body {
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    margin: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(243, 247, 244, 0.92)) fixed no-repeat,
        #f4f7f3;
    background-size: cover;
    min-height: 100vh;
    color: #1f2933;
}


nav {
    --nav-control-height: 2.5rem;
    --nav-control-padding-x: 0.85rem;
}

nav {
    background: rgba(31, 48, 42, 0.94);
    padding: 0.55rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

nav a {
    color: #fff;
    text-decoration: none;
}

nav .nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

nav .nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    flex: 1;
}

nav .brand-name {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    font-weight: 700;
}

nav .nav-burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    cursor: pointer;
    flex-direction: column;
    gap: 0.28rem;
    color: inherit;
}

nav .nav-burger:hover,
nav .nav-burger:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    outline: none;
}

nav .nav-burger:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

nav .burger-bar {
    display: block;
    width: 1.2rem;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: opacity 0.15s;
}

nav .nav-pill {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    min-height: var(--nav-control-height);
    padding: 0.35rem var(--nav-control-padding-x);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.92rem;
}

nav .nav-pill:hover,
nav .nav-pill:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    outline: none;
}

nav .nav-pill--accent {
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
}

nav button {
    margin-top: 0;
}

nav .user-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    flex-shrink: 0;
    margin-left: auto;
}

nav .user-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

nav .user-avatar-frame {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
}

nav .user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

nav .user-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

nav .user-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 14ch;
}

nav .user-email {
    font-size: 0.85rem;
    opacity: 0.8;
}

nav .login-link {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    min-height: var(--nav-control-height);
    padding: 0.35rem var(--nav-control-padding-x);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    font-size: 0.92rem;
    white-space: nowrap;
}

nav .login-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

nav .login-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

nav .login-link--primary {
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    border-color: transparent;
    font-weight: 600;
}

nav .login-link--primary:hover {
    background: #fff;
}

nav .user-dropdown {
    position: relative;
}

nav .user-dropdown-toggle {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-height: var(--nav-control-height);
    gap: 0.55rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    color: inherit;
    padding: 0.2rem var(--nav-control-padding-x) 0.2rem 0.3rem;
    cursor: pointer;
    font: inherit;
    font-size: 0.92rem;
    white-space: nowrap;
}

nav .user-dropdown-toggle:hover,
nav .user-dropdown-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.15);
}

nav .user-dropdown-toggle:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

nav .user-dropdown.open .user-dropdown-toggle {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.55);
}

nav .user-dropdown-toggle .dropdown-icon {
    font-size: 0.8rem;
    opacity: 0.85;
}

/* Household dropdown button — self-contained styles that override the generic toggle defaults */
nav .nav-household {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.32);
    color: #fff;
    font-weight: 600;
    padding: 0.2rem var(--nav-control-padding-x) 0.2rem 0.7rem;
    gap: 0.45rem;
    font-size: 0.92rem;
}

nav .nav-household:hover,
nav .nav-household:focus-visible {
    background: rgba(255, 255, 255, 0.21);
    outline: none;
}

nav .nav-household:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

nav .user-dropdown.open .nav-household {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.6);
}

nav .nav-household__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    font-size: 0.95rem;
    line-height: 1;
    opacity: 0.9;
}

nav .nav-household__name {
    max-width: 16ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

nav .user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    min-width: 180px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 0.35rem 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
    display: none;
    flex-direction: column;
    z-index: 1000;
}

nav .household-dropdown .user-dropdown-menu {
    left: 0;
    right: auto;
}

nav .user-dropdown.open .user-dropdown-menu {
    display: flex;
}

nav .user-dropdown-menu .user-dropdown-item {
    display: block;
    padding: 0.55rem 1rem;
    color: #fff;
    text-decoration: none;
}

nav .user-dropdown-menu .household-label {
    font-weight: 600;
    cursor: default;
    opacity: 0.85;
}

nav .user-dropdown-menu .user-dropdown-item:hover,
nav .user-dropdown-menu .user-dropdown-item:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    outline: none;
}

nav .dropdown-divider {
    height: 1px;
    margin: 0.3rem 0.75rem;
    background: rgba(255, 255, 255, 0.15);
}

nav .user-dropdown-item--danger {
    color: #fca5a5;
}

nav .user-dropdown-item--danger:hover,
nav .user-dropdown-item--danger:focus-visible {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}

nav .user-dropdown-item--create {
    color: rgba(186, 230, 255, 0.85);
    font-size: 0.88rem;
}

nav .user-dropdown-item--create:hover,
nav .user-dropdown-item--create:focus-visible {
    background: rgba(96, 165, 250, 0.15);
    color: #dbeafe;
}

/* Hidden on desktop; shown only inside the mobile burger menu */
nav .nav-mobile-section {
    display: none;
}

.content {
    max-width: none;
    margin: 1.25rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.64);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(31, 41, 55, 0.08);
    border: 1px solid rgba(156, 163, 175, 0.18);
    backdrop-filter: blur(8px);
}

.timetable {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.9);
    table-layout: fixed;
}

.timetable th,
.timetable td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.timetable th {
    background: rgba(0, 0, 0, 0.05);
}

form div {
    margin-bottom: 0.5rem;
}

.edit-plan {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.edit-plan__header,
.edit-plan__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.cook-dashboard-form {
    display: contents;
}

.shopping-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.shopping-list-header h2 {
    margin-top: 0;
}

.shopping-list-header p {
    margin-bottom: 0;
}

.recipe-ingredients-section {
    margin-top: 1.5rem;
}

.recipe-ingredient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.85rem;
    margin: 0.75rem 0 1.25rem;
}

.recipe-ingredient-block {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    padding: 0.85rem;
    background: rgba(248, 250, 252, 0.78);
}

.recipe-ingredient-block h4 {
    margin: 0;
}

.recipe-ingredient-block p {
    margin: 0.2rem 0 0.55rem;
    color: #64748b;
    font-size: 0.88rem;
}

.recipe-ingredient-block ul,
.shopping-list-accumulated,
.shopping-list-sources {
    margin-top: 0.35rem;
}

.shopping-list-accumulated > li {
    margin-bottom: 0.65rem;
}

.shopping-list-sources {
    color: #64748b;
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .shopping-list-header {
        align-items: stretch;
        flex-direction: column;
    }

    .shopping-list-header .primary-button {
        width: 100%;
    }
}

.edit-plan__header h1 {
    margin: 0;
    color: #0f172a;
}

.edit-plan__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.edit-plan__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.edit-plan__grid--week {
    display: grid;
    grid-template-columns: repeat(7, minmax(160px, 1fr));
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.edit-plan .day {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    overflow: hidden;
    min-width: 0;
}

.edit-plan .day h3,
.day__title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.day__image-header {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.1);
}

.day__hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.day__remove-image-label {
    position: absolute;
    bottom: 0.4rem;
    right: 0.4rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.day__remove-image-label input {
    width: auto;
}

.day__body,
.day__image-header {
    margin-bottom: 0;
}

.day__body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem 0.75rem;
}

.edit-plan .edit-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
}

.edit-plan .edit-field--file {
    gap: 0.2rem;
}

.edit-plan label {
    display: block;
    width: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.edit-plan input {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    padding: 0.4rem 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.55);
    border-radius: 7px;
    font: inherit;
    font-size: 0.875rem;
}

.edit-plan input[type="file"] {
    font-size: 0.8rem;
    padding: 0.3rem 0.4rem;
}

.edit-plan input:focus {
    outline: none;
    border-color: rgba(47, 111, 78, 0.65);
    box-shadow: 0 0 0 3px rgba(47, 111, 78, 0.1);
}

.edit-plan .image-url-row {
    display: flex;
    gap: 0.35rem;
}

.edit-plan .image-url-row input {
    flex: 1 1 auto;
    min-width: 0;
}

.edit-plan button.clear-image-url {
    flex: 0 0 auto;
    margin: 0;
    padding: 0.35rem 0.55rem;
    border-radius: 7px;
    font-size: 0.8rem;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.4);
    cursor: pointer;
    color: #475569;
    transition: background 0.15s;
}

.edit-plan button.clear-image-url:hover {
    background: rgba(148, 163, 184, 0.22);
}

.edit-plan .image-results {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.2rem;
    min-height: 1.1rem;
    color: #64748b;
    font-size: 0.78rem;
}

.edit-plan .image-results--loading {
    align-items: center;
}

.edit-plan .image-results--loading::before {
    content: "";
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid rgba(100, 116, 139, 0.28);
    border-top-color: #2f6f4e;
    border-radius: 50%;
    animation: image-search-spin 0.8s linear infinite;
}

.edit-plan .image-results--empty {
    color: #94a3b8;
}

.edit-plan .image-option {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s;
}

.edit-plan .image-option:hover,
.edit-plan .image-option:focus-visible {
    border-color: #2f6f4e;
}

@keyframes image-search-spin {
    to {
        transform: rotate(360deg);
    }
}

form label {
    display: inline-block;
    width: 80px;
}

form input {
    padding: 0.3rem;
    width: calc(100% - 100px);
    max-width: 300px;
}

form input.image-url {
    width: calc(100% - 140px);
}

form button.clear-image-url {
    padding: 0.3rem;
    margin-left: 0.5rem;
}

.status-message {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.4);
    color: #155724;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.user-groups-form .form-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.user-groups-form label {
    display: block;
    width: auto;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.user-groups-form textarea {
    width: 100%;
    max-width: 420px;
    min-height: 90px;
    padding: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-family: inherit;
}

.user-groups-form small {
    color: rgba(0, 0, 0, 0.6);
    margin-top: 0.25rem;
    display: block;
}

.user-groups-form .checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.user-groups-form .checkbox label {
    margin-bottom: 0;
    font-weight: 500;
}

button {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #2f6f4e;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background: #285f43;
}

.button,
.primary-button,
.secondary-button,
.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0.68rem 1.05rem;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button,
.primary-button {
    background: #2f6f4e;
    color: #fff;
    box-shadow: 0 2px 8px rgba(47, 111, 78, 0.18);
}

.primary-button:hover,
.button:hover {
    transform: translateY(-1px);
    background: #285f43;
    box-shadow: 0 5px 14px rgba(47, 111, 78, 0.24);
}

.secondary-button {
    background: rgba(255, 255, 255, 0.92);
    color: #2f6f4e;
    border: 1px solid rgba(47, 111, 78, 0.28);
}

.secondary-button:hover {
    background: #f8fbf8;
    transform: translateY(-1px);
}

.link-button {
    background: none;
    border: none;
    color: #2f6f4e;
    padding: 0;
}

.link-button:hover {
    text-decoration: underline;
}

.notice {
    background: rgba(255, 255, 255, 0.84);
    border-left: 4px solid #2f6f4e;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.validation-summary,
.validation-error {
    color: #a94442;
    font-size: 0.9rem;
}

.validation-summary {
    margin-bottom: 0.75rem;
}

.card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 8px 22px rgba(31, 41, 55, 0.07);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.eyebrow {
    margin: 0 0 0.55rem;
    color: #2f6f4e;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.portal-shell {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.portal-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 1.5rem;
    overflow: hidden;
    position: relative;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: #ffffff;
}

.portal-hero__copy h1,
.register-hero h1 {
    margin: 0;
    max-width: 760px;
    color: #0f172a;
    font-size: clamp(2rem, 4.8vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.portal-hero__copy p:not(.eyebrow),
.register-hero p:not(.eyebrow),
.mealplan-header p {
    max-width: 650px;
    color: rgba(30, 41, 59, 0.72);
    line-height: 1.65;
}

.portal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.portal-hero__panel {
    min-height: 300px;
    display: flex;
    align-items: center;
}

.portal-planner-preview {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 8px;
    background: #f8fbf8;
    box-shadow: 0 12px 26px rgba(31, 41, 55, 0.08);
    overflow: hidden;
}

.portal-preview-header,
.portal-preview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.portal-preview-header {
    background: #eef5ef;
}

.portal-preview-header span,
.portal-preview-row span {
    color: #64748b;
    font-size: 0.86rem;
}

.portal-preview-header strong,
.portal-preview-row strong {
    color: #0f172a;
    text-align: right;
}

.portal-preview-row--accent {
    border-bottom: 0;
    background: #fff;
}

.portal-preview-row--accent strong {
    color: #2f6f4e;
}

.portal-steps,
.meal-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.portal-step {
    min-height: 150px;
}

.portal-step__number {
    display: inline-flex;
    margin-bottom: 1rem;
    color: rgba(47, 111, 78, 0.38);
    font-size: 2rem;
    font-weight: 900;
}

.portal-step h2 {
    margin: 0;
    color: #0f172a;
}

.portal-step p,
.portal-notice p {
    color: rgba(30, 41, 59, 0.7);
    line-height: 1.6;
}

.mealplan-board {
    padding: clamp(1.25rem, 3vw, 2rem);
}

.household-members {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.household-members__header {
    position: relative;
    overflow: hidden;
    background: #ffffff;
}

.household-members__header::after {
    content: none;
}

.household-members__heading {
    position: relative;
    z-index: 1;
}

.household-members__heading h1 {
    margin: 0;
    font-size: 1.9rem;
}

.household-name {
    margin: 0.25rem 0 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2f6f4e;
}

.household-members__intro {
    margin: 1rem 0 0;
    color: rgba(30, 41, 59, 0.78);
    line-height: 1.55;
    position: relative;
    z-index: 1;
}

.household-members__grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.5rem;
}

.household-settings-card {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.household-settings-form {
    display: flex;
    align-items: flex-end;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin: 0;
}

.household-settings-form__field {
    min-width: min(260px, 100%);
}

.household-settings-form__field small {
    color: rgba(30, 41, 59, 0.62);
    line-height: 1.4;
}

.section-heading {
    margin-bottom: 1rem;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.35rem;
}

.section-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.95rem;
    color: rgba(30, 41, 59, 0.66);
    line-height: 1.5;
}

.table-scroll {
    overflow-x: auto;
}

.members-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.members-table thead th {
    background: #eef5ef;
    color: rgba(15, 23, 42, 0.9);
    font-weight: 600;
    padding: 0.75rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.members-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    background: rgba(255, 255, 255, 0.85);
}

.members-table tbody tr:last-child td {
    border-bottom: none;
}

.members-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
}

.members-table .center-cell {
    text-align: center;
    width: 1%;
    white-space: nowrap;
}

.members-table .table-actions {
    text-align: right;
    white-space: nowrap;
}

.members-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2f6f4e;
}

.members-table input[type="number"] {
    box-sizing: border-box;
    width: 5.5rem;
    max-width: 100%;
}

.cook-recipe-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 14rem;
}

.chefkoch-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    color: #3b8047;
    background: #f3f4f0;
    border: 1px solid rgba(59, 128, 71, 0.3);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.chefkoch-icon-link:hover,
.chefkoch-icon-link:focus-visible {
    background: #e2ece3;
    border-color: rgba(59, 128, 71, 0.55);
    color: #37713f;
    outline: none;
    transform: translateY(-1px);
}

.chefkoch-icon-link:focus-visible {
    box-shadow: 0 0 0 3px rgba(59, 128, 71, 0.16);
}

.chefkoch-icon-link__hat {
    width: 1.35rem;
    height: 1.35rem;
    fill: currentColor;
}

.chefkoch-icon-link__hat path + path {
    fill: none;
    stroke: #fff;
    stroke-width: 1.6;
    stroke-linecap: round;
}

.cook-recipe-url-input {
    box-sizing: border-box;
    flex: 1 1 12rem;
    min-width: 0;
    width: 100%;
    max-width: none;
    padding: 0.45rem 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 7px;
    font: inherit;
    font-size: 0.84rem;
}

.cook-recipe-url-input:focus {
    outline: none;
    border-color: rgba(47, 111, 78, 0.65);
    box-shadow: 0 0 0 3px rgba(47, 111, 78, 0.12);
}

.cook-import-warnings {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem 0.75rem 2rem;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.08);
    color: #991b1b;
}

.cook-ingredient-state {
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.cook-ingredient-state--ready {
    background: rgba(34, 197, 94, 0.14);
    color: #166534;
}

.cook-ingredient-state--chefkoch {
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
}

.cook-ingredient-state--missing {
    background: rgba(248, 113, 113, 0.16);
    color: #991b1b;
}

.member-name {
    display: block;
    font-weight: 600;
    color: #0f172a;
}

.member-role-badges {
    display: none;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.45rem;
}

.member-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(47, 111, 78, 0.12);
    color: #2f6f4e;
    font-size: 0.75rem;
    font-weight: 600;
}

.member-email {
    color: rgba(30, 41, 59, 0.65);
    font-size: 0.9rem;
}

.members-form,
.invite-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.invite-member {
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.members-list,
.pending-invitations {
    min-width: 0;
}

.invite-member::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 248, 0.92));
    pointer-events: none;
}

.invite-member > * {
    position: relative;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.invite-form .validation-summary {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 10px;
}

.invite-form .validation-summary ul {
    margin: 0;
    padding-left: 1.25rem;
}

.form-field > label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: #0f172a;
}

.invite-email-cell {
    white-space: nowrap;
}

.invite-form input[type="email"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 8px;
    font: inherit;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.invite-email-field .input-with-icon {
    display: flex;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.invite-email-field .input-with-icon:focus-within {
    border-color: rgba(47, 111, 78, 0.65);
    box-shadow: 0 0 0 3px rgba(47, 111, 78, 0.15);
}

.invite-email-field .input-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    color: rgba(47, 111, 78, 0.8);
    font-size: 0.95rem;
}

.invite-email-field input[type="email"] {
    border: none;
    background: transparent;
    padding-left: 0;
}

.invite-form input[type="email"]:focus {
    outline: none;
    border-color: rgba(47, 111, 78, 0.6);
    box-shadow: 0 0 0 3px rgba(47, 111, 78, 0.15);
}

.form-toggle-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.65rem;
}

.form-toggle-label {
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
}

.form-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.form-toggle:hover {
    border-color: rgba(47, 111, 78, 0.5);
    background: rgba(47, 111, 78, 0.08);
    transform: translateY(-1px);
}

.form-toggle:has(input[type="checkbox"]:checked) {
    border-color: #2f6f4e;
    background: rgba(47, 111, 78, 0.12);
    box-shadow: 0 0 0 2px rgba(47, 111, 78, 0.16);
}

.form-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(47, 111, 78, 0.55);
    border-radius: 999px;
    background: #fff;
    position: relative;
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.form-toggle input[type="checkbox"]::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 999px;
    background: #2f6f4e;
    transform: scale(0);
    transition: transform 0.18s ease;
}

.form-toggle input[type="checkbox"]:checked {
    border-color: #2f6f4e;
    box-shadow: 0 0 0 3px rgba(47, 111, 78, 0.18);
}

.form-toggle input[type="checkbox"]:checked::after {
    transform: scale(1);
}

.form-toggle input[type="checkbox"]:focus-visible {
    outline: 2px solid rgba(47, 111, 78, 0.45);
    outline-offset: 2px;
}

.form-toggle label {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2f6f4e;
}

.form-toggle__content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1 1 auto;
}

.form-toggle__title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2f6f4e;
    line-height: 1.2;
    overflow-wrap: break-word;
}

.form-toggle__desc {
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(30, 41, 59, 0.65);
    line-height: 1.3;
    overflow-wrap: break-word;
}

.invite-form-actions .secondary-button {
    box-shadow: 0 10px 22px rgba(47, 111, 78, 0.14);
}

.members-mobile-list {
    display: none;
}

.member-mobile-card {
    margin-bottom: 0.75rem;
}

.member-mobile-trigger {
    display: block;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.96);
    text-decoration: none;
    color: inherit;
}

.member-mobile-trigger__name {
    display: block;
    font-weight: 700;
    color: #0f172a;
}

.member-mobile-trigger__roles {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.45rem;
}

.member-mobile-trigger__email {
    display: block;
    margin-top: 0.45rem;
    color: rgba(30, 41, 59, 0.7);
    overflow-wrap: anywhere;
}

.member-mobile-overlay {
    display: none;
}

.member-mobile-overlay:target {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: block;
}

.member-mobile-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.member-mobile-overlay__panel {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: min(92vw, 420px);
    border-radius: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.member-mobile-overlay__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.member-mobile-overlay__header h3 {
    margin: 0;
}

.member-mobile-overlay__header p {
    margin: 0.35rem 0 0;
    color: rgba(30, 41, 59, 0.7);
    overflow-wrap: anywhere;
}

.member-mobile-overlay__close {
    text-decoration: none;
    color: #2f6f4e;
    font-size: 1.8rem;
    line-height: 1;
    padding: 0.1rem 0.35rem;
}

.member-mobile-overlay__form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.member-mobile-overlay__remove {
    margin-top: auto;
}

@media (max-width: 640px) {
    .invite-email-cell {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .form-toggle-group {
        grid-template-columns: 1fr;
    }

    .invite-form-actions {
        justify-content: stretch;
    }

    .invite-form-actions .secondary-button {
        width: 100%;
    }
}

.table-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
}

.table-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2f6f4e;
    cursor: pointer;
}

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

.invitation-link-callout {
    margin-top: 0.5rem;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    border: 1px solid rgba(47, 111, 78, 0.25);
    background: rgba(47, 111, 78, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.invitation-link-label {
    display: block;
    font-weight: 600;
    color: #2f6f4e;
    margin-bottom: 0.25rem;
}

.invitation-link-url {
    word-break: break-all;
    color: #0f172a;
}

.invitation-code-value {
    display: inline-block;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    border: 1px solid rgba(47, 111, 78, 0.28);
    background: rgba(255, 255, 255, 0.88);
    color: #0f172a;
    font: 700 0.92rem/1.2 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    overflow-wrap: anywhere;
}

.invitation-link-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.copy-link-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(47, 111, 78, 0.45);
    background: rgba(47, 111, 78, 0.14);
    color: #2f6f4e;
    font-weight: 600;
    cursor: pointer;
}

.copy-link-button:hover,
.copy-link-button:focus-visible {
    background: rgba(47, 111, 78, 0.2);
}

.copy-link-button:focus-visible {
    outline: 2px solid rgba(47, 111, 78, 0.45);
    outline-offset: 2px;
}

.copy-link-feedback {
    font-size: 0.85rem;
    color: #2f6f4e;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.copy-link-feedback.visible {
    opacity: 1;
}

.copy-link-feedback.error {
    color: #7f1d1d;
}

.empty-state {
    margin: 0;
    padding: 1rem;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.12);
    color: rgba(30, 41, 59, 0.75);
}

.status-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border-left: 4px solid #2f6f4e;
    background: rgba(47, 111, 78, 0.12);
    color: #2f6f4e;
}

.status-message::before {
    content: "ℹ";
    font-size: 1.25rem;
}

.status-message.success {
    border-left-color: #22c55e;
    background: rgba(34, 197, 94, 0.16);
    color: #166534;
}

.status-message.success::before {
    content: "✔";
}

.status-message.error {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.18);
    color: #7f1d1d;
}

.status-message.error::before {
    content: "⚠";
}

.register-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.register-hero {
    padding: clamp(1.5rem, 4vw, 2.5rem);
    background: #ffffff;
}

.register-page .register-forms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.register-page .register-section {
    position: relative;
    overflow: hidden;
}

.register-section__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 1rem;
    border-radius: 14px;
    background: rgba(47, 111, 78, 0.1);
    color: #2f6f4e;
    font-size: 1.45rem;
    font-weight: 900;
}

.register-page .register-section h2 {
    margin: 0;
    color: #0f172a;
}

.register-page .register-section p,
.register-notice p {
    color: rgba(30, 41, 59, 0.72);
    line-height: 1.6;
}

.register-auth-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.register-auth-actions .register-google-button {
    width: auto;
    min-width: 220px;
}

.register-page .form-group {
    margin-bottom: 0.75rem;
}

.register-page label {
    display: block;
    width: auto;
    margin-bottom: 0.35rem;
    color: #0f172a;
    font-weight: 700;
}

.register-page input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.72rem 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.55);
    border-radius: 12px;
    font: inherit;
    background: rgba(255, 255, 255, 0.92);
}

.register-page input:focus {
    outline: none;
    border-color: rgba(47, 111, 78, 0.65);
    box-shadow: 0 0 0 4px rgba(47, 111, 78, 0.14);
}

.join-page .join-code-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.join-page .join-code-form label {
    width: auto;
    white-space: nowrap;
    font-weight: 600;
}

.join-page .join-code-form input {
    flex: 1 1 220px;
    max-width: 280px;
    padding: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.join-page .join-code-form button {
    margin-top: 0;
}

.join-page .join-accept-form {
    margin-top: 1rem;
}

.join-auth-options {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.join-auth-options p {
    margin-bottom: 0;
}

.join-auth-options .join-google-button {
    width: auto;
    min-width: 220px;
}

.join-auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.text-danger {
    color: #a94442;
}

.meal-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center;
    border-radius: 18px 18px 0 0;
    display: block;
    margin: 0;
}

.day {
    margin-bottom: 1rem;
}

.day label {
    display: block;
    margin-top: 0.5rem;
}

input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.placeholder {
    color: rgba(0, 0, 0, 0.4);
    font-style: italic;
}

.image-results {
    display: flex;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.image-option {
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin: 0.25rem;
    cursor: pointer;
}

.meal-image-preview {
    width: 100px;
    height: 100px;
    object-fit: cover;
    display: block;
    margin-bottom: 0.5rem;
}

.remove-image-label {
    display: block;
    width: auto;
    font-size: 0.8rem;
    text-align: center;
    margin-top: 0;
    color: #555;
}

.mealplan-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.mealplan-header .edit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #2f6f4e;
    background: rgba(47, 111, 78, 0.1);
    border: 1px solid rgba(47, 111, 78, 0.22);
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    font-weight: 800;
}

.mealplan-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    letter-spacing: -0.04em;
}

.meal-card-grid {
    grid-template-columns: repeat(7, 1fr);
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.meal-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 260px;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 248, 0.96));
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.07);
}

.meal-card__body {
    margin-top: auto;
    padding: 0.85rem 1rem;
}

.meal-card__day {
    display: block;
    margin-bottom: 0.45rem;
    color: #2f6f4e;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.meal-card strong {
    display: block;
    color: #0f172a;
    font-size: clamp(0.85rem, 1.1vw, 1.1rem);
    line-height: 1.35;
}

/* ── Auth pages (login, signup, forgot/reset password, verify email) ────── */

.auth-page {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.auth-title {
    margin: 0;
    color: #0f172a;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-description {
    color: rgba(30, 41, 59, 0.72);
    margin: 0;
    line-height: 1.55;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0;
}

.auth-form label {
    display: block;
    width: auto;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.92rem;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    padding: 0.6rem 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 10px;
    font: inherit;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-form input[type="email"]:focus,
.auth-form input[type="password"]:focus,
.auth-form input[type="text"]:focus {
    outline: none;
    border-color: rgba(47, 111, 78, 0.65);
    box-shadow: 0 0 0 4px rgba(47, 111, 78, 0.14);
}

.auth-submit {
    margin-top: 0.4rem;
    width: 100%;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.auth-error {
    background: rgba(239, 68, 68, 0.08);
    border-left: 4px solid rgba(239, 68, 68, 0.6);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    color: #b91c1c;
    font-size: 0.9rem;
}

.auth-notice {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-notice p {
    margin: 0;
    line-height: 1.55;
}

.auth-notice a.primary-button {
    align-self: flex-start;
}

.auth-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: rgba(30, 41, 59, 0.65);
}

.auth-links a {
    color: #2f6f4e;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.optional-hint {
    font-weight: 400;
    font-size: 0.82rem;
    color: rgba(30, 41, 59, 0.55);
}

/* Google sign-in button */
.google-signin-button {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.62rem 1.1rem;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.55);
    border-radius: 999px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    width: 100%;
}

.google-signin-button:hover {
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.google-icon {
    flex-shrink: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(30, 41, 59, 0.45);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(148, 163, 184, 0.4);
}

@media (max-width: 960px) {
    .content {
        margin: 1rem;
    }

    .portal-hero,
    .register-page .register-forms {
        grid-template-columns: 1fr;
    }

    .portal-steps {
        grid-template-columns: 1fr;
    }

    .meal-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .household-members__grid {
        grid-template-columns: 1fr;
    }

    .members-table {
        min-width: 100%;
    }
}

@media (max-width: 640px) {
    nav .nav-burger {
        display: flex;
    }

    nav .nav-links {
        display: none;
        order: 10;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        padding: 0.4rem 0 0.2rem;
        gap: 0.4rem;
    }

    nav.nav-open .nav-links {
        display: flex;
    }

    nav .user-name {
        max-width: 9ch;
    }

    /* Hide the household switcher button from the top bar — it moves into the burger menu */
    nav .household-dropdown {
        display: none;
    }

    /* Compact user button: hide name and chevron, show only avatar */
    nav .user-dropdown-toggle .user-name,
    nav .user-dropdown-toggle .dropdown-icon {
        display: none;
    }

    /* Make the user toggle a square icon button on mobile */
    nav .user-dropdown-toggle {
        padding: 0.2rem;
        border-radius: 50%;
        gap: 0;
    }

    /* Show household links inside the expanded burger menu */
    nav .nav-mobile-section {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        width: 100%;
        padding-top: 0.3rem;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        margin-top: 0.15rem;
    }

    .portal-hero__panel {
        min-height: 230px;
    }

    .mealplan-header {
        flex-direction: column;
    }

    .meal-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .invitation-link-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-actions {
        justify-content: stretch;
    }

    .form-actions .primary-button,
    .form-actions .secondary-button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 760px) {
    .members-form--desktop {
        display: none;
    }

    .members-mobile-list {
        display: block;
    }

    .table-scroll {
        overflow-x: visible;
    }

    .members-table {
        min-width: 0;
    }

    .members-table thead {
        display: none;
    }

    .members-table tbody,
    .members-table tr,
    .members-table td {
        display: block;
        width: 100%;
    }

    .members-table tbody tr {
        margin-bottom: 0.9rem;
        border: 1px solid rgba(226, 232, 240, 0.95);
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
    }

    .members-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.85rem;
        padding: 0.7rem 0.8rem;
        border-bottom: 1px solid rgba(226, 232, 240, 0.65);
    }

    .members-table td::before {
        content: attr(data-label);
        color: rgba(30, 41, 59, 0.68);
        font-size: 0.8rem;
        font-weight: 600;
        flex: 0 0 42%;
    }

    .members-table td:first-child {
        display: block;
        background: rgba(47, 111, 78, 0.06);
    }

    .members-table td:first-child::before {
        display: block;
        margin-bottom: 0.25rem;
    }

    .members-table .center-cell,
    .members-table .table-actions {
        text-align: left;
    }

    .members-table .center-cell label,
    .members-table .table-actions form {
        margin-left: auto;
    }

    .members-table .table-actions:empty {
        display: none;
    }

    .invite-email-cell {
        white-space: normal;
        word-break: break-word;
    }

    .member-role-badges {
        display: flex;
    }
}

/* ── Voting page ── */
.vote-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.vote-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.vote-header h1 {
    margin: 0.25rem 0 0;
    font-size: 1.6rem;
}

.vote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.vote-day {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
}

.vote-day__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--color1, #2f6f4e);
}

.vote-day__empty {
    color: #888;
    font-size: 0.85rem;
    margin: 0;
}

.suggestion-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.03);
    transition: background 0.15s;
}

.suggestion-item--voted {
    background: rgba(192, 57, 43, 0.07);
}

.suggestion-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-actions {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
}

/* Vote button: shows icon + count together, looks clearly interactive */
.vote-button {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    background: #fff;
    border: 1px solid rgba(192, 57, 43, 0.3);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    border-radius: 999px;
    color: #c0392b;
    transition: transform 0.1s, background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.vote-button__icon {
    font-size: 0.9rem;
    line-height: 1;
}

.vote-button__count {
    font-weight: 700;
    font-size: 0.82rem;
}

.vote-button:hover,
.vote-button:focus-visible {
    background: rgba(192, 57, 43, 0.1);
    border-color: rgba(192, 57, 43, 0.5);
    outline: none;
}

.vote-button--active {
    color: #fff;
    background: #c0392b;
    border-color: #c0392b;
}

.vote-button--active:hover,
.vote-button--active:focus-visible {
    background: #a93226;
    border-color: #a93226;
}

.delete-suggestion-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem 0.3rem;
    border-radius: 6px;
    color: #bbb;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.delete-suggestion-button:hover,
.delete-suggestion-button:focus-visible {
    color: #c0392b;
    background: rgba(192, 57, 43, 0.1);
    outline: none;
}

.add-suggestion-form {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.add-suggestion-row {
    display: block;
}

.add-suggestion-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.4rem 0.65rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.875rem;
    font: inherit;
    background: #fff;
    transition: border-color 0.2s;
}

.add-suggestion-input:focus {
    border-color: var(--color1, #2f6f4e);
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 111, 78, 0.15);
}

.add-suggestion-button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
    text-align: center;
}

@media (max-width: 600px) {
    .vote-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Settings page ── */
.settings-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 720px;
}

.settings-page__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.settings-page__header h1,
.settings-card h2 {
    margin: 0;
}

.settings-page__header p {
    margin: 0.35rem 0 0;
    color: #475569;
}

.settings-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-card h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.settings-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem 1.25rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem 1.25rem;
    align-items: end;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.settings-field label {
    display: block;
    width: auto;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.settings-field input,
.settings-field select {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    padding: 0.5rem 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 8px;
    font: inherit;
    font-size: 0.9rem;
    background: #fff;
    color: #0f172a;
}

.settings-field input[readonly] {
    background: rgba(148, 163, 184, 0.08);
    color: #475569;
    cursor: default;
}

.settings-field input:focus,
.settings-field select:focus {
    outline: none;
    border-color: var(--color1, #2f6f4e);
    box-shadow: 0 0 0 3px rgba(47, 111, 78, 0.12);
}

.settings-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.settings-checkbox input {
    width: auto;
}

.settings-password-link {
    align-self: flex-start;
    font-size: 0.875rem;
}

/* ── Superadmin Dashboard ────────────────────────────────────────────────── */

.superadmin-dashboard {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.superadmin-dashboard__header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.superadmin-dashboard__header h1 {
    margin: 0;
}

.dashboard-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1rem;
}

.stat-card {
    background: rgba(47, 111, 78, 0.08);
    border: 1px solid rgba(47, 111, 78, 0.2);
    border-radius: 0.75rem;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color1, #2f6f4e);
    line-height: 1;
}

.stat-label {
    font-size: 0.825rem;
    color: #555;
}

.user-row--inactive td {
    opacity: 0.55;
}

.status-badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
}

.status-badge--success {
    background: #d1fae5;
    color: #065f46;
}

.status-badge--danger {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge--warning {
    background: #fef3c7;
    color: #92400e;
}

.text-muted {
    color: #888;
    font-style: italic;
}

.link-button--danger {
    color: #dc2626;
}

.link-button--danger:hover {
    color: #991b1b;
}

.login-history-details {
    padding: 0;
}

.login-history-summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.login-history-summary::-webkit-details-marker {
    display: none;
}

.login-history-summary::before {
    content: "▶ ";
    font-size: 0.7em;
    opacity: 0.6;
}

details[open] > .login-history-summary::before {
    content: "▼ ";
}

.login-history-details .table-scroll {
    padding: 0 1.25rem 1rem;
}
