/* Сім-Стомат — спільне робоче місце симулятора: головний екран, дії, сцена, пацієнт, журнал,
   документи, столик, розріз тканин, результати, теорія, тест, історія. Основа: base.css */
/* ---------- головна ---------- */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: center; padding-block: 8px 8px; }
.hero-text { display: grid; gap: 14px; min-width: 0; }
.hero-text h1 { font-family: var(--f-display); font-weight: 600; font-size: clamp(24px, 3.2vw, 38px); line-height: 1.15; letter-spacing: -.015em; max-width: 22ch; }
.hero-text p { color: var(--muted); max-width: 62ch; font-size: 16px; }
.hero-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; counter-reset: f; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.hero-flow li { counter-increment: f; padding: 14px; display: grid; gap: 2px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.hero-flow li:nth-child(3n) { border-right: 0; }
.hero-flow li:nth-child(n+4) { border-bottom: 0; }
.hero-flow li::before { content: counter(f); font-family: var(--f-mono); font-size: 12px; color: var(--accent); font-weight: 600; }
.hero-flow b { font-size: 14px; }
.hero-flow span { font-size: 12.5px; color: var(--muted); }

.setup { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.setup-col { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.setup-col.wide { background: transparent; border: 0; padding: 0; }
.setup-col .h-sec + * { margin-top: -2px; }
.fields { display: grid; gap: 10px; }
.fields label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
input[type="text"] { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); padding: 9px 11px; width: 100%; }
input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.note { font-size: 13px; color: var(--muted); }
.scn-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.scn {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  display: grid; gap: 6px; align-content: start; padding: 16px 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .15s, box-shadow .15s;
}
.scn:hover { border-color: var(--accent); }
.scn.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.scn-tag { justify-self: start; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.scn-title { font-weight: 600; font-size: 16px; }
.scn-drug { font-size: 12.5px; color: var(--hub-ink-strong); }
.scn-brief { font-size: 13.5px; color: var(--muted); }

/* ---------- симуляція ---------- */
.simbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; position: relative; }
.simbar-l, .simbar-r { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.simbar h2 { font-family: var(--f-display); font-weight: 500; font-size: 18px; }
.stat { font-size: 13px; color: var(--muted); white-space: nowrap; }
.stat b { color: var(--ink); }
.confirm { flex-basis: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r-s); background: var(--warn-soft); color: var(--ink); font-size: 14px; }
.confirm.inline { flex-basis: auto; display: inline-flex; padding: 6px 10px; }

.simgrid { display: grid; grid-template-columns: 290px minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.p-h { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.actions-p { padding: 14px; display: grid; gap: 10px; max-height: calc(100vh - 150px); overflow: auto; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 64px); }
#actions { display: grid; gap: 14px; }
.act-g h4 { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.act-list { display: grid; gap: 4px; }
.act {
  font: inherit; font-size: 13.5px; line-height: 1.3; color: var(--ink); text-align: left; cursor: pointer;
  display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; align-items: start;
  padding: 7px 8px; border: 1px solid transparent; border-radius: var(--r-s); background: var(--bg);
}
.act:hover:not(:disabled) { border-color: var(--accent); }
.act-mark { width: 14px; height: 14px; margin-top: 1px; border-radius: 4px; border: 1.5px solid var(--line); }
.act.done { background: var(--ok-soft); color: var(--muted); }
.act.done .act-mark { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 2px var(--ok-soft); }
.act.missed { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--crit); }
.act.missed .act-mark { border-color: var(--crit); }
.act.na { opacity: .5; }
.act.active { border-color: var(--accent); background: var(--accent-soft); }
.act.hint { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }

.stage { padding: 0; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; position: relative; }
.stabs { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--line); background: var(--surface-2); overflow-x: auto; }
.stabs button { font: inherit; font-size: 13.5px; font-weight: 500; color: var(--muted); background: transparent; border: 0; border-radius: var(--r-s) var(--r-s) 0 0; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.stabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 0 var(--surface); }
.scenes { padding: 18px; min-height: 420px; min-width: 0; }
.scene { min-width: 0; }
.prompt { margin: 0; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 14px; min-height: 46px; }
.prompt.info { background: var(--surface-2); }
.prompt.ok { background: var(--ok-soft); }
.prompt.warn { background: var(--warn-soft); }
.empty-scene { display: grid; gap: 6px; place-content: center; text-align: center; min-height: 300px; color: var(--ink); }

.toast {
  position: absolute; right: 14px; bottom: 60px; max-width: min(380px, calc(100% - 28px));
  display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r-s);
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: none; }
.toast.sev-critical { border-left-color: var(--crit); }
.toast.sev-moderate { border-left-color: var(--warn); }
.toast.sev-minor { border-left-color: var(--muted); }
.toast b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.toast small { color: var(--muted); font-size: 13px; }

.side { padding: 14px; display: grid; gap: 12px; }
.patient { display: grid; gap: 10px; }
.pt-h { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; }
.pt-h > div { display: grid; min-width: 0; }
.pt-h .muted { font-size: 12.5px; }
.pt-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; }
.bubble { position: relative; background: var(--surface-2); border-radius: var(--r); padding: 10px 12px; font-size: 14px; }
.bubble::before { content: ""; position: absolute; top: -6px; left: 16px; border: 6px solid transparent; border-top: 0; border-bottom-color: var(--surface-2); }
.bubble.quiet { color: var(--muted); }
.chk { margin: 0; padding-left: 20px; display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); max-height: 280px; overflow: auto; }
.chk li.done { color: var(--ok); }
.chk li.done::marker { content: "✓  "; }
.chk li.missed { color: var(--crit); text-decoration: line-through; }
.chk li.na { opacity: .5; }
.chk li.next { color: var(--ink); font-weight: 600; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 320px; overflow: auto; font-size: 12.5px; }
.log li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 6px; }
.log li .mono { color: var(--muted); font-size: 11.5px; padding-top: 1px; }
.log .lg-ok span:last-child { color: var(--ink); }
.log .lg-patient span:last-child { color: var(--hub-ink-strong); font-style: italic; }
.log .lg-err span:last-child { color: var(--crit); }
.log .lg-warn span:last-child { color: var(--warn); }
.log .lg-info span:last-child { color: var(--muted); }

/* ---------- документи ---------- */
.docs { display: grid; gap: 16px; }
.sheet { position: relative; border: 1px solid var(--line); border-radius: var(--r-s); padding: 18px; background: var(--surface); display: grid; gap: 14px; overflow: hidden; }
.sheet-h { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 10px; }
.sheet-h h3 { font-family: var(--f-display); font-weight: 500; font-size: 17px; margin-top: 2px; }
.sheet-ward { font-size: 13px; color: var(--muted); align-self: end; }
.sheet-p { display: flex; gap: 28px; flex-wrap: wrap; margin: 0; }
.sheet-p div { display: grid; }
.sheet-p dt { font-size: 12px; color: var(--muted); }
.sheet-p dd { margin: 0; font-weight: 600; font-size: 15px; }
.sheet-t td.sign { font-style: italic; font-family: Georgia, "Times New Roman", serif; color: var(--hub-ink-strong); }
.sheet.closed > :not(.sheet-cover):not(.sheet-h) { filter: blur(5px); user-select: none; }
.sheet-cover { position: absolute; inset: 62px 0 0; display: grid; place-items: center; text-align: center; padding: 16px; font-weight: 500; color: var(--ink); }
.dialog { display: grid; gap: 10px; }
.dialog:empty { display: none; }
.line { padding: 10px 12px; border-radius: var(--r); font-size: 14.5px; max-width: 60ch; }
.line.nurse { background: var(--accent-soft); justify-self: end; }
.line.patient { background: var(--surface-2); }
.line.done { background: var(--ok-soft); }

/* ---------- столик ---------- */
.table-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.item { border: 1px solid var(--line); border-radius: var(--r-s); padding: 14px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.label-card { border: 1px solid var(--line); border-radius: 22px 22px 8px 8px; padding: 14px; background: var(--surface-2); display: grid; gap: 4px; text-align: center; }
.ampoule.opened .label-card { border-top-style: dashed; }
.lc-drug { font-weight: 600; font-size: 16px; }
.lc-conc { font-family: var(--f-mono); font-size: 14px; }
.lc-meta { font-size: 12px; color: var(--muted); }
.lc-route { font-size: 11.5px; color: var(--muted); }
.q { font-size: 13.5px; }
.stamp { justify-self: start; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; border: 1.5px solid currentColor; }
.stamp.ok { color: var(--ok); }
.pack { font-size: 13px; color: var(--muted); }
.needles { margin: 0; padding-left: 18px; font-size: 13.5px; display: grid; gap: 2px; }
.needles li.used { color: var(--muted); text-decoration: line-through; }
.needles li.on { color: var(--ok); font-weight: 600; }
.syr { width: 100%; max-width: 420px; height: auto; display: block; }
.syr-t { font: 500 10px var(--f-mono); fill: var(--muted); }
.ctl { display: grid; gap: 6px; min-width: 0; }
.ctl label, .ctl-l { font-size: 13px; color: var(--muted); font-weight: 500; }
.ctl label b { color: var(--ink); font-family: var(--f-mono); }
.ctl > b.mono { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; } /* довгі назви голок переносяться */
input[type="range"] { width: 100%; accent-color: var(--accent); }

/* ---------- спільне для сцен з тілом пацієнта: лінійки, антисептик, підказки ---------- */
.ruler-t { font: 500 11px var(--f-mono); fill: var(--muted); }
.swab { fill: var(--liquid); fill-opacity: .55; stroke: var(--vein-hi); stroke-opacity: .5; transition: fill-opacity 1s; }
.swab.dry { fill-opacity: .12; stroke-opacity: .2; }
.swab-anim { animation: swab .7s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes swab { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.arm-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 34px; }
.tool-hint { font-size: 14px; }
.tool-hint.wet { color: var(--hub-ink-strong); font-family: var(--f-mono); }
.tool-hint.ok { color: var(--ok); }
.tool-hint.muted { color: var(--muted); }

/* ---------- пункція та введення ---------- */
.pc-wrap { position: relative; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; }
.pc-wrap canvas { display: block; }
.pc-readout, .inj-read { display: flex; gap: 18px; flex-wrap: wrap; padding: 8px 12px; background: var(--surface-2); border-top: 1px solid var(--line); }
.inj-read { border: 1px solid var(--line); border-radius: var(--r-s); }
.pc-readout span, .inj-read span { display: grid; }
.pc-readout i, .inj-read i { font-style: normal; font-size: 11.5px; color: var(--muted); }
.pc-readout b, .inj-read b { font-family: var(--f-mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.pc-readout b.ok { color: var(--ok); }
.pc-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; margin-top: 14px; align-items: end; }
.ctl-wide { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.inj { display: grid; gap: 12px; }
.emergency { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--r-s); background: var(--crit-soft); border: 1px solid var(--crit); }
.emergency .eyebrow { color: var(--crit); }
.emergency h4 { font-family: var(--f-display); font-weight: 500; font-size: 16px; }
.em-opts { display: grid; gap: 6px; margin-top: 4px; }
.em-opts .btn { justify-content: flex-start; text-align: left; white-space: normal; }
.inj .syr { max-width: 560px; }
.inj .pc-controls { grid-template-columns: minmax(0, 1fr); }

/* ---------- результати ---------- */
.result { display: grid; gap: 20px; }
.res-h { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.res-grade { width: 112px; height: 112px; border-radius: 50%; display: grid; place-content: center; text-align: center; border: 3px solid currentColor; }
.res-grade span { font-size: 52px; font-weight: 600; line-height: 1; }
.res-grade small { font-size: 12px; color: var(--muted); }
.g5, .g4 { color: var(--ok); } .g3 { color: var(--warn); } .g2 { color: var(--crit); }
.res-main { display: grid; gap: 8px; min-width: 0; }
.res-main h2 { font-family: var(--f-display); font-weight: 500; font-size: 24px; }
.res-main p { max-width: 70ch; }
.res-stats { display: flex; gap: 28px; flex-wrap: wrap; margin: 6px 0 0; }
.res-stats div { display: grid; }
.res-stats dt { font-size: 12px; color: var(--muted); }
.res-stats dd { margin: 0; font-weight: 600; }
.res-sec { display: grid; gap: 10px; }
.res-sec h3 { font-family: var(--f-display); font-weight: 500; font-size: 16px; }
.errs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.errs li { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); }
.errs p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.sev-pill { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; padding: 3px 8px; border-radius: 4px; justify-self: start; }
.errs .sev-critical .sev-pill, .sev-critical > .sev-pill { background: var(--crit-soft); color: var(--crit); }
.errs .sev-moderate .sev-pill, .sev-moderate > .sev-pill { background: var(--warn-soft); color: var(--warn); }
.errs .sev-minor .sev-pill, .sev-minor > .sev-pill { background: var(--surface-2); color: var(--muted); }
.steps-t { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); }
.steps-t tr.st-missed td:nth-child(2) { color: var(--crit); font-weight: 600; }
.steps-t tr.st-done td:nth-child(2) { color: var(--ok); }
.steps-t tr.st-na td { color: var(--muted); }
.res-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.report-l { font-size: 13px; color: var(--muted); font-weight: 500; }
.report { font: 12.5px/1.5 var(--f-mono); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px; width: 100%; resize: vertical; }

/* ---------- теорія, тест, історія ---------- */
.theory { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.th-algo { display: grid; gap: 18px; counter-reset: st; }
.th-g h3 { font-family: var(--f-display); font-weight: 500; font-size: 15px; margin-bottom: 8px; }
.th-g ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.th-g li { counter-increment: st; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; max-width: 75ch; }
.th-g li::before { content: counter(st); font-family: var(--f-mono); color: var(--accent); font-weight: 600; font-size: 13px; padding-top: 1px; }
.th-g li b { font-weight: 600; }
.th-g li span { color: var(--muted); }
.th-g li > b, .th-g li > span { grid-column: 2; }
.th-g li > b { grid-row: 1; }
.th-g li > span { grid-row: 2; }
.th-side { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 72px); }
.th-side h3 { font-family: var(--f-display); font-weight: 500; font-size: 14px; }
.veins-l { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 13.5px; }
.veins-l li { display: grid; gap: 1px; }
.veins-l i { color: var(--hub-ink-strong); font-style: normal; font-size: 12.5px; }
.veins-l span { color: var(--muted); }
.keys { margin: 0; display: grid; gap: 8px; font-size: 13.5px; }
.keys div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; }
.keys dt { color: var(--muted); }
.keys dd { margin: 0; }
.compl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); min-width: 720px; }
.compl th[scope="row"] { color: var(--ink); font-size: 13.5px; width: 20%; }
.compl td { color: var(--muted); }

.quiz { display: grid; gap: 14px; max-width: 820px; }
#quizList { display: grid; gap: 12px; }
.qz { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 14px 16px; margin: 0; display: grid; gap: 6px; min-width: 0; }
.qz legend { font-weight: 600; padding: 0 4px; float: left; width: 100%; margin-bottom: 6px; }
.qz label { display: flex; gap: 10px; align-items: flex-start; padding: 6px 8px; border-radius: var(--r-s); cursor: pointer; }
.qz label:hover { background: var(--surface-2); }
.qz input { accent-color: var(--accent); margin-top: 4px; }
.qz.right { border-color: var(--ok); }
.qz.wrong { border-color: var(--crit); }
.qz label.ok { background: var(--ok-soft); }
.qz-why { font-size: 13.5px; color: var(--muted); padding: 0 8px; }
.quiz-f { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.quiz-r { font-weight: 600; }

.hist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); min-width: 640px; }
.g-pill { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid currentColor; font-weight: 600; font-family: var(--f-mono); }
.hist-f { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- адаптивність ---------- */
@media (max-width: 1180px) {
  .simgrid { grid-template-columns: 260px minmax(0, 1fr); }
  .side { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .side .p-h { display: none; }
}
@media (max-width: 860px) {
  .home-hero, .setup, .theory { grid-template-columns: minmax(0, 1fr); }
  .simgrid { grid-template-columns: minmax(0, 1fr); }
  .stage { order: -1; }
  .actions-p { position: static; max-height: none; }
  .side { grid-template-columns: minmax(0, 1fr); }
  .th-side { position: static; }
  .pc-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .scn-list { grid-template-columns: minmax(0, 1fr); }
  .hero-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-flow li:nth-child(3n) { border-right: 1px solid var(--line); }
  .hero-flow li:nth-child(2n) { border-right: 0; }
  .hero-flow li:nth-child(n+4) { border-bottom: 1px solid var(--line); }
  .hero-flow li:nth-child(n+5) { border-bottom: 0; }
  .scenes { padding: 12px; }
  .pc-controls { grid-template-columns: minmax(0, 1fr); }
  .res-h { grid-template-columns: minmax(0, 1fr); }
  .res-grade { width: 88px; height: 88px; }
  .res-grade span { font-size: 40px; }
  .errs li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .topbar-in { gap: 8px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- зв’язок із реєстром: паспорт симулятора, СОП, компетентності, чек-лист ОСКІ ---------- */
.sim-pass { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 14px; }
.sp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sp-head .h-sec { margin-top: 4px; font-size: 17px; }
.sp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.sp-col { display: grid; gap: 8px; align-content: start; min-width: 0; }
.sp-col h3 { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sp-col h3 + * { margin-top: -2px; }
.sp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sp-list.small { font-size: 13px; }
.ps-sk { color: var(--ink); text-decoration: none; }
.ps-sk .mono { color: var(--accent); font-size: 12px; margin-right: 4px; }
.ps-sk:hover { color: var(--accent); text-decoration: underline; }
.sp-comps { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 13px; }
.sp-comps li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 6px; align-items: start; }
.sp-src, .sp-note { font-size: 12.5px; color: var(--muted); }
.sp-src a { color: var(--accent); }
.sp-sop b { font-size: 14px; }
.sp-hint { font-size: 12px; }
.sop-form { display: grid; gap: 10px; }
.sop-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; color: var(--ink); }
.sop-form small { font-weight: 400; color: var(--muted); font-size: 12px; }
.sop-form select, .sop-form input[type="text"] { font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); padding: 7px 9px; width: 100%; }
.chk li .cchip { font-size: 10.5px; padding: 0 4px; margin: 0 0 0 4px; opacity: .85; }
.scn[disabled] { opacity: .55; cursor: not-allowed; }
.scn-off { font-size: 12.5px; font-weight: 600; color: var(--warn); }
.comp-t, .chk-t { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); }
.comp-t tr.ok td:nth-child(2) { color: var(--ok); }
.comp-t tr.warn td:nth-child(3), .comp-t tr.warn td:nth-child(4) { color: var(--warn); font-weight: 600; }
.comp-t tr.crit td:nth-child(4) { color: var(--crit); font-weight: 600; }
.chk-t tr.crit td:nth-child(4) { color: var(--crit); font-weight: 600; }
.chk-t td.box { white-space: nowrap; color: var(--muted); }
.oski-lead { max-width: 75ch; font-size: 14px; }
@media (max-width: 860px) { .sp-grid { grid-template-columns: minmax(0, 1fr); } }

/* Позначки перевірки у каталозі процедур і списку завдань станції. */
.pl-card > .draft-badge, .os-task > .draft-badge { justify-self: start; }
.os-task-list { display: grid; gap: 8px; margin-top: 6px; min-width: 0; }
.os-task { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }

/* режим ОСКІ (тренажер у рамці сторінки oski/) */
.osce-mode .topbar .nav, .osce-mode .hub-back, .osce-mode #procNav,
.osce-mode #hintBtn, .osce-mode #exitBtn, .osce-mode #againBtn, .osce-mode #otherBtn { display: none !important; }
.osce-mode .topbar { pointer-events: none; }
.osce-note { margin-bottom: 12px; }

/* Таблиці результату на телефоні: рядок — картка з підписами полів (підписи дописує table-cards.js) */
@media screen and (max-width: 640px) {
  :is(.steps-t, .comp-t, .chk-t) thead { display: none; }
  :is(.steps-t, .comp-t, .chk-t), :is(.steps-t, .comp-t, .chk-t) tbody { display: block; }
  :is(.steps-t, .comp-t, .chk-t) tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  :is(.steps-t, .comp-t, .chk-t) tr:last-child { border-bottom: 0; }
  :is(.steps-t, .comp-t, .chk-t) td { padding: 0; border: 0; }
  :is(.steps-t, .comp-t) td:first-child { flex-basis: 100%; }
  .chk-t td:nth-child(2) { flex: 1 1 0; min-width: 0; }
  .chk-t td:nth-child(n+3) { flex-basis: auto; }
  :is(.steps-t, .comp-t) td[data-l]:not(:first-child)::before,
  .chk-t td[data-l]:nth-child(n+3)::before { content: attr(data-l) ' '; color: var(--muted); font-size: 12px; font-weight: 500; font-family: var(--f-body); }
  .chk-t td:nth-child(n+3) { margin-left: 0; }
  .tbl-wrap:has(> :is(.steps-t, .comp-t, .chk-t)) { overflow-x: visible; }
  /* історія спроб */
  table.hist[data-cards] { min-width: 0; display: block; }
  table.hist[data-cards] thead { display: none; }
  table.hist[data-cards] tbody { display: block; }
  table.hist[data-cards] tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.hist[data-cards] tr:last-child { border-bottom: 0; }
  table.hist[data-cards] td { padding: 0; border: 0; }
  table.hist[data-cards] td:first-child { flex-basis: 100%; color: var(--muted); font-size: 12px; }
  table.hist[data-cards] td[data-l]:not(:first-child)::before { content: attr(data-l) ' '; color: var(--muted); font-size: 12px; font-weight: 500; font-family: var(--f-body); }
}
