/* ==========================================================================
   Castle Host HR Platform
   Industry-inspired, simplified. Hand written, no build step, no framework.
   Everything is driven by the tokens in :root — change them here, nowhere else.
   ========================================================================== */

:root {
  /* --- colour: one steel-blue accent, no decorative colour anywhere else --- */
  --accent:        #2f6690;
  --accent-deep:   #24506f;
  --accent-lift:   #3b7cad;
  --accent-wash:   #eef3f7;
  --accent-line:   #b9cddc;

  --ground:        #f1f3f5;
  --surface:       #ffffff;
  --surface-2:     #fafbfc;

  --ink:           #11161b;
  --ink-2:         #48535c;
  --ink-3:         #7b868e;
  --ink-4:         #a4adb4;

  --line:          #d5dbe0;
  --line-soft:     #e6eaed;

  /* --- type --- */
  --font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

  /* --- space (4px base) --- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  --sidebar: 220px;
  --header: 64px;
}

/* ==========================================================================
   reset
   ========================================================================== */

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

html, body { margin: 0; padding: 0; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
  line-height: 1.15;
}

h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }

p { margin: 0 0 var(--s3); }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); text-decoration: underline; }

img { max-width: 100%; display: block; }

/* numerals line up in every table and metric */
table, .num, .metric-value, input, .tabular { font-variant-numeric: tabular-nums; }

/* themed states, never browser defaults */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
::selection { background: var(--accent-line); color: var(--ink); }

/* ==========================================================================
   primitives
   ========================================================================== */

.kicker {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.muted    { color: var(--ink-2); }
.dim      { color: var(--ink-3); }
.tiny     { font-size: 12px; }
.small    { font-size: 13px; }
.strong   { font-weight: 600; }
.mono     { font-family: var(--font-mono); font-size: 12px; }
.nowrap   { white-space: nowrap; }
.right    { text-align: right; }
.center   { text-align: center; }

.rule { height: 1px; background: var(--line); border: 0; margin: var(--s5) 0; }

.stack   > * + * { margin-top: var(--s3); }
.stack-s > * + * { margin-top: var(--s2); }
.stack-l > * + * { margin-top: var(--s5); }

.row { display: flex; align-items: center; gap: var(--s3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }
.row-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* hatching — the visual language for weekly offs and empty states.
   Never red, never an empty cell. */
.hatch {
  background-image: repeating-linear-gradient(
    135deg,
    var(--line-soft) 0px, var(--line-soft) 1px,
    transparent 1px, transparent 6px
  );
}
.hatch-accent {
  background-image: repeating-linear-gradient(
    135deg,
    var(--accent-line) 0px, var(--accent-line) 1px,
    transparent 1px, transparent 6px
  );
}

/* ==========================================================================
   card / figure
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: var(--s4) var(--s5) var(--s5);
  position: relative;
}
.card-flush { padding: 0; }
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s2) var(--s4); margin-bottom: var(--s4); flex-wrap: wrap;
}
.card-head .kicker { margin-bottom: 2px; }
.card-title { font-family: var(--font-head); font-size: 17px; font-weight: 600; }
.card-meta { font-size: 12px; color: var(--ink-3); }

/* figure — a card that carries two registration marks.
   The restrained descendant of the blueprint corner set. */
.fig { position: relative; }
.fig::before, .fig::after {
  content: ""; position: absolute; width: 7px; height: 7px;
  border: 1px solid var(--accent); pointer-events: none;
}
.fig::before { top: -1px;    left: -1px;  border-right: 0; border-bottom: 0; }
.fig::after  { bottom: -1px; right: -1px; border-left: 0;  border-top: 0; }

/* ==========================================================================
   metric
   ========================================================================== */

.metrics { display: grid; gap: var(--s3); grid-template-columns: repeat(4, 1fr); }
.metrics-5 { grid-template-columns: repeat(5, 1fr); }
.metrics-3 { grid-template-columns: repeat(3, 1fr); }

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: var(--s4);
  position: relative;
}
.metric .kicker { display: block; margin-bottom: var(--s2); }
.metric-value {
  font-family: var(--font-head);
  font-size: 30px; font-weight: 600; line-height: 1;
  color: var(--ink);
}
.metric-value .of { color: var(--ink-4); font-size: 20px; }
.metric-sub { font-size: 12px; color: var(--ink-3); margin-top: var(--s2); }

/* ==========================================================================
   tag
   ========================================================================== */

.tag {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 7px 1px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: var(--surface-2);
  white-space: nowrap;
  vertical-align: middle;
}
.tag-accent  { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag-outline { background: transparent; border-color: var(--accent); color: var(--accent); }
.tag-neutral { background: var(--surface-2); border-color: var(--line); color: var(--ink-3); }
.tag-hatch   { background-image: repeating-linear-gradient(135deg, var(--line) 0 1px, transparent 1px 5px); color: var(--ink-3); }

/* ==========================================================================
   button
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  font-family: var(--font-head);
  font-size: 14px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0 var(--s4); height: 36px;
  border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn:active { background: var(--accent-wash); }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-lift); border-color: var(--accent-lift); color: #fff; }
.btn-primary:active { background: var(--accent-deep); border-color: var(--accent-deep); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--line); color: var(--accent); }

.btn-sm { height: 28px; font-size: 12px; padding: 0 var(--s3); }
.btn-block { width: 100%; }

.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.btn-group { display: inline-flex; gap: var(--s2); }

/* ==========================================================================
   form
   ========================================================================== */

.field { display: block; margin-bottom: var(--s4); }
.field > .label {
  display: block;
  font-family: var(--font-head);
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: var(--s2);
}
.field > .hint { font-size: 12px; color: var(--ink-3); margin-top: var(--s1); }

.input, select.input, textarea.input {
  width: 100%; height: 38px;
  padding: 0 var(--s3);
  font-family: var(--font-body); font-size: 14px; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  appearance: none;
}
textarea.input { height: auto; min-height: 84px; padding: var(--s2) var(--s3); line-height: 1.5; resize: vertical; }
select.input {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: var(--s6);
}
.input:hover { border-color: var(--ink-4); }
.input:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
.input[readonly], .input[disabled] { background: var(--surface-2); color: var(--ink-3); }
.input::placeholder { color: var(--ink-4); }

.field-row { display: grid; gap: var(--s3); grid-template-columns: 1fr 1fr; }
.field-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--line); background: var(--surface); }
.seg-opt {
  font-family: var(--font-head); font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0 var(--s3); height: 30px; display: inline-flex; align-items: center;
  border-right: 1px solid var(--line); background: transparent; color: var(--ink-2);
  cursor: pointer; text-decoration: none;
}
.seg-opt:last-child { border-right: 0; }
.seg-opt:hover { color: var(--accent); text-decoration: none; }
.seg-opt.is-on { background: var(--accent); color: #fff; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }

/* switch — used heavily by the feature matrix */
.sw { display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; user-select: none; }
.sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw .track {
  width: 34px; height: 18px; border: 1px solid var(--line); background: var(--surface-2);
  position: relative; transition: background .12s, border-color .12s; flex: none;
}
.sw .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; background: var(--ink-4);
  transition: transform .12s, background .12s;
}
.sw input:checked + .track { background: var(--accent-wash); border-color: var(--accent); }
.sw input:checked + .track::after { transform: translateX(16px); background: var(--accent); }
.sw input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw .sw-label { font-size: 13px; color: var(--ink-2); }

/* ==========================================================================
   table
   ========================================================================== */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
.table-wrap .table { border: 0; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 14px; }
.table th {
  font-family: var(--font-head);
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3); text-align: left;
  padding: var(--s3) var(--s3);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
.table td {
  padding: var(--s3);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--accent-wash); }
.table .right, .table th.right { text-align: right; }
.table .cell-actions { text-align: right; white-space: nowrap; }
.table .cell-strong { font-weight: 600; }
.table-empty td { color: var(--ink-3); padding: var(--s6); text-align: center; }
.table-empty tr:hover { background: transparent; }

/* ==========================================================================
   shell — sidebar + header
   ========================================================================== */

.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  padding: var(--s4) var(--s4) var(--s4);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--s3);
}
.sidebar-brand .mark {
  width: 30px; height: 30px; flex: none;
  border: 1px solid var(--accent); color: var(--accent);
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
}
.sidebar-brand .name { font-family: var(--font-head); font-weight: 600; font-size: 16px; line-height: 1.1; }
.sidebar-brand .sub { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }

/* menu toggle — inert on desktop, where the sidebar is always open.
   Kept in the accessibility tree but off-screen so keyboard focus still works. */
.nav-toggle { position: absolute; opacity: 0; width: 0; height: 0; }
.nav-toggle-label { display: none; }

.nav { padding: var(--s3) 0; flex: 1; overflow-y: auto; }
.nav-group { padding: var(--s3) var(--s4) var(--s2); }
.nav a {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s2) var(--s4);
  color: var(--ink-2); font-size: 14px;
  border-left: 2px solid transparent;
  text-decoration: none;
}
.nav a:hover { background: var(--surface-2); color: var(--accent); text-decoration: none; }
.nav a.is-on {
  background: var(--accent-wash); color: var(--accent);
  border-left-color: var(--accent); font-weight: 600;
}
.nav a .ico { width: 16px; height: 16px; flex: none; opacity: .8; }
.nav a .pill {
  margin-left: auto; font-size: 11px; font-family: var(--font-head); font-weight: 600;
  background: var(--accent); color: #fff; padding: 0 5px; line-height: 16px;
}
.nav-sep { height: 1px; background: var(--line); margin: var(--s3) var(--s4); }

.sidebar-foot { border-top: 1px solid var(--line); padding: var(--s3) var(--s4); }
.sync {
  display: flex; align-items: center; gap: var(--s2);
  font-size: 12px; color: var(--ink-3); margin-bottom: var(--s2);
}
.sync .dot { width: 6px; height: 6px; background: var(--accent); flex: none; }
.sync .dot.off { background: var(--ink-4); }

.main { min-width: 0; display: flex; flex-direction: column; }

.header {
  height: var(--header);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s5);
  position: sticky; top: 0; z-index: 20;
}
.header .title-block { min-width: 0; }
.header h1 { font-size: 21px; line-height: 1.1; }
.clocks { display: flex; gap: var(--s4); }
.clock { text-align: right; }
.clock .kicker { display: block; font-size: 10px; }
.clock .t { font-family: var(--font-head); font-size: 16px; font-weight: 600; line-height: 1.1; }

.chip {
  display: flex; align-items: center; gap: var(--s2);
  border: 1px solid var(--line); padding: var(--s1) var(--s3) var(--s1) var(--s1);
}
.chip .mono-mark {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-head); font-size: 12px; font-weight: 600;
  color: var(--accent); border: 1px solid var(--accent-line);
}
.chip .who { font-size: 13px; font-weight: 600; line-height: 1.1; }
.chip .role { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }

.page { padding: var(--s5); flex: 1; }
.page-head { margin-bottom: var(--s5); }
.page-note {
  font-size: 13px; color: var(--ink-2);
  border-left: 2px solid var(--accent-line); padding-left: var(--s3); margin-top: var(--s2);
}

/* ==========================================================================
   grid helpers
   ========================================================================== */

.grid { display: grid; gap: var(--s4); }
.grid-2  { grid-template-columns: 1fr 1fr; }
.grid-3  { grid-template-columns: repeat(3, 1fr); }
.grid-2a { grid-template-columns: 2fr 1fr; }
.grid-1a { grid-template-columns: 1fr 2fr; }

/* ==========================================================================
   week strip — S1 / S2 blocks
   ========================================================================== */

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s2); }
.week-day { border: 1px solid var(--line-soft); }
.week-day .d {
  padding: var(--s2); text-align: center; border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
}
.week-day .d .dow { font-family: var(--font-head); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.week-day .d .dd  { font-family: var(--font-head); font-size: 17px; font-weight: 600; }
.week-day.is-today .d { background: var(--accent-wash); }
.week-day.is-today .d .dd { color: var(--accent); }
.week-slots { padding: var(--s2); display: grid; gap: var(--s1); }
.slot {
  border: 1px solid var(--line); padding: 3px var(--s2);
  font-size: 11px; font-family: var(--font-head); font-weight: 600; letter-spacing: .06em;
  color: var(--ink-3); text-align: center;
}
.slot-logged   { border-color: var(--accent); color: var(--accent); }
.slot-running  { border-color: var(--accent); background: var(--accent); color: #fff; }
.slot-scheduled{ border-style: dashed; }
.slot-leave    { border-color: var(--accent-line); background: var(--accent-wash); color: var(--accent-deep); }
.slot-missed   { border-color: var(--line); color: var(--ink-4); text-decoration: line-through; }
.week-day.is-off .week-slots {
  background-image: repeating-linear-gradient(135deg, var(--line-soft) 0 1px, transparent 1px 6px);
  min-height: 58px; display: grid; place-items: center;
}
.week-day.is-off .off-label {
  font-family: var(--font-head); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
}

/* ==========================================================================
   bar chart — pure CSS, no library
   ========================================================================== */

.chart { position: relative; padding-top: var(--s4); }
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; position: relative; }
.chart-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.chart-bar .fill { background: var(--accent); width: 100%; min-height: 1px; }
.chart-bar.is-off .fill {
  background: transparent;
  background-image: repeating-linear-gradient(135deg, var(--line) 0 1px, transparent 1px 5px);
  border: 1px solid var(--line-soft); border-bottom: 0;
}
.chart-bar.is-under .fill { background: var(--accent-line); }
.chart-rule {
  position: absolute; left: 0; right: 0; border-top: 1px dashed var(--accent-line);
  font-size: 10px; color: var(--ink-3);
}
.chart-rule span {
  position: absolute; right: 0; top: -14px; background: var(--surface); padding-left: var(--s2);
  font-family: var(--font-head); letter-spacing: .1em; text-transform: uppercase;
}
.chart-axis { display: flex; gap: 3px; margin-top: var(--s2); }
.chart-axis span { flex: 1; text-align: center; font-size: 10px; color: var(--ink-4); }

/* progress bar for leave balances */
.bar { height: 4px; background: var(--line-soft); margin: var(--s2) 0; }
.bar > i { display: block; height: 100%; background: var(--accent); }

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

.signin {
  min-height: 100vh; display: grid; place-items: center; padding: var(--s5);
  background: var(--ground);
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 32px 32px;
}
.signin-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); padding: var(--s6) var(--s5) var(--s5); }
.signin-card .mark {
  width: 44px; height: 44px; border: 1px solid var(--accent); color: var(--accent);
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 600; font-size: 20px;
  margin-bottom: var(--s4);
}
.divider { display: flex; align-items: center; gap: var(--s3); margin: var(--s4) 0; color: var(--ink-4); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.btn-slack { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-slack:hover { border-color: var(--accent); }
.btn-slack svg { width: 16px; height: 16px; }

/* ==========================================================================
   feature matrix
   ========================================================================== */

.matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.matrix th, .matrix td { border: 1px solid var(--line-soft); padding: var(--s2) var(--s1); }
.matrix thead th {
  background: var(--surface-2); font-family: var(--font-head); font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
  writing-mode: vertical-rl; text-orientation: mixed; height: 132px; padding: var(--s2) var(--s1);
  white-space: nowrap;
}
.matrix thead th.who-col {
  writing-mode: horizontal-tb; height: auto; text-align: left;
  min-width: 180px; padding: var(--s2) var(--s3);
  position: sticky; left: 0; z-index: 2;
}
.matrix tbody th { position: sticky; left: 0; z-index: 1; }
.matrix tbody th { text-align: left; font-weight: 600; background: var(--surface); }
.matrix td { text-align: center; }
.matrix td.is-locked { background-image: repeating-linear-gradient(135deg, var(--line-soft) 0 1px, transparent 1px 6px); }

.feat-row { display: grid; grid-template-columns: 1fr auto; gap: var(--s4); align-items: start;
  padding: var(--s3) 0; border-bottom: 1px solid var(--line-soft); }
.feat-row:last-child { border-bottom: 0; }
.feat-row .fname { font-weight: 600; }
.feat-row .fdesc { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.tri { display: inline-flex; border: 1px solid var(--line); }
.tri label {
  font-family: var(--font-head); font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 3px var(--s3); cursor: pointer; color: var(--ink-3);
  border-right: 1px solid var(--line); background: var(--surface);
}
.tri label:last-child { border-right: 0; }
.tri input { position: absolute; opacity: 0; width: 0; height: 0; }
.tri input:checked + label { background: var(--accent); color: #fff; }
.tri input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ==========================================================================
   dialog
   ========================================================================== */

.dialog-backdrop {
  position: fixed; inset: 0; background: rgba(17, 22, 27, .45);
  display: grid; place-items: center; padding: var(--s5); z-index: 100;
}
.dialog {
  background: var(--surface); border: 1px solid var(--line);
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
}
.dialog-head { padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.dialog-body { padding: var(--s5); }
.dialog-foot {
  padding: var(--s4) var(--s5); border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: var(--s2); background: var(--surface-2);
}
.dialog-wide { max-width: 780px; }

/* ==========================================================================
   flash + callout
   ========================================================================== */

.flash {
  border: 1px solid var(--accent); border-left-width: 3px;
  background: var(--accent-wash); padding: var(--s3) var(--s4);
  margin-bottom: var(--s4); font-size: 13px;
}
.flash-warn { border-color: var(--ink-3); background: var(--surface-2); }

.callout {
  border: 1px solid var(--line); background: var(--surface-2);
  padding: var(--s3) var(--s4); font-size: 13px; color: var(--ink-2);
}
.callout .kicker { display: block; margin-bottom: var(--s1); }

/* definition list used across the profile */
.dl { display: grid; grid-template-columns: 160px 1fr; gap: var(--s2) var(--s4); font-size: 14px; }
.dl dt {
  font-family: var(--font-head); font-size: 11px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
  padding-top: 3px;
}
.dl dd { margin: 0; }
.dl dd.empty { color: var(--ink-4); }

/* tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: var(--s5); }
.tabs a {
  font-family: var(--font-head); font-size: 14px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  padding: var(--s3) var(--s4); color: var(--ink-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none;
}
.tabs a:hover { color: var(--accent); text-decoration: none; }
.tabs a.is-on { color: var(--accent); border-bottom-color: var(--accent); }

/* timeline */
.timeline { position: relative; padding-left: var(--s5); }
.timeline::before { content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: var(--s4); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: calc(-1 * var(--s5) + 1px); top: 5px;
  width: 7px; height: 7px; border: 1px solid var(--accent); background: var(--surface);
}
.timeline-item .when { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-family: var(--font-head); }

/* pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-top: var(--s4); }
.pager .pages { display: flex; gap: var(--s1); }
.pager .pages a, .pager .pages span {
  min-width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); text-decoration: none;
}
.pager .pages a:hover { border-color: var(--accent); color: var(--accent); }
.pager .pages .is-on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* filter bar */
.filters { display: flex; gap: var(--s2); align-items: flex-end; flex-wrap: wrap; margin-bottom: var(--s4); }
.filters .field { margin-bottom: 0; }
.filters .input { height: 34px; }

/* ==========================================================================
   responsive
   ========================================================================== */

@media (max-width: 1100px) {
  .metrics, .metrics-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .grid-2a, .grid-1a { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }

  /* The sidebar becomes a collapsed top bar. Content starts at the top of the
     screen instead of a screenful of navigation. Pure CSS — no JavaScript. */
  .sidebar {
    position: sticky; top: 0; z-index: 30; height: auto;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .sidebar-brand { border-bottom: 0; position: relative; }

  .nav-toggle-label {
    display: grid; align-content: center; gap: 4px;
    position: absolute; right: var(--s3); top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; padding: 0 10px;
    border: 1px solid var(--line); cursor: pointer; background: var(--surface);
  }
  .nav-toggle-label span { display: block; height: 1px; background: var(--ink-2); }
  .nav-toggle:focus-visible ~ .sidebar-brand .nav-toggle-label { outline: 2px solid var(--accent); outline-offset: 2px; }
  .nav-toggle:checked ~ .sidebar-brand .nav-toggle-label { border-color: var(--accent); }
  .nav-toggle:checked ~ .sidebar-brand .nav-toggle-label span { background: var(--accent); }

  .nav, .sidebar-foot { display: none; }
  .nav-toggle:checked ~ .nav { display: grid; }
  .nav-toggle:checked ~ .sidebar-foot { display: block; }

  .nav {
    grid-template-columns: 1fr 1fr; padding: var(--s2);
    border-top: 1px solid var(--line); max-height: 70vh; overflow-y: auto;
  }
  .nav a { border-left: 0; border-bottom: 1px solid transparent; }
  .nav a.is-on { border-left: 0; border-bottom-color: var(--accent); }
  .nav-sep, .nav-group { grid-column: 1 / -1; }

  .header { height: auto; flex-wrap: wrap; padding: var(--s3) var(--s4); gap: var(--s3); position: static; }
  .page { padding: var(--s4); }
  .dl { grid-template-columns: 1fr; gap: var(--s1) 0; }
  .dl dd { margin-bottom: var(--s3); }
  .week { grid-template-columns: repeat(2, 1fr); }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .btn, .nav a, .tabs a { min-height: 44px; }
  .btn-sm { min-height: 36px; }
}

@media (max-width: 560px) {
  .metrics, .metrics-5 { grid-template-columns: 1fr; }
  .clocks { gap: var(--s3); }
  h1 { font-size: 24px; }
}

/* ==========================================================================
   print
   ========================================================================== */

@media print {
  .sidebar, .header, .btn, .filters, .pager { display: none !important; }
  body { background: #fff; }
  .card, .metric, .table-wrap { border-color: #999; }
  .page { padding: 0; }
}
