/* NOMIC Ramp app styles. Tokens and components come from the mock-up (mockups/mockup.src.html). */
/* Brand: GOSA grey and red, made NOMIC's own. Warm charcoal greys lead; brick red is kept for the wordmark and the one next action.
   Deliberately not LOSA Collaborative navy + bright red, not an airline livery red, not Sanomic sage. */
:root {
  --bg: #eeeceb;          /* warm concrete */
  --surface: #ffffff;
  --surface-2: #e2dfdd;
  --ink: #23211f;
  --muted: #625d58;
  --line: #cdc8c3;
  --steel: #3a3735;       /* GOSA grey: bar, charts, selected states */
  --steel-ink: #ffffff;
  --accent: #a3322b;      /* brick red: wordmark and next action only */
  --accent-ink: #ffffff;
  --navy: var(--steel);
  --help: #186b42;  --help-bg: #e1f1e8;
  --hinder: #934509; --hinder-bg: #fbeadb;
  --adjust: #3d5a80; --adjust-bg: #e2e9f3;
  --prof: #0f6e6a;  --prof-bg: #dcefee;
  --uos: #8e1f5c;   --uos-bg: #f5e0eb;
  --focus: #0b63ce;
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r: 6px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #181716; --surface: #222120; --surface-2: #2e2c2a; --ink: #ece9e6; --muted: #aaa39c; --line: #403c39;
  --steel: #121110; --steel-ink: #ece9e6; --accent: #c8463d; --accent-ink: #ffffff; --navy: #d9d4cf;
  --help: #6fd19f; --help-bg: #1b3328; --hinder: #f0a060; --hinder-bg: #3a2717; --adjust: #9db8de; --adjust-bg: #222e3e;
  --prof: #6fd3cc; --prof-bg: #163533; --uos: #ef8fc1; --uos-bg: #3b1d2d; --focus: #6aa8ff; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #181716; --surface: #222120; --surface-2: #2e2c2a; --ink: #ece9e6; --muted: #aaa39c; --line: #403c39;
  --steel: #121110; --steel-ink: #ece9e6; --accent: #c8463d; --accent-ink: #ffffff; --navy: #d9d4cf;
  --help: #6fd19f; --help-bg: #1b3328; --hinder: #f0a060; --hinder-bg: #3a2717; --adjust: #9db8de; --adjust-bg: #222e3e;
  --prof: #6fd3cc; --prof-bg: #163533; --uos: #ef8fc1; --uos-bg: #3b1d2d; --focus: #6aa8ff; color-scheme: dark }

* { box-sizing: border-box }
[hidden] { display: none !important }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font-body); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; text-wrap: balance; margin: 0 }
h1 { font-size: 2.1rem } h2 { font-size: 1.5rem } h3 { font-size: 1.2rem; letter-spacing: .01em }
p { margin: 0 } a { color: var(--navy) }
.mono { font-family: var(--font-mono); font-size: .86em; font-variant-numeric: tabular-nums }
.label { font: 600 .74rem/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }
button, input, select, textarea { font: inherit; color: inherit }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px }

/* top bar */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: var(--steel); color: var(--steel-ink); border-bottom: 4px solid var(--accent) }
.bar-in { max-width: 1080px; margin: 0 auto; padding-inline: 16px; display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap }
.wordmark { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); color: var(--steel-ink); text-decoration: none }
.wordmark b { font-size: 1.45rem; font-weight: 700; letter-spacing: .08em; background: var(--accent); color: var(--accent-ink); padding: 2px 8px 0; border-radius: 3px }
.wordmark span { font-size: 1.15rem; font-weight: 600; color: var(--steel-ink); letter-spacing: .14em; text-transform: uppercase }
.tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1 1 auto; min-width: 0; scrollbar-width: none }
.tabs a { color: color-mix(in srgb, var(--steel-ink) 78%, transparent); text-decoration: none; padding: 16px 12px 12px; border-bottom: 4px solid transparent; white-space: nowrap; font-weight: 500 }
.tabs a[aria-current="page"] { color: var(--steel-ink); border-bottom-color: var(--accent) }

.banner { background: var(--surface-2); color: var(--muted); font-size: .88rem }
.banner .in { max-width: 1080px; margin: 0 auto; padding: 8px 16px }

main { max-width: 1080px; margin: 0 auto; padding-inline: 16px; padding-block: 24px 64px }
.screen { display: grid; gap: 20px }
.head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap }
.head > div { display: grid; gap: 6px; min-width: 0 }
.lede { color: var(--muted); max-width: 62ch }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: center }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr } }
.hero-text { display: grid; gap: 14px; min-width: 0 }
.hero-art { margin: 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); max-width: 100% }
.hero-art svg { display: block; width: 100%; height: auto }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: grid; gap: 14px; min-width: 0 }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); padding: 10px 16px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink) }
.btn:hover { background: var(--surface-2) }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-size: 1.05rem; padding: 14px 22px }
.btn.primary:hover { filter: brightness(1.08) }
.btn.big { font-size: 1.2rem; padding: 18px 28px }
.btn.quiet { border-color: transparent; background: transparent; color: var(--navy); padding-inline: 8px }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center }

/* (stand strip from the mock-up, kept for the home screen later) */
/* stand strip: progress like a row of numbered stands */
.stands { display: grid; grid-template-columns: repeat(20, 1fr); gap: 5px }
@media (max-width: 560px) { .stands { grid-template-columns: repeat(10, 1fr) } }
.stands i { height: 34px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line) }
.standkey { display: flex; flex-wrap: wrap; gap: 16px; font-size: .9rem; color: var(--muted) }
.standkey span { display: inline-flex; align-items: center; gap: 6px }
.standkey i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); background: var(--surface-2) }
.standkey i.done { background: var(--navy); border-color: var(--navy) }
.standkey i.part { background: var(--hinder); border-color: var(--hinder) }
.stands i.done { background: var(--navy); border-color: var(--navy) }
.stands i.part { background: var(--hinder); border-color: var(--hinder) }

table { border-collapse: collapse; width: 100% }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top }
th { font: 600 .74rem/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }
.tablewrap { overflow-x: auto }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap }
.pill.notes { background: var(--hinder-bg); color: var(--hinder) }
.pill.coded { background: var(--adjust-bg); color: var(--adjust) }
.pill.checked { background: var(--help-bg); color: var(--help) }

/* form */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px }
.field { display: grid; gap: 6px }
.field label { font-weight: 600; font-size: .95rem }
.field small { color: var(--muted) }
input[type=text], input[type=date], input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 10px 12px }
.seg { display: flex; flex-wrap: wrap; gap: 6px }
.seg label { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; cursor: pointer; font-weight: 500; font-size: .95rem }
.seg input { position: absolute; opacity: 0; pointer-events: none }
.seg input:checked + span { font-weight: 700 }
.seg label:has(input:checked) { background: var(--ink); color: var(--bg); border-color: var(--ink) }
.seg label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px }
.note-priv { border-left: 4px solid var(--help); background: var(--help-bg); padding: 10px 14px; border-radius: 0 var(--r) var(--r) 0; color: var(--ink) }


/* coding */
.code-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start }
@media (max-width: 820px) { .code-layout { grid-template-columns: 1fr } }
.narrative { font-size: 1.04rem; line-height: 1.8; max-width: 68ch }
.narrative p + p { margin-top: 12px }
.narrative .t { color: var(--muted); font-family: var(--font-mono); font-size: .82em; margin-right: 6px }
mark { border-radius: 3px; padding: 1px 2px; cursor: pointer; color: inherit; border-bottom: 2px solid }
mark.condition_hindering { background: var(--hinder-bg); border-color: var(--hinder) }
mark.condition_helping { background: var(--help-bg); border-color: var(--help) }
mark.adjustment { background: var(--adjust-bg); border-color: var(--adjust) }
mark.proficiency { background: var(--prof-bg); border-color: var(--prof) }
mark.undesired_state { background: var(--uos-bg); border-color: var(--uos) }
mark.sel { outline: 2px solid var(--focus) }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .85rem }
.legend span { display: inline-flex; align-items: center; gap: 6px }
.legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border-bottom: 3px solid }
.picker { position: sticky; top: 72px }
.eltabs { display: flex; flex-wrap: wrap; gap: 6px }
.eltabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: .88rem; cursor: pointer }
.eltabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink) }
.codelist { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r) }
.codelist button { display: grid; grid-template-columns: 88px 1fr; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer }
.codelist button:hover, .codelist button:focus-visible { background: var(--surface-2) }
.codelist .cat { grid-column: 1 / -1; padding: 8px 10px 4px; font: 600 .72rem/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2) }
.quote { border-left: 3px solid var(--line); padding-left: 12px; color: var(--muted); font-style: italic }
.tags { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px }
.tags li { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r) }
.tags .chip { font-family: var(--font-mono); font-size: .78rem; padding: 2px 6px; border-radius: 4px }
.chip.condition_hindering { background: var(--hinder-bg); color: var(--hinder) }
.chip.condition_helping { background: var(--help-bg); color: var(--help) }
.chip.adjustment { background: var(--adjust-bg); color: var(--adjust) }
.chip.proficiency { background: var(--prof-bg); color: var(--prof) }
.chip.undesired_state { background: var(--uos-bg); color: var(--uos) }

.narrative .ntext { white-space: pre-wrap }
.tags li.removable { grid-template-columns: auto 1fr auto }
.tags li { cursor: pointer }

/* notes */
.notes { list-style: none; margin: 0; padding: 0; display: grid }
.notes li { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: start }
.notes time { font-family: var(--font-mono); color: var(--muted) }
.phase { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); display: block }
.x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: .85rem; text-decoration: underline; padding: 2px 4px }
textarea { min-height: 96px; resize: vertical }
.empty { color: var(--muted); padding: 20px 0 }
.err { border-left: 4px solid var(--accent); background: var(--surface-2); padding: 10px 14px; border-radius: 0 var(--r) var(--r) 0 }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: var(--r); max-width: calc(100vw - 32px); z-index: 20 }
.steps { display: flex; gap: 8px; flex-wrap: wrap; font-size: .9rem; color: var(--muted) }
.steps b { color: var(--ink) }
fieldset.field { border: 0; padding: 0; margin: 0 }
fieldset.field legend { margin-bottom: 6px }
.confirm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
[hidden] { display: none !important }
@media (max-width: 820px) { .picker { position: static } }

/* results (from the mock-up) */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 12px }
.tile { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 4px; align-content: start }
.tile .num { font: 600 2rem/1 var(--font-mono); font-variant-numeric: tabular-nums }
.tile small { color: var(--muted) }
.refgrid { display: grid; gap: 2px }
.refrow { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 9.5rem; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line) }
.refrow .nm { font-size: .95rem; min-width: 0 }
.refrow .vals { font: .8rem/1.3 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--muted); text-align: right }
.refhead { font: 600 .72rem/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 14px }
.track { position: relative; height: 22px }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--surface-2) }
.track .ci { position: absolute; top: 9px; height: 4px; background: color-mix(in srgb, var(--ink) 30%, transparent); border-radius: 2px }
.track .us { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--ink) }
.track .ref { position: absolute; top: 1px; width: 4px; height: 20px; margin-left: -2px; background: var(--accent); border-radius: 1px }
.track .grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line) }
.cmpkey { display: flex; flex-wrap: wrap; gap: 16px; font-size: .88rem; color: var(--muted); align-items: center }
.cmpkey span { display: inline-flex; gap: 6px; align-items: center }
.cmpkey .k-us { width: 12px; height: 12px; border-radius: 50%; background: var(--ink) }
.cmpkey .k-ref { width: 4px; height: 16px; background: var(--accent) }
.cmpkey .k-ci { width: 22px; height: 4px; background: color-mix(in srgb, var(--ink) 30%, transparent) }
.diff { font-weight: 700 }
.diff.up, .diff.down { color: var(--ink) }
.diff.same { color: var(--muted); font-weight: 500 }
.diff.better { color: var(--help) }
.diff.worse { color: var(--hinder) }
.action h3 { font-size: 1rem; margin: 6px 0 0 }
@media (max-width: 640px) {
  .refrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nm vals" "tr tr"; row-gap: 2px }
  .refrow .nm { grid-area: nm } .refrow .vals { grid-area: vals } .refrow .track { grid-area: tr }
}
details.caveats summary { cursor: pointer; font-weight: 600 }
details.caveats ul { margin: 8px 0 0; padding-left: 1.2em; color: var(--muted); display: grid; gap: 4px }
.warn { border-left: 4px solid var(--hinder); background: var(--hinder-bg); padding: 10px 14px; border-radius: 0 var(--r) var(--r) 0 }
.forest { width: 100%; min-width: 560px; height: auto; display: block }
.finding { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line) }
.finding:last-child { border-bottom: 0 }
.finding .btn { justify-self: start; margin-top: 4px }
ol.plain { margin: 0; padding-left: 1.2em; display: grid; gap: 6px }
.quote { border-left: 3px solid var(--line); padding-left: 12px; color: var(--muted); font-style: italic }

/* print: the report and the pack print as plain pages */
@media print {
  .noprint, .toast, select, .field:has(#ref-group), details.caveats summary { display: none !important }
  body { background: #fff; color: #000; font-size: 11pt }
  main { padding: 0; max-width: none }
  .panel { border: 0; padding: 0; break-inside: avoid }
  .screen { gap: 14px }
  details.caveats ul { display: grid }
  .tablewrap { overflow: visible }
}

/* practise (from the mock-up) */
.res { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .8rem; font-weight: 700; white-space: nowrap }
.res.hit { background: var(--help-bg); color: var(--help) }
.res.half { background: var(--adjust-bg); color: var(--adjust) }
.res.miss { background: var(--hinder-bg); color: var(--hinder) }
.res.extra { background: var(--surface-2); color: var(--muted) }
.cmp td { font-size: .95rem }
.cmp tbody tr { cursor: pointer }
.cmp tbody tr:hover { background: var(--surface-2) }
.meter { height: 10px; border-radius: 5px; background: var(--surface-2); position: relative; overflow: hidden }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--steel) }
:root[data-theme="dark"] .meter i { background: var(--navy) }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .meter i { background: var(--navy) } }
.coverage th { text-align: left; white-space: nowrap; vertical-align: top; padding-right: 12px }
.coverage .gap { color: var(--hinder); font-weight: 600 }
.meter b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--accent) }

.example-flag { display: inline-block; font: 600 .72rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--prof); background: var(--prof-bg); padding: 4px 8px; border-radius: 4px }

/* phone and hub */
.phone-only { display: none }
.phone-mode .phone-only { display: revert }
.phone-mode .hub-only { display: none !important }
span.phone-only, .phone-mode span.phone-only { display: none }
.phone-mode span.phone-only { display: inline }
.linkbox { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px }
.qr { background: #fff; padding: 8px; border-radius: var(--r); width: min(240px, 100%); }
.qr svg { display: block; width: 100%; height: auto }
.linkfield { flex: 1 1 200px; min-width: 0; font-family: var(--font-mono); font-size: .8rem }

/* recording on a phone */
details.more { border-top: 1px solid var(--line); padding-top: 12px }
details.more summary { cursor: pointer; font-weight: 600; margin-bottom: 12px }
.notepad textarea { min-height: 140px; font-size: 1.1rem }
.notepad button[type=submit] { font-size: 1.15rem; padding: 16px 24px }
@media (max-width: 640px) {
  .notepad { position: sticky; top: 60px; z-index: 5; box-shadow: 0 6px 16px rgba(0,0,0,.08) }
  .notepad .seg label { padding: 10px 12px }
  .bar-in { min-height: 48px; gap: 10px }
  .tabs a { padding: 12px 9px 9px }
  main { padding-block: 16px 64px }
  h1 { font-size: 1.7rem }
  .btn.primary.big { width: 100% }
}
.filters .field { min-width: 12rem }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 14px; min-width: 0 }
.facts > * { min-width: 0 }
.fact { border-top: 4px solid var(--steel); padding-top: 8px; display: grid; gap: 2px }
.fact b { font: 600 1.7rem/1 var(--font-mono); font-variant-numeric: tabular-nums }
.fact span { color: var(--muted); font-size: .92rem }
#sum-body ul { margin: 6px 0 0; padding-left: 1.2em; display: grid; gap: 4px }
#sum-body { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) }
@media print { body[data-print="summary"] #res-body > :not(#res-summary), body[data-print="summary"] .filters, body[data-print="summary"] #rounds-panel, body[data-print="summary"] [data-screen="results"] .head p.lede { display: none !important } }
.note { border-left: 4px solid var(--help); background: var(--help-bg); padding: 10px 14px; border-radius: 0 var(--r) var(--r) 0 }
.operational { border-left: 4px solid var(--adjust) }
.badge-op { display: inline-block; font: 600 .72rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--adjust); background: var(--adjust-bg); padding: 4px 8px; border-radius: 4px }

/* certificate of completion (printed on its own) */
.certbox { border: 2px solid var(--help); background: var(--help-bg); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 10px }
.certificate { background: #fff; color: #1d1b19; }
.cert-in { max-width: 720px; margin: 0 auto; padding: 48px 40px; border: 6px double #3a3735; display: grid; gap: 16px; text-align: center; font-family: var(--font-body) }
.cert-mark { display: flex; justify-content: center; gap: 8px; font-family: var(--font-display) }
.cert-mark b { background: #a3322b; color: #fff; padding: 2px 10px 0; border-radius: 3px; font-size: 1.6rem; letter-spacing: .08em }
.cert-mark span { font-size: 1.3rem; letter-spacing: .14em; text-transform: uppercase; color: #3a3735; align-self: center }
.cert-kind { font: 600 .9rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: #625d58 }
.cert-in h1 { font-size: 2.6rem; color: #1d1b19 }
.cert-figs { margin: 0 auto; width: auto; font-family: var(--font-mono); font-size: .9rem }
.cert-figs td { border-bottom: 1px solid #cdc8c3; padding: 6px 12px; text-align: left; color: #1d1b19 }
.cert-date { font-weight: 600 }
.cert-note { color: #625d58; font-size: .85rem }
@media print { body[data-print="certificate"] > *:not(main), body[data-print="certificate"] main > *:not([data-screen="practise"]), body[data-print="certificate"] [data-screen="practise"] > *:not(#certificate) { display: none !important }
  body[data-print="certificate"] #certificate { display: block !important } }

/* a managers' report link shows the report only */
.report-mode .tabs { display: none }

/* Managed / Mismanaged / Unmanaged taps while dictating: big, thumb-sized, never steal focus from the note box */
.markbtns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px }
.markbtn { font: 700 clamp(.82rem, 3.6vw, 1rem)/1.1 var(--font-body); padding: 18px 4px; min-width: 0; overflow-wrap: anywhere; border-radius: var(--r); border: 2px solid currentColor; background: var(--surface); cursor: pointer; touch-action: manipulation }
.markbtn:active { transform: scale(.97) }
.markbtn.managed, .markchip.managed { color: var(--help) }
.markbtn.mismanaged, .markchip.mismanaged { color: var(--adjust) }
.markbtn.unmanaged, .markchip.unmanaged { color: var(--muted) }   /* unmanaged is not a fault: no action was seen */
.markchip { display: inline-block; font-size: .8rem; font-weight: 700; border: 1px solid currentColor; border-radius: 999px; padding: 1px 8px; margin: 4px 4px 0 0; background: var(--surface) }
fieldset.marks { border: 0; padding: 0; margin: 0 }

/* how the team managed it: a list of options under Managed */
.howlist { border: 0; padding: 0; margin: 0; display: grid; gap: 6px }
.howlist label { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface) }
.howlist label:has(input:checked) { border-color: var(--help); box-shadow: inset 3px 0 0 var(--help) }

button.markchip { cursor: pointer; font-family: inherit }
button.markchip.sure { outline: 2px solid currentColor }
.howlist label small { display: none }
.howlist label:has(input:checked) small { display: block }

/* welcome on a fresh device: the site's home photo (served from ../img, kept offline by the service worker once seen) */
.welcome { border-radius: var(--r); overflow: hidden; background: var(--surface); border: 1px solid var(--line); display: grid }
.welcome-img { min-height: 190px; background: #1b1918 url(../img/hero-dusk.jpg) 50% 45% / cover no-repeat }
.welcome-text { padding: 16px 18px 18px; display: grid; gap: 6px }
.welcome-text h2 { margin: 0 }
.welcome-text p { margin: 0; color: var(--muted) }
@media (min-width: 760px) { .welcome { grid-template-columns: 1.1fr 1fr } .welcome-img { min-height: 240px } .welcome-text { align-content: center; padding: 24px } }

/* wide tables scroll inside their box instead of widening the screen on a phone */
.panel > *, .screen > * { min-width: 0 }

/* dashboard */
.dash { display: grid; gap: 18px }
.dtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(128px, 100%), 1fr)); gap: 12px }
.dtile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 2px; align-content: start }
.dtile b { font-family: var(--font-display); font-size: 2.1rem; line-height: 1.05 }
.dtile small { color: var(--muted) } .dtile small.up { color: var(--help) } .dtile small.down { color: var(--hinder) }
.drow { display: grid; grid-template-columns: minmax(0, 1.2fr) 3.5rem minmax(0, 2fr); gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line) }
.dname { display: grid } .dname small { color: var(--muted); font-size: .82rem }
.dval { font-family: var(--font-mono); font-weight: 600; text-align: right }
.dscale { position: relative; height: 14px; background: var(--surface-2); border-radius: 7px }
.dscale i { position: absolute; top: 0; bottom: 0 }
.dscale .band { background: color-mix(in srgb, var(--adjust) 30%, transparent); border-radius: 7px }
.dscale .med { width: 2px; background: var(--adjust); margin-left: -1px }
.dscale .ref { width: 3px; top: -4px; bottom: -4px; background: var(--ink); margin-left: -1px; border-radius: 2px }
.dscale .you { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); margin-left: -7px; box-shadow: 0 0 0 2px var(--surface) }
.dkey { font-size: .82rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap }
.dkey .k { display: inline-block; width: 12px; height: 12px; margin-left: 6px } .dkey .k.you { background: var(--accent); border-radius: 50% }
.dkey .k.band { background: color-mix(in srgb, var(--adjust) 30%, transparent); border-radius: 3px } .dkey .k.med { width: 2px; background: var(--adjust) } .dkey .k.ref { width: 3px; background: var(--ink) }
@media (max-width: 560px) { .drow { grid-template-columns: minmax(0, 1fr) 3rem; } .drow .dscale { grid-column: 1 / -1 } }

.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: var(--r); border: 2px solid var(--focus) }
.skip:focus { top: 8px }

/* the dashboard board: a dark, chart-led board in its own colours, the same in light and dark mode */
.board { --b-bg: #141a24; --b-card: #1d2533; --b-line: #2e394b; --b-ink: #eef1f6; --b-mute: #a3adbd;
  --c-help: #4fc28a; --c-hinder: #f0904a; --c-adjust: #6aa6f0; --c-uos: #e8638a; --c-prof: #4fd1c5; --c-accent: #e35d52;
  background: var(--b-bg); color: var(--b-ink); border-radius: 12px; padding: clamp(10px, 2.4vw, 20px); display: grid; gap: 14px; min-width: 0 }
.board .lede, .board small, .board .label { color: var(--b-mute) }
.board a { color: var(--b-ink) }
.board-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center }
.board .seg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center }
.board .seg .label { margin-right: 4px }
.board .seg button, .board .chipbtn { background: transparent; color: var(--b-ink); border: 1px solid var(--b-line); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .9rem; cursor: pointer; min-height: 36px }
.board .seg button[aria-pressed="true"], .board .chipbtn[aria-pressed="true"] { background: var(--b-ink); color: var(--b-bg); border-color: var(--b-ink); font-weight: 600 }
.board .chips { display: flex; flex-wrap: wrap; gap: 6px }
.board-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px }
.bcard { background: var(--b-card); border: 1px solid var(--b-line); border-radius: 10px; padding: 16px; min-width: 0; display: grid; gap: 10px; align-content: start }
.bcard h2 { font-size: 1.1rem; letter-spacing: .02em; color: var(--b-ink); margin: 0 }
.b-ring, .b-hinder, .b-resp { grid-column: span 4 }
.b-kpis { grid-column: span 3; grid-row: span 2 } .b-trend { grid-column: span 9 }
.b-late { grid-column: span 3 } .b-cats { grid-column: span 6 } .b-links { grid-column: span 3 } .b-sit { grid-column: span 12 }
@media (max-width: 1100px) { .b-ring, .b-hinder, .b-resp { grid-column: span 6 } .b-kpis { grid-column: span 6; grid-row: auto } .b-trend { grid-column: span 12 } .b-late, .b-links { grid-column: span 6 } .b-cats { grid-column: span 12 } }
@media (max-width: 700px) { .board-grid > * { grid-column: 1 / -1 !important } }
.c-help { --c: var(--c-help) } .c-hinder { --c: var(--c-hinder) } .c-adjust { --c: var(--c-adjust) } .c-uos { --c: var(--c-uos) }
/* ring */
.ring { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: center }
.ring svg { max-width: 170px; justify-self: center }
.ring svg { width: 100%; height: auto }
.ring circle { fill: none; stroke-width: 26 } .ring .track { stroke: var(--b-line) } .ring circle[class^="c-"] { stroke: var(--c) }
.ring .hole { fill: var(--b-card); stroke: none }
.ring-big { font: 700 34px var(--font-display); fill: var(--b-ink) } .ring-sub { font: 500 13px var(--font-body); fill: var(--b-mute) }
.ring-key { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .88rem }
.ring-key li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: center }
.ring-key i { width: 12px; height: 12px; border-radius: 3px; background: var(--c) } .ring-key b { font-family: var(--font-mono) }
@media (max-width: 420px) { .ring { grid-template-columns: 1fr } .ring svg { max-width: 180px; margin: 0 auto } }
/* bars */
.hbars { display: grid; gap: 9px }
.hb { display: grid; grid-template-columns: minmax(0, 10rem) minmax(0, 1fr) 3rem; gap: 10px; align-items: center; font-size: .88rem }
.hb-l { overflow-wrap: anywhere } .hb-t { height: 14px; background: var(--b-bg); border-radius: 3px; overflow: hidden }
.hb-t i { display: block; height: 100%; background: var(--c); border-radius: 3px } .hb b { font-family: var(--font-mono); text-align: right }
@media (max-width: 420px) { .hb { grid-template-columns: minmax(0, 1fr) 3rem } .hb-t { grid-column: 1 / -1; grid-row: 2 } }
.howtop { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .88rem } .howtop li { display: flex; justify-content: space-between; gap: 10px } .howtop b { font-family: var(--font-mono) }
/* numbered key figures */
.kpis { display: grid; gap: 10px }
.kpi { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 10px; align-items: center; background: var(--b-bg); border-radius: 8px; padding: 10px 12px; border-left: 4px solid var(--c) }
.kpi-n { font: 700 .95rem var(--font-mono); color: var(--b-bg); background: var(--c); border-radius: 6px; text-align: center; padding: 6px 0 }
.kpi b { display: block; font: 700 1.9rem/1.05 var(--font-display) } .kpi div > span { display: block; font-size: .9rem } .kpi small { display: block; font-size: .8rem }
.k-ink { --c: var(--b-ink) } .k-help { --c: var(--c-help) } .k-adjust { --c: var(--c-adjust) } .k-prof { --c: var(--c-prof) } .k-accent { --c: var(--c-accent) }
.board .up { color: var(--c-help) } .board .down { color: var(--c-uos) } .board .same { color: var(--b-mute) }
/* progress chart */
.trend-head { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline }
.trend-wrap { overflow-x: auto } .trend { width: 100%; min-width: 420px; height: auto; display: block }
.trend .grid { stroke: var(--b-line); stroke-width: 1 } .trend .ax { fill: var(--b-mute); font: 12px var(--font-body) } .trend .ax.sel { fill: var(--b-ink); font-weight: 700 } .trend .ax.sub { font-size: 11px }
.trend .band { fill: color-mix(in srgb, var(--c-adjust) 22%, transparent) } .trend .med { stroke: var(--c-adjust); stroke-dasharray: 4 4 } .trend .ref { stroke: var(--b-ink); stroke-dasharray: 2 4; stroke-width: 1.5 }
.trend .area { fill: color-mix(in srgb, var(--c-accent) 16%, transparent) } .trend .ln { fill: none; stroke: var(--c-accent); stroke-width: 3; stroke-linejoin: round }
.trend .pt { fill: var(--b-card); stroke: var(--c-accent); stroke-width: 3 } .trend .pt.sel { fill: var(--c-accent) } .trend .val { fill: var(--b-ink); font: 600 13px var(--font-mono) }
.trend .act { stroke: var(--c-hinder); stroke-dasharray: 3 3 } .trend .actdot { fill: var(--c-hinder) } .trend .actnum { fill: var(--b-bg); font: 700 11px var(--font-mono) }
.actlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem } .actlist li { display: flex; gap: 8px; align-items: baseline }
.actnum-badge { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--c-hinder); color: var(--b-bg); font: 700 11px/20px var(--font-mono); text-align: center }
.board details summary { cursor: pointer; color: var(--b-mute) } .board table { color: var(--b-ink) } .board th, .board td { border-color: var(--b-line) }
.board .dkey { color: var(--b-mute) } .board .dkey .k.line { width: 14px; height: 3px; background: var(--c-accent) } .board .dkey .k.act { width: 10px; height: 10px; border-radius: 50%; background: var(--c-hinder) }
.board .dkey .k.band { background: color-mix(in srgb, var(--c-adjust) 30%, transparent) } .board .dkey .k.med { background: var(--c-adjust) } .board .dkey .k.ref { background: var(--b-ink) } .board .dkey .k.you { background: var(--c-accent) }
/* category table */
.cat-table { width: 100%; border-collapse: collapse; font-size: .88rem } .cat-table td, .cat-table th { padding: 6px 8px; border-bottom: 1px solid var(--b-line); text-align: left; background: transparent }
.cat-table tr.grp th { color: var(--b-mute); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; padding-top: 12px }
.spark { display: block } .spark polyline { fill: none; stroke: var(--b-mute); stroke-width: 1.8 } .spark circle { fill: var(--c-accent) }
.board .arr { font-size: .8em }
/* where you sit, on the board */
.board .drow { border-top-color: var(--b-line) } .board .dscale { background: var(--b-bg) }
.board .dscale .band { background: color-mix(in srgb, var(--c-adjust) 35%, transparent) } .board .dscale .med { background: var(--c-adjust) }
.board .dscale .ref { background: var(--b-ink) } .board .dscale .you { background: var(--c-accent); box-shadow: 0 0 0 2px var(--b-card) }

main:has([data-screen="dashboard"]:not([hidden])) { max-width: 1360px }

/* a way back to the website, Menu on phones, and Back links */
.back-link { display: inline-block; font-weight: 600; text-decoration: none; color: var(--ink); padding: 6px 0 }
.back-link:hover { text-decoration: underline }
.tabs .tab-site { margin-left: auto; opacity: .8 }
.menu { display: none; position: relative; margin-left: auto }
.menu summary { list-style: none; cursor: pointer; color: var(--steel-ink); font-weight: 600; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--steel-ink) 40%, transparent); border-radius: 8px; min-height: 44px; display: flex; align-items: center; gap: 8px }
.menu summary::-webkit-details-marker { display: none }
.menu summary::before { content: "☰"; font-size: 1.1rem }
.menu[open] summary::before { content: "✕" }
.menu nav { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgb(0 0 0 / .25); padding: 8px; display: grid; min-width: 220px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 90px); overflow-y: auto }
.menu nav a { color: var(--ink); text-decoration: none; padding: 12px; border-radius: 6px; font-weight: 500 }
.menu nav a[aria-current="page"] { font-weight: 700; background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent) }
@media (max-width: 640px) { .tabs { display: none } .menu { display: block } .report-mode .menu { display: none } }

/* observations on a phone: each one a card you can tap anywhere, with the status in view */
@media (max-width: 560px) {
  .obs-table thead { display: none }
  .obs-table, .obs-table tbody { display: block }
  .obs-table tr { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line) }
  .obs-table td { display: block; padding: 0; border: 0 }
  .obs-table td:nth-child(1) { grid-column: 1; grid-row: 1 }
  .obs-table td:nth-child(5) { grid-column: 2; grid-row: 1; align-self: start }
  .obs-table td:nth-child(2), .obs-table td:nth-child(3) { grid-column: 1 / -1; color: var(--muted); font-size: .92rem }
  .obs-table td:nth-child(4) { grid-column: 1 / -1; color: var(--muted); font-size: .85rem }
  .obs-table td:nth-child(4)::after { content: " " attr(data-n) }
  .obs-table td:nth-child(1) a { font-size: 1.05rem; font-weight: 600 }
  .obs-table td:nth-child(1) a::after { content: ""; position: absolute; inset: 0 }
}
.bcard { grid-template-columns: minmax(0, 1fr) }
.bcard > * { min-width: 0 }

/* gloves: bigger targets for removing notes and taps */
.notes li button.x { min-height: 44px; padding: 10px 12px } .markchip { min-height: 36px; padding: 6px 10px }

input.assign { width: 5.5rem; padding: 6px 8px; font: inherit; font-family: var(--font-mono) }

.cal-pick { align-items: center; gap: 10px } .cal-pick select { font: inherit; padding: 8px 10px; min-height: 44px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink) }
