/* KuraCellar · Human Focus Digital */
/* Brand: Espresso & Linen (spec: brand/kuracellar-brand.css). Fonts: css/fonts.css */
:root {
  color-scheme: light dark;

  /* Brand: burgundy stays for the header bar and primary button */
  --burg:      #5B1A2B;
  --burg-2:    #7A2E40;   /* hover / pressed */
  --on-burg:   #FFFFFF;
  --header-bg: #5B1A2B;
  --header-fg: #F4F1EB;

  /* Text */
  --heading:   #4A2E22;   /* espresso: page titles, section titles, big numbers */
  --char:      #1F1A17;   /* body text */
  --muted:     #665D56;   /* captions and meta (was #8A7F75, which failed contrast) */

  /* Surfaces */
  --cream:     #F4F1EB;   /* app background (linen) */
  --paper:     #FDFBF8;   /* cards */
  --parch:     #ECE3DA;
  --soft:      #ECE3DA;
  --line:      #E3DCD3;

  /* Accent: replaces gold for UI (links, alert icons, active tab, badges) */
  --accent:      #6F4A36; /* cocoa */
  --accent-soft: #ECE3DA; /* tinted fill behind accent text */
  --alert-line:  #D8CABE;

  /* Status colors: unchanged from today */
  --past:      #B5524A;
  --soon:      #D9A441;
  --ready:     #6E9C6A;
  --too-young: #8FA3B8;
  --gone:      #BFBFBF;

  /* Wine-type colors: LOCKED. Identical in light and dark. Never theme these. */
  --wine-red:       #5B1A2B;
  --wine-white:     #E8D9A8;
  --wine-rose:      #E6A4A8;
  --wine-sparkling: #D9C27A;
  --wine-dessert:   #B08D57;
  --wine-fortified: #8A3B2E;
  --wine-orange:    #D98C3F;

  /* Kept at its old value so anything not yet migrated looks the same.
     New code: use --accent for UI, --wine-dessert for Dessert. */
  --gold: #B08D57;

  /* Type */
  --font-head: "Federo", "Zen Kaku Gothic New", system-ui, sans-serif;
  --font-body: "Zen Kaku Gothic New", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: var(--font-head);  /* old name, now points at Federo */
  --sans:  var(--font-body);
  --head-tracking: 0.04em;

  --radius: 12px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow: 0 1px 2px rgba(46, 30, 20, .06);

  /* Not in the brand file: field backgrounds and search highlights, themed for dark mode */
  --field-bg:  #FFFFFF;
  --mark:      #F3E3B8;
}


/* --------------------------------------------------------------------------
   3. Dark theme
   Follows the phone's setting. <html data-theme="light"> or "dark" forces it.
   The two blocks are identical; CSS can't share one block between a media
   query and an attribute selector.
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --burg:      #8A2D3B;  --burg-2: #A23A4A;
    --header-bg: #3A1519;  --header-fg: #EEE8E1;
    --heading:   #E9D6C4;
    --char:      #EEE8E1;
    --muted:     #A69D94;
    --cream:     #151311;
    --paper:     #1F1C19;
    --parch:     #2E2621;
    --soft:      #2E2621;
    --line:      #352E29;
    --accent:      #C9A58C;
    --accent-soft: #2E2621;
    --alert-line:  #43362E;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --field-bg:  #262220;
    --mark:      #4A3A1E;
  }
}
:root[data-theme="dark"] {
  --burg:      #8A2D3B;  --burg-2: #A23A4A;
  --header-bg: #3A1519;  --header-fg: #EEE8E1;
  --heading:   #E9D6C4;
  --char:      #EEE8E1;
  --muted:     #A69D94;
  --cream:     #151311;
  --paper:     #1F1C19;
  --parch:     #2E2621;
  --soft:      #2E2621;
  --line:      #352E29;
  --accent:      #C9A58C;
  --accent-soft: #2E2621;
  --alert-line:  #43362E;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --field-bg:  #262220;
  --mark:    #4A3A1E;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: var(--char); font-family: var(--font-body);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--accent); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Titles: Federo, all caps, spaced. Federo has one weight (400): never bold it. */
h1, h2, h3 { font-family: var(--font-head); font-weight: 400; text-transform: uppercase; letter-spacing: var(--head-tracking);
  color: var(--heading); margin: 0; }
h2, h3 { color: var(--char); }
/* Wine names stay in the body font, bold, sentence case */
.wine-name, h1.wine-name { font-family: var(--font-body); font-weight: 700; text-transform: none; letter-spacing: normal; color: var(--char); }
h1 { font-size: 28px; line-height: 1.2; } h2 { font-size: 19px; } h3 { font-size: 16px; }
@media (max-width: 480px) { h1 { font-size: 24px; } h1.wine-name { font-size: 22px; } }
.boot { min-height: 100vh; display: grid; place-items: center; font-family: var(--font-head);
  color: var(--heading); font-size: 22px; letter-spacing: var(--head-tracking); text-transform: uppercase; }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--header-bg); color: var(--header-fg);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 18px 10px; display: flex; align-items: center;
  gap: 16px; border-bottom: 1px solid rgba(0, 0, 0, .25); }
.brand { display: flex; flex-direction: column; line-height: 1.1; text-decoration: none; color: inherit; }
.brand b { font-family: var(--font-head); font-weight: 400; font-size: 20px; letter-spacing: var(--head-tracking); text-transform: uppercase; color: var(--header-fg); }
.brand small { font-size: 9px; letter-spacing: .16em; color: color-mix(in srgb, var(--header-fg) 72%, transparent); font-weight: 700; margin-top: 2px; }
.topnav { display: none; gap: 4px; margin-left: auto; }
.topnav a { color: var(--header-fg); opacity: .8; text-decoration: none; padding: 8px 12px; border-radius: 8px;
  font-size: 14px; }
.topnav a.on, .topnav a:hover { opacity: 1; background: rgba(255, 255, 255, .1); }
main { max-width: 1120px; margin: 0 auto; padding: 20px 16px calc(var(--nav-h) + var(--safe-b) + 28px); }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--paper);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: var(--safe-b); height: calc(var(--nav-h) + var(--safe-b)); }
.bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; background: none; border: 0;
  cursor: pointer; }
.bottomnav .on { color: var(--accent); }
.bottomnav svg { width: 22px; height: 22px; }
@media (min-width: 900px) {
  .topnav { display: flex; }
  .bottomnav { display: none; }
  main { padding: 28px 24px 48px; }
}
.demo-banner { background: var(--char); color: var(--cream); font-size: 13px; text-align: center;
  padding: 8px 12px; }
.demo-banner a { color: var(--accent-soft); font-weight: 700; margin-left: 8px; }
.notice { background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 0; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; display: flex;
  gap: 12px; align-items: center; flex-wrap: wrap; }
.notice .grow { flex: 1; min-width: 200px; }

/* ---------- building blocks ---------- */
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.grid > * { min-width: 0; } /* let grid columns shrink so long names truncate instead of overflowing */
.card h2 { margin-bottom: 12px; }
.label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr; }
.g4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .g2 { grid-template-columns: 1fr 1fr; } .g4 { grid-template-columns: repeat(4, 1fr); } }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 8px;
  padding: 22px 12px; }
.hero-stats .num, .stat-number { font-family: var(--font-head); font-weight: 400; font-size: clamp(30px, 7vw, 46px); color: var(--heading); line-height: 1.1;
  letter-spacing: var(--head-tracking); font-variant-numeric: lining-nums tabular-nums; }
.stat { text-align: center; padding: 14px 10px; border-bottom: 2px solid var(--alert-line); }
.stat .num { font-family: var(--font-head); font-size: 30px; color: var(--heading); line-height: 1.15; margin-top: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px;
  padding: 0 18px; border-radius: 999px; border: 1px solid var(--burg); background: var(--burg);
  color: var(--on-burg); cursor: pointer; text-decoration: none; font-size: 14.5px; white-space: nowrap; }
.btn:hover { background: var(--burg-2); }
.btn.ghost { background: transparent; color: var(--heading); }
.btn.ghost:hover { background: var(--soft); }
.btn.quiet { background: transparent; border-color: var(--line); color: var(--char); }
.btn.danger { background: transparent; color: var(--past); border-color: var(--past); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  white-space: nowrap; }
.st-too-young { background: var(--too-young); color: #fff; }
.st-ready { background: var(--ready); color: #fff; }
.st-drink-soon { background: var(--soon); color: var(--char); }
.st-past-peak { background: var(--past); color: #fff; }
.st-gone { background: var(--gone); color: var(--char); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty h2 { margin-bottom: 8px; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--soft);
  text-decoration: none; color: inherit; }
.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--cream); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .end { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.count { font-family: var(--font-head); font-size: 22px; color: var(--heading); line-height: 1; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.search { flex: 1; min-width: 200px; height: 42px; border: 1px solid var(--line); border-radius: 999px;
  padding: 0 16px; background: var(--paper); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 12px;
  font-size: 13px; cursor: pointer; }
.chip.on { background: var(--burg); color: var(--on-burg); border-color: var(--burg); }
select.compact { height: 38px; border: 1px solid var(--line); border-radius: 999px; padding: 0 12px;
  background: var(--paper); }

/* ---------- bars ---------- */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 120px 1fr 32px; gap: 10px; align-items: center; font-size: 13px; }
.bar .track { background: var(--soft); border-radius: 999px; height: 10px; overflow: hidden; }
.bar .fill { display: block; height: 100%; background: var(--burg); border-radius: 999px; }
.bar .n { text-align: right; color: var(--muted); }
.bar .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- detail ---------- */
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.facts .v { margin-top: 2px; }
.pair-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) { .pair-grid { grid-template-columns: 1fr 1fr; } }
.pair-grid div { border-top: 1px solid var(--soft); padding-top: 8px; }
.stars { color: var(--accent); letter-spacing: 2px; }
.star-input { display: flex; gap: 4px; }
.star-input button { background: none; border: 0; font-size: 26px; color: var(--line); cursor: pointer; padding: 0 2px; }
.star-input button.on { color: var(--accent); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { width: 40px; height: 40px; border: 0; background: var(--paper); font-size: 20px; cursor: pointer; color: var(--heading); }
.qty span { min-width: 36px; text-align: center; font-family: var(--font-head); font-size: 18px; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.fieldset { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.fieldset h3 { margin-bottom: 12px; }
.fields { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .fields { grid-template-columns: 1fr 1fr; } .fields .wide { grid-column: 1 / -1; } }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea { color: var(--char); height: 44px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; background: var(--field-bg); width: 100%; }
.field textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { flex: 1; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; white-space: nowrap; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; position: sticky;
  bottom: calc(var(--nav-h) + var(--safe-b)); background: linear-gradient(transparent, var(--cream) 30%); padding: 18px 0 8px; }
@media (min-width: 900px) { .form-actions { bottom: 0; } }
.error { color: var(--past); font-size: 13px; }

/* ---------- sheet (modal) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(30, 18, 14, .45); display: flex;
  align-items: flex-end; justify-content: center; }
.sheet { background: var(--cream); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + var(--safe-b)); }
@media (min-width: 640px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 18px; } }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sheet-head h2 { flex: 1; }
.close { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.video-box { position: relative; background: #111; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; }
.video-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-box .aim { position: absolute; left: 12%; right: 12%; top: 38%; bottom: 38%; border: 2px solid var(--accent-soft);
  border-radius: 10px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .25); }

/* ---------- drink windows ---------- */
.dw { overflow-x: auto; }
.dw-grid { display: grid; min-width: 760px; font-size: 12.5px; }
.dw-row { display: contents; }
.dw-name { padding: 6px 8px 6px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--soft); }
.dw-cell { border-bottom: 1px solid var(--soft); border-left: 1px solid var(--soft); height: 30px; position: relative; }
.dw-cell.now { border-left: 1.5px solid var(--accent); border-right: 1.5px solid var(--accent); }
.dw-cell i { position: absolute; inset: 7px 0; }
.dw-head { font-size: 10.5px; color: var(--muted); text-align: center; padding-bottom: 4px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  background: var(--char); color: var(--cream); padding: 10px 16px; border-radius: 999px; font-size: 14px;
  z-index: 60; display: flex; gap: 12px; align-items: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.toast button { background: none; border: 0; color: var(--accent-soft); font-weight: 700; cursor: pointer; }
@media (min-width: 900px) { .toast { bottom: 24px; } }
.footer { text-align: center; font-size: 12px; color: var(--muted); margin-top: 36px; }
@media (max-width: 639px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .toolbar .check { margin-left: 0 !important; }
}

/* ---------- dashboard sections ---------- */
.dash { display: grid; grid-template-columns: 1fr; gap: 16px; }
.dash > * { min-width: 0; }
@media (min-width: 720px) { .dash { grid-template-columns: 1fr 1fr; } .dash-sec.full { grid-column: 1 / -1; } }
.dash-sec > .card { height: 100%; margin: 0; }
.hero-stats .hero-link { text-decoration: none; color: inherit; border-radius: 10px; }
.hero-stats .hero-link:hover { background: var(--cream); }
.bottle-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 14px 6px 10px; align-items: end; }
.bottle-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: inherit;
  border-radius: 10px; padding: 6px 0 4px; }
.bottle-tile:hover { background: var(--cream); }
.bottle-tile .bottle-svg { display: block; width: auto; overflow: visible; transition: transform .15s; }
.bottle-tile:hover .bottle-svg { transform: translateY(-2px); }
.bottle-tile .label { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  text-align: center; white-space: nowrap; }
.bottle-tile.zero .bottle-svg { opacity: .35; }
.bottle-tile.zero .label { opacity: .6; }
/* Dark mode: a see-through bottle on a dark card turns gray, so an empty type keeps its true color
   and shows it's empty through the faded capsule, "0" and label (the wine colors never change). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bottle-tile.zero .bottle-svg { opacity: 1; }
  :root:not([data-theme="light"]) .bottle-tile.zero .bottle-svg > * { opacity: .45; }
  :root:not([data-theme="light"]) .bottle-tile.zero .bottle-body { opacity: 1; }
  :root:not([data-theme="light"]) .bottle-tile.zero text { opacity: .7; } }
:root[data-theme="dark"] .bottle-tile.zero .bottle-svg { opacity: 1; }
:root[data-theme="dark"] .bottle-tile.zero .bottle-svg > * { opacity: .45; }
:root[data-theme="dark"] .bottle-tile.zero .bottle-body { opacity: 1; }
:root[data-theme="dark"] .bottle-tile.zero text { opacity: .7; }
@media (min-width: 640px) { .bottle-tile .bottle-svg { height: 108px; } .bottle-tile .label { font-size: 11px; } }
@media (max-width: 480px) { .bottle-tile .label { font-size: 10px; letter-spacing: 0; text-transform: none; font-weight: 600; } }
.reorder { display: flex; flex-direction: column; gap: 4px; flex: none; }
.reorder button { width: 34px; height: 28px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px;
  cursor: pointer; color: var(--heading); }
.reorder button:disabled { opacity: .35; cursor: default; }
@media (max-width: 639px) {
      .hero-stats { padding: 18px 6px; }
  .hero-stats .small { font-size: 11.5px; }
  .page-head .actions { margin-left: 0; width: 100%; }
}

/* ---------- alerts ---------- */
.bell { margin-left: auto; position: relative; color: var(--header-fg); width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 999px; text-decoration: none; }
.bell:hover, .bell.on { background: rgba(255, 255, 255, .1); }
@media (min-width: 900px) { .topnav + .bell { margin-left: 8px; } }
.badge { position: absolute; top: -1px; right: -3px; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: var(--cream); font-size: 12px; font-weight: 700; line-height: 1; display: grid; place-items: center;
  border: 2px solid var(--header-bg); font-variant-numeric: tabular-nums; }
/* notification banner, under the header bar */
.notify { background: var(--accent-soft); border-bottom: 1px solid var(--alert-line); }
.notify-in { max-width: 1120px; margin: 0 auto; padding: 8px 16px; }
@media (min-width: 900px) { .notify-in { padding: 8px 24px; } }
.notify-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; font-size: 14px; }
.notify-item + .notify-item { border-top: 1px solid var(--alert-line); }
.notify-ico { width: 28px; height: 28px; border-radius: 50%; background: var(--paper); color: var(--accent); display: grid; place-items: center; flex: none; }
.notify-text { flex: 1; min-width: 0; color: var(--char); }
.notify-text span { color: var(--muted); }
.notify-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 640px) {
  .notify-item { align-items: flex-start; }
  .notify-text { flex-basis: calc(100% - 38px); }
  .notify-actions { margin-left: 38px; }
}
.notify-foot { display: flex; align-items: center; gap: 12px; padding: 4px 0 2px 38px; font-size: 13px; }
.notify-more { background: none; border: 0; padding: 4px 0; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 13px; text-decoration: underline; }
.notify-foot a { margin-left: auto; color: var(--muted); }
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-card { display: flex; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); }
.alert-card .main { flex: 1; min-width: 0; }
.alert-card .title { font-weight: 600; }
.alert-card .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.alert-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--soft); color: var(--muted); }
.alert-card { border-color: var(--alert-line); }
.alert-card.on { border-color: var(--alert-line); border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; }
.alert-card.on .alert-icon { background: var(--accent-soft); color: var(--accent); }
.alert-card.seen .alert-icon { background: var(--soft); }
.alert-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.sentence .sentence-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.sentence select, .sentence input { height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--field-bg); }
.sentence select:focus, .sentence input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.notice.warn { border-left-color: var(--soon); }

/* ---------- explore your cellar ---------- */
.xgrid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.xgrid > * { min-width: 0; }
@media (min-width: 720px) { .xgrid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .xgrid { grid-template-columns: repeat(3, 1fr); } }
.xc { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; }
.xc-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.xc-insight { font-family: var(--font-body); font-weight: 500; font-size: 17px; line-height: 1.35; color: var(--char); margin: 4px 0 12px; }
.xc-more { margin-top: auto; padding-top: 10px; font-size: 13px; text-decoration: none; }
.seg { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; }
.seg > * { display: block; min-width: 4px; }
.xc-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.xc-legend a { color: inherit; text-decoration: none; }
.xc-legend b { color: var(--char); font-weight: 600; }
.sq { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar, .prow { display: grid; grid-template-columns: minmax(0, 110px) 1fr auto; gap: 10px; align-items: center;
  font-size: 13px; color: var(--char); text-decoration: none; }
.hbar .name, .prow .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .track { background: var(--soft); border-radius: 999px; height: 10px; overflow: hidden; }
.hbar .fill { display: block; height: 100%; border-radius: 999px; }
.hbar .n, .prow .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.palate { display: flex; flex-direction: column; gap: 9px; }
.prow small { font-size: 11px; }
.avgstars { position: relative; display: inline-block; color: var(--line); letter-spacing: 2px; font-size: 15px; line-height: 1; justify-self: start; }
.avgstars > span { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; color: var(--accent); }
.hbar:hover .name, .prow:hover .name, .loc:hover span { text-decoration: underline; }
/* Column chart: bars are drawn in their own plot area (the label row sits below it and the
   count sits on top of each bar), so bar heights are true to scale and nothing gets clipped. */
.cols { display: flex; align-items: stretch; gap: 6px; height: 140px; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: center; }
.col .cplot { flex: 1; min-height: 0; position: relative; margin-top: 18px; }
.col .cbar { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 4px 4px 0 0; }
.col .cn { position: absolute; left: 0; right: 0; bottom: 100%; padding-bottom: 3px; font-size: 12px; line-height: 1.2;
  color: var(--char); font-variant-numeric: tabular-nums; }
.col .ck { flex: none; font-size: 11px; color: var(--muted); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.loc { background: var(--cream); border-radius: 8px; padding: 10px 8px; text-align: center; text-decoration: none; color: var(--char); }
.loc b { display: block; font-family: var(--font-head); font-weight: 400; font-size: 24px; color: var(--heading); line-height: 1.1; }
.loc span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow { grid-template-columns: minmax(0, 110px) auto 1fr; }

/* ---------- picker (grape, country) ---------- */
.pick-field { height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--field-bg); padding: 0 12px;
  display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; width: 100%; }
.pick-field span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-field.empty span:first-child { color: var(--muted); }
.pick-field:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pick-caret { color: var(--muted); font-size: 12px; }
.pick-search { position: sticky; top: -18px; z-index: 1; background: var(--cream); padding: 2px 0 8px; margin-top: -4px; }
.pick-search input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px;
  background: var(--field-bg); font-size: 16px; }
.pick-list { display: flex; flex-direction: column; min-height: 50vh; }
.pick-sec { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding: 14px 4px 6px; }
.pick-row { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 4px; border: 0;
  border-top: 1px solid var(--soft); background: none; text-align: left; cursor: pointer; width: 100%; font-size: 15px; }
.pick-row:hover { background: var(--soft); }
.pick-row.on { color: var(--accent); font-weight: 600; }
.pick-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 1px solid rgba(0, 0, 0, .1); }
.pick-name { flex: 1; min-width: 0; }
.pick-name mark { background: var(--mark); color: inherit; border-radius: 2px; }
.pick-alias { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.pick-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pick-check { color: var(--accent); }
.pick-plus { width: 10px; text-align: center; color: var(--accent); font-weight: 700; }
.pick-clear { color: var(--muted); justify-content: center; margin-top: 8px; }

/* ---------- label photos ---------- */
.crop { display: flex; flex-direction: column; gap: 10px; }
.crop-stage { position: relative; align-self: center; max-width: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.crop-stage img { display: block; max-width: 100%; max-height: 58vh; border-radius: 8px; }
.crop-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.crop-stage.empty { width: 100%; height: 40vh; background: var(--soft); border-radius: 8px; }
.crop-shade { fill: rgba(20, 10, 12, .5); }
.crop-edge { fill: none; stroke: #fff; stroke-width: 3; vector-effect: non-scaling-stroke; }
.crop-handle { cursor: grab; }
.crop-handle .hit { fill: transparent; }
.crop-handle .dot { fill: var(--burg); stroke: #fff; stroke-width: 3; vector-effect: non-scaling-stroke; }
.crop-status { margin: 0; text-align: center; min-height: 1.4em; }
.crop-tools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.crop-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; border-top: 1px solid var(--soft); }
.photo-strip { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.photo-tile { position: relative; width: 64px; height: 84px; }
.photo-pick { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; width: 100%; height: 100%; background: var(--soft); cursor: pointer; }
.photo-tile.cover .photo-pick { border: 2px solid var(--accent); }
.photo-pick img, .row-thumb img, .gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-badge { position: absolute; left: 4px; bottom: 4px; background: var(--burg); color: var(--on-burg); font-size: 10px; padding: 1px 5px; border-radius: 4px; }
.photo-x { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--char); font-size: 15px; line-height: 1; cursor: pointer; }
.row-thumb { width: 36px; height: 48px; border-radius: 6px; overflow: hidden; flex: none; background: var(--soft); border: 1px solid var(--line); }
.gallery { margin-bottom: 16px; }
.gallery-main { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; justify-content: center; }
.gallery-main img { display: block; max-width: 100%; max-height: 280px; object-fit: contain; }
.gallery-strip { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.gallery-thumb { width: 44px; height: 58px; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--soft); cursor: pointer; }
.gallery-thumb.on { border: 2px solid var(--accent); }
.photo-empty { margin: -4px 0 14px; }
.scan-explain { margin: 0 0 12px; padding: 10px 12px; background: var(--cream); border: 1px solid var(--line); border-radius: 8px; color: var(--char); }
.backup-ready { background: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.backup-ready p { margin: 0; }
.backup-ready .warn { color: var(--past); margin-top: 6px; }
/* backup reminders */
.nav-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: 5px; vertical-align: 2px; }
.nav-ico { position: relative; display: inline-flex; }
.nav-ico .nav-dot { position: absolute; top: -1px; right: -5px; margin: 0; border: 2px solid var(--paper); width: 10px; height: 10px; }
.backup-status { margin: 10px 0 12px; font-size: 14px; }
.backup-status.due { color: var(--char); background: var(--accent-soft); border: 1px solid var(--alert-line); border-radius: 8px; padding: 8px 10px; }
.row .meta.due { color: var(--accent); font-weight: 700; }

/* ---------- subscription + recently deleted (v0.8.0) ---------- */
.key-form { margin-top: 10px; }
.key-form .field { max-width: 460px; margin-bottom: 8px; }
#f_license { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.license-status { margin: 4px 0 6px; }
.license-status.ended { color: var(--char); background: var(--accent-soft); border: 1px solid var(--alert-line); border-radius: 8px; padding: 8px 10px; }
.unlock { max-width: 560px; margin: 8px auto 0; }
.unlock h1 { margin-bottom: 6px; }
.unlock .sub { margin-bottom: 16px; }
.trash-row { align-items: flex-start; }
.trash-row .main .title { white-space: normal; }
.trash-actions { display: flex; gap: 6px; flex: none; align-items: center; }
@media (max-width: 420px) {
  .trash-row { flex-wrap: wrap; }
  .trash-actions { width: 100%; justify-content: flex-start; }
}
.key-form .warn { color: var(--past); margin: 0 0 8px; }
.code-input { font-size: 22px; letter-spacing: .3em; max-width: 220px; }
.sync-bar { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; margin: 6px 0 4px; }
.sync-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.backup-status.safe { color: var(--char); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; gap: 6px; align-items: flex-start; }
.backup-status.safe svg { color: var(--accent); flex: none; margin-top: 2px; }
.card h3.subhead { font-size: 13px; letter-spacing: .08em; color: var(--muted); border-top: 1px solid var(--soft); padding-top: 14px; margin: 18px 0 6px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 6px; }
.backup-promise { margin-top: 16px; }
.member-list .row { align-items: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--char); display: inline-flex;
  align-items: center; justify-content: center; font-family: Federo, Georgia, serif; font-size: 16px; flex: none; }
.invite-box { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 8px; }
.invite-code { font-family: Federo, Georgia, serif; font-size: 34px; letter-spacing: .12em; color: var(--heading); margin: 6px 0 4px; }
.open-invite .title { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; }
.member-list .row { flex-wrap: wrap; }
.member-actions { display: flex; gap: 6px; margin-left: auto; }
@media (max-width: 420px) { .member-actions { width: 100%; padding-left: 46px; margin-left: 0; } }

/* ---------- cellar switcher (v0.11.0) ---------- */
.cellar-bar { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; border-bottom: 1px solid var(--line);
  background: var(--paper); color: var(--char); padding: 9px 16px; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.cellar-bar svg { color: var(--accent); flex: none; }
.cellar-bar .cb-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cellar-bar .cb-role { color: var(--muted); font-size: 12px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cellar-row { gap: 8px; }
.cellar-pick { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; background: none; border: 0; padding: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer; }
.cellar-pick .main { display: flex; flex-direction: column; min-width: 0; }
.cellar-check { width: 20px; flex: none; color: var(--accent); display: inline-flex; }
.cellar-row.on .title { color: var(--heading); }

/* ---------- activity (v0.12.0) ---------- */
.activity-day { margin: 18px 0 8px; border-top: 0; padding-top: 0; }
.activity-row { align-items: flex-start; gap: 10px; }
.activity-ico { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--char); display: inline-flex;
  align-items: center; justify-content: center; flex: none; margin-top: 1px; }
.activity-line { line-height: 1.45; white-space: normal; }
.activity-line .stars, .activity-line svg { vertical-align: -2px; }
.activity-time { flex: none; white-space: nowrap; padding-top: 3px; }
.activity-filter { display: flex; gap: 6px; margin: 4px 0 6px; }
.install-steps { margin: 8px 0 10px; padding-left: 22px; }
.install-steps li { margin: 6px 0; line-height: 1.5; }

/* ---------- settings layout (v0.13.0) ---------- */
.attention { border-color: var(--alert-line); background: var(--accent-soft); }
.attention h2 { color: var(--char); }
.attention .row { border-bottom-color: var(--alert-line); align-items: center; }
.attention-text { color: var(--char); line-height: 1.45; white-space: normal; }
.account-line { margin: 4px 0 6px; line-height: 1.5; }
.danger-zone { border-top: 1px solid var(--soft); margin-top: 14px; padding-top: 12px; }
