/* Show Sourcing free tools. Dark by default, html.light for light mode (theme.js). */
:root { --bg:#060a18; --card:rgba(255,255,255,0.035); --field:rgba(255,255,255,0.06); --accent:#0071e3; --accent2:#38bdf8;
  --text:#f1f5f9; --muted:#94a3b8; --dim:#64748b; --border:rgba(255,255,255,0.09); --good:#4ade80; --warn:#fbbf24; }
html.light { --bg:#f6f7fb; --card:#fff; --field:#f1f5f9; --accent:#0062cc; --accent2:#0062cc; --text:#0f172a; --muted:#475569;
  --dim:#64748b; --border:rgba(15,23,42,0.12); --good:#15803d; --warn:#b45309; }
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Plus Jakarta Sans', system-ui, sans-serif; background:var(--bg); color:var(--text); min-height:100vh; line-height:1.55; }
.page { max-width:980px; margin:0 auto; padding:104px 20px 80px; }
.crumbs { font-size:.8rem; color:var(--dim); margin-bottom:18px; }
.crumbs a { color:var(--dim); text-decoration:none; } .crumbs a:hover { color:var(--accent2); }
h1 { font-size:clamp(1.7rem,4.2vw,2.5rem); font-weight:800; letter-spacing:-.02em; line-height:1.15; margin-bottom:10px; }
.lede { color:var(--muted); font-size:1.02rem; max-width:720px; margin-bottom:26px; }
h2 { font-size:1.25rem; font-weight:700; margin:36px 0 12px; letter-spacing:-.01em; }
h3 { font-size:1rem; font-weight:700; margin:22px 0 6px; }
p, li { color:var(--muted); } p + p { margin-top:10px; }
a { color:var(--accent2); }
.card { background:var(--card); border:1px solid var(--border); border-radius:16px; padding:20px; margin-bottom:16px; }
.card h2 { margin-top:0; }
.grid { display:grid; gap:12px; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); }
label.f { display:flex; flex-direction:column; gap:5px; font-size:.78rem; font-weight:600; color:var(--muted); }
input[type=number], input[type=text], select, textarea { font:inherit; font-size:1rem; color:var(--text); background:var(--field);
  border:1px solid var(--border); border-radius:10px; padding:10px 12px; width:100%; min-width:0; }
input[type=number], input[type=text], select { height:44px; }
input[type=number] { -moz-appearance:textfield; appearance:textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
select { -webkit-appearance:none; appearance:none; padding-right:34px; cursor:pointer; text-overflow:ellipsis;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 11px center; background-size:15px; }
#lfill { height:38px; }
input:focus, select:focus, textarea:focus { outline:2px solid var(--accent); outline-offset:0; border-color:transparent; }
textarea { font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:.85rem; min-height:150px; resize:vertical; }
.row { display:flex; flex-wrap:wrap; gap:10px 18px; align-items:center; margin-top:14px; }
.check { display:inline-flex; gap:8px; align-items:center; font-size:.88rem; color:var(--muted); cursor:pointer; }
.check input { width:18px; height:18px; accent-color:var(--accent); }
.seg { display:inline-flex; border:1px solid var(--border); border-radius:10px; overflow:hidden; }
.seg button { font:inherit; font-size:.85rem; font-weight:600; padding:8px 14px; border:0; background:transparent; color:var(--muted); cursor:pointer; }
.seg button[aria-pressed=true] { background:var(--accent); color:#fff; }
.btn { font:inherit; font-size:.85rem; font-weight:600; padding:9px 14px; border-radius:10px; border:1px solid var(--border);
  background:var(--field); color:var(--text); cursor:pointer; text-decoration:none; display:inline-flex; gap:6px; align-items:center; }
.btn:hover { border-color:var(--accent); }
.stats { display:grid; gap:10px; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); }
.stat { background:var(--field); border-radius:12px; padding:12px 14px; }
.stat b { display:block; font-size:1.35rem; font-weight:800; color:var(--text); letter-spacing:-.01em; }
.stat span { font-size:.75rem; color:var(--dim); font-weight:600; }
.tbl { width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
table { width:100%; border-collapse:collapse; font-size:.9rem; }
th, td { text-align:left; padding:9px 10px; border-bottom:1px solid var(--border); white-space:nowrap; }
th { font-size:.72rem; text-transform:uppercase; letter-spacing:.04em; color:var(--dim); font-weight:700; }
td { color:var(--text); } td.num, th.num { text-align:right; font-variant-numeric:tabular-nums; }
tr.best td { background:rgba(56,189,248,0.08); }
.tag { font-size:.7rem; font-weight:700; padding:2px 7px; border-radius:20px; background:var(--field); color:var(--muted); }
.tag.w { color:var(--warn); } .tag.ok { color:var(--good); }
.note { font-size:.8rem; color:var(--dim); margin-top:10px; }
.err { color:var(--warn); font-size:.85rem; margin-top:8px; }
.tools { display:grid; gap:14px; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); }
.tools a.card { display:block; text-decoration:none; color:inherit; transition:border-color .2s; }
.tools a.card:hover { border-color:var(--accent); }
.tools a.card b { display:block; color:var(--text); font-size:1.05rem; margin-bottom:6px; }
.app { display:flex; flex-wrap:wrap; gap:14px; align-items:center; justify-content:space-between; }
.app p { max-width:560px; }
.app .btn.pri { background:var(--accent); color:#fff; border-color:var(--accent); }
.faq h3 { color:var(--text); }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
@media (max-width:600px) { .page { padding-top:88px; } .card { padding:16px; } th, td { padding:8px 7px; font-size:.85rem; } }
.sub { display:block; font-size:.74rem; color:var(--dim); font-weight:500; margin-top:2px; white-space:normal; }
td .tag { margin-left:4px; }
th { white-space:normal; }
@media (max-width:600px) { th, td { padding:8px 5px; } td:first-child { min-width:120px; } }
@media (max-width:600px) { .hide-sm { display:none; } td:first-child { min-width:96px; } }
@media (max-width:760px) {
  #itab, #itab tbody, #itab tr, #itab td { display:block; width:100%; }
  #itab tr:first-child { display:none; }
  #itab tr[data-f] { border:1px solid var(--border); border-radius:12px; margin-bottom:10px; padding:6px 0; }
  #itab td { border:0; padding:4px 12px; white-space:normal; display:flex; gap:10px; justify-content:space-between; text-align:right; }
  #itab td:first-child { font-size:1rem; text-align:left; display:block; padding-bottom:6px; }
  #itab td[data-label]:not(:first-child)::before { content:attr(data-label); color:var(--dim); font-size:.78rem; text-align:left; flex:0 0 42%; }
}
@media (max-width:600px) { td:first-child { white-space:normal; } }
/* Export buttons (Excel + printed report), 2026-12-01 */
.xrow { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.xrow .btn svg { width:16px; height:16px; flex:0 0 auto; }
@media print {
  :root, html.light { --bg:#fff; --card:#fff; --field:#fff; --text:#000; --muted:#222; --dim:#444; --border:#bbb; --accent:#000; --accent2:#000; --good:#000; --warn:#000; }
  @page { margin:14mm; }
  body { background:#fff !important; color:#000; font-size:11pt; min-height:0; }
  body::before { content:attr(data-print-date); display:block; font-size:9pt; color:#444; margin-bottom:6px; }
  #header, header, footer, nav, .crumbs, .lede, .faq, .app, .tools, .xrow, .seg, .sr, .pskip, #prog,
  main > h2, main > p, main > div:not(.card):not(.calc):not(.pbrand), .dock, #ltext, #list > p, #list > .row, #lerr:empty, .menu-btn, #menuPanel, #ss-consent, .xnote { display:none !important; }
  .page { max-width:none; padding:0; }
  h1 { font-size:18pt; margin-bottom:8px; }
  .card { border:1px solid #bbb; border-radius:6px; padding:10px 12px; margin-bottom:10px; break-inside:avoid; box-shadow:none; }
  .card h2 { font-size:12pt; margin-bottom:6px; }
  input[type=number], input[type=text], select { border:0; background:none; padding:0; font-weight:700; color:#000; -webkit-appearance:none; appearance:none; -moz-appearance:textfield; }
  input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
  .check input { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .grid { grid-template-columns:repeat(3,1fr); gap:6px 14px; }
  .stats { grid-template-columns:repeat(3,1fr); gap:6px; }
  .stat { border:1px solid #ddd; padding:6px 8px; }
  .stat b { font-size:13pt; }
  .tbl { overflow:visible; }
  table { font-size:9.5pt; }
  th, td { padding:4px 6px; white-space:normal; }
  .hide-sm { display:table-cell !important; }
  tr.best td { background:#eee !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}
.xrow[hidden] { display:none; }
/* Site footer + "Made by Show Sourcing" strip (2026-12-01) */
.promo { display:inline-flex; align-items:center; gap:10px; margin:-8px 0 24px; padding:8px 14px 8px 8px; border:1px solid var(--border);
  border-radius:999px; background:var(--card); color:var(--muted); font-size:.85rem; text-decoration:none; max-width:100%; transition:border-color .2s; }
.promo:hover { border-color:var(--accent); }
.promo img { border-radius:6px; flex:0 0 auto; }
.promo b { color:var(--text); }
.promo .arr { color:var(--accent2); font-weight:700; }
.site-foot { border-top:1px solid var(--border); padding:28px 20px 34px; color:var(--dim); font-size:.8rem; }
.site-foot .wrap { max-width:980px; margin:0 auto; display:flex; flex-wrap:wrap; gap:12px 24px; justify-content:space-between; align-items:center; }
.site-foot nav { display:flex; flex-wrap:wrap; gap:8px 18px; }
.site-foot a { color:var(--muted); text-decoration:none; } .site-foot a:hover { color:var(--text); }
.site-foot .more { margin-top:16px; flex-direction:column; align-items:flex-start; gap:8px; }
.site-foot strong { color:var(--text); font-weight:600; margin-right:6px; }
@media (max-width:600px) { .promo { border-radius:14px; align-items:flex-start; } .site-foot .wrap { justify-content:flex-start; } }
@media print { .promo, .site-foot, #ss-chat, [id^=ss-chat] { display:none !important; } }

/* Icons, tool cards, app box (2026-12-01) */
.ticon { --c:#38bdf8; flex:0 0 auto; width:46px; height:46px; border-radius:13px; display:inline-grid; place-items:center;
  color:var(--c); background:color-mix(in srgb, var(--c) 14%, transparent); border:1px solid color-mix(in srgb, var(--c) 28%, transparent); }
.ticon svg { width:24px; height:24px; }
html.light .ticon { color:color-mix(in srgb, var(--c) 70%, #0f172a); }
h1.ttl { display:flex; align-items:center; gap:14px; }
h1.ttl .ticon { width:52px; height:52px; border-radius:15px; } h1.ttl .ticon svg { width:27px; height:27px; }
.tools { grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); }
.tools a.card.tool { display:flex; align-items:center; gap:16px; padding:18px; margin:0; }
.tools a.card.tool > div { flex:1; min-width:0; }
.tools a.card.tool b { margin-bottom:3px; font-size:1rem; }
.tools a.card.tool p { font-size:.88rem; line-height:1.45; }
.tools a.card.tool .go { color:var(--dim); font-weight:700; transition:transform .2s, color .2s; }
.tools a.card.tool:hover .go { color:var(--accent2); transform:translateX(3px); }
.card.app { display:grid; grid-template-columns:1fr auto; gap:24px; align-items:center; margin-top:34px; padding:24px; overflow:hidden; }
.app-head { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.app-head img { border-radius:12px; }
.app-head b { display:block; font-size:1.15rem; color:var(--text); }
.app-head span { font-size:.85rem; color:var(--muted); }
.app-txt p { margin-bottom:16px; max-width:520px; }
.app-shots { display:flex; gap:12px; }
.app-shots figure { width:150px; border-radius:22px; overflow:hidden; border:1px solid var(--border); box-shadow:0 10px 30px rgba(0,0,0,.25); }
.app-shots figure:nth-child(2) { transform:translateY(18px); }
.app-shots img { display:block; width:100%; height:auto; }
.app-shots .lt { display:none; } html.light .app-shots .lt { display:block; } html.light .app-shots .dk { display:none; }
@media (max-width:720px) { .card.app { grid-template-columns:1fr; } .app-shots { justify-content:center; } .app-shots figure { width:42%; max-width:170px; } }

/* 3D load drawings (draw.js) */
.viz { margin-top:14px; background:var(--field); border-radius:14px; padding:14px; }
.viz .d3 { display:block; width:100%; height:auto; max-height:340px; }
.viz .cap { font-size:.8rem; color:var(--dim); margin-top:8px; text-align:center; }
.viz .seg { margin-bottom:10px; }
.viz .seg button { padding:6px 11px; font-size:.8rem; }
.d3 polygon, .d3 polyline, .d3 line { vector-effect:non-scaling-stroke; stroke-linejoin:round; }
.d3 .bx .f { fill:#c9955a; } .d3 .bx .t { fill:#e3b87e; } .d3 .bx .r { fill:#a97843; }
.d3 .bx polygon { stroke:#6b4a26; stroke-width:.6; stroke-opacity:.55; }
.d3 .pl .f { fill:#c9955a; } .d3 .pl .t { fill:#e3b87e; } .d3 .pl .r { fill:#a97843; }
.d3 .pl polygon { stroke:#5a3c1c; stroke-width:1; }
.d3 .wd .f { fill:#8a6440; } .d3 .wd .t { fill:#a57b52; } .d3 .wd .r { fill:#6e4e30; } .d3 .wd polygon { stroke:#4a3320; stroke-width:.6; }
.d3 .ct.floor { fill:rgba(148,163,184,.16); } .d3 .ct.wall { fill:rgba(148,163,184,.08); stroke:rgba(148,163,184,.45); stroke-width:1; }
.d3 .ct.edge { stroke:rgba(148,163,184,.7); stroke-width:1.2; }
.d3 .lim { fill:none; stroke:var(--warn); stroke-width:1.4; stroke-dasharray:5 4; }
@media print { .viz { background:none; padding:0; } .viz .seg { display:none !important; } .app-shots { display:none; } }

.tools.four { grid-template-columns:repeat(auto-fit,minmax(min(100%,380px),1fr)); }

/* 3D view you can turn (view3d.js) */
.v3bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:8px; }
.v3slot:empty { display:none; } .v3slot .seg { margin:0; }
.btn.sm { padding:6px 11px; font-size:.8rem; border-radius:9px; }
.btn.sm svg { width:12px; height:12px; }
.v3hint { font-size:.75rem; color:var(--dim); margin-left:auto; }
canvas.v3 { display:block; width:100%; touch-action:pan-y; cursor:grab; user-select:none; -webkit-user-select:none; }
canvas.v3:active { cursor:grabbing; }
@media print { .v3bar { display:none !important; } }

/* Pinned results (2026-12-01, Moshe: "pin it so the results are right there"). Desktop: inputs left, results right and
   sticky. Phone: one column, plus a bottom bar with the key numbers while the results are off screen. */
main.page:has(.calc) { max-width:1200px; }
.calc { display:grid; gap:0 18px; align-items:start; }
.calc-out { scroll-margin-top:72px; }
.calc-in .grid { grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); }
@media (min-width:960px) {
  .calc { grid-template-columns:minmax(0,0.85fr) minmax(0,1.15fr); }
  .calc-out { position:sticky; top:70px; max-height:calc(100vh - 82px); overflow:auto; scrollbar-width:thin; }
  .calc-out .card { margin-bottom:0; }
  .calc-out .stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .calc-out .stat { padding:10px 12px; } .calc-out .stat b { font-size:1.2rem; }
  .calc-out table th, .calc-out table td { padding:7px 8px; }
  .dock { display:none !important; }
}
.dock { position:fixed; left:12px; right:84px; bottom:calc(12px + env(safe-area-inset-bottom)); z-index:50; display:flex; align-items:center; gap:10px;
  padding:11px 14px; border-radius:14px; text-decoration:none; color:var(--text); font-size:.88rem; font-weight:600;
  background:var(--card); border:1px solid var(--border); box-shadow:0 2px 8px rgba(0,0,0,.12); }
.dock[hidden] { display:none; }
.dock b { color:var(--accent2); }
.dock .t { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dock .go { margin-left:auto; color:var(--muted); font-size:.8rem; white-space:nowrap; }
@media print { .calc { display:block; } .calc-out { position:static; max-height:none; overflow:visible; } }

/* Brand strip on the printed report (export.js adds it): QR code + link */
.pbrand { display:none; }
@media print { .pbrand { display:flex !important; gap:14px; align-items:center; margin-top:14px; padding-top:10px; border-top:1px solid #bbb; break-inside:avoid; }
  .pbrand b { display:block; font-size:11pt; } .pbrand a { display:block; color:#0062cc; font-size:11pt; } .pbrand span { font-size:9pt; color:#555; } }

/* SKU list: folded behind one button; products as chips under the 3D view (2026-12-01) */
#list { padding:0; }
#list .ltoggle { all:unset; box-sizing:border-box; display:flex; width:100%; align-items:center; justify-content:space-between; gap:10px;
  padding:16px 20px; cursor:pointer; border-radius:16px; color:var(--text); font-size:1rem; }
#list .ltoggle:hover { color:var(--accent2); } #list .ltoggle:focus-visible { outline:2px solid var(--accent); }
#list .ltoggle span:first-child b { font-weight:800; }
#list .chev { color:var(--muted); transition:transform .2s; } #list.open .chev { transform:rotate(180deg); }
#list #lbody { padding:0 20px 20px; }
.chips3[hidden] { display:none; }
.chips3 { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; align-items:center; }
.chip3 { font:inherit; font-size:.8rem; font-weight:600; display:inline-flex; align-items:center; gap:6px; padding:5px 10px; border-radius:20px;
  border:1px solid var(--border); background:var(--card); color:var(--text); cursor:pointer; max-width:100%; }
.chip3 i { width:11px; height:11px; border-radius:3px; flex:0 0 auto; }
.chip3[aria-pressed=false] { opacity:.45; text-decoration:line-through; }
.chip3.away { border-style:dashed; color:var(--dim); }
.chips3 .pager { display:inline-flex; align-items:center; gap:6px; margin-right:6px; font-size:.82rem; }
@media print { .chips3 .btn, .chips3 .pager button { display:none !important; } }

/* Footer in four groups (2026-12-01, Moshe: "the footer on mobile is too messy") */
.site-foot .fcols { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:22px; align-items:start; }
.site-foot .fcols nav { display:flex; flex-direction:column; gap:9px; }
.site-foot .fcols strong { margin:0 0 2px; font-size:.82rem; }
.site-foot .fcopy { display:block; margin-top:26px; padding-top:16px; border-top:1px solid var(--border); font-size:.75rem; }
@media (max-width:700px) { .site-foot .fcols { grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px 16px; } .site-foot { padding-bottom:96px; } }

/* Margin calculator (2026-12-01) */
.prow { display:grid; grid-template-columns:minmax(0,1fr) 108px 34px; gap:8px; margin-bottom:8px; align-items:center; }
.prow .pv { position:relative; display:block; } .prow .pv i { position:absolute; right:12px; top:50%; transform:translateY(-50%); font-style:normal; color:var(--dim); font-size:.9rem; pointer-events:none; }
.prow .pv input { padding-right:28px; }
.prow .px { font:inherit; font-size:1.1rem; width:34px; height:34px; border-radius:9px; border:1px solid var(--border); background:var(--field); color:var(--muted); cursor:pointer; }
.prow .px:hover { color:var(--warn); border-color:var(--warn); }
.split { display:flex; height:38px; border-radius:10px; overflow:hidden; gap:2px; }
.split span { display:flex; align-items:center; justify-content:center; color:#fff; font-size:.75rem; font-weight:700; min-width:3px; white-space:nowrap; overflow:hidden; }
.legend { display:flex; flex-wrap:wrap; gap:6px 14px; margin-top:10px; font-size:.8rem; color:var(--muted); }
.legend span { display:inline-flex; align-items:center; gap:6px; } .legend i { width:10px; height:10px; border-radius:3px; }
.legend .lossnote { color:var(--warn); font-weight:700; }
.stat.bad b { color:var(--warn); }
.row.target { margin-top:14px; padding:12px 14px; background:var(--field); border-radius:12px; justify-content:space-between; font-size:.88rem; }
.row.target b { color:var(--text); }

/* Tidy fields (2026-12-01, Moshe: "sloppy"): in a row, every box sits on the same line even when a label wraps. */
.grid { align-items:stretch; }
label.f > input, label.f > select, label.f > .pv { margin-top:auto; }
label.f > span { line-height:1.3; }
.grid.g3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
@media (max-width:520px) { .grid.g3 { grid-template-columns:repeat(2,minmax(0,1fr)); } }
label.f.solve input { border-color:color-mix(in srgb, var(--accent) 45%, var(--border)); }
.solvebar { gap:10px; font-size:.85rem; color:var(--muted); margin-top:12px; }
.solvebar .seg button { padding:6px 12px; font-size:.8rem; }
#msolve:empty { display:none; } #msolve { color:var(--warn); }
.prow .px { display:inline-grid; place-items:center; padding:0; line-height:1; font-size:1.05rem; }
.saveas { display:flex; gap:6px; flex:1 1 240px; }
.saveas input { height:36px; font-size:.88rem; padding:6px 10px; }
.btn.pri { background:var(--accent); color:#fff; border-color:var(--accent); }
.chipwrap { display:inline-flex; align-items:center; }
.chipwrap .chip3 { border-top-right-radius:0; border-bottom-right-radius:0; border-right:0; }
.chipwrap .chip3 small { color:var(--dim); font-weight:600; }
.chipwrap .chip3.on { background:var(--accent); border-color:var(--accent); color:#fff; } .chipwrap .chip3.on small { color:#fff; opacity:.8; }
.chipx { font:inherit; display:inline-grid; place-items:center; width:26px; height:29px; padding:0; line-height:1; border:1px solid var(--border); border-radius:0 20px 20px 0;
  background:var(--card); color:var(--dim); cursor:pointer; }
.chipx:hover { color:var(--warn); }
#saved { margin:4px 0 12px; }
.chipwrap .chip3[aria-pressed=false] { opacity:1; text-decoration:none; }
.chipwrap .chipx { height:auto; align-self:stretch; }

/* Printed SKU report: one page per product (load.js buildSkuPrint) */
#skuprint { display:none; }
#skuhost { position:absolute; left:-10000px; top:0; width:760px; }
@media print {
  #skuprint:not(.pskip) { display:block !important; border:0; padding:0; }
  .skupage { break-after:page; page-break-after:always; }
  .skupage:last-child { break-after:auto; page-break-after:auto; }
  .skupage h2 { font-size:15pt; margin:0 0 4px; }
  .skupage table { width:100%; max-width:520px; }
  .skushot { display:block; width:100%; max-width:640px; margin-top:12px; }
}

/* Margin boxes v2 (2026-12-01, Moshe): "$" and "%" inside the boxes, grey = worked out by the math, × icons centered. */
label.f .pv { position:relative; display:block; margin-top:auto; }
label.f .pv i { position:absolute; top:50%; transform:translateY(-50%); font-style:normal; color:var(--dim); font-size:.95rem; font-weight:500; pointer-events:none; }
label.f .pv:not(.pre) i { right:12px; } label.f .pv:not(.pre) input { padding-right:30px; }
label.f .pv.pre i { left:12px; } label.f .pv.pre input { padding-left:calc(16px + var(--symw, 1ch)); }
label.f.auto input { background:transparent; border-style:dashed; color:var(--muted); }
label.f.auto > span:first-child::after { content:" · worked out"; font-weight:500; color:var(--dim); }
.autohint { display:flex; align-items:center; gap:8px; margin-top:12px; }
.autokey { flex:0 0 auto; width:22px; height:14px; border:1px dashed var(--muted); border-radius:4px; }
.prow { grid-template-columns:minmax(0,1fr) 108px 44px; }
.prow .px { width:44px; height:44px; display:grid; place-items:center; padding:0; border-radius:10px; }
.prow .px svg, .chipx svg { display:block; }
.chipx svg { width:12px; height:12px; }

/* Phone compact mode (2026-12-01, Moshe: "on phone it should be compact mode where i dont have to scroll at all if possible").
   Calculator pages only (main:has(.calc)). Smaller title, no intro box, tight cards, carton sizes on one row. */
@media (max-width:700px) {
  main:has(.calc) .crumbs { margin-bottom:6px; }
  main:has(.calc) h1 { font-size:1.35rem; margin-bottom:4px; }
  main:has(.calc) h1.ttl .ticon { width:34px; height:34px; border-radius:10px; } main:has(.calc) h1.ttl .ticon svg { width:18px; height:18px; }
  main:has(.calc) .lede { font-size:.85rem; margin-bottom:10px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  main:has(.calc) .promo { display:none; }
  .calc .card { padding:12px; margin-bottom:10px; border-radius:14px; }
  .calc .card h2 { font-size:1rem; margin-bottom:8px; }
  .calc .card > .row:first-child { margin-bottom:8px !important; }
  .calc .grid { gap:8px; }
  .calc label.f { font-size:.7rem; gap:3px; }
  .calc input[type=number], .calc input[type=text], .calc select { height:38px; padding:6px 10px; font-size:.95rem; }
  .calc .row { margin-top:8px; }
  .calc .seg button { padding:5px 9px; font-size:.75rem; }
  .calc label.check { font-size:.78rem; }
  .calc .note { font-size:.72rem; margin-top:6px; }
  .calc .stats { gap:6px; }
  .calc .stat { padding:7px 9px; border-radius:10px; } .calc .stat b { font-size:1rem; } .calc .stat span { font-size:.66rem; }
  .calc table th, .calc table td { padding:5px 6px; font-size:.8rem; }
  .calc .viz { padding:8px; margin-top:8px; }
  .calc .xrow .btn { padding:7px 11px; font-size:.82rem; }
  /* Carton: L, W, H on one row, weight and count on the next. */
  #carton .grid { grid-template-columns:repeat(6,minmax(0,1fr)); }
  #carton .grid > label { grid-column:span 2; } #carton .grid > label:nth-child(n+4) { grid-column:span 3; }
  /* Volume and weight: one row of 4 small numbers, no heading. */
  #volcard { padding:8px; } #volcard h2 { display:none; }
  #volcard .stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
  #volcard .stat { padding:6px 7px; } #volcard .stat b { font-size:.9rem; } #volcard .stat span { font-size:.6rem; line-height:1.2; display:block; }
  #list .ltoggle { padding:2px 0; font-size:.88rem; }
  #list { padding:10px 12px; }
  .page:has(.calc) { padding-top:12px; }
  /* Results: the 3D view first, then the table; table sub-lines small. */
  #contcard, #pccard { display:flex; flex-direction:column; }
  #contcard > *, #pccard > * { order:3; } #contcard > .row:first-child, #pccard > .row:first-child { order:0; }
  #cviz, #pviz { order:1; margin:0 0 8px; } #contcard .tbl, #pccard .tbl { order:2; }
  .calc td .sub { font-size:.66rem; }
  .calc .prow { grid-template-columns:minmax(0,1fr) 96px 38px; gap:6px; margin-bottom:6px; } .calc .prow .px { width:38px; height:38px; }
  #palcard .grid { grid-template-columns:repeat(3,minmax(0,1fr)); } #palcard .grid > label:first-child { grid-column:span 2; }
  .calc .viz .seg { margin-bottom:6px; } .calc .viz .seg button { padding:4px 8px; font-size:.72rem; }
  .calc .v3bar { gap:6px; margin-bottom:4px; } .calc .v3bar .btn { padding:4px 9px; font-size:.75rem; } .calc .v3hint { display:none; }
  .calc .viz .cap { margin-top:4px; font-size:.72rem; }
  #contcard > p.note:not(.xnote), #pccard > p.note:not(.xnote) { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
}
/* Wide tables (freight column) scroll inside their card instead of widening the page (2026-12-04). */
.calc-in, .calc-out, .calc .card { min-width: 0; }

/* Pallet page: "Pallets per container" folded behind one button (2026-12-04) */
#pccard { padding:0; }
#pccard .ltoggle { all:unset; box-sizing:border-box; display:flex; width:100%; align-items:center; justify-content:space-between; gap:10px;
  padding:16px 20px; cursor:pointer; border-radius:16px; color:var(--text); font-size:1rem; }
#pccard .ltoggle:hover { color:var(--accent2); } #pccard .ltoggle:focus-visible { outline:2px solid var(--accent); }
#pccard .ltoggle span:first-child b { font-weight:800; }
#pccard .chev { color:var(--muted); transition:transform .2s; } #pccard.open .chev { transform:rotate(180deg); }
#pccard #pcbody { padding:0 20px 20px; }
@media (max-width:600px) { #pccard .ltoggle { padding:14px 16px; font-size:.92rem; } #pccard #pcbody { padding:0 16px 16px; } }
