/* WineMenu.ai Partners — the restaurant portal. A plain, light work tool (owner, 2026-10-26: "partner section can have white BG
   and look like a standard portal. black bg is difficult to work with"; "GET RID OF THE PURPLE"). White cards on a pale page,
   near-black text, wine for actions, gold only for small highlights. */
:root {
  --bg: #F6F6F5; --card: #FFFFFF; --card2: #F3F3F2; --line: #E4E4E2; --line2: #D2D2CF;
  --cream: #1B1B1B; --dim: #5C5C5A; --dim2: #7C7C79; --gold: #9A6B12; --gold-bg: #FFF7E3; --wine: #8E2441; --wine-dk: #6E1B32;
  --ok: #23734F; --ok-bg: #EAF6F0; --warn: #A86A0B; --warn-bg: #FFF4DD; --bad: #B3392B; --bad-bg: #FCEDEA;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--cream); }
body { margin: 0; font: 15px/1.5 var(--sans); min-height: 100vh;
  padding-left: max(0px, env(safe-area-inset-left, 0px)); padding-right: max(0px, env(safe-area-inset-right, 0px)); }
a { color: var(--wine); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
.hide { display: none !important; }

/* ── Top bar ── */
.top { position: sticky; top: 0; z-index: 20; background: #FFFFFF; border-bottom: 1px solid var(--line); }
.top-in { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cream); }
.brand img { width: 30px; height: 30px; }
.brand b { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.brand span { color: var(--gold); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.top .grow { flex: 1; }
.who { color: var(--dim); font-size: 13px; overflow-wrap: anywhere; max-width: 38vw; }

/* ── Layout ── */
.wrap { max-width: 1120px; margin: 0 auto; padding: 22px 16px 80px; }
.narrow { max-width: 520px; margin: 0 auto; }
body.wide .wrap, body.wide .top-in { max-width: 1440px; }
h1 { font-family: var(--serif); font-size: 28px; line-height: 1.15; margin: 6px 0 8px; text-wrap: balance; }
h2 { font-family: var(--serif); font-size: 20px; margin: 22px 0 8px; }
h3 { font-size: 15px; margin: 16px 0 6px; }
.sub { color: var(--dim); margin: 0 0 18px; max-width: 70ch; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--dim); }
.small { font-size: 13px; }
.tiny { font-size: 12px; color: var(--dim2); }

/* ── Controls ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line2);
  background: #FFFFFF; color: var(--cream); cursor: pointer; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn:hover { background: var(--card2); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--wine); border-color: var(--wine); color: #fff; }
.btn.primary:hover { background: var(--wine-dk); }
.btn.gold { background: var(--gold-bg); border-color: #E9CF8F; color: var(--gold); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.ghost:hover { background: var(--card2); color: var(--cream); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.danger { color: var(--bad); }
.btn.google { background: #fff; color: #1f1f1f; border-color: var(--line2); }
.btn.google svg { flex-shrink: 0; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--dim); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select {
  width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line2); background: #FFFFFF; color: var(--cream); }
input::placeholder { color: #9B9B98; }
.or { display: flex; align-items: center; gap: 10px; color: var(--dim2); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.err { color: var(--bad); font-size: 14px; }
.note { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--card); }
.note.gold { border-color: #EBD49C; background: var(--gold-bg); }
.note.ok { border-color: #BFE3D1; background: var(--ok-bg); }

/* ── Chips ── */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line2); white-space: nowrap; background: #fff; }
.chip.pending { color: var(--warn); border-color: #EBCB8B; background: var(--warn-bg); }
.chip.verified { color: var(--gold); border-color: #EBD49C; background: var(--gold-bg); }
.chip.live { color: var(--ok); border-color: #BFE3D1; background: var(--ok-bg); }
.chip.rejected, .chip.paused { color: var(--bad); border-color: #F0C4BD; background: var(--bad-bg); }
.chip.oos { color: var(--warn); border-color: #EBCB8B; background: var(--warn-bg); }

/* ── Restaurant list ── */
.places { display: grid; gap: 8px; }
.place { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--cream); width: 100%; font: inherit; }
.place:hover { border-color: var(--line2); }
.place .nm { font-weight: 700; } .place .ad { color: var(--dim); font-size: 13px; }
.place.taken { opacity: .55; }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 16px; overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--dim); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tab.on { color: var(--cream); border-bottom-color: var(--wine); }

/* ── Upload ── */
.drop { display: block; border: 1.5px dashed var(--line2); border-radius: 12px; padding: 22px; text-align: center; background: #FBFBFA; cursor: pointer; }
.drop.over { border-color: var(--wine); background: #FBF2F4; }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: var(--wine); width: 0; transition: width .4s; }
/* The pages of the list: one pill each, wrapping (never cut off); the one being looked at is highlighted. */
.pgbar { display: flex; flex-wrap: wrap; gap: 5px 6px; align-items: center; margin: 10px 0 2px; }
.pgl { flex-basis: 100%; font: 700 10.5px/1.4 var(--sans); color: var(--dim); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; overflow-wrap: anywhere; }
.pgp { font: 12px/1.5 var(--sans); padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line2); background: #fff; color: var(--cream); cursor: pointer; }
.pgp:hover { border-color: var(--wine); }
.pgp.sel { border-color: var(--wine); background: #FBF2F4; box-shadow: inset 0 0 0 1px var(--wine); }
.pgp.off { cursor: default; color: var(--dim2); background: var(--card); }
.pgp.off:hover { border-color: var(--line2); }
.pgp.reading, .pgp.waiting { color: var(--gold); border-color: #EBD49C; background: var(--gold-bg); }
.pgp.failed { color: var(--bad); border-color: #F0C4BD; background: var(--bad-bg); }
.pgp .ok { color: var(--ok); font-weight: 700; }
.pgp .bad { color: var(--bad); font-weight: 700; }
.pgp .zero { color: var(--dim2); }
.pgp .lnk { font-size: 12px; }

/* ── The wine list ── */
.listhead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 2px; }
.listhead h2 { margin: 0; }
.listhead .grow { flex: 1; }
.sect { display: flex; align-items: baseline; gap: 6px; margin: 18px 0 6px; font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--cream); background: none; border: 0; padding: 0; }
button.sect { cursor: pointer; }
.sect .cnt { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--dim); }
.sect .tog { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--wine); margin-left: 4px; }
/* The list is ONE GRID, like a spreadsheet (owner, 2026-10-26: "this is an import tool"): the wine data in a fixed-width
   font, a hairline grid, the sortable column header kept in view while scrolling. The list's own words are a grey, read-only
   column; then our producer, wine and vintage (highlighted, editable), the format and its price — glass and bottle on one
   line, each other size on its own — and a status column: ✓ ready to publish, ✕ to resolve. */
.dt { border: 1px solid var(--line2); border-radius: 6px; background: var(--card); font: 12px/1.45 var(--mono); color: var(--cream); }
.dt .r { display: grid; grid-template-columns: var(--cols); gap: 0; align-items: stretch; border-top: 1px solid var(--line); border-left: 3px solid transparent; }
.dt .r > :not(.fix) { padding: 3px 9px; border-left: 1px solid var(--line); min-width: 0; overflow-wrap: break-word; }
.dt .r > :first-child { border-left: 0; }
.dt .r.head { position: sticky; top: var(--top-h, 51px); z-index: 5; background: #EFEFED; border-top: 0; border-radius: 5px 5px 0 0; }
.dt .r.head > * { overflow-wrap: normal; }
.sorth { font: 700 10.5px/1.5 var(--sans); color: var(--dim); text-transform: uppercase; letter-spacing: .06em; background: none; border: 0; text-align: left; cursor: pointer; }
.sorth:hover { color: var(--cream); background: #E6E6E3; }
.sorth[aria-sort="ascending"], .sorth[aria-sort="descending"] { color: var(--wine); }
.dt .num { text-align: right; }
/* Every row white; only the left edge says unsure (amber) or unknown (red) — owner, 2026-10-26: "all white". */
.dt .r.need { border-left-color: var(--warn); }
.dt .r.need.st-nomatch { border-left-color: var(--bad); }
.dt .r.skipped > :not(.st), .dt .r.oos > :not(.st) { color: var(--dim2); }
.dt .r.skipped .wn b, .dt .r.oos .wn b, .dt .r.skipped .none { color: var(--dim2); }
.mt { overflow-wrap: break-word; }
.dt .mt { color: var(--dim); background: rgba(0, 0, 0, .028); cursor: default; }
.dt .r.head .sorth:nth-child(3) { background: rgba(0, 0, 0, .028); }
.dt .pgn { color: var(--dim); font-variant-numeric: tabular-nums; }
.dt .r.cont { border-top: 1px dotted var(--line); }
.dt .fm { white-space: nowrap; }
/* the vintage: highlighted, and a click changes it */
.dt .vin { cursor: pointer; text-align: center; }
.dt .vin:hover { background: #FBF5F7; }
.vin b { display: inline-block; padding: 0 5px; border-radius: 4px; background: var(--gold-bg); color: #6B4A0C; font-weight: 700; box-shadow: inset 0 0 0 1px #EBD49C; }
.vin i { font-style: normal; color: var(--line2); }
.dt .vin.editing { padding: 1px 3px; background: #fff; box-shadow: inset 0 0 0 2px var(--wine); }
.vin input.vinin { width: 100%; min-width: 3.6em; border: 0; border-radius: 0; outline: 0; padding: 2px 3px; font: inherit; font-weight: 700; text-align: center; background: transparent; }
.mv { color: var(--dim2); white-space: nowrap; }
.dt .sec { color: var(--dim); font-size: 10.5px; text-transform: uppercase; }
.needn { color: var(--warn); }
/* Our wine: the producer in bold, the wine's name under it; a pencil says it can be changed (owner, 2026-10-26). */
.wn { position: relative; padding-right: 24px !important; }
.wn b { color: var(--cream); font-weight: 700; }
.wn .wnm { display: block; }
.pen { color: var(--dim2); font: 13px/1 var(--sans); }
.wn .pen { position: absolute; top: 4px; right: 7px; }
.vin .pen { margin-left: 4px; }
.wcell:hover .pen, .vin:hover .pen { color: var(--wine); }
.none { color: var(--bad); font-weight: 700; }
.span2 { grid-column: span 2; }
.dt .wcell { cursor: pointer; }
.dt .wcell:hover { background: #FBF5F7; text-decoration: underline dotted var(--line2); text-underline-offset: 3px; }
/* the price column: one segment per size, a hairline between them */
.dt .pc { position: relative; display: flex; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start; padding: 0 0 0 22px !important; }
.seg { padding: 3px 8px; border-left: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; cursor: text; }
.seg:first-child { border-left: 0; }
.seg i { font-style: normal; color: var(--dim2); }
.seg:hover { background: #FBF5F7; color: var(--wine); }
.seg:focus-visible { outline: 2px solid var(--wine); outline-offset: -2px; }
.seg.add { position: absolute; left: 0; top: 0; border-left: 0; color: var(--dim2); cursor: pointer; opacity: 0; }
.dt .r:hover .seg.add, .seg.add:focus-visible { opacity: 1; }
.seg b { font-weight: 400; }
.seg.oos, .seg.oos i { color: var(--dim2); }
.seg.oos b { text-decoration: line-through; text-decoration-color: var(--bad); }
/* 🚫 out of stock (lit while it is) and 🗑 remove — faint until pointed at, so the ✓ / ✕ reads first. */
.ib { font: 14px/1.3 var(--sans); background: none; border: 0; padding: 0 4px; border-radius: 5px; cursor: pointer; opacity: .45; filter: grayscale(1); }
.ib:hover, .ib:focus-visible { opacity: 1; filter: none; background: var(--card2); }
.ib.on { opacity: 1; filter: none; background: var(--warn-bg); box-shadow: inset 0 0 0 1px #EBCB8B; }
.seg.editing { display: flex; gap: 4px; align-items: center; padding: 1px 4px; background: #fff; box-shadow: inset 0 0 0 2px var(--wine); }
.seg input.cellin { width: 4.2em; border: 0; border-radius: 0; outline: 0; padding: 2px 4px; font: inherit; text-align: right; background: transparent; -moz-appearance: textfield; }
.cellin::-webkit-outer-spin-button, .cellin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.seg select.cellz { width: auto; padding: 1px 4px; font: 12px var(--sans); border-radius: 4px; }
/* status: a mark, then plain links */
.dt .st { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 0 2px; font: 12px/1.6 var(--sans); }
.mk { font-weight: 800; margin-right: 6px; }
.mk.ok { color: var(--ok); }
.mk.x { color: var(--bad); }
.xbtn { font: 800 13px/1.3 var(--sans); background: none; border: 0; padding: 0 5px; margin-right: 1px; border-radius: 5px; cursor: pointer; }
.xbtn:hover, .xbtn:focus-visible { background: var(--bad-bg); box-shadow: inset 0 0 0 1px #F0C4BD; }
.mk.oosx { color: var(--warn); }
.mk.dash { color: var(--dim2); }
.stx { color: var(--dim); }
.sep { color: var(--line2); margin: 0 3px; }
.lnk { font: inherit; background: none; border: 0; padding: 0; color: var(--wine); cursor: pointer; text-decoration: underline; text-decoration-color: #E2BFCA; text-underline-offset: 2px; }
.lnk:hover { text-decoration-color: currentColor; }
.lnk.danger { color: var(--bad); }
/* the window that resolves one wine */
body.modal-open { overflow: hidden; }
.modal-bg { position: fixed; inset: 0; background: rgba(20, 20, 20, .35); z-index: 40; }
.modal { position: fixed; z-index: 41; left: 50%; top: 6vh; transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); max-height: 88vh; overflow: auto;
  background: var(--card); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25); padding: 16px 18px; display: grid; gap: 12px; }
.modal-h { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-h h3 { margin: 2px 0; font-size: 16px; font-family: var(--mono); font-weight: 600; }
.modal .res.cur { background: var(--ok-bg); border-color: #BFE3D1; }
.modal .results { gap: 4px; }
.modal .res { padding: 5px 10px; }
.modal .res .rn { font-size: 14px; }
.modal .res .btn.small { padding: 3px 10px; font-size: 12.5px; }
.modal .step { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.step-h { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.step-h b { font-size: 14px; }
.modal .results { max-height: 46vh; overflow: auto; }
button.res.pick { width: 100%; font: inherit; text-align: left; cursor: pointer; color: var(--cream); }
button.res.pick:hover, button.res.pick:focus-visible { border-color: var(--line2); background: #fff; }
button.res.pick.on { background: var(--ok-bg); border-color: #BFE3D1; }
.res .go { color: var(--dim2); font-size: 18px; line-height: 1; }
.further { padding: 2px 2px 0; font-size: 13px; }
.modal-f { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; }
.dt .fix { grid-column: 1 / -1; border-top: 1px dashed var(--line2); padding: 8px 10px; margin: 0; font: 13px/1.5 var(--sans); }
.fix { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 10px 0 4px; margin-top: 2px; display: grid; gap: 8px; }
.fix-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filt { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line2); background: #fff; color: var(--dim); cursor: pointer; font-size: 13px; }
.filt.on { color: #fff; background: var(--cream); border-color: var(--cream); font-weight: 700; }
.results { display: grid; gap: 6px; }
.res { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: #FBFBFA; }
.res .rn { font-weight: 600; overflow-wrap: anywhere; } .res .rm { color: var(--dim); font-size: 12px; }
.fmt-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 8px; align-items: center; }

/* ── QR ── */
.qr-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 24px; align-items: start; }
.qr-preview { background: repeating-conic-gradient(#ECECEA 0 25%, #FFFFFF 0 50%) 0 0 / 22px 22px; border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: grid; place-items: center; }
.qr-preview canvas { width: 100%; height: auto; max-width: 280px; }
.dl { display: grid; gap: 8px; }
.linkbox { font-family: var(--mono); font-size: 14px; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line2); background: #FBFBFA; overflow-wrap: anywhere; }

/* ── Toast ── */
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: #1B1B1B; color: #FFFFFF; padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.toast.bad { background: var(--bad); }

@media (max-width: 760px) {
  .top .who { display: none; }
  .qr-grid { grid-template-columns: 1fr; }
  .fmt-row { grid-template-columns: 120px 1fr auto; }
}
/* The grid stacks on a narrow screen: the heading (once), the list's line, our wine and vintage; then each size's line —
   format, price, status — the other sizes indented under it. */
@media (max-width: 900px) {
  .dt .r { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; padding: 5px 10px; }
  .dt .r > :not(.fix) { padding: 0; border-left: 0; }
  .dt .r::after { content: ""; flex-basis: 100%; order: 5; }
  .dt .r.head { display: none; }
  .dt .sec { flex-basis: 100%; order: 1; font-size: 10.5px; letter-spacing: .04em; }
  .dt .r.same .sec { display: none; }
  .dt .mt { flex-basis: 100%; order: 2; background: none; }
  .dt .wn, .dt .vin { order: 3; }
  .wn { padding-right: 0 !important; }
  .wn .wnm { display: inline; }
  .wn .pen { position: static; margin-left: 4px; }
  .dt .pgn { order: 6; }
  .dt .pgn:not(:empty)::before { content: "p. "; }
  .dt .fm { order: 6; color: var(--dim); }
  .dt .pc { order: 6; justify-content: flex-start; padding-left: 0 !important; }
  .dt .st { order: 7; margin-left: auto; justify-content: flex-end; }
  .dt .r.cont { padding-left: 24px; }
  .dt .r.cont > .blank, .dt .r.cont::after { display: none; }
  .seg.add { position: static; opacity: 1; border-left: 1px solid var(--line); }
  .seg:first-child { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
