/* Nářez plechu – vzhled.
   Rozvržení: pracovní plocha jako v CAD – horní lišta, vlevo velké plátno s plánem, vpravo pevný panel se zadáním.
   Na mobilu dole záložky Zadání / Plán.
   Barvy: VŽDY SVĚTLÉ (nezávisle na tmavém režimu Windows/telefonu) – bílá, světle šedá, antracit a oranžový akcent.
   Tmavý režim jen na vyžádání tlačítkem (data-theme="dark"). */
:root {
  --bg: #f4f6f8;          /* plátno */
  --side: #eceff2;        /* podklad panelu se zadáním */
  --panel: #ffffff;       /* panely a karty */
  --field: #ffffff;       /* pole formulářů */
  --track: #eef1f4;       /* podklad přepínačů */
  --ink: #0d1216;         /* skoro černá – dobře čitelná */
  --muted: #2b353c;       /* doplňkový text, pořád tmavý */
  --faint: #5c6870;
  --line: #e6eaee;
  --line-2: #d3dae0;
  --paper: #fafbfc;       /* podklad výkresu */
  --sheet: #e8edf1;
  --hatch: #c6d0d7;
  --accent: #d2601f;      /* oranžová */
  --accent-2: #b4501a;
  --accent-soft: #fff1e8;
  --on-accent: #ffffff;
  --danger: #c0352b; --danger-soft: #fdecea;
  --ok: #2e8a55;
  --scrim: rgba(30, 42, 51, .38);
  --sh-1: 0 1px 3px rgba(30, 42, 51, .07), 0 1px 1px rgba(30, 42, 51, .03);
  --sh-2: 0 7px 25px rgba(30, 42, 51, .09), 0 2px 5.5px rgba(30, 42, 51, .05);
  --sh-3: 0 18px 54px rgba(30, 42, 51, .22);
  --p0: #8fbde6; --p1: #f5b16c; --p2: #9cd497; --p3: #d2a3dc; --p4: #f2d466; --p5: #82cfc6; --p6: #ef9c90; --p7: #b1a6ec;
  --pstroke: #22303a;
  --steel: #bcc6ce; --steel-off: #dde3e8; --steel-edge: #4f5c67;
  --off: #e2f4e6; --off-edge: #2b7a4b; --off-ink: #17502f;  /* zbytek = použitelný plech */
  --f-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --f-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 12.5px; --r-s: 9px;
  --bar: 50.5px;
  --dark: #1f2b34; --dark-2: #2b3843; --dark-line: rgba(255, 255, 255, .14); --on-dark: #ffffff; --on-dark-2: rgba(255, 255, 255, .68); --accent-hi: #ff8a3d;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1316; --side: #0b0f12; --panel: #161d21; --field: #10161a; --track: #0d1215; --ink: #e4eaee; --muted: #9aa7b0; --faint: #6c7a83;
  --line: #242e34; --line-2: #33414a; --paper: #12191d; --sheet: #233038; --hatch: #36444d;
  --accent: #e58b58; --accent-2: #f0a275; --accent-soft: #33241b; --on-accent: #1b120c;
  --danger: #ff8f80; --danger-soft: #3a1f1b; --ok: #7fcf9b; --scrim: rgba(0, 0, 0, .62);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .4); --sh-2: 0 5.5px 21.5px rgba(0, 0, 0, .45); --sh-3: 0 16px 54px rgba(0, 0, 0, .6);
  --p0: #2a4860; --p1: #57432f; --p2: #324f39; --p3: #4d384e; --p4: #534e2a; --p5: #2a504f; --p6: #573632; --p7: #3c385c;
  --pstroke: #c4d0d6; color-scheme: dark;
  --steel: #3b4752; --steel-off: #2b353e; --steel-edge: #a3afb8;
  --off: #1d3828; --off-edge: #7fcf9b; --off-ink: #b4e8c6;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 13.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
body.noscroll { overflow: hidden; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--f-mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ico { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ico-f { fill: currentColor; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

.filewarn { background: var(--danger-soft); color: var(--ink); border-bottom: 1px solid var(--danger); padding: 9px 14.5px; font-size: 12.5px; text-align: center; }

/* ---------- horní lišta ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30; height: calc(var(--bar) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(14.5px, env(safe-area-inset-right, 0px)) 0 max(14.5px, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 11px;
  background: var(--dark); color: var(--on-dark); border-bottom: 3px solid var(--accent); box-shadow: 0 2px 9px rgba(16, 24, 30, .18);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 30.5px; height: 30.5px; flex: none; }
.lg-bg { fill: var(--accent); }
.lg-s { fill: #ffffff; }
.lg-p { fill: var(--accent); opacity: .55; }
.lg-c { fill: none; stroke: #1f2b34; stroke-width: 1.8; stroke-dasharray: 3 2; }
.brand-t { display: grid; min-width: 0; line-height: 1.1; }
.brand-n { font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: .04em; text-transform: uppercase; color: var(--on-dark); }
.jobchip { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--on-dark-2); font-size: 12.5px; max-width: 46vw; }
.jobchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobchip svg { width: 11px; height: 11px; flex: none; }
.jobchip:hover { color: var(--on-dark); }
.hbtns { display: flex; gap: 5.5px; flex: none; }
.hbtn { display: inline-flex; align-items: center; gap: 6.5px; height: 36px; min-width: 36px; justify-content: center; padding: 0 11.5px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; font-weight: 500; font-size: 12px; transition: background .15s, border-color .15s; }
.hbtn svg { width: 15.5px; height: 15.5px; }
.hbtn.icon { padding: 0; font-size: 20px; line-height: 1; }
#btnTheme { padding: 0 11.5px; }
.hbtn:hover { background: var(--field); border-color: var(--line-2); }
.appbar .hbtn { background: rgba(255, 255, 255, .06); border-color: var(--dark-line); color: var(--on-dark); }
.appbar .hbtn:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); }
.appbar #btnInstall { background: var(--accent); border-color: var(--accent); }
.hbtn:disabled { opacity: .35; cursor: default; }
@media (max-width: 720px) { .hbtn:not(.icon) span { display: none; } .hbtn:not(.icon) { padding: 0; width: 40px; } #btnPrint { display: none; } }

/* ---------- rozvržení ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100vh - var(--bar)); }
.side { background: var(--panel); min-width: 0; }
.main { min-width: 0; padding: 18px max(14.5px, env(safe-area-inset-right, 0px)) 25px max(14.5px, env(safe-area-inset-left, 0px)); }
.main-in { max-width: 1116px; margin: 0 auto; display: grid; gap: 11px; }
@media (min-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr) 342px; }
  .side { order: 2; position: sticky; top: var(--bar); height: calc(100vh - var(--bar)); overflow: auto; border-left: 1px solid var(--line); scrollbar-width: thin; }
  .main { padding: 14.5px 20px 27px; }
  .tabbar { display: none !important; }
}
@media (min-width: 1360px) {
  .layout { grid-template-columns: minmax(0, 1fr) 378px; }
}
@media (max-width: 979.98px) {
  .layout[data-view="input"] .main, .layout[data-view="plan"] .side { display: none; }
  .layout { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); min-height: 0; }
  .side { padding-bottom: 7px; }
}

/* ---------- panel se zadáním ---------- */
.sec { padding: 14.5px max(18px, env(safe-area-inset-left, 0px)) 16px; border-bottom: 1px solid var(--line); display: grid; gap: 12.5px; }
.sec:last-child { border-bottom: 0; }
@media (max-width: 979.98px) { .sec { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); } }
.sec-h { display: flex; align-items: center; gap: 9px; }
.sec-h h2 { margin: 0; font-size: 15.5px; font-weight: 800; letter-spacing: -.01em; }
.sec-h .n { width: 21.5px; height: 21.5px; border-radius: 50%; display: inline-grid; place-items: center; font-family: var(--f-mono); font-size: 11.5px; font-weight: 600; background: var(--accent); color: var(--on-accent); }
.sec-meta { margin-left: auto; font-family: var(--f-mono); font-size: 11px; color: var(--muted); background: var(--field); border: 1px solid var(--line); padding: 2px 8px; border-radius: 899px; }
.sec-meta:empty { display: none; }
.clr { border: 0; background: none; padding: 4px 2px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.clr:hover { color: var(--danger); }

/* jednotky mm / cm / m */
.units { margin-left: auto; display: inline-flex; padding: 2px; gap: 2px; border-radius: 899px; background: var(--track); border: 1px solid var(--line); }
.units button { border: 0; background: transparent; min-width: 36px; height: 25px; padding: 0 9px; border-radius: 899px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.units button:hover { color: var(--ink); }
.units button[aria-checked="true"] { background: var(--ink); color: var(--panel); }

/* přepínač (segment) */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: var(--r); background: var(--track); border: 1px solid var(--line); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 5px 9px; border-radius: var(--r-s); cursor: pointer; font-weight: 500; font-size: 13px; color: var(--muted); transition: background .15s, color .15s, box-shadow .15s; }
.seg label svg { width: 20px; height: 13.5px; flex: none; }
.seg label:hover { color: var(--ink); }
.seg input:checked + label { background: var(--panel); color: var(--ink); box-shadow: var(--sh-1), 0 0 0 1px var(--line); font-weight: 600; }
.seg input:checked + label svg { color: var(--accent); }
.seg input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }

/* pole */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.field { display: grid; gap: 5px; min-width: 0; align-content: start; }
.field > label, .lbl { font-size: 11.5px; color: var(--ink); font-weight: 600; letter-spacing: .01em; }
.inp { position: relative; }
.inp > span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 11px; pointer-events: none; font-family: var(--f-mono); }
input[type=text] { width: 100%; font: inherit; font-family: var(--f-mono); font-size: 14.5px; padding: 7px 36px 7px 11px; min-height: 39.5px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--field); color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s; }
input[type=text]::placeholder { color: var(--faint); }
input[type=text].plain { padding-right: 11px; font-family: var(--f-body); }
input[type=text]:hover { border-color: var(--faint); }
input[type=text]:focus { outline: none; border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=text].bad { border-color: var(--danger); background: var(--danger-soft); }
.kerf { max-width: 180px; }

.presets { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.presets-l { font-size: 12px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 5.5px; }
.chip { font-family: var(--f-mono); font-size: 12px; padding: 5.5px 11.5px; min-height: 34px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 899px; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.hint b { color: var(--ink); font-weight: 600; }
.note { font-size: 11.5px; background: var(--accent-soft); color: var(--ink); border-radius: var(--r-s); padding: 8px 11px; margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 9px; flex-wrap: wrap; }
.link { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-weight: 600; justify-self: start; }
.eq { font-family: var(--f-mono); font-size: 11px; color: var(--accent); }
.eq:empty { display: none; }
.err { margin: 0; color: var(--danger); font-weight: 600; font-size: 12.5px; }

/* přepínač zap/vyp */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 12.5px; min-height: 32.5px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { width: 32.5px; height: 19px; border-radius: 899px; background: var(--line-2); position: relative; flex: none; transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 14.5px; height: 14.5px; border-radius: 50%; background: var(--panel); box-shadow: var(--sh-1); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(13.5px); }
.switch input:focus-visible + i { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.switch.sm { font-size: 11px; color: var(--muted); min-height: 25px; gap: 6.5px; }
.switch.sm i { width: 27px; height: 16px; }
.switch.sm i::after { width: 11.5px; height: 11.5px; }
.switch.sm input:checked + i::after { transform: translateX(11px); }

/* tlačítka */
.btnrow { display: flex; flex-wrap: wrap; gap: 7px; }
.btn { font-weight: 600; font-size: 13px; padding: 8px 14.5px; min-height: 38px; border-radius: var(--r-s); border: 1px solid var(--ink); background: var(--ink); color: var(--panel); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15.5px; height: 15.5px; }
.btn.sm { min-height: 32.5px; padding: 5.5px 11px; font-size: 12px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--sh-1); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--field); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .4; cursor: default; }
.del { width: 32.5px; height: 32.5px; border: 1px solid transparent; background: transparent; color: var(--faint); cursor: pointer; border-radius: var(--r-s); font-size: 13.5px; line-height: 1; flex: none; transition: all .15s; }
.del:hover { color: var(--danger); background: var(--danger-soft); }

/* ---------- seznam dílů ---------- */
.plist { display: grid; gap: 5.5px; }
.plist-empty { border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 20px; text-align: center; color: var(--muted); font-size: 12.5px; }
.pcard { display: grid; grid-template-columns: 43px minmax(0, 1fr) auto 27px; grid-template-areas: "t i q d" "t r q d"; gap: 0 9px; padding: 7px 4px 7px 7px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); align-items: center; transition: border-color .15s, box-shadow .15s; }
.pcard:hover { border-color: var(--line-2); box-shadow: var(--sh-1); }
.pcard.bad { border-color: var(--danger); background: var(--danger-soft); }
.thumb { grid-area: t; width: 43px; height: 43px; border-radius: var(--r-s); background: var(--paper); border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; padding: 0; }
.thumb svg { width: 36px; height: 36px; }
.thumb-x { font-family: var(--f-display); font-size: 20px; color: var(--danger); }
.th-p { stroke: var(--pstroke); stroke-width: 1.2; }
.pinfo { grid-area: i; text-align: left; background: none; border: none; padding: 0; cursor: pointer; display: grid; gap: 0; min-width: 0; align-self: end; }
.pinfo b { font-weight: 600; font-size: 13px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pcard .del { width: 29px; height: 29px; }
.pinfo > span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pinfo:hover b { color: var(--accent); }
.pcard.bad .pinfo > span { color: var(--danger); }
.pcard .switch { grid-area: r; align-self: start; white-space: nowrap; }
@media (max-width: 480px) {
  .pcard { grid-template-columns: 43px minmax(0, 1fr) auto; grid-template-areas: "t i d" "t r q"; row-gap: 5.5px; }
  .pcard .pinfo { align-self: center; }
  .pcard .switch { align-self: center; }
  .pcard .del { justify-self: end; align-self: start; }
}
.pcard .qty { grid-area: q; }
.pcard .del { grid-area: d; }
.qty { display: inline-flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r-s); overflow: hidden; background: var(--field); }
.qty button { width: 29px; min-height: 30.5px; border: none; background: transparent; cursor: pointer; font-size: 15.5px; line-height: 1; color: var(--muted); }
.qty button:hover { background: var(--track); color: var(--ink); }
.qty input[type=text] { width: 34px; min-height: 30.5px; border: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; padding: 3px; font-size: 13.5px; font-weight: 600; background: var(--panel); }
.qty input[type=text]:focus { box-shadow: none; }
.qty.big button { width: 41.5px; min-height: 41.5px; font-size: 18px; }
.qty.big input[type=text] { width: 57.5px; min-height: 41.5px; font-size: 15.5px; }
.addbtn { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 41.5px; border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, var(--line-2)); border-radius: var(--r); background: color-mix(in srgb, var(--accent-soft) 55%, transparent); color: var(--accent); font-weight: 600; font-size: 13.5px; cursor: pointer; transition: background .15s, border-color .15s; }
.addbtn svg { width: 17px; height: 17px; }
.addbtn:hover { background: var(--accent-soft); border-color: var(--accent); }

/* ---------- plán ---------- */
.main-head { display: flex; align-items: center; justify-content: space-between; gap: 9px 18px; flex-wrap: wrap; }
.main-title { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.tools { display: flex; align-items: center; gap: 7px 18px; flex-wrap: wrap; font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 5.5px 12.5px; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5.5px; }
.lg-box { width: 12.5px; height: 12.5px; border-radius: 3px; border: 1px solid var(--faint); }
.lg-waste { background: var(--steel); border-color: var(--steel-edge); }
.lg-off { background: var(--off); border: 1.5px dashed var(--off-edge); }
.lg-cut { width: 16px; height: 0; border: 0; border-top: 2px dashed var(--accent); border-radius: 0; }

.sumbox { display: grid; gap: 9px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(144px, 1fr)); gap: 11px; }
.kpi { background: var(--panel); padding: 9px 12.5px 10px; display: grid; gap: 4px; align-content: start; min-width: 0; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); }
.kpi .k { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.kpi .v { font-family: var(--f-mono); font-size: 18px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { font-size: 12px; color: var(--muted); font-family: var(--f-mono); }
.kpi.main { background: var(--dark); border-color: var(--dark); box-shadow: var(--sh-2); }
.kpi.main .k, .kpi.main .s { color: var(--on-dark-2); }
.kpi.main .v { font-family: var(--f-display); font-size: 30.5px; font-weight: 700; line-height: .95; color: var(--accent-hi); letter-spacing: .01em; }
.kpi.main .v small { font-size: 16px; margin-left: 5.5px; color: var(--on-dark); text-transform: uppercase; letter-spacing: .04em; }
.kpi .v small { font-size: 12.5px; font-weight: 600; margin-left: 5px; color: var(--muted); letter-spacing: 0; }
.kpi.left { border-color: var(--steel-edge); background: linear-gradient(135deg, var(--panel) 55%, var(--steel-off)); }
.kpi.left .k::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6.5px; border-radius: 3px; background: var(--steel-off); border: 1.5px dashed var(--steel-edge); vertical-align: -1px; }
.kpi.bad { border-color: color-mix(in srgb, var(--danger) 50%, transparent); background: var(--danger-soft); }
.kpi.bad .v, .kpi.bad .k { color: var(--danger); }
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 11px 12.5px 11.5px; }
  .kpi .v { font-size: 16px; }
  .kpi.main .v { font-size: 34px; }
  .kpi.main .v small { font-size: 17px; }
  .main-title { font-size: 20px; }
}
.meter { height: 5.5px; border-radius: 3px; background: var(--track); overflow: hidden; margin-top: 5.5px; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.status { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6.5px; flex-wrap: wrap; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.status { display: block; font-size: 12px; }
.status .dot { display: inline-block; margin-right: 7px; vertical-align: 1px; }
.status.run .dot { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.status.man-on .dot { background: var(--accent); }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .status.run .dot { animation: none; } * { transition: none !important; } }
.warn { background: var(--danger-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); border-radius: var(--r); padding: 11px 12.5px; font-size: 12.5px; }
.warn b { color: var(--danger); }
.warn ul { margin: 5.5px 0 0; padding-left: 16px; }
.empty { background: var(--panel); border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 39.5px 18px; text-align: center; color: var(--muted); display: grid; gap: 5.5px; justify-items: center; }
.empty > svg { width: 68.5px; margin-bottom: 7px; }
.empty b { color: var(--ink); font-size: 15.5px; }
.empty .btnrow { justify-content: center; margin-top: 9px; }
.em-s { fill: var(--sheet); stroke: var(--faint); stroke-width: 1.5; }
.em-c { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 3; fill: none; }

.sheets { display: grid; gap: 14.5px; }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); min-width: 0; overflow: hidden; }
.sh-head { display: flex; flex-wrap: wrap; align-items: center; gap: 5.5px 7px; padding: 10px 12.5px; border-bottom: 1px solid var(--line); }
.sh-head h3 { font-size: 15px; font-weight: 800; margin: 0 4px 0 0; letter-spacing: -.01em; }
.sh-head .btn { margin-left: auto; }
.sh-head .btn .ico { stroke-width: 1.6; }
.tag { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--track); border: 0; border-radius: 899px; padding: 3px 9px; white-space: nowrap; }
.tag.strong { background: var(--ink); color: var(--panel); border-color: var(--ink); font-weight: 600; }
.tag.left { background: var(--steel-off); color: var(--ink); box-shadow: inset 0 0 0 1px var(--steel-edge); }
.svgbox { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--panel); padding: 9px 12.5px 11px; }
.svgbox svg { display: block; width: 100%; height: auto; max-height: max(240px, calc(100vh - 330px)); max-height: max(240px, calc(100dvh - 330px)); }
details.cuts { padding: 4px 14.5px 12.5px; }
details.cuts { border-top: 1px solid var(--line); }
details.cuts summary { cursor: pointer; font-weight: 600; font-size: 13px; min-height: 39.5px; display: flex; align-items: center; gap: 7px; list-style: none; }
details.cuts summary .cnt { font-family: var(--f-mono); font-size: 11px; font-weight: 700; background: var(--track); color: var(--muted); border-radius: 899px; padding: 1px 8px; }
details.cuts summary:hover { color: var(--accent); }
details.cuts summary::-webkit-details-marker { display: none; }
details.cuts summary::before { content: ""; width: 6.5px; height: 6.5px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
details.cuts[open] summary::before { transform: rotate(45deg); }
details.cuts .hint { margin-bottom: 7px; }
details.cuts ol { margin: 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 0; font-size: 14px; }
details.cuts li { counter-increment: st; display: block; position: relative; padding: 9px 0 9px 38px; border-top: 1px solid var(--line); line-height: 1.55; }
details.cuts li::before { content: counter(st); position: absolute; left: 0; top: 9px; width: 27px; height: 21.5px; font-family: var(--f-mono); font-weight: 600; font-size: 11px; color: var(--on-accent); background: var(--accent); border-radius: 5.5px; display: grid; place-items: center; }
.pc { display: inline-block; width: 9px; height: 9px; border-radius: 2px; border: 1px solid var(--pstroke); margin-right: 5px; vertical-align: baseline; }
.sheet > .hint { padding: 0 14.5px 12.5px; }

/* tabulka rozměření dílů */
.tabwrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--r-s); }
.postab { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.postab th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--on-dark-2); background: var(--dark); padding: 9px 11px; white-space: nowrap; }
.postab td { padding: 9px 11px; border-top: 1px solid var(--line); vertical-align: middle; }
.postab tbody tr:nth-child(even) td { background: var(--paper); }
.postab tbody tr:hover td { background: var(--accent-soft); }
.postab .n { width: 1%; font-family: var(--f-mono); font-weight: 600; color: var(--accent); }
.postab .d b { margin-right: 7px; }
.postab .d .mono { color: var(--muted); font-size: 12px; }
.postab .mm { text-align: right; font-family: var(--f-mono); font-weight: 600; font-size: 14.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.postab th.mm { font-family: var(--f-body); font-size: 11px; }
.postab .r { text-align: center; white-space: nowrap; }

/* SVG výkresy */
.sv-wbg { fill: var(--sheet); }
.sv-wln { stroke: var(--hatch); }
.sv-steel { fill: var(--steel); }
.sv-off { fill: var(--off); stroke: var(--off-edge); stroke-width: 2; stroke-dasharray: 9 5; }
.sv-ok { stroke: var(--off-edge); stroke-width: 1.3; fill: none; }
.sv-okb { fill: var(--off); }
.sv-ot { fill: var(--off-ink); font-family: var(--f-mono); font-weight: 600; }
.sv-otn { font-family: var(--f-body); font-weight: 800; letter-spacing: .07em; }
.sv-piece { stroke: var(--pstroke); stroke-width: 1.6; stroke-linejoin: round; }
.sv-t { fill: #000000; font-family: var(--f-mono); font-weight: 500; }
.sv-tn { fill: #000000; font-family: var(--f-body); font-weight: 700; }
.sv-to { fill: var(--steel-edge); font-family: var(--f-mono); font-weight: 500; }
.sv-ton { font-family: var(--f-body); font-weight: 700; letter-spacing: .08em; }
.sv-ta { font-weight: 700; }
:root[data-theme="dark"] :is(.sv-t, .sv-tn, .m-lbl) { fill: var(--ink); }
/* světlý režim: popisky ve výkresu černé */
:root:not([data-theme="dark"]) :is(.sv-to, .sv-dim) { fill: #000000; }
:root:not([data-theme="dark"]) .m-lbl { fill: #000000; }
.sv-cut { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 7 4; }
.sv-bd { fill: var(--accent); }
.sv-bt { fill: var(--on-accent); font-family: var(--f-mono); font-weight: 600; }
.sv-edge { fill: none; stroke: var(--steel-edge); stroke-width: 2.2; }
.sv-dim { fill: var(--muted); font-family: var(--f-mono); }
.sv-dl { stroke: var(--faint); stroke-width: 1; }

/* ---------- mobilní záložky ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: grid; grid-template-columns: 1fr 1fr; gap: 5.5px; padding: 5.5px max(9px, env(safe-area-inset-right, 0px)) calc(5.5px + env(safe-area-inset-bottom, 0px)) max(9px, env(safe-area-inset-left, 0px)); background: var(--dark); border-top: 3px solid var(--accent); box-shadow: 0 -4px 14.5px rgba(16, 24, 30, .18); }
.tabbar button { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 43px; border: 0; border-radius: var(--r); background: transparent; color: var(--on-dark-2); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.tabbar button svg { width: 20px; height: 20px; }
.tabbar button[aria-pressed="true"] { background: var(--accent); color: var(--on-dark); }
.tb-badge { font-family: var(--f-mono); font-size: 11px; font-weight: 600; background: #ffffff; color: #1f2b34; border-radius: 899px; padding: 1px 7px; }

/* ---------- dialogy ---------- */
.dlg-back { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(2px); }
.dlg { background: var(--panel); color: var(--ink); width: 100%; max-height: 94vh; max-height: 94dvh; display: flex; flex-direction: column; border-radius: 14.5px 14.5px 0 0; box-shadow: var(--sh-3); padding-bottom: env(safe-area-inset-bottom, 0px); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(21.5px); opacity: 0; } }
@media (min-width: 760px) {
  .dlg-back { align-items: center; padding: 21.5px; }
  .dlg { width: min(864px, 100%); max-height: 90vh; border-radius: 12.5px; }
  .dlg.small { width: min(504px, 100%); }
}
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 12.5px max(16px, env(safe-area-inset-right, 0px)) 11px max(16px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.dlg-scroll { overflow: auto; padding: 14.5px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 11px; grid-auto-rows: max-content; overscroll-behavior: contain; }
.dlg-foot { display: flex; gap: 7px; padding: 11px max(16px, env(safe-area-inset-right, 0px)) 11px max(16px, env(safe-area-inset-left, 0px)); border-top: 1px solid var(--line); background: var(--field); flex-wrap: wrap; border-radius: 0 0 12.5px 12.5px; }
.dlg-foot .sp { flex: 1; }
@media (max-width: 480px) { .dlg-foot .btn { flex: 1; } .dlg-foot .sp { display: none; } }

.tpls { display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 5.5px; scrollbar-width: thin; }
@media (min-width: 760px) { .tpls { display: grid; grid-template-columns: repeat(6, 1fr); overflow: visible; } }
.tpl { flex: none; width: 90px; min-height: 81px; display: grid; justify-items: center; align-content: center; gap: 5px; padding: 7px 4px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; font-size: 11.5px; line-height: 1.15; text-align: center; color: var(--ink); transition: all .15s; }
@media (min-width: 760px) { .tpl { width: auto; } }
.tpl svg { width: 43px; height: 34px; }
.tpl:hover { border-color: var(--line-2); color: var(--ink); background: var(--field); }
.ic-p { fill: var(--sheet); stroke: var(--muted); stroke-width: 1.3; }
.tpl[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--accent); }
.tpl[aria-checked="true"] .ic-p { fill: color-mix(in srgb, var(--accent) 35%, transparent); stroke: var(--accent); }

.ed-body { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .ed-body { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }
.ed-view { display: grid; gap: 7px; min-width: 0; }
.pv { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); min-height: 189px; display: grid; place-items: center; padding: 7px; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 18px 18px; }
.pv svg { width: 100%; height: auto; max-height: 270px; display: block; }
@media (max-width: 759.98px) { .pv { min-height: 160px; } .pv svg { max-height: 200px; } }
.pv-p { stroke: var(--pstroke); stroke-width: 1.6; }
.pv-t { fill: var(--ink); font-family: var(--f-mono); font-weight: 500; }
.pv-bad { color: var(--danger); font-weight: 600; padding: 18px; text-align: center; background: var(--panel); border-radius: var(--r-s); }
.pv-info { display: grid; gap: 2px; font-size: 12px; color: var(--muted); font-family: var(--f-mono); }
.ed-form { display: grid; gap: 12.5px; min-width: 0; align-content: start; }
.ed-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ed-fields .hint { grid-column: 1 / -1; }
.ed-draw { display: grid; gap: 9px; }
.qrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 11px; flex-wrap: wrap; padding-top: 11px; border-top: 1px solid var(--line); }

.draw { width: 100%; height: auto; max-height: 56vh; display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.dg-m { stroke: var(--line); stroke-width: .6; vector-effect: non-scaling-stroke; }
.dg-M { stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dg-t { fill: var(--faint); font-family: var(--f-mono); }
.dr-fill { stroke: var(--accent); stroke-width: 2; fill-opacity: .85; }
.dr-line { stroke: var(--accent); stroke-width: 2; fill: none; }
.dr-v { fill: var(--panel); stroke: var(--accent); stroke-width: 2; cursor: grab; }
.dr-v.sel { fill: var(--accent); }
.dr-n { fill: var(--accent); font-family: var(--f-mono); font-weight: 600; }
.dr-hint { fill: var(--muted); font-family: var(--f-body); }
.side-add { display: grid; gap: 5.5px; }
.side-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 7px; }
.coords summary { cursor: pointer; font-weight: 600; font-size: 12.5px; min-height: 29px; display: flex; align-items: center; }
#coordList { display: grid; gap: 5.5px; margin-top: 5.5px; }
.crow { display: grid; grid-template-columns: 23.5px 1fr 1fr 32.5px; gap: 5.5px; align-items: center; }
.crow.sel span.mono { color: var(--accent); font-weight: 600; }
.crow input[type=text] { min-height: 36px; padding: 5.5px 23.5px 5.5px 7px; font-size: 13.5px; }

/* zakázky */
.jobform { display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: end; padding-bottom: 12.5px; border-bottom: 1px solid var(--line); }
.joblist { display: grid; gap: 5.5px; }
.job { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; align-items: center; padding: 9px 7px 9px 12.5px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.job:hover { border-color: var(--line-2); }
.job > div { display: grid; min-width: 0; }
.job b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- ruční skládání ---------- */
.man { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.man-bar { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 9px max(12.5px, env(safe-area-inset-right, 0px)) 9px max(12.5px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); background: var(--panel); box-shadow: var(--sh-1); }
.man-nav { display: flex; align-items: center; gap: 7px; }
.man-nav b { font-size: 15.5px; font-weight: 800; white-space: nowrap; }
.man-stage { min-height: 0; padding: 12.5px max(12.5px, env(safe-area-inset-right, 0px)) 12.5px max(12.5px, env(safe-area-inset-left, 0px)); display: grid; place-items: center; overflow: hidden; }
#mSvg { width: 100%; height: 100%; max-height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.m-sheet { fill: var(--steel); stroke: var(--steel-edge); stroke-width: 2; }
.m-grid { stroke: var(--hatch); stroke-width: .6; vector-effect: non-scaling-stroke; }
.m-piece { cursor: grab; }
.m-piece path { stroke: var(--pstroke); stroke-width: 1.6; }
.m-piece.sel path { stroke: var(--accent); stroke-width: 3; }
.m-piece.bad path { fill: var(--danger-soft) !important; stroke: var(--danger); stroke-width: 3; }
.m-lbl { fill: #15212a; font-family: var(--f-body); font-weight: 600; pointer-events: none; }
.man-foot { border-top: 1px solid var(--line); background: var(--panel); padding: 9px max(12.5px, env(safe-area-inset-right, 0px)) 11px max(12.5px, env(safe-area-inset-left, 0px)); display: grid; gap: 9px; }
.man-tools { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.man-msg { font-size: 12px; color: var(--muted); flex: 1; min-width: 162px; }
.man-msg.bad { color: var(--danger); font-weight: 600; }
.tray { display: flex; gap: 9px; align-items: center; min-width: 0; }
.tray-list { display: flex; gap: 5.5px; overflow-x: auto; min-width: 0; padding-bottom: 2px; }
.tray-it { flex: none; display: inline-flex; align-items: center; gap: 5.5px; padding: 6.5px 11px; min-height: 36px; border: 1px solid var(--line-2); border-radius: 899px; background: var(--panel); cursor: pointer; font-size: 12px; }
.tray-it:hover { border-color: var(--accent); }
.badge { font-family: var(--f-mono); font-size: 11px; font-weight: 600; background: var(--ink); color: var(--panel); border-radius: 899px; padding: 1px 7px; }

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--panel); padding: 11px 14.5px; border-radius: var(--r); box-shadow: var(--sh-3); display: flex; gap: 12.5px; align-items: center; font-size: 12.5px; max-width: calc(100% - 29px); animation: up .2s ease-out; }
.toast .link { color: var(--accent-soft); }
@media (max-width: 979.98px) { .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- tisk ---------- */
@media print {
  :root { --bg: #fff; --panel: #fff; --paper: #fff; --ink: #000; --muted: #333; --line: #999; }
  .appbar .hbtns, .jobchip svg, .side, .tabbar, .tools, .sh-head .btn, .toast, .filewarn, #status { display: none !important; }
  .appbar { position: static; box-shadow: none; }
  .layout { display: block; }
  .layout .main { display: block !important; padding: 0; }
  .kpis, .sheet { box-shadow: none; break-inside: avoid; }
  .sheet { margin-bottom: 11px; }
  .svgbox svg { max-height: none; }
}

/* ---------- řezání: popisky voleb ---------- */
.seg2 { display: grid; text-align: center; line-height: 1.2; }
.seg2 b { font-weight: inherit; }
.seg2 small { font-size: 11.5px; color: var(--muted); font-weight: 500; }

/* ---------- prázdná tabule ---------- */
.blank { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; box-shadow: var(--sh-1); font-weight: 600; }

/* ---------- ohýbaný profil ---------- */
.pf { display: block; width: 100%; height: auto; }
.pf-l { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pf-s, i.dot { fill: var(--accent); }
i.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); vertical-align: 0; margin: 0 2px; }
.pf-t { fill: var(--ink); font-family: var(--f-mono); font-weight: 700; }
.pf-a { fill: var(--accent-2); font-family: var(--f-mono); font-weight: 700; }
.pf.ic { width: 48px; height: 38px; }
.pf.ic .pf-l { stroke: var(--muted); stroke-width: 2.4; }
.tpl[aria-checked="true"] .pf.ic .pf-l { stroke: var(--accent); }
.thumb .pf { width: 40px; height: 40px; }
.thumb .pf-l { stroke-width: 2.2; }
.pv-bend { width: 100%; display: grid; gap: 4px; }
.pv-bend .pf { max-height: 210px; }
.pv-bend .strip { max-height: 120px; }
.pv-cap { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pv-strip { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.5; }
.pv-bl { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 4; }
.pv-info .big { font-size: 15px; color: var(--ink); font-family: var(--f-body); }
.pv-info b { color: var(--ink); }
.ed-bend { display: grid; gap: 10px; }
.bend-top { display: grid; gap: 6px; }
.bend-list { display: grid; gap: 0; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.bseg { display: grid; grid-template-columns: 26px 52px minmax(0, 1fr) 32px; gap: 8px; align-items: center; padding: 8px 8px 8px 10px; background: var(--panel); }
.bseg .inp input[type=text] { min-height: 40px; }
.bn { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--panel); font-size: 12px; font-weight: 700; }
.bl { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.bbend { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 6px 8px; align-items: center; padding: 8px 10px 8px 44px; background: var(--accent-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bang { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.bang .chip { min-height: 32px; padding: 4px 10px; font-size: 12.5px; background: var(--panel); }
.bang .inp.ang { width: 74px; }
.bang .inp.ang input[type=text] { min-height: 32px; padding: 4px 22px 4px 8px; font-size: 14px; }
.bdir { grid-column: 2; display: inline-flex; gap: 0; border: 1px solid var(--line-2); border-radius: var(--r-s); overflow: hidden; justify-self: start; }
.bdir button { border: 0; background: var(--panel); padding: 5px 12px; min-height: 32px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.bdir button + button { border-left: 1px solid var(--line-2); }
.bdir button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }

/* výkres + karta Ohýbání */
.sv-bend { stroke: #000; stroke-width: 1.4; stroke-dasharray: 7 5; opacity: .75; }
:root[data-theme="dark"] .sv-bend { stroke: var(--ink); }
.blist { display: grid; gap: 0; }
.bcard { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: center; }
.bcard:first-child { border-top: 0; }
.bpf { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-s); padding: 6px; }
.bpf .pf { max-height: 130px; }
.binfo { display: grid; gap: 4px; min-width: 0; }
.bt { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.bw { font-size: 14px; }
.bsteps { margin: 2px 0 0; padding-left: 20px; font-size: 14px; display: grid; gap: 2px; }
.bsteps b { font-family: var(--f-mono); }
@media (max-width: 560px) { .bcard { grid-template-columns: 1fr; } .bseg { grid-template-columns: 26px 46px minmax(0, 1fr) 32px; } .bbend { padding-left: 10px; grid-template-columns: 46px minmax(0, 1fr); } }

/* zrcadlový díl */
.mirbox { display: grid; gap: 7px; }
.mirbox[hidden] { display: none; }
.mirbox .lbl small { font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
.seg3 { grid-template-columns: repeat(3, 1fr); }
.seg button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 5px 7px; border: 0; border-radius: var(--r-s); background: transparent; cursor: pointer; font: inherit; font-weight: 500; font-size: 12.5px; color: var(--muted); transition: background .15s, color .15s, box-shadow .15s; }
.seg button svg { width: 17px; height: 12px; flex: none; }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--panel); color: var(--ink); box-shadow: var(--sh-1), 0 0 0 1px var(--line); font-weight: 600; }
.seg button[aria-checked="true"] svg { color: var(--accent); }
.seg button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
.pv-p.mir { opacity: .82; }
.pv-axis { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 5 4; fill: none; }
.pv-cap2 { fill: var(--muted); font-family: var(--f-mono); }
.pinfo > .mtag { justify-self: start; margin-top: 3px; color: var(--accent); }
.mtag { display: inline-block; padding: 0 6px; border-radius: 899px; font-size: 10.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); white-space: nowrap; vertical-align: 1px; }

/* zbytky pod výkresem */
.sv-oe { font-weight: 600; }
.offs { padding: 4px 16px 12px; }
.offs-h { font-size: 11.5px; font-weight: 600; margin-bottom: 6px; display: flex; gap: 8px; align-items: baseline; }
.offs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.offs li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 6px 6px 8px; border: 1px dashed var(--off-edge); border-radius: var(--r); background: color-mix(in srgb, var(--off) 55%, var(--panel)); }
.ofn { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 11.5px var(--f-mono); background: var(--off-edge); color: #fff; }
.ofd { display: grid; min-width: 0; }
.ofd b { font-size: 13px; }
.ofd small { font-size: 11.5px; color: var(--muted); }
.offs .btn svg, .stock .btn svg { width: 15px; height: 15px; }

/* sklad zbytků */
.hbtn { position: relative; }
.hb-badge { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 899px; background: var(--accent); color: #fff; font: 700 10.5px/17px var(--f-mono); text-align: center; }
.hb-badge[hidden] { display: none; }
.dlg-head .sec-meta { margin-left: auto; margin-right: 8px; }
.stockform { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--line); }
.stockform .st-note { grid-column: 1 / -1; }
.stockform .st-note small { font-weight: 400; color: var(--muted); }
.stockform .btn { grid-column: 1 / -1; }
.stocklist { display: grid; gap: 6px; padding-top: 12px; }
.stock { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto auto; gap: 9px; align-items: center; padding: 7px 7px 7px 9px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.st-r { fill: var(--off); stroke: var(--off-edge); stroke-width: 1.2; stroke-dasharray: 3 2; }
.st-i { display: grid; min-width: 0; }
.st-i .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.st-q { font: 700 13px var(--f-mono); }
.st-empty { text-align: center; padding: 18px 0; }
@media (max-width: 520px) { .stock { grid-template-columns: 40px minmax(0, 1fr) auto auto; } .stock .st-q { grid-row: 1; grid-column: 3; } .stock [data-use] { grid-column: 2 / 4; } }

/* ---------- licence: štítek, proužek, okno Aplikace ---------- */
.brand-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.plan-tag { border: 0; cursor: pointer; font: 700 10px/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase; padding: 3.5px 6px; border-radius: 5px; background: var(--accent); color: #fff; }
body[data-plan="demo"] .plan-tag { background: #ffffff; color: var(--dark); }
.lbar { display: flex; align-items: center; justify-content: center; gap: 6px 12px; flex-wrap: wrap; padding: 6px 42px 6px max(14.5px, env(safe-area-inset-left, 0px)); position: relative; background: var(--accent-soft); border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); font-size: 12.5px; text-align: center; }
.lbar .link { font-size: 12.5px; }
.lbar-x { position: absolute; right: max(6px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; background: none; cursor: pointer; color: var(--muted); border-radius: var(--r-s); }
.lbar-x:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); }
.asec { display: grid; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.asec .btnrow a.btn { text-decoration: none; }
.licbox { display: grid; gap: 8px; }
.licst { display: grid; gap: 1px; padding: 10px 12.5px; border-radius: var(--r); border: 1px solid var(--line-2); border-left: 4px solid var(--accent); background: var(--panel); }
.licst b { font-size: 14.5px; }
.licst.ok { border-left-color: var(--ok); }
.licst.demo { border-left-color: var(--faint); }
.note.limit { background: var(--danger-soft); font-size: 12.5px; font-weight: 600; }
.licform { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: end; }
.licform input[type=text] { font-size: 12.5px; }
.about { text-align: center; padding-top: 2px; }
.about a { color: inherit; }
.printfoot, .wm { display: none; }

@media print {
  .lbar, .plan-tag { display: none !important; }
  .printfoot { display: block; margin: 10px 0 0; font-size: 10px; color: #444; text-align: right; }
  body[data-plan="demo"] .wm { display: flex; position: fixed; inset: 0; align-items: center; justify-content: center; pointer-events: none; z-index: 99; }
  .wm span { font: 800 150px/1 var(--f-body); letter-spacing: .1em; color: rgba(0, 0, 0, .1); transform: rotate(-30deg); }
}
