/* EDS O2-Planung — Oberfläche. Farben, Schriften und Kopfzeile nach StueveCast / GaforCast. */

@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/ibm-plex-mono-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/inter-latin-600-normal.woff2') format('woff2'); }

:root {
  --bg: #f4f5f7; --panel: #ffffff; --panel-2: #eef0f3; --line: #d7dce3; --line-soft: #eef0f3;
  --text: #2a323e; --text-dim: #667080; --text-strong: #12161c;
  --amber: #b96f14; --amber-text: #8f5410; --on-amber: #1a1200;
  --field: #f4f5f7;
  --ok-bg: #e9f4ee; --ok-line: #b9d8c6; --ok: #1f6f4a; --ok-text: #14532d;
  --warn-bg: #fdf3e0; --warn-line: #ecd3a4; --warn: #8a4b00;
  --bad-bg: #fbeaea; --bad-line: #eec0bd; --bad: #a11d17;
  --alt-line: #3d6a94; --alt-text: #2f5273;
  --mono: 'IBM Plex Mono', 'JetBrains Mono', SFMono-Regular, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="dark"] {
  --bg: #0b1017; --panel: #121926; --panel-2: #0f1520; --line: #263143; --line-soft: #1b2433;
  --text: #cfd8e3; --text-dim: #8d9bb0; --text-strong: #f2f5f9;
  --amber: #f0a63d; --amber-text: #f0a63d; --on-amber: #1a1200;
  --field: #0b1017;
  --ok-bg: #10261c; --ok-line: #1f4a36; --ok: #58c58f; --ok-text: #8fe0b6;
  --warn-bg: #2a2010; --warn-line: #4f3c17; --warn: #f0b860;
  --bad-bg: #2b1414; --bad-line: #5a2622; --bad: #ff8a80;
  --alt-line: #7fb0dd; --alt-text: #a9cbea;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
button, input, select { font-family: inherit; }
button { cursor: pointer; }
sub { font-size: .7em; line-height: 0; }
a { color: var(--amber-text); } a:hover { text-decoration: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.app { max-width: 1600px; margin: 0 auto; padding: 0 20px 32px; }

/* ---------- Kopfzeile ---------- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.title-block { min-width: 0; }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--amber-text); margin-bottom: 3px; }
.title-block h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; color: var(--text-strong); white-space: nowrap; }
.subtitle { margin: 3px 0 0; font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); }
.header-right { display: flex; align-items: center; gap: 20px; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.header-logo { height: 46px; width: auto; object-fit: contain; }
:root[data-theme="dark"] .header-logo { background: #fff; border-radius: 4px; padding: 2px 4px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; font-family: var(--mono); font-size: 12px; flex-shrink: 0; }
.seg button { height: 40px; padding: 0 12px; border: none; background: var(--panel); color: var(--text-dim); font: inherit; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--amber); color: var(--on-amber); font-weight: 700; }
.seg.small button { height: 32px; }

.icon-btn { width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--text-dim); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-btn:hover { color: var(--text); border-color: var(--text-dim); }
.icon-btn svg { width: 18px; height: 18px; }
.btn { height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.btn:hover { border-color: var(--text-dim); }
.btn.ghost { background: transparent; color: var(--text-dim); }
.btn.soft { background: var(--panel-2); }
.primary-btn { height: 36px; padding: 0 14px; border: 1px solid var(--amber); border-radius: 6px; background: var(--amber); color: var(--on-amber); font-family: var(--mono); font-size: 12px; font-weight: 700; white-space: nowrap; }
.primary-btn.big { height: 48px; border-radius: 8px; font-size: 13px; padding: 0 16px; }
.btn.big { height: 48px; border-radius: 8px; font-size: 13px; padding: 0 16px; }

.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 46px; z-index: 40; min-width: 250px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px 0; font-family: var(--mono); font-size: 12px; }
.menu button.mi { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px; border: none; background: transparent; color: var(--text); font: inherit; text-align: left; }
.menu button.mi:hover { background: var(--panel-2); color: var(--amber-text); }
.menu .mh { padding: 8px 14px 4px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); border-top: 1px solid var(--line); margin-top: 4px; }
.menu .mine { display: flex; align-items: center; }
.menu .mine .mi { flex: 1; min-width: 0; }
.menu .mine .mi span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu .mine .forget { width: 36px; height: 36px; border: none; background: transparent; color: var(--text-dim); }
.menu .only-phone { display: none; }

/* ---------- Link-Zeile ---------- */
.linkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding: 8px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: 12px; }
.lb-label { color: var(--text-dim); letter-spacing: .06em; text-transform: uppercase; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
#shareUrl { flex: 1 1 220px; min-width: 0; max-width: 320px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text-strong); font: inherit; font-weight: 600; }
.qr-btn { width: 64px; height: 64px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #ffffff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qr-btn svg { width: 56px; height: 56px; display: block; }
.lb-status { display: inline-flex; align-items: center; gap: 6px; color: var(--text); min-width: 0; flex: 1 1 120px; }
.lb-status .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-status svg { width: 14px; height: 14px; flex-shrink: 0; }
.lb-status.ok svg { color: var(--ok); } .lb-status.local svg { color: var(--warn); }
.spacer { display: none; }
.lb-title { flex: 1 1 170px; min-width: 0; max-width: 300px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--text-strong); font: inherit; font-weight: 600; }
.lb-title::placeholder { color: var(--text-dim); font-weight: 400; }

/* ---------- Persönliche Konfiguration (Kurzcode) ---------- */
.cfgbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: 12px; }
.cfgbar .lb-label { margin-right: auto; }
.cfgbar .pc-in { position: relative; display: inline-flex; }
.cfgbar #pcInput { width: 104px; font-weight: 600; background: var(--panel); padding-right: 22px; }
.cfgbar .pc-x { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 22px; height: 28px; border: none; background: none; color: var(--text-dim); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.cfgbar .pc-x[hidden] { display: none; }
.cfgbar .pc-status { flex: 1 0 100%; margin: 0; font-size: 11px; line-height: 1.5; color: var(--text-dim); }
.cfgbar .pc-status[hidden] { display: none; }
.cfgbar #pcUpdate { flex: 1 0 100%; } .cfgbar #pcUpdate[hidden] { display: none; }
.cfgbar .pc-status.ok { color: var(--ok-text); } .cfgbar .pc-status.bad { color: var(--bad); }
.switch-line { color: var(--text); }
.switch-line.bad { color: var(--bad); }
.notice { margin-top: 10px; padding: 8px 12px; border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--text-strong); border-radius: 8px; font-family: var(--mono); font-size: 12px; line-height: 1.5; }

/* ---------- Spalten und Panels ---------- */
.cols { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; align-items: flex-start; }
.col-in { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.col-out { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.panel h2, .result-head h2, .ptitle { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); font-weight: 600; white-space: nowrap; display: flex; align-items: center; }
.panel > h2 { margin-bottom: 8px; }
.step { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--amber); color: var(--on-amber); font-size: 12px; font-weight: 700; letter-spacing: 0; flex-shrink: 0; }
.step svg { width: 14px; height: 14px; }
.flow-arrow { display: flex; justify-content: center; margin: -10px 0; color: var(--amber); }
.flow-arrow svg { width: 18px; height: 18px; }
.to-result { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 2px; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--amber-text); }
.to-result svg { width: 18px; height: 18px; }
.result-head { display: flex; align-items: center; padding: 0 2px; }
.panel-toggle { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; padding: 0; border: none; background: transparent; color: inherit; text-align: left; cursor: default; }
.panel-toggle .tt { min-width: 0; }
.panel-sum { display: none; margin-top: 2px; font-family: var(--mono); font-size: 13px; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { display: none; width: 18px; height: 18px; color: var(--text-dim); flex-shrink: 0; margin-left: auto; transition: transform .15s; }
.hint { margin: 8px 0 0; font-family: var(--mono); font-size: 11px; line-height: 1.5; color: var(--text-dim); }
.hint button { border: none; background: none; padding: 0; color: var(--amber-text); font: inherit; text-decoration: underline; }

.table-wrap { overflow-x: auto; }
.w-phone { display: none; }
table.grid { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 13px; }
table.grid th { padding: 6px 4px; text-align: right; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.grid th.l, table.grid td.l { text-align: left; }
table.grid td { padding: 5px 4px; text-align: right; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.grid td.dim { color: var(--text-dim); } table.grid td.strong { color: var(--text-strong); font-weight: 600; }
table.grid tr.add-row td { text-align: left; padding: 6px 4px 8px; border-bottom: 1px solid var(--line); }
table.grid tr.sum td { padding: 8px 4px; border-bottom: none; color: var(--text-dim); }
table.grid tr.sum td.strong { color: var(--text-strong); font-weight: 700; }
table.grid td.del { padding: 5px 0; width: 36px; }
.in { height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--text-strong); font-family: var(--mono); font-size: 13px; }
.in.num { text-align: right; }
.in.bad { border-color: var(--bad); background: var(--bad-bg); }
.in.w-nr { width: 52px; } .in.w-s { width: 72px; } .in.w-alt { width: 96px; } .in.w-dur { width: 80px; }
.del-btn { width: 36px; height: 36px; border: none; background: transparent; color: var(--text-dim); display: inline-flex; align-items: center; justify-content: center; }
.del-btn:hover { color: var(--bad); }
.del-btn svg { width: 14px; height: 14px; }

.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; align-items: end; font-family: var(--mono); }
.field { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-width: 0; }
.field label { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field .in { height: 40px; width: 100%; font-size: 14px; padding: 0 10px; }
.field .in.key { font-weight: 600; }

/* ---------- Resultat ---------- */
.balance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stat { background: var(--panel); padding: 12px 16px; min-width: 0; }
.stat .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; }
.stat .v { margin-top: 4px; font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--text-strong); white-space: nowrap; }
.stat .s { font-family: var(--mono); font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.neg .v { color: var(--bad); }
.status { grid-column: 1 / -1; padding: 12px 16px; display: flex; align-items: center; gap: 10px; background: var(--ok-bg); }
.status svg { width: 28px; height: 28px; flex-shrink: 0; color: var(--ok); }
.status .t { font-size: 16px; font-weight: 600; color: var(--ok-text); }
.status .d { font-family: var(--mono); font-size: 11px; color: var(--text); }
.status.tight { background: var(--warn-bg); } .status.tight svg, .status.tight .t { color: var(--warn); }
.status.short { background: var(--bad-bg); } .status.short svg, .status.short .t { color: var(--bad); }
.status.none { background: var(--panel-2); } .status.none svg, .status.none .t { color: var(--text-dim); }
.warns { display: flex; flex-direction: column; gap: 6px; }
.warns .w { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 8px; font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--text-strong); }
.warns .w svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--warn); }

.chart svg { display: block; width: 100%; height: auto; font-family: var(--mono); }
.chart .ax { stroke: var(--line); } .chart .gr { stroke: var(--line-soft); }
.chart .tx { fill: var(--text-dim); font-size: 10px; } .chart .lv { fill: var(--alt-text); font-size: 10px; }
.chart .alt { fill: none; stroke: var(--alt-line); stroke-width: 2; stroke-linejoin: round; }
.chart .start { stroke: var(--amber-text); stroke-dasharray: 4 4; } .chart .startt { fill: var(--amber-text); font-size: 10px; }
.chart .o2 { fill: none; stroke: var(--amber); stroke-width: 2.5; stroke-linejoin: round; }
.chart .o2a { fill: var(--amber); fill-opacity: .12; } .chart .o2neg { fill: var(--bad); fill-opacity: .16; }
.chart .dot { fill: var(--amber); } .chart .end { fill: var(--text-strong); font-size: 11px; font-weight: 600; }
.chart .empty { fill: var(--text-dim); font-size: 12px; }
.chart .sw { stroke: var(--text-dim); stroke-width: 1.2; stroke-dasharray: 5 4; } .chart .swt { fill: var(--text-strong); font-size: 10px; font-weight: 600; }
.chart .swbg { fill: var(--panel); } .chart .endbg { fill: var(--panel); fill-opacity: .85; } .chart .sw.bad { stroke: var(--bad); } .chart .swt.bad { fill: var(--bad); }

table.rows td, table.rows th { padding-left: 8px; padding-right: 8px; }
table.rows tr.lvl td { padding-top: 7px; padding-bottom: 7px; color: var(--text-strong); }
table.rows tr.lvl td.l, table.rows tr.lvl td.b { font-weight: 600; }
table.rows tr.auto td { padding-top: 3px; padding-bottom: 3px; font-size: 11px; color: var(--text-dim); background: var(--bg); }
table.rows tr.auto td.l { padding-left: 20px; }
table.rows tr.tot td { padding-top: 9px; padding-bottom: 9px; border-top: 1px solid var(--line); border-bottom: none; color: var(--text-strong); font-weight: 700; }
table.rows tr.add td { padding-top: 4px; padding-bottom: 4px; border-bottom: none; color: var(--text-dim); }

.footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px; line-height: 1.5; color: var(--text-dim); }
.footer button { border: none; background: none; padding: 0; color: var(--amber-text); font: inherit; text-decoration: underline; }

.bottombar { display: none; }

/* ---------- Dialoge ---------- */
dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); color: var(--text); padding: 0; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); box-shadow: 0 16px 50px rgba(0,0,0,.35); font-family: var(--mono); }
dialog::backdrop { background: rgba(0,0,0,.5); }
.dlg { width: 520px; max-width: 100%; padding: 22px 26px; display: flex; flex-direction: column; gap: 14px; }
.dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dlg-head h2 { margin: 0; font-family: var(--sans); font-size: 18px; font-weight: 600; color: var(--text-strong); }
.dlg-head .sub { margin-top: 2px; font-size: 12px; color: var(--amber-text); }
.dlg h3 { margin: 0 0 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); font-weight: 600; }
.dlg p, .dlg li { font-size: 12.5px; line-height: 1.6; } .dlg p { margin: 0; } .dlg ul { margin: 0; padding-left: 18px; }
.dlg table.nodes { width: 100%; border-collapse: collapse; font-size: 12.5px; background: var(--panel); border: 1px solid var(--line); }
.dlg table.nodes th { padding: 5px 10px; text-align: left; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); font-weight: 600; border-bottom: 1px solid var(--line); }
.dlg table.nodes td { padding: 4px 10px; border-bottom: 1px solid var(--line-soft); } .dlg table.nodes .r { text-align: right; } .dlg table.nodes td.r { color: var(--text-strong); font-weight: 600; }
.signs { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.signs div { display: flex; align-items: center; gap: 10px; } .signs svg { width: 22px; height: 22px; flex-shrink: 0; }
.signs .ok svg, .signs .ok strong { color: var(--ok-text); } .signs .tight svg, .signs .tight strong { color: var(--warn); } .signs .short svg, .signs .short strong { color: var(--bad); }
.dlg .fine { padding-top: 10px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.5; color: var(--text-dim); }
.dlg-actions { display: flex; gap: 10px; } .dlg-actions .grow { flex: 1 1 0; }
.qr-big { background: #fff; padding: 14px; border-radius: 8px; align-self: center; } .qr-big svg { display: block; width: 260px; height: 260px; max-width: 70vw; max-height: 70vw; }
.qr-url { text-align: center; font-size: 12.5px; word-break: break-all; color: var(--text-strong); }

.track .card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.track .two { display: flex; align-items: flex-end; gap: 10px; }
.track .two .field:first-child { flex: 3 1 0; } .track .two .field:last-child { flex: 2 1 0; }
.track .field .in, .track select.in { height: 44px; font-size: 15px; font-weight: 600; }
.track table.grid td { border-bottom: none; padding: 3px 4px; font-size: 14px; }
.track table.grid th { border-bottom: none; font-size: 10px; padding: 4px; }
.track .in.now { width: 84px; height: 44px; font-size: 14px; }
.track .in.now.changed { border-color: var(--amber); background: var(--panel); font-weight: 600; }
.cmp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cmp .k { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; }
.cmp .v { font-size: 20px; font-weight: 600; color: var(--text-strong); white-space: nowrap; } .cmp .v.dim { color: var(--text-dim); } .cmp .v.dev { color: var(--warn); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 4px; font-size: 12px; color: var(--text-strong); }
.check input { width: 22px; height: 22px; accent-color: var(--amber); flex-shrink: 0; }
.track .status { border: 1px solid var(--ok-line); border-radius: 8px; }
.track .status.tight { border-color: var(--warn-line); } .track .status.short { border-color: var(--bad-line); }
.track .status .d { font-size: 12px; line-height: 1.5; }

.print-sheet { display: none; }

/* ---------- Handy ---------- */
@media (max-width: 720px) {
  .app { padding: 0 12px calc(96px + var(--safe-b)); }
  .topbar { align-items: flex-start; flex-wrap: nowrap; gap: 10px; padding: 10px 2px; }
  .eyebrow { font-size: 10px; margin-bottom: 2px; }
  .eyebrow .dev { display: none; }
  .title-block h1 { font-size: 19px; }
  .subtitle .long { display: none; }
  .header-right { flex-direction: column; align-items: flex-end; gap: 6px; }
  .header-logo { order: -1; height: 36px; }
  .head-actions { flex-wrap: nowrap; }
  .head-actions .desk { display: none; }
  .seg button { height: 44px; padding: 0 11px; } .seg.small button { height: 36px; }
  .icon-btn { width: 44px; height: 44px; }
  .menu .only-phone { display: flex; }
  .linkbar { margin-top: 10px; padding: 6px 6px 6px 12px; gap: 8px; flex-wrap: nowrap; }
  .linkbar .lb-main { flex: 1 1 0; min-width: 0; }
  .lb-label { font-size: 10px; display: block; }
  #shareUrl { border: none; background: transparent; padding: 0; height: 20px; font-size: 13px; max-width: none; width: 100%; flex: none; }
  .linkbar .lb-status, .linkbar #trackBtn, .linkbar #newBtn, .linkbar .spacer { display: none; }
  .linkbar { flex-wrap: wrap; }
  .linkbar .lb-title { order: 5; flex: 1 0 100%; max-width: none; height: 40px; margin: 2px 0 4px; }
  .cfgbar { padding: 8px 10px; }
  .cfgbar .lb-label { flex: 1 0 100%; margin-right: 0; }
  .cfgbar .pc-in { flex: 1 1 0; } .cfgbar #pcInput { width: 100%; height: 44px; font-size: 14px; }
  .linkbar .qr-btn { width: 44px; height: 44px; flex: none; padding: 2px; } .linkbar .qr-btn svg { width: 38px; height: 38px; }
  table.rows td, table.rows th { padding-left: 4px; padding-right: 4px; }
  table.rows tr.auto td.l { padding-left: 12px; }
  table.rows { font-size: 13px; } table.rows tr.add td.l { font-size: 11.5px; }
  .w-desk { display: none; } .w-phone { display: inline; }
  .primary-btn { height: 44px; padding: 0 12px; }
  .cols { margin-top: 10px; gap: 10px; }
  .col-in, .col-out { gap: 10px; flex-basis: 100%; }
  .flow-arrow, .to-result, .result-head { display: none; }
  .panel { padding: 10px 12px; }
  .panel-head { margin-bottom: 4px; }
  .collapsible .panel-toggle { cursor: pointer; min-height: 36px; }
  .collapsible .chev { display: block; }
  .collapsible.collapsed .panel-sum { display: block; }
  .collapsible.collapsed .panel-body, .collapsible.collapsed .panel-head .seg { display: none; }
  .collapsible.collapsed .panel-head { margin-bottom: 0; }
  .collapsible:not(.collapsed) .chev { transform: rotate(180deg); }
  .col-out.collapsible { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
  .col-out.collapsible.collapsed { gap: 0; }
  .col-out .res-toggle { display: flex; }
  .col-out.collapsible.collapsed > :not(.res-toggle) { display: none; }
  .step { width: 20px; height: 20px; margin-right: 6px; } .step svg { width: 12px; height: 12px; }
  table.grid { font-size: 14px; }
  table.grid th { font-size: 10px; }
  table.grid .hide-phone { display: none; }
  .in { height: 44px; font-size: 14px; }
  .in.w-nr { width: 56px; } .in.w-s { width: 76px; }
  .del-btn { height: 44px; }
  .btn { height: 44px; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field .in { height: 44px; }
  .balance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 10px 12px; } .stat .v { font-size: 20px; }
  .col-out .panel { border: none; padding: 0; }
  .footer { margin-top: 12px; }
  .bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 12px calc(12px + var(--safe-b)); background: var(--ok-bg); border-top: 1px solid var(--ok-line); }
  .bottombar svg.ic { width: 30px; height: 30px; flex-shrink: 0; color: var(--ok); }
  .bottombar .bb { flex: 1 1 0; min-width: 0; }
  .bottombar .t { font-size: 14px; font-weight: 600; color: var(--ok-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bottombar .d { font-family: var(--mono); font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bottombar.tight { background: var(--warn-bg); border-color: var(--warn-line); } .bottombar.tight svg.ic, .bottombar.tight .t { color: var(--warn); }
  .bottombar.short { background: var(--bad-bg); border-color: var(--bad-line); } .bottombar.short svg.ic, .bottombar.short .t { color: var(--bad); }
  .bottombar.none { background: var(--panel-2); border-color: var(--line); } .bottombar.none svg.ic, .bottombar.none .t { color: var(--text-dim); }
  .bottombar .btn { border-color: currentColor; color: var(--ok-text); background: var(--panel); font-weight: 700; }
  .bottombar.tight .btn { color: var(--warn); } .bottombar.short .btn { color: var(--bad); } .bottombar.none .btn { color: var(--text); }
  dialog { max-width: 100vw; max-height: 100vh; }
  dialog.sheet { width: 100vw; height: 100vh; height: 100dvh; margin: 0; border: none; border-radius: 0; background: var(--bg); }
  .dlg { padding: 16px 14px; width: 100%; }
  dialog.sheet .dlg { min-height: 100%; }
  dialog.sheet .dlg-actions { margin-top: auto; }
}
@media (min-width: 721px) {
  .col-out .res-toggle { display: none; }
  .linkbar .lb-main { display: contents; }
}
@media (min-width: 721px) and (max-width: 1040px) { .balance { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
