:root { color-scheme: light; --p-bg: #f2f4f7; --p-paper: #fff; --p-soft: #f6f7f9; --p-ink: #202938; --p-muted: #657080; --p-line: #e2e6ec; --p-blue: #1768c6; --p-blue-ink: #fff; --p-tint: #eef5ff; --p-error: #ac2727; --p-select-color: #1768c6; --p-select-opacity: .3; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
* { box-sizing: border-box; }
body { margin: 0; color: var(--p-ink); background: var(--p-bg); font: 14px/1.55 "Segoe UI","Microsoft YaHei","PingFang SC",sans-serif; }
button,input,select { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,a:focus-visible { outline: 3px solid var(--p-blue); outline-offset: 3px; }
[hidden] { display: none !important; }
h1,h2,p { margin: 0; }
h1 { font-size: 19px; font-weight: 600; margin-bottom: 4px; }
h2 { font-size: 15px; font-weight: 600; }
#piece-mobile { width: 100%; max-width: 480px; min-height: 100vh; min-height: 100svh; margin: 0 auto; background: var(--p-paper); display: flex; flex-direction: column; }
main { flex: 1; min-width: 0; }
.p-topbar { display: flex; justify-content: space-between; align-items: center; min-height: 56px; padding: 6px 16px; background: var(--p-blue); color: var(--p-blue-ink); }
.p-topbar strong { font-size: 17px; font-weight: 600; }
.p-topbar button { border: 0; background: transparent; color: inherit; min-width: 0; max-width: calc(100% - 48px); min-height: 44px; padding: 5px 0 5px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-test-bar { display: flex; justify-content: space-between; gap: 12px; padding: 7px 16px; color: var(--p-muted); background: var(--p-soft); border-bottom: 1px solid var(--p-line); font-size: 11px; white-space: nowrap; }
.p-test-bar #connection-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.p-muted { color: var(--p-muted); }
.p-small { font-size: 12px; }
.p-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.p-button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--p-line); border-radius: 4px; color: var(--p-blue); background: var(--p-paper); }
.p-primary { background: var(--p-blue); color: var(--p-blue-ink); border-color: var(--p-blue); }
.p-full { width: 100%; margin-top: 20px; }
input,select { width: 100%; min-width: 0; min-height: 44px; padding: 9px 10px; color: var(--p-ink); background: var(--p-paper); border: 1px solid var(--p-line); border-radius: 4px; font-size: 16px; }
input[type=file] { padding: 7px; font-size: 16px; }
.p-field { display: grid; gap: 6px; margin-top: 16px; color: var(--p-muted); font-size: 12px; }
.p-lookup { padding: 16px; border-bottom: 8px solid var(--p-bg); }
.p-scan { width: 100%; min-height: 48px; font-size: 16px; }
.p-search-row { display: grid; grid-template-columns: minmax(0,1fr) 62px; gap: 10px; margin-top: 10px; }
.p-search-row input { font-family: Consolas,monospace; font-size: 16px; }
details { margin-top: 12px; }
summary { color: var(--p-muted); font-size: 12px; cursor: pointer; min-height: 28px; }
details .p-button { margin-top: 10px; }
details p { margin-top: 8px; }
.p-submit-options { margin-top: 16px; border-top: 1px solid var(--p-line); }
.p-submit-options > summary { min-height: 44px; padding: 10px 0; color: var(--p-blue); }
.p-message { margin-top: 10px; overflow-wrap: anywhere; color: var(--p-blue); font-size: 13px; white-space: pre-wrap; }
.p-message:empty { display: none; }
.p-message[data-error=true] { color: var(--p-error); }
.p-load-card { margin-top: 14px; padding: 14px; border: 1px solid #cfdef0; border-radius: 6px; background: #f7faff; }
.p-load-head { display: flex; align-items: center; gap: 10px; }
.p-load-icon { display: grid; flex: 0 0 32px; height: 32px; place-items: center; border-radius: 50%; color: var(--p-blue); background: #e6effb; font-size: 18px; }
.p-load-card[data-busy=true] .p-load-icon::after { content: ''; width: 14px; height: 14px; border: 2px solid #b4ccec; border-top-color: var(--p-blue); border-radius: 50%; animation: p-load-spin 1s linear infinite; }
.p-load-heading { flex: 1; min-width: 0; }
.p-load-heading strong { display: block; font-size: 14px; font-weight: 600; }
#load-summary { margin-top: 2px; color: var(--p-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.p-load-percent { flex-shrink: 0; color: var(--p-blue); font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; }
.p-load-percent small { margin-left: 1px; font-size: 12px; font-weight: 400; }
.p-load-track { height: 7px; margin-top: 13px; overflow: hidden; border-radius: 8px; background: #dfe9f6; }
.p-load-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--p-blue); transition: width .25s ease; }
.p-load-card[data-indeterminate=true] .p-load-fill { width: 32%; animation: p-load-slide 1.5s ease-in-out infinite alternate; }
.p-load-detail { margin-top: 9px; color: var(--p-muted); font-size: 12px; overflow-wrap: anywhere; }
.p-load-failures { margin: 12px 0 0; padding: 10px 10px 10px 24px; border-top: 1px solid var(--p-line); color: var(--p-error); font-size: 12px; overflow-wrap: anywhere; }
.p-load-failures li + li { margin-top: 6px; }
#retry-failed-files { display: block; margin: 4px 0 -6px auto; padding-inline: 0; }
@keyframes p-load-spin { to { transform: rotate(360deg); } }
@keyframes p-load-slide { to { transform: translateX(210%); } }
@media (prefers-reduced-motion:reduce) { .p-load-fill { transition: none; } .p-load-card[data-busy=true] .p-load-icon::after,.p-load-card[data-indeterminate=true] .p-load-fill { animation: none; } }
.p-search-results button { display: block; width: 100%; min-height: 44px; padding: 10px; text-align: left; margin-top: 8px; background: var(--p-soft); border: 1px solid var(--p-line); color: var(--p-ink); border-radius: 4px; overflow-wrap: anywhere; }
.p-panel-head { padding: 14px 16px; border-bottom: 1px solid var(--p-line); }
.p-code { font-family: Consolas,monospace; overflow-wrap: anywhere; margin: 7px 0; font-size: 13px; }
#workorder-dialog { padding: 16px; }
.p-workorder-list { margin: 12px 0 0; padding: 0; list-style: none; max-height: min(460px,55vh); max-height: min(460px,55dvh); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.p-workorder-list ul { margin: 0; padding: 0; list-style: none; }
.p-workorder-fabric + .p-workorder-fabric { margin-top: 16px; }
.p-workorder-fabric-title { margin: 0; padding: 8px; background: var(--p-tint); color: var(--p-blue); font-size: 15px; overflow-wrap: anywhere; }
.p-workorder-style-title { margin: 0; padding: 8px; background: var(--p-soft); font-size: 13px; overflow-wrap: anywhere; }
.p-workorder-list .p-workorder-items { padding-left: 8px; }
.p-workorder-item { border-bottom: 1px solid var(--p-line); }
.p-workorder-list button { display: block; width: 100%; min-height: 48px; padding: 12px 8px; text-align: left; border: 0; border-radius: 0; background: var(--p-paper); color: var(--p-blue); font: 16px/1.5 Consolas,monospace; white-space: normal; overflow-wrap: anywhere; }
.p-workorder-list button[aria-current=true] { background: var(--p-tint); }
.p-workorder-list button:disabled { opacity: .7; }
.p-workorder-code { display: block; }
.p-workorder-suborder { display: block; margin-top: 5px; color: var(--p-muted); font: 12px/1.5 "Segoe UI","Microsoft YaHei","PingFang SC",sans-serif; }
.p-workorder-sizes { display: grid; grid-template-columns: 64px minmax(0,1fr) 64px; gap: 8px; align-items: center; padding: 0 8px 12px; }
.p-workorder-sizes button { width: 100%; min-height: 44px; padding: 6px; border: 1px solid var(--p-line); border-radius: 4px; background: var(--p-soft); font: 14px/1.5 "Segoe UI","Microsoft YaHei","PingFang SC",sans-serif; text-align: center; touch-action: manipulation; }
.p-workorder-size-value { text-align: center; color: var(--p-muted); font-size: 12px; overflow-wrap: anywhere; }
.p-workorder-size-value [data-size-reset] { border: 0; background: transparent; font-size: 12px; }
.p-workorder-size-value small { display: block; }
.p-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 4px 16px; gap: 8px; font-size: 13px; }
.p-toolbar strong { font-weight: 500; }
.p-toolbar button,.p-text-button { min-height: 44px; padding: 6px 8px; border: 0; background: transparent; color: var(--p-blue); }
.p-view-switch,.p-periods { display: flex; gap: 0; }
.p-view-switch { margin: 0 16px 12px; border-bottom: 1px solid var(--p-line); }
.p-view-switch button,.p-periods button { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--p-muted); padding: 8px 12px; min-height: 44px; }
.p-view-switch button[aria-pressed=true],.p-periods button[aria-pressed=true] { border-bottom-color: var(--p-blue); color: var(--p-blue); }
[data-field=piece-board] { margin: 0 16px; }
.p-file-panel + .p-file-panel { border-top: 8px solid var(--p-bg); }
.p-file-panel { min-width: 0; }
.p-file-jumps { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; border-bottom: 1px solid var(--p-line); overscroll-behavior-x: contain; }
.p-file-jumps button { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; max-width: 220px; min-height: 44px; padding: 8px 12px; color: var(--p-ink); background: var(--p-soft); border: 1px solid var(--p-line); border-radius: 4px; }
.p-file-jumps button[data-selected=true] { color: var(--p-blue); border-color: #a8c8ed; background: var(--p-tint); }
.p-file-jumps span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-file-jumps small { color: var(--p-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.p-file-panel { scroll-margin-block: 12px; }
.p-file-quantities { padding: 0 16px 14px; }
.p-file-panel > [data-retry-file] { margin: 0 8px; }
.p-preview { position: relative; background: var(--p-soft); }
.p-preview > img { width: 100%; height: auto; display: block; }
.p-preview-scroll { overflow: auto; max-height: 65vh; max-height: 65dvh; overscroll-behavior: contain; }
.p-contours { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.p-shape { fill: transparent; stroke: transparent; stroke-width: 1; stroke-linejoin: round; stroke-linecap: round; pointer-events: fill; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.p-shape[aria-pressed=true] { stroke: var(--p-select-color); stroke-width: 2; fill: var(--p-select-color); fill-opacity: var(--p-select-opacity); }
.p-shape:focus-visible { outline: none; stroke: #e07714; stroke-width: 3; }
.p-shape[aria-pressed=true]:focus-visible { stroke: var(--p-select-color); }
.p-review-region { fill: #e0771420; stroke: #c66b0d; stroke-dasharray: 4 3; stroke-width: 1.5; }
.p-piece-label { position: absolute; transform: translate(-50%,-50%); padding: 0; border-radius: 1px; font: 10px/1.2 Consolas,monospace; background: var(--p-paper); color: var(--p-ink); white-space: nowrap; user-select: none; -webkit-user-select: none; }
.p-piece-label[data-selected=true] { background: var(--p-blue); color: var(--p-blue-ink); }
.p-zoom-tools output { display: inline-block; min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
.p-piece-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.p-source-name { overflow-wrap: anywhere; }
.p-file-list { max-height: 45vh; overflow: auto; margin-top: 6px; }
.p-file-option { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--p-line); cursor: pointer; }
.p-file-option input { flex: 0 0 22px; width: 22px; min-height: 22px; accent-color: var(--p-blue); }
.p-file-option span { min-width: 0; overflow-wrap: anywhere; }
.p-file-option strong { font-size: 13px; }
.p-file-option small { display: block; color: var(--p-muted); font-size: 11px; margin-top: 3px; }
.p-piece-card { min-width: 0; }
.p-piece { position: relative; display: grid; width: 100%; gap: 7px; justify-items: center; padding: 10px 8px; color: var(--p-muted); background: var(--p-soft); border: 1px solid var(--p-line); border-radius: 4px; min-width: 0; -webkit-tap-highlight-color: transparent; }
.p-card-quantity { width: 100%; min-height: 44px; border: 0; background: transparent; color: var(--p-blue); font-size: 12px; }
.p-piece img { width: 100%; height: 110px; object-fit: contain; }
.p-piece[aria-pressed=true] { border-color: var(--p-blue); color: var(--p-blue); }
.p-check { position: absolute; right: 8px; top: 8px; width: 20px; height: 20px; border: 1px solid var(--p-line); border-radius: 3px; color: transparent; background: var(--p-paper); text-align: center; line-height: 18px; }
.p-piece[aria-pressed=true] .p-check { color: var(--p-blue-ink); background: var(--p-blue); border-color: var(--p-blue); }
.p-piece small { color: var(--p-muted); font-size: 11px; }
.p-card-caption small { display: block; margin-top: 4px; }
.p-board-foot,.p-warnings { padding: 10px 16px 14px; margin: 0; font-size: 11px; color: var(--p-muted); }
.p-bottom-bar { position: sticky; bottom: 0; z-index: 5; flex-shrink: 0; background: var(--p-paper); border-top: 1px solid var(--p-line); box-shadow: 0 -3px 12px #20293808; }
.p-summary { padding: 12px 16px; background: var(--p-paper); max-height: 35vh; max-height: 35dvh; overflow-y: auto; }
.p-submit-row { display: grid; grid-template-columns: minmax(0,1fr) 104px; align-items: center; gap: 12px; }
.p-summary #selected-count { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.p-review-trigger { display: grid; gap: 3px; min-width: 0; min-height: 48px; padding: 4px 0; border: 0; background: transparent; color: var(--p-ink); text-align: left; }
.p-review-trigger > span { color: var(--p-blue); font-size: 12px; }
.p-undo-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 0; color: var(--p-muted); font-size: 12px; }
.p-undo-bar > span { min-width: 0; overflow-wrap: anywhere; }
.p-undo-bar button { flex-shrink: 0; }
.p-load-actions { display: flex; justify-content: flex-end; }
.p-selection-dialog { width: min(480px,calc(100vw - 16px)); max-height: 85vh; max-height: 85dvh; overflow: auto; overscroll-behavior: contain; }
.p-selection-dialog > .p-between { position: sticky; top: 0; z-index: 1; background: var(--p-paper); padding-bottom: 6px; }
#selection-summary { margin: 4px 0 16px; }
.p-review-file { margin: 16px 0; }
.p-review-file h3 { margin: 0; padding: 8px 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; border-bottom: 1px solid var(--p-line); }
.p-review-row { display: grid; grid-template-columns: 64px minmax(0,1fr); align-items: center; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--p-line); }
.p-review-row > img { width: 64px; height: 64px; object-fit: contain; background: var(--p-soft); border: 1px solid var(--p-line); border-radius: 4px; grid-row: span 2; }
.p-review-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.p-review-row-head strong { font: 13px Consolas,monospace; overflow-wrap: anywhere; }
.p-review-row .p-quantity-control { grid-template-columns: 44px minmax(46px,64px) 44px; }
.p-view-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.p-zoom-tools { flex-wrap: wrap; gap: 4px; }
.p-fullscreen-count { display: none; }
html.p-selecting-fullscreen { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.p-selecting-fullscreen { position: fixed; inset: 0; width: 100%; overflow: hidden; overscroll-behavior: none; }
#piece-panel.p-files-fullscreen { position: fixed; top: var(--p-fullscreen-top,0px); left: var(--p-fullscreen-left,0px); z-index: 20; display: flex; flex-direction: column; width: var(--p-fullscreen-width,100%); height: 100vh; height: var(--p-fullscreen-height,100dvh); padding: calc(env(safe-area-inset-top) + var(--p-fullscreen-header,52px)) 0 env(safe-area-inset-bottom); background: var(--p-paper); overflow: hidden; overscroll-behavior: contain; }
.p-files-fullscreen #file-panels { flex: 1 1 0; width: 100%; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y; }
.p-files-fullscreen #file-jumps { display: none; }
.p-files-fullscreen .p-file-panel { position: relative; display: flex; flex-direction: column; background: var(--p-paper); }
.p-files-fullscreen[data-fullscreen-files=single] #file-panels { display: flex; flex-direction: column; }
.p-files-fullscreen[data-fullscreen-files=single] .p-file-panel { flex: 1; min-height: 0; }
.p-files-fullscreen[data-fullscreen-files=single] .p-panel-head { display: none; }
.p-files-fullscreen .p-file-panel > .p-toolbar:not(.p-zoom-tools),.p-files-fullscreen .p-view-switch,.p-files-fullscreen .p-file-quantities { display: none; }
.p-files-fullscreen .p-zoom-tools { flex-shrink: 0; padding: 4px 8px; border-bottom: 1px solid var(--p-line); background: var(--p-paper); }
.p-files-fullscreen .p-file-panel:first-child .p-zoom-tools { position: fixed; top: calc(var(--p-fullscreen-top,0px) + env(safe-area-inset-top)); left: var(--p-fullscreen-left,0px); z-index: 4; width: var(--p-fullscreen-width,100%); min-height: 52px; }
.p-files-fullscreen [data-field=review-button] { display: none; }
.f-mobile .p-files-fullscreen [data-field=piece-board] { flex: 1; min-height: 0; margin: 0; overflow: auto; border: 0; border-radius: 0; }
.p-files-fullscreen .p-preview-scroll { display: flex; height: 100%; max-height: none; touch-action: pan-x pan-y; }
.p-files-fullscreen .p-preview { flex: none; margin: auto; }
.p-files-fullscreen[data-fullscreen-files=multi] #file-panels { display: flex; flex-direction: column; gap: 10px; }
.p-files-fullscreen[data-fullscreen-files=multi] .p-file-panel { flex: none; }
.p-files-fullscreen[data-fullscreen-files=multi] .p-file-panel:first-child { margin-top: auto; }
.p-files-fullscreen[data-fullscreen-files=multi] .p-file-panel:last-child { margin-bottom: auto; }
.p-files-fullscreen[data-fullscreen-files=multi] .p-file-panel + .p-file-panel { border: 0; }
.p-files-fullscreen[data-fullscreen-files=multi] .p-panel-head,.p-files-fullscreen[data-fullscreen-files=multi] .p-file-panel:not(:first-child) .p-zoom-tools,.p-files-fullscreen[data-fullscreen-files=multi] .p-file-panel:not(:first-child) .p-fullscreen-count { display: none; }
.f-mobile .p-files-fullscreen[data-fullscreen-files=multi] [data-field=piece-board] { flex: none; overflow: visible; }
.p-files-fullscreen[data-fullscreen-files=multi] .p-preview-scroll { display: block; height: auto; max-height: none; overflow: visible; }
.p-files-fullscreen[data-fullscreen-files=multi] .p-preview { margin: 0 auto; }
.p-files-fullscreen .p-fullscreen-count { display: none; }
.f-mobile .p-files-fullscreen #submit-dock { position: relative; z-index: 6; display: flex; flex-direction: column; flex: 0 1 auto; width: 100%; min-height: 0; max-height: 60%; margin: 0; padding: 8px 12px; overflow: hidden; }
.p-files-fullscreen .p-submit-row { flex-shrink: 0; }
.p-files-fullscreen .p-whole-controls { flex: 0 1 auto; min-height: 0; margin-top: 0; overflow: auto; overscroll-behavior: contain; }
.p-files-fullscreen .p-board-foot,.p-files-fullscreen .p-warnings { display: none; }
.p-files-fullscreen .p-piece-grid { padding: 8px; }
.p-whole-controls { margin-bottom: 6px; border-bottom: 1px solid var(--p-line); }
.p-whole-controls > summary { min-height: 44px; padding: 10px 0; color: var(--p-blue); cursor: pointer; touch-action: manipulation; }
.p-whole-controls > summary small { margin-left: 8px; color: var(--p-muted); font-size: 12px; }
.p-whole-list { max-height: 100px; max-height: min(160px,max(48px,calc(var(--p-fullscreen-height,100dvh) * .45 - 130px))); overflow-y: auto; overscroll-behavior: contain; }
.p-whole-row { padding: 6px 0; }
.p-whole-row + .p-whole-row { border-top: 1px solid var(--p-line); }
.p-whole-name { margin-bottom: 5px; color: var(--p-muted); font-size: 12px; overflow-wrap: anywhere; }
.p-whole-row-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.p-whole-label { display: grid; justify-items: start; }
.p-whole-label > button { min-height: 44px; padding: 5px 10px; border: 1px solid var(--p-line); border-radius: 4px; background: var(--p-paper); color: var(--p-blue); }
.p-whole-label > button[aria-pressed=true] { background: var(--p-tint); border-color: var(--p-blue); }
.p-whole-label > small { padding-top: 2px; color: var(--p-muted); font-size: 11px; }
.p-whole-controls[data-files=single] > summary,.p-whole-controls[data-files=single] .p-whole-name { display: none; }
.p-whole-controls[data-files=single] .p-whole-list { max-height: none; overflow: visible; }
.p-selected-list { margin-top: 14px; max-height: 300px; overflow-y: auto; border-top: 1px solid var(--p-line); }
.p-quantity-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--p-line); }
.p-quantity-row strong { font: 13px Consolas,monospace; overflow-wrap: anywhere; }
.p-quantity-control { display: grid; grid-template-columns: 44px 64px 44px; flex-shrink: 0; }
.p-quantity-control button { min-height: 44px; border: 1px solid var(--p-line); border-radius: 3px; color: var(--p-blue); background: var(--p-soft); font-size: 20px; touch-action: manipulation; }
.p-quantity-control input { text-align: center; border-radius: 0; padding: 8px 2px; font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield; }
.p-quantity-control input::-webkit-inner-spin-button,.p-quantity-control input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.p-quantity-editor { margin: 22px auto 14px; max-width: 100%; grid-template-columns: 48px minmax(60px,1fr) 48px; }
.p-summary > .p-small { margin-top: 8px; }
.p-download { display: inline-block; color: var(--p-blue); min-height: 44px; padding: 10px 0; text-decoration: underline; }
.p-empty { padding: 36px 18px; text-align: center; color: var(--p-muted); }
.p-nav { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--p-line); padding: 0 8px env(safe-area-inset-bottom); background: var(--p-paper); }
.p-nav button { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; min-height: 64px; font-size: 12px; border: 0; background: transparent; color: var(--p-muted); }
.p-nav button span { font-size: 20px; line-height: 23px; }
.p-nav button[aria-current=page] { color: var(--p-blue); }
.p-page { padding: 18px 14px 24px; }
.p-record-filters { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.p-record-filters input,.p-record-filters select { padding-inline: 7px; }
.p-record { margin-top: 12px; padding: 13px; border: 1px solid var(--p-line); border-radius: 5px; background: var(--p-paper); }
.p-record-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.p-record-time { color: var(--p-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.p-record-status { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border: 1px solid #cbd4df; border-radius: 999px; color: var(--p-muted); background: var(--p-soft); font-size: 11px; white-space: nowrap; }
.p-record-status[data-status=done] { border-color: #b8dfc6; color: #24733d; background: #f0faf3; }
.p-record-status[data-status=failed] { border-color: #e7bcbc; color: var(--p-error); background: #fff3f3; }
.p-record-status[data-status=running],.p-record-status[data-status=queued] { border-color: #b9d1ef; color: var(--p-blue); background: var(--p-tint); }
.p-record-status[data-status=ready],.p-record-status[data-status=batched],.p-record-status[data-status=partially_batched] { border-color: #d6c89b; color: #75601d; background: #fffaf0; }
.p-record-code { margin: 10px 0 5px; font: 11px/1.65 Consolas,monospace; overflow-wrap: anywhere; }
.p-record-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--p-muted); font-size: 11px; }
.p-record-fabric { color: var(--p-blue); }
.p-record-selection { display: flex; align-items: center; gap: 8px; margin-top: 10px; min-width: 0; }
.p-record-chips { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.p-record-chip { max-width: 120px; padding: 2px 6px; overflow: hidden; border: 1px solid var(--p-line); border-radius: 3px; background: var(--p-soft); color: var(--p-ink); font: 10px/1.5 Consolas,monospace; text-overflow: ellipsis; white-space: nowrap; }
.p-record-chip-more { color: var(--p-blue); }
.p-record-selection-label { flex: 0 0 auto; color: var(--p-muted); font-size: 10px; }
.p-record-next { display: flex; align-items: center; gap: 8px; margin: 11px -13px -13px; padding: 9px 13px; border-top: 1px solid var(--p-line); background: var(--p-soft); color: var(--p-muted); font-size: 11px; }
.p-record-progress { min-width: 0; overflow-wrap: anywhere; }
.p-record-next > .p-text-button { flex: 0 0 auto; min-height: 30px; margin-left: auto; padding: 2px 0 2px 8px; white-space: nowrap; }
.p-record-foot { margin-top: 0; }
.p-record[data-status=failed] .p-record-progress { color: var(--p-error); }
.p-record-preview { position: relative; background: white; }
.p-record-preview > img { display: block; width: 100%; height: auto; }
.p-record-preview svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.p-record-shape { fill: #1768c62c; stroke: var(--p-blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.p-record-pieces { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.p-record-pieces figure { margin: 0; min-width: 0; border: 1px solid var(--p-line); padding: 8px; }
.p-record-pieces img { display: block; width: 100%; height: 120px; object-fit: contain; background: white; }
.p-record-pieces figcaption { margin-top: 8px; overflow-wrap: anywhere; font-size: 13px; font-variant-numeric: tabular-nums; }
.p-ranking-head { margin: 18px 0 12px; }
.p-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.p-table th { background: var(--p-soft); font-size: 12px; font-weight: 500; color: var(--p-muted); }
.p-table td,.p-table th { padding: 16px 6px; border-bottom: 1px solid var(--p-line); text-align: left; }
.p-table td:nth-child(2) { overflow-wrap: anywhere; }
.p-table .p-number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-table tr[data-me=true] { background: var(--p-tint); }
.p-rule { margin-top: 18px; }
.p-test-bar a { color: var(--p-blue); }
dialog { color: var(--p-ink); background: var(--p-paper); width: min(400px,calc(100% - 28px)); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: auto; padding: 22px; border: 1px solid var(--p-line); border-radius: 6px; }
dialog::backdrop { background: #0007; }
#contour-dialog { width: min(760px,calc(100% - 20px)); padding: 14px; }
#contour-dialog .p-toolbar { padding-inline: 0; flex-wrap: wrap; }
#contour-dialog [aria-pressed=true] { color: var(--p-blue-ink); background: var(--p-blue); border-radius: 3px; }
.p-contour-scroll { max-height: 50vh; max-height: 50dvh; overflow: auto; border: 1px solid var(--p-line); overscroll-behavior: contain; background: repeating-conic-gradient(#eef1f5 0% 25%,#fff 0% 50%) 0 0/16px 16px; }
#contour-surface { margin-inline: auto; }
#contour-surface svg { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
#contour-surface.p-drawing { touch-action: none; cursor: crosshair; }
dialog > .p-muted { margin-top: 12px; }
.p-defs { display: grid; gap: 12px; margin: 18px 0; font-size: 13px; }
.p-defs > div { display: grid; grid-template-columns: 76px minmax(0,1fr); gap: 10px; }
.p-defs dt { color: var(--p-muted); }
.p-defs dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.p-actions,.p-scan-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.p-result-mark { width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 50%; background: var(--p-tint); color: var(--p-blue); font-size: 24px; line-height: 40px; text-align: center; }
.p-submit-result h2 { font-size: 18px; text-align: center; }
.p-result-summary { margin-top: 12px; font-size: 15px; text-align: center; }
.p-submit-result .p-actions button { flex: 1; }
#confirm-status:not(:empty) { padding: 10px; border: 1px solid var(--p-line); border-radius: 4px; background: var(--p-tint); }
#confirm-status[data-error=true] { background: #fff3f3; border-color: #e5baba; }
html.p-scanning,html.p-scanning body { overflow: hidden; }
#scan-dialog { position: fixed; inset: 0; margin: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; padding: 0; border: 0; border-radius: 0; overflow: hidden; color: #fff; background: #10151b; overscroll-behavior: contain; }
#scan-dialog[open] { display: flex; flex-direction: column; }
.p-scan-camera { position: absolute; inset: 0; }
#scan-video { display: block; width: 100%; height: 100%; object-fit: cover; }
.p-scan-header { position: relative; z-index: 1; flex-shrink: 0; padding: max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 8px max(16px,env(safe-area-inset-left)); background: #10151bbd; }
#scan-dialog .p-scan-header .p-text-button { color: #fff; }
.p-scan-guide { position: absolute; inset: 76px 16px 250px; display: grid; place-items: center; pointer-events: none; }
.p-scan-guide span { display: block; width: min(66vw,280px); max-height: 100%; aspect-ratio: 1; border: 2px solid #fff; border-radius: 4px; }
.p-scan-controls { position: relative; z-index: 1; margin-top: auto; padding: 12px max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); background: #10151bf2; }
#scan-dialog .p-message { margin-top: 0; color: #fff; min-height: 20px; }
#scan-dialog .p-message[data-error=true] { color: #ffb3b3; }
#scan-dialog .p-scan-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
#scan-dialog .p-button { min-width: 0; padding-inline: 8px; }
#scan-dialog .p-field { margin-top: 12px; color: #d5dbe2; }
#scan-dialog .p-search-row { margin-top: 6px; grid-template-columns: minmax(0,1fr) 64px; }
@media (orientation:landscape) and (max-height:500px) {
  .p-scan-header { padding-top: max(2px,env(safe-area-inset-top)); padding-bottom: 2px; }
  .p-scan-controls { padding-top: 8px; padding-bottom: max(8px,env(safe-area-inset-bottom)); }
  #scan-dialog .p-scan-actions { margin-top: 6px; }
  #scan-dialog .p-field { margin-top: 6px; }
  .p-scan-guide { inset: 52px 16px 192px; }
}
@media (pointer:coarse) { .p-search-row input { font-size: 16px; } summary { min-height: 44px; } }
@media (max-width:350px) { .p-test-bar { padding-inline: 12px; font-size: 11px; } .p-topbar { padding-inline: 12px; } .p-table td,.p-table th { padding-inline: 4px; font-size: 11px; } }
.p-workshop-person { padding: 12px; margin: 12px 0; border: 1px solid #d7e4f2; border-radius: 10px; background: #f5f9fe; }
.p-workshop-person .p-between { gap: 8px; }
.p-workshop-dialog { padding: 18px; }
.p-workshop-list { display: grid; gap: 8px; max-height: 52vh; max-height: 52dvh; overflow-y: auto; overscroll-behavior: contain; margin: 12px 0; }
.p-workshop-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 60px; padding: 12px; border: 1px solid var(--p-line); border-radius: 6px; background: var(--p-paper); color: var(--p-ink); text-align: left; font-size: 16px; cursor: pointer; }
.p-workshop-row span { min-width: 0; overflow-wrap: anywhere; }
.p-workshop-row small { display: block; color: var(--p-muted); font-size: 12px; margin-top: 3px; }
.p-workshop-row[aria-pressed=true] { border-color: var(--p-blue); background: #edf5ff; }
.p-workshop-row:disabled { opacity: .55; cursor: default; }
