@import url("tokens.css");

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.55;
  color: var(--body);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0; font-weight: 640; letter-spacing: -.011em; }
h1 { font-size: var(--t-xl); letter-spacing: -.02em; }
h2 { font-size: var(--t-md); }
h3 { font-size: var(--t-base); }
p { margin: 0; }
small { font-size: var(--t-sm); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
a { color: var(--accent); }

:where(button, input, select, textarea) { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* ---------- banda dimostrativa ---------- */
.demo-strip {
  background: var(--ink);
  color: oklch(93% .01 250);
  font-size: var(--t-xs);
  letter-spacing: .02em;
  text-align: center;
  padding: 7px var(--s4);
}
.demo-strip strong { color: #fff; font-weight: 600; }

/* ---------- impianto ---------- */
.shell { display: flex; min-height: calc(100vh - 32px); align-items: stretch; }

.sidebar {
  width: 248px;
  flex: 0 0 248px;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  padding: var(--s5) var(--s4) var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  position: sticky;
  top: 0;
  height: calc(100vh - 32px);
  overflow-y: auto;
}
.brand { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--s2); }
.brand b { font-size: 1.5rem; letter-spacing: .1em; color: #fff; font-weight: 680; }
.brand span { font-size: var(--t-xs); color: var(--sidebar-dim); letter-spacing: .01em; }
.brand em { font-style: normal; font-size: var(--t-xs); color: var(--sidebar-dim); margin-top: var(--s3); }

nav { display: flex; flex-direction: column; gap: 2px; }
nav button {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%; text-align: left;
  padding: 9px var(--s3);
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--sidebar-ink);
  font-size: var(--t-base); cursor: pointer;
  transition: background var(--fast) var(--ease);
}
nav button i { font-style: normal; width: 18px; text-align: center; opacity: .75; }
nav button:hover { background: oklch(100% 0 0 / .08); }
nav button.on { background: oklch(100% 0 0 / .14); color: #fff; font-weight: 600; }
nav button.on i { opacity: 1; }

.side-quick {
  margin-top: auto;
  background: oklch(100% 0 0 / .07);
  border: 1px solid oklch(100% 0 0 / .1);
  border-radius: var(--r-md);
  padding: var(--s3);
  display: flex; flex-direction: column; gap: var(--s2);
}
.side-quick p { font-size: var(--t-xs); color: var(--sidebar-dim); }
.side-quick button {
  border: 0; border-radius: var(--r-sm); cursor: pointer;
  background: var(--on-accent); color: var(--ink);
  padding: 8px; font-size: var(--t-sm); font-weight: 600;
}
.identity {
  display: flex; align-items: center; gap: var(--s3);
  border-top: 1px solid oklch(100% 0 0 / .12);
  padding-top: var(--s3);
}
.identity div { display: flex; flex-direction: column; line-height: 1.3; }
.identity b { font-size: var(--t-sm); color: #fff; font-weight: 600; }
.identity small { font-size: var(--t-xs); color: var(--sidebar-dim); }

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

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: var(--s3) var(--s6);
  background: oklch(100% 0 0 / .82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 20;
}
.crumb { font-size: var(--t-sm); color: var(--muted); }
.crumb b { color: var(--ink); font-weight: 600; }
.role-pick { display: flex; align-items: center; gap: var(--s2); font-size: var(--t-sm); color: var(--muted); }
.role-pick select {
  border: 1px solid var(--rule); border-radius: var(--r-sm);
  padding: 5px var(--s2); background: var(--surface); color: var(--ink);
}
.menu-btn { display: none; }
.topbar-right { display: flex; align-items: center; gap: var(--s3); }

/* dietro le quinte: nascosto finché non lo si accende */
.tech-only { display: none !important; }
body.tecnico .tech-only { display: block !important; }
body.tecnico .role-pick.tech-only { display: flex !important; }
.tech-strip {
  background: var(--ink); color: oklch(88% .02 250);
  font-size: var(--t-sm); padding: 10px var(--s6);
  border-bottom: 1px solid var(--rule);
}
.panel.tech { border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-soft) 0 3px, var(--surface) 3px); }
.frase { font-size: var(--t-md); color: var(--ink); line-height: 1.5; }
.frase strong { font-weight: 640; }

.view { padding: var(--s6); max-width: 1180px; width: 100%; }
footer {
  margin-top: auto;
  padding: var(--s5) var(--s6);
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: var(--s4);
  font-size: var(--t-xs); color: var(--faint); flex-wrap: wrap;
}

/* ---------- testate ---------- */
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.pagehead p { color: var(--muted); margin-top: var(--s1); max-width: 62ch; }
.pagehead .tools { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* ---------- controlli ---------- */
button.btn, .btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--rule); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  padding: 8px var(--s3); font-size: var(--t-sm); font-weight: 560;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.btn:hover { background: var(--surface-sunk); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 5px var(--s2); font-size: var(--t-xs); }
button.link {
  border: 0; background: none; color: var(--accent); cursor: pointer;
  padding: 0; font-size: inherit; font-weight: 560; text-align: left;
}
button.link:hover { text-decoration: underline; }

label.field { display: flex; flex-direction: column; gap: 5px; font-size: var(--t-sm); color: var(--body); font-weight: 560; }
label.field span.hint { font-weight: 400; color: var(--muted); font-size: var(--t-xs); }
input, select, textarea {
  border: 1px solid var(--rule); border-radius: var(--r-sm);
  padding: 9px var(--s3); background: var(--surface); color: var(--ink);
  font-size: var(--t-base); width: 100%; min-height: 40px;
  font-weight: 400;
}
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--accent-line); }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s3); }

/* ---------- pannelli ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: var(--s5);
  box-shadow: var(--shadow-sm);
}
.panel + .panel, .gap { margin-top: var(--s4); }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s4) var(--s5); border-bottom: 1px solid var(--rule-soft); flex-wrap: wrap;
}
.panel-head.plain { padding: 0 0 var(--s3); border: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.stack { display: flex; flex-direction: column; gap: var(--s4); }

/* ---------- note ---------- */
.note {
  border-left: 3px solid var(--accent-line);
  background: var(--accent-soft);
  padding: var(--s3) var(--s4);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: var(--t-sm); color: var(--body);
}
.note.warn { border-color: var(--warn-line); background: var(--warn-soft); }
.note.plain { border-color: var(--rule); background: var(--surface-sunk); }
.note strong { color: var(--ink); }
.note + .note { margin-top: var(--s2); }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: var(--r-pill); padding: 2px 9px;
  font-size: var(--t-xs); font-weight: 560;
  background: var(--surface-sunk); color: var(--body); border: 1px solid var(--rule-soft);
}
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.tag.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.tag.accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.tag.miss { background: transparent; color: var(--faint); border-style: dashed; }

/* ---------- indicatori di sintesi ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.tile {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md);
  padding: var(--s4); box-shadow: var(--shadow-sm);
}
.tile b { display: block; font-size: var(--t-2xl); color: var(--ink); font-weight: 660; letter-spacing: -.02em; line-height: 1.1; }
.tile span { display: block; font-size: var(--t-sm); color: var(--muted); margin-top: 2px; }
.tile em { display: block; font-style: normal; font-size: var(--t-xs); color: var(--faint); margin-top: var(--s2); }

/* ---------- elenco persone ---------- */
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: var(--s3); margin-bottom: var(--s4); align-items: end; }
.person-row {
  display: grid; grid-template-columns: 40px minmax(0, 1.4fr) minmax(0, 1.3fr) auto;
  gap: var(--s3); align-items: center;
  padding: var(--s3) var(--s5);
  border-top: 1px solid var(--rule-soft);
  text-align: left; width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; cursor: pointer;
  transition: background var(--fast) var(--ease);
}
.person-row:hover { background: var(--surface-sunk); }
.avatar {
  width: 40px; height: 40px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: var(--t-sm); font-weight: 620;
}
.avatar.lg { width: 56px; height: 56px; font-size: var(--t-md); }
.person-row b { display: block; color: var(--ink); font-weight: 600; }
.person-row small { display: block; color: var(--muted); }
.person-row .meta { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.person-row .go { color: var(--accent); font-size: var(--t-sm); font-weight: 560; white-space: nowrap; }

/* ---------- scheda persona ---------- */
.profilehead { display: flex; gap: var(--s4); align-items: center; }
.profilehead small { color: var(--muted); display: block; }
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--rule); margin-bottom: var(--s4); flex-wrap: wrap; }
.tabs button {
  border: 0; background: none; cursor: pointer;
  padding: var(--s2) var(--s3); font-size: var(--t-sm); font-weight: 560; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }

dl.facts { margin: 0; display: grid; gap: 0; }
dl.facts > div { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--rule-soft); align-items: baseline; }
dl.facts > div:last-child { border-bottom: 0; }
dl.facts dt { font-size: var(--t-sm); color: var(--muted); }
dl.facts dd { margin: 0; color: var(--ink); display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; }
dl.facts dd .src { font-size: var(--t-xs); color: var(--faint); }

.dimension { border: 1px solid var(--rule-soft); border-radius: var(--r-md); overflow: hidden; }
.dimension + .dimension { margin-top: var(--s3); }
.dimension > summary {
  cursor: pointer; padding: var(--s3) var(--s4); background: var(--surface-sunk);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  font-weight: 600; color: var(--ink); font-size: var(--t-sm); list-style: none;
}
.dimension > summary::-webkit-details-marker { display: none; }
.dimension > summary::after { content: "▾"; color: var(--muted); font-size: var(--t-xs); }
.dimension[open] > summary::after { content: "▴"; }
.dimension .body { padding: var(--s3) var(--s4) var(--s4); }
.progress { height: 5px; border-radius: var(--r-pill); background: var(--rule-soft); overflow: hidden; width: 90px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); }

.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 96px 1fr; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--rule-soft); }
.tl-item:first-child { border-top: 0; }
.tl-when { font-size: var(--t-xs); color: var(--muted); padding-top: 2px; }
.tl-item h3 { font-size: var(--t-base); }
.tl-item p { font-size: var(--t-sm); color: var(--muted); }

.record { border-top: 1px solid var(--rule-soft); padding: var(--s3) 0; }
.record:first-child { border-top: 0; }
.record h3 { font-size: var(--t-base); }
.record small { color: var(--muted); display: block; }

.conflict { border: 1px solid var(--warn-line); border-radius: var(--r-md); overflow: hidden; }
.conflict-head { background: var(--warn-soft); padding: var(--s3) var(--s4); font-weight: 600; color: var(--ink); font-size: var(--t-sm); }
.conflict-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.claim { padding: var(--s4); border-left: 1px solid var(--rule-soft); }
.claim:first-child { border-left: 0; }
.claim b { display: block; color: var(--ink); font-size: var(--t-md); }
.claim small { display: block; color: var(--muted); }

/* ---------- registrazione rapida ---------- */
.quickbar {
  background: linear-gradient(180deg, var(--accent-soft), var(--surface));
  border: 1px solid var(--accent-line);
  border-radius: var(--r-md);
  padding: var(--s4);
  margin-bottom: var(--s4);
}
.quickbar h2 { font-size: var(--t-base); }
.quickbar p { font-size: var(--t-sm); color: var(--muted); margin: 2px 0 var(--s3); }
.quickrow { display: flex; gap: var(--s2); align-items: stretch; }
.quickrow textarea { min-height: 44px; background: var(--surface); }
.chips { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.chips span.label { font-size: var(--t-xs); color: var(--muted); align-self: center; }
.chips button {
  border: 1px dashed var(--accent-line); background: var(--surface); color: var(--accent);
  border-radius: var(--r-pill); padding: 4px 11px; font-size: var(--t-xs); cursor: pointer;
}
.chips button:hover { background: var(--accent-soft); }

.read-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); margin: var(--s3) 0; }
.read-cell { border: 1px solid var(--rule-soft); border-radius: var(--r-sm); padding: var(--s3); background: var(--surface); }
.read-cell small { display: block; color: var(--muted); font-size: var(--t-xs); }
.read-cell b { color: var(--ink); font-weight: 600; }
.read-cell.guess { border-style: dashed; border-color: var(--warn-line); background: var(--warn-soft); }

/* ---------- consultazione ---------- */
.ask { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: var(--s5); box-shadow: var(--shadow-sm); }
.ask textarea { min-height: 64px; }
.ask-row { display: flex; gap: var(--s3); align-items: flex-end; }
.ask-row .field { flex: 1 1 auto; }

.plan { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.plan > div { padding: var(--s3) var(--s4); border-left: 1px solid var(--rule-soft); }
.plan > div:first-child { border-left: 0; }
.plan small { display: block; color: var(--muted); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .05em; }
.plan b { color: var(--ink); font-weight: 600; }

.checks { display: flex; flex-direction: column; gap: var(--s2); }
.check { display: flex; gap: var(--s2); align-items: flex-start; font-size: var(--t-sm); }
.check i { font-style: normal; width: 18px; flex: 0 0 18px; text-align: center; font-weight: 700; }
.check.ok i { color: var(--good); }
.check.warn i { color: var(--warn); }
.check.stop i { color: var(--stop); }

/* barre di risultato: una sola serie, tinta d'accento */
table.result { width: 100%; border-collapse: collapse; }
table.result th { text-align: left; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 0 var(--s3) var(--s2) 0; border-bottom: 1px solid var(--rule); }
table.result th.n, table.result td.n { text-align: right; }
table.result td { padding: 9px var(--s3) 9px 0; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; color: var(--ink); }
table.result td.bar { width: 46%; padding-right: 0; }
table.result .barwrap { display: block; background: var(--surface-sunk); border-radius: 0 var(--r-sm) var(--r-sm) 0; height: 14px; }
table.result .barwrap i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
table.result tr:hover td { background: var(--surface-sunk); }
table.result td.hidden-cell { color: var(--muted); font-style: italic; }

table.grid { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
table.grid th { text-align: left; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--rule); }
table.grid td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--rule-soft); color: var(--ink); }
table.grid td.n, table.grid th.n { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }

pre.plan-json {
  background: var(--ink); color: oklch(92% .02 250);
  border-radius: var(--r-sm); padding: var(--s3) var(--s4);
  font-family: var(--mono); font-size: var(--t-xs); line-height: 1.6;
  overflow-x: auto; margin: 0;
}
details.disclose summary { cursor: pointer; font-size: var(--t-sm); font-weight: 560; color: var(--accent); padding: var(--s2) 0; }
details.disclose[open] summary { margin-bottom: var(--s2); }

.catalog-item { border-top: 1px solid var(--rule-soft); padding: var(--s3) 0; display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr); gap: var(--s3); }
.catalog-item:first-child { border-top: 0; }
.catalog-item b { color: var(--ink); }
.catalog-item small { color: var(--muted); display: block; }

.example-group { margin-bottom: var(--s4); }
.example-group h3 { font-size: var(--t-sm); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: var(--s2); }
.example-list { display: flex; flex-direction: column; gap: var(--s2); align-items: flex-start; }
.example-list button {
  border: 1px solid var(--rule); background: var(--surface); border-radius: var(--r-sm);
  padding: 7px var(--s3); font-size: var(--t-sm); color: var(--ink); cursor: pointer; text-align: left; width: 100%;
}
.example-list button:hover { border-color: var(--accent-line); background: var(--accent-soft); }

/* ---------- dialogo ---------- */
dialog {
  border: 0; border-radius: var(--r-lg); padding: 0;
  width: min(640px, calc(100vw - 32px)); max-height: 88vh;
  box-shadow: var(--shadow-lg); color: var(--body); background: var(--surface);
}
dialog::backdrop { background: var(--overlay); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--surface); }
.dialog-head button { border: 0; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted); }
.dialog-body { padding: var(--s5); overflow-y: auto; }
.dialog-body > * + * { margin-top: var(--s3); }
.dialog-body .actions { display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; padding-top: var(--s2); }
.error { color: var(--stop); font-size: var(--t-sm); }

/* ---------- vuoto ---------- */
.empty { text-align: center; padding: var(--s7) var(--s5); color: var(--muted); }
.empty h2 { margin-bottom: var(--s2); }

/* ---------- stampa: scheda per il gruppo casi ---------- */
.print-sheet { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 10.5pt; }
  .demo-strip, .sidebar, main, .topbar, footer, .tabs, .no-print, dialog { display: none !important; }
  .shell { display: block; min-height: 0; }
  .view { display: none; }
  .print-sheet { display: block; padding: 0; }
  .print-sheet h1 { font-size: 20pt; }
  .print-sheet .panel { box-shadow: none; border: 1px solid #c9ccd2; break-inside: avoid; page-break-inside: avoid; padding: 10pt 12pt; }
  .print-sheet .panel + .panel { margin-top: 8pt; }
  .print-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #1c2430; padding-bottom: 6pt; margin-bottom: 10pt; }
  .print-brand { font-size: 12pt; letter-spacing: .12em; font-weight: 700; color: #1c2430; }
  .print-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8pt; }
  .print-foot { margin-top: 10pt; border-top: 1px solid #c9ccd2; padding-top: 6pt; font-size: 8pt; color: #5a6270; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- adattamento ---------- */
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; }
  .view { padding: var(--s4); }
  .topbar { padding: var(--s3) var(--s4); }
  .tech-strip { padding: 10px var(--s4); }
}
@media (max-width: 760px) {
  .shell { display: block; min-height: auto; }
  .sidebar {
    position: static; width: auto; height: auto; flex: none;
    flex-direction: row; align-items: center; justify-content: space-between;
    padding: var(--s3) var(--s4); gap: var(--s3);
  }
  .sidebar .side-quick, .sidebar .identity, .brand em { display: none; }
  .brand b { font-size: 1.2rem; }
  .menu-btn {
    display: inline-flex; border: 1px solid oklch(100% 0 0 / .25); background: transparent;
    color: #fff; border-radius: var(--r-sm); padding: 7px var(--s3); font-size: var(--t-sm); cursor: pointer;
  }
  nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--sidebar); padding: var(--s2) var(--s3) var(--s4); z-index: 30; gap: var(--s1);
  }
  .sidebar { position: relative; }
  nav.open { display: flex; }
  nav button { padding: 11px var(--s3); }
  .toolbar { grid-template-columns: 1fr; }
  .person-row { grid-template-columns: 36px 1fr; grid-template-areas: "a n" "m m" "g g"; row-gap: var(--s2); padding: var(--s3) var(--s4); }
  .person-row .avatar { grid-area: a; width: 36px; height: 36px; }
  .person-row .who { grid-area: n; }
  .person-row .meta { grid-area: m; flex-direction: row; flex-wrap: wrap; gap: var(--s2); align-items: center; }
  .person-row .go { grid-area: g; }
  .tl-item { grid-template-columns: 1fr; gap: 2px; }
  .plan > div { border-left: 0; border-top: 1px solid var(--rule-soft); }
  .plan > div:first-child { border-top: 0; }
  .ask-row { flex-direction: column; align-items: stretch; }
  table.result td.bar { display: none; }
  .quickrow { flex-direction: column; }
  h1 { font-size: var(--t-lg); }
  .tile b { font-size: var(--t-xl); }
  input, select, textarea, .btn { min-height: 44px; }
  .btn { padding: 10px var(--s4); }
}
