/* ============================================================
   CheckIn — design system
   Tokens → primitives → components → layout → utilities
   ============================================================ */

/* ---------------------------------------------------- tokens ---------- */
:root {
  /* brand (overridden per organisation) — _base default */
  --accent: #9d174d;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);
  --accent-line: color-mix(in oklab, var(--accent) 32%, transparent);

  /* neutrals — light (shared _base palette) */
  --bg: #faf7f5;
  --surface: #ffffff;
  --surface-2: #f5f1ee;
  --raised: #ffffff;
  --line: #e7e2de;
  --line-soft: #f0ece9;
  --ink: #1c1917;
  --ink-2: #44403c;
  --ink-3: #78716c;

  /* semantic */
  --ok: #166534;
  --ok-soft: #dcfce7;
  --warn: #92400e;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --info: #1e40af;
  --info-soft: #dbeafe;

  /* shape */
  --r-xs: 8px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --r-full: 999px;

  /* elevation */
  --sh-1: 0 1px 2px rgba(28, 25, 23, .05), 0 1px 3px rgba(28, 25, 23, .05);
  --sh-2: 0 4px 16px rgba(28, 25, 23, .08);
  --sh-3: 0 12px 32px rgba(28, 25, 23, .16);
  --ring: 0 0 0 3px var(--accent-soft);

  /* type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --step--1: clamp(.78rem, .76rem + .1vw, .82rem);
  --step-0: clamp(.9rem, .87rem + .14vw, .95rem);
  --step-1: clamp(1.05rem, 1rem + .25vw, 1.15rem);
  --step-2: clamp(1.3rem, 1.2rem + .5vw, 1.55rem);
  --step-3: clamp(1.6rem, 1.4rem + 1vw, 2.1rem);

  --nav-h: 60px;
  --tab-h: 64px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

[data-theme="dark"] {
  --bg: #17130f;
  --surface: #1f1b17;
  --surface-2: #26211c;
  --raised: #2a241f;
  --line: #453d35;
  --line-soft: #2a241f;
  --ink: #f5f1ee;
  --ink-2: #ddd6cf;
  --ink-3: #b3aaa1;
  --ok-soft: #14301d;
  --warn-soft: #2f2410;
  --bad-soft: #2f1616;
  --info-soft: #141f36;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 4px 16px rgba(0, 0, 0, .45);
  --sh-3: 0 16px 40px rgba(0, 0, 0, .55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17130f;
    --surface: #1f1b17;
    --surface-2: #26211c;
    --raised: #2a241f;
    --line: #453d35;
    --line-soft: #2a241f;
    --ink: #f5f1ee;
    --ink-2: #ddd6cf;
    --ink-3: #b3aaa1;
    --ok-soft: #14301d;
    --warn-soft: #2f2410;
    --bad-soft: #2f1616;
    --info-soft: #141f36;
    --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
    --sh-2: 0 4px 16px rgba(0, 0, 0, .45);
    --sh-3: 0 16px 40px rgba(0, 0, 0, .55);
  }
}

/* ------------------------------------------------- primitives --------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html { overflow-x: clip; }

body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.018em; line-height: 1.22; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 .8em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
small { font-size: var(--step--1); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }

.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: -9999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--r-sm);
}
.skip-link:focus { left: 8px; }

/* icons — a single size rule so no icon can ever render full-page */
svg.ico, svg.ic { width: 18px; height: 18px; flex: none; }
.card-head > svg.ico { width: 19px; height: 19px; color: var(--ink-3); }
.empty > svg.ic { width: 44px; height: 44px; }
.bottom-nav svg.ico { width: 21px; height: 21px; }
.btn > svg.ico { width: 17px; height: 17px; }
.toast > svg.ic { width: 20px; height: 20px; }
.notice > svg.ic { width: 19px; height: 19px; margin-top: 1px; }
.role-pick .avatar svg.ico { width: 18px; height: 18px; }

/* --------------------------------------------------- layout ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 680; letter-spacing: -.02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), color-mix(in oklab, var(--accent) 55%, #000));
  color: #fff; font-size: 14px; font-weight: 800;
  box-shadow: 0 2px 8px color-mix(in oklab, var(--accent) 40%, transparent);
}
.brand .sub { font-size: var(--step--1); font-weight: 500; color: var(--ink-3); }

.spacer { flex: 1; }

.main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 20px 16px calc(var(--tab-h) + 28px); }
@media (min-width: 900px) { .main { padding-bottom: 40px; } }

.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .eyebrow { font-size: var(--step--1); font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 2px; }
.page-head h1 { font-size: var(--step-2); }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: 1fr; }
.grid.cols-3 { grid-template-columns: 1fr; }
.grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) {
  .grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
  .grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ----------------------------------------------------- card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
}
.card-pad { padding: 18px; }
@media (min-width: 640px) { .card-pad { padding: 22px; } }

.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line-soft);
}
.card-head h3 { font-size: var(--step-0); font-weight: 640; }
.card-head .hint { font-size: var(--step--1); color: var(--ink-3); }

/* ---------------------------------------------------- button --------- */
.btn {
  --btn-bg: var(--surface);
  --btn-ink: var(--ink);
  --btn-line: var(--line);
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px;
  font: inherit; font-size: var(--step-0); font-weight: 570; letter-spacing: -.005em;
  color: var(--btn-ink); background: var(--btn-bg);
  border: 1px solid var(--btn-line); border-radius: var(--r-sm);
  cursor: pointer; text-decoration: none;
  transition: transform .1s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease);
}
.btn:hover { text-decoration: none; background: color-mix(in oklab, var(--btn-bg) 94%, var(--ink)); }
.btn:active { transform: translateY(1px) scale(.995); }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  --btn-bg: var(--accent); --btn-ink: var(--accent-ink); --btn-line: transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 4px 14px color-mix(in oklab, var(--accent) 26%, transparent);
}
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 88%, #000); }
.btn-ghost { --btn-bg: transparent; --btn-line: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-soft); }
.btn-danger { --btn-bg: var(--bad-soft); --btn-ink: var(--bad); --btn-line: color-mix(in oklab, var(--bad) 24%, transparent); }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: var(--step--1); border-radius: var(--r-xs); }
.btn-block { width: 100%; }
.btn .ico { width: 17px; height: 17px; flex: none; }

.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* copy button */
.copy-wrap { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.copy-val {
  font-family: var(--mono); font-size: var(--step--1);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-xs);
  padding: 4px 8px; overflow-wrap: anywhere;
}
.btn-copy { min-height: 30px; padding: 0 9px; font-size: 12px; border-radius: var(--r-xs); }
.btn-copy.copied { --btn-bg: var(--ok-soft); --btn-ink: var(--ok); --btn-line: color-mix(in oklab, var(--ok) 26%, transparent); }

/* ----------------------------------------------------- form ---------- */
.field { display: block; margin-bottom: 14px; }
.field > .label { display: block; font-size: var(--step--1); font-weight: 580; color: var(--ink-2); margin-bottom: 6px; }
.field .help { display: block; font-size: var(--step--1); color: var(--ink-3); margin-top: 5px; }

.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  font: inherit; font-size: var(--step-0); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.textarea { min-height: 88px; resize: vertical; }
.select {
  appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8394' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input[aria-invalid="true"] { border-color: var(--bad); }

.more-toggle {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px;
  background: none; border: 0; padding: 6px 2px; margin: 0 0 8px;
  font: inherit; font-size: var(--step--1); font-weight: 570; color: var(--accent); cursor: pointer;
}
.more-toggle .plus {
  width: 20px; height: 20px; border-radius: var(--r-full); display: grid; place-items: center;
  background: var(--accent-soft); font-size: 14px; line-height: 1;
}
.more-panel[hidden] { display: none; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
/* A box you tick, not a switch you slide — people read a tick faster than
   they read the position of a knob. */
.switch .track {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  border: 1.5px solid var(--line); background: var(--surface);
  position: relative; transition: background .15s var(--ease), border-color .15s;
}
.switch .track::after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(.4);
  opacity: 0; transition: opacity .12s var(--ease), transform .12s var(--ease);
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { opacity: 1; transform: rotate(45deg) scale(1); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.switch.sm .track { width: 18px; height: 18px; border-radius: 5px; }
.switch.sm .track::after { left: 5.5px; top: 2px; width: 4px; height: 8px; }
/* the whole row answers to a tap, not just the little box */
.switch { padding: 8px; margin-inline: -8px; border-radius: var(--r-s); }
.switch:hover { background: var(--surface-2); }

/* ---------------------------------------------------- badges --------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-full);
  font-size: var(--step--1); font-weight: 600; line-height: 1.5;
  background: var(--line-soft); color: var(--ink-2);
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: var(--r-full); background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

/* ---------------------------------------------------- avatar --------- */
.avatar {
  width: 38px; height: 38px; border-radius: var(--r-full); flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 660; font-size: var(--step--1); letter-spacing: -.01em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 56px; height: 56px; font-size: var(--step-0); }
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }

/* ----------------------------------------------------- stats --------- */
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 16px; box-shadow: var(--sh-1);
  display: flex; flex-direction: column; gap: 3px;
}
.stat .k { font-size: var(--step--1); font-weight: 580; color: var(--ink-3); }
.stat .v { font-size: var(--step-2); font-weight: 680; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat .meta { font-size: var(--step--1); color: var(--ink-3); }
.stat.ok .v { color: var(--ok); }
.stat.bad .v { color: var(--bad); }
.stat.warn .v { color: var(--warn); }

.meter { height: 6px; border-radius: var(--r-full); background: var(--line-soft); overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s var(--ease); }

/* ----------------------------------------------------- table --------- */
.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--step-0); min-width: 520px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2); color: var(--ink-3);
  font-size: var(--step--1); font-weight: 620; text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .who { display: flex; align-items: center; gap: 10px; }
table.data .who .nm { font-weight: 570; }
table.data .who .sm { font-size: var(--step--1); color: var(--ink-3); }

/* --------------------------------------------------- check-in -------- */
.checkin-hero {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 28px 20px 26px; text-align: center;
  background:
    radial-gradient(120% 90% at 50% -10%, var(--accent-soft), transparent 62%),
    var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-2);
}
.checkin-hero .when { font-size: var(--step--1); color: var(--ink-3); font-weight: 550; }
.checkin-hero .clock { font-size: var(--step-3); font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }

.gps-ring {
  --pct: 0;
  position: relative; width: 168px; height: 168px; border-radius: var(--r-full);
  display: grid; place-items: center;
  background: conic-gradient(var(--ring-c, var(--ink-3)) calc(var(--pct) * 1%), var(--line-soft) 0);
  transition: background .5s var(--ease);
}
.gps-ring::before {
  content: ""; position: absolute; inset: 9px; border-radius: inherit; background: var(--surface);
}
.gps-ring.locating { animation: pulse 1.8s var(--ease) infinite; }
.gps-ring.inside { --ring-c: var(--ok); }
.gps-ring.outside { --ring-c: var(--bad); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.gps-btn {
  position: relative; z-index: 1;
  width: 134px; height: 134px; border-radius: var(--r-full); border: 0;
  display: grid; place-items: center; gap: 2px; align-content: center;
  font: inherit; font-weight: 680; font-size: var(--step-1); letter-spacing: -.02em;
  color: var(--accent-ink); cursor: pointer;
  background: linear-gradient(150deg, var(--accent), color-mix(in oklab, var(--accent) 62%, #000));
  box-shadow: 0 8px 26px color-mix(in oklab, var(--accent) 38%, transparent), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .12s var(--ease), filter .2s var(--ease);
}
.gps-btn:hover { filter: brightness(1.06); }
.gps-btn:active { transform: scale(.965); }
.gps-btn .cap { font-size: var(--step--1); font-weight: 560; opacity: .82; letter-spacing: 0; }
.gps-btn[disabled] { background: var(--line); color: var(--ink-3); box-shadow: none; cursor: not-allowed; }
.gps-btn.out { background: linear-gradient(150deg, #64748b, #3f4a5a); }

.gps-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--step--1); font-weight: 570; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: var(--r-full);
}
.gps-status .dot { width: 7px; height: 7px; border-radius: var(--r-full); background: var(--ink-3); }
.gps-status.inside { color: var(--ok); border-color: color-mix(in oklab, var(--ok) 26%, transparent); background: var(--ok-soft); }
.gps-status.inside .dot { background: var(--ok); }
.gps-status.outside { color: var(--bad); border-color: color-mix(in oklab, var(--bad) 26%, transparent); background: var(--bad-soft); }
.gps-status.outside .dot { background: var(--bad); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative; padding: 0 0 16px 26px; font-size: var(--step-0);
}
.timeline li::before {
  content: ""; position: absolute; left: 4px; top: 7px; width: 9px; height: 9px;
  border-radius: var(--r-full); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.timeline li::after {
  content: ""; position: absolute; left: 8px; top: 20px; bottom: 0; width: 1px; background: var(--line);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline .t { font-variant-numeric: tabular-nums; font-weight: 600; }
.timeline .d { color: var(--ink-3); font-size: var(--step--1); }

/* -------------------------------------------------- calendar --------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal .dow { min-width: 0; text-align: center; font-size: 11px; font-weight: 640; color: var(--ink-3); padding-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }
.cal .day {
  aspect-ratio: 1; min-width: 0; border-radius: var(--r-xs); display: grid; place-items: center;
  font-size: var(--step--1); font-weight: 570; font-variant-numeric: tabular-nums;
  background: var(--line-soft); color: var(--ink-3);
}
.cal .day.present { background: var(--ok-soft); color: var(--ok); }
.cal .day.absent { background: var(--bad-soft); color: var(--bad); }
.cal .day.field { background: var(--info-soft); color: var(--info); }
.cal .day.leave { background: var(--warn-soft); color: var(--warn); }
.cal .day.empty { background: transparent; }
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: var(--step--1); color: var(--ink-3); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* ------------------------------------------------------ nav ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: 10px 13px; font-size: var(--step-0); font-weight: 570; color: var(--ink-3);
  border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }

.quick-nav {
  position: fixed; inset: auto 0 0 0; z-index: 45;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; align-items: stretch;
  background: color-mix(in oklab, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}
.quick-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 570; color: var(--ink-3); min-width: 0;
}
.quick-nav a:hover { text-decoration: none; color: var(--ink); }
.quick-nav a.on { color: var(--accent); }
.quick-nav svg { width: 21px; height: 21px; }
.quick-nav .qi { position: relative; display: block; line-height: 0; }
.quick-nav .qbadge {
  position: absolute; top: -5px; left: 12px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--bad); color: #fff; border-radius: var(--r-full);
  font-size: 10px; font-weight: 700; font-style: normal; line-height: 1;
}

/* on wide screens it becomes a compact floating bar, not a full-width strip */
@media (min-width: 900px) {
  .quick-nav {
    inset: auto auto 18px 50%; transform: translateX(-50%);
    height: auto; width: auto; padding: 6px;
    border: 1px solid var(--line); border-radius: var(--r-full);
    box-shadow: var(--sh-3); gap: 2px;
  }
  .quick-nav a {
    flex-direction: row; gap: 7px; padding: 8px 14px; border-radius: var(--r-full);
    font-size: var(--step--1); white-space: nowrap;
  }
  .quick-nav a.on { background: var(--accent-soft); }
  .quick-nav .qbadge { position: static; margin-left: 2px; }
  .quick-nav .qi { display: inline-flex; align-items: center; }
}

.menu { position: relative; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 216px;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-3); padding: 6px; overflow: hidden;
}
.menu-panel[hidden] { display: none; }
.menu-panel a, .menu-panel button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 11px; border: 0; background: none; border-radius: var(--r-xs);
  font: inherit; font-size: var(--step-0); color: var(--ink); text-align: left; cursor: pointer;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--line-soft); text-decoration: none; }
.menu-sep { height: 1px; background: var(--line-soft); margin: 5px 0; }
.menu-label { padding: 8px 11px 4px; font-size: 11px; font-weight: 640; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }

/* ---------------------------------------------------- dialog --------- */
dialog.modal {
  border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink);
  box-shadow: var(--sh-3); width: min(520px, calc(100vw - 32px)); max-height: 88dvh;
}
dialog.modal::backdrop { background: rgba(8, 10, 15, .5); backdrop-filter: blur(3px); }
dialog.modal .modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
dialog.modal .modal-head h3 { flex: 1; font-size: var(--step-1); }
dialog.modal .modal-body { padding: 18px; overflow-y: auto; }
dialog.modal .modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line-soft); }

/* ---------------------------------------------------- toasts --------- */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: calc(var(--tab-h) + 18px); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 24px)); }
@media (min-width: 900px) { .toasts { bottom: 22px; } }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--r); font-size: var(--step-0); font-weight: 540;
  background: var(--raised); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--sh-3);
  animation: toast-in .26s var(--ease);
}
.toast.ok { border-color: color-mix(in oklab, var(--ok) 34%, transparent); }
.toast.bad { border-color: color-mix(in oklab, var(--bad) 34%, transparent); }
.toast .ic { width: 20px; height: 20px; flex: none; }
.toast.ok .ic { color: var(--ok); }
.toast.bad .ic { color: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* -------------------------------------------------- skeleton --------- */
.skel { border-radius: var(--r-xs); background: linear-gradient(90deg, var(--line-soft) 25%, var(--line) 37%, var(--line-soft) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; height: 14px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.empty { text-align: center; padding: 42px 20px; color: var(--ink-3); }
.empty .ic { width: 44px; height: 44px; margin: 0 auto 12px; opacity: .5; }
.empty h3 { color: var(--ink-2); margin-bottom: 4px; font-size: var(--step-0); }

/* ------------------------------------------------------ auth --------- */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(90% 60% at 50% 0%, var(--accent-soft), transparent 60%), var(--bg); }
.auth-card { width: min(420px, 100%); }
.auth-card .card { padding: 26px 22px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; text-align: center; }
.auth-logo .mark { width: 46px; height: 46px; border-radius: 13px; font-size: 20px; }
.auth-foot { text-align: center; margin-top: 10px; font-size: var(--step--1); color: var(--ink-3); }

/* every link on a signed-out page is a comfortable target — these get tapped at a gate */
.auth-card a, .auth-foot a { display: inline-block; min-height: 40px; padding: 10px 8px; }
.auth-card .card a.btn, .auth-card a.btn { padding: 0 16px; }

.role-pick { display: grid; gap: 8px; }
.role-pick button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  font: inherit; cursor: pointer; transition: border-color .15s var(--ease), background .15s var(--ease);
}
.role-pick button:hover { border-color: var(--accent); background: var(--accent-soft); }
.role-pick .nm { font-weight: 600; }
.role-pick .sm { font-size: var(--step--1); color: var(--ink-3); }

/* --------------------------------------------------- utility --------- */
.muted { color: var(--ink-3); }
.strong { font-weight: 620; }
.nums { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.hide { display: none !important; }
@media (max-width: 639px) { .sm-hide { display: none !important; } }

.notice {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r);
  font-size: var(--step-0); background: var(--info-soft); color: var(--info);
  border: 1px solid color-mix(in oklab, var(--info) 22%, transparent);
}
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in oklab, var(--warn) 22%, transparent); }
.notice.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in oklab, var(--bad) 22%, transparent); }
.notice.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in oklab, var(--ok) 22%, transparent); }
.notice .ic { width: 19px; height: 19px; flex: none; margin-top: 1px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .topbar, .bottom-nav, .btn, .tabs { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* ------------------------------------------------- branding & notes --- */
.hero-shot {
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: 18px;
  border: 1px solid var(--line); box-shadow: var(--sh-2); aspect-ratio: 16 / 7; background: var(--surface-2);
}
.hero-shot img { width: 100%; height: 100%; object-fit: cover; }

img.mark { width: 28px; height: 28px; border-radius: 8px; }

.brand-preview {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--surface-2);
}
.brand-preview .shot { width: 96px; aspect-ratio: 16/9; border-radius: var(--r-sm); overflow: hidden; background: var(--line-soft); flex: none; }
.brand-preview .shot img { width: 100%; height: 100%; object-fit: cover; }
.brand-preview .lg { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: none; background: var(--line-soft); }

.invite-box {
  font-family: var(--mono); font-size: var(--step--1); line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px; max-height: 240px; overflow: auto;
}

/* ------------------------------------------------- map picker -------- */
.map-pick { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.map-canvas { height: 280px; width: 100%; background: var(--line-soft); }
@media (min-width: 640px) { .map-canvas { height: 320px; } }
.map-bar { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.map-bar .input { min-height: 36px; flex: 1; min-width: 140px; }
.map-hint { padding: 0 10px 10px; font-size: var(--step--1); }

/* Leaflet inside our shell */
.leaflet-container { font: inherit; background: var(--line-soft); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.75); }
[data-theme="dark"] .leaflet-control-attribution { background: rgba(0,0,0,.5); color: #aaa; }
[data-theme="dark"] .leaflet-tile { filter: brightness(.75) contrast(1.05) saturate(.85); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile { filter: brightness(.75) contrast(1.05) saturate(.85); }
  :root:not([data-theme="light"]) .leaflet-control-attribution { background: rgba(0,0,0,.5); color: #aaa; }
}
.leaflet-bar a { color: var(--ink) !important; background: var(--surface) !important; border-color: var(--line) !important; }

/* status pills in people list */
.people-status { display: inline-flex; align-items: center; gap: 6px; }
.bulk-bar {
  position: sticky; bottom: calc(var(--tab-h) + 10px); z-index: 30;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; margin-top: 12px;
  background: var(--raised); border: 1px solid var(--accent-line); border-radius: var(--r);
  box-shadow: var(--sh-3);
}
@media (min-width: 900px) { .bulk-bar { bottom: 12px; } }
.bulk-bar[hidden] { display: none; }
.bulk-bar .n { font-weight: 640; }

/* ------------------------------------------------ visitor desk ------- */
.waiting-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--warn); border-left-width: 4px;
  border-radius: var(--r-sm); background: var(--warn-soft);
  animation: waiting-in .3s var(--ease);
}
.waiting-row:last-child { margin-bottom: 0; }
@keyframes waiting-in { from { opacity: 0; transform: translateY(-6px); } }

/* ------------------------------------------------ inline editing ----- */
.ed {
  border-bottom: 1px dashed var(--line); cursor: text; border-radius: 3px;
  padding: 1px 3px; margin: -1px -3px;
}
.ed:hover { background: var(--accent-soft); border-bottom-color: var(--accent); }
.ed:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--surface); }
.ed.saving { opacity: .5; }
.ed.saved { background: var(--ok-soft); transition: background .8s; }
.ed-empty { color: var(--ink-3); font-style: italic; }

tr.rowlink { cursor: pointer; }
tr.rowlink:focus-within { background: var(--surface-2); }

.stat.linked { text-decoration: none; color: inherit; transition: border-color .15s var(--ease), transform .1s var(--ease); }
.stat.linked:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }

/* slips */
.slip {
  border: 1px dashed var(--line); border-radius: var(--r-sm);
  padding: 14px; break-inside: avoid; margin-bottom: 10px;
}
.slip .nm { font-weight: 660; font-size: var(--step-1); }
.slip dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 8px 0 0; font-size: var(--step--1); }
.slip dt { color: var(--ink-3); }
.slip dd { margin: 0; font-family: var(--mono); word-break: break-all; }
@media print {
  .slips { columns: 2; column-gap: 14px; }
  .slip { border-color: #999; }
}

/* ------------------------------------------------ one-tap marking ---- */
.mark-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.mark-chip {
  display: flex; align-items: center; gap: 9px; text-align: left;
  padding: 9px 11px; min-height: 52px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); font: inherit; color: var(--ink); cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .08s var(--ease);
}
.mark-chip:active { transform: scale(.98); }
.mark-chip .nm { flex: 1; min-width: 0; font-weight: 570; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark-chip .st { font-size: 11px; font-weight: 640; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.mark-chip.is-present { background: var(--ok-soft); border-color: color-mix(in oklab, var(--ok) 30%, transparent); }
.mark-chip.is-present .st { color: var(--ok); }
.mark-chip.is-absent { background: var(--bad-soft); border-color: color-mix(in oklab, var(--bad) 30%, transparent); }
.mark-chip.is-absent .st { color: var(--bad); }
.mark-chip.is-leave { background: var(--warn-soft); border-color: color-mix(in oklab, var(--warn) 30%, transparent); }
.mark-chip.is-leave .st { color: var(--warn); }

/* ==========================================================
   Phone: a list of tables is a spreadsheet; a list of cards
   is an app. Below 760px every `.rows` table becomes cards.
   ========================================================== */
/* the chevron only earns its place where rows collapse */
.table-wrap.rows .cell-name .switch { display: none; }

.rowtoggle {
  display: none; flex: none; width: 30px; height: 30px; padding: 0;
  align-items: center; justify-content: center;
  background: none; border: 0; color: var(--ink-3); cursor: pointer; border-radius: var(--r-xs);
}
.rowtoggle .chev { transition: transform .18s var(--ease); }
tr.open .rowtoggle .chev { transform: rotate(180deg); }
.rowtoggle:hover { background: var(--line-soft); color: var(--ink); }

.only-cards { display: none; }

@media (max-width: 759px) {
  .rowtoggle { display: inline-flex; }
  .only-cards { display: inline; }
  .table-wrap.rows .not-cards { display: none !important; }

  /* closed by default: a card shows a name and whether they are active */
  .table-wrap.rows tr:not(.open) td[data-label],
  .table-wrap.rows tr:not(.open) .cell-actions { display: none !important; }
  .table-wrap.rows tr:not(.open) .cell-name { margin-bottom: 0; }

  .table-wrap.rows { border: 0; background: transparent; overflow: visible; border-radius: 0; }
  .table-wrap.rows table.data { min-width: 0; display: block; }
  .table-wrap.rows table.data thead { display: none; }
  .table-wrap.rows table.data tbody { display: block; }

  /* A folded panel stays folded on a phone too. The card rule below turns
     every row into a block — including rows the page has hidden. */
  .table-wrap.rows table.data tr[hidden] { display: none !important; }
  .table-wrap.rows table.data tr {
    display: block; position: relative;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    box-shadow: var(--sh-1); padding: 12px 14px; margin-bottom: 10px;
  }
  .table-wrap.rows table.data tr:hover { background: var(--surface); }
  .table-wrap.rows table.data td { display: block; border: 0; padding: 0; }

  /* the name line is the card's headline */
  .table-wrap.rows .cell-name { margin-bottom: 8px; }
  .table-wrap.rows .cell-name .nm { font-size: var(--step-1); font-weight: 640; }
  .table-wrap.rows .cell-name .who { gap: 11px; }
  .table-wrap.rows .cell-name .avatar { width: 40px; height: 40px; font-size: var(--step--1); }

  /* labelled detail lines */
  /* label on top, value under it - never left/right on a phone */
  .table-wrap.rows table.data td[data-label] {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
    padding: 6px 0; border-top: 1px solid var(--line-soft);
    font-size: var(--step-0);
  }
  .table-wrap.rows table.data td[data-label]::before {
    content: attr(data-label);
    font-size: .72rem; font-weight: 500; color: var(--ink-3); letter-spacing: .01em;
  }
  .table-wrap.rows table.data td[data-label] > * { min-width: 0; }
  .table-wrap.rows table.data td:empty { display: none; }

  /* the toggle already sits on the name line */
  .table-wrap.rows .cell-status { display: none !important; }

  /* select-all checkbox floats over the card corner */
  .table-wrap.rows .cell-pick { position: absolute; top: 12px; right: 12px; }
  .table-wrap.rows .cell-pick input { width: 20px; height: 20px; }
  .table-wrap.rows .cell-name .switch { display: inline-flex; margin-right: 30px; }

  /* actions: two real buttons and a menu, side by side */
  .table-wrap.rows .cell-actions { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
  .table-wrap.rows .row-actions { display: flex; gap: 8px; }
  .table-wrap.rows .row-actions > .btn { flex: 1; min-height: 40px; }
  .table-wrap.rows .row-actions .menu > .btn { min-width: 46px; min-height: 40px; font-size: 18px; line-height: 1; }

  .table-wrap.rows .empty { background: var(--surface); border-radius: var(--r); }
}

.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.contacts { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.contacts .c { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* -------------------------------------------------- collapsible cards */
.card-head.foldable { cursor: pointer; user-select: none; }
.card-head.foldable:hover { background: var(--surface-2); }
.card-head .fold {
  flex: none; width: 40px; height: 40px; padding: 0; margin: -6px -6px -6px auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--ink-3); cursor: pointer; border-radius: var(--r-xs);
}
.card-head .fold svg { transition: transform .18s var(--ease); }
.card.folded .card-head { border-bottom: 0; }
.card.folded .card-head .fold svg { transform: rotate(-90deg); }
.card.folded > :not(.card-head) { display: none !important; }

.photo-pick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.photo-pick label.btn { cursor: pointer; }

/* ------------------------------------------------------- note chips -- */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.note-chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 7px 13px; min-height: 34px;
  font: inherit; font-size: var(--step--1); font-weight: 560; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.note-chip:hover { border-color: var(--accent); color: var(--ink); }
.note-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.note-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.note-box { width: min(360px, 100%); }
.note-box .chip-row { justify-content: center; }

/* -------------------------------------------------- install nudge -- */
.install-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 18px auto 0; max-width: 1180px; padding-inline: 16px;
  border: 1px solid var(--line); border-radius: 14px; padding-block: 11px;
  background: var(--accent-soft); color: var(--ink);
}
.install-strip .txt { font-size: var(--step--1); min-width: 200px; flex: 1; }
@media (max-width: 759px) {
  .install-strip { margin: 12px 12px 0; border-radius: 12px; }
  .install-strip .txt { flex-basis: 100%; }
}

/* ------------------------------------------------ trust and devices -- */
.trust-check { display: flex; align-items: center; gap: 9px; margin: 4px 0 2px; cursor: pointer; }
.trust-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.trust-check span { font-size: var(--step--1); }
.badge.new-device { border: 0; cursor: pointer; font: inherit; font-size: var(--step--2); font-weight: 640; margin-left: 6px; }
.badge.new-device:hover { filter: brightness(.95); }

/* ------------------------------------------------- lists and paging -- */
.list-controls {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 10px; font-size: var(--step--1);
}
.list-controls .per-page { display: inline-flex; align-items: center; gap: 7px; }
.list-controls .per-page select { width: auto; min-height: 34px; }
.list-controls .pager { display: inline-flex; align-items: center; gap: 8px; }
.list-controls [aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ------------------------------------------------- inline row panels -- */
tr.org-panel > td { background: var(--surface-2, var(--surface)); padding: 14px; }
.panel-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.panel-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface); }
.panel-box h4 { margin: 0 0 8px; font-size: var(--step--1); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
tr.org-row.open { background: var(--accent-soft); }
tr.org-row.open .chev { transform: rotate(180deg); }
button.stat { text-align: left; font: inherit; cursor: pointer; }

/* --------------------------------------------- registration numbers -- */
.reg-rows { display: grid; gap: 8px; }
.reg-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
@media (max-width: 559px) { .reg-row { grid-template-columns: 1fr auto; } .reg-row input:first-child { grid-column: 1 / -1; } }
.map-open { margin-bottom: 8px; }
tr.person-panel > td { background: var(--accent-soft); padding: 10px 14px 12px; }

/* -------------------------------------------------- the quick strip -- */
.quick { display: grid; gap: 9px; }
.quick .facts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: var(--step--1); }
.quick .pills, .quick .drawer { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.quick .drawer { padding-top: 3px; }
.pill {
  display: inline-flex; align-items: center; min-height: 34px; padding: 6px 13px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink-2); font: inherit; font-size: var(--step--1); font-weight: 560;
  cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.pill:hover { border-color: var(--accent); color: var(--ink); }
.pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill.danger { color: var(--bad); }
.pill.danger:hover { border-color: var(--bad); }
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.note-quick { display: flex; gap: 7px; width: 100%; }
.note-quick .input { flex: 1; min-height: 34px; }
.note-line { width: 100%; font-size: var(--step--1); }
tr.person-row.open { background: var(--accent-soft); }
tr.person-row.open .chev { transform: rotate(180deg); }

/* ------------------------------------------------------- landing page -- */
/* The shop window. Almost no reading: one line per section, colour does the
   talking. Tints are mixed from a hue into transparency so the same rules
   hold in light and dark. */
.foot-mark { width: 1em; height: 1em; }
.lp { --h-mint:#10b981; --h-sky:#3b82f6; --h-amber:#f59e0b; --h-pink:#ec4899; --h-violet:#8b5cf6;
      --h-rose:#e11d48; --h-lime:#84cc16; --h-gold:#d97706; --h-teal:#14b8a6;
      max-width: 1080px; margin: 0 auto; padding: 0 16px 40px; }
.lp h1, .lp h2 { letter-spacing: -.02em; text-wrap: balance; }
.lp h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); margin: 0 0 18px; text-align: center; }
.lp-sec { padding: 40px 0; }
.lp-muted { color: var(--ink-3); text-align: center; margin: 10px 0 0; font-size: var(--step--1); }
.lp-fine { color: var(--ink-3); font-size: var(--step--1); margin: 12px 0 0; }
.lp .center { text-align: center; }

/* tints: one class, three properties */
.t-mint   { --t: var(--h-mint); }  .t-sky   { --t: var(--h-sky); }   .t-amber { --t: var(--h-amber); }
.t-pink   { --t: var(--h-pink); }  .t-violet{ --t: var(--h-violet);} .t-rose  { --t: var(--h-rose); }
.t-lime   { --t: var(--h-lime); }  .t-gold  { --t: var(--h-gold); }  .t-teal  { --t: var(--h-teal); }
.lp [class*="t-"] { --t-bg: color-mix(in srgb, var(--t) 14%, var(--surface)); --t-line: color-mix(in srgb, var(--t) 35%, transparent); --t-ink: color-mix(in srgb, var(--t) 70%, var(--ink)); }

/* nav */
.lp-nav { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.lp-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); text-decoration: none; font-size: var(--step-0); }
.lp-brand .mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, var(--h-pink), var(--h-violet)); }
.lp-brand .mark .foot-mark { width: 20px; height: 20px; }
.lp-nav nav { display: none; gap: 18px; margin-left: 10px; }
.lp-nav nav a { color: var(--ink-2); text-decoration: none; font-weight: 560; font-size: var(--step--1); }
.lp-nav > .btn { margin-left: auto; }
@media (min-width: 640px) { .lp-nav nav { display: flex; } }

/* hero */
.lp-hero { position: relative; display: grid; gap: 26px; align-items: center; padding: 26px 0 34px; border-radius: 28px; overflow: hidden; isolation: isolate; }
.lp-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background:
    radial-gradient(60% 70% at 10% 10%, color-mix(in srgb, var(--h-pink) 26%, transparent), transparent 70%),
    radial-gradient(55% 60% at 90% 20%, color-mix(in srgb, var(--h-sky) 26%, transparent), transparent 70%),
    radial-gradient(60% 60% at 60% 100%, color-mix(in srgb, var(--h-amber) 22%, transparent), transparent 70%); }
.lp-hero-copy { padding: 10px 14px 0; }
.lp-hero h1 { font-size: clamp(2rem, 1.4rem + 3.2vw, 3.4rem); line-height: 1.05; margin: 0 0 12px; }
.lp-hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--h-pink), var(--h-violet), var(--h-sky));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-hero p { font-size: var(--step-1); color: var(--ink-2); margin: 0 0 18px; max-width: 30ch; }
.lp-cta { display: flex; gap: 10px; flex-wrap: wrap; }
@media (min-width: 760px) { .lp-hero { grid-template-columns: 1.15fr .85fr; padding: 40px 24px 48px; gap: 30px; } .lp-hero-copy { padding: 0; } }

/* the phone: a ring that fills, three rows under it */
.lp-phone { display: grid; gap: 10px; justify-items: center; padding: 8px; }
.lp-ring { position: relative; width: 190px; height: 190px; display: grid; place-items: center; border-radius: 50%;
  background: conic-gradient(var(--h-mint) var(--deg, 0deg), color-mix(in srgb, var(--ink) 10%, transparent) 0);
  animation: lpfill 3.2s var(--ease, ease) infinite alternate; }
.lp-ring i { position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); box-shadow: var(--sh-2); }
.lp-ring span { position: relative; display: grid; place-items: center; width: 140px; height: 140px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 1.15rem; text-align: center; line-height: 1.1;
  background: linear-gradient(160deg, var(--h-sky), var(--h-violet)); box-shadow: 0 10px 30px color-mix(in srgb, var(--h-violet) 40%, transparent); }
.lp-ring small { display: block; font-weight: 500; font-size: .72rem; opacity: .85; margin-top: 4px; }
@property --deg { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes lpfill { from { --deg: 40deg; } to { --deg: 320deg; } }
.lp-pill { padding: 6px 12px; border-radius: 999px; font-size: var(--step--1); font-weight: 650;
  background: color-mix(in srgb, var(--h-mint) 18%, var(--surface)); color: color-mix(in srgb, var(--h-mint) 70%, var(--ink)); }
.lp-row { width: min(240px, 100%); display: flex; justify-content: space-between; gap: 10px; padding: 9px 13px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line-soft); font-size: var(--step--1); box-shadow: var(--sh); }
.lp-row.in span { color: color-mix(in srgb, var(--h-mint) 70%, var(--ink)); font-weight: 650; }
.lp-row:not(.in) { opacity: .6; }

/* four promises, one row, always */
.lp-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 26px 0 6px; }
.lp-band > div { display: grid; gap: 4px; padding: 14px 10px; border-radius: 16px; background: var(--t-bg); border: 1px solid var(--t-line); text-align: center; min-width: 0; }
.lp-band svg { width: 22px; height: 22px; margin: 0 auto 2px; color: var(--t-ink); }
.lp-band strong { font-size: var(--step--1); color: var(--ink); line-height: 1.15; }
.lp-band span { font-size: .72rem; color: var(--ink-3); line-height: 1.2; }
@media (max-width: 480px) { .lp-band { gap: 6px; } .lp-band > div { padding: 10px 6px; border-radius: 12px; } .lp-band span { display: none; } .lp-band strong { font-size: .74rem; } }

/* three steps */
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lp-steps li { display: grid; justify-items: center; gap: 6px; padding: 22px 12px 18px; border-radius: 20px; background: var(--t-bg); border: 1px solid var(--t-line); text-align: center; min-width: 0; }
.lp-steps span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--t); color: #fff; font-weight: 800; font-size: 1.15rem; box-shadow: 0 6px 18px color-mix(in srgb, var(--t) 40%, transparent); }
.lp-steps strong { font-size: var(--step-1); }
.lp-steps small { color: var(--ink-2); font-size: var(--step--1); line-height: 1.3; }
@media (max-width: 480px) { .lp-steps { gap: 6px; } .lp-steps li { padding: 14px 6px; } .lp-steps small { display: none; } .lp-steps span { width: 36px; height: 36px; } }

/* who it is for: coloured chips, one live line */
.lp-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.lp-chip { font: inherit; font-size: var(--step--1); font-weight: 620; cursor: pointer; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--t-line); background: var(--t-bg); color: var(--t-ink); transition: transform .12s var(--ease, ease), box-shadow .12s; }
.lp-chip:hover { transform: translateY(-1px); }
.lp-chip.on, .lp-chip:has(input:checked) { background: var(--t); border-color: var(--t); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--t) 40%, transparent); }
.lp-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.lp-chips.small { justify-content: flex-start; } .lp-chips.small .lp-chip { padding: 7px 12px; position: relative; }
.lp-who-line { text-align: center; font-size: var(--step-1); font-weight: 650; margin: 18px 0 0; min-height: 1.6em; }

/* pricing: features come from the plan, colours from the plan too */
.lp-price { display: grid; gap: 14px; }
.lp-plan { display: grid; gap: 4px; padding: 22px 20px; border-radius: 22px; background: var(--t-bg); border: 1px solid var(--t-line); position: relative; }
.lp-plan.hi { box-shadow: 0 14px 40px color-mix(in srgb, var(--t) 22%, transparent); border-color: var(--t); }
.lp-plan.hi::after { content: "Popular"; position: absolute; top: 14px; right: 14px; font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--t); color: #fff; }
.lp-plan .pk { font-weight: 700; color: var(--t-ink); }
.lp-plan .pv { font-size: clamp(1.9rem, 1.4rem + 1.5vw, 2.6rem); font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.lp-plan .pp { color: var(--ink-3); font-size: var(--step--1); min-height: 1.3em; }
.lp-plan ul { list-style: none; margin: 14px 0 16px; padding: 0; display: grid; gap: 7px; }
.lp-plan li { position: relative; padding-left: 24px; font-size: var(--step--1); color: var(--ink-2); }
.lp-plan li::before { content: "✓"; position: absolute; left: 0; top: 0; font-weight: 800; color: var(--t); }
@media (min-width: 720px) { .lp-price { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; } .lp-plan.hi { transform: translateY(-8px); } }

/* start */
.lp-start { max-width: 520px; margin: 0 auto; }
.lp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: var(--sh-2); }
.lp-card h2 { text-align: left; margin-bottom: 12px; }
.lp-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 20px 4px 0; color: var(--ink-3); font-size: var(--step--1); border-top: 1px solid var(--line-soft); }
.lp-foot a { color: inherit; }
@media (prefers-reduced-motion: reduce) { .lp-ring { animation: none; --deg: 240deg; } .lp-chip { transition: none; } }

/* a pin that is not set yet has nothing to open */
#mapOpen.is-off { opacity: .5; pointer-events: none; }

/* a small tick-list, used where several switches sit side by side */
.pick { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: var(--step--1); cursor: pointer; }
.pick input { width: 16px; height: 16px; accent-color: var(--accent); }
.pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 560; }

/* ============================================================
   People — one screen, one question: who is in?
   ============================================================ */
.lead { margin-bottom: 14px; }
.lead h2 { margin: 0 0 4px; font-size: var(--step-2); letter-spacing: -.015em; }
.lead p { margin: 0; color: var(--ink-2); font-size: var(--step-0); }
.lead .in { color: var(--ok); font-weight: 620; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: var(--step--1); font-weight: 560;
  text-decoration: none; white-space: nowrap; min-height: 36px; display: inline-flex; align-items: center;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--surface); font-weight: 620; }
.toolbar .search { position: relative; display: inline-flex; align-items: center; }
.toolbar .search svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.toolbar .search .input { padding-left: 34px; width: 230px; }

.people { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.prow { border-bottom: 1px solid var(--line-soft); }
.prow:last-child { border-bottom: 0; }
.prow-main {
  display: grid; grid-template-columns: auto auto 1fr auto auto 20px;
  align-items: center; gap: 12px; padding: 13px 16px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background .12s;
}
.prow-main:active { background: var(--line-soft); }
.prow.open { background: var(--accent-soft); }
.prow.open .chev { transform: rotate(90deg); }
.prow .pick { width: 18px; height: 18px; accent-color: var(--accent); }
.prow .who { min-width: 0; }
.prow .nm { font-weight: 620; font-size: var(--step-0); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.prow .sub { font-size: var(--step--1); color: var(--ink-3); margin-top: 2px; }
.prow .state { display: flex; align-items: center; gap: 8px; font-size: var(--step--1); white-space: nowrap; }
.prow .state .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--ink-3); flex: none; }
.prow.state-in .state .dot { background: var(--ok); }
.prow.state-notyet .state .dot { background: var(--warn); }
.prow.state-leave .state .dot { background: #c9ced6; }
.prow.state-leave .state .txt, .prow.state-leave .hrs { color: var(--ink-3); }
.prow .hrs { font-size: var(--step--1); color: var(--ink-2); min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; }
.prow .chev { width: 20px; height: 20px; color: var(--ink-3); transition: transform .18s var(--ease); }
.badge.sm { font-size: var(--step--2); padding: 2px 8px; }

.prow-open { padding: 2px 16px 18px 62px; display: grid; gap: 14px; }
.prow-open .facts { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: var(--step--1); color: var(--ink-2); align-items: center; }
.prow-open .facts em { font-style: normal; color: var(--ink-3); margin-right: 4px; }
.acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; max-width: 780px; }
.act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 76px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--step--1); font-weight: 600;
  text-decoration: none; cursor: pointer; text-align: center;
  transition: transform .1s var(--ease), border-color .15s, background .15s;
}
.act svg { width: 20px; height: 20px; color: var(--accent); }
.act:hover { border-color: var(--accent); }
.act:active { transform: scale(.96); background: var(--accent-soft); }
.quiet { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: var(--step--1); }
.lnk { background: 0; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: none; }
.lnk.danger { color: var(--bad); }
.switch.sm .track { transform: scale(.85); }

@media (max-width: 759px) {
  .prow-main { grid-template-columns: auto 1fr auto; gap: 10px; padding: 12px 14px; }
  .prow .pick { display: none; }
  .prow .state { flex-direction: column; align-items: flex-end; gap: 2px; }
  .prow .state .dot { display: none; }
  .prow.state-in .state .txt { color: var(--ok); font-weight: 620; }
  .prow.state-notyet .state .txt { color: var(--warn); font-weight: 620; }
  .prow .hrs, .prow .chev { display: none; }
  .prow-open { padding: 0 14px 16px; }
  .acts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .act { min-height: 72px; font-size: var(--step--2); }
  .toolbar .search { flex: 1; }
  .toolbar .search .input { width: 100%; }
  .toolbar .btn-primary { flex: none; }
}

/* ============================================================
   App feel — movement, sheets, thumbs
   ============================================================ */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vtOut .18s var(--ease) both; }
  ::view-transition-new(root) { animation: vtIn .22s var(--ease) both; }
  @keyframes vtOut { to { opacity: 0; transform: translateX(-14px); } }
  @keyframes vtIn { from { opacity: 0; transform: translateX(16px); } }
}

/* buttons answer the thumb at once */
.btn, .pill, .chip, .act, .quick-nav a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn:active, .pill:active, .chip:active { transform: scale(.97); }

/* on a phone a dialog belongs at the bottom, where the thumb is */
@media (max-width: 759px) {
  .modal { margin: auto auto 0; width: 100%; max-width: none; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal::backdrop { background: rgba(16, 19, 26, .45); }
  @media (prefers-reduced-motion: no-preference) {
    .modal[open] { animation: sheetUp .22s var(--ease); }
    @keyframes sheetUp { from { transform: translateY(18px); opacity: .6; } }
  }
  .modal .modal-head::before {
    content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 38px; height: 4px; border-radius: 999px; background: var(--line);
  }
  .modal .modal-head { position: relative; padding-top: 20px; }
  .modal-foot { position: sticky; bottom: 0; background: var(--surface); }
  .toasts { bottom: calc(var(--tab-h) + 16px); }
}

/* the bar tucks away while reading, comes back on the way up */
.topbar { transition: transform .22s var(--ease), box-shadow .22s var(--ease); }
.topbar.shrunk { box-shadow: 0 1px 0 var(--line), var(--sh-1); }
@media (max-width: 759px) {
  .topbar.tucked { transform: translateY(-100%); }
}
.stat.warn .v { color: var(--warn); }
.stat .v small { font-size: var(--step-0); font-weight: 500; color: var(--ink-3); }

/* --------------------------------------------------- master dashboard -- */
/* Tiles are doors, not decoration: each one filters the list below it. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: 16px 16px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink); text-decoration: none;
  transition: transform .1s var(--ease), border-color .15s, box-shadow .15s;
}
.tile:hover { border-color: var(--accent); box-shadow: var(--shadow-1); }
.tile:active { transform: scale(.99); }
.tile.on { border-color: var(--accent); background: var(--accent-soft); }
.tile.warn .v { color: var(--warn); }
.tile .go { position: absolute; top: 12px; right: 14px; color: var(--ink-3); font-size: 18px; line-height: 1; }
.tile .v { font-size: var(--step-4); font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.tile .k { font-size: var(--step--1); color: var(--ink-2); }
.tile .meta { font-size: var(--step--2); color: var(--ink-3); }
.tile .cta { margin-top: 8px; font-size: var(--step--2); font-weight: 600; color: var(--accent); }

th.sortable { padding: 0; }
th.sortable > a {
  display: block; padding: 11px 12px; color: inherit; text-decoration: none; white-space: nowrap;
}
th.sortable > a .sm { color: var(--ink-3); font-size: .85em; }
th.sortable.on > a { color: var(--accent); }
th.sortable.on > a .sm { color: var(--accent); }

/* The open row: read-only facts, then pills, then the actions. No forms. */
/* RULE: never label-left / value-right. Label on top, value under it,
   and the facts sit side by side in one flowing row. Everywhere. */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 8px; margin-bottom: 12px; align-items: stretch; }
.org-panel .facts { margin-bottom: 12px; }
.facts dl { margin: 0; display: contents; }
.facts dl > div {
  display: flex; flex-direction: column; justify-content: flex-start; gap: 2px;
  min-width: 0; padding: 7px 10px; border: 1px solid var(--line-soft); border-radius: 10px;
  font-size: var(--step--1);
}
.facts dt { margin: 0; color: var(--ink-3); font-size: .74rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts dd { margin: 0; text-align: left; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.sec-pills { margin-bottom: 10px; }
.sec-body { margin-bottom: 14px; }
.mini { list-style: none; margin: 0; padding: 0; }
.mini li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: var(--step--1);
}
.mini li:last-child { border-bottom: 0; }
.mini .nm { font-weight: 600; }
.act-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.act-primary:hover { border-color: var(--accent); filter: brightness(1.05); }
@media (max-width: 559px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 13px 12px 11px; }
}


/* The organisation's actions are one slim line, not a wall of cards. */
.org-panel .acts { display: flex; flex-wrap: wrap; gap: 8px; max-width: none; }
.org-panel .act {
  flex: 0 0 auto; flex-direction: row; min-height: 0; gap: 6px;
  padding: 9px 14px; border-radius: 10px; font-size: var(--step--1);
}
.org-panel .act svg { width: 16px; height: 16px; }

/* Inside the facts a link should read as a value, not as a wall of blue. */
.facts dd .lnk { color: inherit; border-bottom: 1px dashed var(--line); }
.facts dd .lnk:hover { color: var(--accent); border-bottom-color: var(--accent); }
.facts dd .lnk .badge { border-bottom: 0; }
.facts dd a { color: var(--accent); text-decoration: none; }
.facts dd a:hover { text-decoration: underline; }
.facts dd .copy-wrap { margin-left: 6px; }
.facts dd .btn { padding: 2px 8px; font-size: .74rem; }
.facts dd .switch { margin-top: 2px; }

/* Home is always one tap away, next to the name. */
.home-btn { display: inline-flex; align-items: center; gap: 6px; }
.home-btn svg { width: 18px; height: 18px; }
@media (max-width: 559px) { .home-btn .home-word { display: none; } }

/* ------------------------------------------------- the working day ---- */
/* Green while the clock is running, red once the day is closed. */
.gps-btn.out { background: linear-gradient(150deg, #16a34a, #0f8a3e); }
.gps-ring.working { --ring-c: var(--ok); }
.gps-ring.closed { --ring-c: var(--bad); }
.gps-btn.done { background: linear-gradient(150deg, #e04747, #c22f2f); }
.gps-btn[disabled].done, .gps-btn[disabled].out { opacity: .55; }

/* One line per day of the month — tap one to open that day. */
.month-strip { display: flex; gap: 3px; align-items: flex-end; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.month-strip::-webkit-scrollbar { display: none; }
.ms { flex: 1 1 0; min-width: 9px; text-decoration: none; display: block; text-align: center; }
.ms i { display: block; height: 34px; border-radius: 3px; background: var(--line); transition: transform .1s var(--ease), filter .15s; }
.ms span { display: block; font-size: 9px; color: var(--ink-3); margin-top: 3px; }
.ms.in i { background: var(--ok); }
.ms.part i { background: var(--warn); }
.ms.out i { background: color-mix(in oklab, var(--bad) 45%, var(--line)); }
.ms.future i { background: var(--line-soft); height: 22px; }
.ms.today i { outline: 2px solid var(--accent); outline-offset: 1px; }
.ms.today span { color: var(--accent); font-weight: 700; }
.ms:hover i { filter: brightness(1.08); transform: scaleY(1.06); }
@media (max-width: 559px) { .ms span { display: none; } .ms i { height: 30px; } }

/* A list of places to go: icon, what it is, one line of why. */
.rowlist { display: flex; flex-direction: column; }
.rowlist > a, .rowlist > button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 16px; border: 0; border-top: 1px solid var(--line-soft);
  background: 0; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.rowlist > :first-child { border-top: 0; }
.rowlist > a:hover, .rowlist > button:hover { background: var(--surface-2); }
.rowlist svg { width: 20px; height: 20px; flex: none; color: var(--ink-3); }
.rowlist .t { display: block; font-weight: 600; font-size: var(--step--1); }
.rowlist .d { display: block; font-size: var(--step--2); color: var(--ink-3); }
.rowlist > a::after, .rowlist > button::after { content: '\203A'; margin-left: auto; color: var(--ink-3); font-size: 18px; line-height: 1; }
tr.picked > td { background: var(--accent-soft); }


/* --------------------------------------------------- folding cards ---- */
.card.fold > .card-head { cursor: pointer; user-select: none; }
.card.fold > .card-head::after {
  content: '\203A'; margin-left: auto; color: var(--ink-3); font-size: 20px; line-height: 1;
  transform: rotate(90deg); transition: transform .15s var(--ease);
}
.card.fold.shut > .card-head::after { transform: rotate(0deg); }
.card.fold.shut > :not(.card-head) { display: none; }
.card-pad > h3 + .foldable, .card.fold > .card-head h3 { margin: 0; }


/* --- folding lines: every row on a list opens in place ------------------ */
.linefold { border-bottom: 1px solid var(--line-2); }
.linefold:last-child { border-bottom: 0; }
.linefold > summary { list-style: none; cursor: pointer; padding: 10px 2px; border-radius: var(--r-s); }
.linefold > summary::-webkit-details-marker { display: none; }
.linefold > summary:hover { background: var(--line-2); }
.linefold > summary::after { content: "\203A"; margin-left: 6px; color: var(--muted);
  transition: transform .15s ease; display: inline-block; }
.linefold[open] > summary::after { transform: rotate(90deg); }
.linebody { padding: 2px 2px 12px; display: flex; flex-direction: column; gap: 8px; }
.linebody .acts { display: flex; flex-wrap: wrap; gap: 6px; }

/* the register mark, as a small coloured box */
.mark { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; flex: none; background: var(--line-2); color: var(--muted); }
.mark-p, .mark-od { background: var(--ok-soft, #e3f4eb); color: var(--ok, #1b7f4d); }
.mark-a { background: var(--bad-soft, #fceceb); color: var(--bad, #c23b2e); }
.mark-cl, .mark-sl, .mark-el { background: var(--accent-soft); color: var(--accent); }
.mark-hd { background: var(--warn-soft, #fdf1dd); color: var(--warn, #a56600); }

/* the same fact list, used straight inside a folded row */
dl.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 8px; font-size: var(--step--1); }
dl.facts > div { display: flex; flex-direction: column; gap: 2px; min-width: 0;
  padding: 7px 10px; border: 1px solid var(--line-soft); border-radius: 10px; }
dl.facts dt { margin: 0; color: var(--ink-3); font-size: .74rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
dl.facts dd { margin: 0; text-align: left; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }


/* --- chips: presets you tap, days you toggle ---------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { font: inherit; font-size: var(--step--1); font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  padding: 5px 11px; border-radius: 99px; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn:active { transform: translateY(1px); }

.chip-box { position: relative; cursor: pointer; user-select: none; }
.chip-box input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip-box span { display: inline-block; font-size: var(--step--1); font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  padding: 5px 12px; border-radius: 99px; }
.chip-box input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-box input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.saved-note { font-size: var(--step--1); color: var(--ink-3); }
.saved-note.on { color: var(--ok); }


/* =======================================================================
   Shell, tightened (Sep 2026)
   The app was built for one column on a phone and then stretched across a
   desktop, which left a thin ribbon of content in a field of white and rows
   tall enough that five people filled a screen. Everything below pulls the
   chrome in so the work — names, times, numbers — is what takes up room.
   ===================================================================== */

:root {
  --step--1: clamp(.76rem, .74rem + .08vw, .8rem);
  --step-0:  clamp(.86rem, .84rem + .1vw, .9rem);
  --step-1:  clamp(.98rem, .95rem + .16vw, 1.05rem);
  --step-2:  clamp(1.12rem, 1.06rem + .3vw, 1.3rem);
  --step-3:  clamp(1.3rem, 1.2rem + .5vw, 1.6rem);
  --nav-h: 52px;
}

/* one page-wide rhythm */
.main { max-width: 1280px; padding: 16px 20px 28px; }
@media (min-width: 900px) { .main { padding: 20px 28px 36px; } }

/* the heading is one line, with room for actions on the right */
.page-head { align-items: center; gap: 10px; margin-bottom: 14px; }
.page-head .eyebrow { display: inline; margin: 0 6px 0 0; letter-spacing: .04em; }
.page-head h1 { font-size: var(--step-2); display: inline; }
.lead { margin-bottom: 12px; }
.lead h2 { font-size: var(--step-2); }

.topbar { height: var(--nav-h); padding: 0 20px; gap: 10px; }
.brand .mark { width: 24px; height: 24px; border-radius: 7px; font-size: 12px; box-shadow: none; }

.tabs { gap: 2px; margin-bottom: 14px; }
.tabs a { padding: 8px 11px; font-size: var(--step--1); font-weight: 600; }

/* the four numbers read as one strip, not four billboards */
.grid { gap: 10px; }
.grid.cols-4 { gap: 8px; }
.stat { padding: 9px 12px; gap: 1px; box-shadow: none; border-radius: var(--r-sm); }
.stat .k { font-size: var(--step--1); font-weight: 600; color: var(--ink-2); order: 1; }
.stat .v { font-size: var(--step-2); order: 2; line-height: 1.15; }
.stat .meta { font-size: 11px; order: 3; }
@media (min-width: 760px) {
  .grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.card { box-shadow: none; }
.card-pad { padding: 14px; }
@media (min-width: 640px) { .card-pad { padding: 16px; } }
.card-head { padding: 11px 14px; gap: 9px; }
.card-head > svg.ico { width: 16px; height: 16px; }
.stack { gap: 10px; }
.mb-2 { margin-bottom: 12px !important; }

/* a person is one line high */
.linefold > summary { padding: 7px 4px; }
.linefold > summary .avatar, .linefold > summary .avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.linefold > summary .strong { font-size: var(--step-0); font-weight: 620; }
.linebody { padding: 2px 4px 10px; }
.mark { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; }

.btn { min-height: 34px; padding: 0 13px; font-size: var(--step--1); font-weight: 600; }
.btn-sm { min-height: 28px; padding: 0 10px; font-size: var(--step--1); }

/* desktop has tabs at the top; it does not also need a floating bar over
   the content it is meant to help with */
@media (min-width: 900px) {
  .quick-nav { display: none; }
  .main { padding-bottom: 36px; }
}

/* wide screens: two columns, so the page fills instead of trailing off */
@media (min-width: 1040px) {
  .split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; align-items: start; }
}


/* --- always-there sign out, and one rule for "this is clickable" -------- */
.signout-btn { color: var(--ink-2); }
.signout-btn:hover { color: var(--bad); border-color: var(--bad); }
.signout-word { font-weight: 600; }
@media (max-width: 640px) { .signout-word { display: none; } }

/* Rohit's rule: if it carries a fact, it opens something. Anything that
   responds to a click says so on hover rather than making people guess. */
[data-action], [data-jump], [data-shift], .linefold > summary,
.stat.linked, .tile, .chip-box, .chip-btn, .lnk { cursor: pointer; }
.stat.linked:hover { border-color: var(--accent); }
.stat.linked:hover .k { color: var(--accent); }
.lnk, a.plain { color: inherit; text-decoration: none; border-bottom: 1px dashed transparent; }
.lnk:hover, a.plain:hover { color: var(--accent); border-bottom-color: currentColor; text-decoration: none; }
dl.facts dd a { color: inherit; border-bottom: 1px dashed var(--line); text-decoration: none; }
dl.facts dd a:hover { color: var(--accent); border-bottom-color: currentColor; }
.linefold > summary .strong:hover { color: var(--accent); }


/* a dropdown that sits inside a line of facts, not in a form */
.select-inline { min-height: 28px; padding: 2px 26px 2px 8px; font-size: var(--step--1);
  font-weight: 600; width: auto; border-radius: var(--r-xs); background-position: right 6px center; }
.select-inline:hover { border-color: var(--accent); color: var(--accent); }

/* an editable value looks editable before you click it */
.ed { border-bottom: 1px dashed var(--line); cursor: text; }
.ed:hover { border-bottom-color: var(--accent); color: var(--accent); }
.ed[contenteditable="true"] { border-bottom-color: var(--accent); outline: none; color: var(--ink); }
.ed.saved { border-bottom-color: var(--ok); color: var(--ok); }
.ed-empty { color: var(--ink-3); font-style: italic; }


/* a day that was worked, but not for long enough to count whole */
.cal .day.half { background: var(--warn-soft); color: var(--warn); }
.cal .day.half::after { content: ""; position: absolute; inset: auto 6px 5px 6px; height: 2px;
  border-radius: 2px; background: currentColor; opacity: .5; }
.cal .day { position: relative; }


/* ---- _base look: display serif on the headline level only ------------ */
h1, .page-head h1, .auth-card h1, .brand-name, .sb-brand .nm {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.02em;
}


/* ================= sweep: mobile density, contrast, calendar ========== */
.grid.cols-3.tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tiles .stat { padding: 10px 11px; gap: 1px; }
.tiles .stat .k { font-size: var(--step--1); }
.tiles .stat .v { font-size: var(--step-1); }
.tiles .stat .meta { font-size: var(--step--1); opacity: .85; }
.tiles .meter { margin-top: 6px; height: 4px; }

.page-head input[type="month"] { width: auto; min-width: 0; padding: 7px 10px; font-size: var(--step--1); }

.cal { align-content: start; grid-auto-rows: minmax(0, auto); }
.cal .day { background: transparent; border: 1px solid var(--line-soft); color: var(--ink-3); }
.cal .day.present, .cal .day.absent, .cal .day.field,
.cal .day.leave, .cal .day.half { border-color: transparent; }
.cal .day.empty { border: 0; aspect-ratio: auto; min-height: 0; }

html, body { max-width: 100%; overflow-x: hidden; }
@media (max-width: 759px) {
  .table-wrap { overflow-x: auto; }
  .page-head { flex-wrap: wrap; row-gap: 8px; }
}

/* Notification bell in the top bar. */
.bell-btn { position: relative; }
.bell-btn .qbadge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-full); background: var(--bad); color: #fff;
  font-size: 10px; font-weight: 700; font-style: normal; line-height: 16px; text-align: center;
}

/* The gate's pick list: a name is a tap target, not a form field. */
.chip-box { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--r-full); background: var(--surface);
  font-size: var(--step--1); font-weight: 560; }
.chip-box:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.chip-box .badge { font-size: 10px; padding: 1px 5px; margin-left: 4px; }


/* ============ sweep 2: chips instead of menus, search, master shell ==== */
.chipset { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip-pick {
  font: inherit; font-size: var(--step--1); font-weight: 560; cursor: pointer;
  padding: 7px 13px; border-radius: var(--r-full);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.chip-pick:hover { border-color: var(--accent); color: var(--ink); }
.chip-pick.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

[data-marker] .chip-row { margin: 8px 0; }
[data-marker] .note-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.searchbox { position: relative; flex: 1; min-width: 120px; max-width: 320px; }
.searchbox input { width: 100%; }
.sr-out {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--sh-2); max-height: 60vh; overflow-y: auto; padding: 4px;
}
.sr-row { display: block; padding: 9px 11px; border-radius: var(--r-xs); text-decoration: none; color: inherit; }
.sr-row:hover { background: var(--surface-2); text-decoration: none; }
.sr-row .nm { display: block; font-weight: 580; }
.sr-row .sm { display: block; font-size: var(--step--1); }
@media (max-width: 559px) { .searchbox { max-width: none; order: 9; flex-basis: 100%; } }

.rail { display: none; }
@media (min-width: 1024px) {
  .has-rail { display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 22px; align-items: start; }
  .rail { display: block; position: sticky; top: 18px; }
  .rail a {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm);
    color: var(--ink-2); font-weight: 560; font-size: var(--step-0); text-decoration: none;
  }
  .rail a:hover { background: var(--surface-2); text-decoration: none; }
  .rail a.on { background: var(--accent-soft); color: var(--ink); }
  .rail .sep { height: 1px; background: var(--line-soft); margin: 8px 4px; }
}


/* Four tiles, one row - they only stack when a phone leaves no choice. */
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 899px) { .tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* ================== sweep 3: one row of tiles, tight top bar ========== */
.tiles, .tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tile { padding: 13px 12px 12px; }
.tile .cta, .tile .go { display: none; }
@media (max-width: 719px) {
  .tiles, .tiles.four { gap: 7px; }
  .tile { padding: 10px 9px; border-radius: 12px; }
  .tile .v { font-size: var(--step-1); }
  .tile .k { font-size: 11.5px; line-height: 1.25; }
  .tile .meta { font-size: 10.5px; line-height: 1.2; }
}
.grid.cols-2.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3.tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 719px) {
  .topbar { flex-wrap: nowrap; gap: 4px; padding-left: 8px; padding-right: 8px; }
  .topbar .brand .sub { display: none; }
  .topbar .brand .nm, .topbar .brand span:not(.avatar) { font-size: 14px; white-space: nowrap; }
  .topbar .home-word, .topbar .signout-word { display: none; }
  .topbar .btn { padding-left: 7px; padding-right: 7px; }
  .searchbox { flex: 0 0 100%; order: 10; margin-top: 6px; }
}

.page-head { gap: 8px; }
@media (max-width: 719px) {
  .page-head .btn { padding: 7px 10px; font-size: var(--step--1); }
  .page-head h1 { font-size: var(--step-2); }
}

/* A still picture of the site - no map library, no waiting. */
.map-still { position: relative; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line);
  background: var(--surface-2); aspect-ratio: 16 / 9; max-height: 220px; }
.map-still .pin { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px #fff, 0 1px 4px rgba(0,0,0,.4); }
.map-still .ring { position: absolute; left: 50%; top: 50%; border-radius: 50%;
  border: 2px solid var(--accent); background: color-mix(in oklab, var(--accent) 14%, transparent);
  transform: translate(-50%, -50%); }
.map-still .none { display: grid; place-items: center; height: 100%; color: var(--ink-3); font-size: var(--step--1); }

/* The invite dialog: one row per link, each with its own Copy. */
.invite-link { display: flex; gap: 10px; align-items: flex-start; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 10px; }
.invite-link > div { flex: 1; min-width: 0; }
.invite-link .sm { font-size: var(--step--1); }
.invite-link code { display: block; margin-top: 6px; font-family: var(--mono); font-size: 11.5px;
  color: var(--accent); word-break: break-all; line-height: 1.45; }

/* ---------------------------------------------------------- gate scan -- */
.scan-stage{position:relative;margin-top:14px;border-radius:var(--r-lg,16px);overflow:hidden;background:#0c0c0e;aspect-ratio:4/3;max-height:58vh}
.scan-stage video{width:100%;height:100%;object-fit:cover;display:block}
.scan-frame{position:absolute;inset:50% auto auto 50%;translate:-50% -50%;width:min(62%,260px);aspect-ratio:1;border:3px solid rgba(255,255,255,.9);border-radius:18px;box-shadow:0 0 0 100vmax rgba(0,0,0,.35);pointer-events:none}
.scan-note{position:absolute;left:0;right:0;bottom:0;padding:10px 14px;background:linear-gradient(transparent,rgba(0,0,0,.65));color:#fff;font-size:var(--step--1);text-align:center}

.scan-result{display:flex;flex-direction:column;gap:2px;margin-top:12px;padding:14px 16px;border-radius:var(--r-lg,16px);border:1px solid var(--line);background:var(--surface,#fff)}
.scan-result strong{font-size:var(--step-1)}
.scan-result span{font-size:var(--step--1);opacity:.75}
.scan-result.in{border-color:#16a34a;background:color-mix(in srgb,#16a34a 12%,transparent)}
.scan-result.out{border-color:#2563eb;background:color-mix(in srgb,#2563eb 12%,transparent)}
.scan-result.late{border-color:#d97706;background:color-mix(in srgb,#d97706 14%,transparent)}
.scan-result.bad{border-color:#dc2626;background:color-mix(in srgb,#dc2626 12%,transparent)}

.scan-log{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:6px}
.scan-log li{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:9px 12px;border:1px solid var(--line);border-radius:12px;min-width:0}
.scan-log li strong{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.scan-log li span{font-size:var(--step--1);opacity:.7;white-space:nowrap}
.scan-log li.in{border-left:4px solid #16a34a}
.scan-log li.out{border-left:4px solid #2563eb}
.scan-log li.late{border-left:4px solid #d97706}
.scan-log li.note{border-left:4px solid #7c3aed}

.scan-extras{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px;width:100%}
.scan-extras .chip-btn{font-size:var(--step--1);padding:7px 12px;min-height:38px}
.scan-extras .chip-btn[disabled]{opacity:.5}

/* -------------------------------------------------------- staff cards -- */
.card-sheet{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px;margin-top:20px}
.id-card{display:flex;align-items:center;gap:12px;padding:12px;border:1px dashed var(--line);border-radius:14px;background:#fff;break-inside:avoid}
.id-qr{flex:0 0 88px;width:88px;height:88px}
.id-qr svg{width:100%;height:100%;display:block}
.id-who{display:flex;flex-direction:column;gap:2px;min-width:0;color:#111}
.id-logo{width:22px;height:22px;border-radius:6px;object-fit:cover;margin-bottom:2px}
.id-name{font-size:15px;line-height:1.25;overflow:hidden;text-overflow:ellipsis}
.id-code{font-size:12px;opacity:.6}
.id-org{font-size:11px;opacity:.55;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

@media print{
  .noprint{display:none!important}
  body{background:#fff}
  .cards-page{padding:0;max-width:none}
  .card-sheet{grid-template-columns:repeat(2,1fr);gap:0;margin:0}
  .id-card{border-radius:0;page-break-inside:avoid}
}


/* --- Master organisation table: compact, one line per row -------------- */
@media (min-width: 760px) { #orgTable table.data { min-width: 780px; } }
#orgTable table.data th, #orgTable table.data td { padding: 8px 12px; }
#orgTable tbody td:first-child .who { border: 0; background: transparent; padding: 0; border-radius: 0; }
#orgTable .who { gap: 8px; align-items: center; }
#orgTable .who > div { min-width: 0; }
#orgTable .who .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
#orgTable .who .sm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
#orgTable td .badge { white-space: nowrap; }
#orgTable .nums, #orgTable td[data-label="Owner"] > div { white-space: nowrap; }
#orgTable .row-actions { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 6px; justify-content: flex-end; }
#orgTable .row-actions .btn { white-space: nowrap; }
#orgTable .avatar-sm { flex: 0 0 auto; }

/* Select-all bar above any multi-select list */
.selbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: var(--step--1); }
.selbar .cnt { color: var(--ink-3); }


/* Four cards stay in one row, on a phone too - they shrink, they never wrap. */
.tiles.one-row { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 8px; }
.tiles.one-row .stat { padding: 9px 9px; min-width: 0; }
.tiles.one-row .stat .k { font-size: .72rem; line-height: 1.15; }
.tiles.one-row .stat .v { font-size: var(--step-1); line-height: 1.1; }
.tiles.one-row .stat .meta { font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) {
  .tiles.one-row { gap: 6px; }
  .tiles.one-row .stat { padding: 7px 6px; border-radius: 10px; }
  .tiles.one-row .stat .k { font-size: .64rem; }
  .tiles.one-row .stat .v { font-size: var(--step-0); }
  .tiles.one-row .stat .meta { display: none; }
}

/* An empty card should be a line, not a hole. */
.card-pad .empty { padding: 14px 8px; }
.card-pad .empty h3 { margin: 6px 0 2px; font-size: var(--step-0); }
.card-pad .empty p { margin: 0; font-size: var(--step--1); }
.card-pad .empty .ic { width: 22px; height: 22px; }
#notmarked .card-pad { padding-top: 6px; padding-bottom: 6px; }
.split > .card { align-self: start; }


/* Fact cards size to their own content - no tall empty boxes on a phone. */
.facts { align-items: start; }
.facts dl > div, dl.facts > div { min-height: 0; align-self: start; }
@media (max-width: 560px) {
  .facts, dl.facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .facts dl > div, dl.facts > div { padding: 6px 8px; }
  .facts dd, dl.facts dd { font-size: var(--step--1); }
}

/* Picking people to mark, straight from the day list. */
#gateIn > .linefold > summary > input[type=checkbox] { width: 20px; height: 20px; flex: 0 0 auto; }
#gateIn .selbar { padding: 0 0 6px; }


/* The whole camera stage exists only while the camera is on. The stage
   itself carries the dark background, so hiding just the <video> still
   left a black rectangle sitting on the page. */
.scan-stage { display: none; }
body.scanning .scan-stage { display: block; }


/* --- update strip: a new version landed, the page refreshes itself ------ */
.update-strip { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 72px); transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 999px; border: 0; cursor: pointer;
  font: inherit; font-size: var(--step--1); color: #fff; background: var(--ink); box-shadow: var(--sh-2); max-width: calc(100vw - 24px); }
.update-strip .go { font-weight: 700; color: #7dd3fc; white-space: nowrap; }
.update-strip b { font-variant-numeric: tabular-nums; }
@media (min-width: 760px) { .update-strip { bottom: 20px; } }

/* --- plans dialog: one plan open at a time -------------------------------- */
.plan-tabs { flex-wrap: wrap; }
.plan-tabs .chip-add { border-style: dashed; }
.plan-panel { padding-top: 4px; }
.plan-del { margin-top: 6px; border-color: color-mix(in srgb, var(--bad, #c23b2e) 40%, transparent); }
.plan-del:has(input:checked) { background: var(--bad-soft, #fceceb); color: var(--bad, #c23b2e); border-color: var(--bad, #c23b2e); }

/* --- phone: action buttons wrap, nothing is cut off at the edge ----------- */
@media (max-width: 759px) {
  #orgTable .row-actions { flex-wrap: wrap; justify-content: flex-start; }
  #orgTable .row-actions .btn { flex: 1 1 45%; }
  .org-panel .acts { flex-wrap: wrap; }
  .org-panel .act { flex: 1 1 45%; justify-content: center; }
  .org-panel .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Register (paper look) ---- */
.register .reg-nav { gap: 4px; }
.register .reg-nav .chip-btn { min-width: 34px; justify-content: center; }
.reg-title { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 10px 16px; border-bottom: 2px solid var(--line); font-size: var(--step--1); }
.reg-title .muted { margin-right: 4px; }
table.reg-table { min-width: 0; font-size: var(--step--1); }
table.reg-table th, table.reg-table td { padding: 6px 10px; border-right: 1px solid var(--line-soft); }
table.reg-table th:last-child, table.reg-table td:last-child { border-right: 0; }
table.reg-table thead th { background: color-mix(in oklab, var(--brand, #2563eb) 10%, var(--card)); }
table.reg-table tbody tr { height: 34px; }
.reg-row.off td { background: color-mix(in oklab, var(--line-soft) 45%, var(--card)); color: var(--muted); }
.reg-row.abs td { background: color-mix(in oklab, #ef4444 8%, var(--card)); }
.reg-row.today td { background: color-mix(in oklab, var(--brand, #2563eb) 7%, var(--card)); }
.reg-mark { display: inline-block; min-width: 28px; text-align: center; font-weight: 700; font-family: var(--mono, ui-monospace, monospace); }
.reg-mark.m-p, .reg-mark.m-od { color: #15803d; }
.reg-mark.m-hd { color: #b45309; }
.reg-mark.m-a { color: #b91c1c; }
.reg-mark.m-l, .reg-mark.m-cl, .reg-mark.m-sl, .reg-mark.m-el { color: #7c3aed; }
.reg-mark.m-wo, .reg-mark.m-h { color: var(--muted); font-weight: 600; }
.reg-remark { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reg-tot { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--step--1); border-top: 2px solid var(--line); }
.reg-tot strong { margin-left: 4px; }
@media (max-width: 759px) {
  table.reg-table th, table.reg-table td { padding: 6px 6px; }
  .reg-remark { max-width: 90px; }
  .register .card-head { flex-wrap: wrap; gap: 8px; }
}
@media print {
  body * { visibility: hidden; }
  .register, .register * { visibility: visible; }
  .register { position: absolute; left: 0; top: 0; width: 100%; border: 0; }
  .register .reg-nav, .register .btn { display: none !important; }
  table.reg-table th, table.reg-table td { border: 1px solid #999; padding: 4px 8px; }
  .reg-row.off td, .reg-row.abs td, .reg-row.today td { background: #f2f2f2 !important; }
}

/* 360 px sweep (26 Sep): nothing wider than the phone. */
@media (max-width: 639px) {
  main .row { flex-wrap: wrap; }
  .btn, .lnk { max-width: 100%; white-space: normal; }
  .month-strip { flex-wrap: wrap; overflow: visible; row-gap: 6px; }
  .ms { flex: 0 0 calc((100% - 45px) / 16); min-width: 0; }
  table.data.hist { table-layout: fixed; width: 100%; }
  table.data.hist { min-width: 0 !important; }
  main .stack, main .card { min-width: 0; max-width: 100%; }
  main .grid > *, main .stack > * { min-width: 0; }
  table.data.hist th, table.data.hist td { padding-left: 6px; padding-right: 6px; font-size: var(--step--1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.data.hist .hist-st { display: block; margin-top: 2px; }
}
@media (min-width: 640px) { table.data.hist .hist-st { display: none; } }
.per-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.type-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.type-chips label { cursor: pointer; }
.type-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.type-chips input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.type-chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }

/* Footer: which build is running and when it went live. */
.app-foot { text-align: center; font-size: 12px; color: var(--ink-3); padding: 14px 16px 96px; }
@media (min-width: 900px) { .app-foot { padding-bottom: 20px; } }

/* ===== Space / font / button sweep (9 Oct): one size system, desktop left menu ===== */
body { font-size: 14px; }
h1, .page-head h1 { font-size: 20px; line-height: 1.25; }
.card-head h3, .card h3 { font-size: 16px; }
.btn { min-height: 44px; font-size: 14px; }
.btn.btn-sm { min-height: 40px; font-size: 14px; }
.chip-pick, .chip-btn { min-height: 36px; }
@media (max-width: 759px) { .main { padding-left: 16px; padding-right: 16px; } }
@media (min-width: 1000px) {
  .main { max-width: 1100px; }
  /* Sections become a left menu; the page sits beside it. */
  .main:has(> nav.tabs) { display: grid; grid-template-columns: 190px minmax(0, 1fr); column-gap: 28px; align-items: start; }
  .main:has(> nav.tabs) > * { grid-column: 2; }
  .main:has(> nav.tabs) > nav.tabs { grid-column: 1; grid-row: 1 / span 40; position: sticky; top: 76px;
    flex-direction: column; border-bottom: 0; border-right: 1px solid var(--line); padding-right: 12px; overflow: visible; margin: 0; }
  .main:has(> nav.tabs) > nav.tabs a { border-bottom: 0; border-left: 3px solid transparent; border-radius: 0 8px 8px 0;
    padding: 11px 14px; font-size: 14px; min-height: 44px; display: flex; align-items: center; }
  .main:has(> nav.tabs) > nav.tabs a.on { border-left-color: var(--accent); background: var(--accent-soft); }
  /* Check-in: one centred card, not a stretched page. */
  .checkin-hero { max-width: 560px; margin-inline: auto; }
}

/* Where a check-in happened: a name and a map link, never numbers. */
.place-line { font-size: 12px; line-height: 1.3; margin-top: 2px; white-space: normal; }
.place-line .place-map { font-weight: 600; white-space: nowrap; }
@media print { .place-map { display: none; } }
