:root {
  --bg: #f5f7fb;
  --paper: #ffffff;
  --ink: #18233a;
  --muted: #6d7890;
  --line: #e4e9f2;
  --green: #2563eb;
  --green-soft: #eaf1ff;
  --navy: #16254a;
  --danger: #d14343;
  --shadow: 0 16px 42px rgba(24, 35, 58, .08);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(circle at 89% -12%, #dce8ff 0, transparent 31rem), radial-gradient(circle at 2% 19%, #eef4ff 0, transparent 26rem), var(--bg); font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
.hero, main, footer { width: min(1440px, calc(100% - 40px)); margin-inline: auto; }
.workspace-layout { display: grid; grid-template-columns: minmax(460px, .94fr) minmax(540px, 1.06fr); align-items: start; gap: 18px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 28px; padding: 40px 0 26px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.hero h1 { margin: 0 0 10px; color: var(--navy); font-size: clamp(30px, 4vw, 46px); letter-spacing: -.035em; }
.hero p:last-child { margin: 0; color: var(--muted); line-height: 1.7; }
.health { padding: 9px 13px; border: 1px solid #f1dfb6; border-radius: 999px; color: #765f2f; background: #fff9e9; font-size: 12px; font-weight: 700; white-space: nowrap; }
.health.ready { border-color: #cddcff; color: #2459d5; background: #edf3ff; }
.health.error { color: #9f403d; background: #f6dfdd; }
.generator-shell, .jobs-section { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .94); box-shadow: var(--shadow); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); background: #f8faff; }
.tabs button { padding: 12px 16px; border: 0; border-radius: 10px; color: #74809a; background: transparent; cursor: pointer; font-size: 14px; font-weight: 800; transition: background .16s, color .16s, box-shadow .16s; }
.tabs button span { margin-right: 8px; color: #9aa8c5; font-size: 11px; }
.tabs button.active { color: #fff; background: linear-gradient(135deg, #2f6df4, #2456cd); box-shadow: 0 7px 15px rgba(38, 99, 235, .22); }
.tabs button.active span { color: #d9e5ff; }
.tab-panel { display: none; padding: 22px; }
.tab-panel.active { display: block; }
.panel-intro { display: flex; justify-content: space-between; gap: 20px; align-items: start; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel-intro h2, .jobs-heading h2 { margin: 0; color: var(--navy); font-size: 23px; }
.panel-intro > p { max-width: 480px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.design-form { display: grid; gap: 12px; margin-top: 16px; }
.form-section { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 4px 15px rgba(38, 59, 102, .025); }
.form-section h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: #344c4c; font-size: 14px; }
.form-section h3 > span { display: grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 11px; }
.section-note { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 500; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid { display: grid; gap: 10px; }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.brand-grid { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(340px, 1.2fr); gap: 18px; align-items: stretch; }
label { display: grid; gap: 5px; color: #465955; font-size: 12px; font-weight: 800; }
input:not([type=checkbox]), select, textarea { width: 100%; border: 1px solid #d4dbd6; border-radius: 8px; color: var(--ink); background: #fff; outline: none; }
input:not([type=checkbox]), select { height: 38px; padding: 0 10px; }
textarea { min-height: 66px; padding: 9px 10px; resize: vertical; }
.unit-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; overflow: hidden; border: 1px solid #d4dbd6; border-radius: 8px; background: #fff; }
.unit-input input:not([type=checkbox]) { border: 0; border-radius: 0; }
.unit-input span { padding: 0 10px; border-left: 1px solid #d4dbd6; color: var(--muted); font-size: 11px; font-weight: 800; line-height: 38px; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }
fieldset { margin: 11px 0 0; padding: 11px 12px; border: 1px solid #e0e4e1; border-radius: 9px; }
legend { padding: 0 5px; color: #52645f; font-size: 12px; font-weight: 800; }
.choice-row { display: flex; gap: 6px; }
.choice-row.wrap { flex-wrap: wrap; }
.choice-row label { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid #d6ddd8; border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 700; }
.choice-row input { margin: 0; accent-color: var(--green); }
.wide-notes { padding: 0 2px; }
.primary { display: grid; width: 100%; padding: 14px; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #2f6df4, #2456cd); box-shadow: 0 10px 20px rgba(37, 99, 235, .21); cursor: pointer; font-weight: 900; }
.primary:hover { background: linear-gradient(135deg, #245fe2, #1d48b1); }
.primary:disabled { cursor: wait; opacity: .6; }
.form-message { min-height: 18px; margin: 0; color: var(--green); font-size: 13px; }
.form-message.error { color: var(--danger); }

.logo-picker { position: relative; display: flex; min-height: 72px; align-items: center; gap: 12px; padding: 11px; border: 1px dashed #9abdb2; border-radius: 10px; background: linear-gradient(135deg, #f2f9f6, #fff); cursor: pointer; }
.logo-picker input { position: absolute; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.logo-copy { display: grid; gap: 5px; }
.logo-copy b { color: var(--navy); font-size: 13px; }
.logo-copy small { color: var(--muted); font-weight: 400; }
.logo-picker img { order: -1; width: 66px; height: 50px; padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: #fff; object-fit: contain; }

.text-reference-section > .field-help { margin-bottom: 11px; }
.text-reference-upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.text-reference-picker { position: relative; display: flex; min-height: 92px; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px; border: 1px dashed #a7bee9; border-radius: 10px; background: linear-gradient(135deg, #f4f8ff, #fff); cursor: pointer; }
.text-reference-picker input { position: absolute; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.text-reference-picker > span { display: grid; gap: 5px; }
.text-reference-picker b { color: var(--navy); font-size: 12px; }
.text-reference-picker small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.5; }
.text-reference-picker em { flex: 0 0 auto; padding: 6px 7px; border: 1px solid #c5d6f5; border-radius: 7px; color: #2959c5; background: #fff; font-size: 10px; font-style: normal; font-weight: 800; }
.text-reference-preview-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 11px; }
.text-reference-preview-groups > section { min-width: 0; padding: 9px; border: 1px solid #e2e8f4; border-radius: 9px; background: #fbfcff; }
.text-reference-preview-groups header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: #43536f; font-size: 11px; }
.text-reference-preview-groups header span { color: var(--muted); font-size: 10px; }
.text-reference-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 7px; min-height: 42px; }
.text-reference-preview figure { min-width: 0; margin: 0; overflow: hidden; border: 1px solid #dde5f2; border-radius: 6px; background: #fff; }
.text-reference-preview img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.text-reference-preview figcaption { overflow: hidden; padding: 4px 5px; color: #62718b; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.text-reference-empty { display: grid; place-items: center; min-height: 42px; color: #9aa6bb; border: 1px dashed #d9e1ef; border-radius: 6px; font-size: 10px; }

.field-help { margin: 0 0 8px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.open-selector { padding: 11px 12px 12px; }
.open-map { display: grid; grid-template: 32px minmax(118px, 145px) 36px / 46px minmax(220px, 420px) 46px; justify-content: center; align-items: stretch; margin: 3px auto 0; }
.booth-floor { grid-area: 2 / 2; display: grid; place-content: center; gap: 4px; border: 1px solid #d3ddd8; border-radius: 5px; color: #60736d; background: repeating-linear-gradient(45deg, #f6f8f5, #f6f8f5 10px, #eef3ef 10px, #eef3ef 20px); text-align: center; }
.booth-floor strong { font-size: 13px; }
.booth-floor small { font-size: 10px; font-weight: 400; }
.open-edge { position: relative; display: grid; place-items: center; cursor: pointer; user-select: none; }
.open-edge input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.open-edge::before { content: ""; position: absolute; z-index: 1; border-radius: 5px; background: var(--navy); box-shadow: 0 2px 6px rgba(20, 56, 69, .18); transition: opacity .18s, background .18s, transform .18s; }
.open-edge:hover::before { background: var(--green); transform: scale(1.02); }
.open-edge span { position: relative; z-index: 2; padding: 3px 6px; border-radius: 999px; color: #fff; background: rgba(20, 56, 69, .82); font-size: 10px; line-height: 1; }
.edge-back { grid-area: 1 / 2; }
.edge-front { grid-area: 3 / 2; }
.edge-left { grid-area: 2 / 1; }
.edge-right { grid-area: 2 / 3; }
.edge-back::before, .edge-front::before { inset: 12px 0; }
.edge-left::before, .edge-right::before { inset: 0 20px; }
.open-edge.is-open::before { opacity: .18; background: repeating-linear-gradient(90deg, var(--green), var(--green) 13px, transparent 13px, transparent 22px); box-shadow: none; }
.edge-left.is-open::before, .edge-right.is-open::before { background: repeating-linear-gradient(0deg, var(--green), var(--green) 13px, transparent 13px, transparent 22px); }
.open-edge.is-open span { color: var(--green); background: #e6f3ee; }
.open-legend { display: flex; justify-content: center; gap: 15px; margin-top: 7px; color: var(--muted); font-size: 10px; }
.open-legend span { display: flex; align-items: center; gap: 6px; }
.open-legend i { width: 28px; height: 5px; border-radius: 4px; }
.open-legend .solid { background: var(--navy); }
.open-legend .ghost { opacity: .28; background: repeating-linear-gradient(90deg, var(--green), var(--green) 7px, transparent 7px, transparent 11px); }

.drop-zone { display: grid; place-items: center; gap: 7px; min-height: 190px; border: 1.5px dashed #8db4a7; border-radius: 13px; background: linear-gradient(135deg, #eff8f4, #fafcf8); cursor: pointer; text-align: center; }
.drop-zone.dragging { border-color: var(--green); background: #e5f4ee; }
.drop-zone input { position: absolute; width: 1px !important; height: 1px !important; opacity: 0; }
.drop-zone strong { color: var(--navy); font-size: 16px; }
.drop-zone span { color: var(--muted); font-size: 12px; font-weight: 400; }
.drop-zone em { padding: 6px 11px; border: 1px solid #a9cbbf; border-radius: 7px; color: var(--green); background: #fff; font-size: 12px; font-style: normal; }
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.preview { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #eef1ed; }
.preview img { display: block; width: 100%; height: 130px; object-fit: cover; }
.preview span { display: block; overflow: hidden; padding: 7px; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.image-edit-request { display: grid; grid-template-columns: minmax(180px, .55fr) minmax(0, 1.45fr); gap: 12px 18px; padding: 16px; border: 1px solid #bed0fb; border-radius: 12px; background: linear-gradient(135deg, #f1f6ff, #fbfdff); }
.image-edit-request h3 { margin: 0; color: var(--navy); font-size: 15px; }
.image-edit-request > p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.image-edit-request > label { grid-column: 1 / -1; }
.image-edit-request textarea { min-height: 74px; background: #fff; }

.view-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 15px; }
.view-grid label { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; min-height: 76px; align-content: center; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.view-grid label:has(input:checked) { border-color: #86b9a9; background: #edf7f3; box-shadow: inset 0 0 0 1px #b7d8cd; }
.view-grid input { grid-row: 1 / 3; margin: 2px 0; accent-color: var(--green); }
.view-grid b { color: #354c49; font-size: 12px; }
.view-grid small { color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.5; }
.view-groups { display: grid; gap: 9px; margin-bottom: 15px; }
.view-group { overflow: hidden; border: 1px solid #dce6e2; border-radius: 10px; background: #fbfdfc; }
.view-group h4 { display: flex; align-items: center; min-height: 42px; margin: 0; padding: 0 13px; border-bottom: 1px solid #e0ebe6; color: #31534a; background: #f0f7f4; font-size: 12px; font-weight: 800; }
.view-group summary { display: flex; align-items: center; min-height: 42px; padding: 0 13px; color: #31534a; cursor: pointer; font-size: 12px; font-weight: 800; list-style: none; }
.view-group summary::-webkit-details-marker { display: none; }
.view-group summary::after { margin-left: auto; color: var(--muted); content: "展开"; font-size: 11px; font-weight: 600; }
.view-group[open] summary { border-bottom: 1px solid #e0ebe6; background: #f0f7f4; }
.view-group[open] summary::after { content: "收起"; }
.view-group .view-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 10px; }
.view-group .view-grid label { min-height: 70px; padding: 10px; }
.consistency-lock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px; border: 1px solid #b9d6cc; border-radius: 12px; background: #eef7f3; }
.consistency-lock div { display: grid; gap: 4px; padding: 4px 8px; border-left: 3px solid #7db5a3; }
.consistency-lock b { color: var(--green); font-size: 12px; }
.consistency-lock span { color: #61736e; font-size: 10px; line-height: 1.55; }

.space-tone-section { display: grid; gap: 15px; }
.space-settings { display: grid; grid-template-columns: minmax(140px, .7fr) repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; }
.space-settings h3 { margin: 0; }
.floor-material-color { grid-column: 1 / -1; }
.tone-settings { padding-top: 15px; border-top: 1px solid var(--line); }
.tone-settings-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.tone-settings-heading h3 { margin: 0; }
.tone-settings-heading > label { width: min(230px, 48%); }
.tone-settings .field-help { margin-top: 10px; }
.tone-settings .grid.two { gap: 9px; }
.tone-settings .rgb-field { padding: 11px; background: #fff; }

.advanced-options { overflow: hidden; border: 1px solid #dfe6f3; border-radius: 12px; background: #fafcff; }
.advanced-options summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; color: #2758c4; cursor: pointer; font-size: 13px; font-weight: 800; list-style: none; }
.advanced-options summary::-webkit-details-marker { display: none; }
.advanced-options summary::after { content: "展开"; color: var(--muted); font-size: 11px; font-weight: 600; }
.advanced-options[open] summary { border-bottom: 1px solid #e2e8f4; }
.advanced-options[open] summary::after { content: "收起"; }
.advanced-options summary small { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 500; }
.advanced-options-body { display: grid; gap: 12px; padding: 12px; }
.output-settings { background: linear-gradient(135deg, #f9fbff, #fff); }
.watermark-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; color: #475569; background: #fff; font-size: 11px; font-weight: 700; }
.watermark-controls span { flex: 1 1 150px; }
.watermark-controls button { padding: 7px 9px; border: 1px solid #bfdbfe; border-radius: 7px; color: #1d4ed8; background: #fff; cursor: pointer; font-size: 11px; font-weight: 800; }
.watermark-controls button:hover, .watermark-controls button.active { border-color: #2563eb; color: #fff; background: #2563eb; }

.jobs-section { display: flex; position: sticky; top:16px; max-height: calc(100vh - 32px); flex-direction: column; margin: 0; padding: 20px; }
.jobs-heading { display: flex; align-items: center; justify-content: space-between; }
.jobs-heading button { padding: 8px 11px; border: 1px solid #cddcff; border-radius: 8px; color: #2459d5; background: #f7f9ff; cursor: pointer; font-size: 12px; font-weight: 800; }
.job-list { display: grid; flex: 1; gap: 12px; min-height: 0; margin-top: 16px; padding-right: 3px; overflow-y: auto; overscroll-behavior: contain; }
.job-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 4px 13px rgba(38, 59, 102, .03); }
.job-meta h3 { margin: 0 0 6px; color: #314846; font-size: 15px; }
.job-meta p { margin: 4px 0; color: var(--muted); font-size: 12px; }
.job-meta .reference-score { color: #2f6df4; font-weight: 700; }
.progress-track { overflow: hidden; width: min(420px, 100%); height: 5px; margin-top: 9px; border-radius: 999px; background: #e6ebe7; }
.progress-track i { display: block; height: 100%; background: linear-gradient(90deg, #2f6df4, #4f8cff); }
.status { align-self: start; padding: 6px 9px; border-radius: 999px; color: #856228; background: #fff5dc; font-size: 11px; font-weight: 900; }
.status.completed { color: #2459d5; background: #eaf1ff; }
.status.failed { color: #a14340; background: #f7e0dd; }
.result-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.result-card { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #f4f5f2; }
.result-image-button { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #eff3fa; cursor: zoom-in; }
.result-image-button::after { position: absolute; right: 8px; bottom: 8px; padding: 4px 6px; border-radius: 6px; color: #fff; background: rgba(15, 28, 58, .68); content: "点击放大"; font-size: 10px; font-weight: 800; opacity: 0; transition: opacity .16s; }
.result-image-button:hover::after, .result-image-button:focus-visible::after { opacity: 1; }
.result-image-button:focus-visible { outline: 3px solid rgba(37, 99, 235, .35); outline-offset: -3px; }
.result-card img { display: block; width: 100%; aspect-ratio: 1.14; object-fit: cover; }
.result-card a, .result-card .use-for-image, .result-card .annotate-result { display: block; width: 100%; padding: 7px; border: 0; color: var(--green); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; text-align: left; text-decoration: none; }
.result-card .use-for-image { border-top: 1px solid var(--line); color: var(--navy); background: #edf5f1; }
.result-card .use-for-image:hover { background: #dcece5; }
.result-card .use-for-image:disabled { cursor: wait; opacity: .65; }
.result-card .annotate-result { border-top: 1px solid var(--line); color: #9a5b09; background: #fff7ea; }
.result-card .annotate-result:hover { background: #ffefd5; }
.result-details { grid-column: 1 / -1; margin-top: 2px; border: 1px solid #dfe6f3; border-radius: 10px; background: #fafcff; }
.result-details summary { padding: 12px 14px; color: #2959c5; cursor: pointer; font-size: 12px; font-weight: 800; list-style: none; }
.result-details summary::-webkit-details-marker { display: none; }
.result-details summary::after { float: right; content: "展开"; color: var(--muted); font-weight: 600; }
.result-details[open] summary { border-bottom: 1px solid #e4e9f2; }
.result-details[open] summary::after { content: "收起"; }
.result-details .result-grid { padding: 12px; }
.workspace-layout .result-grid { grid-template-columns: repeat(2, 1fr); }
.job-pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; }
.job-pagination button { min-width: 32px; height: 32px; padding: 0 9px; border: 1px solid #dce4f2; border-radius: 8px; color: #53627e; background: #fff; cursor: pointer; font-size: 12px; font-weight: 800; }
.job-pagination button:hover:not(:disabled), .job-pagination button.active { border-color: #2f6df4; color: #fff; background: #2f6df4; }
.job-pagination button:disabled { cursor: not-allowed; opacity: .45; }
.job-pagination span { margin-left: 7px; color: var(--muted); font-size: 12px; }
.job-actions { display: flex; gap: 8px; margin-top: 8px; }
.job-actions button, .job-actions a { padding: 5px 8px; border: 1px solid #afd0c5; border-radius: 6px; color: var(--green); background: #fff; cursor: pointer; font-size: 11px; font-weight: 800; text-decoration: none; }
.cmyk-field { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfa; }
.cmyk-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--navy); font-size: 13px; }
.cmyk-heading output { color: var(--muted); font-size: 11px; }
.cmyk-picker { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; margin-top: 10px; }
.cmyk-preview { display: block; width: 34px; height: 34px; border: 1px solid rgba(102, 208, 255, .46); border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.cmyk-preview.unset { background: repeating-conic-gradient(#192844 0 25%, #0b1528 0 50%) 50% / 12px 12px; }
.cmyk-sliders { display: grid; gap: 5px; min-width: 0; }
.cmyk-channel { display: grid; grid-template-columns: 12px minmax(0, 1fr); align-items: center; gap: 6px; margin: 0; color: #a8bfdc; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; font-weight: 900; }
.cmyk-channel input[type="range"] { width: 100%; height: 10px; margin: 0; padding: 0; appearance: none; border: 0; border-radius: 999px; background: transparent; box-shadow: none; cursor: pointer; }
.cmyk-channel input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 999px; }
.cmyk-channel input[type="range"]::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -3.5px; appearance: none; border: 2px solid #e4faff; border-radius: 50%; background: #4cdcff; box-shadow: 0 0 8px rgba(76, 220, 255, .46); }
.cmyk-channel input[type="range"]::-moz-range-track { height: 5px; border-radius: 999px; }
.cmyk-channel input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #e4faff; border-radius: 50%; background: #4cdcff; box-shadow: 0 0 8px rgba(76, 220, 255, .46); }
.cmyk-channel.channel-c input::-webkit-slider-runnable-track { background: linear-gradient(90deg, #f8ffff, #00b8d4); }
.cmyk-channel.channel-c input::-moz-range-track { background: linear-gradient(90deg, #f8ffff, #00b8d4); }
.cmyk-channel.channel-m input::-webkit-slider-runnable-track { background: linear-gradient(90deg, #fff8fc, #dc227a); }
.cmyk-channel.channel-m input::-moz-range-track { background: linear-gradient(90deg, #fff8fc, #dc227a); }
.cmyk-channel.channel-y input::-webkit-slider-runnable-track { background: linear-gradient(90deg, #fffef4, #f4d21f); }
.cmyk-channel.channel-y input::-moz-range-track { background: linear-gradient(90deg, #fffef4, #f4d21f); }
.cmyk-channel.channel-k input::-webkit-slider-runnable-track { background: linear-gradient(90deg, #e9eff8, #151c28); }
.cmyk-channel.channel-k input::-moz-range-track { background: linear-gradient(90deg, #e9eff8, #151c28); }
.cmyk-clear { margin-left: auto; padding: 5px 8px; border: 1px solid rgba(126, 169, 222, .22); border-radius: 6px; color: #8299b8; background: transparent; cursor: pointer; font-size: 10px; font-weight: 800; }
.cmyk-clear:hover { border-color: rgba(100, 211, 255, .65); color: #d9f7ff; background: rgba(22, 104, 147, .22); }
.rgb-field { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfa; }
.rgb-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--navy); font-size: 13px; }
.rgb-heading output { color: var(--muted); font-size: 11px; }
.rgb-picker { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; margin-top: 10px; }
.rgb-preview { display: block; width: 34px; height: 34px; border: 1px solid rgba(102, 208, 255, .46); border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.rgb-preview.unset { background: repeating-conic-gradient(#e8ece9 0 25%, #fff 0 50%) 50% / 12px 12px; }
.rgb-swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; min-width: 0; }
.rgb-swatches button, .rgb-custom { display: block; min-width: 0; height: 16px; margin: 0; padding: 0; border: 1px solid rgba(15, 23, 42, .15); border-radius: 4px; cursor: pointer; }
.rgb-swatches button[data-rgb-color="#e53935"] { background: #e53935; }.rgb-swatches button[data-rgb-color="#f59e0b"] { background: #f59e0b; }.rgb-swatches button[data-rgb-color="#eab308"] { background: #eab308; }.rgb-swatches button[data-rgb-color="#16a34a"] { background: #16a34a; }.rgb-swatches button[data-rgb-color="#0891b2"] { background: #0891b2; }.rgb-swatches button[data-rgb-color="#2563eb"] { background: #2563eb; }.rgb-swatches button[data-rgb-color="#7c3aed"] { background: #7c3aed; }.rgb-swatches button[data-rgb-color="#ec4899"] { background: #ec4899; }.rgb-swatches button[data-rgb-color="#111827"] { background: #111827; }
.rgb-swatches button:hover, .rgb-custom:hover { outline: 2px solid rgba(37, 99, 235, .35); outline-offset: 1px; }
.rgb-custom { position: relative; overflow: hidden; background: conic-gradient(#f43f5e, #f59e0b, #22c55e, #06b6d4, #3b82f6, #a855f7, #f43f5e); }
.rgb-custom input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.rgb-clear { margin-left: auto; padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 6px; color: #64748b; background: #fff; cursor: pointer; font-size: 10px; font-weight: 800; }
.rgb-clear:hover { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.output-settings .generation-count { width: 100%; }
.image-preview-dialog { width: min(1180px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 16px; background: #10182b; box-shadow: 0 24px 80px rgba(5, 12, 28, .48); }
.image-preview-dialog::backdrop { background: rgba(8, 15, 31, .72); backdrop-filter: blur(3px); }
.image-preview-frame { position: relative; display: grid; max-height: calc(100vh - 32px); padding: 18px 18px 0; }
.image-preview-frame img { display: block; max-width: 100%; max-height: calc(100vh - 118px); margin: 0 auto; border-radius: 9px; object-fit: contain; }
.image-preview-close { position: absolute; z-index: 1; top: 28px; right: 28px; display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 50%; color: #fff; background: rgba(8, 15, 31, .74); cursor: pointer; font-size: 27px; line-height: 1; }
.image-preview-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 58px; color: #dce6ff; font-size: 12px; }
.image-preview-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-preview-meta a { flex: 0 0 auto; padding: 8px 10px; border: 1px solid rgba(211, 224, 255, .35); border-radius: 8px; color: #fff; text-decoration: none; font-weight: 800; }
.annotation-dialog { width: min(1320px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 16px; background: #f8faff; box-shadow: 0 24px 80px rgba(5, 12, 28, .46); }
.annotation-dialog::backdrop { background: rgba(8, 15, 31, .72); backdrop-filter: blur(3px); }
.annotation-workbench { display: grid; max-height: calc(100vh - 32px); grid-template-rows: auto minmax(0, 1fr); }
.annotation-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 22px; border-bottom: 1px solid var(--line); background: #fff; }
.annotation-header .eyebrow { margin-bottom: 4px; }
.annotation-header h2 { margin: 0; color: var(--navy); font-size: 20px; }
.annotation-close { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: #53627e; background: #fff; cursor: pointer; font-size: 25px; line-height: 1; }
.annotation-main { display: grid; min-height: 0; grid-template-columns: 270px minmax(0, 1fr); }
.annotation-tools { display: grid; align-content: start; gap: 13px; overflow-y: auto; padding: 17px; border-right: 1px solid var(--line); background: #fff; }
.annotation-tip { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.annotation-tool-group { display: grid; gap: 7px; }
.annotation-tool-group > b, .annotation-width { color: #43536f; font-size: 11px; font-weight: 800; }
.annotation-colors, .annotation-modes, .annotation-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.annotation-colors button { width: 26px; height: 26px; padding: 0; border: 3px solid #fff; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 1px #d9e2f2; }
.annotation-colors button.active { box-shadow: 0 0 0 3px #2f6df4; }
.annotation-colors button[data-annotation-color="#ef4444"] { background: #ef4444; }
.annotation-colors button[data-annotation-color="#f59e0b"] { background: #f59e0b; }
.annotation-colors button[data-annotation-color="#22c55e"] { background: #22c55e; }
.annotation-colors button[data-annotation-color="#3b82f6"] { background: #3b82f6; }
.annotation-colors button[data-annotation-color="#a855f7"] { background: #a855f7; }
.annotation-modes button, .annotation-actions button { padding: 7px 9px; border: 1px solid #dbe4f5; border-radius: 7px; color: #53627e; background: #fff; cursor: pointer; font-size: 11px; font-weight: 800; }
.annotation-modes button.active { border-color: #2f6df4; color: #fff; background: #2f6df4; }
.annotation-width { display: grid; grid-template-columns: auto 1fr 22px; align-items: center; gap: 8px; }
.annotation-width input { accent-color: #2f6df4; }
.annotation-width output { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.annotation-tools textarea { min-height: 86px; }
.annotation-copy-tip { margin: -4px 0 0; padding: 9px 10px; border-left: 3px solid #f59e0b; border-radius: 0 7px 7px 0; color: #765c2e; background: #fff8e9; font-size: 10px; line-height: 1.6; }
.annotation-copy-tip b { display: block; color: #9a5b09; }
.annotation-region-list { padding: 9px 10px; border: 1px solid #dce5f4; border-radius: 8px; background: #f7faff; }
.annotation-region-list header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: #43536f; font-size: 11px; }
.annotation-region-list header small { color: var(--muted); font-size: 10px; }
.annotation-region-list ol { display: grid; gap: 4px; margin: 8px 0 0; padding-left: 18px; color: #51617c; font-size: 10px; line-height: 1.45; }
.annotation-region-list li.empty { margin-left: -18px; list-style: none; color: var(--muted); }
.annotation-message { min-height: 17px; margin: 0; color: #2459d5; font-size: 11px; line-height: 1.5; }
.annotation-message.error { color: var(--danger); }
.annotation-tools #submitAnnotation {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
}
.annotation-canvas-wrap { display: grid; overflow: auto; min-height: 0; place-items: center; padding: 22px; background: repeating-conic-gradient(#edf1f8 0 25%, #f8faff 0 50%) 50% / 24px 24px; }
.annotation-canvas-wrap canvas { display: block; max-width: 100%; max-height: calc(100vh - 164px); border-radius: 8px; background: #fff; box-shadow: 0 9px 30px rgba(25, 42, 75, .2); touch-action: none; cursor: crosshair; }
.annotation-canvas-wrap canvas[data-mode="text"] { cursor: text; }
.muted { color: var(--muted); font-size: 13px; }
footer { padding: 24px 0 30px; color: #7d8984; font-size: 12px; text-align: center; }

/* Dark visual lab theme */
:root {
  --bg: #050a16;
  --paper: #0d172a;
  --ink: #e8f1ff;
  --muted: #8ea2c1;
  --line: rgba(124, 168, 233, .18);
  --green: #41d9ff;
  --green-soft: rgba(65, 217, 255, .12);
  --navy: #f0f6ff;
  --danger: #ff727f;
  --shadow: 0 26px 70px rgba(0, 0, 0, .36), 0 0 0 1px rgba(95, 190, 255, .035);
}

html { min-height: 100%; background: var(--bg); }
body { position: relative; min-height: 100vh; color-scheme: dark; background: radial-gradient(circle at 82% 4%, rgba(60, 108, 255, .24), transparent 30rem), radial-gradient(circle at 3% 29%, rgba(0, 210, 255, .13), transparent 25rem), linear-gradient(135deg, #050914 0%, #081225 48%, #050a16 100%); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: .01em; }
body::before { position: fixed; z-index: 0; inset: 0; background-image: linear-gradient(rgba(132, 191, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(132, 191, 255, .035) 1px, transparent 1px); background-size: 40px 40px; content: ""; pointer-events: none; mask-image: linear-gradient(to bottom, #000, transparent 80%); }
body > header, body > main, body > footer { position: relative; z-index: 1; }
::selection { color: #03111a; background: #5de2ff; }

.hero { position: relative; padding: 46px 0 28px; }
.hero::before { position: absolute; top: 24px; left: -15px; width: 4px; height: 72px; border-radius: 999px; background: linear-gradient(#7eeaff, #5177ff); box-shadow: 0 0 22px rgba(65, 217, 255, .9); content: ""; }
.hero::after { position: absolute; top: 39px; right: 150px; color: rgba(140, 190, 255, .34); content: "AI VISUAL LAB / 01"; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.eyebrow { color: #69ddff; text-shadow: 0 0 18px rgba(65, 217, 255, .34); }
.hero h1 { color: #f4f8ff; text-shadow: 0 0 28px rgba(63, 151, 255, .18); }
.hero p:last-child { color: #a9bad3; }
.health { border-color: rgba(255, 202, 91, .36); color: #ffd982; background: rgba(124, 79, 11, .22); box-shadow: inset 0 0 20px rgba(255, 182, 57, .05); }
.health.ready { border-color: rgba(65, 217, 255, .45); color: #86ecff; background: rgba(21, 113, 154, .17); box-shadow: 0 0 22px rgba(65, 217, 255, .09), inset 0 0 18px rgba(65, 217, 255, .06); }
.health.error { border-color: rgba(255, 114, 127, .42); color: #ff9ca5; background: rgba(141, 28, 43, .18); }

.generator-shell, .jobs-section { border-color: rgba(120, 182, 255, .2); background: linear-gradient(145deg, rgba(15, 28, 51, .95), rgba(7, 15, 30, .96)); box-shadow: var(--shadow); }
.generator-shell { position: relative; }
.generator-shell::before { position: absolute; z-index: 1; top: 0; right: 0; left: 0; height: 1px; background: linear-gradient(90deg, transparent, #53dcff 50%, transparent); content: ""; opacity: .85; }
.tabs { position: relative; z-index: 2; border-bottom-color: var(--line); background: rgba(4, 11, 25, .48); }
.tabs button { color: #8da4c8; }
.tabs button span { color: #5f7eaa; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tabs button:hover { color: #d3edff; background: rgba(98, 181, 255, .08); }
.tabs button.active { color: #eefdff; background: linear-gradient(135deg, #1671c7, #2e50d7); box-shadow: 0 9px 24px rgba(23, 116, 234, .3), inset 0 1px rgba(255, 255, 255, .28); }
.tabs button.active span { color: #aeeeff; }
.panel-intro { border-bottom-color: var(--line); }
.panel-intro h2, .jobs-heading h2 { color: #f1f7ff; }
.panel-intro > p { color: #9cb0ce; }

.form-section { border-color: rgba(125, 175, 231, .18); background: linear-gradient(135deg, rgba(19, 35, 60, .8), rgba(10, 20, 38, .75)); box-shadow: inset 0 1px rgba(191, 224, 255, .035), 0 7px 22px rgba(0, 0, 0, .11); }
.form-section h3 { color: #dceafe; }
.form-section h3 > span { color: #76e8ff; background: rgba(65, 217, 255, .11); box-shadow: inset 0 0 0 1px rgba(65, 217, 255, .16), 0 0 14px rgba(65, 217, 255, .06); }
label { color: #b7c8df; }
input:not([type=checkbox]), select, textarea { border-color: rgba(126, 169, 222, .26); color: #edf6ff; background: rgba(4, 13, 29, .72); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2); }
.unit-input { border-color: rgba(126, 169, 222, .26); background: rgba(4, 13, 29, .72); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2); }
.unit-input span { border-left-color: rgba(126, 169, 222, .2); color: #91a8c7; }
input:not([type=checkbox])::placeholder, textarea::placeholder { color: #657b9b; }
input:not([type=checkbox]):hover, select:hover, textarea:hover { border-color: rgba(96, 207, 255, .48); }
input:focus, select:focus, textarea:focus { border-color: #4cdbff; box-shadow: 0 0 0 3px rgba(65, 217, 255, .13), 0 0 18px rgba(65, 217, 255, .08); }
select option { color: #eaf4ff; background: #101c31; }
fieldset { border-color: rgba(126, 169, 222, .2); }
legend { color: #9db3d1; }
.field-help, .section-note { color: #8398b8; }
.choice-row label { border-color: rgba(126, 169, 222, .24); color: #b8cbe4; background: rgba(8, 18, 35, .42); }
.choice-row label:has(input:checked) { border-color: rgba(65, 217, 255, .66); color: #cbf7ff; background: rgba(25, 151, 194, .15); box-shadow: inset 0 0 16px rgba(65, 217, 255, .06); }
.primary { position: relative; overflow: hidden; background: linear-gradient(135deg, #0c9fcd, #3e52d7); box-shadow: 0 13px 28px rgba(21, 117, 239, .28), inset 0 1px rgba(255, 255, 255, .3); letter-spacing: .06em; }
.primary::after { position: absolute; top: 0; bottom: 0; left: -45%; width: 30%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent); content: ""; transform: skewX(-20deg); transition: left .45s ease; }
.primary:hover { background: linear-gradient(135deg, #14b4df, #5264ee); }
.primary:hover::after { left: 120%; }
.form-message { color: #72e3ff; }

.logo-picker, .text-reference-picker { border-color: rgba(85, 210, 255, .38); background: linear-gradient(135deg, rgba(17, 75, 109, .32), rgba(7, 17, 34, .55)); }
.logo-picker:hover, .text-reference-picker:hover { border-color: #51dcff; box-shadow: 0 0 18px rgba(65, 217, 255, .07); }
.logo-picker, .text-reference-picker, .drop-zone { transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease; }
.logo-picker.dragging, .text-reference-picker.dragging, .drop-zone.dragging { border-color: #7aebff; background: linear-gradient(135deg, rgba(20, 139, 180, .4), rgba(14, 45, 82, .74)); box-shadow: 0 0 0 3px rgba(65, 217, 255, .13), 0 0 30px rgba(65, 217, 255, .13); transform: translateY(-1px); }
.logo-copy b, .text-reference-picker b { color: #dff5ff; }
.logo-copy small, .text-reference-picker small { color: #8da3c1; }
.logo-picker img, .text-reference-preview figure { border-color: rgba(128, 183, 242, .22); background: #081326; }
.text-reference-picker em { border-color: rgba(87, 204, 255, .4); color: #8deaff; background: rgba(14, 66, 99, .32); }
.text-reference-preview-groups > section { border-color: rgba(128, 183, 242, .18); background: rgba(7, 16, 31, .45); }
.text-reference-preview-groups header { color: #bcd2ee; }
.text-reference-preview figcaption, .text-reference-preview-groups header span { color: #8197b5; }
.text-reference-empty { border-color: rgba(128, 183, 242, .22); color: #7187a5; }

.booth-floor { border-color: rgba(90, 208, 255, .32); color: #bbd6ed; background: repeating-linear-gradient(45deg, rgba(17, 38, 65, .75), rgba(17, 38, 65, .75) 10px, rgba(15, 55, 78, .7) 10px, rgba(15, 55, 78, .7) 20px); }
.open-edge::before { background: #a9c4eb; box-shadow: 0 0 10px rgba(74, 178, 255, .25); }
.open-edge span { color: #d7efff; background: rgba(9, 23, 45, .88); }
.open-edge:hover::before { background: #5be0ff; }
.open-edge.is-open span { color: #75e6ff; background: rgba(20, 108, 142, .26); }
.open-legend { color: #8ca2c0; }
.open-legend .solid { background: #a9c4eb; }

.drop-zone { border-color: rgba(65, 217, 255, .48); background: linear-gradient(135deg, rgba(10, 72, 104, .32), rgba(7, 18, 35, .65)); }
.drop-zone.dragging { border-color: #78e9ff; background: rgba(24, 126, 165, .3); box-shadow: inset 0 0 32px rgba(65, 217, 255, .08); }
.drop-zone strong { color: #e1f6ff; }
.drop-zone span { color: #99afca; }
.drop-zone em { border-color: rgba(65, 217, 255, .42); color: #89ebff; background: rgba(12, 63, 94, .44); }
.preview { border-color: rgba(128, 183, 242, .2); background: #081426; }
.image-edit-request { border-color: rgba(85, 157, 255, .34); background: linear-gradient(135deg, rgba(27, 75, 142, .25), rgba(8, 21, 42, .72)); }
.image-edit-request h3 { color: #dff2ff; }
.image-edit-request > p { color: #91a8c7; }
.image-edit-request textarea { background: rgba(5, 14, 29, .78); }

.view-group { border-color: rgba(109, 168, 226, .22); background: rgba(8, 18, 34, .55); }
.view-group summary { color: #c4dcf4; }
.view-group summary::after { color: #7891b4; }
.view-group[open] summary { border-bottom-color: rgba(113, 174, 230, .2); background: linear-gradient(90deg, rgba(29, 89, 123, .33), rgba(14, 29, 51, .12)); }
.view-grid label { border-color: rgba(123, 169, 223, .2); background: rgba(7, 16, 31, .58); }
.view-grid label:hover { border-color: rgba(96, 211, 255, .48); }
.view-grid label:has(input:checked) { border-color: rgba(80, 221, 255, .65); background: linear-gradient(135deg, rgba(22, 122, 157, .28), rgba(13, 45, 75, .48)); box-shadow: inset 0 0 0 1px rgba(110, 228, 255, .13), 0 0 15px rgba(58, 192, 255, .07); }
.view-grid b { color: #d6eafb; }
.view-grid small { color: #8096b4; }
.consistency-lock { border-color: rgba(77, 209, 218, .28); background: linear-gradient(135deg, rgba(13, 100, 111, .27), rgba(10, 35, 53, .5)); }
.consistency-lock div { border-left-color: #56dbed; }
.consistency-lock b { color: #86edff; }
.consistency-lock span { color: #9ebbd0; }

.tone-settings { border-top-color: var(--line); }
.tone-settings .cmyk-field, .cmyk-field { border-color: rgba(126, 169, 222, .2); background: rgba(6, 17, 33, .56); }
.cmyk-heading { color: #c7ddf5; }
.cmyk-heading output { color: #839ab8; }
.advanced-options { border-color: rgba(103, 162, 237, .25); background: rgba(8, 19, 38, .6); }
.advanced-options summary { color: #88dfff; }
.advanced-options[open] summary { border-bottom-color: var(--line); }
.output-settings { background: linear-gradient(135deg, rgba(20, 53, 91, .58), rgba(9, 20, 38, .68)); }

.jobs-heading button, .job-pagination button, .job-actions button, .job-actions a { border-color: rgba(92, 181, 255, .34); color: #96eaff; background: rgba(16, 57, 93, .3); }
.jobs-heading button:hover, .job-pagination button:hover:not(:disabled), .job-actions button:hover, .job-actions a:hover { border-color: #5fdefe; color: #e9fbff; background: rgba(22, 115, 165, .42); }
.job-card { border-color: rgba(123, 169, 223, .18); background: linear-gradient(135deg, rgba(17, 32, 56, .9), rgba(9, 18, 34, .88)); box-shadow: inset 0 1px rgba(188, 224, 255, .025); }
.job-meta h3 { color: #e2efff; }
.job-meta p, .muted { color: #92a8c5; }
.job-meta .reference-score { color: #46d8ff; text-shadow: 0 0 10px rgba(70, 216, 255, .32); }
.progress-track { background: #162640; }
.progress-track i { background: linear-gradient(90deg, #30d5f6, #566cff); box-shadow: 0 0 12px rgba(65, 217, 255, .72); }
.status { border: 1px solid rgba(255, 204, 101, .34); color: #ffe09b; background: rgba(133, 79, 18, .25); }
.status.completed { border-color: rgba(60, 215, 255, .35); color: #8cecff; background: rgba(15, 105, 145, .22); }
.status.failed { border-color: rgba(255, 114, 127, .32); color: #ffa1aa; background: rgba(136, 34, 47, .24); }
.result-card { border-color: rgba(123, 169, 223, .22); background: #0a172b; }
.result-image-button { background: #081527; }
.result-card a, .result-card .use-for-image, .result-card .annotate-result { color: #83e7ff; }
.result-card .use-for-image { border-top-color: var(--line); color: #d4efff; background: rgba(22, 106, 135, .3); }
.result-card .use-for-image:hover { background: rgba(33, 144, 176, .4); }
.result-card .annotate-result { border-top-color: var(--line); color: #ffd18a; background: rgba(122, 72, 14, .24); }
.result-card .annotate-result:hover { background: rgba(166, 96, 16, .35); }
.result-details { border-color: rgba(103, 162, 237, .22); background: rgba(7, 16, 31, .54); }
.result-details summary { color: #8ce6ff; }
.result-details[open] summary { border-bottom-color: var(--line); }
.job-pagination button:hover:not(:disabled), .job-pagination button.active { border-color: #4cdbff; color: #06111f; background: #68e4ff; box-shadow: 0 0 16px rgba(65, 217, 255, .28); }
.job-pagination span { color: #8098b9; }

.annotation-dialog { border: 1px solid rgba(123, 188, 255, .24); background: #0a1427; }
.annotation-header { border-bottom-color: var(--line); background: linear-gradient(90deg, #0d1d36, #091426); }
.annotation-header h2 { color: #eef7ff; }
.annotation-close { border-color: rgba(123, 169, 223, .28); color: #b6cae4; background: rgba(11, 27, 50, .84); }
.annotation-tools { border-right-color: var(--line); background: #0b172a; }
.annotation-tip, .annotation-width, .annotation-tool-group > b { color: #9bb1cd; }
.annotation-colors button { border-color: #10213c; box-shadow: 0 0 0 1px rgba(137, 187, 244, .32); }
.annotation-colors button.active { box-shadow: 0 0 0 3px #53dcff, 0 0 14px rgba(65, 217, 255, .4); }
.annotation-modes button, .annotation-actions button { border-color: rgba(121, 169, 225, .28); color: #adc1da; background: rgba(8, 20, 39, .75); }
.annotation-modes button.active { border-color: #4cdbff; color: #041321; background: #5bdefc; }
.annotation-width input { accent-color: #53dcff; }
.annotation-copy-tip { border-left-color: #ffb445; color: #f1d49c; background: rgba(109, 64, 10, .25); }
.annotation-copy-tip b { color: #ffcf78; }
.annotation-region-list { border-color: rgba(113, 175, 235, .24); background: rgba(12, 29, 53, .68); }
.annotation-region-list header { color: #cae7ff; }
.annotation-region-list ol { color: #9db6d4; }
.annotation-message { color: #80e8ff; }
.annotation-canvas-wrap { background: repeating-conic-gradient(#101e35 0 25%, #0a1426 0 50%) 50% / 24px 24px; }
.annotation-canvas-wrap canvas { box-shadow: 0 12px 38px rgba(0, 0, 0, .48), 0 0 0 1px rgba(113, 183, 251, .15); }
footer { color: #7288a5; }

.multi-view-dialog { width: min(920px, calc(100vw - 36px)); max-width: none; max-height: min(820px, calc(100vh - 52px)); padding: 0; overflow: hidden; border: 1px solid rgba(92, 178, 255, .34); border-radius: 18px; color: var(--ink); background: #091528; box-shadow: 0 28px 100px rgba(0, 0, 0, .62), 0 0 0 1px rgba(84, 174, 255, .06); }
.multi-view-dialog::backdrop { background: rgba(2, 7, 17, .72); backdrop-filter: blur(7px); }
.multi-view-workbench { display: grid; max-height: min(820px, calc(100vh - 52px)); grid-template-rows: auto minmax(0, 1fr); }
.multi-view-dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding: 18px 22px; border-bottom: 1px solid rgba(123, 177, 239, .2); background: linear-gradient(100deg, rgba(14, 42, 74, .96), rgba(11, 22, 42, .98)); }
.multi-view-dialog-head .eyebrow { margin-bottom: 4px; }
.multi-view-dialog-head h2 { margin: 0; color: #edf7ff; font-size: 21px; }
.multi-view-dialog-head p:last-child { margin: 5px 0 0; color: #92a9c7; font-size: 12px; }
.multi-view-dialog-head > button { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; padding: 0; border: 1px solid rgba(126, 177, 231, .28); border-radius: 50%; color: #b9cce4; background: rgba(7, 18, 36, .72); cursor: pointer; font-size: 24px; line-height: 1; }
.multi-view-dialog-head > button:hover { border-color: rgba(98, 222, 255, .72); color: #e9fbff; }
.multi-view-dialog-body { min-height: 0; overflow-y: auto; padding: 18px 22px 24px; scrollbar-color: rgba(91, 214, 255, .32) transparent; scrollbar-width: thin; }
.multi-view-dialog .tab-panel.active { display: block; padding: 0; }
.multi-view-dialog .panel-intro { position: relative; }
.multi-view-dialog .panel-intro h2 { font-size: 18px; }
.multi-view-dialog .panel-intro > p { max-width: 760px; }
.multi-view-dialog .design-form { gap: 14px; }
.multi-view-dialog .view-group .view-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.multi-view-dialog .view-grid label { min-height: 66px; }
.multi-view-dialog .view-group .view-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; }
.multi-view-dialog .view-grid label { display: inline-flex; width: fit-content; min-height: 0; align-items: center; gap: 7px; padding: 8px 10px; }
.multi-view-dialog .view-grid input { grid-row: auto; margin: 0; }
.multi-view-dialog .view-grid b { white-space: nowrap; }

.history-dialog { width: min(1120px, calc(100vw - 36px)); max-width: none; max-height: min(860px, calc(100vh - 36px)); padding: 0; overflow: hidden; border: 1px solid rgba(92, 178, 255, .34); border-radius: 18px; color: var(--ink); background: #091528; box-shadow: 0 28px 100px rgba(0, 0, 0, .62), 0 0 0 1px rgba(84, 174, 255, .06); }
.history-dialog::backdrop { background: rgba(2, 7, 17, .72); backdrop-filter: blur(7px); }
.history-workbench { display: grid; max-height: min(860px, calc(100vh - 36px)); grid-template-rows: auto auto minmax(0, 1fr) auto; }
.history-dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding: 18px 22px; border-bottom: 1px solid rgba(123, 177, 239, .2); background: linear-gradient(100deg, rgba(14, 42, 74, .96), rgba(11, 22, 42, .98)); }
.history-dialog-head .eyebrow { margin-bottom: 4px; }
.history-dialog-head h2 { margin: 0; color: #edf7ff; font-size: 21px; }
.history-dialog-head p:last-child { margin: 5px 0 0; color: #92a9c7; font-size: 12px; }
.history-dialog-actions { display: flex; gap: 8px; }
.history-dialog-actions button { display: grid; min-width: 34px; height: 34px; place-items: center; padding: 0 10px; border: 1px solid rgba(126, 177, 231, .28); border-radius: 8px; color: #b9cce4; background: rgba(7, 18, 36, .72); cursor: pointer; font-size: 12px; font-weight: 800; }
.history-dialog-actions button:last-child { width: 34px; padding: 0; border-radius: 50%; font-size: 24px; font-weight: 400; line-height: 1; }
.history-dialog-actions button:hover { border-color: rgba(98, 222, 255, .72); color: #e9fbff; }
.history-filter { display: flex; gap: 7px; padding: 12px 22px; border-bottom: 1px solid rgba(123, 177, 239, .14); background: rgba(6, 15, 30, .58); }
.history-filter button { padding: 7px 13px; border: 1px solid rgba(126, 169, 223, .2); border-radius: 7px; color: #9bb1ce; background: rgba(6, 16, 31, .5); cursor: pointer; font-size: 11px; font-weight: 800; }
.history-filter button.active { border-color: rgba(75, 160, 255, .72); color: #c7efff; background: rgba(26, 99, 183, .26); box-shadow: inset 0 0 14px rgba(71, 158, 255, .1); }
.history-dialog .history-job-list { display: grid; align-content: start; gap: 12px; min-height: 0; max-height: none; margin: 0; padding: 16px 22px; overflow-y: auto; scrollbar-color: rgba(91, 214, 255, .32) transparent; scrollbar-width: thin; }
.history-dialog .job-card { padding: 14px; }
.history-dialog .result-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.history-dialog .job-pagination { margin: 0; padding: 12px 22px 16px; border-top: 1px solid rgba(123, 177, 239, .14); }

.history-page { min-height: calc(100vh - 154px); }
.history-page-shell { display: grid; min-height: calc(100vh - 154px); grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid rgba(123, 177, 240, .2); border-radius: 16px; background: linear-gradient(145deg, rgba(17, 29, 53, .94), rgba(7, 15, 30, .96)); box-shadow: 0 18px 52px rgba(0, 0, 0, .2), inset 0 1px rgba(192, 226, 255, .035); }
.history-page-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid rgba(123, 177, 239, .2); background: linear-gradient(100deg, rgba(14, 42, 74, .9), rgba(11, 22, 42, .92)); }
.history-page-head .eyebrow { margin-bottom: 4px; }
.history-page-head h2 { margin: 0; color: #edf7ff; font-size: 22px; }
.history-page-head p:last-child { max-width: 620px; margin: 5px 0 0; color: #92a9c7; font-size: 12px; line-height: 1.6; }
.history-page-head > button { padding: 8px 11px; border: 1px solid rgba(92, 181, 255, .38); border-radius: 8px; color: #a8efff; background: rgba(16, 69, 111, .35); cursor: pointer; font-size: 11px; font-weight: 800; }
.history-page-head > button:hover { border-color: #5fdefe; color: #e9fbff; background: rgba(22, 115, 165, .42); }
.history-page .history-filter { padding: 12px 22px; }
.history-page .history-job-list { display: grid; align-content: start; gap: 14px; min-height: 0; max-height: none; margin: 0; padding: 20px 22px; overflow: visible; }
.history-page .job-card { padding: 16px; transition: border-color .2s, box-shadow .2s, background .2s; }
.history-page .result-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.history-page .job-pagination { margin: 0; padding: 13px 22px 18px; border-top: 1px solid rgba(123, 177, 239, .14); }
.history-page .job-card.history-focus { border-color: rgba(93, 223, 255, .85); background: linear-gradient(135deg, rgba(16, 72, 105, .72), rgba(9, 25, 47, .9)); box-shadow: 0 0 0 2px rgba(76, 220, 255, .13), 0 0 28px rgba(65, 217, 255, .14); }
.history-page .multi-view-result { color: #ffd195; background: rgba(125, 70, 19, .3); }
.history-page .multi-view-result:hover { background: rgba(167, 93, 20, .4); }

@media (max-width: 640px) {
  .multi-view-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 13px; }
  .multi-view-workbench { max-height: calc(100vh - 16px); }
  .multi-view-dialog-head { padding: 14px; }
  .multi-view-dialog-head h2 { font-size: 18px; }
  .multi-view-dialog-body { padding: 14px; }
  .multi-view-dialog .grid.four, .multi-view-dialog .grid.three, .multi-view-dialog .grid.two, .multi-view-dialog .view-group .view-grid, .multi-view-dialog .consistency-lock { grid-template-columns: 1fr; }
  .multi-view-dialog .panel-intro { padding-top: 32px; }
  .history-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 13px; }
  .history-workbench { max-height: calc(100vh - 16px); }
  .history-dialog-head { padding: 14px; }
  .history-dialog-head h2 { font-size: 18px; }
  .history-filter { padding: 10px 14px; }
  .history-dialog .history-job-list { padding: 12px 14px; }
  .history-dialog .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-dialog .job-pagination { padding: 10px 14px 13px; }
  .history-page { min-height: auto; }
  .history-page-shell { min-height: auto; }
  .history-page-head { padding: 16px 14px; }
  .history-page .history-filter, .history-page .history-job-list, .history-page .job-pagination { padding-inline: 14px; }
  .history-page .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .grid.four, .grid.three, .view-grid { grid-template-columns: repeat(2, 1fr); }
  .split, .brand-grid { grid-template-columns: 1fr; }
  .image-edit-request { grid-template-columns: 1fr; }
  .consistency-lock { grid-template-columns: repeat(2, 1fr); }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .annotation-main { grid-template-columns: 235px minmax(0, 1fr); }
}

@media (max-width: 1120px) {
  .workspace-layout { grid-template-columns: 1fr; }
  .jobs-section { position: static; max-height: none; margin: 26px 0; }
  .job-list { overflow: visible; }
  .workspace-layout .result-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 600px) {
  .workspace-layout .result-grid { grid-template-columns: 1fr; }
  .hero { align-items: flex-start; flex-direction: column; }
  .tab-panel, .jobs-section { padding: 19px; }
  .panel-intro { flex-direction: column; }
  .grid.four, .grid.three, .grid.two, .view-grid, .consistency-lock { grid-template-columns: 1fr; }
  .view-group .view-grid { grid-template-columns: 1fr; }
  .advanced-options summary { align-items: flex-start; flex-wrap: wrap; }
  .advanced-options summary small { width: 100%; margin-left: 0; }
  .space-settings { grid-template-columns: 1fr; }
  .tone-settings-heading { align-items: stretch; flex-direction: column; }
  .tone-settings-heading > label { width: 100%; }
  .text-reference-upload-grid, .text-reference-preview-groups { grid-template-columns: 1fr; }
  .tabs button { font-size: 13px; }
  .result-grid { grid-template-columns: 1fr; }
  .job-card { grid-template-columns: 1fr; }
  .preview-grid { grid-template-columns: 1fr; }
  .image-edit-request { padding: 14px; }
  .open-map { grid-template: 38px 145px 42px / 48px minmax(190px, 1fr) 48px; }
  .image-preview-frame { padding: 10px 10px 0; }
  .image-preview-frame img { max-height: calc(100vh - 108px); }
  .image-preview-close { top: 18px; right: 18px; }
  .annotation-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .annotation-workbench { max-height: calc(100vh - 16px); }
  .annotation-header { padding: 13px 15px; }
  .annotation-main { grid-template-columns: 1fr; overflow-y: auto; }
  .annotation-tools { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px; }
  .annotation-canvas-wrap { min-height: 300px; padding: 12px; }
  .annotation-canvas-wrap canvas { max-height: 56vh; }
}

/* AIGC three-column workspace layout */
body { display: flex; align-items: stretch; background: radial-gradient(circle at 52% -8%, rgba(55, 94, 212, .2), transparent 35rem), radial-gradient(circle at 92% 44%, rgba(19, 178, 220, .1), transparent 28rem), #070c18; }
body::before { opacity: .72; }
.global-nav { position: sticky; z-index: 3; top: 0; display: flex; width: 112px; height: 100vh; flex: 0 0 112px; flex-direction: column; border-right: 1px solid rgba(126, 167, 230, .16); background: linear-gradient(180deg, rgba(15, 25, 46, .94), rgba(7, 13, 26, .97)); box-shadow: 18px 0 44px rgba(0, 0, 0, .2); transition: width .2s ease, flex-basis .2s ease; }
.global-nav-head { display: flex; align-items: center; justify-content: space-between; min-height: 66px; padding: 0 13px; border-bottom: 1px solid rgba(126, 167, 230, .12); }
.global-mark { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid rgba(101, 221, 255, .58); border-radius: 10px; color: #9cecff; background: linear-gradient(145deg, rgba(24, 124, 178, .36), rgba(32, 54, 145, .38)); box-shadow: 0 0 20px rgba(64, 214, 255, .18); font-size: 16px; font-weight: 900; }
.global-nav-head button { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 1px solid rgba(128, 173, 231, .14); border-radius: 8px; color: #9ab3d5; background: rgba(255, 255, 255, .035); cursor: pointer; font-size: 21px; line-height: 1; }
.global-nav-list { display: grid; gap: 8px; padding: 16px 10px; }
.global-nav-item { display: grid; min-height: 72px; place-items: center; gap: 5px; padding: 9px 5px; border: 1px solid transparent; border-radius: 12px; color: #92a7c6; appearance: none; background: transparent; cursor: pointer; font: inherit; text-decoration: none; transition: border-color .16s, background .16s, color .16s, transform .16s; }
.global-nav-item:not(.muted):hover { border-color: rgba(90, 208, 255, .28); color: #e1f6ff; background: rgba(61, 143, 214, .1); transform: translateY(-1px); }
.global-nav-item.active { border-color: rgba(73, 161, 255, .7); color: #83ddff; background: linear-gradient(155deg, rgba(39, 111, 205, .34), rgba(19, 70, 132, .18)); box-shadow: inset 0 0 22px rgba(58, 163, 255, .1), 0 0 18px rgba(44, 133, 255, .14); }
.global-nav-item.muted { cursor: default; opacity: .42; }
.nav-icon { display: grid; width: 25px; height: 25px; place-items: center; font-size: 23px; font-weight: 400; line-height: 1; }
.nav-copy { display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 700; line-height: 1.2; text-align: center; }
.nav-copy b { color: #58729a; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; letter-spacing: .1em; }
.global-nav-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin: auto 0 15px; color: #647d9d; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; letter-spacing: .08em; }
.nav-pulse { width: 6px; height: 6px; border-radius: 50%; background: #5be5ff; box-shadow: 0 0 11px #5be5ff; }
.global-nav.collapsed { width: 64px; flex-basis: 64px; }
.global-nav.collapsed .global-nav-head { justify-content: center; padding: 0; }
.global-nav.collapsed .global-mark, .global-nav.collapsed .nav-copy { display: none; }
.global-nav.collapsed .global-nav-item { min-height: 54px; }

.app-frame { position: relative; z-index: 1; width: min(1920px, calc(100vw - 112px)); min-width: 0; padding: 0 24px; transition: width .2s ease; }
.global-nav.collapsed + .app-frame { width: min(1920px, calc(100vw - 64px)); }
.app-frame .hero, .app-frame main, .app-frame footer { width: 100%; margin-inline: auto; }
.app-frame .topbar { min-height: 66px; padding: 12px 4px 10px; }
.topbar::before, .topbar::after { display: none; }
.topbar .eyebrow { margin-bottom: 4px; font-size: 9px; }
.topbar h1 { margin: 0; font-size: clamp(20px, 2vw, 28px); letter-spacing: -.02em; }
.topbar p:last-child { display: none; }
.topbar-project { display: flex; align-items: baseline; gap: 7px; padding: 9px 12px; border: 1px solid rgba(123, 172, 231, .16); border-radius: 10px; color: #e1edff; background: rgba(9, 19, 37, .46); }
.topbar-project span { color: #7087a8; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; letter-spacing: .1em; }
.topbar-project b { font-size: 12px; }

.workspace-layout { grid-template-columns: 320px minmax(0, 1fr) 272px; gap: 14px; align-items: start; }
.generator-shell, .canvas-workspace, .reference-panel { min-width: 0; border: 1px solid rgba(123, 177, 240, .2); border-radius: 16px; background: linear-gradient(145deg, rgba(17, 29, 53, .94), rgba(7, 15, 30, .96)); box-shadow: 0 18px 52px rgba(0, 0, 0, .2), inset 0 1px rgba(192, 226, 255, .035); }
.generator-shell { position: sticky; top: 10px; display: flex; width: 320px; height: calc(100vh - 92px); max-height: 1050px; flex-direction: column; overflow: hidden; }
.generator-shell::before { background: linear-gradient(90deg, transparent, rgba(95, 224, 255, .85), transparent); }
.control-panel-heading { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 11px 14px; border-bottom: 1px solid rgba(125, 177, 234, .18); background: linear-gradient(90deg, rgba(9, 21, 41, .95), rgba(12, 32, 58, .72)); }
.control-panel-heading .eyebrow { margin: 0 0 4px; font-size: 9px; }
.control-panel-heading b { color: #e4efff; font-size: 14px; }
.control-panel-heading > span { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid rgba(77, 201, 255, .38); border-radius: 7px; color: #88e8ff; background: rgba(23, 111, 155, .2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; font-weight: 800; }
.generator-shell .tabs { flex: 0 0 auto; gap: 5px; padding: 8px; background: rgba(4, 11, 23, .62); }
.generator-shell .tabs button { min-width: 0; padding: 10px 7px; font-size: 12px; }
.generator-shell .tabs button span { display: block; margin: 0 0 3px; font-size: 9px; }
.generator-shell .tab-panel { min-height: 0; flex: 1; overflow-y: auto; padding: 15px; scrollbar-color: rgba(91, 214, 255, .32) transparent; scrollbar-width: thin; }
.generator-shell .panel-intro { display: block; padding-bottom: 11px; }
.generator-shell .panel-intro h2 { font-size: 16px; }
.generator-shell .panel-intro > p { margin-top: 5px; font-size: 11px; }
.generator-shell .design-form { gap: 10px; margin-top: 11px; }
.generator-shell .form-section { padding: 12px; }
.generator-shell .form-section h3 { margin-bottom: 9px; font-size: 12px; }
.generator-shell .form-section h3 > span { width: 20px; height: 20px; flex-basis: 20px; font-size: 9px; }
.generator-shell .brand-grid, .generator-shell .split, .generator-shell .image-edit-request { grid-template-columns: 1fr; gap: 9px; }
.generator-shell .grid.four, .generator-shell .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.generator-shell .grid.two, .generator-shell .view-group .view-grid { grid-template-columns: 1fr; }
.generator-shell .logo-picker { min-height: 58px; }
.generator-shell .text-reference-upload-grid, .generator-shell .text-reference-preview-groups { grid-template-columns: 1fr; }
.generator-shell .text-reference-picker { min-height: 66px; }
.generator-shell .preview-grid { grid-template-columns: repeat(2, 1fr); }
.generator-shell .view-grid label { min-height: 56px; }
.generator-shell .consistency-lock { grid-template-columns: 1fr 1fr; padding: 10px; }
.generator-shell .consistency-lock div { padding: 3px 5px; }
.generator-shell button.primary[type="submit"] { display: none; }
.generator-shell .form-message { min-height: 0; font-size: 11px; }

/* Keep every control inside the fixed-width parameter rail. */
.generator-shell .tab-panel { overflow-x: hidden; }
.generator-shell .design-form, .generator-shell .form-section, .generator-shell fieldset, .generator-shell .text-reference-picker > span, .generator-shell .rgb-picker { min-width: 0; }
.generator-shell fieldset { min-inline-size: 0; }
.generator-shell .form-section { padding: 10px; }
.generator-shell label { font-size: 10px; }
.generator-shell input:not([type=checkbox]), .generator-shell select { height: 32px; padding-inline: 8px; font-size: 11px; }
.generator-shell textarea { min-height: 56px; padding: 8px; font-size: 11px; }
.generator-shell .unit-input span { line-height: 32px; }
.generator-shell .choice-row { flex-wrap: wrap; }
.generator-shell .choice-row label { padding: 5px 6px; font-size: 10px; }
.generator-shell .space-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.generator-shell .space-settings h3 { grid-column: 1 / -1; }
.generator-shell .tone-settings-heading { align-items: stretch; flex-direction: column; gap: 8px; }
.generator-shell .tone-settings-heading > label { width: 100%; }
.generator-shell .open-selector { padding: 8px; }
.generator-shell .open-map { grid-template: 24px minmax(92px, 110px) 28px / 28px minmax(0, 1fr) 28px; width: 100%; min-width: 0; }
.generator-shell .open-edge span { padding: 2px 3px; font-size: 8px; }
.generator-shell .edge-back::before, .generator-shell .edge-front::before { inset-block: 8px; }
.generator-shell .edge-left::before, .generator-shell .edge-right::before { inset-inline: 10px; }
.generator-shell .open-legend { flex-wrap: wrap; gap: 5px 9px; }
.generator-shell .open-legend i { width: 19px; }
.generator-shell .text-reference-picker { min-width: 0; padding: 9px; }
.generator-shell .text-reference-picker em { padding: 5px; font-size: 9px; }
.generator-shell .rgb-picker { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 6px; }
.generator-shell .rgb-preview { width: 30px; height: 30px; }
.generator-shell .rgb-swatches { gap: 3px; }
.generator-shell .rgb-clear { padding: 4px 6px; font-size: 9px; }

.canvas-workspace { display: grid; gap: 13px; padding: 17px; }
.canvas-heading, .reference-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.canvas-heading .eyebrow, .reference-heading .eyebrow { margin-bottom: 4px; font-size: 9px; }
.canvas-heading h2, .reference-heading h2 { margin: 0; color: #eef6ff; font-size: 18px; }
.canvas-mode-badge { padding: 6px 9px; border: 1px solid rgba(91, 218, 255, .3); border-radius: 7px; color: #89e7ff; background: rgba(21, 109, 148, .18); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; white-space: nowrap; }
.main-canvas-preview { position: relative; display: grid; height: clamp(300px, 43vh, 550px); min-height: clamp(300px, 43vh, 550px); max-height: clamp(300px, 43vh, 550px); place-items: center; overflow: hidden; border: 1px solid rgba(120, 181, 241, .2); border-radius: 14px; background: radial-gradient(circle at 50% 30%, rgba(25, 79, 145, .18), transparent 50%), repeating-conic-gradient(#0d1b33 0 25%, #091426 0 50%) 50% / 24px 24px; }
.main-canvas-preview::before { position: absolute; z-index: 0; width: 66%; height: 66%; border: 1px solid rgba(81, 208, 255, .12); border-radius: 50%; box-shadow: 0 0 80px rgba(41, 115, 255, .13); content: ""; }
.canvas-empty { position: relative; z-index: 1; display: grid; justify-items: center; gap: 8px; max-width: 350px; padding: 26px; color: #8da3c1; text-align: center; }
.canvas-empty i { display: grid; width: 45px; height: 45px; place-items: center; border: 1px solid rgba(89, 211, 255, .3); border-radius: 14px; color: #77e7ff; background: rgba(27, 116, 156, .16); box-shadow: 0 0 28px rgba(65, 217, 255, .12); font-size: 22px; font-style: normal; }
.canvas-empty b { color: #d6e8ff; font-size: 15px; }
.canvas-empty span { font-size: 12px; line-height: 1.65; }
.canvas-generating { position: relative; z-index: 1; display: grid; justify-items: center; gap: 12px; max-width: 360px; padding: 30px; color: #8da3c1; text-align: center; }
.canvas-generating i { display: block; width: 56px; height: 56px; border: 4px solid rgba(81, 207, 255, .16); border-top-color: #5ce5ff; border-right-color: #486dff; border-radius: 50%; box-shadow: 0 0 28px rgba(65, 217, 255, .2); animation: canvas-generating-spin .9s linear infinite; }
.canvas-generating b { color: #dff6ff; font-size: 16px; }
.canvas-generating span { color: #91a9c9; font-size: 12px; line-height: 1.7; }
@keyframes canvas-generating-spin { to { transform: rotate(360deg); } }
.main-canvas-image { position: relative; z-index: 1; display: grid; width: 100%; height: 100%; min-height: inherit; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.main-canvas-image img { width: 100%; height: 100%; min-height: inherit; object-fit: contain; }
.canvas-image-toolbar { position: absolute; z-index: 2; right: 10px; bottom: 10px; display: flex; width: max-content; align-items: center; justify-content: flex-end; gap: 5px; padding: 6px; border: 1px solid rgba(158, 205, 255, .18); border-radius: 9px; color: #b4cae6; background: rgba(6, 15, 30, .78); backdrop-filter: blur(12px); font-size: 10px; }
.canvas-image-toolbar span { overflow: hidden; margin-right: auto; text-overflow: ellipsis; white-space: nowrap; }
.canvas-image-toolbar button, .canvas-image-toolbar a { padding: 5px 7px; border: 1px solid rgba(126, 190, 245, .24); border-radius: 6px; color: #a9eaff; background: rgba(35, 97, 143, .24); cursor: pointer; font-size: 10px; text-decoration: none; }
.canvas-image-toolbar .canvas-image-icon-action { display: grid; width: 30px; height: 30px; place-items: center; padding: 0; border-radius: 7px; font-size: 20px; font-weight: 500; line-height: 1; }
.canvas-action-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.canvas-action { display: grid; grid-template-columns: 25px 1fr; align-items: center; gap: 0 8px; min-height: 72px; padding: 10px 13px; border: 1px solid; border-radius: 12px; background: rgba(7, 15, 29, .64); cursor: pointer; text-align: left; transition: transform .16s, box-shadow .16s, background .16s; }
.canvas-action:hover:not(:disabled) { transform: translateY(-2px); }
.canvas-action:disabled { cursor: not-allowed; opacity: .42; }
.canvas-action.is-loading { cursor: wait; transform: none; }
.canvas-action > span { grid-row: 1 / 3; display: grid; width: 25px; height: 25px; place-items: center; font-size: 20px; }
.canvas-action b { font-size: 14px; }
.canvas-action small { margin-top: 3px; color: #8298b7; font-size: 10px; }
.canvas-action.blue { border-color: rgba(73, 155, 255, .72); color: #86c6ff; box-shadow: inset 0 0 20px rgba(34, 107, 214, .08); }
.canvas-action.blue:hover:not(:disabled) { background: rgba(24, 84, 156, .2); box-shadow: 0 7px 22px rgba(39, 116, 255, .16), inset 0 0 20px rgba(34, 107, 214, .1); }
.canvas-action.orange { border-color: rgba(255, 166, 93, .72); color: #ffbc7e; box-shadow: inset 0 0 20px rgba(211, 104, 32, .07); }
.canvas-action.orange:hover:not(:disabled) { background: rgba(137, 69, 19, .16); box-shadow: 0 7px 22px rgba(233, 120, 46, .13), inset 0 0 20px rgba(211, 104, 32, .08); }
.prompt-dock { padding: 13px; border: 1px solid rgba(255, 169, 89, .7); border-radius: 13px; background: linear-gradient(135deg, rgba(73, 42, 21, .16), rgba(8, 18, 35, .78)); box-shadow: inset 0 0 26px rgba(250, 139, 51, .04); }
.prompt-dock-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.prompt-dock-head .eyebrow { margin-bottom: 3px; color: #ffb474; font-size: 9px; }
.prompt-dock h3 { margin: 0; color: #f7e5d4; font-size: 14px; }
.prompt-dock-head > span { color: #a69283; font-size: 10px; text-align: right; }
.prompt-dock textarea { min-height: 82px; border-color: rgba(229, 151, 81, .34); background: rgba(6, 14, 28, .67); }
.workspace-generate { position: relative; display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; padding: 13px; overflow: hidden; border: 0; border-radius: 9px; color: #f7fcff; background: linear-gradient(100deg, #167ec5, #3553d8); box-shadow: 0 10px 26px rgba(29, 97, 232, .27), inset 0 1px rgba(255, 255, 255, .25); cursor: pointer; font-size: 15px; font-weight: 900; letter-spacing: .04em; }
.workspace-generate:hover { background: linear-gradient(100deg, #17a7d6, #5261e8); }
.workspace-generate kbd { padding: 2px 5px; border: 1px solid rgba(255,255,255,.25); border-radius: 4px; color: rgba(255,255,255,.72); background: rgba(0,0,0,.14); font-family: inherit; font-size: 9px; font-weight: 600; }
.canvas-workspace .jobs-section { position: static; display: flex; max-height: none; min-height: 0; margin: 0; padding: 14px; border-color: rgba(122, 173, 232, .17); border-radius: 12px; background: rgba(5, 14, 28, .36); box-shadow: none; }
.canvas-workspace .jobs-heading h2 { font-size: 15px; }
.canvas-workspace .job-list { max-height: 540px; }
.canvas-workspace .result-grid, .workspace-layout .result-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.canvas-workspace .job-card { padding: 12px; }

.reference-panel { position: sticky; top: 10px; display: flex; height: calc(100vh - 92px); max-height: 1050px; flex-direction: column; padding: 16px; overflow: hidden; }
.reference-heading h2 { font-size: 17px; }
.reference-heading > button { padding: 7px 9px; border: 1px solid rgba(86, 196, 255, .38); border-radius: 7px; color: #9ceaff; background: rgba(21, 100, 147, .22); cursor: pointer; font-size: 10px; font-weight: 800; }
.reference-filter { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 14px; }
.reference-filter button { padding: 7px 5px; border: 1px solid rgba(126, 169, 223, .18); border-radius: 7px; color: #9bb1ce; background: rgba(6, 16, 31, .5); cursor: pointer; font-size: 11px; font-weight: 700; }
.reference-filter button.active { border-color: rgba(75, 160, 255, .7); color: #bceaff; background: rgba(26, 99, 183, .22); box-shadow: inset 0 0 14px rgba(71, 158, 255, .09); }
.reference-panel-copy { min-height: 34px; margin: 11px 0 8px; color: #8199b8; font-size: 10px; line-height: 1.55; }
.reference-gallery { display: grid; flex: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 9px; overflow-y: auto; padding-right: 2px; scrollbar-color: rgba(91, 214, 255, .32) transparent; scrollbar-width: thin; }
.reference-empty { grid-column: 1 / -1; display: grid; min-height: 130px; place-items: center; margin: 0; padding: 18px; border: 1px dashed rgba(104, 177, 240, .28); border-radius: 10px; color: #7188a7; font-size: 11px; line-height: 1.65; text-align: center; }
.reference-card { min-width: 0; padding: 0; overflow: hidden; border: 1px solid rgba(124, 174, 229, .2); border-radius: 8px; color: #9bb3cf; background: rgba(9, 20, 37, .86); cursor: pointer; text-align: left; }
.reference-card:hover, .reference-card.selected { border-color: rgba(84, 213, 255, .76); box-shadow: 0 0 0 2px rgba(65, 217, 255, .12), 0 0 17px rgba(65, 217, 255, .1); }
.reference-card img { display: block; width: 100%; aspect-ratio: 1.17; object-fit: cover; }
.reference-card span, .reference-card small { display: block; overflow: hidden; padding: 4px 6px 0; text-overflow: ellipsis; white-space: nowrap; }
.reference-card span { color: #cae7fc; font-size: 10px; font-weight: 800; }
.reference-card small { padding-bottom: 5px; color: #7890ad; font-size: 9px; }
.reference-panel-tip { display: flex; gap: 7px; margin-top: 11px; padding-top: 10px; border-top: 1px solid rgba(126, 169, 222, .15); color: #788faa; }
.reference-panel-tip span { color: #6cdbff; font-size: 15px; }
.reference-panel-tip p { margin: 0; font-size: 10px; line-height: 1.5; }
.app-frame footer { padding: 14px 0 18px; font-size: 10px; }

/* Minimal light workspace: put image and reference content ahead of decoration. */
:root { --bg: #f7f8fa; --paper: #ffffff; --ink: #1f2937; --muted: #6b7280; --line: #e5e7eb; --green: #2563eb; --green-soft: #eff6ff; --navy: #111827; --shadow: 0 8px 24px rgba(15, 23, 42, .06); }
html { background: var(--bg); }
body { color-scheme: light; background: var(--bg); color: var(--ink); letter-spacing: 0; }
body::before { display: none; }
::selection { color: #fff; background: #2563eb; }

.global-nav { width: 88px; flex-basis: 88px; border-right-color: var(--line); background: #fff; box-shadow: none; }
.global-nav-head { justify-content: flex-end; border-bottom-color: var(--line); }
.global-mark { border-color: #dbe3f0; color: #2563eb; background: #f8fafc; box-shadow: none; }
.global-nav-head button, .panel-collapse { border: 1px solid #dbe3f0; color: #64748b; background: #fff; box-shadow: none; }
.global-nav-item, .global-nav-item.muted { color: #334155; opacity: 1; }
.global-nav-item:not(.muted):hover { border-color: #dbeafe; color: #1d4ed8; background: #f8fbff; transform: none; }
.global-nav-item.active { border-color: #bfdbfe; color: #1d4ed8; background: #eff6ff; box-shadow: none; }

.app-frame { width: min(2200px, calc(100vw - 88px)); padding: 0 14px; }
.global-nav.collapsed + .app-frame { width: min(2200px, calc(100vw - 64px)); }
.workspace-titlebar { position: relative; display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 24px; margin: 12px 0 10px; padding: 12px 20px; overflow: hidden; border: 1px solid #e3e8f2; border-radius: 12px; background: linear-gradient(105deg, #ffffff 0%, #f8fbff 62%, #eef5ff 100%); box-shadow: 0 6px 18px rgba(15, 23, 42, .045); }
.workspace-titlebar::before { position: absolute; top: 0; bottom: 0; left: 0; width: 4px; border-radius: 12px 0 0 12px; background: linear-gradient(#2563eb, #60a5fa); content: ""; }
.workspace-titlebar::after { position: absolute; width: 220px; height: 220px; top: -132px; right: 92px; border: 1px solid rgba(96, 165, 250, .16); border-radius: 50%; box-shadow: 0 0 0 22px rgba(96, 165, 250, .045), 0 0 0 44px rgba(96, 165, 250, .03); content: ""; pointer-events: none; }
.workspace-titlebar-copy { position: relative; z-index: 1; min-width: 0; padding-left: 2px; }
.workspace-titlebar-copy > span { display: block; margin-bottom: 3px; color: #2563eb; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.workspace-titlebar h1 { margin: 0; color: #172033; font-size: clamp(21px, 2vw, 28px); font-weight: 760; letter-spacing: -.035em; }
.workspace-titlebar p { margin: 5px 0 0; color: #64748b; font-size: 12px; line-height: 1.45; }
.workspace-titlebar-state { position: relative; z-index: 1; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #cfe0ff; border-radius: 999px; color: #1d4ed8; background: rgba(255, 255, 255, .78); font-size: 12px; font-weight: 700; }
.workspace-titlebar-state i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .12); }

.workspace-layout { grid-template-columns: 248px minmax(0, 1fr) 380px; gap: 10px; align-items: stretch; }
.generator-shell, .canvas-workspace, .reference-panel { border-color: var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.generator-shell { width: 248px; }
.generator-shell::before { display: none; }
.control-panel-heading { min-height: 58px; padding: 10px 12px; border-bottom-color: var(--line); background: #fff; }
.control-panel-heading b, .canvas-heading h2, .reference-heading h2 { color: #111827; }
.control-panel-heading > span, .canvas-mode-badge { border-color: #dbeafe; color: #2563eb; background: #eff6ff; }
.panel-collapse { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; padding: 0; border-radius: 7px; cursor: pointer; font-size: 18px; line-height: 1; }
.panel-collapse:hover { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.generator-shell .tabs { border-bottom-color: var(--line); background: #fafafa; }
.tabs button { color: #64748b; }
.tabs button:hover { color: #1d4ed8; background: #f1f5f9; }
.tabs button.active { color: #1d4ed8; background: #eff6ff; box-shadow: none; }
.tabs button.active span { color: #2563eb; }
.generator-shell .tab-panel { scrollbar-color: #cbd5e1 transparent; }
.panel-intro, .advanced-options[open] summary { border-bottom-color: var(--line); }
.panel-intro h2, .jobs-heading h2 { color: #111827; }
.panel-intro > p, .field-help, .section-note { color: #6b7280; }
.form-section, .output-settings { border-color: var(--line); background: #fff; box-shadow: none; }
.form-section h3 { color: #334155; }
.form-section h3 > span { color: #2563eb; background: #eff6ff; box-shadow: none; }
label { color: #475569; }
input:not([type=checkbox]), select, textarea, .unit-input { border-color: #dbe1ea; color: #1f2937; background: #fff; box-shadow: none; }
.unit-input span { border-left-color: #dbe1ea; color: #64748b; }
input:not([type=checkbox])::placeholder, textarea::placeholder { color: #9ca3af; }
input:not([type=checkbox]):hover, select:hover, textarea:hover { border-color: #93c5fd; }
input:focus, select:focus, textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
select option { color: #1f2937; background: #fff; }
fieldset, .tone-settings { border-color: var(--line); }
legend { color: #64748b; }
.choice-row label, .view-grid label { border-color: #e2e8f0; color: #475569; background: #fff; box-shadow: none; }
.choice-row label:has(input:checked), .view-grid label:has(input:checked) { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; box-shadow: none; }
.primary, .workspace-generate { background: #2563eb; box-shadow: none; letter-spacing: 0; }
.primary::after { display: none; }
.primary:hover, .workspace-generate:hover { background: #1d4ed8; }
.form-message { color: #2563eb; }

.logo-picker, .text-reference-picker, .drop-zone, .image-edit-request { border-color: #cbd5e1; background: #f8fafc; }
.logo-picker:hover, .text-reference-picker:hover, .drop-zone:hover { border-color: #93c5fd; box-shadow: none; }
.logo-picker.dragging, .text-reference-picker.dragging, .drop-zone.dragging { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.logo-copy b, .text-reference-picker b, .drop-zone strong, .image-edit-request h3 { color: #1e293b; }
.logo-copy small, .text-reference-picker small, .drop-zone span, .image-edit-request > p { color: #64748b; }
.logo-picker img, .text-reference-preview figure, .preview { border-color: #e2e8f0; background: #fff; }
.text-reference-picker em, .drop-zone em { border-color: #bfdbfe; color: #1d4ed8; background: #fff; }
.text-reference-preview-groups > section, .tone-settings .rgb-field, .rgb-field { border-color: #e2e8f0; background: #fafafa; }
.text-reference-preview-groups header, .rgb-heading { color: #475569; }
.text-reference-preview figcaption, .text-reference-preview-groups header span, .rgb-heading output { color: #64748b; }

.booth-floor { border-color: #bfdbfe; color: #334155; background: #f8fafc; }
.open-edge::before, .open-legend .solid { background: #64748b; box-shadow: none; }
.open-edge span { color: #475569; background: #fff; }
.open-edge:hover::before { background: #2563eb; }
.open-edge.is-open span { color: #1d4ed8; background: #eff6ff; }
.open-legend { color: #64748b; }
.view-group, .advanced-options { border-color: #e2e8f0; background: #fafafa; }
.view-group h4 { border-bottom-color: #e2e8f0; color: #334155; background: #f8fafc; }
.view-group summary, .advanced-options summary { color: #334155; }
.view-group[open] summary { border-bottom-color: #e2e8f0; background: #f8fafc; }
.view-grid b { color: #334155; }
.view-grid small, .consistency-lock span { color: #64748b; }
.consistency-lock { border-color: #dbeafe; background: #f8fbff; }
.consistency-lock div { border-left-color: #2563eb; }
.consistency-lock b { color: #1d4ed8; }

.canvas-workspace { padding: 14px; }
.canvas-heading h2, .reference-heading h2 { font-size: 18px; }
.main-canvas-preview { height: clamp(440px, 66vh, 780px); min-height: clamp(440px, 66vh, 780px); max-height: clamp(440px, 66vh, 780px); border-color: #e2e8f0; background: #fff; }
.main-canvas-preview::before { display: none; }
.canvas-empty, .canvas-generating { color: #64748b; }
.canvas-empty i { border-color: #bfdbfe; color: #2563eb; background: #eff6ff; box-shadow: none; }
.canvas-empty b, .canvas-generating b { color: #334155; }
.canvas-generating i { border-color: #dbeafe; border-top-color: #2563eb; border-right-color: #60a5fa; box-shadow: none; }
.canvas-image-toolbar { border-color: #e2e8f0; color: #475569; background: rgba(255, 255, 255, .94); box-shadow: 0 4px 16px rgba(15, 23, 42, .08); }
.canvas-image-toolbar button, .canvas-image-toolbar a { border-color: #dbeafe; color: #1d4ed8; background: #fff; }
.canvas-image-toolbar .canvas-image-icon-action:hover { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.canvas-action { border-color: #dbeafe; color: #1d4ed8; background: #fff; box-shadow: none; }
.canvas-action small { color: #64748b; }
.canvas-action.blue, .canvas-action.orange { border-color: #dbeafe; color: #1d4ed8; box-shadow: none; }
.canvas-action.blue:hover:not(:disabled), .canvas-action.orange:hover:not(:disabled) { background: #eff6ff; box-shadow: none; }
.main-canvas-preview.has-results { display: grid; place-items: stretch; gap: 10px; padding: 10px; }
.main-canvas-preview.has-results[data-has-more="true"] { padding-bottom: 58px; }
.main-canvas-preview.has-results[data-result-count="1"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.main-canvas-preview.has-results[data-result-count="2"], .main-canvas-preview.has-results[data-result-count="3"], .main-canvas-preview.has-results[data-result-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.canvas-result-card { position: relative; display: grid; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 9px; background: #f8fafc; transition: border-color .16s, box-shadow .16s; }
.canvas-result-card.selected { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .16); }
.canvas-result-card .main-canvas-image { min-height: 0; }
.canvas-result-card .main-canvas-image img { min-height: 0; object-fit: contain; }
.canvas-result-card .canvas-image-toolbar { right: 8px; bottom: 8px; padding: 4px; }
.canvas-result-card .canvas-image-icon-action { width: 27px; height: 27px; font-size: 18px; }
.canvas-result-card .canvas-image-tool-action { font-size: 16px; font-weight: 800; }
.canvas-result-card .canvas-image-tool-action.annotate { color: #7c3aed; }
.canvas-result-card .canvas-image-tool-action.multi-view { color: #c2410c; }
.canvas-partial-progress { position: absolute; z-index: 5; top: 18px; right: 18px; max-width: calc(100% - 36px); padding: 6px 9px; border: 1px solid #bfdbfe; border-radius: 7px; color: #1d4ed8; background: rgba(255, 255, 255, .94); box-shadow: 0 3px 12px rgba(15, 23, 42, .10); font-size: 12px; font-weight: 750; line-height: 1.3; pointer-events: none; }
.canvas-expand-results { position: absolute; z-index: 6; bottom: 16px; left: 50%; display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 7px 13px; border: 1px solid #bfdbfe; border-radius: 8px; color: #1d4ed8; background: rgba(255, 255, 255, .96); box-shadow: 0 5px 16px rgba(15, 23, 42, .12); cursor: pointer; font-size: 12px; font-weight: 800; transform: translateX(-50%); }
.canvas-expand-results:hover { border-color: #60a5fa; background: #eff6ff; }
.canvas-results-dialog { width: min(1240px, calc(100vw - 32px)); max-width: none; height: min(820px, calc(100vh - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 14px; color: #1f2937; background: #fff; box-shadow: 0 20px 60px rgba(15, 23, 42, .2); }
.canvas-results-dialog::backdrop { background: rgba(15, 23, 42, .36); backdrop-filter: blur(3px); }
.canvas-results-dialog-frame { display: grid; height: 100%; min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
.canvas-results-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 18px; border-bottom: 1px solid #e5e7eb; background: #fff; }
.canvas-results-dialog-head h2 { margin: 0; color: #111827; font-size: 18px; font-weight: 780; }
.canvas-results-dialog-head p { margin: 4px 0 0; color: #64748b; font-size: 12px; }
.canvas-results-dialog-head > button { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; padding: 0; border: 1px solid #dbe1ea; border-radius: 8px; color: #475569; background: #fff; cursor: pointer; font-size: 22px; line-height: 1; }
.canvas-results-dialog-head > button:hover { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.canvas-results-dialog-grid { display: grid; min-height: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 14px; overflow-y: auto; padding: 16px; scrollbar-color: #cbd5e1 transparent; }
.canvas-results-dialog-card { position: relative; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.canvas-results-dialog-card > button:first-child { display: block; width: 100%; padding: 0; border: 0; background: #f8fafc; cursor: zoom-in; }
.canvas-results-dialog-card img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: contain; }
.canvas-results-dialog-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 9px; border-top: 1px solid #e2e8f0; background: #fff; }
.canvas-results-dialog-actions button, .canvas-results-dialog-actions a { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 8px; border: 1px solid #dbeafe; border-radius: 6px; color: #1d4ed8; background: #fff; cursor: pointer; font-size: 12px; font-weight: 750; line-height: 1; text-decoration: none; }
.canvas-results-dialog-actions button:hover, .canvas-results-dialog-actions a:hover { border-color: #93c5fd; background: #eff6ff; }
.canvas-results-dialog-select { display: inline-flex; align-items: center; gap: 6px; margin: 0 9px 9px; color: #1d4ed8; cursor: pointer; font-size: 12px; font-weight: 750; }
.canvas-results-dialog-select input { width: 14px; height: 14px; margin: 0; accent-color: #2563eb; }
.history-result-card { position: relative; background: #fff; }
.history-result-card .result-image-button { background: #fff; }
.history-result-card .result-image-button::after { display: none; }
.history-result-card img { aspect-ratio: 1.14; object-fit: contain; }
.history-result-card .canvas-image-toolbar { right: 8px; bottom: 8px; padding: 4px; }
.history-result-card .canvas-image-icon-action { width: 27px; height: 27px; font-size: 18px; }
.history-result-card .canvas-image-tool-action { font-size: 16px; font-weight: 800; }
.history-result-card .canvas-image-tool-action.annotate { color: #7c3aed; }
.history-result-card .canvas-image-tool-action.multi-view { color: #c2410c; }
.canvas-result-select { position: absolute; z-index: 3; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 5px 7px; border: 1px solid #dbeafe; border-radius: 7px; color: #1d4ed8; background: rgba(255, 255, 255, .94); box-shadow: 0 2px 8px rgba(15, 23, 42, .08); cursor: pointer; font-size: 11px; font-weight: 800; }
.canvas-result-select input { width: 14px; height: 14px; margin: 0; accent-color: #2563eb; }
.prompt-dock { border-color: #e2e8f0; background: #fafafa; box-shadow: none; }
.prompt-dock-head .eyebrow { color: #2563eb; }
.prompt-dock h3 { color: #334155; }
.prompt-dock-head > span { color: #64748b; }
.prompt-dock textarea { border-color: #dbe1ea; background: #fff; }
.workspace-generate kbd { border-color: rgba(255,255,255,.45); color: rgba(255,255,255,.85); background: transparent; }

.reference-panel { width: 380px; padding: 14px; }
.reference-panel-actions { display: flex; align-items: flex-start; gap: 6px; }
.reference-gallery-wrap { position: relative; display: flex; flex: 1; min-height: 0; }
.reference-gallery-wrap .reference-gallery { flex: 1; min-height: 0; }
.reference-upload-choices { position: absolute; z-index: 20; top: 8px; right: 8px; left: 8px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 6px; border: 1px solid #bfdbfe; border-radius: 10px; background: rgba(255, 255, 255, .97); box-shadow: 0 12px 28px rgba(15, 23, 42, .16); }
.reference-upload-choices[hidden] { display: none; }
.reference-upload-choices button { padding: 8px 5px; border: 0; border-radius: 7px; color: #111827; background: #f8fafc; cursor: pointer; font-size: 10px; font-weight: 700; text-align: center; white-space: nowrap; }
.reference-upload-choices button:hover { color: #1d4ed8; background: #eff6ff; }
.reference-filter button { border-color: #e2e8f0; color: #64748b; background: #fff; }
.reference-filter button.active { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; box-shadow: none; }
.reference-panel-copy, .reference-panel-tip { color: #64748b; }
.reference-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; scrollbar-color: #cbd5e1 transparent; }
.reference-gallery.dragging { outline: 2px dashed #60a5fa; outline-offset: -2px; border-radius: 9px; background: #eff6ff; }
.reference-add-card { display: grid; min-height: 142px; place-content: center; gap: 5px; padding: 14px; border: 1px dashed #93c5fd; border-radius: 10px; color: #1d4ed8; background: linear-gradient(145deg, #f8fbff, #eff6ff); cursor: pointer; text-align: center; }
.reference-add-card:hover { border-color: #2563eb; background: #eaf2ff; }
.reference-add-card i { display: grid; width: 26px; height: 26px; margin: 0 auto 2px; place-items: center; border-radius: 50%; color: #fff; background: #2563eb; font-size: 19px; font-style: normal; line-height: 1; }
.reference-add-card b { color: #000; font-size: 12px; }
.reference-add-card small { color: #64748b; font-size: 10px; font-weight: 500; }
.reference-card img { aspect-ratio: 1.05; }
.reference-empty { border-color: #cbd5e1; color: #94a3b8; }
.reference-card { position: relative; border-color: #e2e8f0; color: #64748b; background: #fff; }
.reference-card-select { display: block; width: 100%; padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; text-align: left; }
.reference-card:hover, .reference-card.selected { border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(37, 99, 235, .08); }
.reference-card-delete { position: absolute; z-index: 2; top: 7px; right: 7px; display: grid; width: 25px; height: 25px; place-items: center; padding: 0; border: 1px solid rgba(255, 255, 255, .88); border-radius: 50%; color: #b91c1c; background: rgba(255, 255, 255, .94); box-shadow: 0 2px 8px rgba(15, 23, 42, .15); cursor: pointer; font-size: 18px; font-weight: 500; line-height: 1; opacity: .94; }
.reference-card-delete:hover { color: #fff; border-color: #dc2626; background: #dc2626; transform: scale(1.06); }
.reference-card span { color: #334155; }
.reference-card small { color: #64748b; }
.reference-panel-tip { border-top-color: #e2e8f0; }
.reference-panel-tip span { color: #2563eb; }

.workspace-layout.parameters-collapsed { grid-template-columns: 44px minmax(0, 1fr) 380px; }
.workspace-layout.references-collapsed { grid-template-columns: 248px minmax(0, 1fr) 44px; }
.workspace-layout.parameters-collapsed.references-collapsed { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.parameters-collapsed .generator-shell { width: 44px; }
.parameters-collapsed .generator-shell > :not(.control-panel-heading) { display: none; }
.parameters-collapsed .control-panel-heading { height: 100%; justify-content: center; padding: 6px; border-bottom: 0; }
.parameters-collapsed .control-panel-heading > div, .parameters-collapsed .control-panel-heading > span { display: none; }
.parameters-collapsed #collapseParameters { display: grid; width: 32px; height: 138px; min-height: 138px; grid-template-rows: auto 1fr; align-content: center; gap: 7px; border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; font-size: 20px; font-weight: 700; }
.parameters-collapsed #collapseParameters::after { content: "展开参数"; writing-mode: vertical-rl; color: #2563eb; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.parameters-collapsed #collapseParameters:hover { border-color: #2563eb; background: #dbeafe; }
.references-collapsed .reference-panel { width: 44px; padding: 6px; align-items: center; }
.references-collapsed .reference-panel > :not(.reference-heading) { display: none; }
.references-collapsed .reference-heading > div:first-child { display: none; }
.references-collapsed .reference-heading, .references-collapsed .reference-panel-actions { width: 100%; justify-content: center; }
.references-collapsed #collapseReferences { display: grid; width: 32px; height: 138px; min-height: 138px; grid-template-rows: auto 1fr; align-content: center; gap: 7px; border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; font-size: 20px; font-weight: 700; }
.references-collapsed #collapseReferences::after { content: "展开素材"; writing-mode: vertical-rl; color: #2563eb; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.references-collapsed #collapseReferences:hover { border-color: #2563eb; background: #dbeafe; }

.jobs-section, .history-page-shell, .job-card, .result-card, .result-details { border-color: #e2e8f0; color: #1f2937; background: #fff; box-shadow: none; }
.job-meta h3, .history-page-head h2 { color: #111827; }
.job-meta p, .muted, .job-pagination span { color: #64748b; }
.job-meta .reference-score { color: #2563eb; text-shadow: none; }
.progress-track { background: #e2e8f0; }
.progress-track i { background: #2563eb; box-shadow: none; }
.status.completed { border-color: #bbf7d0; color: #15803d; background: #f0fdf4; }
.result-image-button { background: #f8fafc; }
.result-card a, .result-card .use-for-image, .result-card .annotate-result { color: #1d4ed8; background: #fff; }

.multi-view-dialog, .history-dialog, .annotation-dialog { border-color: #e2e8f0; color: #1f2937; background: #fff; box-shadow: 0 20px 60px rgba(15, 23, 42, .18); }
.multi-view-dialog::backdrop, .history-dialog::backdrop { background: rgba(15, 23, 42, .32); }
.multi-view-dialog-head, .history-dialog-head, .annotation-header { border-bottom-color: #e2e8f0; background: #fff; }
.multi-view-dialog-head h2, .history-dialog-head h2, .annotation-header h2 { color: #111827; }
.multi-view-dialog-head p:last-child, .history-dialog-head p:last-child { color: #64748b; }
.annotation-tools { border-right-color: #e2e8f0; background: #fafafa; }
.annotation-region-list { border-color: #e2e8f0; background: #fff; }
.annotation-region-list header, .annotation-region-list header small, .annotation-region-list ol, .annotation-region-list li.empty { color: #000; }
.annotation-copy-tip { border-left-color: #2563eb; color: #000; background: #fff; }
.annotation-copy-tip b { color: #000; }

@media (max-width: 1260px) {
  .workspace-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .workspace-layout.parameters-collapsed { grid-template-columns: 44px minmax(0, 1fr); }
  .workspace-layout.references-collapsed { grid-template-columns: 260px minmax(0, 1fr); }
  .workspace-layout.parameters-collapsed.references-collapsed { grid-template-columns: 44px minmax(0, 1fr); }
  .reference-panel { position: static; grid-column: 1 / -1; height: auto; max-height: none; min-height: 300px; }
  .reference-heading .panel-collapse { display: none; }
  .reference-gallery { flex: 0 0 auto; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); max-height: 360px; }
}
@media (max-width: 940px) {
  .global-nav { width: 64px; flex-basis: 64px; }
  .global-nav .global-mark, .global-nav .nav-copy { display: none; }
  .global-nav .global-nav-head { justify-content: center; padding: 0; }
  .global-nav .global-nav-item { min-height: 54px; }
  .app-frame, .global-nav.collapsed + .app-frame { width: calc(100vw - 64px); padding: 0 14px; }
  .workspace-layout { grid-template-columns: 1fr; }
  .generator-shell { position: static; width: min(100%, 420px); height: auto; max-height: none; justify-self: center; }
  .generator-shell .tab-panel { max-height: 760px; }
  .reference-panel { position: static; }
}
@media (max-width: 640px) {
  body { display: block; }
  .global-nav { position: relative; width: 100%; height: 56px; flex: none; flex-direction: row; border-right: 0; border-bottom: 1px solid rgba(126, 167, 230, .16); }
  .global-nav-head { min-width: 58px; min-height: 56px; padding: 0 12px; border: 0; }
  .global-mark { display: grid !important; width: 27px; height: 27px; }
  .global-nav-head button { display: none; }
  .global-nav-list { display: flex; gap: 3px; padding: 5px; overflow-x: auto; }
  .global-nav-item, .global-nav.collapsed .global-nav-item { min-width: 42px; min-height: 42px; padding: 4px; }
  .global-nav .nav-copy { display: none; }
  .global-nav-foot { display: none; }
  .app-frame, .global-nav.collapsed + .app-frame { width: 100%; padding: 0 11px; }
  .workspace-titlebar { min-height: 0; margin-top: 10px; padding: 13px 15px; }
  .workspace-titlebar h1 { font-size: 19px; }
  .canvas-workspace { padding: 12px; }
  .generator-shell { width: 100%; }
  .canvas-action-bar { grid-template-columns: 1fr; }
  .canvas-workspace .result-grid, .workspace-layout .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .canvas-image-toolbar span { display: none; }
  .canvas-image-toolbar { justify-content: flex-end; }
  .prompt-dock-head { align-items: start; flex-direction: column; }
  .prompt-dock-head > span { text-align: left; }
}

/* Keep actionable names and section titles crisp; helper copy stays muted. */
.workspace-titlebar h1,
.control-panel-heading b,
.canvas-heading h2,
.reference-heading h2,
.panel-intro h2,
.form-section h3,
.output-settings h3,
.design-form > label,
.design-form .grid > label,
.design-form .tone-settings-heading > label,
.design-form .wide-notes,
.design-form legend,
.logo-copy b,
.text-reference-picker b,
.drop-zone strong,
.text-reference-preview-groups header b,
.rgb-heading b,
.view-group summary,
.view-group h4,
.view-grid b,
.image-edit-request h3,
.canvas-empty b,
.canvas-generating b,
.canvas-action b,
.prompt-dock h3,
.reference-card span,
.jobs-heading h2,
.job-meta h3,
.history-page-head h2,
.multi-view-dialog-head h2,
.history-dialog-head h2,
.annotation-header h2,
.annotation-region-list header b,
.annotation-copy-tip b {
  color: #000;
}

label { color: #000; }

/* Left navigation and parameter rail: text-first, larger, and consistently aligned. */
/* The navigation shares the workspace's sticky anchor. It starts alongside the
   effect workspace, then reaches the same 10px top offset as the centre canvas
   while the page scrolls, so the two rails never visually separate. */
#globalNav.global-nav {
  position: sticky !important;
  z-index: 3;
  top: 10px;
  align-self: flex-start;
  width: 112px;
  height: calc(100vh - 20px);
  margin: 84px 0 0;
  flex-basis: 112px;
  transition: none;
}
.global-nav-list { gap: 6px; padding: 7px; }
.global-nav-item { display: flex; min-height: 46px; align-items: center; justify-content: flex-start; padding: 9px; border-radius: 9px; }
.nav-copy { display: flex; align-items: center; justify-content: flex-start; gap: 8px; font-size: 14px; font-weight: 750; line-height: 1.25; text-align: left; }
.nav-copy b { min-width: 18px; color: #94a3b8; font-size: 10px; letter-spacing: .04em; }
.global-nav.collapsed { width: 44px; flex-basis: 44px; }
.global-nav.collapsed .global-nav-list { display: none; }
.app-frame { width: min(2200px, calc(100vw - 112px)); margin-left: 0; }
.global-nav.collapsed + .app-frame { width: min(2200px, calc(100vw - 44px)); margin-left: 0; }
.workspace-titlebar { width: calc(100% + 140px); margin-left: -126px; padding-left: 20px; }
.workspace-layout { grid-template-columns: 280px minmax(0, 1fr) 380px; }
.workspace-layout.parameters-collapsed { grid-template-columns: 44px minmax(0, 1fr) 380px; }
.generator-shell { width: 280px; }
.control-panel-heading b { font-size: 16px; }
.generator-shell .tab-panel { padding: 15px; }
.generator-shell .form-section { padding: 12px; }
.generator-shell .form-section h3 { margin-bottom: 11px; font-size: 14px; }
.generator-shell label { font-size: 12px; line-height: 1.35; }
.generator-shell input:not([type=checkbox]), .generator-shell select { height: 36px; padding-inline: 9px; font-size: 12px; }
.generator-shell textarea { min-height: 68px; font-size: 12px; }
.generator-shell .choice-row label { padding: 6px 8px; font-size: 11px; }
.generator-shell .field-help, .generator-shell .section-note { font-size: 11px; line-height: 1.55; }

@media (max-width: 940px) {
  #globalNav.global-nav { top: 10px; width: 112px; height: calc(100vh - 20px); margin: 84px 0 0; flex-basis: 112px; }
  .global-nav-list { padding-top: 7px; }
  .global-nav .nav-copy { display: flex; }
  .app-frame, .global-nav.collapsed + .app-frame { width: calc(100vw - 112px); }
}

@media (max-width: 640px) {
  #globalNav.global-nav { position: relative !important; top: auto; right: auto; bottom: auto; left: auto; width: 100%; height: auto; min-height: 56px; margin: 0; }
  .global-nav-list { display: flex; gap: 4px; padding: 6px; overflow-x: auto; }
  .global-nav-item { min-width: auto; min-height: 38px; padding: 7px 9px; }
  .global-nav .nav-copy { display: flex; font-size: 12px; white-space: nowrap; }
  .global-nav .nav-copy b { display: none; }
  .global-nav.collapsed .global-nav-list { display: none; }
  .app-frame, .global-nav.collapsed + .app-frame { width: 100%; margin-left: 0; }
  .workspace-titlebar { width: auto; margin-left: 0; padding-left: 15px; }
}

/* Keep the three workspace rails aligned and let the CSS grid own their widths. */
.workspace-layout { grid-template-columns: minmax(0, 280px) minmax(0, 1fr) minmax(0, 380px); }
.generator-shell, .reference-panel { width: 100%; }
.workspace-layout.parameters-collapsed { grid-template-columns: 44px minmax(0, 1fr) minmax(0, 380px); }
.workspace-layout.references-collapsed { grid-template-columns: minmax(0, 280px) minmax(0, 1fr) 44px; }
.workspace-layout.parameters-collapsed.references-collapsed { grid-template-columns: 44px minmax(0, 1fr) 44px; }

.control-panel-heading, .canvas-heading, .reference-heading {
  display: flex;
  min-height: 58px;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}
.control-panel-heading b, .canvas-heading h2, .reference-heading h2 {
  margin: 0;
  color: #111827;
  font-size: 16px;
  font-weight: 760;
  line-height: 1.3;
}
.canvas-workspace { gap: 0; padding: 0; }
.canvas-workspace .main-canvas-preview { margin: 14px 14px 0; }
.canvas-workspace .prompt-dock { margin: 13px 14px 14px; }
.reference-panel { padding: 0 14px 14px; }
.reference-panel .reference-heading { margin-inline: -14px; }
.reference-panel .reference-filter { margin-top: 14px; }

/* Desktop: the three workspace columns share one fixed rail height and stick
   together. Only their inner content scrolls or stretches, so the centre
   canvas cannot drift while the user scrolls parameter or reference content. */
@media (min-width: 1261px) {
  .workspace-layout { align-items: stretch; }
  .generator-shell, .canvas-workspace, .reference-panel {
    height: calc(100vh - 92px);
    max-height: 1050px;
  }
  .canvas-workspace {
    position: sticky;
    top: 10px;
    display: grid;
    min-height: 0;
    grid-template-rows: 58px minmax(0, 1fr) auto;
    overflow: hidden;
  }
  .canvas-workspace .main-canvas-preview {
    height: auto;
    min-height: 0;
    max-height: none;
  }
}

@media (max-width: 1260px) {
  .workspace-layout { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); }
  .workspace-layout.parameters-collapsed { grid-template-columns: 44px minmax(0, 1fr); }
  .workspace-layout.references-collapsed { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); }
  .workspace-layout.parameters-collapsed.references-collapsed { grid-template-columns: 44px minmax(0, 1fr); }
  .generator-shell, .reference-panel { width: 100%; }
}

@media (max-width: 940px) {
  .workspace-layout,
  .workspace-layout.parameters-collapsed,
  .workspace-layout.references-collapsed,
  .workspace-layout.parameters-collapsed.references-collapsed { grid-template-columns: minmax(0, 1fr); }
  .generator-shell, .parameters-collapsed .generator-shell { width: min(100%, 420px); }
  #collapseParameters { display: none; }
}

/* History uses the same full-width title treatment as the effect workspace. */
.history-page-shell { grid-template-rows: auto minmax(0, 1fr) auto; }
.history-titlebar { margin-bottom: 10px; }
.history-titlebar #refreshJobs {
  position: relative;
  z-index: 1;
  padding: 8px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1d4ed8;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}
.history-titlebar #refreshJobs:hover { border-color: #93c5fd; background: #eff6ff; }

@media (max-width: 640px) {
  .history-titlebar { margin-bottom: 8px; }
}
