/* Nice Drop · Paper White
   The final design-system layer. Loads last, after nd-polish.css, so it wins the cascade without
   touching the app's markup or behaviour.

   Expressive brand, quiet interface: paper-white surfaces, one Pinot accent, a little dusty rose,
   EB Garamond for editorial moments and Inter for everything functional.

   Structure
     1. Tokens: colour, type, space, radius, control sizes, states
     2. Token bridge: maps the app's older variables onto the tokens
     3. Foundations: page, gutters, focus
     4. Type styles
     5. Components: header, tab bar, cards, buttons, chips, segmented controls, rows, ratings, forms, sheets
     6. Screens: Cellar, wine detail, Palate, Recommendations, School
   Wine photography, the wine-colour glasses, maps and bottle drawings are imagery and keep their own colours. */

/* ===================================================================== 1. Tokens */
:root {
  /* Colour */
  --nd-paper: #FAFAF7;          /* app background */
  --nd-surface: #FFFFFF;        /* cards, sheets' content, bars */
  --nd-sunken: #F2F1ED;         /* quiet fills: search field, tracks, icon wells */
  --nd-pinot: #5A1B3C;          /* brand, primary actions, selected states */
  --nd-pinot-pressed: #46142E;
  --nd-pinot-tint: #F5ECF0;     /* selected-but-quiet backgrounds */
  --nd-rose: #D4A6B4;           /* dusty rose: decorative details only, never text (2.1:1) */
  --nd-rose-tint: #F6EDF0;      /* hero art backdrops */
  --nd-ink: #241F1B;            /* primary text            16.3:1 on surface, 14.4:1 on sunken */
  --nd-ink-2: #605954;          /* secondary text           6.9:1 on surface, 6.1:1 on sunken */
  --nd-ink-3: #716A64;          /* tertiary text, captions  5.3:1 on surface, 4.7:1 on sunken */
  --nd-line: #E9E6E0;           /* hairline borders */
  --nd-line-strong: #D6D1C9;    /* control outlines */
  --nd-disabled: #B9B3AD;       /* disabled glyphs (non-text) */
  --nd-star-off: #E6DADF;       /* unfilled rating stars */
  --nd-on-pinot: #FFFFFF;       /* text on Pinot           12.7:1 (Pinot on tint 11:1) */
  --nd-focus: rgba(90, 27, 60, .5);
  --nd-scrim: rgba(36, 31, 27, .32);

  /* Type */
  --nd-serif: "EB Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --nd-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --nd-t-display: 2.125rem;     /* 34  page headline (editorial) */
  --nd-t-title: 1.875rem;       /* 30  wine title in detail */
  --nd-t-feature: 1.625rem;     /* 26  featured wine, feature headings */
  --nd-t-section: 1.25rem;      /* 20  section headings */
  --nd-t-product: 1.0625rem;    /* 17  wine names in lists and cards, card titles */
  --nd-t-body: 1rem;            /* 16 */
  --nd-t-body-s: .875rem;       /* 14 */
  --nd-t-label: .8125rem;       /* 13  labels, metadata */
  --nd-t-caption: .75rem;       /* 12  tab labels, captions */

  /* Space: 4pt base, 8pt steps for layout */
  --nd-1: 4px; --nd-2: 8px; --nd-3: 12px; --nd-4: 16px; --nd-5: 20px; --nd-6: 24px; --nd-8: 32px;
  --nd-gutter: 20px;
  --nd-card-pad: 16px;
  --nd-section: 32px;

  /* Radius */
  --nd-r-card: 16px;
  --nd-r-hero: 20px;
  --nd-r-sm: 12px;
  --nd-r-xs: 8px;
  --nd-r-pill: 999px;

  /* Controls */
  --nd-btn-h: 50px;
  --nd-tap: 44px;
  --nd-chip-h: 40px;
  --nd-ring: 0 0 0 1px var(--nd-line);
  --nd-ring-strong: 0 0 0 1px var(--nd-line-strong);
  --nd-ease: cubic-bezier(.2, .8, .2, 1);
}

/* ===================================================================== 2. Token bridge */
:root {
  --canvas: var(--nd-paper); --card: var(--nd-surface); --fill: var(--nd-sunken); --line: var(--nd-line);
  --sep: var(--nd-line); --ink: var(--nd-ink); --ink-2: var(--nd-ink-2); --ink-3: var(--nd-ink-3);
  --claret: var(--nd-pinot); --oxblood: var(--nd-pinot); --red: var(--nd-pinot); --on-claret: var(--nd-on-pinot); --claret-tint: var(--nd-pinot-tint);
  --ui: var(--nd-sans); --round: var(--nd-sans); --display: var(--nd-sans); --p-serif: var(--nd-serif);
  --p-canvas: var(--nd-paper); --p-card: var(--nd-surface); --p-ink: var(--nd-ink); --p-ink-2: var(--nd-ink-2); --p-ink-3: var(--nd-ink-3);
  --p-accent: var(--nd-pinot); --p-accent-tint: var(--nd-pinot-tint); --p-hair: var(--nd-line); --p-hair-strong: var(--nd-line-strong);
  --p-fill: var(--nd-sunken); --p-fill-2: #E9E7E2; --p-sub: var(--nd-sunken); --p-ring: var(--nd-focus);
  --shadow-card: var(--nd-ring); --shadow-float: none;
}

/* ===================================================================== 3. Foundations */
html, html body { background: var(--nd-paper); color: var(--nd-ink); }
html body { font-family: var(--nd-sans); font-variation-settings: normal; font-feature-settings: "cv11", "ss03"; -webkit-font-smoothing: antialiased; }
html body .page { padding-inline: var(--nd-gutter); }
html body .sheet-body { padding-inline: var(--nd-gutter); }
html body .filters, html body .styletabs, html body .shop-chips { margin-inline: calc(0px - var(--nd-gutter)); padding-inline: var(--nd-gutter); scroll-padding-inline: var(--nd-gutter); }
html body .shelf { margin-inline: calc(0px - var(--nd-gutter)); padding-inline: var(--nd-gutter); scroll-padding-inline: var(--nd-gutter); gap: var(--nd-3); }
html body .o-hero { margin-inline: calc(0px - var(--nd-gutter)); }
html body :focus-visible { outline: 2px solid var(--nd-focus); outline-offset: 2px; }
html body b, html body strong { font-weight: 600; }
/* numbers line up wherever they sit in columns */
html body .yr, html body .stat b, html body .foot b, html body .count, html body .stars { font-variant-numeric: tabular-nums; }

/* ===================================================================== 4. Type styles */
/* Display: the page headline, editorial, Pinot */
html body .large-title h1 {
  font-family: var(--nd-serif); font-size: var(--nd-t-display); font-weight: 500; line-height: 1.08;
  letter-spacing: -.012em; color: var(--nd-pinot); text-wrap: balance;
}
/* Titles: a selected wine, a featured wine */
html body .o-head h2 { font-family: var(--nd-serif); font-size: var(--nd-t-title); font-weight: 500; line-height: 1.08; letter-spacing: -.01em; color: var(--nd-ink); }
html body .o-head h2.long { font-size: var(--nd-t-feature); }
html body .tn-name { font-family: var(--nd-serif); font-size: var(--nd-t-feature); font-weight: 500; line-height: 1.06; letter-spacing: -.01em; }
/* Feature headings in cards (Palate reading, School phrase) */
html body .card .headline, html body .palate .headline, html body .step-title, html body .snob-school .ss-say {
  font-family: var(--nd-serif); font-size: 1.5rem; font-weight: 500; line-height: 1.15; letter-spacing: -.005em; font-style: normal; color: var(--nd-ink);
}
/* Section headings */
html body .section-head h2 { font-family: var(--nd-sans); font-size: var(--nd-t-section); font-weight: 600; line-height: 1.25; letter-spacing: -.015em; }
html body .section-head { align-items: baseline; margin: var(--nd-section) 0 var(--nd-3); }
html body .section-head .aside, html body .section-head .o-link, html body .section-head button {
  font-size: var(--nd-t-body-s); font-weight: 500; color: var(--nd-ink-2); text-decoration: none;
}
/* Card and item titles */
html body h3, html body .card h3, html body .card > h3:first-child, html body .dc-t, html body .sh-t, html body .fc-t, html body .cc-lbl,
html body .rc-name, html body .cc-name, html body .gi-top b, html body .o-place .v, html body .pair .pn, html body .look-preview .lbl {
  font-family: var(--nd-sans); font-size: var(--nd-t-product); font-weight: 600; line-height: 1.3; letter-spacing: -.01em;
}
html body .rc-name, html body .cc-name { font-size: var(--nd-t-body); }
/* Body copy */
html body p, html body .muted { line-height: 1.5; }
html body .card > p.muted, html body .card p.muted { font-size: var(--nd-t-body-s); color: var(--nd-ink-2); }
/* Labels: sentence case, never shouty */
html body .kicker, html body .eyebrow, html body .tn-k, html body .v-k, html body .r-k, html body .fb h4, html body .toolbar .count,
html body .fgroup .label, html body .prow .pk, html body .o-place .k, html body .stat span, html body .ul-head .kicker,
html body .snob-school .kicker, html body .quiz-result .kicker, html body .card .kicker, html body .dict-card .kicker,
html body .friends-card .kicker, html body .info-head .kicker, html body .cc-head .kicker, html body .pal-top .kicker,
html body .prophecy .eyebrow, html body .fab-move .eyebrow, html body .shelf-group .eyebrow, html body .o-label {
  font-family: var(--nd-sans); font-size: var(--nd-t-label); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--nd-ink-2) !important;
}

/* ===================================================================== 5. Components */

/* --- Header: logo leading, profile trailing, both centred on one line --- */
html body .navbar { height: 68px !important; padding-inline: var(--nd-gutter) 14px; }
html body .navbar::before { background: var(--nd-paper) !important; }
html body .navbar.scrolled::before, html body .navbar.nd-under::before {
  background: rgba(250, 250, 247, .94) !important; -webkit-backdrop-filter: saturate(1.4) blur(18px) !important; backdrop-filter: saturate(1.4) blur(18px) !important;
  border-bottom: .5px solid var(--nd-line-strong) !important;
}
html body .navbar .start { grid-column: 1; justify-self: start; }
html body .navbar .wordmark { color: var(--nd-pinot); }
html body .navbar .wordmark .nd-wordline { height: 52px !important; width: auto; margin: 0 !important; display: block; }
html body .navbar .compact { font-family: var(--nd-sans); font-size: var(--nd-t-product); font-weight: 600; letter-spacing: -.01em; }
html body .me-btn { width: var(--nd-tap); height: var(--nd-tap); background: transparent !important; box-shadow: none !important; color: var(--nd-ink); position: relative; isolation: isolate; }
html body .me-btn::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--nd-surface); box-shadow: var(--nd-ring-strong); z-index: -1; }
html body .me-btn svg { width: 20px; height: 20px; }
html body .me-btn .me-avatar { width: 38px; height: 38px; }
html body .large-title { padding-block: 4px 0; }

/* --- Tab bar: a flat white bar with a hairline, Pinot for the current place --- */
html body .dock { background: var(--nd-surface) !important; border-radius: 0 !important; box-shadow: 0 -.5px 0 var(--nd-line-strong) !important; }
html body .tabbar { height: 64px; }
html body .tabbar .lens { display: none; }
html body .tabbar button { font-family: var(--nd-sans); font-size: var(--nd-t-caption); font-weight: 500; letter-spacing: 0; color: var(--nd-ink-3); gap: 4px; }
html body .tabbar button svg { width: 24px; height: 24px; stroke-width: 1.6; }
html body .tabbar button[aria-current="page"] { color: var(--nd-pinot); font-weight: 600; }
html body .log-fab {
  width: 56px; height: 56px; top: -18px; background: var(--nd-pinot) !important; color: var(--nd-on-pinot) !important;
  box-shadow: 0 4px 12px -4px rgba(90, 27, 60, .45) !important;
}
html body .log-fab svg { width: 24px; height: 24px; stroke-width: 2; }
html body .log-fab:active { background: var(--nd-pinot-pressed) !important; }

/* --- Cards: white on paper, hairline, 16 radius, no shadow --- */
html body .card, html body .wcard, html body .stat, html body .region-card, html body .cook-card, html body .rec-card, html body .grape-item,
html body .scan, html body .o-place, html body .friends-card, html body .dict-card, html body .dict-card.quiz-card, html body .snob-school,
html body .scan-buy, html body .fam-tile, html body .look-preview, html body .fields, html body .toggle-row, html body .note-box {
  background: var(--nd-surface) !important; box-shadow: var(--nd-ring) !important; border: 0 !important; border-radius: var(--nd-r-card) !important;
}
html body .card { padding: var(--nd-card-pad) var(--nd-card-pad) calc(var(--nd-card-pad) + 2px); }
html body .tonight { background: var(--nd-surface) !important; box-shadow: var(--nd-ring) !important; border-radius: var(--nd-r-hero) !important; }
/* inside sheets, cards sit on paper the same way */
html body .sheet { background: var(--nd-paper); border-radius: var(--nd-r-hero) var(--nd-r-hero) 0 0; box-shadow: 0 -1px 0 var(--nd-line); }
html body .sheet .card, html body .sheet .facts, html body .sheet .notes-list, html body .sheet .buy, html body .sheet .look-preview {
  background: var(--nd-surface) !important; box-shadow: var(--nd-ring) !important; border-radius: var(--nd-r-card) !important;
}
html body .sheet .tip { background: var(--nd-sunken); box-shadow: none; border-radius: var(--nd-r-sm); }
/* quiet inset blocks inside cards */
html body .verdict, html body .roast, html body .prophecy, html body .fab-move { background: var(--nd-sunken) !important; border-radius: var(--nd-r-sm) !important; }
@media (hover: hover) and (pointer: fine) {
  html body .wcard:hover, html body .scan:hover, html body .o-place:hover, html body .grape-item:hover, html body .region-card:hover,
  html body .cook-card:hover, html body .dict-card:hover, html body .friends-card:hover { box-shadow: var(--nd-ring-strong) !important; filter: none; }
}

/* --- Buttons: primary Pinot, secondary quiet fill, tertiary text --- */
html body .btn { font-family: var(--nd-sans); font-size: var(--nd-t-body); font-weight: 600; letter-spacing: -.005em; min-height: var(--nd-tap) !important;
  background: var(--nd-sunken); color: var(--nd-ink); box-shadow: none; border-radius: var(--nd-r-pill); }
html body .btn.filled { background: var(--nd-pinot); color: var(--nd-on-pinot); min-height: var(--nd-btn-h) !important; padding-inline: 24px; }
html body .btn.filled:active { background: var(--nd-pinot-pressed); }
html body .btn.wide { min-height: var(--nd-btn-h) !important; font-size: var(--nd-t-body); }
html body .btn.plain { background: transparent; color: var(--nd-pinot); }
html body .btn:disabled { opacity: 1; background: var(--nd-sunken); color: var(--nd-disabled); }
@media (hover: hover) and (pointer: fine) {
  html body .btn.filled:hover { background: var(--nd-pinot-pressed); }
  html body .btn:not(.filled):not(.plain):hover { background: #EAE8E3; }
}
html body .see-more { color: var(--nd-pinot) !important; font-weight: 600; }
html body .o-link { color: var(--nd-pinot); font-weight: 500; text-decoration: none; }

/* --- Chips and filters: hairline, one selected style --- */
html body .pill { min-height: var(--nd-chip-h) !important; padding: 0 14px; font-family: var(--nd-sans); font-size: var(--nd-t-body-s); font-weight: 500;
  background: var(--nd-surface); color: var(--nd-ink); box-shadow: inset 0 0 0 1px var(--nd-line-strong); border: 0; position: relative; }
html body .pill::after { content: ""; position: absolute; inset: -2px 0; }   /* 40pt chip, 44pt hit area */
html body .pill[aria-pressed="true"], html body .pill[aria-checked="true"], html body .shop-chips .pill[aria-pressed="true"] {
  background: var(--nd-pinot) !important; color: var(--nd-on-pinot) !important; box-shadow: none; }
html body .pill.pair-pill { background: var(--nd-pinot-tint) !important; color: var(--nd-pinot) !important; box-shadow: none; }
html body .pill svg { width: 16px; height: 16px; }
html body .o-pills span { height: 32px; background: var(--nd-sunken); color: var(--nd-ink); font-size: var(--nd-t-label); font-weight: 500; }

/* --- Text tabs (All, Red, White…) --- */
html body .styletabs { gap: 20px; }
html body .styletabs button { font-family: var(--nd-sans); font-size: var(--nd-t-body-s); font-weight: 500; color: var(--nd-ink-3); }
html body .styletabs button[aria-pressed="true"] { color: var(--nd-ink); font-weight: 600; }
html body .styletabs button[aria-pressed="true"]::after { background: var(--nd-pinot) !important; width: 16px; height: 2px; margin-left: -8px; border-radius: 2px; bottom: 4px; }

/* --- Segmented controls: one iOS-style control everywhere --- */
html body .segmented, html body .o-segs, html body .scale { background: var(--nd-sunken) !important; border-radius: var(--nd-r-sm); padding: 3px; gap: 2px; border: 0; }
html body .segmented button, html body .o-segs button { min-height: 36px; border-radius: 9px; font-family: var(--nd-sans); font-size: var(--nd-t-body-s); font-weight: 500; color: var(--nd-ink-2); background: transparent; }
html body .segmented button[aria-pressed="true"], html body .segmented button[aria-checked="true"], html body .o-segs button[aria-selected="true"], html body .scale span.on {
  background: var(--nd-surface) !important; color: var(--nd-ink) !important; font-weight: 600; box-shadow: 0 0 0 .5px var(--nd-line-strong), 0 1px 2px rgba(36, 31, 27, .08) !important;
}
html body .sheet .o-segs { box-shadow: 0 0 0 6px var(--nd-paper) !important; }
html body .scale span { height: 30px; border-radius: 8px; font-size: var(--nd-t-label); color: var(--nd-ink-3); }

/* --- List rows --- */
html body .row { gap: var(--nd-3); }
html body .row .t { font-family: var(--nd-sans); font-size: var(--nd-t-product); font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
html body .row .s { font-size: var(--nd-t-body-s); color: var(--nd-ink-2); }
html body .row .fams.sm { font-size: var(--nd-t-caption); color: var(--nd-ink-3); }
html body .row + .row::before { border-top: 1px solid var(--nd-line) !important; }
html body .row .yr, html body .yr { font-family: var(--nd-sans); font-size: var(--nd-t-body-s); font-weight: 500; color: var(--nd-ink-2); }

/* --- Ratings: Pinot stars, rose-grey when unfilled --- */
html body .stars { font-size: 13px; letter-spacing: 1px; color: var(--nd-pinot); line-height: 1; }
html body .stars .off { color: var(--nd-star-off) !important; }
html body .rate-stars button { color: var(--nd-star-off); font-size: 1.5rem; min-width: var(--nd-tap); min-height: var(--nd-tap); }
html body .rate-stars button.on { color: var(--nd-pinot); }
html body .rs-lbl { font-size: var(--nd-t-label); font-weight: 500; color: var(--nd-ink-2); }
html body .fav { color: var(--nd-pinot) !important; }

/* --- Forms --- */
html body .search input, html body .dish-in { height: var(--nd-tap); background: var(--nd-surface); box-shadow: inset 0 0 0 1px var(--nd-line-strong); border-radius: var(--nd-r-pill); font-family: var(--nd-sans); font-size: var(--nd-t-body); color: var(--nd-ink); }
html body .search input { padding-left: 42px; }
html body .search svg { left: 16px; color: var(--nd-ink-3); }
html body .search input::placeholder, html body .dish-in::placeholder, html body input::placeholder, html body textarea::placeholder { color: var(--nd-ink-3); }
html body .switch[aria-checked="true"] { background: var(--nd-pinot) !important; }
html body .frow label, html body .frow > span:first-child { font-size: var(--nd-t-body); color: var(--nd-ink); }

/* --- Sheets --- */
html body .sheet-head .title { font-family: var(--nd-sans); font-size: var(--nd-t-product); font-weight: 600; }
html body .sheet-head .btn.plain { color: var(--nd-pinot); font-weight: 500; font-size: var(--nd-t-product); background: transparent; box-shadow: none; }
html body .sheet-head .btn.plain.strong { font-weight: 600; }
html body .grabber { background: var(--nd-line-strong); }
html body .scrim { background: var(--nd-scrim) !important; }

/* --- Icon wells and round icon buttons --- */
html body .scan .ic, html body .scan-buy .ic, html body .o-place .ic { background: var(--nd-sunken) !important; color: var(--nd-ink) !important; border-radius: var(--nd-r-sm); }
html body .o-ic { width: var(--nd-tap); height: var(--nd-tap); background: var(--nd-surface) !important; box-shadow: var(--nd-ring-strong) !important; color: var(--nd-ink); }
html body .o-ic.on { color: var(--nd-pinot); }

/* ===================================================================== 6. Screens */

/* --- Cellar --- */
html body .tonight { padding: var(--nd-4) var(--nd-5) var(--nd-4) var(--nd-2); margin-top: var(--nd-5); }
html body .tn-circle, html body .o-circle { background: var(--nd-rose-tint) !important; }
html body .tn-k { margin-bottom: 2px; }
html body .tn-sub { font-size: var(--nd-t-body-s); color: var(--nd-ink-2); margin-top: var(--nd-2); }
html body .tn-food { font-size: var(--nd-t-body-s); margin-top: var(--nd-3); }
html body .tn-food b { font-weight: 600; }
html body .wcard { padding: var(--nd-3) var(--nd-3) var(--nd-4); }
html body .wcard .t { font-family: var(--nd-sans); font-size: var(--nd-t-body); font-weight: 600; line-height: 1.3; letter-spacing: -.01em; margin-top: var(--nd-3); }
html body .wcard .s { font-size: var(--nd-t-label); color: var(--nd-ink-2); margin-top: 2px; }
html body .wcard .foot { padding-top: var(--nd-3); }
html body .wcard .foot b { font-size: var(--nd-t-label); font-weight: 500; color: var(--nd-ink-2); }
html body .wcard .stars { font-size: 12px; }
html body .region-card, html body .cook-card { padding: var(--nd-3) var(--nd-3) var(--nd-4); }
html body .rc-sub, html body .cc-wine { font-size: var(--nd-t-label); color: var(--nd-ink-2); }
html body .cc-art { background: var(--nd-sunken); border-radius: var(--nd-r-sm); }
html body .toolbar .sort span { font-size: var(--nd-t-body-s); font-weight: 500; }

/* --- Palate --- */
html body .stats { gap: var(--nd-2) !important; }
html body .stat { padding: var(--nd-3) 10px 14px; min-width: 0; }
html body .stat b { font-family: var(--nd-sans); font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; color: var(--nd-ink); }
html body .stat span { font-size: var(--nd-t-caption) !important; letter-spacing: 0 !important; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html body .scale-row .k { font-size: var(--nd-t-body); font-weight: 500; }
html body .r-crime { color: var(--nd-pinot); }
html body .verdict .v-bar i.on, html body .count-pill i { background: var(--nd-pinot) !important; }
html body .verdict .v-bar i { background: var(--nd-line) !important; }

/* --- Recommendations --- */
html body .scan-buy span span, html body .scan span span { color: var(--nd-ink-2) !important; font-size: var(--nd-t-body-s); }
html body .br-verdict { background: var(--nd-sunken) !important; color: var(--nd-ink) !important; }
html body .buy-yes .br-verdict { background: var(--nd-pinot) !important; color: var(--nd-on-pinot) !important; }

/* --- School --- */
html body .snob-school .ss-means { font-size: var(--nd-t-body-s); color: var(--nd-ink-2); }
html body .snob-school .ss-means b { color: var(--nd-ink); }
html body .grape-item .gi-top span, html body .grape-item .gi-n { font-size: var(--nd-t-label); color: var(--nd-ink-3); }
html body .grape-item p { font-size: var(--nd-t-body-s); color: var(--nd-ink-2); }

/* ===================================================================== 7. Remaining surfaces and details
   Older layers hard-code cream and green in a few places; these bring them onto the tokens. */
html body .group, html body .facts, html body .notes-list, html body .buy, html body .banner, html body .unlocks, html body .qr-picks, html body .rec-card {
  background: var(--nd-surface) !important; box-shadow: var(--nd-ring) !important; border: 0 !important; border-radius: var(--nd-r-card) !important;
}
html body .better-row, html body .dict-item, html body .qa-item, html body .qr-pick, html body .ul-row { border-color: var(--nd-line) !important; }
html body .chips span, html body .fw-chips span, html body .sheet .share-row, html body .palate .share-row, html body .pair .pic { background: var(--nd-sunken) !important; }
html body .bm-track, html body .fam-tile .track { background: var(--nd-line) !important; }
html body .count-pill i, html body .ul-row.done .ul-ic, html body .pbar i.on { background: var(--nd-pinot) !important; color: var(--nd-on-pinot) !important; }
html body .btn.destructive { background: #FBECEA; color: var(--nd-danger, #B3261E); }
/* Educational headings in Learn it use the editorial serif */
html body .cc-lbl, html body .colour-card .cc-lbl, html body .map-card .cc-lbl { font-family: var(--nd-serif); font-size: 1.5rem; font-weight: 500; line-height: 1.15; letter-spacing: -.005em; }

/* Editorial voice: the "say it like a snob" lines are quotes, so they get the serif italic */
html body .snob-line .say, html body p.say { font-family: var(--nd-serif); font-style: italic; font-size: 1.375rem; font-weight: 400; line-height: 1.3; letter-spacing: 0; }
/* Text links: Pinot, sentence case, and a full 44pt row to tap */
html body .bottle-link, html body .bottle-link span { color: var(--nd-pinot) !important; font-size: var(--nd-t-body-s); font-weight: 500; letter-spacing: 0; text-transform: none; }
html body .bottle-link { display: inline-flex; align-items: center; gap: 6px; min-height: var(--nd-tap); }
html body .snob-school .o-link, html body .card .o-link { color: var(--nd-pinot) !important; display: inline-flex; align-items: center; min-height: var(--nd-tap); }
/* Where to buy: shop names read as list items; monograms stay neutral instead of borrowing four brand colours */
html body .shop .nm { font-size: var(--nd-t-body); font-weight: 500; }
html body .shop .nm small { font-size: var(--nd-t-label); color: var(--nd-ink-2); }
html body .shop .mono { background: var(--nd-sunken) !important; color: var(--nd-ink) !important; font-size: var(--nd-t-caption); font-weight: 600; }
/* Empty states sit quietly inside their card */
html body .empty { background: transparent !important; box-shadow: none !important; }
html body .card .empty, html body .empty p { color: var(--nd-ink-2); }
/* Friends: a neutral avatar, not a gold ring */
html body .fc-faces .ph { background: var(--nd-rose-tint) !important; color: var(--nd-pinot) !important; box-shadow: 0 0 0 1px var(--nd-line) !important; border: 0 !important; }
html body .look { text-transform: none; letter-spacing: 0; font-size: var(--nd-t-label); font-weight: 500; color: var(--nd-ink-2); }
html body .step-title { font-size: var(--nd-t-title); line-height: 1.1; }
html body .sheet-head .btn.plain { min-height: var(--nd-tap) !important; }
html body .o-link { display: inline-flex; align-items: center; min-height: var(--nd-tap); }
/* Links in section heads keep a 44pt hit area without making the heading row taller */
html body .section-head .o-link, html body .section-head button { min-height: 0; padding-block: 12px; margin-block: -12px; }
html body .shelf { padding-bottom: 4px; }
/* All wines: search, filters, tabs and sort sit as one tight control group above the list */
html body .filters { margin-top: var(--nd-3); }
html body .styletabs { margin-top: var(--nd-2); }
html body .toolbar { margin: 0 0 var(--nd-2); }
/* Every page title sits the same 20pt above whatever comes first */
html body .large-title + * { margin-top: var(--nd-5) !important; }
/* A card's title and its description read as one unit */
html body .card > h3 + p, html body .card > h3:first-child + .muted { margin-top: -8px; }
/* Both "at the shop" entry points read as equally available */
html body .scan b { color: var(--nd-ink) !important; }
/* Flavour tiles sit inside a card, so they drop their own outline and use the quiet fill */
html body .fam-tile { background: var(--nd-sunken) !important; box-shadow: none !important; }
html body .fam-tile .ficon rect:first-child { fill: var(--nd-surface); }
html body .fam-tile .track { background: var(--nd-line-strong) !important; }

/* ===================================================================== 8. Add button (moved by nd-paper.js)
   The tab bar keeps four equal destinations. Add lives beside "All wines" on the Cellar and in the header elsewhere. */
html.nd-add-moved body #log-fab { display: none !important; }
html.nd-add-moved body .tabbar { grid-template-columns: repeat(4, 1fr) !important; }
html.nd-add-moved body .tabbar .fab-gap { display: none !important; }
html body .nd-quick { display: flex; align-items: center; gap: var(--nd-3); }
html body .nd-quick-all {
  flex: 1; min-width: 0; height: var(--nd-btn-h); display: flex; align-items: center; justify-content: space-between; padding: 0 14px 0 20px;
  border: 0; border-radius: var(--nd-r-pill); background: var(--nd-surface); box-shadow: inset 0 0 0 1px var(--nd-line-strong);
  font-family: var(--nd-sans); font-size: var(--nd-t-body); font-weight: 500; color: var(--nd-ink); text-align: left; cursor: pointer;
}
html body .nd-quick-all svg { width: 20px; height: 20px; fill: none; stroke: var(--nd-ink-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html body .nd-quick-all:active { background: var(--nd-sunken); }
html body .nd-add.log-fab.nd-add-inline {
  position: static !important; transform: none !important; flex: none; width: var(--nd-btn-h); height: var(--nd-btn-h); margin: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; padding: 0;
  background: var(--nd-pinot) !important; color: var(--nd-on-pinot) !important; box-shadow: none !important; -webkit-backdrop-filter: none; backdrop-filter: none;
}
html body .nd-add.log-fab.nd-add-inline:active { background: var(--nd-pinot-pressed) !important; transform: scale(.96) !important; }
html body .nd-add svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
html body .navbar .end { display: flex; align-items: center; gap: 2px; }
html body .nd-add-nav {
  position: relative; isolation: isolate; width: var(--nd-tap); height: var(--nd-tap); padding: 0; border: 0; background: transparent;
  display: grid; place-items: center; color: var(--nd-on-pinot); cursor: pointer; transition: opacity .2s ease, transform .2s ease;
}
html body .nd-add-nav::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--nd-pinot); z-index: -1; }
html body .nd-add-nav svg { width: 20px; height: 20px; }
html body .nd-add-nav:active::before { background: var(--nd-pinot-pressed); }
html.nd-add-inline-on body .nd-add-nav { opacity: 0; transform: scale(.8); pointer-events: none; visibility: hidden; }
@media (prefers-reduced-motion: reduce) { html body .nd-add-nav { transition: none; } }

/* ===================================================================== 9. Sign-in and account screens (nd-standalone.css) */
html body .nd-signin { background: var(--nd-paper); color: var(--nd-ink); font-family: var(--nd-sans); }
html body .nd-si-logo { width: 104px; height: 90px; margin: 0 auto 10px; background: url(/nd-wordline.svg) center / contain no-repeat; }
html body .nd-si-logo > * { display: none !important; }   /* the older illustrated logo */
html body .nd-signin h1 { font-family: var(--nd-serif); font-weight: 500; font-size: 2.25rem; line-height: 1.08; letter-spacing: -.012em; font-variation-settings: normal; color: var(--nd-ink); }
html body .nd-signin h1 i { color: var(--nd-pinot); font-weight: 500; }
html body .nd-si-sub, html body .nd-si-busy span { font-family: var(--nd-sans); font-size: var(--nd-t-body); color: var(--nd-ink-2); }
html body .nd-si-fine, html body .nd-si-hint, html body .nd-si-or { font-family: var(--nd-sans); font-size: var(--nd-t-label); color: var(--nd-ink-3); }
html body .nd-si-or::before, html body .nd-si-or::after { background: var(--nd-line); }
html body .nd-si-emailbtn { min-height: var(--nd-btn-h); border: 0; box-shadow: inset 0 0 0 1px var(--nd-line-strong); background: var(--nd-surface); color: var(--nd-ink); font-family: var(--nd-sans); font-size: var(--nd-t-body); font-weight: 600; }
html body .nd-si-msg, html body .nd-si-busy, html body .nd-si-form { background: var(--nd-surface); border: 0; box-shadow: var(--nd-ring); border-radius: var(--nd-r-card); font-family: var(--nd-sans); }
html body .nd-si-busy b { font-family: var(--nd-serif); font-weight: 500; color: var(--nd-ink); }
html body .nd-si-wine { fill: var(--nd-pinot); }
html body .nd-si-tabs { background: var(--nd-sunken); border-radius: var(--nd-r-sm); padding: 3px; }
html body .nd-si-tabs button { min-height: 36px; border-radius: 9px; font-family: var(--nd-sans); font-size: var(--nd-t-body-s); font-weight: 500; color: var(--nd-ink-2); }
html body .nd-si-tabs button[aria-selected="true"] { background: var(--nd-surface); color: var(--nd-ink); font-weight: 600; box-shadow: 0 0 0 .5px var(--nd-line-strong), 0 1px 2px rgba(36, 31, 27, .08); }
html body .nd-si-f { font-family: var(--nd-sans); font-size: var(--nd-t-label); color: var(--nd-ink-2); }
html body .nd-si-f input { min-height: var(--nd-tap); border: 0; box-shadow: inset 0 0 0 1px var(--nd-line-strong); border-radius: var(--nd-r-sm); font-family: var(--nd-sans); font-size: var(--nd-t-body); color: var(--nd-ink); }
html body .nd-si-f input:focus { outline: 2px solid var(--nd-focus); outline-offset: 1px; }
html body .nd-si-show, html body .nd-si-link { color: var(--nd-pinot); font-family: var(--nd-sans); }
html body .nd-si-link { min-height: var(--nd-tap); }
html body .nd-si-go { min-height: var(--nd-btn-h); }

/* ===================================================================== 10. Cellar, as in the reference
   Favourites read as a collection shelf: standing bottles, four across, no card. Cook tonight becomes photo cards
   with a label chip. Real bottle photos come from bottles.js; unmatched wines keep their drawing. */
html body .shelf:has(> .wcard) { gap: var(--nd-3); }
html body .shelf .wcard {
  width: calc((min(100vw, 600px) - 2 * var(--nd-gutter) - 3 * var(--nd-3)) / 4); min-width: 74px;
  padding: 0 !important; background: transparent !important; box-shadow: none !important; border-radius: 0 !important;
  align-items: center; text-align: center;
}
html body .shelf .wcard .art { height: 158px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
html body .shelf .wcard .art svg.bart { width: 54px; height: 148px; }
html body .shelf .wcard .fav { display: none; }
html body .shelf .wcard .t { font-size: var(--nd-t-body-s); font-weight: 600; line-height: 1.25; letter-spacing: -.01em; margin-top: var(--nd-3); text-align: center; -webkit-line-clamp: 2; }
html body .shelf .wcard .s { font-size: var(--nd-t-caption); color: var(--nd-ink-2); margin-top: 3px; white-space: nowrap; max-width: 100%; }
html body .shelf .wcard .foot { flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding-top: 1px; margin-top: 0; min-height: 0; }
html body .shelf .wcard .foot b { font-size: var(--nd-t-caption); font-weight: 400; color: var(--nd-ink-3); }
html body .shelf .wcard .stars[data-score] { font-size: 0; letter-spacing: 0; display: inline-flex; align-items: center; gap: 3px; }
html body .shelf .wcard .stars[data-score] .off { display: none; }
html body .shelf .wcard .stars[data-score]::before { content: "★"; font-size: 12px; color: var(--nd-pinot); }
html body .shelf .wcard .stars[data-score]::after { content: attr(data-score); font-size: var(--nd-t-caption); font-weight: 600; color: var(--nd-ink); }

/* Bottle photos sit where the drawings sat, standing on the same baseline */
html body img.nd-bottle { display: block; width: auto; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 6px 6px rgba(36, 31, 27, .12)); }
html body .wcard .art img.nd-bottle { height: 150px; max-width: 100%; }
html body .tn-art img.nd-bottle { position: relative; height: 150px; margin-right: 6px; }
html body .o-art img.nd-bottle { height: 210px; }
html body .rec-art img.nd-bottle { height: 92px; margin: 0 auto; }

/* Cook tonight: the dish photo fills the card, with a label chip on top */
html body .shelf .cook-card {
  position: relative; overflow: hidden; width: calc((min(100vw, 600px) - 2 * var(--nd-gutter) - var(--nd-3)) / 2);
  padding: 0 !important; background: var(--nd-sunken) !important; box-shadow: none !important; border-radius: var(--nd-r-card) !important;
}
html body .shelf .cook-card .cc-art { height: 132px; border-radius: 0; background: var(--nd-sunken); }
html body .shelf .cook-card .cc-art img.food-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
html body .shelf .cook-card::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 8px; height: 46px; border-radius: 10px; background: rgba(255, 255, 255, .94); }
html body .shelf .cook-card .cc-name, html body .shelf .cook-card .cc-wine {
  position: absolute; z-index: 1; left: 18px; right: 18px; margin: 0; display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; -webkit-line-clamp: unset; text-align: left;
}
html body .shelf .cook-card .cc-name { bottom: 31px; font-size: var(--nd-t-body-s); font-weight: 600; line-height: 1.2; }
html body .shelf .cook-card .cc-wine { bottom: 15px; font-size: var(--nd-t-caption); line-height: 1.2; color: var(--nd-ink-2); }
html body .shelf .cook-card .cc-wine svg { width: 12px; height: 12px; vertical-align: -1px; }

/* The current tab's icon is filled, as in the reference */
html body .tabbar button[aria-current="page"] svg { fill: currentColor; fill-opacity: .16; }
