/* GearUp web — brand: peach #FFCBBB, maroon #580D21 (light) / #FFA89E (dark). */

@font-face { font-family: "Zoho Puvi"; src: url("../fonts/ZohoPuvi-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Zoho Puvi"; src: url("../fonts/ZohoPuvi-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Zoho Puvi"; src: url("../fonts/ZohoPuvi-Semibold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Zoho Puvi"; src: url("../fonts/ZohoPuvi-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --peach: #FFCBBB;
  --maroon: #580D21;
  --bg: #f4f2f2;
  --card: #ffffff;
  --card-2: #f7f5f5;
  --text: #1d1517;
  --text-2: #78696d;
  --line: rgba(88, 13, 33, 0.12);
  --accent: #580D21;
  --on-accent: #ffffff;
  --peach-soft: rgba(255, 203, 187, 0.45);
  --orange: #b45500; --orange-bg: rgba(180, 85, 0, 0.12);
  --blue: #0a66c2;  --blue-bg: rgba(10, 102, 194, 0.12);
  --red: #c22929;   --red-bg: rgba(194, 41, 41, 0.12);
  --green: #1e7d3c; --green-bg: rgba(30, 125, 60, 0.12);
  --gray: #6b6b6b;  --gray-bg: rgba(107, 107, 107, 0.14);
  --sheet-backdrop: rgba(29, 21, 23, 0.45);
  --radius: 16px;
  --tap: 44px;

  /* Type scale — semantic text-style roles (HIG), in rem so the whole UI
     tracks the user's preferred browser text size (Dynamic Type analogue). */
  --type-large-title: 1.75rem;   /* screen titles */
  --type-title3: 1.1875rem;      /* minor headings, empty-state titles */
  --type-headline: 1.0625rem;    /* emphasized row/card labels */
  --type-body: 1rem;             /* default reading & input text */
  --type-callout: 0.9375rem;     /* buttons, secondary copy */
  --type-subhead: 0.875rem;      /* supporting copy */
  --type-footnote: 0.8125rem;    /* metadata, chips */
  --type-caption: 0.75rem;       /* helper text, lowest emphasis */
}

@media (prefers-color-scheme: dark) {
  :root {
    --peach: #FFCBBB;
    --maroon: #FFA89E;
    --bg: #171112;
    --card: #241b1d;
    --card-2: #2e2326;
    --text: #f5eceb;
    --text-2: #ab9a9d;
    --line: rgba(255, 168, 158, 0.16);
    --accent: #FFA89E;
    --on-accent: #40161f;
    --peach-soft: rgba(255, 168, 158, 0.18);
    --orange: #ffa04d; --orange-bg: rgba(255, 160, 77, 0.16);
    --blue: #6cb2ff;  --blue-bg: rgba(108, 178, 255, 0.16);
    --red: #ff7a7a;   --red-bg: rgba(255, 122, 122, 0.16);
    --green: #63c883; --green-bg: rgba(99, 200, 131, 0.16);
    --gray: #a8a8a8;  --gray-bg: rgba(168, 168, 168, 0.18);
    --sheet-backdrop: rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  font-family: "Zoho Puvi", -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--type-body); line-height: 1.4;
  background: var(--bg); color: var(--text);
  overscroll-behavior-y: none;
}
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Visible keyboard focus everywhere (Full Keyboard Access). */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Motion is functional only — honour Reduce Motion with a quiet equivalent. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .btn:active { transform: none; }
}

.boot-splash { min-height: 100dvh; display: grid; place-items: center; }

/* ---------- layout: bottom tabs on mobile, left rail on desktop ---------- */

.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.shell-main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 12px 16px calc(76px + env(safe-area-inset-bottom)); }

/* Tab navigation: content lifts in on tab change (not on live data refreshes). */
.shell-main.tab-enter { animation: tab-in 0.22s ease; }
@keyframes tab-in { from { opacity: 0; transform: translateY(10px); } }

/* List views flow into as many columns as the width allows. */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 12px; }
.card-grid > .card { margin-bottom: 0; }
.card-grid > .empty { grid-column: 1 / -1; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--peach);
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  display: flex; align-items: center; justify-content: center;
}
.topbar img { height: 26px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 14px; }
.page-head h1 { font-size: var(--type-large-title); font-weight: 700; }
.page-head .actions { display: flex; gap: 8px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tabbar button {
  flex: 1; max-width: 140px;
  background: none; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-2); font-size: var(--type-caption); font-weight: 500;
  padding: 6px 4px; border-radius: 12px; min-height: var(--tap);
  transition: color 0.18s ease, background 0.18s ease;
}
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.active { color: var(--accent); font-weight: 700; }

@media (min-width: 900px) {
  .shell { flex-direction: row; }
  .topbar { display: none; }
  .tabbar {
    position: sticky; top: 0; bottom: auto; height: 100dvh; width: 220px;
    flex-direction: column; justify-content: flex-start; gap: 4px;
    border-top: 0; border-right: 1px solid var(--line);
    padding: 20px 12px;
  }
  .tabbar::before {
    content: ""; display: block; height: 60px; margin: 0 8px 20px;
    background: url("../img/logo-horizontal.png") no-repeat left center / contain;
  }
  @media (prefers-color-scheme: dark) {
    .tabbar::before { background-image: url("../img/logo-horizontal-white.png"); }
  }
  .tabbar button { flex: 0 0 auto; max-width: none; flex-direction: row; gap: 12px; font-size: var(--type-callout); padding: 10px 12px; }
  .tabbar button.active { background: var(--peach-soft); }
  /* Use the full window width; grids and columns absorb it. */
  .shell-main { max-width: none; padding: 20px 32px 40px; }
  /* Settings sections flow into up-to-2 columns when there's room. */
  .settings-columns { columns: 2 380px; column-gap: 16px; }
  .settings-columns .form-section { break-inside: avoid; }
}

/* Pointer devices (iPad trackpad, Mac): hover feedback on interactive things. */
@media (hover: hover) {
  .tabbar button:hover { color: var(--text); background: var(--peach-soft); }
  .btn:hover { background: var(--card-2); }
  .btn.primary:hover, .btn.tinted:hover, .btn.success:hover { filter: brightness(1.08); }
  .card.tappable:hover, .form-row.tappable:hover { background: var(--card-2); }
  .line-item .remove:hover { background: var(--red-bg); }
  .sheet-header .btn-text:hover { opacity: 0.75; }
}

/* ---------- common controls ---------- */

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-weight: 500; font-size: var(--type-callout); cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 600; }
.btn.tinted { background: var(--peach-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.btn.success { background: var(--green); color: #fff; border-color: transparent; font-weight: 600; }
.btn.danger { color: var(--red); }
.btn.small { min-height: 32px; padding: 3px 12px; font-size: var(--type-subhead); }
/* Compact buttons keep a 44pt effective hit target via an invisible extension. */
.btn.small::after { content: ""; position: absolute; inset: -6px -2px; }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.icon { width: var(--tap); padding: 0; }
.btn svg { width: 18px; height: 18px; }

.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: var(--type-footnote); font-weight: 600; white-space: nowrap;
}
.chip.orange { color: var(--orange); background: var(--orange-bg); }
.chip.blue { color: var(--blue); background: var(--blue-bg); }
.chip.red { color: var(--red); background: var(--red-bg); }
.chip.green { color: var(--green); background: var(--green-bg); }
.chip.gray { color: var(--gray); background: var(--gray-bg); }
.chip.peach { color: var(--accent); background: var(--peach-soft); }

.search {
  width: 100%; min-height: var(--tap);
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); padding: 8px 14px; margin-bottom: 12px;
  font-size: var(--type-body);
}
.search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.card {
  background: var(--card); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px;
  border: 1px solid var(--line);
}
.card.tappable { cursor: pointer; }
.card.tappable:active { background: var(--card-2); }

.empty { text-align: center; color: var(--text-2); padding: 56px 20px; }
.empty h3 { font-size: var(--type-title3); font-weight: 600; color: var(--text); margin-bottom: 6px; }

.muted { color: var(--text-2); }
.small { font-size: var(--type-footnote); }
.tiny { font-size: var(--type-caption); }
.semibold { font-weight: 600; }
.headline { font-size: var(--type-headline); font-weight: 600; }
.warn { color: var(--orange); }
.error-text { color: var(--red); font-size: var(--type-subhead); padding: 8px 2px; }

.row { display: flex; align-items: center; gap: 10px; }
.row .grow, .form-row .grow, .line-item .grow { flex: 1; min-width: 0; }
.stack-2 { display: flex; flex-direction: column; gap: 2px; }

/* ---------- forms ---------- */

.form-section { margin-bottom: 18px; }
.form-section > h3 {
  font-size: var(--type-footnote); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-2); margin: 0 4px 6px;
}
.form-section > .hint { font-size: var(--type-caption); color: var(--text-2); margin: 6px 4px 0; }
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.form-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 50px; padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}
.form-row:last-child { border-bottom: 0; }
.form-row:focus-within { background: var(--card-2); }
.form-row > label:first-child { flex-shrink: 0; font-weight: 500; }
.form-row input[type="text"], .form-row input[type="email"], .form-row input[type="tel"],
.form-row input[type="number"], .form-row input[type="password"], .form-row input[type="date"] {
  flex: 1; min-width: 0; border: 0; background: none; text-align: right; font-size: var(--type-body); min-height: 34px;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; }
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--text-2); opacity: 0.7; }
.form-row select {
  flex: 1; min-width: 0; border: 0; background: none; text-align: right; font-size: var(--type-body);
  appearance: none; -webkit-appearance: none; direction: rtl; cursor: pointer; min-height: 34px;
  color: var(--accent); font-weight: 500;
}
.form-row select option { direction: ltr; color: initial; }
.form-row.column { flex-direction: column; align-items: stretch; gap: 4px; padding-top: 10px; padding-bottom: 10px; }
.form-row.column textarea {
  border: 0; background: none; resize: vertical; min-height: 60px; font-size: var(--type-body);
}
.form-row.tappable { cursor: pointer; }
.form-row.tappable:active { background: var(--card-2); }
.form-row .value { margin-left: auto; text-align: right; }
.form-row .accent-label { color: var(--accent); font-weight: 500; }

/* iOS-style switch (44pt effective target via the enlarged invisible input) */
.switch { position: relative; flex-shrink: 0; width: 50px; height: 30px; margin-left: auto; }
.switch input { position: absolute; inset: -8px; width: auto; height: auto; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .knob {
  position: absolute; inset: 0; border-radius: 999px; background: var(--gray-bg);
  border: 1px solid var(--line); transition: background 0.15s;
}
.switch .knob::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: left 0.15s;
}
.switch input:checked + .knob { background: var(--green); }
.switch input:checked + .knob::after { left: 22px; }
.switch input:focus-visible + .knob { outline: 2px solid var(--accent); outline-offset: 2px; }

/* segmented control */
.segmented { display: flex; background: var(--card-2); border-radius: 10px; padding: 3px; margin-left: auto; }
.segmented button {
  position: relative;
  border: 0; background: none; padding: 5px 16px; border-radius: 8px;
  font-size: var(--type-subhead); font-weight: 500; color: var(--text-2); cursor: pointer; min-height: 32px;
}
.segmented button::after { content: ""; position: absolute; inset: -9px 0; }
.segmented button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.12); font-weight: 600; }

/* ---------- sheets (modal editors) ---------- */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: var(--sheet-backdrop);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in 0.18s ease;
}
.sheet {
  background: var(--bg); width: 100%; max-height: 94dvh;
  border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
  animation: slide-up 0.22s ease;
}
.sheet:focus { outline: none; }
.sheet-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: var(--card); border-radius: 18px 18px 0 0;
  position: sticky; top: 0; z-index: 2;
}
.sheet-header h2 { font-size: var(--type-headline); font-weight: 600; text-align: center; flex: 1; }
.sheet-header .btn-text {
  background: none; border: 0; color: var(--accent); font-size: var(--type-body); font-weight: 500;
  cursor: pointer; min-height: var(--tap); padding: 0 4px; min-width: 56px;
}
.sheet-header .btn-text.bold { font-weight: 700; }
.sheet-header .btn-text:disabled { opacity: 0.4; }
.sheet-body { overflow-y: auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }

@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet { max-width: 640px; border-radius: 18px; max-height: 90dvh; }
  .sheet-header { border-radius: 18px 18px 0 0; }
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0.5; } }
@keyframes slide-down { to { transform: translateY(40px); opacity: 0; } }
@keyframes pop-in { from { transform: scale(0.96) translateY(8px); opacity: 0; } }
@keyframes pop-out { to { transform: scale(0.96) translateY(8px); opacity: 0; } }

/* Exit animations — `dismiss()` in ui.js adds .closing and removes on animationend. */
.sheet-backdrop.closing { animation: fade-out 0.18s ease forwards; }
.sheet-backdrop.closing .sheet { animation: slide-down 0.18s ease forwards; }
@media (min-width: 700px) {
  .sheet { animation: pop-in 0.2s ease; }
  .sheet-backdrop.closing .sheet { animation: pop-out 0.15s ease forwards; }
}

/* confirm dialog */
.dialog-backdrop { position: fixed; inset: 0; z-index: 70; background: var(--sheet-backdrop); display: grid; place-items: center; padding: 24px; animation: fade-in 0.15s ease; }
.dialog { background: var(--card); border-radius: 16px; max-width: 340px; width: 100%; padding: 20px; text-align: center; animation: pop-in 0.15s ease; }
.dialog-backdrop.closing { animation: fade-out 0.13s ease forwards; }
.dialog-backdrop.closing .dialog { animation: pop-out 0.13s ease forwards; }
.dialog p { margin-bottom: 16px; }
.dialog .dialog-buttons { display: flex; flex-direction: column; gap: 8px; }

/* anchored menu (popover) — item options that don't warrant an alert */
.menu-backdrop { position: fixed; inset: 0; z-index: 60; }
.menu {
  position: absolute; min-width: 230px; max-width: calc(100vw - 24px);
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22); padding: 5px;
  animation: menu-in 0.14s ease; transform-origin: top right;
}
@keyframes menu-in { from { opacity: 0; transform: scale(0.94); } }
.menu-backdrop.closing .menu, .menu-backdrop.closing .cal { animation: fade-out 0.12s ease forwards; }
.menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  min-height: var(--tap); padding: 8px 12px; border: 0; border-radius: 9px;
  background: none; text-align: left; font-size: var(--type-callout); cursor: pointer;
}
.menu button:hover, .menu button:focus-visible { background: var(--card-2); outline: none; }
.menu .menu-check { width: 1.2em; flex-shrink: 0; color: var(--accent); font-weight: 700; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 90; background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-size: var(--type-subhead); font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25); animation: toast-in 0.22s ease;
  max-width: calc(100vw - 40px);
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(10px); } }
.toast.hide { animation: toast-out 0.22s ease forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateX(-50%) translateY(10px); } }

/* ---------- sign-in ---------- */

.signin {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; gap: 24px;
  background: linear-gradient(180deg, var(--peach-soft), transparent 40%);
}
.signin .logo { width: min(340px, 80vw); }
.signin form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.signin input {
  min-height: 50px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); padding: 10px 16px; font-size: var(--type-body);
}
.signin input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.signin .btn { min-height: 50px; font-size: var(--type-headline); }

/* ---------- booking card specifics ---------- */

.booking-card .dates { color: var(--text-2); font-size: var(--type-subhead); }
.booking-card .items-line { color: var(--text-2); font-size: var(--type-footnote); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.booking-card .foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.booking-card .foot .total { font-weight: 600; font-size: var(--type-body); margin-right: auto; }

.line-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: 0; }
.line-item .remove {
  position: relative;
  border: 0; background: none; color: var(--red); cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 18px;
}
.line-item .remove::after { content: ""; position: absolute; inset: -7px; }

/* prompt dialog input */
.dialog .prompt-input {
  width: 100%; min-height: var(--tap, 44px);
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card-2); padding: 8px 12px;
  margin-bottom: 14px; font-size: 16px;
}
.dialog .prompt-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* wrapper adding a dropdown chevron to a select styled as a button */
.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap > select { appearance: none; -webkit-appearance: none; padding-right: 30px; }
.select-wrap > svg {
  position: absolute; right: 11px; width: 14px; height: 14px;
  color: var(--text-2); pointer-events: none;
}

/* date controls: right-align the native input (its value ignores text-align),
   and the desktop date-button + calendar popover */
.form-row input[type="date"] { flex: 0 0 auto; width: auto; margin-left: auto; }

.date-btn {
  margin-left: auto; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--card-2); color: var(--text);
  padding: 6px 12px; font-size: var(--type-body, 16px); min-height: 34px;
}
.date-btn:hover, .date-btn:focus-visible { background: var(--peach-soft); outline: none; }

.cal {
  position: fixed; z-index: 61; width: 296px; padding: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
  animation: menu-in 0.14s ease; transform-origin: top right;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-head .cal-title { font-weight: 600; }
.cal-head button {
  border: 0; background: none; cursor: pointer; color: var(--accent);
  width: 34px; height: 34px; border-radius: 8px; font-size: 20px; line-height: 1;
}
.cal-head button:hover, .cal-head button:focus-visible { background: var(--card-2); outline: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-grid .cal-dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-2); padding: 4px 0; }
.cal-grid button {
  border: 0; background: none; cursor: pointer; color: var(--text);
  aspect-ratio: 1; border-radius: 50%; font-size: 14px; font-weight: 500;
}
.cal-grid button:hover:not(:disabled), .cal-grid button:focus-visible { background: var(--card-2); outline: none; }
.cal-grid button.selected { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.cal-grid button.today:not(.selected) { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-grid button:disabled { opacity: 0.3; cursor: default; }

/* ---------- analytics ---------- */

.an-range { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.an-range button {
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  border-radius: 999px; padding: 6px 14px; font-size: var(--type-subhead); font-weight: 500;
  cursor: pointer; min-height: 34px;
}
.an-range button.active { background: var(--peach-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.an-range button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.stat-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px;
}
.stat-value { font-size: 1.7rem; font-weight: 600; line-height: 1.2; }

.an-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 860px) { .an-grid { grid-template-columns: 1fr 1fr; } }
.an-card { padding: 14px; }

/* column chart: thin accent columns, 4px rounded caps square at the baseline,
   solid hairline gridlines, per-column tooltip on hover/focus */
.chart-wrap { position: relative; }
.chart-plot { position: relative; height: 150px; margin: 18px 0 4px; }
.chart-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.chart-grid:last-of-type { border-top-color: var(--text-2); opacity: 0.55; }
.chart-tick {
  position: absolute; left: 0; top: -0.6em; font-size: 10px; color: var(--text-2);
  background: var(--card); padding-right: 4px; font-variant-numeric: tabular-nums;
}
.chart-cols { position: absolute; inset: 0 0 0 34px; display: flex; align-items: flex-end; gap: 2px; }
.chart-col {
  flex: 1; min-width: 0; height: 100%; position: relative;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  cursor: default; border-radius: 4px 4px 0 0;
}
.chart-col:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chart-fill { width: 100%; max-width: 22px; background: var(--accent); border-radius: 4px 4px 0 0; }
.chart-col.hover .chart-fill { opacity: 0.75; }
.chart-peak { font-size: 10px; font-weight: 600; color: var(--text-2); margin-bottom: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-x { display: flex; gap: 2px; margin-left: 34px; }
.chart-x span {
  flex: 1; min-width: 0; text-align: center; font-size: 10px; color: var(--text-2);
  white-space: nowrap; /* labeled columns may spill into their unlabeled neighbours */
}
.chart-tip {
  display: none; position: absolute; top: -6px; z-index: 5;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 10px; font-size: var(--type-caption); color: var(--text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); pointer-events: none; white-space: nowrap;
}

/* horizontal bar list: label column, thin bar with rounded data-end, visible value */
.an-bar-row {
  display: grid; grid-template-columns: minmax(110px, 36%) 1fr auto;
  gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line);
}
.an-bar-row:last-child { border-bottom: 0; }
.an-bar-info { min-width: 0; }
.an-bar-info > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-bar-track { min-width: 0; }
.an-bar-fill { height: 12px; background: var(--accent); border-radius: 0 4px 4px 0; }
.an-bar-value { font-variant-numeric: tabular-nums; color: var(--text-2); }

.an-table-toggle { margin: 8px 0 18px; }
.an-table-card { margin-bottom: 18px; }
.an-table { width: 100%; border-collapse: collapse; font-size: var(--type-subhead); }
.an-table th, .an-table td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.an-table tr:last-child td { border-bottom: 0; }
.an-table th { font-weight: 600; color: var(--text-2); font-size: var(--type-footnote); }
.an-table .num { text-align: right; font-variant-numeric: tabular-nums; }
