/* ONSITE components: "Bold and modern". Colours, type and sizes come from tokens.css only.
   No inline styles anywhere: the Content-Security-Policy blocks them. */
@import url('/assets/css/tokens.css');

/* ---------- Base */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  /* WCAG 2.4.11: keep keyboard focus clear of the sticky clock bar and bottom nav */
  scroll-padding-bottom: calc(var(--nav-h) + var(--tap-big) + 40px);
  scroll-padding-top: 72px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-body);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 800; line-height: 1.15; margin: 0 0 var(--gap-sm); letter-spacing: -0.015em; }
h1 { font-size: 30px; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 var(--gap-sm); }
a { color: var(--brand-text); font-weight: 500; text-underline-offset: 3px; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Icons: Lucide sprite */
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.i-lg { width: 30px; height: 30px; }
.i-xl { width: 64px; height: 64px; stroke-width: 2; }

/* ---------- Buttons (56px minimum) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 0 22px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: 600 16px/1 var(--font-head); letter-spacing: 0.005em; text-decoration: none; cursor: pointer;
  touch-action: manipulation;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 120ms var(--ease);
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { background: var(--clock-out); color: var(--clock-out-ink); border-color: var(--clock-out); font-weight: 700; }
.btn-danger:hover { background: var(--clock-out); filter: brightness(0.93); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 15px; }
.icon-btn { min-width: var(--tap); padding: 0; }

/* The clock button: huge, full width, sticky at the bottom of the staff app */
.clock-bar {
  position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 5;
  padding: 12px var(--gap); background: var(--bg); border-top: 1px solid var(--line);
}
.btn-clock {
  width: 100%; min-height: var(--tap-big); border: 0; border-radius: var(--radius);
  font: 800 24px/1 var(--font-head); letter-spacing: 0; gap: 12px;
}
.btn-clock .i { width: 28px; height: 28px; stroke-width: 2.5; }
.btn-clock.in { background: var(--clock-in); color: var(--clock-in-ink); }
.btn-clock.in:hover { background: var(--lime-hover); }
.btn-clock.out { background: var(--clock-out); color: var(--clock-out-ink); }
.btn-clock.out:hover { background: var(--clock-out); filter: brightness(0.93); }

/* ---------- Forms */
label, .label { display: block; font-weight: 500; font-size: 15px; margin: 0 0 6px; }
.field { margin-bottom: var(--gap); }
.hint { font-size: 14px; color: var(--text-2); margin-top: 4px; }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: 400 16px/1.3 var(--font-body);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--text-2); opacity: 0.8; }
textarea { min-height: 110px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 24px; height: 24px; min-height: 0; accent-color: var(--brand); }
input[type="range"] { padding: 0; border: 0; accent-color: var(--brand); }
.check { display: flex; align-items: center; gap: 12px; min-height: var(--tap); font-weight: 500; cursor: pointer; }
.row { display: flex; gap: var(--gap-sm); align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: var(--gap-sm); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.row > input, .row > select, .toolbar > input, .toolbar > select { width: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.stack > * + * { margin-top: var(--gap); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 44px; min-width: 52px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text); font: 600 15px/1 var(--font-head); cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* ---------- Cards and lists */
.card { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--gap); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: var(--gap); }
.card-hero { padding: var(--gap-lg) 20px; }
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: var(--shadow-sm); }
.list > li { padding: 14px var(--gap); border-top: 1px solid var(--line); min-height: var(--tap); display: flex; align-items: center; gap: 12px; }
.list > li:first-child { border-top: 0; }
.list > li > .i { color: var(--text-2); }
.list .grow { flex: 1; min-width: 0; }
.list button.grow { text-align: left; background: none; border: 0; color: inherit; font: inherit; padding: 0; cursor: pointer; min-height: 44px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--radius-pill); font: 600 13px/1.2 var(--font-head); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge-warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge-bad { background: var(--bad-bg); color: var(--bad-ink); }
.badge-plain { background: var(--surface-2); color: var(--text-2); }
.badge .i { width: 15px; height: 15px; }

.big-time { font: 800 clamp(30px, 8.5vw, 44px)/1.05 var(--font-head); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--gap); box-shadow: var(--shadow-sm); }
.kpi .n { font: 800 34px/1 var(--font-head); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--text-2); font-size: 14px; margin-top: 6px; }

/* ---------- States */
.state { text-align: center; padding: 48px var(--gap); color: var(--text-2); }
.state .i-xl { color: var(--brand-text); margin-bottom: 14px; }
.state h2, .state h3 { color: var(--text); }
.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px var(--gap); border-radius: var(--radius-sm); }
.notice-warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice-bad { background: var(--bad-bg); color: var(--bad-ink); }
.notice-ok { background: var(--ok-bg); color: var(--ok-ink); }
.notice p:last-child { margin: 0; }
.form-error { margin-bottom: var(--gap); }

/* Locked / upgrade card: calm, factual */
.locked { border: 1px dashed var(--line-strong); box-shadow: none; }
.locked .i-lg { color: var(--brand-text); }

/* ---------- Demo banner */
.demo-banner {
  position: sticky; top: 0; z-index: 20; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 8px var(--gap); background: var(--brand-soft); color: var(--brand-soft-ink); border-bottom: 1px solid var(--line);
  font-weight: 500; font-size: 15px; text-align: center;
}
.demo-banner select { width: auto; min-height: 40px; padding: 4px 10px; font-size: 15px; }
.demo-banner .btn { min-height: 40px; }

/* ---------- Layout: sign-in pages (indigo, the first thing a buyer sees) */
.auth { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--gap-lg) var(--gap); background: var(--ink); color: var(--ink-text); }
.auth .card { width: 100%; max-width: 440px; padding: 28px var(--gap-lg); box-shadow: var(--shadow-lg); border-color: transparent; }
.auth .narrow > .card { max-width: none; }
.auth .narrow > h1 { font-size: 34px; }
.auth .narrow > p, .auth .narrow > p.muted { color: var(--ink-text-2); }
.auth .narrow > p.muted { margin-bottom: var(--gap-lg); }
.auth .card .row .btn { flex: 1 1 150px; }
.auth p + .btn { margin-top: var(--gap-sm); }
.auth .narrow > p a { color: var(--lime); }
.brand-mark { display: flex; align-items: center; gap: 10px; font: 800 24px/1 var(--font-head); letter-spacing: 0.02em; margin-bottom: var(--gap-lg); }
.brand-mark .dot { width: 36px; height: 36px; border-radius: 10px; background: var(--lime); display: grid; place-items: center; color: var(--lime-ink); }

/* ---------- Layout: staff app (phone first) */
.staff { max-width: 620px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px var(--gap); min-height: 64px; background: var(--ink); color: var(--ink-text); }
.topbar .title { font: 700 18px/1.2 var(--font-head); }
.topbar .muted { color: var(--ink-text-2); }
.topbar .btn-ghost { color: var(--ink-text); }
.topbar .btn-ghost:hover { background: var(--ink-hover); }
.content { flex: 1; padding: var(--gap); }
.bottom-nav {
  position: sticky; bottom: 0; z-index: 6; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: var(--nav-h); border-top: 3px solid transparent; color: var(--text-2); text-decoration: none; font: 600 12px/1 var(--font-head); }
.bottom-nav a[aria-current="page"] { color: var(--brand-text); border-top-color: var(--brand-text); }

/* ---------- Layout: admin (desktop first, bottom nav on phones) */
.admin { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: var(--ink); color: var(--ink-text); padding: 20px var(--gap); display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.sidebar .brand-mark { margin-bottom: 6px; }
.sidebar .muted { color: var(--ink-text-2); }
.sidebar a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--ink-text-2); text-decoration: none; font: 600 15px/1 var(--font-head); transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.sidebar a:hover { background: var(--ink-hover); color: var(--ink-text); }
.sidebar a[aria-current="page"] { background: var(--lime); color: var(--lime-ink); }
.sidebar .lock { margin-left: auto; width: 16px; height: 16px; }
.sidebar .spacer { flex: 1; min-height: var(--gap); }
.main { padding: 28px var(--gap-lg); max-width: var(--page-max); width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--gap); flex-wrap: wrap; margin-bottom: var(--gap-lg); }
.page-head h1 { margin: 0; }
.toolbar { display: flex; gap: var(--gap-sm); flex-wrap: wrap; align-items: center; }
.toolbar select, .toolbar input { width: auto; min-width: 150px; }

/* ---------- Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg); }
th { font: 600 13px/1.2 var(--font-head); color: var(--text-2); background: var(--surface-2); position: sticky; top: 0; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); cursor: zoom-in; background: var(--surface-2); }

/* ---------- Roster week */
.week-scroll { overflow-x: auto; padding-bottom: 4px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(128px, 1fr)); gap: 10px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 180px; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-sm); }
.day-head { padding: 10px 12px; gap: 6px; border-bottom: 1px solid var(--line); font: 600 14px/1.2 var(--font-head); display: flex; justify-content: space-between; }
.day-head.today { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.day-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.shift-chip { text-align: left; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-left: 3px solid var(--brand-text); border-radius: 4px var(--radius-sm) var(--radius-sm) 4px; background: var(--brand-soft); color: var(--brand-soft-ink); font: 400 13px/1.35 var(--font-body); cursor: pointer; transition: filter 150ms var(--ease); }
.shift-chip:hover { filter: brightness(0.97); }
.shift-chip strong { display: block; font: 700 14px/1.2 var(--font-head); }
.shift-chip .muted { color: inherit; opacity: 0.85; }
.shift-chip.draft { background: transparent; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--text); }
.shift-chip.cancelled { opacity: 0.5; text-decoration: line-through; }

/* ---------- Dialogs */
dialog { border: 0; border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: var(--scrim); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 12px var(--gap) 12px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dlg-head h2 { margin: 0; font-size: 20px; }
.dlg-body { padding: 20px; }
.dlg-foot { display: flex; gap: var(--gap-sm); justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); flex-wrap: wrap; }

/* ---------- Camera and result overlays (full screen, one-handed) */
.overlay { position: fixed; inset: 0; z-index: 50; background: var(--overlay); color: var(--overlay-text); display: flex; flex-direction: column; }
.overlay video { flex: 1; width: 100%; object-fit: cover; transform: scaleX(-1); background: var(--overlay); min-height: 0; }
.overlay .count { position: absolute; inset: 0; display: grid; place-items: center; font: 800 160px/1 var(--font-head); color: var(--lime); text-shadow: 0 2px 16px var(--overlay); pointer-events: none; }
.overlay .bar { padding: var(--gap); display: grid; gap: var(--gap-sm); background: var(--overlay); padding-bottom: calc(var(--gap) + env(safe-area-inset-bottom)); }
.overlay .msg { padding: var(--gap); text-align: center; font: 600 18px/1.3 var(--font-head); }
/* No camera on screen (finding location, sending, camera blocked): centre the message */
.overlay:not(:has(video)) .msg { margin-top: auto; }
.overlay:not(:has(video)) .msg:only-child { margin-bottom: auto; }
.overlay:not(:has(video)) .bar { margin-bottom: auto; }
.result { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--gap); padding: var(--gap-lg); text-align: center; }
.result.ok { background: var(--clock-in); color: var(--clock-in-ink); }
.result.bad { background: var(--clock-out); color: var(--clock-out-ink); }
.result h2 { font-size: 34px; font-weight: 800; color: inherit; text-wrap: balance; }
.result p { font-size: 19px; font-weight: 500; max-width: 30ch; }
.result .btn { min-width: 220px; background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.result .btn + .btn { background: transparent; color: inherit; border-color: currentColor; }

.lightbox { position: fixed; inset: 0; z-index: 70; background: var(--scrim); display: grid; place-items: center; padding: var(--gap); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg); }

/* ---------- Chat */
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg-bubble { max-width: 85%; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius) var(--radius) var(--radius) 4px; background: var(--surface); }
.msg-bubble.mine { margin-left: auto; border-radius: var(--radius) var(--radius) 4px var(--radius); border-color: transparent; background: var(--brand-soft); color: var(--brand-soft-ink); }
.msg-bubble .who { font: 600 13px/1.2 var(--font-head); color: var(--text-2); margin-bottom: 4px; }
.msg-bubble.mine .who { color: inherit; opacity: 0.85; }
.composer { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 10px 0; background: var(--bg); }

/* ---------- Toast */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 96px); z-index: 80; display: grid; gap: 8px; width: min(480px, calc(100vw - 24px)); }
.toast { padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--ink); color: var(--ink-text); font-weight: 500; box-shadow: var(--shadow-lg); }

/* ---------- First-run setup guide */
.setup h2 { margin-bottom: 2px; }
.setup-steps { list-style: none; margin: var(--gap) 0 0; padding: 0; }
.setup-steps li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.setup-steps .grow { flex: 1; min-width: 0; }
.step-mark { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); font: 700 15px/1 var(--font-head); }
.setup-steps .done .step-mark { background: var(--lime); color: var(--lime-ink); }
.setup-steps .done strong { color: var(--text-2); }
.setup-link { display: flex; align-items: center; gap: 12px; margin-top: 4px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.setup-link .grow { flex: 1; min-width: 0; }

/* ---------- On-site tools and checklists */
.tile-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-sm); margin-top: var(--gap); }
.tile-pair .btn { flex-direction: column; gap: 6px; min-height: 84px; padding: 10px; line-height: 1.2; text-align: center; }
progress { display: block; width: 100%; height: 10px; margin: 8px 0 var(--gap); accent-color: var(--brand); }
.area-head { margin: var(--gap) 0 6px; font-size: 15px; color: var(--text-2); }
.tick { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0; font-weight: 400; cursor: pointer; }
.tick input { flex: none; }
.list > li.task-row { padding-top: 6px; padding-bottom: 6px; gap: 6px; }
.couldnt { flex: none; min-height: 44px; padding: 0 8px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.list > li.priority { background: var(--warn-bg); color: var(--warn-ink); }
.list > li.priority > .i { color: inherit; }
.priority .muted, .priority .couldnt { color: inherit; }
.notice-link { text-decoration: none; font-weight: 400; align-items: center; }
.notice-link .grow { flex: 1; min-width: 0; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.line-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 5fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }

.list > li.wrap { flex-wrap: wrap; }
.list > li.wrap .grow { flex-basis: 220px; }

/* ---------- Utilities */
.mt { margin-top: var(--gap); }
.mt-sm { margin-top: 6px; }
.mt-lg { margin-top: var(--gap-lg); }
.mb { margin-bottom: var(--gap); }
.center { text-align: center; }
.narrow { width: 100%; max-width: 560px; }
.w-auto { width: auto; }
.nowrap { white-space: nowrap; }

/* ---------- Phones */
@media (max-width: 860px) {
  .admin { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main { padding: var(--gap); padding-bottom: calc(var(--nav-h) + var(--gap)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week { grid-template-columns: minmax(0, 1fr); }
  .day { min-height: 0; }
  .admin-bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; }
  .desktop-only { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (min-width: 861px) {
  .admin-bottom-nav { display: none !important; }
}
@media (max-width: 600px) {
  .line-row { grid-template-columns: minmax(0, 1fr) auto; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .line-row .line-area { grid-column: 1; grid-row: 1; }
  .line-row .line-label { grid-column: 1 / -1; grid-row: 2; }
  .demo-banner { padding: 6px 12px; gap: 8px; font-size: 14px; }
  .demo-banner .long { display: none; }
}
/* Tables turn into stacked cards on phones */
@media (max-width: 700px) {
  .table-stack { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .table-stack table, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-stack tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
  .table-stack tbody tr:hover { background: var(--surface); }
  .table-stack td { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 36px; padding: 6px 0; border: 0; text-align: right; white-space: normal; }
  .table-stack td::before { content: attr(data-label); color: var(--text-2); font-size: 14px; text-align: left; flex: 1 1 auto; }
  .table-stack td[data-label=""]::before { content: none; }
  .table-stack td[data-label=""] { justify-content: flex-end; flex-wrap: wrap; }
  .toolbar > input, .row > input[type="date"] { flex: 1 1 130px; min-width: 0; }
  .row > .chips { flex: 1 1 100%; }
  .kpi .n { font-size: 26px; }
}

@media (max-width: 440px) {
  .demo-banner { flex-wrap: nowrap; }
  .demo-banner .mid { display: none; }
  .demo-banner select { min-width: 0; flex: 1; }
  .demo-banner .btn { padding: 0 12px; font-size: 14px; white-space: nowrap; }
}
@media (max-width: 380px) {
  h1 { font-size: 26px; }
  .btn-clock { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
