/* Steel weight calculator (metal.html) — tokens as frontend/hub.css (#hub), dark default; system fonts only */
:root{
  --bg:#0f1117;--bg-2:#0d1016;--panel:#1a1d27;--card:#1a1e2a;--card-2:#141822;--border:#2d3650;--line:#283047;
  --rule:rgba(45,54,80,.7);--text:#e2e8f0;--text-2:#cbd5e1;--muted:#a6b2c6;--dim:#8b98ad;--faint:#7f8ca3;
  --accent:#4f8ef7;--primary:#2f66e0;--primary-h:#295bcc;--m1:#4f8ef7;--m2:#a78bfa;--md1-bg:rgba(79,142,247,.14);--md1-t:#9cc0ff;
  --green:#10b981;--green-t:#6ee7b7;--yellow:#f59e0b;--tag-y:#f5b544;--tag-y-bg:rgba(245,158,11,.12);--tag-y-b:rgba(245,158,11,.34);
  --red:#ef4444;--red-t:#fca5a5;--chip-bg:rgba(255,255,255,.035);--chip-b:rgba(148,163,184,.16);--nav-bg:rgba(22,25,35,.96);--nav-b:rgba(45,54,80,.85);
  --hover:rgba(255,255,255,.05);--grid-1:rgba(79,142,247,.06);--grid-2:rgba(79,142,247,.024);
  --shadow:0 1px 0 rgba(255,255,255,.04) inset,0 14px 34px -22px rgba(0,0,0,.9);--btn-sh:0 1px 2px rgba(0,0,0,.35);
  color-scheme:dark;
}
html[data-theme="light"]{
  --bg:#f4f3ef;--bg-2:#eeede8;--panel:#ffffff;--card:#ffffff;--card-2:#f8f7f3;--border:#d8d5cc;--line:#dddad1;
  --rule:#e7e4dc;--text:#171b23;--text-2:#2a303c;--muted:#485160;--dim:#5b6473;--faint:#636c7b;
  --accent:#1f5fd6;--primary:#2257cc;--primary-h:#1d4bb0;--m1:#2563eb;--m2:#6b46d6;--md1-bg:rgba(37,99,235,.09);--md1-t:#1d4fbf;
  --green:#0f9f6e;--green-t:#05714f;--yellow:#d97706;--tag-y:#9a4a07;--tag-y-bg:rgba(245,158,11,.13);--tag-y-b:rgba(180,83,9,.32);
  --red:#dc2626;--red-t:#b91c1c;--chip-bg:#f5f4f0;--chip-b:#dedbd2;--nav-bg:rgba(250,249,246,.96);--nav-b:#dedbd2;
  --hover:rgba(20,30,50,.05);--grid-1:rgba(30,60,110,.055);--grid-2:transparent;
  --shadow:0 1px 2px rgba(20,25,35,.06);--btn-sh:0 1px 2px rgba(20,25,35,.18);
  color-scheme:light;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font:15px/1.45 'Segoe UI',system-ui,-apple-system,sans-serif;font-variant-numeric:tabular-nums}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--accent)}
.sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:6px}
input:focus-visible,select:focus-visible{outline-offset:1px}
[hidden]{display:none!important}
.skip{position:absolute;left:-999px;top:8px;z-index:200;background:var(--card);padding:8px 12px;border-radius:6px}
.skip:focus{left:8px}
.sprite{position:absolute}

/* nav */
.nav{position:sticky;top:0;z-index:60;height:56px;display:flex;align-items:center;gap:14px;padding:0 28px;background:var(--nav-bg);border-bottom:1px solid var(--nav-b)}
.logo{font-size:18px;font-weight:700;color:var(--accent);white-space:nowrap;text-decoration:none}
.logo span{color:var(--text)}
.logo .lg-i{color:inherit}
.nav-t{font-size:14px;color:var(--muted);white-space:nowrap;padding-left:14px;border-left:1px solid var(--line)}
.tag{display:inline-flex;align-items:center;height:20px;padding:0 7px;border-radius:5px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--tag-y);background:var(--tag-y-bg);border:1px solid var(--tag-y-b);white-space:nowrap}
.nl{display:flex;gap:2px;margin-left:8px}
.nl a{font-size:14px;color:var(--dim);padding:8px 11px;border-radius:6px;text-decoration:none;white-space:nowrap}
.nl a:hover{color:var(--text);background:var(--hover)}
.nl i{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:7px;vertical-align:1px;background:var(--m1)}
.nl .n2 i{background:var(--m2)}
.nr{display:flex;align-items:center;gap:8px;margin-left:auto}
.nb{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px;border-radius:6px;border:1px solid var(--border);background:none;color:var(--text);font-size:13px;cursor:pointer;white-space:nowrap}
.nb:hover{border-color:var(--accent);color:var(--accent)}
.lsw{display:flex;gap:4px}
.lsw a{display:inline-flex;align-items:center;height:34px;padding:0 9px;border-radius:6px;border:1px solid var(--border);font-size:12.5px;font-weight:600;color:var(--dim);text-decoration:none}
.lsw a:hover{color:var(--accent);border-color:var(--accent)}
.lsw a[aria-current]{color:var(--text);border-color:var(--accent)}
.nb.theme{width:34px;padding:0;justify-content:center;color:var(--dim)}
.nb.theme .i-moon,html[data-theme="light"] .nb.theme .i-sun{display:none}
html[data-theme="light"] .nb.theme .i-moon{display:block}

/* layout */
.wrap{max-width:1220px;margin:0 auto;padding:0 28px}
.hero{position:relative;padding:12px 0 10px;display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 16px}
.hero::before{content:"";position:absolute;inset:0 -28px;z-index:-1;pointer-events:none;
  background-image:linear-gradient(var(--grid-1) 1px,transparent 1px),linear-gradient(90deg,var(--grid-1) 1px,transparent 1px),linear-gradient(var(--grid-2) 1px,transparent 1px),linear-gradient(90deg,var(--grid-2) 1px,transparent 1px);
  background-size:120px 120px,120px 120px,24px 24px,24px 24px;-webkit-mask-image:linear-gradient(#000 40%,transparent);mask-image:linear-gradient(#000 40%,transparent)}
h1{font-size:26px;line-height:1.2;margin:0;font-weight:700;letter-spacing:-.01em}
.lead{margin:0;color:var(--muted);font-size:15px;max-width:900px}
.grid{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:24px;align-items:start}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);padding:20px 22px}
h2{font-size:16px;margin:0;font-weight:700}
.dimt{color:var(--dim);font-size:13px}
.err-banner{margin:0 0 12px;padding:10px 12px;border:1px solid var(--red);border-radius:8px;color:var(--red-t);display:flex;gap:10px;align-items:center}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:0 20px;border-radius:8px;font-size:15px;font-weight:600;cursor:pointer;border:1px solid var(--border);background:var(--panel);color:var(--text);box-shadow:var(--btn-sh);white-space:nowrap;text-decoration:none}
.btn:hover{border-color:var(--accent)}
.btn.pri{background:var(--primary);border-color:var(--primary);color:#fff}
.btn.pri:hover{background:var(--primary-h)}
.btn[aria-disabled="true"],.btn:disabled{opacity:.5;cursor:not-allowed}
.btn.sm{min-height:36px;padding:0 12px;font-size:13.5px}
.lnk{border:0;background:none;color:var(--accent);padding:4px 0;cursor:pointer;font-size:13.5px}
.lnk:hover{text-decoration:underline}
.ib{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:6px;border:1px solid transparent;background:none;color:var(--dim);cursor:pointer;padding:0}
.ib:hover{color:var(--text);border-color:var(--border);background:var(--hover)}
.ib.del:hover{color:var(--red);border-color:var(--red)}
.ib svg{width:17px;height:17px}
.ib[disabled]{opacity:.35;cursor:not-allowed}

/* segmented */
.seg{display:inline-flex;padding:3px;border-radius:8px;background:var(--panel);border:1px solid var(--border);gap:2px}
html[data-theme="light"] .seg{background:var(--bg-2)}
.seg button{border:0;background:none;padding:6px 12px;border-radius:6px;font-size:13px;font-weight:600;color:var(--dim);cursor:pointer;white-space:nowrap}
.seg button[aria-pressed="true"]{background:var(--card-2);color:var(--text);box-shadow:0 0 0 1px var(--line)}
html[data-theme="light"] .seg button[aria-pressed="true"]{background:#fff;box-shadow:0 0 0 1px var(--border),0 1px 2px rgba(20,25,35,.08)}
.seg.xs button{padding:4px 9px;font-size:12.5px}

/* fields */
.f{display:flex;flex-direction:column;gap:4px;min-width:0}
.f>span,.lbl{font-size:12.5px;color:var(--muted);font-weight:600}
.in,.f input,.f select,.sel{height:40px;border:1px solid var(--border);background:var(--panel);border-radius:8px;padding:0 11px;min-width:0;width:100%}
.f select,.sel{padding-right:30px;-webkit-appearance:none;appearance:none;cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238b98ad' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 11px center}
select option,select optgroup{background:var(--panel);color:var(--text)}
.f input::placeholder,.in::placeholder{color:var(--faint)}
.f input[aria-invalid="true"],.in[aria-invalid="true"]{border-color:var(--red)}
.suf{position:relative;display:block}
.suf i{position:absolute;right:11px;top:50%;transform:translateY(-50%);font-style:normal;color:var(--dim);font-size:13px;pointer-events:none}
.suf input{padding-right:40px}
.err{font-size:12px;color:var(--red-t);min-height:0}
.warn{font-size:12px;color:var(--yellow)}
.chk{display:flex;gap:8px;align-items:flex-start;font-size:13.5px;color:var(--text-2);cursor:pointer;line-height:1.35}
.chk input{width:16px;height:16px;margin:2px 0 0;accent-color:var(--accent);flex:none}

/* composer */
.composer{display:flex;flex-direction:column;gap:10px;min-width:0;scroll-margin-top:72px}
.cmp-top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.cmp-top .stdl{display:flex;align-items:center;gap:8px}
.qwrap{position:relative}
.qwrap>svg{position:absolute;left:13px;top:50%;transform:translateY(-50%);color:var(--dim);pointer-events:none}
.srow{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,2fr);gap:12px;align-items:end}
.srow .f select{height:44px}
.picks{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:2px 12px;align-items:end;min-width:0}
.pcap{grid-column:1 / -1;display:flex;align-items:center;gap:8px;font-size:12.5px;line-height:1.25;color:var(--muted)}
.pcap::after{content:"";flex:1;height:1px;background:var(--rule)}
#q{height:44px;font-size:16px;padding-left:40px;border-radius:10px}
.sug{position:absolute;z-index:40;left:0;width:max(100%,560px);top:calc(100% + 4px);margin:0;padding:4px;list-style:none;background:var(--panel);border:1px solid var(--border);border-radius:10px;box-shadow:0 18px 40px -18px rgba(0,0,0,.6);max-height:340px;overflow:auto}
.sug li{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:10px;padding:8px 10px;border-radius:7px;cursor:pointer;min-height:40px}
.sug li .s1{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sug li .s1 b{font-weight:650}
.sug li .s1 small{color:var(--dim);margin-left:8px;font-size:12.5px}
.sug li .s2{color:var(--text-2);font-size:13.5px;text-align:right;white-space:nowrap}
.sug li[aria-selected="true"]{background:var(--md1-bg)}
.sug li.msg{cursor:default;display:block;color:var(--muted);font-size:13.5px}
.sug li.msg b{color:var(--text)}
.sug li.fam .s1 b{color:var(--accent)}
.chips{display:flex;flex-wrap:wrap;gap:6px;min-height:30px}
.chip{height:30px;padding:0 11px;border-radius:15px;border:1px solid var(--chip-b);background:var(--chip-bg);color:var(--text-2);font-size:13px;cursor:pointer;white-space:nowrap}
.chip:hover{border-color:var(--accent);color:var(--text)}
.chip[aria-pressed="true"]{border-color:var(--accent);color:var(--accent);background:var(--md1-bg)}
.chip.cust{border-style:dashed}
.entry{display:grid;grid-template-columns:120px minmax(0,1fr);gap:8px 18px;padding-top:12px;border-top:1px solid var(--rule)}
.entry.editing{outline:2px solid var(--accent);outline-offset:6px;border-radius:8px}
.draw{grid-row:1 / span 2;width:120px;height:120px;border-radius:10px;border:1px solid var(--line);background:var(--card-2);display:flex;align-items:center;justify-content:center;overflow:hidden}
.draw.empty{border-style:dashed;color:var(--faint);font-size:13px;text-align:center;padding:12px}
.draw svg{width:100%;height:100%;display:block}
.einfo{min-width:0;min-height:64px}
.etitle{font-size:16px;font-weight:700;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.etitle .std{font-weight:400;color:var(--dim);font-size:13px}
.evals{font-size:14px;color:var(--text-2);margin-top:2px}
.edims{font-size:12.5px;color:var(--dim);margin-top:2px}
.enote{font-size:12px;color:var(--dim);margin-top:4px}
.fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 12px;align-items:end}
.entry.m-sheet>.fields{grid-template-columns:repeat(5,minmax(0,1fr))}
.fields.dims3{grid-template-columns:repeat(3,minmax(0,1fr))}
.fields .w2{grid-column:span 2}
.fields .full{grid-column:1 / -1}
.fmts{display:flex;flex-wrap:wrap;gap:6px}
.fmts .chip{height:28px;font-size:12.5px}
/* desktop order: inputs, Add | result line, note */
#gAct{order:1;align-self:end}#ePrev{order:2;grid-column:span 3}#gNote{order:3}#addWhy{order:4;grid-column:1 / -1}
.entry.m-sheet #ePrev{grid-column:span 4}
/* live result: three stacked rows, the total the most visible (owner 26.10) */
.eprev{display:flex;flex-direction:column;gap:1px;min-height:22px;align-self:center;padding:6px 12px;border-left:3px solid var(--accent);border-radius:6px;background:var(--md1-bg);color:var(--text)}
.eprev:empty{padding:0;border-color:transparent;background:none}
.eprev .rv{display:flex;justify-content:space-between;align-items:baseline;gap:14px;font-size:14px;line-height:1.45}
.eprev .rl{color:var(--muted);font-weight:500;white-space:nowrap}
.eprev .rn{font-variant-numeric:tabular-nums;font-weight:650;white-space:nowrap}
.eprev .big .rn{font-size:19px;font-weight:700}
.eprev .big .rn small{font-size:13px;font-weight:500;color:var(--muted)}
.eprev .w{color:var(--yellow);font-weight:400;font-size:13px;margin-top:2px}
.eact{display:flex;gap:8px;align-items:flex-end}
.eact .btn{flex:1;min-height:40px;padding:0 14px}
.entry.editing .eact{grid-column:span 2}
#gNote{align-self:center}#gNote.on{align-self:end}
#gNote .lnk{text-align:left}
.fields .hint{font-size:12px;color:var(--dim)}
.fields .hint:empty{display:none}

/* source chips */
.src{display:inline-flex;align-items:center;height:19px;padding:0 6px;border-radius:5px;font-size:11px;font-weight:600;white-space:nowrap;border:1px solid transparent;vertical-align:1px}
.src.T{color:var(--md1-t);background:var(--md1-bg)}
.src.TS{color:var(--md1-t);background:var(--md1-bg);border-color:var(--md1-t)}
.src.G,.src.P{color:var(--tag-y);background:var(--tag-y-bg)}
.src.M{color:var(--muted);background:var(--chip-bg);border-color:var(--chip-b)}
.mtag{font-size:11px;color:var(--muted);border:1px solid var(--chip-b);border-radius:5px;padding:0 5px;white-space:nowrap}
.wi{color:var(--yellow);display:inline-flex;vertical-align:-3px}

/* totals */
.totals{position:sticky;top:72px;display:flex;flex-direction:column;gap:12px;background:var(--card-2);border-top:3px solid var(--green)}   /* the list's sums, told apart from the entry card */
.tot-hint{margin-top:-8px;font-size:12.5px}
.tot-h{display:flex;justify-content:space-between;align-items:baseline}
.bigrow{display:flex;align-items:baseline;gap:6px 16px;flex-wrap:wrap}
.big{font-size:32px;font-weight:700;line-height:1.1;letter-spacing:-.01em}
.big small{font-size:18px;font-weight:600;color:var(--muted)}
.tline{font-size:17px;color:var(--text-2)}
.tline b{color:var(--text)}
.dim0 .big,.dim0 .tline{color:var(--faint)}
.areabox{border:1px solid var(--line);border-radius:10px;padding:10px 12px;display:flex;flex-direction:column;gap:6px;background:var(--card-2)}
.areabox .ah{font-size:12.5px;font-weight:700;color:var(--muted)}
.areabox .av{font-size:20px;font-weight:700}
.areabox .av small{font-size:13px;font-weight:400;color:var(--dim)}
.sep{height:1px;background:var(--rule);margin:2px 0}
details.prices>summary{cursor:pointer;font-weight:700;font-size:14px;list-style:none;display:flex;justify-content:space-between;align-items:center}
details.prices>summary::-webkit-details-marker{display:none}
details.prices>summary::after{content:"";width:8px;height:8px;border-right:1.6px solid var(--dim);border-bottom:1.6px solid var(--dim);transform:rotate(45deg);margin-right:4px}
details.prices[open]>summary::after{transform:rotate(-135deg)}
.pgrid{display:grid;grid-template-columns:minmax(0,1fr) 92px auto;gap:8px 8px;align-items:center;margin-top:10px}
.pgrid .lbl{display:flex;align-items:center;gap:6px}
.pgrid .in{height:36px;text-align:right}
.tip{display:inline-flex;width:16px;height:16px;border-radius:50%;border:1px solid var(--dim);color:var(--dim);font-size:11px;align-items:center;justify-content:center;cursor:help;font-weight:700}
.costs{display:flex;flex-direction:column;gap:3px;font-size:14px}
.costs .cl{display:flex;justify-content:space-between;gap:10px}
.costs .cl.tot{font-weight:700;font-size:16px;border-top:1px solid var(--rule);padding-top:5px;margin-top:2px}
.tbtns{display:flex;flex-direction:column;gap:8px}
.tbtns .btn{min-height:40px}
.lnote{margin:4px 22px 12px;display:flex;flex-direction:column;gap:4px}
.tbtns .row2{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.disc{font-size:12px;color:var(--dim);margin:0}

/* list */
.list{margin-top:16px;padding:16px 0 6px}
.ltool{display:flex;flex-wrap:wrap;gap:10px 16px;align-items:flex-end;padding:0 22px 14px}
.ltool .lt-h{display:flex;align-items:baseline;gap:10px;margin-right:auto;min-width:160px;align-self:flex-start}
.ltool .f{min-width:150px}
.ltool .f.nm{min-width:170px;flex:1 1 170px;max-width:300px}
.ltool .f.fm{flex:0 0 285px;min-width:0}
.ltool .acts{display:flex;gap:4px;align-items:center}
.tblw{overflow-x:auto}
table.lt{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:14px}
.lt th{font-size:12px;font-weight:700;color:var(--muted);text-align:right;padding:8px 8px;border-bottom:1px solid var(--line);background:var(--card);white-space:nowrap}
.lt th.l{text-align:left}
.lt td{padding:7px 8px;border-bottom:1px solid var(--rule);vertical-align:middle;text-align:right;white-space:nowrap}
.lt td.l{text-align:left}
.lt tbody tr:nth-child(even) td{background:var(--card-2)}
.lt tbody tr.bad td:first-child{box-shadow:inset 3px 0 0 var(--red)}
.lt tbody tr.ed td{background:var(--md1-bg)!important}
.lt tbody tr.flash td{animation:flash 1.2s ease-out}
@keyframes flash{from{background:var(--md1-bg)}to{background:transparent}}
.lt col.c-no{width:40px}.lt col.c-len{width:100px}.lt col.c-qty{width:70px}.lt col.c-kgm{width:78px}.lt col.c-kgpc{width:90px}
.lt col.c-kg{width:100px}.lt col.c-alm{width:72px}.lt col.c-m2{width:92px}.lt col.c-cost{width:104px}.lt col.c-act{width:118px}
.lt .c-no{color:var(--dim)}
.lt td.pf{white-space:normal}
.pf .pw{display:flex;gap:8px;align-items:flex-start}
.pf .gl{width:20px;height:20px;flex:none;color:var(--dim);margin-top:1px}
.pf .nm{font-weight:600}
.snote{font-weight:700;color:var(--muted);margin-left:1px;cursor:help;line-height:0}
.snotes{color:var(--muted)}
.pf .sd{font-size:12px;color:var(--dim);margin-top:1px;overflow:hidden;text-overflow:ellipsis}
.pf .kgmx{display:none}
.lt input.ci{height:32px;width:100%;text-align:right;border:1px solid var(--border);background:var(--panel);border-radius:6px;padding:0 7px}
.lt input.ci[aria-invalid="true"]{border-color:var(--red)}
.lt .acts{display:flex;gap:4px;justify-content:flex-end}
.lt .lbs{display:block;font-size:11px;color:var(--dim)}
.lt tfoot td{font-weight:700;border-top:1px solid var(--line);border-bottom:0;background:var(--card);position:sticky;bottom:0;z-index:2;padding:10px 8px}
.lt .m2c{color:var(--text)}
.lt .c-kgm .u{font-size:11px;color:var(--dim)}
.lt td.c-sum{display:none}
.rtog{all:unset;box-sizing:border-box;display:block;width:100%;cursor:pointer}
.lt:not(.has-cost) .c-cost{display:none}
.pv{display:none}
#empty{padding:22px;margin:0 22px 14px;border:1px dashed var(--border);border-radius:10px;min-height:150px}
#empty h3{margin:0 0 6px;font-size:15px}
#empty p{margin:0 0 10px;color:var(--muted);font-size:14px}
#empty .ex{display:flex;flex-wrap:wrap;gap:6px}
.byp{margin:14px 22px 10px}
.byp>summary{cursor:pointer;font-weight:700;font-size:14px;padding:6px 0}
.byp table{width:100%;border-collapse:collapse;font-size:13.5px;margin-top:6px}
.byp td,.byp th{padding:6px 8px;border-bottom:1px solid var(--rule);text-align:right;white-space:nowrap}
.byp th{color:var(--muted);font-size:12px}
.byp td:first-child,.byp th:first-child{text-align:left}
#bypBody{overflow-x:auto}
.byp th{white-space:normal;vertical-align:bottom}
.byp .bypn{margin:6px 0 2px;white-space:normal}
footer.ft{max-width:1220px;margin:26px auto 30px;padding:0 28px;color:var(--dim);font-size:13px}

/* toast, bar */
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:120;background:var(--panel);border:1px solid var(--border);border-radius:10px;padding:10px 14px;box-shadow:0 18px 40px -18px rgba(0,0,0,.7);display:flex;gap:14px;align-items:center;font-size:14px;max-width:calc(100vw - 32px)}
.toast.ok{border-color:var(--green)}
.mbar.flash{animation:barflash 1.5s ease-out}
@keyframes barflash{0%,60%{box-shadow:inset 0 3px 0 var(--green)}100%{box-shadow:inset 0 3px 0 transparent}}
.mbar.flash .mv b{color:var(--green-t)}
.toast.warn{border-color:var(--yellow)}
.mbar{display:none}

/* dialogs */
dialog{border:1px solid var(--border);border-radius:12px;background:var(--card);color:var(--text);padding:0;width:min(560px,calc(100vw - 32px));box-shadow:0 30px 70px -20px rgba(0,0,0,.7)}
dialog::backdrop{background:rgba(5,8,14,.55)}
.dh{display:flex;justify-content:space-between;align-items:center;padding:16px 20px 8px}
.dh h2{font-size:17px}
.db{padding:4px 20px 12px;display:flex;flex-direction:column;gap:12px;font-size:14px}
.db p{margin:0;color:var(--text-2)}
.df{display:flex;justify-content:flex-end;gap:8px;padding:12px 20px 16px;border-top:1px solid var(--rule)}
.small{font-size:12.5px;color:var(--dim)}
.st-panel{position:fixed;right:12px;bottom:12px;z-index:300;background:var(--panel);border:2px solid var(--green);border-radius:10px;padding:10px 12px;max-width:560px;max-height:60vh;overflow:auto;font:12px/1.4 ui-monospace,Consolas,monospace;white-space:pre-wrap}
.st-panel.fail{border-color:var(--red)}
.print-only{display:none}

/* site parts: no-JS line, 1D hint in "By section", CTA strip, SEO section (server), footer */
.nojs{margin:0 0 12px;padding:10px 12px;border:1px solid var(--yellow);border-radius:8px;color:var(--text-2);font-size:14px}
.byp .byp1d{margin:8px 0 2px;font-size:13px;color:var(--muted);white-space:normal}
.byp1d a{font-weight:600;text-decoration:none}
.byp1d a:hover{text-decoration:underline}
.cta{margin-top:16px;padding:16px 22px;border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:12px;background:var(--card-2);display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 20px}
.cta .cq{margin:0;font-weight:650;font-size:15px}
.cta .ca{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center}
.cta .btn{min-height:42px}
.cta .reg{font-size:14px;font-weight:600;text-decoration:none;padding:8px 0}
.cta .reg:hover{text-decoration:underline}
#mc-seo{margin-top:28px;color:var(--text-2)}
#mc-seo h2{font-size:19px;margin:28px 0 10px;color:var(--text)}
#mc-seo h3{font-size:15px;margin:18px 0 6px;color:var(--text)}
#mc-seo p,#mc-seo li{line-height:1.55;max-width:900px}
#mc-seo .tw{overflow-x:auto;border:1px solid var(--line);border-radius:10px;background:var(--card)}
#mc-seo table{width:100%;border-collapse:collapse;font-size:14px}
#mc-seo th,#mc-seo td{padding:7px 10px;border-bottom:1px solid var(--rule);text-align:left;vertical-align:top}
#mc-seo th{font-size:12.5px;color:var(--muted);font-weight:700}
#mc-seo .n{text-align:right;white-space:nowrap}
#mc-seo tr:last-child td{border-bottom:0}
#mc-seo details{border:1px solid var(--line);border-radius:10px;padding:10px 14px;margin:8px 0;background:var(--card)}
#mc-seo summary{cursor:pointer;font-weight:650;color:var(--text)}
#mc-seo details[open] summary{margin-bottom:6px}
footer.ft .fl{display:flex;flex-wrap:wrap;gap:4px 18px;margin-bottom:10px}
footer.ft .fl a{color:var(--muted);text-decoration:none}
footer.ft .fl a:hover{color:var(--accent);text-decoration:underline}
footer.ft .fn{margin:0;display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px 16px}

/* ===== breakpoints ===== */
@media (max-width:1180px){
  .grid{grid-template-columns:minmax(0,1fr) 340px}
}
@media (min-width:961px) and (max-width:1100px){
  .fields,.entry.m-sheet>.fields{grid-template-columns:repeat(3,minmax(0,1fr))}
  #ePrev,.entry.m-sheet #ePrev{grid-column:1 / -1}
  .srow{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:960px){
  .grid{grid-template-columns:minmax(0,1fr)}
  .totals{position:static}
  .lt col.c-kgm,.lt col.c-alm{width:0}
  .lt .c-kgm,.lt .c-alm{display:none}
  .pf .kgmx{display:block;font-size:12px;color:var(--dim)}
  .lt col.c-act{width:112px}
  .lt col.c-kgpc{width:80px}
  body.has-rows{padding-bottom:calc(72px + env(safe-area-inset-bottom))}
  .mbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:70;min-height:56px;padding:8px 16px calc(8px + env(safe-area-inset-bottom));align-items:center;gap:10px;background:var(--nav-bg);border-top:1px solid var(--nav-b);font-size:14px}
  .mbar .mv{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mbar .mv b{font-size:15px}
  body:not(.has-rows) .mbar,body.kbd .mbar{display:none}
  .toast{bottom:16px}
  body.has-rows:not(.kbd) .toast{bottom:calc(72px + env(safe-area-inset-bottom))}
  .toast{left:16px;right:16px;transform:none;max-width:none;justify-content:space-between}
}
@media (max-width:760px){
  .nav-t{display:none}
}
@media (max-width:600px){
  .wrap{padding:0 16px}
  .hero::before{inset:0 -16px}
  .nav{padding:0 12px;gap:8px;height:52px}
  .nl{display:none}
  .logo{font-size:16px}
  h1{font-size:22px}
  .lead{font-size:14px}
  .hero{padding:18px 0 14px}
  .card{padding:16px 14px}
  .composer{gap:12px}
  .cmp-top{align-items:flex-start}
  .chips{flex-wrap:nowrap;overflow-x:auto;scroll-snap-type:x proximity;margin:0 -14px;padding:0 14px 4px;scrollbar-width:none;min-height:48px}
  .chips::-webkit-scrollbar{display:none}
  .chip{scroll-snap-align:start;height:44px}
  .srow{grid-template-columns:1fr;gap:12px}
  .picks{grid-template-columns:1fr;gap:8px}
  .pcap{margin-top:2px}
  .sug{width:100%}
  #q{height:48px}
  .entry{grid-template-columns:104px minmax(0,1fr);gap:10px 12px}
  .draw{width:104px;height:104px;grid-row:auto}
  .entry>.fields{grid-column:1 / -1}
  .fields,.entry.m-sheet>.fields{grid-template-columns:1fr 1fr;gap:10px 12px}
  #gAct,#ePrev,#gNote,#addWhy{order:0}
  #ePrev,.entry.m-sheet #ePrev,#gAct,.fields .w2{grid-column:1 / -1}
  .entry.editing .eact{grid-column:1 / -1}
  #ePrev{min-height:24px}
  .eprev .rv{font-size:15px}
  .eprev .big .rn{font-size:21px}
  #gNote{align-self:end}
  .f input,.f select,.in,.sel,.srow .f select{height:48px;font-size:16px}
  .lt input.ci{height:44px;font-size:16px}
  .eact .btn{min-height:48px}
  /* touch targets >= 44 px */
  .nb{height:44px;min-width:44px}.nb.theme{width:44px}
  .seg{padding:1px}.seg button{min-height:42px}
  .fmts .chip{height:44px}
  details>summary,.lnk,label.chk{min-height:44px}
  details.prices>summary,.byp>summary{display:flex;align-items:center}
  label.chk{align-items:center}
  .chk input{width:20px;height:20px;margin:0}
  .tip{width:32px;height:32px;font-size:13px}
  .ltool .f.fm{flex-basis:100%;min-width:0}
  .grid{gap:16px}
  .list{margin-top:16px;padding:14px 0 4px}
  .ltool{padding:0 14px 12px}
  .ltool .f,.ltool .f.nm{min-width:0;flex:1 1 140px;max-width:none}
  #empty{margin:0 14px 12px}
  .lnote{margin:4px 14px 10px}
  /* table -> compact two-line cards; tap a card for length, quantity and actions */
  table.lt,.lt tbody{display:block}
  .lt colgroup,.lt thead,.lt tfoot{display:none}
  .lt tbody tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;grid-template-areas:"pf pf kg" "sum sum sum";gap:2px 12px;padding:10px 14px;border-bottom:1px solid var(--rule);cursor:pointer}
  .lt tbody tr.open{grid-template-areas:"pf pf kg" "sum sum sum" "len qty qty" "cost cost cost" "act act act";gap:6px 12px;background:var(--md1-bg)!important;cursor:default}
  .lt tbody tr:nth-child(even){background:var(--card-2)}
  .lt tbody tr td,.lt tbody tr:nth-child(even) td{background:none}
  .lt tbody tr.bad{box-shadow:inset 3px 0 0 var(--red)}
  .lt tbody tr.bad td:first-child{box-shadow:none}
  .lt td{display:none;border:0;padding:0;text-align:left;white-space:normal}
  .lt td.pf{display:block;grid-area:pf}
  .lt td.c-kg{display:block;grid-area:kg;text-align:right;font-weight:700;white-space:nowrap;font-size:15px}
  .lt td.c-kg::after{content:" " attr(data-u);font-weight:600;font-size:13px;color:var(--muted)}
  .lt td.c-sum{display:block;grid-area:sum}
  .rtog{font-size:13.5px;color:var(--muted);min-height:24px;line-height:1.4}
  .rtog:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}
  .lt tr.open td.c-len{display:block;grid-area:len}.lt tr.open td.c-qty{display:block;grid-area:qty}
  .lt tr.open td.c-cost{display:block;grid-area:cost}.lt tr.open td.c-act{display:block;grid-area:act}
  .lt td[data-l]::before{content:attr(data-l);display:block;font-size:11.5px;font-weight:600;color:var(--dim)}
  .lt td.c-kg[data-l]::before{display:none}
  .pf .sd,.pf .kgmx{display:none!important}
  .lt tr.open .pf .sd,.lt tr.open .pf .kgmx{display:block!important}
  .pf .pw{gap:6px}
  .lt .acts{justify-content:flex-start;gap:6px}
  .lt .ib{width:44px;height:44px;border-color:var(--border)}
  .byp{margin:12px 14px 8px}
  .byp .hm{display:none}
  .tbtns .row2{grid-template-columns:1fr 1fr}
  .pgrid{grid-template-columns:minmax(0,1fr) auto;gap:4px 8px}
  .pgrid>.lbl{grid-column:1 / -1;margin-top:6px}
  .pgrid .seg{justify-self:start}
  .pgrid .seg.xs button{min-height:42px;padding:0 12px}
  .pgrid .in,.pgrid .sel{height:44px}
  dialog{width:100vw;max-width:100vw;height:100%;max-height:100%;border-radius:0;margin:0}
  footer.ft{padding:0 16px}
}
@media (max-width:380px){.nb.theme{width:34px}.tag.beta{display:none}}
@media (pointer:coarse){.ib{min-width:44px;min-height:44px}.chip{min-height:44px}}
@media (prefers-reduced-motion:reduce){.lt tbody tr.flash td{animation:none}*{scroll-behavior:auto!important}}

/* ===== print ===== */
@media print{
  @page{size:A4;margin:12mm 12mm 14mm}
  :root,html[data-theme]{--text:#000;--text-2:#000;--muted:#333;--dim:#444;--faint:#555;--card:#fff;--card-2:#fff;--bg:#fff;--line:#999;--rule:#bbb;--md1-t:#000;--md1-bg:transparent;--tag-y:#000;--tag-y-bg:transparent;color-scheme:light}
  body{background:#fff!important;color:#000;font-size:9.5pt;padding:0!important}
  .nav,.hero,.composer,.totals,.ltool,#empty,.lnote,.c-act,.c-sum,.mbar,.toast,dialog,.st-panel,footer.ft,.skip,.byp>summary,.cta,#mc-seo,.nojs,.byp1d{display:none!important}
  .ph .psig{margin-top:6px;font-size:9pt}
  .ph .psig span{display:inline-block;width:45mm;border-bottom:1px solid #000;margin:0 8mm 0 2mm}
  table.pbt{width:100%;border-collapse:collapse;font-size:8.4pt;margin:6px 0}
  table.pbt caption{text-align:left;font-weight:700;padding:2px 0 3px}
  table.pbt th,table.pbt td{padding:2px 4px;border-bottom:1px solid #bbb;text-align:right;white-space:nowrap}
  table.pbt th{border-bottom:1px solid #000;font-size:8pt}
  table.pbt .l{text-align:left}
  .wrap{max-width:none;padding:0}
  .grid{display:block}
  .card{border:0;box-shadow:none;padding:0;margin:0;background:#fff}
  .list{margin:0;padding:0}
  .print-only{display:block}
  .ph{display:flex;justify-content:space-between;align-items:flex-end;border-bottom:1.5px solid #000;padding-bottom:6px;margin-bottom:8px}
  .ph .ptl{font-size:15pt;line-height:1.2;margin:0;font-weight:700;letter-spacing:-.01em}
  .ph .pm{text-align:right;font-size:9pt}
  .tblw{overflow:visible}
  table.lt{font-size:8.6pt;table-layout:auto}
  .lt th{background:#fff;color:#000;border-bottom:1px solid #000;padding:4px 4px;font-size:8pt}
  .lt td{padding:3px 4px;border-bottom:1px solid #ccc;background:#fff!important}
  .lt col{width:auto!important}
  .lt .c-kgm,.lt .c-alm{display:table-cell!important}
  .pf .kgmx{display:none!important}
  .lt thead{display:table-header-group}
  .lt tfoot{display:table-row-group}
  .lt tfoot td{position:static;border-top:1px solid #000}
  .lt tr{break-inside:avoid}
  .lt input.ci{display:none}
  .pv{display:inline}
  .src{border:0;padding:0;height:auto;background:none!important;color:#000!important;font-size:7pt;vertical-align:super}
  .pf .gl{width:12px;height:12px}
  .byp{margin:8px 0 0;display:block}
  .byp:not([open])>*:not(summary){display:block}
  .byp table{font-size:8pt}
  .ptot{break-inside:avoid;margin-top:8px;border-top:1.5px solid #000;padding-top:6px;font-size:9.5pt}
  .ptot .pt1{font-size:11pt;font-weight:700}
  .ptot p{margin:3px 0}
  .pleg{font-size:7.5pt;color:#333;margin-top:6px}
  a{color:#000;text-decoration:none}
}
.f>label{font-size:12.5px;color:var(--muted);font-weight:600}
.f>span.err,.err{font-weight:400}
.lt h3.sr{margin:0}

.pf .kgmx .mx{display:none}
@media print{.byp{display:none!important}.pbyp{font-size:8.5pt}}
@media (max-width:960px){
  main.wrap{display:flex;flex-direction:column}
  .grid{display:contents}
  .hero{order:0}main.wrap>noscript,#dataErr{order:1}.composer{order:2}.list{order:3}.totals{order:4;margin-top:16px}.cta{order:5}#mc-seo{order:6}
}
@media (max-width:600px){
  .pf .kgmx .mx{display:inline}
  .lt tr.open td.c-cost:empty{display:none}
}
@media (max-width:600px){
  .lsw a{height:44px;min-width:44px;justify-content:center}
  .cta{padding:14px;flex-direction:column;align-items:stretch}
  .cta .ca{flex-direction:column;align-items:stretch}
  .cta .btn{min-height:48px}
  .cta .reg{text-align:center;min-height:44px;display:flex;align-items:center;justify-content:center}
  footer.ft .fl a{display:inline-block;padding:10px 0}
  #mc-seo .tw{overflow:visible;border:0;border-radius:0;background:none}
  #mc-seo table,#mc-seo tbody{display:block;font-size:13px}
  #mc-seo thead{display:block;position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  #mc-seo tbody tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 12px;padding:10px 12px;margin:0 0 8px;border:1px solid var(--line);border-radius:10px;background:var(--card)}
  #mc-seo tbody th,#mc-seo tbody td{padding:0;border:0}
  #mc-seo tbody th{grid-area:1/1;font-size:14px;color:var(--text)}
  #mc-seo tbody td:nth-child(5){grid-area:1/2;font-weight:650;color:var(--text)}
  #mc-seo tbody td:nth-child(4){grid-area:2/1/3/3}
  #mc-seo tbody td:nth-child(2){grid-area:3/1;font-size:12.5px;color:var(--muted)}
  #mc-seo tbody td:nth-child(3){grid-area:3/2;font-size:12.5px;color:var(--muted)}
  #mc-seo tbody td[data-u]::after{content:" " attr(data-u)}
}
