/* Presentation layer only: existing data and task handlers remain authoritative. */
:root {
  --navy: #102c50;
  --navy-hover: #1b416d;
  --red: #bc2031;
  --border: #dce4ec;
  --muted: #566b84;
  --surface: #f3f6f9;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #122a48;
  background: var(--surface);
  font-size: 15px;
  line-height: 1.55;
}
body { min-width: 320px; }
button, input, select { font: inherit; }
button, .button-link { min-height: 46px; border-radius: 8px; font-weight: 600; transition: background-color .15s, border-color .15s, color .15s; }
button { color: var(--navy); background: #edf2f7; }
button:hover:not(:disabled), .button-link:hover { background: #e0e9f2; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #a8c6eb; outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .5; }
button[aria-busy="true"] { cursor: progress; }
input { min-width: 0; min-height: 46px; padding: 10px 13px; border-color: #cdd9e5; border-radius: 8px; }
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--navy); width: 19px; height: 19px; flex: 0 0 19px; }
input[type="file"] { font-size: 14px; overflow: hidden; }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 6px 10px; color: var(--navy); background: #edf2f7; border: 0; border-radius: 5px; cursor: pointer; }
label { color: #455c77; font-size: 14px; }
.primary, .button-link.primary { color: #fff; background: var(--red); }
.primary:hover:not(:disabled), .button-link.primary:hover { color: #fff; background: #a81b2a; }
.secondary, .upload-form>button, .task-upload>button, #sample-preflight-button { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.secondary:hover:not(:disabled), .upload-form>button:hover:not(:disabled), .task-upload>button:hover:not(:disabled), #sample-preflight-button:hover:not(:disabled) { background: #eef4fa; }
.topbar { min-height: 80px; align-items: center; gap: 24px; padding: 14px max(24px, calc((100vw - 1360px) / 2)); background: var(--navy); }
.topbar .eyebrow { display: block; font-size: 10px; letter-spacing: .19em; margin-bottom: 3px; opacity: .78; }
.topbar h1 { font-size: 31px; line-height: 1.2; letter-spacing: -.025em; font-weight: 650; }
.brand { display: flex; min-width: 0; align-items: center; gap: 12px; }
.brand-mark { display: block; width: 34px; height: 34px; flex: 0 0 34px; color: #fff; }
.brand-mark svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.account { font-size: 15px; gap: 15px; flex-shrink: 0; }
.account .ghost { min-height: 42px; padding: 8px 19px; color: #fff; background: #ffffff20; }
.account .ghost:hover { background: #ffffff30; }
main { width: min(1360px, calc(100% - 48px)); margin: 0 auto 44px; }
.tabs { position: relative; isolation: isolate; display: flex; align-items: stretch; gap: 30px; margin: 0 0 20px; border-bottom: 1px solid var(--border); background: #fff; }
.tabs::before { content: ""; position: absolute; z-index: -1; inset: 0; left: 50%; width: 100vw; transform: translateX(-50%); background: #fff; border-bottom: 1px solid var(--border); }
.tabs button { position: relative; min-width: 112px; min-height: 55px; padding: 12px 11px 12px 0; border-radius: 0; color: #455c77; background: transparent; font-size: 16px; font-weight: 500; white-space: nowrap; }
.tabs .nav-icon { width: 17px; height: 17px; margin-right: 8px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs button:hover:not(:disabled) { background: #f4f7fb; color: var(--navy); }
.tabs button.active { color: var(--navy); background: transparent; font-weight: 700; }
.tabs button.active::after { content: ""; height: 3px; position: absolute; bottom: -1px; left: 0; right: 0; background: var(--navy); }
.tabs button:focus:not(:focus-visible), .return-tabs button:focus:not(:focus-visible), #data-management:focus:not(:focus-visible) { outline: none; }
.tabs button:focus-visible, .return-tabs button:focus-visible { outline: 2px solid #799fc9; outline-offset: -5px; }
.search-shell, .panel, .metric, .notice { border-color: var(--border); border-radius: 11px; box-shadow: none; }
.search-shell { grid-template-columns: auto minmax(0, 1fr); gap: 24px; padding: 16px 22px 12px; margin-bottom: 18px; align-items: start; }
.search-intro { padding-top: 8px; }
.search-intro h2 { margin: 0; font-size: 22px; line-height: 1.35; white-space: nowrap; color: #0c2649; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 12px; align-items: stretch; }
.search-row input { width: 100%; min-width: 0; }
.search-row button { white-space: nowrap; color: #fff; background: var(--navy); padding: 8px 20px; }
.search-row button:hover:not(:disabled) { background: var(--navy-hover); }
.search-help { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.search-assist { top: 50px; padding: 8px; border-color: var(--border); max-height: min(320px, 44dvh); overflow-y: auto; overscroll-behavior: contain; }
.search-assist button { min-height: 44px; }
.search-assist button strong, .search-assist button span { overflow-wrap: anywhere; white-space: normal; overflow: visible; }
.search-assist button span { font-size: 13px; }
.view, #search-view, .panel-grid, .task-layout, .panel, .metrics, .metric, .task-detail, .task-result, .task-result-slot, .task-upload-result { min-width: 0; }
.return-tabs { display: flex; gap: 5px; width: fit-content; max-width: 100%; margin: 0 0 16px; padding: 5px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.return-tabs button { min-width: 130px; min-height: 42px; padding: 8px 18px; background: transparent; color: #455c77; }
.return-tabs button[aria-selected="true"] { background: var(--navy); color: #fff; }
.return-view > .module-heading { margin: 0 0 16px; }
.mobile-source-list { display: none; }
#app.is-search-page > footer { display: none; }
#search-empty { padding: 42px 16px 46px; margin: 24px auto 0; text-align: center; color: var(--muted); }
#search-empty .search-empty-icon { display: block; width: 42px; height: 42px; margin: 0 auto 15px; color: #5d7898; }
#search-empty h2 { margin: 0 0 7px; color: #243e5d; font-size: 20px; font-weight: 600; }
#search-empty > p { margin: 0; font-size: 14px; line-height: 1.6; }
#search-empty .search-empty-versions { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px 24px; margin-top: 23px; font-size: 13px; }
#search-empty .search-empty-versions span { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
#search-empty .search-empty-versions strong { color: #395777; font-weight: 500; }
#search-page.has-search-result .search-shell { position: sticky; top: 0; z-index: 15; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 14px; padding: 10px 14px; margin-bottom: 10px; }
#search-page.has-search-result .search-intro { padding: 0; }
#search-page.has-search-result .search-intro h2 { font-size: 18px; }
#search-page.has-search-result .search-help { display: none; }
#search-page.has-search-result .search-assist { top: calc(100% + 6px); }
#search-page.has-search-result .product-head { scroll-margin-top: 80px; }
.view>.module-heading { margin: 20px 0 16px; }
.module-heading h2 { margin: 0 0 4px; color: #0c2649; font-size: 25px; line-height: 1.3; }
.module-heading p { margin: 0; font-size: 15px; color: var(--muted); }
.panel { padding: 22px; margin-top: 18px; }
.panel-grid, .task-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.panel-grid>.panel, .task-layout>.panel { margin-top: 0; }
.panel-title { gap: 12px; align-items: flex-start; margin-bottom: 16px; padding-bottom: 13px; }
.panel-title>div { min-width: 0; }
.panel-title h2 { margin-bottom: 5px; font-size: 19px; line-height: 1.4; overflow-wrap: anywhere; }
.panel-title span, .muted, small, .search-shell p { font-size: 13px; color: var(--muted); }
.panel-title span { display: block; }
.module-overview { margin-top: 0; margin-bottom: 16px; padding: 14px 18px; }
.module-overview .module-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.module-overview .module-heading h2 { margin: 0; font-size: 23px; }
.module-overview .module-heading p { font-size: 14px; }
.metrics, .compact-summary { gap: 14px; margin: 0 0 18px; }
.metric, .compact-summary .metric { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; align-items: start; gap: 3px; padding: 16px 18px; min-height: 100px; }
.metric>span, .compact-summary .metric>span { font-size: 14px; color: var(--muted); white-space: normal; }
.metric strong, .compact-summary .metric strong { font-size: 28px; line-height: 1.25; font-weight: 700; white-space: normal; overflow-wrap: anywhere; letter-spacing: -.025em; }
.metric small, .compact-summary .metric small { display: block; font-size: 12px; text-align: left; white-space: normal; overflow: visible; }
.rfid-summary { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 10px 0 0; }
.rfid-summary .metric { position: relative; min-height: 76px; padding: 9px 13px; background: #fff; align-content: start; grid-template-columns: auto minmax(0,1fr); grid-template-rows: 18px auto; gap: 2px 10px; }
.rfid-summary .metric>span { font-size: 12px; grid-column: 1/-1; }
.rfid-summary .metric strong { font-size: 26px; grid-row: 2; grid-column: 1; }
.rfid-summary .metric small { grid-row: 2; grid-column: 2; align-self: center; justify-self: end; max-width: 160px; font-size: 11px; text-align: right; }
.rfid-summary .metric:first-child { grid-template-columns: minmax(0,1fr) auto; column-gap: 12px; }
.rfid-summary .metric:first-child>span { grid-column: 1/-1; }
.rfid-summary .metric:first-child strong { white-space: nowrap; grid-row: 2; grid-column: 1; }
.rfid-summary .metric:first-child small { grid-row: 2; grid-column: 2; align-self: center; padding-left: 14px; border-left: 1px solid var(--border); font-size: 13px; white-space: nowrap; }
.rfid-import-grid, .return-layout { grid-template-columns: minmax(0,.44fr) minmax(0,.56fr); gap: 18px; }
.return-generate-button { width: 100%; }
.return-generate-button:disabled, .rfid-generate-button:disabled, #sample-start:disabled { opacity: 1; color: #fff; background: #dca0aa; }
.return-generate-button[aria-busy="true"], .rfid-generate-button[aria-busy="true"], #sample-start[aria-busy="true"] { background: var(--red); }
:is(.return-generate-button,.rfid-generate-button,#sample-start)[aria-busy="true"]::before { content: ""; display: inline-block; vertical-align: -.15em; width: 14px; height: 14px; margin-right: 8px; border: 2px solid #ffffff70; border-top-color: #fff; border-radius: 50%; animation: processing-spin .8s linear infinite; }
.return-layout .task-result-slot { margin-top: 15px; }
.task-result-slot:empty, .task-upload-result:empty { display: none; }
#instruction-generation-help, #direct-generation-help { margin: 9px 0 0; line-height: 1.5; }
.file-submit-hint { margin: 12px 0 0; font-size: 13px; }
.step-title { display: flex; justify-content: flex-start; align-items: flex-start; gap: 13px; border-bottom: 0; padding-bottom: 0; margin-bottom: 17px; }
.step-number { display: inline-flex !important; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; color: var(--navy) !important; background: #edf4fb; font-size: 15px !important; font-weight: 700; }
.step-title h2 { margin: 2px 0 4px; font-size: 20px; line-height: 1.4; }
.step-title>div>span { font-size: 13px; line-height: 1.5; }
.upload-form, .task-upload { gap: 14px; }
.file-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 177px; padding: 20px; border: 1px dashed #a9c2e0; border-radius: 9px; background: #f8fafd; color: var(--navy); cursor: pointer; text-align: center; }
.file-drop:hover, .file-drop.drag-over { background: #edf4fc; border-color: #416ea0; }
.file-drop:focus-within { outline: 3px solid #a8c6eb; outline-offset: 3px; }
.file-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-drop .upload-icon { width: 38px; height: 38px; margin-bottom: 3px; fill: none; stroke: #5b7696; stroke-width: 1.6; }
.file-drop .drop-title { font-size: 17px; font-weight: 650; }
.file-drop .drop-hint { font-size: 14px; color: #6c8099; }
.file-drop .selected-file { display: block; max-width: 100%; font-size: 13px; color: #395d84; overflow-wrap: anywhere; }
.file-drop .selected-file:empty { display: none; }
.file-drop.has-file { border-color: #7e9cbd; background: #f2f7fc; }
.selected-files { margin-top: 14px; color: var(--muted); font-size: 13px; }
.selected-files summary { cursor: pointer; }
.selected-files summary strong { color: var(--navy); margin-right: 10px; }
.selected-files summary span { display: inline; }
.selected-files p { margin: 8px 0 0; overflow-wrap: anywhere; }
#rfid-empty-state { margin: 9px 0 0; }
.data-storage-note { margin: 18px 0 0; }
.file-selection-name { font-size: 13px; overflow-wrap: anywhere; line-height: 1.4; }
#rfid-preflight>.processing-message { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; }
.source-binding { padding: 13px 15px; margin: 0 0 14px; border-radius: 9px; background: #edf4fa; }
.source-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 7px; }
.source-header>strong { font-size: 14px; }
.source-detail-toggle { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 28px; padding: 2px 0 2px 8px; background: transparent; color: var(--navy); font-size: 13px; font-weight: 500; }
.source-detail-toggle:hover:not(:disabled) { background: transparent; text-decoration: underline; }
.source-detail-toggle>span[aria-hidden="true"] { display: none; }
.source-detail-toggle::after { content: "›"; display: block; font-size: 22px; line-height: 1; transform: rotate(0); }
.source-detail-toggle[aria-expanded="true"]::after { transform: rotate(90deg); }
.source-rows { display: grid; gap: 3px; }
.source-row { display: grid; grid-template-columns: 88px minmax(0,1fr); column-gap: 12px; color: #455f7e; font-size: 14px; }
.source-row>strong { font-weight: 500; overflow-wrap: anywhere; }
.source-details { margin-top: 11px; padding-top: 9px; border-top: 1px solid #d4e1ed; }
.source-details dl { grid-template-columns: 80px minmax(0,1fr); margin: 0; gap: 6px 12px; font-size: 13px; }
.source-details dd { word-break: normal; overflow-wrap: anywhere; }
.rfid-options { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 12px 26px; align-items: start; }
.rfid-options .location-options { justify-self: start; }
.rfid-options fieldset { min-width: 0; padding: 0; margin: 0; border: 0; border-radius: 0; }
.rfid-options legend { padding: 0; margin-bottom: 7px; color: #455c77; font-size: 14px; }
.rfid-options .shoe-options { display: grid; grid-template-columns: max-content max-content; gap: 10px; }
.option-tile { min-height: 44px; min-width: 110px; width: max-content; padding: 9px 12px; border: 1px solid #d3dfeb; border-radius: 8px; background: #fff; cursor: pointer; font-weight: 600; }
.option-tile:has(input:checked) { border-color: #8faacc; background: #f3f7fc; }
.option-tile:hover { border-color: #7a9abd; }
.option-tile:focus-within { outline: 3px solid #a8c6eb; outline-offset: 2px; }
.rfid-options .switch-control { position: relative; min-height: 44px; gap: 10px; cursor: pointer; }
.switch-control>input[type="checkbox"] { position: absolute; z-index: 1; opacity: 0; width: 42px; height: 26px; cursor: pointer; }
.switch-track { position: relative; display: inline-block; width: 42px; height: 26px; flex: 0 0 42px; border-radius: 20px; background: #8c9eae; transition: background-color .15s; }
.switch-track::before { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px #102c5020; }
.switch-control>input:checked+.switch-track { background: var(--navy); }
.switch-control>input:checked+.switch-track::before { transform: translateX(16px); }
.switch-control>input:focus-visible+.switch-track { outline: 3px solid #a8c6eb; outline-offset: 3px; }
.rfid-generate-button, #rfid-generation-help { grid-column: 1/-1; }
.rfid-generate-button { width: 100%; font-size: 16px; min-height: 47px; }
#rfid-generation-help { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.history-panel { padding: 0; margin-top: 18px; border: 1px solid var(--border); border-radius: 11px; background: #fff; font-size: 14px; color: #283f5c; }
.history-panel>summary { display: flex; align-items: center; gap: 12px; min-height: 53px; padding: 13px 20px; cursor: pointer; list-style: none; }
.history-panel>summary::-webkit-details-marker { display: none; }
.history-title { font-size: 16px; font-weight: 650; color: var(--navy); }
.history-count { font-size: 13px; color: var(--muted); }
.history-panel .chevron { margin-left: auto; width: 8px; height: 8px; border-right: 1.5px solid #56718e; border-bottom: 1.5px solid #56718e; transform: rotate(45deg) translateY(-2px); }
.history-panel[open]>summary .chevron { transform: rotate(225deg) translateY(-2px); }
.history-content { padding: 0 20px 17px; border-top: 1px solid #edf1f5; }
.history-content>p { font-size: 13px; padding-top: 12px; margin: 0 0 5px; color: var(--muted); }
.task-history-panel { margin-top: 18px; }
.version-row { padding: 12px 0; gap: 16px; }
.version-row>div { min-width: 0; gap: 4px; }
.version-row strong { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.version-row small { overflow-wrap: anywhere; }
.task-binding { display: grid; padding: 12px 14px; gap: 3px; margin-bottom: 16px; background: #edf4fa; }
.task-binding strong { font-size: 14px; }
.task-binding span { font-size: 13px; overflow-wrap: anywhere; }
.task-result-slot { margin-top: 4px; }
.task-result-slot>.panel { margin: 0; padding: 0; }
.task-row { min-height: 65px; gap: 14px; padding: 12px 2px; }
.task-row>span:first-child { min-width: 0; gap: 4px; }
.task-row strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.task-row small { font-size: 13px; overflow-wrap: anywhere; }
.task-state { flex-shrink: 0; font-weight: 500; font-size: 12px; }
.version-note { padding: 11px 13px; font-size: 13px; overflow-wrap: anywhere; line-height: 1.55; }
.success-box, .state-box { padding: 13px 15px; font-size: 14px; }
.task-actions { margin: 14px 0; }
.task-actions a, .task-actions button { font-size: 14px; }
.row-results, .other-details, .data-notes { font-size: 13px; }
.row-results>summary, .other-details>summary, .data-notes>summary, .legacy-upload>summary { cursor: pointer; min-height: 28px; }
.result-table, .rfid-result-table { max-width: 100%; }
.result-row, .rfid-result-row { font-size: 13px; }
.result-row>*, .rfid-result-row>* { min-width: 0; overflow-wrap: anywhere; }
.result-row small { font-size: 12px; }
.preflight:empty, .task-upload-result:empty { display: none; }
.preview-card { margin-top: 10px; line-height: 1.55; font-size: 14px; overflow-wrap: anywhere; }
.preview-card dl { grid-template-columns: 90px minmax(0,1fr); font-size: 13px; }
.preview-card p { margin: 8px 0; }
.preview-card button { font-size: 13px; }
.notice { margin: 0 0 16px; font-size: 14px; }
.product-head { align-items: center; gap: 16px; }
.product-identity { min-width: 0; }
.product-head h2 { font-size: 25px; margin: 7px 0 3px; overflow-wrap: anywhere; }
.product-head p { margin: 0; font-size: 14px; }
.totals>div { padding: 10px 15px; min-width: 145px; }
.totals strong { font-size: 25px; }
.warehouse-priority { padding: 15px; margin-top: 16px; }
.warehouse-priority h3 { font-size: 21px; }
.warehouse-row { grid-template-columns: minmax(85px,.55fr) minmax(0,2fr) minmax(65px,.45fr); }
.warehouse-row>*, .warehouse-row details p { min-width: 0; overflow-wrap: anywhere; }
.warehouse-priority .warehouse-row>strong:first-child { font-size: 20px; }
.warehouse-head>strong { font-size: 13px !important; }
.size-pill { font-size: 15px; padding: 4px 7px; margin-bottom: 5px; }
.inventory-size { min-width: 0; padding: 13px; }
.inventory-size>strong { font-size: 23px; }
.inventory-size details p, .warehouse-row details p { word-break: normal; overflow-wrap: anywhere; }
footer { padding: 18px 24px 26px; color: #667b91; font-size: 12px; }
@media (min-width: 761px) and (max-width: 1190px) {
  .rfid-summary .metric:first-child { column-gap: 8px; }
  .rfid-options { grid-template-columns: max-content minmax(0,1fr); gap: 12px 20px; }
  .option-tile { padding: 9px; }
  .rfid-import-grid { grid-template-columns: minmax(0,.43fr) minmax(0,.57fr); }
}
@media (max-width: 760px) {
  :root { font-size: 15px; }
  .topbar { height: auto; min-height: 66px; padding: 11px 14px; gap: 10px; }
  .topbar .eyebrow { display: block; font-size: 8px; line-height: 1.2; letter-spacing: .12em; margin-bottom: 4px; }
  .brand { gap: 7px; }
  .brand-mark { width: 23px; height: 23px; flex-basis: 23px; }
  .tabs .nav-icon { display: none; }
  .topbar h1 { font-size: 21px; line-height: 1.2; white-space: nowrap; }
  .account { font-size: 12px; gap: 7px; }
  .account .ghost { min-height: 36px; padding: 6px 10px; font-size: 12px; }
  main { width: calc(100% - 28px); margin: 0 auto 28px; }
  .tabs { display: grid; grid-template-columns: 1fr .65fr 1fr 1.35fr; gap: 0; margin: 0 0 12px; }
  .tabs button { min-width: 0; min-height: 47px; font-size: 12px; padding: 10px 2px; border-radius: 0; letter-spacing: -.015em; white-space: nowrap; }
  .search-shell { grid-template-columns: minmax(0,1fr); gap: 8px; margin-bottom: 12px; padding: 12px; border-radius: 10px; }
  .search-intro { padding: 0; }
  .search-intro h2 { font-size: 16px; line-height: 1.3; }
  .search-row { grid-template-columns: minmax(0,1fr) 70px; gap: 8px; }
  .search-row input { min-height: 44px; font-size: 14px; padding: 9px 11px; }
  .search-row button { min-height: 44px; padding: 8px; font-size: 14px; white-space: nowrap; }
  .search-help { font-size: 11px !important; line-height: 1.45; margin-top: 5px; }
  .search-assist { top: 48px; max-height: min(300px, 44dvh); }
  .panel-grid, .task-layout, .rfid-import-grid, .return-layout { grid-template-columns: minmax(0,1fr); gap: 12px; align-items: start; }
  .panel { margin-top: 12px; padding: 16px; border-radius: 10px; }
  .panel-grid>.panel, .task-layout>.panel { margin-top: 0; }
  .panel-title { gap: 8px; margin-bottom: 13px; padding-bottom: 10px; }
  .panel-title h2 { font-size: 18px; }
  .panel-title span { font-size: 12px; }
  .module-overview { margin: 0 0 12px; padding: 12px; }
  .module-overview .module-heading { display: block; }
  .module-overview .module-heading h2 { font-size: 20px; margin-bottom: 3px; }
  .module-overview .module-heading p { font-size: 12px; }
  .module-heading h2 { font-size: 22px; margin-bottom: 4px; }
  .module-heading p { font-size: 13px; }
  .metrics, .compact-summary { gap: 7px; margin-bottom: 12px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .inventory-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .metric, .compact-summary .metric { min-height: 82px; padding: 10px; gap: 3px; border-radius: 8px; }
  .metric>span, .compact-summary .metric>span { font-size: 11px; white-space: normal; line-height: 1.4; overflow: visible; }
  .metric strong, .compact-summary .metric strong { font-size: 20px; white-space: normal; overflow-wrap: anywhere; }
  .metric small, .compact-summary .metric small { display: block; font-size: 10px; line-height: 1.3; white-space: normal; }
  .rfid-summary { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin: 12px 0 0; }
  .rfid-summary .metric { min-height: 76px; padding: 7px; grid-template-columns: minmax(0,1fr); grid-template-rows: 16px 25px auto; gap: 2px; }
  .rfid-summary .metric>span { font-size: 11px; }
  .rfid-summary .metric strong { font-size: 22px; }
  .rfid-summary .metric:first-child { grid-template-columns: minmax(0,1fr); gap: 5px; }
  .rfid-summary .metric:first-child strong { font-size: 16px; letter-spacing: -.045em; white-space: nowrap; }
  .rfid-summary .metric small, .rfid-summary .metric:first-child small { grid-column: 1; grid-row: 3; justify-self: start; padding: 0; border: 0; font-size: 10px; text-align: left; }
  .step-title { gap: 10px; margin-bottom: 14px; padding: 0; }
  .step-number { width: 31px; height: 31px; flex-basis: 31px; font-size: 13px !important; }
  .step-title h2 { font-size: 18px; margin-top: 1px; }
  .step-title>div>span { font-size: 12px; }
  .file-drop { min-height: 145px; padding: 16px; }
  .file-drop .upload-icon { width: 32px; height: 32px; }
  .file-drop .drop-title { font-size: 16px; }
  .file-drop .drop-hint, .file-drop .selected-file { font-size: 12px; }
  .upload-form, .task-upload { gap: 12px; }
  .source-binding { padding: 12px; margin-bottom: 13px; }
  .source-header>strong { font-size: 13px; }
  .source-detail-toggle { font-size: 12px; min-height: 30px; }
  .source-row { grid-template-columns: 74px minmax(0,1fr); font-size: 12px; gap: 8px; }
  .source-details dl { grid-template-columns: 70px minmax(0,1fr); gap: 6px 8px; font-size: 12px; }
  .rfid-options { display: grid; grid-template-columns: minmax(0,1fr); gap: 13px; }
  .rfid-options legend { font-size: 13px; margin-bottom: 7px; }
  .rfid-options .shoe-options { grid-template-columns: max-content max-content; gap: 10px; }
  .rfid-options .location-options { display: flex; gap: 16px; align-items: center; }
  .rfid-options .location-options legend { float: left; margin: 9px 0 0; }
  .rfid-options .switch-control { width: auto; min-height: 38px; }
  .rfid-generate-button { font-size: 15px; min-height: 46px; }
  #rfid-generation-help { font-size: 12px; }
  .history-panel { padding: 0; margin-top: 12px; }
  .history-panel>summary { min-height: 50px; padding: 12px 14px; gap: 10px; }
  .history-title { font-size: 14px; }
  .history-count { font-size: 12px; }
  .history-content { padding: 0 14px 12px; }
  .history-content>p { font-size: 12px; }
  .version-row { gap: 10px; padding: 11px 0; }
  .version-row strong { font-size: 13px; }
  .version-row small { font-size: 12px; }
  .version-row button { min-height: 40px; padding: 8px 12px; font-size: 13px; }
  .task-binding { padding: 11px 12px; gap: 4px; margin-bottom: 13px; }
  .task-binding strong { font-size: 13px; }
  .task-binding span { font-size: 12px; }
  .task-row { padding: 11px 0; gap: 10px; }
  .task-row strong { font-size: 13px; }
  .task-row small, .task-state { font-size: 11px; }
  .task-result-slot { margin-top: 0; }
  .task-result-slot>.panel { padding: 0; margin: 0; }
  .task-actions { display: flex; gap: 7px; }
  .task-actions .button-link, .task-actions button { padding: 10px 11px; font-size: 13px; min-height: 42px; }
  .version-note, .success-box { font-size: 12px; }
  .processing-title { flex-wrap: wrap; gap: 7px; }
  .processing-title h2 { font-size: 16px; }
  .processing-live { font-size: 11px; }
  .preview-card dl { grid-template-columns: 72px minmax(0,1fr); }
  .preview-card { font-size: 13px; padding: 12px; }
  .preview-card button { width: 100%; margin-top: 5px; }
  .notice { padding: 12px; font-size: 13px; }
  #search-output>.panel { margin-top: 0; }
  .product-head { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; align-items: center; }
  .product-head h2 { font-size: 20px; margin: 5px 0 2px; }
  .product-head p { font-size: 12px; }
  .totals.primary-total>div { min-width: 90px; padding: 8px; }
  .totals.primary-total span { font-size: 10px; }
  .totals.primary-total strong { font-size: 21px; }
  .warehouse-priority { padding: 10px; margin-top: 12px; }
  .warehouse-priority h3 { font-size: 19px; }
  .warehouse-priority .section-heading p { font-size: 11px; line-height: 1.5; }
  .warehouse-row { grid-template-columns: 65px minmax(0,1fr) 28px; gap: 7px; padding: 10px 7px; }
  .warehouse-head { display: none; }
  .warehouse-priority .warehouse-row>strong:first-child { font-size: 19px !important; }
  .warehouse-row>strong:last-child { font-size: 12px; }
  .size-pill { font-size: 13px; padding: 4px 5px; margin-right: 3px; margin-bottom: 4px; }
  .warehouse-row details { font-size: 11px; }
  .inventory-size-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
  .inventory-size { padding: 9px; }
  .inventory-size>strong { font-size: 20px; }
  .inventory-size small { font-size: 11px; }
  .section-heading { align-items: flex-start; gap: 8px; }
  .section-heading h3 { font-size: 18px; }
  .section-heading p { font-size: 12px; }
  .section-heading>button { font-size: 12px; padding: 7px 9px; min-height: 38px; }
  .other-detail-grid { grid-template-columns: 1fr 1fr; }
  .other-details { padding: 11px; }
  .candidates { grid-template-columns: 1fr; }
  .anomaly-grid { grid-template-columns: minmax(0,1fr); }
  footer { padding: 14px 16px 22px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}

/* Phone finding view: all locations and all inventory sizes stay expanded.
   Only source disclosures move below the two core sections. */
@media (max-width: 760px) {
  .topbar { min-height: 54px; padding: 7px 14px; }
  .topbar h1 { font-size: 20px; }
  .topbar .eyebrow { font-size: 7px; margin-bottom: 3px; }
  .tabs { grid-template-columns: 1fr 1fr 1.1fr 1.4fr; margin-bottom: 10px; }
  .tabs button { min-height: 44px; font-size: 12px; }
  #search-page .search-shell { padding: 10px; gap: 6px; margin-bottom: 10px; }
  #search-page .search-help { margin: 4px 0 0; }
  #search-page .search-row input { font-size: 16px; }
  #search-empty { padding: 27px 10px 28px; margin-top: 14px; }
  #search-empty .search-empty-icon { width: 34px; height: 34px; margin-bottom: 12px; }
  #search-empty h2 { font-size: 18px; margin-bottom: 6px; }
  #search-empty > p { font-size: 13px; }
  #search-empty .search-empty-versions { margin-top: 18px; gap: 7px 16px; font-size: 12px; }
  #search-page.has-search-result .search-shell { gap: 8px; padding: 7px 9px; margin-bottom: 8px; }
  #search-page.has-search-result .search-intro h2 { font-size: 14px; }
  #search-page.has-search-result .search-row { grid-template-columns: minmax(0,1fr) 56px; gap: 6px; }
  #search-page.has-search-result .search-row input { padding: 9px 8px; }
  #search-page.has-search-result .product-head { scroll-margin-top: 70px; }
  .return-tabs { width: 100%; gap: 4px; margin-bottom: 12px; padding: 4px; }
  .return-tabs button { min-width: 0; flex: 1; min-height: 42px; font-size: 15px; }
  .return-view > .module-heading { margin: 0 0 12px; }
  #search-output > .panel { padding: 10px; }
  #search-output .product-head { gap: 8px; }
  #search-output .product-head h2 { font-size: 20px; line-height: 1.25; margin: 3px 0 2px; }
  #search-output .product-head .badge { font-size: 10px; padding: 2px 5px; }
  #search-output .product-head p { font-size: 12px; line-height: 1.4; }
  #search-output .totals.primary-total > div { min-width: 82px; padding: 6px 7px; }
  #search-output .totals.primary-total strong { font-size: 20px; }
  #search-output .warehouse-priority { padding: 8px; margin-top: 9px; }
  #search-output .section-heading { margin-bottom: 6px; }
  #search-output .section-heading h3 { font-size: 17px; line-height: 1.3; }
  #search-output .warehouse-priority .section-heading p { font-size: 11px; line-height: 1.35; margin-top: 3px; }
  #search-output .warehouse-row { grid-template-columns: 58px minmax(0,1fr) 26px; padding: 7px 5px; gap: 5px; }
  #search-output .warehouse-row > strong:first-child { font-size: 20px !important; line-height: 1.2; }
  #search-output .warehouse-row > strong:last-child { font-size: 12px; }
  #search-output .size-pill { font-size: 14px; line-height: 1.4; padding: 3px 4px; margin: 0 3px 3px 0; }
  #search-output .warehouse-row details, #search-output .inventory-size details { display: none; }
  #search-output .result-section { margin-top: 10px; }
  #search-output .inventory-size-grid { grid-template-columns: repeat(auto-fit,minmax(50px,1fr)); gap: 4px; }
  #search-output .inventory-size { padding: 6px 4px; gap: 1px; border-radius: 7px; text-align: center; align-content: start; }
  #search-output .inventory-size > span { font-size: 14px; overflow-wrap: anywhere; }
  #search-output .inventory-size > strong { font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
  #search-output .inventory-size > small { display: none; }
  #search-output .inventory-size[data-status="zero"] > small, #search-output .inventory-size[data-status="inventory_missing"] > small { display: block; font-size: 10px; line-height: 1.3; }
  #search-output .other-details { margin-top: 10px; padding: 9px; }
  #search-output .mobile-source-list { display: block; margin-top: 12px; font-size: 12px; }
  #search-output .mobile-source-list h4 { margin: 12px 0 5px; }
  #search-output .mobile-source-list p { overflow-wrap: anywhere; word-break: normal; margin: 5px 0; }
}
/* Import metadata belongs to its own source card; never hides business values. */
.import-meta { display: flex; flex-wrap: wrap; gap: 5px 16px; padding: 10px 12px; margin-bottom: 14px; background: #f2f6fa; border-radius: 8px; color: #526784; font-size: 12px; }
.import-meta .meta-item { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.import-meta .meta-item:first-child { flex-basis: 100%; }
.import-meta strong { color: #102c50; font-size: 14px; }
.import-meta small { font-size: 12px; }
#rfid-binding { background: transparent; border-radius: 0; border-top: 1px solid #e0e7ef; padding: 12px 0 0; margin: 14px 0 0; font-size: 13px; }
#rfid-binding .source-header { font-size: 13px; margin-bottom: 6px; }
#rfid-binding .source-row { font-size: 13px; }
/* Home-only presentation: the existing empty-state flag owns this layout.
   Result, candidate and failure states keep the established search styles. */
.search-home-heading { display: none; }
#search-page:has(#search-empty:not(.hidden)) { padding-top: clamp(48px, 11vh, 116px); }
#search-page:has(#search-empty:not(.hidden)) .search-shell { display: grid; grid-template-columns: minmax(0,1fr); gap: 26px; width: min(100%, 820px); margin: 0 auto; padding: 0; background: transparent; border: 0; box-shadow: none; }
#search-page:has(#search-empty:not(.hidden)) .search-home-heading { display: grid; justify-items: center; gap: 15px; text-align: center; }
.search-home-heading svg { width: 44px; height: 44px; color: #577493; }
.search-home-heading h2 { margin: 0; color: #102c50; font-size: 30px; line-height: 1.4; font-weight: 650; }
#search-page:has(#search-empty:not(.hidden)) .search-intro,
#search-page:has(#search-empty:not(.hidden)) .search-help { display: none; }
#search-page:has(#search-empty:not(.hidden)) #search-empty { margin: 17px auto 0; padding: 0 8px 35px; }
#search-page:has(#search-empty:not(.hidden)) .search-empty-versions { margin-top: 22px; }
@media (max-width: 760px) {
  #search-page:has(#search-empty:not(.hidden)) { padding-top: 25px; }
  #search-page:has(#search-empty:not(.hidden)) .search-shell { gap: 21px; }
  #search-page:has(#search-empty:not(.hidden)) .search-home-heading { gap: 11px; }
  .search-home-heading svg { width: 36px; height: 36px; }
  .search-home-heading h2 { font-size: 24px; }
  #search-page:has(#search-empty:not(.hidden)) #search-empty { margin-top: 15px; padding-bottom: 20px; }
  #search-page:has(#search-empty:not(.hidden)) .search-empty-versions { margin-top: 18px; }
}
.home-desktop-title, .home-desktop-subtitle { display: none; }
@media (min-width: 761px) {
  /* Desktop landing composition only; no fixed-height spacer or result override. */
  #app:has(#search-page:not(.hidden) #search-empty:not(.hidden)) { display: flex; flex-direction: column; min-height: 100svh; }
  #app:has(#search-page:not(.hidden) #search-empty:not(.hidden)) > main { display: flex; flex: 1; flex-direction: column; margin-bottom: 0; }
  #search-page:has(#search-empty:not(.hidden)) { display: flex; flex: 1; flex-direction: column; }
  #search-page:has(#search-empty:not(.hidden)) { padding-top: clamp(64px, calc((100svh - 420px) * .22), 150px); }
  #search-page:has(#search-empty:not(.hidden)) .search-shell { width: min(100%, 1100px); gap: 28px; }
  #search-page:has(#search-empty:not(.hidden)) .search-home-heading { gap: 12px; }
  .search-home-heading svg, .home-mobile-title { display: none; }
  .home-desktop-title { display: inline; }
  .search-home-heading h2 { font-size: clamp(34px, 3vw, 44px); font-weight: 650; line-height: 1.3; letter-spacing: 0; }
  .home-desktop-title strong { font-weight: inherit; }
  .search-home-heading .home-desktop-subtitle { display: block; margin: 0; font-size: 16px; line-height: 1.6; color: #465f7c; }
  #search-page:has(#search-empty:not(.hidden)) .search-tools { padding: 18px; background: #fff; border: 1px solid #dce4ec; border-radius: 12px; }
  #search-page:has(#search-empty:not(.hidden)) .search-row { grid-template-columns: minmax(0,1fr) clamp(140px, 11vw, 150px); gap: 14px; }
  #search-page:has(#search-empty:not(.hidden)) .search-row input,
  #search-page:has(#search-empty:not(.hidden)) .search-row button { min-height: clamp(56px, 4vw, 60px); font-size: 17px; }
  #search-page:has(#search-empty:not(.hidden)) .search-row input { padding-inline: 17px; }
  #search-page:has(#search-empty:not(.hidden)) .search-assist { top: calc(100% + 6px); }
  #search-page:has(#search-empty:not(.hidden)) #search-empty { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 100%; margin-top: clamp(80px, 10svh, 110px); padding: 0; }
  #search-page:has(#search-empty:not(.hidden)) #search-empty > p { display: none; }
  #search-page:has(#search-empty:not(.hidden)) .search-empty-versions { margin-top: 0; gap: 12px 28px; font-size: 13px; }
  #search-page:has(#search-empty:not(.hidden)) .search-empty-versions span + span { border-left: 1px solid #d5dee8; padding-left: 28px; }
}
.sample-scope-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sample-scope-heading > button { min-height: 34px; padding: 4px 12px; font-size: 13px; }
.sample-rules { margin-left: auto; font-size: 13px; }
.sample-rules summary { cursor: pointer; }
.sample-rules > div { padding: 8px 0; }
.sample-scopes { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.sample-scopes .option-tile { display: flex; align-items: center; width: 100%; min-height: 48px; gap: 10px; padding: 10px 14px; }
.sample-form-grid { display: grid; grid-template-columns: minmax(0,.44fr) minmax(0,.56fr); gap: 18px; align-items: start; }
.sample-form-grid > .panel { margin-top: 0; min-width: 0; }
.sample-form-grid h3 { margin: 0; font-size: 17px; }
.sample-form-grid h3 small { font-weight: 400; margin-left: 7px; }
.sample-scope-heading { justify-content: space-between; margin-bottom: 14px; }
.sample-scope-actions { display: flex; gap: 6px; }
.sample-scope-actions button { padding: 4px 10px; min-height: 32px; font-size: 13px; background: transparent; color: #455f7e; }
.sample-scope-actions button:hover { background: #edf2f7; }
.sample-form-grid .sample-scopes { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.sample-form-grid .option-tile { min-height: 44px; font-weight: 500; }
.sample-form-grid .sample-rules { margin: 12px 0 0; color: #566b84; }
.sample-upload-block { min-width: 0; }
.sample-upload-block > p { margin: 7px 0 12px; }
.sample-upload-block .file-drop { min-height: 177px; }
.sample-upload-block #sample-files-names { margin-top: 10px; }
#sample-files-names:empty { display: none; }
.sample-preflight-button { width: 100%; margin-top: 10px; }
.sample-preflight-result { margin-top: 8px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; color: #526983; }
.sample-preflight-result > summary { min-height: 38px; padding: 10px 0; cursor: pointer; font-size: 13px; line-height: 1.4; }
.sample-preflight-result > div { padding: 0 0 9px; }
.sample-preflight-file { padding: 9px 0; border-top: 1px solid #e0e7ef; overflow-wrap: anywhere; }
.sample-preflight-file:first-child { border-top: 0; }
.sample-preflight-file strong { display: block; color: #193653; font-size: 13px; }
.sample-preflight-file p { margin: 4px 0 0; font-size: 12px; line-height: 1.45; }
.sample-preflight-file ul { margin: 5px 0 0; padding-left: 18px; font-size: 12px; }
.sample-action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.sample-action-row #sample-start { width: 320px; }
#sample-status:empty { display: none; }
@media (max-width: 760px) {
  .sample-form-grid { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .sample-action-row #sample-start { width: 100%; }
}
#sample-inventory { overflow-wrap: anywhere; }
#sample-result .panel-title > div { min-width: 0; overflow-wrap: anywhere; }
#sample-start { width: min(100%,320px); }
#sample-files-names { overflow-wrap: anywhere; margin: 0; }
#sample-status { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
#sample-result { width: 100%; min-width: 0; margin-top: 10px; }
.sample-audience-heading { margin-top: 20px; }
.sample-audiences { display: flex; flex-wrap: wrap; gap: 8px; }
.sample-chip { position: relative; display: flex; align-items: center; min-height: 42px; padding: 8px 13px; border: 1px solid #d7e1ec; border-radius: 8px; background: #fff; color: #415773; cursor: pointer; font-size: 14px; }
.sample-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sample-chip:has(input:checked) { color: #102c50; border-color: #8faacc; background: #f3f7fc; font-weight: 600; }
.sample-chip:has(input:checked) span::before { content: '✓'; margin-right: 7px; color: #17416d; }
.sample-chip:has(input:focus-visible) { outline: 2px solid #276ed1; outline-offset: 2px; }
/* Sample-check refinements are scoped to this page. */
#sample-view > .module-heading { margin-bottom: 14px; }
#sample-view > .module-heading h2 { font-size: 25px; line-height: 1.3; }
#sample-view > .module-heading p { margin-top: 5px; line-height: 1.55; }
#sample-inventory { align-items: baseline; gap: 5px 10px; padding: 10px 14px; margin-bottom: 16px; }
#sample-inventory strong { color: #193c64; font-size: 13px; }
#sample-inventory .sample-inventory-file { color: #5b708a; overflow-wrap: anywhere; }
.async-placeholder { display: block; margin: 0; color: #647991; font-size: 13px; line-height: 1.45; }
.async-placeholder-error { color: #a52635; }
.import-meta > .async-placeholder { flex-basis: 100%; }
.source-binding > .async-placeholder { padding: 1px 0; }
.sample-scopes > .async-placeholder, .sample-audiences > .async-placeholder { grid-column: 1 / -1; }
#sample-view .sample-scope-heading { gap: 8px 12px; margin-bottom: 10px; }
#sample-view .sample-scope-heading h3 { flex: 1 1 auto; min-width: 0; }
#sample-view .sample-scope-actions { flex: 0 0 auto; }
#sample-view .sample-audience-heading { margin-top: 22px; }
#sample-view .sample-scopes { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 10px; }
#sample-view .sample-audiences { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
#sample-view .sample-chip { justify-content: center; min-height: 44px; padding: 8px 4px; border-radius: 8px; font-size: 14px; line-height: 1.3; transition: border-color .15s, background-color .15s; }
#sample-view .sample-chip:hover { border-color: #92afce; background: #f6f9fc; }
#sample-view .sample-chip:has(input:checked):hover { border-color: #7a9abd; background: #f3f7fc; }
#sample-view .sample-chip span { display: inline-flex; align-items: center; gap: 7px; }
#sample-view .sample-chip span::before { content: none; }
#sample-view .sample-chip input:checked { opacity: 1; width: 19px; height: 19px; left: 4px; top: 50%; margin: 0; transform: translateY(-50%); cursor: pointer; }
#sample-view .sample-chip:has(input:checked) span { transform: translateX(7px); }
#sample-view .sample-upload-block .file-drop { min-height: 177px; }
#sample-view #sample-files-names:not(:empty) { margin: 10px 0 0; color: #405978; line-height: 1.5; }
#sample-view .sample-action-row { margin-top: 16px; flex-direction: column; align-items: stretch; gap: 12px; }
#sample-view .sample-action-row #sample-start { width: 100%; }
#sample-view #sample-ready { max-width: none; margin: -6px 0 0; text-align: left; line-height: 1.45; font-size: 13px; }
#sample-view #sample-result { margin-top: 0; }
#sample-view #sample-result > .panel { margin: 0; }
#sample-view .sample-result-details { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
#sample-view .sample-result-details > summary { cursor: pointer; color: #4d6580; font-size: 14px; }
#sample-view .sample-result-detail-content { padding-top: 10px; }
#sample-view .sample-pdf-actions { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
#sample-view .sample-pdf-actions .button-link { min-width: 100px; text-align: center; white-space: nowrap; }
@media (max-width: 760px) {
  #sample-view .sample-action-row { gap: 8px; }
  #sample-view .sample-action-row #sample-start { width: 100%; }
  #sample-view #sample-ready { max-width: none; }
}
.sample-row { display: grid; grid-template-columns: 50px 60px 145px minmax(90px,1fr) minmax(70px,1fr) minmax(150px,2fr) 65px; gap: 10px; border-bottom: 1px solid #e0e7ef; padding: 13px 0; align-items: start; font-size: 14px; }
.sample-row span { overflow-wrap: anywhere; min-width: 0; }
.sample-row span:nth-child(3) { font-weight: 650; }
.sample-head { color: #102c50; background: #f2f6fa; }
@media (max-width: 1000px) {
  .sample-row { grid-template-columns: 1fr 1fr; border: 1px solid #e0e7ef; border-radius: 8px; padding: 12px; margin-top: 10px; }
  .sample-head { display: none; }
  .sample-row span::before { content: attr(data-label) "："; color: #566b84; font-size: 12px; font-weight: 400; }
  .sample-row span:nth-child(3), .sample-row span:nth-child(6) { grid-column: 1/-1; }
  .sample-row span:nth-child(3) { font-size: 18px; }
}
@media (max-width: 760px) {
  .tabs:has([data-view="sample"]) { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sample-scopes { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
.account .management-link { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; }
.management-link svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.6; flex-shrink: 0; }
.account .management-link.active { outline: 1px solid #ffffff70; background: #ffffff30; }
@media (max-width: 760px) {
  .account { gap: 6px; }
  .data-management-label { display: none; }
  .account .management-link { min-width: 36px; min-height: 36px; padding: 8px; }
}
/* Shared inventory-backed choices: one actual style, one single-line option. */
.search-assist .product-option,.shared-product-options .product-option{display:flex;align-items:center;gap:9px;width:100%;min-width:0;min-height:44px;text-align:left;overflow-x:auto;flex-wrap:nowrap}
.product-option .candidate-code{flex:0 0 auto;white-space:nowrap;overflow-wrap:normal;font-size:14px}
.product-option .candidate-names{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}
.product-option small{flex:0 0 auto;white-space:nowrap}
.product-title{display:flex;align-items:center;gap:3px}
.product-title .same-style-mark{position:relative;flex:0 0 30px;width:30px;height:30px;min-height:30px;padding:0;border:0;background:transparent;color:#58728e;border-radius:50%;display:inline-flex;align-items:center;justify-content:center}
.same-style-mark:hover{background:#edf2f7}
.same-style-mark::before{content:"";position:absolute;inset:-6px;border-radius:50%}
.same-style-mark>span,.related-stock-toggle>span{width:7px;height:7px;border-radius:50%;background:#527fae;display:block;pointer-events:none;transform:translateY(-5px)}
.related-stock-inline{display:grid;gap:3px;margin:4px 0 8px;padding:5px;border:1px solid #e0e7ef;border-radius:8px;background:#f8fafc}
.detail-related-stock{max-width:420px}
.related-stock-choice{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;align-items:center;gap:2px 10px;width:100%;min-height:40px;padding:7px 8px;border:0;border-bottom:1px solid #e3e9ef;border-radius:4px;background:transparent;color:#17314f;text-align:left}
.related-stock-choice:last-child{border-bottom:0}
.related-stock-choice>strong{grid-column:1/-1;min-width:0;overflow-wrap:anywhere;font-size:13px}
.related-stock-choice>span{grid-column:1;grid-row:2;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#60748b;font-size:12px}
.related-stock-choice>small{grid-column:2;grid-row:2;justify-self:end;padding:2px 7px;border-radius:999px;background:#edf2f7;color:#536b84;font-size:11px;white-space:nowrap}
.related-stock-choice:hover,.related-stock-choice:focus{background:#edf3f7}
.search-assist .product-option-row{border-bottom:1px solid #e3e9ef}
.search-assist .product-option-row:last-child{border-bottom:0}
.search-assist .product-option-line{position:relative;display:flex;align-items:center;min-width:0;gap:2px}
.search-assist .product-option-line>.product-option{display:flex;flex:1 1 auto;align-items:center;gap:9px;width:auto;min-width:0;min-height:44px;padding:8px;border:0;border-radius:7px;background:#fff;overflow:hidden;text-align:left}
.search-assist .product-option-line.has-related-stock .candidate-names{margin-left:36px}
.search-assist .product-option-line>.product-option:hover,.search-assist .product-option-line>.product-option:focus{background:#edf3f7}
.search-assist .related-stock-toggle{position:absolute;z-index:2;flex:0 0 36px;width:36px;height:36px;min-height:36px;padding:0;border:0;border-radius:50%;background:transparent;display:grid;place-items:center}
.search-assist .related-stock-toggle>span{justify-self:start;margin-left:3px}
.search-assist .related-stock-toggle::before{content:"";position:absolute;inset:0;border-radius:50%}
.search-assist .related-stock-toggle:hover,.search-assist .related-stock-toggle:focus{background:#edf3f7}
.product-option-row .related-stock-inline{margin:0 0 5px 8px}
.size-targets-panel{grid-column:1/-1;flex-basis:100%;width:100%;min-width:0;border:1px solid #dce4ec;border-radius:9px;padding:12px;margin:2px 0}
.size-targets-panel>summary{cursor:pointer;font-weight:600}.size-targets-panel>summary small{margin-left:8px;font-weight:400;color:#60748b}
.size-target-search-tools{position:relative;margin:12px 0}.size-target-search-tools input{width:100%;min-width:0}.size-target-search-tools .search-assist{left:0;right:0;top:44px;z-index:30}
.size-target-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.size-target-actions select{min-width:76px;padding:8px;margin-left:6px}
.size-target-row{display:flex;align-items:center;gap:6px;border-top:1px solid #e3e9ee;padding:3px 0}.size-target-row>div{flex:1;min-width:0}.size-target-row strong{font-size:14px;overflow-wrap:anywhere}.size-target-row p{font-size:12px;line-height:1.3;margin:1px 0;overflow-wrap:anywhere}.size-target-row small{font-size:12px;color:#6a7d90}.size-target-row span{margin-left:6px;font-weight:600;color:#274a70}.size-target-row button{flex:0 0 auto;width:auto;min-height:40px;padding:4px;font-size:12px;white-space:nowrap}.size-target-row.needs-review{background:#fff8e9}.target-highlight{outline:1px solid #a7b9ca}
@media(max-width:600px){.size-targets-panel{padding:10px}.size-target-row{gap:4px}.size-targets-panel>summary small{display:inline;font-size:11px}.size-target-actions{gap:6px}}
.quantity-basis-panel{margin:12px 0;padding:10px;border-radius:8px;background:#f4f7fa;font-size:12px}.quantity-basis-panel p{margin:0 0 6px}.quantity-basis-panel label{align-items:flex-start!important;font-size:12px;line-height:1.5}.quantity-basis-panel button{font-size:12px;margin-top:6px}.quantity-task-summary{font-size:13px;line-height:1.65;margin:10px 0}.quantity-task-summary details{margin:8px 0}.quantity-discrepancy-list{display:grid;gap:8px;margin-top:8px}.quantity-discrepancy-item{border:1px solid #dce5ed;border-radius:8px;background:#fff;padding:9px 11px}.quantity-discrepancy-item>strong{display:block;color:#16385f}.quantity-discrepancy-item>p{margin:3px 0 0}.quantity-discrepancy-item details{border-top:1px solid #edf1f4;margin-top:6px;padding-top:5px}.quantity-discrepancy-item details>summary{cursor:pointer;color:#526984;font-size:12px}.quantity-discrepancy-item ul{margin:5px 0 0;padding-left:18px}.quantity-discrepancy-item li{margin:2px 0;overflow-wrap:anywhere}
#size-target-list{display:flex;flex-wrap:wrap;gap:5px;align-items:center;min-height:42px}
#size-target-list .target-chip{display:inline-flex;align-items:center;max-width:100%;border:1px solid #d8e2eb;border-radius:5px;background:#fff}
#size-target-list .target-chip button{margin:0;border:0;background:transparent;color:#274a70;min-height:32px;font-size:12px}
#size-target-list .target-chip-style{padding:4px 3px 4px 7px;overflow-wrap:anywhere;text-align:left}
#size-target-list .target-chip-remove{padding:4px 8px;color:#60748b;font-size:16px}
#size-target-list .target-empty{color:#708297;font-size:12px}
.rfid-result-row.quantity-result{grid-template-columns:1.15fr 1fr .45fr .65fr .65fr 1.2fr 1.6fr;min-width:800px}.rfid-result-row.quantity-result.no-locations{grid-template-columns:1.15fr 1fr .45fr .65fr .65fr 1.8fr;min-width:680px}

/* RFID file metadata and explicitly selected saved targets. */
#rfid-preflight-button { width: 100%; }
.size-target-history { border-top: 1px solid #e3e9ee; margin-top: 12px; padding-top: 12px; }
.size-target-history > summary { cursor: pointer; font-weight: 600; }
.size-target-history > summary small { margin-left: 8px; color: #60748b; font-weight: 400; }
.size-target-history > p { margin: 8px 0; font-size: 12px; }
.target-choice { display: flex; align-items: center; gap: 5px; flex-shrink: 0; font-size: 12px; white-space: nowrap; }
.history-inline-detail { padding: 8px 12px 14px; border-bottom: 1px solid #e3e9ee; }
.history-inline-detail .task-actions { margin: 0; justify-content: flex-end; }

/* Return results: file context on the left, current task actions on the right. */
.return-layout { align-items: start; }
.return-file-info { min-width: 0; margin-top: 14px; padding: 12px 14px; border-radius: 9px; background: #f3f5f8; color: #425b78; font-size: 13px; }
.return-info-title { display: block; color: #102c50; margin-bottom: 7px; font-size: 14px; }
.return-info-row { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 5px 12px; align-items: baseline; margin-top: 4px; }
.return-info-row strong { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.return-result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.return-result-heading h2 { min-width: 0; margin: 0; color: #102c50; font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.return-result-summary { margin: 7px 0 0; color: #526a86; font-size: 14px; line-height: 1.5; }
.return-result .task-actions { margin: 13px 0; }
.return-result-details, .return-result .row-results { border-top: 1px solid #e3e9ef; padding-top: 10px; margin-top: 10px; }
.return-result-details > summary, .return-result .row-results > summary { cursor: pointer; color: #4d6580; font-size: 14px; }
.return-result-details .version-note { margin-top: 10px; }
.return-result-details .review-box { margin-top: 10px; }
.return-layout .task-detail .return-result { min-width: 0; }
@media(max-width:600px) { .return-result-heading { flex-wrap: wrap; } .return-file-info { padding: 11px 12px; } .return-result .task-actions { gap: 8px; } }

/* Waiting uses the same flowing highlight as footwear, without claiming a percentage. */
.return-result .return-indeterminate > i { width: 8%; }
.return-result .return-progress-waiting { margin: 5px 0 0; color: #566b84; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .return-result .return-indeterminate > i::after { animation: none; } }

/* Match the sample-check page heading. */
#rfid-view > .module-heading { margin-bottom: 14px; }
#rfid-view > .module-heading h2 { font-size: 25px; line-height: 1.3; }

#rfid-current.rfid-preflight-meta { margin-top: 10px; padding: 9px 12px; border-radius: 8px; background: #f3f6f9; color: #526b88; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }

/* Data management: summaries and one selected operation. */
#inventory-view > .module-heading { margin-bottom: 16px; }
.data-overview { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.data-overview-card { min-width: 0; min-height: 116px; padding: 16px 19px; display: flex; flex-direction: column; justify-content: center; gap: 3px; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.data-overview-card > span { color: #5b718b; font-size: 13px; }
.data-overview-card > strong { color: var(--navy); font-size: 21px; line-height: 1.35; overflow-wrap: anywhere; }
.data-overview-card > small { color: #5b718b; font-size: 13px; }
.data-tabs { display: flex; width: fit-content; max-width: 100%; gap: 5px; padding: 5px; margin: 18px 0; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.data-tabs button { min-width: 136px; min-height: 42px; padding: 8px 16px; color: #455c77; background: transparent; }
.data-tabs button[aria-selected="true"] { color: #fff; background: var(--navy); }
.data-category > .panel:not(.history-panel) { padding: 22px; }
.data-category > .history-panel { margin-top: 14px; }
#inventory-view .data-storage-note { margin-top: 16px; }
@media (max-width: 760px) {
  .data-overview { grid-template-columns: 1fr; gap: 8px; }
  .data-overview-card { min-height: 0; padding: 11px 14px; gap: 1px; }
  .data-overview-card > strong { font-size: 18px; }
  .data-tabs { display: grid; width: 100%; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; margin: 14px 0; }
  .data-tabs button { min-width: 0; padding: 8px 4px; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
  .data-category > .panel:not(.history-panel) { padding: 15px; }
}
