:root {
  --bg: #F1F0EE; --surface: #FFFFFF; --ink: #1B1A18; --ink-2: #55514C; --ink-3: #8C8782; --line: #E4E1DD;
  --accent: #E35A12; --accent-hover: #C84A0A; --accent-soft: #FDEADF;
  --ok: #1C9A68; --warn: #A86300; --bad: #C4351E; --info: #2F6ED8;
  --r-card: 20px; --r-ctl: 10px; --shadow: 0 1px 2px rgba(27,26,24,.06), 0 6px 24px rgba(27,26,24,.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
/* The hidden attribute always wins (component rules such as .btn { display: inline-flex } used to override it). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
h1 { font-size: 17px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
code, .mono { font-family: var(--mono); font-size: 12px; }
.small { font-size: 13px; }
.muted { color: var(--ink-3); }
.hint { color: var(--ink-2); margin-bottom: 0; }

.appbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .sub { margin: 0; font-size: 12px; color: var(--ink-3); }
.pill { font-size: 12px; padding: 5px 10px; border-radius: 999px; white-space: nowrap; max-width: 55vw; overflow: hidden; text-overflow: ellipsis; }
.pill-wait { background: #F3EFEA; color: var(--ink-2); }
.pill-ok { background: #E3F4EC; color: var(--ok); }
.pill-bad { background: #FBE6E2; color: var(--bad); }

.notice { margin: 12px 16px 0; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: #6B2C08; font-size: 13px; }

.loader { margin: 12px 16px 0; padding: 12px 16px; max-width: 1248px; }
@media (min-width: 1280px) { .loader { margin-left: auto; margin-right: auto; } }
.loader[hidden] { display: none; }
.loader-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; }
.loader-track { height: 8px; border-radius: 999px; background: #EEEAE5; overflow: hidden; margin: 8px 0 6px; }
.loader-bar { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .25s ease; }
.loader-ok .loader-bar { background: var(--ok); }
.loader-bad .loader-bar { background: var(--bad); }
.loader-bad .loader-head { color: var(--bad); }
.loader-note { margin: 0; }
.layout { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 12px 16px 16px; max-width: 1280px; margin: 0 auto; }
@media (min-width: 900px) { .layout { grid-template-columns: 360px 1fr; align-items: start; } .col-left { position: sticky; top: 64px; } }
.col-left, .col-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 16px; }
details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2 { margin: 0; }
details.card > summary h2::after { content: "▸"; color: var(--ink-3); margin-left: auto; }
details[open].card > summary h2::after { content: "▾"; }
details[open].card > summary { margin-bottom: 12px; }
.step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 14px var(--font);
  padding: 10px 14px; border-radius: var(--r-ctl); cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover:not(:disabled) { border-color: var(--ink-3); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-small { padding: 6px 10px; min-height: 36px; font-size: 13px; }
.btn-row .btn { flex: 1 1 auto; }
#card-input .btn-row .btn { flex: 1 1 140px; }

.dropzone { margin-top: 10px; border: 1.5px dashed var(--line); border-radius: var(--r-ctl); padding: 12px; text-align: center; color: var(--ink-3); font-size: 13px; }
.dropzone.drag { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
@media (pointer: coarse) { .dropzone { display: none; } }
.samples { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }

.field { margin-bottom: 12px; }
.field label { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.field output { font-family: var(--mono); color: var(--ink); }
.field input[type=range] { width: 100%; accent-color: var(--accent); }
.field-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-inline label { margin: 0; }
.field-inline input[type=number] { width: 90px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: 14px var(--mono); }
.field-inline input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }

.viewer { position: relative; border-radius: 14px; overflow: hidden; background: #22201E; min-height: 220px; display: grid; place-items: center; }
.viewer canvas { display: block; width: 100%; height: auto; }
.viewer.empty canvas { display: none; }
.placeholder { color: #9b958f; font-size: 14px; }
.viewer:not(.empty) .placeholder { display: none; }
.busy { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(27,26,24,.55); color: #fff; font-size: 14px; }
.busy[hidden] { display: none; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 4px; color: var(--ink-2); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 2.5px solid; }
.sw-disk { border-color: var(--info); } .sw-zone { border-color: var(--accent); } .sw-unpaired { border-color: var(--bad); border-style: dashed; }
.sw-lowconf { border-color: var(--accent); border-style: dashed; }
.field-inline select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: 13px var(--font); background: var(--surface); max-width: 60%; }
.sw-plate { border-color: #8C8782; border-style: dashed; border-width: 2px; }
.subhead { font-size: 13px; margin: 16px 0 8px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 12px; }
.tag { display: inline-block; flex: none; align-self: center; font-size: 10px; line-height: 1.4; height: auto; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-hover); margin-left: 4px; vertical-align: 1px; white-space: nowrap; font-weight: 600; letter-spacing: 0.02em; }
.label-text { display: inline; }
.field-inline label { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: #F3F1EE; color: var(--ink-2); }
.chip b { color: var(--ink); font-family: var(--mono); font-weight: 600; }
.flags { margin: 4px 0 8px; padding-left: 18px; color: var(--warn); font-size: 13px; }
.flags:empty { display: none; }

.table-wrap { overflow-x: auto; margin: 6px 0; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
td.num { font-family: var(--mono); white-space: nowrap; }
td.mm { font-family: var(--mono); font-weight: 700; font-size: 14px; }
td.none { color: var(--ink-3); font-style: italic; }
td.notes { color: var(--warn); font-size: 12px; }
tr.unpaired td { color: var(--bad); }

.diag { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12px; margin: 0 0 10px; }
.diag dt { color: var(--ink-3); }
.diag dd { margin: 0; font-family: var(--mono); word-break: break-all; }
.diag dd.bad { color: var(--bad); }
.diag dd.ok { color: var(--ok); }

.footer { max-width: 1280px; margin: 0 auto; padding: 0 16px 24px; }
.footer p { margin: 4px 0; }

/* per-disk edge reading */
.edge-select { font: inherit; font-size: 0.85em; width: auto; max-width: none; padding: 2px 4px; border-radius: 6px; border: 1px solid #c9c3bb; background: #fff; }
td.edited .edge-select { border-color: #E35A12; background: #FFF4EC; }

/* interpretation */
.sw-alt { border: 2px dashed #FFD60A; background: transparent; }
.agent-select { font: inherit; font-size: 0.85em; max-width: 15em; padding: 2px 4px; border-radius: 6px; border: 1px solid #c9c3bb; background: #fff; }
.crit-select { display: block; margin-top: 3px; font: inherit; font-size: 0.78em; max-width: 15em; border-radius: 6px; border: 1px solid #ddd6cc; background: #fff; }
.cat { display: inline-block; min-width: 2.2em; text-align: center; font-weight: 700; border-radius: 6px; padding: 1px 6px; }
.cat-S { background: #DDF3E4; color: #11612F; }
.cat-I, .cat-SDD { background: #FFF1CC; color: #7A5200; }
.cat-NS { background: #FCE4D6; color: #8A3B12; }
.cat-R { background: #FADBD6; color: #8E1F12; }
.bp-text { display: block; font-size: 0.75em; color: #6b655d; }
.bp-text.warn { color: #8E1F12; }

/* breakpoint-table ⓘ button + collapsible details panel */
.label-with-info { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.field-inline .label-with-info label { flex: 0 1 auto; }
.info-btn { appearance: none; flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border-radius: 50%;
  border: 1.5px solid var(--ink-3); background: var(--surface); color: var(--ink-2); font: italic 700 12px/1 Georgia, "Times New Roman", serif; cursor: pointer;
  position: relative; }
.info-btn::after { content: ""; position: absolute; inset: -11px; }   /* 44 px tap target without a larger visual */
.info-btn:hover, .info-btn.open { border-color: var(--accent); color: var(--accent); }
.info-btn:focus-visible, .note-toggle:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.info-panel { margin: -4px 0 12px; padding: 10px 12px; border-radius: var(--r-ctl); background: #F7F5F2; border: 1px solid var(--line); color: var(--ink-2); }
.info-panel p { margin: 0 0 6px; }
.info-panel p:last-child { margin-bottom: 0; }
.info-panel b { color: var(--ink); font-weight: 600; }
.info-panel .info-title { color: var(--ink); font-weight: 600; }
.info-panel .info-note { color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 6px; margin-top: 8px; }
#card-interp .btn-row { margin-top: 2px; }

/* compact S/I/R cell */
td.c-cat { min-width: 9em; }
.cat-line { display: block; white-space: nowrap; }   /* badge + ⓘ side by side (plain inline flow) */
.cat-line > * { vertical-align: middle; }
.cat-line .note-toggle { margin-left: 6px; }
.cat-reason { font-size: 0.85em; color: var(--ink-2); }
.bp-text.bp-short { white-space: nowrap; margin-top: 2px; }
.bp-text.warn { max-width: 18em; }
.note-toggle { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--info); font: 600 11px/1 var(--font);
  padding: 3px 6px; border-radius: 999px; cursor: pointer; }
.note-toggle[aria-expanded="true"] { background: #EAF1FC; border-color: #BFD3F5; }
.bp-notes { margin: 4px 0 2px; padding-left: 14px; font-size: 0.75em; color: #4E4943; max-width: 22em; }
.bp-notes li { margin: 1px 0; }

/* ---------- annotation mode ---------- */
.chip-toggle { appearance: none; margin-left: auto; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink-2); font: 600 13px var(--font); cursor: pointer; position: relative; }
.chip-toggle::after { content: ""; position: absolute; inset: -4px; }   /* >= 44 px tap target */
.chip-toggle[aria-pressed="true"] { background: #EAF1FC; border-color: var(--info); color: var(--info); }
.chip-toggle:disabled { opacity: .45; cursor: default; }
.chip-toggle:focus-visible, .ann-panel .btn:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.ann-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; padding: 8px 12px; border-radius: var(--r-ctl);
  background: #EAF1FC; border: 1px solid #BFD3F5; color: #1B3F7A; }
.ann-notice > span:first-child { flex: 1 1 220px; }
.ann-notice-btns { display: flex; gap: 8px; }
.viewer.annotating canvas { cursor: pointer; }
.viewer.annotating.adding canvas { cursor: crosshair; }
.ann-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ann-head { display: flex; align-items: center; gap: 8px; }
.ann-head .btn { flex: none; min-width: 72px; }
.ann-title { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; line-height: 1.25; }
.ann-title b { font-size: 15px; overflow-wrap: anywhere; }
.ann-panel .btn { white-space: normal; text-align: center; min-width: 0; }
.ann-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 10px 0 4px; }
.ann-modes .seg { border-radius: 0; margin-left: -1px; padding: 8px 6px; font-size: 13px; }
.ann-modes .seg:first-child { border-radius: var(--r-ctl) 0 0 var(--r-ctl); margin-left: 0; }
.ann-modes .seg:last-child { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.ann-modes .seg[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; position: relative; z-index: 1; }
.ann-hint { margin: 4px 0 10px; }
.ann-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 700px) { .ann-grid { grid-template-columns: minmax(260px, 400px) minmax(0, 1fr); align-items: start; } }
.ann-inset-wrap { width: 100%; max-width: 480px; min-width: 0; justify-self: center; }
#ann-inset { display: block; width: 100%; aspect-ratio: 1 / 1; height: auto; border-radius: 12px; background: #22201E;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: crosshair; }
.ann-controls { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ann-readout { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.ann-readout output { font: 700 22px var(--mono); color: var(--ink); }
.ann-src { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #F3F1EE; color: var(--ink-2); }
.ann-src.is-human { background: #EAF1FC; color: var(--info); }
.ann-algo { margin: 0; }
.ann-slider { width: 100%; min-height: 44px; accent-color: var(--accent); margin: 0; }
.ann-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ann-steps .btn { padding: 8px 2px; font-family: var(--mono); }
.ann-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ann-pair .btn { padding: 8px 8px; font-size: 13px; text-align: center; }
#ann-nozone[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.ann-disk-tools { padding: 8px 10px; border-radius: var(--r-ctl); background: #F7F5F2; border: 1px solid var(--line); }
.ann-disk-tools p { margin: 0 0 8px; }
.ann-tags { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 4px 10px 6px; margin: 0; min-width: 0; }
.ann-tag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.ann-tags legend { padding: 0 4px; color: var(--ink-2); }
.ann-tag { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; cursor: pointer; }
.ann-tag input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); margin: 0; }
.ann-field { margin-bottom: 0; }
.ann-field input[type=text], .ann-field input[type=number] { font: 16px var(--font); min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; width: 100%; }
.ann-field.field-inline input[type=number] { width: 110px; font-family: var(--mono); }
.ann-field.field-inline input[type=text] { width: 160px; }
.ann-export { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.ann-export .btn-row .btn { flex: 1 1 180px; }
.ann-msg { margin: 8px 0 4px; min-height: 1em; }
.ann-msg-ok { color: var(--ok); }
.ann-msg-bad { color: var(--bad); }
.ann-badge { display: inline-block; margin-left: 4px; font-size: 11px; font-weight: 700; color: var(--info); }
td.mm.human, td.human { color: var(--info); }
tr.deleted td { color: var(--ink-3); text-decoration: line-through; }
tr.deleted td select { text-decoration: none; }
tr.ann-selectable td.c-disk { cursor: pointer; }
tr.selected td { background: #EAF6FC; }
@media (max-width: 700px) {
  .ann-tag { font-size: 13px; }
  .ann-head .btn { min-width: 64px; padding: 8px 8px; }
  .ann-field.field-inline { flex-wrap: wrap; }
  .ann-field.field-inline label { flex: 1 1 100%; }
  .ann-field.field-inline input[type=number], .ann-field.field-inline input[type=text] { width: 100%; }
  #result-table tr.selected { border-color: var(--info); background: #EAF6FC; }
  #result-table tr.selected td { background: transparent; }
}

/* narrow screens (phones): each result row becomes a compact card, no horizontal scrolling */
@media (max-width: 700px) {
  .table-wrap { overflow-x: visible; }
  #result-table, #result-table tbody { display: block; width: 100%; }
  #result-table thead { display: none; }
  /* flex-wrap card: line 1 = Disk · zone mm · S/I/R (fills the rest); then antibiotic (full width); edge + conf; notes (full width) */
  #result-table tr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; padding: 10px 12px; margin: 0 0 8px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  #result-table tr.unpaired { background: #FDF3F1; }
  #result-table td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  /* visual order differs from DOM/column order: S/I/R joins Disk + zone on line 1, antibiotic goes below */
  #result-table td.c-disk { order: 1; } #result-table td.c-mm { order: 2; } #result-table td.c-cat { order: 3; }
  #result-table td.c-agent { order: 4; } #result-table td.c-edge { order: 5; } #result-table td.c-conf { order: 6; }
  #result-table td.c-notes { order: 7; }
  #result-table td.c-disk { flex: none; font-weight: 700; font-size: 14px; line-height: 24px; }
  #result-table td.c-mm { flex: none; white-space: nowrap; line-height: 24px; }
  #result-table td.c-mm.mm::after { content: " mm"; font-weight: 400; font-size: 12px; color: var(--ink-3); }
  #result-table td.c-cat { flex: 1 1 0; min-width: 0; text-align: right; }   /* basis 0: never pushed to its own line by long text */
  #result-table td.c-cat .cat-line { min-height: 24px; }
  #result-table td.c-cat .bp-text.bp-short { white-space: normal; }
  #result-table td.c-cat .bp-notes, #result-table td.c-cat .bp-text.warn { max-width: none; text-align: left; }
  #result-table td.c-agent { flex: 1 1 100%; }
  #result-table td.c-edge { flex: 1 1 0; }
  #result-table td.c-conf { flex: none; text-align: right; }
  #result-table td.c-notes { flex: 1 1 100%; }
  #result-table td.c-notes:empty, #result-table td.c-empty { display: none; }
  #result-table td.c-full { flex: 1 1 100%; }
  #result-table td.c-agent::before, #result-table td.c-edge::before, #result-table td.c-conf::before, #result-table td.c-notes::before {
    content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: var(--ink-3); margin-bottom: 2px; font-style: normal; }
  /* 16 px controls: full-width, comfortable tap targets, and no iOS auto-zoom on focus */
  #result-table .agent-select, #result-table .crit-select { display: block; width: 100%; max-width: 100%; min-width: 0; font-size: 16px; min-height: 36px; padding: 4px 6px; }
  #result-table .edge-select { width: 100%; max-width: 100%; min-width: 0; font-size: 16px; min-height: 36px; padding: 4px 6px; }
  #result-table td.c-agent.muted { font-size: 13px; }
}

/* ---------- teaching mode (Annotation) */
.ann-teachbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 0 0 8px; }
.ann-teach-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.ann-teach-toggle input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.ann-coach { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--ink, #111); border-left: 3px solid var(--accent); line-height: 1.4; }
.ann-remind { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: #fff7e6; border-left: 3px solid #d97706; line-height: 1.4; }
.ann-remind p { margin: 0; }
.ann-remind p + p { margin-top: 6px; }
.ann-rules { margin: 6px 0 10px; }
.ann-rules summary { cursor: pointer; color: var(--accent-hover); font-weight: 600; }
.ann-rules ul { margin: 6px 0; padding-left: 18px; line-height: 1.4; }
.ann-rules li + li { margin-top: 4px; }
.ann-rules p { margin: 4px 0 0; }

.teach-overlay { position: fixed; inset: 0; z-index: 2000; }
.teach-hole { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55); outline: 2px solid var(--accent); outline-offset: 0; pointer-events: none; transition: left .15s, top .15s, width .15s, height .15s; }
.teach-overlay:has(.teach-hole[hidden]) { background: rgba(15, 23, 42, 0.55); }
.teach-card { position: fixed; width: 360px; max-width: calc(100vw - 24px); background: var(--surface, #fff); color: var(--ink, #111); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25); padding: 14px 16px 12px; outline: none; }
.teach-card.teach-sheet { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); top: auto; width: auto; max-width: 640px; margin: 0 auto; max-height: 46vh; overflow: auto; }
.teach-count { font-size: 11px; color: var(--ink-2); letter-spacing: 0.04em; }
.teach-title { margin: 2px 0 6px; font-size: 16px; }
.teach-body p { margin: 0 0 6px; font-size: 14px; line-height: 1.45; }
.teach-dots { display: flex; gap: 4px; margin: 6px 0 10px; }
.teach-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.teach-dots span.on { background: var(--accent); }
.teach-bar { display: flex; gap: 8px; align-items: center; }
.teach-bar .teach-skip { margin-right: auto; }
.teach-bar .btn { min-height: 36px; }
@media (prefers-reduced-motion: reduce) { .teach-hole { transition: none; } }

/* ---------- disk-code reading (v0.5.0): per-disk status under the antibiotic select, plate status line, annotation block */
.code-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 3px; font-size: 12px; line-height: 1.35; color: var(--ink-2); max-width: 22em; }
.code-line .code-text { min-width: 0; overflow-wrap: anywhere; }
.code-pending { color: var(--ink-3); font-style: italic; }
.code-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .02em; background: #F3F1EE; color: var(--ink-2); white-space: nowrap; }
.code-badge:empty { display: none; }
.code-badge.code-auto { background: #E4F5EC; color: var(--ok); }
.code-badge.code-review { background: #FFF1DB; color: var(--warn); }
.code-badge.code-unresolved { background: #FBE9E5; color: var(--bad); }
.code-badge.code-user { background: #EAF1FC; color: var(--info); }
.code-line .btn-small { min-height: 28px; padding: 2px 10px; font-size: 12px; }
.agent-select.auto-filled { border-color: #9fd6bd; background: #F5FBF8; }
.code-dup { margin-top: 3px; font-size: 12px; color: var(--warn); font-weight: 600; }
.codes-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; padding: 6px 10px; border-radius: var(--r-ctl); background: #F6F5F3; color: var(--ink-2); }
.codes-status.codes-ok { background: #EEF8F3; }
.codes-status.codes-warn { background: #FFF6E8; color: #6E4300; }
.codes-status.codes-bad { background: #FBEDEA; color: var(--bad); }
.codes-status progress { width: 120px; height: 8px; }
.ann-abx { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: #FAFAF9; }
.ann-abx-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ann-abx-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ann-abx-row .agent-select { flex: 1 1 12em; max-width: 100%; min-height: 36px; font-size: 15px; }
.ann-abx-note { margin: 4px 0 0; }
@media (max-width: 700px) {
  #result-table .code-line { max-width: none; font-size: 13px; }
  #result-table .code-line .btn-small { min-height: 36px; }
  .ann-abx-row .agent-select { font-size: 16px; }   /* no iOS zoom on focus */
}

/* PDF report details (v0.5.0-beta.7) */
.report-details { margin: 12px 0 4px; }
.report-details summary { cursor: pointer; color: var(--accent-hover); font-weight: 600; font-size: 14px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; margin-top: 10px; }
.report-grid input[type=text], .report-grid textarea { width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font: 16px var(--font); background: var(--surface); color: var(--ink); }   /* 16px: iOS Safari does not zoom on focus */
.report-grid .report-wide { grid-column: 1 / -1; }

/* colonies inside the zone (0.5.0-beta.9, opt-in) */
.col-tag { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: #FCE4EF; color: #A3195B; font-size: 0.72em; font-weight: 600; vertical-align: middle; }
.col-tag.streaks { background: #FFF3CD; color: #7A5A00; }
td.needs-choice select { outline: 2px solid #D63384; outline-offset: 1px; }
.colony-line { margin-top: 4px; font-size: 0.82em; line-height: 1.35; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-weight: 400; white-space: normal; }
.colony-line .code-text { color: #A3195B; }
td.has-colony { color: #A3195B; }

.org-prompt { margin-top: 2px; }
select.attention { outline: 3px solid var(--accent, #E2643A); outline-offset: 2px; transition: outline-color 0.3s; }
