/* Nostravino — visual design system v2
   Premium wine UX: layered shadows, refined typography, micro-animations.
   Palette goes from cream → terracotta → burgundy → oxblood, with gold and
   chalk accents. Grain texture overlays on backgrounds. */

:root {
    --bg:           #f8f1e7;
    --bg-tint:      #f3e7d2;
    --bg-card:      #fffaf2;
    --bg-elevated:  #ffffff;

    --ink:          #221912;
    --ink-soft:     #5b4a3f;
    --ink-muted:    #9b8e7c;

    --line:         #e7dcc9;
    --line-strong:  #d2c4ac;

    --wine:         #7a2f3a;
    --wine-deep:    #5e2530;
    --wine-darker:  #3d1820;
    --wine-tint:    #f3e2e0;
    --oxblood:      #4a1418;

    --gold:         #c89b3e;
    --gold-deep:    #a37915;
    --gold-soft:    #efe2c2;

    --champagne:    #f4e7c3;
    --chalk:        #fbf7ee;

    --moss:         #6b7a47;
    --moss-soft:    #d8e0c2;
    --sky:          #4b6577;

    --radius-s: 6px;
    --radius:   12px;
    --radius-l: 18px;
    --radius-xl: 24px;

    /* Layered, soft shadows */
    --shadow-s:  0 1px 2px rgba(46, 30, 22, 0.05),
                 0 1px 1px rgba(46, 30, 22, 0.03);
    --shadow:    0 4px 12px rgba(46, 30, 22, 0.07),
                 0 1px 3px rgba(46, 30, 22, 0.05);
    --shadow-l:  0 14px 32px rgba(46, 30, 22, 0.10),
                 0 4px 12px rgba(46, 30, 22, 0.06);
    --shadow-xl: 0 30px 60px rgba(46, 30, 22, 0.12),
                 0 12px 24px rgba(46, 30, 22, 0.08);

    /* Subtle paper grain via SVG data URI (no extra request) */
    --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.13  0 0 0 0 0.10  0 0 0 0 0.07  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.7'/></svg>");

    --serif:  "Cormorant Garamond", "EB Garamond", "Playfair Display", Georgia, serif;
    --sans:   "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Dark mode: a candlelit wine-cellar atmosphere. Warmer near-black bg,
   cream ink, slightly brighter wine/gold so they pop on dark surfaces. */
:root[data-theme="dark"] {
    --bg:           #1a1410;
    --bg-tint:      #221a14;
    --bg-card:      #2a211c;
    --bg-elevated:  #312820;

    --ink:          #ede5d6;
    --ink-soft:     #b8ad9a;
    --ink-muted:    #80735f;

    --line:         #3a2f28;
    --line-strong:  #4d3f33;

    --wine:         #d44a5a;
    --wine-deep:    #b8364a;
    --wine-darker:  #8a2638;
    --wine-tint:    #3a1820;
    --oxblood:      #c33545;

    --gold:         #d4a653;
    --gold-deep:    #c89940;
    --gold-soft:    #4a3d20;

    --champagne:    #54472a;
    --chalk:        #2d251f;

    --moss:         #93a370;
    --moss-soft:    #3a4530;
    --sky:          #7a98ab;

    --shadow-s:  0 1px 2px rgba(0, 0, 0, 0.40),
                 0 1px 1px rgba(0, 0, 0, 0.28);
    --shadow:    0 4px 12px rgba(0, 0, 0, 0.45),
                 0 1px 3px rgba(0, 0, 0, 0.30);
    --shadow-l:  0 14px 32px rgba(0, 0, 0, 0.55),
                 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-xl: 0 30px 60px rgba(0, 0, 0, 0.65),
                 0 12px 24px rgba(0, 0, 0, 0.45);

    /* Dim the paper-grain noise — it's distracting on dark surfaces */
    --grain: none;

    color-scheme: dark;
}

/* Topnav glass is hardcoded with light-mode rgba — adjust for dark */
:root[data-theme="dark"] .topnav {
    background: rgba(26, 20, 16, 0.78);
    border-bottom-color: rgba(58, 47, 40, 0.7);
}
:root[data-theme="dark"] .nav-links {
    background: rgba(26, 20, 16, 0.98);
    border-bottom-color: rgba(58, 47, 40, 0.7);
}

/* Color pills on cellar/wishlist cards use hardcoded hex — soften in dark */
:root[data-theme="dark"] .tag {
    filter: brightness(1.05);
}

/* Form inputs need a contrasting dark fill */
:root[data-theme="dark"] .input,
:root[data-theme="dark"] .textarea {
    background: var(--bg-elevated);
    color: var(--ink);
    border-color: var(--line);
}
:root[data-theme="dark"] .input::placeholder,
:root[data-theme="dark"] .textarea::placeholder {
    color: var(--ink-muted);
}
:root[data-theme="dark"] select.input {
    background: var(--bg-elevated);
}

/* Empty-state, code blocks, and elevated cards use hardcoded near-white */
:root[data-theme="dark"] code {
    background: var(--bg-elevated);
    color: var(--ink);
}

/* Smooth transition when toggling themes */
html, body, .card, .topnav, .input, .textarea, .btn {
    transition: background-color 220ms var(--ease-out), color 220ms var(--ease-out),
                border-color 220ms var(--ease-out);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 1200px 600px at 50% -200px, rgba(122,47,58,0.06), transparent 60%),
        radial-gradient(ellipse 800px 400px at 10% 110%, rgba(200,155,62,0.06), transparent 60%);
    background-attachment: fixed;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    position: relative;
    /* Respect iPhone notch + home-bar */
    padding: env(safe-area-inset-top) env(safe-area-inset-right)
             env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Tap targets ≥ 44pt for iOS */
button, .btn, .checkpill, .nav-links a, .info-i, input, select, textarea {
    -webkit-tap-highlight-color: rgba(122,47,58,0.10);
}

/* Universal: HTML `hidden` attribute must beat any class-level display rule */
[hidden] { display: none !important; }
input[type="number"], input[type="email"], input[type="text"], input[type="date"], textarea, select {
    font-size: 16px;            /* prevents iOS zoom on focus */
}

/* Grain overlay (very subtle) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: var(--grain);
    background-size: 220px 220px;
    opacity: 0.5;
    mix-blend-mode: multiply;
    z-index: 0;
}

main { position: relative; z-index: 1; }

a { color: var(--wine); text-decoration: none; transition: color 160ms var(--ease-out); }
a:hover { color: var(--oxblood); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.005em;
    margin: 0 0 .5em;
    line-height: 1.1;
}
h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); line-height: 1.18; }
h3 { font-size: 1.5rem; line-height: 1.25; }
h4 { font-size: 1.18rem; }

.display {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 0.95;
    letter-spacing: -0.018em;
}
.display em {
    font-style: italic;
    color: var(--wine);
    font-weight: 500;
}
.display .stroke {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--wine);
    font-style: italic;
}

.eyebrow {
    font-family: var(--sans);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold-deep);
}
.eyebrow.muted { color: var(--ink-muted); }

p { margin: 0 0 1em; }
.muted { color: var(--ink-muted); }
.soft  { color: var(--ink-soft); }
.serif { font-family: var(--serif); }
.italic { font-style: italic; }
.center { text-align: center; }
.lede { font-size: 1.18rem; line-height: 1.6; color: var(--ink-soft); max-width: 56ch; }

/* Drop-cap on first paragraph of selected sections */
.dropcap::first-letter {
    font-family: var(--serif);
    font-size: 4em;
    line-height: 0.9;
    float: left;
    color: var(--wine);
    padding: 4px 12px 0 0;
    margin-top: 0.1em;
    font-weight: 500;
}

/* --- Layout --- */
.container        { max-width: 1100px; margin: 0 auto; padding: 0 28px; }
.container-narrow { max-width:  720px; margin: 0 auto; padding: 0 24px; }
.container-wide   { max-width: 1280px; margin: 0 auto; padding: 0 32px; }

.stack > * + *    { margin-top: 1rem; }
.stack-sm > * + * { margin-top: 0.5rem; }
.stack-lg > * + * { margin-top: 2rem; }
.stack-xl > * + * { margin-top: 3rem; }

.row     { display: flex; gap: 16px; flex-wrap: wrap; }
.row-tight { gap: 8px; }
.row-loose { gap: 24px; }
.row-baseline { align-items: baseline; }
.row-center  { align-items: center; }
.row-between { justify-content: space-between; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-asym { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; }
@media (max-width: 800px) {
    .grid-2, .grid-3, .grid-asym { grid-template-columns: 1fr; gap: 20px; }
}

hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
    margin: 2rem 0;
}

.divider-ornament {
    text-align: center;
    margin: 3rem 0;
    color: var(--gold);
    font-size: 1.3rem;
    letter-spacing: 1em;
}
.divider-ornament::before, .divider-ornament::after {
    content: "";
    display: inline-block;
    width: 60px;
    height: 1px;
    background: var(--line-strong);
    vertical-align: middle;
    margin: 0 16px;
}

/* --- Top nav (subtle, sticky, glass) --- */
.topnav {
    background: rgba(248, 241, 231, 0.72);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid rgba(231, 220, 201, 0.6);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: padding 200ms var(--ease-out);
}
.topnav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    max-width: 1280px;
    margin: 0 auto;
    position: relative;  /* anchor for mobile nav-links absolute panel */
}
.brand {
    font-family: var(--serif);
    font-size: 1.6rem;
    color: var(--wine);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.brand::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--gold), var(--gold-deep));
    box-shadow: 0 1px 3px rgba(163,121,21,0.4);
}
.brand:hover { text-decoration: none; color: var(--oxblood); }

/* Nav-bar dropdowns (Kelder, Meer) — same details/summary pattern as user-menu */
.nav-dropdown {
    position: relative;
    display: inline-block;
}
.nav-dropdown summary {
    list-style: none;
    cursor: pointer;
    color: var(--ink-soft);
    font-size: 0.94rem;
    font-weight: 500;
    padding: 8px 0;
    user-select: none;
    transition: color 160ms;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary:hover { color: var(--ink); }
.nav-dropdown summary.active { color: var(--wine); }
.nav-dropdown[open] summary { color: var(--wine); }
.nav-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: -8px;
    min-width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 6px;
    z-index: 100;
    animation: nav-dd-in 160ms var(--ease-out);
}
@keyframes nav-dd-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.nav-dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background-color 120ms;
}
.nav-dropdown-item:hover {
    background: var(--bg-tint);
    text-decoration: none;
    color: var(--ink);
}
.nav-dropdown-item.active { color: var(--wine); background: rgba(122,47,58,0.06); }
.nav-dd-icon {
    width: 22px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.nav-dropdown-divider {
    height: 1px;
    background: var(--line);
    margin: 6px 4px;
}

/* Hamburger button — hidden by default, only shows on narrow viewports */
.nav-hamburger {
    display: none;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    width: 38px; height: 38px;
    padding: 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}
.nav-hamburger:hover { background: rgba(231, 220, 201, 0.4); }
.nav-hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
    border-radius: 1px;
    transition: transform 200ms var(--ease-out), opacity 200ms;
}
body.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; }
body.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a {
    color: var(--ink-soft);
    font-size: 0.94rem;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: color 160ms var(--ease-out);
}
.nav-links a::after {
    content: "";
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 1.5px;
    background: var(--wine);
    transition: width 220ms var(--ease-out), left 220ms var(--ease-out);
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a:hover::after { width: 100%; left: 0; }
.nav-links a.active { color: var(--wine); }
.nav-links a.active::after { width: 100%; left: 0; background: var(--wine); }
/* --- User menu dropdown (replaces old plain nav-user) --- */
.user-menu {
    position: relative;
    margin-left: 12px;
    padding-left: 18px;
    border-left: 1px solid var(--line);
}
.user-menu summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: 0.88rem;
    transition: background 150ms;
    user-select: none;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary::marker { display: none; }
.user-menu summary:hover {
    background: var(--bg-card);
    color: var(--ink);
}
.user-menu-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wine), var(--wine-deep));
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 0;
}
.user-menu-name {
    font-weight: 500;
    color: inherit;
}
.user-menu-caret {
    font-size: 0.7rem;
    color: var(--ink-muted);
    transition: transform 180ms var(--ease-out);
    margin-top: 1px;
}
.user-menu[open] .user-menu-caret { transform: rotate(180deg); }
.user-menu[open] summary {
    background: var(--bg-card);
    color: var(--ink);
}

.user-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 260px;
    background: var(--bg-elevated);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    padding: 8px;
    z-index: 60;
    animation: userMenuIn 160ms var(--ease-out);
}
@keyframes userMenuIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.user-menu-header {
    padding: 12px 14px 14px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 6px;
}
.user-menu-email {
    margin: 0;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 500;
    word-break: break-all;
}
.user-menu-tier {
    margin: 6px 0 0;
}
.user-menu-badge {
    display: inline-block;
    background: var(--gold-soft);
    color: var(--wine-deep);
    border: 1px solid rgba(200, 155, 62, 0.4);
    padding: 2px 9px 3px;
    border-radius: 999px;
    font-size: 0.72rem;
    text-transform: capitalize;
    letter-spacing: 0.02em;
    font-weight: 500;
}
.user-menu-badge-admin {
    background: var(--wine);
    color: #fff;
    border-color: var(--wine-deep);
}
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--ink);
    text-decoration: none;
    border-radius: var(--radius-s);
    font-size: 0.92rem;
    transition: background 120ms, color 120ms;
}
.user-menu-item:hover {
    background: var(--bg-card);
    color: var(--wine);
}
.user-menu-item-admin:hover { color: var(--wine-deep); }
.user-menu-item-quiet { color: var(--ink-soft); }
.user-menu-icon {
    width: 22px;
    text-align: center;
    color: var(--ink-muted);
    font-size: 0.95rem;
}
.user-menu-item:hover .user-menu-icon { color: var(--wine); }
.user-menu-divider {
    height: 1px;
    background: var(--line);
    margin: 6px 4px;
}

/* Theme switch — three small buttons in the user-menu */
.user-menu-theme {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    margin: 4px 0 2px;
}
.user-menu-theme-label {
    font-size: 0.86rem;
    color: var(--ink-soft);
}
.user-menu-theme-options {
    display: inline-flex;
    gap: 4px;
    background: var(--bg-tint);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px;
}
.theme-opt {
    background: transparent;
    border: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0;
    color: var(--ink-soft);
    transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.theme-opt:hover { color: var(--ink); }
.theme-opt-active {
    background: var(--bg-card);
    color: var(--wine);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

@media (max-width: 760px) {
    .nav-links { gap: 14px; }
    .nav-links a { font-size: 0.85rem; }
    .user-menu { padding-left: 10px; margin-left: 6px; }
    .user-menu-name { display: none; }
    .user-menu-panel { min-width: 240px; right: -8px; }
}

/* Mobile: collapse the topnav into a hamburger menu */
@media (max-width: 640px) {
    .nav-hamburger { display: inline-flex; }
    .topnav-inner { padding: 12px 18px; }
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: rgba(248, 241, 231, 0.98);
        backdrop-filter: blur(14px) saturate(140%);
        -webkit-backdrop-filter: blur(14px) saturate(140%);
        border-bottom: 1px solid rgba(231, 220, 201, 0.6);
        box-shadow: 0 10px 24px -12px rgba(58, 27, 32, 0.18);
        padding: 8px 0 14px;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        opacity: 0;
        transform: translateY(-8px);
        pointer-events: none;
        transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
    }
    body.nav-open .nav-links {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    .nav-links a {
        padding: 12px 22px;
        font-size: 0.98rem;
        border-bottom: 1px solid rgba(231, 220, 201, 0.4);
    }
    .nav-links a:last-of-type { border-bottom: none; }
    .nav-links a::after { display: none; }  /* hide underline-on-hover on mobile */
    .nav-links a.active { background: rgba(180, 56, 70, 0.06); color: var(--wine); }

    /* Nav-dropdowns inside the mobile slide-down panel — flatten them */
    .nav-dropdown { width: 100%; }
    .nav-dropdown summary {
        padding: 12px 22px;
        font-size: 0.98rem;
        border-bottom: 1px solid rgba(231, 220, 201, 0.4);
        color: var(--ink);
    }
    .nav-dropdown-panel {
        position: static;
        background: rgba(231, 220, 201, 0.18);
        box-shadow: none;
        border: 0;
        border-radius: 0;
        padding: 0;
        margin: 0;
    }
    .nav-dropdown-item {
        padding: 11px 22px 11px 44px;
        border-bottom: 1px solid rgba(231, 220, 201, 0.3);
        border-radius: 0;
    }

    /* User-menu inside the mobile panel — keep the dropdown style but adapt margins */
    .user-menu {
        margin: 8px 14px 0;
        padding-left: 14px;
        border-left: 3px solid var(--gold);
    }
    .user-menu-name { display: inline; }
    .user-menu-panel {
        position: static;
        margin-top: 10px;
        box-shadow: none;
        border: 1px solid var(--line);
    }
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-s);
    transition: transform 240ms var(--ease-out), box-shadow 240ms var(--ease-out), border-color 240ms;
    position: relative;
    overflow: hidden;
}
.card-link { display: block; text-decoration: none; color: inherit; cursor: pointer; }
.card-link:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-l); border-color: var(--line-strong); }
.card-link:hover h3, .card-link:hover h4 { color: var(--wine); }

.card-tight { padding: 18px; }
.card-loose { padding: 36px; }

.card-hero {
    padding: 36px;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at 100% 0%, rgba(200,155,62,0.10), transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(122,47,58,0.06), transparent 50%),
        linear-gradient(155deg, #fffaf2 0%, #f7eede 100%);
    box-shadow: var(--shadow-l);
    position: relative;
    overflow: hidden;
}
.card-hero::before {
    content: "";
    position: absolute;
    top: 0; right: 0;
    width: 280px; height: 280px;
    background: var(--grain);
    background-size: 220px 220px;
    opacity: 0.18;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.card-quiet {
    background: transparent;
    border: 1px dashed var(--line-strong);
    box-shadow: none;
}

.card-feature {
    background: linear-gradient(165deg, var(--bg-card), var(--chalk));
    border: 1px solid var(--line);
    padding: 32px 28px;
    border-radius: var(--radius-l);
    position: relative;
}
.card-feature .feat-mark {
    position: absolute;
    top: 24px; right: 24px;
    width: 36px; height: 36px;
    color: var(--gold);
    opacity: 0.7;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--wine);
    color: var(--bg-card);
    border: 1px solid var(--wine);
    padding: 13px 26px;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 0.94rem;
    font-weight: 600;
    letter-spacing: 0.25px;
    cursor: pointer;
    transition: background 160ms var(--ease-out), border-color 160ms, transform 80ms, box-shadow 200ms;
    box-shadow: 0 4px 14px rgba(122,47,58,0.18);
    text-decoration: none !important;
}
.btn:hover {
    background: var(--oxblood);
    border-color: var(--oxblood);
    color: var(--bg-card);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(122,47,58,0.28);
}
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    box-shadow: none;
}
.btn-ghost:hover {
    background: var(--bg-card);
    border-color: var(--wine);
    color: var(--wine);
    box-shadow: 0 4px 12px rgba(122,47,58,0.10);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    border-color: var(--gold-deep);
    color: #2e1f08;
    box-shadow: 0 4px 14px rgba(163,121,21,0.25);
}
.btn-gold:hover {
    background: linear-gradient(135deg, #b58a2f, var(--gold-deep));
    border-color: var(--gold-deep);
    color: #2e1f08;
    box-shadow: 0 8px 22px rgba(163,121,21,0.35);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1rem;
    letter-spacing: 0.3px;
}
.btn-small  { padding: 9px 18px; font-size: .85rem; }
.btn-block  { display: flex; width: 100%; justify-content: center; }
.btn-arrow::after { content: "→"; font-size: 1.1em; margin-left: 2px; transition: transform 200ms var(--ease-out); }
.btn:hover .btn-arrow::after { transform: translateX(4px); }
.btn-arrow:hover::after { transform: translateX(4px); }

/* --- Forms --- */
.field { margin-bottom: 18px; }
.field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 7px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.input, .textarea, select {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-s);
    padding: 13px 16px;
    font-family: var(--sans);
    font-size: 1rem;
    color: var(--ink);
    transition: border-color 140ms, box-shadow 140ms, background 140ms;
}
.input:hover, .textarea:hover, select:hover { border-color: var(--wine-tint); }
.input:focus, .textarea:focus, select:focus {
    outline: none;
    border-color: var(--wine);
    box-shadow: 0 0 0 4px rgba(122,47,58,0.10);
}
.textarea { resize: vertical; min-height: 92px; line-height: 1.55; }

.input-large {
    font-size: 1.18rem;
    padding: 18px 22px;
    font-family: var(--serif);
}

.checkpill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    cursor: pointer;
    background: var(--bg-card);
    font-size: 0.92rem;
    color: var(--ink-soft);
    transition: all 180ms var(--ease-out);
    user-select: none;
}
.checkpill input { display: none; }
.checkpill:hover { border-color: var(--wine); color: var(--wine); transform: translateY(-1px); }
.checkpill:has(input:checked) {
    background: linear-gradient(135deg, var(--wine-tint), #f7d4d2);
    border-color: var(--wine);
    color: var(--wine-deep);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(122,47,58,0.15);
}

/* --- Score visuals --- */
.score-circle {
    width: 86px; height: 86px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: radial-gradient(circle at 30% 30%, #f8d4d2, var(--wine-tint));
    color: var(--wine-deep);
    font-family: var(--serif);
    font-weight: 500;
    flex-shrink: 0;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.5), 0 2px 8px rgba(122,47,58,0.12);
    border: 1px solid #f0c0bd;
}
.score-circle .n { font-size: 2rem; line-height: 1; letter-spacing: -0.02em; }
.score-circle .l { font-size: .65rem; letter-spacing: 0.2em; text-transform: uppercase; opacity: .65; margin-top: 3px; font-family: var(--sans); font-weight: 600; }

/* Radial gauge — used on pairing cards */
.score-gauge {
    position: relative;
    width: 130px; height: 130px;
    flex-shrink: 0;
}
.score-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-gauge .gauge-bg { fill: none; stroke: var(--line); stroke-width: 9; }
.score-gauge .gauge-mol { fill: none; stroke: var(--wine);  stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 800ms var(--ease-out); }
.score-gauge .gauge-str { fill: none; stroke: var(--gold);  stroke-width: 9; stroke-linecap: round; }
.score-gauge .gauge-sty { fill: none; stroke: var(--moss);  stroke-width: 9; stroke-linecap: round; }
.score-gauge .gauge-cul { fill: none; stroke: var(--sky);   stroke-width: 9; stroke-linecap: round; }
.score-gauge .gauge-ctx { fill: none; stroke: var(--ink-muted); stroke-width: 9; stroke-linecap: round; }
.score-gauge .gauge-num {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.score-gauge .gauge-num .n {
    font-family: var(--serif);
    font-size: 2.4rem;
    color: var(--wine-deep);
    line-height: 1;
    font-weight: 500;
}
.score-gauge .gauge-num .l {
    font-size: 0.65rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-top: 4px;
    font-weight: 600;
}

.legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin-top: 12px;
}
.legend .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}

/* --- Pairing cards --- */
.pairing {
    display: flex;
    gap: 24px;
    padding: 26px;
    align-items: flex-start;
}
.pairing .body { flex: 1; min-width: 0; }
.pairing .wine-name {
    font-family: var(--serif);
    font-size: 1.45rem;
    color: var(--ink);
    margin-bottom: 4px;
    letter-spacing: -0.005em;
    line-height: 1.2;
}
.pairing .wine-name .yr {
    color: var(--wine);
    font-style: italic;
    margin-left: 6px;
    font-size: 1.2rem;
}
.pairing .reasoning {
    color: var(--ink-soft);
    font-size: 0.96rem;
    margin-top: 14px;
    line-height: 1.65;
}
.pairing .matched { font-size: 0.78rem; color: var(--ink-muted); margin-top: 10px; letter-spacing: 0.02em; }
.pairing .matched strong { color: var(--ink-soft); font-weight: 600; }

@media (max-width: 640px) {
    .pairing { flex-direction: column; gap: 16px; padding: 22px; }
}

/* Rank badge — top pairing gets a small "best match" ribbon */
.rank {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--gold-deep);
}
.rank.gold::before {
    content: "★ ";
    color: var(--gold);
    font-size: 1.05rem;
    margin-right: 2px;
}

/* --- Chat --- */
.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 32px 0;
    min-height: 200px;
}
.msg {
    max-width: 86%;
    padding: 16px 20px;
    border-radius: 16px;
    font-size: 0.98rem;
    line-height: 1.65;
    animation: msg-rise 360ms var(--ease-out) both;
}
@keyframes msg-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--wine-tint), #f7d4d2);
    color: var(--ink);
    border: 1px solid #f0c4c0;
    border-bottom-right-radius: 4px;
}
.msg-bot {
    align-self: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-s);
}
.msg-cite {
    font-size: 0.78rem;
    color: var(--ink-muted);
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    line-height: 1.7;
}
.msg-cite strong { color: var(--ink-soft); font-weight: 700; letter-spacing: 0.04em; }

.chat-suggest {
    display: flex; gap: 10px; flex-wrap: wrap;
    margin-top: 14px;
}
.chat-suggest button {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.88rem;
    color: var(--ink-soft);
    cursor: pointer;
    transition: all 160ms var(--ease-out);
    font-family: var(--sans);
}
.chat-suggest button:hover {
    border-color: var(--wine);
    color: var(--wine);
    background: var(--bg-elevated);
    transform: translateY(-1px);
}

/* --- Tags / badges --- */
.tag {
    display: inline-block;
    background: var(--gold-soft);
    color: var(--ink);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.tag-quiet { background: var(--line); color: var(--ink-soft); }
.tag-wine  { background: var(--wine-tint); color: var(--wine-deep); }
.tag-moss  { background: var(--moss-soft); color: #44572a; }
.tag-sky   { background: #d8e1e9; color: var(--sky); }

/* --- Vintage year typography --- */
.vintage-year {
    font-family: var(--serif);
    font-size: 3.2rem;
    color: var(--wine);
    line-height: 1;
    font-weight: 500;
    letter-spacing: -0.02em;
}
.vintage-year-sm { font-size: 1.6rem; }
.vintage-year .delta {
    display: block;
    font-size: 0.7rem;
    font-family: var(--sans);
    font-weight: 600;
    color: var(--ink-muted);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-top: 4px;
    font-style: normal;
}

/* --- GDD sparkline --- */
.sparkline {
    display: block;
    width: 100%;
    height: 100px;
}
.sparkline .area { fill: rgba(122,47,58,0.10); }
.sparkline .line { fill: none; stroke: var(--wine); stroke-width: 2; stroke-linejoin: round; }
.sparkline .band { fill: rgba(200,155,62,0.10); }
.sparkline .band-line { fill: none; stroke: var(--gold); stroke-width: 1; stroke-dasharray: 3 4; }
.sparkline .grid { stroke: var(--line); stroke-width: 1; }
.sparkline text { font-family: var(--sans); font-size: 10px; fill: var(--ink-muted); }

/* --- Misc --- */
.flash {
    padding: 14px 18px;
    border-radius: var(--radius-s);
    background: var(--wine-tint);
    border: 1px solid var(--wine);
    color: var(--wine-deep);
    font-size: 0.92rem;
    margin: 14px 0;
}
.flash-ok   { background: var(--moss-soft); border-color: var(--moss); color: #44572a; }
.flash-warn { background: var(--gold-soft); border-color: var(--gold); color: #6b4e15; }

.spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid var(--wine-tint);
    border-top-color: var(--wine);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.htmx-request .when-idle { display: none; }
.htmx-request .when-loading { display: inline-flex; }
.when-loading { display: none; }

/* --- Balanced two-field rows (consistent label-height, no awkward wrap) --- */
.form-row-even {
    gap: 14px;
    align-items: flex-start;
}
.form-row-even .field { flex: 1 1 0; min-width: 160px; }
.form-row-even label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Wishlist quick-add row (price + note) — same pattern, narrower minimum --- */
.wishlist-add-row {
    gap: 14px;
    align-items: flex-start;
}
.wishlist-add-row .field { flex: 1; min-width: 160px; }
.wishlist-add-row label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Profile header (account / settings) --- */
.profile-header {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 22px 24px;
    background: linear-gradient(135deg, var(--bg-card), var(--chalk));
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-s);
    flex-wrap: wrap;
}
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wine), var(--wine-deep));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    font-family: var(--sans);
    text-transform: uppercase;
    box-shadow: var(--shadow);
    border: 3px solid var(--bg-elevated);
    flex-shrink: 0;
}
.profile-body { flex: 1; min-width: 220px; }
.profile-name {
    font-family: var(--serif);
    font-size: clamp(1.6rem, 4vw, 2rem);
    margin: 0 0 4px;
    color: var(--ink);
    line-height: 1.15;
    font-weight: 500;
}
.profile-email {
    margin: 0 0 10px;
    color: var(--ink-soft);
    font-size: 0.9rem;
    word-break: break-word;
}
.profile-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.profile-badge {
    display: inline-block;
    padding: 4px 12px 5px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    line-height: 1.3;
}
.profile-badge-tier {
    background: var(--gold-soft);
    color: var(--wine-deep);
    border: 1px solid rgba(200, 155, 62, 0.45);
}
.profile-badge-admin {
    background: var(--wine);
    color: #fff;
    border: 1px solid var(--wine-deep);
    text-transform: none;
}
.profile-actions {
    margin-left: auto;
    flex-shrink: 0;
}

@media (max-width: 560px) {
    .profile-header { padding: 20px; gap: 16px; }
    .profile-avatar { width: 60px; height: 60px; font-size: 1.6rem; }
    .profile-actions {
        margin-left: 0;
        width: 100%;
        order: 99;
    }
    .profile-actions .btn { width: 100%; }
}

/* --- Collapsible card (details/summary as expandable section) --- */
.collapsible-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-s);
    overflow: hidden;
    transition: border-color 200ms, box-shadow 200ms;
}
.collapsible-card[open] {
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
}
.collapsible-card summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--ink);
    user-select: none;
    transition: background 150ms, color 150ms;
}
.collapsible-card summary::-webkit-details-marker,
.collapsible-card summary::marker { display: none; }
.collapsible-card summary:hover {
    background: linear-gradient(135deg, var(--chalk), var(--gold-soft));
    color: var(--wine);
}
.collapsible-card[open] summary {
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, var(--bg-card), var(--chalk));
}
.collapsible-summary-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--wine);
    color: #fff;
    font-family: var(--sans);
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1;
    transition: transform 220ms var(--ease-out), background 200ms;
    flex-shrink: 0;
}
.collapsible-card[open] .collapsible-summary-icon {
    transform: rotate(45deg);
    background: var(--wine-deep);
}
.collapsible-summary-label { flex: 1; }
.collapsible-summary-caret {
    color: var(--ink-muted);
    font-size: 0.85rem;
    transition: transform 220ms var(--ease-out);
}
.collapsible-card[open] .collapsible-summary-caret { transform: rotate(180deg); }
.collapsible-body {
    padding: 24px;
    animation: collapsibleIn 240ms var(--ease-out);
}
@keyframes collapsibleIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Empty states (consumer-warm, not enterprise-empty-list) --- */
.empty-state {
    text-align: center;
    padding: 56px 28px;
    background: linear-gradient(160deg, var(--bg-card) 0%, var(--chalk) 70%, var(--gold-soft) 130%);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-l);
    max-width: 620px;
    margin: 0 auto;
}
.empty-state .empty-state-icon {
    font-size: 3.2rem;
    margin-bottom: 14px;
    filter: drop-shadow(0 3px 10px rgba(122, 47, 58, 0.15));
}
.empty-state h2 {
    margin: 0 0 10px;
    font-size: 1.5rem;
    color: var(--wine-deep);
    font-weight: 500;
}
.empty-state .lede {
    max-width: 460px;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.6;
}

/* --- Subtle admin chip in nav (no enterprise-red) --- */
.nav-admin-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px 4px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gold-soft), var(--champagne));
    border: 1px solid rgba(200, 155, 62, 0.45);
    color: var(--wine-deep) !important;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.2;
    margin-left: 6px;
    transition: all 150ms var(--ease-out);
}
.nav-admin-chip:hover {
    background: linear-gradient(135deg, var(--champagne), var(--gold-soft));
    border-color: var(--gold);
    transform: translateY(-1px);
}
.nav-admin-chip.active {
    background: var(--wine);
    color: #fff !important;
    border-color: var(--wine-deep);
}

/* --- Rich footer --- */
.app-footer-rich {
    margin-top: 96px;
    padding: 72px 24px 0;
    background: linear-gradient(180deg, transparent 0%, var(--chalk) 30%, var(--gold-soft) 100%);
    border-top: none;
    position: relative;
}
/* Elegant gold hairline with single centered star — no boxy notch breaking the line */
.app-footer-rich::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(720px, 90%);
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(200, 155, 62, 0.18) 18%,
        rgba(200, 155, 62, 0.55) 50%,
        rgba(200, 155, 62, 0.18) 82%,
        transparent 100%);
}
.app-footer-rich::after {
    content: "✦";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--gold);
    font-size: 0.85rem;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg) 50%, var(--chalk) 50%, var(--chalk) 100%);
    padding: 0 12px;
    line-height: 1;
}
.footer-mark-icon {
    display: inline-block;
    width: 22px;
    height: auto;
    vertical-align: -4px;
    margin-right: 6px;
    opacity: 0.9;
    filter: drop-shadow(0 1px 1px rgba(122, 47, 58, 0.18));
}
.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.7fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 36px;
    align-items: start;
}
.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
}
.footer-col .footer-h { margin-bottom: 4px; }
.footer-col a {
    color: var(--ink-soft);
    text-decoration: none;
    transition: color 120ms;
}
.footer-col a:hover { color: var(--wine); }
.footer-h {
    font-family: var(--sans);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 600;
    color: var(--wine);
    margin: 0 0 6px;
    line-height: 1.2;
}
.footer-mark {
    font-family: var(--serif);
    font-size: 1.45rem;
    color: var(--wine-deep);
    margin: 0 0 6px;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.1;
}
.footer-tagline {
    font-family: var(--serif);
    font-style: italic;
    color: var(--wine-deep);
    margin: 0 0 6px;
    font-size: 0.98rem;
    line-height: 1.45;
    font-weight: 500;
}
.footer-subtagline {
    color: var(--ink-soft);
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.55;
}
.footer-promise {
    color: var(--ink-muted);
    font-size: 0.78rem;
    margin: 0;
    line-height: 1.7;
}
.footer-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold);
    vertical-align: middle;
    margin: 0 4px 2px;
}
.footer-credits .footer-credit-line {
    margin: 0;
    font-size: 0.88rem;
    color: var(--ink-muted);
    line-height: 1.4;
}
.footer-credits .footer-credit-line a {
    color: var(--ink-soft);
}
.footer-credits .footer-credit-line a:hover { color: var(--wine); }
.footer-coda {
    text-align: center;
    color: var(--wine-deep);
    font-family: var(--serif);
    font-style: italic;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    margin: 0 0 14px;
    padding-top: 6px;
}

/* NIX18 — Dutch responsible-drinking 18+ mark.
   Visual nod to the official NIX18 wordmark (orange + amber-yellow). */
.nix18-badge {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    margin: 0 auto 12px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #fffaf2;
    border: 1px solid #f3d9a2;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1rem;
    font-family: "Inter", -apple-system, sans-serif;
    letter-spacing: -0.5px;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: transform 160ms var(--ease-out), box-shadow 160ms;
    /* Centered horizontally */
    display: flex; width: max-content;
}
.nix18-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    text-decoration: none;
}
.nix18-nix { color: #e3651f; }       /* orange */
.nix18-eighteen { color: #d4a653; }  /* amber */
:root[data-theme="dark"] .nix18-badge {
    background: rgba(255,255,255,0.04);
    border-color: rgba(243,217,162,0.25);
}
.footer-bar {
    border-top: 1px solid rgba(122, 47, 58, 0.18);
    padding: 16px 0 22px;
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.82rem;
    max-width: 1080px;
    margin: 0 auto;
}
.footer-bar a {
    color: var(--wine);
    font-weight: 600;
    text-decoration: none;
}
.footer-bar a:hover { text-decoration: underline; }
.footer-sep {
    color: var(--gold);
    margin: 0 10px;
}

@media (max-width: 760px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
    .footer-inner { grid-template-columns: 1fr; }
    .footer-bar { font-size: 0.76rem; }
    .footer-sep { display: block; height: 4px; visibility: hidden; }
}

/* --- Cookie banner --- */
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 80;
    background: var(--ink);
    color: #f5ede0;
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(200, 155, 62, 0.35);
    animation: cookieIn 320ms var(--ease-out);
    max-width: 720px;
    margin: 0 auto;
}
@keyframes cookieIn {
    from { transform: translateY(140%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.cookie-banner-inner {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 16px 20px;
    flex-wrap: wrap;
}
.cookie-banner-body { flex: 1; min-width: 240px; }
.cookie-banner-title {
    margin: 0 0 4px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gold);
}
.cookie-banner-text {
    margin: 0;
    font-size: 0.84rem;
    color: #d8c8b3;
    line-height: 1.55;
}
.cookie-banner-text a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.cookie-banner-ok {
    white-space: nowrap;
}

@media (max-width: 520px) {
    .cookie-banner-inner { padding: 14px 16px; }
    .cookie-banner-ok { width: 100%; }
}

/* --- A11y focus-visible ring --- */
:where(a, button, [role="button"], input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--wine);
    outline-offset: 2px;
    border-radius: var(--radius-s);
}

/* respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner { animation: none; }
    .fade-up { animation: none; opacity: 1; }
}

/* --- Hero --- */
.hero {
    padding: 96px 0 64px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 0.7fr;
    gap: 48px;
    align-items: center;
    text-align: left;
    padding: 48px 0 32px;
}
.hero-grid .lede { font-size: 1.22rem; }
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-grid .lede { margin-left: auto; margin-right: auto; }
}

/* --- Animations --- */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

@keyframes float-bubble {
    0%   { transform: translateY(0) scale(1); opacity: 0; }
    15%  { opacity: 0.9; }
    100% { transform: translateY(-200px) scale(0.7); opacity: 0; }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--line) 25%, var(--bg-card) 50%, var(--line) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
    border-radius: var(--radius-s);
}

/* --- Onboarding --- */
.step-pill {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: 0.82rem;
    font-weight: 700;
    transition: all 200ms var(--ease-out);
}
.step-pill.active { background: var(--wine); border-color: var(--wine); color: #fff; box-shadow: 0 2px 8px rgba(122,47,58,0.3); }
.step-pill.done   {
    background: var(--moss); border-color: var(--moss); color: #fff;
    font-size: 0;
}
.step-pill.done::before { content: "✓"; font-size: 0.85rem; }

.stepper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.86rem;
    color: var(--ink-muted);
    margin-bottom: 40px;
    font-weight: 500;
}
.stepper .step-label { letter-spacing: 0.02em; }
.stepper .step-line {
    flex: 1; height: 1px;
    background: linear-gradient(90deg, var(--line) 0%, var(--line-strong) 50%, var(--line) 100%);
    margin: 0 4px;
}

/* --- Bottle silhouette container --- */
.bottle {
    display: inline-block;
    width: 32px;
    height: 80px;
    vertical-align: middle;
}

/* --- Drinking window indicator --- */
.dw-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}
.dw-bar {
    position: relative;
    width: 120px; height: 6px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
}
.dw-bar .dw-fill {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, var(--moss-soft), var(--moss));
    border-radius: 999px;
}
.dw-bar .dw-now {
    position: absolute;
    top: -3px;
    width: 2px; height: 12px;
    background: var(--ink);
}

/* --- Hero illustration positioning --- */
.flute-svg {
    width: 100%;
    max-width: 340px;
    height: auto;
    filter: drop-shadow(0 30px 40px rgba(122,47,58,0.18));
}
@media (max-width: 900px) {
    .flute-svg { max-width: 200px; }
}

/* --- Mobile-only swipe hint above the cellar grid --- */
.swipe-hint {
    display: none;
    font-size: 0.74rem;
    color: var(--ink-muted);
    text-align: center;
    margin: -8px 0 12px;
    letter-spacing: 0.04em;
}
@media (max-width: 640px) and (pointer: coarse) {
    .swipe-hint { display: block; }
    .cellar-entry { touch-action: pan-y; user-select: none; }
}

/* --- Vertical-tasting comparison table on wine_detail --- */
.vertical-tasting-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: var(--shadow-s);
}
.vertical-tasting {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.vertical-tasting th,
.vertical-tasting td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
.vertical-tasting thead th {
    background: var(--bg-tint);
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--wine);
    border-bottom: 2px solid var(--line-strong);
    white-space: nowrap;
}
.vertical-tasting tbody th {
    font-weight: 600;
    color: var(--ink-soft);
    background: rgba(231, 220, 201, 0.18);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    width: 130px;
    min-width: 130px;
}
.vertical-tasting tbody tr:last-child th,
.vertical-tasting tbody tr:last-child td { border-bottom: 0; }

/* --- Bottle-kind filter chips on cellar page --- */
.kind-chips {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin: 14px 0 12px;
}
.kind-chip {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.92rem;
    cursor: pointer;
    color: var(--ink-soft);
    transition: all 160ms var(--ease-out);
}
.kind-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.kind-chip-active {
    background: var(--wine); color: #fff; border-color: var(--wine);
}
/* Filter cellar entries by kind via class on the parent #cellar-sections.
   !important is required because cellar-entry-card has an inline style="display:flex"
   that outranks the CSS file otherwise. */
#cellar-sections.kind-filter-wine    .cellar-entry:not([data-kind="wine"]),
#cellar-sections.kind-filter-whisky  .cellar-entry:not([data-kind="whisky"]),
#cellar-sections.kind-filter-rum     .cellar-entry:not([data-kind="rum"]),
#cellar-sections.kind-filter-tequila .cellar-entry:not([data-kind="tequila"]) {
    display: none !important;
}

/* --- Drink-window filter chips on cellar page --- */
.dw-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.dw-chip {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 0.86rem;
    cursor: pointer;
    color: var(--ink-soft);
    transition: all 160ms var(--ease-out);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.dw-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.dw-chip-count {
    font-size: 0.75rem;
    background: var(--bg-tint);
    color: var(--ink-muted);
    padding: 1px 7px;
    border-radius: 999px;
    font-weight: 600;
}
.dw-chip-active {
    background: var(--wine);
    color: #fff;
    border-color: var(--wine);
}
.dw-chip-active .dw-chip-count {
    background: rgba(255,255,255,0.22);
    color: #fff;
}
/* Hide non-matching cellar-entries when a chip filter is active.
   !important needed because cellar-entry has inline display:flex. */
#cellar-sections.dw-filter-now      .cellar-entry:not([data-dw="now"]),
#cellar-sections.dw-filter-soon     .cellar-entry:not([data-dw="soon"]),
#cellar-sections.dw-filter-later    .cellar-entry:not([data-dw="later"]),
#cellar-sections.dw-filter-past     .cellar-entry:not([data-dw="past"]) {
    display: none !important;
}

/* --- Accessibility: visible focus ring for keyboard users --- */
:focus-visible {
    outline: 2px solid var(--wine);
    outline-offset: 2px;
    border-radius: 4px;
}
.btn:focus-visible,
.user-menu-item:focus-visible,
.input:focus-visible,
.textarea:focus-visible,
select.input:focus-visible {
    outline: 2px solid var(--wine);
    outline-offset: 2px;
}
/* Buttons that already have a colored background — use lighter offset */
.btn-gold:focus-visible,
.btn-arrow:focus-visible {
    outline-offset: 3px;
}
/* Screen-reader-only helper for live-region content */
.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;
}

/* --- Empty-cellar onboarding nudge on dashboard --- */
.empty-cellar-nudge {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 32px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-tint));
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-l);
    position: relative;
    overflow: hidden;
}
.empty-cellar-nudge::before {
    content: "";
    position: absolute;
    top: -40px; right: -40px;
    width: 200px; height: 200px;
    background: radial-gradient(circle at center, rgba(200, 155, 62, 0.10), transparent 70%);
    pointer-events: none;
}
.empty-cellar-icon {
    font-size: 3rem;
    line-height: 1;
    flex-shrink: 0;
}
.empty-cellar-body {
    flex: 1;
    min-width: 0;
    position: relative;
}
@media (max-width: 560px) {
    .empty-cellar-nudge { flex-direction: column; padding: 24px; gap: 12px; }
    .empty-cellar-icon { font-size: 2.4rem; }
}

/* --- Drink-window status badge on cellar cards --- */
.dw-badge {
    display: inline-block;
    font-size: 0.74rem;
    letter-spacing: 0.02em;
    margin: 4px 0 8px;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid;
    font-weight: 500;
}
.dw-now {
    background: rgba(107, 122, 71, 0.10);
    border-color: rgba(107, 122, 71, 0.3);
    color: #5a6a3a;
}
.dw-wait {
    background: rgba(200, 155, 62, 0.10);
    border-color: rgba(200, 155, 62, 0.3);
    color: #8a6a18;
}
.dw-past {
    background: rgba(184, 69, 58, 0.10);
    border-color: rgba(184, 69, 58, 0.3);
    color: #b8453a;
}
:root[data-theme="dark"] .dw-now { color: #93a370; background: rgba(107, 122, 71, 0.15); }
:root[data-theme="dark"] .dw-wait { color: #d4a653; background: rgba(212, 166, 83, 0.12); }
:root[data-theme="dark"] .dw-past { color: #d96a5e; background: rgba(184, 69, 58, 0.15); }

/* --- Analogue years grid — 5 wide on desktop, wraps cleanly on narrower screens --- */
.analogue-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
.analogue-card {
    text-align: center;
    padding: 18px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
}
@media (max-width: 900px) {
    .analogue-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
    .analogue-grid { grid-template-columns: repeat(2, 1fr); }
}
.analogue-warning {
    padding: 10px 14px;
    background: rgba(212, 166, 83, 0.08);
    border-left: 3px solid var(--gold);
    border-radius: 6px;
}
:root[data-theme="dark"] .analogue-warning {
    background: rgba(212, 166, 83, 0.10);
}

/* --- Landing page: chat-preview block (mocked agent conversation) --- */
.landing-chat {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 720px;
    margin: 0 auto;
    padding: 28px;
    background: var(--bg-tint);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-s);
}
.landing-chat .msg-tools {
    margin-top: 10px;
}
.landing-chat .msg-tools summary {
    cursor: pointer;
    user-select: none;
    list-style: none;
    padding: 4px 0;
}
.landing-chat .msg-tools summary::-webkit-details-marker { display: none; }
.landing-chat .msg-tools summary::before {
    content: "▸ ";
    color: var(--ink-muted);
    transition: transform 160ms var(--ease-out);
    display: inline-block;
}
.landing-chat .msg-tools[open] summary::before { content: "▾ "; }
.landing-chat .msg-tools code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.74rem;
    background: var(--bg-card);
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--line);
}

/* --- Landing page: how-it-works numbered cards --- */
.how-it-works .card {
    padding: 22px 24px;
    position: relative;
    overflow: visible;
}
.how-num {
    font-family: var(--serif);
    font-size: 2.4rem;
    line-height: 1;
    color: var(--gold-deep);
    font-style: italic;
    margin-bottom: 4px;
    display: inline-block;
}
:root[data-theme="dark"] .how-num {
    color: var(--gold);
    text-shadow: 0 0 12px rgba(212, 166, 83, 0.25);
}

/* --- Product-card with bottle --- */
.product-card {
    display: flex;
    gap: 18px;
    padding: 28px;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    transition: transform 240ms var(--ease-out), box-shadow 240ms;
    text-decoration: none;
    color: inherit;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-l);
    text-decoration: none;
}
.product-card .bottle { flex-shrink: 0; }
.product-card .body  { flex: 1; }

/* --- Region map style --- */
.region-map {
    width: 100%;
    height: auto;
    max-width: 480px;
}
.region-map .land { fill: var(--bg-tint); stroke: var(--line-strong); stroke-width: 0.5; }
.region-map .subregion { fill: var(--wine-tint); stroke: var(--wine); stroke-width: 0.6; transition: fill 200ms; }
.region-map .subregion:hover { fill: #f0c4c0; cursor: pointer; }
.region-map .label {
    font-family: var(--serif);
    font-size: 11px;
    fill: var(--wine-deep);
    text-anchor: middle;
}

/* --- Vintage classical-quality indicator (thermometer) --- */
.indicator {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 28px;
    box-shadow: var(--shadow-s);
}
.indicator-compact { padding: 20px 22px; }

.therm-wrap {
    position: relative;
    padding: 36px 4px 8px;     /* top space for cone-label + needle-label */
}
.therm-cone-label {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--sans);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin: 0;
    white-space: nowrap;
}
.therm-bar {
    position: relative;
    display: flex;
    height: 24px;
    border-radius: 4px;
    overflow: visible;        /* let cone + needle extend out */
    box-shadow: inset 0 1px 2px rgba(46,30,22,0.08);
}
.therm-zone {
    height: 100%;
}
.therm-zone:first-child { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.therm-zone:last-child  { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.z-slecht    { width: 30%; background: #b8453a; }
.z-zwak      { width: 20%; background: #c87a3e; }
.z-gebal     { width: 20%; background: #c89b3e; }
.z-goed      { width: 15%; background: #6b7a47; }
.z-excellent { width: 15%; background: #3d5f2d; }

.therm-cone {
    position: absolute;
    top: -10px;
    bottom: -10px;
    background: rgba(255, 250, 242, 0.32);
    border: 1.5px dashed rgba(46, 30, 22, 0.32);
    border-radius: 6px;
    pointer-events: none;
}

.therm-needle {
    position: absolute;
    top: -28px;
    bottom: 0;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 5;
}
.therm-needle-label {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--bg-card);
    background: var(--ink);
    border-radius: 4px;
    padding: 4px 10px;
    box-shadow: 0 2px 6px rgba(46,30,22,0.30);
}
.therm-needle-label::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--ink);
}
.therm-needle-pin {
    position: absolute;
    top: 30px;             /* sits centered on the 24px-tall bar */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--ink);
    border: 2.5px solid var(--bg-card);
    box-shadow: 0 1px 4px rgba(46,30,22,0.40);
}

.therm-labels {
    position: relative;
    margin-top: 16px;
    height: 14px;
}
.therm-labels span {
    position: absolute;
    transform: translateX(-50%);
    font-family: var(--sans);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--ink-soft);
    text-transform: uppercase;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .therm-labels span { font-size: 0.56rem; letter-spacing: 0.10em; }
    .therm-cone-label { font-size: 0.56rem; letter-spacing: 0.14em; }
}
@media (max-width: 420px) {
    /* Hide some labels to avoid overlap on tiny screens */
    .therm-labels span:nth-child(2) { display: none; }
    .therm-labels span:nth-child(3) { left: 50% !important; }
}

.indicator-axes {
    border-top: 1px solid var(--line);
    padding-top: 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.axis-row {
    display: grid;
    grid-template-columns: 28px 160px 1fr;
    align-items: baseline;
    gap: 12px;
    padding: 6px 0;
    font-size: 0.92rem;
}
.axis-emoji  { font-size: 1.1rem; line-height: 1; }
.axis-label  { color: var(--ink); font-weight: 600; letter-spacing: 0.01em; }
.axis-detail { color: var(--ink-soft); font-size: 0.9rem; }
.axis-good    .axis-label { color: #44572a; }
.axis-watch   .axis-label { color: #856b1a; }
.axis-warn    .axis-label { color: #8a4520; }
.axis-bad     .axis-label { color: var(--wine-deep); }
.axis-unknown .axis-label { color: var(--ink-muted); font-weight: 500; }

@media (max-width: 560px) {
    .axis-row { grid-template-columns: 24px 1fr; }
    .axis-row .axis-detail { grid-column: 2; }
}

/* --- Glossary info-popover --- */
.info {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
    vertical-align: baseline;
}
.info-i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px; height: 17px;
    border-radius: 50%;
    background: var(--line);
    color: var(--ink-soft);
    font-family: var(--serif);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 160ms, color 160ms, transform 80ms;
    border: 0;
    padding: 0;
    line-height: 1;
    font-style: italic;
    margin-left: 2px;
    vertical-align: super;
}
.info-i:hover,
.info-i:focus { background: var(--wine); color: var(--bg-card); outline: none; transform: scale(1.08); }

.info-pop {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    width: 340px;
    max-width: calc(100vw - 32px);
    background: var(--bg-elevated);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-l);
    font-family: var(--sans);
    font-size: 0.88rem;
    font-weight: 400;
    font-style: normal;
    line-height: 1.6;
    color: var(--ink-soft);
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-4px);
    transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.info-pop::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px; height: 12px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--line-strong);
    border-left: 1px solid var(--line-strong);
}
.info-pop strong {
    display: block;
    color: var(--wine);
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.05rem;
    margin-bottom: 8px;
    letter-spacing: -0.005em;
}
.info-pop p, .info-pop ul { margin: 0 0 0.7em; }
.info-pop p:last-child, .info-pop ul:last-child { margin-bottom: 0; }
.info-pop code {
    background: var(--gold-soft);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.85em;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    color: var(--ink);
}
.info-pop ul { padding-left: 1.3em; }
.info-pop li { margin-bottom: 4px; }

.info:hover .info-pop,
.info.open .info-pop {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Variant — when the popover would clip off the right edge, anchor it to the right */
.info.info-right .info-pop { left: auto; right: 0; transform: translateX(0) translateY(-4px); }
.info.info-right .info-pop::before { left: auto; right: 8px; transform: rotate(45deg); }
.info.info-right:hover .info-pop,
.info.info-right.open .info-pop { transform: translateX(0) translateY(0); }

/* Variant — anchor the popover to the left edge (useful in tight columns) */
.info.info-left .info-pop { left: 0; right: auto; transform: translateX(0) translateY(-4px); }
.info.info-left .info-pop::before { left: 8px; right: auto; transform: rotate(45deg); }
.info.info-left:hover .info-pop,
.info.info-left.open .info-pop { transform: translateX(0) translateY(0); }

@media (max-width: 480px) {
    .info-pop { width: calc(100vw - 32px); }
    /* On mobile, all popovers default to left-edge anchored */
    .info-pop { left: 0; transform: translate(0,-4px); }
    .info-pop::before { left: 14px; }
    .info:hover .info-pop, .info.open .info-pop { transform: translate(0, 0); }
}

/* ─────────── Flatpickr — wine-warm theme override ─────────── */
.flatpickr-calendar {
    background: var(--bg-elevated);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    font-family: var(--sans);
    padding: 0;
    width: 320px;
}
.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after { border-bottom-color: var(--line-strong); }
.flatpickr-calendar.arrowBottom:before,
.flatpickr-calendar.arrowBottom:after { border-top-color: var(--line-strong); }

/* ── Header (month/year + prev/next) ── */
.flatpickr-months {
    padding: 14px 12px 6px;
    background: linear-gradient(180deg, var(--chalk), var(--bg-elevated));
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius) var(--radius) 0 0;
    align-items: center;
}
.flatpickr-months .flatpickr-month {
    color: var(--wine-deep);
    fill: var(--wine-deep);
    height: 32px;
    overflow: visible;
    line-height: 32px;
}
.flatpickr-current-month {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 500;
    padding: 0;
    line-height: 32px;
    height: 32px;
    left: 0;
    width: 100%;
    color: var(--wine-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--wine-deep);
    padding: 2px 6px;
    border-radius: var(--radius-s);
    line-height: 1.2;
    text-transform: capitalize;
    margin: 0;
    appearance: none;
    border: 1px solid transparent;
    transition: background 120ms, border-color 120ms;
}
.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: var(--gold-soft);
    border-color: rgba(200, 155, 62, 0.45);
}
.flatpickr-current-month .numInputWrapper {
    width: 4ch;
    color: var(--wine-deep);
}
.flatpickr-current-month input.cur-year {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--wine-deep);
    background: transparent;
    padding: 2px 0;
}
.flatpickr-current-month .numInputWrapper:hover {
    background: transparent;
}
.flatpickr-prev-month, .flatpickr-next-month {
    fill: var(--wine);
    color: var(--wine);
    padding: 6px 12px;
    top: 12px;
    height: 32px;
    width: 32px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 120ms;
}
.flatpickr-prev-month svg, .flatpickr-next-month svg {
    width: 11px;
    height: 11px;
}
.flatpickr-prev-month:hover, .flatpickr-next-month:hover {
    fill: var(--wine-deep);
    color: var(--wine-deep);
    background: var(--gold-soft);
}
.flatpickr-prev-month:hover svg, .flatpickr-next-month:hover svg {
    fill: var(--wine-deep);
}

/* ── Weekday header ── */
.flatpickr-weekdays {
    background: transparent;
    height: 30px;
    padding: 6px 8px 4px;
}
.flatpickr-weekdaycontainer {
    display: flex;
    flex: 1;
}
span.flatpickr-weekday {
    color: var(--ink-muted);
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: transparent;
    flex: 1;
}

/* ── Day grid ── */
.flatpickr-days {
    border: none;
    padding: 4px 8px 12px;
    width: 100%;
}
.flatpickr-days .dayContainer {
    padding: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
    justify-content: space-between;
}
.flatpickr-day {
    border-radius: 50%;
    color: var(--ink);
    border: 1px solid transparent;
    font-weight: 500;
    font-size: 0.92rem;
    max-width: 40px;
    height: 38px;
    line-height: 36px;
    margin: 1px 0;
    flex-basis: 14.2857%;
    transition: background 120ms, color 120ms, border-color 120ms, transform 120ms;
}
.flatpickr-day:hover {
    background: var(--gold-soft);
    color: var(--wine-deep);
    border-color: rgba(200, 155, 62, 0.5);
    transform: scale(1.04);
}
.flatpickr-day.today {
    border-color: var(--gold);
    color: var(--wine);
    background: transparent;
    font-weight: 600;
}
.flatpickr-day.today::after {
    content: "";
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold);
}
.flatpickr-day.today {
    position: relative;
}
.flatpickr-day.today:hover {
    background: var(--gold-soft);
    color: var(--wine-deep);
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected.today,
.flatpickr-day.selected.today:hover {
    background: var(--wine);
    color: #fff;
    border-color: var(--wine-deep);
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(122, 47, 58, 0.28);
}
.flatpickr-day.selected.today::after {
    background: #fff;
}
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--ink-muted);
    opacity: 0.45;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: var(--ink-muted);
    background: transparent;
    cursor: not-allowed;
    opacity: 0.3;
    transform: none;
    border-color: transparent;
}
.flatpickr-day.inRange,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--gold-soft);
    border-color: rgba(200, 155, 62, 0.45);
    box-shadow: none;
    color: var(--wine-deep);
}
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--wine);
    color: #fff;
    border-color: var(--wine-deep);
}
.numInputWrapper span.arrowUp:after { border-bottom-color: var(--wine); }
.numInputWrapper span.arrowDown:after { border-top-color: var(--wine); }
.numInputWrapper span:hover { background: var(--gold-soft); }

/* ─── Reusable confirm-dialog ─── */
.nv-confirm {
    border: 0; border-radius: 14px; padding: 0;
    max-width: 380px; width: calc(100% - 32px);
    background: var(--bg-card, #fffaf2); color: var(--ink, #2a2320);
    box-shadow: 0 24px 64px -12px rgba(0,0,0,0.35);
}
.nv-confirm::backdrop { background: rgba(26,20,16,0.55); backdrop-filter: blur(2px); }
.nv-confirm-body { padding: 24px 24px 20px; }
.nv-confirm-title { margin: 0 0 8px; font-size: 1.2rem; font-family: var(--serif, Georgia), serif; }
.nv-confirm-msg { margin: 0 0 20px; font-size: 0.94rem; line-height: 1.5; color: var(--ink-soft, #5b4a3f); }
.nv-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.btn.btn-danger { background: #b8453a; border-color: #b8453a; color: #fff; }
.btn.btn-danger:hover { background: #a23a30; border-color: #a23a30; }
