/* finesse · product · white and lilac-blue · shared workspace with canvas and settings */
:root {
  color-scheme: light;
  --workspace-bg: #fff;
  --panel: #fff;
  --surface: #f5f6fb;
  --well: #ececf6;
  --ink: #201d36;
  --secondary: #55516e;
  --quiet: #68647b;
  --line: #dadae9;
  --line-soft: #ebebf3;
  --accent: #5149b4;
  --accent-strong: #40358e;
  --accent-soft: #efedfc;
  --accent-border: #bbb5e1;
  --accent-deep: #2d2e6d;
  --accent-fg: #fcfbff;
  --success: #285e4a;
  --error: #963f37;
  --error-soft: #f9eeed;
  /* Light comes from the upper left at every elevation. */
  --shadow-panel: 2px 3px 6px rgba(28, 48, 80, .055), 7px 11px 22px -5px rgba(28, 48, 80, .145);
  --shadow-control: 1px 1px 2px rgba(28, 48, 80, .065), 2px 3px 6px -2px rgba(28, 48, 80, .12);
  --shadow-dialog: 6px 9px 20px rgba(28, 48, 80, .13), 15px 23px 48px -7px rgba(28, 48, 80, .26);
  --radius: 20px;
  --small: 11px;
  font: 100% system-ui, "PingFang SC", "Microsoft YaHei UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; background: var(--workspace-bg); }
body { margin: 0; color: var(--ink); line-height: 1.55; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary, input[type="checkbox"] { cursor: pointer; }
:disabled { cursor: default; }
button, a, summary, label { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 1.0625rem; font-weight: 720; line-height: 1.35; }
h3, legend { font-size: .875rem; font-weight: 680; line-height: 1.4; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header { background: var(--workspace-bg); border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 8; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand { width: fit-content; font-weight: 760; font-size: 1rem; white-space: nowrap; }
.brand-mark { position: relative; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-deep); color: var(--accent-fg); flex: none; }
.brand-mark i { position: absolute; top: 8px; left: 9px; width: 16px; height: 9px; border: 1.3px solid currentColor; border-radius: 2px; transform: skewY(-18deg); }
.brand-mark i:nth-child(2) { top: 12px; }
.brand-mark i:nth-child(3) { top: 16px; }

.button, .text-button, .connection {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 43px; padding: 6px 14px; border: 1px solid transparent; border-radius: var(--small);
  font-size: .875rem; line-height: 1.25; font-weight: 675; white-space: nowrap;
  background: transparent; transition: background-color .14s ease, border-color .14s ease;
}
.button:active:not(:disabled), .text-button:active { transform: translateY(1px); }
.text-button { color: var(--secondary); }
.text-button:hover { background: var(--surface); color: var(--ink); }
.connection, .button.secondary, .button.icon-button { border-color: var(--line); background: var(--panel); }
.button.secondary:hover, .button.icon-button:hover { background: var(--surface); border-color: #b5c5dd; }
.connection { min-height: 37px; padding-inline: 10px; font-size: .82rem; }
.signal { border-radius: 50%; width: 7px; height: 7px; background: #6f8098; flex: none; }
.connection[data-state="verified"] .signal { background: var(--success); }
.connection[data-state="pending"] .signal, .connection[data-state="limited"] .signal { background: #a47124; }
.button.primary { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.button.primary:hover:not(:disabled) { background: var(--accent-strong); }
.button.primary:disabled { color: var(--quiet); background: var(--well); }
.button.secondary:disabled { color: var(--quiet); background: var(--surface); }
.button.ink { background: var(--accent-deep); color: var(--accent-fg); }
.button.ink:hover { background: var(--accent-strong); }
.button.icon-button { width: 43px; padding: 0; font-size: 1.25rem; }
.inline-link { color: var(--accent-strong); font-weight: 675; }
a.inline-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.wide { width: 100%; }

.workspace { max-width: 1512px; margin-inline: auto; padding: 30px clamp(20px, 4vw, 60px) 26px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 20px; }
.page-title { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
.page-heading h1 { font-weight: 765; font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.15; letter-spacing: -.045em; overflow-wrap: anywhere; }
.release-version { color: var(--quiet); font-size: .78rem; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.page-heading p { margin-top: 7px; color: var(--secondary); font-size: .9375rem; text-wrap: pretty; }
.panel { min-width: 0; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-panel); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 19px 20px 13px; }
.panel-heading p { margin-top: 3px; color: var(--quiet); font-size: .83rem; overflow-wrap: anywhere; }
.layout, .studio-layout { display: grid; gap: 14px 18px; align-items: start; }
.layout {
  grid-template-columns: clamp(270px, 22vw, 320px) minmax(0,1fr) clamp(268px, 24vw, 336px);
  grid-template-areas:
    "settings preview output"
    "settings layers  output";
  grid-template-rows: auto 1fr;
}
.layout > .setup { grid-area: settings; }
.layout > .preview-panel { grid-area: preview; }
.layout > .layer-panel { grid-area: layers; }
.prepress-rail, .studio-rail { display: grid; gap: 14px; min-width: 0; }
.prepress-rail { grid-area: output; }
.studio-layout {
  grid-template-columns: minmax(0,1fr) clamp(318px, 29vw, 392px);
  grid-template-areas: "canvas inspector";
}
.studio-preview { grid-area: canvas; }
.studio-rail { grid-area: inspector; }

.preview-panel { overflow: hidden; }
.preview-heading .icon-button { align-self: flex-start; }
.expand-icon {
  display: block; width: 15px; height: 15px; border: 1.5px solid currentColor; border-radius: 2px;
  clip-path: polygon(0 0,34% 0,34% 32%,66% 32%,66% 0,100% 0,100% 34%,68% 34%,68% 66%,100% 66%,100% 100%,66% 100%,66% 68%,34% 68%,34% 100%,0 100%,0 66%,32% 66%,32% 34%,0 34%);
}
.views {
  padding: 0 20px 9px; display: flex; align-items: center; gap: 4px;
  min-height: 48px; overflow-x: auto; scrollbar-width: thin;
}
.view-button { border: 1px solid transparent; border-radius: 8px; background: transparent; min-height: 35px; padding: 3px 9px; font-size: .855rem; font-weight: 670; white-space: nowrap; color: var(--secondary); }
.view-button:hover { background: var(--surface); }
.view-button[aria-pressed="true"] { color: var(--accent-strong); background: var(--accent-soft); }
.view-button:focus-visible { outline-offset: -2px; }
.preview-output-picker { justify-content: flex-start; margin: 0 20px 9px; }
.preview-output-picker select { min-width: 0; max-width: min(78%, 18rem); }
.mat { margin: 0 13px 7px; padding: 10px 10px 7px; display: grid; gap: 7px; border-radius: 15px; background: var(--well); }
.scale-x, .scale-y { display: none; }
.artboard, .zoom-content {
  background: repeating-conic-gradient(#fafbfd 0 25%, #f2f5f9 0 50%) 0 / 24px 24px;
}
.artboard {
  position: relative; display: grid; place-items: center; min-width: 0; min-height: clamp(235px, 38vh, 403px);
  padding: clamp(14px, 3.2vw, 42px); border: 1px solid var(--line); border-radius: 10px;
}
.studio-artboard { min-height: clamp(270px, 47vh, 460px); }
.artboard img { width: 100%; max-height: 354px; height: auto; object-fit: contain; }
#measure-outline { position: absolute; border: 2px dashed var(--accent); pointer-events: none; z-index: 2; }
.preflight-panel dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 10px; }
.preflight-panel dd { margin: 0; overflow-wrap: anywhere; }
.preflight-panel ul:empty { display: none; }
.factory-inks { display: grid; gap: 5px; margin: 9px 0; }
.factory-template { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: center; }
.factory-template select { min-width: 0; }
.factory-release { margin: 0 17px 12px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.factory-release p { margin: 0 0 8px; overflow-wrap: anywhere; }
.output-options label:has(:disabled) { opacity: .65; }
.layer-stack {
  width: min(100%, calc(354px * var(--stack-aspect, 1)));
  min-width: 0;
}
.stack-frame {
  position: relative;
  aspect-ratio: var(--stack-aspect, 1);
  isolation: isolate;
  background: repeating-conic-gradient(#fafbfd 0 25%, #f2f5f9 0 50%) 0 / 24px 24px;
}
.artboard:has(.layer-stack:not([hidden])), .zoom-content:has(.layer-stack:not([hidden])) { background: var(--surface); }
.stack-images, .stack-images img { position: absolute; inset: 0; width: 100%; height: 100%; }
.stack-images img { max-width: none; max-height: none; object-fit: fill; pointer-events: none; }
.process-stack {
  margin-top: 14px;
  border-radius: 9px;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-control);
  overflow: hidden;
}
.process-stack-heading {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 3px 12px; padding: 5px 9px; font-size: .78rem; color: var(--secondary);
  border-bottom: 1px solid var(--line-soft);
}
.process-stack-heading span { color: var(--quiet); overflow-wrap: anywhere; }
.layer-stack .stack-message {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); z-index: 1;
  width: max-content; max-width: max(140px, 95%); padding: 7px 10px; border-radius: 8px;
  background: var(--panel); color: var(--quiet); box-shadow: var(--shadow-control);
  font-size: .79rem; text-align: center;
}
.output-proof-details {
  padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 9px;
  background: var(--panel); color: var(--secondary); font-size: .82rem; overflow-wrap: anywhere;
}
.output-proof-details ul { margin: 4px 0 0; padding-inline-start: 18px; }
.studio-artboard img { max-height: 418px; }
.artboard p { color: var(--quiet); padding: 8px 12px; border-radius: 8px; background: var(--panel); font-size: .87rem; }
.canvas-corner { position: absolute; width: 10px; height: 10px; border-style: solid; border-color: var(--accent-border); pointer-events: none; }
.corner-tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-radius: 9px 0 0; }
.corner-br { right: -1px; bottom: -1px; border-width: 0 2px 2px 0; border-radius: 0 0 9px; }
.mat-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 3px; min-height: 19px; font-size: .78rem; color: var(--quiet); }
.mat-label > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-label > span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.specifications { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 0; padding: 10px 18px 16px; }
.specifications div + div { border-left: 1px solid var(--line-soft); padding-left: 13px; }
.specifications dt { color: var(--quiet); font-size: .77rem; }
.specifications dd { margin: 2px 0 0; font-weight: 710; font-size: .95rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sizing-note[data-error="true"] { color: var(--error); }
.candidate-section { padding: 9px 19px 13px; }
.candidate-section h3 { margin-bottom: 8px; }
.candidate-strip { display: flex; flex-wrap: wrap; gap: 7px; }
.candidate {
  width: 105px; padding: 5px; display: grid; gap: 4px; background: var(--panel);
  color: var(--secondary); border: 1px solid var(--line); border-radius: 10px; white-space: nowrap;
  font-size: .78rem; font-weight: 675;
}
.candidate img { width: 100%; height: 49px; object-fit: contain; background: var(--surface); border-radius: 5px; }
.candidate:hover, .candidate[aria-pressed="true"] { border-color: var(--accent-border); color: var(--accent-strong); }
.candidate[aria-pressed="true"] { background: var(--accent-soft); }
.selection-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 19px; padding-block: 12px; border-top: 1px solid var(--line-soft); }
.selection-footer p { color: var(--secondary); font-size: .86rem; overflow-wrap: anywhere; }
.selection-footer .button { color: var(--accent-strong); }
.studio-history ul { list-style: none; margin: 4px 0 0; padding: 0; }
.studio-history li + li { border-top: 1px solid var(--line-soft); }
.studio-history .text-button { padding-inline: 0; }

.segmented { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 3px; gap: 3px; background: var(--surface); border-radius: 10px; }
.studio-modes { margin-inline: 18px; }
.segmented label { position: relative; min-width: 0; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; }
.segmented span, .studio-modes button { display: grid; place-items: center; width: 100%; min-height: 36px; padding: 3px 4px; border: 0; border-radius: 7px; color: var(--secondary); background: transparent; font-size: .84rem; font-weight: 680; white-space: nowrap; }
.segmented input:checked + span, .studio-modes button[aria-pressed="true"] { background: var(--panel); color: var(--accent-strong); }
.segmented input:disabled + span { color: #788497; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.studio-form { padding: 14px 18px 9px; }
.stack-label { display: block; margin-bottom: 5px; font-size: .9rem; font-weight: 685; }
.prompt-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; }
.prompt-heading .stack-label { margin: 0; }
.brief-entry { min-height: 34px; padding-inline: 10px; color: var(--accent-strong); font-size: .82rem; }
.field-note { margin-top: 5px; font-size: .81rem; color: var(--quiet); overflow-wrap: anywhere; }
.studio-fields { margin-top: 13px; }
.reference-fold { padding-block: 9px; margin-top: 10px; border-top: 1px solid var(--line-soft); }
.reference-fold summary, .advanced summary, .checks summary { font-size: .86rem; font-weight: 675; color: var(--secondary); }
.reference-fold summary:hover, .advanced summary:hover, .checks summary:hover { color: var(--accent-strong); }
.reference-fold summary small { margin-left: 5px; color: var(--quiet); font-weight: 500; }
.create-action { margin-top: 7px; }
.provider-help { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: .81rem; color: var(--quiet); }
.provider-help p:empty { display: none; }
#task-status { margin: 4px 18px 12px; }
#task-status, #ai-status, #connect-status { color: var(--quiet); font-size: .81rem; overflow-wrap: anywhere; }
#task-status[data-error="true"], #ai-status[data-error="true"], #connect-status[data-error="true"] { color: var(--error); font-weight: 650; }
#connect-status:empty { display: none; }
.form-section { min-width: 0; margin: 0; border: 0; border-top: 1px solid var(--line-soft); padding: 11px 18px; }
.form-section > h3 { margin-bottom: 7px; }
.form-section legend { width: 100%; padding: 8px 0 0; }
.form-section:has(legend) { padding-top: 6px; }
.source-section { padding-top: 8px; }
.dropzone {
  width: 100%; display: flex; align-items: center; justify-content: center; text-align: left; gap: 9px;
  min-height: 68px; padding: 8px 10px; border: 1px dashed #b5c5dd; border-radius: var(--small); background: var(--surface);
}
.dropzone strong, .dropzone small { display: block; }
.dropzone strong { font-size: .89rem; }
.dropzone small { color: var(--quiet); font-size: .75rem; }
.dropzone:hover, .dropzone.dragging { background: var(--accent-soft); border-color: var(--accent); }
.studio-drop { min-height: 115px; }
.upload-icon { display: grid; place-items: center; flex: none; width: 31px; height: 31px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-strong); }
.source-file { display: flex; align-items: center; gap: 9px; padding-top: 8px; }
.source-file img { width: 54px; height: 31px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.source-file > div { min-width: 0; }
.source-file strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.source-file small, .file-setting small { display: block; font-size: .76rem; color: var(--quiet); overflow-wrap: anywhere; }
.row { display: flex; align-items: center; gap: 6px; }
input[type="number"], input[type="password"], select, textarea {
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel);
  min-height: 40px; width: 100%; min-width: 0; padding: 6px 9px;
}
input[type="number"] { font-variant-numeric: tabular-nums; font-weight: 675; appearance: textfield; }
input::-webkit-inner-spin-button { appearance: none; }
select {
  appearance: none; padding-right: 24px; font-size: .87rem; background-color: var(--panel);
  background-image: linear-gradient(45deg, transparent 50%, var(--quiet) 50%), linear-gradient(135deg, var(--quiet) 50%, transparent 50%);
  background-position: calc(100% - 12px) 54%, calc(100% - 8px) 54%; background-size: 4px 4px; background-repeat: no-repeat;
}
textarea { resize: vertical; display: block; padding: 8px 10px; font-size: .91rem; }
textarea::placeholder { color: #66768e; }
.size-row select { flex: 0 0 49px; }
.unit-field { min-width: 0; width: 100%; display: flex; align-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 9px; padding-right: 7px; background: var(--panel); }
.unit-field input { min-height: 38px; border: 0; background: transparent; }
.unit-field > span:not(.sr-only) { font-size: .72rem; white-space: nowrap; color: var(--quiet); }
.unit-field:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.unit-field:focus-within input { outline: none; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px 9px; margin-top: 8px; }
.field-grid > label:not(.field-inline) { display: grid; gap: 4px; font-size: .8rem; color: var(--secondary); }
.field-grid input, .field-grid select { color: var(--ink); }
.field-inline { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 7px; color: var(--secondary); font-size: .82rem; }
.field-inline select { width: auto; min-height: 36px; max-width: 62%; color: var(--ink); }
.field-wide { grid-column: 1 / -1; margin-top: 0; }
.toggle-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 30px; font-weight: 675; font-size: .88rem; cursor: pointer; }
.toggle-row > input { position: absolute; right: 0; width: 38px; min-height: 33px; opacity: 0; margin: 0; z-index: 1; }
.toggle { display: block; width: 37px; height: 21px; padding: 2px; border-radius: 14px; background: #74829a; }
.toggle::before { content: ""; display: block; width: 17px; height: 17px; border-radius: 50%; background: #f8fbff; transition: transform .14s ease; }
.toggle-row input:checked + .toggle { background: var(--accent); }
.toggle-row input:checked + .toggle::before { transform: translateX(16px); }
.toggle-row input:focus-visible + .toggle { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-row input:disabled + .toggle { opacity: .52; }
input[type="checkbox"] { accent-color: var(--accent); }
.check-row { display: flex; align-items: center; gap: 5px; font-size: .82rem; margin-top: 9px; }
.file-setting { min-width: 0; padding-top: 8px; margin-top: 5px; font-size: .82rem; border-top: 1px solid var(--line-soft); }
.file-setting > label:not(.sr-only) { display: block; font-weight: 650; margin-bottom: 4px; }
.file-setting input[type="file"] { max-width: 100%; display: block; font-size: .78rem; color: var(--quiet); }
.file-setting small { margin-top: 4px; }
.file-setting .clear { min-height: 30px; padding-inline: 4px; color: var(--accent-strong); }
input::file-selector-button { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; margin-right: 6px; cursor: pointer; font: inherit; box-shadow: var(--shadow-control); }
.advanced-content { display: grid; gap: 7px; margin-top: 7px; }
.form-footer { display: flex; flex-wrap: wrap; gap: 2px; justify-content: space-between; padding: 2px 10px 5px; border-top: 1px solid var(--line-soft); }

.count { font-size: .77rem; color: var(--quiet); font-weight: 630; white-space: nowrap; font-variant-numeric: tabular-nums; }
.quote-panel .panel-heading, .studio-cost .panel-heading { padding-bottom: 8px; }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 0 12px 4px; }
.presets .text-button { min-height: 33px; padding: 3px 7px; font-size: .82rem; color: var(--accent-strong); }
.output-options { min-width: 0; border: 0; margin: 0; padding: 0 17px 12px; }
#output-checkboxes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; }
.output-options label {
  display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 6px;
  border: 1px solid var(--line-soft); border-radius: 8px; font-size: .79rem; font-weight: 635; line-height: 1.26; cursor: pointer;
}
.output-options label:has(:checked) { background: var(--surface); border-color: var(--line); }
.output-options label.previewing { border-color: var(--accent); }
.presets .text-button[aria-pressed="true"] { color: var(--accent-strong); background: var(--surface); text-decoration: underline; text-underline-offset: 4px; }
.output-options label input { flex: none; margin: 0; }
.output-options label span { overflow-wrap: anywhere; }
#save-output-preset { display: block; min-height: 38px; margin: -5px 17px 6px; padding-inline: 2px; border: 0; text-align: left; }
#save-output-preset:disabled { background: transparent; color: var(--quiet); }
.estimate-band { display: flex; justify-content: space-between; align-items: baseline; gap: 9px; margin: 0 17px; padding: 9px 11px; border-radius: 10px; background: var(--surface); }
.estimate-band span { font-weight: 665; font-size: .84rem; color: var(--secondary); }
.estimate-band strong { font-size: 1.42rem; line-height: 1.25; font-weight: 760; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-footnote { margin: 6px 18px 11px; font-size: .79rem; color: var(--quiet); overflow-wrap: anywhere; }
.quote-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 17px 13px; }
.quote-actions .primary { flex: 1; }
.cost-rows { list-style: none; padding: 0; margin: 6px 0 0; }
.cost-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.cost-step { min-width: 0; display: grid; gap: 1px; overflow-wrap: anywhere; }
.cost-step strong { font-size: .82rem; font-weight: 650; }
.cost-step small { color: var(--quiet); font-size: .76rem; }
.cost-amount { flex: none; font-weight: 675; font-size: .84rem; font-variant-numeric: tabular-nums; }
.actual-summary { padding: 9px 18px 13px; border-top: 1px solid var(--line-soft); font-size: .85rem; }
.actual-details summary { color: var(--secondary); margin-top: 4px; }
.downloads { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 19px 13px; }
.downloads:empty { padding: 0; }
.export-heading { flex-wrap: wrap; }
#output-status[data-error="true"] { color: var(--error); font-weight: 650; }
.download-link { display: block; align-content: center; min-height: 35px; max-width: 100%; padding: 3px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--secondary); font-size: .8rem; font-weight: 650; overflow-wrap: anywhere; }
.download-link:hover { color: var(--accent-strong); border-color: var(--accent-border); background: var(--surface); }
.checks { border-top: 1px solid var(--line-soft); padding: 9px 19px; font-size: .84rem; color: var(--secondary); }
.checks dl { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 3px 11px; margin: 8px 0; }
.checks dd { margin: 0; overflow-wrap: anywhere; }
#receipt-checks { margin: 6px 0 0; padding-left: 18px; }
#receipt-checks li { margin-bottom: 3px; }
.layers-heading { padding-bottom: 9px; }
.layer-tools { display: flex; flex-wrap: wrap; gap: 5px 10px; align-items: center; padding: 0 16px 9px; }
.layer-actions { display: flex; align-items: center; gap: 5px; }
.layer-actions .button { min-height: 34px; padding: 4px 10px; font-size: .82rem; }
#layers-inspect { min-height: 34px; padding: 3px 8px; font-size: .82rem; }
.layer-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 5px; padding: 0 16px 13px; margin: 0; }
.layer-row { width: 100%; min-width: 0; min-height: 43px; display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--panel); text-align: left; }
button.layer-row:hover { border-color: var(--accent-border); }
.layer-row[aria-pressed="true"] { background: var(--surface); color: var(--accent-strong); border-color: var(--accent-border); }
.layer-row[aria-pressed="true"] .eye { color: var(--accent-strong); }
.layer-row:disabled { color: var(--quiet); }
.layer-unavailable { color: var(--quiet); font-size: .72rem; white-space: nowrap; }
.layer-chip { width: 28px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 5px; background: var(--surface); color: var(--quiet); }
.layer-chip img { max-width: 24px; max-height: 20px; object-fit: contain; }
.layer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; font-weight: 650; }
.eye { width: 12px; height: 8px; border: 1px solid currentColor; color: var(--quiet); border-radius: 75%; flex: none; position: relative; }
.eye::before { content: ""; position: absolute; left: 3px; top: 2px; width: 4px; height: 3px; border-radius: 50%; background: currentColor; }
.eye.off::after { content: ""; position: absolute; top: 3px; left: -2px; width: 14px; height: 1px; transform: rotate(-37deg); background: currentColor; }
.empty-layers { padding: 0 19px 12px; color: var(--quiet); font-size: .86rem; }
.workspace-footer { font-size: .8rem; color: var(--quiet); margin-top: 14px; }

.modal {
  border: 1px solid var(--line); border-radius: 19px; padding: 0; width: min(92vw, 580px);
  max-height: 88dvh; background: var(--panel); color: var(--ink); box-shadow: var(--shadow-dialog);
}
.modal::backdrop { background: rgba(20, 33, 52, .49); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); }
.modal-body { padding: 16px 18px 21px; }
.help-copy h3 { margin-top: 13px; }
.help-copy h3:first-child { margin-top: 0; }
.help-copy p { margin-top: 4px; color: var(--secondary); font-size: .9rem; }
.config-state, .connection-summary { padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--surface); margin-bottom: 11px; font-size: .86rem; }
#ai-status { margin-top: 6px; }
#analyze { margin-top: 9px; }
#ai-plan { padding: 10px 11px; border-radius: 9px; background: var(--surface); font-size: .86rem; overflow-wrap: anywhere; }
#ai-plan p { margin-bottom: 4px; }
#ai-plan ul { padding-left: 17px; }
.zoom-dialog { width: min(95vw, 1530px); }
.zoom-content { min-height: 180px; max-height: 73dvh; padding: 13px; overflow: auto; }
.zoom-content img { max-width: none; }
.zoom-content .layer-stack { width: min(100%, var(--stack-zoom-width)); }
.zoom-layout.stacked { display: grid; grid-template-columns: minmax(0, 1fr) clamp(250px, 24vw, 320px); }
.zoom-content:has(.layer-stack) { display: grid; place-items: center; }
.zoom-layer-tools { min-width: 0; max-height: 73dvh; overflow: auto; border-left: 1px solid var(--line-soft); }
.zoom-layer-tools .layer-panel { border: 0; border-radius: 0; box-shadow: none; }
.zoom-layer-tools .layer-list { grid-template-columns: minmax(0, 1fr); }
.zoom-layer-tools #layers-inspect { display: none; }
.usage-row + .usage-row { border-top: 1px solid var(--line-soft); }
.usage-row { padding: 8px 0; }
.usage-row summary span { margin-left: 7px; font-size: .82rem; white-space: nowrap; }
.usage-row .button { margin-top: 6px; }
.connect-form input { margin-bottom: 2px; }
.connection-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
#generate-confirm-copy + .field-note { margin-bottom: 10px; }

.brief-dialog { width: min(92vw, 600px); max-height: 92dvh; }
.brief-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.brief-dialog .modal-head { flex: none; padding-block: 10px; }
.brief-dialog .modal-body { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.brief-fields { min-width: 0; padding: 0; margin: 0; border: 0; }
.brief-directions { grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 0; }
.brief-note-label { margin-top: 10px; }
.brief-note-label small { font-weight: 500; color: var(--quiet); }
.brief-estimate { margin: 12px 0 6px; }
.brief-cost-details { padding: 3px 0 5px; color: var(--secondary); font-size: .84rem; }
.brief-actions, .brief-result-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.brief-actions { margin-top: 10px; }
.brief-actions #brief-submit { min-width: 125px; }
.brief-status { min-height: 1.5em; }
.brief-status:empty { display: none; }
.brief-status[data-error="true"] { color: var(--error); font-weight: 650; }
.brief-result { padding-top: 12px; margin-top: 10px; border-top: 1px solid var(--line-soft); }
.brief-selection { margin-bottom: 7px; color: var(--quiet); font-size: .8rem; }
.brief-result-footer { flex: none; justify-content: space-between; border-top: 1px solid var(--line-soft); padding: 10px 18px; }
.brief-receipt { font-size: .84rem; font-variant-numeric: tabular-nums; }
.brief-receipt p { margin-top: 2px; }

.segmented, .segmented input:checked + span, .studio-modes button[aria-pressed="true"],
.button, .connection, .view-button[aria-pressed="true"],
.mat, .artboard, .candidate, .dropzone,
.unit-field, input[type="number"]:not(.unit-field input), input[type="password"], select, textarea,
.output-options label, .estimate-band, .download-link, .layer-row,
.config-state, .connection-summary, #ai-plan {
  box-shadow: var(--shadow-control);
}

@media (max-width: 1060px) {
  .layout {
    grid-template-columns: clamp(270px, 33vw, 315px) minmax(0,1fr);
    grid-template-areas:
      "settings preview"
      "settings output"
      "settings layers";
    grid-template-rows: auto auto 1fr;
  }
}
@media (max-width: 900px) {
  .workspace { padding-left: 20px; padding-right: 20px; }
  .layout { gap: 12px; }
  .studio-layout { grid-template-columns: minmax(0,1fr) minmax(281px,33%); gap: 12px; }
  .layer-list { grid-template-columns: repeat(auto-fit,minmax(123px,1fr)); }
}
@media (max-width: 740px) {
  .workspace { padding-inline: 14px; }
  .brand { grid-area: 1 / 1; font-size: .91rem; gap: 5px; }
  .brand-mark { width: 33px; height: 33px; }
  .layer-actions .button, #layers-inspect { min-height: 44px; }
  .artboard .layer-stack { width: min(100%, calc(260px * var(--stack-aspect, 1))); }
  #save-output-preset { min-height: 44px; }
  .workspace { padding-top: 19px; }
  .page-heading { align-items: flex-start; margin-bottom: 13px; gap: 7px; }
  .page-heading p { font-size: .85rem; }
  .page-heading .button { padding-inline: 8px; font-size: .82rem; }
  .layout, .studio-layout { grid-template-columns: minmax(0,1fr); gap: 13px; }
  .studio-layout { grid-template-areas: "inspector" "canvas"; }
  .layout { grid-template-areas: "preview" "settings" "output" "layers"; grid-template-rows: none; }
  .zoom-layout.stacked { grid-template-columns: minmax(0, 1fr); }
  .zoom-layout.stacked .zoom-content { min-height: 100px; max-height: 41dvh; }
  .zoom-layer-tools { max-height: 36dvh; border-left: 0; border-top: 1px solid var(--line-soft); }
  .zoom-layer-tools .layer-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 118px), 1fr)); }
  .panel-heading { padding-inline: 14px; }
  .mat { margin-inline: 8px; padding-inline: 6px; }
  .artboard, .studio-artboard { min-height: 200px; padding: 12px; }
  .artboard img { max-height: 260px; }
  .views { padding-inline: 11px; }
  .view-button, .button, .download-link, .output-options label, .studio-modes button, .presets .text-button,
  input[type="number"], select, input[type="password"] { min-height: 44px; }
  .selection-footer { margin-inline: 13px; flex-wrap: wrap; }
  .specifications { padding-inline: 12px; gap: 4px; }
  .specifications div + div { padding-left: 7px; }
  .specifications dd { font-size: .87rem; }
}
@media (max-width: 345px) {
  .workspace { padding-inline: 10px; }
  .brand { gap: 4px; }
  .page-heading h1 { font-size: 1.7rem; }
}
@media (max-width: 480px) {
  .brief-directions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .brief-directions label:last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
