/* 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); }
.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;
    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);
}
/* When there is no avatar, render just the display name (no orphan
   border or placeholder circle). */
.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; }

/* 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; }

/* 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;
}

/* 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. */
@media print {
    body * { visibility: hidden !important; }
    .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;
}
/* Reserve space at the bottom so the added-date never collides with the meta line */
.card { padding-bottom: 1.9rem; }

.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;
}
.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; }

/* 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;
}
.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);
}
.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;
    }
}
