/* ==========================================================================
   Stocked's own pages (2026-10-26): home tiles, tables of money, the count
   screen, spec and delivery line editors. Built on app.css and manage.css.
   A loss is always written ("£12.40 short", a minus sign), and the claret
   only underlines it.
   ========================================================================== */

.page .back { display: inline-block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.page .back:hover { color: var(--text); }
.num-r { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.num-r.muted { color: var(--muted); font-weight: 500; min-width: 78px; text-align: right; }
.arrow { color: var(--muted2); }
.tag-warn { background: var(--warn-wash); color: var(--warn); }
.page .rows > li > a, .page .rows > li > label.pick { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
@media (hover: hover) { .page .rows > li:has(> a):hover { background: var(--wash); } }
.danger-zone { margin: 28px 0 0; }
.is-short { color: var(--brand-text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.sp-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 10px !important; }
.sp-group-head h2 { margin: 0 !important; }

/* Filter chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 16px; }
.chip { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--surface2); color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.chip:hover { color: var(--text); }
.chip[aria-current="true"] { background: var(--action); color: var(--on-action); }

/* Home tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px var(--border-soft); color: inherit; text-decoration: none; min-width: 0; }
@media (hover: hover) { a.tile:hover { box-shadow: 0 0 0 1px var(--border-strong); } }
.tile-k { font-size: 13px; font-weight: 600; color: var(--muted); }
.tile-v { font-size: 26px; font-weight: 800; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tile-v.is-quiet { font-size: 19px; color: var(--muted); font-weight: 700; }
.tile-s { font-size: 13px; color: var(--muted); line-height: 1.4; }
.home-cols { align-items: start; }
.todo li > a, .more-list li > a { padding: 0; }
.todo-done b { color: var(--muted); }
.chg { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14px; }
.chg-pct { font-size: 12.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--surface2); color: var(--muted); }
.chg-pct.is-up { background: var(--brand-wash); color: var(--brand-text); }
.count-open { display: flex; align-items: center; gap: 16px; color: inherit; text-decoration: none; }
.count-open .who b { white-space: normal; }

/* Products */
.prod-cost { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; font-variant-numeric: tabular-nums; }
.prod-cost > span:not(.tag) { font-size: 12.5px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid .field { margin: 0; }
.prefix, .suffix { display: flex; align-items: center; position: relative; }
.prefix > span, .suffix > span { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; font-size: 15px; color: var(--muted); pointer-events: none; }
.prefix > span { left: 14px; }
.suffix > span { right: 14px; }
.prefix input { padding-left: 30px !important; width: 100%; }
.suffix input { padding-right: 48px !important; width: 100%; }
.calc { margin: 14px 0 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1em; }
.weigh { margin-top: 16px; }
.weigh summary { cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--brand-text); }
.weigh[open] summary { margin-bottom: 10px; }
.weigh .form-grid { margin-top: 12px; }
.area-picks { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 12px; }
.pick { cursor: pointer; }
.pick input { width: 20px; height: 20px; flex: none; accent-color: var(--brand); }

/* Tables of money */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-top: 1px solid var(--border-soft); vertical-align: top; }
.tbl tr:first-child td { border-top: 0; }
.tbl th:first-child, .tbl td:first-child { padding-left: 24px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 24px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl a { color: inherit; text-decoration: none; }
.tbl a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.tbl tfoot td { border-top: 1px solid var(--border); font-weight: 600; }
.tbl .tag { margin-left: 6px; vertical-align: 1px; }
.tbl-small { font-size: 13px; }
.tbl-small td, .tbl-small th { padding: 6px 10px; white-space: nowrap; }
.pct { font-weight: 650; }
.pct.is-low { color: var(--brand-text); }
.pct small { font-size: 11.5px; font-weight: 700; margin-left: 3px; text-transform: uppercase; letter-spacing: .04em; }

/* Spec editor */
.spec-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.spec-money { position: sticky; top: 78px; }
.sum { margin: 16px 0 0; display: grid; gap: 0; }
.sum > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border-soft); font-variant-numeric: tabular-nums; }
.sum dt { color: var(--muted); font-size: 14px; }
.sum dd { margin: 0; font-weight: 650; text-align: right; }
.sum .sum-big dd { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-soft); }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 120px 74px 40px; gap: 10px; align-items: center; padding: 8px 14px 8px 24px; border-bottom: 1px solid var(--border-soft); }
.line select, .line input { height: 42px; width: 100%; border: 1px solid transparent; border-radius: 11px; background: var(--surface2); color: var(--text); font: inherit; font-size: 15px; padding: 0 12px; }
.line select:focus, .line input:focus { outline: none; background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.line-cost { text-align: right; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dl-line { grid-template-columns: minmax(0, 1fr) 190px 110px 40px; }
.dl-qty { display: flex; gap: 6px; }
.dl-qty input { width: 76px; flex: none; }
.dl-qty select { flex: 1; padding: 0 8px; }
.dl-note { grid-column: 1 / -1; margin: -2px 0 0; font-size: 13px; color: var(--brand-text); font-weight: 600; }
.dl-note:empty { display: none; }
.order-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 12px !important; border-top: 1px solid var(--border-soft); }
.order-act form { margin: 0; }

/* Settings */
.sup { flex: 1; min-width: 0; }
.sup summary { display: flex; align-items: center; gap: 14px; list-style: none; cursor: pointer; }
.sup summary::-webkit-details-marker { display: none; }
.sup[open] summary .btn { visibility: hidden; }
.sup-form { margin-top: 14px; }
.sup-act { display: flex; gap: 8px; }
.shelf { counter-reset: none; }
.shelf-n { flex: none; width: 26px; text-align: right; font-weight: 700; color: var(--muted2); font-variant-numeric: tabular-nums; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
.typed-rows li { gap: 12px; }
.typed-q { width: 92px; height: 42px; text-align: right; border: 1px solid transparent; border-radius: 11px; background: var(--surface2); color: var(--text); font: inherit; padding: 0 12px; }
.match-rows li { flex-wrap: wrap; }
.match-rows .who { flex: 1 1 180px; min-width: 0; }
.match-rows select { flex: 1 1 260px; max-width: 100%; height: 42px; border: 1px solid transparent; border-radius: 11px; background: var(--surface2); color: var(--text); font: inherit; padding: 0 10px; }
.notice > span { flex: 1 1 260px; }
a.notice { color: inherit; text-decoration: none; }

/* Where it went and menu sorting */
.gap-pick { align-items: flex-end; }
.gap-pick .field { flex: 0 1 220px !important; }
.fine summary { display: flex; gap: 10px; align-items: baseline; }
.quads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.quad { padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--border-soft); display: flex; flex-direction: column; gap: 4px; }
.quad b { font-size: 16px; }
.quad span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.verdict { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 13.5px; white-space: nowrap; }
.verdict::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted2); }
.v-star::before { background: var(--brand); }
.v-plough::before { background: var(--action); }
.v-puzzle::before { background: transparent; box-shadow: inset 0 0 0 2px var(--brand); }
.v-dog::before { background: transparent; box-shadow: inset 0 0 0 2px var(--muted2); }

/* The count screen */
.page-count { max-width: 720px; }
.ct-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.ct-head h1 { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -0.045em; }
.ct-head h1 .dot { color: var(--brand); }
.ct-head p { margin: 4px 0 0; color: var(--muted); }
.ct-sync { margin: 8px 0 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.ct-sync::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.ct-sync.is-waiting { color: var(--warn); }
.ct-sync.is-waiting::before { background: var(--warn); }
.ct-tabs { position: sticky; top: 60px; z-index: 20; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; margin: 0 0 6px; background: var(--bg); scrollbar-width: none; }
.ct-tabs::-webkit-scrollbar { display: none; }
.ct-tab { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 52px; padding: 7px 14px; border: 0; border-radius: 14px; background: var(--surface2); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.ct-tab b { font-size: 14.5px; }
.ct-tab span { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ct-tab.is-on { background: var(--action); color: var(--on-action); }
.ct-tab.is-on span { color: color-mix(in srgb, var(--on-action) 72%, transparent); }
.ct-tab.is-done:not(.is-on) span::before { content: "✓ "; color: var(--brand-text); font-weight: 800; }
.ct-prog { display: block; width: 100%; min-width: 64px; height: 3px; margin-top: 5px; border-radius: 2px; background: color-mix(in srgb, currentColor 14%, transparent); overflow: hidden; }
.ct-prog i { display: block; height: 100%; border-radius: 2px; background: var(--brand); }
.ct-tab.is-on .ct-prog i { background: var(--on-action); }
/* Each row: a box that fills claret with a tick once it's counted. */
.ct-box { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--border-strong); border-radius: 8px; }
.ct-row.is-counted .ct-box { background: var(--brand); border-color: var(--brand); }
.ct-row.is-counted .ct-box::after { content: ""; width: 11px; height: 6px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg); }
.ct-chev { width: 18px; height: 18px; fill: none; stroke: var(--muted2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ct-rows { list-style: none; margin: 0; padding: 0; border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px var(--border-soft); overflow: hidden; }
.ct-row { border-top: 1px solid var(--border-soft); }
.ct-row:first-child { border-top: 0; }
.ct-row-head { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 10px 18px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ct-row.is-open .ct-row-head { background: var(--wash); }
.ct-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ct-name b { font-size: 15.5px; font-weight: 650; }
.ct-name span { font-size: 13px; color: var(--muted); }
.ct-val { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 14px; font-weight: 600; color: var(--brand-text); font-variant-numeric: tabular-nums; }
.ct-val.is-set { color: var(--text); }
.ct-row.is-counted .ct-val.is-set::before { content: ""; }
.ct-who { font-size: 12px; font-weight: 600; color: var(--muted); }
.ct-edit { display: flex; flex-direction: column; gap: 14px; padding: 6px 18px 18px; background: var(--wash); }
.ct-lab { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.ct-step-row { display: flex; gap: 8px; }
.ct-step-row button { width: 56px; height: 52px; flex: none; border: 0; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--border-soft); color: var(--text); font: 600 24px var(--font-sans); cursor: pointer; }
.ct-step-row input { flex: 1; min-width: 0; height: 52px; border: 1px solid transparent; border-radius: 14px; background: var(--surface); color: var(--text); text-align: center; font: 750 22px var(--font-sans); font-variant-numeric: tabular-nums; }
.ct-step-row input:focus, .ct-weigh input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.ct-ten-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ct-ten-row button { height: 46px; border: 0; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--border-soft); color: var(--text); font: 650 16px var(--font-sans); cursor: pointer; font-variant-numeric: tabular-nums; }
.ct-ten-row button[aria-pressed="true"] { background: var(--action); color: var(--on-action); box-shadow: none; }
.ct-weigh input { width: 100%; height: 48px; border: 1px solid transparent; border-radius: 12px; background: var(--surface); color: var(--text); font: 650 18px var(--font-sans); padding: 0 14px; }
.ct-act { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.ct-act .btn-primary { flex: 1 1 160px; justify-content: center; height: 50px; }
.ct-closed { padding: 22px 20px; border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px var(--border-soft); }
.ct-closed p { margin: 6px 0 0; color: var(--muted); }
.ct-step-row button:active, .ct-ten-row button:active { transform: scale(.96); }

@media (max-width: 900px) {
  .tiles, .quads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-cols { grid-template-columns: 1fr; }
  .spec-money { position: static; }
}
@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
  .tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
  .tbl td, .tbl th { padding-left: 8px; padding-right: 8px; }
  .tbl-wide { display: none; }
  .tbl { font-size: 14px; }
  .line { grid-template-columns: minmax(0, 1fr) 96px 36px; padding: 8px 8px 8px 16px; }
  .line .line-cost { display: none; }
  .dl-line { grid-template-columns: 1fr 1fr 36px; }
  .dl-line select[name=line_product] { grid-column: 1 / -1; }
  .ct-row-head { padding: 10px 16px; }
  .ct-edit { padding: 6px 16px 16px; }
  .tile { padding: 14px 16px; }
  .tile-v { font-size: 22px; }
  .page-head .row-actions, .card-pad .row-actions { width: 100%; justify-content: flex-start; padding-left: 0; }
}
@media (max-width: 420px) {
  .tiles, .quads { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile-v { font-size: 20px; }
}

/* Long names wrap rather than push the page wider than the phone. */
.grid-2 > *, .tiles > *, .stack > * { min-width: 0; }
.todo .who b, .todo .who span, .more-list .who span, .count-open .who span, .notice span { white-space: normal; }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gap-empty h2 { white-space: normal; }
@media (max-width: 900px) {
  .tiles-3 { grid-template-columns: 1fr 1fr; }
  .tiles-3 .tile-main { grid-column: 1 / -1; }
}

/* An unused save bar inside a form takes no room */
.page .card .savebar.is-idle { height: 0; padding-top: 0; padding-bottom: 0; margin: 0; overflow: hidden; }

/* A list that ends a card keeps the card's round bottom corners on hover */
.page .card > .rows:last-child { border-radius: 0 0 18px 18px; overflow: hidden; }
.page .card > .rows:only-child { border-radius: 18px; }

/* Stepping between counts (2026-10-26): arrows a week at a time, any two
   counts behind "Other counts". */
.gap-bar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.step { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 14px; background: var(--surface2); }
.step-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--text); }
.step-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
a.step-btn:hover { background: var(--surface); }
.step-btn.is-off { color: var(--muted2); }
.step-label { min-width: 0; padding: 8px 16px; border-radius: 10px; background: var(--surface); box-shadow: 0 1px 3px rgba(17,22,29,.1); font-size: 14.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.step-to { color: var(--muted); font-weight: 500; }
.pop { position: relative; }
.pop > summary { list-style: none; cursor: pointer; }
.pop > summary::-webkit-details-marker { display: none; }
.pop-body { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; display: flex; flex-direction: column; gap: 12px; width: 260px; padding: 16px; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--border-soft), 0 12px 32px rgba(17,22,29,.16); }

.tile-main .tile-v { font-size: 32px; }
.gap-bar-top .chips { margin: 0; }

/* Menu sorting chart: a section's drinks by sales share (across) and profit
   per drink (up). Filled dots sell well, rings don't; claret makes good
   money, ink doesn't. Every dot has its name, so colour never works alone. */
.qc-wrap { padding: 0 24px 18px; }
.qc { display: block; width: 100%; height: auto; font-family: var(--font-sans); }
.qc-q { fill: var(--surface2); opacity: .7; }
.qc-q.qc-star { fill: var(--brand-wash); opacity: 1; }
.qc-line { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.qc-corner { font-size: 12px; font-weight: 700; fill: var(--muted); letter-spacing: .02em; text-transform: uppercase; }
.qc-axis { font-size: 11.5px; fill: var(--muted2); }
.qc-dot text { font-size: 12px; font-weight: 600; fill: var(--text); }
.qc-dot circle { stroke-width: 2.4; }
.qc-star circle { fill: var(--brand); stroke: var(--brand); }
.qc-plough circle { fill: var(--action); stroke: var(--action); }
.qc-puzzle circle { fill: var(--surface); stroke: var(--brand); }
.qc-dog circle { fill: var(--surface); stroke: var(--muted2); }
.qc-narrow { display: none !important; }
@media (max-width: 640px) { .qc-wrap { padding: 0 12px 12px; } .qc-wide { display: none !important; } .qc-narrow { display: block !important; } }

/* More: an icon tile on each row, like the tabs they stand in for. */
.more-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--brand-wash); color: var(--brand-text); }
.more-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chip-pick { gap: 6px; background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--text); }

/* ==========================================================================
   Where it went, rebuilt (2026-10-27)
   ==========================================================================
   The week's figure big, the trend beside it, then every line on a bar that
   grows out from the middle: short to the right in claret, over to the left
   in ink. Each line opens (a <details>) into its own sum. */

.gw-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; padding: 22px 28px 26px; overflow: hidden; }
.gw-hero .gap-bar-top { margin-bottom: 22px; }
.gw-big { margin: 0; font-size: clamp(46px, 6.4vw, 76px); font-weight: 800; letter-spacing: -0.055em; line-height: .95; font-variant-numeric: tabular-nums; }
.gw-big.is-short { color: var(--brand-text); }
.gw-big.is-quiet { font-size: 40px; color: var(--muted); }
.gw-say { margin: 14px 0 0; max-width: 44ch; font-size: 16.5px; line-height: 1.5; text-wrap: pretty; }
.gw-say a { color: inherit; font-weight: 650; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 55%, transparent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.gw-say a:hover { text-decoration-color: var(--brand); }
.gw-say .hint { display: block; margin-top: 4px; font-size: 14px; }
.gw-flow { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 0; margin: 22px 0 0; }
.gw-flow > div { padding: 2px 18px 2px 0; margin-right: 18px; border-right: 1px solid var(--border-soft); }
.gw-flow > div:last-child { border-right: 0; margin-right: 0; }
.gw-flow dt { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.gw-flow dd { margin: 2px 0 0; font-size: 17px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.gw-flow .is-gap dd { color: var(--brand-text); }

.gw-trend { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; padding-left: 28px; border-left: 1px solid var(--border-soft); }
.gw-trend-k { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tr { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-sans); }
.tr-zero { stroke: var(--border-strong); stroke-width: 1; }
.tr-hit { fill: transparent; }
.tr-col { transform-box: fill-box; transform-origin: 50% 100%; }
.tr-col.is-short { fill: var(--brand); }
.tr-col.is-over { fill: var(--text); transform-origin: 50% 0; }
.tr-col.is-fine { fill: var(--muted2); }
.tr-col.is-none { fill: none; stroke: var(--border-strong); stroke-dasharray: 3 3; }
.tr-bar .tr-col { opacity: .3; transition: opacity .2s; }
.tr-bar:hover .tr-col, .tr-bar:focus-visible .tr-col { opacity: .62; }
.tr-bar.is-on .tr-col { opacity: 1; }
.tr-val { font-size: 12px; font-weight: 700; fill: var(--muted); font-variant-numeric: tabular-nums; }
.tr-bar.is-on .tr-val { fill: var(--text); }
.tr-val.is-none { font-weight: 500; fill: var(--muted2); }
.tr-day { font-size: 12px; font-weight: 500; fill: var(--muted2); }
.tr-bar.is-on .tr-day { fill: var(--text); font-weight: 700; }
.tr-bar:focus-visible { outline: none; }

/* A line's gap in each week: a small bar chart on a shared scale. */
.spark { display: block; flex: none; overflow: visible; }
.spark-zero { stroke: var(--border); stroke-width: 1; }
.spark rect { fill: var(--muted2); opacity: .5; }
.spark rect.is-short { fill: var(--brand); opacity: .45; }
.spark rect.is-over { fill: var(--text); opacity: .35; }
.spark rect.is-on { opacity: 1; }

/* Keeps happening */
.gw-keeps { margin-top: 14px; }
.keeps { list-style: none; margin: 0; padding: 4px 0 8px; }
.keeps a { display: grid; grid-template-columns: minmax(0, 1fr) 112px 120px 150px; align-items: center; gap: 20px; padding: 12px 24px; color: inherit; text-decoration: none; }
@media (hover: hover) { .keeps a:hover { background: var(--wash); } }
.keeps-name, .keeps-sum, .keeps-year { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.keeps-name b { font-size: 15.5px; }
.keeps-name span, .keeps-sum span, .keeps-year span { font-size: 12.5px; color: var(--muted); }
.keeps-sum, .keeps-year { align-items: flex-end; text-align: right; font-variant-numeric: tabular-nums; }
.keeps-sum b, .keeps-year b { font-size: 16px; font-weight: 750; letter-spacing: -0.02em; }
.is-short { color: var(--brand-text); }

/* Line by line */
.gw-lines { margin-top: 14px; overflow: hidden; }
.gw-lines-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 12px !important; }
.gw-legend { display: flex; width: 240px; margin-right: 154px; font-size: 12px; font-weight: 650; color: var(--muted); }
.gw-legend span { flex: 1; }
.gw-legend .lg-over { text-align: left; }
.gw-legend .lg-short { text-align: right; color: var(--brand-text); }
.gl-list { border-top: 1px solid var(--border-soft); }
.gl-sep { margin: 0; padding: 18px 24px 8px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border-soft); }
.gl { border-top: 1px solid var(--border-soft); }
.gl-sep + .gl, .gl-list > .gl:first-child { border-top: 0; }
.gl > summary { display: grid; grid-template-columns: minmax(0, 1fr) 76px 240px 110px 20px; align-items: center; gap: 22px; min-height: 64px; padding: 10px 24px; list-style: none; cursor: pointer; }
.gl > summary::-webkit-details-marker { display: none; }
@media (hover: hover) { .gl > summary:hover { background: var(--wash); } }
.gl[open] > summary { background: var(--wash); }
.gl-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.gl-name b { font-size: 15.5px; font-weight: 650; }
.gl-name span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-hist { grid-column: 2; }
.gl-bar { grid-column: 3; position: relative; height: 12px; border-radius: 6px; background: var(--surface2); }
.gl-bar::before { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1.5px; margin-left: -.75px; background: var(--border-strong); border-radius: 1px; }
.gl-bar i { position: absolute; top: 0; bottom: 0; width: calc(var(--w) / 2); border-radius: 6px; }
.gl-bar.is-short i { left: 50%; background: var(--brand); border-radius: 0 6px 6px 0; transform-origin: 0 50%; }
.gl-bar.is-over i { right: 50%; background: var(--text); border-radius: 6px 0 0 6px; transform-origin: 100% 50%; }
.gl-bar.is-fine i { left: calc(50% - var(--w) / 4); background: var(--muted2); opacity: .5; }
.gl-amt { grid-column: 4; display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.gl-amt b { font-size: 16px; font-weight: 750; letter-spacing: -0.02em; }
.gl-amt b.is-quiet { color: var(--muted); font-weight: 600; }
.gl-amt small { font-size: 12px; font-weight: 600; color: var(--muted); }
.gl-chev { grid-column: 5; width: 18px; height: 18px; fill: none; stroke: var(--muted2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.gl[open] .gl-chev, .gw-fine[open] > summary .gl-chev { transform: rotate(180deg); }

/* A line opened: its sum, what the till sold, the verdict. */
.gl-more { padding: 6px 24px 24px; background: var(--wash); }
.sum-flow { display: flex; align-items: stretch; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.sum-flow li { display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 9px 14px; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--border-soft); }
.sum-flow li span { font-size: 12px; font-weight: 600; color: var(--muted); }
.sum-flow li b { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum-flow .op { padding: 0 2px; background: none; box-shadow: none; font-size: 18px; font-weight: 700; color: var(--muted2); }
.sum-op { display: none; font-style: normal; }
.sum-flow .is-used { background: var(--action); color: var(--on-action); box-shadow: none; }
.sum-flow .is-used span { color: color-mix(in srgb, var(--on-action) 70%, transparent); }
.gl-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.gl-cols > div { padding: 16px 18px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--border-soft); }
.gl-cols h3 { margin: 0 0 10px; font-size: 14.5px; font-weight: 650; text-wrap: pretty; }
.gl-till ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-variant-numeric: tabular-nums; }
.gl-till li { display: flex; justify-content: space-between; gap: 12px; }
.gl-verdict p { margin: 0; font-size: 14px; color: var(--muted); }
.gl-verdict p b { color: var(--text); }
.gl-verdict p b.is-short { color: var(--brand-text); }
.gl-weeks { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); font-size: 13.5px; color: var(--muted); }
.gl-weeks b { color: var(--text); }

.gw-fine { border-top: 1px solid var(--border-soft); }
.gw-fine > summary { display: flex; align-items: center; gap: 10px; padding: 18px 24px; list-style: none; cursor: pointer; }
.gw-fine > summary::-webkit-details-marker { display: none; }
.gw-fine > summary .gl-chev { margin-left: auto; }

/* Opening and closing glide where the browser can animate to auto height. */
@supports (interpolate-size: allow-keywords) {
  .gl, .gw-fine { interpolate-size: allow-keywords; }
  .gl::details-content, .gw-fine::details-content { height: 0; overflow: clip; transition: height .32s cubic-bezier(.2, .8, .2, 1), content-visibility .32s allow-discrete; }
  .gl[open]::details-content, .gw-fine[open]::details-content { height: auto; }
}

/* Bars grow in on arrival: the week's columns up from the line, each line's
   bar out from the middle, a beat apart. */
@media (prefers-reduced-motion: no-preference) {
  .tr-col:not(.is-none) { animation: grow-y .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms + 120ms); }
  .tr-bar { --i: 0; }
  .gl-bar i { animation: grow-x .8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--n, 0) * 35ms + 200ms); }
  .gl-more { animation: rise .35s cubic-bezier(.2, .8, .2, 1) both; }
}
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(-4px); } }

@media (max-width: 900px) {
  .gw-hero { grid-template-columns: 1fr; gap: 20px; }
  .gw-trend { padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--border-soft); }
  .keeps a { grid-template-columns: minmax(0, 1fr) 112px 110px; }
  .keeps-year { display: none !important; }
}
@media (max-width: 760px) {
  .gw-hero { padding: 16px 16px 20px; }
  .gw-flow { grid-template-columns: 1fr 1fr; gap: 12px 0; }
  .gw-flow > div:nth-child(2n) { border-right: 0; margin-right: 0; }
  .gw-legend { display: none; }
  .gl > summary { grid-template-columns: minmax(0, 1fr) auto 18px; grid-template-areas: "name amt chev" "bar bar bar"; gap: 6px 12px; padding: 12px 16px; }
  .gl-name { grid-area: name; }
  .gl-hist { display: none; }
  .gl-bar { grid-area: bar; height: 8px; margin: 2px 0 2px; }
  .gl-amt { grid-area: amt; }
  .gl-chev { grid-area: chev; }
  .gl-more { padding: 6px 16px 18px; }
  .sum-flow { flex-direction: column; gap: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--border-soft); }
  .sum-flow li { flex-direction: row; justify-content: space-between; align-items: baseline; border-radius: 0; box-shadow: none; border-top: 1px solid var(--border-soft); }
  .sum-flow li:first-child { border-top: 0; }
  .sum-flow li span { font-size: 14px; font-weight: 500; }
  .sum-flow .op { display: none; }
  .sum-op { display: inline; font-weight: 700; }
  .gl-cols { grid-template-columns: 1fr; }
  .gl-sep { padding: 16px 16px 6px; }
  .keeps a { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name sum" "spark spark"; gap: 8px 12px; padding: 12px 16px; }
  .keeps-name { grid-area: name; }
  .keeps .spark { grid-area: spark; width: 100%; height: 26px; }
  .keeps-sum { grid-area: sum; }
  .gw-fine > summary { padding: 16px; }
}
/* The word "short" is always there, so the new pieces drop the underline. */
.gw-big.is-short, .keeps .is-short, .gl .is-short, .gw-flow .is-short { text-decoration: none; }
.gl.is-flash > summary { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 30% { background: var(--brand-wash); } }

/* ==========================================================================
   Home, rebuilt (2026-10-27): the week in one big card, four small ones.
   ========================================================================== */
.hm-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 14px; margin-bottom: 14px; }
.hm-week { grid-row: 1 / 3; display: flex; flex-direction: column; padding: 24px 26px; color: inherit; text-decoration: none; overflow: hidden; }
.hm-big { margin-top: 10px; font-size: clamp(40px, 4.6vw, 60px); font-weight: 800; letter-spacing: -0.055em; line-height: .95; font-variant-numeric: tabular-nums; }
.hm-big.is-short { color: var(--brand-text); text-decoration: none; }
.hm-big { white-space: nowrap; }
.hm-big.is-quiet { font-size: 30px; color: var(--muted); }
.hm-say { margin-top: 14px; font-size: 15px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.hm-say b { color: var(--text); font-weight: 650; }
.hm-trend { display: block; margin-top: auto; padding-top: 18px; }
.hm-trend .tr-bar .tr-col { opacity: .3; }
.hm-trend .tr-bar.is-on .tr-col { opacity: 1; }
.hm-go { margin-top: 12px; font-size: 14px; font-weight: 650; }
.hm-week:hover .hm-go span { display: inline-block; transform: translateX(3px); transition: transform .2s; }
@media (hover: hover) { .hm-week:hover, a.hm-tile:hover { box-shadow: 0 0 0 1px var(--border-strong) !important; } }
.hm-tile { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; color: inherit; text-decoration: none; min-width: 0; position: relative; }

/* Order: the total split by supplier, one segment each. */
.hm-sups { display: flex; gap: 3px; height: 8px; margin-top: auto; padding-top: 0; }
.hm-sups span { flex: var(--f) 1 0; min-width: 4px; border-radius: 3px; background: var(--text); opacity: .85; }
.hm-sups span:nth-child(2) { opacity: .55; }
.hm-sups span:nth-child(3) { opacity: .35; }
.hm-sups span:nth-child(n+4) { opacity: .2; }
.hm-sup-names { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.hm-sup-names span { display: flex; align-items: center; gap: 7px; }
.hm-sup-names i { width: 8px; height: 8px; border-radius: 2px; background: var(--text); opacity: .85; }
.hm-sup-names span:nth-child(2) i { opacity: .55; }
.hm-tile .tile-s + .hm-sups { margin-top: 14px; }

/* Stock value at each count: a small filled line. */
.hm-vl { position: relative; display: block; height: 44px; margin-top: 12px; }
.vl { display: block; width: 100%; height: 100%; overflow: visible; }
.vl-area { fill: var(--brand-wash); }
.vl-line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.vl-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--surface); }

/* Profit per drink: a half dial against the target's tick. */
.gp-dial { position: relative; display: block; width: 150px; margin: 6px 0 2px; }
.gp-dial svg { display: block; width: 100%; overflow: visible; }
.gp-dial b { position: absolute; left: 0; right: 0; bottom: -2px; text-align: center; font-size: 26px; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.gp-track, .gp-fill { fill: none; stroke-width: 10; stroke-linecap: round; }
.gp-track { stroke: var(--surface2); }
.gp-fill { stroke: var(--brand); stroke-dasharray: calc(var(--v) * 1px) 100px; }
.gp-target { stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; transform-origin: 60px 62px; }

/* Next count: the week as seven ticks, the days gone filled. */
.hm-days { display: flex; gap: 4px; margin-top: auto; padding-top: 14px; }
.hm-days i { flex: 1; height: 8px; border-radius: 3px; background: var(--surface2); }
.hm-days i.is-gone { background: var(--text); opacity: .7; }

@media (prefers-reduced-motion: no-preference) {
  .gp-fill { animation: gp-in 1.1s cubic-bezier(.2, .8, .2, 1) .15s both; }
  .vl-line { stroke-dasharray: 600; animation: draw 1.4s cubic-bezier(.2, .8, .2, 1) .1s both; }
  .vl-area { animation: fade .8s ease-out .6s both; }
  .vl-dot { animation: pop .4s cubic-bezier(.2, 1.4, .4, 1) 1.1s both; }
}
@keyframes gp-in { from { stroke-dasharray: 0 100px; } }
@keyframes draw { from { stroke-dashoffset: 600; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(0); } }

@media (max-width: 1000px) {
  .hm-grid { grid-template-columns: 1fr 1fr; }
  .hm-week { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 600px) {
  .hm-grid { gap: 10px; }
  .hm-week { grid-template-columns: 1fr; padding: 18px 16px; }
  .hm-big { font-size: 42px; }
  .hm-tile { padding: 14px 16px; }
  .gp-dial { width: 120px; }
  .gp-dial b { font-size: 21px; }
}

/* ==========================================================================
   The count screen, rebuilt (2026-10-27): progress across every area, the
   open one set on a drawing of the bottle, ticks that draw themselves in,
   and a moment when an area is done.
   ========================================================================== */
.ct-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 10px 0 12px; }
.ct-meta .ct-sync { margin: 0; }
.ct-progress { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex: 1 1 220px; }
.ct-progress b { color: var(--text); }
.ct-progress > i { flex: 1; max-width: 220px; height: 6px; border-radius: 3px; background: var(--surface2); overflow: hidden; }
.ct-progress > i > i { display: block; height: 100%; border-radius: 3px; background: var(--brand); transition: width .5s cubic-bezier(.2, .8, .2, 1); }

.ct-total { margin: 4px 0 -2px; font-size: 26px; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.ct-part { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: stretch; }
.ct-part-r { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ct-part .ct-ten-row { grid-template-columns: repeat(5, 1fr); gap: 5px; }
.ct-part .ct-ten-row button { height: 40px; font-size: 15px; border-radius: 10px; }

.ct-vessel { position: relative; display: grid; place-items: center; padding: 10px 0 8px; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--border-soft); cursor: ns-resize; touch-action: none; user-select: none; -webkit-user-select: none; }
.ct-vessel:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ct-vessel svg { display: block; width: 68px; height: auto; overflow: visible; }
.ct-v-glass { fill: var(--surface2); }
.ct-v-edge { fill: none; stroke: var(--border-strong); stroke-width: 1.6; }
.ct-v-liquid { fill: var(--brand); transition: y .18s cubic-bezier(.2, .8, .2, 1); }
.is-dragging .ct-v-liquid { transition-duration: .06s; }
.ct-v-shine { fill: #fff; opacity: .22; }
.ct-v-ticks line { stroke: var(--text); stroke-width: 1.4; opacity: .35; }
.ct-v-read { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.ct-vessel.is-dragging { box-shadow: 0 0 0 2px var(--brand); }

/* A tick that's just been made draws itself in. */
@media (prefers-reduced-motion: no-preference) {
  .ct-row.is-fresh .ct-box { animation: tick-pop .42s cubic-bezier(.2, 1.5, .4, 1); }
  .ct-row.is-fresh .ct-box::after { animation: fade .25s ease-out .08s both; }
  .ct-row.is-fresh .ct-val { animation: rise .3s ease-out both; }
  .ct-edit { animation: rise .25s cubic-bezier(.2, .8, .2, 1) both; }
}
@keyframes tick-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* An area finished */
.ct-done { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; padding: 16px 18px; border-radius: 18px; background: var(--action); color: var(--on-action); }
.ct-done svg { width: 40px; height: 40px; flex: none; }
.ct-done circle { fill: var(--brand); }
.ct-done path { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.ct-done > div { flex: 1 1 160px; display: flex; flex-direction: column; }
.ct-done b { font-size: 17px; }
.ct-done span { font-size: 13.5px; opacity: .72; }
.ct-done .btn-primary { background: var(--on-action); color: var(--action); }
@media (prefers-reduced-motion: no-preference) {
  .ct-done.is-new { animation: done-in .5s cubic-bezier(.2, 1.2, .4, 1) both; }
  .ct-done.is-new circle { animation: tick-pop .5s cubic-bezier(.2, 1.5, .4, 1) .1s both; transform-origin: center; transform-box: fill-box; }
  .ct-done.is-new path { stroke-dasharray: 40; animation: draw-tick .45s ease-out .3s both; }
}
@keyframes done-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes draw-tick { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }

@media (max-width: 420px) {
  .ct-part { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .ct-vessel svg { width: 58px; }
  .ct-step-row button { width: 48px; }
}
html.dark .ct-v-shine { opacity: .07; }
.gw-now .row-actions { margin-top: 18px; }
