:root {
    --color-bg: #f4f1ec;
    --color-surface: #ffffff;
    --color-sidebar: #2c3e50;
    --color-sidebar-hover: #34495e;
    --color-sidebar-active: #1a252f;
    --color-accent: #c17f59;
    --color-accent-dark: #a66a48;
    --color-text: #2d2a26;
    --color-text-muted: #6b6560;
    --color-border: #e3ddd4;
    --sidebar-width: 260px;
    --header-height: 64px;
    --content-max-width: 960px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
    --radius: 10px;
    --transition: 0.25s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

a {
    color: var(--color-accent);
}

a:hover {
    color: var(--color-accent-dark);
}

code {
    padding: 0.15em 0.4em;
    border-radius: 4px;
    background: #ebe6df;
    font-size: 0.9em;
}

/* Layout shell */

.app {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--header-height) 1fr auto;
    grid-template-areas:
        "sidebar header"
        "sidebar main"
        "sidebar footer";
    min-height: 100vh;
}

/* Header */

.site-header {
    grid-area: header;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.menu-toggle:hover {
    background: var(--color-bg);
}

.menu-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-brand-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.site-brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.site-brand-tagline {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.site-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.site-user {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Sidebar */

.sidebar {
    grid-area: sidebar;
    background: var(--color-sidebar);
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.6;
}

.sidebar-close {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0.75rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.nav-link:hover {
    background: var(--color-sidebar-hover);
    color: #fff;
}

.nav-link.is-active {
    background: var(--color-sidebar-active);
    color: #fff;
    border-left: 3px solid var(--color-accent);
    padding-left: calc(1.5rem - 3px);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.85;
    background: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.nav-icon-home {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 10.5L12 3l9 7.5V21a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1v-10.5z'/%3E%3C/svg%3E");
}

.nav-icon-users {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='9' cy='7' r='3'/%3E%3Ccircle cx='17' cy='9' r='2.5'/%3E%3Cpath d='M3 20c0-3 2.5-5 6-5s6 2 6 5M14 20c0-2.2 1.8-4 4-4'/%3E%3C/svg%3E");
}

.nav-icon-calendar {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E");
}

.nav-icon-house {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 10.5L12 3l9 7.5V21a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1v-10.5z'/%3E%3C/svg%3E");
}

.nav-icon-car {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M5 17h14M5 17a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm14 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM3 12l1.5-5h15L21 12M6 12h12'/%3E%3C/svg%3E");
}

.nav-icon-food {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M6 3v8a4 4 0 0 0 8 0V3M6 3H4M6 3h2M14 3h2M14 3v8a4 4 0 0 0 8 0V3M14 3h2'/%3E%3Cpath d='M4 21h16M8 21v-4M16 21v-4'/%3E%3C/svg%3E");
}

.nav-icon-image {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10' r='1.5'/%3E%3Cpath d='M21 16l-5.5-5.5L6 19'/%3E%3C/svg%3E");
}

.nav-icon-mail {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E");
}

.nav-icon-logout {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E");
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-link-logout {
    opacity: 0.9;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 200;
}

.sidebar-overlay.is-visible {
    display: block;
}

/* Main content */

.main {
    grid-area: main;
    padding: 2rem 1.5rem;
}

.main-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.page-header h1 {
    margin: 0 0 1.5rem;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    line-height: 1.2;
}

.page-content > section + section {
    margin-top: 2rem;
}

.lead {
    font-size: 1.15rem;
    color: var(--color-text-muted);
}

.notice {
    padding: 0.85rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.notice-warning {
    background: #fff3cd;
    border: 1px solid #ffe08a;
    color: #664d03;
}

.notice-error {
    background: #fde8e8;
    border: 1px solid #f5c2c2;
    color: #9b1c1c;
}

.error {
    color: #b42318;
}

/* Dashboard */

.dashboard {
    min-width: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.dashboard-grid > *,
.dashboard-sidebar > * {
    min-width: 0;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 100%;
}

.dashboard-widget-birthdays {
    flex: 1;
}

.dashboard-widget-waste.is-today {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px rgba(193, 127, 89, 0.2);
}

.waste-pickup {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-top: 1rem;
    padding: 0.85rem;
    border-radius: var(--radius);
    background: var(--color-bg);
}

.dashboard-widget-waste.is-today .waste-pickup {
    background: #fff6ea;
}

.waste-pickup-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.waste-pickup-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.waste-pickup-date {
    margin: 0.25rem 0 0;
    color: var(--color-text);
    font-weight: 600;
}

.waste-pickup-meta {
    margin: 0.2rem 0 0;
    font-size: 0.88rem;
    color: var(--color-accent-dark);
    font-weight: 600;
}

.waste-pickup-location {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.dashboard-widget {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.35rem 1.5rem 1.5rem;
}

.dashboard-widget-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.dashboard-widget-subtitle {
    margin: 0.35rem 0 0;
    color: var(--color-text-muted);
    font-size: 0.88rem;
}

.dashboard-empty,
.dashboard-note {
    margin: 1rem 0 0;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.dashboard-note {
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: #fff8e6;
    border: 1px solid #f0dfaa;
    color: #7a5b00;
}

.weather-current {
    margin-top: 1.25rem;
}

.weather-current-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.weather-icon {
    font-size: 2.4rem;
    line-height: 1;
}

.weather-temp {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.weather-desc {
    margin: 0.2rem 0 0;
    color: var(--color-text-muted);
}

.weather-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    color: var(--color-text-muted);
    font-size: 0.88rem;
}

.weather-hourly {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
}

.weather-hourly-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.weather-hourly-header h3 {
    margin: 0;
    font-size: 1rem;
}

.weather-hourly-nav {
    display: flex;
    gap: 0.35rem;
}

.weather-hourly-btn {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition), opacity var(--transition);
}

.weather-hourly-btn:hover:not(:disabled) {
    background: var(--color-bg);
}

.weather-hourly-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.weather-hourly-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}

.weather-hourly-scroll::-webkit-scrollbar {
    display: none;
}

.weather-hourly-track {
    display: flex;
    gap: 0.65rem;
    min-width: min-content;
    padding-bottom: 0.15rem;
}

.weather-hourly-item {
    flex: 0 0 5.1rem;
    padding: 0.65rem 0.45rem;
    border-radius: 8px;
    background: var(--color-bg);
    text-align: center;
}

.weather-hourly-time {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.weather-hourly-item .weather-icon {
    display: block;
    margin: 0.35rem auto 0;
    font-size: 1.35rem;
}

.weather-hourly-temp {
    margin: 0.25rem 0 0;
    font-size: 0.92rem;
    font-weight: 700;
}

.weather-hourly-rain {
    margin: 0.15rem 0 0;
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

.weather-forecast {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
}

.weather-forecast h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
}

.weather-forecast-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    min-width: 0;
}

.weather-forecast-day {
    padding: 0.85rem;
    border-radius: 8px;
    background: var(--color-bg);
    text-align: center;
    min-width: 0;
}

.weather-forecast-label {
    margin: 0;
    font-weight: 600;
    font-size: 0.9rem;
}

.weather-forecast-desc {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}

.weather-forecast-temps {
    margin: 0.35rem 0 0;
    font-weight: 600;
}

.weather-forecast-meta {
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    align-items: center;
}

.weather-forecast-rain {
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    line-height: 1.25;
}

.birthday-list {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.birthday-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 1rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--color-border);
}

.birthday-item:first-child {
    border-top: none;
    padding-top: 0;
}

.birthday-item.is-today {
    padding: 0.85rem;
    border-top: none;
    border-radius: 8px;
    background: #fff6ea;
    border: 1px solid #f0d2b8;
}

.birthday-item.is-today + .birthday-item {
    border-top: none;
}

.birthday-name {
    margin: 0;
    font-weight: 600;
}

.birthday-date {
    margin: 0.15rem 0 0;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

.birthday-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    text-align: right;
}

.birthday-age {
    font-weight: 600;
    color: var(--color-accent);
}

.birthday-countdown {
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.birthday-turns {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-accent-dark);
    font-weight: 600;
}

.dashboard-quicklinks-title {
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

/* Dashboard today calendars */

.dashboard-house-tasks {
    margin-bottom: 2rem;
}

.dashboard-today {
    margin-bottom: 2rem;
}

.dashboard-today-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-today-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.today-column {
    min-height: 180px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-top: 4px solid var(--column-color, var(--color-accent));
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
}

.today-column-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 0.9rem 0.7rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.today-column-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: var(--column-color, var(--color-accent));
    flex-shrink: 0;
}

.today-column-header h3 {
    margin: 0;
    font-size: 0.95rem;
}

.today-column-empty {
    margin: auto;
    padding: 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.today-column-events {
    list-style: none;
    margin: 0;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.today-event {
    padding: 0.65rem 0.7rem;
    border-radius: 8px;
    background: var(--color-surface);
    border-left: 3px solid var(--column-color, var(--color-accent));
}

.today-event-time {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.today-event-title {
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.today-event-location {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

@media (max-width: 1100px) {
    .dashboard-today-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .dashboard-today-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-today-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-today-header .btn {
        align-self: stretch;
        text-align: center;
    }

    .dashboard-grid {
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .dashboard-sidebar {
        gap: 1rem;
    }

    .dashboard-widget {
        padding: 1rem 1rem 1.15rem;
    }

    .dashboard-widget-header h2 {
        font-size: 1.05rem;
    }

    .dashboard-widget-subtitle {
        overflow-wrap: anywhere;
    }

    .dashboard-house-tasks,
    .dashboard-today {
        margin-bottom: 1.25rem;
    }

    .house-tasks-widget {
        padding: 1rem;
    }

    .house-tasks-widget-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .house-tasks-widget-header .btn {
        align-self: stretch;
        text-align: center;
    }

    .house-task-form {
        gap: 0.65rem;
        padding: 0.75rem;
    }

    .house-task-check {
        width: 2.75rem;
        height: 2.75rem;
    }

    .house-task-meta {
        font-size: 0.8rem;
    }

    .weather-current-main {
        gap: 0.75rem;
    }

    .weather-temp {
        font-size: 1.75rem;
    }

    .weather-icon {
        font-size: 2rem;
    }

    .weather-meta {
        gap: 0.35rem 0.75rem;
        font-size: 0.82rem;
    }

    .weather-hourly-scroll {
        margin-inline: -1rem;
        padding-inline: 1rem;
    }

    .birthday-item {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .birthday-meta {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 0.35rem 0.75rem;
        text-align: left;
    }

    .waste-pickup {
        padding: 0.75rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .page-header h1 {
        margin-bottom: 1rem;
    }

    code {
        overflow-wrap: anywhere;
    }
}

/* Week calendar */

.calendar-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.calendar-nav-label-short {
    display: none;
}

.calendar-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.calendar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.calendar-range {
    margin: 0;
    font-weight: 600;
    color: var(--color-text-muted);
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    font: inherit;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: opacity var(--transition), background var(--transition), border-color var(--transition);
}

.calendar-legend-item:hover {
    background: var(--color-bg);
}

.calendar-legend-item.is-active {
    color: var(--color-text);
    border-color: transparent;
    background: var(--color-bg);
}

.calendar-legend-item:not(.is-active) {
    opacity: 0.55;
}

.calendar-legend-item:not(.is-active) .calendar-legend-dot {
    background: transparent !important;
    box-shadow: inset 0 0 0 2px var(--legend-color, currentColor);
}

.calendar-legend-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.week-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.85rem;
    min-width: 0;
}

.week-day {
    min-width: 0;
    min-height: 280px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.week-day.is-today {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px rgba(193, 127, 89, 0.25);
}

.week-day-header {
    padding: 0.85rem 0.85rem 0.7rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    border-radius: var(--radius) var(--radius) 0 0;
}

.week-day.is-today .week-day-header {
    background: #fff6ea;
}

.week-day-name {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.week-day-date {
    margin: 0.15rem 0 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.week-day-empty {
    margin: auto;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-align: center;
}

.week-day-events {
    list-style: none;
    margin: 0;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.week-day-events.is-hidden,
.week-day-empty.is-hidden,
.week-event.is-calendar-hidden {
    display: none;
}

.week-event {
    padding: 0.65rem 0.7rem 0.65rem 0.8rem;
    border-radius: 8px;
    background: #faf8f5;
    border-left: 4px solid var(--event-color, var(--color-accent));
}

.week-event-time {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.week-event-title {
    margin: 0.2rem 0 0;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.week-event-person {
    margin: 0.25rem 0 0;
    font-size: 0.78rem;
    color: var(--event-color, var(--color-accent));
    font-weight: 600;
}

.week-event-location {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .calendar-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }

    .calendar-range {
        order: -1;
        text-align: center;
        font-size: 1.05rem;
    }

    .calendar-nav {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        gap: 0.5rem;
        width: 100%;
    }

    .calendar-nav .btn:first-child {
        justify-self: start;
    }

    .calendar-nav .btn:nth-child(2) {
        justify-self: center;
    }

    .calendar-nav .btn:last-child {
        justify-self: end;
    }

    .week-calendar {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .week-day {
        min-height: auto;
    }

    .week-day-header {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .week-day-name {
        text-transform: none;
        letter-spacing: 0;
        font-size: 0.95rem;
        color: var(--color-text);
    }

    .week-day-date {
        margin: 0;
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--color-text-muted);
    }

    .week-day-empty {
        margin: 0;
        padding: 0.85rem 1rem;
    }

    .week-day-events {
        padding: 0.65rem 0.85rem 0.85rem;
    }
}

@media (max-width: 640px) {
    .calendar-nav-label-full {
        display: none;
    }

    .calendar-nav-label-short {
        display: inline;
    }

    .calendar-nav .btn-sm {
        min-width: 2.75rem;
        padding: 0.55rem 0.75rem;
        text-align: center;
    }

    .calendar-legend {
        gap: 0.45rem;
    }

    .calendar-legend-item {
        font-size: 0.85rem;
        padding: 0.4rem 0.65rem;
    }
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .weather-forecast-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .weather-forecast-day {
        display: grid;
        grid-template-columns: 2.25rem minmax(0, 1fr) auto;
        grid-template-areas:
            "icon label temps"
            "icon desc  meta";
        gap: 0.1rem 0.65rem;
        align-items: center;
        padding: 0.7rem 0.85rem;
        text-align: left;
    }

    .weather-forecast-label {
        grid-area: label;
        margin: 0;
        font-size: 0.88rem;
    }

    .weather-forecast-day .weather-icon {
        grid-area: icon;
        align-self: center;
        font-size: 1.65rem;
        line-height: 1;
    }

    .weather-forecast-desc {
        grid-area: desc;
        margin: 0;
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .weather-forecast-temps {
        grid-area: temps;
        margin: 0;
        font-size: 0.88rem;
        font-weight: 600;
        text-align: right;
        white-space: nowrap;
    }

    .weather-forecast-meta {
        grid-area: meta;
        align-items: flex-end;
        margin: 0;
    }

    .weather-forecast-rain {
        font-size: 0.76rem;
        white-space: nowrap;
    }

    .dashboard-sidebar {
        flex-direction: column;
    }
}

/* Cards */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.card {
    padding: 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.card p {
    margin: 0 0 1rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.card-link {
    font-weight: 600;
    text-decoration: none;
}

.card-link:hover {
    text-decoration: underline;
}

/* Content blocks */

.content-block h2 {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
}

.styled-list {
    padding-left: 1.25rem;
}

.styled-list li + li {
    margin-top: 0.35rem;
}

/* Persona profiles */

.persona-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .persona-grid {
        grid-template-columns: 1fr;
    }
}

.persona-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.persona-card-link {
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.persona-card-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
}

.persona-more {
    margin: 0.85rem 0 0;
    padding-top: 0.85rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-accent);
}

.persona-photo {
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #d4c4b0, #b8a898);
}

.persona-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.persona-photo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.92);
    background: linear-gradient(135deg, #8aa0b0, #5f7384);
}

.persona-body {
    padding: 1.25rem 1.35rem 1.35rem;
}

.persona-header h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.25;
}

.persona-role {
    margin: 0.35rem 0 0;
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.9rem;
}

.persona-details {
    margin: 1rem 0 0;
}

.persona-detail {
    display: grid;
    grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
    gap: 0.35rem 1rem;
    padding: 0.65rem 0;
    border-top: 1px solid var(--color-border);
}

.persona-detail:first-child {
    border-top: none;
    padding-top: 0;
}

.persona-detail dt {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.persona-detail dd {
    margin: 0;
    font-size: 0.92rem;
    word-break: break-word;
}

.persona-allergies {
    margin: 0;
    padding-left: 1.15rem;
}

.persona-allergies li + li {
    margin-top: 0.25rem;
}

.persona-muted {
    color: var(--color-text-muted);
    font-style: italic;
}

/* Person detail page */

.person-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.person-back-link {
    font-weight: 600;
    text-decoration: none;
}

.person-back-link:hover {
    text-decoration: underline;
}

.person-hero {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.person-hero-photo {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(135deg, #d4c4b0, #b8a898);
}

.person-hero-photo img,
.person-hero-photo .persona-photo-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person-hero-meta {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

.person-hero-meta li + li {
    margin-top: 0.35rem;
}

.person-section h2 {
    margin: 0 0 1rem;
}

.vaccination-table-wrap {
    overflow-x: auto;
}

.vaccination-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.vaccination-table th,
.vaccination-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.vaccination-table th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    background: var(--color-bg);
}

.vaccination-table tbody tr:hover {
    background: #faf8f5;
}

.vaccination-status {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.vaccination-status-ok {
    background: #e8f5ea;
    color: #1f6b2f;
}

.vaccination-status-soon {
    background: #fff3cd;
    color: #7a5b00;
}

.vaccination-status-overdue {
    background: #fde8e8;
    color: #9b1c1c;
}

.vaccination-status-none {
    background: #eef1f4;
    color: #5f7384;
}

@media (max-width: 640px) {
    .person-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .persona-detail {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }
}

/* Gallery placeholder */

.gallery-placeholder {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.gallery-item {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #d4c4b0, #b8a898);
}

.gallery-item-1 { background: linear-gradient(135deg, #c9b8a8, #a8927d); }
.gallery-item-2 { background: linear-gradient(135deg, #b5c4b1, #8fa889); }
.gallery-item-3 { background: linear-gradient(135deg, #b8c9d4, #8aa0b0); }
.gallery-item-4 { background: linear-gradient(135deg, #d4c0b8, #b09588); }
.gallery-item-5 { background: linear-gradient(135deg, #c4b8d4, #9a88b0); }
.gallery-item-6 { background: linear-gradient(135deg, #d4d0b8, #b0aa88); }

/* Contact form */

.contact-form {
    max-width: 520px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font: inherit;
    background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(193, 127, 89, 0.2);
}

.btn {
    display: inline-block;
    padding: 0.7rem 1.25rem;
    border: none;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-accent-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    text-decoration: none;
    border: 1px solid var(--color-border);
}

.btn-ghost:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Login page */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-shell {
    width: 100%;
    max-width: 420px;
}

.login-card {
    padding: 2rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.login-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.login-header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
}

.login-header p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.login-form {
    margin-top: 1rem;
}

/* Footer */

.site-footer {
    grid-area: footer;
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}

.site-footer p {
    margin: 0;
}

/* Mobile: collapsed sidebar with burger menu */

@media (max-width: 768px) {
    .app {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "footer";
    }

    .menu-toggle {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(var(--sidebar-width), 85vw);
        height: 100vh;
        z-index: 300;
        transform: translateX(-100%);
        transition: transform var(--transition);
        box-shadow: var(--shadow-md);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .main {
        padding: 1rem 0.85rem;
    }

    .main-inner {
        min-width: 0;
    }

    .page-content {
        min-width: 0;
    }

    body.menu-open {
        overflow: hidden;
    }

    body {
        overflow-x: clip;
    }

    .site-user {
        display: none;
    }

    .site-header {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }

    .site-brand {
        min-width: 0;
        flex: 1;
    }

    .site-brand-link {
        min-width: 0;
    }

    .site-brand-title {
        font-size: 1rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .site-brand-tagline {
        display: block;
        font-size: 0.75rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .site-header-actions {
        flex-shrink: 0;
    }

    .site-header-actions .btn-sm {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
    }
}

@media (min-width: 769px) {
    .menu-toggle {
        display: none !important;
    }
}

/* House section */

.house-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.house-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.house-nav-link {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.house-nav-link:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.house-nav-link.is-active {
    background: var(--color-bg);
    border-color: var(--color-accent);
    color: var(--color-accent-dark);
}

.house-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.house-stat-card {
    padding: 1.35rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.house-stat-card.is-positive {
    border-color: #b8dcc0;
    background: #f6fbf7;
}

.house-stat-card.is-negative {
    border-color: #f0c2c2;
    background: #fff8f8;
}

.house-stat-card h2 {
    margin: 0;
    font-size: 1rem;
}

.house-stat-value {
    margin: 0.5rem 0 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.house-stat-meta {
    margin: 0.5rem 0 0.85rem;
    color: var(--color-text-muted);
    font-size: 0.88rem;
}

.house-quicklinks-title {
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.house-finance-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
}

.house-finance-summary.is-positive {
    background: #f6fbf7;
    border-color: #b8dcc0;
}

.house-finance-summary.is-negative {
    background: #fff8f8;
    border-color: #f0c2c2;
}

.house-finance-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.house-finance-summary-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.house-finance-summary-item strong {
    font-size: 1.15rem;
}

.house-finance-summary-balance strong {
    font-size: 1.35rem;
}

.house-finance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.house-income-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.house-income-block {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    overflow: hidden;
}

.house-income-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.house-income-header h3 {
    margin: 0;
    font-size: 1rem;
}

.house-income-totals {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.house-income-totals strong {
    color: #1f6b2f;
    font-size: 1rem;
}

.house-income-deduct {
    color: #9b1c1c;
}

.house-income-empty {
    margin: 0;
    padding: 0.85rem 1.1rem;
    font-size: 0.88rem;
    color: var(--color-text-muted);
    font-style: italic;
}

.house-income-table th,
.house-income-table td {
    background: transparent;
}

.house-income-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.1rem;
    border-top: 1px solid var(--color-border);
    background: #f6fbf7;
    font-size: 0.9rem;
}

.house-income-footer strong {
    color: #1f6b2f;
}

.house-income-grand-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    background: #f6fbf7;
    border: 1px solid #b8dcc0;
    font-weight: 600;
}

.house-income-grand-total strong {
    color: #1f6b2f;
    font-size: 1.1rem;
}

.house-table-wrap {
    overflow-x: auto;
}

.house-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.house-table th,
.house-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.house-table th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    background: var(--color-bg);
}

.house-table tfoot th,
.house-table tfoot td {
    font-weight: 700;
    border-top: 2px solid var(--color-border);
    background: var(--color-bg);
}

.house-table-amount {
    text-align: right;
    white-space: nowrap;
}

.house-amount-income {
    color: #1f6b2f;
}

.house-amount-expense {
    color: #9b1c1c;
}

.house-maintenance-cell {
    min-width: 180px;
    max-width: 280px;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

.house-devices-table td a {
    font-weight: 600;
}

.house-tasks-widget {
    padding: 1.25rem 1.35rem 1.35rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.house-tasks-widget-compact {
    margin-bottom: 0.5rem;
}

.house-tasks-widget-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.house-tasks-widget-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.house-task-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.house-task-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
}

.house-task-item.is-completed {
    opacity: 0.72;
    background: #f6fbf7;
    border-color: #b8dcc0;
}

.house-task-form {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 0.95rem;
    margin: 0;
    min-width: 0;
}

.house-task-check {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: transparent;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.house-task-check:hover {
    border-color: var(--color-accent);
}

.house-task-item.is-completed .house-task-check {
    background: #1f6b2f;
    border-color: #1f6b2f;
    color: #fff;
}

.house-task-body {
    min-width: 0;
    flex: 1;
}

.house-task-label {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.house-task-item.is-completed .house-task-label {
    text-decoration: line-through;
    color: var(--color-text-muted);
}

.house-task-meta {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}

.house-tasks-schedule h2 {
    margin-top: 0;
}

@media (max-width: 900px) {
    .house-dashboard-grid,
    .house-finance-grid,
    .house-finance-summary {
        grid-template-columns: 1fr;
    }
}

/* Vehicles */

.vehicles-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.vehicle-card {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    padding: 1.35rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.vehicle-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.vehicle-card-header h2 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.25;
}

.vehicle-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.92rem;
    color: var(--color-text-muted);
}

.vehicle-plate {
    margin: 0;
    padding: 0.35rem 0.65rem;
    border: 2px solid var(--color-text);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    white-space: nowrap;
    flex-shrink: 0;
}

.vehicle-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    margin: 0;
}

.vehicle-detail {
    min-width: 0;
}

.vehicle-detail dt {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.vehicle-detail dd {
    margin: 0.15rem 0 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.vehicle-detail-full {
    grid-column: 1 / -1;
}

.vehicle-status {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.vehicle-status-ok {
    background: #e8f5ea;
    color: #1f6b2f;
}

.vehicle-status-soon {
    background: #fff3cd;
    color: #7a5b00;
}

.vehicle-status-overdue {
    background: #fde8e8;
    color: #9b1c1c;
}

.vehicle-service h3,
.vehicle-tires h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.vehicle-service-empty {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.vehicle-tire-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.vehicle-tire-set {
    padding: 0.85rem;
    border-radius: var(--radius);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    min-width: 0;
}

.vehicle-tire-set-winter {
    border-top: 3px solid #4a7fb8;
}

.vehicle-tire-set-summer {
    border-top: 3px solid #d4a017;
}

.vehicle-tire-set h4 {
    margin: 0 0 0.65rem;
    font-size: 0.92rem;
}

.vehicle-tire-empty {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.vehicle-tire-meta {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0;
}

.vehicle-tire-meta dt {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.vehicle-tire-meta dd {
    margin: 0.1rem 0 0;
    font-weight: 600;
    font-size: 0.92rem;
}

.vehicle-tire-age {
    color: var(--color-accent-dark);
}

.vehicle-notes {
    margin: 0;
    padding-top: 0.85rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

@media (max-width: 900px) {
    .vehicle-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .vehicle-card {
        padding: 1rem;
    }

    .vehicle-card-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .vehicle-plate {
        align-self: flex-start;
    }

    .vehicle-details {
        grid-template-columns: 1fr;
    }

    .vehicle-service-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vehicle-service-details .vehicle-detail:only-child {
        grid-column: 1 / -1;
    }

    .vehicle-tire-grid {
        grid-template-columns: 1fr;
    }
}

/* Meal planning */

.meals-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.meals-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.meals-nav-link {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.meals-nav-link:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.meals-nav-link.is-active {
    background: var(--color-bg);
    border-color: var(--color-accent);
    color: var(--color-accent-dark);
}

.meals-section-header,
.meals-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.meals-section-subtitle,
.meals-week-range {
    margin: 0.35rem 0 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.meals-section h2,
.meals-page-title {
    margin: 0;
    font-size: 1.15rem;
}

.meals-nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.meals-week-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.meals-day-card {
    padding: 0.85rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.meals-day-card.is-today {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px rgba(193, 127, 89, 0.25);
}

.meals-day-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--color-border);
}

.meals-day-card-header h3 {
    margin: 0;
    font-size: 0.95rem;
}

.meals-day-date {
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.meals-day-meals {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.meals-day-meals li {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 0.5rem;
    font-size: 0.88rem;
}

.meals-slot-label {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.meals-empty-slot {
    color: var(--color-text-muted);
}

.meals-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.meals-stat-card {
    padding: 1.35rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.meals-stat-card h2 {
    margin: 0;
    font-size: 1rem;
}

.meals-stat-value {
    margin: 0.5rem 0 0;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.meals-stat-meta {
    margin: 0.35rem 0 0.85rem;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

.meals-recipe-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.meals-recipe-grid-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.meals-recipe-card {
    padding: 1.15rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.meals-recipe-card.is-favorite {
    border-color: #f0d2b8;
    background: #fffaf6;
}

.meals-recipe-card h2,
.meals-recipe-card h3 {
    margin: 0;
    font-size: 1.05rem;
}

.meals-recipe-card h2 a,
.meals-recipe-card h3 a {
    color: inherit;
    text-decoration: none;
}

.meals-recipe-card h2 a:hover,
.meals-recipe-card h3 a:hover {
    color: var(--color-accent-dark);
}

.meals-recipe-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.meals-favorite-badge {
    flex-shrink: 0;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #fff3cd;
    color: #7a5b00;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.meals-recipe-desc {
    margin: 0.65rem 0 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.meals-recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.meals-recipe-meta-inline {
    margin-top: 0.5rem;
}

.meals-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.75rem;
}

.meals-tag {
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.meals-recipe-note {
    margin: 0.65rem 0 0;
    font-size: 0.88rem;
    color: var(--color-accent-dark);
    font-weight: 600;
}

.meals-table-wrap {
    overflow-x: auto;
}

.meals-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.meals-table th,
.meals-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.meals-table thead th {
    background: var(--color-bg);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.meals-table tbody tr:last-child td,
.meals-table tbody tr:last-child th {
    border-bottom: none;
}

.meals-table tbody tr.is-today {
    background: #fffaf6;
}

.meals-day-name {
    display: block;
    font-weight: 600;
}

.meals-table tbody th .meals-day-date {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    font-weight: 400;
}

.meals-shopping-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.meals-shopping-item {
    padding: 0.75rem 0.9rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.meals-shopping-label {
    font-weight: 600;
    font-size: 0.92rem;
}

.meals-recipe-detail {
    padding: 1.35rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.meals-recipe-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.meals-recipe-detail-header h2 {
    margin: 0;
}

.meals-recipe-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.meals-ingredient-list {
    margin: 0;
}

.meals-instructions {
    line-height: 1.6;
}

.meals-back-link {
    margin: 0;
}

.meals-hint {
    margin: 0;
    font-size: 0.88rem;
}

@media (max-width: 900px) {
    .meals-week-preview,
    .meals-dashboard-grid,
    .meals-recipe-grid,
    .meals-recipe-grid-compact,
    .meals-recipe-detail-grid,
    .meals-shopping-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .meals-section-header,
    .meals-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .meals-day-meals li {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }
}
