/* Bohrungsanalyse: Zeichnungsblatt-Optik. Schrift: Bahnschrift (DIN-Charakter, in Windows enthalten). */
:root {
  --bg: #d8dfe5;
  --panel: #eef2f5;
  --sheet: #fbfcfd;
  --ink: #12202b;
  --ink2: #4a5b69;
  --hair: #c2cdd6;
  --hair2: #dbe3e9;
  --accent: #1d4e7a;
  --accent-ink: #ffffff;
  --accent-soft: rgba(29, 78, 122, .09);
  --ok: #15823c;
  --ok-soft: rgba(21, 130, 60, .12);
  --bad: #c0178a; --mx: #d9480f; --mn: #1565c0;
  --bad-soft: rgba(192, 23, 138, .11);
  --ist: #1e9f4b; --m0: #1e9f4b; --m1: #2b6cd1; --m2: #d9822b; --m3: #7a4fd0; --m4: #0f9aa8; --m5: #8a6d1d;
  --tol: #d23a3a;
  --grid: rgba(29, 78, 122, .075);
  --grid2: rgba(29, 78, 122, .17);
  --top: #12202b;
  --shadow: 0 1px 2px rgba(18, 32, 43, .08), 0 6px 18px rgba(18, 32, 43, .06);
  --font: "Bahnschrift", "DIN Alternate", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1117; --panel: #111a22; --sheet: #0e161e; --ink: #e6edf3; --ink2: #8fa1b0;
    --hair: #263541; --hair2: #1b2832; --accent: #6db0ea; --accent-ink: #0b1117;
    --accent-soft: rgba(109, 176, 234, .12); --ok: #3fd27a; --ok-soft: rgba(63, 210, 122, .13);
    --bad: #ff58c8; --mx: #ff9a4d; --mn: #5fb0ff; --bad-soft: rgba(255, 88, 200, .13); --ist: #3fd27a; --m0: #3fd27a; --m1: #6aa5ff; --m2: #ffa24d; --m3: #b69bff; --m4: #41d3e0; --m5: #d8b64a; --tol: #ff6f66;
    --grid: rgba(109, 176, 234, .07); --grid2: rgba(109, 176, 234, .16);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 22px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1117; --panel: #111a22; --sheet: #0e161e; --ink: #e6edf3; --ink2: #8fa1b0;
  --hair: #263541; --hair2: #1b2832; --accent: #6db0ea; --accent-ink: #0b1117;
  --accent-soft: rgba(109, 176, 234, .12); --ok: #3fd27a; --ok-soft: rgba(63, 210, 122, .13);
  --bad: #ff58c8; --mx: #ff9a4d; --mn: #5fb0ff; --bad-soft: rgba(255, 88, 200, .13); --ist: #3fd27a; --m0: #3fd27a; --m1: #6aa5ff; --m2: #ffa24d; --m3: #b69bff; --m4: #41d3e0; --m5: #d8b64a; --tol: #ff6f66;
  --grid: rgba(109, 176, 234, .07); --grid2: rgba(109, 176, 234, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 22px rgba(0, 0, 0, .35); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 14px; line-height: 1.35;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Gerüst ---------- */
.app {
  height: 100vh; min-height: 560px; display: grid; gap: 0;
  grid-template-columns: 330px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "top top" "panel stage";
}
.top {
  grid-area: top; display: flex; align-items: center; gap: 18px;
  padding: 10px 18px; background: var(--top); color: #fff;
}
:root[data-theme="dark"] .top, :root:not([data-theme="light"]) .top { }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand svg { flex: none; }
.brand h1 { margin: 0; font-size: 21px; font-weight: 700; font-stretch: 85%; letter-spacing: .01em; white-space: nowrap; }
.status {
  margin-left: 6px; padding: 5px 12px 5px 10px; border-radius: 4px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .12); color: #fff;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #9fb0bd; flex: none; }
.status.ok { background: rgba(63, 210, 122, .2); }
.status.ok::before { background: #4ee08a; }
.status.bad { background: rgba(255, 88, 200, .22); }
.status.bad::before { background: #ff6fd0; }
.status.busy::before { background: #ffd24d; }
.top-actions { margin-left: auto; display: flex; gap: 8px; }
.top .icon-btn { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.top .icon-btn:hover { background: rgba(255, 255, 255, .2); }

/* ---------- Seitenleiste ---------- */
.panel {
  grid-area: panel; overflow-y: auto; background: var(--panel);
  border-right: 1px solid var(--hair); padding: 6px 0 16px;
}
.group { padding: 14px 18px 16px; border-bottom: 1px solid var(--hair); }
.group:last-of-type { border-bottom: 0; }
.group h2 { margin: 0 0 10px; font-size: 15px; font-weight: 700; font-stretch: 88%; letter-spacing: .01em; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--ink2); }
.input {
  display: flex; align-items: stretch; background: var(--sheet); border: 1px solid var(--hair);
  border-radius: 5px; overflow: hidden;
}
.input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.input input {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 7px 9px; font-size: 15px;
  text-align: right; outline: none;
}
.input input:disabled { color: var(--ink2); opacity: .55; }
.input input[aria-invalid="true"] { color: var(--bad); }
.input .unit { padding: 7px 9px 7px 0; color: var(--ink2); font-size: 13px; align-self: center; }
.input .step { border: 0; border-left: 1px solid var(--hair); background: var(--panel); width: 32px; font-size: 16px; line-height: 1; }
.input .step:hover { background: var(--hair2); }
.hint { margin: 8px 0 0; font-size: 12.5px; color: var(--ink2); }
.hint strong { color: var(--ink); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px;
  border-radius: 5px; border: 1px solid var(--hair); background: var(--sheet); font-weight: 600;
}
.btn:hover { background: var(--hair2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 5px;
  border: 1px solid var(--hair); background: var(--sheet); padding: 0;
}
.icon-btn:hover { background: var(--hair2); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--hair); border-radius: 5px; overflow: hidden; background: var(--sheet); }
.seg label { position: relative; text-align: center; cursor: pointer; }
.seg input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.seg span { display: block; padding: 8px 10px; font-weight: 600; border-left: 1px solid var(--hair); }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -3px; }

.file-line { margin: 10px 0 0; font-size: 13px; color: var(--ink2); overflow-wrap: anywhere; }
.file-line strong { color: var(--ink); font-weight: 600; }
.fine { padding: 12px 18px 0; font-size: 12px; color: var(--ink2); }

/* ---------- Bühne ---------- */
.stage {
  grid-area: stage; display: grid; min-width: 0; min-height: 0; padding: 12px 14px 14px; gap: 10px;
  grid-template-rows: auto minmax(0, 1fr) clamp(150px, 24vh, 230px);
}
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.gain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; flex: 1 1 420px; min-width: 0; }
.gain > label { font-weight: 700; font-stretch: 88%; font-size: 15px; white-space: nowrap; }
.gain input[type=range] { flex: 1 1 140px; min-width: 80px; accent-color: var(--accent); height: 28px; }
.gain .input { width: 92px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { padding: 5px 9px; border: 1px solid var(--hair); background: var(--sheet); border-radius: 4px; font-size: 13px; font-weight: 600; }
.chip:hover { background: var(--hair2); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tools-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tools-right .seg span { padding: 7px 12px; }
.zoom { display: flex; gap: 4px; }

.sheet, .strip {
  position: relative; background: var(--sheet); border: 1px solid var(--hair); border-radius: 6px;
  box-shadow: var(--shadow); min-height: 0; overflow: hidden;
}
.sheet canvas, .strip canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#plot { touch-action: none; cursor: grab; }
#plot.panning { cursor: grabbing; }
#plot:focus-visible { outline-offset: -3px; }
.sheet.drop::after {
  content: "Datei loslassen"; position: absolute; inset: 10px; display: grid; place-items: center;
  border: 2px dashed var(--accent); border-radius: 6px; background: var(--accent-soft);
  font-size: 22px; font-weight: 700; color: var(--accent); z-index: 5;
}

.legend {
  position: absolute; left: 14px; bottom: 12px; display: grid; gap: 5px; font-size: 12.5px; color: var(--ink2);
  background: color-mix(in srgb, var(--sheet) 88%, transparent); padding: 8px 10px; border-radius: 5px; pointer-events: none;
}
.legend div { display: flex; align-items: center; gap: 9px; }
.legend svg { width: 30px; height: 8px; flex: none; }

.titleblock {
  position: absolute; right: 12px; bottom: 12px; width: 318px; background: var(--sheet);
  border: 1.6px solid var(--ink); font-size: 13px; z-index: 2;
}
.titleblock .cells { display: grid; grid-template-columns: 1fr 1fr; }
.titleblock .cell { padding: 4px 8px 5px; border-bottom: .8px solid var(--ink); min-width: 0; }
.titleblock .cells .cell:nth-child(odd) { border-right: .8px solid var(--ink); }
.titleblock .cell.full { grid-column: 1 / -1; }
.titleblock .cells .cell.full { border-right: 0; }
.titleblock small { display: block; font-size: 11px; color: var(--ink2); }
.titleblock b { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.titleblock .verdict { font-size: 16px; font-weight: 700; padding: 7px 8px; border-bottom: .8px solid var(--ink); background: var(--hair2); color: var(--ink2); }
.titleblock .verdict.ok { background: var(--ok-soft); color: var(--ok); }
.titleblock .verdict.bad { background: var(--bad-soft); color: var(--bad); }
.titleblock .credit { padding: 3px 8px; font-size: 10.5px; color: var(--ink2); }

.empty {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(470px, 88%);
  display: grid; justify-items: center; gap: 12px; text-align: center; padding: 26px 28px; z-index: 3;
  background: color-mix(in srgb, var(--sheet) 94%, transparent); border: 1px solid var(--hair); border-radius: 8px; box-shadow: var(--shadow);
}
.empty h2 { margin: 0; font-size: 26px; font-weight: 700; font-stretch: 85%; }
.empty p { margin: 0; max-width: 46ch; color: var(--ink2); font-size: 15px; }
.empty .btn-row { justify-content: center; margin-top: 4px; }
.empty code { background: var(--hair2); padding: 1px 6px; border-radius: 3px; font-family: inherit; color: var(--ink); }
.empty-frame { position: absolute; inset: 22px; border: 1.5px dashed var(--hair); border-radius: 6px; pointer-events: none; }

.strip-title { white-space: nowrap;
  position: absolute; left: 14px; top: 8px; font-weight: 700; font-stretch: 88%; font-size: 14px; z-index: 1; pointer-events: none;
  background: color-mix(in srgb, var(--sheet) 85%, transparent); padding: 1px 6px 1px 0;
}
.tip {
  position: absolute; z-index: 6; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12.5px;
  padding: 5px 9px; border-radius: 4px; white-space: nowrap; transform: translate(12px, 12px); display: none;
}
.toast {
  position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 20; max-width: min(560px, 92vw);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 6px; box-shadow: var(--shadow); display: none;
  border-left: 5px solid var(--bad);
}
.toast.show { display: block; }

/* ---------- schmale Fenster ---------- */
@media (max-width: 1180px) {
  .titleblock { width: 250px; font-size: 12px; }
  .titleblock b { font-size: 13.5px; }
}
@media (max-width: 900px) {
  .app { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto;
         grid-template-areas: "top" "stage" "panel"; }
  .stage { grid-template-rows: auto 62vh 190px; padding: 10px; min-width: 0; }
  .toolbar, .gain { min-width: 0; }
  .panel { border-right: 0; border-top: 1px solid var(--hair); overflow: visible; }
  .status { display: none; }
  .titleblock { width: 200px; right: 8px; bottom: 8px; }
  .titleblock .cells, .titleblock .cell.full { display: none; }
  .legend { display: none; }
}
@media (max-width: 560px) {
  .brand h1 { font-size: 18px; }
  .gain { flex-basis: 100%; }
  .tools-right { margin-left: 0; width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Drucken: Messprotokoll ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; }
  .panel, .toolbar, .top-actions, .zoom, .empty { display: none !important; }
  .app { display: block; height: auto; }
  .top { background: #fff; color: #000; padding: 0 0 6px; }
  .status { background: none; color: #000; padding: 0; }
  .stage { display: block; padding: 0; }
  .sheet { height: 128mm; box-shadow: none; }
  .strip { height: 52mm; margin-top: 4mm; box-shadow: none; }
}

/* ---------- Messungen ---------- */
.meas-list { display: grid; gap: 8px; margin-top: 12px; }
.meas-list:empty { display: none; }
.meas {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; align-items: center;
  padding: 8px 8px 8px 12px; border: 1px solid var(--hair); border-radius: 6px; background: var(--sheet); cursor: pointer;
}
.meas::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 6px 0 0 6px; background: var(--c, var(--ist)); }
.meas[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.meas .nm { grid-column: 1 / 3; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meas .rm { grid-column: 3; grid-row: 1; width: 28px; height: 28px; border: 0; background: transparent; border-radius: 4px; color: var(--ink2); font-size: 18px; line-height: 1; padding: 0; }
.meas .rm:hover { background: var(--hair2); color: var(--ink); }
.meas .dp { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink2); }
.meas .dp input { width: 62px; padding: 3px 6px; border: 1px solid var(--hair); border-radius: 4px; background: var(--panel); text-align: right; font-size: 13.5px; }
.meas .dp input:focus { outline: none; border-color: var(--accent); }
.meas .sx { grid-column: 2 / 4; text-align: right; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.meas .sx.ok { color: var(--ok); }
.meas .sx.bad { color: var(--bad); }
.taper { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--hair); border-radius: 6px; background: var(--sheet); font-size: 13px; }
.taper b { font-weight: 700; font-size: 14px; display: block; margin-bottom: 4px; }
.taper div + div { margin-top: 3px; color: var(--ink2); }
.taper .warn { color: var(--bad); font-weight: 600; }
.legend div.sw i { width: 30px; height: 3px; border-radius: 2px; display: inline-block; flex: none; }
.legend svg { overflow: visible; }
#tbTable table { width: 100%; border-collapse: collapse; font-size: 12px; }
#tbTable th { font-weight: 400; color: var(--ink2); text-align: right; padding: 3px 5px; font-size: 11px; border-bottom: .8px solid var(--ink); }
#tbTable td { text-align: right; padding: 4px 5px; border-bottom: .8px solid var(--hair); font-weight: 600; white-space: nowrap; }
#tbTable th:first-child, #tbTable td:first-child { text-align: left; }
#tbTable td.bad { color: var(--bad); } #tbTable td.ok { color: var(--ok); }
#tbTable i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; background: var(--c); }
#tbTable[hidden], #tbCells[hidden] { display: none; }

/* ---------- kompakte Seitenleiste: alles ohne Scrollen ---------- */
.app { grid-template-columns: 372px minmax(0, 1fr); }
.panel { padding: 0; display: flex; flex-direction: column; }
.group { padding: 11px 14px 12px; }
.group h2 { margin: 0 0 7px; font-size: 14px; }
.row { gap: 7px 10px; }
.field { gap: 2px; }
.field label { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.input input { padding: 5px 8px; font-size: 14.5px; }
.input .unit { padding-right: 8px; font-size: 12px; white-space: nowrap; }
.btn { padding: 6px 12px; }
.btn-row.tight { margin-top: 8px; gap: 6px; }
.btn-row.tight .btn { padding: 6px 8px; flex: 1 1 0; }
#btnFree { margin-top: 8px; padding: 5px 8px; font-size: 12.5px; }
.seg span { padding: 6px 10px; }
.hint { margin: 7px 0 0; font-size: 12px; }
.file-line { margin: 8px 0 0; font-size: 12.5px; }
.meas-list { gap: 6px; margin-top: 9px; }
.meas { grid-template-columns: minmax(0, 1fr) auto auto; gap: 0 8px; padding: 5px 4px 5px 12px; }
.meas .nm { grid-column: 1; grid-row: 1; font-size: 13px; }
.meas .dp { grid-column: 2; grid-row: 1; }
.meas .rm { grid-column: 3; grid-row: 1; width: 24px; height: 24px; }
.meas .sx { grid-column: 1 / -1; grid-row: 2; text-align: left; font-size: 12px; }
.meas .dp input { width: 50px; padding: 2px 5px; }
.taper { margin-top: 9px; padding: 7px 10px; font-size: 12px; }
.taper b { font-size: 13px; margin-bottom: 2px; }
.fine { margin-top: auto; padding: 10px 14px 12px; font-size: 11px; }
@media (max-height: 820px) {
  .group { padding: 8px 12px 9px; }
  .group h2 { margin-bottom: 5px; font-size: 13.5px; }
  .input input { padding: 3px 7px; font-size: 14px; }
  .btn { padding: 4px 10px; }
  .seg span { padding: 4px 10px; }
  .meas { padding-top: 3px; padding-bottom: 3px; }
  .taper div + div { margin-top: 1px; }
  .fine { padding: 6px 12px 8px; }
}
@media (max-width: 1200px) { .app { grid-template-columns: 340px minmax(0, 1fr); } }
@media (max-width: 900px) { .app { grid-template-columns: minmax(0, 1fr); } .panel { display: block; } }
[hidden] { display: none !important; }
.btn { white-space: nowrap; }
.btn-row.tight .btn:first-child { flex: 1.5 1 0; }
@media (max-height: 820px) { .fine { display: none; } }

.row.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 8px; }
.row.r3 .span2 { grid-column: span 2; }
.row.r3 .span2 .btn { width: 100%; padding: 5px 6px; font-size: 12.5px; }
.row.r3 .input input { padding: 4px 6px; font-size: 14px; }
.row.r3 .input .unit { padding-right: 6px; font-size: 11.5px; }
.field label #kegelUnit { color: var(--ink2); font-weight: 400; }

[data-tip] { cursor: help; }
.xtip {
  position: fixed; z-index: 30; display: none; max-width: 320px; padding: 9px 12px; border-radius: 6px; pointer-events: none;
  background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow);
}
@media print { .xtip { display: none !important; } }

.tgl { height: 36px; padding: 0 12px; border: 1px solid var(--hair); background: var(--sheet); border-radius: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.tgl:hover { background: var(--hair2); }
.tgl[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

#plot.selmode, #strp.selmode { cursor: crosshair; }
.selbar {
  position: absolute; z-index: 5; right: 14px; top: 12px; width: min(540px, calc(100% - 360px)); display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px; background: var(--sheet); border: 1px solid var(--bad); border-radius: 8px; box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.4;
}
.selbar .selbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.selbar .btn { padding: 5px 10px; font-size: 12.5px; }
@media print { .selbar { display: none !important; } }

.titleblock .corr { padding: 5px 8px 6px; border-bottom: .8px solid var(--ink); background: var(--accent-soft); }
.titleblock .corr b { display: block; font-size: 16px; color: var(--accent); }
.titleblock .corr b.ok { color: var(--ok); }
.titleblock .corr span { display: block; font-size: 11px; color: var(--ink2); }
.titleblock .corr[hidden] { display: none; }

.titleblock { width: 356px; }
#tbTable td, #tbTable th { padding-left: 3px; padding-right: 3px; }

.simf { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 9px; border: 1px solid var(--hair); border-radius: 6px; background: var(--sheet); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: text; }
.simf input { width: 62px; text-align: right; border: 0; background: transparent; font: inherit; color: var(--ink); padding: 0; outline: none; }
.simf .u { color: var(--ink2); font-weight: 400; }
.simf:focus-within { border-color: var(--accent); }
.simf.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.simf.on input { color: var(--accent); }
.simf input[aria-invalid="true"] { color: var(--bad); }
@media print { .simf { display: none !important; } }

.panel .simf, aside .simf { width: 100%; height: 34px; margin: 0 0 8px; justify-content: space-between; box-sizing: border-box; }
aside .simf input { width: 70px; flex: none; margin-left: auto; }
aside .simf .u { min-width: 62px; }
aside .simf .u { min-width: 110px; text-align: left; }
aside .simf input { width: 52px; }

.infowrap { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(10,18,28,.55); }
.infodlg { display: flex; flex-direction: column; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--hair); border-radius: 10px; background: var(--sheet); color: var(--ink); box-shadow: 0 18px 60px rgba(0,0,0,.35); }
.infohead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--hair); }
.infohead h2 { margin: 0; font-size: 17px; line-height: 1.3; }
.infohead .icon-btn { color: var(--ink); }
.infobody { overflow-y: auto; padding: 4px 22px 20px; font-size: 14px; line-height: 1.55; }
.infobody h3 { margin: 18px 0 6px; font-size: 15px; }
.infobody p { margin: 6px 0; }
.infobody ul { margin: 6px 0; padding-left: 20px; }
.infobody li { margin: 4px 0; }
@media print { .infowrap { display: none !important; } }
.btn-row.tight { flex-wrap: nowrap; }
.btn-row.tight .btn, .btn-row.tight .btn:first-child { flex: 1 1 0; padding: 6px 2px; min-width: 0; }

.formseg { margin-top: 6px; }
