/* ==========================================================================
   Design system
   One typeface (IBM Plex Sans), one accent (configurable via /brand.css),
   neutral surfaces, and color reserved for status and exceptions.
   ========================================================================== */

@font-face { font-family: "Plex"; src: url("../fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/IBMPlexSans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --accent: #1F5F4E;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3EEEA;

  --paper: #F6F7F4;
  --surface: #FFFFFF;
  --sunken: #EEF0EC;
  --ink: #18201C;
  --ink-2: #3B4440;
  --muted: #5B655F;
  --faint: #8A938E;
  --line: #DDE2DC;
  --line-strong: #C7CEC8;

  --danger: #B42318;   --danger-soft: #FCEBE9;
  --warning: #A15C07;  --warning-soft: #FDF1DE;
  --info: #2E5AAC;     --info-soft: #E8EEF9;
  --success: #1E7A46;  --success-soft: #E5F3EA;

  --font: "Plex", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 0.8125rem;  /* 13 */
  --fs-sm: 0.875rem;   /* 14 */
  --fs-md: 0.9375rem;  /* 15 body */
  --fs-lg: 1.0625rem;  /* 17 */
  --fs-xl: 1.3125rem;  /* 21 */
  --fs-2xl: 1.75rem;   /* 28 */

  --r-sm: 6px;
  --r-md: 10px;
  --shadow-pop: 0 1px 2px rgba(24, 32, 28, .06), 0 8px 24px rgba(24, 32, 28, .10);
  --sidebar: 248px;
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-md); line-height: 1.55;
  color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-2xl); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
code { font-size: .9em; background: var(--sunken); padding: .1em .35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -3rem; background: var(--surface); padding: .5rem .75rem; border-radius: var(--r-sm); z-index: 100; }
.skip-link:focus { top: 1rem; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 40px; padding: .5rem 1rem; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 500 var(--fs-sm)/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .12s, border-color .12s;
}
.btn:hover { background: var(--sunken); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunken); }
.btn-sm { min-height: 32px; padding: .3rem .65rem; font-size: var(--fs-xs); }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* -------------------------------------------------------------------- forms */
.field { margin-bottom: 1.1rem; }
.field > label, .label { display: block; font-weight: 500; font-size: var(--fs-sm); margin-bottom: .35rem; color: var(--ink-2); }
.hint { font-size: var(--fs-xs); color: var(--muted); margin: .3rem 0 0; }
.input, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: .55rem .75rem; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: 400 var(--fs-md)/1.4 var(--font);
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[readonly] { background: var(--sunken); color: var(--muted); }
.field-error { color: var(--danger); font-size: var(--fs-xs); margin: .35rem 0 0; font-weight: 500; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-size: var(--fs-sm); }
.check input { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--accent); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 36px; padding: .35rem .8rem; border: 1px solid var(--line-strong); border-radius: 999px; font-size: var(--fs-sm); cursor: pointer; user-select: none; }
.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }
.chip input:focus-visible + span { box-shadow: var(--focus); }
.form-row { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row.two { grid-template-columns: 1fr 1fr; } }
.form-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.inline-form { display: inline; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 4.5rem; }
.password-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); }

/* ------------------------------------------------------------------- alerts */
.flash-stack { display: grid; gap: .5rem; margin-bottom: 1.25rem; }
.alert { display: flex; gap: .65rem; align-items: flex-start; padding: .75rem .9rem; border-radius: var(--r-sm); border: 1px solid; font-size: var(--fs-sm); }
.alert p { margin: 0; }
.alert .icon { margin-top: .1rem; }
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); color: #144d2d; }
.alert-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); color: #7a1a12; }
.alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: #1f3d75; }
.alert-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); color: #6b3d05; }
.alert .dismiss { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; padding: 0 .2rem; opacity: .7; }

/* ------------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem; border-radius: 999px; font-size: var(--fs-xs); font-weight: 500; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }

/* ------------------------------------------------------------------ avatars */
.avatar { --h: 160; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  font-size: .75rem; font-weight: 600; color: hsl(var(--h) 45% 26%); background: hsl(var(--h) 40% 88%); }
.avatar.lg { width: 44px; height: 44px; font-size: .95rem; }
.avatar.sm { width: 26px; height: 26px; font-size: .65rem; }
.avatar[data-hue="0"]{--h:0}.avatar[data-hue="30"]{--h:30}.avatar[data-hue="60"]{--h:60}.avatar[data-hue="90"]{--h:90}
.avatar[data-hue="120"]{--h:120}.avatar[data-hue="150"]{--h:150}.avatar[data-hue="180"]{--h:180}.avatar[data-hue="210"]{--h:210}
.avatar[data-hue="240"]{--h:240}.avatar[data-hue="270"]{--h:270}.avatar[data-hue="300"]{--h:300}.avatar[data-hue="330"]{--h:330}

/* =================================================================== layout */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40;
}
.sidebar-head { padding: 1rem .9rem .75rem; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 600; font-size: var(--fs-lg); color: var(--ink); text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-size: .8rem; font-weight: 600; }
.brand img { height: 28px; width: auto; }
.org-switch { margin-top: .75rem; position: relative; }
.org-switch summary { list-style: none; display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font-weight: 500; font-size: var(--fs-sm); }
.org-switch summary::-webkit-details-marker { display: none; }
.org-switch summary .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-switch[open] summary { border-color: var(--line-strong); }
.menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: .35rem; z-index: 50; }
.menu-label { font-size: var(--fs-xs); color: var(--muted); padding: .35rem .55rem .2rem; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: .5rem; padding: .5rem .55rem; border: 0; background: none; border-radius: var(--r-sm); font: 400 var(--fs-sm)/1.3 var(--font); color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; }
.menu button:hover, .menu a:hover { background: var(--sunken); }
.menu .current { font-weight: 600; }
.menu hr { margin: .35rem 0; }
.nav { padding: .75rem .6rem; display: grid; gap: 2px; flex: 1; overflow-y: auto; align-content: start; }
.nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .65rem; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: var(--fs-sm); }
.nav a:hover { background: var(--sunken); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav-section { font-size: var(--fs-xs); color: var(--faint); padding: 1rem .65rem .3rem; }
.sidebar-foot { border-top: 1px solid var(--line); padding: .7rem .9rem; display: flex; align-items: center; gap: .6rem; }
.sidebar-foot .who { flex: 1; min-width: 0; font-size: var(--fs-sm); line-height: 1.3; }
.sidebar-foot .who strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .who span { color: var(--muted); font-size: var(--fs-xs); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { display: none; }
.page { max-width: 1040px; margin: 0 auto; padding: 2rem 2rem 4rem; }
.page.narrow { max-width: 720px; }
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.75rem; }
.page-head p { margin: .35rem 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.crumb { font-size: var(--fs-sm); color: var(--muted); margin-bottom: .4rem; display: inline-flex; gap: .35rem; align-items: center; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }
.scrim { display: none; }

@media (max-width: 899px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-pop); width: min(86vw, 300px); }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(24, 32, 28, .35); z-index: 30; }
  .main { margin-left: 0; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; gap: .5rem; height: 56px; padding: 0 .6rem; background: var(--surface); border-bottom: 1px solid var(--line); }
  .topbar .title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page { padding: 1.25rem 1rem 3rem; }
  h1 { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* =========================================================== content blocks */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.panel + .panel, .panel + .section, .section + .section { margin-top: 1.5rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head p { margin: .15rem 0 0; color: var(--muted); font-size: var(--fs-sm); }
.panel-body { padding: 1.15rem; }
.panel-foot { padding: .8rem 1.15rem; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--sunken) 50%, var(--surface)); border-radius: 0 0 var(--r-md) var(--r-md); }
.section-title { font-size: var(--fs-lg); margin-bottom: .75rem; display: flex; align-items: baseline; gap: .5rem; }
.section-title .count { color: var(--muted); font-weight: 400; font-size: var(--fs-sm); }
.grid { display: grid; gap: 1rem; }
@media (min-width: 720px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

/* Lists of people / records: rows on desktop, stacked on phones */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: .85rem; padding: .8rem 1.15rem; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.row .sub { font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.row .meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.row-link { color: inherit; text-decoration: none; }
.row-link:hover .title { color: var(--accent); text-decoration: underline; }
@media (max-width: 639px) {
  .row { flex-wrap: wrap; padding: .8rem 1rem; }
  .row .meta { width: 100%; justify-content: flex-start; padding-left: calc(32px + .85rem); }
}

/* Workspace cards */
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { display: flex; flex-direction: column; gap: .6rem; padding: 1.1rem 1.15rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: inherit; text-decoration: none; transition: border-color .12s; }
a.card:hover { border-color: var(--line-strong); }
a.card:hover h3 { color: var(--accent); }
.card p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }
.card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: var(--fs-xs); color: var(--muted); }
.facepile { display: flex; }
.facepile .avatar { border: 2px solid var(--surface); margin-left: -6px; }
.facepile .avatar:first-child { margin-left: 0; }

/* Capacity meter: text first, bar as a supplement */
.meter { display: grid; gap: .3rem; font-size: var(--fs-xs); color: var(--muted); }
.meter-bar { height: 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.meter.full .meter-bar span { background: var(--danger); }
.meter.near .meter-bar span { background: var(--warning); }
.w-0{width:0}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-25{width:25%}.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}.w-50{width:50%}
.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-75{width:75%}.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}.w-100{width:100%}

/* Tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: .65rem .8rem; color: var(--muted); text-decoration: none; font-weight: 500; font-size: var(--fs-sm); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .badge { margin-left: .3rem; }

/* Empty states: an invitation to act */
.empty { text-align: center; padding: 2.5rem 1.25rem; }
.empty .icon { width: 28px; height: 28px; color: var(--faint); margin-bottom: .5rem; }
.empty h3 { margin-bottom: .35rem; }
.empty p { color: var(--muted); max-width: 30rem; margin: 0 auto 1rem; font-size: var(--fs-sm); }

/* Setup checklist (home) */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.15rem; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.tick .icon { width: 14px; height: 14px; }
.checklist .done .tick { background: var(--success); border-color: var(--success); color: #fff; }
.checklist .done .label-text { color: var(--muted); text-decoration: line-through; }
.checklist a { margin-left: auto; font-size: var(--fs-sm); }

/* Stat line (home): plain numbers with labels, no hero KPI tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.stat { padding: .9rem 1.15rem; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .n { font-size: var(--fs-xl); font-weight: 600; display: block; line-height: 1.2; }
.stat .l { font-size: var(--fs-xs); color: var(--muted); }
@media (max-width: 639px) { .stat { border-right: 0; border-bottom: 1px solid var(--line); } .stat:last-child { border-bottom: 0; } }

/* Tables for admin data (scroll inside their own container on phones) */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.data th { text-align: left; font-weight: 500; color: var(--muted); font-size: var(--fs-xs); padding: .6rem 1.15rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: .7rem 1.15rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }

/* Definition list for settings summaries */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; font-size: var(--fs-sm); margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Disclosure blocks (inline edit forms) */
details.disclose > summary { cursor: pointer; list-style: none; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose[open] > summary { margin-bottom: .75rem; }

/* Dialog (confirmations) */
dialog.confirm { border: 0; border-radius: var(--r-md); padding: 0; width: min(92vw, 420px); box-shadow: var(--shadow-pop); color: var(--ink); }
dialog.confirm::backdrop { background: rgba(24, 32, 28, .4); }
dialog.confirm .body { padding: 1.25rem 1.25rem .5rem; }
dialog.confirm h2 { font-size: var(--fs-lg); margin-bottom: .4rem; }
dialog.confirm p { color: var(--muted); font-size: var(--fs-sm); }
dialog.confirm .actions { display: flex; justify-content: flex-end; gap: .5rem; padding: .75rem 1.25rem 1.1rem; }

/* ================================================================ auth pages */
.auth-body { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.auth-top { padding: 1.25rem 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.auth-main { display: grid; place-items: start center; padding: 2rem 1rem 3rem; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 2rem; }
.auth-card.wide { max-width: 620px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: .4rem; }
.auth-card .lede { color: var(--muted); margin-bottom: 1.5rem; }
.auth-foot { text-align: center; padding: 1rem; font-size: var(--fs-xs); color: var(--faint); }
.auth-alt { text-align: center; margin-top: 1.25rem; font-size: var(--fs-sm); color: var(--muted); }
@media (max-width: 479px) { .auth-card { padding: 1.4rem 1.1rem; border-radius: 0; border-left: 0; border-right: 0; } .auth-main { padding: 1rem 0 2rem; } }

.checks { list-style: none; margin: 0 0 1.5rem; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); }
.checks li { display: flex; gap: .6rem; padding: .55rem .8rem; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); align-items: flex-start; }
.checks li:last-child { border-bottom: 0; }
.checks .ok { color: var(--success); } .checks .bad { color: var(--danger); } .checks .warn { color: var(--warning); }
.checks small { display: block; color: var(--muted); }

/* ============================================================== landing page */
.landing { max-width: 1040px; margin: 0 auto; padding: 0 1.5rem; }
.landing-nav { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 0; gap: 1rem; }
.landing-nav nav { display: flex; gap: .5rem; align-items: center; }
.hero { padding: 4rem 0 3rem; display: grid; gap: 3rem; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.05fr 1fr; padding: 5.5rem 0 4.5rem; } }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); line-height: 1.08; letter-spacing: -0.03em; max-width: 14ch; margin-bottom: 1.1rem; }
.hero .lede { font-size: var(--fs-lg); color: var(--ink-2); max-width: 34rem; margin-bottom: 1.75rem; }
.hero .cta { display: flex; gap: .6rem; flex-wrap: wrap; }
/* The hero's characteristic object: a hand-off ledger — who owns what, by when. */
.ledger { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); overflow: hidden; font-size: var(--fs-sm); }
.ledger-head { padding: .75rem 1rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: var(--fs-xs); }
.ledger-row { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.ledger-row:last-child { border-bottom: 0; }
.ledger-row .what { font-weight: 500; }
.ledger-row .who { color: var(--muted); font-size: var(--fs-xs); grid-column: 1; }
.ledger-row .badge { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.ledger-row.late { border-left-color: var(--danger); }
.ledger-row.blocked { border-left-color: var(--warning); }
.ledger-row.review { border-left-color: var(--info); }
.ledger-caption { font-size: var(--fs-xs); color: var(--faint); margin-top: .6rem; text-align: center; }
.principles { display: grid; gap: 2rem; padding: 3rem 0 4rem; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .principles { grid-template-columns: repeat(3, 1fr); } }
.principles h2 { font-size: var(--fs-lg); margin-bottom: .4rem; }
.principles p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }
.landing-foot { border-top: 1px solid var(--line); padding: 1.5rem 0 2.5rem; font-size: var(--fs-xs); color: var(--faint); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.fieldset { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.h3 { font-size: var(--fs-lg); }
.input.btn-sm { min-height: 32px; width: auto; padding: .25rem 1.75rem .25rem .5rem; font-size: var(--fs-xs); }
.row .meta form { display: inline-flex; gap: .35rem; align-items: center; }
.search-bar { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search-bar .input { max-width: 22rem; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
[hidden] { display: none !important; }
.hero figure { margin: 0; }
.stats + .section, .alert + .stats { margin-top: 1.5rem; }
@media (max-width: 419px) { .landing-nav .btn-primary { display: none; } .landing { padding: 0 1rem; } }
.field > label.check { display: flex; font-weight: 400; color: var(--ink); }
@media (max-width: 899px) { .sidebar { box-shadow: none; } .nav-open .sidebar { box-shadow: var(--shadow-pop); } }
