/* ── "Studio" theme: light, white cards on soft grey, cobalt accent, Geist.
   Use px, not rem: halfmoon sets the root font size to 10px.
   --st-* are the palette; the rest re-point halfmoon's light-mode variables at it.
   --secondary-color / --border-color / --light-lm-color are what views use for muted text,
   borders and soft fills (halfmoon's own --secondary-color is yellow). ── */
:root {
    --st-bg: #f5f6f8; --st-surface: #ffffff; --st-soft: #eef0f4;
    --st-line: #e3e6ec; --st-line-strong: #d3d8e0;
    --st-text: #13151b; --st-muted: #5f6675;
    --st-accent: #2847f5; --st-accent-hover: #1f3ad6; --st-accent-soft: #e8ecff; --st-ring: rgba(40,71,245,.18);
    --st-ok: #137a43; --st-ok-soft: #e2f6ea; --st-bad: #c4302b; --st-bad-soft: #fdecea; --st-warn: #7a5d00; --st-warn-soft: #fbf1cc;
    --st-line-hover: #b9c0cc; --st-placeholder: #9aa0ad; --st-accent-line: #c9d1ff; --st-bad-line: #f1c4c2; --st-warn-line: #efdf9e;
    --st-nav-bg: rgba(255,255,255,.88); --st-fav: #e0a800; --st-backdrop: rgba(15, 18, 30, .35);
    --st-shadow-primary: 0 1px 2px rgba(40,71,245,.3), inset 0 1px 0 rgba(255,255,255,.18);
    --st-radius: 12px; --st-radius-sm: 8px;
    --st-shadow: 0 1px 2px rgba(19,21,27,.04); --st-shadow-lift: 0 10px 24px -8px rgba(30,40,90,.18); --st-shadow-pop: 0 12px 32px -8px rgba(19,21,27,.18);
    --st-font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --st-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    --primary-color: var(--st-accent); --primary-color-light: #4762ff; --primary-color-dark: var(--st-accent-hover);
    --primary-box-shadow-color: var(--st-ring); --primary-box-shadow-color-darker: var(--st-ring);
    --text-color-on-primary-color-bg: #ffffff;
    --success-color: var(--st-ok); --danger-color: var(--st-bad); --danger-color-light: #d9443f; --text-color-on-danger-color-bg: #ffffff;
    --secondary-color: var(--st-muted); --border-color: var(--st-line); --light-lm-color: var(--st-soft);

    --navbar-height: 56px;
}
/* halfmoon has separate light (--lm-*) and dark (--dm-*, body.dark-mode) variables; both point at the --st-* tokens. */
:root {
    --lm-base-body-bg-color: var(--st-bg); --lm-base-text-color: var(--st-text); --lm-muted-text-color: var(--st-muted);
    --lm-link-text-color: var(--st-accent); --lm-link-text-color-hover: var(--st-accent-hover);
    --lm-card-bg-color: var(--st-surface); --lm-card-border-color: var(--st-line); --lm-card-box-shadow: var(--st-shadow); --card-border-radius: var(--st-radius);
    --input-height: 38px; --input-border-radius: var(--st-radius-sm);
    --lm-input-bg-color: var(--st-surface); --lm-input-border-color: var(--st-line-strong); --lm-input-border-color-hover: var(--st-line-hover);
    --lm-input-border-color-focus: var(--st-accent); --lm-input-box-shadow-focus: 0 0 0 3px var(--st-ring);
    --lm-input-bg-color-disabled: var(--st-soft); --lm-input-placeholder-text-color: var(--st-placeholder);
    --button-height: 38px; --small-button-height: 30px; --small-button-font-size: 13px; --small-button-padding: 0 11px; --button-border-radius: 9px;
    --lm-button-text-color: var(--st-text); --lm-button-bg-color: var(--st-surface); --lm-button-border-color: var(--st-line-strong);
    --lm-button-bg-color-hover: var(--st-soft); --lm-button-box-shadow: none;
    --lm-button-primary-bg-color-hover: var(--st-accent-hover); --lm-button-primary-border-color-hover: var(--st-accent-hover);
    --lm-button-primary-box-shadow: var(--st-shadow-primary);
    --lm-button-secondary-text-color: var(--st-text); --lm-button-secondary-bg-color: var(--st-surface); --lm-button-secondary-border-color: var(--st-line-strong);
    --lm-button-secondary-bg-color-hover: var(--st-soft); --lm-button-secondary-border-color-hover: var(--st-line-hover); --lm-button-secondary-box-shadow: none;
    --lm-code-bg-color: var(--st-soft); --lm-code-border-color: var(--st-line);
    --lm-switch-border-color: var(--st-line-strong); --lm-checkbox-border-color: var(--st-line-strong);
    --lm-navbar-bg-color: var(--st-nav-bg); --lm-navbar-border-color: var(--st-line);
}
:root {
    --dm-base-body-bg-color: var(--st-bg); --dm-base-text-color: var(--st-text); --dm-muted-text-color: var(--st-muted);
    --dm-link-text-color: var(--st-accent); --dm-link-text-color-hover: var(--st-accent-hover);
    --dm-card-bg-color: var(--st-surface); --dm-card-border-color: var(--st-line); --dm-card-box-shadow: var(--st-shadow);
    --dm-input-bg-color: var(--st-surface); --dm-input-border-color: var(--st-line-strong); --dm-input-border-color-hover: var(--st-line-hover);
    --dm-input-border-color-focus: var(--st-accent); --dm-input-box-shadow-focus: 0 0 0 3px var(--st-ring);
    --dm-input-bg-color-disabled: var(--st-soft); --dm-input-placeholder-text-color: var(--st-placeholder);
    --dm-button-text-color: var(--st-text); --dm-button-bg-color: var(--st-surface); --dm-button-border-color: var(--st-line-strong);
    --dm-button-bg-color-hover: var(--st-soft); --dm-button-box-shadow: none;
    --dm-button-primary-bg-color-hover: var(--st-accent-hover); --dm-button-primary-border-color-hover: var(--st-accent-hover);
    --dm-button-primary-box-shadow: var(--st-shadow-primary);
    --dm-button-secondary-text-color: var(--st-text); --dm-button-secondary-bg-color: var(--st-surface); --dm-button-secondary-border-color: var(--st-line-strong);
    --dm-button-secondary-bg-color-hover: var(--st-soft); --dm-button-secondary-border-color-hover: var(--st-line-hover); --dm-button-secondary-box-shadow: none;
    --dm-code-bg-color: var(--st-soft); --dm-code-border-color: var(--st-line);
    --dm-switch-border-color: var(--st-line-strong); --dm-checkbox-border-color: var(--st-line-strong);
    --dm-navbar-bg-color: var(--st-nav-bg); --dm-navbar-border-color: var(--st-line);
    --dm-switch-bg-color: var(--st-surface); --dm-checkbox-bg-color: var(--st-surface);
}
/* Dark theme: <html data-theme="dark"> (set before paint by the script at the end of <head>, from
   localStorage "theme" = auto | light | dark, auto following the OS); the body also gets halfmoon's .dark-mode. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --st-bg: #0e1015; --st-surface: #171a21; --st-soft: #222630;
    --st-line: #2a2f3a; --st-line-strong: #3a404d;
    --st-text: #e8eaef; --st-muted: #9ca3b1;
    --st-accent: #8196ff; --st-accent-hover: #a2b1ff; --st-accent-soft: #1e2546; --st-ring: rgba(129,150,255,.28);
    --st-ok: #4ade80; --st-ok-soft: #10301e; --st-bad: #f87171; --st-bad-soft: #3a1818; --st-warn: #f2c94c; --st-warn-soft: #362d10;
    --st-line-hover: #4b5262; --st-placeholder: #6b7280; --st-accent-line: #3e4a8a; --st-bad-line: #6b2a2a; --st-warn-line: #5c4d1c;
    --st-nav-bg: rgba(23,26,33,.88); --st-fav: #f5c542; --st-backdrop: rgba(0, 0, 0, .6);
    --st-shadow-primary: none;
    --st-shadow: 0 1px 2px rgba(0,0,0,.3); --st-shadow-lift: 0 10px 24px -8px rgba(0,0,0,.6); --st-shadow-pop: 0 12px 32px -8px rgba(0,0,0,.7);
    /* Filled buttons keep a darker blue so white text stays readable. */
    --primary-color: #3d5af1; --primary-color-light: #5670ff; --primary-color-dark: #4a66ff;
    --dm-button-primary-bg-color-hover: #4a66ff; --dm-button-primary-border-color-hover: #4a66ff;
}
body { font-family: var(--st-font); font-size: 15px; -webkit-font-smoothing: antialiased; }
.content-wrapper { padding: 0 16px; }
h1, h2, h3, h4 { letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-weight: 650; }
code, pre, kbd, .text-monospace { font-family: var(--st-mono) !important; }
::selection { background: var(--st-accent-soft); }
/* Accessibility: a visible focus ring for keyboard users, "Skip to content", underlined links in running text, less motion on request. */
:focus-visible { outline: 2px solid var(--st-accent); outline-offset: 2px; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 1000; padding: 8px 14px; border-radius: 8px; background: var(--st-accent-solid, var(--primary-color)); color: #fff !important; font-weight: 600; }
.skip-link:focus { top: 8px; }
#main:focus { outline: none; }
p a:not(.btn), li a:not(.btn), .hint a, .site-footer a, .locked-page a, .site-notice a { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; } }

/* ── Top nav ── */
.navbar { gap: 4px; padding: 0 16px; background: var(--st-nav-bg); border-bottom: 1px solid var(--st-line); backdrop-filter: saturate(160%) blur(10px); z-index: 100; }
.navbar .nav-brand { display: flex; align-items: center; gap: 8px; margin-right: 12px; color: var(--st-text); font-weight: 650; font-size: 16px; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.nav-brand:hover { text-decoration: none; color: var(--st-text); }
.nav-brand .badge { font-family: var(--st-mono); font-size: 11px; font-weight: 500; letter-spacing: 0; padding: 1px 7px; border: 0; border-radius: 999px; background: var(--st-soft); color: var(--st-muted); }
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-links a, .nav-right a:not(.btn), .nav-menu > summary { display: block; padding: 7px 11px; border-radius: 8px; color: var(--st-muted); font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; user-select: none; }
.nav-links a:hover, .nav-right a:not(.btn):hover, .nav-menu > summary:hover, .nav-menu[open] > summary { background: var(--st-soft); color: var(--st-text); text-decoration: none; }
.nav-links .active, .nav-right .active, .nav-menu.active > summary { color: var(--st-accent-hover); background: var(--st-accent-soft); }
.nav-menu { position: relative; }
.nav-menu > summary { list-style: none; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::after { content: ""; display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.nav-menu-list { position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px; padding: 6px; background: var(--st-surface); border: 1px solid var(--st-line); border-radius: var(--st-radius); box-shadow: var(--st-shadow-pop); z-index: 100; }
.nav-menu-list a { padding: 8px 10px; color: var(--st-text) !important; }
.nav-right { display: flex; align-items: center; gap: 2px; margin-left: auto; }
/* Queue badge + dropdown of your live jobs (client/nav.ts) */
.queue-menu > summary { color: var(--st-accent-hover) !important; background: var(--st-accent-soft); font-family: var(--st-mono); font-size: 13px !important; }
.queue-menu .queue-list { left: auto; right: 0; width: min(340px, calc(100vw - 32px)); }
.queue-status { font-size: 13px; color: var(--st-muted); padding: 6px 10px 8px; border-bottom: 1px solid var(--st-line); margin-bottom: 4px; }
.queue-item { display: grid !important; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 10px !important; border-radius: 8px; white-space: normal !important; }
.queue-item:hover { background: var(--st-soft); }
.queue-item-type { font-weight: 600; font-size: 13.5px; }
.queue-item-state { font-family: var(--st-mono); font-size: 12px; color: var(--st-muted); }
.queue-all { font-size: 13px !important; color: var(--st-accent-hover) !important; border-top: 1px solid var(--st-line); margin-top: 4px; padding-top: 8px !important; }
.queue-item-prompt { grid-column: 1 / -1; font-size: 12.5px; color: var(--st-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navbar .nav-right .btn { margin-left: 6px; font-size: 14px !important; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--st-muted); cursor: pointer; }
.theme-toggle:hover { background: var(--st-soft); color: var(--st-text); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: var(--st-text); font-size: 22px; padding: 4px 8px; cursor: pointer; border-radius: 8px; }
.nav-toggle:hover { background: var(--st-soft); }
@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .nav-links, .nav-right { display: none; }
    /* Open menu drops down over the page as a sheet. */
    .navbar.open { position: absolute; top: 0; left: 0; right: 0; height: auto; min-height: var(--navbar-height); flex-wrap: wrap; align-items: center; padding-bottom: 12px; background: var(--st-surface); box-shadow: var(--st-shadow-pop); }
    .navbar.open .nav-toggle { height: var(--navbar-height); }
    .navbar.open .nav-links, .navbar.open .nav-right { display: flex; flex-direction: column; align-items: stretch; width: 100%; flex-basis: 100%; }
    .navbar.open .nav-links a, .navbar.open .nav-right a:not(.btn), .navbar.open .nav-menu > summary { padding: 11px 12px; font-size: 15px; }
    .navbar.open .nav-right { margin-left: 0; border-top: 1px solid var(--st-line); padding-top: 8px; margin-top: 6px; }
    .navbar.open .nav-right .btn { margin: 8px 0 0; height: 42px; line-height: 42px; }
    .navbar.open .theme-toggle { width: auto; justify-content: flex-start; padding: 11px 12px; }
    .nav-menu-list { position: static; box-shadow: none; border: 0; background: none; padding: 0 0 0 12px; min-width: 0; }
}

/* ── Halfmoon components, Studio look ── */
.card { margin: 14px 0; padding: 20px; border-radius: var(--st-radius); }
.card-header { font-weight: 600; font-size: 15px !important; margin: -6px 0 14px; }
.card-body > :first-child { margin-top: 0; }
.card-body > :last-child { margin-bottom: 0; }
.btn { font-weight: 550; font-size: 14px; transition: background-color .12s, border-color .12s, box-shadow .12s, transform .12s; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-sm { font-size: 13px; }
label { font-size: 13.5px; font-weight: 500; color: var(--st-muted); }
.form-control { font-size: 15px; transition: border-color .12s, box-shadow .12s; }
textarea.form-control { padding-top: 8px; padding-bottom: 8px; line-height: 1.5; }
select.form-control { background-image: linear-gradient(45deg, transparent 50%, var(--st-muted) 50%), linear-gradient(135deg, var(--st-muted) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
a { text-underline-offset: 2px; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--st-accent); }

/* ── Tool pages (/t2i, /flux-t2i, …): shared form layout ── */
#main > form:first-of-type { padding-top: 28px; }
.row { gap: 0 10px; }
.row > div { flex: 1 1 110px; min-width: 0; }
.row .form-control { margin-top: 0; }
#status { margin-top: 12px; font-size: 15px; font-weight: 600; color: var(--st-ok); min-height: 1.2em; }
#status.error { color: var(--st-bad); }
.hint { font-size: 13.5px; color: var(--st-muted); }
.lora-check-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--st-line); cursor: pointer; user-select: none; }
.lora-check-row:last-child { border-bottom: none; }
.lora-check-row input[type=checkbox] { width: 16px; height: 16px; margin: 0; flex-shrink: 0; cursor: pointer; }
.lora-check-row .lora-name { flex: 1; font-size: 15px; }
.lora-check-row .lora-tip { font-size: 13px; color: var(--st-muted); flex: 1; }
.lora-check-row input[type=number] { width: 70px; flex-shrink: 0; height: 30px; padding: 0 8px; font: inherit; font-size: 14px; color: var(--st-text); background: var(--st-surface); border: 1px solid var(--st-line-strong); border-radius: 6px; }
.lora-entry { border: 1px solid var(--st-line); border-radius: var(--st-radius-sm); padding: 10px; margin-top: 8px; }
.lora-entry-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 13.5px; color: var(--st-muted); }

/* ── Workbench (every tool page): settings panel on the left (sticky, scrolls on its own, Generate
   pinned at its bottom), input image (if any) + results on the right. Markup: see RECIPES.md. ── */
.bench { display: grid; grid-template-columns: 400px minmax(0, 1fr); align-items: start; margin: 0 -16px; }
.bench-side { position: sticky; top: 0; height: calc(100vh - var(--navbar-height)); height: calc(100dvh - var(--navbar-height)); display: flex; flex-direction: column; background: var(--st-surface); border-right: 1px solid var(--st-line); }
.bench-scroll { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.bench-scroll .form-group { margin: 0; }
.bench-foot { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--st-line); background: var(--st-surface); }
.bench-foot .btn { height: 42px; }
.bench-foot .btn-primary { flex: 1; font-size: 15px; }
.bench-foot kbd { font-family: var(--st-mono) !important; font-size: 11px; font-weight: 400; opacity: .75; margin-left: 8px; background: none; padding: 0; border: 0; box-shadow: none; color: inherit; }
/* Admins only (client/jobList.ts): "Skip safety filter (testing)" above Generate. */
.bench-foot:has(.safety-bypass), .bench-foot:has(.bench-estimate), .bench-foot:has(.consent-check) { flex-wrap: wrap; }
.consent-check { flex-basis: 100%; display: flex; align-items: flex-start; gap: 7px; margin: 0; font-size: 12.5px; font-weight: 400; color: var(--st-text); line-height: 1.35; }
.consent-check input { margin-top: 2px; flex: none; }
.bench-estimate { flex-basis: 100%; font-size: 12.5px; color: var(--st-muted); font-family: var(--st-mono); min-height: 1em; }
.bench-estimate.warn { color: var(--st-warn); }
.safety-bypass { flex-basis: 100%; display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--st-warn); }
.bench-main { padding: 20px 24px 8px; min-width: 0; }
.bench-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bench-head h1 { margin: 0; font-size: 19px; }
.bench-head a { margin-left: auto; font-size: 13.5px; }
.bench-main #status { margin: 0; min-height: 0; font-size: 12.5px; font-weight: 500; font-family: var(--st-mono); }
.bench-main .job-list { margin-top: 16px; }
.bench-main .job-list:empty::before { content: attr(data-empty); display: block; padding: 48px 20px; text-align: center; color: var(--st-muted); border: 1px dashed var(--st-line-strong); border-radius: var(--st-radius); }

.bench label { margin-bottom: 5px; }
.field-head { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.field-head label { margin: 0; }
.field-head .tags { margin-left: auto; display: flex; gap: 4px; }
.tag { font-family: var(--st-mono); font-size: 11px; padding: 1px 7px; border-radius: 5px; background: var(--st-soft); color: var(--st-muted); }
.tag:empty { display: none; }
.section-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--st-muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.inline-switch { display: flex; align-items: flex-end; gap: 12px; }
.inline-switch .form-group { flex: 1; }
.inline-switch .custom-switch { height: 38px; display: flex; align-items: center; }

.ratio-row { display: flex; flex-wrap: wrap; gap: 4px; }
.ratio-btn { height: 30px; padding: 0 9px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--st-line-strong); background: var(--st-surface); border-radius: 7px; font: 12.5px var(--st-mono); color: var(--st-muted); cursor: pointer; }
.ratio-btn:hover { background: var(--st-soft); color: var(--st-text); }
.ratio-btn i { display: inline-block; border: 1.5px solid currentColor; border-radius: 2px; }
.ratio-btn i.custom { width: 12px; height: 12px; border-style: dashed; }
.ratio-btn[aria-pressed="true"] { border-color: var(--st-accent); background: var(--st-accent-soft); color: var(--st-accent-hover); }
.ratio-btn:focus-visible { outline: 2px solid var(--st-accent); outline-offset: 2px; }
.ratio-btn:disabled { opacity: .45; cursor: default; background: var(--st-surface); color: var(--st-muted); }

/* Settings help + Simple / Advanced (client/settingsUi.ts) */
.has-field-help { position: relative; }
.field-help { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin: 0 0 5px 5px; padding: 0; vertical-align: middle; border: 1px solid var(--st-line-strong); border-radius: 50%; background: none; color: var(--st-muted); font: italic 600 10.5px/1 Georgia, serif; cursor: pointer; }
.field-help:hover, .field-help[aria-expanded="true"] { color: var(--st-accent); border-color: var(--st-accent); }
.custom-switch .field-help { margin: 0 0 0 6px; }
.field-tip { position: fixed; z-index: 400; width: min(300px, calc(100vw - 16px)); padding: 12px; background: var(--st-surface); color: var(--st-text); border: 1px solid var(--st-line); border-radius: var(--st-radius-sm); box-shadow: var(--st-shadow-pop); font-size: 13px; line-height: 1.45; }
.field-tip[hidden] { display: none; }
.field-tip p { margin: 4px 0 8px; color: var(--st-muted); }
.field-tip-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; font-family: var(--st-mono); font-size: 12px; color: var(--st-muted); }
.mode-switch { display: flex; padding: 3px; gap: 3px; background: var(--st-soft); border-radius: 9px; }
.mode-switch button { flex: 1; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--st-muted); font: 500 13px var(--st-font); cursor: pointer; }
.mode-switch button[aria-pressed="true"] { background: var(--st-surface); color: var(--st-text); box-shadow: var(--st-shadow); }
.mode-hidden { display: none !important; }
.mode-note { margin: -6px 0 0; }
.mode-note[hidden] { display: none; }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--st-muted); user-select: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: ""; border: 4px solid transparent; border-left-color: currentColor; margin-right: -2px; transition: transform .15s; transform-origin: 25% 50%; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary:hover { color: var(--st-text); }
.compare-models { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13px; }
.compare-models label { display: flex; gap: 6px; align-items: center; margin: 0; font-weight: 400; color: var(--st-text); }
@media (max-width: 600px) { .compare-models { grid-template-columns: 1fr; } }
/* Batch fold (client/batch.ts): job count in the summary, Compare models / schedulers as sub-folds, models under family headings. */
.batch-count { font-weight: 400; font-size: 12.5px; color: var(--st-muted); }
.batch-count.over { color: var(--st-bad); font-weight: 600; }
details.subfold { border: 1px solid var(--st-line); border-radius: var(--st-radius-sm); padding: 7px 10px; margin: 10px 0; background: var(--st-surface); }
details.subfold > summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--st-text); }
details.subfold[open] > summary { margin-bottom: 6px; }
details.subfold > .hint { margin-top: 0; }
.compare-models.grouped { display: block; }
.compare-group { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13px; margin-bottom: 10px; }
.compare-group label { display: flex; gap: 6px; align-items: center; margin: 0; font-weight: 400; color: var(--st-text); }
.compare-group-head { grid-column: 1 / -1; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--st-muted); border-bottom: 1px solid var(--st-line); padding-bottom: 3px; }
.compare-group-head small { margin-left: 6px; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--st-accent); }
@media (max-width: 600px) { .compare-group { grid-template-columns: 1fr; } }

/* /batch (client/batchPage.ts): axis cards in the settings column, the viewer bar and the labelled grid. */
.axis-card { border: 1px solid var(--st-line); border-radius: var(--st-radius-sm); background: var(--st-surface); padding: 10px 12px; margin-top: 14px; }
.axis-card .axis-head { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px; align-items: center; }
.axis-card .axis-head label { margin: 0; font-weight: 600; }
.axis-card .axis-head small { font-weight: 400; color: var(--st-muted); margin-left: 4px; }
.axis-card .axis-body > .hint { margin: 8px 0 6px; }
.axis-card .axis-body > .compare-models:not(:empty) { margin-top: 4px; }
.grid-count { font-size: 12.5px; color: var(--st-muted); margin-right: auto; }
.viewer-bar { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(110px, 1fr); gap: 10px; align-items: end; margin-bottom: 6px; }
.viewer-bar .form-group { margin: 0; }
.viewer-bar .viewer-size input { width: 100%; }
.batch-summary { font-size: 13px; color: var(--st-muted); margin-bottom: 10px; min-height: 18px; }
.batch-grids { --cell: 220px; overflow-x: auto; padding-bottom: 8px; }
.batch-grids:empty::before { content: attr(data-empty); display: block; padding: 40px 20px; text-align: center; color: var(--st-muted); border: 1px dashed var(--st-line-strong); border-radius: var(--st-radius); }
.batch-group + .batch-group { margin-top: 22px; }
.batch-group-head { font-weight: 600; font-size: 13.5px; margin-bottom: 8px; color: var(--st-text); }
.batch-grid { display: grid; gap: 6px; width: max-content; }
.batch-col-head, .batch-row-head, .batch-corner { font-size: 12.5px; font-weight: 500; color: var(--st-text); overflow: hidden; text-overflow: ellipsis; }
.batch-col-head { white-space: nowrap; text-align: center; padding: 2px 4px; align-self: end; }
.batch-row-head { max-width: 180px; align-self: center; text-align: right; padding-right: 6px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; word-break: break-word; }
.batch-corner { font-size: 11px; color: var(--st-muted); font-weight: 400; align-self: end; text-align: right; padding-right: 6px; }
.batch-cell { position: relative; width: var(--cell); height: var(--cell); border-radius: var(--st-radius-sm); background: var(--st-soft); border: 1px solid var(--st-line); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.batch-cell.is-empty { background: transparent; border-style: dashed; }
.batch-cell.is-failed { border-color: var(--st-bad-line); background: var(--st-bad-soft); }
.batch-cell > a:first-child { display: block; width: 100%; height: 100%; }
.batch-cell img { width: 100%; height: 100%; object-fit: contain; display: block; }
.batch-more, .batch-open { position: absolute; top: 6px; font-size: 11px; line-height: 1; padding: 4px 6px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; text-decoration: none; }
.batch-more { left: 6px; }
.batch-open { right: 6px; opacity: 0; transition: opacity .15s; }
.batch-cell:hover .batch-open, .batch-open:focus-visible { opacity: 1; }
.batch-state { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; width: 100%; text-align: center; font-size: 13px; font-weight: 500; color: var(--st-muted); }
.batch-cell.is-failed .batch-state { color: var(--st-bad); }
.batch-state small { font-weight: 400; font-size: 11.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.batch-state a { font-size: 12px; font-weight: 400; }
.batch-state .job-progress { width: 80%; }
@media (max-width: 700px) { .viewer-bar { grid-template-columns: 1fr 1fr; } .viewer-bar .form-group:first-child { grid-column: 1 / -1; } }
details.fold > .fold-body { padding-top: 8px; }

/* LoRA rows (client/textToImage.ts, buildLoraChecklist() in client/common.ts): name with its hint underneath, weight on the right. */
.bench .lora-check-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) 68px; column-gap: 10px; row-gap: 0; }
.bench .lora-check-row input[type=checkbox] { grid-area: 1 / 1; }
.bench .lora-check-row .lora-name { grid-area: 1 / 2; font-size: 14px; font-weight: 500; color: var(--st-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bench .lora-check-row .lora-tip { grid-area: 2 / 2; font-size: 12px; }
.bench .lora-check-row input[type=number] { grid-area: 1 / 3 / 3 / 4; width: 100%; }
.lora-entry input { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--st-line-strong); border-radius: 6px; background: var(--st-surface); font-size: 13.5px; }
.lora-entry .remove { background: none; border: 0; color: var(--st-bad); cursor: pointer; font-size: 13px; }

@media (max-width: 900px) {
  .bench { grid-template-columns: 1fr; }
  .bench-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--st-line); }
  .bench-scroll { overflow: visible; padding: 16px; }
  .bench-foot { position: sticky; bottom: 0; z-index: 5; padding: 10px 16px; box-shadow: 0 -6px 16px -8px rgba(0,0,0,.15); }
  .bench-main { padding: 16px 16px 8px; }
}
@media (max-width: 600px) {
  .grid4 { grid-template-columns: 1fr 1fr; }
  .bench-foot kbd { display: none; }
}

/* Input image card at the top of the right pane (image tool pages). */
.bench-input { margin-top: 16px; background: var(--st-surface); border: 1px solid var(--st-line); border-radius: var(--st-radius); box-shadow: var(--st-shadow); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bench-input-head { display: flex; align-items: center; gap: 10px; }
.bench-input-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.bench-input-head .btn { margin-left: auto; }
.bench-input input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bench-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 180px; padding: 20px; text-align: center; border: 1px dashed var(--st-line-strong); border-radius: 10px; color: var(--st-muted); cursor: pointer; margin: 0; font-size: 14px; font-weight: 400; }
.bench-drop:hover { border-color: var(--st-accent); color: var(--st-text); background: var(--st-accent-soft); }
.bench-drop small { font-size: 12.5px; color: var(--st-muted); }
/* Optional extra input images (/t2i start + reference, /qwen-edit image 2 / 3): .input-slot, filled by the page script. */
.input-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.input-slot { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.input-slot .bench-input-head h2 small, .bench-input-head h2 small { font-weight: 400; color: var(--st-muted); }
.input-slot .bench-drop { min-height: 110px; }
.input-slot img { display: none; max-width: 100%; max-height: 200px; object-fit: contain; border-radius: 10px; background: var(--st-soft); align-self: flex-start; }
.input-slot.has-image img { display: block; }
.input-slot.has-image .bench-drop { display: none; }
.input-slot .slot-clear { display: none; }
.input-slot.has-image .slot-clear { display: inline-block; }
@media (max-width: 600px) { .input-slots { grid-template-columns: minmax(0, 1fr); } }
.bench-input:has(#imagePreview[src]) .bench-drop, .bench-input:has(#paintWrap[style*="block"]) .bench-drop { display: none; }
.multi-hidden { display: none !important; }
.batch-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.batch-thumbs:empty { display: none; }
.batch-thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
#imagePreview { display: none; max-width: 100%; max-height: 520px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.12); align-self: flex-start; }

/* ── Job cards on tool pages (client/jobList.ts) ── */
.job-list { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.job-card { background: var(--st-surface); border: 1px solid var(--st-line); border-radius: var(--st-radius); padding: 14px; box-shadow: var(--st-shadow); }
.job-card.failed { border-color: var(--st-bad-line); }
.job-card-head { display: flex; align-items: center; gap: 8px; }
.job-card-state { flex: 1; font-weight: 600; font-size: 14px; }
.job-card.failed .job-card-state { color: var(--st-bad); }
.job-card-title { font-size: 14px; color: var(--st-muted); margin: 4px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-dismiss { background: none; border: 0; color: var(--st-muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.job-dismiss:hover { background: var(--st-soft); color: var(--st-text); }
.job-progress { background: var(--st-soft); border-radius: 999px; height: 6px; margin-bottom: 6px; overflow: hidden; }
.job-progress-bar { height: 100%; background: var(--st-accent); border-radius: inherit; width: 0; transition: width 0.3s; }
/* Running with no numbers to show (client/jobList.ts #working, client/queuePage.ts): a sliding segment. */
.job-progress.indeterminate .job-progress-bar { width: 35%; transition: none; animation: job-progress-slide 1.3s ease-in-out infinite; }
@keyframes job-progress-slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) { .job-progress.indeterminate .job-progress-bar { width: 100%; animation: none; opacity: .45; } }
.job-card-label { font-family: var(--st-mono); font-size: 12.5px; color: var(--st-muted); }
.job-card.failed .job-card-label { font-family: inherit; font-size: 14px; color: var(--st-bad); }
/* Outputs: an even grid; each image has a bar as wide as itself (Download + "Send to ▾"). */
.job-outputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 10px; }
.job-output { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.job-output:has(audio) { grid-column: 1 / -1; }
.job-output-label { font-size: 12.5px; font-weight: 600; text-transform: capitalize; color: var(--st-muted); margin-bottom: -4px; }
.job-output audio { width: 100%; }
.job-text { resize: vertical; font-size: 13px; }
.job-output > a { display: block; border-radius: 10px; }
.job-thumb { width: 100%; height: auto; max-height: 420px; object-fit: contain; border-radius: 10px; background: var(--st-soft); box-shadow: 0 1px 3px rgba(0,0,0,.12); display: block; transition: box-shadow .15s; }
.job-output > a:hover .job-thumb { box-shadow: var(--st-shadow-lift); }
.job-thumb.preview { opacity: 0.6; filter: blur(1px); }
.job-model { width: 100%; height: 420px; border-radius: 10px; background: var(--st-soft); display: block; }
.job-output-actions { display: flex; gap: 6px; }
.job-output-actions > .btn, .job-output-actions > .send-menu { flex: 1 1 0; min-width: 0; }
.job-output-actions .btn { width: 100%; text-decoration: none; }
.send-menu { position: relative; }
.send-menu > summary { list-style: none; display: flex; align-items: center; justify-content: center; gap: 6px; }
.send-menu > summary::-webkit-details-marker { display: none; }
.send-menu > summary::after { content: ""; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.send-menu-list { position: absolute; right: 0; top: calc(100% + 4px); min-width: 100%; padding: 4px; background: var(--st-surface); border: 1px solid var(--st-line); border-radius: 10px; box-shadow: var(--st-shadow-pop); z-index: 20; display: flex; flex-direction: column; }
.send-menu-list button { background: none; border: 0; text-align: left; padding: 7px 10px; border-radius: 6px; font-size: 13.5px; color: var(--st-text); cursor: pointer; white-space: nowrap; }
.send-menu-list button:hover { background: var(--st-soft); }
.send-menu-list button:disabled { color: var(--st-muted); cursor: default; background: none; }
.send-menu-divider { border-top: 1px solid var(--st-line); margin: 4px 2px; }
.job-card-foot { font-size: 13.5px; color: var(--st-muted); margin-top: 8px; }
.job-flag-note { color: var(--st-warn); background: var(--st-warn-soft); border-radius: 6px; padding: 6px 8px; margin-bottom: 6px; }
/* A failed job: plain-words reason, the raw error, Retry / Retry smaller (client/jobList.ts) */
.job-error-detail { margin-bottom: 6px; font-family: var(--st-mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.job-error-detail > summary { font-family: var(--st-font); cursor: pointer; width: fit-content; }
.job-retry { display: flex; gap: 6px; }
.job-again { background: none; border: 0; padding: 0; color: var(--st-accent); font: inherit; cursor: pointer; }
.job-again:hover { text-decoration: underline; }
.job-again:disabled { color: var(--st-muted); cursor: default; }
/* "Settings ▸" under a finished job card (client/jobList.ts) */
.job-settings { margin-top: 6px; }
.job-settings > summary { cursor: pointer; width: fit-content; }
.job-settings-body { margin-top: 6px; padding: 10px; background: var(--st-soft); border-radius: var(--st-radius-sm); }
.job-settings-body dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0 0 8px; font-size: 13px; }
.job-settings-body dt { font-weight: 500; color: var(--st-muted); }
.job-settings-body dd { margin: 0; color: var(--st-text); font-family: var(--st-mono); font-size: 12.5px; word-break: break-word; }
.job-settings-actions { display: flex; flex-wrap: wrap; gap: 6px; }
/* An image file dragged over a tool page (client/pasteDrop.ts) */
body.dragging-image .bench-input, body.dragging-image #toolsForm input[type=file] { outline: 2px dashed var(--st-accent); outline-offset: 4px; }
body.dragging-image .bench-drop { border-color: var(--st-accent); background: var(--st-accent-soft); color: var(--st-text); }
/* "This image was made here — Load its settings" after dropping one of your PNGs (client/pasteDrop.ts) */
.remix-offer { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 200; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; background: var(--st-surface); border: 1px solid var(--st-line); border-radius: var(--st-radius); box-shadow: var(--st-shadow-pop); font-size: 14px; max-width: calc(100vw - 32px); }
/* Socket down / back (client/socket.ts) */
.conn-banner { position: fixed; top: calc(var(--navbar-height) + 8px); left: 50%; transform: translateX(-50%); z-index: 300; padding: 8px 16px; border-radius: 999px; background: var(--st-warn-soft); color: var(--st-warn); border: 1px solid var(--st-warn-line); box-shadow: var(--st-shadow-pop); font-size: 13.5px; font-weight: 500; max-width: calc(100vw - 32px); text-align: center; }
.conn-banner.ok { background: var(--st-ok-soft); color: var(--st-ok); border-color: transparent; }
.conn-banner[hidden] { display: none; }
/* ── Full-screen image viewer (client/lightbox.ts) ── */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(10, 12, 18, .94); color: #fff;
    display: grid; grid-template-rows: auto minmax(0, 1fr) auto; --lb-max-h: calc(100dvh - 120px); }
.lightbox:not([open]) { display: none; }
.lightbox::backdrop { background: transparent; }
.lightbox [hidden] { display: none !important; }
.lb-top { display: flex; align-items: center; gap: 8px; padding: 10px 16px; }
.lb-counter { font-family: var(--st-mono); font-size: 13px; opacity: .8; }
.lb-note { flex: 1; font-size: 13.5px; opacity: .85; }
.lb-top .btn.active { background: var(--st-accent); border-color: var(--st-accent); color: #fff; }
.lb-close { font-size: 18px; line-height: 1; }
.lb-stage { display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0 16px; touch-action: pan-y; }
.lb-view { max-width: 100%; max-height: var(--lb-max-h); object-fit: contain; cursor: zoom-in; user-select: none; }
.lb-stage.zoomed { display: block; overflow: auto; touch-action: auto; }
.lb-stage.zoomed .lb-view { max-width: none; max-height: none; cursor: zoom-out; }
.lb-compare { display: none; position: relative; max-width: 100%; }
.lb-stage.comparing .lb-view { display: none; }
.lb-stage.comparing .lb-compare { display: block; }
.lb-after { display: block; max-width: 100%; max-height: var(--lb-max-h); user-select: none; }
.lb-before { position: absolute; inset: 0; width: 100%; height: 100%; clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0); user-select: none; }
.lb-compare.letterbox .lb-before { object-fit: contain; background: #111; }
.lb-compare::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 4px rgba(0,0,0,.6); pointer-events: none; }
.lb-labels { position: absolute; inset: 8px 8px auto; display: flex; justify-content: space-between; pointer-events: none; }
.lb-labels span { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.55); }
.lb-slider { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; font-size: 32px; line-height: 1; cursor: pointer; }
.lb-nav:hover { background: rgba(255,255,255,.24); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-actions { justify-content: center; padding: 10px 16px 16px; }
.lb-actions > .btn, .lb-actions > .send-menu { flex: 0 1 180px; }
.lb-actions .send-menu-list { top: auto; bottom: calc(100% + 4px); }
@media (max-width: 600px) { .lb-nav { display: none; } }
/* Label with a small button on the right (e.g. "Prompt from image" on /inpaint, /outpaint). */
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.label-row label { margin: 0; }
/* ── Saved images: "Saved…" picker next to an image input (client/savedImages.ts) ── */
.bench-input-head .btn ~ .btn { margin-left: 0; }
.form-group > .saved-pick { margin-top: 8px; }
.saved-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 16px; border: 1px solid var(--st-line); border-radius: var(--st-radius); box-shadow: var(--st-shadow-pop); background: var(--st-surface); color: var(--st-text); }
.saved-dialog::backdrop { background: var(--st-backdrop); }
.saved-dialog-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 15px; }
.saved-dialog-head a { font-size: 13.5px; }
.saved-dialog-head .btn { margin-left: auto; }
/* "Draw…" for the ControlNet scribble (client/drawPad.ts) */
.draw-pad .saved-dialog-head { flex-wrap: wrap; }
.draw-pad .saved-dialog-head .btn { margin-left: 0; }
.draw-size { display: flex; align-items: center; gap: 6px; margin: 0 0 0 auto; font-size: 13.5px; }
.draw-stage { display: grid; width: fit-content; max-width: 100%; margin: 0 auto; border: 1px solid var(--st-line); border-radius: var(--st-radius-sm); background: #fff; overflow: hidden; }
.draw-stage canvas { grid-area: 1 / 1; display: block; max-width: 100%; max-height: calc(100vh - 220px); }
.draw-guide { opacity: .35; pointer-events: none; }
.draw-lines { touch-action: none; cursor: crosshair; }
/* The ControlNet fold on /inpaint and /outpaint (client/controlFold.ts) */
#controlFields { border: 0; margin: 0; min-width: 0; }
#controlFields:disabled > :not(#controlOff) { opacity: .5; }
.control-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.control-pick input[type=file] { display: none; }
#controlPreview { display: block; max-width: 100%; max-height: 160px; object-fit: contain; border-radius: 10px; background: var(--st-soft); margin-bottom: 8px; }
#controlPreview[hidden] { display: none; }
.draw-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.draw-foot .hint { margin: 0 auto 0 0; }
.saved-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; color: var(--st-muted); font-size: 14px; }
.saved-item { display: flex; flex-direction: column; gap: 4px; padding: 6px; background: none; border: 1px solid var(--st-line); border-radius: 10px; cursor: pointer; text-align: left; color: var(--st-text); min-width: 0; }
.saved-item:hover { border-color: var(--st-accent); background: var(--st-accent-soft); }
.saved-item img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--st-soft); border-radius: 6px; }
.saved-section { grid-column: 1 / -1; margin: 4px 0 0; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--st-muted); }
.saved-item span { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ── "✨ Enhance" + its ▾ menu and the prompt chat dialog (client/common.ts initPromptEnhancer) ── */
.enhance-group { display: inline-flex; gap: 4px; }
.enhance-chat { display: none; flex-direction: column; }
.enhance-chat[open] { display: flex; }
.enhance-chat-target { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enhance-chat-log { display: flex; flex-direction: column; gap: 8px; min-height: 160px; height: 50vh; overflow-y: auto; padding: 4px 2px; }
.enhance-chat-log > .hint { margin: auto 12px; text-align: center; }
.enhance-msg { max-width: 88%; padding: 8px 12px; border-radius: 12px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.enhance-msg p { margin: 0; }
.enhance-msg p + * { margin-top: 8px; }
.enhance-msg.user { align-self: flex-end; background: var(--st-accent-soft); border: 1px solid var(--st-accent-line); }
.enhance-msg.assistant { align-self: flex-start; background: var(--st-soft); border: 1px solid var(--st-line); }
.enhance-msg.pending { color: var(--st-muted); }
.enhance-prompt { padding: 8px 10px; background: var(--st-surface); border: 1px solid var(--st-line-strong); border-radius: var(--st-radius-sm); font-family: var(--st-mono); font-size: 13px; }
.enhance-prompt + * { margin-top: 8px; }
.enhance-prompt .btn { margin-top: 8px; font-family: var(--st-font); }
.enhance-chat-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.enhance-chat-form textarea { flex: 1; resize: vertical; }
.enhance-chat-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.enhance-chat-foot .hint { margin-right: auto; }
.enhance-chat-status.error { color: var(--st-bad); }
/* ── Saved-prompt bar above prompt boxes (client/presets.ts) ── */
.preset-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 13px; }
.preset-bar select { width: auto; max-width: 260px; flex: 0 1 auto; }
/* ── "Transfer your guest data?" prompt after logging in (helpers/guestData.ts) ── */
.guest-dialog { width: min(460px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--st-line); border-radius: var(--st-radius); box-shadow: var(--st-shadow-pop); background: var(--st-surface); color: var(--st-text); }
.guest-dialog::backdrop { background: var(--st-backdrop); }
.terms-dialog { width: min(560px, calc(100vw - 32px)); }
.terms-dialog::backdrop { background: rgba(15, 18, 30, .7); backdrop-filter: blur(6px); }
.terms-dialog h2 { font-size: 20px; margin: 0 0 10px; }
.terms-dialog p, .terms-dialog li { font-size: 14.5px; line-height: 1.55; }
.terms-dialog ul { padding-left: 20px; margin: 0 0 14px; }
.terms-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; color: var(--st-text); margin: 0 0 14px; }
.terms-check input { margin-top: 3px; }
.guest-dialog p { margin: 0 0 8px; font-size: 15px; }
.guest-dialog .hint { margin-bottom: 16px; }
.guest-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.guest-dialog-actions .btn-danger-text { margin-left: auto; color: var(--st-bad); }
#guestDataError { color: var(--st-bad); font-size: 13.5px; margin-top: 10px; }
/* "Send feedback" (client/feedback.ts) */
.feedback-dialog { width: min(520px, calc(100vw - 32px)); }
.feedback-dialog h2 { font-size: 19px; margin: 0 0 4px; }
.feedback-dialog textarea { margin: 6px 0; resize: vertical; }
.feedback-status { font-size: 13.5px; margin-top: 10px; color: var(--st-ok); }
.feedback-status.error { color: var(--st-bad); }
.feedback-status:empty { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#guestDataError:empty { display: none; }
/* ── Guests: what's limited (helpers/access.ts → guestLimits()), and pages their tier can't run ── */
.guest-banner { display: flex; align-items: center; gap: 14px; margin: 12px 0 0; padding: 10px 14px; background: var(--st-warn-soft); color: var(--st-warn); border: 1px solid var(--st-warn-line); border-radius: var(--st-radius); font-size: 13.5px; }
.guest-banner[hidden] { display: none; }
.guest-banner-text { flex: 1; min-width: 0; }
.guest-banner strong { color: var(--st-text); font-weight: 600; }
.guest-banner ul { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 4px 0 0; padding: 0 0 0 16px; }
.guest-banner .btn { flex-shrink: 0; }
.guest-banner-close { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--st-warn); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.guest-banner-close:hover { background: rgba(0,0,0,.06); }
.announce-banner { display: flex; align-items: center; gap: 12px; margin: 12px 0 0; padding: 8px 10px 8px 14px; background: var(--st-accent-soft); color: var(--st-text); border: 1px solid var(--st-accent-line); border-radius: var(--st-radius); font-size: 14px; }
.announce-banner[hidden] { display: none; }
.announce-banner .announce-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.announce-banner .guest-banner-close { color: var(--st-muted); }
.site-notice { margin: 12px 0 0; padding: 10px 14px; background: var(--st-warn-soft); color: var(--st-warn); border-radius: var(--st-radius); font-size: 14px; font-weight: 500; }
.locked-page { margin: 12px 0 0; padding: 10px 14px; background: var(--st-bad-soft); color: var(--st-bad); border-radius: var(--st-radius); font-size: 14px; font-weight: 500; }
.nav-links a.locked, .nav-menu-list a.locked { color: var(--st-muted) !important; }
.nav-links a.locked::after, .nav-menu-list a.locked::after { content: " 🔒"; font-size: 11px; }
@media (max-width: 600px) { .guest-banner { flex-wrap: wrap; } .guest-banner-text { flex-basis: calc(100% - 40px); } }
/* ── "About" text + FAQ under tool pages (helpers/seo.ts) ── */
.tool-about { max-width: 760px; margin: 40px auto 0; padding: 0 16px; color: var(--st-muted); font-size: 14.5px; line-height: 1.6; }
.tool-about h2 { font-size: 17px; color: var(--st-text); margin: 0 0 8px; }
.tool-about p { margin: 0 0 12px; }
.tool-about details { border-top: 1px solid var(--st-line); padding: 8px 0; }
.tool-about summary { cursor: pointer; color: var(--st-text); font-weight: 500; }
.tool-about details p { margin: 6px 0 0; }

/* ── Footer ── */
.site-footer { text-align: center; padding: 32px 16px 40px; font-size: 13px; color: var(--st-muted); }
.site-footer a { color: inherit; margin: 0 8px; }
.site-footer a:hover { color: var(--st-text); }

/* ── Phones ── */
@media (max-width: 600px) {
    .card { margin: 12px 0; padding: 16px; }
    .row > div { flex-basis: calc(50% - 5px) !important; }   /* beats inline flex on some fields */
    .row > .form-group:first-child:has(> select) { flex-basis: 100% !important; }   /* model / voice / scheduler pickers */
    .form-control { font-size: 16px; }                         /* 16px stops iOS zooming into inputs */
    .job-outputs { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .preset-bar select { flex: 1 1 auto; max-width: none; }
}
