/* Neutral editing workspace. Document images and color samples keep their colors. */
:root {
  color-scheme: dark;
  --ink: #e3e5e9;
  --muted: #b4bac4;
  --line: #484c54;
  --blue: #c7f36b;
  --soft: #3b4c29;
  --surface: #2b2d31;
  --surface-raised: #303237;
  --field: #202226;
}
body, .editor-host, #workspace { background: #1e2023; }
.app-header { background: var(--surface); }
.brand, .welcome h1 { color: var(--ink); }
.brand > span { color: #f1f3f0; font-weight: 700; letter-spacing: -.045em; }
.product-label, .eyebrow { color: var(--muted); }
.header-divider { background: var(--line); }
.button { color: var(--ink); background: #383b41; border-color: #555b65; }
.button:hover { background: #444952; border-color: #7b8798; }
.button.quiet { background: transparent; border-color: transparent; }
.button.quiet:hover { background: #393e46; }
.button.primary { color: #1b260d; font-weight: 650; background: #c7f36b; border-color: #c7f36b; box-shadow: none; }
.button.primary:hover { background: #d6ff87; }
.button kbd, .icon-button, .text-button { color: #b4bac4; }
.icon-button:hover { color: #effbdb; background: #3b4c29; }
.text-button:hover { color: #d6ff87; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline-color: #c7f36b; }
.document-bar { background: #24262a; border-color: var(--line); }
.document-title { color: #c5cbd4; }
.mode, .external-mode, .external-mark { color: #aeb6c3; }
.mode.active { color: #d6ff87; }
.mode.active::after { background: #c7f36b; }
#dirtyDot { color: #efb961; }
.status-bar { background: #292b30; border-color: var(--line); color: #b4bac4; }
.status-right span + span::before { background: #555b65; }
.status-dot { background: #9cbba8; }

/* The start screen uses the same surfaces as the editing controls. */
.welcome { background: #24262a; }
.welcome-description, .section-heading > span { color: #b4bac4; }
.welcome-mark { display: block; width: clamp(64px, 10vw, 112px); height: auto; margin-left: 24px; }
@media (max-width: 560px) { .welcome-mark { display: none; } }
.start-card, .sample-card { background: #303237; border-color: var(--line); box-shadow: none; }
.start-card:hover { border-color: #b9e75e; box-shadow: 0 8px 24px #0003; }
.start-card > span:not(.card-icon):not(.card-shortcut), .card-shortcut { color: #b4bac4; }
.card-icon.blue { background: #37452a; color: #c7f36b; }
.card-icon.violet { background: #45492a; color: #e4ee84; }
.card-icon.orange { background: #514534; color: #ebcb91; }
.sample-preview { background: #272a30; }
.sample-caption div > span, .sample-open { color: #b4bac4; }
.recent-item { border-color: var(--line); }
.recent-item > span { background: #303640; border-color: #525b69; color: #bdcce4; }
.recent-item small, .recent-item .recent-ext { color: #b4bac4; }
.recent-item .recent-ext { background: none; border: 0; }
.empty-recent, .empty-recent strong, .home-note svg, .home-note p, .home-note strong, .welcome-footer { color: #b4bac4; }

/* File dialogs, guidance and loading surfaces never flash a white panel. */
.dialog { background: #2b2d31; color: var(--ink); border-color: #555b65; box-shadow: 0 24px 90px #0008; }
.dialog::backdrop { background: #101215b3; }
.field { color: #c0c6d0; }
.field input:not([type=range]), .field select { background-color: #202226; border-color: #59606b; color: #e3e5e9; }
.field .unit { color: #b4bac4; }
.presets button { background: #34373d; border-color: #545b66; color: #e3e5e9; }
.presets span { color: #b4bac4; }
.presets button.selected { background: #3b4c29; border-color: #a7d55e; color: #effbdb; }
.export-options label { background: #303237; border-color: #555b65; }
.export-options label:has(input:checked) { background: #3b4c29; border-color: #a7d55e; }
.export-options small, .dialog-note, .guide-grid p, .shortcut-grid, .confirm-text { color: #bfc6d0; }
.guide-grid section > span { color: #c7f36b; }
.guide-callout, .report-mode { background: #344126; color: #e2f1c9; border-left-color: #a7d55e; }
.shortcut-grid kbd { background: #202226; border-color: #59606b; color: #d4dce9; }
.report-summary div { background: #363a43; }
.report-summary small, .report-list { color: #bfc6d0; }
.report-list.warning { color: #e3bf7c; }
.drop-overlay { background: #303d24ed; color: #d6ff87; border-color: #c7f36b; }
.drop-overlay > span:last-child { color: #c0cee5; }
.toast { background: #3b475a; border: 1px solid #6c7e98; color: #f1f4f9; box-shadow: 0 8px 25px #0005; }
.toast.error { background: #653c3f; border-color: #a16b70; }
.busy-overlay { background: #1e2023aa; }
.busy-panel { background: #303237; border-color: #555b65; box-shadow: 0 20px 60px #0005; }
.busy-panel > span, .small-note { color: #b4bac4; }
.spinner { border-color: #4c5360; border-top-color: #c7f36b; }
.engine-loading { background: #24262a; }
.engine-loading p { color: #b4bac4; }
.engine-loading .error-message { color: #e8b48d; }
input, select, textarea { color-scheme: dark; }
input::placeholder { color: #a5afbf; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #27292d; }
::-webkit-scrollbar-thumb { background: #646b77; border: 2px solid #27292d; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #858e9c; }
::selection { color: #eff5ff; background: #3b4c29; }
/* Each editor iframe keeps its own undo history, selection and viewport. */
.document-tabs{display:flex;gap:3px;min-height:0;flex-shrink:0;overflow-x:auto;background:#222427;padding:0 10px}
.document-tabs:not(:empty){min-height:35px;border-bottom:1px solid #41444a}
.document-tab{display:flex;align-items:center;flex:none;max-width:250px;border-bottom:2px solid transparent}
.document-tab.active{background:#31352b;border-color:#b4e66b}
.document-tab button{border:0;background:none;color:#c9cdd2;padding:7px 9px;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:215px}
.document-tab.active button{color:#c5ed8e}.document-tab .tab-close{font-size:18px;padding:2px 7px;color:#abb0b6}
.document-tab button:hover{background:#3c4147}.recent-list{max-height:320px;overflow:auto}
#closeDocumentDialog{width:min(590px,calc(100vw - 30px))}

.welcome-footer { flex-wrap: wrap; }
.qp-languages { display: inline-flex; flex-wrap: wrap; gap: .8em; align-items: center; }
.qp-languages a { color: #c3c7ca; text-decoration: none; }
.qp-languages a[aria-current], .qp-languages a:hover { color: #c7f36b; }

.welcome-footer .qp-operator { color: #b9bdc1; font-size: 12px; text-decoration: none; }
