/* iwant2eat — base styles */

:root {
    --primary: #5a9e2f;
    --primary-2: #7ab648;
    --text: #222;
    --muted: #7a7a7a;
    --bg: #fafafa;
    --surface: #ffffff;
    --border: #e4e4e4;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.04);
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}
h1, h2, h3 { margin-top: 0; }
h1:focus { outline: none; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.page { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar .brand {
    display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
    color: var(--text); font-weight: 700; font-size: 0.85rem;
    text-decoration: none; line-height: 1;
}
.topbar .brand:hover { text-decoration: none; color: var(--primary); }
/* Clip the logo into a circle — the source PNG is square but the app
   reads cleaner with a pill-shaped brand. object-fit:cover guards against
   a future non-square source. */
.topbar .brand img {
    width: 42px; height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}
.topbar nav { display: flex; align-items: center; gap: 0.5rem; }
.topbar nav a { color: var(--text); }
/* Render the primary nav links (all top-level /recipes /ai-budget /admin
   /pricing anchors) as chips. User-badge and help "?" opt out by having
   their own classes. */
.topbar nav > a:not(.user-badge):not(.help-link) {
    background: #f1ece4; color: #5a4e3a;
    border: 1px solid #e0d6c3; border-radius: 999px;
    padding: 0.3rem 0.8rem;
    font-size: 0.9rem; font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.topbar nav > a:not(.user-badge):not(.help-link):hover {
    background: var(--primary); color: #fff; border-color: var(--primary);
    text-decoration: none;
}
.topbar nav .linklike {
    background: none; border: none; color: var(--text);
    cursor: pointer; font: inherit; padding: 0;
}
.topbar nav .linklike:hover { color: var(--primary); text-decoration: underline; }
.topbar nav .user-badge {
    display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text);
    text-decoration: none;
}
.topbar nav .user-badge:hover { text-decoration: none; color: var(--primary); }
.topbar nav .user-badge:hover .nav-avatar {
    border-color: var(--primary);
}
/* No-avatar fallback: two-letter initials in a round badge that matches
   the uploaded-avatar size so the topbar height stays stable. */
.topbar nav .user-badge .user-badge-initials {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--primary); color: #fff;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
    border: 1.5px solid var(--primary);
    user-select: none;
}
.topbar nav .user-badge:hover .user-badge-initials {
    filter: brightness(1.08);
}
/* Legacy class — older renders emitted the display name as text; kept so
   cached HTML from a prior deploy still styles reasonably. */
.topbar nav .user-badge .user-badge-name { font-weight: 500; }
.sub-badge {
    font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 999px;
    font-weight: 600; text-decoration: none;
}
.sub-badge.expired { background: #fbebe9; color: #b94737; }
.sub-badge.trial { background: #fff8f0; color: #8a6d3b; }
.nav-avatar {
    width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
    border: 1.5px solid var(--border);
}
.inline-form { display: inline; }

main {
    flex: 1; max-width: 960px; width: 100%;
    margin: 0 auto; padding: 2rem 1.25rem; box-sizing: border-box;
}

.auth-container {
    max-width: 420px; margin: 4rem auto; padding: 2rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.form-control, .form-control:focus {
    display: block; width: 100%; box-sizing: border-box;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border); border-radius: 6px;
    font-size: 1rem; background: #fff; outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(90, 158, 47, 0.15); }
.form-floating { margin-bottom: 1rem; }
.form-floating label { display: block; margin-bottom: 0.35rem; font-size: 0.85rem; color: var(--muted); }

textarea.form-control { font-family: inherit; min-height: 200px; resize: vertical; }

.btn {
    display: inline-block; padding: 0.55rem 1rem;
    border-radius: 6px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text);
    font-size: 1rem; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #4a8a25; color: #fff; }
.btn-lg { padding: 0.75rem 1.25rem; font-size: 1.05rem; }
.btn-danger { background: #b94737; border-color: #b94737; color: #fff; }
.w-100 { width: 100%; }

.text-danger, .validation-message { color: #b94737; font-size: 0.9rem; }

.alert {
    padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem;
    border: 1px solid transparent;
}
.alert-success { background: #eaf7e6; color: #2e6a28; border-color: #b8e1ae; }
.alert-danger { background: #fbebe9; color: #7a2720; border-color: #f2c3bc; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    grid-auto-rows: 1fr;
    gap: 1rem;
}
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem;
    box-shadow: var(--shadow); text-decoration: none; color: inherit;
    /* Flex column so .card-tags can use margin-top:auto to sit just above
       the absolute-positioned footer (date + icons) instead of floating
       in the middle when the title/subtitle are short. */
    display: flex; flex-direction: column;
    cursor: pointer;
}
.card:hover { border-color: var(--primary); }
.card-processing {
    cursor: not-allowed; opacity: 0.7;
    border-style: dashed; border-color: var(--muted);
    animation: pulse-processing 2s ease-in-out infinite;
}
.card-processing:hover { border-color: var(--muted); }
@keyframes pulse-processing {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.5; }
}
.card.drag-over {
    border-color: var(--primary); border-style: dashed; border-width: 2px;
    background: #f5fbf0; transition: all 0.15s;
}
.card-thumb {
    position: absolute; top: 0.6rem; right: 0.6rem;
    width: 56px; height: 56px; border-radius: 6px;
    object-fit: cover; border: 1px solid var(--border);
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    cursor: zoom-in;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    z-index: 2;
}
.card-thumb:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 14px rgba(0,0,0,0.28);
}

/* Admin impersonation warning banner — shown site-wide while an admin is in
   "view as user" mode. Loud orange so it is impossible to miss. */
.impersonation-banner {
    background: #fff4d6;
    border-bottom: 2px solid #d89a1f;
    color: #6a4f1a;
    padding: 0.6rem 1rem;
    font-size: 0.92rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
}
.impersonation-banner strong { color: #3d2c0a; }
.impersonation-return {
    background: #d89a1f; color: #fff; border: none;
    border-radius: 6px; padding: 0.35rem 0.75rem;
    font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.impersonation-return:hover { background: #b87e14; }

/* Email-verification nudge banner — shown site-wide to signed-in users
   whose AppUser.EmailConfirmed is false. Softer than the impersonation
   warning (this is informational, not a safeguard). */
.verify-banner {
    background: #eef6ff;
    border-bottom: 1px solid #bcd7f5;
    color: #24476b;
    padding: 0.55rem 1rem;
    font-size: 0.92rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
}
.verify-banner strong { color: #1b365a; }
.verify-banner em { font-style: italic; color: #1b365a; }
.verify-resend {
    background: #3477c7; color: #fff; border: none;
    border-radius: 6px; padding: 0.3rem 0.7rem;
    font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.verify-resend:hover { background: #285d9f; }

/* Chrome-extension promo banner — thin strip above the top nav on desktop
   Chromium browsers when the extension isn't already installed. Sits above
   the topbar so it doesn't shift main-content layout when it closes. */
.ext-promo-banner {
    background: #f4f7ed;
    border-bottom: 1px solid #d8e4c2;
    color: #3c5423;
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
}
.ext-promo-banner strong { color: #2c5c1f; }
.ext-promo-banner a { color: #2c5c1f; text-decoration: underline; }
.ext-promo-banner a:hover { color: #1c3d12; }
.ext-promo-close {
    background: none; border: none; cursor: pointer;
    color: #6b7a54; font-size: 1.15rem; line-height: 1;
    padding: 0 0.35rem; border-radius: 4px;
}
.ext-promo-close:hover { color: #2c5c1f; background: #e7efd4; }
/* Extension-banner.js toggles this class to hide/show. !important so Blazor
   re-renders that put hidden=false on the element don't fight us. */
.ext-promo-banner.ext-promo-hidden { display: none !important; }
/* Hidden on narrow viewports — mobile users can't install Chrome extensions. */
@media (max-width: 899px) {
    .ext-promo-banner { display: none !important; }
}

/* Site footer — small legal-link strip */
.site-footer {
    text-align: center;
    padding: 1.5rem 1rem 2rem;
    color: var(--muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--primary); text-decoration: underline; }
.site-footer span { margin: 0 0.3rem; opacity: 0.6; }
/* Copyright chunk — keeps "VolicSoftware Inc." visible even though it's
   a link by not dimming the whole span. */
.site-footer .site-footer-copy { opacity: 0.85; margin: 0 0 0 0.3rem; }
.site-footer .site-footer-copy a { opacity: 1; color: var(--muted); }
.site-footer .site-footer-copy a:hover { color: var(--primary); }

/* Segmented two-button sort switch (e.g. Name / Date on My Recipes) */
.sort-switch {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface, #fff);
    font-size: 0.85rem;
}
.sort-switch button {
    background: none;
    border: none;
    padding: 0.35rem 0.9rem;
    cursor: pointer;
    color: var(--muted);
    font-weight: 500;
    transition: background 0.12s, color 0.12s;
}
.sort-switch button + button { border-left: 1px solid var(--border); }
.sort-switch button:hover:not(.active) { color: var(--primary); background: #f5fbf0; }
.sort-switch button.active {
    background: var(--primary);
    color: #fff;
    cursor: default;
}

/* "?" help icon in the top navigation */
.help-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    color: var(--muted);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    line-height: 1;
    transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.help-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f5fbf0;
    text-decoration: none;
}

/* External (OAuth) sign-in buttons on Login / Register pages */
.oauth-separator {
    position: relative;
    text-align: center;
    margin: 1.25rem 0 1rem;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}
.oauth-separator::before {
    content: "";
    position: absolute;
    top: 50%; left: 0; right: 0;
    border-top: 1px solid var(--border);
    z-index: 0;
}
.oauth-separator span {
    position: relative;
    background: var(--surface, #fff);
    padding: 0 0.75rem;
    z-index: 1;
}
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: filter 0.12s, border-color 0.12s, background 0.12s;
}
.oauth-btn:hover { text-decoration: none; filter: brightness(0.96); }
.oauth-btn svg { width: 20px; height: 20px; flex: 0 0 20px; }

.oauth-btn--facebook {
    background: #1877F2;
    border-color: #1877F2;
    color: #fff;
}
.oauth-btn--facebook:hover { background: #166fe5; border-color: #166fe5; color: #fff; }

.oauth-btn--google {
    background: #fff;
    color: #3c4043;
}
.oauth-btn--google:hover { background: #f8f9fa; border-color: #c6c6c6; color: #3c4043; }

/* Temporarily disabled external provider button */
.oauth-btn.is-disabled,
.oauth-btn.is-disabled:hover {
    opacity: 0.5;
    filter: grayscale(100%);
    pointer-events: none;
    cursor: not-allowed;
}

/* Sub-headline under the Sign up / Sign in H1 — soft reassurance ("14 days
   free, no card") lives here so it doesn't fight the OAuth buttons. */
.auth-sub {
    color: var(--muted); font-size: 0.92rem;
    margin: -0.25rem 0 1.1rem;
    text-align: center;
}

/* Password field with an inline Show / Hide toggle — replaces the
   confirm-password field for both register and login. The toggle is an
   unstyled button so the password still clears correctly on form reset. */
.pw-field { position: relative; }
.pw-field .pw-input { padding-right: 3.5rem; }
.pw-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--muted);
    font-size: 0.82rem;
    padding: 0.25rem 0.35rem;
    cursor: pointer;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.pw-toggle:hover { color: var(--primary); background: #f4f4ee; }
.pw-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Show/hide toggle injected by js/password-toggle.js */
.password-field {
    position: relative;
    display: block;
}
.password-field > input {
    padding-right: 2.4rem !important;
    width: 100%;
    box-sizing: border-box;
}
.password-toggle {
    position: absolute;
    right: 0.3rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: #888;
    font-size: 1rem;
    line-height: 1;
    user-select: none;
}
.password-toggle:hover { color: var(--primary); }

/* AI-generated document (Write a correct recipe of, etc.) */
.ai-document {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    line-height: 1.55;
    font-size: 0.95rem;
}
.ai-document h1 { font-size: 1.4rem; color: var(--primary); margin: 0 0 0.4rem; }
.ai-document h2 { font-size: 1.05rem; margin: 1.1rem 0 0.35rem; color: #333; }
.ai-document h3 { font-size: 0.95rem; margin: 0.8rem 0 0.25rem; color: #444; }
.ai-document ul, .ai-document ol { padding-left: 1.4rem; margin: 0.3rem 0 0.6rem; }
.ai-document li { margin: 0.15rem 0; }
.ai-document p { margin: 0.35rem 0; }
.ai-document hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.ai-document em { color: var(--muted); }
.ai-document strong { color: #222; }
.ai-document-actions {
    display: flex; gap: 0.4rem; justify-content: flex-end;
    margin-bottom: 0.5rem;
}
.ai-document-actions .btn { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

/* Print / "Save as PDF" — isolate the .ai-document on the page. The
   :has() guard scopes the aggressive visibility: hidden rule to pages
   where an .ai-document element is actually present; every other page
   (recipe detail, shopping list, meal plan) uses the general
   @media print block further down. */
@media print {
    body:has(.ai-document) * { visibility: hidden !important; }
    body:has(.ai-document) .ai-document,
    body:has(.ai-document) .ai-document * { visibility: visible !important; }
    .ai-document {
        position: absolute; inset: 0;
        box-shadow: none; border: none; padding: 0;
        margin: 0; max-width: none;
    }
    .ai-document-actions { display: none !important; }
    /* Keep headings on the same page as the first item under them */
    .ai-document h1, .ai-document h2, .ai-document h3 { break-after: avoid; }
    .ai-document li, .ai-document p { break-inside: avoid; }
}

/* Lightbox overlay for expanded thumbnail */
.thumb-lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    animation: thumb-fade 0.15s ease;
    cursor: zoom-out;
}
.thumb-lightbox img {
    max-width: 90vw; max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(0,0,0,0.55);
    background: #fff;
}
@keyframes thumb-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
.card:has(.card-thumb) .title,
.card:has(.card-thumb) .subtitle,
.card:has(.card-thumb) .meta { padding-right: 64px; }
.card .title { font-weight: 600; margin-bottom: 0.15rem; }
.card .subtitle { color: var(--muted); font-size: 0.82rem; margin-bottom: 0.25rem; font-style: italic; }
.card .meta { color: var(--muted); font-size: 0.8rem; }

.card-added {
    position: absolute; bottom: 0.5rem; left: 0.8rem;
    color: var(--muted); font-size: 0.72rem; font-style: italic;
    pointer-events: none;
    display: flex; gap: 0.5rem; align-items: baseline;
}
.card-added .card-times {
    font-style: normal;
    color: var(--muted);
}
/* Reserve space at the bottom so the added-date never collides with the meta line.
   The min-height keeps short cards (e.g. a failure row with just a title) tall
   enough that the absolute-positioned trash button at the bottom-right doesn't
   end up behind the 56x56 thumbnail pinned at the top-right. */
.card { padding-bottom: 1.9rem; min-height: 6.5rem; }

.trash-btn {
    position: absolute; bottom: 0.3rem; right: 0.6rem;
    background: none; border: none; cursor: pointer;
    color: #ccc; padding: 2px; border-radius: 4px;
    transition: color 0.15s;
    line-height: 0;
    /* Sits above the thumbnail if the card is ever too short to fully clear
       it — the trash button must stay clickable no matter what. */
    z-index: 2;
}
.trash-btn:hover { color: #b94737; }

/* -------- Tags -------- */
.tag-bar {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
    align-items: center; margin-bottom: 0.6rem;
}
.tag-bar-bottom {
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px dashed var(--border);
}
.tag-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.2rem 0.5rem 0.2rem 0.65rem;
    background: #f1ece4; color: #5a4e3a;
    border: 1px solid #e0d6c3; border-radius: 999px;
    font-size: 0.85rem; cursor: pointer; user-select: none;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.tag-chip:hover { background: #e9e0cf; }
.tag-chip.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}
.tag-chip.active:hover { background: #4e8a2a; }
.tag-chip[draggable="true"] { cursor: grab; }
.tag-chip[draggable="true"]:active { cursor: grabbing; }
.tag-chip-count {
    font-size: 0.75rem; opacity: 0.7;
}
.tag-chip.active .tag-chip-count { opacity: 0.9; }
.tag-chip-x {
    background: none; border: none; cursor: pointer;
    color: inherit; opacity: 0.55; font-size: 1rem; line-height: 1;
    padding: 0 0 0 0.1rem;
}
.tag-chip.editing {
    background: #fff; color: var(--text); cursor: text;
    padding: 0.15rem 0.4rem;
}
.tag-chip-edit {
    background: transparent; border: none; outline: none;
    color: inherit; font: inherit; width: 9rem;
    padding: 0;
}
.tag-chip-x:hover { opacity: 1; }
.tag-add-input {
    background: transparent; border: 1px dashed #c7bda6;
    border-radius: 999px; padding: 0.2rem 0.7rem;
    color: var(--muted); font-size: 0.85rem; min-width: 8rem;
}
.tag-add-input:focus { outline: none; border-color: var(--primary); color: var(--text); }
.tag-delete-confirm {
    background: #fff8f0; border: 1px solid #f0d8b0; color: #8a6d3b;
    border-radius: 8px; padding: 0.6rem 0.9rem;
    margin-bottom: 0.75rem; font-size: 0.92rem;
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.tag-delete-confirm .btn-yes {
    background: #b94737; color: #fff; border: none; border-radius: 4px;
    padding: 0.2rem 0.7rem; cursor: pointer; font-size: 0.85rem;
}
.tag-delete-confirm .btn-no {
    background: #e4e4e4; color: #333; border: none; border-radius: 4px;
    padding: 0.2rem 0.7rem; cursor: pointer; font-size: 0.85rem;
}
.card-tags {
    display: flex; flex-wrap: wrap; gap: 0.25rem;
    margin-top: auto;
    padding-top: 0.4rem;
}
.card-tag-chip {
    display: inline-flex; align-items: center; gap: 0.25rem;
    background: #f1ece4; color: #5a4e3a;
    border: 1px solid #e0d6c3; border-radius: 999px;
    padding: 0.08rem 0.45rem 0.08rem 0.55rem;
    font-size: 0.75rem;
}
.card.tag-drop-hover {
    border-color: var(--primary); border-style: dashed;
    background: #f5fbf0;
}

/* Heart icon tucked into the top-left corner of a recipe card. Transparent
   background so it doesn't cover the title; only the heart shape itself is
   visible. Grey outline by default, red filled once the recipe is a favorite. */
.card-fav-btn {
    position: absolute; top: 0.1rem; left: 0.1rem;
    background: none; border: none; cursor: pointer;
    color: #ccc; padding: 2px; border-radius: 999px;
    line-height: 0;
    transition: color 0.15s, transform 0.15s;
    z-index: 1;
}
.card-fav-btn:hover { color: #e0493a; transform: scale(1.15); }
.card-fav-btn.on { color: #e0493a; }

/* Target-people control used on both the shopping list detail page and
   the create-list modal — a circle with the current number always visible,
   and −/+ buttons that fade in when the wrapper is hovered or focused. */
.sl-people {
    display: inline-flex; align-items: center; gap: 0;
    padding: 0.25rem 0.5rem; border-radius: 999px;
    outline: none; cursor: default;
}
.sl-people-circle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; border-radius: 50%;
    background: var(--primary); color: #fff;
    font-weight: 600; font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}
.sl-people-btn {
    background: #f2f2f2; border: 1px solid var(--border); color: #555;
    width: 2rem; height: 2rem; border-radius: 50%;
    line-height: 1; font-size: 1.1rem;
    cursor: pointer; padding: 0;
    opacity: 0; transform: scale(0.7);
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s, margin 0.15s;
    margin: 0;
}
.sl-people:hover .sl-people-btn,
.sl-people:focus-within .sl-people-btn {
    opacity: 1; transform: scale(1); pointer-events: auto;
}
.sl-people:hover .sl-people-dec,
.sl-people:focus-within .sl-people-dec { margin-right: 0.4rem; }
.sl-people:hover .sl-people-inc,
.sl-people:focus-within .sl-people-inc { margin-left: 0.4rem; }
.sl-people-btn:hover:not(:disabled) { background: #e4e4e4; color: #000; }
.sl-people-btn:disabled { opacity: 0.3 !important; cursor: default; }

/* Cart icon next to the heart — adds the recipe to a shopping list. */
.card-sl-btn {
    position: absolute; top: 0.25rem; left: 2rem;
    background: none; border: none; cursor: pointer;
    color: #c9a349; padding: 2px; border-radius: 999px;
    line-height: 0;
    transition: color 0.15s, transform 0.15s;
    z-index: 1;
}
.card-sl-btn:hover { color: #8a6c1f; transform: scale(1.15); }

/* Shared picker modal — matches RecipeDetail's reprocess-modal styling. */
.sl-pick-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.sl-pick-modal {
    background: #fff; border-radius: 8px; padding: 1.25rem 1.5rem;
    max-width: 460px; width: calc(100% - 2rem);
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.sl-pick-modal h3 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.sl-pick-list {
    list-style: none; padding: 0; margin: 0.5rem 0 1rem;
    max-height: 40vh; overflow-y: auto;
}
.sl-pick-list > li { margin: 0.3rem 0; }
.sl-pick-option {
    display: block; width: 100%; text-align: left;
    background: #fef9ed; border: 1px solid #e8d9a8; border-radius: 6px;
    padding: 0.5rem 0.75rem; cursor: pointer;
    transition: border-color 0.15s;
}
.sl-pick-option:hover:not(:disabled) { border-color: #c99620; }
.sl-pick-option:disabled { opacity: 0.55; cursor: default; }
.sl-pick-option.current { background: #f3e5b8; }
.sl-pick-name { font-weight: 600; display: block; }
.sl-pick-meta { color: var(--muted); font-size: 0.85rem; }
.sl-pick-current { color: #7a5e0c; font-style: italic; margin-left: 0.25rem; }

/* Heart button next to the recipe detail title. Inherits the h1 red. */
.fav-btn {
    background: none; border: none; cursor: pointer;
    color: #d0d0d0; padding: 2px; border-radius: 6px;
    line-height: 0;
    transition: color 0.15s, transform 0.15s;
}
.fav-btn:hover { color: #e0493a; transform: scale(1.08); }
.fav-btn.on { color: #e0493a; }

/* Favorites-only filter toggle in the toolbar. Same sizing as the sort
   switch so they sit flush next to each other. Heart turns red when on. */
.fav-toggle {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 6px; padding: 0.35rem 0.55rem; cursor: pointer;
    color: #bbb; line-height: 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.fav-toggle:hover { color: #e0493a; border-color: #e0c5c1; }
.fav-toggle.on {
    color: #e0493a; border-color: #e0493a; background: #fff5f3;
}

/* Admin-only reprocess icon, sits just to the left of the trash icon.
   Bottom-aligned with the card date and the trash icon. */
.reprocess-btn {
    position: absolute; bottom: 0.3rem; right: 1.9rem;
    background: none; border: none; cursor: pointer;
    color: #ccc; padding: 2px; border-radius: 4px;
    transition: color 0.15s;
    line-height: 0;
    z-index: 2;
}
.reprocess-btn:hover { color: var(--primary); }
.reprocess-btn:disabled { cursor: default; color: var(--primary); }
.reprocess-btn .spin {
    animation: rp-spin 0.9s linear infinite;
    transform-origin: 50% 50%;
}
@keyframes rp-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.delete-confirm {
    position: absolute; bottom: 0.5rem; right: 0.5rem;
    display: flex; align-items: center; gap: 0.4rem;
    background: #fff8f7; border: 1px solid #f2c3bc; border-radius: 6px;
    padding: 0.25rem 0.5rem; font-size: 0.8rem;
}
.delete-confirm span { color: #7a2720; }
.delete-confirm .btn-yes {
    background: #b94737; color: #fff; border: none; border-radius: 4px;
    padding: 0.15rem 0.5rem; cursor: pointer; font-size: 0.75rem;
}
.delete-confirm .btn-yes:hover { background: #9a3a2d; }
.delete-confirm .btn-no {
    background: #e4e4e4; color: #333; border: none; border-radius: 4px;
    padding: 0.15rem 0.5rem; cursor: pointer; font-size: 0.75rem;
}

.add-drop-banner {
    display: block; text-align: center; text-decoration: none;
    background: var(--primary); color: #fff;
    border-radius: var(--radius); padding: 1.25rem 1.5rem;
    margin-bottom: 1rem; transition: all 0.15s;
}
.add-drop-banner:hover { background: #4a8a25; text-decoration: none; color: #fff; }
.add-drop-banner .add-drop-hint { font-size: 0.9rem; opacity: 0.85; }
.add-drop-banner.drag-over {
    background: #4a8a25; transform: scale(1.02);
    box-shadow: 0 0 16px rgba(90, 158, 47, 0.5);
    border: 2px dashed #fff;
}
.add-drop-banner.drag-over .add-drop-hint::after { content: ' here'; }

.pagination {
    display: flex; gap: 0.4rem; justify-content: center;
    margin-top: 1.5rem; flex-wrap: wrap;
}
.pagination .btn { min-width: 2.2rem; padding: 0.4rem 0.6rem; font-size: 0.9rem; }

.empty-hint {
    padding: 2rem; border: 2px dashed var(--border); border-radius: var(--radius);
    text-align: center; color: var(--muted);
}

/* First-time-user onboarding panel on /recipes when the vault is empty.
   Three cards explaining the intake channels (email / paste / extension),
   plus a "load samples" button so the user always has content to poke. */
.onboarding {
    max-width: 920px; margin: 1rem auto 2rem;
}
.onboarding-title { margin: 0 0 0.25rem; font-size: 1.6rem; }
.onboarding-lead { color: var(--muted); margin: 0 0 1.25rem; }
.onboarding-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
    margin-bottom: 1.5rem;
}
.onboarding-card {
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    padding: 1rem 1.1rem;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.onboarding-card h3 { margin: 0; font-size: 1.05rem; }
.onboarding-card p { margin: 0; color: #444; font-size: 0.92rem; }
.onboarding-card .btn { align-self: flex-start; margin-top: 0.2rem; }
.onboarding-icon { font-size: 1.6rem; line-height: 1; }
.onboarding-email {
    display: inline-block; padding: 0.15rem 0.4rem;
    background: #fbf8ef; border: 1px solid #e8dfc3; border-radius: 4px;
    font-size: 0.9rem;
}
.onboarding-small { color: var(--muted); font-size: 0.82rem; }
.onboarding-samples {
    padding: 1rem 1.1rem;
    background: #fbf9f3; border: 1px dashed #d8cfb9; border-radius: 8px;
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.onboarding-samples .onboarding-small { margin: 0; flex: 1; min-width: 16rem; }
@media (max-width: 760px) {
    .onboarding-grid { grid-template-columns: 1fr; }
}
.email-list { list-style: none; padding: 0; }
.email-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 0; border-bottom: 1px solid var(--border);
}
.email-list .chip {
    font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 999px;
    background: #f0f0f0; color: var(--muted);
}
.email-list .chip.primary { background: #ffe3de; color: var(--primary); }
.email-list .chip.verified { background: #e5f2de; color: #2e6a28; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.darker-border-checkbox.form-check-input { border-color: #929292; }

#blazor-error-ui {
    background: lightyellow; bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2); display: none;
    left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.blazor-error-boundary {
    background: #b32121; color: white; padding: 1rem;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

/* ---------- MyRecipes: two-level sidebar navigation ---------- */
.recipes-layout {
    display: flex; gap: 1.25rem; align-items: flex-start;
}
.recipes-sidebar {
    width: 200px; flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem;
    position: sticky; top: 1rem;
}
.recipes-content { flex: 1; min-width: 0; }

.sidebar-section + .sidebar-section { margin-top: 1rem; }
.sidebar-heading {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--muted);
    padding: 0.25rem 0.5rem 0.35rem; margin: 0;
}
.sidebar-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.4rem; width: 100%;
    padding: 0.4rem 0.55rem; margin: 0.1rem 0;
    background: transparent; border: 0; border-radius: 6px;
    font: inherit; color: var(--text); text-align: left;
    cursor: pointer;
}
.sidebar-item:hover { background: rgba(90, 158, 47, 0.08); }
.sidebar-item.active {
    background: rgba(90, 158, 47, 0.15);
    color: var(--primary); font-weight: 600;
}
.sidebar-subitem {
    padding-left: 1rem; font-size: 0.9rem;
}
.sidebar-label {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-count {
    color: var(--muted); font-size: 0.78rem;
    background: var(--bg); padding: 0.05rem 0.4rem; border-radius: 10px;
    flex-shrink: 0;
}
.sidebar-item.active .sidebar-count { background: var(--surface); color: var(--primary); }

@media (max-width: 720px) {
    .recipes-layout { flex-direction: column; }
    .recipes-sidebar {
        width: 100%; position: static;
        /* Cap height on mobile so a long title list doesn't push the cards off-screen. */
        max-height: 50vh; overflow-y: auto;
    }
}

/* Small row that hosts the Print + PDF buttons on the recipe, shopping-
   list, and meal-plan pages. Stays out of the way on screen and the
   whole row is .no-print so it never lands in the output. */
.page-actions {
    display: flex; gap: 0.5rem; flex-wrap: wrap;
    margin: 0 0 1rem;
}
.page-actions .btn { padding: 0.3rem 0.75rem; font-size: 0.85rem; }

/* Browser print output: hide every piece of chrome (topbar nav, footer,
   in-page buttons, toolbars, install prompt, cooking overlay). What's
   left is the page body — the thing the user actually wants on paper. */
@page { margin: 12mm 14mm; }
@media print {
    .topbar, .site-footer, .no-print, .install-prompt,
    #blazor-error-ui { display: none !important; }
    main { max-width: none !important; padding: 0 !important; }
    body { background: #fff !important; }
    a { color: inherit !important; text-decoration: none !important; }
}

/* PWA install prompt — small banner pinned to the bottom, built by
   /js/install-prompt.js. Styled here so first paint isn't flashes-of-
   unstyled-banner on slow connections. */
.install-prompt {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000;
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    background: #fff; color: #333;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    font-size: 0.9rem;
    padding-bottom: calc(0.65rem + env(safe-area-inset-bottom));
}
.install-prompt-icon {
    width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0;
}
.install-prompt-text {
    flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25;
}
.install-prompt-text strong { font-size: 0.95rem; }
.install-prompt-text span { color: #666; font-size: 0.85rem; }
.install-prompt-text em { font-style: normal; font-weight: 600; color: #333; }
.install-prompt-action {
    background: var(--primary); color: #fff; border: none;
    border-radius: 6px; padding: 0.5rem 0.9rem;
    font-weight: 600; font-size: 0.9rem; cursor: pointer;
}
.install-prompt-action:hover { filter: brightness(0.95); }
.install-prompt-close {
    background: none; border: none; color: #888; font-size: 1.4rem;
    line-height: 1; cursor: pointer; padding: 0 0.25rem;
}
.install-prompt-close:hover { color: #333; }

