/* Ephoria's iris palette, with surfaces that follow the user's appearance. */
:root{--surface:#fff;--accent-button:#4b4c96}
/* 16 Nov 2026: the browser's own parts (scroll bars, form controls) follow the appearance too: without this, every scrolling
   region showed white scroll-bar tracks on the dark theme. One rule for the whole site. */
:root{color-scheme:light}:root[data-theme="dark"]{color-scheme:dark}
/* Selection, status and elevation tokens (14 Nov 2026, one family site-wide; rules in style.css "Selection and status").
   Selected = flat fill + full-strength text at 600; hover = a lighter neutral fill; a picture tile = a 2px accent border.
   Status = a dot or chip in the status colour; only real errors tint their box. Elevation only on what floats. */
:root{--sel-fill:rgba(131,132,184,.22);--dock-sel:rgba(131,132,184,.22);--sel-ink:var(--ink);--sel-weight:600;--sel-line:var(--hair-2);--hover-fill:rgba(21,19,24,.05);--pick-ring:var(--accent-button);
 --status-error:var(--brick);--status-warn:var(--caramel);--status-ok:var(--sage);--status-info:var(--peri);--status-error-tint:rgba(183,61,57,.06);
 --elev-composer:0 1px 2px rgba(21,19,24,.04),0 8px 24px -12px rgba(21,19,24,.08);--elev-menu:0 1px 2px rgba(21,19,24,.05),0 14px 44px -14px rgba(21,19,24,.3);
 --elev-float:0 1px 2px rgba(21,19,24,.05),0 8px 24px -10px rgba(21,19,24,.3);--elev-dialog:0 24px 64px -20px rgba(21,19,24,.4)}
:root[data-theme="dark"]{--paper:#17171d;--paper-2:#202027;--paper-3:#2c2b35;--surface-2:var(--paper-3);--surface:#202027;--ink:#f3f1f7;--ink-2:#d1cdd9;--ink-3:#aaa5b5;--iris:#aaa7ef;--iris-dk:#c4c1fa;--peri:#a29fd9;--peri-lt:#d4d1ff;--peri-soft:rgba(163,159,217,.14);--peri-mid:rgba(163,159,217,.24);--hair:rgba(239,235,255,.13);--hair-2:rgba(239,235,255,.23);--hair-soft:rgba(239,235,255,.08);--sage-dk:#acd9bd;--caramel-dk:#efc49e;--brick:#ffa6a0;--green:#625fb0;--accent-button:#625fb0;--white:#202027;--shadow:0 1px 2px #0003,0 8px 24px -12px #0006;--sel-fill:rgba(163,159,217,.22);--hover-fill:rgba(239,235,255,.06);--status-error-tint:rgba(255,166,160,.08);--elev-composer:0 1px 2px #0003,0 8px 24px -12px #0006;--elev-menu:0 1px 2px #0004,0 14px 44px -12px #000a;--elev-float:0 1px 2px #0004,0 8px 24px -10px #0009;--elev-dialog:0 24px 64px -16px #000b}
.sidebar,.mobile-header{background:var(--dock-paper);color:var(--dock-text)}
.sidebar .wordmark,.sidebar .wordmark span,.sidebar .workspace strong,.sidebar .new-chat,.sidebar .profile,.sidebar .nav-item:hover,.sidebar .nav-item.active,.sidebar .conversation-item:hover,.sidebar .conversation-item.active,.sidebar .sidebar-control:hover,.mobile-header .wordmark,.mobile-header .wordmark span,.mobile-header .sidebar-control{color:var(--dock-text)}
.btn,.search,.input,.production-card,.product-card,.empty,.form-section,.type-option,.output-card,.brief-panel,.selection-chip,.composer-ref,.chat-output,.message-product,.editor-tools,.starter-prompts button,.composer,.product-dialog,.source-conflicts{background:var(--surface);color:var(--ink)}

.btn.primary,.send-button{background:var(--accent-button);border-color:var(--accent-button);color:#fff}
.btn.primary:hover,.send-button:hover{background:#55529f;border-color:#55529f}
.btn.dark{background:var(--ink);color:var(--paper)}
input,textarea,select{color:var(--ink)}

:root[data-theme="dark"] .check-dot{background:var(--surface)}
:root[data-theme="dark"] .selected .check-dot{background:var(--accent-button);color:white}
:root[data-theme="dark"] .reference-item button,:root[data-theme="dark"] .close-viewer{background:var(--surface);color:var(--ink)}
:root[data-theme="dark"] #viewer{background:#101014}
.settings-layout{max-width:760px}.settings-layout .settings-form{max-width:none}.settings-layout .form-section{padding:24px;margin-bottom:16px}.settings-layout h2{font:500 21px var(--disp);margin:0 0 14px}.settings-save{display:flex;align-items:center;gap:12px;margin:20px 0 18px}.settings-save #settings-status{margin:0;font-size:12px}.settings-description{font-size:12px;color:var(--ink-3);line-height:1.6;margin-top:10px}.appearance-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;border:0;padding:0;margin:20px 0 12px}.appearance-choice{position:relative;display:grid;gap:9px;cursor:pointer;font-size:12px;color:var(--ink-2);text-align:center}.appearance-choice input{position:absolute;opacity:0;width:100%;height:100%;margin:0;cursor:pointer}.theme-swatch{display:block;height:82px;border:1px solid var(--hair-2);border-radius:9px;overflow:hidden;position:relative;background:#fafaf7}.theme-swatch i{position:absolute;inset:0 auto 0 0;width:24%;background:#151318}.theme-swatch b{position:absolute;left:34%;right:12%;top:24%;bottom:24%;border-radius:5px;background:white;border:1px solid #dedce5}.theme-swatch-dark{background:#17171d}.theme-swatch-dark b{background:#2c2b35;border-color:#44424e}.theme-swatch-system{background:linear-gradient(90deg,#fafaf7 50%,#17171d 50%)}.theme-swatch-system b{background:linear-gradient(90deg,#fff 29%,#2c2b35 29%);border-color:#85818d}.appearance-choice input:checked+.theme-swatch{border:2px solid var(--pick-ring)}.appearance-choice input:focus-visible+.theme-swatch{outline:3px solid var(--peri);outline-offset:4px}.appearance-choice input:checked~span:last-child{color:var(--sel-ink);font-weight:var(--sel-weight)}.settings-toggle{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:8px 0 16px}.settings-toggle strong{font-size:13px;font-weight:500}.settings-toggle small{display:block;color:var(--ink-3);font-size:12px;margin-top:4px}.settings-toggle input{width:18px;height:18px;accent-color:var(--accent-button)}.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}

@media(max-width:740px){.settings-layout .form-section{padding:20px 16px}.appearance-options{gap:10px}.theme-swatch{height:65px}}

/* Settings → New chat defaults: Images and Video groups (14 Nov 2026). */
.settings-layout .settings-subhead{font:600 13px var(--ui);color:var(--ink);margin:20px 0 0;letter-spacing:0}
.settings-layout .settings-group{border-top:1px solid var(--hair);margin-top:24px;padding-top:4px}
.settings-layout .settings-note{font-size:12px;line-height:1.5;color:var(--ink-2);background:var(--surface-2);border-radius:8px;padding:9px 12px;margin:12px 0 0}
.settings-layout .video-default-status{min-height:1.6em} /* reserved, so the saved line never pushes the page down */
.settings-layout .video-field-status{margin-top:6px} /* each video choice's own saved line, under its control */
@media(max-width:480px){.settings-layout .two-col{grid-template-columns:1fr;gap:0}}

/* Product detail (14 Nov 2026): one primary "Use this colour" button in the sticky head with its chat state beside it; "Colours in this
   style" as fixed-size photo tiles straight under the photos. Looking never selects; the shown colour and the ones in the chat are marked. */
#product-viewer{overflow-anchor:none} /* the colour swap keeps the clicked colour still itself; the browser's own anchoring would add to it */
.product-dialog-head{flex-wrap:wrap;row-gap:10px}
.product-dialog-head>div:first-child{min-width:0;flex:1 1 260px}
.product-dialog-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:0 0 auto;margin-left:auto}
.product-chat-state{font-size:12px;font-weight:600;color:var(--iris);white-space:nowrap}
.product-chat-state[hidden]{display:none}
#use-shown-colour{min-width:136px}
.product-gallery{align-content:start}
.product-gallery a{aspect-ratio:3/4;overflow:hidden;border-radius:6px;background:var(--paper-2)}
.product-gallery a img{height:100%}
.style-colours{display:grid;grid-template-columns:repeat(auto-fill,minmax(168px,1fr));gap:8px}
.style-colour{display:flex;align-items:center;gap:10px;min-width:0;min-height:72px;padding:6px 10px 6px 6px;text-align:left;border:1px solid var(--hair);border-radius:8px;background:var(--surface);color:var(--ink);font:inherit;cursor:pointer}
.style-colour:hover{background:var(--hover-fill)}
.style-colour:focus-visible{outline:2px solid var(--iris);outline-offset:2px}
.style-colour[aria-current="true"]{border:2px solid var(--pick-ring);padding:5px 9px 5px 5px} /* picture tile: 2px accent border, padding trimmed by 1px so nothing moves */
.style-colour[aria-busy="true"]{cursor:progress;opacity:.7}
.style-colour-photo{flex:0 0 44px;width:44px;height:58px;border-radius:4px;overflow:hidden;background:var(--paper-2);display:block}
.style-colour-photo img,.style-colour-photo .placeholder{display:block;width:100%;height:100%;object-fit:cover;aspect-ratio:auto;padding:0;font-size:8px}
.style-colour-text{display:flex;flex-direction:column;min-width:0;line-height:1.3}
.style-colour-text strong{font-size:12px;font-weight:600;overflow-wrap:anywhere}
.style-colour-text small{font-size:11px;color:var(--ink-3)}
.style-colour .style-colour-chat{display:none;color:var(--iris);font-weight:600}
.style-colour[data-in-chat] .style-colour-chat{display:block}
@media(max-width:740px){.product-dialog-actions{width:100%;justify-content:flex-start;margin-left:0}.style-colours{grid-template-columns:repeat(2,minmax(0,1fr))}#use-shown-colour{flex:1 1 auto}}
/* Cast: create a cast member (15 Nov 2026, client/cast-ui.js). The window is the product dialog; choices are the flat selected family;
   the card state is a status dot. No shadows, no coloured edges. */
.cast-owner-note{margin:-16px 0 20px;font-size:12px;line-height:1.5;color:var(--ink-2)}
.cast-owner-note a{color:var(--iris);font-weight:600}
.cast-card .pill.draft{align-self:flex-start;margin-bottom:4px}
.cast-state{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--ink-2);margin:2px 0 6px}
.cast-state::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--status-info);flex:none}
.cast-state[data-state="ready"]::before{background:var(--status-ok)}
.cast-state[data-state="failed"]::before{background:var(--status-warn)}
.cast-state[data-state="retired"]::before{background:var(--ink-3)}
.cast-placeholder{font-size:12px}
#cast-create{background:var(--paper);color:var(--ink);width:min(880px,94vw);max-height:92vh;overflow:auto}
.cast-create-body{display:grid;gap:12px}
.cast-field-label{font-size:12px;font-weight:600;color:var(--ink-2)}
.cast-text{width:100%;min-height:124px;resize:vertical;font:inherit;font-size:15px;line-height:1.5;padding:12px 14px;box-sizing:border-box}
.cast-name{width:min(320px,100%);box-sizing:border-box}
.cast-help{margin:0;font-size:12px;line-height:1.5;color:var(--ink-3)}
.cast-examples{display:grid;gap:8px}
.cast-example{font:inherit;font-size:13px;line-height:1.45;text-align:left;padding:9px 12px;border:1px solid var(--hair-2);border-radius:8px;background:var(--surface);color:var(--ink-2);cursor:pointer}
.cast-example:hover{background:var(--hover-fill);color:var(--ink)}
.cast-example:focus-visible{outline:3px solid var(--peri);outline-offset:2px}
.cast-wearer{display:flex;flex-wrap:wrap;gap:8px;border:0;padding:0;margin:4px 0 0}
.cast-wearer legend{font-size:12px;font-weight:600;color:var(--ink-2);padding:0;margin-bottom:8px}
.cast-wearer label{position:relative;cursor:pointer}
.cast-wearer input{position:absolute;opacity:0;width:100%;height:100%;margin:0;cursor:pointer}
.cast-wearer span{display:inline-flex;align-items:center;min-height:36px;padding:0 16px;border:1px solid var(--hair-2);border-radius:8px;background:var(--surface);color:var(--ink-2);font-size:13px}
.cast-wearer input:checked+span{background:var(--sel-fill);border-color:var(--sel-line);color:var(--sel-ink);font-weight:var(--sel-weight)}
.cast-wearer input:focus-visible+span{outline:3px solid var(--peri);outline-offset:2px}
.cast-error{margin:0;min-height:1.2em;font-size:13px;line-height:1.5;color:var(--status-error)}
.cast-error:empty{min-height:0}
.cast-slots{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0}
.cast-slot{margin:0;min-width:0}
.cast-slot a{display:block}
.cast-slot img,.cast-slot-wait{display:grid;place-items:center;width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:8px;background:var(--paper-2)}
.cast-slot-wait{align-content:center;justify-items:center;gap:8px;font-size:12px;color:var(--ink-3)}
.cast-slot-wait .workspace-loader-ring{width:18px;height:18px}
.cast-slot figcaption{font-size:12px;color:var(--ink-2);margin-top:6px}
.cast-slots.small{grid-template-columns:repeat(4,minmax(0,96px))}
/* Batch 10b: picking one of the faces. Flat selected state: a full 2px outline in the brand ink plus a quiet fill, no shadow, no
   one-sided edge; the button keeps its size so nothing moves when chosen. */
.cast-slots.cast-faces{grid-template-columns:repeat(4,minmax(0,1fr))}
.cast-face-pick{display:block;width:100%;padding:3px;border:2px solid transparent;border-radius:11px;background:none;cursor:pointer;font:inherit;color:inherit}
.cast-face-pick:hover{border-color:var(--hair)}
.cast-face-pick:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.cast-face-pick[aria-pressed="true"]{border-color:var(--pick-ring);background:var(--sel-fill)}
.cast-face-pick img{border-radius:8px}
@media(max-width:740px){.cast-slots.cast-faces{grid-template-columns:repeat(2,minmax(0,1fr))}}
.cast-look{margin:0;font-size:13px;line-height:1.5;color:var(--ink-2)}
.cast-done{margin:0;font-size:14px;font-weight:600;color:var(--ink)}
.cast-confirm p{margin:0 0 10px;font-size:13px;line-height:1.5;color:var(--ink)}
.cast-review-actions,.cast-confirm .dialog-actions{flex-wrap:wrap}
.cast-earlier summary{cursor:pointer;font-size:12px;color:var(--ink-2)}
.cast-earlier-try{display:grid;gap:8px;margin-top:10px;justify-items:start}
.cast-person-manage{display:flex;gap:8px;margin-right:auto}
@media(max-width:740px){.cast-slots{grid-template-columns:repeat(2,minmax(0,1fr))}.cast-slots.small{grid-template-columns:repeat(4,minmax(0,1fr))}.cast-review-actions .btn{flex:1 1 auto}.cast-owner-note{margin-top:-10px}}
/* The window's confirm row stays in view while the person reads or scrolls (phones: the credits on the button are always visible). */
#cast-create .cast-create-body>.dialog-actions,#cast-create .cast-confirm{position:sticky;bottom:0;z-index:1;background:var(--paper);padding:12px 0 2px;margin-bottom:-2px}
@media(max-width:740px){.cast-example{font-size:13px;padding:8px 10px}.cast-text{min-height:104px}}
.cast-name-row{display:grid;align-content:start;gap:6px;min-height:76px}
/* One size set (16 Nov 2026, Badal: "Why isn't styling constant like a professional company?"). Every page takes its control
   height, spacing and corners from these tokens, and tools/layout-check measures every page against the same numbers on every
   release. Controls: one height for buttons, fields, selects and link-buttons (44 px touch size at phone width); the few kinds that
   are not ordinary controls are named in the :not() list below and in tools/layout-check/rules.js, each with its reason.
   Spacing scale 4 · 8 · 12 · 16 · 20 · 24 · 32 · 40 · 48 · 64: box padding --pad-box (tight boxes --pad-box-tight), gap between
   boxes --gap-box, label to field --gap-label, between rows --gap-row. Corners: --radius-control, --radius-box. */
:root{--control-h:36px;--space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;--space-8:32px;--space-10:40px;--space-12:48px;
 --pad-box:16px;--pad-box-tight:12px;--gap-box:12px;--gap-label:8px;--gap-row:8px;--radius-control:8px;--radius-box:12px;--on-accent:#fff;
 --dock-paper:#151318;--dock-ink-2:#C8C5CE;--backdrop:#15131870}
:root[data-theme="dark"]{--on-accent:#fff}
@media(max-width:767px){:root{--control-h:44px}}
:is(.btn,.input,select,.search,.account-tab,.pb-filter,.auth-primary,.auth-secondary,.auth-input-row button,#new-chat,
 input:is([type=text],[type=email],[type=password],[type=search],[type=number],[type=url],[type=tel],[type=date],[type=month],:not([type]))):not(textarea):not([multiple]):not(:is(
 #composer-plus,.cc-trigger,.composer-tool,#voice-input,#send-message,#latest-reply,.composer-card *,
 #image-editor .editor-zoom *,.chip-remove,.composer-ref button,.selection-chip button,.cast-pick,.cast-example,.message-product,.cc-item,#navigation-backdrop)){
 height:var(--control-h)!important;min-height:var(--control-h)!important;max-height:var(--control-h)!important;padding-top:0!important;padding-bottom:0!important;box-sizing:border-box!important}
/* Boxes moved onto the spacing scale where the original rule is pinned by an older test (the pinned literal stays in style.css). */
.chat-message .message-bubble{padding:var(--space-3) var(--space-4)}
/* One button style per action row (16 Nov 2026): a quiet button beside an outlined one in a tool section is outlined too. */
#image-editor .editor-tool .btn.ghost{background:var(--surface);border-color:var(--line);color:var(--ink)}
@media(max-width:740px){.usage-period{justify-content:flex-start}}
