/* PDW Planta. Dark, quiet, precise. */
:root {
  --bg: #070809; --panel: #0e1112; --panel2: #151a1b; --panel3: #1b2122; --line: #1e2527; --line2: #2a3335;
  --text: #ecf1f1; --soft: #b9c4c5; --muted: #869596;
  --accent: #5fa3a8; --accent-hi: #7cc0c4; --ice: #42afd1;
  --green: #34c38f; --yellow: #f4c542; --red: #f0544f; --ship: #ff1744;
  --amber: #f4c542; --blue: #42afd1;
  --r: 14px; --r-sm: 9px;
  --f-head: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-ui: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-num: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 40px -24px rgba(0,0,0,.9);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--f-ui); -webkit-font-smoothing: antialiased; }
body { padding-bottom: env(safe-area-inset-bottom); background:
  radial-gradient(1200px 500px at 85% -10%, rgba(95,163,168,.08), transparent 60%),
  radial-gradient(900px 400px at -10% 0%, rgba(66,175,209,.05), transparent 60%), var(--bg); background-attachment: fixed; min-height: 100vh; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .6em; font-weight: 600; }
h1 { font: 800 1.9rem/1.1 var(--f-head); font-stretch: 112%; letter-spacing: -.01em; }
h2 { font: 700 .78rem/1.2 var(--f-head); font-stretch: 112%; text-transform: uppercase; letter-spacing: .14em; color: var(--soft); }
h3 { font: 700 .74rem/1.2 var(--f-head); font-stretch: 112%; margin-top: 1.4em; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
h4 { grid-column: 1 / -1; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin: .4em 0 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.accent { color: var(--accent-hi); }
.red { color: var(--red); } .ok-text { color: var(--green); }
.grow { flex: 1; }
.hidden { display: none !important; }
.center { margin: 20vh auto; max-width: 480px; text-align: center; }
.splash { min-height: 80vh; display: grid; place-items: center; }
.splash img { opacity: .9; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .4; } }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 22px; padding: 12px 24px; padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(7,8,9,.82); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 40px; height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font: 700 .92rem var(--f-head); font-stretch: 112%; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-hi); }
.brand-text small { font: 600 .68rem var(--f-ui); letter-spacing: .32em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.topbar nav { display: flex; gap: 2px; overflow-x: auto; }
.topbar nav a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); white-space: nowrap; font-weight: 500; transition: color .15s, background .15s; }
.topbar nav a:hover { color: var(--text); }
.topbar nav a.active { background: var(--panel2); color: var(--text); box-shadow: 0 0 0 1px var(--line2) inset; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang { background: none; color: var(--soft); border: 1px solid var(--line2); border-radius: 999px; padding: 6px 12px; font: 600 .78rem var(--f-ui); letter-spacing: .1em; cursor: pointer; }
.lang:hover { color: var(--text); border-color: var(--accent); }
.sync { font-size: .8rem; color: var(--muted); }
.sync.off { color: var(--red); } .sync.wait { color: var(--yellow); }
select.dev { width: auto; background: var(--panel2); color: var(--yellow); border: 1px dashed rgba(244,197,66,.5); border-radius: 999px; padding: 5px 10px; font-size: .8rem; }

main { padding: 24px; max-width: 1480px; margin: 0 auto; overflow-x: hidden; }
.card { background: linear-gradient(180deg, var(--panel), #0b0d0e); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card.error { border-color: var(--red); color: var(--red); }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h1, .card-head h2 { margin: 0; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.cols > div { min-width: 0; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; } main { padding: 16px; } }
.loading { padding: 60px; text-align: center; color: var(--muted); letter-spacing: .1em; }

/* ---------- production board ---------- */
.board-head { display: flex; align-items: flex-end; gap: 16px; margin: 6px 0 20px; flex-wrap: wrap; }
.board-head h1 { margin: 0; font-size: 2.3rem; }
.eyebrow { font: 600 .72rem var(--f-ui); letter-spacing: .24em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }

.t-green { --tier: var(--green); } .t-yellow { --tier: var(--yellow); } .t-red { --tier: var(--red); } .t-late { --tier: var(--ship); }
.t-none { --tier: #4b5658; } .t-done { --tier: #4b5658; }

.tier-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.tier-count { position: relative; text-align: left; cursor: pointer; font: inherit; color: var(--text); background: linear-gradient(180deg, var(--panel), #0b0d0e); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 14px 22px; overflow: hidden; transition: border-color .15s, transform .15s; }
.tier-count::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tier); box-shadow: 0 0 18px var(--tier); }
.tier-count:hover { border-color: var(--line2); transform: translateY(-1px); }
.tier-count.on { border-color: var(--tier); box-shadow: 0 0 0 1px var(--tier) inset; }
.tier-count b { display: block; font: 600 2.1rem/1 var(--f-num); color: var(--tier); }
.tier-count span { display: block; margin-top: 8px; font: 700 .76rem var(--f-head); font-stretch: 112%; letter-spacing: .14em; text-transform: uppercase; }
.tier-count small { color: var(--muted); font-size: .76rem; }
@media (max-width: 700px) { .tier-strip { grid-template-columns: repeat(2, 1fr); } .tier-count b { font-size: 1.7rem; } }

.blocker-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; margin-bottom: 18px; border-radius: var(--r-sm); background: rgba(240,84,79,.08); border: 1px solid rgba(240,84,79,.35); }
.bb-label { font: 700 .74rem var(--f-head); font-stretch: 112%; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.bb-item { text-decoration: none; color: var(--soft); font-size: .9rem; } .bb-item b { color: var(--text); font-family: var(--f-num); font-weight: 600; }
.bb-item:hover { color: var(--text); }

.board { display: flex; flex-direction: column; gap: 18px; }
.empty { color: var(--muted); padding: 40px; text-align: center; border: 1px dashed var(--line2); border-radius: var(--r); }
.ocard { position: relative; background: linear-gradient(180deg, #0f1213, #0a0c0d); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.ocard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--tier); box-shadow: 0 0 22px var(--tier); }
.ocard::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, color-mix(in srgb, var(--tier) 9%, transparent), transparent 38%); }
.ocard.t-late { border-color: rgba(255,23,68,.55); animation: shipglow 2.4s ease-in-out infinite; }
@keyframes shipglow { 0%, 100% { box-shadow: var(--shadow), 0 0 0 0 rgba(255,23,68,0); } 50% { box-shadow: var(--shadow), 0 0 28px -4px rgba(255,23,68,.55); } }
@media (prefers-reduced-motion: reduce) { .ocard.t-late { animation: none; box-shadow: 0 0 22px -6px rgba(255,23,68,.6); } }

.oc-head { position: relative; z-index: 1; display: flex; gap: 20px; align-items: stretch; padding: 18px 20px 16px 28px; border-bottom: 1px solid var(--line); }
.oc-id { flex: 1; min-width: 0; }
.oc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.oc-num { font: 600 1.15rem var(--f-num); letter-spacing: .02em; color: var(--text); text-decoration: none; }
.oc-num:hover { color: var(--accent-hi); }
.oc-cust { font: 700 1.25rem/1.25 var(--f-head); font-stretch: 112%; margin-top: 6px; color: var(--text); }
.oc-loc { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.flag-blocker { font: 700 .72rem var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--red); padding: 3px 9px; border-radius: 999px; text-decoration: none; }

.oc-due { position: relative; display: grid; grid-template-columns: auto; align-content: center; justify-items: end; gap: 2px; min-width: 190px; padding: 10px 16px; border-radius: var(--r-sm); text-align: right;
  background: color-mix(in srgb, var(--tier) 10%, #0b0d0e); border: 1px solid color-mix(in srgb, var(--tier) 45%, transparent); color: var(--text); font: inherit; }
button.oc-due { cursor: pointer; transition: border-color .15s, background .15s; }
button.oc-due:hover { border-color: var(--tier); background: color-mix(in srgb, var(--tier) 16%, #0b0d0e); }
.oc-due small { font: 600 .66rem var(--f-ui); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.oc-due b { font: 600 1.15rem var(--f-num); }
.oc-days { font-size: .85rem; color: var(--soft); }
.tier-pill { margin-top: 4px; font: 700 .66rem var(--f-head); font-stretch: 112%; letter-spacing: .14em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--tier); color: #070809; }
.t-late .tier-pill { color: #fff; }
.oc-edit { position: absolute; top: 8px; left: 10px; font-style: normal; color: var(--muted); font-size: .85rem; opacity: 0; transition: opacity .15s; }
button:hover > .oc-edit, button:focus-visible > .oc-edit { opacity: 1; }

.oc-items { position: relative; z-index: 1; }
.oc-job { display: flex; align-items: center; gap: 10px; padding: 10px 20px 10px 28px; background: rgba(255,255,255,.015); border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--soft); }
.oc-job b { font: 700 .72rem var(--f-head); font-stretch: 112%; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-hi); }
.oc-job small { color: var(--muted); }

.oi { display: grid; grid-template-columns: 148px minmax(0, 1fr) minmax(260px, 340px); gap: 22px; padding: 18px 20px 18px 28px; border-bottom: 1px solid var(--line); align-items: start; }
.oi:last-child { border-bottom: 0; }
.oi-media { position: relative; display: block; width: 148px; height: 148px; border-radius: 11px; overflow: hidden; background: #f3f4f2; border: 1px solid var(--line2); }
.oi-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.oi-media.empty { display: grid; place-items: center; background: repeating-linear-gradient(135deg, #0f1314 0 10px, #121718 10px 20px); }
.oi-media.empty span { font: 700 .68rem var(--f-head); font-stretch: 112%; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.oi-tag { position: absolute; left: 6px; bottom: 6px; font: 700 .6rem var(--f-ui); letter-spacing: .12em; text-transform: uppercase; background: rgba(7,8,9,.85); color: var(--ice); padding: 2px 6px; border-radius: 4px; }
.oi-desc { min-width: 0; }
.oi-code { display: flex; gap: 10px; align-items: center; font: 600 .78rem var(--f-num); color: var(--accent-hi); }
.oi-code span { font: 600 .66rem var(--f-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.oi-name { margin: 6px 0 8px; font: 700 1.2rem/1.25 var(--f-head); font-stretch: 112%; color: var(--text); text-transform: none; letter-spacing: 0; }
.oi-model { display: inline-block; margin-left: 10px; font: 500 .85rem var(--f-num); color: var(--muted); }
.oi-spec { display: flex; flex-wrap: wrap; gap: 6px; }
.oi-spec span { font-size: .82rem; color: var(--soft); background: var(--panel2); border: 1px solid var(--line); padding: 3px 9px; border-radius: 6px; }
.oi-meta { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.oi-qty { font: 600 1rem var(--f-num); color: var(--text); }
.oi-draw { font-weight: 600; font-size: .88rem; color: var(--ice); text-decoration: none; border-bottom: 1px solid rgba(66,175,209,.35); }
.oi-draw:hover { border-bottom-color: var(--ice); }

.om { background: #0a0d0e; border: 1px solid var(--line); border-radius: 11px; padding: 4px 0 8px; }
.om.all { border-color: rgba(52,195,143,.4); }
.om-head { position: relative; display: flex; width: 100%; align-items: center; gap: 8px; padding: 10px 14px 8px; background: none; border: 0; color: inherit; font: inherit; text-align: left; }
button.om-head { cursor: pointer; border-radius: 11px 11px 0 0; }
button.om-head:hover { background: rgba(255,255,255,.025); }
.om-head .oc-edit { position: static; opacity: .5; }
.om-title { font: 700 .68rem var(--f-head); font-stretch: 112%; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.src { font: 600 .62rem var(--f-ui); letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; border: 1px solid; }
.src-ai { color: var(--ice); border-color: rgba(66,175,209,.45); background: rgba(66,175,209,.08); }
.src-estimate { color: var(--muted); border-color: var(--line2); }
.src-manual { color: var(--accent-hi); border-color: rgba(95,163,168,.45); }
.om-count { font: 600 .74rem var(--f-num); color: var(--soft); }
.om.all .om-count { color: var(--green); }
.bar.thin { height: 3px; margin: 0 14px 6px; }
.bar.thin i { background: var(--green); }
.om-list { list-style: none; margin: 0; padding: 0 6px; }
.om-list li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; font-size: .86rem; }
.om-list li:hover { background: rgba(255,255,255,.02); }
.om-list li.done .om-name { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(52,195,143,.6); }
.om-list input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--green); cursor: pointer; }
.om-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line2); justify-self: center; }
.om-qty { font: 500 .8rem var(--f-num); color: var(--soft); white-space: nowrap; }
.om .muted.small { padding: 0 14px; margin: 4px 0; }

.oc-foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; padding: 12px 20px 12px 28px; border-top: 1px solid var(--line); background: rgba(255,255,255,.012); }
.oc-stage { font-size: .84rem; color: var(--soft); white-space: nowrap; }
.oc-progress { flex: 1; display: flex; align-items: center; gap: 10px; max-width: 420px; }
.oc-progress .bar { flex: 1; margin: 0; }
.oc-progress small { font: 500 .78rem var(--f-num); color: var(--muted); }
.oc-open { margin-left: auto; font-weight: 600; font-size: .86rem; color: var(--accent-hi); text-decoration: none; white-space: nowrap; }
.oc-open:hover { color: var(--text); }

@media (max-width: 1100px) { .oi { grid-template-columns: 120px minmax(0, 1fr); } .oi .om { grid-column: 1 / -1; } .oi-media { width: 120px; height: 120px; } }
@media (max-width: 640px) {
  .oc-head { flex-direction: column; gap: 12px; padding: 16px 16px 14px 22px; }
  .oc-due { justify-items: start; text-align: left; min-width: 0; grid-template-columns: auto auto; column-gap: 12px; align-items: baseline; }
  .oc-due small { grid-column: 1 / -1; }
  .oc-due .tier-pill { grid-column: 1 / -1; justify-self: start; }
  .oc-edit { left: auto; right: 10px; opacity: .6; }
  .oi { grid-template-columns: 88px minmax(0, 1fr); gap: 14px; padding: 14px 14px 14px 22px; }
  .oi-media { width: 88px; height: 88px; }
  .oi-name { font-size: 1.05rem; }
  .oc-job { padding-left: 22px; }
  .oc-foot { flex-wrap: wrap; padding: 12px 14px 12px 22px; gap: 10px; }
  .oc-progress { order: 3; flex-basis: 100%; max-width: none; }
  .board-head h1 { font-size: 1.8rem; }
}

/* ship date modal */
.tier-preview { display: flex; gap: 10px; align-items: baseline; min-height: 1.6em; margin: 4px 0 14px; }
.tier-preview b { font: 700 .74rem var(--f-head); font-stretch: 112%; letter-spacing: .14em; text-transform: uppercase; color: var(--tier); }
.tier-preview span { color: var(--soft); font-size: .9rem; }
.tier-legend { list-style: none; padding: 12px 0 0; margin: 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.tier-legend li { display: grid; grid-template-columns: 12px 130px 1fr; gap: 10px; align-items: center; font-size: .85rem; color: var(--muted); }
.tier-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--tier); box-shadow: 0 0 8px var(--tier); }
.tier-legend b { color: var(--text); font-weight: 600; }

/* materials modal */
.mm-list { display: flex; flex-direction: column; gap: 6px; }
.mm-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px 64px 36px 30px; gap: 6px; align-items: center; }
.mm-row input { padding: 8px; }
.mm-row .mm-buy { width: 20px; height: 20px; justify-self: center; accent-color: var(--green); }
.mm-hdr span { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.mm-note { grid-column: 1 / -1; color: var(--muted); font-size: .76rem; margin: -2px 0 4px 2px; }

/* import */
.import-cta { display: flex; align-items: center; gap: 18px; padding: 16px 18px; margin: 4px 0 18px; border-radius: var(--r-sm); border: 1px solid rgba(66,175,209,.35); background: linear-gradient(90deg, rgba(66,175,209,.08), transparent); }
.import-cta > div { flex: 1; } .import-cta p { margin: 4px 0 0; font-size: .88rem; }
@media (max-width: 640px) { .import-cta { flex-direction: column; align-items: stretch; } }

/* ---------- shared pieces ---------- */
.counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.light { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.light i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 8px currentColor; background: currentColor; }
.light.on_track { color: var(--green); } .light.at_risk { color: var(--yellow); } .light.late { color: var(--red); } .light.draft { color: #6c7779; }
.light.draft i { box-shadow: none; }

.order-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.order-row:last-child { border-bottom: 0; }
.wo-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wo-num { font: 600 1rem var(--f-num); text-decoration: none; color: var(--accent-hi); }
.row-meta { display: flex; gap: 8px; margin: 6px 0; font-size: .85rem; }
.due { font-weight: 600; white-space: nowrap; font-family: var(--f-num); font-size: .9rem; } .due.red { color: var(--red); } .due.amber { color: var(--yellow); }
.due small { color: var(--muted); font-weight: 400; font-family: var(--f-ui); }
.reasons { color: var(--yellow); display: block; margin-top: 4px; font-size: .85rem; }
.bar { height: 4px; background: #1a2022; border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--ice)); border-radius: 3px; }
.prio { font: 700 .66rem var(--f-ui); text-transform: uppercase; letter-spacing: .1em; padding: 3px 8px; border-radius: 999px; border: 1px solid; }
.prio.urgent { color: var(--red); } .prio.high { color: var(--yellow); } .prio.low { color: var(--muted); }
.chip { font-size: .72rem; padding: 3px 9px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line2); color: var(--soft); white-space: nowrap; letter-spacing: .02em; }
.chip.amber { color: var(--yellow); border-color: rgba(244,197,66,.4); }
.chip.ok, .chip.pr-approved, .chip.pr-received { color: var(--green); border-color: rgba(52,195,143,.4); }
.chip.pr-pending { color: var(--yellow); border-color: rgba(244,197,66,.4); } .chip.pr-rejected { color: var(--red); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--panel2); color: var(--text); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 16px; font: 600 .92rem var(--f-ui); cursor: pointer; text-decoration: none; min-height: 42px; transition: border-color .15s, background .15s, transform .1s; }
.btn:hover { border-color: #3f4b4d; background: var(--panel3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #6fb3b8, #4f9297); color: #041012; border-color: #6fb3b8; }
.btn.primary:hover { background: linear-gradient(180deg, #7cc0c4, #5aa0a5); }
.btn.ok { background: rgba(52,195,143,.14); border-color: rgba(52,195,143,.5); color: var(--green); }
.btn.danger { background: rgba(240,84,79,.14); border-color: rgba(240,84,79,.55); color: #ff8a86; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: .84rem; border-radius: 8px; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 4px; }
.icon-btn:hover { color: var(--text); }
.btns { display: flex; gap: 8px; align-items: center; }
.btns.wrap { flex-wrap: wrap; margin-top: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 999px; overflow: hidden; padding: 2px; }
.seg button { background: none; color: var(--muted); border: 0; padding: 7px 16px; cursor: pointer; font: inherit; border-radius: 999px; }
.seg button.on { background: var(--panel3); color: var(--text); }

input, select, textarea { width: 100%; background: #090b0c; color: var(--text); border: 1px solid var(--line2); border-radius: 9px; padding: 10px 12px; font: inherit; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #3a4547; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(95,163,168,.18); }
input[type=checkbox] { width: auto; }
input[type=search] { max-width: 300px; border-radius: 999px; padding-left: 16px; }
input[type=date] { color-scheme: dark; font-family: var(--f-num); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 14px; margin-bottom: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.field.wide { grid-column: span 2; } .field.full { grid-column: 1 / -1; margin-bottom: 10px; }
@media (max-width: 600px) { .field.wide { grid-column: 1 / -1; } }
.totals { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; color: var(--muted); }
.totals b { color: var(--text); font-family: var(--f-num); }
.inline { display: flex; gap: 6px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 1rem; }
.check input { width: 22px; height: 22px; accent-color: var(--green); }

.admin-box { border: 1px dashed rgba(95,163,168,.45) !important; background: rgba(95,163,168,.04); border-radius: 10px; padding: 12px; margin-top: 12px; }
.admin-box summary { cursor: pointer; color: var(--accent-hi); font-weight: 600; }
.admin-line { color: var(--accent-hi); font-size: .9rem; font-family: var(--f-num); }
.note-box { background: var(--panel2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 6px; }
.note-box.amber { border-left-color: var(--yellow); color: #f6dc8f; } .note-box.ok { border-left-color: var(--green); color: #9fe3c6; }
.dc-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.item { border: 1px solid var(--line); border-radius: 11px; padding: 14px; margin-bottom: 12px; background: #0a0c0d; }
.item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.item-head select { width: auto; }
.item .sub { border-top: 1px solid var(--line); padding-top: 8px; }
.item.view .om { margin-top: 12px; }
.sub-details { margin: 6px 0; } .sub-details summary { cursor: pointer; color: var(--soft); padding: 6px 0; }
.item-body { display: flex; gap: 16px; align-items: flex-start; }
.item-body .oi-media { width: 120px; height: 120px; flex: none; }
.item-body .oi-draw { display: inline-block; margin-top: 10px; }
@media (max-width: 600px) { .item-body .oi-media { width: 88px; height: 88px; } }
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 0; font-size: .9rem; }
.specs dt { color: var(--muted); } .specs dd { margin: 0; overflow-wrap: anywhere; }
.start-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 700px) { .start-opts { grid-template-columns: 1fr; } }

.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); padding: 24px 0 14px; display: flex; gap: 10px; justify-content: flex-end; }

.wo-head { position: relative; overflow: hidden; padding-left: 26px; }
.wo-head::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--tier, var(--line2)); box-shadow: 0 0 18px var(--tier, transparent); }
.wo-head h1 { font-family: var(--f-num); font-weight: 600; font-stretch: normal; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 10px; }
.kv small { display: block; color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 2px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; }
.tabs a { padding: 10px 18px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; white-space: nowrap; color: var(--muted); position: relative; }
.tabs a.on { color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tabs small { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 6px; } .dot.red { background: var(--red); box-shadow: 0 0 8px var(--red); }

.stages { list-style: none; padding: 0; margin: 0; }
.stages li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.stages li > div { min-width: 0; overflow-wrap: anywhere; }
.stages .step { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line2); color: var(--muted); font: 600 .8rem var(--f-num); flex: none; }
.stages li.done .step { background: var(--green); border-color: var(--green); color: #04130d; }
.stages li.next .step { border-color: var(--accent-hi); color: var(--accent-hi); box-shadow: 0 0 12px rgba(95,163,168,.4); }
.stages li.todo b { color: #6c7779; }
.stages .thumb img { width: 56px; height: 56px; }

.thumb { display: inline-flex; flex-direction: column; text-decoration: none; gap: 3px; }
.thumb img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line2); background: #1a2022; }
.thumb span { font-size: .75rem; } .thumb small { font-size: .7rem; color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo-grid .thumb img { width: 100%; height: 110px; }
.photo-picker { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.photo-btn { min-height: 54px; font-size: 1rem; }
.preview img { max-width: 100%; max-height: 240px; border-radius: 8px; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 10px; background: var(--panel2); margin-bottom: 8px; text-decoration: none; }
.alert.blocker { border-left: 3px solid var(--red); } .alert.blocker.resolved { border-left-color: #2b5f3f; opacity: .65; }
.alert p { margin: 2px 0; }
.pr { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 5px 4px; border-bottom: 1px solid #151b1c; }
.tbl-wrap { overflow-x: auto; }
.tbl.mats input { padding: 6px 8px; } .tbl.mats input.num { width: 80px; font-family: var(--f-num); } .tbl.mats input.unit { width: 64px; }
.tbl tr.short td { background: rgba(240,84,79,.07); }
.labor-form { align-items: end; }

.modal-wrap { position: fixed; inset: 0; background: rgba(3,4,5,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 12px; }
.modal { background: linear-gradient(180deg, #121617, #0c0f10); border: 1px solid var(--line2); border-radius: 16px; width: min(600px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px -20px rgba(0,0,0,.9); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; text-transform: none; letter-spacing: 0; font: 700 1.1rem var(--f-head); font-stretch: 112%; color: var(--text); }
.modal-body { padding: 18px 20px; }
.modal-actions { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(480px, calc(100% - 32px)); }
.toast { background: rgba(21,26,27,.96); border: 1px solid var(--line2); border-left: 3px solid var(--green); padding: 12px 16px; border-radius: 10px; opacity: 0; transform: translateY(10px); transition: .25s; box-shadow: 0 12px 30px -10px rgba(0,0,0,.8); }
.toast.show { opacity: 1; transform: none; }
.toast.err { border-left-color: var(--red); } .toast.warn { border-left-color: var(--yellow); }
.om-head { flex-wrap: wrap; row-gap: 4px; }
.om-title, .src, .om-count { white-space: nowrap; }
.open-items { margin: 6px 0 0; padding-left: 18px; } .open-items li { margin: 3px 0; }

/* Order history */
.history { display: grid; }
.hist-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.hist-row:last-child { border-bottom: 0; }
.hist-row:hover { background: rgba(95,163,168,.05); }
.hr-img { width: 84px; height: 84px; border-radius: var(--r-sm); background: #f4f6f6; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hr-img img { width: 100%; height: 100%; object-fit: contain; }
.hr-img img.is-drawing { padding: 4px; }
.hr-noimg { color: #9aa; }
.hr-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hr-num { font: 600 1rem var(--f-num); letter-spacing: .04em; }
.hr-cust { margin-top: 3px; color: var(--soft); }
.hr-prod { font-size: .85rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-dates { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 22px; text-align: right; }
.hr-dates small { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.hr-dates span { font: 500 .88rem var(--f-num); }
.chip.st-shipped, .chip.st-closed { color: var(--green); border-color: rgba(52,195,143,.4); }
.chip.st-cancelled { color: var(--muted); text-decoration: line-through; }
.chip.st-released, .chip.st-in_production { color: var(--accent-hi); border-color: rgba(95,163,168,.45); }
@media (max-width: 700px) {
  .hist-row { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
  .hr-img { width: 64px; height: 64px; }
  .hr-dates { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); text-align: left; }
}

/* ================= v2 ================= */
.danger-text { color: #ff8a86 !important; }
input.bad { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(240,84,79,.18); }
.page-hint { margin: -10px 0 18px; max-width: 760px; }

/* top bar */
.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font: 700 .66rem var(--f-ui); font-style: normal; vertical-align: 1px; }
.me-btn { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--line2); border-radius: 999px; padding: 3px 12px 3px 3px; color: var(--soft); font: 500 .84rem var(--f-ui); cursor: pointer; }
.me-btn:hover { border-color: var(--accent); color: var(--text); }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #6fb3b8, #2f6a6e); color: #041012; font: 800 .82rem var(--f-head); text-transform: uppercase; flex: none; }
.avatar.lg { width: 38px; height: 38px; font-size: 1rem; }
.avatar.alt { background: linear-gradient(135deg, #3a4446, #1b2122); color: var(--soft); }
@media (max-width: 640px) { .me-name { display: none; } .me-btn { padding: 3px; } }

/* sign in */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; overflow: hidden; background: #040506; }
.lg-bg { position: absolute; inset: 0; pointer-events: none; }
.lg-bg i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; animation: drift 18s ease-in-out infinite alternate; }
.lg-bg .b1 { width: 520px; height: 520px; left: -120px; top: -140px; background: radial-gradient(circle, rgba(95,163,168,.55), transparent 65%); }
.lg-bg .b2 { width: 640px; height: 640px; right: -220px; bottom: -260px; background: radial-gradient(circle, rgba(66,175,209,.35), transparent 65%); animation-duration: 24s; }
.lg-bg .b3 { width: 340px; height: 340px; left: 55%; top: 12%; background: radial-gradient(circle, rgba(244,197,66,.12), transparent 65%); animation-duration: 30s; }
.lg-grid { position: absolute; inset: -2px; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%); }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.12); } }
.lg-card { position: relative; z-index: 1; width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 34px 30px 26px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(20,25,26,.82), rgba(10,12,13,.9)); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 40px 120px -30px rgba(0,0,0,.95), 0 0 0 1px rgba(95,163,168,.08) inset; animation: rise .7s cubic-bezier(.2,.8,.2,1) both; transition: transform .5s, opacity .5s, filter .5s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.lg-mark { position: relative; width: 78px; height: 78px; margin: 0 auto 4px; display: grid; place-items: center; }
.lg-mark img { width: 54px; height: 54px; position: relative; z-index: 1; }
.lg-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(124,192,196,.45); animation: pulse 3.2s ease-out infinite; }
.lg-ring.r2 { animation-delay: 1.6s; }
@keyframes pulse { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
.lg-title { text-align: center; }
.lg-title small { display: block; font: 600 .7rem var(--f-ui); letter-spacing: .32em; text-transform: uppercase; color: var(--accent-hi); }
.lg-title h1 { margin: 4px 0 0; font-size: 2.6rem; letter-spacing: .02em; background: linear-gradient(180deg, #fff, #9fb2b3); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-sub { text-align: center; margin: -6px 0 6px; color: var(--muted); font-size: .9rem; }
.lg-field { display: flex; flex-direction: column; gap: 6px; }
.lg-field span { font: 600 .68rem var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.lg-field input { height: 48px; font-size: 1rem; background: rgba(0,0,0,.35); border-color: rgba(255,255,255,.09); }
.lg-field.hidden { display: none; }
.lg-msg { min-height: 1.2em; margin: 0; color: #ff8a86; font-size: .86rem; text-align: center; }
.lg-btn { position: relative; height: 52px; border: 0; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden;
  font: 700 .9rem var(--f-head); font-stretch: 112%; letter-spacing: .16em; text-transform: uppercase; color: #041012; background: linear-gradient(180deg, #7cc0c4, #4f9297); box-shadow: 0 12px 30px -12px rgba(95,163,168,.8); }
.lg-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); transform: translateX(-100%); animation: sheen 3.6s ease-in-out infinite 1s; }
@keyframes sheen { 40%, 100% { transform: translateX(100%); } }
.lg-arrow { font-style: normal; transition: transform .2s; }
.lg-btn:hover .lg-arrow { transform: translateX(4px); }
.lg-btn:disabled { opacity: .7; cursor: progress; }
.busy .lg-arrow { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.lg-link { background: none; border: 0; color: var(--muted); font: 500 .84rem var(--f-ui); cursor: pointer; padding: 4px; }
.lg-link:hover { color: var(--accent-hi); }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.lg-welcome { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 6px; opacity: 0; pointer-events: none; transform: translateY(14px); transition: opacity .5s .25s, transform .5s .25s; }
.lg-welcome small { font: 600 .74rem var(--f-ui); letter-spacing: .3em; text-transform: uppercase; color: var(--accent-hi); }
.lg-welcome b { font: 800 3rem var(--f-head); font-stretch: 112%; }
.login.welcome .lg-card { opacity: 0; transform: scale(.94); filter: blur(6px); }
.login.welcome .lg-welcome { opacity: 1; transform: none; }
.lg-foot { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 16px; color: #56666a; font-size: .78rem; letter-spacing: .08em; }
.lg-lang { background: none; border: 1px solid #263032; color: var(--muted); border-radius: 999px; padding: 4px 10px; font: 600 .72rem var(--f-ui); cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .lg-bg i, .lg-ring, .lg-btn::after { animation: none; } }

/* scorecard */
.scorecard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.sc { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 14px 18px; border-radius: var(--r); background: linear-gradient(180deg, var(--panel), #0b0d0e); border: 1px solid var(--line); text-decoration: none; color: var(--text); min-height: 86px; }
.sc small { font: 600 .66rem var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.sc b { font: 600 1.9rem/1.1 var(--f-num); }
.sc span { font-size: .8rem; }
.sc.hot b { color: var(--red); }
.sc.link:hover { border-color: var(--line2); }
.ring-wrap { flex-direction: row; align-items: center; gap: 14px; }
.ring-wrap > div { display: flex; flex-direction: column; }
.ring { width: 52px; height: 52px; flex: none; }
.ring circle { fill: none; stroke-width: 5; }
.ring-bg { stroke: var(--line2); }
.ring-fg { stroke-linecap: round; transition: stroke-dasharray .8s; }
.ring-fg.good { stroke: var(--green); } .ring-fg.mid { stroke: var(--yellow); } .ring-fg.bad { stroke: var(--red); }
.tier-count.zero { opacity: .55; }
.tier-count.zero b { color: var(--muted); }
@media (max-width: 900px) { .scorecard { grid-template-columns: repeat(2, 1fr); } }

/* ship-date timeline */
.oc-tl { position: relative; z-index: 1; padding: 14px 20px 6px 28px; border-bottom: 1px solid var(--line); }
.wo-head .oc-tl { padding: 10px 0 4px; border: 0; }
.tl-track { position: relative; height: 10px; border-radius: 999px; background: #121617; overflow: visible; }
.tl .z { position: absolute; top: 0; bottom: 0; opacity: .34; }
.tl .z-g { background: var(--green); border-radius: 999px 0 0 999px; }
.tl .z-y { background: var(--yellow); }
.tl .z-r { background: var(--red); }
.tl .z-late { background: repeating-linear-gradient(135deg, rgba(255,23,68,.65) 0 4px, transparent 4px 8px); border-radius: 0 999px 999px 0; }
.tl-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, rgba(255,255,255,.0), rgba(255,255,255,.28)); box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset; }
.tl-due { position: absolute; top: -7px; bottom: -7px; width: 4px; margin-left: -2px; background: var(--ship); border-radius: 2px; box-shadow: 0 0 12px rgba(255,23,68,.9); }
.tl-now { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(0,0,0,.6), 0 0 14px rgba(255,255,255,.6); }
.tl-labels { position: relative; height: 20px; margin-top: 6px; font: 500 .7rem var(--f-num); color: var(--muted); }
.tl-l { position: absolute; top: 0; white-space: nowrap; }
.tl-l.now { transform: translateX(-50%); color: var(--soft); }
.tl-l.due { transform: translateX(-50%); color: #ff6b81; font-weight: 700; }
.tl-empty { display: flex; align-items: center; min-height: 30px; }
.t-late .tl-now { background: var(--ship); }

/* order card extras */
.cant-bar { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 20px 10px 28px; background: rgba(255,23,68,.1); border-bottom: 1px solid rgba(255,23,68,.35); font-size: .9rem; }
.wo-head .cant-bar { margin: 10px 0; border: 1px solid rgba(255,23,68,.35); border-radius: var(--r-sm); padding: 10px 14px; }
.cant-bar b { color: #ff6b81; font: 700 .74rem var(--f-head); font-stretch: 112%; letter-spacing: .12em; text-transform: uppercase; }
.chip.out { color: #c9a6ff; border-color: rgba(201,166,255,.45); }
.oc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.oc-foot { flex-wrap: wrap; }
.btn.toggle { gap: 10px; }
.btn.toggle .tg { position: relative; width: 30px; height: 18px; border-radius: 999px; background: var(--line2); transition: background .2s; flex: none; }
.btn.toggle .tg::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--soft); transition: transform .2s, background .2s; }
.btn.toggle.on { border-color: rgba(52,195,143,.6); color: var(--green); background: rgba(52,195,143,.1); }
.btn.toggle.on .tg { background: var(--green); }
.btn.toggle.on .tg::after { transform: translateX(12px); background: #04110b; }
.ship-btn { background: linear-gradient(180deg, #1d2a2b, #141c1d); border-color: rgba(95,163,168,.5); }
.ocard.is-ready { border-color: rgba(52,195,143,.35); }
.act-bar { padding: 12px 16px; }
.icon-btn.more { font-size: 1.2rem; line-height: 1; padding: 2px 8px; }
.oi-pencil { margin-left: auto; background: none; border: 1px solid transparent; color: var(--muted); border-radius: 7px; padding: 1px 7px; cursor: pointer; font-size: .85rem; }
.oi-pencil:hover { color: var(--accent-hi); border-color: var(--line2); }

/* pop menu */
.pop { position: absolute; z-index: 40; width: 240px; padding: 6px; border-radius: 12px; background: #111516; border: 1px solid var(--line2); box-shadow: 0 24px 60px -20px rgba(0,0,0,.95); animation: popin .14s ease-out; }
@keyframes popin { from { opacity: 0; transform: translateY(-4px); } }
.pop-item { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font: 500 .9rem var(--f-ui); padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.pop-item:hover { background: var(--panel3); }

/* weekly photos */
.wk { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 10px; border: 1px solid var(--line); }
.wk.ok { border-color: rgba(52,195,143,.35); } .wk.ok b { color: var(--green); }
.wk.due { border-color: rgba(244,197,66,.35); } .wk.due b { color: var(--yellow); }
.wk-thumb { position: relative; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 7px; overflow: hidden; cursor: pointer; background: #000; }
.wk-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wk-thumb span { position: absolute; right: 2px; bottom: 2px; background: rgba(0,0,0,.75); color: #fff; font: 700 .62rem var(--f-ui); border-radius: 4px; padding: 0 4px; }
.wk-text { display: flex; flex-direction: column; line-height: 1.2; }
.wk-text small { font: 600 .6rem var(--f-ui); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.wk-text b { font-size: .82rem; font-weight: 600; }
.gallery section + section { margin-top: 18px; }
.g-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.g-row figure { position: relative; margin: 0; }
.g-row img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.g-row figcaption { font-size: .74rem; color: var(--muted); margin-top: 4px; }
.g-row .icon-btn { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.7); }
.g-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.g-tile { position: relative; flex: none; width: 128px; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: #000; }
.g-tile img { display: block; width: 100%; height: 96px; object-fit: cover; }
.g-tile span { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.72); color: #fff; font: 600 .68rem var(--f-num); padding: 1px 6px; border-radius: 5px; }

/* shipped moment */
.celebrate { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: radial-gradient(circle at center, rgba(52,195,143,.18), rgba(3,4,5,.85) 60%); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadein .25s; transition: opacity .45s; }
.celebrate.out { opacity: 0; }
.celebrate.late { background: radial-gradient(circle at center, rgba(244,197,66,.16), rgba(3,4,5,.85) 60%); }
@keyframes fadein { from { opacity: 0; } }
.cb-card { display: flex; flex-direction: column; align-items: center; gap: 4px; animation: rise .5s cubic-bezier(.2,.8,.2,1); }
.cb-card small { font: 600 .78rem var(--f-ui); letter-spacing: .34em; text-transform: uppercase; color: var(--green); margin-top: 10px; }
.cb-card b { font: 800 2.8rem var(--f-head); font-stretch: 112%; }
.cb-card span { color: var(--soft); }
.cb-check { width: 96px; height: 96px; }
.cb-check circle { stroke: var(--green); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s ease-out forwards; }
.cb-check path { stroke: var(--green); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .35s .5s ease-out forwards; }
.celebrate.late .cb-check circle, .celebrate.late .cb-check path { stroke: var(--yellow); } .celebrate.late .cb-card small { color: var(--yellow); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.spark { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--green); opacity: 0; animation: burst .9s var(--delay) ease-out forwards; }
.spark:nth-child(3n) { background: var(--accent-hi); } .spark:nth-child(4n) { background: #fff; }
@keyframes burst { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d) - 60px)); } }
@media (prefers-reduced-motion: reduce) { .spark { display: none; } }

/* piece editor */
.modal.wide { width: min(860px, 100%); }
.modal-actions .grow { flex: 1; }
.pm-sec { margin: 18px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.pm-cur { min-height: 0; }
.pm-cur .thumb img { max-height: 90px; }
.pm-extra { display: flex; flex-direction: column; gap: 8px; }
.pm-xrow { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; }

/* estimates */
.est-group { margin-bottom: 26px; }
.est-group > .eyebrow { margin-bottom: 12px; }
.est { position: relative; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 20px; padding: 18px 20px 18px 26px; margin-bottom: 12px; border-radius: var(--r); background: linear-gradient(180deg, #0f1213, #0a0c0d); border: 1px solid var(--line); overflow: hidden; }
.est::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tier); box-shadow: 0 0 18px var(--tier); }
.est.st-answered { --tier: var(--accent-hi); }
.est.st-won { --tier: var(--green); } .est.st-lost, .est.st-cancelled { --tier: #4b5658; opacity: .75; }
.est-media { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.est-media img { width: 100%; height: 100%; object-fit: contain; }
.est-media.empty { background: #101415; color: var(--muted); font: 600 .7rem var(--f-ui); letter-spacing: .14em; text-transform: uppercase; }
.est-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.est-num { font: 600 .82rem var(--f-num); color: var(--accent-hi); }
.est h3 { margin: 6px 0 2px; font: 700 1.2rem var(--f-head); font-stretch: 112%; text-transform: none; letter-spacing: 0; color: var(--text); }
.est-flag { font: 700 .68rem var(--f-ui); letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.est-flag.f-late { background: var(--ship); color: #fff; } .est-flag.f-red { background: var(--red); color: #fff; } .est-flag.f-yellow { background: rgba(244,197,66,.16); color: var(--yellow); }
.est-desc { color: var(--soft); margin: 8px 0 0; white-space: pre-line; }
.est-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: .8rem; color: var(--muted); }
.est-meta a { color: var(--accent-hi); text-decoration: none; }
.est-answer { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 26px; margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: rgba(95,163,168,.07); border: 1px solid rgba(95,163,168,.25); }
.est-answer small { display: block; font: 600 .62rem var(--f-ui); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.est-answer b { font: 600 1.25rem var(--f-num); }
.est-answer p { flex-basis: 100%; margin: 0; color: var(--soft); white-space: pre-line; }
.est-btns { margin-top: 12px; }
.chip.est-st-requested { color: var(--yellow); border-color: rgba(244,197,66,.4); }
.chip.est-st-in_progress { color: var(--blue); border-color: rgba(66,175,209,.4); }
.chip.est-st-answered, .chip.est-st-won { color: var(--green); border-color: rgba(52,195,143,.4); }
@media (max-width: 640px) { .est { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: 14px 14px 14px 20px; } }

/* team */
.tm-list { display: flex; flex-direction: column; }
.tm-row { display: grid; grid-template-columns: auto minmax(160px, 1.4fr) auto minmax(120px, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.tm-row:last-child { border-bottom: 0; }
.tm-row.off { opacity: .5; }
.tm-main { display: flex; flex-direction: column; min-width: 0; }
.tm-main small { overflow: hidden; text-overflow: ellipsis; }
.tm-pw { font-size: .8rem; }
@media (max-width: 900px) { .tm-row { grid-template-columns: auto 1fr auto; } .tm-row > :nth-child(n+4):not(:last-child) { grid-column: 2 / 3; } }
.wa-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.wa-bubble { padding: 12px 14px; border-radius: 4px 14px 14px 14px; background: #0f2a22; border: 1px solid rgba(52,195,143,.3); }
.wa-bubble small { display: block; color: var(--green); font-size: .74rem; margin-bottom: 6px; }
.wa-bubble pre { margin: 0; white-space: pre-wrap; font: .86rem/1.45 var(--f-ui); color: #dfeee8; }
.ob-body { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.ob-sent { color: var(--green); } .chip.ob-failed { color: var(--red); } .chip.ob-not_connected, .chip.ob-no_phone { color: var(--muted); }
.chip.of-awarded { color: #c9a6ff; border-color: rgba(201,166,255,.45); } .chip.of-offered { color: var(--yellow); }
.tl-l.edge-l { transform: none; } .tl-l.edge-r { transform: translateX(-100%); }
.wk-text b { font-family: var(--f-ui); }

/* neuron swarm on the sign-in page */
.lg-neurons { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .95; transition: opacity 1s; }
.login .lg-card, .login .lg-welcome, .login .lg-foot { z-index: 2; }
.lg-sound { opacity: .8; }

/* work order quick view */
.wo-btn { border-color: rgba(110,220,235,.35); }
.wq { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: rgba(4,5,6,.94); backdrop-filter: blur(6px); }
.wq-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid rgba(255,255,255,.08); }
.wq-bar b { flex: 1; min-width: 0; font: 700 1rem var(--f-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wq-frame { flex: 1; width: 100%; border: 0; background: #fff; }

/* piece tools */
.oi-tools { margin-left: auto; display: inline-flex; gap: 2px; }
.oi-tools .oi-pencil { margin-left: 0; }
.oi-trash:hover { color: var(--red); }

/* undo and trash */
.undo-btn { background: transparent; border: 1px solid var(--line2); color: var(--ice); border-radius: 999px; padding: 6px 12px; font: 600 .8rem var(--f-ui); cursor: pointer; }
.undo-btn:hover { border-color: var(--accent); color: var(--accent-hi); }
.toast.has-act { display: flex; align-items: center; gap: 12px; }
.toast.has-act > span { flex: 1; }
.toast-act { background: var(--accent); color: #041012; border: 0; border-radius: 8px; padding: 7px 12px; font: 700 .82rem var(--f-ui); cursor: pointer; white-space: nowrap; }
.hist-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.hist { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.hist small { display: block; color: var(--muted); margin-top: 2px; }
.hist.undone { opacity: .55; }

/* work order view tabs, job tools */
.wq-tabs { display: inline-flex; gap: 4px; margin-left: 8px; }
.wq-tab { background: transparent; border: 1px solid var(--line2); color: var(--muted); border-radius: 999px; padding: 6px 12px; font: 600 .8rem var(--f-ui); cursor: pointer; }
.wq-tab.on { background: var(--accent); border-color: var(--accent); color: #041012; }
.tab-tools { display: inline-flex; gap: 4px; margin-left: auto; align-items: center; }
@media (max-width: 700px) { .wq-bar b { flex-basis: 100%; } .undo-btn { padding: 5px 9px; } }

/* catalog pickers */
.pf .grid + .btns, .pf-modes { margin-top: 8px; }
.pf select:disabled { opacity: .45; cursor: not-allowed; }
.pf input.pf-sku { background: #0f1415; color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; border-style: dashed; cursor: default; }
.pf .need, .pf select.need, .pf input.need { border-color: #e0524a; box-shadow: 0 0 0 3px rgba(224,82,74,.22); }
.pf-note { margin: 6px 0 0; }
.pf-mode { margin: 0 0 10px; }
.pf optgroup { color: var(--muted, #8a9597); font-style: normal; }
.pf optgroup option { color: var(--text); }
.pf select.wo { border-color: rgba(244,197,66,.55); color: #f4d27a; }
/* BOM per piece and total, comps */
.om-list li { grid-template-columns: 22px minmax(0,1fr) 76px 84px; }
.om-cols { display: grid; grid-template-columns: minmax(0,1fr) 76px 84px; gap: 8px; padding: 6px 14px 0 44px; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.om-cols span:nth-child(n+2) { text-align: right; }
.om-qty { text-align: right; }
.om-per { color: var(--muted); }
.om-note { display: block; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.om-basis { margin: 6px 14px 4px; font-size: .74rem; color: var(--muted); }
button.oi-draw { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.comps { display: grid; gap: 8px; }
.comp-link { display: flex; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 10px; color: var(--text); text-decoration: none; }
.comp-link:hover { border-color: var(--accent); }

/* photo follows color, Materials needed tools, Show the math, Current pricing */
.pf-photo { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.pf-photo img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line, #2a2a2a); background: #111; }
.pf-photo small { color: var(--muted, #9a9a9a); }
.oi-tag-photo { max-width: 100%; white-space: normal; font-size: 10px; line-height: 1.25; }
.om-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.seg-xs button { padding: 2px 8px; font-size: 11px; }
.om-tool { background: none; border: 1px solid var(--line, #2a2a2a); color: inherit; border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.om-tool:hover { border-color: var(--gold, #c9a45c); }
.mx-basis { margin: 0 0 12px; padding-left: 18px; color: var(--muted, #9a9a9a); font-size: 13px; }
.mx-card, .px-card { border: 1px solid var(--line, #2a2a2a); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.mx-card h4, .px-card h4 { margin: 0 0 6px; display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.mx-card h4 span, .px-card h4 span { color: var(--muted, #9a9a9a); font-weight: 500; }
.mx-steps { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.mx-ok { color: #7cc48a; font-size: 13px; margin: 6px 0 0; }
.mx-diff { color: #e3b35a; font-size: 13px; margin: 6px 0 0; }
.px-row { padding: 6px 0; border-top: 1px solid var(--line, #2a2a2a); display: grid; gap: 2px; }
.px-row:first-of-type { border-top: 0; }
.px-main { display: flex; justify-content: space-between; gap: 10px; }
.px-main a { color: inherit; }
.px-need { color: var(--gold, #c9a45c); }

/* Production timeline: a second full-width bar under the ship-date bar */
.ptl { padding: 12px 0 4px; }
.ptl-bar { position: relative; height: 10px; border-radius: 999px; background: #1a2123; box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset; }
.ptl-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, #3d7f85, var(--accent-hi)); box-shadow: 0 0 12px rgba(124,192,196,.35); transition: width .4s ease; }
.ptl-tick { position: absolute; top: 2px; bottom: 2px; width: 1px; background: rgba(255,255,255,.14); }
.ptl-tick.on { background: rgba(7,8,9,.45); }
.ptl-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; min-height: 28px; }
.ptl-label { font: 700 .66rem/1.2 var(--f-head); font-stretch: 112%; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); white-space: nowrap; }
.ptl-meta { font: 500 .74rem var(--f-num); color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptl-meta b { color: var(--accent-hi); font-weight: 700; }
.ptl-meta small { color: var(--muted); font-size: inherit; }
.ptl-row .grow { flex: 1; }
.ptl-btn { background: none; border: 1px solid var(--line2); color: var(--soft); border-radius: 999px; padding: 5px 12px; font: 600 .72rem var(--f-ui); cursor: pointer; white-space: nowrap; transition: border-color .15s, color .15s; }
.ptl-btn:hover { border-color: var(--accent); color: var(--accent-hi); }
@media (max-width: 640px) { .ptl-row { flex-wrap: wrap; gap: 4px 10px; } .ptl-meta { order: 3; width: 100%; } }

/* Production modal */
.pm-list { list-style: none; margin: 0; padding: 0; position: relative; }
.pm-top { display: flex; align-items: center; gap: 14px; }
.pm-top .ptl-bar { flex: 1; }
.pm-pct { font: 700 .9rem var(--f-num); color: var(--accent-hi); min-width: 3.2em; text-align: right; }
.pm-hint { margin: 8px 0 6px; }
.pm-list li { display: grid; grid-template-columns: 28px 1fr auto 40px 30px; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); min-height: 50px; }
.pm-list li:last-child { border-bottom: 0; }
.pm-check { position: relative; width: 22px; height: 22px; cursor: pointer; }
.pm-check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pm-check i { position: absolute; inset: 0; border: 1.5px solid var(--line2); border-radius: 6px; background: #121718; transition: background .15s, border-color .15s; pointer-events: none; }
.pm-check input:checked + i { background: var(--accent); border-color: var(--accent); }
.pm-check input:checked + i::after { content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px; border: solid #071012; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pm-check input:focus-visible + i { box-shadow: 0 0 0 3px rgba(124,192,196,.35); }
.pm-check input:hover:not(:disabled) + i { border-color: var(--accent); }
.pm-check input:disabled { cursor: default; } .pm-check input:disabled + i { opacity: .55; }
.pm-add { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line2); background: none; color: var(--soft); cursor: pointer; font-size: .9rem; line-height: 1; }
.pm-add:hover { border-color: var(--accent); color: var(--accent-hi); }
.pm-main { display: flex; flex-direction: column; min-width: 0; }
.pm-main b { font-weight: 600; font-size: .92rem; color: var(--soft); }
.pm-list li.done .pm-main b { color: var(--text); }
.pm-list li:not(.done) .pm-main b { color: var(--soft); font-weight: 500; }
.pm-main small { color: var(--muted); font-size: .75rem; }
.pm-gap { font: 500 .72rem var(--f-num); color: var(--soft); }
.pm-list li img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }

/* Photo picker: camera, file from computer, drag and drop */
.drop-zone { border: 2px dashed var(--line2); border-radius: var(--r-sm); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.drop-zone.over { border-color: var(--accent-hi); background: rgba(95,163,168,.08); }
.drop-zone.has { border-style: solid; border-color: var(--accent); }
.drop-zone .btns { display: flex; flex-wrap: wrap; gap: 6px; }
.drop-zone .btns .btn { flex: 1 1 10em; }
.drop-zone .preview img { max-width: 100%; max-height: 220px; border-radius: 6px; }
.pm-proc { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; }
.pm-proc b { font-size: .86rem; font-weight: 600; }
.pm-proc-sel { background: var(--panel2); color: var(--text); border: 1px solid var(--line2); border-radius: 8px; padding: 5px 8px; font: 500 .84rem var(--f-ui); }
.pm-opt { font-style: normal; font-weight: 400; font-size: .78rem; color: var(--muted); }
.pm-hint2 { color: var(--muted); opacity: .8; }


/* Send work order */
.sw { display: grid; gap: 12px; }
.sw-file { margin: 0; font-size: 15px; }
.sw-status { margin: 0; }
.sw-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-btns .btn { flex: 1 1 160px; justify-content: center; text-align: center; text-decoration: none; }
.wq ~ .modal-wrap { z-index: 95; } /* a modal opened from the work order view sits above it */
.om-note.om-dose { white-space: normal; color: var(--text-2, #c9c9c9); }
.om-note.om-dose a { color: var(--accent, #6fb6bb); text-decoration: none; white-space: nowrap; }

/* Training: "More info & video" on each checklist step */
.pm-info { align-self: flex-start; margin-top: 4px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: .72rem; letter-spacing: .01em; cursor: pointer; }
.pm-info:hover, .pm-info:focus-visible { color: var(--text); border-color: var(--muted); }
.tr { display: flex; flex-direction: column; gap: 14px; max-width: 880px; }
.tr-video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; }
.tr-note { margin: -6px 0 0; }
.tr-sec h4 { margin: 0 0 6px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tr-sec ul, .tr-sec ol { margin: 0; padding-left: 20px; display: grid; gap: 5px; font-size: .9rem; }
.tr-links { list-style: none; padding-left: 0 !important; }
.tr-links a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.tr-links a:hover { border-color: var(--text); }
.modal:has(.tr) { width: min(920px, 100%); }
/* Video link under each production step */
.pm-video { display: inline-block; margin-top: 4px; font-size: .78rem; color: var(--accent, #6fb6bb); text-decoration: none; }
.pm-video:hover, .pm-video:focus-visible { text-decoration: underline; }
/* Several photos in one upload */
.preview.preview-multi { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pv-item { position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: #000; }
.pv-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; font-size: 12px; }
.pv-count { width: 100%; }
/* Order photos on the card, between the pieces and the footer */
.oc-photos { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 22px 4px 28px; }
.oi-left { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.oi-left .oc-photos { padding: 0; gap: 8px; width: 148px; }
.oi-left .oc-ph { width: 70px; height: 70px; }
@media (max-width: 1100px) { .oi-left .oc-photos { width: 120px; } .oi-left .oc-ph { width: 56px; height: 56px; } }
@media (max-width: 640px) { .oi-left .oc-photos { width: 88px; gap: 6px; } .oi-left .oc-ph { width: 41px; height: 41px; } }
.oc-ph { width: 92px; height: 92px; padding: 0; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; background: #000; cursor: zoom-in; transition: border-color .15s, transform .1s; }
.oc-ph:hover, .oc-ph:focus-visible { border-color: var(--accent, #6fb6bb); }
.oc-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 640px) { .oc-photos { padding: 4px 14px 14px; gap: 8px; } .oc-ph { width: 72px; height: 72px; } }
/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 98; background: rgba(0,0,0,.94); display: grid; place-items: center; padding: 48px 56px 64px; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lb-bar { position: absolute; left: 16px; right: 16px; bottom: 12px; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.lb-cap { text-align: center; color: #cfcfcf; font-size: .85rem; }
.lb-del { padding: 6px 12px; font-size: .82rem; }
.lb-x { position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid #333; background: #111; color: #fff; font-size: 16px; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; font-size: 34px; cursor: pointer; }
.lb-prev { left: 8px; } .lb-next { right: 8px; }
@media (max-width: 640px) { .lb { padding: 56px 8px 72px; } .lb-nav { width: 36px; height: 52px; } }
/* 3D model */
@media (max-width: 640px) { .m3-stage { height: 52vh; } }

/* catalog CAD viewer */
.modal:has(.cad) { width: min(1100px, calc(100vw - 24px)); max-width: none; }
.cad-src { margin: 0 0 10px; color: var(--muted); }
.cad-src b { color: var(--text, #fff); }
.cad-view { max-height: min(68vh, 760px); overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.cad-img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.cad-view.zoom .cad-img { width: 250%; max-width: none; cursor: zoom-out; }
.cad-dl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.cad-dl .disabled { opacity: .5; cursor: default; }
.cad-note { margin-top: 12px; color: #f0b44c; font-size: .85rem; }

/* Plans page */
.pl-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 4px 0 18px; }
.pl-search { flex: 1 1 260px; min-width: 0; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel2, #111); color: var(--text); font: inherit; }
.pl-list { display: grid; gap: 16px; }
.pl-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: var(--panel, #0c0f10); }
.pl-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.pl-head h3 { margin: 0; font-size: 1.1rem; }
.pl-head small { color: var(--muted); }
.pl-hero { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line2); flex: none; }
.pl-group { margin-top: 10px; }
.pl-group > b { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.pl-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.pl-doc { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); font-size: .82rem; line-height: 1.25; }
.pl-doc img { width: 100%; aspect-ratio: 8.5 / 11; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line2); transition: border-color .15s; }
.pl-doc:hover img, .pl-doc:focus-visible img { border-color: var(--accent, #6fb6bb); }
.pl-doc span { overflow-wrap: anywhere; }
.pl-doc.off { cursor: default; opacity: .75; }
.pl-doc small { font-size: .68rem; }
.pl-ext { display: grid; place-items: center; aspect-ratio: 8.5 / 11; font: 700 .8rem var(--f-head); letter-spacing: .14em; background: repeating-linear-gradient(135deg, #0f1314 0 10px, #121718 10px 20px); border-radius: 8px; border: 1px solid var(--line2); color: var(--muted); }
.pl-dl { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) { .pl-card { padding: 12px; } .pl-docs { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); } }

/* Reference images (client photos to match), shown unaltered */
.oi-ref.has { color: var(--accent, #6fb6bb); font-weight: 600; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 10px 0 16px; }
.ref-grid figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ref-img { padding: 0; border: 1px solid var(--line2); border-radius: 8px; background: #000; cursor: zoom-in; aspect-ratio: 1; overflow: hidden; }
.ref-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ref-grid figcaption { font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; }
.ref-add { border-top: 1px solid var(--line2); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 640px) { .ref-grid { grid-template-columns: repeat(2, 1fr); } }
