:root {
  --ink: #151914;
  --ink-soft: #303730;
  --paper: #f2f4ee;
  --white: #fff;
  --muted: #70786f;
  --line: #d6dbd2;
  --line-strong: #aeb7ac;
  --acid: #d7ff45;
  --cyan: #1ce1e8;
  --pink: #ff4f96;
  --coral: #ff7867;
  --yellow: #ffe15a;
  --mint: #72ddb5;
  --black: #0b0e0c;
  --shadow: 0 24px 70px rgba(21, 25, 20, 0.13);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.page-progress { position: fixed; z-index: 100; inset: 0 0 auto; height: 3px; pointer-events: none; }
.page-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--pink), var(--yellow), var(--cyan), var(--acid)); }

.topbar {
  position: fixed;
  z-index: 60;
  inset: 0 0 auto;
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
  padding: 0 30px;
  color: var(--white);
  background: rgba(11, 14, 12, 0.96);
  border-bottom: 1px solid #313831;
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; text-decoration: none; }
.brand-mark { position: relative; width: 32px; height: 32px; flex: 0 0 auto; overflow: hidden; background: var(--ink); border: 1px solid #4d574e; border-radius: 4px; }
.brand-mark::before, .brand-mark::after, .brand-mark span { content: ""; position: absolute; border-radius: 50%; }
.brand-mark::before { width: 15px; height: 15px; left: 5px; top: 5px; background: var(--acid); }
.brand-mark::after { width: 10px; height: 10px; right: 4px; bottom: 4px; background: var(--coral); }
.brand-mark span { width: 7px; height: 7px; right: 5px; top: 5px; background: #82cfff; }
.brand > span:last-child { display: grid; gap: 2px; }
.brand strong { font-size: 13px; font-weight: 900; }
.brand small { color: #93a097; font-size: 9px; font-weight: 700; }

.product-switch { display: flex; gap: 3px; padding: 4px; background: #151b16; border: 1px solid #3a443c; border-radius: 6px; }
.product-switch a { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; color: #98a49b; border-radius: 4px; font-size: 11px; font-weight: 800; text-decoration: none; }
.product-switch a.active, .product-switch a:hover { color: var(--white); background: #2a332b; }
.product-switch svg { width: 14px; }

.top-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.asset-button, .credit-button, .avatar-button { height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #3d473f; cursor: pointer; }
.asset-button, .credit-button { gap: 7px; padding: 0 11px; color: var(--white); background: #151b16; border-radius: 5px; }
.asset-button svg, .credit-button svg { width: 15px; }
.asset-button span, .credit-button span { font-size: 10px; }
.credit-button svg { color: var(--yellow); }
.credit-button strong { font-size: 12px; }
.avatar-button { width: 38px; padding: 0; color: var(--black); background: var(--mint); border-color: var(--mint); border-radius: 50%; font-size: 11px; font-weight: 900; }
.asset-button:hover, .credit-button:hover { color: var(--black); background: var(--acid); border-color: var(--acid); }

main { padding-top: 68px; }
.workbench-heading {
  min-height: 178px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 46px max(30px, calc((100vw - 1500px) / 2)) 32px;
  color: var(--white);
  background:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
    var(--black);
  background-size: 54px 54px;
  border-bottom: 1px solid #343c35;
}
.workbench-heading p { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--acid); font-size: 9px; font-weight: 900; }
.workbench-heading p span { width: 20px; height: 2px; background: var(--pink); }
.workbench-heading h1 { margin: 0; max-width: 760px; font-size: 38px; line-height: 1.12; }
.heading-status { display: flex; gap: 8px; padding-bottom: 4px; }
.heading-status span { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; color: #bac4bc; background: #151b16; border: 1px solid #39433b; border-radius: 4px; font-size: 9px; font-weight: 800; }
.heading-status svg { width: 13px; color: var(--cyan); }

.visual-workbench {
  width: min(1500px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px minmax(520px, 1fr) minmax(320px, 420px);
  align-items: start;
  background: var(--white);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.format-rail, .visual-form, .visual-preview { min-width: 0; min-height: 890px; padding: 26px; }
.format-rail { background: #e9ede5; border-right: 1px solid var(--line-strong); }
.visual-form { background: var(--white); }
.visual-preview { position: sticky; top: 68px; color: var(--white); background: #111612; border-left: 1px solid #39413a; }

.rail-heading, .form-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.rail-heading > span, .form-heading > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: var(--black); background: var(--acid); border: 1px solid var(--ink); border-radius: 4px; font-size: 10px; font-weight: 900; }
.rail-heading small, .form-heading small { color: var(--muted); font-size: 8px; font-weight: 900; }
.rail-heading h2, .form-heading h2 { margin: 3px 0 0; font-size: 17px; }

.format-options { display: grid; gap: 6px; }
.format-options button { width: 100%; min-height: 62px; display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px; padding: 9px 10px; text-align: left; color: #4f584f; background: rgba(255,255,255,0.56); border: 1px solid transparent; border-radius: 5px; cursor: pointer; }
.format-options button:hover, .format-options button.active { color: var(--ink); background: var(--white); border-color: var(--ink); box-shadow: 3px 3px 0 var(--cyan); }
.format-options svg { width: 19px; }
.format-options strong, .format-options small { display: block; }
.format-options strong { font-size: 11px; }
.format-options small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.format-fact { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line-strong); }
.format-fact span { display: block; color: #536052; font-size: 30px; font-weight: 900; }
.format-fact p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }

.visual-form { display: block; }
.creation-mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: -4px 0 18px; padding: 4px; background: #edf0e9; border: 1px solid var(--line); border-radius: 5px; }
.creation-mode-switch button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 10px; color: #69736a; background: transparent; border: 1px solid transparent; border-radius: 3px; font-size: 10px; font-weight: 900; cursor: pointer; }
.creation-mode-switch button.active { color: var(--ink); background: var(--white); border-color: var(--ink); box-shadow: 2px 2px 0 var(--cyan); }
.creation-mode-switch svg { width: 14px; }
.director-panel { padding: 2px 0 19px; margin-bottom: 17px; border-bottom: 1px solid var(--line-strong); }
.director-heading, .director-result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.director-heading { margin-bottom: 13px; }
.director-heading small, .director-result-heading small, .director-detail small { color: var(--muted); font-size: 8px; font-weight: 900; }
.director-heading h3, .director-result-heading h3 { margin: 4px 0 0; font-size: 17px; line-height: 1.35; }
.director-heading > span, .director-result-heading > span { flex: 0 0 auto; padding: 5px 7px; color: #315144; background: #e3f7e7; border: 1px solid #9ccbb0; border-radius: 3px; font-size: 8px; font-weight: 900; }
.director-intent-field textarea { min-height: 124px; background: #fbfdf8; }
.director-actions, .director-result-actions { display: flex; gap: 8px; align-items: center; }
.director-actions { justify-content: flex-end; margin-top: -4px; }
.director-actions .secondary-button { min-height: 40px; }
.director-reference-state { min-height: 18px; margin: 12px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.director-result { margin-top: 15px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.director-result-heading h3 { max-width: 470px; font-size: 13px; }
.director-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 13px 0; }
.director-chip { display: inline-flex; align-items: center; min-height: 25px; padding: 0 7px; color: #334236; background: #edf3e2; border: 1px solid #c9d7b1; border-radius: 3px; font-size: 8px; font-weight: 850; }
.director-detail { padding: 10px 0; border-top: 1px solid #e4e8e1; }
.director-detail p, .director-detail ul { margin: 5px 0 0; color: #4b554d; font-size: 10px; line-height: 1.55; }
.director-detail ul { padding-left: 17px; }
.director-detail li + li { margin-top: 3px; }
.director-result-actions { justify-content: flex-end; margin-top: 12px; }
.manual-mode-hint { margin: -4px 0 15px; padding: 9px 10px; color: #425244; background: #f1f7e5; border-left: 3px solid var(--acid); font-size: 9px; font-weight: 750; line-height: 1.5; }
.visual-form[data-mode="agent"] .manual-brief-fields { display: none; }
.visual-form[data-mode="manual"] .director-panel { display: none; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { position: relative; min-width: 0; display: grid; gap: 7px; margin-bottom: 14px; }
.field > span, fieldset legend { color: var(--ink-soft); font-size: 10px; font-weight: 900; }
.field > span b { color: #b93f66; font-size: 8px; }
.field input, .field textarea, .field select { width: 100%; color: var(--ink); background: #f8faf6; border: 1px solid var(--line); border-radius: 4px; outline: none; font-size: 12px; font-weight: 650; }
.field input, .field select { height: 44px; padding: 0 11px; }
.field textarea { min-height: 104px; padding: 11px; resize: vertical; line-height: 1.6; }
.field textarea.compact { min-height: 72px; }
.field input:focus, .field textarea:focus, .field select:focus { background: var(--white); border-color: var(--ink); box-shadow: 0 0 0 2px var(--acid); }
.field > small { position: absolute; right: 8px; bottom: 6px; color: #9aa19a; font-size: 8px; }
.field > small em { font-style: normal; }

.reference-upload { position: relative; min-height: 82px; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 6px 0 17px; padding: 10px; background: #f5f7f2; border: 1px dashed var(--line-strong); border-radius: 5px; }
.reference-upload.dragging { background: #f4fbd9; border-color: var(--ink); }
.reference-preview { position: relative; width: 58px; height: 58px; overflow: hidden; background: #dfe4dc; border-radius: 3px; }
.reference-preview img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.35); opacity: 0.55; }
.reference-upload.has-image .reference-preview img { filter: none; opacity: 1; }
.reference-preview span { position: absolute; left: 4px; bottom: 4px; padding: 2px 4px; color: var(--white); background: rgba(11,14,12,0.82); border-radius: 2px; font-size: 7px; font-weight: 900; }
.reference-upload strong, .reference-upload small { display: block; }
.reference-upload strong { font-size: 11px; }
.reference-upload small { margin-top: 5px; color: var(--muted); font-size: 8px; }
.reference-upload button { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--white); border: 1px solid var(--line-strong); border-radius: 4px; font-size: 9px; font-weight: 900; cursor: pointer; }
.reference-upload button svg { width: 14px; }
.reference-upload .remove-reference { position: absolute; right: -7px; top: -7px; width: 24px; min-height: 24px; display: grid; place-items: center; padding: 0; color: var(--white); background: var(--ink); border-radius: 50%; }

fieldset { min-width: 0; margin: 0 0 17px; padding: 0; border: 0; }
fieldset legend { margin-bottom: 9px; }
.direction-options { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.direction-options button { min-width: 0; min-height: 64px; display: grid; justify-items: center; gap: 6px; padding: 7px 4px; background: var(--white); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.direction-options button:hover, .direction-options button.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.direction-options strong { overflow-wrap: anywhere; font-size: 8px; }
.swatch { width: 100%; height: 25px; border: 1px solid #303630; border-radius: 2px; }
.swatch.tech { background: linear-gradient(135deg, #101b1a 0 45%, var(--cyan) 45% 68%, var(--acid) 68%); }
.swatch.life { background: linear-gradient(135deg, #f0d8bb 0 45%, #6e9e78 45% 70%, #f56f67 70%); }
.swatch.editorial { background: linear-gradient(135deg, #f6f3e9 0 50%, #171917 50% 75%, #e04e4e 75%); }
.swatch.energy { background: linear-gradient(135deg, var(--pink) 0 40%, var(--yellow) 40% 68%, #2d4ce8 68%); }
.swatch.minimal { background: linear-gradient(135deg, #f7f8f5 0 70%, #535b55 70%); }
.swatch.product { background: linear-gradient(135deg, #e7eeef 0 50%, #152229 50% 73%, #ef675b 73%); }

.package-field { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.package-field legend { grid-column: 1 / -1; }
.package-field label { position: relative; min-height: 66px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px; padding: 10px 12px; background: #f7f9f5; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.package-field label:has(input:checked) { background: #f7fce6; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.package-field input { position: absolute; opacity: 0; }
.package-field strong, .package-field small { display: block; }
.package-field strong { font-size: 11px; }
.package-field small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.package-field b { font-size: 11px; }
.package-field em { padding: 2px 4px; color: #554000; background: var(--yellow); border-radius: 2px; font-size: 7px; font-style: normal; }

.consent-row { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 16px; color: #596159; font-size: 9px; line-height: 1.5; }
.consent-row input { width: 15px; height: 15px; flex: 0 0 auto; margin: 0; accent-color: var(--ink); }
.consent-row a { font-weight: 850; }
.current-task { width: 100%; min-height: 54px; display: grid; grid-template-columns: 30px 1fr 18px; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 11px; text-align: left; color: var(--white); background: var(--ink); border: 0; border-radius: 4px; cursor: pointer; }
.current-task > svg:first-child { width: 17px; color: var(--acid); animation: spin 1.3s linear infinite; }
.current-task > svg:last-child { width: 15px; }
.current-task strong, .current-task small { display: block; }
.current-task strong { font-size: 10px; }
.current-task small { margin-top: 3px; color: #9ea9a0; font-size: 8px; }
.submit-row { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.submit-row small, .submit-row strong { display: block; }
.submit-row small { color: var(--muted); font-size: 8px; }
.submit-row strong { margin-top: 3px; font-size: 15px; }
.primary-button, .secondary-button, .danger-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; border-radius: 4px; font-size: 10px; font-weight: 900; text-decoration: none; cursor: pointer; }
.primary-button { color: var(--white); background: var(--ink); border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--pink); }
.primary-button:hover { color: var(--black); background: var(--acid); }
.primary-button svg, .secondary-button svg, .danger-button svg { width: 15px; }
.secondary-button { color: var(--ink); background: var(--white); border: 1px solid var(--line-strong); }
.danger-button { color: #a04646; background: transparent; border: 1px solid #cc9a9a; }
.primary-button.full, .secondary-button.full { width: 100%; margin-top: 10px; box-shadow: none; }
button:disabled { cursor: wait; opacity: 0.55; }

.preview-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.preview-heading > div { display: flex; align-items: center; gap: 7px; }
.preview-heading strong { font-size: 11px; }
.preview-heading > span { padding: 5px 7px; color: #dbe4dd; background: #1b211c; border: 1px solid #3e4941; border-radius: 3px; font-size: 8px; font-weight: 800; }
.live-dot { width: 7px; height: 7px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 14px rgba(28,225,232,0.85); animation: pulse 1.8s ease-in-out infinite; }
.artboard-stage { min-height: 570px; display: grid; place-items: center; overflow: hidden; background: #0b0f0c; border: 1px solid #3d473f; perspective: 900px; }
.artboard { position: relative; width: min(86%, 300px); aspect-ratio: 3 / 4; overflow: hidden; background: #222; box-shadow: 0 28px 60px rgba(0,0,0,0.55); transition: width 280ms ease, aspect-ratio 280ms ease, transform 450ms ease; }
.artboard[data-format="x-banner"] { width: min(51%, 175px); aspect-ratio: 3 / 8; }
.artboard[data-format="ecommerce-main"] { width: min(88%, 330px); aspect-ratio: 1; }
.artboard[data-format="douyin-cover"] { width: min(64%, 230px); aspect-ratio: 9 / 16; }
.artboard img { width: 100%; height: 100%; object-fit: cover; transition: opacity 180ms ease; }
.crop-mark { position: absolute; width: 17px; height: 17px; pointer-events: none; }
.crop-mark.tl { left: 7px; top: 7px; border-left: 1px solid var(--cyan); border-top: 1px solid var(--cyan); }
.crop-mark.tr { right: 7px; top: 7px; border-right: 1px solid var(--cyan); border-top: 1px solid var(--cyan); }
.crop-mark.bl { left: 7px; bottom: 7px; border-left: 1px solid var(--pink); border-bottom: 1px solid var(--pink); }
.crop-mark.br { right: 7px; bottom: 7px; border-right: 1px solid var(--pink); border-bottom: 1px solid var(--pink); }
.preview-meta { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #39423a; }
.preview-meta small, .preview-meta strong { display: block; }
.preview-meta small { color: #839087; font-size: 7px; }
.preview-meta strong { max-width: 235px; margin-top: 4px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.preview-meta > span { color: var(--cyan); font-size: 8px; font-weight: 900; }
.ontology-strip { min-height: 66px; display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; align-items: center; gap: 5px; color: #69746c; font-size: 7px; font-weight: 850; }
.ontology-strip span.complete { color: var(--acid); }
.ontology-strip i { height: 1px; background: #3a443c; }

.example-band { padding: 64px max(30px, calc((100vw - 1240px) / 2)) 76px; background: #e8ece4; border-top: 1px solid var(--line-strong); }
.example-heading { margin-bottom: 22px; }
.example-heading small { color: var(--muted); font-size: 8px; font-weight: 900; }
.example-heading h2 { margin: 6px 0 0; font-size: 24px; }
.example-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.example-grid figure { position: relative; min-width: 0; margin: 0; overflow: hidden; background: var(--black); border-radius: 6px; }
.example-grid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; transition: transform 550ms ease; }
.example-grid figure[data-format="x-banner"],
.example-grid figure[data-format="douyin-cover"] { background: #0b0f0c; }
.example-grid figure[data-format="x-banner"] img,
.example-grid figure[data-format="douyin-cover"] img,
.example-grid figure[data-format="ecommerce-main"] img { object-fit: contain; object-position: center; }
.example-grid figure[data-format="ecommerce-main"] { background: #f4f7f2; }
.example-grid figure:hover img { transform: scale(1.025); }
.example-grid figcaption { position: absolute; inset: auto 0 0; padding: 38px 14px 13px; color: var(--white); background: linear-gradient(transparent, rgba(7,9,8,0.91)); }
.example-grid strong, .example-grid span { display: block; }
.example-grid strong { font-size: 12px; }
.example-grid span { margin-top: 4px; color: #bdc6bf; font-size: 8px; }

footer { min-height: 104px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; padding: 22px 30px; color: #c7d0c9; background: var(--black); border-top: 1px solid #303730; }
footer .brand.compact strong { color: var(--white); font-size: 11px; }
footer p, footer > span { margin: 0; color: #7e8981; font-size: 9px; }
footer > span { text-align: right; }

.drawer-backdrop { position: fixed; z-index: 70; inset: 0; background: rgba(11,14,12,0.54); backdrop-filter: blur(4px); }
.works-drawer { position: fixed; z-index: 80; inset: 0 0 0 auto; width: min(440px, 100vw); padding: 28px; overflow-y: auto; background: var(--paper); border-left: 1px solid var(--line-strong); box-shadow: -24px 0 70px rgba(21,25,20,0.2); transform: translateX(102%); transition: transform 220ms ease; }
.works-drawer.open { transform: translateX(0); }
.drawer-heading { display: flex; justify-content: space-between; gap: 12px; }
.drawer-heading small { color: var(--muted); font-size: 8px; font-weight: 900; }
.drawer-heading h2 { margin: 4px 0 0; font-size: 23px; }
.drawer-heading button, .dialog-close { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; background: var(--white); border: 1px solid var(--line-strong); border-radius: 4px; cursor: pointer; }
.drawer-heading svg, .dialog-close svg { width: 16px; }
.work-summary { display: flex; align-items: baseline; gap: 8px; margin: 24px 0 14px; padding: 14px; color: var(--white); background: var(--ink); border-radius: 5px; }
.work-summary strong { color: var(--acid); font-size: 25px; }
.work-summary span { color: #a6b0a8; font-size: 9px; }
.work-list { display: grid; gap: 8px; }
.work-item { min-height: 82px; display: grid; grid-template-columns: 70px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 7px; background: var(--white); border: 1px solid var(--line); border-radius: 5px; }
.work-item img { width: 70px; height: 70px; object-fit: cover; border-radius: 3px; }
.work-item strong, .work-item span { display: block; }
.work-item strong { font-size: 10px; }
.work-item span { margin-top: 5px; color: var(--muted); font-size: 8px; }
.work-item button { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; background: var(--white); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.work-item svg { width: 14px; }
.empty-works { min-height: 220px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; background: var(--white); border: 1px solid var(--line); border-radius: 5px; font-size: 10px; }
.empty-works svg { width: 28px; }

dialog { color: var(--ink); background: var(--white); border: 1px solid var(--ink); border-radius: 7px; box-shadow: 0 34px 100px rgba(21,25,20,0.38); }
dialog::backdrop { background: rgba(11,14,12,0.62); backdrop-filter: blur(6px); }
.task-dialog { position: relative; width: min(760px, calc(100vw - 24px)); min-height: 520px; padding: 36px; }
.account-dialog, .wallet-dialog { position: relative; width: min(430px, calc(100vw - 24px)); padding: 34px; }
.dialog-close { position: absolute; right: 13px; top: 13px; z-index: 3; }
.task-running, .task-failure { min-height: 430px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.task-signal { width: 78px; height: 78px; display: grid; place-items: center; margin-bottom: 22px; color: var(--black); background: var(--acid); border: 1px solid var(--ink); border-radius: 50%; box-shadow: 0 0 0 8px #edf3d8; }
.task-signal svg { width: 28px; }
.task-running > small, .task-failure > small, .task-result small, .account-dialog > section > small, .wallet-dialog > small { color: var(--muted); font-size: 8px; font-weight: 900; }
.task-running h2, .task-failure h2 { margin: 6px 0 0; font-size: 26px; }
.task-running > p, .task-failure > p { margin: 10px 0 22px; color: var(--muted); font-size: 11px; }
.progress-track { width: min(100%, 500px); height: 8px; overflow: hidden; background: #e6eae2; border-radius: 4px; }
.progress-track span { display: block; width: 4%; height: 100%; background: var(--ink); transition: width 400ms ease; }
.task-stages { width: min(100%, 540px); display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-top: 11px; }
.task-stages span { color: #9ba39b; font-size: 8px; font-weight: 750; }
.task-stages span.active { color: var(--ink); }
.task-running > em { margin-top: 28px; color: #929a92; font-size: 8px; font-style: normal; }
.task-running .danger-button { margin-top: 14px; min-height: 34px; }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.result-heading h2 { margin: 5px 0 0; font-size: 25px; }
.result-heading > span, .task-failure > span { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink); background: var(--mint); border: 1px solid var(--ink); border-radius: 50%; }
.result-heading svg, .task-failure > span svg { width: 20px; }
.result-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 24px 0; }
.result-images img { width: 100%; max-height: 520px; object-fit: contain; background: #eef1eb; border: 1px solid var(--line-strong); border-radius: 4px; }
.result-actions { display: flex; justify-content: flex-end; gap: 9px; }
.result-actions button { min-height: 42px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; background: var(--white); border: 1px solid var(--line-strong); border-radius: 4px; cursor: pointer; }
.result-actions svg { width: 15px; }
.task-failure > span { margin-bottom: 18px; color: #8a3b3b; background: #ffd8d5; }
.task-failure .primary-button { margin-top: 5px; }
.account-dialog h2, .wallet-dialog h2 { margin: 7px 0 20px; font-size: 28px; }
.account-dialog p { color: var(--muted); font-size: 10px; }
.account-dialog form, .wallet-dialog form { display: grid; gap: 12px; }
.account-dialog label, .wallet-dialog label { display: grid; gap: 6px; }
.account-dialog label > span, .wallet-dialog label > span { font-size: 9px; font-weight: 900; }
.account-dialog input, .wallet-dialog input { width: 100%; height: 43px; padding: 0 11px; background: #f7f9f5; border: 1px solid var(--line-strong); border-radius: 4px; outline: none; }
.account-dialog input:focus, .wallet-dialog input:focus { border-color: var(--ink); box-shadow: 0 0 0 2px var(--acid); }
.auth-consent { display: flex !important; grid-template-columns: 15px 1fr; align-items: flex-start; gap: 8px !important; font-size: 9px; line-height: 1.5; }
.auth-consent input { width: 15px; height: 15px; margin: 0; accent-color: var(--ink); }
.auth-consent span { font-weight: 500 !important; }
.dev-code { margin: 0; padding: 8px; color: #22503a !important; background: #e3f8eb; border: 1px solid #9bd6b4; border-radius: 4px; font-weight: 800; }
.account-summary { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-bottom: 18px; padding: 16px; background: #f2f5ef; border: 1px solid var(--line); border-radius: 5px; }
.account-summary span { color: var(--muted); font-size: 10px; }
.account-summary strong { font-size: 11px; }
.terms-renewal { margin-bottom: 15px; padding: 13px; background: #fff8d8; border: 1px solid #d8c45e; border-radius: 4px; }
.terms-renewal > strong { font-size: 11px; }
.terms-renewal > p { margin: 5px 0 9px; color: #665f3d; font-size: 9px; line-height: 1.5; }
.terms-renewal > label { display: flex; grid-template-columns: 15px 1fr; align-items: center; gap: 7px; }
.terms-renewal > label input { width: 15px; height: 15px; padding: 0; accent-color: var(--ink); }
.terms-renewal > label span { font-size: 9px; }
.wallet-balance { display: flex; justify-content: space-between; padding: 14px 0; margin-bottom: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 10px; }
.wallet-balance strong { font-size: 16px; }
.toast { position: fixed; z-index: 110; left: 50%; bottom: 22px; max-width: calc(100vw - 24px); padding: 11px 14px; color: var(--white); background: var(--ink); border: 1px solid #4d574f; border-radius: 4px; box-shadow: var(--shadow); font-size: 10px; font-weight: 800; opacity: 0; transform: translate(-50%, 14px); pointer-events: none; transition: 180ms ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes pulse { 50% { opacity: 0.45; transform: scale(0.7); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .visual-workbench { grid-template-columns: 230px minmax(480px, 1fr); }
  .visual-preview { position: relative; top: 0; grid-column: 1 / -1; min-height: auto; display: grid; grid-template-columns: minmax(300px, 0.8fr) minmax(280px, 1fr); gap: 18px; }
  .preview-heading, .preview-meta, .ontology-strip { grid-column: 2; }
  .artboard-stage { grid-row: 1 / 4; min-height: 500px; }
}

@media (max-width: 820px) {
  .topbar { grid-template-columns: auto 1fr auto; padding: 0 14px; }
  .brand small, .asset-button span { display: none; }
  .product-switch { justify-self: center; }
  .product-switch a { padding: 0 9px; }
  .workbench-heading { min-height: 150px; padding: 34px 18px 24px; }
  .workbench-heading h1 { font-size: 29px; }
  .heading-status { display: none; }
  .visual-workbench { display: block; width: 100%; border: 0; box-shadow: none; }
  .format-rail, .visual-form, .visual-preview { min-height: auto; }
  .format-rail { border-right: 0; border-bottom: 1px solid var(--line-strong); }
  .format-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .format-options button { grid-template-columns: 1fr; justify-items: center; min-height: 82px; text-align: center; }
  .format-fact { display: none; }
  .visual-preview { display: block; }
  .artboard-stage { min-height: 520px; }
}

@media (max-width: 560px) {
  .topbar { height: 62px; gap: 7px; padding: 0 10px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand > span:last-child { display: none; }
  .product-switch { gap: 2px; padding: 3px; }
  .product-switch a { min-height: 32px; padding: 0 8px; font-size: 9px; }
  .product-switch svg { width: 12px; }
  .asset-button { display: none; }
  .credit-button { padding: 0 8px; }
  .credit-button span { display: none; }
  main { padding-top: 62px; }
  .workbench-heading { min-height: 134px; align-items: center; padding: 24px 16px 20px; }
  .workbench-heading p { font-size: 8px; }
  .workbench-heading h1 { font-size: 25px; }
  .format-rail, .visual-form, .visual-preview { padding: 20px 16px; }
  .format-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .director-actions, .director-result-actions { display: grid; grid-template-columns: 1fr; }
  .director-actions > *, .director-result-actions > * { width: 100%; }
  .direction-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .package-field { grid-template-columns: 1fr; }
  .reference-upload { grid-template-columns: 52px minmax(0, 1fr); }
  .reference-preview { width: 52px; height: 52px; }
  .reference-upload > button:not(.remove-reference) { grid-column: 1 / -1; }
  .submit-row { position: sticky; z-index: 8; bottom: 0; margin: 0 -16px -20px; padding: 12px 16px; background: rgba(255,255,255,0.96); box-shadow: 0 -8px 24px rgba(21,25,20,0.08); backdrop-filter: blur(12px); }
  .primary-button { padding: 0 13px; }
  .visual-preview { border-left: 0; }
  .artboard-stage { min-height: 480px; }
  .example-band { padding: 42px 16px 52px; }
  .example-grid { grid-template-columns: 1fr; }
  .example-grid figure { max-height: 520px; }
  footer { grid-template-columns: 1fr auto; padding: 20px 16px; }
  footer p { display: none; }
  .task-dialog { padding: 30px 16px 20px; }
  .task-stages { gap: 2px; }
  .task-stages span { font-size: 7px; }
  .result-images { grid-template-columns: 1fr; }
  .result-actions { flex-direction: column-reverse; }
  .result-actions > * { width: 100%; }
  .account-dialog, .wallet-dialog { padding: 30px 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
