/* Virtual MDT platform. One stylesheet, no external fonts or assets. */

@font-face { font-family: "Instrument Sans Variable"; font-style: normal; font-display: swap; font-weight: 400 700; src: url(/fonts/instrument-sans-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Instrument Sans Variable"; font-style: normal; font-display: swap; font-weight: 400 700; src: url(/fonts/instrument-sans-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible Mono Variable"; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible Mono Variable"; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/atkinson-hyperlegible-mono-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* Colours come from the reading room: the blue of film base, the cool white of a light box, the amber of a wax marker.
   Text is Instrument Sans. Identifiers (references, national and hospital numbers, accession numbers) are set in Atkinson Hyperlegible Mono,
   drawn so that similar characters (1 l I, 0 O) cannot be confused when a number is read off a shared screen. */
:root {
  --ink: #15212c;
  --ink-soft: #435260;
  --ink-faint: #5f6e7b;
  --paper: #edf1f4;
  --surface: #ffffff;
  --line: #d2d9e0;
  --line-soft: #e5eaee;
  --brand: #14304a;
  --brand-2: #1c4f7c;
  --brand-tint: #e4ecf4;
  --accent: #a9650a;
  --accent-tint: #fff1d6;
  --marker: #f0b44c;
  --w-signed: #1f7048; --w-discussed: #5b4a8a; --w-ready: #1c4f7c; --w-waiting: #d9951f; --w-none: #d2d9e0;
  --green: #1f7048;  --green-tint: #e1f1e8;
  --red: #a8291f;    --red-tint: #fbe6e3;
  --blue: #1c4f7c;   --blue-tint: #e1ebf5;
  --purple: #5b4a8a; --purple-tint: #ece8f6;
  --grey-tint: #e8ecf0;
  --teams: #4b53bc;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(21, 33, 44, .08);
  --lift: 0 18px 50px rgba(15, 30, 45, .28);
  --side-w: 256px;
  --font: "Instrument Sans Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Atkinson Hyperlegible Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-variant-numeric: lining-nums;
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -.012em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.06rem; letter-spacing: 0; }
button, input, select, textarea { font-family: inherit; }
h3 { font-size: .95rem; margin-top: 1.25rem; }
p { margin: 0 0 .75rem; }
a { color: var(--brand-2); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--marker); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }
.loading { color: var(--ink-faint); padding: 1.5rem 0; }

/* ---- shell ---- */
.demo-banner { background: var(--accent-tint); color: #5e3a04; border-bottom: 1px solid #ecd49a; padding: .45rem 1rem; font-size: .88rem; text-align: center; }
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.topbar { display: none; }
.side {
  background: var(--brand); color: #d3deea; display: flex; flex-direction: column; padding: 1.1rem .75rem .9rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
.brand { padding: .1rem .55rem .9rem; }
.brand-name { display: block; color: #fff; font-weight: 700; font-size: 1.18rem; text-decoration: none; letter-spacing: -.015em; }
.brand-org { display: block; color: #a8bdd0; font-size: .82rem; margin-top: .1rem; }
.icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.find-btn {
  display: flex; align-items: center; gap: .55rem; width: 100%; margin: 0 0 .85rem; padding: .5rem .65rem; min-height: 2.5rem; cursor: pointer;
  background: rgba(255, 255, 255, .09); color: #d3deea; border: 1px solid rgba(255, 255, 255, .16); border-radius: 9px; font: inherit; font-size: .93rem; text-align: left;
}
.find-btn:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.find-label { flex: 1; }
.find-key { font-family: var(--mono); font-size: .72rem; color: #fff; background: rgba(255, 255, 255, .14); border-radius: 5px; padding: .08rem .38rem; }
.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav-group { margin: .95rem 0 .2rem; padding: 0 .65rem; color: #a8bdd0; font-size: .78rem; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: .65rem; padding: .5rem .65rem; border-radius: 8px; position: relative;
  color: #e2eaf2; text-decoration: none; font-size: .95rem; line-height: 1.3;
}
.nav-item .icon { opacity: .78; }
.nav-label { flex: 1; min-width: 0; }
.nav-item:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.nav-item.is-active { background: rgba(255, 255, 255, .15); color: #fff; font-weight: 650; }
.nav-item.is-active .icon { opacity: 1; }
.nav-item.is-active::before { content: ""; position: absolute; left: -.75rem; top: .45rem; bottom: .45rem; width: 4px; border-radius: 0 3px 3px 0; background: var(--marker); }
.nav-badge { background: var(--marker); color: #2a1c02; border-radius: 999px; min-width: 1.45rem; padding: 0 .4rem; text-align: center; font-size: .78rem; font-weight: 700; line-height: 1.45rem; font-variant-numeric: tabular-nums; }
.side-foot { border-top: 1px solid rgba(255, 255, 255, .14); padding: .85rem .5rem 0; margin-top: .75rem; display: flex; flex-direction: column; gap: .6rem; }
.who { display: flex; align-items: center; gap: .6rem; font-size: .9rem; min-width: 0; }
.avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; flex-shrink: 0; }
.who-text { display: flex; flex-direction: column; min-width: 0; color: #fff; line-height: 1.25; }
.who-text span { color: #a8bdd0; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.level-chip { color: #fff; border: 1px solid rgba(255, 255, 255, .4); border-radius: 999px; padding: .12rem .65rem; font-size: .8rem; font-weight: 600; text-decoration: none; }
.level-chip:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.version { color: #a8bdd0; font-size: .74rem; }
.side .btn-secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .34); }
.side .btn-secondary:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.content { min-width: 0; }
.main { padding: 2rem 2.25rem 4rem; max-width: 1200px; width: 100%; outline: none; }
.scrim { display: none; }

/* ---- page furniture ---- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-sub { color: var(--ink-soft); margin: .3rem 0 0; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; background: var(--grey-tint); padding: .25rem; border-radius: 9px; }
.tabs a { padding: .4rem .8rem; border-radius: 7px; text-decoration: none; color: var(--ink-soft); font-size: .92rem; white-space: nowrap; }
.tabs a.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.grid-2 > .card { margin: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
.card-accent { border-left: 4px solid var(--accent); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line-soft); }
.card-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.card-body { padding: 1rem 1.1rem; }
.card-body > :last-child { margin-bottom: 0; }

.note { background: var(--brand-tint); border-radius: 8px; padding: .65rem .85rem; color: #14304a; font-size: .93rem; }
.note-amber { background: var(--accent-tint); color: #5e3d07; }
.hint { color: var(--ink-faint); font-size: .88rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-soft); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-title { font-weight: 650; color: var(--ink); font-size: 1.05rem; }
.error-panel { background: var(--red-tint); color: #5c1610; border-radius: var(--radius); padding: 1rem 1.1rem; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.6rem; padding: .5rem 1rem;
  border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .93rem; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn-small { min-height: 2.1rem; padding: .3rem .7rem; font-size: .86rem; }
.btn-primary { background: var(--brand-2); color: #fff; }
.btn-primary:hover { background: var(--brand); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: #b9c3cd; }
.btn-quiet { background: transparent; color: var(--brand-2); border-color: transparent; min-height: 2.2rem; padding: .3rem .6rem; }
.btn-quiet:hover { background: var(--brand-tint); color: var(--brand); }
.btn-secondary:hover { background: var(--grey-tint); color: var(--ink); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #8a2018; }
.btn-teams { background: var(--teams); color: #fff; }
.btn-teams:hover { background: #3c44a0; color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ""; position: absolute; width: 1rem; height: 1rem; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-secondary.is-busy::after, .btn-quiet.is-busy::after { border-color: rgba(21, 33, 44, .25); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 8px; min-width: 2.4rem; min-height: 2.4rem; font-size: 1.15rem; line-height: 1; cursor: pointer; color: var(--ink-soft); }
.icon-btn:hover { background: var(--grey-tint); color: var(--ink); }

/* ---- chips ---- */
.chip { display: inline-block; padding: .08rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 650; background: var(--grey-tint); color: var(--ink-soft); vertical-align: middle; white-space: nowrap; }
.chip-green { background: var(--green-tint); color: var(--green); }
.chip-amber { background: var(--accent-tint); color: #7c5008; }
.chip-red { background: var(--red-tint); color: var(--red); }
.chip-blue { background: var(--blue-tint); color: var(--blue); }
.chip-purple { background: var(--purple-tint); color: var(--purple); }
.chip-grey { background: var(--grey-tint); color: var(--ink-faint); }

/* ---- rows ---- */
.rows { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.card-body > .rows { border: 0; box-shadow: none; margin: -1rem -1.1rem; border-radius: 0 0 var(--radius) var(--radius); }
.row { display: flex; align-items: stretch; border-top: 1px solid var(--line-soft); }
.row:first-child { border-top: 0; }
.row-child .row-main { padding-left: 2.4rem; }
.row-main { flex: 1; min-width: 0; padding: .8rem 1.1rem; text-decoration: none; color: inherit; display: block; }
a.row-main:hover { background: #f5f8fb; color: inherit; }
.row-title { font-weight: 650; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.row-num { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-size: .8rem; }
.row-meta { color: var(--ink-faint); font-size: .86rem; margin-top: .1rem; }
.row-text { margin-top: .3rem; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-sub { color: var(--ink-soft); font-size: .88rem; margin-top: .25rem; }
.row-badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.row-badges:empty { display: none; }
.row-side { display: flex; align-items: center; gap: .25rem; padding: .5rem .9rem .5rem 0; flex-shrink: 0; }
.rows-tight .row-main { padding: .5rem 1.1rem; }
.plain { list-style: none; }
.plain li { padding: .2rem 0; }

/* ---- patient banner ---- */
/* Drawn like a patient wristband: a white band with a heavy edge, so the patient's identity is the firmest thing on the page. */
.patient-banner { background: var(--surface); color: var(--ink); border: 1.5px solid var(--brand); border-left-width: 9px; border-radius: 10px; padding: .7rem 1.1rem; display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; align-items: baseline; margin-bottom: 1rem; }
.pb-name { font-weight: 700; font-size: 1.2rem; color: var(--ink); letter-spacing: -.01em; }
.pb-item { font-size: .92rem; }
.ref-bar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: -.4rem 0 1rem; }
.ref { display: inline-flex; align-items: baseline; gap: .4rem; font: inherit; font-size: .84rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .28rem .7rem; cursor: pointer; min-height: 2rem; }
.ref:hover { border-color: var(--brand-2); }
.ref-k { color: var(--ink-faint); font-size: .8rem; }
.ref-v { font-family: var(--mono); font-weight: 650; }
.ref-link { color: var(--brand-2); border-style: dashed; }
.sheet-ref { font-family: var(--mono); font-size: .88em; }
.pb-k { color: var(--ink-faint); font-size: .84rem; }
.id { font-family: var(--mono); font-size: .96em; }

/* ---- definition lists and prose ---- */
.dl { display: grid; grid-template-columns: minmax(130px, 210px) minmax(0, 1fr); gap: .5rem 1.25rem; margin: 0; }
.dl dt { color: var(--ink-faint); font-size: .88rem; padding-top: .1rem; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.prose { white-space: pre-wrap; margin: 0; }

/* ---- forms ---- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.1rem; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field-label { font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.field-hint { font-size: .82rem; color: var(--ink-faint); }
.field-error, .form-error { color: var(--red); font-size: .9rem; font-weight: 600; margin: 0; }
.form-error { background: var(--red-tint); padding: .6rem .8rem; border-radius: 8px; }
.req { color: var(--red); }
input[type=text], input[type=email], input[type=url], input[type=search], input[type=date], input[type=month], input[type=time], input[type=number], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff; border: 1px solid #aab5c0; border-radius: 8px; padding: .5rem .65rem; min-height: 2.6rem;
}
textarea { resize: vertical; line-height: 1.45; }
input:disabled, select:disabled, textarea:disabled { background: var(--grey-tint); color: var(--ink-soft); }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--marker); outline-offset: 0; border-color: var(--brand-2); }
.check { display: inline-flex; align-items: flex-start; gap: .5rem; cursor: pointer; padding: .25rem 0; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: .18rem; accent-color: var(--brand-2); flex-shrink: 0; }
.checks { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; }
.checks-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: .75rem; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.repeater { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .6rem; }
.repeater-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .5rem; align-items: center; }
.study-row { grid-template-columns: minmax(0, 1.1fr) minmax(0, .8fr) minmax(0, 1.6fr) minmax(0, 1fr) auto auto; }
.field-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr) minmax(0, 1.1fr) minmax(0, 1.3fr) auto auto auto; }
.member-row { grid-template-columns: minmax(0, 1.6fr) minmax(0, .9fr) minmax(0, .9fr) auto auto auto; }
.dx-picker { display: flex; flex-direction: column; gap: .35rem; }
.tnm-row { display: grid; grid-template-columns: repeat(3, minmax(0, 5.5rem)) minmax(0, 11rem); gap: .5rem; }
.match-box { background: var(--accent-tint); border-radius: 8px; padding: .75rem .9rem; margin-top: .9rem; }
.match-chosen { background: var(--green-tint); }
.match-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .35rem 0; flex-wrap: wrap; }
.search-form { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search-box { flex: 1; }

/* ---- tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1.25rem; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .75rem .95rem .8rem; text-decoration: none; color: var(--ink-soft); display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
a.tile:hover { border-color: var(--brand-2); color: var(--ink); }
.tile-n { font-size: 1.8rem; font-weight: 700; line-height: 1; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.tile-l { font-size: .92rem; line-height: 1.25; }
.tile-on .tile-n { color: var(--brand-2); }
.tile-on .tile-l, .tile-warn .tile-l { color: var(--ink); }
.tile-warn { border-color: #e3c684; background: var(--accent-tint); }
.tile-warn .tile-n { color: #8a5206; }

/* ---- case record ---- */
.studies, .actions-list, .timeline, .bars, .guide { list-style: none; }
.study, .action { display: flex; justify-content: space-between; gap: .75rem; align-items: center; padding: .6rem 0; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.study:first-child, .action:first-child { border-top: 0; padding-top: 0; }
.study-side, .action-side { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.action.is-done strong { text-decoration: line-through; color: var(--ink-faint); font-weight: 500; }
.prep { border-left: 3px solid var(--blue-tint); padding: .15rem 0 .15rem .9rem; margin-top: .9rem; }
.prep-mine { border-left-color: var(--brand-2); }
.prep-head { font-size: .88rem; color: var(--ink-faint); margin-bottom: .3rem; }
.prep-head strong { color: var(--ink); }
.prep textarea { margin-bottom: .5rem; }
.outcome { margin-top: 1rem; }
.outcome:first-child { margin-top: 0; }
.outcome-head { font-size: .9rem; color: var(--ink-soft); margin-bottom: .6rem; }
.outcome-current { background: var(--green-tint); border-radius: 8px; padding: .9rem 1rem; }
details { margin-top: .75rem; }
summary { cursor: pointer; color: var(--brand-2); font-size: .92rem; }
.timeline li { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); gap: .75rem; padding: .35rem 0; border-top: 1px solid var(--line-soft); font-size: .92rem; }
.timeline li:first-child { border-top: 0; }
.tl-when, .tl-who { color: var(--ink-faint); }
.guide { counter-reset: g; }
ol.guide li { counter-increment: g; padding: .35rem 0 .35rem 2.2rem; position: relative; }
ol.guide li::before { content: counter(g); position: absolute; left: 0; top: .35rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-size: .8rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
ul.guide li { padding: .3rem 0 .3rem 1.1rem; position: relative; }
ul.guide li::before { content: ""; position: absolute; left: 0; top: .85rem; width: .4rem; height: .4rem; border-radius: 50%; background: var(--brand-2); }

/* ---- running a meeting ---- */
.run { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.run-side { position: sticky; top: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.back { display: block; font-weight: 650; text-decoration: none; margin-bottom: .25rem; }
.run-select { display: none; }
.run-list { list-style: none; margin-top: .6rem; }
.run-section { font-size: .82rem; font-weight: 650; color: var(--ink-faint); padding: .7rem .4rem .25rem; }
.run-item a { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; gap: .4rem; padding: .4rem; border-radius: 7px; text-decoration: none; color: var(--ink); font-size: .9rem; align-items: center; }
.run-item a:hover { background: var(--grey-tint); }
.run-item.is-current a { background: var(--brand-tint); font-weight: 650; }
.run-n { color: var(--ink-faint); font-size: .82rem; }
.run-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-state { color: var(--green); font-size: .8rem; letter-spacing: -.15em; }
.run-discussed { color: var(--purple); }
.run-nav { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.run-main > .run-nav:last-child { margin: 1rem 0 0; }
.run-pos { color: var(--ink-faint); font-size: .9rem; }

/* ---- audit ---- */
.bars li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: .6rem; align-items: center; padding: .28rem 0; font-size: .9rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--grey-tint); border-radius: 999px; height: .6rem; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand-2); border-radius: 999px; }
.bar-n { font-variant-numeric: tabular-nums; color: var(--ink-soft); min-width: 4.2rem; text-align: right; }
.table-wrap { overflow-x: auto; margin: -1rem -1.1rem; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .8rem; color: var(--ink-faint); font-weight: 650; padding: .6rem 1.1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .55rem 1.1rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }

/* ---- modal and toast ---- */
.has-modal { overflow: hidden; }
.overlay { position: fixed; inset: 0; background: rgba(15, 30, 45, .5); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 1rem; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px; box-shadow: var(--lift); }
.modal-wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.2rem; border-bottom: 1px solid var(--line-soft); }
.modal-body { padding: 1.1rem 1.2rem 1.2rem; }
.modal-body > * + * { margin-top: .9rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; margin-top: 1.1rem; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 150%); background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 10px; z-index: 80; max-width: min(92vw, 520px); box-shadow: 0 8px 24px rgba(0, 0, 0, .2); transition: transform .2s ease, visibility 0s .2s; visibility: hidden; font-size: .95rem; }
.toast.is-shown { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }
.toast-error { background: var(--red); }

/* ---- sign-in pages ---- */
.gate { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem; }
.gate-card { width: 100%; max-width: 640px; }
.gate-card h1 { margin-bottom: .5rem; }
.gate-lead { color: var(--ink-soft); margin-bottom: 1.25rem; }
.gate-foot { color: var(--ink-faint); font-size: .86rem; margin-top: 1rem; }
.progress { display: block; height: .7rem; max-width: 420px; }

/* ---- printable sheets ---- */
.print-bar { display: flex; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.sheet { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2.2rem 2.4rem; max-width: 820px; margin: 0 auto; }
/* A long word, address or code with no spaces must wrap, on a phone and on paper, and never push the page wider than itself. */
.sheet { overflow-wrap: anywhere; min-width: 0; }
.sheet table { width: 100%; max-width: 100%; }
.sheet td, .sheet th, .sheet dd, .sheet p, .sheet li { overflow-wrap: anywhere; word-break: break-word; }
.sheet-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--ink); padding-bottom: .8rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.sheet-org { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.sheet-meta { text-align: right; }
.sheet-meta p { margin: 0; }
.sheet h2 { font-size: 1rem; margin: 1.4rem 0 .6rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line); }
.sheet-patient { background: var(--paper); border-radius: 6px; padding: .8rem 1rem; }
.sheet-foot { margin-top: 1.8rem; border-top: 1px solid var(--line); padding-top: .7rem; color: var(--ink-soft); font-size: .84rem; }
.sheet-foot p { margin: 0 0 .2rem; }
.list-case { padding: .7rem 0; border-top: 1px solid var(--line-soft); break-inside: avoid; }
.list-case h3 { margin: 0 0 .3rem; }
.list-case p { margin: 0 0 .25rem; }
.list-case-meta { color: var(--ink-soft); font-weight: 400; font-size: .86rem; }
.write-space { border: 1px solid var(--line); border-radius: 4px; min-height: 3.2rem; padding: .3rem .5rem; color: var(--ink-faint); font-size: .8rem; margin-top: .4rem; }

/* ---- small screens ---- */
@media (max-width: 900px) {
  .shell { display: block; }
  .topbar { display: flex; align-items: center; gap: .5rem; background: var(--brand); padding: .45rem .75rem; position: sticky; top: 0; z-index: 30; }
  .topbar .brand-name { font-size: 1.05rem; }
  .menu-btn { color: #fff; font-size: 1.4rem; }
  .menu-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(84vw, 300px); height: auto; transform: translateX(-102%); transition: transform .2s ease; z-index: 41; }
  .nav-open .side { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 30, 45, .5); z-index: 40; }
  .top-find { margin-left: auto; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
  .top-find:hover { background: rgba(255, 255, 255, .12); color: #fff; }
  .find-key { display: none; }
  .nav-item { padding: .6rem .65rem; }
  .main { padding: 1.1rem 1rem 4rem; }
  h1 { font-size: 1.4rem; }
  .run { display: block; }
  .run-side { position: static; max-height: none; margin-bottom: 1rem; }
  .run-select { display: block; margin-top: .5rem; }
  .run-list { display: none; }
}
@media (max-width: 680px) {
  .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .dl dt { margin-top: .6rem; }
  .dl dt:first-child { margin-top: 0; }
  .row { flex-direction: column; }
  .row-side { padding: 0 1.1rem .8rem; }
  .repeater-row, .study-row, .field-row, .member-row { grid-template-columns: minmax(0, 1fr) auto auto; background: var(--paper); padding: .6rem; border-radius: 8px; }
  .repeater-row > :not(.icon-btn) { grid-column: 1 / -1; }
  .repeater-row > .icon-btn { grid-row: auto; justify-self: end; }
  .study-row > .check { grid-column: 1 / 3; }
  .study-row > .icon-btn { grid-column: 3; }
  .tnm-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tnm-row select { grid-column: 1 / -1; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .form-actions .btn { flex: 1 1 auto; }
  .modal-actions .btn { flex: 1 1 auto; }
  .overlay { padding: 0; align-items: stretch; }
  .modal { border-radius: 0; max-width: none; min-height: 100%; }
  .sheet { padding: 1.2rem 1rem; }
  .table thead { display: none; }
  .table tr { display: block; padding: .6rem 1.1rem; border-bottom: 1px solid var(--line-soft); }
  .table td { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .5rem; padding: .12rem 0; border: 0; }
  .table td::before { content: attr(data-label); color: var(--ink-faint); font-size: .82rem; }
  .table td:empty { display: none; }
  .bars li { grid-template-columns: minmax(0, 1fr) auto; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .search-form { flex-direction: column; }
  .toast { bottom: 1rem; }
}

@media print {
  body { background: #fff; }
  .no-print, .topbar, .side, .scrim, .demo-banner, #toast { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .sheet { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 16mm; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- version 0.2.0: files, merge, import ---- */
.file-name { overflow-wrap: anywhere; }
.files .study-main { min-width: 0; flex: 1 1 14rem; }
.file-add { border-top: 1px solid var(--line-soft); margin-top: .9rem; padding-top: .9rem; }
.file-add-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.file-add-row input[type=file] { flex: 1 1 15rem; min-width: 0; max-width: 100%; }
.file-add-row select { flex: 0 1 13rem; width: auto; }
.file-add .hint { margin-top: .5rem; }
input[type=file] { font: inherit; padding: .35rem; border: 1px dashed var(--line); border-radius: 8px; background: var(--paper); width: 100%; }
.search-row { display: flex; gap: .5rem; }
.search-row input { flex: 1; min-width: 0; }
.compare-wrap { margin: 0; border: 1px solid var(--line); border-radius: 8px; }
.compare { table-layout: fixed; }
.compare th, .compare td { padding: .5rem .7rem; overflow-wrap: anywhere; }
.compare tbody th { width: 7.5rem; white-space: normal; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.compare thead th { white-space: normal; }
.compare thead th:first-child { width: 7.5rem; }
.table td > .chip { justify-self: start; }
.stack > [hidden] { display: none; }
.compare tr.is-different td { background: var(--accent-tint); font-weight: 600; }
.compare-cases { font-size: .86rem; margin-top: .25rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; }
.stat { background: var(--paper); border-radius: 8px; padding: .7rem .85rem; }
.stat strong { display: block; font-size: 1.5rem; line-height: 1.2; }
.stat span { color: var(--ink-soft); font-size: .86rem; }
.more-row { justify-content: center; margin-top: .25rem; }
.print-bar .form-actions { justify-content: flex-end; }
@media (max-width: 680px) {
  /* The comparison stays a three-column table on a phone: the two records must be read side by side. */
  .table.compare thead { display: table-header-group; }
  .table.compare tr { display: table-row; padding: 0; }
  .table.compare td, .table.compare th { display: table-cell; padding: .45rem .5rem; font-size: .86rem; border-bottom: 1px solid var(--line-soft); }
  .table.compare td::before { content: none; }
  .compare tbody th, .compare thead th:first-child { width: 5.2rem; }
  .file-add-row select, .file-add-row .btn { flex: 1 1 100%; width: 100%; }
}

/* ---- version 0.3.0: cover, reports, search filters ---- */
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filters { margin: 0 0 1rem; }
.filters .form-grid { margin-top: .6rem; }
.mins-label { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink-soft); font-size: .9rem; }
.mins { width: 5rem; }
.nav-external { display: flex; }
.nav-out { opacity: .7; }
.table-note { margin-bottom: .9rem; }
@media (max-width: 900px) { .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .form-grid-4 { grid-template-columns: minmax(0, 1fr); } .mins-label { flex: 1 1 100%; } }

/* ---- version 0.4.0: meeting record ---- */
.record-section { margin: 1.1rem 0 .2rem; font-size: 1rem; color: var(--ink-soft); }

/* ---- version 0.5.0: backups and storage ---- */
.bar-warn { background: var(--amber, #c9891d); }

/* ---- version 0.6.0: reference numbers (see .ref above) ---- */

/* ---- version 0.7.0: readiness strip, next meeting, quick find, access levels ---- */
/* One block for each case on a list. Waiting is hatched as well as coloured, so the strip does not depend on colour alone. */
.wedge { display: flex; gap: 3px; height: 9px; max-width: 22rem; min-width: 0; }
.wedge-large { height: 14px; max-width: 34rem; }
.wedge-seg { flex: 0 1 auto; width: 28px; min-width: 3px; border-radius: 2px; background: var(--w-none); }
.wedge-large .wedge-seg { width: 44px; border-radius: 3px; }
.wedge-signed { background: var(--w-signed); }
.wedge-discussed { background: var(--w-discussed); }
.wedge-ready { background: var(--w-ready); }
.wedge-waiting { background: repeating-linear-gradient(135deg, var(--w-waiting) 0 3px, #f3cf8c 3px 6px); }
.wedge-long { width: 100%; }
.wedge-empty { border: 1px dashed #aab5c0; border-radius: 3px; width: 4.5rem; }
.legend { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; font-size: .88rem; color: var(--ink-soft); margin-top: .45rem; }
.legend-item { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.legend-dot { width: .7rem; height: .7rem; border-radius: 2px; }
.row-wedge { display: flex; align-items: center; gap: .7rem; margin-top: .45rem; }
.row-wedge .wedge { flex: 0 1 auto; max-width: min(16rem, 60%); }
.wedge-long .wedge-seg { width: auto; }
.row-wedge .row-meta { margin: 0; white-space: nowrap; }
.list-state { margin: 0 0 1rem; }
.sub-actions { display: flex; flex-wrap: wrap; gap: .15rem .25rem; margin: -.5rem 0 1rem -.6rem; }

.next { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.3rem 1.4rem; margin-bottom: 1.25rem;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; align-items: end; }
.next-when { margin: 0 0 .35rem; color: #8a5206; font-weight: 700; font-size: .95rem; }
.next-name { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.next-name a { color: var(--ink); text-decoration: none; }
.next-name a:hover { color: var(--brand-2); text-decoration: underline; }
.next-date { margin: .3rem 0 0; color: var(--ink-soft); }
.next-list { grid-column: 1; }
.next-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: .5rem; align-self: center; }
.next-actions .btn { min-width: 11rem; }

.palette-overlay { padding-top: 12vh; }
.palette { background: var(--surface); width: 100%; max-width: 580px; border-radius: 14px; box-shadow: var(--lift); overflow: hidden; }
.palette-input { border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; padding: 1rem 1.15rem !important; font-size: 1.08rem !important; min-height: 3.4rem; outline: none !important; }
.palette-list { list-style: none; max-height: min(50vh, 26rem); overflow-y: auto; padding: .35rem; }
.palette-item { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); gap: .6rem; align-items: baseline; padding: .55rem .75rem; border-radius: 8px; cursor: pointer; }
.palette-item.is-active { background: var(--brand-tint); }
.palette-item.is-dead { cursor: default; color: var(--red); background: var(--red-tint); }
.palette-kind { color: var(--ink-faint); font-size: .82rem; }
.palette-label { font-weight: 600; overflow-wrap: anywhere; }
.palette-foot { margin: 0; padding: .6rem 1.15rem; border-top: 1px solid var(--line-soft); color: var(--ink-faint); font-size: .82rem; }

.access-mine { margin: 0 0 .75rem; }
.levels { list-style: none; display: grid; gap: .1rem; }
.level { display: grid; grid-template-columns: 9.5rem auto minmax(0, 1fr); gap: .25rem .75rem; align-items: baseline; padding: .55rem .6rem; border-radius: 8px; }
.level > span:last-child { grid-column: 3; color: var(--ink-soft); }
.level.is-mine { background: var(--brand-tint); }
.matrix-wrap { margin: 0; }
.matrix { table-layout: fixed; }
.matrix th, .matrix td { padding: .6rem .9rem; }
.matrix thead th { white-space: normal; font-size: .84rem; color: var(--ink); vertical-align: bottom; }
.matrix thead th:first-child { font-size: 1.02rem; font-weight: 700; }
.matrix thead th:first-child { width: 44%; }
.matrix tbody th { font-weight: 500; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: .95rem; color: var(--ink); white-space: normal; }
.matrix tr:last-child th { border-bottom: 0; }
.matrix-who { display: none; }
.matrix-note { display: block; color: var(--ink-faint); font-size: .84rem; font-weight: 400; margin-top: .1rem; }
.matrix-col, .matrix-cell { text-align: center !important; padding-left: .3rem !important; padding-right: .3rem !important; }
.matrix .is-mine { background: var(--brand-tint); }
.tick { color: var(--green); font-weight: 700; font-size: 1.05rem; }
.cross { color: #9aa6b1; }

@media (max-width: 900px) {
  .next { grid-template-columns: minmax(0, 1fr); padding: 1.1rem; }
  .next-actions { grid-column: 1; grid-row: auto; flex-direction: row; flex-wrap: wrap; }
  .next-actions .btn { flex: 1 1 9rem; min-width: 0; }
  .next-name { font-size: 1.35rem; }
}
@media (max-width: 680px) {
  .sub-actions { margin-left: -.4rem; }
  .palette-overlay { padding: 0; }
  .palette { border-radius: 0; max-width: none; min-height: 100%; }
  .palette-item { grid-template-columns: 4.6rem minmax(0, 1fr); }
  .level { grid-template-columns: minmax(0, 1fr) auto; }
  .level > span:last-child { grid-column: 1 / -1; }
  .matrix thead { display: block; }
  .matrix thead tr { display: block; padding: .8rem 1.1rem .2rem; border: 0; }
  .matrix thead th { display: none; }
  .matrix thead th:first-child { display: block; width: auto; padding: 0; border: 0; }
  .matrix tbody th { display: block; width: auto; border: 0; padding: 0; font-weight: 600; }
  .matrix .matrix-cell { display: none; }
  .matrix-who { display: block; color: var(--green); font-weight: 650; font-size: .9rem; margin-top: .15rem; }
}

/* ---- version 0.8.0: teams and profiles ---- */
.who-name { color: #fff; font-weight: 700; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-name:hover { color: #fff; text-decoration: underline; }
.stack-tight > * + * { margin-top: .45rem; }
.pick-list { list-style: none; border: 1px solid var(--line); border-radius: 8px; max-height: 15rem; overflow-y: auto; }
.pick-list li + li { border-top: 1px solid var(--line-soft); }
.pick-item { display: flex; flex-direction: column; gap: .05rem; width: 100%; text-align: left; padding: .5rem .75rem; background: none; border: 0; font: inherit; color: var(--ink); cursor: pointer; }
.pick-item span { color: var(--ink-faint); font-size: .86rem; }
button.pick-item:hover, button.pick-item:focus-visible { background: var(--brand-tint); }
.pick-item.is-in { cursor: default; color: var(--ink-faint); }
.pick-none { padding: .6rem .75rem; color: var(--ink-faint); font-size: .9rem; }
.new-person { background: var(--paper); border-radius: 8px; padding: .8rem .9rem; }
.team-note { padding: .7rem 1.1rem 0; margin: -1rem -1.1rem 1rem; }
.btn-danger + .btn { margin-left: auto; }
@media (max-width: 680px) { .btn-danger + .btn { margin-left: 0; } }

/* ---- version 0.9.0: the help manual ---- */
.help-bar { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; margin: 0 0 .4rem; }
.help-search { flex: 1 1 22rem; max-width: 36rem; min-height: 2.9rem !important; font-size: 1.02rem !important; }
.help-count { margin: 0 0 .6rem; }
.help-group { font-size: .95rem; color: var(--ink-faint); font-weight: 650; margin: 1.3rem 0 .45rem; }
.help-topic { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: .4rem; }
.help-topic > summary { cursor: pointer; padding: .7rem 1rem; list-style: none; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.help-topic > summary::-webkit-details-marker { display: none; }
.help-topic > summary::before { content: "+"; width: 1.1rem; font-weight: 700; color: var(--brand-2); font-size: 1.15rem; line-height: 1; }
.help-topic[open] > summary::before { content: "\2212"; }
.help-topic[open] > summary { border-bottom: 1px solid var(--line-soft); }
.help-title { font-weight: 650; flex: 1 1 14rem; }
.help-body { padding: .2rem 1.1rem .9rem 1.4rem; max-width: 46rem; }
.help-go { margin: .6rem 0 0; }
.gate-group { font-size: .95rem; margin: 1.2rem 0 .1rem; }
.gate-group + .hint { margin: 0 0 .5rem; }

/* ---- version 0.10.0: the reporting dashboard ---- */
/* Chart colours are a checked set, used in this fixed order. Text never takes a series colour. */
.viz-root { --viz-1: #257de0; --viz-2: #f47230; --viz-3: #00b894; --viz-4: #f2a600; --viz-5: #ee7fac; --viz-6: #008a17; }
.viz-s1 { fill: var(--viz-1); } .viz-s2 { fill: var(--viz-2); }
.viz-bg1 { background: var(--viz-1); } .viz-bg2 { background: var(--viz-2); } .viz-bg3 { background: var(--viz-3); } .viz-bg4 { background: var(--viz-4); } .viz-bg5 { background: var(--viz-5); } .viz-bg6 { background: var(--viz-6); }
.viz-filters { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-end; margin: 0 0 .8rem; }
.viz-filters .field { min-width: 13rem; }
.viz-custom { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.viz-custom[hidden] { display: none; }
.viz-scope { margin-top: 0; }
.viz-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.viz-tiles .tile-n { font-size: 1.5rem; color: var(--ink); }
.viz-group { font-size: 1.15rem; margin: 1.6rem 0 .6rem; scroll-margin-top: 4.5rem; }
.viz-jump { display: flex; flex-wrap: wrap; gap: .4rem; margin: .9rem 0 0; }
.viz-grid-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; align-items: start; }
.viz-card { margin: 0; padding: 1rem 1.1rem 1.05rem; min-width: 0; }
.viz-wide { grid-column: 1 / -1; }
.viz-title { font-size: 1rem; font-weight: 650; margin: 0 0 .7rem; letter-spacing: 0; }
.viz-note { margin: .7rem 0 0; }
.viz-columns { width: 100%; height: auto; display: block; overflow: visible; }
.viz-grid { stroke: var(--line-soft); stroke-width: 1; }
.viz-axis { stroke: #9aa6b1; stroke-width: 1; }
.viz-tick { fill: var(--ink-faint); font-size: 11px; font-family: var(--font); }
.viz-legend { margin: 0 0 .5rem; }
.viz-bars { list-style: none; display: grid; gap: .5rem; }
.viz-row { display: grid; grid-template-columns: minmax(7rem, 38%) minmax(3rem, 1fr) auto; gap: .2rem .75rem; align-items: center; }
.viz-name { font-size: .92rem; line-height: 1.25; overflow-wrap: anywhere; }
.viz-track { height: 12px; border-radius: 0 4px 4px 0; display: block; }
.viz-track-on { background: var(--grey-tint); border-radius: 4px; }
.viz-fill { display: block; height: 100%; min-width: 2px; background: var(--viz-1); border-radius: 0 4px 4px 0; }
.viz-track-on .viz-fill { border-radius: 4px; }
.viz-num { font-variant-numeric: tabular-nums; font-weight: 650; font-size: .92rem; text-align: right; white-space: nowrap; min-width: 5.2rem; }
.viz-share { display: inline-block; min-width: 2.9rem; margin-left: .5rem; color: var(--ink-faint); font-weight: 400; font-size: .84rem; }
.viz-meters .viz-share { min-width: 4.6rem; }
.viz-f1 { fill: var(--viz-1); } .viz-f2 { fill: var(--viz-2); } .viz-f3 { fill: var(--viz-3); } .viz-f4 { fill: var(--viz-4); } .viz-f5 { fill: var(--viz-5); } .viz-f6 { fill: var(--viz-6); }
.viz-pie { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 1.1rem; align-items: center; }
.viz-ring { width: 132px; height: 132px; display: block; }
.viz-ring-n { fill: var(--ink); font-size: 22px; font-weight: 700; font-family: var(--font); }
.viz-ring-l { fill: var(--ink-faint); font-size: 10px; font-family: var(--font); }
.viz-key { list-style: none; display: grid; gap: .4rem; }
.viz-alone .viz-bars, .viz-alone .viz-pie { max-width: 46rem; }
.viz-key li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .6rem; align-items: center; }
.viz-figures { margin-top: .6rem; }
.viz-figures > summary { cursor: pointer; color: var(--brand-2); font-size: .88rem; }
.viz-figures .table-wrap { margin: .5rem 0 0; }
.viz-tip { position: absolute; z-index: 90; background: var(--ink); color: #fff; padding: .3rem .55rem; border-radius: 6px; font-size: .82rem; pointer-events: none; white-space: nowrap; }
.viz-tip[hidden] { display: none; }
@media (max-width: 980px) { .viz-grid-cards { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 680px) {
  .viz-row { grid-template-columns: minmax(0, 1fr) auto; }
  .viz-track { grid-column: 1 / -1; grid-row: 2; }
  .viz-num { min-width: 0; }
  .viz-filters .field { min-width: 0; flex: 1 1 100%; }
  .viz-pie { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .viz-pie .viz-key { width: 100%; }
}
@media print { .viz-grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .viz-card { break-inside: avoid; } .viz-figures { display: none; } }
