@font-face { font-family: 'Switzer'; src: url('/fonts/switzer-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('/fonts/switzer-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('/fonts/switzer-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --bg: #e8ebee;
  --panel: #ffffff;
  --panel-2: #f4f5f7;
  --field: #ffffff;
  --seg-bg: #eceef1;
  --seg-on: #ffffff;
  --hover: #eef0f3;
  --line: #d5dade;
  --line-soft: #e8ebee;
  --line-2: #a9b0b8;
  --ink: #15181b;
  --ink-soft: #59616a;
  --brand: #f7403a;
  --focus: #1d5fd1;
  --current: #fff4c2;
  --ok: #1f9d55; --warn: #d9a300; --no: #d93a30; --none: #b3bac2;
  --ok-bg: #dcefe3; --ok-ink: #135a2c;
  --warn-bg: #fbe8b0; --warn-ink: #5e4000;
  --no-bg: #f9d9d5; --no-ink: #8c1b15;
  --none-bg: #eceef0; --none-ink: #59616a;
  --draw-paper: #ffffff;
  --draw-ink: #15181b;
  --draw-grid: #cdd3d9;
  --draw-soft: #5b6168;
  --draw-fill: #e6e9ec;
  --draw-ground: #8a9097;
  --logo-filter: none;
  --shadow: 0 1px 2px rgb(16 24 32 / .12);
  --r: 6px;
  color-scheme: light;
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1012; --panel: #171a1e; --panel-2: #1d2126; --field: #111417; --seg-bg: #0f1215; --seg-on: #2a3037; --hover: #22272d;
    --line: #2b3138; --line-soft: #22272d; --line-2: #48515b; --ink: #e7eaee; --ink-soft: #9ea7b1; --focus: #6ea2ff; --current: #3a3417;
    --ok: #34c472; --warn: #e8b923; --no: #f0574d; --none: #4a525c;
    --ok-bg: #12331f; --ok-ink: #8fe0aa; --warn-bg: #3a2f0c; --warn-ink: #f3d36f; --no-bg: #431a18; --no-ink: #ffa49c; --none-bg: #23282e; --none-ink: #9ea7b1;
    --draw-paper: #121518; --draw-ink: #d6dbe1; --draw-grid: #2a3138; --draw-soft: #8b949e; --draw-fill: #262c33; --draw-ground: #5a636d;
    --logo-filter: invert(1) hue-rotate(180deg) brightness(1.15); --shadow: 0 1px 2px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --bg: #0e1012; --panel: #171a1e; --panel-2: #1d2126; --field: #111417; --seg-bg: #0f1215; --seg-on: #2a3037; --hover: #22272d;
    --line: #2b3138; --line-soft: #22272d; --line-2: #48515b; --ink: #e7eaee; --ink-soft: #9ea7b1; --focus: #6ea2ff; --current: #3a3417;
    --ok: #34c472; --warn: #e8b923; --no: #f0574d; --none: #4a525c;
    --ok-bg: #12331f; --ok-ink: #8fe0aa; --warn-bg: #3a2f0c; --warn-ink: #f3d36f; --no-bg: #431a18; --no-ink: #ffa49c; --none-bg: #23282e; --none-ink: #9ea7b1;
    --draw-paper: #121518; --draw-ink: #d6dbe1; --draw-grid: #2a3138; --draw-soft: #8b949e; --draw-fill: #262c33; --draw-ground: #5a636d;
    --logo-filter: invert(1) hue-rotate(180deg) brightness(1.15); --shadow: 0 1px 2px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.45 'Switzer', system-ui, sans-serif;
  font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin: 0; text-wrap: balance; }
html { scrollbar-color: var(--line-2) transparent; caret-color: var(--focus); }
::selection { background: color-mix(in srgb, var(--focus) 30%, transparent); }
a { text-underline-offset: 3px; }
button, a, input, label, summary { touch-action: manipulation; }
.skip {
  position: absolute; left: 12px; top: -64px; z-index: 40; padding: 10px 14px; border-radius: var(--r);
  background: var(--ink); color: var(--panel); font-weight: 500; text-decoration: none; transition: top .15s ease-out;
}
.skip:focus { top: 8px; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.icon { display: inline-block; vertical-align: -0.12em; flex: none; }

/* header */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
  height: 56px; padding: 0 12px 0 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.top__brand { display: block; line-height: 0; margin-right: 4px; }
.logo { height: 22px; width: auto; filter: var(--logo-filter); }
.top__app { padding-left: 14px; border-left: 1px solid var(--line); font-size: 15px; font-weight: 600; line-height: 22px; letter-spacing: 0; }
.top__spacer { flex: 1; }
.top__report svg { margin-left: -2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border: 1px solid var(--ink); border-radius: var(--r);
  background: var(--ink); color: var(--panel); font-weight: 500; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color .15s ease-out, border-color .15s ease-out, opacity .15s ease-out, transform .12s cubic-bezier(.22, 1, .36, 1);
}
.btn:hover { opacity: .9; }
.btn:active, .icon-btn:active, .cell:active { transform: scale(.97); }
.icon-btn, .cell { transition: background-color .15s ease-out, box-shadow .15s ease-out, transform .12s cubic-bezier(.22, 1, .36, 1); }
.btn--line, .btn--quiet { background: var(--panel); color: var(--ink); border-color: var(--line-2); }
.btn--line:hover, .btn--quiet:hover { background: var(--hover); opacity: 1; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink); padding: 0 12px; }
.btn--ghost:hover { background: var(--hover); opacity: 1; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: var(--r); background: none; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); }
#theme[aria-pressed="true"] .icon-moon, #theme[aria-pressed="false"] .icon-sun { display: none; }
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--focus); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }

.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.avatar {
  display: grid; place-items: center; width: 36px; height: 36px; margin-left: 4px; border-radius: 50%;
  background: var(--ink); color: var(--panel); font-weight: 600; font-size: 14px; cursor: pointer; user-select: none;
}
.menu__pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 220px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 32px rgb(0 0 0 / .18);
}
.menu__name { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-weight: 600; }
.menu__item {
  display: flex; align-items: center; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 4px;
  background: none; color: var(--ink); text-decoration: none; text-align: left; cursor: pointer;
}
.menu__item:hover { background: var(--hover); }

/* workspace */
.ws {
  display: grid; grid-template-columns: 304px minmax(0, 1fr) 368px; grid-template-rows: minmax(0, 1fr) auto;
  height: calc(100svh - 56px); min-height: 640px;
}
.pane { position: relative; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; background: var(--panel); }
.pane--left { border-right: 1px solid var(--line); }
.pane--right { border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.pane--center { display: flex; flex-direction: column; background: var(--draw-paper); overflow: hidden; }

.sec { padding: 12px 16px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.sec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sec__head .sec__title { margin-bottom: 0; }
.sec__title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.sec__meta { font-size: 12px; color: var(--ink-soft); text-align: right; }
.sec__label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.hint { font-size: 13px; color: var(--ink-soft); margin-top: 8px; text-wrap: pretty; }
.hint:empty { display: none; }
.field-error { color: var(--no-ink); font-size: 13px; font-weight: 500; margin-top: 6px; }
.field-error:empty { display: none; }

/* crane */
.crane { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: end; }
.crane__img { display: block; width: 84px; height: 54px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.crane__search { position: relative; min-width: 0; }
.crane__input {
  width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--field); font-weight: 600; font-size: 16px;
}
.crane__input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 1px var(--focus); }
.crane__list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 15; margin: 0; padding: 4px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 32px rgb(0 0 0 / .18);
}
.crane__option { display: block; width: 100%; padding: 8px 10px; min-height: 44px; border: 0; border-radius: 4px; background: none; text-align: left; font-weight: 600; cursor: pointer; }
.crane__option:hover, .crane__option[aria-selected="true"] { background: var(--hover); }
.crane__option small { display: block; color: var(--ink-soft); font-size: 12px; font-weight: 400; }
.crane__empty { padding: 10px; color: var(--ink-soft); font-size: 13px; }

/* number fields */
.prop { display: grid; grid-template-columns: minmax(0, 1fr) 9.5rem; align-items: center; gap: 12px; padding: 2px 0; }
.prop label { font-size: 14px; color: var(--ink-soft); }
.prop--big label { color: var(--ink); font-weight: 500; }
.num {
  display: flex; align-items: center; height: 40px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--field); transition: border-color .15s ease;
}
.num:hover { border-color: var(--ink-soft); }
.num:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.num:has([aria-invalid="true"]) { border-color: var(--no); box-shadow: 0 0 0 1px var(--no); }
.num input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; outline: none; text-align: right; font-size: 16px; font-weight: 600; }
.num span { width: 1.1em; margin-left: 6px; color: var(--ink-soft); font-size: 14px; }
.prop--big .num { height: 46px; }
.prop--big .num input { font-size: 22px; letter-spacing: -0.01em; }

/* segmented */
.seg { border: 0; margin: 0 0 10px; padding: 0; min-width: 0; }
.seg:last-of-type { margin-bottom: 0; }
.seg legend { padding: 0; margin-bottom: 6px; font-size: 13px; color: var(--ink-soft); }
.seg__row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 2px; background: var(--seg-bg); border: 1px solid var(--line); border-radius: var(--r); }
.seg__row label { position: relative; display: flex; }
.seg__row input { position: absolute; inset: 0; z-index: 1; margin: 0; opacity: 0; cursor: pointer; }
.seg__row span {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 40px; padding: 4px 4px; border-radius: 4px; text-align: center; line-height: 1.15;
  font-size: 14px; font-weight: 500; color: var(--ink-soft); cursor: pointer;
  transition: background-color .15s ease-out, color .15s ease-out, box-shadow .15s ease-out, transform .12s cubic-bezier(.22, 1, .36, 1);
}
.seg__row span small { font-size: 11px; font-weight: 400; color: var(--ink-soft); }
.seg__row label:hover span { color: var(--ink); }
.seg__row input:checked + span { background: var(--seg-on); color: var(--ink); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.seg__row label:active span { transform: scale(.97); }
.seg__row input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -2px; }
.seg__row--status span { padding-bottom: 10px; }
.seg__row--fit { display: flex; }
.seg__row--fit label { flex: 1 1 auto; }
.seg__row--fit span { padding: 4px 8px; }
.seg__bar { position: absolute; left: 10px; right: 10px; bottom: 4px; height: 3px; border-radius: 2px; pointer-events: none; }
.seg__bar--ok { background: var(--ok); } .seg__bar--warn { background: var(--warn); } .seg__bar--no { background: var(--no); } .seg__bar--none { background: var(--none); }

/* center */
.tabs {
  display: flex; align-items: stretch; flex-wrap: wrap; min-height: 46px; padding: 0 8px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.tab {
  padding: 0 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none;
  font-size: 14px; font-weight: 500; color: var(--ink-soft); cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.view { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.stage__cap {
  position: absolute; left: 12px; top: 10px; max-width: calc(100% - 24px); padding: 4px 8px; border-radius: 4px;
  background: var(--panel); border: 1px solid var(--line); font-size: 12px; color: var(--ink-soft); pointer-events: none;
}
.view--matrix { overflow: auto; overscroll-behavior: contain; padding: 20px clamp(16px, 2vw, 28px); background: var(--panel); }
.view__lead { font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; }
.stage { position: relative; flex: 1; min-height: 0; }
.stage svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* status */
#answer { scroll-margin-top: 72px; }
.status__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.status__head { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.status__head .icon { width: .8em; height: .8em; }
.status--ok .status__head { color: var(--ok-ink); } .status--warn .status__head { color: var(--warn-ink); } .status--no .status__head { color: var(--no-ink); } .status--none .status__head { color: var(--none-ink); }
.status__pct { font-size: 34px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.gauge { position: relative; height: 8px; margin: 14px 0 20px; }
.gauge__track { position: absolute; inset: 0; overflow: hidden; border-radius: 4px; background: var(--seg-bg); box-shadow: inset 0 0 0 1px var(--line); }
.gauge__fill {
  position: absolute; inset: 0; background: var(--ok); transform-origin: left center;
  transition: transform .26s cubic-bezier(.22, 1, .36, 1), background-color .2s ease-out;
}
.gauge__fill--warn { background: var(--warn); } .gauge__fill--no { background: var(--no); }
.gauge__tick { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--ink-soft); font-style: normal; }
.gauge__lbl { position: absolute; top: 12px; font-size: 11px; line-height: 1; color: var(--ink-soft); white-space: nowrap; }
.gauge__lbl--90 { right: calc(25% + 5px); }
.gauge__lbl--100 { left: calc(83.333% + 5px); }
.status__lead { font-size: 14px; line-height: 1.45; text-wrap: pretty; }
.status__lead b { font-weight: 600; }
.status__lead + .status__lead { margin-top: 6px; }
.recs { margin-top: 12px; border-top: 1px solid var(--line); }
.rec { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.rec__label { font-size: 12px; color: var(--ink-soft); }
.rec__value { font-size: 14px; font-weight: 600; }
.rec__value small { font-weight: 400; color: var(--ink-soft); font-size: 13px; }
.rec .link-btn { grid-column: 2; grid-row: 1 / span 2; }
.rec__now { grid-column: 2; grid-row: 1 / span 2; font-size: 12px; color: var(--ink-soft); }

/* values */
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 0; font-size: 14px; }
.kv dt { padding: 6px 12px 6px 0; color: var(--ink-soft); border-bottom: 1px solid var(--line-soft); }
.kv dd { margin: 0; padding: 6px 0; text-align: right; font-weight: 500; border-bottom: 1px solid var(--line-soft); min-width: 0; overflow-wrap: anywhere; }
.kv dd small { color: var(--ink-soft); font-weight: 400; }

/* curve */
.curve { position: relative; }
.lc { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.lc text { font-family: 'Switzer', system-ui, sans-serif; fill: var(--ink-soft); font-size: 11px; }
.lc__grid { stroke: var(--line); stroke-width: 1; }
.lc__curve { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.lc__area { fill: var(--ok); opacity: .1; }
.lc__cross { stroke: var(--brand); stroke-width: 1; stroke-dasharray: 4 3; }
.lc__mark { stroke: var(--panel); stroke-width: 2; }
.lc__mark--ok { fill: var(--ok); } .lc__mark--warn { fill: var(--warn); } .lc__mark--no { fill: var(--no); } .lc__mark--none { fill: var(--none); }
.lc__cursor { stroke: var(--ink-soft); stroke-width: 1; }

/* distance list */
.sec--list { flex: 1 0 auto; display: flex; flex-direction: column; min-height: 240px; border-bottom: 0; }
.dist-wrap { flex: 1; min-height: 0; max-height: 360px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; margin: 0 -16px; }
.dist { width: 100%; border-collapse: collapse; font-size: 14px; }
.dist th { position: sticky; top: 0; z-index: 1; padding: 6px 16px 6px 8px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--ink-soft); text-align: right; }
.dist td { padding: 5px 16px 5px 8px; text-align: right; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.dist th:first-child, .dist td:first-child { padding-left: 24px; text-align: left; }
.dist td:first-child { position: relative; }
.dist td:first-child::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--none); }
.dist .s-ok td:first-child::before { background: var(--ok); }
.dist .s-warn td:first-child::before { background: var(--warn); }
.dist .s-no td:first-child::before { background: var(--no); }
.dist .is-current td { background: var(--current); font-weight: 600; }
.dist .is-current td:first-child::after { content: ''; position: absolute; left: 11px; top: 50%; width: 6px; height: 8px; margin-top: -4px; background: var(--ink); clip-path: polygon(0 0, 100% 50%, 0 100%); }

/* matrix */
.matrix-wrap { overflow-x: auto; }
.matrix { border-collapse: separate; border-spacing: 4px; margin: -4px; width: calc(100% + 8px); max-width: 860px; }
.matrix th { font-weight: 500; font-size: 13px; color: var(--ink-soft); text-align: center; padding: 2px; white-space: nowrap; }
.matrix th.matrix__group { color: var(--ink); font-weight: 600; padding: 4px 4px 8px; border-bottom: 1px solid var(--line-2); }
.matrix th.matrix__corner { text-align: left; vertical-align: bottom; }
.matrix tbody th { text-align: left; padding-right: 10px; }
.matrix .split { border-left: 1px solid var(--line); padding-left: 4px; }
.matrix__ballast { display: flex; align-items: baseline; gap: 6px; }
.matrix__ballast b { font-weight: 600; color: var(--ink); font-size: 15px; }
.matrix td { padding: 0; }
.cell {
  position: relative; width: 100%; min-height: 52px; min-width: 56px; padding: 5px 2px;
  border: 0; border-radius: 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-weight: 600; font-size: 15px; line-height: 1.1; white-space: nowrap;
}
.cell__sym { font-size: 12px; line-height: 1; }
.cell__tip { font-size: 12px; font-weight: 500; }
.cell--ok { background: var(--ok-bg); color: var(--ok-ink); }
.cell--warn { background: var(--warn-bg); color: var(--warn-ink); }
.cell--no { background: var(--no-bg); color: var(--no-ink); }
.cell--none { background: var(--none-bg); color: var(--none-ink); font-weight: 400; }
.cell:hover { box-shadow: inset 0 0 0 1px currentColor; }
.cell[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; font-size: 13px; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { font-weight: 600; color: var(--ink); }
.sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.sw--ok { background: var(--ok-bg); } .sw--warn { background: var(--warn-bg); } .sw--no { background: var(--no-bg); } .sw--none { background: var(--none-bg); }

.tag { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 4px; font-size: 13px; font-weight: 500; }
.tag--ok { background: var(--ok-bg); color: var(--ok-ink); }
.tag--warn { background: var(--warn-bg); color: var(--warn-ink); }
.tag--no { background: var(--no-bg); color: var(--no-ink); }
.tag--none { background: var(--none-bg); color: var(--none-ink); }

/* status bar */
.statusbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; min-width: 0; padding: 7px 16px;
  background: var(--panel); border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-soft);
}
.statusbar span { white-space: nowrap; }
.statusbar span:last-child { overflow: hidden; text-overflow: ellipsis; }
.statusbar b { color: var(--ink); font-weight: 600; }
.mini { display: none; }

/* dialog */
.dialog {
  width: min(620px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--ink); box-shadow: 0 24px 64px rgb(0 0 0 / .3);
}
.dialog { overscroll-behavior: contain; }
.dialog::backdrop { background: rgb(10 12 14 / .5); }
.dialog__in { padding: 18px 20px 20px; }
.dialog__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.dialog__head h2 { font-size: 18px; }
.dialog__lead { font-size: 14px; color: var(--ink-soft); margin-bottom: 16px; }
.dialog__note { margin-top: 14px; font-size: 13px; color: var(--ink-soft); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.form-grid__wide { grid-column: 1 / -1; }
.form-grid label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.form-grid input {
  width: 100%; min-width: 0; height: 42px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--field); color: var(--ink); font-size: 16px;
}
.form-grid input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 1px var(--focus); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.state { padding: 48px 24px; max-width: 680px; margin: 0 auto; }
.state h1 { font-size: 28px; margin-bottom: 12px; }
.state__action { margin-top: 16px; }

/* shared with admin */
.panel { min-width: 0; }
.section-title { font-size: 18px; padding-bottom: 10px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.booms { width: 100%; border-collapse: collapse; font-size: 15px; }
.booms th, .booms td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.booms thead th { font-size: 13px; color: var(--ink-soft); font-weight: 500; border-bottom-color: var(--line-2); }

.print-only { display: none; }

/* tablet */
@media (max-width: 1279px) {
  .ws { grid-template-columns: 296px minmax(0, 1fr); grid-template-rows: auto auto auto; height: auto; min-height: 0; }
  .pane--left { grid-row: 1 / span 2; overflow: visible; }
  .pane--center { grid-column: 2; height: min(62svh, 560px); min-height: 360px; }
  .pane--right { grid-column: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  #answer, .sec--list { grid-column: 1 / -1; }
  #sec-curve { border-right: 1px solid var(--line); }
  .dist-wrap { max-height: 320px; }
  .statusbar { flex-wrap: wrap; gap: 4px 16px; }
  .statusbar span { white-space: normal; }
}

/* phone */
@media (max-width: 899px) {
  .ws { display: flex; flex-direction: column; padding-bottom: 64px; }
  .pane--left, .pane--right { display: contents; }
  .pane--center { order: 6; height: auto; min-height: 0; overflow: visible; border-bottom: 1px solid var(--line); }
  .stage { flex: none; height: clamp(250px, 72vw, 460px); }
  #sec-kran { order: 1; } #sec-input { order: 2; } #answer { order: 3; } #sec-geraet { order: 4; } #sec-config { order: 5; }
  #sec-curve { order: 7; } #sec-values { order: 8; border-right: 0; } #sec-list { order: 9; } .statusbar { order: 10; }
  .dist-wrap { max-height: 380px; }
  .stage__cap { position: static; max-width: none; margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 6px 12px; order: -1; }
  .mini {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; align-items: center; gap: 10px;
    min-height: 56px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: var(--panel);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgb(0 0 0 / .08); color: var(--ink); text-decoration: none;
  }
  .mini__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--none); }
  .mini--ok .mini__dot { background: var(--ok); } .mini--warn .mini__dot { background: var(--warn); } .mini--no .mini__dot { background: var(--no); }
  .mini__head { font-weight: 600; }
  .mini__cfg { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mini__pct { font-weight: 600; font-size: 20px; }
  .mini.is-hidden { display: none; }
}
@media (max-width: 640px) {
  .top { padding: 0 8px 0 12px; gap: 2px; }
  .logo { height: 19px; }
  .top__app { display: none; }
  .top__report span { display: none; }
  .top__report { width: 40px; padding: 0; border-color: transparent; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .matrix { border-spacing: 2px; margin: -2px; width: calc(100% + 4px); }
  .matrix th { font-size: 12px; padding: 1px; }
  .matrix .mm, .matrix__ballast .small { display: none; }
  .matrix th.matrix__group { font-size: 12px; white-space: normal; line-height: 1.2; }
  .cell { min-width: 0; font-size: 14px; }
  .view--matrix { padding: 16px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  @page { size: A4 landscape; margin: 7mm 10mm 7mm; }
  body { background: #fff; font-size: 8.5pt; }
  .top, .pane--left, .tabs, .view--matrix, #sec-list, .statusbar, .mini, .dialog, #loading, #load-error, .recs { display: none !important; }
  .print-only { display: block; }
  .ws { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); grid-template-rows: auto auto auto auto; height: auto; min-height: 0; padding: 0; border: 0.3mm solid #000; }
  .stage__cap { position: static; max-width: none; margin: 0; padding: 1.5mm 3mm; border: 0; border-top: 0.2mm solid #999; border-radius: 0; font-size: 7.5pt; color: #333; background: none; }
  .print-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding: 2mm 3mm; border-bottom: 0.3mm solid #000; }
  .print-logo { height: 7mm; width: auto; }
  .print-title { text-align: right; display: grid; }
  .print-title b { font-size: 11pt; }
  .print-meta { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-bottom: 0.3mm solid #000; }
  .print-meta div { padding: 1mm 2mm; min-height: 7.5mm; border-right: 0.2mm solid #999; border-bottom: 0.2mm solid #999; }
  .print-meta div:nth-child(6n) { border-right: 0; }
  .print-meta div:nth-last-child(-n + 6) { border-bottom: 0; }
  .print-meta b { display: block; font-weight: 500; font-size: 6.5pt; color: #555; }
  .print-meta span { font-weight: 600; font-size: 8.5pt; }
  .pane { overflow: visible; background: #fff; }
  .pane--center { grid-column: 1; grid-row: 3; border-right: 0.3mm solid #000; display: block; height: auto; min-height: 0; }
  .view--sketch { display: block; }
  .stage { height: 115mm; }
  .pane--right { grid-column: 2; grid-row: 3; display: block; border: 0; }
  .sec { padding: 2mm 3mm; border-bottom: 0.2mm solid #999; }
  .sec__title { font-size: 9pt; margin-bottom: 1.2mm; }
  .sec__head { margin-bottom: 1.2mm; }
  .status__head { font-size: 13pt; }
  .status__pct { font-size: 18pt; }
  .gauge { margin: 2mm 0 4mm; height: 2mm; }
  .gauge__lbl { top: 3mm; font-size: 6pt; }
  .status__lead, .rec__value { font-size: 8pt; }
  .rec { padding: 0.8mm 0; }
  .rec__label { font-size: 6.5pt; }
  .recs { margin-top: 1.5mm; }
  .kv { font-size: 7.5pt; }
  .kv dt, .kv dd { padding: 0.35mm 0; }
  .kv dt { padding-right: 3mm; }
  .sec__meta { font-size: 6.5pt; }
  .print-sign { grid-column: 1 / -1; grid-row: 4; display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 8mm; align-items: end; padding: 2mm 3mm 3mm; border-top: 0.3mm solid #000; font-size: 7.5pt; color: #333; }
  .print-sign div { padding-top: 5mm; border-bottom: 0.3mm solid #000; }
  .print-notice { font-size: 6.5pt; color: #444; line-height: 1.35; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* drawing colours */
.sk { color: var(--draw-ink); }
.sk-p { fill: var(--draw-paper); }
.sk-f { fill: var(--draw-fill); }
.sk-grid { stroke: var(--draw-grid); }
.sk-soft { fill: var(--draw-soft); }
.sk-ground { stroke: var(--draw-ground); }
@media print { #view-sketch { display: block !important; } }
