* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f8f7f4;
    color: #222;
}

button {
    font-family: inherit;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* =========================
   WELCOME SCREEN
========================= */

.screen {
    min-height: 100vh;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.welcome-screen h1 {
    font-size: 48px;
    margin: 0 0 12px;
}

.tagline {
    font-size: 22px;
    color: #555;
    margin: 0 0 40px;
}

.primary-button,
.secondary-button {
    width: 280px;
    padding: 15px;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
}

.primary-button {
    border: none;
    background: #222;
    color: white;
    margin-bottom: 14px;
}

.secondary-button {
    border: 1px solid #ccc;
    background: white;
    color: #222;
}

.usage-choice-button {
    display: flex;
    width: 100%;
    min-height: 92px;
    margin: 0 0 14px;
    padding: 18px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    text-align: left;
}

.usage-choice-button span {
    font-size: 17px;
}

.usage-choice-button small {
    font-size: 14px;
    font-weight: 400;
}


/* =========================
   ACCOUNT SCREEN
========================= */

.account-screen {
    max-width: 480px;
    margin: 0 auto;
    padding: 60px 24px;
}

.account-screen h1 {
    text-align: center;
    margin-bottom: 50px;
}

.account-screen h2 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 40px;
}

.account-screen label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.account-screen input {
    width: 100%;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 24px;
}

.signin-question {
    font-weight: 600;
    margin-bottom: 12px;
}

.signin-options {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.method-button {
    flex: 1;
    padding: 13px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background: white;
    font-size: 15px;
}

.method-button.active {
    background: #222;
    color: white;
}

.account-screen .primary-button {
    width: 100%;
}

.back-button {
    display: block;
    margin: 20px auto 0;
    border: none;
    background: none;
    color: #555;
}

.auth-status {
    margin: -8px 0 18px;
    color: #a33b2b;
    font-size: 14px;
    line-height: 1.4;
}


/* =========================
   GROUP HOME
========================= */

/* =========================
   GROUP HOME
========================= */

.group-home {
    min-height: 100vh;
    background: #f8f7f4;
    padding-left: 240px;
    padding-bottom: 30px;
}


/* =========================
   DESKTOP SIDEBAR
========================= */

.bottom-nav {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;

    padding: 110px 20px 30px;

    background: white;
    border-right: 1px solid #ddd;
}

.nav-item {
    width: 100%;
    border: none;
    background: none;

    display: flex;
    align-items: center;
    gap: 14px;

    padding: 14px 16px;
    margin-bottom: 6px;

    border-radius: 10px;

    color: #666;
    font-size: 15px;
    text-align: left;
}

.nav-item span {
    font-size: 20px;
}

.nav-item small {
    font-size: 15px;
}

.nav-item.active {
    background: #f1f0ed;
    color: #222;
    font-weight: 600;
}


/* =========================
   TOP BAR
========================= */

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 20px 40px;

    background: white;
    border-bottom: 1px solid #eee;
}

.app-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.group-selector {
    max-width: 240px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    padding: 6px 30px 6px 8px;

    font-size: 16px;
    font-weight: 600;
}

.top-actions {
    display: flex;
    gap: 8px;
}

.icon-button {
    width: 42px;
    height: 42px;

    border: none;
    border-radius: 50%;

    background: #f3f2ef;
    font-size: 18px;
}


/* =========================
   MAIN CONTENT
========================= */

.greeting {
    max-width: 1100px;
    margin: 0 auto;
    padding: 45px 40px 20px;
}

.greeting h2 {
    margin: 0 0 8px;
    font-size: 32px;
}

.greeting p {
    margin: 0;
    color: #666;
}


/* =========================
   MEALS
========================= */

.meals-section,
.attention-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 40px;
}

.meals-section h3,
.attention-section h3 {
    font-size: 20px;
    margin: 0 0 16px;
}


/* Meal cards */

.meal-card {
    display: flex;
    align-items: center;
    gap: 18px;

    background: white;

    border-radius: 16px;
    padding: 20px;

    margin-bottom: 14px;

    border: 1px solid #eee;
}

.meal-icon {
    width: 54px;
    height: 54px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #f3f2ef;
    border-radius: 14px;

    font-size: 27px;
}

.meal-info {
    flex: 1;
}

.meal-type {
    display: block;
    font-size: 13px;
    color: #777;
    margin-bottom: 4px;
}

.meal-info strong {
    display: block;
    font-size: 18px;
}

.meal-info small {
    display: block;
    margin-top: 5px;
    color: #777;
}

.small-action {
    border: none;
    background: #222;
    color: white;

    padding: 10px 18px;

    border-radius: 9px;

    font-weight: 600;
}


/* =========================
   ATTENTION
========================= */

.attention-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;

    background: white;

    border-radius: 14px;
    padding: 18px;

    margin-bottom: 12px;

    border: 1px solid #eee;
}

.attention-card span {
    font-size: 22px;
}

.attention-card p {
    margin: 0;
    line-height: 1.4;
    color: #555;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 700px) {

    .group-home {
        padding-left: 0;
        padding-bottom: 80px;
    }

    .bottom-nav {
        top: auto;
        left: 0;
        bottom: 0;

        width: 100%;
        height: 70px;

        padding: 8px 4px;

        flex-direction: row;
        justify-content: space-around;

        border-right: none;
        border-top: 1px solid #ddd;
    }

    .nav-item {
        width: auto;
        margin: 0;
        padding: 6px;

        flex-direction: column;
        justify-content: center;
        gap: 2px;

        border-radius: 8px;

        text-align: center;
    }

    .nav-item span {
        font-size: 20px;
    }

    .nav-item small {
        font-size: 10px;
    }

    .top-bar {
        padding: 16px 20px;
    }

    .greeting {
        padding: 28px 20px 12px;
    }

    .greeting h2 {
        font-size: 25px;
    }

    .meals-section,
    .attention-section {
        padding: 18px 20px;
    }

    .meal-card {
        padding: 16px;
    }
}

/* =========================
   MEMBER PROFILES — V2
========================= */

.member-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.member-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0 24px;
}

.profile-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
}

.profile-header h2,
.profile-header p {
    margin: 0;
}

.profile-header p {
    color: #777;
    margin-top: 4px;
}

.profile-section {
    margin: 20px 0;
}

.profile-section h3 {
    margin-bottom: 14px;
}

.profile-section select,
.profile-section textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    margin: 6px 0 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font: inherit;
    background: white;
}

.profile-section textarea {
    resize: vertical;
}

.meal-participation {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.meal-participation label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: normal;
}

.meal-participation input {
    width: auto;
    padding: 0;
    margin: 0;
    flex: 0 0 auto;
}

.profile-note {
    color: #777;
    font-size: 14px;
}

.save-status {
    margin: 14px 0;
    color: #2f7d32;
    font-weight: 600;
    text-align: center;
}

.invite-section,
.pending-invitations-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #e5e3df;
}

.invite-section h3,
.pending-invitations-section h3 {
    margin-top: 0;
}

.invite-section .secondary-button,
.pending-invitation-card .secondary-button {
    width: 100%;
    margin-bottom: 14px;
}

.pending-invitation-row {
    display: grid;
    gap: 4px;
    padding: 14px 0;
    border-bottom: 1px solid #e5e3df;
}

.pending-invitation-row span,
.pending-invitation-row small {
    color: #666;
}

.pending-invitation-card {
    padding: 20px;
    background: white;
    border: 1px solid #e5e3df;
    border-radius: 12px;
}

.notification-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: -8px;
    margin-top: -20px;
    border-radius: 50%;
    background: #c0392b;
    color: white;
    font-size: 11px;
    font-weight: 700;
    vertical-align: top;
}

#save-profile-button:disabled {
    opacity: 0.5;
    cursor: default;
}

/* =========================
   FAMILY MANAGEMENT MVP
========================= */

.family-screen {
    display: flex;
    min-height: 100vh;
    background: #fffdf9;
    color: var(--dashboard-ink);
    font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

.family-page-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    display: flex;
    width: 246px;
    flex-direction: column;
    padding: 24px 16px 20px;
    border-right: 1px solid #e8ece4;
    background: #fffefa;
}

.family-page-content {
    width: calc(100% - 246px);
    margin-left: 246px;
    padding-bottom: 60px;
}

.family-page-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 72px;
    padding: 0 clamp(24px, 4vw, 58px);
    border-bottom: 1px solid #e8ece4;
    color: var(--dashboard-green-dark);
    font-size: 12px;
    font-weight: 800;
    gap: 24px;
}

.family-page-topbar > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid #dfe8dc;
    border-radius: 9px;
    background: #f5f9f2;
    white-space: nowrap;
}

.family-page-topbar > span:first-child::after {
    content: "⌄";
    color: var(--dashboard-orange);
}

.family-page-topbar .preferences-topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
}

.family-page-header,
.family-page-section {
    width: min(1120px, calc(100% - 72px));
    margin-inline: auto;
}

.family-page-header { padding: 54px 0 30px; }
.family-page-header h1 { margin: 0; color: var(--dashboard-green-dark); font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.04em; }
.family-page-header h1 span { color: var(--dashboard-orange); }
.family-page-header > p:last-child { max-width: 620px; margin: 12px 0 0; color: var(--dashboard-muted); line-height: 1.55; }

.family-page-section {
    margin-bottom: 20px;
    padding: 24px;
    border: 1px solid var(--dashboard-line);
    border-radius: 17px;
    background: white;
    box-shadow: 0 10px 28px rgba(7, 86, 61, 0.05);
}

.family-section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.family-section-heading h2 { margin: 0; color: var(--dashboard-green-dark); font-size: 22px; }
.family-add-button { width: auto; margin: 0; padding: 10px 14px; background: var(--dashboard-green); font-size: 12px; }

.family-member-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.family-member-card { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; box-sizing: border-box; padding: 14px; border: 1px solid #e5ebe2; border-radius: 12px; background: #fbfdf9; color: var(--dashboard-ink); text-align: left; transition: border-color 160ms ease, transform 160ms ease; }
.family-member-card:hover { border-color: #82b07d; transform: translateY(-2px); }
.family-card-avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; background: #dcecdc; color: var(--dashboard-green-dark); font-weight: 800; }
.family-member-card:nth-child(2n) .family-card-avatar { background: #ffe3ce; }
.family-member-card:nth-child(3n) .family-card-avatar { background: #dceafa; }
.family-card-main { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.family-card-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.family-card-main span { color: var(--dashboard-green); font-size: 12px; font-weight: 800; }
.family-card-main small { color: var(--dashboard-muted); font-size: 11px; }
.family-card-arrow { margin-left: auto; color: var(--dashboard-orange); font-size: 20px; }
.family-member-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.family-member-actions .text-button { padding: 6px; font-size: 11px; }
.member-remove-button { color: #a33b2b; }
.family-lifecycle-section > h2 { margin: 0; color: var(--dashboard-green-dark); font-size: 22px; }
.family-lifecycle-section > p:not(.eyebrow), .family-delete-area > p:not(.eyebrow) { color: var(--dashboard-muted); font-size: 13px; line-height: 1.5; }
.family-lifecycle-section > .secondary-button { width: auto; min-height: 44px; margin: 2px 0 0; padding: 10px 14px; font-size: 12px; }
.family-delete-area { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--dashboard-line); }
.family-delete-area h3 { margin: 0; color: #a33b2b; font-size: 18px; }
.danger-button { width: auto; min-height: 44px; margin: 2px 0 0; padding: 10px 14px; border: 0; border-radius: 9px; background: #a33b2b; color: white; font: inherit; font-size: 12px; font-weight: 800; }

.family-invite-panel { background: #fff6e7; }
.family-invite-panel { width: min(760px, calc(100% - 72px)); margin: 0 auto 20px; }
.family-invite-panel label { display: block; margin: 12px 0 6px; font-size: 12px; font-weight: 800; }
.family-invite-panel input { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid #e1d6c5; border-radius: 9px; font: inherit; background: white; }
.family-invite-panel .save-status a { overflow-wrap: anywhere; }
.family-invite-panel .invitation-copy-button { display: block; width: fit-content; margin: 10px auto 0; padding: 8px 12px; font-size: 12px; }
.family-invite-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.error-detail { display: block; margin-top: 6px; color: #a33b2b; font-size: 11px; }
.family-invite-actions .primary-button, .family-invite-actions .secondary-button { width: auto; margin: 0; padding: 11px 14px; font-size: 12px; }
.family-page-content > .back-button { margin: 0 auto; }

.personal-details-section h4 { margin: 24px 0 6px; color: var(--dashboard-green-dark); font-size: 14px; }
.profile-detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.profile-detail-grid input, .profile-detail-grid select, .personal-details-section > textarea { width: 100%; box-sizing: border-box; padding: 11px; border: 1px solid #dfe5dc; border-radius: 8px; font: inherit; background: white; }
.profile-detail-grid label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 800; }
.personal-age { display: block; margin-top: 5px; color: var(--dashboard-muted); font-size: 11px; }
.personal-details-section > textarea { margin-top: 8px; resize: vertical; }
.personal-details-section .primary-button { width: auto; margin: 14px 0 0; padding: 10px 14px; font-size: 12px; background: var(--dashboard-green); }
.food-profile-summary .text-button { padding: 0; }

#member-profile-screen {
    max-width: none;
    min-height: 100vh;
    padding: 42px clamp(18px, 4vw, 58px) 70px;
    background: #fffdf9;
    color: var(--dashboard-ink);
    font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

#member-profile-screen > h1,
#member-profile-screen > .eyebrow,
#member-profile-screen > .profile-header,
#member-profile-screen > .profile-section,
#member-profile-screen > .profile-note,
#member-profile-screen > .save-status,
#member-profile-screen > .primary-button,
#member-profile-screen > .back-button:not(.profile-top-back) {
    width: min(940px, 100%);
    margin-left: auto;
    margin-right: auto;
}

#member-profile-screen > h1 { margin-top: 0; color: var(--dashboard-green-dark); font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.04em; }
.profile-top-back { width: min(940px, 100%); margin: 0 auto 28px; padding: 0; text-align: left; color: var(--dashboard-green); font-weight: 800; }
#member-profile-screen .profile-header { display: flex; gap: 16px; align-items: center; margin-top: 18px; margin-bottom: 20px; padding: 20px; border: 1px solid var(--dashboard-line); border-radius: 16px; background: white; box-shadow: 0 10px 28px rgba(7, 86, 61, 0.05); }
#member-profile-screen .profile-header h2 { color: var(--dashboard-green-dark); font-size: 24px; }
#member-profile-screen .profile-header p { color: var(--dashboard-green); font-weight: 800; }
#member-profile-screen .profile-section { margin-top: 16px; padding: 24px; border: 1px solid var(--dashboard-line); border-radius: 16px; background: white; box-shadow: 0 10px 28px rgba(7, 86, 61, 0.05); }
#member-profile-screen .profile-section h3 { color: var(--dashboard-green-dark); font-size: 20px; }
#member-profile-screen .food-profile-summary { background: #eaf4e6; }
#member-profile-screen .personal-details-section { background: #fff; }
#member-profile-screen .profile-note { margin-top: 16px; }

@media (max-width: 760px) {
    .family-page-sidebar { display: none !important; }
    .family-page-content { width: 100%; margin: 0; }
    .family-page-topbar { padding: 0 14px; }
    .family-page-header, .family-page-section { width: calc(100% - 28px); }
    .family-invite-panel { width: calc(100% - 28px); }
    .family-page-header { padding-top: 36px; }
}

@media (max-width: 520px) {
    .family-member-card-grid, .profile-detail-grid { grid-template-columns: 1fr; }
    .family-section-heading { display: block; }
    .family-add-button { margin-top: 14px; }
    .family-invite-actions { display: grid; }
    .family-invite-actions .primary-button, .family-invite-actions .secondary-button { width: 100%; }
}

@media screen and (max-width: 760px) {
    main.family-screen .family-page-sidebar {
        display: none !important;
    }
}

/* =========================
   MEAL PLAN MVP
========================= */

.meal-plan-screen { display: flex; min-height: 100vh; overflow-x: hidden; background: #fffdf9; color: var(--dashboard-ink); font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.meal-plan-shell-content { width: calc(100% - 246px); min-width: 0; margin-left: 246px; overflow-x: hidden; padding-bottom: 60px; }
.meal-plan-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; width: min(1240px, calc(100% - 72px)); margin: 0 auto; padding: 52px 0 28px; }
.meal-plan-header h1 { margin: 0; color: var(--dashboard-green-dark); font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.04em; }
.meal-plan-header p:last-child { margin: 10px 0 0; color: var(--dashboard-muted); }
.meal-plan-week-controls { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.meal-plan-week-controls strong { min-width: 150px; color: var(--dashboard-green-dark); text-align: center; }
.meal-plan-workspace { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; width: min(1240px, calc(100% - 72px)); margin: 0 auto; }
.meal-preferences-panel, .meal-board { min-width: 0; padding: 20px; border: 1px solid var(--dashboard-line); border-radius: 16px; background: white; box-shadow: 0 10px 28px rgba(7, 86, 61, .05); }
.meal-preferences-panel h2 { margin: 0; color: var(--dashboard-green-dark); font-size: 19px; }
.meal-preference-occasion { margin-top: 18px; }
.meal-preference-occasion h3 { margin: 0 0 8px; color: var(--dashboard-muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.meal-preference-member-group { margin-top: 18px; padding-top: 14px; border-top: 1px solid #e8eee5; }
.meal-preference-member-group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.meal-preference-member-heading { display: grid; gap: 3px; margin-bottom: 9px; }
.meal-preference-member-heading strong { color: var(--dashboard-green-dark); font-size: 14px; }
.meal-preference-member-heading small { color: var(--dashboard-green); font-size: 11px; font-weight: 800; }
.meal-preference-member-empty { margin: 0; color: var(--dashboard-muted); font-size: 11px; }
.meal-preference-card { display: grid; width: 100%; margin-bottom: 7px; padding: 9px 10px; border: 1px solid #dfe9dc; border-radius: 9px; background: #f4faf0; color: var(--dashboard-green-dark); text-align: left; cursor: grab; }
.meal-preference-card:hover, .meal-preference-card.selected { border-color: var(--dashboard-green); background: #e5f2e1; }
.meal-preference-card strong { font-size: 12px; }
.meal-preference-card small { margin-top: 3px; color: var(--dashboard-muted); font-size: 10px; }
.meal-board { overflow: auto; padding: 0; }
.meal-board-header, .meal-board-body { display: grid; grid-template-columns: 118px repeat(7, minmax(100px, 1fr)); min-width: 830px; }
.meal-board-header { border-bottom: 1px solid var(--dashboard-line); }
.meal-board-day { display: grid; gap: 3px; padding: 14px 8px; border-left: 1px solid #edf1eb; color: var(--dashboard-green-dark); text-align: center; }
.meal-board-day strong { font-size: 12px; }
.meal-board-day small { color: var(--dashboard-muted); font-size: 11px; }
.meal-board-corner { background: #fbfdf9; }
.meal-board-occasion { display: flex; align-items: center; padding: 10px; border-bottom: 1px solid #edf1eb; color: var(--dashboard-green-dark); font-size: 11px; font-weight: 800; }
.meal-board-cell { position: relative; min-height: 76px; padding: 8px; border-left: 1px solid #edf1eb; border-bottom: 1px solid #edf1eb; background: #fff; }
.meal-board-cell:hover, .meal-board-cell.drop-target { background: #f3faef; }
.meal-slot-empty { display: grid; place-items: center; min-height: 58px; border: 1px dashed #cbdaca; border-radius: 8px; color: var(--dashboard-muted); font-size: 11px; }
.meal-board-cell strong { display: block; padding-right: 16px; color: var(--dashboard-green-dark); font-size: 11px; line-height: 1.35; }
.meal-slot-preference { display: block; margin-bottom: 5px; padding: 5px 6px; border-radius: 6px; background: #edf6e9; color: var(--dashboard-green-dark); font-size: 10px; line-height: 1.3; }
.meal-slot-clear { position: absolute; top: 7px; right: 7px; border: 0; background: transparent; color: #b75042; font-size: 15px; }
.meal-plan-error { color: #a33b2b; }

@media (max-width: 900px) {
    .meal-plan-workspace { grid-template-columns: 1fr; }
    .meal-preferences-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .meal-preferences-panel > .family-section-heading, .meal-preferences-panel > .profile-help { grid-column: 1 / -1; }
    .meal-preference-occasion { margin-top: 0; }
}

@media (max-width: 760px) {
    .meal-plan-shell-content { width: 100%; margin: 0; }
    .meal-plan-header, .meal-plan-workspace { width: calc(100% - 28px); }
    .meal-plan-header { display: block; padding-top: 36px; }
    .meal-plan-week-controls { justify-content: space-between; margin-top: 20px; gap: 5px; }
    .meal-plan-week-controls strong { min-width: 0; font-size: 12px; }
}

@media (max-width: 520px) {
    .meal-preferences-panel { display: block; }
    .meal-preference-occasion { margin-top: 16px; }
}

.meal-calendar-screen { display: flex; min-height: 100vh; overflow-x: hidden; background: #fffdf9; color: var(--dashboard-ink); font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif; }

.grocery-screen { min-height: 100vh; padding: 48px 24px; background: #fffdf9; color: var(--dashboard-ink); font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.grocery-content { width: min(820px, 100%); margin: 0 auto; }
.grocery-content h1 { margin: 0; color: var(--dashboard-green-dark); font-size: clamp(30px, 4vw, 44px); }
.grocery-tabs { display: flex; gap: 8px; margin: 24px 0; }
.grocery-tabs button { padding: 10px 14px; border: 1px solid var(--dashboard-line); border-radius: 9px; background: white; color: var(--dashboard-muted); font: inherit; font-weight: 800; }
.grocery-tabs button.active { background: #eaf4e6; color: var(--dashboard-green-dark); }
.grocery-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.grocery-actions .primary-button { width: auto; margin: 0; padding: 11px 15px; background: var(--dashboard-green); font-size: 13px; }
.grocery-actions p { margin: 0; color: var(--dashboard-muted); font-size: 13px; }

.settings-screen { min-height: 100vh; padding: 48px 24px; background: #fffdf9; color: var(--dashboard-ink); font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.settings-content { width: min(680px, 100%); margin: 0 auto; }
.settings-content h1 { margin: 0; color: var(--dashboard-green-dark); font-size: clamp(30px, 4vw, 44px); }
.settings-section { margin-top: 24px; padding: 22px; border: 1px solid var(--dashboard-line); border-radius: 15px; background: white; box-shadow: 0 10px 28px rgba(7, 86, 61, .05); }
.settings-section h2 { margin: 0; color: var(--dashboard-green-dark); font-size: 20px; }
.settings-section > p { margin: 8px 0 18px; color: var(--dashboard-muted); font-size: 13px; line-height: 1.5; }
.settings-account-name { margin: 8px 0 2px; color: var(--dashboard-green-dark); font-size: 15px; font-weight: 800; }
.settings-account-email { margin: 0 0 18px; color: var(--dashboard-muted); font-size: 13px; }
.settings-section #sign-out-button { width: auto; }
.settings-language-options { display: flex; flex-wrap: wrap; gap: 10px; }
.settings-language-option { min-width: 140px; min-height: 46px; padding: 11px 16px; border: 1px solid var(--dashboard-line); border-radius: 10px; background: white; color: var(--dashboard-ink); font: inherit; font-size: 13px; font-weight: 700; }
.settings-language-option.active { border-color: var(--dashboard-green); background: #eaf4e6; color: var(--dashboard-green-dark); }
@media (max-width: 520px) { .settings-screen { padding: 28px 14px; } .settings-language-option { min-width: 0; flex: 1 1 auto; } }
.grocery-list-content { display: grid; gap: 14px; }
.grocery-category { padding: 18px; border: 1px solid var(--dashboard-line); border-radius: 14px; background: white; box-shadow: 0 8px 22px rgba(7, 86, 61, .04); }
.grocery-category h2 { margin: 0 0 10px; color: var(--dashboard-orange); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.grocery-item-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid #edf1eb; }
.grocery-item-row strong { color: var(--dashboard-green-dark); font-size: 14px; }
.grocery-item-row small { color: var(--dashboard-muted); }
@media (max-width: 520px) { .grocery-screen { padding: 28px 14px; } .grocery-actions { align-items: flex-start; flex-direction: column; } }
.meal-calendar-shell-content { width: calc(100% - 246px); min-width: 0; margin-left: 246px; padding-bottom: 60px; }
.meal-calendar-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; width: min(1120px, calc(100% - 72px)); margin: 0 auto; padding: 52px 0 28px; }
.meal-calendar-header h1 { margin: 0; color: var(--dashboard-green-dark); font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.04em; }
.meal-calendar-header p:last-child { margin: 10px 0 0; color: var(--dashboard-muted); }
.meal-calendar-list { display: grid; gap: 12px; width: min(1120px, calc(100% - 72px)); margin: 0 auto; }
.meal-calendar-day { padding: 18px 20px; border: 1px solid var(--dashboard-line); border-radius: 15px; background: white; box-shadow: 0 8px 22px rgba(7, 86, 61, .04); }
.meal-calendar-day.past { background: #f8f8f5; }
.meal-calendar-day.today { border-color: #71a66b; background: #f0f8ed; }
.meal-calendar-day-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.meal-calendar-day-heading strong { color: var(--dashboard-green-dark); font-size: 16px; }
.meal-calendar-day-heading small { color: var(--dashboard-muted); font-size: 12px; }
.calendar-meal-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid #edf1eb; }
.calendar-meal-occasion { color: var(--dashboard-orange); font-size: 12px; font-weight: 800; }
.calendar-meal-row strong { color: var(--dashboard-green-dark); font-size: 13px; }
.calendar-day-empty { margin: 0; color: var(--dashboard-muted); font-size: 12px; }
.calendar-empty-state { padding: 50px 24px; border: 1px dashed #cbdaca; border-radius: 16px; background: white; text-align: center; }
.calendar-empty-state h2 { margin: 0 0 8px; color: var(--dashboard-green-dark); font-size: 20px; }
.calendar-empty-state p { margin: 0; color: var(--dashboard-muted); }

@media (max-width: 760px) {
    .meal-calendar-shell-content { width: 100%; margin: 0; }
    .meal-calendar-header, .meal-calendar-list { width: calc(100% - 28px); }
    .meal-calendar-header { display: block; padding-top: 36px; }
    .meal-calendar-header .meal-plan-week-controls { margin-top: 20px; }
}

@media (max-width: 520px) {
    .calendar-meal-row { grid-template-columns: 1fr; gap: 4px; }
}

/* =========================
   DASHBOARD V1
========================= */

:root {
    --dashboard-green: #07563d;
    --dashboard-green-dark: #043b2b;
    --dashboard-orange: #ff6b2c;
    --dashboard-yellow: #f3b522;
    --dashboard-cream: #fffdf9;
    --dashboard-paper: #ffffff;
    --dashboard-ink: #26332f;
    --dashboard-muted: #718079;
    --dashboard-line: #e6e9e1;
    --dashboard-shadow: 0 18px 45px rgba(31, 64, 54, 0.08);
}

.group-home {
    min-height: 100vh;
    padding: 0 0 32px;
    background: var(--dashboard-cream);
    color: var(--dashboard-ink);
    font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

.group-home button,
.group-home a {
    -webkit-tap-highlight-color: transparent;
}

.group-home button:focus-visible,
.group-home a:focus-visible {
    outline: 3px solid rgba(223, 120, 65, 0.5);
    outline-offset: 3px;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    min-height: 78px;
    padding: 16px clamp(20px, 5vw, 72px);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--dashboard-line);
    box-shadow: 0 4px 20px rgba(31, 64, 54, 0.04);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--dashboard-green);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #edf5e9;
}

.brand-mark svg {
    width: 43px;
    height: 43px;
}

.brand > span:last-child {
    display: grid;
    gap: 2px;
}

.brand .app-name {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0.01em;
}

.brand-word-meal {
    color: var(--dashboard-green);
}

.brand-word-mate {
    color: var(--dashboard-orange);
}

.brand small {
    color: var(--dashboard-muted);
    font-size: 11px;
}

.top-actions {
    align-items: center;
    gap: 12px;
}

.icon-button,
.profile-menu-button {
    border: 1px solid transparent;
    background: transparent;
    color: var(--dashboard-green);
}

.icon-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 23px;
}

.icon-button:hover {
    background: #eef4eb;
}

.profile-menu-button {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 8px 4px 4px;
    border-radius: 30px;
    text-align: left;
}

.profile-menu-button:hover {
    background: #f0f4ed;
}

.profile-menu-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--dashboard-green);
    color: white;
    font-weight: 700;
}

.profile-menu-copy {
    display: grid;
    gap: 1px;
}

.profile-menu-copy strong {
    font-size: 13px;
}

.profile-menu-copy small {
    color: var(--dashboard-muted);
    font-size: 11px;
}

.dashboard-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    padding: 66px 8px 42px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--dashboard-orange);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.dashboard-hero h1 {
    max-width: 620px;
    margin: 0;
    color: var(--dashboard-green-dark);
    font-size: clamp(30px, 4vw, 48px);
    letter-spacing: -0.025em;
    line-height: 1.08;
}

.hero-copy {
    margin: 12px 0 15px;
    color: var(--dashboard-muted);
    font-size: 17px;
}

.current-family {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--dashboard-green);
    font-size: 14px;
    font-weight: 700;
}

.family-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dashboard-orange);
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
}

.hero-primary,
.hero-actions .primary-button {
    width: auto;
    min-width: 150px;
    margin: 0;
    padding: 13px 18px;
    border-radius: 10px;
    background: var(--dashboard-green);
    font-size: 14px;
}

.hero-primary:hover,
.primary-button:hover {
    background: var(--dashboard-green-dark);
}

.hero-primary span {
    margin-right: 5px;
    font-size: 19px;
    line-height: 0;
}

.text-button,
.card-action,
.icon-link {
    border: 0;
    background: transparent;
    color: var(--dashboard-green);
    font: inherit;
    font-weight: 800;
}

.text-button {
    padding: 8px 0;
    font-size: 13px;
}

.text-button:hover,
.card-action:hover {
    color: var(--dashboard-orange);
}

.dashboard-section,
.dashboard-panel,
.quick-actions {
    background: var(--dashboard-paper);
    border: 1px solid var(--dashboard-line);
    border-radius: 20px;
    box-shadow: 0 10px 26px rgba(7, 86, 61, 0.06);
}

.dashboard-section {
    padding: 28px;
}

.section-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.section-heading-row h2,
.dashboard-panel h2,
.quick-actions h2 {
    margin: 0;
    color: var(--dashboard-green-dark);
    font-size: 23px;
    letter-spacing: -0.02em;
}

.section-date {
    color: var(--dashboard-muted);
    font-size: 13px;
}

.meal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.dashboard-meal-card {
    min-height: 205px;
    padding: 20px;
    border-radius: 15px;
    color: var(--dashboard-green-dark);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.dashboard-meal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 22px rgba(31, 64, 54, 0.1);
}

.breakfast-card { background: #fff4d5; }
.lunch-card { background: #fff0e8; }
.dinner-card { background: #eaf4e6; }

.meal-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.meal-illustration {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--dashboard-orange);
    font-size: 25px;
}

.meal-status {
    padding: 5px 9px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--dashboard-muted);
    font-size: 11px;
    font-weight: 700;
}

.meal-occasion {
    margin: 23px 0 5px;
    color: var(--dashboard-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.dashboard-meal-card h3 {
    margin: 0 0 18px;
    font-size: 18px;
}

.card-action {
    padding: 0;
    font-size: 13px;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 18px;
    margin-top: 18px;
}

.dashboard-panel {
    position: relative;
    min-height: 245px;
    padding: 28px;
}

.compact-heading {
    align-items: flex-start;
    margin-bottom: 22px;
}

.icon-link {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eef4eb;
    font-size: 20px;
}

.family-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-family-member {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--dashboard-ink);
    text-align: left;
}

.dashboard-family-member:hover {
    border-color: var(--dashboard-line);
    background: #fafbf8;
}

.family-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #f4d8a6;
    color: var(--dashboard-green-dark);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-family-member:nth-child(2n) .family-avatar { background: #d8e8d8; }
.dashboard-family-member:nth-child(3n) .family-avatar { background: #f1c5a8; }

.family-member-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.family-member-copy strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.family-member-copy small {
    color: var(--dashboard-muted);
    font-size: 11px;
}

.preference-summary-panel {
    background: var(--dashboard-green);
    color: white;
}

.preference-summary-panel h2,
.preference-summary-panel .eyebrow,
.preference-summary-panel p {
    color: white;
}

.preference-summary-panel p:not(.eyebrow) {
    max-width: 320px;
    margin: 16px 0 20px;
    color: #dce9dc;
    line-height: 1.55;
}

.preference-summary-panel .text-button { color: var(--dashboard-yellow); }

.panel-icon {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    margin-bottom: 20px;
    border-radius: 13px;
    font-size: 22px;
}

.heart-icon { background: #ffe0d2; color: var(--dashboard-orange); }
.grocery-icon { background: #f8e8b4; color: #9d7511; }

.grocery-panel p:not(.eyebrow),
.suggestion-panel p:not(.eyebrow) {
    max-width: 370px;
    margin: 14px 0 20px;
    color: var(--dashboard-muted);
    line-height: 1.55;
}

.suggestion-panel {
    background: #fff7dc;
}

.suggestion-spark {
    display: block;
    margin-bottom: 20px;
    color: var(--dashboard-orange);
    font-size: 27px;
}

.quick-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 18px;
    padding: 22px 28px;
}

.quick-action-list {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 9px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--dashboard-line);
    border-radius: 10px;
    background: white;
    color: var(--dashboard-green-dark);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.quick-action:hover {
    border-color: #b5cbb4;
    background: #f5f9f2;
}

.quick-icon {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border-radius: 7px;
    background: #edf4e9;
    color: var(--dashboard-green);
    font-size: 16px;
}

.loading-copy {
    color: var(--dashboard-muted);
    font-size: 13px;
}

.bottom-nav {
    position: static;
    display: flex;
    width: min(1180px, calc(100% - 40px));
    height: auto;
    margin: 22px auto 0;
    padding: 0;
    gap: 8px;
    background: transparent;
    border: 0;
}

.bottom-nav .nav-item {
    width: auto;
    flex: 1;
    justify-content: center;
    margin: 0;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--dashboard-muted);
    text-align: center;
}

.bottom-nav .nav-item span { font-size: 17px; }
.bottom-nav .nav-item small { font-size: 12px; }

.bottom-nav .nav-item.active,
.bottom-nav .nav-item:hover {
    background: #eaf1e8;
    color: var(--dashboard-green);
}

@media (max-width: 760px) {
    .dashboard-shell,
    .bottom-nav {
        width: min(100% - 28px, 620px);
    }

    .top-bar {
        padding: 13px 14px;
    }

    .profile-menu-copy { display: none; }

    .dashboard-hero {
        display: block;
        padding: 42px 2px 28px;
    }

    .hero-actions {
        justify-content: flex-start;
        margin-top: 24px;
    }

    .dashboard-section,
    .dashboard-panel {
        padding: 21px;
        border-radius: 16px;
    }

    .meal-grid,
    .dashboard-columns {
        grid-template-columns: 1fr;
    }

    .dashboard-meal-card {
        min-height: 175px;
    }

    .quick-actions {
        display: block;
        padding: 21px;
        border-radius: 16px;
    }

    .quick-action-list {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 16px;
    }

    .quick-action {
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .brand small { display: none; }
    .brand-mark { width: 44px; height: 44px; border-radius: 13px; }
    .brand-mark svg { width: 37px; height: 37px; }
    .hero-actions { display: grid; gap: 8px; }
    .hero-primary { width: 100%; }
    .family-grid { grid-template-columns: 1fr; }
    .bottom-nav .nav-item { padding-inline: 5px; }
}

/* =========================
   FAMILY PREFERENCES MVP
========================= */

.preferences-screen {
    display: flex;
    min-height: 100vh;
    padding: 0;
    background: #fffdf9;
    color: var(--dashboard-ink);
    font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

.preferences-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    display: flex;
    width: 246px;
    flex-direction: column;
    padding: 24px 16px 20px;
    border-right: 1px solid #e8ece4;
    background: #fffefa;
}

.preferences-shell-content {
    width: calc(100% - 246px);
    margin-left: 246px;
    padding: 0 clamp(24px, 4vw, 58px) 70px;
}

.preferences-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    margin: 0 calc(-1 * clamp(24px, 4vw, 58px)) 36px;
    padding: 0 clamp(24px, 4vw, 58px);
    border-bottom: 1px solid #e8ece4;
    color: var(--dashboard-green-dark);
    font-size: 12px;
    font-weight: 800;
}

.preferences-topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.preferences-header,
.preference-tabs,
.preference-workspace { width: 100%; }

.preferences-header,
.preference-tabs,
.preference-workspace {
    width: min(1240px, 100%);
    margin-inline: auto;
}

.preferences-back-button {
    margin: 0 0 30px;
    padding: 0;
    color: var(--dashboard-green);
    font-weight: 700;
}

.preferences-header h1 {
    margin: 0;
    color: var(--dashboard-green-dark);
    font-size: clamp(30px, 4vw, 48px);
    letter-spacing: -0.035em;
}

.preferences-header h1 span { color: var(--dashboard-orange); }

.preferences-header > p:last-child {
    max-width: 710px;
    margin: 12px 0 26px;
    color: var(--dashboard-muted);
    line-height: 1.55;
}

.preference-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 14px;
    padding: 4px;
    border: 1px solid var(--dashboard-line);
    border-radius: 11px;
    background: white;
}

.preference-tab {
    min-height: 38px;
    padding: 4px 6px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--dashboard-ink);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
}

.preference-tab.active,
.preference-tab:hover {
    background: #dcecdc;
    color: var(--dashboard-green-dark);
}

.preference-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.48fr) minmax(320px, 0.72fr);
    gap: 14px;
    align-items: start;
}

.preference-member-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.preference-member-card {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: white;
    color: var(--dashboard-ink);
    text-align: left;
    box-shadow: 0 4px 14px rgba(7, 86, 61, 0.04);
}

.preference-member-card:hover,
.preference-member-card.active {
    border-color: #70a66c;
    background: #f4faf0;
}

.preference-member-card > span:last-child {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.preference-member-card strong,
.preference-member-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preference-member-card strong { font-size: 12px; }
.preference-member-card small { color: var(--dashboard-muted); font-size: 10px; }

.preference-member-avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--dashboard-green);
    color: white;
    font-size: 11px;
    font-weight: 800;
}

.preference-member-card:nth-child(2) .preference-member-avatar { background: #74b8d8; }
.preference-member-card:nth-child(3) .preference-member-avatar { background: #d66885; }
.preference-member-card:nth-child(4) .preference-member-avatar { background: #a985d1; }

.preference-table-card,
.preference-detail-panel {
    border: 1px solid var(--dashboard-line);
    border-radius: 15px;
    background: white;
    box-shadow: 0 10px 28px rgba(7, 86, 61, 0.06);
}

.preference-table-card { overflow: hidden; }

.preference-table-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 22px 16px;
}

.preference-table-heading h2 {
    margin: 0;
    color: var(--dashboard-green-dark);
    font-size: 21px;
}

.preference-table-heading p:last-child {
    margin: 7px 0 0;
    color: var(--dashboard-muted);
    font-size: 12px;
}

.add-food-button {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    padding: 10px 13px;
    border-radius: 9px;
    background: var(--dashboard-green);
    font-size: 12px;
}

.preference-table { border-top: 1px solid var(--dashboard-line); }

.preference-table-row {
    display: grid;
    grid-template-columns: 106px minmax(0, 1fr) 118px;
    min-height: 70px;
    border-bottom: 1px solid #eef0eb;
}

.preference-table-row:last-child { border-bottom: 0; }

.preference-table-row > div {
    padding: 14px 12px;
    border-right: 1px solid #eef0eb;
}

.preference-table-row > div:last-child { border-right: 0; }

.preference-occasion-cell {
    display: flex;
    align-items: center;
    color: var(--dashboard-green-dark);
    font-size: 11px;
    font-weight: 800;
}

.preference-foods-cell {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    gap: 6px;
}

.food-chip,
.add-row-food-button {
    padding: 7px 9px;
    border: 1px solid #cfe2d0;
    border-radius: 14px;
    background: #e6f2e5;
    color: var(--dashboard-green-dark);
    font: inherit;
    font-size: 11px;
    font-weight: 700;
}

.food-chip.like { background: #fff1d1; border-color: #f2d38b; }
.food-chip.sometimes { background: #ffe5dc; border-color: #f4baa6; }
.food-chip:hover { border-color: var(--dashboard-orange); }

.add-row-food-button {
    border-color: #dce2dc;
    background: #f7f9f6;
    color: var(--dashboard-muted);
}

.preference-notes-cell {
    color: var(--dashboard-muted);
    font-size: 10px;
    line-height: 1.4;
}

.preference-empty-state {
    padding: 46px 24px;
    border-top: 1px solid var(--dashboard-line);
    text-align: center;
}

.empty-bowl { font-size: 32px; }
.preference-empty-state h3 { margin: 12px 0 5px; color: var(--dashboard-green-dark); }
.preference-empty-state p { margin: 0 auto 18px; color: var(--dashboard-muted); font-size: 13px; }
.preference-empty-state .primary-button { width: auto; margin: 0; padding: 10px 14px; font-size: 12px; }

.preference-detail-panel {
    position: sticky;
    top: 18px;
    min-height: 470px;
    padding: 22px;
}

.detail-panel-empty {
    display: grid;
    place-items: center;
    min-height: 410px;
    padding: 25px;
    color: var(--dashboard-muted);
    text-align: center;
}

.detail-panel-empty > span { color: var(--dashboard-orange); font-size: 40px; }
.detail-panel-empty h2 { margin: 12px 0 5px; color: var(--dashboard-green-dark); font-size: 20px; }
.detail-panel-empty p { max-width: 230px; margin: 0; font-size: 12px; line-height: 1.5; }

.detail-heading-row,
.detail-section-heading,
.detail-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.detail-heading-row h2 { margin: 0; color: var(--dashboard-green-dark); font-size: 22px; }
.detail-close-button { font-size: 22px; }

.preference-detail-panel label {
    display: block;
    margin: 17px 0 6px;
    color: var(--dashboard-green-dark);
    font-size: 11px;
    font-weight: 800;
}

.preference-detail-panel input,
.preference-detail-panel select,
.preference-detail-panel textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #dfe5dc;
    border-radius: 8px;
    background: #fff;
    color: var(--dashboard-ink);
    font: inherit;
    font-size: 12px;
}

.preference-detail-panel textarea { resize: vertical; }
.preference-detail-panel input:disabled,
.preference-detail-panel select:disabled,
.preference-detail-panel textarea:disabled { background: #f5f7f3; color: #7c8880; }

.detail-two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.detail-two-columns label { margin-top: 14px; }

.detail-links-section { margin-top: 21px; padding-top: 17px; border-top: 1px solid var(--dashboard-line); }
.detail-section-heading h3 { margin: 0; color: var(--dashboard-green-dark); font-size: 14px; }

.preference-link-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    align-items: center;
    margin-top: 9px;
    padding: 9px;
    border: 1px solid #e5ebe2;
    border-radius: 8px;
}

.preference-link-row a { overflow: hidden; color: var(--dashboard-green); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.preference-link-row small { overflow: hidden; color: var(--dashboard-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.link-edit-button,
.link-delete-button { border: 0; background: transparent; font: inherit; font-size: 11px; }
.link-edit-button { grid-column: 2; color: var(--dashboard-green); font-weight: 800; }
.link-delete-button { grid-column: 3; grid-row: 1 / span 2; color: #be4b3e; font-size: 17px; }

.add-link-form { display: grid; gap: 7px; margin-top: 10px; }
.small-button { width: auto; min-width: 76px; margin: 0; padding: 9px 12px; border-radius: 8px; font-size: 12px; }
.add-link-form .secondary-button { justify-self: end; }

.detail-actions { margin-top: 22px; }
.detail-actions .primary-button { background: var(--dashboard-green); }

@media (max-width: 850px) {
    .preference-workspace { grid-template-columns: 1fr; }
    .preference-detail-panel { position: static; }
}

@media (max-width: 620px) {
    .preferences-screen { padding: 0 14px 45px; }
    .preferences-sidebar { display: none; }
    .preferences-shell-content { width: 100%; margin: 0; padding: 0; }
    .preferences-topbar { margin: 0 -14px 26px; padding: 0 14px; }
    .preferences-header { padding: 0; }
    .preference-tabs { grid-template-columns: repeat(2, 1fr); }
    .preference-tab { min-height: 46px; }
    .preference-member-selector { grid-template-columns: repeat(2, 1fr); }
    .preference-table-heading { display: block; }
    .add-food-button { margin-top: 15px; }
    .preference-table-row { grid-template-columns: 86px minmax(0, 1fr); }
    .preference-notes-cell { display: none; }
    .preference-table-row > div:nth-child(2) { border-right: 0; }
    .preference-detail-panel { padding: 18px; }
}

/* =========================
   PRODUCT SHELL RESET
========================= */

.group-home {
    display: flex;
    min-height: 100vh;
    padding: 0;
    background: #fffdf9;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    display: flex;
    width: 246px;
    flex-direction: column;
    padding: 24px 16px 20px;
    border-right: 1px solid #e8ece4;
    background: #fffefa;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 12px 42px;
    color: var(--dashboard-green-dark);
    text-decoration: none;
}

.sidebar-brand .brand-mark {
    width: 43px;
    height: 43px;
    border-radius: 13px;
}

.sidebar-brand .brand-mark svg { width: 36px; height: 36px; }

.sidebar-brand > span:last-child {
    display: grid;
    gap: 2px;
}

.sidebar-brand strong { font-size: 18px; letter-spacing: -0.02em; }
.sidebar-brand small { color: var(--dashboard-muted); font-size: 10px; }

.sidebar-nav,
.sidebar-secondary-nav {
    display: grid;
    gap: 5px;
}

.sidebar-secondary-nav {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid #edf0eb;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #5b6c63;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
}

.sidebar-nav-item span {
    display: grid;
    place-items: center;
    width: 21px;
    color: var(--dashboard-green);
    font-size: 19px;
}

.sidebar-nav-item:hover,
.sidebar-nav-item.active {
    background: #e8f2e5;
    color: var(--dashboard-green-dark);
}

.sidebar-nav-item.active { box-shadow: inset 3px 0 0 var(--dashboard-green); }

.sidebar-note {
    display: grid;
    justify-items: center;
    gap: 7px;
    margin: 24px 8px 0;
    padding: 16px 12px;
    border-radius: 13px;
    background: #fff2dc;
    color: var(--dashboard-green-dark);
    text-align: center;
}

.sidebar-note span { color: var(--dashboard-orange); font-size: 19px; }
.sidebar-note strong { max-width: 150px; font-size: 11px; line-height: 1.4; }

.app-shell-content {
    width: calc(100% - 246px);
    min-width: 0;
    margin-left: 246px;
}

.app-shell-content .top-bar {
    position: sticky;
    z-index: 5;
    min-height: 72px;
    padding: 13px clamp(24px, 4vw, 58px);
    border-bottom: 1px solid #e8ece4;
    box-shadow: none;
}

.app-shell-content .top-bar > .brand { display: none; }

.mobile-menu-button {
    display: none;
    border: 0;
    background: transparent;
    color: var(--dashboard-green);
    font-size: 22px;
}

.family-selector {
    padding: 9px 13px;
    border: 1px solid #dfe8dc;
    border-radius: 9px;
    background: #f5f9f2;
    color: var(--dashboard-green-dark);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
}

.family-selector span { margin-left: 7px; color: var(--dashboard-orange); }

.app-shell-content .dashboard-shell {
    width: min(1180px, calc(100% - 72px));
}

.app-shell-content .dashboard-hero { padding-top: 52px; }

.app-shell-content .bottom-nav { display: none; }

@media (max-width: 760px) {
    .app-sidebar {
        width: 246px;
        transform: translateX(-102%);
        transition: transform 180ms ease;
        box-shadow: 18px 0 35px rgba(7, 86, 61, 0.12);
    }

    .app-sidebar.open { transform: translateX(0); }

    .app-shell-content {
        width: 100%;
        margin-left: 0;
    }

    .app-shell-content .top-bar {
        display: flex;
        gap: 12px;
        padding: 12px 14px;
    }

    .mobile-menu-button { display: block; }
    .app-shell-content .top-bar > .brand { display: inline-flex; margin-right: auto; }
    .app-shell-content .top-bar > .brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
    .app-shell-content .top-bar > .brand .brand-mark svg { width: 32px; height: 32px; }
    .app-shell-content .top-bar > .brand small { display: none; }
    .family-selector { display: none; }
    .app-shell-content .dashboard-shell { width: min(100% - 28px, 620px); }
    .app-shell-content .dashboard-hero { padding-top: 38px; }
}

/* =========================
   MOBILE USABILITY
========================= */

@media (max-width: 760px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    .family-screen,
    .meal-plan-screen,
    .meal-calendar-screen,
    .preferences-screen {
        display: block;
    }

    .family-page-sidebar,
    .meal-plan-screen .preferences-sidebar,
    .meal-calendar-screen .preferences-sidebar,
    .preferences-screen .preferences-sidebar {
        position: sticky;
        inset: 0 auto auto 0;
        z-index: 20;
        display: block !important;
        width: 100%;
        padding: 7px 10px;
        border-right: 0;
        border-bottom: 1px solid #e8ece4;
        overflow-x: auto;
        background: #fffefa;
        box-shadow: 0 4px 12px rgba(7, 86, 61, 0.05);
    }

    .family-page-sidebar .sidebar-brand,
    .family-page-sidebar .sidebar-note,
    .meal-plan-screen .preferences-sidebar .sidebar-brand,
    .meal-calendar-screen .preferences-sidebar .sidebar-brand,
    .preferences-screen .preferences-sidebar .sidebar-brand {
        display: none;
    }

    .family-page-sidebar .sidebar-nav,
    .family-page-sidebar .sidebar-secondary-nav,
    .meal-plan-screen .preferences-sidebar .sidebar-nav,
    .meal-calendar-screen .preferences-sidebar .sidebar-nav,
    .preferences-screen .preferences-sidebar .sidebar-nav,
    .preferences-screen .preferences-sidebar .sidebar-secondary-nav {
        display: flex;
        width: max-content;
        gap: 5px;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .family-page-sidebar .sidebar-secondary-nav,
    .preferences-screen .preferences-sidebar .sidebar-secondary-nav {
        margin-left: 5px;
    }

    .family-page-sidebar .sidebar-nav-item,
    .meal-plan-screen .preferences-sidebar .sidebar-nav-item,
    .meal-calendar-screen .preferences-sidebar .sidebar-nav-item,
    .preferences-screen .preferences-sidebar .sidebar-nav-item {
        width: auto;
        min-height: 44px;
        padding: 10px 12px;
        gap: 6px;
        font-size: 12px;
        white-space: nowrap;
    }

    .family-page-sidebar .sidebar-nav-item span,
    .meal-plan-screen .preferences-sidebar .sidebar-nav-item span,
    .meal-calendar-screen .preferences-sidebar .sidebar-nav-item span,
    .preferences-screen .preferences-sidebar .sidebar-nav-item span {
        width: auto;
        font-size: 16px;
    }

    .family-page-content,
    .meal-plan-shell-content,
    .meal-calendar-shell-content,
    .preferences-shell-content {
        width: 100%;
        margin-left: 0;
    }

    .family-page-topbar,
    .preferences-topbar {
        min-height: 56px;
        gap: 10px;
    }

    .meal-plan-screen .preferences-topbar,
    .meal-calendar-screen .preferences-topbar {
        margin: 0 0 22px;
        padding: 0 14px;
    }

    .family-page-topbar > span:first-child {
        max-width: 58vw;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .family-page-topbar .preferences-topbar-user,
    .preferences-topbar-user {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .meal-plan-header h1,
    .meal-calendar-header h1,
    .preferences-header h1,
    .family-page-header h1,
    .grocery-content h1 {
        font-size: 30px;
        line-height: 1.15;
    }

    .meal-plan-week-controls {
        width: 100%;
    }

    .meal-plan-week-controls .small-button {
        min-height: 44px;
        padding-inline: 9px;
    }

    .meal-plan-week-controls strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .meal-board {
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }

    .meal-board-header,
    .meal-board-body {
        grid-template-columns: 96px repeat(7, minmax(88px, 1fr));
        min-width: 712px;
    }

    .meal-board-cell {
        min-height: 82px;
    }

    .preferences-screen {
        padding: 0 14px 45px;
    }

    .preferences-topbar {
        margin: 0 -14px 22px;
    }

    .meal-plan-screen .preferences-topbar,
    .meal-calendar-screen .preferences-topbar {
        margin: 0 0 22px;
    }

    .preference-member-selector {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .preference-member-card {
        min-width: 154px;
        min-height: 58px;
    }

    .preference-table-card {
        overflow-x: auto;
    }

    .preference-table {
        min-width: 300px;
    }

    .preference-detail-panel {
        min-height: 0;
    }

    .detail-two-columns {
        grid-template-columns: 1fr;
    }

    .detail-actions {
        align-items: stretch;
    }

    .detail-actions .small-button {
        min-height: 44px;
    }

    .family-page-section,
    #member-profile-screen .profile-section {
        padding: 18px;
        border-radius: 12px;
    }

    .family-add-button,
    .personal-details-section .primary-button {
        min-height: 44px;
    }

    .grocery-tabs {
        overflow-x: auto;
        padding-bottom: 3px;
    }

    .grocery-tabs button,
    .grocery-actions .primary-button {
        min-height: 44px;
        white-space: nowrap;
    }

    .grocery-item-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .grocery-item-row small {
        line-height: 1.4;
    }
}
