:root {
  --bg: #fbfbfa; --fg: #1c1c1a; --muted: #6b6b66; --line: #e3e3df;
  --panel: #fff; --accent: #2f5d50; --warn: #8a5a00; --warn-bg: #fdf6e6;
  --stop: #a33; --change: #8a5a00; --keep: #2f5d50;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #16171a; --fg: #e8e8e4; --muted: #9a9a95; --line: #2c2e33;
          --panel: #1d1f23; --accent: #7fb3a2; --warn: #d9a441; --warn-bg: #2a2417;
          --stop: #e07a7a; --change: #d9a441; --keep: #7fb3a2; }
}
* { box-sizing: border-box; }
/* footer sits at the bottom of the viewport when the page is short,
   and after the content when it is long */
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.55 ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column; }
header { border-bottom: 1px solid var(--line); background: var(--panel); }
nav { max-width: 1100px; margin: 0 auto; padding: 14px 20px; display: flex; gap: 20px; }
nav a { color: var(--fg); text-decoration: none; font-weight: 600; }
nav a:hover { color: var(--accent); }
main { flex: 1 0 auto; width: 100%; max-width: 1100px; margin: 0 auto;
  padding: 24px 20px 48px; }
footer { flex-shrink: 0; border-top: 1px solid var(--line); background: var(--panel); }
footer p { max-width: 1100px; margin: 0 auto; padding: 18px 20px; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 28px 0 10px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); }
a { color: var(--accent); }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: color-mix(in srgb, var(--line) 60%, transparent); padding: 1px 5px; border-radius: 4px; }
blockquote { margin: 0 0 12px; padding-left: 14px; border-left: 3px solid var(--accent); }

.cards { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 18px; color: var(--muted); }
.big { display: block; font-size: 26px; font-weight: 700; color: var(--fg); }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }

table { width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
section { overflow-x: auto; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line);
  vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.metrics th { width: 34%; font-family: ui-monospace, monospace; text-transform: none;
  letter-spacing: 0; }
.metrics td { font-family: ui-monospace, monospace; font-size: 13px; word-break: break-word; }
.na { color: var(--warn); }

.note { color: var(--muted); font-size: 13px; margin: 6px 0; }
.warn { background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  color: var(--warn); border-radius: 8px; padding: 10px 14px; font-size: 13px; }
footer .warn { border: 0; border-radius: 0; background: transparent; }

.score { font-weight: 700; }
.s1, .s2, .s3, .s4 { color: var(--stop); }
.s5, .s6 { color: var(--change); }
.s7, .s8, .s9, .s10 { color: var(--keep); }
.conf, .infra { font-size: 11px; border: 1px solid var(--line); border-radius: 999px;
  padding: 1px 8px; color: var(--muted); }
.chigh { color: var(--keep); } .clow { color: var(--stop); }
.vstop { color: var(--stop); font-weight: 700; }
.vchange { color: var(--change); font-weight: 700; }
.vkeep { color: var(--keep); font-weight: 700; }

.finding { border: 1px solid var(--line); background: var(--panel); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 10px; }
.finding p { margin: 4px 0; }
.desc { color: var(--muted); font-size: 13px; }
.evidence { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); }
.dims { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 13px; color: var(--muted); }
.dims b { color: var(--fg); }

.chart-box { position: relative; width: 100%; max-width: 620px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 12px; }
.chart-box canvas { width: 100% !important; height: 100% !important; }

/* forms: the People tab edits the roster and the host/user map */
.inline { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 8px 6px 0; }
.stack { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 560px;
  margin: 16px auto; padding: 24px 28px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; }
.stack label { display: flex; flex-direction: column; gap: 5px; font-size: 12px;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stack label input { font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--fg); }
.stack .note { text-transform: none; letter-spacing: 0; font-size: 12px; }
.stack label.check { flex-direction: row; align-items: flex-start; gap: 8px;
  text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--fg); }
.stack label.check input { margin-top: 3px; }
.stack button { align-self: flex-start; padding: 7px 18px; }
input, select { font: inherit; padding: 5px 8px; background: var(--panel); color: var(--fg);
  border: 1px solid var(--line); border-radius: 5px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font: inherit; padding: 5px 12px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--panel); }
button:hover { filter: brightness(1.1); }
.nav-right { margin-left: auto; }
.muted-row td { opacity: .6; }
code.off { text-decoration: line-through; opacity: .6; }

.btn { float: right; font-size: 13px; font-weight: 600; text-decoration: none;
  padding: 6px 14px; border-radius: 5px; border: 1px solid var(--accent);
  color: var(--panel); background: var(--accent); }
.btn:hover, .btn-inline:hover { filter: brightness(1.1); }
.btn-inline { display: inline-block; font-size: 13px; text-decoration: none;
  padding: 5px 12px; border-radius: 5px; border: 1px solid var(--line);
  color: var(--fg); background: var(--panel); }

/* person page: the score against the 1–10 scale, the team average, the bands the
   rubric uses. A number alone does not say whether 5.4 is normal here. */
.gauge { display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 22px; margin: 16px 0; }
.gauge-num { font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.gauge-num small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.gauge-scale { flex: 1 1 320px; min-width: 260px; position: relative; padding-top: 20px; }
.gauge-track { height: 18px; border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--stop) 22%, var(--panel)) 0 27.8%,
    color-mix(in srgb, var(--change) 22%, var(--panel)) 27.8% 61.1%,
    color-mix(in srgb, var(--keep) 22%, var(--panel)) 61.1% 83.3%,
    color-mix(in srgb, var(--accent) 30%, var(--panel)) 83.3% 100%); }
.gauge-mark { position: absolute; top: 16px; width: 16px; height: 16px; margin-left: -8px;
  border-radius: 50%; background: currentColor; border: 2px solid var(--panel); }
.gauge-team { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px;
  color: var(--muted); white-space: nowrap; }
.gauge-team::after { content: ""; position: absolute; left: 50%; top: 15px; height: 22px;
  border-left: 1px dashed var(--muted); }
.gauge-ticks { position: relative; height: 16px; font-size: 11px; color: var(--muted); }
.gauge-ticks span { position: absolute; transform: translateX(-50%); top: 2px; }

/* rule-based observations; the colour is the direction, not decoration */
.hl { border: 1px solid var(--line); border-left: 3px solid var(--line);
  background: var(--panel); border-radius: 8px; padding: 9px 13px; margin-bottom: 7px;
  font-size: 14px; }
.hl.up { border-left-color: var(--keep); }
.hl.down { border-left-color: var(--stop); }
.hl.warn { border-left-color: var(--change); background: var(--panel); color: var(--fg); }
.hl.info { border-left-color: var(--muted); color: var(--muted); }

.drow { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 13px; margin-bottom: 7px; }
.dtop { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted); }
.dtop b { color: var(--fg); }
.bar { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--line) 70%, transparent);
  overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; border-radius: 4px; background: currentColor; }
.filters { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap;
  margin: 16px 0 2px; }
.filters label { display: flex; gap: 8px; align-items: baseline; font-size: 12px;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* key figures: equal columns, so seven numbers read as one row and not as a
   ragged pile that implies an order they do not have */
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin: 16px 0; }
.fig { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; display: flex; flex-direction: column; gap: 2px; }
.fig .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); }
.fig .v { font-size: 21px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; }
.fig .s { font-size: 11px; color: var(--muted); min-height: 15px; }

/* findings, split by verdict: which habits actually repeat, biggest first */
.fcard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; }
.fbars { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 7px; }
.fbars li { display: grid; grid-template-columns: minmax(0, 1fr) 84px 26px; gap: 8px;
  align-items: center; font-size: 12px; }
.fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbar { height: 8px; border-radius: 4px; overflow: hidden;
  background: color-mix(in srgb, var(--line) 70%, transparent); }
.fbar i { display: block; height: 100%; border-radius: 4px; background: currentColor; }
.fbars b { text-align: right; color: var(--muted); }
details { margin-top: 12px; }
summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 600;
  margin-bottom: 10px; }
