:root {
  --canvas: #f1f3f2; --surface: #ffffff; --ink: #14201c; --muted: #5c6965; --line: #dde3e0;
  --accent: #0f5c4d; --accent-soft: #e3f0ec; --mentioned: #86c2b2;
  --warn: #8a5a00; --warn-bg: #fff3d1; --fail: #b42318; --fail-bg: #fdecea;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4;
  --r-s: 6px; --r-m: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.5 "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 4px; font-weight: 600; }
h3 { font-size: 15px; margin: 0; font-weight: 600; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.rail { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; padding: 0 8px 14px; }
.brand span { color: var(--accent); }
.ws-switch select { width: 100%; }
.nav-group { margin-top: 18px; }
.nav-label { font-size: 12px; color: var(--muted); padding: 0 8px 4px; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 7px 8px; border-radius: var(--r-s); color: var(--ink); text-decoration: none; }
.nav a:hover { background: var(--canvas); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.count { font-size: 12px; background: var(--ink); color: #fff; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.rail-foot { margin-top: auto; padding-top: 16px; }
main { padding: 28px 32px 60px; max-width: 1120px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { max-width: 62ch; margin: 0; }

/* Surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px 20px; margin-bottom: 18px; }
.panel > h2 + p { margin-bottom: 14px; }
.cols { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; }
.cols > .panel { margin-bottom: 18px; }
.banner { border-radius: var(--r-s); padding: 9px 12px; margin-bottom: 14px; font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.banner.info { background: var(--accent-soft); }
.banner.warn { background: var(--warn-bg); color: #4d3300; }
.banner.fail { background: var(--fail-bg); color: #6e1610; }

/* Headline measure */
.headline { font-size: 30px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 4px; max-width: 26ch; }
.headline b { font-weight: 700; color: var(--accent); }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.stat .v { font-size: 20px; font-weight: 600; }
.delta { font-size: 13px; margin-left: 4px; color: var(--muted); }
.delta.up { color: var(--accent); } .delta.down { color: var(--fail); }

/* Presence grid */
.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); padding: 4px 0; }
.grid td.state { padding-left: 14px; }
.grid td { padding: 6px 0; border-top: 1px solid var(--line); vertical-align: middle; }
.grid .group td { border-top: 0; padding-top: 16px; font-weight: 600; font-size: 13px; }
.grid a { color: var(--ink); text-decoration: none; } .grid a:hover { text-decoration: underline; }
.cells { display: flex; gap: 3px; justify-content: flex-end; }
.cell { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); flex: none; }
.cell.mentioned { background: var(--mentioned); border-color: var(--mentioned); }
.cell.cited { background: var(--accent); border-color: var(--accent); }
.cell.none { border-style: dashed; }
.key { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 6px 0 10px; }
.key span { display: inline-flex; gap: 6px; align-items: center; }
.state { font-size: 13px; white-space: nowrap; padding-left: 14px; min-width: 44px; text-align: right; width: 1%; }

/* Bars */
.bar-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 46px; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; }
.bar-track { height: 10px; }
.bar { height: 10px; border-radius: 0 4px 4px 0; background: #b9c4c0; min-width: 2px; }
.bar.own { background: var(--accent); }
.bar-row.own { font-weight: 600; }

/* Tables and lists */
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); }
table.list td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--canvas); color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--accent-soft); color: var(--accent); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.fail { background: var(--fail-bg); color: var(--fail); }
.item { padding: 14px 0; border-top: 1px solid var(--line); }
.item:first-of-type { border-top: 0; padding-top: 4px; }
.item-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.item pre, .answer { white-space: pre-wrap; font: inherit; font-size: 14px; color: #2c3a36; margin: 8px 0 0; max-width: 78ch; }
details > summary { cursor: pointer; color: var(--accent); font-size: 14px; margin-top: 6px; }
.pillar-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chips a { text-decoration: none; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; }
.chips a[aria-current="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Forms */
button, .btn { font: inherit; font-size: 14px; font-weight: 500; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 7px 12px; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover { border-color: #b6c0bc; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.quiet { border-color: transparent; background: transparent; color: var(--muted); padding: 7px 6px; }
button.danger { color: var(--fail); }
form.inline { display: inline; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select { font: inherit; font-size: 14px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
label { display: block; font-size: 13px; font-weight: 500; margin: 12px 0 4px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: 14px; margin: 6px 0; }
label.check input { width: auto; }
.hint { font-size: 13px; color: var(--muted); margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.login { max-width: 360px; margin: 12vh auto; padding: 0 16px; }

/* Review */
.pick { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); margin: 0; font-weight: 400; font-size: 15px; cursor: pointer; }
.pick input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--accent); }
.pick:has(input:not(:checked)) .q { color: var(--muted); text-decoration: line-through; }
.pick .q[dir="rtl"] { text-align: right; flex: 1; }
.subhead { font-weight: 600; font-size: 13px; padding: 16px 0 4px; display: flex; justify-content: space-between; gap: 10px; }
.bar-bottom { position: sticky; bottom: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; box-shadow: 0 -4px 14px rgba(20, 32, 28, .06); }

/* Chart */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; padding: 7px 9px; border-radius: var(--r-s); transform: translate(-50%, -100%); white-space: nowrap; display: none; z-index: 2; }
.chart .tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

@media (max-width: 900px) {
  .shell { display: block; }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 14px 8px; display: block; }
  .rail-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
  .brand { padding: 0; }
  .ws-switch select { width: auto; max-width: 52vw; }
  .nav { display: flex; gap: 4px; overflow-x: auto; margin: 10px -14px 0; padding: 0 14px 4px; }
  .nav-group { margin: 0; display: contents; }
  .nav-label, .rail-foot { display: none; }
  .nav a { white-space: nowrap; gap: 6px; }
  main { padding: 18px 14px 50px; }
  .cols, .form-grid { grid-template-columns: 1fr; gap: 0; }
  .headline { font-size: 24px; }
  .panel { padding: 16px 14px; }
  .cells .cell:nth-last-child(n+6) { display: none; }
  .hide-s { display: none; }
}
