/* viinakello version: viinakello-2026-11-19-8 */
/* Viinakello: one screen, iOS-native feel. Ring on top, the selected day's bar and
   the 2 x 2 tiles in the thumb zone, the selected day's list below. */
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --sheet: #f2f2f7;
  --sheet-card: #ffffff;
  --text: #111114;
  --muted: #6e6e73;
  --sep: rgba(60, 60, 67, 0.16);
  --track: rgba(120, 120, 128, 0.16);
  --green: #34c759;
  --amber: #ff9f0a;
  --red: #ff3b30;
  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, 0.12);   /* selected bar column, past-day "Adding to" bar */
  --bar-idle: rgba(10, 132, 255, 0.42);      /* bars that are not selected */
  --amber-idle: rgba(255, 159, 10, 0.5);     /* heavy bars that are not selected */
  --night: #5e5ce6;                          /* moon mark of a night still counting */
  --add: #30b14f;                            /* swipe-right "One more" */
  --beer: linear-gradient(155deg, #ffb340 0%, #f08c00 100%);
  --beer-large: linear-gradient(155deg, #f09a1a 0%, #c46a00 100%);
  --wine: linear-gradient(155deg, #c0365e 0%, #7d1636 100%);
  --spirit: linear-gradient(155deg, #6f8296 0%, #3f4e5e 100%);
  --wine-dark: linear-gradient(155deg, #9a2448 0%, #5a0e26 100%);     /* the second wine tile */
  --spirit-dark: linear-gradient(155deg, #55657a 0%, #2a3541 100%);   /* the second spirit tile */
  --radius: 26px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --sheet: #1c1c1e;
    --sheet-card: #2c2c2e;
    --text: #f5f5f7;
    --muted: #98989f;
    --sep: rgba(84, 84, 88, 0.6);
    --track: rgba(120, 120, 128, 0.3);
    --green: #30d158;
    --amber: #ff9f0a;
    --red: #ff453a;
    --accent: #0a84ff;
    --accent-soft: rgba(10, 132, 255, 0.22);
    --bar-idle: rgba(10, 132, 255, 0.62);
    --amber-idle: rgba(255, 159, 10, 0.62);
    --night: #7d7aff;
    --add: #30d158;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 16px/1.35 var(--font);
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
svg { display: block; }

.app {
  max-width: 520px; margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 4px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 96px) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 8px;
}
/* everything a horizontal swipe may change the selected day on */
.dayzone { display: flex; flex-direction: column; gap: 8px; touch-action: pan-y; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.top h1 { font: 700 21px/1 var(--rounded); letter-spacing: -0.01em; margin: 0; }
.icon-btn { width: 44px; height: 44px; margin-right: -10px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.icon-btn:active { background: var(--track); }

/* browser-tab note (never in the Home Screen app) */
.install-note {
  display: flex; align-items: center; gap: 8px; padding: 8px 6px 8px 14px; border-radius: 12px;
  background: var(--card); color: var(--muted); font-size: 13px; line-height: 1.35;
}
.install-note span { flex: 1; }
.install-note button { flex: none; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--muted); }
.install-note button:active { background: var(--track); }
.install-note .note-btn { width: auto; height: 32px; padding: 0 12px; border-radius: 16px; font-size: 14px;
  font-weight: 600; color: #fff; background: var(--accent); }
.install-note .note-btn:active { background: var(--accent); opacity: 0.8; }
.paste-area { width: 100%; min-height: 140px; border: 0; border-radius: 14px; padding: 12px;
  background: var(--sheet-card); color: var(--text); font: 13px/1.4 ui-monospace, Menlo, monospace;
  -webkit-user-select: text; user-select: text; resize: vertical; }

/* ring */
.gauge { position: relative; width: min(46vw, 184px, 22dvh); aspect-ratio: 1; margin: 0 auto; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 13; }
.ring-track { stroke: var(--track); }
.ring-fill { stroke: var(--green); stroke-linecap: round; transition: stroke-dashoffset 0.6s cubic-bezier(.2,.8,.2,1), stroke 0.3s; }
.gauge[data-level="amber"] .ring-fill { stroke: var(--amber); }
.gauge[data-level="red"] .ring-fill { stroke: var(--red); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.total { font: 700 clamp(38px, 12vw, 54px)/1 var(--rounded); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.of { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.next { margin: -2px 0 0; text-align: center; font-size: 14px; color: var(--muted); min-height: 19px; }
.next b { color: var(--text); font-weight: 600; }
.next.link { cursor: pointer; }
.next.link::after { content: " \203a"; opacity: 0.6; }

/* 7-day strip: the value rides on top of its bar, fixed rows keep the labels in line,
   and one capsule behind the selected column slides from bar to bar */
.week {
  --bars-h: 58px;
  position: relative;
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  background: var(--card); border-radius: 18px; padding: 8px 6px 6px;
}
.week .cap { position: absolute; left: 0; top: 0; border-radius: 12px; background: var(--accent-soft); pointer-events: none; }
.week .cap.ready { transition: transform 0.2s cubic-bezier(.2,.8,.2,1), width 0.2s; }
.day {
  position: relative;
  display: grid; grid-template-rows: var(--bars-h) 18px; justify-items: center;
  min-width: 0; border-radius: 12px; padding: 4px 0 2px; min-height: 44px;
}
.day .bar-wrap { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.day .val { font: 600 12px/1 var(--rounded); font-variant-numeric: tabular-nums; color: var(--muted); }
.day .bar {
  width: 16px; border-radius: 8px; background: var(--bar-idle);
  height: calc((var(--bars-h) - 15px) * var(--h, 0)); min-height: 6px;
  transition: height 0.4s cubic-bezier(.2,.8,.2,1);
}
.day.heavy .bar { background: var(--amber-idle); }
.day.dry .bar { width: 6px; height: 6px; min-height: 6px; background: transparent; border: 1.5px solid var(--muted); border-radius: 50%; opacity: 0.55; }
.day .name { font-size: 12px; line-height: 18px; color: var(--muted); display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.day.current .name { color: var(--text); font-weight: 700; }
.day.selected .bar { background: var(--accent); }
.day.selected.heavy .bar { background: var(--amber); }
.day.selected.dry .bar { background: transparent; border-color: var(--accent); opacity: 1; }
.day.selected .val { color: var(--text); font-weight: 700; }
.day.selected .name { color: var(--accent); font-weight: 700; }
.moon { width: 11px; height: 11px; fill: var(--night); flex: none; }

/* the "Adding to" bar directly above the tiles */
.adding {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 36px; padding: 0 4px 0 14px; border-radius: 12px; font-size: 15px;
  transition: background-color 0.2s;
}
.adding .to { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.adding .to b { color: var(--text); font-weight: 700; }
.adding .aside { font-size: 13px; color: var(--muted); padding-right: 10px; white-space: nowrap; }
.adding.past { background: var(--accent-soft); }
.adding.past .to { color: var(--accent); }
.adding.past .to b { color: var(--accent); }
.adding .back {
  min-height: 30px; padding: 0 12px; border-radius: 15px; background: var(--accent); color: #fff;
  font: 600 14px/30px var(--font); white-space: nowrap; display: inline-flex; align-items: center; gap: 3px;
}
.adding .back .moon { fill: #fff; width: 12px; height: 12px; margin: 0; }
.adding .moon { display: inline-block; width: 13px; height: 13px; margin-right: 5px; vertical-align: -1px; }
.adding .to.drag { opacity: 0.6; }
.adding .to.spring { transition: transform 0.2s ease, opacity 0.2s ease; }
.adding .to.from-left { animation: slide-from-left 0.18s ease-out; }
.adding .to.from-right { animation: slide-from-right 0.18s ease-out; }
@keyframes slide-from-left { from { transform: translateX(-28px); opacity: 0; } }
@keyframes slide-from-right { from { transform: translateX(28px); opacity: 0; } }

/* tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile-wrap { position: relative; display: grid; }
.tile-more {
  position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border-radius: 22px;
  display: grid; place-items: center; color: #fff; touch-action: manipulation; z-index: 2;
}
.tile-more span {
  width: 30px; height: 30px; border-radius: 15px; background: rgba(255,255,255,0.22);
  display: grid; place-items: center; font: 700 18px/1 var(--rounded); letter-spacing: 1px;
}
.tile-more:active span { background: rgba(255,255,255,0.4); }
.tile {
  position: relative; overflow: hidden;
  min-height: clamp(130px, 19.5dvh, 200px);
  border-radius: var(--radius); color: #fff; text-align: left;
  padding: 14px 16px 14px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  transition: transform 0.25s cubic-bezier(.3,1.6,.5,1);
  touch-action: pan-y;
}
.tile[data-kind="beer"] { background: var(--beer); }
.tile[data-kind="beer-large"] { background: var(--beer-large); }
.tile[data-kind="wine"] { background: var(--wine); }
.tile[data-kind="spirit"] { background: var(--spirit); }
.tile[data-kind="wine-dark"] { background: var(--wine-dark); }
.tile[data-kind="spirit-dark"] { background: var(--spirit-dark); }
.tile .icon { display: block; height: 36px; }
.tile.pressed { transform: scale(0.95); transition-duration: 0.08s; }
.tile.pop { animation: pop 0.45s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { 0% { transform: scale(0.94); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
.tile svg.glass { width: 36px; height: 36px; fill: none; stroke: rgba(255,255,255,0.95); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile .label { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; }
.tile .name { font: 700 22px/1.05 var(--rounded); }
.tile .size { font: 600 15px/1.2 var(--rounded); opacity: 0.9; }
.tile .units { font: 600 12px/1 var(--font); opacity: 0.8; margin-top: 3px; }
.tile .count {
  position: absolute; top: 12px; right: 52px; min-width: 32px; height: 32px; padding: 0 10px;
  border-radius: 16px; background: rgba(255,255,255,0.28); display: grid; place-items: center;
  font: 700 16px/1 var(--rounded); font-variant-numeric: tabular-nums;
}
.tile .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.tile.pop .flash { animation: flash 0.45s ease-out; }
@keyframes flash { 0% { opacity: 0.35; } 100% { opacity: 0; } }

/* the selected day's list */
.daylist { background: var(--card); border-radius: 18px; padding: 12px 0 4px; overflow: hidden; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 16px 2px; }
.section-head h2 { margin: 0; font: 700 17px/1.2 var(--rounded); display: flex; align-items: center; gap: 6px; }
.section-head h2 .moon { width: 14px; height: 14px; }
.section-head span { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.section-note { margin: 0 16px 6px; font-size: 13px; color: var(--muted); }
.list { list-style: none; margin: 6px 0 0; padding: 0; }
.empty { margin: 6px 16px 10px; color: var(--muted); font-size: 15px; }
.row { position: relative; overflow: hidden; }
.row + .row .row-main { border-top: 0.5px solid var(--sep); }
/* two action layers under each row; only the one for the drag direction shows */
.row-act {
  position: absolute; inset: 0; display: flex; align-items: center; gap: 8px;
  color: #fff; font-weight: 600; font-size: 15px; visibility: hidden;
}
.row-act.show { visibility: visible; }
.row-act svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.row-act.armed svg { transform: scale(1.15); }
.row-act.add { background: var(--add); justify-content: flex-start; padding-left: 20px; }
.row-act.del { background: var(--red); justify-content: flex-end; padding-right: 20px; }
.row-main {
  position: relative; background: var(--card); display: flex; align-items: center; gap: 12px;
  padding: 0 16px; min-height: 50px; touch-action: pan-y; width: 100%; text-align: left;
}
.row-main.anim { transition: transform 0.25s ease; }
.row-main.swiping { box-shadow: 0 0 0 0.5px var(--sep), 0 2px 10px rgba(0,0,0,0.12); }
.row.fresh .row-main { animation: fresh 0.3s ease-out; }
@keyframes fresh { from { background: var(--accent-soft); } }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot[data-kind="beer"] { background: var(--beer); }
.dot[data-kind="beer-large"] { background: var(--beer-large); }
.dot[data-kind="wine"] { background: var(--wine); }
.dot[data-kind="spirit"] { background: var(--spirit); }
.row-text { flex: 1; min-width: 0; font-weight: 600; }
.row-amt { color: var(--muted); font-variant-numeric: tabular-nums; }
.row-chev { color: var(--muted); opacity: 0.5; font-size: 18px; }
.list-hint { margin: 2px 16px 8px; font-size: 12px; color: var(--muted); }
.storage-note { text-align: center; color: var(--red); font-size: 13px; }

/* toast */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top, 0px) + 48px); /* under the header, away from tiles and list */
  width: min(92vw, 420px);
  background: rgba(30, 30, 32, 0.94); color: #fff; border-radius: 16px;
  padding: 10px 10px 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3); z-index: 60; /* above sheets (50), so messages show while a sheet is open */
  pointer-events: none; /* only the Undo button takes taps, the screen under it stays usable */
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  animation: toast-in 0.3s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes toast-in { from { transform: translate(-50%, -16px); opacity: 0; } }
.toast span { font-size: 15px; }
.toast button { pointer-events: auto; color: #ffd60a; font-weight: 700; padding: 8px 12px; border-radius: 10px; }
.toast button:active { background: rgba(255,255,255,0.12); }

/* bottom sheet */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 40; animation: fade 0.25s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  max-width: 560px; margin: 0 auto; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--sheet); border-radius: 22px 22px 0 0;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 22px) max(16px, env(safe-area-inset-left, 0px));
  animation: sheet-in 0.35s cubic-bezier(.2,.9,.3,1);
  -webkit-user-select: none; user-select: none;
}
@keyframes sheet-in { from { transform: translateY(100%); } }
.grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--track); margin: 0 auto 6px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.sheet-head h2 { margin: 0; font: 700 20px/1.2 var(--rounded); display: flex; align-items: center; gap: 8px; }
.sheet-head .dot { width: 14px; height: 14px; }
.sheet-sub { margin: -4px 0 0; font-size: 14px; color: var(--muted); }
.text-btn { color: var(--accent); font-weight: 600; padding: 10px 4px; }
.sheet-body { display: grid; gap: 12px; padding-top: 10px; }
.group { background: var(--sheet-card); border-radius: 14px; overflow: hidden; }
.group-title { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 4px 4px -6px; }
.cell { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; min-height: 50px; width: 100%; text-align: left; }
.cell + .cell { border-top: 0.5px solid var(--sep); }
button.cell:active { background: var(--track); }
.cell .sub { color: var(--muted); font-size: 14px; }
.cell.danger { color: var(--red); justify-content: center; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 40px; height: 34px; border-radius: 9px; background: var(--track); font: 600 20px/1 var(--font); }
.stepper output { min-width: 46px; text-align: center; font: 600 17px/1 var(--rounded); font-variant-numeric: tabular-nums; }
.note { color: var(--muted); font-size: 13px; margin: 0 4px; line-height: 1.45; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* edit sheet: drink switch, 2 x 2 mini tiles in the same places as the big ones */
.swap { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.swap button {
  position: relative; min-height: 54px; border-radius: 14px; color: #fff; text-align: left;
  padding: 0 14px; font: 700 16px/1.1 var(--rounded); display: flex; align-items: center; gap: 6px;
}
.swap button small { font: 600 14px/1 var(--rounded); opacity: 0.85; }
.swap [data-kind="beer"] { background: var(--beer); }
.swap [data-kind="beer-large"] { background: var(--beer-large); }
.swap [data-kind="wine"] { background: var(--wine); }
.swap [data-kind="spirit"] { background: var(--spirit); }
.swap [data-kind="wine-dark"] { background: var(--wine-dark); }
.swap [data-kind="spirit-dark"] { background: var(--spirit-dark); }
.swap button.current { box-shadow: 0 0 0 3px var(--sheet), 0 0 0 5px var(--accent); }
.swap .check { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.swap .check svg { width: 14px; height: 14px; fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* edit sheet: day strip, same order as the bars (oldest left) */
.daystrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: var(--sheet-card); border-radius: 14px; padding: 6px; }
.daystrip button { min-height: 52px; border-radius: 10px; display: grid; place-content: center; justify-items: center; gap: 2px; }
.daystrip button:active { background: var(--track); }
.daystrip .w { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.daystrip .d { font: 700 17px/1 var(--rounded); font-variant-numeric: tabular-nums; }
.daystrip .current .w { color: var(--text); font-weight: 700; }
.daystrip .on { background: var(--accent); color: #fff; }
.daystrip .on .w { color: rgba(255,255,255,0.85); }
.daystrip .on .moon { fill: #fff; }

/* settings: segmented control for "Day changes at" */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; margin: 8px; border-radius: 10px; background: var(--track); }
.seg button { min-height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; font-weight: 500; }
.seg button.on { background: var(--sheet-card); font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,0.12); }
@media (prefers-color-scheme: dark) { .seg button.on { background: #636366; } }
.footer { text-align: center; color: var(--muted); font-size: 12px; margin: 4px 0 0; }

@media (max-height: 700px) {
  .app, .dayzone { gap: 6px; }
  .week { --bars-h: 50px; padding: 6px 6px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.sheet .row-main { background: var(--sheet-card); }

/* delete all: the warning, above the settings sheet, in the half away from the button */
.confirm-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 70; animation: fade 0.2s; }
.confirm {
  position: fixed; left: 0; right: 0; z-index: 71; max-width: 420px; margin: 0 auto;
  width: calc(100% - 32px); background: var(--sheet-card); border-radius: 18px;
  padding: 18px 16px 12px; display: grid; gap: 10px; box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  animation: fade 0.2s;
}
.confirm.at-top { top: calc(env(safe-area-inset-top, 0px) + 16px); }
.confirm.at-bottom { bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); }
.confirm h2 { margin: 0; font: 700 19px/1.2 var(--rounded); text-align: center; }
.confirm p { margin: 0; font-size: 15px; line-height: 1.4; color: var(--muted); text-align: center; }
.confirm-btn { min-height: 50px; border-radius: 12px; background: var(--track); font-size: 17px; font-weight: 600; color: var(--accent); }
.confirm-btn.danger { background: var(--red); color: #fff; }
.confirm-btn:active { opacity: 0.8; }
.framed { margin: 40px 16px; text-align: center; font-size: 17px; }

/* a sheet just opened, the screen just under a closed sheet, the red button just shown: taps reach nothing */
.settling { pointer-events: none; }

/* settings: a row that opens another sheet */
.cell.chev { justify-content: flex-start; }
.cell.chev .sub { margin-left: auto; }
.cell.chev::after { content: "›"; color: var(--muted); opacity: 0.6; font-size: 20px; }

/* longer view: one bar per week, the limit dashed */
.longer { padding: 10px 6px 4px; }
.longer-chart { display: block; width: 100%; height: auto; }
.longer-chart rect { fill: var(--bar-idle); }
.longer-chart .current rect { fill: var(--accent); }
.longer-chart .over rect { fill: var(--amber-idle); }
.longer-chart .current.over rect { fill: var(--amber); }
.longer-chart text { font: 600 8.5px var(--font); fill: var(--muted); text-anchor: middle; }
.longer-chart .current text { fill: var(--text); }
.longer-chart .limit { stroke: var(--red); stroke-width: 1; stroke-dasharray: 4 3; opacity: 0.8; }
.longer-chart .limit-label { text-anchor: start; fill: var(--red); font-weight: 500; }
.longer-facts { padding: 0 16px; }
.fact { margin: 0; padding: 11px 0; font-size: 15px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 4px; }
.fact + .fact { border-top: 0.5px solid var(--sep); }
.fact .arrow { font-weight: 700; }
.fact.less .arrow, .fact.less b { color: var(--green); }
.fact.more .arrow, .fact.more b { color: var(--amber); }
.fact.short { color: var(--muted); }

/* tile editor */
.size-seg button { white-space: nowrap; }
.tile-preview { margin: 0 4px; font: 600 16px/1.3 var(--rounded); text-align: center; }
.cell.tile-row > span:first-child { font-variant-numeric: tabular-nums; }
.cell.reset-tiles { color: var(--accent); }

/* the first open: one calm card, closed with one tap */
.privacy-card { background: var(--card); border-radius: 18px; padding: 14px 16px 12px; display: grid; gap: 8px; }
.privacy-card h2 { margin: 0; font: 700 17px/1.25 var(--rounded); }
.privacy-card p { margin: 0; font-size: 14px; line-height: 1.4; color: var(--muted); }
.privacy-card .note-btn { justify-self: end; height: 34px; padding: 0 16px; border-radius: 17px; font-size: 15px; font-weight: 600;
  background: var(--accent); color: #fff; }
.privacy-card .note-btn:active { opacity: 0.8; }
.privacy-note { margin-bottom: 4px; }
