/* Chronia – Design-System. Brand-Tokens (--brand, --accent, --font-sans, --radius …) kommen aus /brand.css. */

:root {
  color-scheme: light;
  --canvas: #F5F6FA;
  --surface: #FFFFFF;
  --surface-2: #F0F2F7;
  --glass: rgba(255, 255, 255, 0.72);
  --ink: #151926;
  --muted: #5D6476;
  --faint: #646A7B;
  --line: #E2E5EE;
  --line-strong: #CDD2DE;
  --work: #0E9F6E;
  --work-soft: #E3F6EE;
  --work-text: #0A7A54;
  --pause: #C27C0E;
  --pause-soft: #FBF1DE;
  --pause-text: #8A5807;
  --danger: #D14343;
  --danger-soft: #FCE9E9;
  --danger-text: #A92F2F;
  --info-soft: #E8EEFB;
  --shadow-1: 0 1px 2px rgba(21, 25, 38, 0.06), 0 1px 1px rgba(21, 25, 38, 0.04);
  --shadow-2: 0 1px 2px rgba(21, 25, 38, 0.05), 0 6px 16px -4px rgba(21, 25, 38, 0.08), 0 18px 40px -16px rgba(21, 25, 38, 0.12);
  --shadow-3: 0 2px 4px rgba(21, 25, 38, 0.05), 0 12px 28px -8px rgba(21, 25, 38, 0.14), 0 32px 64px -24px rgba(21, 25, 38, 0.18);
  --focus: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand-ring, rgba(91, 91, 214, .4));
  --ease: cubic-bezier(.2, .8, .2, 1);
  --nav-h: 72px;
  /* fallbacks if brand.css fails */
  --brand: #5B5BD6; --brand-strong: #4A4AB0; --brand-soft: #E7E7F9; --brand-softer: #F2F2FC; --brand-text: #4B4BC4;
  --on-brand: #FFFFFF; --accent: #12B5A6; --on-accent: #0B0D14;
  --brand-gradient: linear-gradient(135deg, #5B5BD6, #12B5A6);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px; --radius-sm: 8px; --radius-lg: 21px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #0E1016; --surface: #151821; --surface-2: #1C202B; --glass: rgba(21, 24, 33, 0.72);
    --ink: #ECEEF4; --muted: #A3A9B8; --faint: #868C9C; --line: #262B37; --line-strong: #353B4A;
    --work: #2BC48A; --work-soft: rgba(43, 196, 138, .14); --work-text: #5BD9A6;
    --pause: #F0A73A; --pause-soft: rgba(240, 167, 58, .14); --pause-text: #F5BE6B;
    --danger: #F06A6A; --danger-soft: rgba(240, 106, 106, .14); --danger-text: #F59494;
    --info-soft: rgba(120, 150, 240, .12);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-3: 0 2px 4px rgba(0, 0, 0, .35), 0 20px 50px -16px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0E1016; --surface: #151821; --surface-2: #1C202B; --glass: rgba(21, 24, 33, 0.72);
  --ink: #ECEEF4; --muted: #A3A9B8; --faint: #868C9C; --line: #262B37; --line-strong: #353B4A;
  --work: #2BC48A; --work-soft: rgba(43, 196, 138, .14); --work-text: #5BD9A6;
  --pause: #F0A73A; --pause-soft: rgba(240, 167, 58, .14); --pause-text: #F5BE6B;
  --danger: #F06A6A; --danger-soft: rgba(240, 106, 106, .14); --danger-text: #F59494;
  --info-soft: rgba(120, 150, 240, .12);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-3: 0 2px 4px rgba(0, 0, 0, .35), 0 20px 50px -16px rgba(0, 0, 0, .7);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--canvas); color: var(--ink);
  font: 400 1rem/1.55 var(--font-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background-image: radial-gradient(1200px 500px at 85% -10%, var(--bg-tint, transparent), transparent 60%);
  background-attachment: fixed;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.015em; font-weight: 680; }
h1 { font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.1rem); letter-spacing: -0.025em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.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; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--surface); padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-2); }
.skip-link:focus { top: 12px; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px; min-height: 60px;
  background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .topbar, .tabbar { background: var(--surface); } }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; min-width: 0; }
.brand img { height: 30px; width: auto; max-width: 160px; object-fit: contain; }
.brand .logo-dark { display: none; }
:root[data-theme="dark"] .brand .logo-dark.has { display: block; }
:root[data-theme="dark"] .brand .logo-light.has-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand .logo-dark.has { display: block; }
  :root:not([data-theme="light"]) .brand .logo-light.has-dark { display: none; }
}
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-gradient); color: var(--on-brand); display: grid; place-items: center; box-shadow: var(--shadow-1); }
.brand-mark .icon { width: 18px; height: 18px; }
.topbar .spacer { flex: 1; }
.topbar-user { color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }

.main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 20px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); }
.main.wide { max-width: 1240px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }

/* bottom tab bar (mobile) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px max(8px, env(safe-area-inset-bottom)); background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 560; border-radius: 12px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.tabbar a .icon { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--brand-text); background: var(--brand-softer); }

/* admin sidebar (tablet/desktop) */
.with-sidebar { display: flex; flex: 1; }
.sidebar { display: none; }
@media (min-width: 960px) {
  .tabbar.admin-tabs { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 2px; width: 248px; flex: none; padding: 20px 12px; position: sticky; top: 60px;
    height: calc(100dvh - 60px); overflow-y: auto; border-right: 1px solid var(--line);
  }
  .sidebar .group { margin: 16px 10px 6px; color: var(--faint); font-size: .8rem; font-weight: 600; }
  .sidebar a {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--muted);
    text-decoration: none; font-weight: 540; font-size: .95rem;
  }
  .sidebar a:hover { background: var(--surface-2); color: var(--ink); }
  .sidebar a[aria-current="page"] { background: var(--brand-softer); color: var(--brand-text); }
  .sidebar .badge { margin-left: auto; }
  .with-sidebar .main { padding-bottom: 48px; }
}

.footer { text-align: center; color: var(--faint); font-size: .82rem; padding: 0 16px calc(var(--nav-h) + 24px); }
.footer a { color: var(--muted); }
.footer nav { display: flex; gap: 16px; justify-content: center; margin-top: 4px; }
@media (min-width: 960px) { .with-sidebar ~ .footer { padding-bottom: 24px; } }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1); padding: 20px;
}
.card + .card, .stack > * + * { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 720px) and (max-width: 1099px) { .grid-4 { grid-template-columns: 1fr 1fr; } }

.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: .86rem; }
.stat .value { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .value.pos { color: var(--work-text); }
.stat .value.neg { color: var(--danger-text); }

/* ---------- buttons ---------- */
.btn {
  --b-bg: var(--surface); --b-fg: var(--ink); --b-bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: var(--radius); border: 1px solid var(--b-bd); background: var(--b-bg); color: var(--b-fg);
  font: 600 .98rem/1 var(--font-sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-1); transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { --b-bg: var(--brand); --b-fg: var(--on-brand); --b-bd: transparent; background: var(--brand-gradient); box-shadow: var(--brand-glow, var(--shadow-2)); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-danger { --b-bg: var(--danger-soft); --b-fg: var(--danger-text); --b-bd: transparent; box-shadow: none; }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; color: var(--ink); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: .9rem; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-text); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.inline-form { display: inline; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-weight: 600; font-size: .92rem; }
.field .hint { color: var(--muted); font-size: .85rem; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: 400 1rem/1.4 var(--font-sans);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input.code { font-size: 1.5rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 8px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.check span small { display: block; color: var(--muted); }
.form-row { display: grid; gap: 0 16px; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } .form-row.three { grid-template-columns: repeat(3, 1fr); } }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 600; margin-bottom: 8px; }
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border-radius: calc(var(--radius) + 2px); border: 1px solid var(--line); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 560; cursor: pointer; }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.segmented input:focus-visible + span { box-shadow: var(--focus); }
input[type="color"].input { padding: 4px; height: 48px; width: 72px; }

/* ---------- alerts & badges ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--info-soft); margin-bottom: 16px; }
.alert .icon { margin-top: 2px; }
.alert p:last-child { margin-bottom: 0; }
.alert-success { background: var(--work-soft); color: var(--work-text); }
.alert-error { background: var(--danger-soft); color: var(--danger-text); }
.alert-warning { background: var(--pause-soft); color: var(--pause-text); }
.alert-success a, .alert-error a, .alert-warning a { color: inherit; }
.toast-stack { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 72px); width: min(92vw, 520px); display: grid; gap: 8px; }
.toast-stack .alert { box-shadow: var(--shadow-3); margin: 0; animation: toast-in .35s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.work { background: var(--work-soft); color: var(--work-text); }
.badge.pause { background: var(--pause-soft); color: var(--pause-text); }
.badge.danger { background: var(--danger-soft); color: var(--danger-text); }
.badge.brand { background: var(--brand-soft); color: var(--brand-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.badge.work .dot { box-shadow: 0 0 0 0 currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); }
table.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .82rem; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table .row-muted td { color: var(--faint); }
.table .row-cancelled td { color: var(--faint); text-decoration: line-through; }
.table tfoot td { font-weight: 700; background: var(--surface-2); }

/* ---------- auth pages ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 28px 24px; box-shadow: var(--shadow-3); }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 22px; text-align: center; }
.auth-brand img { height: 52px; width: auto; max-width: 220px; object-fit: contain; }
.auth-brand .brand-mark { width: 52px; height: 52px; border-radius: 16px; box-shadow: var(--brand-glow); }
.auth-brand .brand-mark .icon { width: 28px; height: 28px; }
.auth-brand .name { font-size: 1.1rem; font-weight: 700; }
.auth h1 { font-size: 1.45rem; text-align: center; }
.auth .lead { text-align: center; color: var(--muted); }
.auth-links { text-align: center; margin-top: 18px; font-size: .92rem; }

/* ---------- stamp (hero) ---------- */
.stamp { display: grid; justify-items: center; gap: 18px; padding: 8px 0 4px; }
.stamp-status { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); min-height: 28px; }
.stamp-dial { position: relative; width: min(78vw, 300px); aspect-ratio: 1; display: grid; place-items: center; }
.stamp-dial svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--line); }
.ring .progress { stroke: var(--brand); transition: stroke-dashoffset .8s var(--ease), stroke .3s; }
.stamp[data-state="working"] .ring .progress { stroke: var(--work); }
.stamp[data-state="break"] .ring .progress { stroke: var(--pause); }
.ring .over { stroke: var(--accent); }
.stamp-btn {
  position: relative; width: 74%; aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; align-content: center; gap: 6px; color: var(--on-brand);
  background: var(--brand-gradient); box-shadow: var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -10px 30px rgba(0, 0, 0, .12);
  font: 700 1.25rem/1.15 var(--font-sans); letter-spacing: -0.01em; -webkit-tap-highlight-color: transparent;
  transition: transform .18s var(--ease), box-shadow .3s var(--ease), filter .2s;
}
.stamp-btn::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 30% 22%, rgba(255, 255, 255, .35), transparent 45%); pointer-events: none; }
.stamp-btn .icon { width: 42px; height: 42px; }
.stamp-btn:active { transform: scale(.965); }
.stamp-btn:focus-visible { box-shadow: var(--focus), var(--brand-glow); }
.stamp[data-state="working"] .stamp-btn, .stamp[data-state="break"] .stamp-btn {
  background: linear-gradient(140deg, #D43F4F 0%, #B83250 100%); color: #FFFFFF;
  box-shadow: 0 18px 50px -12px rgba(214, 69, 69, .55), 0 6px 18px -6px rgba(214, 69, 69, .4), inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -10px 30px rgba(0, 0, 0, .12);
}
.stamp[data-state="off"] .stamp-btn {
  background: linear-gradient(140deg, #0B8457 0%, #08775F 100%); color: #FFFFFF;
  box-shadow: 0 18px 50px -12px rgba(14, 159, 110, .55), 0 6px 18px -6px rgba(14, 159, 110, .4), inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -10px 30px rgba(0, 0, 0, .1);
}
.stamp-btn[aria-busy="true"] { filter: saturate(.6) brightness(.95); pointer-events: none; }
.stamp-btn[aria-busy="true"] .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stamp-clock { font-size: clamp(2.6rem, 2rem + 4vw, 3.4rem); font-weight: 720; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.stamp-sub { color: var(--muted); font-variant-numeric: tabular-nums; margin-top: -8px; }
.stamp-secondary { width: 100%; max-width: 340px; }
.stamp-secondary .btn { width: 100%; min-height: 56px; border-radius: 999px; font-size: 1.02rem; }
.stamp-secondary .btn.pause-btn { --b-bg: var(--pause-soft); --b-fg: var(--pause-text); --b-bd: transparent; box-shadow: none; }
.stamp-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin-bottom: 32px; }
.stamp-facts .fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; box-shadow: var(--shadow-1); }
.stamp-facts .fact .v { display: block; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stamp-facts .fact .l { display: block; color: var(--muted); font-size: .76rem; }
.stamp-msg { min-height: 24px; text-align: center; font-weight: 600; }
.stamp-msg.ok { color: var(--work-text); }
.stamp-msg.err { color: var(--danger-text); }
.stamp-geo { color: var(--faint); font-size: .82rem; text-align: center; max-width: 340px; display: flex; gap: 6px; justify-content: center; }
.stamp-geo .icon { width: 1em; height: 1em; margin-top: 3px; }
.stamp.flash .stamp-dial { animation: pop .5s var(--ease); }
@keyframes pop { 40% { transform: scale(1.03); } }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 108px; }
.timeline .what { flex: 1; color: var(--muted); }

/* ---------- calendar ---------- */
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav .title { font-weight: 700; min-width: 150px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .wd { text-align: center; color: var(--faint); font-size: .78rem; font-weight: 600; padding-bottom: 2px; }
.cal .day {
  position: relative; min-height: 64px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  padding: 6px; display: flex; flex-direction: column; gap: 2px; font-size: .78rem; color: inherit; text-decoration: none;
}
.cal .day .d { font-weight: 650; font-size: .86rem; }
.cal .day .h { font-variant-numeric: tabular-nums; color: var(--muted); }
.cal .day.out { visibility: hidden; }
.cal .day.weekend { background: var(--surface-2); }
.cal .day.holiday { background: var(--brand-softer); }
.cal .day.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal .day .tag { font-size: .68rem; font-weight: 600; border-radius: 6px; padding: 1px 5px; align-self: flex-start; background: var(--surface-2); color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .day .tag.vacation { background: var(--brand-soft); color: var(--brand-text); }
.cal .day .tag.sick { background: var(--danger-soft); color: var(--danger-text); }
.cal .day .tag.warn { background: var(--pause-soft); color: var(--pause-text); }
.cal .day.has-work::after { content: ""; position: absolute; right: 7px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--work); }
@media (min-width: 720px) { .cal .day { min-height: 84px; padding: 8px; } }

/* ---------- misc ---------- */
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain > li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.list-plain > li:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 560; }
.qr-box { background: #FFFFFF; padding: 12px; border-radius: var(--radius); width: 220px; max-width: 100%; margin: 0 auto 16px; box-shadow: var(--shadow-2); }
.qr-box svg { width: 100%; height: auto; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font: 600 1rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 16px; background: var(--surface-2); border-radius: var(--radius); }
.secret { font: 600 1rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; background: var(--surface-2); padding: 8px 12px; border-radius: var(--radius-sm); }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; margin: 0 auto 8px; color: var(--faint); }
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 16px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.toolbar .field { margin: 0; min-width: 150px; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 6px; border: 1px solid var(--line); vertical-align: middle; }
.diff { font-size: .85rem; }
.diff del { color: var(--danger-text); }
.diff ins { color: var(--work-text); text-decoration: none; }
.offline-banner { position: fixed; z-index: 70; left: 0; right: 0; top: 0; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: var(--ink); color: var(--canvas); text-align: center; font-weight: 600; font-size: .9rem; }
.error-page { text-align: center; padding: 48px 16px; }
.error-page .code { font-size: 4rem; font-weight: 800; letter-spacing: -0.05em; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .tabbar, .sidebar, .footer, .btn, .no-print { display: none !important; }
  body { background: #FFFFFF; color: #000000; }
  .card, .table-wrap { box-shadow: none; border-color: #CCCCCC; }
  .main { padding: 0; max-width: none; }
}

/* admin navigation on small screens */
.admin-mobile-nav { margin-bottom: 16px; }
.admin-mobile-nav summary { list-style: none; }
.admin-mobile-nav summary::-webkit-details-marker { display: none; }
.admin-mobile-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.admin-mobile-links a { padding: 8px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .9rem; }
@media (min-width: 960px) { .admin-mobile-nav { display: none; } }
.auth .footer { padding: 16px 0 0; }
.tabbar.tabs-5 { grid-template-columns: repeat(5, 1fr); }

/* installer */
.install-card { max-width: 560px; }
.install-steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; justify-content: center; }
.install-steps li { font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.install-steps li[aria-current="step"] { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; font-weight: 650; }
details.field summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.warn-line { color: var(--pause-text); display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; }
.warn-line .icon { width: 1em; height: 1em; margin-top: 3px; }

/* kiosk display */
.kiosk { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
.kiosk .brand img { height: 48px; }
.kiosk-qr { width: min(60vmin, 420px); }
.kiosk-code { font-size: clamp(3rem, 2rem + 6vmin, 6rem); font-weight: 800; letter-spacing: .08em; }
input[type="range"] { width: 100%; accent-color: var(--brand); min-height: 44px; }
.vac-grid .stat { padding: 0; }
.neg-text { color: var(--danger-text); }

/* live overview */
.live-counts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 720px) { .live-counts { grid-template-columns: repeat(5, 1fr); } }
.live-count { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-1); color: var(--muted); font-size: .86rem; }
.live-count .n { font-size: 2rem; font-weight: 750; letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.live-count.work .n { color: var(--work-text); }
.live-count.pause .n { color: var(--pause-text); }
.live-count.sick .n { color: var(--danger-text); }
.live-count.vac .n { color: var(--brand-text); }
.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
@media (min-width: 1100px) { .people { grid-template-columns: 1fr 1fr; } }
.person a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-1); transition: box-shadow .2s var(--ease); }
.person a:hover { box-shadow: var(--shadow-2); }
.person .avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--muted); flex: none; }
.person.working .avatar { background: var(--work-soft); color: var(--work-text); box-shadow: 0 0 0 2px var(--work); }
.person.break .avatar { background: var(--pause-soft); color: var(--pause-text); box-shadow: 0 0 0 2px var(--pause); }
.person .who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.person .state { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.todo .list-plain li { padding: 10px 0; }
.card-legend { font-weight: 700; font-size: 1.05rem; padding: 0; margin-bottom: 12px; float: left; width: 100%; }
fieldset.card > .card-legend + * { clear: both; }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.weekday-picker label { position: relative; }
.weekday-picker input { position: absolute; opacity: 0; inset: 0; }
.weekday-picker span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-strong); font-weight: 600; color: var(--muted); cursor: pointer; background: var(--surface); }
.weekday-picker input:checked + span { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.weekday-picker input:focus-visible + span { box-shadow: var(--focus); }
.section-gap { margin-top: 16px; }
.center { text-align: center; }
.invite-card { max-width: 520px; }
.table.audit td { font-size: .86rem; }
.table.audit .diff { max-width: 420px; word-break: break-word; }
code { font: .85em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

/* branding page */
.branding-layout { display: grid; gap: 20px; }
@media (min-width: 1100px) { .branding-layout { grid-template-columns: 1fr 340px; align-items: start; } .branding-preview { position: sticky; top: 80px; } }
.color-field { display: flex; align-items: center; gap: 10px; }
.logo-current { padding: 12px; border-radius: var(--radius); border: 1px dashed var(--line-strong); margin-bottom: 6px; }
.logo-current.dark { background: #151821; }
.logo-current.light { background: #FFFFFF; }
.logo-current img { max-height: 48px; width: auto; }
.phone { border-radius: 34px; border: 10px solid var(--ink); background: var(--canvas); overflow: hidden; box-shadow: var(--shadow-3); font-family: var(--font-sans); max-width: 320px; margin: 0 auto; }
.phone-bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--glass); border-bottom: 1px solid var(--line); }
.phone-body { display: grid; justify-items: center; gap: 14px; padding: 22px 16px 26px; }
.pv-dial { width: 170px; height: 170px; border-radius: 50%; display: grid; place-items: center; border: 4px solid var(--line); }
.pv-btn { width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; align-content: center; gap: 4px; color: var(--on-brand); background: var(--brand-gradient); box-shadow: var(--brand-glow); font-weight: 700; }
.pv-btn .icon { width: 28px; height: 28px; }
.pv-clock { font-size: 2.2rem; font-weight: 720; letter-spacing: -0.04em; }
.offline-mark { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px; }
.offline-mark .icon { width: 28px; height: 28px; }
