/* Luminous edge — approved matte-indigo cabinet theme.
   Source vocabulary: luminous-edge-dark/DESIGN.md. Portal selectors remain stable. */
:root, .luminous-theme {
  color-scheme: dark;
  --le-background: #202039;
  --le-surface: #2D2B48;
  --le-text: #F8EEE8;
  --le-muted: #C0B5C9;
  --le-primary: #F19A73;
  --le-secondary: #A99BCB;
  --le-border: #48425E;
  --le-sun: #FFD296;
  --le-glow-rgb: 241 154 115;
  --le-glow-alpha: 0.22;
  --le-texture-alpha: 0.025;
  --le-radius-panel: 10px;
  --le-radius-control: 7px;
  --le-control-height: 46px;
  --le-hit-size: 44px;
  --le-font: "Helvetica Neue", Arial, sans-serif;
  --le-font-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  /* Semantic extensions: coral is an action, not a success/error signal. */
  --le-success: #9BE3B0;
  --le-warning: #FFD296;
  --le-error: #FFB4B4;
  --le-success-surface: color-mix(in srgb, var(--le-success) 8%, var(--le-background));
  --le-warning-surface: color-mix(in srgb, var(--le-warning) 8%, var(--le-background));
  --le-error-surface: color-mix(in srgb, var(--le-error) 8%, var(--le-background));

}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--le-background);
  color: var(--le-text);
  font: 400 14px/1.6 var(--le-font);
}
[hidden], input[type=hidden] { display: none !important; }
a { color: var(--le-primary); text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; }
h1 { margin: 0 0 24px; font-size: 30px; font-weight: 500; line-height: 1.2; letter-spacing: -1px; overflow-wrap: anywhere; }
h2 { margin: 0 0 12px; font-size: 18px; font-weight: 500; line-height: 1.5; }
h3, .h2s { margin: 0 0 8px; font-size: 16px; font-weight: 500; }
p { margin: 0 0 18px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 18px; padding: 0; font-size: 18px; font-weight: 500; }
button:focus-visible, a:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, summary:focus-visible,
.hint-ico:focus-visible, .lf-track:focus-visible {
  outline: 2px solid var(--le-text);
  outline-offset: 4px;
}

/* Shell and identity: the account caption always stays beneath the brand. */
.shell { max-width: 1080px; margin: 0 auto; padding: 32px; }
header, .topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding-bottom: 22px; border-bottom: 1px solid var(--le-border);
}
.brand-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-symbol { display: inline-grid; place-items: center; min-width: var(--le-hit-size); min-height: var(--le-hit-size); color: var(--le-primary); text-decoration: none; flex-shrink: 0; }
.brand-wrap { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; gap: 2px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 23px; font-weight: 500; letter-spacing: -.6px; text-decoration: none; color: var(--le-text); }
.brand:hover { text-decoration: none; }
.brand span { color: var(--le-muted); font-size: 16px; letter-spacing: 0; }
.brand-symbol svg, .brand svg, .brand-mark, .brand-logo {
  width: 36px; height: 36px; flex-shrink: 0; color: var(--le-primary);
  fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
}
.brand-login { color: var(--le-muted); font-size: 12px; line-height: 1.7; max-width: 100%; overflow-wrap: anywhere; }
.badge { color: var(--le-muted); font-size: 12px; text-align: right; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 12px 0 24px; }
nav a { display: inline-flex; align-items: center; min-height: var(--le-hit-size); color: var(--le-muted); text-decoration: none; }
nav a:hover { color: var(--le-text); }
nav a[aria-current=page] { color: var(--le-text); text-decoration: underline; text-decoration-color: var(--le-primary); text-underline-offset: 10px; }
nav form { margin-left: auto; }
footer { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--le-border); color: var(--le-muted); font-size: 12px; line-height: 1.7; }
footer span { display: block; }
.portal-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: middle; }

/* Real content panels only: static noise sits behind content, never on text. */
.meta-block, .create-form, .order-card, .empty {
  position: relative; isolation: isolate;
  background: var(--le-surface); border: 1px solid var(--le-border);
  border-radius: var(--le-radius-panel); padding: 24px;
}
.meta-block::before, .create-form::before, .order-card::before, .empty::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; z-index: -1; opacity: var(--le-texture-alpha);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' d='M0 0h120v120H0z'/%3E%3C/svg%3E");
}
[data-texture=false] :is(.meta-block, .create-form, .order-card, .empty)::before { display: none; }
/* The shell's .card is a transparent wrapper, not a second enclosing panel. */
main.card { background: transparent; border: 0; padding: 0; min-width: 0; }
.meta-block { min-width: 0; margin-bottom: 18px; overflow-wrap: anywhere; }
.auth-panel { max-width: 540px; margin: 0 auto 18px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.detail-main, .detail-side { min-width: 0; }
.detail-side .section-title { flex-wrap: wrap; }
.page-head, .list-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin: 0 0 24px; }
.page-head-main { min-width: 0; flex: 1; }
.page-head h1, .list-head h1 { margin-bottom: 6px; }
.sub { font-size: 14px; color: var(--le-muted); }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: var(--le-hit-size); color: var(--le-muted); text-decoration: none; }
.back:hover { color: var(--le-text); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 18px; }
.section-title h2 { margin: 0; }
.params-title { margin-top: 0; }
.hint, .helptext, .rules, .owner, .lifecycle-mini { font-size: 12px; color: var(--le-muted); line-height: 1.7; }
.helptext { display: block; margin-top: 6px; }
.rules { margin: 10px 0 0; }
.email, .quote-note, .rb-text { overflow-wrap: anywhere; }
.divider { border: 0; border-top: 1px solid var(--le-border); margin: 24px 0; }

/* Native forms: stronger lavender contours are not decorative panel borders. */
label { display: block; margin-bottom: 8px; color: var(--le-text); }
input[type=file] { padding: 0; border: 0; background: transparent; }
input[type=file]::file-selector-button {
  min-height: var(--le-hit-size); margin-right: 12px; padding: 8px 12px;
  background: var(--le-background); color: var(--le-text); font: inherit;
  border: 1px solid var(--le-secondary); border-radius: var(--le-radius-control);
  cursor: pointer;
}
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field label { margin: 0 0 8px; }
.meta-block > label, .create-form > label, .price-form label { margin: 18px 0 8px; }
.meta-block > label:first-of-type, .create-form > label:first-of-type { margin-top: 0; }
.form-errors { color: var(--le-error); }
input:not([type=radio]):not([type=checkbox]):not([type=range]):not([type=hidden]), textarea, select {
  display: block; width: 100%; min-width: 0; min-height: var(--le-control-height);
  padding: 11px 12px; background: var(--le-background); color: var(--le-text);
  border: 1px solid var(--le-secondary); border-radius: var(--le-radius-control); line-height: 1.6;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--le-muted); opacity: .85; }
input[type=checkbox], input[type=radio] { accent-color: var(--le-primary); }
input[type=file] { overflow: hidden; }
input[type=file]::file-selector-button {
  min-height: var(--le-hit-size); margin: -5px 12px -5px -6px; padding: 6px 12px;
  background: var(--le-background); color: var(--le-text); border: 1px solid var(--le-secondary);
  border-radius: var(--le-radius-control); font: inherit; cursor: pointer;
}
input[readonly], textarea[readonly] { color: var(--le-muted); border-color: var(--le-border); }
input:disabled, textarea:disabled, select:disabled { opacity: .55; cursor: not-allowed; }
input[aria-invalid=true], textarea[aria-invalid=true], select[aria-invalid=true] { border-color: var(--le-error); }
.errorlist { color: var(--le-error); margin: 8px 0 18px; padding-left: 20px; }
.notice { color: var(--le-warning); }
.success { color: var(--le-success); }

/* Only explicitly selected primary actions receive the coral edge/glow. */
button, .btn, .upload-btn, .btn-recalc {
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  min-height: var(--le-control-height); min-width: var(--le-hit-size); padding: 10px 17px;
  border: 1px solid var(--le-secondary); border-radius: var(--le-radius-control);
  background: var(--le-background); color: var(--le-text); font-size: 14px; font-weight: 550;
  line-height: 1.4; text-align: center; text-decoration: none;
  transition: transform .15s, border-color .15s, background .15s;
}
.btn:hover { text-decoration: none; }
button:hover:not(:disabled), .btn:hover { border-color: var(--le-text); }
.btn.primary, .upload-btn {
  background: var(--le-background); color: var(--le-primary); border-color: var(--le-primary);
  box-shadow: 0 0 20px rgb(var(--le-glow-rgb) / var(--le-glow-alpha)), inset 0 0 8px rgb(var(--le-glow-rgb) / .06);
}
.btn.primary:hover:not(:disabled), .upload-btn:hover:not(:disabled) { border-color: var(--le-primary); transform: translateY(-1px); }
.btn.primary:active:not(:disabled), .upload-btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary[aria-pressed=true] { background: color-mix(in srgb, var(--le-primary) 12%, var(--le-background)); }
.quiet, .btn.quiet, .quiet-btn { background: var(--le-background); color: var(--le-text); box-shadow: none; }
.btn.small, .btn-recalc { font-size: 13px; }
.btn-recalc { margin: 4px 0 8px; color: var(--le-secondary); }
.btn.danger { background: var(--le-background); color: var(--le-error); border-color: var(--le-error); box-shadow: none; }
.btn.complete-btn { background: var(--le-background); color: var(--le-success); border-color: var(--le-success); box-shadow: none; }
button:disabled, .btn[aria-disabled=true] { cursor: not-allowed; opacity: .45; box-shadow: none; transform: none; }
.btn svg, .order-ico svg, .k-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Three kind branches retain .on and .show for portal-kind.js. */
.kind-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.kind {
  position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); align-content: start; gap: 6px 10px;
  min-height: 108px; padding: 16px 14px; margin: 0; background: var(--le-background);
  border: 1px solid var(--le-secondary); border-radius: var(--le-radius-control); cursor: pointer;
  transition: border-color .15s;
}
.kind input { position: static; opacity: 1; width: 16px; height: 16px; margin: 4px 0 0; grid-column: 1; grid-row: 1; }
.kind .k-ico { display: none; }
.kind .k-title { grid-column: 2; font-size: 14px; font-weight: 500; line-height: 1.5; }
.kind .k-sub { grid-column: 2; font-size: 12px; color: var(--le-muted); line-height: 1.6; }
.kind:hover { border-color: var(--le-text); }
.kind.on, .kind:has(input:checked) { border-color: var(--le-primary); }
.kind.on .k-title, .kind:has(input:checked) .k-title { color: var(--le-primary); }
.kind:has(input:focus-visible) { outline: 2px solid var(--le-text); outline-offset: 4px; }
.kind .k-check { position: absolute; top: 8px; right: 10px; color: var(--le-primary); font-size: 12px; }
.block { display: none; }
.block.show { display: block; }
.example-details {
  margin: 18px 0; padding: 14px 16px; background: var(--le-background);
  border: 1px solid var(--le-border); border-radius: var(--le-radius-control);
  font-size: 13px; line-height: 1.8; color: var(--le-muted);
}
.example-details summary { min-height: var(--le-hit-size); cursor: pointer; color: var(--le-text); font-weight: 500; }
.example { margin-top: 12px; font-size: 13px; color: var(--le-muted); }
.example .ex-title, .example b { color: var(--le-text); font-weight: 500; }
.example ul { margin: 8px 0; padding-left: 18px; }
.example li { margin: 4px 0; }
.example .ex-note { margin-top: 8px; font-size: 12px; }

/* Lists and account/trash compatibility. */
.list-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.arch-toggle { display: flex; align-items: center; gap: 8px; margin: 0; }
.arch-label { color: var(--le-muted); font-size: 13px; }
.switch { position: relative; display: inline-block; width: 57px; height: var(--le-hit-size); margin: 0; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; z-index: 1; cursor: pointer; }
.switch .slider { position: absolute; left: 0; right: 0; top: 8px; height: 28px; background: var(--le-background); border: 1px solid var(--le-secondary); border-radius: var(--le-radius-control); }
.switch .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 5px; top: 4px; border-radius: 3.5px; background: var(--le-muted); transition: transform .2s, background .2s; }
.switch input:checked + .slider { border-color: var(--le-primary); background: color-mix(in srgb, var(--le-primary) 12%, var(--le-background)); }
.switch input:checked + .slider::before { transform: translateX(26px); background: var(--le-primary); border-radius: 50%; box-shadow: 0 0 15px rgb(var(--le-glow-rgb) / var(--le-glow-alpha)); }
.switch input:focus-visible + .slider { outline: 2px solid var(--le-text); outline-offset: 4px; }
.order-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 22px 24px; margin-bottom: 12px; text-decoration: none; color: var(--le-text); transition: border-color .15s; }
.order-card:hover { border-color: var(--le-secondary); text-decoration: none; }
.order-ico { align-self: start; display: grid; place-items: center; width: 44px; height: 44px; background: var(--le-background); border: 1px solid var(--le-border); border-radius: var(--le-radius-control); color: var(--le-secondary); font-size: 22px; }
.order-ico svg { width: 22px; height: 22px; }
.order-main { min-width: 0; }
.order-title { margin-bottom: 6px; font-size: 18px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.order-comment { color: var(--le-muted); font-size: 14px; overflow-wrap: anywhere; }
.order-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: 12px; color: var(--le-muted); }
.order-next { min-width: 145px; text-align: right; font-size: 13px; color: var(--le-primary); line-height: 1.5; }
.order-next small { display: block; color: var(--le-muted); font-size: 12px; margin-bottom: 6px; }
.owner { margin-top: 8px; overflow-wrap: anywhere; }
.chev { color: var(--le-primary); font-size: 20px; }
.order-next .chev { margin-left: 8px; }
.chip, .metric-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--le-border); border-radius: 5px; background: var(--le-background); color: var(--le-muted); font-size: 12px; }
.chip b { color: var(--le-text); font-weight: 500; }
.chip.date { border-style: dashed; }
.empty { text-align: left; padding: 32px 24px; }
.empty .big { font-size: 32px; margin-bottom: 12px; }
.empty p { color: var(--le-muted); }
.trash-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--le-border); }
.trash-row:last-child { border-bottom: none; }
.trash-title { font-weight: 500; text-decoration: none; }
.trash-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.order-del { margin-left: auto; }

/* Loading and model tiles: darker than their parent panel. */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; min-width: 0; gap: 8px; padding: 18px; background: var(--le-background); border: 1px solid var(--le-border); border-radius: var(--le-radius-control); overflow-wrap: anywhere; }
.tile.pending { border-style: dashed; }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tile-ico { color: var(--le-secondary); font-size: 24px; }
.tile-del, .ref-tile .del { min-width: var(--le-hit-size); min-height: var(--le-hit-size); padding: 0; color: var(--le-muted); background: var(--le-background); border-color: var(--le-secondary); }
.tile-del:hover, .ref-tile .del:hover { color: var(--le-error); border-color: var(--le-error); }
.tile-name { font-weight: 500; overflow-wrap: anywhere; }
.tile-meta { font-size: 12px; color: var(--le-muted); line-height: 1.8; }
.tile-qty { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--le-border); }
.tile-qty form { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0; padding: 0; border: 0; }
.tile-qty label { margin: 0; font-size: 13px; }
.tile-qty input { max-width: 85px; text-align: center; }
.tile-qty input:disabled { opacity: .55; cursor: not-allowed; }
.tile-dl { display: inline-flex; align-items: center; min-height: var(--le-hit-size); font-size: 13px; align-self: flex-start; }
.tile.add { border: 1px dashed var(--le-secondary); min-height: 180px; justify-content: center; align-items: center; text-align: center; color: var(--le-muted); }
.tile.add .plus { font-size: 28px; line-height: 1; }
.tile.add .rules { text-align: center; }
.upload-form { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; }
.upload-form label { margin: 0; }
.upload-form input[type=number] { max-width: 90px; align-self: center; text-align: center; }
.upload-busy { opacity: .85; cursor: progress; }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--le-primary); border-right-color: transparent; border-radius: 50%; vertical-align: middle; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.tile-busy { position: relative; }
.tile-busy::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgb(32 32 57 / .35); pointer-events: none; }
.metric-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.metric-chip.dim { color: var(--le-muted); }
.models-block { min-width: 0; }
.review-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; padding: 14px 16px; border: 1px solid var(--le-secondary); border-radius: var(--le-radius-control); background: var(--le-background); }
.review-box .rb-text { font-size: 14px; }
.tile-grid > .review-box { grid-column: 1 / -1; }

/* Tooltip rule preserves the exact clamp API and 290px portal-tip.js width. */
.hint-ico { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: var(--le-hit-size); min-height: var(--le-hit-size); margin-left: 2px; border-radius: var(--le-radius-control); border: 1px solid var(--le-secondary); background: var(--le-background); color: var(--le-muted); font-size: 12px; cursor: help; }
.hint-ico:hover, .hint-ico:focus { color: var(--le-text); }
.hint-ico:hover::after,.hint-ico:focus::after{
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px);
  left: var(--tip-left,50%); transform: translateX(var(--tip-shift,-50%)); width:290px;
  max-width: calc(100vw - 16px); padding: 12px 14px; background: var(--le-background);
  border: 1px solid var(--le-secondary); border-radius: var(--le-radius-panel);
  font-size: 12px; line-height: 1.7; font-weight: 400; color: var(--le-text);
  text-align: left; white-space: normal; z-index: 50;
}

/* Parameters retain the native range's keyboard/touch semantics. */
.print-params .range-row { display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--le-border); }
.print-params .range-row:last-child { border-bottom: none; }
.print-params .range-row label { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: 14px; min-width: 0; }
.print-params select { max-width: 100%; }
.range-wrap { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.range-wrap input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; min-width: 0;
  height: var(--le-hit-size); margin: 0; padding: 0; border: 0;
  background: transparent;
  background-image: linear-gradient(var(--le-border), var(--le-border));
  background-size: 100% 6px; background-repeat: no-repeat; background-position: center;
  accent-color: var(--le-primary); cursor: pointer;
}
.range-wrap input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: transparent; }
.range-wrap input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; margin-top: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--le-primary); border: 2px solid var(--le-background); }
.range-wrap input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: transparent; }
.range-wrap input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--le-primary); border: 2px solid var(--le-background); }
.range-val { color: var(--le-primary); min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

/* Quotes, production, references and readonly delivery. */
.quote-amount, .est-range { margin: 6px 0 14px; font-size: 30px; font-weight: 500; line-height: 1.3; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.quote-box { overflow-wrap: anywhere; }
.estimate-box { overflow-wrap: anywhere; }
.quote-note { color: var(--le-muted); margin-bottom: 18px; }
.quote-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.price-form { margin-top: 12px; }
.price-form > button { margin-top: 18px; }
.est-title { font-size: 12px; color: var(--le-muted); margin-bottom: 6px; }
.est-range small { font-size: 14px; font-weight: 400; color: var(--le-muted); }
.est-brakedown { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; font-size: 13px; color: var(--le-muted); }
.est-explain { margin-top: 8px; color: var(--le-muted); font-size: 12px; line-height: 1.8; }
.est-note { margin: 12px 0 0; color: var(--le-warning); font-size: 12px; }
.autoprobe-note { margin-top: 12px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; }
.inline-form input:not([type=hidden]), .inline-form select { flex: 1 1 160px; width: auto; }
.inline-form input[type=file] { max-width: 100%; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.photo { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--le-border); border-radius: var(--le-radius-control); background: var(--le-background) center/cover; }
.photo .cap { position: absolute; bottom: 0; left: 0; right: 0; padding: 8px 10px; font-size: 12px; color: var(--le-text); background: var(--le-background); overflow-wrap: anywhere; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr)); gap: 10px; margin: 12px 0 4px; }
.ref-tile { position: relative; display: flex; align-items: center; justify-content: center; min-height: 110px; padding: 18px 12px; background: var(--le-background); border: 1px solid var(--le-border); border-radius: var(--le-radius-control); color: var(--le-muted); font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.ref-tile img { max-width: 100%; max-height: 96px; border-radius: 5px; }
.ref-tile .del { position: absolute; top: 4px; right: 4px; }
.ref-add { border-style: dashed; border-color: var(--le-secondary); }
.delivery-box .row { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--le-border); overflow-wrap: anywhere; }
.delivery-box .row:last-of-type { border-bottom: none; }
.delivery-box .row > span { color: var(--le-muted); }
.track-box { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-top: 12px; border: 1px solid var(--le-success); border-radius: var(--le-radius-control); background: var(--le-background); }
.track-box .num { color: var(--le-success); font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* Legacy staff stepper, if rendered by an older page. */
.production-box .stepper { display: flex; overflow-x: auto; margin: 14px 0 6px; }
.production-box .step { position: relative; flex: 1; min-width: 90px; text-align: center; }
.production-box .step .dot { position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; margin: 0 auto 6px; border: 1px solid var(--le-secondary); border-radius: 50%; background: var(--le-background); color: var(--le-muted); font-size: 13px; }
.production-box .step::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 1px; background: var(--le-border); }
.production-box .step:first-child::before { display: none; }
.production-box .step.done .dot { color: var(--le-success); border-color: var(--le-success); }
.production-box .step.active .dot { color: var(--le-primary); border-color: var(--le-primary); }
.production-box .step .lbl { color: var(--le-muted); font-size: 12px; }
.production-box .step.active .lbl { color: var(--le-text); }
.production-box .step .when { color: var(--le-muted); font-size: 11px; }

/* Semantics are communicated by existing text/icons as well as distinct colors. */
.state { display: inline-flex; align-items: center; align-self: flex-start; gap: 7px; color: var(--le-muted); font-size: 12px; line-height: 1.6; }
.state::before { content: ""; width: 6px; height: 6px; border: 1px solid currentColor; border-radius: 50%; flex-shrink: 0; }
.state.ok, .state.done { color: var(--le-success); }
.state.wait { color: var(--le-warning); }
.state.active { color: var(--le-primary); }
.state.active::before { background: currentColor; }
.state-banner, .flash { margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--le-secondary); border-radius: var(--le-radius-control); background: var(--le-background); color: var(--le-muted); font-size: 14px; }
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.flash-stack .flash { margin-bottom: 0; }
.flash, .flash.success, .state-banner.ok, .chip.ok, .metric-chip.ok { color: var(--le-success); border-color: var(--le-success); background: var(--le-success-surface); }
.flash.error, .state-banner.error, .chip.error { color: var(--le-error); border-color: var(--le-error); background: var(--le-error-surface); }
.flash.warning, .state-banner.wait, .chip.wait, .chip.warn { color: var(--le-warning); border-color: var(--le-warning); background: var(--le-warning-surface); }
.flash.info { color: var(--le-secondary); border-color: var(--le-secondary); background: var(--le-background); }

/* Opaque sticky lifecycle: one horizontally scrollable track, all kinds/states. */
.lifecycle-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 14px 0 18px; background: var(--le-background); border-top: 1px solid var(--le-secondary); }
.lifecycle-foot .lf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; max-width: 1080px; margin: 0 auto 10px; padding: 0 32px; font-size: 12px; }
.lifecycle-foot .lf-title { font-weight: 500; color: var(--le-text); }
.lifecycle-foot .lf-caption { color: var(--le-primary); }
.lifecycle-foot .lf-track { display: flex; align-items: center; gap: 9px; flex-wrap: nowrap; max-width: 1080px; margin: 0 auto; padding: 2px 32px 8px; overflow-x: auto; scrollbar-width: thin; }
.lf-step { flex-shrink: 0; white-space: nowrap; padding: 7px 9px; border: 1px solid transparent; border-radius: 5px; color: var(--le-muted); font-size: 11px; }
.lf-step.lf-done { color: var(--le-text); }
.lf-step.lf-active { color: var(--le-primary); border-color: var(--le-primary); background: var(--le-surface); }
.lf-arrow { flex-shrink: 0; color: var(--le-secondary); font-size: 11px; }
.lf-step.lf-idle { color: var(--le-muted); }
.lifecycle-mini { margin: 2px 0 10px; }
body.has-lifecycle-foot { padding-bottom: 150px; }
html:has(body.has-lifecycle-foot) { scroll-padding-bottom: 150px; }
.save-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; padding: 18px; margin-top: 22px; background: var(--le-background); border: 1px solid var(--le-border); border-radius: var(--le-radius-panel); }
.save-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--le-success); flex: none; }
.save-bar .note { flex: 1 1 180px; font-size: 12px; color: var(--le-muted); }
.save-bar button { margin-left: auto; }
.detail-side .save-bar { flex-direction: column; align-items: stretch; }
.detail-side .save-bar .note { flex-basis: auto; }
.detail-side .save-bar button { margin-left: 0; width: 100%; }
.draft-actions .save-bar { position: static; flex-direction: column; align-items: stretch; padding: 0; margin-top: 0; border: 0; border-radius: 0; background: transparent; }
.draft-actions .save-bar .dot { display: none; }

@media (max-width: 840px) {
  .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .list-head { flex-direction: column; }
  .list-actions { width: 100%; }
  .list-actions .arch-toggle { margin-right: auto; }
  .kind-switch { grid-template-columns: minmax(0, 1fr); }
  .kind { min-height: 78px; }
  .order-card { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; }
  .order-next { grid-column: 2; min-width: 0; text-align: left; }
  .order-next small { display: none; }
  .order-card > .chev { grid-column: 2; }
}
@media (max-width: 520px) {
  .shell { padding: 20px 18px 32px; }
  header, .topbar { align-items: flex-start; gap: 12px; padding-bottom: 18px; }
  .brand { font-size: 21px; gap: 8px; }
  .brand span { font-size: 14px; }
  .brand-group { gap: 8px; }
  .brand-symbol svg, .brand svg, .brand-mark, .brand-logo { width: 28px; height: 28px; }
  .badge { font-size: 10px; max-width: 88px; }
  nav { gap: 18px; padding-bottom: 18px; }
  nav form { margin-left: 0; }
  .meta-block, .create-form, .empty { padding: 20px; }
  .order-card { padding: 18px 16px; }
  .order-title { font-size: 17px; }
  .order-comment, .sub { font-size: 13px; }
  .list-actions { gap: 10px; }
  .list-actions .btn.primary { width: 100%; }
  .section-title { align-items: flex-start; flex-direction: column; gap: 4px; }
  .page-head { gap: 16px; }
  .detail-head { flex-direction: column; align-items: stretch; }
  .order-del { margin-left: 0; }
  .print-params .range-row { align-items: stretch; flex-direction: column; }
  .quote-actions { flex-direction: column; }
  .quote-actions .btn { width: 100%; }
  .trash-row { align-items: flex-start; flex-direction: column; }
  .trash-side { flex-wrap: wrap; }
  .save-bar { align-items: stretch; flex-direction: column; }
  .save-bar .note { flex-basis: auto; }
  .save-bar .dot { display: none; }
  .save-bar button { width: 100%; margin-left: 0; }
  .lifecycle-foot .lf-head { padding: 0 18px; font-size: 11px; }
  .lifecycle-foot .lf-track { padding-left: 18px; padding-right: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .spin { animation: none; }
}
