/* A working sketchbook: expressive edges, quiet reading surfaces, complete images. */
html:has(body.creation-page) { scrollbar-gutter: auto; }
.creation-page {
  --studio-radius: 7px 11px 6px 9px;
  --studio-card-radius: 5px 9px 4px 7px;
  --studio-dialog-radius: 12px 18px 10px 15px;
  --studio-shadow: 0 3px 12px var(--card-shadow);
  --studio-field: color-mix(in srgb, var(--card) 94%, var(--paper));
  height: 100vh; overflow: hidden; font-size: 17px;
}
[data-theme="ink"] .creation-page { --studio-radius: 4px 8px 5px 3px; --studio-card-radius: 3px 5px 2px 4px; --studio-dialog-radius: 6px 10px 5px 8px; --studio-shadow: 0 2px 8px var(--card-shadow); }
[data-theme="cobalt"] .creation-page { --studio-radius: 1px; --studio-card-radius: 1px; --studio-dialog-radius: 2px; --studio-shadow: 3px 3px 0 var(--card-shadow); }
[data-theme="lifestyle"] .creation-page { --studio-radius: 5px 9px 5px 8px; --studio-card-radius: 5px 10px 4px 8px; --studio-dialog-radius: 10px 16px 8px 12px; --studio-shadow: 0 1px 0 var(--card-shadow); }
[data-theme="storybook"] .creation-page { --studio-radius: 10px 15px 9px 13px; --studio-card-radius: 8px 13px 6px 11px; --studio-dialog-radius: 15px 23px 12px 19px; --studio-shadow: 2px 4px 0 var(--card-shadow); }
.creation-page [hidden] { display: none !important; }
.creation-page :is(button, a, input, select, textarea) { transition: background-color .16s, color .16s, border-color .16s, box-shadow .16s; }
.creation-page :is(h1, h2, h3, p) { margin: 0; }
.creation-page textarea { font: 17px/1.75 var(--font); color: var(--ink); resize: vertical; }
.creation-page [data-icon] { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.creation-page [data-icon] svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.creation-page :is(button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.creation-page :is(button, select):disabled { cursor: not-allowed; opacity: .48; }
.creation-page :is(.brief-scroll, .prompt-page, .creation-dialog, .style-options, .job-preview, #work-prompt) { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.creation-header { height: 80px; padding: 8px 28px; display: flex; align-items: center; gap: 32px; background: var(--sky) url('assets/paper-grain.svg'); color: var(--sky-text); border-bottom: 1px solid color-mix(in srgb, var(--sky-text) 25%, transparent); position: relative; z-index: 10; }
.creation-header .brand { transform: scale(.8); transform-origin: left center; margin-right: -28px; }
.creation-navigation { display: flex; gap: 24px; align-items: center; font-size: 18px; }
.creation-navigation a { text-decoration: none; opacity: .76; }
.creation-navigation a:hover { opacity: 1; color: var(--sky-text); }
.creation-navigation [aria-current] { position: relative; color: var(--sky-highlight); }
.creation-navigation [aria-current]::after { content: ''; position: absolute; height: 3px; left: 0; right: 0; bottom: -11px; background: currentColor; clip-path: polygon(0 30%,100% 0,97% 90%,8% 100%); }
.creation-header-tools { display: flex; align-items: center; gap: 21px; margin-left: auto; font-size: 16px; }
.header-action { display: flex; align-items: center; gap: 7px; padding: 9px 2px; white-space: nowrap; }
.header-action:hover { color: var(--sky-highlight); }
.creation-page .theme-picker summary { font-size: 16px; padding: 9px 12px; }
.settings-dot { width: 6px; height: 6px; border-radius: 100%; background: var(--sky-highlight); }
.creation-workspace { height: calc(100vh - 80px); max-width: none; padding: 0; display: grid; grid-template-columns: 382px minmax(0,1fr); margin: 0; }
.creative-brief { display: flex; flex-direction: column; min-height: 0; background: color-mix(in srgb,var(--card) 84%,var(--paper)); border-right: 1px solid var(--line); }
.brief-heading { flex-shrink: 0; padding: 20px 24px 16px; display: flex; align-items: center; gap: 10px; }
.brief-heading h1 { font-size: 23px; letter-spacing: -.5px; line-height: 1.35; font-weight: 500; }
.quiet-button { font-size: 15px; color: var(--muted); margin-left: auto; padding: 5px 0; white-space: nowrap; }
.quiet-button:hover { color: var(--accent); }
.brief-scroll { flex: 1; overflow-y: auto; min-height: 0; padding: 0 24px 12px; overscroll-behavior: contain; }
.brief-section { padding: 17px 0; border-top: 1px solid var(--line); }
.brief-section:first-child { padding-top: 14px; }
.control-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 12px; }
.control-heading h2, .section-label { font-size: 18px; font-weight: 500; }
.section-label { display: block; }
.text-button { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; padding: 4px 0; color: var(--accent); white-space: nowrap; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.style-mode { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; padding: 3px; margin-bottom: 15px; border: 1px solid var(--line); border-radius: var(--studio-radius); background: color-mix(in srgb,var(--paper) 75%,var(--card)); }
.style-mode button { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 37px; padding: 7px 3px; border-radius: var(--studio-card-radius); color: var(--muted); font-size: 14px; white-space: nowrap; }
.style-mode button svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.style-mode button:hover:not(:disabled) { background: color-mix(in srgb,var(--card) 65%,transparent); color: var(--ink); }
.style-mode button[aria-pressed="true"] { color: var(--accent); background: var(--card) url('assets/paper-grain.svg'); box-shadow: 0 1px 4px var(--card-shadow); }
.style-mode-note { margin: -2px 0 4px !important; font-size: 15px; color: var(--muted); line-height: 1.8; }
.chosen-style { padding: 0; display: flex; flex-direction: column; width: 100%; gap: 12px; text-align: left; }
.chosen-style-art { display: flex; justify-content: center; align-items: center; width: 100%; position: relative; border-radius: var(--studio-card-radius); background: color-mix(in srgb,var(--paper) 44%,transparent) url('assets/paper-grain.svg'); overflow: hidden; }
.chosen-style-art::before { content: ''; position: absolute; inset: -22px; background-image: var(--style-art, none); background-size: cover; background-position: center; filter: blur(18px) saturate(.7); opacity: .19; pointer-events: none; }
.chosen-style-art > img { position: relative; display: block; width: auto; height: auto; max-width: 100%; max-height: 170px; border-radius: 2px; box-shadow: 0 2px 7px var(--card-shadow); }
.chosen-style-art .style-expand { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: var(--studio-card-radius); background: var(--label-paper); color: var(--ink); box-shadow: 0 1px 4px var(--card-shadow); transition: transform .16s; }
.chosen-style:hover .style-expand { color: var(--accent); transform: scale(1.08); }
.style-expand svg { width: 15px !important; height: 15px !important; }
.chosen-style-copy { display: block; width: 100%; min-width: 0; }
.chosen-style strong { display: block; font-size: 20px; line-height: 1.4; font-weight: 500; }
.chosen-style small { color: var(--muted); font-size: 14px; line-height: 1.65; display: block; margin-top: 4px; overflow-wrap: anywhere; }
.auto-style-choice { margin-top: 12px; padding: 10px 12px; border-left: 2px solid var(--accent); background: color-mix(in srgb,var(--accent-wash) 40%,transparent); font-size: 14px; line-height: 1.75; color: var(--muted); border-radius: var(--studio-card-radius); }
.auto-style-choice strong { color: var(--ink); font-weight: 500; }
.auto-style-choice button { margin-top: 5px; color: var(--accent); font-size: 14px; }
.field-label { display: block; font-size: 14px; color: var(--muted); margin: 13px 0 6px; }
.creation-page :is(select, input[type=search], input[type=password], input[type=text]) { width: 100%; color: var(--ink); border: 1px solid var(--line); border-radius: var(--studio-radius); padding: 9px 11px; background: var(--studio-field); font-size: 16px; min-height: 42px; }
.creation-page select { cursor: pointer; }
.creation-page select:hover { border-color: var(--accent); }
/* Native customizable select keeps keyboard/typeahead behavior and a readable fallback. */
.ratio-symbol { display: none; }
@supports (appearance: base-select) {
  .creation-page #size { padding: 7px 9px; gap: 6px; min-height: 46px; }
  #size > button { padding: 0; min-width: 0; }
  #size selectedcontent { display: flex; align-items: center; gap: 7px; overflow: visible; white-space: nowrap; }
  #size .ratio-symbol { display: flex; align-items: center; justify-content: center; width: 30px; height: 29px; flex: 0 0 30px; color: var(--accent); }
  .ratio-shape { display: block; position: relative; flex: none; box-sizing: border-box; border: 1.35px solid currentColor; background: color-mix(in srgb,var(--accent-wash) 55%,var(--card)); border-radius: 1.5px; box-shadow: 1.5px 1.5px 0 color-mix(in srgb,var(--accent) 9%,transparent); }
  .ratio-shape::after { content: ''; position: absolute; inset: 2px; border-top: 1px solid color-mix(in srgb,currentColor 18%,transparent); pointer-events: none; }
  .ratio-auto { width: 23px; height: 20px; border-style: dashed; background: transparent; transform: rotate(-5deg); }
  .ratio-auto::after { inset: 4px -3px -3px 4px; border: 1px solid currentColor; background: var(--card); border-radius: 1px; opacity: .5; }
  .ratio-square { width: 23px; height: 23px; }
  .ratio-landscape { width: 27px; height: 18px; }
  .ratio-portrait { width: 18px; height: 27px; }
  .ratio-wide { width: 28px; height: 15.75px; }
  .ratio-tall { width: 15.75px; height: 28px; }
  #size .ratio-option-label { display: inline-block; color: var(--ink); font-size: 14px; white-space: nowrap; }
  #size .ratio-value { font-size: 13px; font-variant-numeric: tabular-nums; }
  #size::picker(select) { min-width: 212px; max-height: min(368px,70dvh); padding: 7px; background-image: url('assets/paper-grain.svg'); }
  #size option { padding: 8px 12px; gap: 13px; min-height: 48px; }
  #size option .ratio-option-label { font-size: 16px; }
  #size option .ratio-value { margin-left: 5px; font-size: 14px; color: var(--muted); }
  #size option::checkmark { order: 3; margin-left: auto; font-size: 13px; }
  [data-theme="cobalt"] .ratio-shape { border-radius: 0; box-shadow: 2px 2px 0 var(--card-shadow); }
  [data-theme="lifestyle"] .ratio-shape { border-radius: 2px 3px 1px 2px; }
}
.source-prompt { margin-top: 12px; font-size: 14px; color: var(--muted); }
.source-prompt > summary, .tool-options > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.source-prompt summary::-webkit-details-marker, .tool-options summary::-webkit-details-marker { display: none; }
.source-prompt > summary { width: fit-content; gap: 6px; }
.source-prompt > summary [data-icon] svg { width: 15px; height: 15px; }
.source-prompt[open] > summary [data-icon] { transform: rotate(180deg); }
.source-prompt pre { font: 14px/1.75 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 230px; overflow: auto; color: var(--ink); background: var(--prompt-paper); padding: 12px; border: 1px solid var(--line); border-radius: var(--studio-card-radius); }
#source-parts { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
#source-parts > p { margin-top: 10px; font-size: 14px; color: var(--muted); }
#description { display: block; width: 100%; height: 146px; min-height: 146px; max-height: 310px; border: 1px solid var(--line); border-radius: var(--studio-radius); background: var(--studio-field); padding: 11px 13px; font-size: 17px; }
#description::placeholder { color: var(--muted); opacity: .8; }
.description-count { font: 14px var(--text-font); color: var(--muted); }
.upload-area { margin-top: 12px; border: 1px dashed var(--line); border-radius: var(--studio-radius); background: color-mix(in srgb,var(--paper) 40%,transparent); }
.upload-area:hover { border-color: var(--accent); }
.upload-area.dragging { border-color: var(--accent); background: var(--accent-wash); box-shadow: 0 0 0 3px var(--accent-wash); }
#upload-button { display: flex; align-items: center; gap: 11px; text-align: left; width: 100%; padding: 11px 12px; font-size: 16px; }
#upload-button > [data-icon] { color: var(--accent); }
#upload-button small { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.upload-plus { margin-left: auto; font: 25px var(--font); color: var(--accent); }
.attachment-list { display: grid; gap: 12px; }
.attachment-list:not(:empty) { margin-top: 14px; }
.attachment-item { display: grid; grid-template-columns: 86px minmax(0,1fr) 26px; gap: 9px; align-items: start; padding: 10px; border: 1px solid var(--line); background: var(--card); border-radius: var(--studio-card-radius); }
.attachment-item.attachment-invalid { border-color: var(--action); box-shadow: 0 0 0 1px color-mix(in srgb,var(--action) 20%,transparent); }
.attachment-validation-message { grid-column: 1 / -1; margin: 0; color: var(--action); font-size: 14px; line-height: 1.6; }
.attachment-preview { position: relative; width: 86px; height: 104px; padding: 4px; display: flex; align-items: center; justify-content: center; background: var(--viewer); border: 1px solid var(--line); border-radius: var(--studio-card-radius); cursor: zoom-in; overflow: hidden; }
.attachment-item img { width: 86px; height: 104px; object-fit: contain; background: var(--viewer); border-radius: var(--studio-card-radius); }
.attachment-preview img { width: 100%; height: 100%; }
.attachment-number { position: absolute; left: 4px; top: 4px; min-width: 23px; height: 23px; padding: 0 5px; display: grid; place-items: center; font: 14px var(--text-font); border-radius: 50%; background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 1px 3px var(--card-shadow); }
.attachment-content { min-width: 0; }
.attachment-name { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); margin-bottom: 6px; }
.attachment-item select { font-size: 14px; min-height: 34px; padding: 5px 7px; }
.attachment-item :is(input, textarea) { display: block; width: 100%; font: 14px/1.55 var(--font) !important; margin-top: 6px; padding: 6px 8px !important; min-height: 48px !important; border: 1px solid var(--line); border-radius: var(--studio-card-radius); background: var(--studio-field); }
.attachment-content details { margin-top: 7px; }
.attachment-content details summary { font-size: 14px; color: var(--muted); cursor: pointer; }
.attachment-order { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.attachment-order button { display: grid; place-items: center; width: 26px; height: 27px; color: var(--muted); border-radius: var(--studio-card-radius); font-size: 16px; }
.attachment-order button:hover:not(:disabled) { color: var(--accent); background: var(--accent-wash); }
.attachment-order button:disabled { opacity: .28; }
.attachment-item .icon-control { width: 26px; height: 28px; padding: 3px; color: var(--muted); }
.attachment-item .icon-control:hover { color: var(--action); }
.tool-options > summary { font-size: 17px; color: var(--ink); padding: 1px 0; }
.tool-options > summary [data-icon] { color: var(--muted); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.model-settings-link { margin-top: 12px; }
.brief-actions { flex-shrink: 0; border-top: 1px solid var(--line); padding: 10px 24px 17px; background: var(--card); box-shadow: 0 -4px 14px color-mix(in srgb,var(--paper) 70%,transparent); }
.tool-summary { display: flex; align-items: center; gap: 7px; width: 100%; padding: 2px 0 11px; color: var(--muted); font-size: 14px; text-align: left; }
.tool-summary:hover { color: var(--accent); }
.tool-summary [data-icon]:last-child { margin-left: auto; }
.tool-summary [data-icon] svg { width: 15px; height: 15px; }
.brief-action-buttons { display: flex; gap: 9px; }
.brief-action-buttons button { flex: 1; padding: 11px 8px; font-size: 16px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; font-size: 16px; line-height: 1.4; border-radius: var(--studio-radius); white-space: nowrap; border: 1px solid transparent; }
.primary-button { background: var(--accent); color: var(--card); box-shadow: 0 2px 0 color-mix(in srgb,var(--accent) 70%,var(--ink)); }
.primary-button:hover:not(:disabled) { background: color-mix(in srgb,var(--accent) 85%,var(--ink)); box-shadow: 0 3px 0 color-mix(in srgb,var(--accent) 65%,var(--ink)); }
.secondary-button { border-color: var(--line); background: var(--card); }
.secondary-button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-wash); }
.creative-desk { min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; background: var(--paper) url('assets/paper-relief.svg'); }
.desk-header { height: 60px; display: flex; justify-content: space-between; align-items: center; padding: 0 30px; border-bottom: 1px solid var(--line); gap: 20px; flex-shrink: 0; }
.stage-tabs { display: flex; align-items: stretch; height: 100%; gap: 28px; }
.stage-tabs button { display: flex; gap: 8px; align-items: center; padding: 0 2px; position: relative; color: var(--muted); font-size: 18px; }
.stage-tabs button.active { color: var(--ink); }
.stage-tabs button.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 3px; background: var(--accent); border-radius: 2px; }
.stage-tabs button > [data-icon] svg { width: 19px; height: 19px; }
.stage-tabs button.active > [data-icon] { color: var(--accent); }
.draft-status { font-size: 14px; color: var(--muted); text-align: right; }
.job-status { width: calc(100% - 60px); max-width: 860px; margin: 16px auto 0; padding: 10px 13px 10px 10px; background: color-mix(in srgb,var(--card) 85%,transparent) url('assets/paper-grain.svg'); border: 1px solid color-mix(in srgb,var(--line) 70%,transparent); border-radius: var(--studio-radius); box-shadow: 0 2px 5px var(--card-shadow); flex-shrink: 0; }
.job-heading { display: flex; align-items: center; gap: 12px; }
.job-heading-copy { min-width: 0; flex: 1; }
.job-status strong { font-size: 17px; font-weight: 500; }
.job-status small { display: block; font-size: 13px; color: var(--muted); line-height: 1.55; margin-top: 3px; }
/* A little pigment study replaces the stopwatch; the actual task state stays beside it. */
.job-muse { display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 1px; flex: 0 0 auto; min-width: 112px; padding-inline: 5px; color: var(--muted); }
.job-muse > svg { display: block; width: 86px; height: 30px; overflow: visible; }
#job-muse-copy { font-size: 12px; line-height: 1.5; white-space: nowrap; }
.muse-paper { fill: var(--card); stroke: color-mix(in srgb,var(--line) 55%,transparent); stroke-width: .75; }
.muse-pigment { fill: none; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; animation: muse-pigment 7.2s ease-in-out infinite; }
.muse-pigment-one { stroke: var(--accent); opacity: .8; }
.muse-pigment-two { stroke: var(--orange); animation-delay: .9s; opacity: .83; }
.muse-pigment-three { stroke: color-mix(in srgb,var(--olive) 75%,var(--accent)); animation-delay: 1.8s; opacity: .8; }
.muse-draft { display: none; fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; }
.muse-draft path { stroke-dasharray: 100; stroke-dashoffset: 100; animation: muse-pencil 7.2s ease-in-out infinite; }
.muse-brush { transform-origin: 60px 21px; animation: muse-brush 7.2s ease-in-out infinite; }
.muse-handle { fill: var(--orange); stroke: var(--accent); stroke-width: .55; }
.muse-ferrule { fill: var(--card); stroke: var(--muted); stroke-width: .65; }
.muse-tip { fill: var(--accent); }
.job-status[data-action="compose"] .muse-pigments { display: none; }
.job-status[data-action="compose"] .muse-draft { display: block; }
.job-status[data-action="compose"] .muse-handle { fill: var(--card); }
.job-muse[data-mood="slow"] :is(.muse-pigment,.muse-brush,.muse-draft path) { animation-duration: 10s; }
.job-muse[data-mood="receiving"] :is(.muse-pigment,.muse-draft path) { stroke-dashoffset: 0; animation: none; }
.job-muse[data-mood="receiving"] .muse-brush { animation: muse-finishing 3.6s ease-in-out infinite; }
.job-muse[data-mood="disconnected"] { opacity: .6; }
.job-muse[data-mood="disconnected"] :is(.muse-pigment,.muse-brush,.muse-draft path) { animation-play-state: paused; }
.job-status:has(.job-muse) :is(.working-nib,.working-line) { animation: none; }
[data-theme="cobalt"] .muse-pigment { stroke-linecap: square; stroke-width: 7; }
[data-theme="ink"] .muse-pigment-two { stroke: var(--muted); }
[data-theme="lifestyle"] .muse-pigment { stroke-width: 4; }
[data-theme="storybook"] .muse-pigment { stroke-width: 7; }
.working-mark { width: 40px; height: 40px; display: grid; place-items: center; color: var(--accent); flex-shrink: 0; }
.working-mark > svg { width: 38px; height: 38px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.working-sheet { fill: var(--accent-wash); stroke: var(--line); }
.working-nib { fill: var(--card); transform-origin: 23px 15px; animation: manuscript-nib 2.8s ease-in-out infinite; }
.working-line { stroke-dasharray: 20; stroke-dashoffset: 0; animation: manuscript-line 2.8s ease-in-out infinite; }
.job-stop { display: flex; align-items: center; gap: 2px; font-size: 13px; color: var(--muted); padding: 7px 6px; border-radius: var(--studio-card-radius); white-space: nowrap; }
.job-stop svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.job-stop:hover { color: var(--action); background: color-mix(in srgb,var(--orange) 10%,transparent); }
#job-toggle { width: 28px; height: 30px; color: var(--muted); }
#job-toggle[aria-expanded="true"] [data-icon] { transform: rotate(180deg); }
.job-details { padding: 10px 5px 1px 52px; margin-top: 7px; border-top: 1px solid color-mix(in srgb,var(--line) 60%,transparent); }
.job-stages { display: flex; flex-wrap: wrap; gap: 8px 17px; list-style: none; padding: 0; margin: 0; }
.job-stages li { position: relative; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.job-stages li::before { content: ''; display: block; width: 5px; height: 5px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; }
.job-stages li:is(.active, .current, [data-state="active"], [aria-current="step"]) { color: var(--accent); }
.job-stages li:is(.active, .current, [data-state="active"], [aria-current="step"])::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb,var(--accent) 10%,transparent); }
.job-stages li:is(.done, .complete, [data-state="complete"], [data-state="done"])::before { border-color: var(--accent); background: var(--accent); opacity: .55; }
.job-foot { margin-top: 8px; }
.job-heartbeat { font-size: 12px; color: var(--muted); }
.job-error { display: flex; align-items: flex-start; gap: 11px; padding: 15px 28px; background: color-mix(in srgb,var(--orange) 16%,var(--card)); border-bottom: 1px solid var(--line); font-size: 16px; }
.job-error > [data-icon] { color: var(--action); margin-top: 3px; }
.job-error-copy { flex: 1; min-width: 0; }
.job-error strong { font-weight: 500; }
.job-error p { overflow-wrap: anywhere; font-size: 14px; line-height: 1.7; color: var(--muted); margin-top: 4px; }
.error-actions { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 7px; }
.error-actions:empty { display: none; }
.prompt-panel { min-height: 0; display: flex; flex: 1; flex-direction: column; }
.prompt-page { position: relative; min-height: 0; flex: 0 1 auto; width: calc(100% - 60px); max-width: 860px; overflow: auto; margin: 24px auto 0; padding: 30px 42px 24px; background: var(--card) url('assets/paper-grain.svg'); box-shadow: 0 3px 15px var(--card-shadow), 2px 3px 0 var(--paper), 3px 4px 0 color-mix(in srgb,var(--line) 45%,transparent); border: 1px solid color-mix(in srgb,var(--line) 65%,transparent); border-radius: var(--studio-card-radius); display: flex; flex-direction: column; }
.prompt-page::before { content: ''; position: absolute; pointer-events: none; top: 24px; left: 22px; width: 1px; height: calc(100% - 48px); background: color-mix(in srgb,var(--accent) 13%,transparent); }
.manuscript-edge { position: absolute; top: 0; right: 35px; width: 82px; height: 23px; opacity: .74; pointer-events: none; }
.manuscript-edge svg { display: block; width: 100%; height: 100%; }
.swatch-one { fill: var(--accent); }
.swatch-two { fill: var(--orange); }
.swatch-three { fill: var(--olive); }
.prompt-page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.prompt-page h2 { font-size: 28px; font-weight: 500; line-height: 1.5; letter-spacing: .03em; }
.prompt-editor-tools { display: flex; align-items: center; gap: 12px; }
.prompt-version-controls { display: flex; align-items: center; gap: 9px; }
.prompt-version-controls select { width: 145px; min-height: 34px; padding: 5px 8px; font-size: 14px; }
.prompt-version-controls .text-button { font-size: 14px; }
.prompt-summary { font-size: 15px; line-height: 1.8; color: var(--muted); margin: 9px 0 18px !important; max-width: 65ch; }
.icon-control { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--studio-card-radius); flex-shrink: 0; }
.icon-control:hover { background: var(--accent-wash); color: var(--accent); }
#final-prompt, .job-preview { width: 100%; flex: none; border: 0; background: transparent; border-top: 1px solid color-mix(in srgb,var(--line) 75%,transparent); padding: 19px 0 23px; font: 19px/1.95 var(--font); letter-spacing: .015em; color: var(--ink); tab-size: 2; }
#final-prompt { min-height: 260px; height: clamp(260px,38vh,460px); resize: vertical; scrollbar-width: thin; }
@supports (field-sizing: content) { #final-prompt { field-sizing: content; height: auto; resize: none; overflow: hidden; } }
#final-prompt::placeholder { color: var(--muted); opacity: .72; }
#final-prompt:focus-visible { outline: 2px solid var(--focus); outline-offset: 7px; }
.job-preview { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 260px; max-height: none; margin: 0; overflow: visible; }
.job-preview::after { content: ''; display: inline-block; width: 2px; height: 1em; margin-left: 5px; background: var(--accent); vertical-align: -.12em; animation: manuscript-caret 1.2s steps(2,end) infinite; }
.prompt-page:has(.job-preview:not([hidden])) #final-prompt { display: none; }
.manuscript-wait { display: none; align-items: center; gap: 13px; padding: 12px 0 17px; color: var(--muted); font-size: 14px; }
.manuscript-wait i { position: relative; height: 2px; width: 53px; background: color-mix(in srgb,var(--accent) 15%,transparent); overflow: hidden; border-radius: 50%; }
.manuscript-wait i::after { content: ''; position: absolute; inset: 0; width: 22px; background: var(--accent); animation: manuscript-ink 2.5s ease-in-out infinite; }
.prompt-page.is-writing .manuscript-wait { display: flex; }
.prompt-page.is-writing #final-prompt { color: var(--muted); }
.prompt-page.is-writing :is(#prompt-summary, #creative-decisions) { display: none; }
.creative-decisions { font-size: 14px; line-height: 1.75; border-top: 1px solid var(--line); padding-top: 10px; color: var(--muted); }
.creative-decisions summary { cursor: pointer; }
.prompt-attachment-map { margin-bottom: 10px; }
.prompt-attachment-map ol { margin: 8px 0; padding-left: 22px; }
.creative-decisions ul { padding-left: 18px; margin: 8px 0; }
.stale-note { font-size: 14px; line-height: 1.65; color: var(--action); padding: 11px 13px; margin-top: 12px; border-left: 3px solid var(--orange); border-radius: 0 7px 7px 0; background: color-mix(in srgb,var(--orange) 14%,var(--card)); }
.stale-actions { display: flex; gap: 20px; margin-top: 5px; }
.stale-actions .text-button { font-size: 14px; }
.prompt-actions { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; width: calc(100% - 60px); max-width: 860px; margin: 0 auto; padding: 17px 0 21px; gap: 16px; }
#generate { margin-left: auto; }
.prompt-actions > span { font-size: 14px; color: var(--muted); }
.canvas-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.canvas-empty { margin: auto; text-align: center; padding: 28px; max-width: 620px; }
.empty-art { width: 190px; height: 166px; margin-bottom: 20px; }
.art-back { fill: var(--panel); stroke: var(--line); stroke-width: 1.5; }
.art-paper { fill: var(--card); stroke: var(--line); stroke-width: 1.5; }
.art-mountain { fill: var(--accent); opacity: .8; }
.art-sun { fill: var(--orange); }
.art-stroke { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.art-pen { fill: var(--orange); stroke: var(--ink); stroke-width: 1.5; }
.canvas-empty h2 { font-size: 29px; line-height: 1.5; font-weight: 500; }
.canvas-empty p { color: var(--muted); font-size: 17px; margin: 10px 0 19px; }
.canvas-empty .text-button { font-size: 16px; }
.result-view { display: flex; flex: 1; min-height: 0; flex-direction: column; padding: 20px 30px 22px; gap: 14px; }
.result-topline { display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: 17px; }
.result-topline span:last-child { font-size: 14px; color: var(--muted); }
.result-image-button { min-height: 0; flex: 1; width: 100%; padding: 18px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb,var(--viewer) 75%,var(--paper)); border: 1px solid var(--line); border-radius: var(--studio-card-radius); overflow: hidden; cursor: zoom-in; }
.result-image-button img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 5px 20px var(--dialog-shadow); }
.result-actions { display: flex; gap: 10px; justify-content: flex-end; }
.result-actions button { font-size: 15px; padding: 10px 14px; }
.creation-dialog { border: 1px solid var(--line); border-radius: var(--studio-dialog-radius); padding: 28px; background: var(--card) url('assets/paper-grain.svg'); color: var(--ink); box-shadow: 0 20px 80px var(--dialog-shadow); max-height: 88vh; overflow: auto; }
.creation-dialog::backdrop, .creation-image-dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(4px); }
.dialog-heading { display: flex; justify-content: space-between; gap: 22px; align-items: flex-start; margin-bottom: 22px; }
.dialog-heading h2 { font-size: 28px; line-height: 1.4; font-weight: 500; }
.dialog-heading p { font-size: 15px; line-height: 1.65; color: var(--muted); margin-top: 7px; }
.style-dialog { width: min(1120px,92vw); height: min(860px,88vh); padding-bottom: 20px; overflow: hidden; }
.style-dialog[open] { display: flex; flex-direction: column; }
.style-dialog > .dialog-heading { flex-shrink: 0; }
.style-picker-tools { flex-shrink: 0; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.style-search { display: flex; align-items: center; gap: 10px; }
.style-search input { flex: 1; background: var(--paper) !important; font-size: 17px !important; }
.style-search > [data-icon] { color: var(--muted); }
.style-filters { display: flex; gap: 7px; margin-top: 14px; }
.style-filters button { font-size: 15px; padding: 7px 13px; color: var(--muted); border: 1px solid transparent; border-radius: var(--studio-radius); }
.style-filters button:hover { color: var(--ink); background: var(--paper); }
.style-filters button[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb,var(--accent) 30%,var(--line)); background: var(--accent-wash); }
.style-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 23px 20px; overflow: auto; min-height: 0; padding: 21px 5px 15px; align-content: start; overscroll-behavior: contain; }
.style-option { position: relative; padding: 10px; text-align: left; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--studio-card-radius); background: color-mix(in srgb,var(--card) 95%,var(--paper)); }
.style-option img { display: block; width: 100%; height: 208px; object-fit: contain; background: var(--prompt-paper); border: 1px solid color-mix(in srgb,var(--line) 70%,transparent); border-radius: var(--studio-card-radius); padding: 4px; }
.style-option strong { display: block; font-size: 19px; line-height: 1.5; font-weight: 500; margin-top: 11px; padding-inline: 2px; }
.style-option small { display: block; font-size: 15px; line-height: 1.7; color: var(--muted); white-space: normal; overflow: visible; overflow-wrap: anywhere; margin-top: 5px; padding: 0 2px 5px; }
.style-option[aria-pressed="true"], .style-option:has([aria-pressed="true"]) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.style-option:hover { border-color: var(--accent); background: var(--paper); }
.style-option[aria-pressed="true"]::after { content: '已选'; position: absolute; top: 18px; left: 18px; color: var(--card); background: var(--accent); border-radius: var(--studio-radius); padding: 4px 8px; font-size: 14px; box-shadow: 0 2px 5px var(--card-shadow); }
.style-option :is(.style-favorite, .style-save) { position: absolute; right: 17px; top: 17px; background: var(--card); color: var(--accent); border: 1px solid var(--line); }
.settings-dialog { width: 600px; }
.key-field { margin: 18px 0; }
.key-field label { font: 16px var(--text-font); }
.key-field-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.key-state { font-size: 14px; color: var(--muted); }
.key-input { display: flex; gap: 8px; }
.key-input input { flex: 1; font: 14px var(--text-font) !important; }
.key-input button { font-size: 14px; padding: 0 8px; }
.region-field { display: flex; align-items: center; gap: 20px; margin: 20px 0; font-size: 15px; }
.region-field select { flex: 1; }
.remember-keys { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 20px 0 8px; }
.remember-keys input { accent-color: var(--accent); width: 17px; height: 17px; }
.settings-privacy { font-size: 14px; line-height: 1.75; color: var(--muted); }
.dialog-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-top: 23px; }
.history-dialog { width: min(1040px,90vw); min-height: 320px; }
.history-section-title { font-size: 18px; font-weight: 500; margin: 0 0 14px !important; }
.history-drafts { margin-bottom: 26px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.draft-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.draft-item { min-width: 0; display: flex; align-items: start; gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: var(--studio-card-radius); background: var(--prompt-paper); }
button.draft-item { flex-direction: column; align-items: flex-start; gap: 5px; text-align: left; }
button.draft-item > span { color: var(--muted); font-size: 14px; line-height: 1.6; }
button.draft-item:hover { border-color: var(--accent); background: var(--accent-wash); }
.draft-item > button:first-child { flex: 1; min-width: 0; text-align: left; }
.draft-item h3, .draft-item strong { display: block; font-weight: 500; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.draft-item p, .draft-item small { display: block; font-size: 14px; line-height: 1.6; color: var(--muted); margin-top: 5px; }
.draft-item .icon-control { width: 28px; height: 28px; color: var(--muted); }
.history-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px 20px; }
.history-item { min-width: 0; }
.history-image { display: block; width: 100%; padding: 0; cursor: zoom-in; }
.history-image img { width: 100%; height: 205px; object-fit: contain; padding: 7px; background: var(--viewer); border: 1px solid var(--line); border-radius: var(--studio-card-radius); }
.history-item h3 { font-size: 17px; line-height: 1.5; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 8px; }
.history-item-meta { display: flex; align-items: center; justify-content: space-between; font-size: 14px; color: var(--muted); }
.history-empty { grid-column: 1/-1; text-align: center; padding: 42px 0; color: var(--muted); font-size: 17px; }
.work-dialog { width: min(1170px,92vw); }
.work-detail-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 26px; height: min(570px,58vh); }
.work-image-button { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 12px; background: var(--viewer); border: 1px solid var(--line); border-radius: var(--studio-card-radius); cursor: zoom-in; }
.work-image-button img { width: 100%; height: 100%; object-fit: contain; }
.work-prompt-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.work-prompt-panel h3 { font-size: 19px; font-weight: 500; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
#work-prompt { white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; font: 16px/1.85 var(--font); color: var(--ink); margin: 14px 0 0; padding-right: 10px; }
.work-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.creation-image-dialog { border: 0; padding: 45px; background: var(--lightbox); max-width: 96vw; max-height: 96vh; color: var(--lightbox-text); border-radius: var(--studio-card-radius); }
.creation-image-dialog img { display: block; max-width: calc(96vw - 90px); max-height: calc(96vh - 90px); object-fit: contain; }
.image-dialog-close { position: absolute; right: 6px; top: 6px; }
.confirm-dialog { width: 465px; padding: 28px; }
.confirm-dialog h2 { font-size: 25px; font-weight: 500; }
.confirm-dialog p { font-size: 16px; line-height: 1.7; color: var(--muted); margin-top: 12px; }
.confirm-dialog .dialog-footer { justify-content: flex-end; }
.creation-toast { position: fixed; top: 92px; right: 26px; background: var(--ink); color: var(--card); padding: 12px 20px; border-radius: var(--studio-radius); font-size: 15px; line-height: 1.6; z-index: 1000; box-shadow: 0 5px 20px var(--dialog-shadow); max-width: min(520px,50vw); pointer-events: none; }
.creation-page .chosen-style.style-missing { border: 1px dashed var(--line); padding: 13px; border-radius: var(--studio-radius); background: var(--prompt-paper); }
.creation-page .style-missing strong { font-size: 17px; color: var(--action); }
[data-theme="cobalt"] .creation-header { border-bottom: 3px solid var(--orange); }
[data-theme="cobalt"] .primary-button { box-shadow: 3px 3px 0 var(--ink); }
[data-theme="cobalt"] .style-mode button[aria-pressed="true"] { box-shadow: 2px 2px 0 var(--card-shadow); }
[data-theme="cobalt"] .manuscript-edge { opacity: 1; }
[data-theme="cobalt"] .prompt-page::before { width: 2px; background: var(--accent); opacity: .24; }
[data-theme="storybook"] .prompt-page { border-color: color-mix(in srgb,var(--olive) 50%,var(--line)); }
[data-theme="storybook"] .manuscript-edge { transform: rotate(-3deg); }
[data-theme="ink"] .manuscript-edge { opacity: .55; }
[data-theme="lifestyle"] .prompt-page { box-shadow: 1px 2px 0 var(--card-shadow); }
[data-theme="lifestyle"] .creation-header { background-image: none; }
@media (min-width: 1700px) { .creation-workspace { grid-template-columns: 410px minmax(0,1fr); } .brief-scroll, .brief-heading { padding-inline: 28px; } .brief-actions { padding-inline: 28px; } .desk-header { padding-inline: 40px; } .result-view { padding-inline: 40px; } }
@media (max-width: 1250px) { .creation-workspace { grid-template-columns: 350px minmax(0,1fr); } .creation-header { gap: 22px; padding-inline: 22px; } .creation-header-tools { gap: 13px; } .brief-scroll, .brief-heading, .brief-actions { padding-inline: 20px; } .brief-heading h1 { font-size: 22px; } .creation-navigation { gap: 18px; } .desk-header { padding-inline: 23px; } .prompt-page, .prompt-actions { width: calc(100% - 46px); } .prompt-page { padding-inline: 30px; } .prompt-page::before { left: 14px; } .result-view { padding-inline: 23px; } .attachment-item { grid-template-columns: 74px minmax(0,1fr) 24px; padding: 8px; gap: 7px; } .attachment-preview, .attachment-item img { width: 74px; height: 94px; } .attachment-preview img { width: 100%; height: 100%; } .style-option img { height: 182px; } .prompt-editor-tools { gap: 6px; } .prompt-version-controls select { width: 122px; } .job-status { width: calc(100% - 46px); } .job-heading { gap: 8px; } .style-mode button { font-size: 13px; gap: 3px; } }
@media (max-height: 780px) { .brief-heading { padding-top: 16px; padding-bottom: 14px; } .brief-section { padding-block: 14px; } #description { height: 130px; min-height: 130px; } .empty-art { width: 150px; height: 132px; margin-bottom: 12px; } .canvas-empty h2 { font-size: 27px; } .canvas-empty { padding-block: 18px; } .job-status { margin-top: 12px; padding-block: 8px; } .chosen-style-art > img { max-height: 140px; } .prompt-page { margin-top: 18px; padding-top: 22px; } #final-prompt, .job-preview { min-height: 220px; } }
@keyframes manuscript-nib { 0%,100% { transform: translate(0,0) rotate(-3deg); } 35% { transform: translate(-3px,3px) rotate(2deg); } 70% { transform: translate(1px,-1px) rotate(-1deg); } }
@keyframes manuscript-line { 0%,15% { stroke-dashoffset: 20; opacity: .4; } 75%,100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes manuscript-ink { 0%,100% { transform: translateX(-8px); opacity: .45; } 55% { transform: translateX(40px); opacity: .9; } }
@keyframes manuscript-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .creation-page * { transition: none !important; } .working-mark, .working-nib, .working-line, .manuscript-wait i::after, .job-preview::after { animation: none; } }

@media (min-width: 1700px) and (min-height: 950px) { .chosen-style-art > img { max-height: 184px; } }

@keyframes muse-pigment { 0%,9% { stroke-dashoffset: 100; } 38%,78% { stroke-dashoffset: 0; } 96%,100% { stroke-dashoffset: -100; } }
@keyframes muse-pencil { 0%,8% { stroke-dashoffset: 100; } 68%,85% { stroke-dashoffset: 0; opacity: 1; } 99%,100% { stroke-dashoffset: 0; opacity: .2; } }
@keyframes muse-brush { 0%,100% { transform: translate(-30px,-9px) rotate(-6deg); } 25% { transform: translate(-15px,-8px) rotate(3deg); } 30% { transform: translate(-20px,-3px) rotate(-4deg); } 55% { transform: translate(-2px,-2px) rotate(4deg); } 60% { transform: translate(-1px,3px) rotate(-3deg); } 80% { transform: translate(13px,2px) rotate(5deg); } 90% { transform: translate(13px,-5px) rotate(-5deg); } }
@keyframes muse-finishing { 0%,100% { transform: translate(6px,-2px) rotate(-4deg); } 50% { transform: translate(9px,0) rotate(3deg); } }
@media (max-width: 1250px) { .job-muse { min-width: 99px; padding-inline: 0; } #job-muse-copy { font-size: 11px; } .job-muse > svg { width: 78px; height: 28px; } }
@media (prefers-reduced-motion: reduce) { .job-muse :is(.muse-pigment,.muse-brush,.muse-draft path) { animation: none !important; stroke-dashoffset: 0; } }
