:root {
  /* neutrals, tinted toward the accent hue (255) */
  --bg: oklch(0.985 0.002 255);
  --surface: oklch(1 0 0);
  --rail: oklch(0.962 0.005 255);
  --hover: oklch(0.945 0.006 255);
  --line: oklch(0.905 0.006 255);
  --line-soft: oklch(0.94 0.004 255);
  --ink: oklch(0.21 0.02 258);
  --ink-2: oklch(0.36 0.02 258);
  --muted: oklch(0.47 0.015 258);
  --faint: oklch(0.62 0.01 258);

  /* accent: primary actions + selection only */
  --accent: oklch(0.43 0.13 258);
  --accent-hover: oklch(0.37 0.13 258);
  --accent-soft: oklch(0.95 0.025 258);

  /* status */
  --ok: oklch(0.5 0.12 152);
  --ok-soft: oklch(0.955 0.035 152);
  --warn: oklch(0.52 0.12 65);
  --warn-mark: oklch(0.72 0.14 75);
  --warn-soft: oklch(0.965 0.04 85);
  --bad: oklch(0.52 0.18 27);
  --bad-soft: oklch(0.96 0.025 27);
  --verify: oklch(0.48 0.14 295);
  --verify-soft: oklch(0.955 0.03 295);
  --idle: oklch(0.5 0.01 258);
  --idle-soft: oklch(0.95 0.004 258);

  /* data series */
  --s-complete: oklch(0.72 0.05 258);
  --s-know: oklch(0.55 0.1 258);
  --s-verified: oklch(0.36 0.12 258);

  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --t-xs: 0.75rem;   /* 12 */
  --t-sm: 0.8125rem; /* 13 */
  --t-md: 0.875rem;  /* 14 body */
  --t-lg: 1rem;      /* 16 */
  --t-xl: 1.1875rem; /* 19 */
  --t-2xl: 1.4375rem;/* 23 */
  --t-3xl: 1.75rem;  /* 28 */

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --r-sm: 4px; --r-md: 6px; --r-lg: 8px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --z-sticky: 10; --z-dropdown: 20; --z-backdrop: 30; --z-modal: 40; --z-toast: 50;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: var(--t-md); line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
svg.i { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: var(--z-sticky); height: 52px; display: flex; align-items: center; gap: var(--sp-5); padding: 0 var(--sp-5); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; width: 206px; font-weight: 600; font-size: var(--t-md); }
.brand-mark { width: 24px; height: 24px; border-radius: var(--r-md); background: var(--ink); color: var(--surface); display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: var(--t-xs); line-height: 1.2; }
.roles { display: flex; gap: 2px; padding: 3px; background: var(--rail); border-radius: var(--r-lg); }
.roles button { border: 0; background: none; padding: 5px 12px; border-radius: var(--r-md); font-size: var(--t-sm); color: var(--ink-2); font-weight: 500; transition: background 150ms var(--ease); }
.roles button:hover { background: var(--hover); }
.roles button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 1px 2px oklch(0.2 0.02 258 / 0.06); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); position: relative; }
.icon-btn { position: relative; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); color: var(--ink-2); }
.icon-btn:hover { background: var(--hover); }
.icon-btn .count { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; }
.me { display: flex; align-items: center; gap: 10px; font-size: var(--t-sm); line-height: 1.25; }
.me small { display: block; color: var(--muted); font-size: var(--t-xs); }

.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 52px); }
.sidebar { position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto; background: var(--rail); border-right: 1px solid var(--line); padding: var(--sp-4) var(--sp-3); display: flex; flex-direction: column; }
.side-group + .side-group { margin-top: var(--sp-5); }
.side-label { font-size: var(--t-xs); font-weight: 600; color: var(--muted); padding: 0 var(--sp-2) 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px var(--sp-2); border: 0; background: none; border-radius: var(--r-md); color: var(--ink-2); font-size: var(--t-sm); text-align: left; transition: background 150ms var(--ease); }
.nav-item:hover { background: var(--hover); }
.nav-item[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.nav-item[aria-current="page"] svg.i { color: var(--accent); }
.nav-item .n { margin-left: auto; font-size: var(--t-xs); font-weight: 600; color: var(--bad); }
.nav-item .flag { margin-left: auto; color: var(--warn); }
.side-foot { margin-top: auto; padding: var(--sp-3) var(--sp-2) 0; font-size: var(--t-xs); color: var(--muted); line-height: 1.45; border-top: 1px solid var(--line); }

main { padding: var(--sp-5) var(--sp-6) var(--sp-7); max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-5); margin-bottom: var(--sp-5); }
.page-head h1 { font-size: var(--t-2xl); }
.page-head p { color: var(--muted); margin-top: 4px; max-width: 72ch; }
.crumb { font-size: var(--t-sm); color: var(--muted); margin-bottom: var(--sp-2); }
.crumb button { border: 0; background: none; padding: 0; color: var(--accent); }

/* ---------- primitives ---------- */
.row { display: flex; gap: var(--sp-4); }
.grid { display: grid; gap: var(--sp-4); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.stack > * + * { margin-top: var(--sp-4); }
.gap-lg { margin-top: var(--sp-6); }
.gap-md { margin-top: var(--sp-4); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5); min-width: 0; }
.panel.flush { padding: 0; }
.panel.flush > .panel-head { padding: var(--sp-4) var(--sp-5) 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.panel-head h2 { font-size: var(--t-lg); }
.panel-head .meta { font-size: var(--t-sm); color: var(--muted); }
.section-title { font-size: var(--t-lg); margin-bottom: var(--sp-3); }

.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: var(--t-sm); font-weight: 500; white-space: nowrap; transition: background 150ms var(--ease), border-color 150ms var(--ease); }
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(0.5px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.sm { height: 28px; padding: 0 10px; font-size: var(--t-xs); }
.btn.ghost { border-color: transparent; background: none; color: var(--accent); padding: 0 6px; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-size: var(--t-sm); font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }
.muted { color: var(--muted); }
.sm { font-size: var(--t-sm); }
.xs { font-size: var(--t-xs); }
.strong { font-weight: 600; }

/* status: text + shape + tint, never colour alone */
.st { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: var(--t-xs); font-weight: 600; white-space: nowrap; }
.st svg.i { width: 12px; height: 12px; stroke-width: 2.25; }
.st.ok { background: var(--ok-soft); color: var(--ok); }
.st.warn { background: var(--warn-soft); color: var(--warn); }
.st.bad { background: var(--bad-soft); color: var(--bad); }
.st.verify { background: var(--verify-soft); color: var(--verify); }
.st.info { background: var(--accent-soft); color: var(--accent); }
.st.idle { background: var(--idle-soft); color: var(--idle); }
.tag { display: inline-block; font-size: var(--t-xs); color: var(--ink-2); background: var(--rail); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 6px; line-height: 20px; white-space: nowrap; }
.due-bad { color: var(--bad); font-weight: 600; }
.due-warn { color: var(--warn); font-weight: 600; }

.meter { height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; min-width: 60px; }
.meter > span { display: block; height: 100%; background: var(--s-know); border-radius: 3px; }
.meter.ok > span { background: var(--ok); }
.meter.bad > span { background: var(--bad); }
.meter-row { display: flex; align-items: center; gap: var(--sp-2); }
.meter-row .meter { flex: 1; }
.meter-row b { font-weight: 600; font-size: var(--t-xs); min-width: 32px; text-align: right; }

.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--rail); border: 1px solid var(--line); color: var(--ink-2); display: grid; place-items: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.avatar.lg { width: 44px; height: 44px; font-size: var(--t-md); }
.avatar.ink { background: var(--ink); border-color: var(--ink); color: #fff; }

table { width: 100%; border-collapse: collapse; }
table.fixed { table-layout: fixed; }
table.fixed td { overflow-wrap: anywhere; }
th { text-align: left; font-size: var(--t-xs); font-weight: 600; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th.num, td.num { text-align: right; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--bg); }
.cell-title { font-weight: 600; }
.cell-sub { font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }

.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: var(--sp-3); padding: 10px 0; border-top: 1px solid var(--line-soft); }
.li:first-child { border-top: 0; }
.li.click { cursor: pointer; margin: 0 calc(var(--sp-2) * -1); padding-left: var(--sp-2); padding-right: var(--sp-2); border-radius: var(--r-md); }
.li.click:hover { background: var(--bg); }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 500; }
.li .s { font-size: var(--t-xs); color: var(--muted); margin-top: 1px; }

.note { display: flex; gap: 10px; align-items: flex-start; background: var(--rail); border-radius: var(--r-md); padding: 10px 12px; font-size: var(--t-sm); color: var(--ink-2); }
.note svg.i { margin-top: 2px; color: var(--muted); }
.note.warn { background: var(--warn-soft); color: oklch(0.38 0.08 65); }
.note.warn svg.i { color: var(--warn); }

/* ---------- next action ---------- */
.today { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-5); align-items: end; margin-bottom: var(--sp-5); }
.today h1 { font-size: var(--t-3xl); letter-spacing: -0.02em; }
.today .who { color: var(--muted); margin-top: 6px; }
.daycount { text-align: right; }
.daycount b { font-size: var(--t-3xl); font-weight: 600; letter-spacing: -0.02em; }
.daycount span { color: var(--muted); font-size: var(--t-sm); margin-left: 4px; }
.next { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sp-4); align-items: center; padding: var(--sp-4) var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.next .label { font-size: var(--t-xs); font-weight: 600; color: var(--accent); }
.next h2 { font-size: var(--t-xl); margin-top: 2px; }
.next p { color: var(--muted); font-size: var(--t-sm); margin-top: 2px; }
.next-icon { width: 40px; height: 40px; border-radius: var(--r-lg); background: var(--bad-soft); color: var(--bad); display: grid; place-items: center; }
.next-icon svg.i { width: 20px; height: 20px; }

/* ---------- readiness ladder (signature element) ---------- */
.ladder { display: grid; grid-template-columns: 200px minmax(0, 1fr) 52px; row-gap: 10px; column-gap: var(--sp-4); align-items: center; }
.ladder .lbl { font-size: var(--t-sm); color: var(--ink-2); }
.ladder .lbl small { display: block; font-size: var(--t-xs); color: var(--muted); }
.ladder .val { text-align: right; font-weight: 600; font-size: var(--t-lg); }
.track { position: relative; height: 14px; background: var(--line-soft); border-radius: 2px; }
.track > .fill { position: absolute; inset: 0 auto 0 0; border-radius: 2px; transition: width 250ms var(--ease); }
.track .ghost { position: absolute; top: 0; bottom: 0; border-left: 1.5px dashed var(--faint); }
.ladder-gap { margin: 4px calc(52px + var(--sp-4)) 0 calc(200px + var(--sp-4)); font-size: var(--t-xs); color: var(--muted); }
.gap-track { position: relative; height: 8px; }
.gap-track .bracket { position: absolute; top: 0; height: 8px; border: 1.5px solid var(--warn-mark); border-top: 0; border-radius: 0 0 2px 2px; }
.ladder-gap p { margin-top: 4px; }
.ladder-gap b { color: var(--warn); font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ladder-mini { display: grid; gap: 4px; }
.ladder-mini .track { height: 6px; }
.ladder-mini .r { display: grid; grid-template-columns: 82px minmax(0, 1fr) 34px; gap: 8px; align-items: center; font-size: var(--t-xs); color: var(--muted); }
.ladder-mini .r b { color: var(--ink); text-align: right; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: var(--sp-4); font-size: var(--t-xs); color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.score-line { display: flex; align-items: center; gap: var(--sp-4); padding-top: var(--sp-4); margin-top: var(--sp-4); border-top: 1px solid var(--line-soft); font-size: var(--t-sm); }
.score-line .score { font-size: var(--t-xl); font-weight: 600; }

/* ---------- timeline ---------- */
.tl { padding-top: 26px; }
.tl-ruler { position: relative; height: 28px; }
.tl-base { position: absolute; left: 0; right: 0; top: 12px; height: 4px; background: var(--line-soft); border-radius: 2px; }
.tl-done { position: absolute; left: 0; top: 12px; height: 4px; background: var(--s-know); border-radius: 2px; }
.tl-tick { position: absolute; top: 18px; width: 1px; height: 5px; background: var(--line); }
.tl-tick span { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--faint); }
.tl-ms { position: absolute; top: 6px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); display: grid; place-items: center; }
.tl-ms svg.i { width: 10px; height: 10px; stroke-width: 3; }
.tl-ms.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.tl-ms.late { border-color: var(--bad); color: var(--bad); }
.tl-ms.current { border-color: var(--s-know); }
.tl-now { position: absolute; top: -22px; transform: translateX(-50%); font-size: var(--t-xs); font-weight: 600; color: var(--accent); white-space: nowrap; }
.tl-now::after { content: ""; display: block; width: 2px; height: 24px; margin: 2px auto 0; background: var(--accent); border-radius: 1px; }
.tl-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); margin-top: var(--sp-5); }
.tl-col h3 { font-size: var(--t-md); display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.tl-col ul { list-style: none; padding: 0; margin: 0; font-size: var(--t-sm); color: var(--ink-2); }
.tl-col li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.tl-col li svg.i { width: 13px; height: 13px; color: var(--faint); }
.tl-col li.y svg.i { color: var(--ok); stroke-width: 2.5; }
.tl-col li.n { color: var(--muted); }

/* ---------- three-state module marks ---------- */
.marks { display: inline-flex; gap: 3px; }
.mark { width: 22px; height: 22px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--idle-soft); color: var(--faint); border: 1px solid var(--line); }
.mark svg.i { width: 12px; height: 12px; stroke-width: 2.5; }
.mark.on { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.mark.wait { background: var(--verify-soft); color: var(--verify); border-color: transparent; }
.mark.fail { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.mark.na { background: none; border-style: dashed; color: var(--line); }

/* ---------- achievements ---------- */
.milestones { display: flex; flex-direction: column; }
.ms-item { display: flex; align-items: center; gap: var(--sp-3); padding: 8px 0; font-size: var(--t-sm); border-top: 1px solid var(--line-soft); }
.ms-item:first-child { border-top: 0; }
.ms-dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); color: var(--faint); flex-shrink: 0; }
.ms-dot svg.i { width: 11px; height: 11px; stroke-width: 3; }
.ms-item.y .ms-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.ms-item .grow { flex: 1; min-width: 0; }
.ms-item.n .grow .xs { margin-top: 1px; }
.fb-about b { font-weight: 500; color: var(--ink-2); }
.ms-item.n .grow { color: var(--muted); }

/* ---------- feedback ---------- */
.fb { padding: var(--sp-4) 0; border-top: 1px solid var(--line-soft); }
.fb:first-child { border-top: 0; padding-top: 0; }
.fb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fb-head b { font-size: var(--t-sm); }
.fb-head .s { font-size: var(--t-xs); color: var(--muted); }
.fb-about { font-size: var(--t-xs); color: var(--muted); margin-bottom: 6px; }
.fb p { max-width: 72ch; }
.fb .reply { margin-top: 10px; padding: 10px 12px; background: var(--rail); border-radius: var(--r-md); font-size: var(--t-sm); max-width: 72ch; }
.fb .reply b { display: block; font-size: var(--t-xs); color: var(--muted); margin-bottom: 2px; }

/* ---------- notifications ---------- */
.popover { position: absolute; top: 42px; right: 0; width: 380px; z-index: var(--z-dropdown); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 8px 24px oklch(0.2 0.02 258 / 0.12); overflow: hidden; }
.popover-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: var(--t-sm); }
.notif { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: var(--t-sm); }
.notif:first-of-type { border-top: 0; }
.notif .s { font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }
.notif svg.i { margin-top: 2px; }
.c-bad { color: var(--bad); } .c-warn { color: var(--warn); } .c-ok { color: var(--ok); } .c-info { color: var(--accent); } .c-verify { color: var(--verify); }

/* ---------- drawer / modal ---------- */
.scrim { position: fixed; inset: 0; z-index: var(--z-backdrop); background: oklch(0.2 0.02 258 / 0.28); display: flex; justify-content: flex-end; animation: fade 150ms var(--ease); }
.scrim.center { justify-content: center; align-items: center; }
.drawer { width: 540px; max-width: 100%; height: 100%; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line); padding: var(--sp-5); z-index: var(--z-modal); animation: slide 220ms var(--ease); }
.modal { width: 520px; max-width: calc(100% - 32px); max-height: calc(100vh - 64px); overflow-y: auto; background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); padding: var(--sp-5); z-index: var(--z-modal); animation: rise 200ms var(--ease); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: 0.6; } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.d-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.d-head .kicker { font-size: var(--t-xs); color: var(--muted); }
.d-head h2 { font-size: var(--t-xl); margin-top: 2px; }
.close { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); color: var(--ink-2); flex-shrink: 0; }
.close:hover { background: var(--hover); }
.d-section { padding-top: var(--sp-4); margin-top: var(--sp-4); border-top: 1px solid var(--line-soft); }
.d-section h3 { font-size: var(--t-md); margin-bottom: var(--sp-3); }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px var(--sp-4); font-size: var(--t-sm); margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.field { margin-bottom: var(--sp-4); }
.field > label, .field > .flabel { display: block; font-size: var(--t-sm); font-weight: 600; margin-bottom: 6px; }
.field input[type=text], .field input[type=date], .field select, .field textarea, .select { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-size: var(--t-sm); }
.field textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: oklch(0.82 0.008 258); }
.choice { display: flex; flex-wrap: wrap; gap: 6px; }
.choice label { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-md); font-size: var(--t-sm); cursor: pointer; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.choice input { accent-color: var(--accent); margin: 0; }
.range-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: var(--sp-3); align-items: center; }
.range-row input { accent-color: var(--accent); width: 100%; }
.history { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line); }
.history li { position: relative; padding: 0 0 12px; font-size: var(--t-sm); }
.history li::before { content: ""; position: absolute; left: -18px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--s-know); }
.history small { display: block; color: var(--muted); font-size: var(--t-xs); }

/* ---------- filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-4); }
.toolbar .select { width: auto; height: 30px; padding: 0 8px; font-size: var(--t-sm); background: var(--surface); }
.toolbar .select.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.toolbar input[type=search] { height: 30px; width: 240px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-md); font-size: var(--t-sm); background: var(--surface); }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--rail); border-radius: var(--r-md); }
.seg button { border: 0; background: none; height: 26px; padding: 0 10px; border-radius: var(--r-sm); font-size: var(--t-sm); color: var(--ink-2); white-space: nowrap; }
.seg button:hover { background: var(--hover); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.seg button .c { color: var(--muted); font-weight: 400; margin-left: 4px; }

/* ---------- scorecard (BE KPIs) ---------- */
.scorecard { width: 100%; }
.scorecard td { padding: 14px 12px; }
.sc-name { font-weight: 600; }
.sc-def { font-size: var(--t-xs); color: var(--muted); margin-top: 2px; max-width: 34ch; }
.sc-val { font-size: var(--t-xl); font-weight: 600; text-align: right; white-space: nowrap; }
.sc-val small { font-size: var(--t-xs); color: var(--muted); font-weight: 500; margin-left: 2px; }
.bullet { position: relative; height: 18px; width: 100%; min-width: 180px; }
.bullet .band { position: absolute; top: 0; bottom: 0; }
.bullet .bar { position: absolute; top: 6px; height: 6px; left: 0; background: var(--ink); border-radius: 1px; }
.bullet .target { position: absolute; top: 1px; bottom: 1px; width: 2px; background: var(--bad); }
.bullet-axis { position: relative; display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.bullet-axis .tgt { position: absolute; transform: translateX(-50%); color: var(--bad); font-weight: 600; white-space: nowrap; }
.delta { font-size: var(--t-xs); font-weight: 600; white-space: nowrap; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); } .delta.flat { color: var(--muted); }

/* ---------- manager cards ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: var(--sp-4); align-items: start; }
.person { cursor: pointer; transition: border-color 150ms var(--ease); }
.person:hover { border-color: oklch(0.8 0.01 258); }
.person-top { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.person-top .grow { flex: 1; min-width: 0; }
.person-top b { display: block; }
.person-top .s { font-size: var(--t-xs); color: var(--muted); }
.person-day { text-align: right; }
.person-day b { font-size: var(--t-xl); font-weight: 600; }
.person-day span { display: block; font-size: var(--t-xs); color: var(--muted); }
.person-foot { display: flex; justify-content: space-between; align-items: center; margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--line-soft); font-size: var(--t-sm); }
.signals { margin-top: var(--sp-3); background: var(--warn-soft); border-radius: var(--r-md); padding: 10px 12px; font-size: var(--t-sm); color: oklch(0.36 0.08 65); }
.signals b { display: flex; align-items: center; gap: 6px; color: oklch(0.42 0.11 65); }
.signals ul { margin: 6px 0 0; padding-left: 18px; }
.signals li { padding: 1px 0; }
.calm { display: flex; align-items: center; gap: 6px; margin-top: var(--sp-3); font-size: var(--t-sm); color: var(--ok); }

.counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.counts > button { text-align: left; border: 0; border-left: 1px solid var(--line-soft); background: none; padding: var(--sp-4) var(--sp-5); transition: background 150ms var(--ease); }
.counts > button:first-child { border-left: 0; }
.counts > button:hover { background: var(--bg); }
.counts b { display: block; font-size: var(--t-2xl); font-weight: 600; line-height: 1.15; }
.counts .t { font-size: var(--t-sm); color: var(--ink-2); }
.counts .s { font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }

/* ---------- heatmap ---------- */
.heat td.h { text-align: center; font-weight: 600; font-size: var(--t-sm); border: 2px solid var(--surface); border-radius: var(--r-sm); padding: 8px; }

.slider-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) 44px; gap: var(--sp-3); align-items: center; padding: 6px 0; font-size: var(--t-sm); }
.slider-row input { accent-color: var(--accent); width: 100%; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: var(--z-toast); display: flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-lg); font-size: var(--t-sm); box-shadow: 0 8px 24px oklch(0.2 0.02 258 / 0.2); animation: rise 200ms var(--ease); }
.toast svg.i { color: oklch(0.8 0.12 152); }

.empty { padding: var(--sp-5); text-align: center; color: var(--muted); font-size: var(--t-sm); }

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

@media (max-width: 1100px) {
  .cols-3, .cols-main { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .counts > button:nth-child(3) { border-left: 0; }
  .counts > button:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
}
@media (max-width: 760px) {
  .topbar { padding: 0 var(--sp-3); gap: var(--sp-3); }
  .brand { width: auto; }
  .brand > div, .me > div { display: none; }
  .roles button { padding: 5px 8px; font-size: var(--t-xs); }
  main { padding: var(--sp-4); }
  .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .today { grid-template-columns: minmax(0, 1fr); }
  .daycount { text-align: left; }
  .next { grid-template-columns: minmax(0, 1fr); }
  .next-icon { display: none; }
  .ladder { grid-template-columns: minmax(0, 1fr) 44px; }
  .ladder .lbl { grid-column: 1 / -1; }
  .ladder-gap { margin: 4px calc(44px + var(--sp-4)) 0 0; }
  .tl-cols { grid-template-columns: minmax(0, 1fr); }
  .popover { position: fixed; top: 56px; left: 8px; right: 8px; width: auto; }
  .panel { padding: var(--sp-4); }
  .panel.flush { overflow-x: auto; }
}
