* { box-sizing: border-box; }
:root {
    color-scheme: light;
    --ink: #182d28;
    --muted: #52665e;
    --primary: #09624e;
    --primary-dark: #103c32;
    --border: #d6e2dc;
    --surface: #fff;
    --paper: #eef3ef;
    --soft: #e5f3eb;
    --radius: 16px;
}
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.55 system-ui, "Microsoft YaHei", sans-serif;
}
[hidden] { display: none !important; }
.bom-source-title { font-size: 1.25rem; overflow-wrap: anywhere; }
.bom-tree, .bom-tree ul { list-style: none; padding: 0; margin: 0; }
.bom-tree { margin-bottom: 16px; }
.bom-tree ul { margin-inline-start: clamp(6px, 1.4vw, 18px); padding-inline-start: 10px; border-inline-start: 1px solid var(--border); }
.bom-node { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(80px,auto); gap: 10px; align-items: center; padding: 5px 10px; min-height: 46px; border-bottom: 1px solid #e4ece7; }
.bom-node:has(.bom-node-toggle) { background: #f0f6f2; border-radius: 6px; margin-top: 4px; }
.bom-node-name { display: grid; gap: 2px; overflow-wrap: anywhere; }
.bom-node > .bom-node-name { padding-inline-start: 19px; }
.bom-node-name small, .bom-node-qty { font-size: .82rem; color: #54675d; }
.bom-tree .bom-node-toggle { display: flex; align-items: center; gap: 9px; text-align: start; min-height: 40px; padding: 0; background: transparent; border: 0; color: var(--primary); }
.bom-node-toggle::before { content: ''; flex: none; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); }
.bom-node-toggle[aria-expanded="true"]::before { transform: rotate(45deg); }
.bom-tree-model { text-align: end; font-size: .82rem; }
.bom-tree-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.bom-tree-tools small { margin-inline-end: auto; }
.bom-tree-tools button, .bom-tree-model button { min-height: 36px; padding: 4px 9px; font-size: .85rem; }
.scene-model-picker {
    width: min(960px, calc(100% - 24px));
    max-height: 90vh;
    border: 1px solid #ccd9d4;
    border-radius: 12px;
    padding: 16px;
}
.scene-model-picker::backdrop { background: #102722ba; }
.scene-model-picker > .actions { justify-content: space-between; }
.scene-model-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; margin: 12px 0; }
.scene-model-results { display: grid; align-content: start; gap: 6px; max-height: 52vh; overflow: auto; }
.scene-model-results button { display: grid; gap: 3px; text-align: left; overflow-wrap: anywhere; }
.scene-model-results button[aria-pressed="true"] { background: #295b4b; color: #fff; }
.scene-model-picker .viewer-inline { height: clamp(260px, 52vh, 480px); margin: 0; }
@media (max-width: 620px) {
    .scene-model-grid { grid-template-columns: minmax(0, 1fr); }
    .scene-model-results { max-height: 24vh; }
}
#top {
    min-height: 64px;
    display: flex;
    align-items: center;
    padding: 10px max(20px, calc((100vw - 1240px) / 2));
    background: var(--primary-dark);
    color: #fff;
}
.brand {
    display: flex;
    align-items: center;
    margin-right: auto;
    white-space: nowrap;
    font-size: 21px;
    letter-spacing: .03em;
}
.brand-mark {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 11px;
    border: 2px solid #87dbb6;
    border-radius: 3px;
    transform: rotate(45deg);
}
#identity { margin-right: 14px; color: #dbf1e5; font-size: 14px; }
#top button {
    min-height: 36px;
    margin-left: 6px;
    padding: 6px 11px;
    background: transparent;
    border-color: #60887a;
    color: #fff;
    font-size: 14px;
}
#nav { background: #fff; border-bottom: 1px solid var(--border); }
#nav .nav-inner {
    display: flex;
    align-items: center;
    overflow: auto;
    max-width: 1280px;
    margin: auto;
    padding: 0 20px;
}
#nav button {
    flex: 0 0 auto;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    margin-right: 22px;
    min-height: 51px;
    padding: 3px 0 0;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
}
#nav button[aria-current="page"] { border-color: var(--primary); color: var(--primary); }
main { max-width: 1280px; margin: auto; padding: 29px 20px; }
h1, h2, h3, p { margin: 0 0 12px; }
h1 { font-size: 30px; line-height: 1.25; letter-spacing: -.02em; }
h2 { font-size: 21px; line-height: 1.3; }
h3 { font-size: 17px; }
small, .muted { color: var(--muted); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-head h1, .page-head p { margin: 0 0 4px; }
.page-head .actions { margin: 0; }
.plan-board { overflow: hidden; }
.plan-toolbar, .plan-period, .plan-order-block header {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.plan-toolbar { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.plan-switch { display: inline-flex; padding: 3px; background: var(--paper); border-radius: 10px; gap: 3px; }
.plan-switch button { border: 0; min-height: 38px; background: transparent; color: var(--muted); }
.plan-switch button[aria-pressed=true] { background: var(--primary-dark); color: white; }
.plan-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.plan-controls input { width: min(245px,100%); }
.plan-controls select { width: auto; }
.plan-period { padding: 18px 0; }
.plan-period h2 { margin: 0; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.plan-period button { min-width: 40px; padding: 4px 10px; }
.plan-scroll { overflow-x: auto; }
.plan-board .plan-week { width: 100%; min-width: 740px; table-layout: fixed; border-collapse: collapse; }
.plan-week th:first-child { width: 26%; text-align: left; }
.plan-week :is(th,td) { border: 1px solid var(--border); padding: 7px; text-align: center; }
.plan-week thead th { color: var(--muted); background: #f4f7f4; }
.plan-week thead [aria-current=date] { background: #d9eee2; color: var(--primary-dark); }
.plan-board small { display: block; font-size: .8rem; font-weight: 400; }
.plan-order { background: #f2f6f3; }
.plan-week tbody th { overflow-wrap: anywhere; }
.plan-deadline { display: inline-block; color: #814811; background: #fff0cf; border-radius: 4px; padding: 1px 7px; font-size: .82rem; font-weight: 650; }
.plan-board .plan-bar { width: 100%; min-height: 34px; padding: 3px; font-size: .88rem; background: #d4eade; border-color: #a5c9b4; color: #204b3c; }
.plan-board .plan-final { background: #d9e6f4; border-color: #a9c3df; color: #294a72; }
.plan-board .plan-name { background: transparent; border: 0; padding: 4px 0; min-height: 34px; text-align: left; color: var(--primary); }
.plan-name:hover { text-decoration: underline; }
.plan-order-block { margin-top: 16px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.plan-order-block header { padding: 12px 16px; background: #edf4ef; }
.plan-order-block > p { margin: 16px; }
.plan-empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 42px 12px; color: var(--muted); }
@media (max-width: 640px) {
    .plan-toolbar > .plan-controls { display: grid; width: 100%; grid-template-columns: 1fr 1fr; }
    .plan-toolbar input { grid-column: span 2; width: 100%; }
}
.card {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 14px;
}
.narrow { max-width: 570px; margin: 0 auto 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); grid-gap: 14px; }
label { display: block; color: #35504a; margin: 0 0 12px; font-size: 15px; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
    display: block;
    width: 100%;
    min-height: 44px;
    border: 1px solid #b7c8be;
    border-radius: 8px;
    padding: 9px 11px;
    background: #fff;
    color: var(--ink);
    font-size: 16px;
}
input[type=checkbox] { display: inline; width: auto; min-height: 0; margin-right: 7px; }
textarea { min-height: 96px; resize: vertical; }
button {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    min-height: 44px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 600;
}
button:disabled { opacity: .45; cursor: default; }
button[data-busy] { cursor: wait; opacity: .65; }
.secondary { background: #fff; color: var(--primary); border-color: #a9c6b7; }
.quiet { color: var(--primary); background: transparent; border-color: transparent; padding-left: 8px; padding-right: 8px; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
    outline: 3px solid #34a489;
    outline-offset: 2px;
}
.actions { display: flex; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }
.actions > * { margin: 3px 8px 3px 0; }
#project-create, #bom, .project-manager-create { align-items: flex-end; gap: 8px; }
:is(#project-create, #bom, .project-manager-create) > *, :is(#project-picker, #product-picker) label { margin: 0; }
#project-actions { gap: 8px; }
#project-actions > button { margin: 0; }
#project-actions:empty { display: none; }
.actions:last-child { margin-bottom: 0; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); grid-gap: 12px; margin-bottom: 14px; }
.stat {
    display: flex;
    height: 100%;
    min-height: 98px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 13px 17px;
    color: var(--ink);
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: left;
}
.stat strong { font-size: 28px; line-height: 1.18; }
.stat span { color: var(--muted); font-size: 14px; }
.stat[aria-pressed="true"] { background: var(--soft); border-color: #73b397; }
.table { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 11px 9px; border-bottom: 1px solid #e5ede8; vertical-align: middle; }
th { color: #425e54; font-size: 13px; font-weight: 650; background: #f4f7f4; white-space: nowrap; }
td .actions { margin: 0; }
td button { min-height: 38px; padding: 5px 9px; font-size: 14px; white-space: nowrap; }
td strong { display: inline-block; }
.code { font: 13px ui-monospace, monospace; overflow-wrap: anywhere; color: var(--muted); }
.pill {
    display: inline-block;
    border-radius: 5px;
    padding: 3px 8px;
    background: #e6ede9;
    color: #3c574c;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.pill[data-tone="active"] { color: #075d49; background: #daeee4; }
.pill[data-tone="good"] { color: #215536; background: #e1f0d9; }
.pill[data-tone="wait"] { color: #67440b; background: #f7ebcf; }
.pill[data-tone="bad"] { color: #8b3026; background: #f5e2de; }
.warning { color: #67440b; background: #fff4df; border: 1px solid #ead3a2; padding: 10px 12px; border-radius: 8px; }
.form-error { color: #852f28; margin-top: 3px; }
.filters { display: grid; grid-template-columns: minmax(180px,2fr) minmax(125px,1fr); grid-gap: 12px; margin: 0 0 8px; }
.empty { padding: 26px 12px; text-align: center; color: var(--muted); }
#notice { position: fixed; right: 20px; bottom: 15px; max-width: calc(100% - 40px); z-index: 3; }
#notice:not(:empty) { padding: 11px 14px; border-radius: 8px; background: var(--primary-dark); color: #fff; }
#notice[data-error="true"] { background: #842d2d; }
#overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2; background: #102722ba; padding: 12px; overflow: auto; }
.dialog { max-width: 750px; margin: 24px auto; }
.dialog header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.dialog header h2 { margin: 0 12px 0 0; }
.supply-picker-dialog { max-width: 920px; }
#supply-library-filter select { max-width: 240px; }
.supply-dialog {
    width: min(940px, calc(100% - 24px));
    max-height: calc(100% - 24px);
    padding: 20px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.supply-dialog::backdrop { background: #102722ba; }
.supply-dialog-narrow { width: min(580px, calc(100% - 24px)); }
.supply-dialog .page-head h2 { margin: 0; }
.supply-library-toolbar, .supply-category-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.supply-library-toolbar { justify-content: space-between; }
.supply-library-toolbar .actions, .supply-library-toolbar label, .supply-category-form label { margin: 0; }
.supply-category-form label { flex: 1 1 200px; }
.supply-category-form { margin-top: 12px; }
.supply-category-form input, .supply-category-form select, .supply-category-form button { height: 44px; }
.supply-category-form label:has(select) { flex-basis: 110px; }
.supply-picker-controls label { display: flex; align-items: center; margin: 0; }
.supply-picker-results { min-height: 104px; margin-block: 12px; }
.supply-picker-results .table { max-height: min(48vh, 480px); border: 1px solid var(--border); border-radius: 8px; }
.supply-picker-results th { position: sticky; top: 0; }
.supply-picker-results td label { margin: 0; color: var(--ink); cursor: pointer; overflow-wrap: anywhere; }
.supply-picker-results td:first-child { width: 1%; text-align: center; }
.supply-picker-results input[type=checkbox] { margin: 0; accent-color: var(--primary); }
.supply-picker-results tr:has(input:checked) td { background: var(--soft); }
.supply-picker-footer { justify-content: space-between; margin-bottom: 0; }
@media(max-width: 480px) {
    .supply-picker .filters { grid-template-columns: minmax(0,1fr); gap: 0; }
}
.label { display: inline-flex; align-items: center; padding: 18px; background: #fff; color: #000; max-width: 100%; border: 1px solid #383838; }
.label img { max-width: 132px; width: 36%; margin-right: 12px; }
.label strong { display: block; }
.login-wrap { max-width: 440px; margin: 28px auto; }
.login-wrap h1 { margin-bottom: 7px; }
.login-wrap .muted { margin-bottom: 22px; }
.login-wrap form { margin-bottom: 0; }
.login-wrap button[type="submit"] { width: 100%; margin-top: 5px; }
.scan-hero { max-width: 690px; margin: 22px auto; padding: 28px; }
.scan-hero .primary-scan { display: block; width: 100%; min-height: 62px; font-size: 20px; margin: 19px 0 10px; }
details summary { cursor: pointer; font-weight: 600; color: var(--primary); padding: 8px 0; }
.manual-form { margin-top: 6px; }
.task-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.task-bar .actions { margin: 0; }
.task-heading { display: flex; flex-wrap: wrap; align-items: baseline; margin-bottom: 5px; }
.task-heading h1 { margin: 0 9px 6px 0; }
.task-meta { margin-bottom: 13px; }
.work-layout { display: grid; grid-template-columns: 255px minmax(0,1fr); grid-gap: 14px; align-items: start; }
.step-list h2 { margin-bottom: 6px; }
.step-list button {
    display: flex;
    align-items: flex-start;
    width: 100%;
    margin: 6px 0 0;
    color: var(--ink);
    background: #f5f7f5;
    border-color: transparent;
    text-align: left;
    font-weight: 500;
}
.step-list button[aria-current="step"] { background: var(--soft); border-color: #86b9a3; }
.step-index { min-width: 26px; font-weight: 700; color: var(--primary); }
.step-entry { min-width: 0; }
.step-entry small { display: block; }
.step-copy { white-space: pre-wrap; font-size: 17px; }
.guide-image { max-width: 100%; max-height: 38vh; }
.main-step { touch-action: pan-y; }
.step-kicker { color: var(--primary); font-size: 14px; font-weight: 650; margin-bottom: 7px; }
.step-title { font-size: 27px; margin-bottom: 8px; }
.step-actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.step-actions .primary-scan { min-width: 150px; }
.progress { display: block; width: 100%; height: 10px; margin: 7px 0 10px; accent-color: var(--primary); }
.scan-result { display: block; margin: 4px 0 8px; }
.viewer { max-width: 1000px; height: calc(100% - 16px); min-height: 280px; display: flex; flex-direction: column; margin: auto; color: #f3faf7; background: #102722; padding: 12px; border-radius: 12px; }
.viewer-stage { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; border-radius: 10px; background: #19352e; overflow: hidden; margin: 6px 0; }
.viewer-canvas { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; }
.viewer-canvas canvas { position: absolute; top: 0; left: 0; display: block; touch-action: none; }
.viewer-timeline { display: flex; align-items: center; gap: 12px; }
.viewer-timeline input { flex: 1; min-width: 0; min-height: 32px; padding: 0; accent-color: #73b397; cursor: pointer; }
.viewer-timeline span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.viewer-axis-label { position: absolute; z-index: 2; transform: translate(-50%,-50%); pointer-events: none; padding: 2px 6px; border-radius: 4px; font-weight: 700; background: #102a24; }
.viewer-axis-label.active { outline: 2px solid currentColor; }
.viewer-canvas p { margin: 18px; }
.viewer-motion-note {
    position: absolute; width: max-content; max-width: 48%; max-height: 24%;
    transform: translate(-50%,calc(-100% - 8px)); overflow: auto;
    padding: 6px 10px; border-radius: 8px; background: #102722ee; color: #fff;
    overflow-wrap: anywhere; pointer-events: none;
}
.pose-properties input[data-motion-note] { width: min(360px,65vw); }
.viewer-glue-note { white-space: pre-wrap; transform: translateY(-50%); }
.viewer-adhesive-card {
    position: absolute; right: 10px; bottom: 10px; width: clamp(92px,25%,152px);
    height: clamp(70px,44%,152px); display: flex; align-items: end;
    outline: 1px solid #71958a; border-radius: 6px; overflow: hidden;
    pointer-events: none;
}
.viewer-adhesive-card span {
    width: 100%; padding: 3px 5px; background: #102722; color: #fff;
    font-size: 12px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pose-tools [data-glue] summary { color: inherit; }
.pose-tools [data-glue] .actions { align-items: end; }
.pose-tools [data-glue-pick][aria-pressed="true"] { background: #ffda88; color: #1b322a; }
.viewer-instruction {
    flex: 0 0 auto; max-height: 35%; overflow: auto; padding: 9px 14px;
    border-top: 1px solid #49655b; background: #142b25; color: #f3faf7;
    line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.viewer-instruction:focus-visible { outline: 2px solid #a7d7c4; outline-offset: -2px; }
.viewer .actions { margin: 0; }
.viewer .actions span { margin-left: auto; }
.viewer-inline { height: clamp(330px, 62vh, 620px); max-width: none; margin-top: 12px; }
.scene-editor { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }
.scene-editor h4 { margin: 0 0 8px; }
.scene-objects { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.scene-object { position: relative; display: inline-flex; max-width: 100%; }
.scene-object-dragging { opacity: .3; }
.scene-object-ghost {
    position: fixed; z-index: 6; pointer-events: none; padding: 9px 12px;
    border-radius: 8px; background: #ffda88; color: #1b322a; font-weight: 650;
    box-shadow: 0 5px 16px #10272255; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scene-objects:has(.scene-object:nth-child(2)) [data-select-object] {
    cursor: grab; touch-action: none; user-select: none;
}
.scene-object [data-select-object] {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    border-radius: 8px 0 0 8px;
}
.scene-object [data-select-object][aria-pressed="true"] {
    background: var(--primary); color: #fff; border-color: var(--primary);
}
.scene-object .scene-object-delete {
    min-width: 44px; margin-left: -1px; padding: 0 8px; border-radius: 0 8px 8px 0; font-size: 22px;
}
.scene-object-tools { align-items: end; }
.scene-object-tools label { min-width: 0; max-width: 100%; }
.viewer-pose-editor { height: auto; }
.viewer-pose-editor .viewer-stage { flex: none; height: clamp(280px, 52vh, 520px); }
.viewer-expanded { position: fixed; inset: 0; z-index: 4; }
html:has(.viewer-expanded) { overflow: hidden; }
:is(.viewer,.scene-editor):is(:fullscreen,.viewer-expanded) {
    width: 100%; height: 100%; max-width: none; margin: 0; border-radius: 0;
}
.scene-editor:is(:fullscreen,.viewer-expanded) {
    display: flex; flex-direction: column; overflow: auto; padding: 12px; border: 0;
    color: #f3faf7; background: #102722;
}
.scene-editor:is(:fullscreen,.viewer-expanded) .scene-object-tools label { color: inherit; }
.scene-editor:is(:fullscreen,.viewer-expanded) .scene-preview { display: flex; flex: 1 0 330px; }
.scene-editor:is(:fullscreen,.viewer-expanded) .viewer {
    width: 100%; height: auto; margin: 0; padding-inline: 0;
}
.scene-editor:is(:fullscreen,.viewer-expanded) .viewer-stage { flex: 1 1 0; height: auto; }
.scene-editor:is(:fullscreen,.viewer-expanded):has(.viewer-header) { padding-top: 72px; }
.scene-editor:is(:fullscreen,.viewer-expanded) .viewer-header {
    position: fixed; z-index: 1; top: 0; left: 0; right: 0;
    justify-content: flex-end; padding: 8px 12px; background: #102722;
}
.scene-editor:is(:fullscreen,.viewer-expanded) .viewer-header strong { margin-right: auto; }
@media(max-width: 640px) {
    .scene-editor:is(:fullscreen,.viewer-expanded):has(.viewer-header) { padding-top: 12px; }
    .scene-editor:is(:fullscreen,.viewer-expanded) .viewer-header { position: static; padding: 0; }
}
.viewer .pose-tools { margin-bottom: 8px; }
.pose-tools .stage-tabs > button { width: 145px; max-width: 100%; }
.pose-tools .pose-modes { align-items: end; }
.pose-tools button[data-last-saved],
.pose-tools button[data-view-pose][aria-pressed="true"],
.pose-tools .stage-tabs button[data-pose-mode][aria-pressed="true"] {
    background: #ffda88;
    color: #1b322a;
    border-color: #ffda88;
    box-shadow: inset 0 0 0 2px #102722;
}
.pose-tools label { color: inherit; margin: 0; }
.pose-tools [data-angle-field] { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; margin: 3px 8px 3px 0; }
.pose-tools input[data-pose-angle] { width: 100px; }
.pose-tools input[type="range"] { min-height: 28px; padding: 0; accent-color: #73b397; }
.pose-properties { gap: 16px; }
@media(max-width: 740px) {
    main { padding: 17px 12px; }
    #top { padding: 8px 12px; }
    #identity { margin-right: 0; font-size: 12px; }
    #nav .nav-inner { padding: 0 12px; }
    #nav button { margin-right: 17px; min-height: 47px; }
    .card, .scan-hero { padding: 14px; }
    .work-layout { display: flex; flex-direction: column-reverse; }
    .work-layout > * { width: 100%; }
    .grid { display: block; }
    .page-head { margin-bottom: 14px; }
    .summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); grid-gap: 8px; }
    .stat { min-height: 75px; padding: 8px 12px; }
    .filters { grid-template-columns: minmax(115px,2fr) minmax(95px,1fr); grid-gap: 8px; }
    .brand-mark { display: none; }
}
@media print {
    @page { margin: 0; }
    body { background: #fff; }
    body > * { display: none !important; }
    body #overlay:not([hidden]) { display: block !important; position: static; padding: 0; background: #fff; overflow: visible; }
    #overlay .dialog { padding: 0; margin: 0; border: 0; }
    #overlay .dialog > :not(.label) { display: none !important; }
    #overlay .label { display: flex; width: 100%; border: 0; padding: 2mm; font-size: 9pt; line-height: 1.2; break-inside: avoid; }
    #overlay .label img { width: 17mm; max-width: 38%; margin-right: 1.5mm; }
    #overlay .label .code { font-size: 7pt; }
}
#top { padding-left: 20px; padding-right: 20px; }
@media(min-width:1280px) { #top { padding-left: calc((100vw - 1240px)/2); padding-right: calc((100vw - 1240px)/2); } }
@media(max-width:740px) { #top { padding-left: 12px; padding-right: 12px; } }
.progress::-webkit-progress-bar { background: #e5eee8; border-radius: 8px; }
.progress::-webkit-progress-value { background: var(--primary); border-radius: 8px; }
.queue-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow: auto; }
.queue-list li { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.queue-list button { margin-left: 12px; }
.qc-workspace { align-items: start; }
.stage-tabs button[aria-pressed="true"] { color: #fff; background: var(--primary); border-color: var(--primary); }
.editable-step-tabs button { cursor: grab; touch-action: none; user-select: none; }
.editable-step-tabs .step-tab-dragging { cursor: grabbing; opacity: .65; }
.bom-workspace { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(0, 3fr); gap: 16px; }
.bom-entry { display: block; width: 100%; margin-bottom: 6px; text-align: left; overflow-wrap: anywhere; }
.bom-entry small { display: block; }
.bom-entry[aria-pressed="true"] { color: #fff; background: var(--primary); }
@media(max-width: 760px) { .bom-workspace { grid-template-columns: minmax(0, 1fr); } }
#materials-list { max-height: 325px; overflow: auto; }
#bom-scope { min-width: 0; }
#bom-scope select { max-width: min(28rem, 100%); }
#material-version { flex: 0 1 420px; min-width: 0; margin: 0; }
#material-summary:not(:empty) {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px;
    margin-bottom: 12px; padding: 10px 12px; border-radius: 8px; background: #f1f6f3;
}
#material-summary label { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 0 auto; }
#material-summary input { width: auto; min-height: 0; margin: 0; }
.step-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.step-header .actions { margin-bottom: 0; }
.step-header .actions > * { margin: 5px 0 5px 8px; }
.step-header .primary-scan { min-width: 150px; min-height: 49px; }
.task-bar .task-heading { margin: 0 8px 0 0; }
@media(max-width:740px) {
    .step-header .actions > * { margin: 5px 8px 5px 0; }
}
