/* Shared preparation workspace for the desktop, server and in-browser editions. */
:root {
  --bg: #0b1014; --bg2: #10171c; --panel: #151c22; --panel2: #1b252c;
  --line: #2a353d; --line2: #39474f; --text: #edf3f4; --muted: #a7b6bf;
  --accent: #65e1c1; --accent-ink: #09241c; --focus: #89e8d3; --radius: 13px;
  --wash: #1a302d; --gutter: clamp(16px, 3.2vw, 52px); --container: 1500px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
html:has(.workspace), body:has(.workspace) { height: auto; overflow: visible; }
body { font-size: 16px; line-height: 1.45; }
.app:has(> .workspace) { display: block; height: auto; min-height: 100dvh; padding: 0 0 100px; }
.app > :is(.stepper,.setup-shell,.workspace,.models-tab,.inspect-tab,.foot) {
  width: min(calc(100% - 2 * var(--gutter)), var(--container)); margin-inline: auto;
}
.ui-icon { display: inline-block; width: 19px; height: 19px; flex: none; vertical-align: middle; }
button, a, summary, input, select { touch-action: manipulation; }
.btn { font-size: 14px; font-weight: 600; border-radius: 8px; min-height: 40px; }
.btn.primary { background: var(--accent); }
.btn.primary:disabled { background: #283332; color: #9bada8; border: 1px solid #3c4a47; opacity: 1; }
.btn:not(:disabled):active,.sample:active { transform: translateY(1px); }
.panel { background: var(--panel); border-color: var(--line); padding: 19px; }
.panel-title, .sample-head h2, .setup-heading h2, .inspect-tab h2 { color: var(--text); font-size: 16px; font-weight: 650; text-transform: none; letter-spacing: -.02em; }
.top { background: #10161b; border-bottom: 1px solid var(--line); margin: 0; display: block; }
.mast { max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 14px var(--gutter); display: flex; gap: clamp(18px,3.3vw,62px); align-items: center; min-height: 65px; }
.brand { text-decoration: none; color: var(--text); font-size: 23px; font-weight: 720; letter-spacing: -.065em; white-space: nowrap; gap: 9px; }
.brand-mark { display: grid; place-items: center; background: var(--accent); color: #082f23; width: 32px; height: 34px; border-radius: 9px; }
.brand-mark svg { width: 24px; height: 24px; stroke-width: 2.4; }
.brand-ai { color: var(--accent); font-size: .55em; letter-spacing: -.01em; margin-left: 4px; vertical-align: super; }
.tabs { margin: 0; border: 0; display: flex; gap: 3px; }
.tab { display: inline-flex; gap: 7px; align-items: center; margin: 0; padding: 9px 12px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 550; line-height: 1.3; white-space: nowrap; }
.tab .tab-long { margin-left: -4px; }
.tab .ui-icon { width: 16px; height: 16px; }
.tab[aria-selected=true] { box-shadow: none; color: var(--accent); background: #1a2b29; border-color: #2a4941; }
.top-actions { flex-wrap: nowrap; }
.top-actions .ab-mode { margin: 0; }
.mode-toggle { border-radius: 8px; background: var(--bg); border-color: var(--line); }
.mode-toggle .mode-opt { font-size: 13px; padding: 6px 10px; border-radius: 5px; }
.mode-toggle .mode-opt.on { background: #2a343b; color: var(--text); }
#helpBtn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-color: transparent; color: var(--muted); }
#helpBtn .ui-icon { width: 17px; height: 17px; }
#tipBtn { font-size: 12px; }
.status.sr-only { position: absolute; }
.stepper { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-block: 21px 15px; padding: 0; }
.step { display: block; padding: 0; border-radius: 9px; background: #10161b; border: 1px solid var(--line); color: #8a989f; }
.step button { display: flex; align-items: center; width: 100%; min-height: 44px; gap: 10px; padding: 8px 14px; border: 0; background: none; color: inherit; font: inherit; font-weight: 550; text-align: left; cursor: pointer; }
.step button:disabled { cursor: default; }
.step-n { width: 23px; height: 23px; border: 0; background: #222c32; color: #aebcc3; font-size: 12px; font-variant-numeric: tabular-nums; }
.step.current { border-color: #3f7867; background: #152b25; color: #b1f7dd; }
.step.done { color: #bad4ca; }
.step.done .step-n { background: #24453b; color: var(--accent); }
.setup-shell { margin-block: 0 18px; }
.setup-sheet, .mobile-setup { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.setup-sheet { padding: 15px 20px 17px; position: relative; }
.setup-heading,.setup-heading h2 { display: flex; align-items: center; gap: 9px; }
.setup-heading { justify-content: space-between; margin-bottom: 11px; }
.setup-heading .ui-icon { width: 17px; color: var(--accent); }
.profile-specs { font-size: 13px; color: var(--muted); }
.profile-specs summary { cursor: pointer; }
.profile-specs[open] { color: var(--text); }
#printerSpecs { z-index: 6; position: absolute; right: 18px; top: 37px; margin: 0; padding: 12px 15px; border-radius: 8px; background: #202c32; border: 1px solid var(--line2); max-width: min(92%,430px); white-space: normal; box-shadow: var(--shadow); }
.setup-fields { display: grid; grid-template-columns: 1.6fr 1fr .85fr 1.65fr; gap: 16px; align-items: end; }
.setup-fields > .ab-field { flex: none; min-width: 0; max-width: none; margin: 0; display: grid; gap: 5px; }
.setup-fields .label,.setup-fields label,.ab-smooth > label,.mobile-setup .label { font-size: 13px; letter-spacing: 0; color: var(--muted); text-transform: none; font-weight: 550; }
.setup-fields select,.setup-fields #material,.setup-fields #nozzle,.printer-combo input { width: 100%; height: 40px; font-size: 14px; font-weight: 550; background-color: #10171c; border-color: #344149; border-radius: 7px; }
.setup-fields .seg { background: #10171c; padding: 3px; gap: 2px; min-height: 40px; border: 1px solid #344149; border-radius: 8px; flex-wrap: nowrap; }
.setup-fields .seg button { min-width: 0; flex: 1; border-radius: 5px; border: 1px solid transparent; font-size: 13px; font-weight: 550; padding: 4px 7px; color: var(--muted); background: transparent; }
.setup-fields .seg button.on { color: #bcf4df; background: #244438; border-color: #355a49; }
.seg button.on::before { content: none; }
#changerField { margin-top: 12px; }
#changerField > label { font-size: 13px; letter-spacing: 0; text-transform: none; }
.printer-combo { position: relative; }
.printer-combo > svg { pointer-events: none; position: absolute; width: 16px; height: 16px; top: 12px; color: #92a5aa; }
.printer-combo > svg:first-child { left: 11px; }
.printer-combo > svg:last-of-type { right: 10px; }
.printer-combo input { padding: 8px 29px 8px 35px; }
.printer-popover { position: absolute; top: calc(100% + 4px); left: 0; z-index: 12; width: max(100%,240px); max-width: min(92vw,420px); border: 1px solid #485a61; background: #1b252c; padding: 5px; border-radius: 8px; box-shadow: var(--shadow); max-height: 280px; overflow: auto; overscroll-behavior: contain; }
.printer-popover [role=option] { padding: 8px 10px; cursor: pointer; font-size: 14px; border-radius: 4px; }
.printer-popover [role=option][aria-selected=true],.printer-popover [role=option]:hover { background: #284438; color: var(--accent); }
.printer-popover p { margin: 8px; }
.mobile-setup,#closeSetup { display: none; }
.workspace { display: grid; grid-template-columns: minmax(0,1.75fr) minmax(305px,1fr); grid-template-areas: "stage side"; align-items: start; gap: 18px; }
.stage,.side { height: auto; position: static; min-height: 0; overflow: visible; }
.stage { padding: 0; gap: 0; overflow: hidden; }
.stage-head { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.stage-head .ui-icon { color: var(--accent); margin-right: 5px; }
.stage:has(#dropHint:not([hidden])) .stage-head { display: none; }
.stage .viewport { height: clamp(340px,47vh,560px); min-height: 0; flex: none; border-radius: 0; border: none; }
.workspace:has(#dropHint:not([hidden])) .viewport { height: auto; min-height: 0; }
.viewport:has(#dropHint:not([hidden])) #view { visibility: hidden; }
.drop-hint { display: block; place-items: normal; position: relative; padding: 0; background: var(--panel); }
.hero { position: relative; isolation: isolate; display: flex; align-items: center; overflow: hidden; min-height: 218px; padding: clamp(22px,2.3vw,36px); background: radial-gradient(ellipse at 83% 53%,#193b37 0,transparent 53%),linear-gradient(110deg,#182620,#152423 60%,#132a29); border-bottom: 1px solid #2c413a; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .36; background: repeating-linear-gradient(30deg,transparent 0 22px,#4a6c62 23px,transparent 24px),repeating-linear-gradient(150deg,transparent 0 22px,#4a6c62 23px,transparent 24px); mask-image: linear-gradient(90deg,transparent 34%,#000 80%); }
.hero-copy { position: relative; z-index: 1; width: 62%; }
.hero-label { display: inline-flex; align-items: center; gap: 7px; color: #a4e7cd; font-size: 10.5px; font-weight: 700; line-height: 1.25; text-transform: uppercase; letter-spacing: .14em; }
.hero-label .ui-icon { width: 14px; height: 14px; }
.hero h1,.page-intro h1 { margin: 9px 0 9px; font-size: clamp(29px,2.75vw,44px); font-weight: 650; line-height: 1.08; letter-spacing: -.051em; }
.hero h1 span,.page-intro h1 span { color: var(--accent); }
.hero p,.page-intro p { margin: 0; max-width: 365px; color: #b7c9c4; font-size: 15px; line-height: 1.5; }
.hero-part { position: absolute; z-index: 0; right: -4%; top: 50%; transform: translateY(-48%); width: 51%; max-height: 114%; height: auto; object-fit: contain; filter: drop-shadow(0 12px 12px #0b161983); }
.upload-body { padding: clamp(18px,2vw,29px); }
.drop-card { display: flex; align-items: center; gap: 16px; padding: 23px 17px; border: 1px dashed #52756b; border-radius: 10px; background: #131e1d; text-align: left; }
.upload-symbol,.scan-symbol,.action-symbol { display: grid; flex: none; place-items: center; border-radius: 10px; }
.upload-symbol { width: 44px; height: 44px; background: #20382f; color: var(--accent); }
.drop-card .ui-icon { display: block; width: 23px; height: 23px; stroke: currentColor; }
.drop-title { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.drop-card .drop-sub { display: block; margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.btn.browse { margin-left: auto; border: 1px solid #4d7968; background: #254338; color: #c4f5df; white-space: nowrap; }
.btn.browse:hover { background: #315b4a; }
.sample-head { display: flex; align-items: center; gap: 14px; margin: 20px 0 10px; }
.sample-head h2 { font-size: 14px; }
.sample-head span { flex: 1; height: 1px; background: var(--line); }
.sample-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.sample { display: flex; align-items: center; gap: 11px; text-align: left; background: #161f25; border: 1px solid #334047; border-radius: 9px; padding: 9px 11px; cursor: pointer; }
.sample:hover { background: #1d292b; border-color: #5e8676; }
.sample-thumb { width: clamp(40px,3.8vw,55px); height: clamp(40px,3.8vw,55px); flex: none; display: grid; place-items: center; border-radius: 6px; overflow: hidden; background: #10191e; }
.sample-thumb svg { width: 100%; height: 100%; display: block; }
.sample strong,.sample small { display: block; }
.sample strong { font-size: 14px; font-weight: 650; }
.sample small,.privacy { font-size: 12.5px; color: var(--muted); }
.privacy { display: flex; align-items: center; gap: 6px; margin-top: 15px; }
.privacy .ui-icon { width: 13px; height: 13px; color: #8da99b; }
.side,.side-scroll-pane { display: flex; flex-direction: column; min-width: 0; height: auto; overflow: visible; }
.side-scroll-pane { flex: 0 0 auto; box-shadow: none; background: transparent; border: 0; padding: 0; gap: 10px; }
.fold { padding: 0; }
.fold > summary { padding: 15px 17px; min-height: 50px; gap: 8px; margin: 0; flex-direction: row; justify-content: flex-start; }
.fold[open] > summary { margin: 0; border-bottom: 1px solid var(--line); }
.fold > summary::before { display: none; }
.fold > summary::after { content: ""; display: block; margin-left: auto; width: 6px; height: 6px; border: solid #91a3a9; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); flex: none; }
.fold[open] > summary::after { transform: rotate(225deg); }
.fold > :not(summary) { margin-inline: 17px; }
.fold[open] > summary + * { margin-top: 13px; }
.fold[open] > :last-child { margin-bottom: 16px; }
.panel-title .ui-icon { width: 17px; height: 17px; margin-right: 7px; color: #a8beb7; vertical-align: -3px; }
.summary .panel-title { margin: 0; }
.summary > summary::after { display: none; }
.predicted-tag { margin-left: auto; padding: 2px 9px; font-size: 11px; font-weight: 650; color: #a4ceef; background: #213344; border: 1px solid #334b60; border-radius: 20px; }
.summary-idle { display: flex; align-items: center; gap: 11px; margin: 17px 0; }
.scan-symbol { width: 39px; height: 39px; color: #92adab; background: #202d31; }
.summary-idle strong { font-size: 15px; }
.summary-idle p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.idle-metrics { margin: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; border-top: 1px solid var(--line); padding-top: 12px; }
.idle-metrics > div + div { border-left: 1px solid var(--line); padding-left: 13px; }
.idle-metrics dt { font-size: 12px; color: var(--muted); }
.idle-metrics dd { margin: 3px 0 0; font-size: 19px; line-height: 1.15; color: #b9c7cd; }
.idle-metrics small { font-size: 11px; color: #94a5ae; }
#issueKeysHint { width: 1px; }
#summaryBody { padding-bottom: 1px; }
#finishState { font-weight: 500; }
.printer-pill { width: auto; padding: 0; font-size: 14px; border: 0; border-radius: 0; background: none; }
#pillEvidence { white-space: normal; font-size: 12px; }
#evidenceBox { border: 0; padding: 0; }
#evidenceBox .ev-list li { flex-wrap: wrap; }
.ev-verified_by_slicer { border-width: 1px; }
.side-scroll-pane > .panel,.side-scroll-pane > .details { order: initial; }
#fitPanel,#partsPanel { overflow: hidden; }
.file-bar,.plate-opts { padding: 14px 19px; }
.file-bar { border-top: 1px solid var(--line); }
.file-bar small,.plate-opts small { font-size: 13px; }
#staleNote { margin: 0; }
body:has(#summaryBody:not([hidden])) .before-analysis { display: none; }
.export-stage { display: none; grid-area: stage; min-width: 0; overflow: hidden; padding: 0; }
body[data-stage=export] .export-stage { display: block; }
body[data-stage=export] .model-stage { display: none; }
.export-file,.export-next,.export-facts,.export-links,.inspect-form { margin: 20px 24px; }
.export-file { display: flex; align-items: center; gap: 12px; padding: 15px; background: #182924; border: 1px solid #345245; border-radius: 9px; overflow-wrap: anywhere; }
.export-file > svg { color: var(--accent); }
.export-file small { display: block; color: var(--muted); font-size: 13px; }
.export-facts { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px 20px; font-size: 14px; }
.export-facts dt { color: var(--muted); } .export-facts dd { margin: 0; overflow-wrap: anywhere; }
.export-next,.inspect-guide p { color: var(--muted); font-size: 14px; }
.actionbar { position: fixed; inset: auto 0 0; display: block; min-height: 0; padding: 0; border: 0; border-top: 1px solid #34423e; border-radius: 0; background: #11191cfa; box-shadow: 0 -6px 22px #080c101f; z-index: 20; }
.action-inner { width: min(calc(100% - 2 * var(--gutter)),var(--container)); margin: auto; padding-block: 12px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 2px 16px; }
.action-readout,.action-buttons { display: flex; align-items: center; gap: 10px; }
.action-symbol { width: 37px; height: 37px; background: #1c2d28; color: var(--accent); }
.action-readout strong,.action-readout small { display: block; }
.action-readout strong { font-size: 15px; }
.action-readout small,.receiver-note { font-size: 13px; color: var(--muted); }
.receiver-note { grid-column: 1/-1; }
.action-buttons .btn { min-height: 42px; }
.action-buttons .btn.primary { min-width: 155px; }
.foot { margin-top: 18px; font-size: 12px; color: #94a3aa; text-align: left; }
.foot a { color: inherit; }
body.tab-models .setup-shell,body.tab-inspect .setup-shell { display: none; }
.inspect-tab { display: grid; grid-template-columns: minmax(0,1.75fr) minmax(280px,1fr); align-items: start; gap: 18px; padding-top: 22px; }
.inspect-main { padding: 0; overflow: hidden; }
.page-intro { padding: 28px; background: linear-gradient(115deg,#1b312a,#152724); border-bottom: 1px solid #31403a; }
.page-intro p { max-width: 52ch; }
.inspect-form .check-row { margin-top: 14px; }
.inspect-form .browse { margin: 0; }
.inspect-guide h3 { margin: 20px 0 4px; font-size: 15px; }
.inspect-guide p { margin: 0; }
.models-tab { padding-top: 22px; }
.models-head { padding: 23px; }
.models-head .panel-title { font-size: 25px; }
.models-local-note { border-color: #435b60; font-size: 14px; }
body:has(.setup-sheet.is-open) { overflow: hidden; }
@media (max-width: 1100px) {
  .tab-long { display: none; }
  .mast { gap: 24px; }
  .setup-fields { grid-template-columns: 1.3fr .8fr .7fr 1.5fr; gap: 9px; }
  .workspace { grid-template-columns: minmax(0,1.6fr) minmax(282px,1fr); gap: 12px; }
  .upload-symbol { width: 35px; height: 35px; }
  .drop-card { gap: 10px; padding: 18px 12px; }
  .sample { padding: 8px; gap: 7px; }
  .sample small { font-size: 12px; }
}
@media (max-width: 900px) {
  .workspace,.inspect-tab { display: grid; grid-template-columns: minmax(0,1fr); grid-template-areas: none; gap: 14px; }
  .workspace > .stage,.workspace > .side,.workspace > .export-stage { grid-area: auto; order: 0; }
  .side,.side-scroll-pane { display: flex; }
  .setup-fields { grid-template-columns: 1.1fr 1fr; }
  .hero { min-height: 215px; }
  .hero-part { right: 0; width: 44%; }
  .mast { gap: 14px; }
  #tipBtn { display: none; }
  .step-n { width: 23px; height: 23px; }
}
@media (max-width: 700px) {
  :root { --gutter: 14px; }
  .app:has(> .workspace) { padding-bottom: 125px; }
  .mast { flex-wrap: wrap; gap: 7px; padding: 10px var(--gutter) 6px; }
  .brand { font-size: 21px; }
  .brand-mark { width: 28px; height: 29px; }
  .brand-mark svg { width: 21px; }
  .top-actions { gap: 2px; }
  #helpBtn span { display: none; }
  #helpBtn { padding-inline: 6px; }
  .top-actions .btn.danger { padding-inline: 5px; min-height: 32px; }
  .mode-toggle .mode-opt { padding: 5px 7px; font-size: 12px; }
  .tabs { order: 3; width: 100%; gap: 4px; }
  .tab { flex: 1; justify-content: center; min-height: 40px; }
  .stepper { position: sticky; top: 0; z-index: 10; gap: 5px; margin-block: 0 3px; padding-block: 8px; background: var(--bg); }
  .step { border-radius: 7px; font-size: 13px; }
  .step button { gap: 6px; min-height: 38px; padding: 5px 8px; }
  .step-long { display: none; }
  .step-n { width: 20px; height: 20px; }
  .setup-shell { margin-bottom: 10px; }
  .mobile-setup { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 8px 11px; }
  .mobile-setup > div { min-width: 0; }
  .mobile-setup span,.mobile-setup strong { display: block; }
  .mobile-setup strong { font-size: 13px; letter-spacing: -.01em; }
  .mobile-setup .label { font-size: 11px; }
  .mobile-setup button { font-size: 13px; padding-inline: 8px; flex: none; }
  .mobile-setup svg { width: 15px; }
  .setup-sheet { display: none; }
  .setup-shade { position: fixed; inset: 0; z-index: 39; background: #050b10ba; }
  .setup-sheet.is-open { position: fixed; display: block; inset: auto 0 0; z-index: 40; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; max-height: 88dvh; overflow-y: auto; }
  .setup-heading { margin-bottom: 16px; }
  .setup-fields { grid-template-columns: 1fr 1fr; gap: 12px; }
  .setup-fields .ab-printer,.setup-fields .ab-goal { grid-column: 1/-1; }
  .setup-fields select,.setup-fields #material,.setup-fields #nozzle,.printer-combo input { height: 44px; }
  .setup-fields .seg { min-height: 44px; }
  #closeSetup { display: block; margin-top: 17px; width: 100%; min-height: 44px; }
  .hero { min-height: 174px; padding: 19px 15px; }
  .hero h1 { font-size: clamp(24px,6.3vw,34px); }
  .hero p { font-size: 13px; line-height: 1.45; }
  .hero-copy { width: 65%; }
  .hero-label { font-size: 9px; }
  .hero-part { width: 48%; right: -7%; }
  .upload-body { padding: 14px; }
  .drop-card { display: grid; grid-template-columns: auto 1fr; padding: 15px 13px; gap: 8px 11px; }
  .drop-card .btn { grid-column: 1/-1; margin: 2px 0 0; min-height: 42px; }
  .drop-card .drop-title { font-size: 16px; }
  .drop-card .drop-sub { font-size: 12px; }
  .sample-head { margin: 15px 0 8px; }
  .sample-grid { gap: 6px; }
  .sample { gap: 7px; padding: 7px; align-items: center; }
  .sample-thumb { width: 35px; height: 37px; }
  .sample strong { font-size: 13px; line-height: 1.25; }
  .sample small { font-size: 11.5px; line-height: 1.25; margin-top: 3px; }
  .privacy { font-size: 11.5px; margin-top: 10px; }
  .action-inner { padding-block: 9px calc(9px + env(safe-area-inset-bottom)); grid-template-columns: minmax(0,1fr) auto; gap: 6px; }
  .action-symbol { display: none; }
  .action-readout small,.receiver-note { font-size: 12px; line-height: 1.25; }
  .action-readout strong { font-size: 13px; line-height: 1.2; }
  .action-readout small { margin-top: 3px; }
  .action-buttons { gap: 5px; }
  .action-buttons .btn { padding: 7px 9px; font-size: 13px; }
  .action-buttons .btn.primary { min-width: 0; }
  .action-inner:has(#backStep:not([hidden])) { grid-template-columns: 1fr; }
  .action-inner:has(#backStep:not([hidden])) .action-buttons { justify-content: end; }
  .toast { bottom: 125px; }
  .stage .viewport { height: 330px; }
  .stage-head,.file-bar,.plate-opts { padding: 12px; }
  .file-bar .file-list { max-height: none; }
  .file-actions { justify-content: flex-start; }
  .view-help { font-size: 11px; bottom: 37px; }
  .legend { left: 10px; right: auto; }
  .page-intro { padding: 22px 16px; }
  .export-file,.export-next,.export-facts,.export-links,.inspect-form { margin: 16px; }
  .export-facts { grid-template-columns: 1fr; gap: 3px; }
  .export-facts dd { margin-bottom: 9px; }
  .panel :is(.check-out,pre) { max-width: 100%; overflow-wrap: anywhere; white-space: pre-wrap; }
  .inspect-tab,.models-tab { padding-top: 12px; }
}
@media (max-width: 359px) {
  .mast { gap: 5px; } .brand { font-size: 18px; } .brand-mark { width: 25px; }
  .hero-part { width: 44%; right: -8%; } .hero-copy { width: 73%; }
  .sample-grid { grid-template-columns: 1fr; } .sample-thumb { width: 32px; height: 32px; }
  .mobile-setup .btn { font-size: 12px; }
}
@media print { .app:has(> .workspace) { display: none !important; } }

.summary[open] #summaryEmpty { padding-bottom: 16px; }
.summary[open] #summaryBody { padding-bottom: 16px; }
#settingsPanel .rec-content { display: none; }
body:has(#results:not([hidden])) #settingsPanel .rec-content { display: block; }
#settingsPanel .rec-content > :first-child { margin-top: 0; }
#settingsPanel .rec-content > :last-child { margin-bottom: 0; }
.print-details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.print-details > summary { width: fit-content; color: var(--muted); cursor: pointer; font-size: 13px; }
.attention.clear { border-color: var(--line); }
.attention:not(.clear) { border-color: #8e6b33; }
.attention .att-list:empty { display: none; }
#attentionPanel > summary { margin-bottom: 0; }
#attentionPanel:not(.clear) > summary { color: #e9c58f; }
body:not([data-stage=export]) #exportReceiver { display: none; }
#actionBar .receiver-note { max-height: 4.5em; overflow: auto; }

/* Model discovery shares the existing workspace navigation and print setup. */
.models-head { gap: 20px; background: linear-gradient(115deg,#1a2c27 0%,var(--panel) 58%); }
.models-heading { display: flex; gap: 14px; align-items: center; }
.models-heading h1 { font-size: clamp(23px,2.5vw,32px); line-height: 1.2; letter-spacing: -.04em; }
.models-heading p, .models-handoff p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.library-symbol { display: grid; place-items: center; width: 46px; height: 46px; color: var(--accent); background: #203c32; border-radius: 12px; }
.library-symbol .ui-icon { width: 24px; height: 24px; }
.models-search { display: grid; align-items: end; grid-template-columns: minmax(162px,225px) minmax(0,1fr) auto; gap: 10px; }
.models-search label,.handoff-file label { font-size: 13px; font-weight: 550; color: var(--muted); }
.models-search :is(select,input) { display: block; width: 100%; height: 42px; margin-top: 5px; background-color: var(--bg2); color: var(--text); font-size: 15px; font-weight: 400; }
.models-search button { min-height: 42px; padding-inline: 21px; }
.models-results-head { display: flex; align-items: center; gap: 12px; margin-top: 5px; flex-wrap: wrap; }
.models-results-head h2,.models-handoff h2 { font-size: 18px; letter-spacing: -.024em; }
.models-results-head p { margin: 0; color: var(--muted); font-size: 14px; }
.models-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.models-grid > [role=listitem] { min-width: 0; }
.mc-card { width: 100%; height: 100%; padding: 0; text-align: left; }
.mc-info { padding: 13px 15px 15px; gap: 4px; }
.mc-info strong { font-size: 16px; overflow-wrap: anywhere; line-height: 1.3; }
.mc-info .hint { font-size: 13px; }
.mc-info .tag { margin-top: 6px; }
.mc-thumb { position: relative; width: 100%; overflow: hidden; background: radial-gradient(ellipse at 50% 75%,#25433c,#14221e 76%); color: #709c8c; }
.mc-thumb img { position: absolute; inset: 0; background: var(--bg2); }
.mc-thumb[data-source="library"] img { object-fit: contain; background: #18272a; }
.md-image .mc-thumb { width: 100%; height: 100%; aspect-ratio: auto; }
.md-image img { object-fit: contain; }
.md-lic a,.model-credit a { color: var(--accent); }
.md-description { font-size: 14px; color: var(--muted); }
.md-files small { white-space: nowrap; }
.md-files .btn { min-height: 40px; }
.models-handoff { max-width: 760px; }
.catalog-sites { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin-block: 8px 16px; }
.catalog-sites h2 { color: var(--muted); font-size: 14px; font-weight: 550; }
.catalog-sites > div { display: flex; flex-wrap: wrap; gap: 8px; }
.library-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 clamp(15px,2.2vw,32px) 14px; background: var(--panel); }
.library-shortcuts button { color: var(--muted); border: 1px solid var(--line2); border-radius: 18px; padding: 5px 12px; background: var(--bg2); cursor: pointer; }
.library-shortcuts button:hover,.library-shortcuts button:focus-visible { color: var(--accent); border-color: currentColor; }
.library-shortcuts #openSaved { margin-left: auto; color: var(--accent); }
.catalog-filter { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); cursor: pointer; }
.mc-thumb.mc-source { font-size: clamp(17px,2.5vw,29px); letter-spacing: -.035em; text-align: center; color: #a2c6bd; }
.mc-thumb.mc-source[data-source="zenodo"] { background: linear-gradient(135deg,#223846,#1b2931); color: #abd1e2; }
.mc-thumb.mc-source[data-source="archive"] { background: linear-gradient(135deg,#3d3431,#302723); color: #dab9a2; }
.models-tab.reading-model > :is(.catalog-sites,.models-handoff,.hosted-discovery) { display: none; }
.hosted-discovery { padding: 16px 20px; flex-wrap: wrap; }
.mc-info > small { overflow-wrap: anywhere; }
.models-handoff > a { margin-top: 14px; white-space: normal; overflow-wrap: anywhere; }
.handoff-file { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 4px 12px; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.handoff-file label { grid-column: 1/-1; }
.handoff-file label small { font-weight: 400; }
.handoff-file input[type=url] { border: 1px solid var(--line2); border-radius: 8px; background: var(--bg2); color: var(--text); width: 100%; min-height: 42px; padding: 7px 10px; }
.file-info { flex: 1; min-width: 0; }
.file-info .file-name { display: block; }
.model-credit { display: block; font-weight: 400; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.export-sources { margin: 16px 24px; padding-top: 12px; border-top: 1px solid var(--line); }
.export-sources p { font-size: 14px; margin: 4px 0; }
@media (max-width: 700px) {
  .models-head { padding: 16px; gap: 14px; }
  .models-heading { align-items: flex-start; gap: 9px; }
  .library-symbol { width: 33px; height: 33px; flex: none; }
  .library-symbol .ui-icon { width: 19px; }
  .models-search { grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .models-search label:first-child { grid-column: 1/-1; }
  .models-search button { padding-inline: 12px; }
  .models-grid { grid-template-columns: repeat(auto-fill,minmax(min(160px,100%),1fr)); gap: 9px; }
  .mc-info { padding: 10px; }
  .mc-info strong { font-size: 14px; }
  .models-results-head { gap: 6px 10px; }
  .md-files li { flex-wrap: wrap; }
  .handoff-file { grid-template-columns: 1fr; }
  .handoff-file .btn { margin: 7px 0 0; }
  .export-sources { margin-inline: 16px; }
}

.placement-tools { display:flex; flex-wrap:wrap; align-items:end; gap:8px; padding:12px 16px; border-top:1px solid var(--line); }
.placement-tools label { display:grid; gap:4px; min-width:0; font-size:13px; color:var(--muted); }
.placement-tools label:first-child { flex:1 1 150px; }
.placement-tools select { max-width:100%; width:100%; }
.placement-tools input { width:88px; }

/* The library keeps the search controls and source details close to the models. */
.models-tab .models-head { padding: 0; gap: 0; overflow: hidden; }
.discovery-cover { isolation: isolate; position: relative; display: grid; grid-template-columns: minmax(0,1fr) minmax(250px,38%); align-items: stretch; min-height: 174px; }
.discovery-cover::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 78% 20%, #37655d66, transparent 55%), linear-gradient(110deg,#183631 0%,#172b2b 56%,#162325); }
.discovery-cover .models-heading { padding: clamp(20px,3.4vw,48px); }
.discovery-cover h1 { font-size: clamp(32px,3.5vw,54px); letter-spacing: -.055em; line-height: 1; font-weight: 660; }
.discovery-cover .models-heading p { max-width: 44ch; margin-top: 11px; color: #bbd0cb; font-size: 15px; }
.cover-model { padding: 0; border: 0; position: relative; min-height: 160px; overflow: hidden; cursor: pointer; background: #172a2c; color: #f4fbf9; text-align: left; }
.cover-model img { position: absolute; width: 100%; height: 100%; inset: 0; object-fit: cover; object-position: 50% 43%; transition: transform .2s; }
.cover-model::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg,#071115d9,transparent 66%); }
.cover-model span { position: absolute; inset: auto auto 13px 18px; z-index: 1; display: grid; gap: 1px; }
.cover-model strong { font-size: 15px; }
.cover-model small { color: #c3d4d4; font-size: 13px; }
.cover-model:hover img,.cover-model:focus-visible img { transform: scale(1.045); }
.cover-model:focus-visible { outline-offset: -4px; }
.models-head .models-search { background: var(--panel); padding: 14px clamp(15px,2.2vw,32px) 18px; border-top: 1px solid var(--line); align-items: end; }
.discovery-shelf { margin-top: 12px; }
.shelf-head,.models-results-head { display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.models-results-head { justify-content: flex-start; margin-block: 7px 0; }
.models-results-head p,.shelf-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.shelf-head h2,.models-results-head h2 { margin: 0; font-size: 21px; letter-spacing: -.032em; }
.shelf-head { margin-bottom: 13px; }
.shelf-head > button { flex: none; }
.shelf-head + .models-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.mc-card .mc-thumb { aspect-ratio: 16 / 8.3; }
.mc-format { position: absolute; bottom: 8px; left: 9px; background: #102024db; color: #e3f1ed; border: 1px solid #77968b66; padding: 2px 6px; border-radius: 5px; font-size: 10px; font-weight: 700; letter-spacing: .07em; }
.mc-info { flex: 1; gap: 3px; }
.mc-info .mc-facts { display: flex; align-items: end; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 6px; }
.mc-facts small { font-size: 12px; color: var(--muted); }
.mc-info .tag { margin: 0; }
.more-models { align-self: center; margin-top: 4px; }
.models-tab.reading-model > :is(.models-head,.discovery-shelf,.more-models) { display: none; }
.model-detail .md-body { gap: clamp(18px,3vw,40px); }
.model-detail .md-title { font-size: clamp(24px,2.5vw,36px); letter-spacing: -.042em; line-height: 1.15; }
.model-detail .md-info { gap: 9px; }
.md-files li { padding: 10px; }
@media (max-width: 900px) {
  .shelf-head + .models-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .discovery-cover { min-height: 122px; grid-template-columns: minmax(0,1fr) minmax(104px,33%); }
  .discovery-cover .models-heading { padding: 18px 12px; align-items: center; }
  .discovery-cover h1 { font-size: clamp(27px,6.8vw,36px); }
  .discovery-cover .models-heading p { font-size: 13px; margin-top: 6px; }
  .cover-model { min-height: 112px; }
  .cover-model span { inset: auto 6px 6px; }
  .cover-model strong { font-size: 11px; }
  .cover-model small { font-size: 10px; }
  .models-head .models-search { padding: 10px 12px 13px; }
  .shelf-head h2,.models-results-head h2 { font-size: 17px; }
  .shelf-head,.models-results-head { gap: 6px; }
  .shelf-head > button { padding-inline: 8px; font-size: 12px; }
  .mc-info .mc-facts { flex-wrap: wrap; }
  .mc-card .mc-thumb { aspect-ratio: 4 / 3; }
  .model-detail .md-body { gap: 12px; }
}

.placement-tools .move-drag { display:flex; align-items:center; min-height:38px; }
.placement-tools .move-drag input { width:17px; height:17px; }

.cover-model { background: #222; }
.cover-model img { object-fit: contain; }
.cover-model span { max-width: 75%; }
.format-filters { margin-left: auto; display: inline-flex; gap: 2px; padding: 3px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); }
.format-filters button { border: 0; border-radius: 5px; background: transparent; padding: 5px 10px; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 550; }
.format-filters button[aria-pressed="true"] { background: #284138; color: #b9ead5; }
@media (max-width:700px) {
  .format-filters { margin-left: 0; }
  .format-filters button { padding: 7px; }
}
