.ceres-chat-drawer { margin:18px 0; padding:12px 15px; border:1px solid var(--border,#424341); border-radius:6px; color:var(--primary,#eeeee7); }
.ceres-chat-drawer > summary { min-height:36px; padding:6px 0; font-weight:550; cursor:pointer; }
.ceres-chat-drawer[open] > summary { border-bottom:1px solid var(--border,#424341); margin-bottom:12px; }
.ceres-chat-filters,.ceres-chat-compose { display:flex; align-items:end; gap:10px; flex-wrap:wrap; }
.ceres-chat-filters label,.ceres-chat-compose label { display:grid; gap:5px; min-width:0; font-size:13px; color:var(--quiet,#c1c1b9); }
.ceres-chat-filters label { flex:1 1 180px; }
.ceres-thread { min-width:0; margin-top:12px; }
.ceres-chat-quiet,.ceres-chat-status { margin:8px 0; color:var(--quiet,#c1c1b9); font-size:13px; }
.ceres-chat-status:empty { display:none; }
.ceres-chat-history { padding:0; margin:10px 0 16px; list-style:none; overflow-y:auto; max-height:360px; overscroll-behavior:contain; }
.ceres-chat-history:empty { display:none; }
.ceres-chat-entry { border-top:1px solid var(--border,#424341); padding:11px 2px; }
.ceres-chat-byline { display:flex; gap:8px; align-items:baseline; flex-wrap:wrap; font-size:12px; }
.ceres-chat-byline strong { font-size:14px; color:var(--primary,#eeeee7); }
.ceres-chat-byline span,.ceres-chat-byline time { color:var(--quiet,#c1c1b9); }
.ceres-chat-entry p { margin:4px 0 0; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.ceres-chat-compose label:first-child { flex:1 1 100px; max-width:210px; }
.ceres-chat-compose label:nth-child(2) { flex:3 1 220px; }
.ceres-chat-compose textarea { resize:vertical; min-height:48px; max-height:220px; }
.ceres-chat-identity { display:inline-block; padding:4px 0; margin:4px 0; }
.ceres-chat-identity + .ceres-chat-compose > label:first-child { flex:1 1 220px; max-width:100%; }
.ceres-account { min-height:100vh; display:grid; place-items:center; padding:22px; }
.ceres-account main { width:min(100%,410px); }
.ceres-account h1 { font-size:clamp(1.6rem,5vw,2.3rem); margin:16px 0; }
.ceres-account #account-status { line-height:1.55; margin-bottom:24px; }
.ceres-account .button,.ceres-account .text-button { margin:5px 8px 5px 0; }
.ceres-account [hidden] { display:none!important; }
.ceres-chat-compose :is(input,textarea,select),.ceres-chat-filters select { width:100%; }
.ceres-thread [hidden],.ceres-chat-drawer[hidden] { display:none!important; }
.ceres-chat-review { max-width:min(1080px,95%); margin:18px auto 32px; }
.ceres-chat-files { flex:1 1 100%; width:100%; min-width:0; }
.ceres-chat-files summary { width:fit-content; min-height:36px; padding:8px 0; cursor:pointer; }
.ceres-chat-files fieldset { padding:4px 0; margin:0; min-width:0; border:0; display:grid; gap:10px; }
.ceres-chat-files label,.ceres-chat-files label:first-child { max-width:100%; }
.ceres-chat-files input[type=file] { padding:8px 0; }
.ceres-chat-files button,.ceres-chat-file-link { width:fit-content; min-height:36px; text-align:left; overflow-wrap:anywhere; }
.ceres-chat-file-link { display:block; text-decoration:underline; text-underline-offset:3px; }
.ceres-chat-asset { display:flex; flex-wrap:wrap; align-items:center; column-gap:12px; }
.ceres-chat-asset a { display:inline-flex; align-items:center; min-height:36px; font-size:12px; color:var(--quiet,#c1c1b9); }
.ceres-chat-choices { padding:0; margin:4px 0; list-style:none; }
.ceres-chat-choices:empty,.ceres-chat-files p:empty { display:none; }
.ceres-chat-choices > li { margin-top:4px; padding:6px 0; overflow-wrap:anywhere; border-top:1px solid var(--border,#424341); }
.ceres-chat-choices .ceres-chat-quiet { margin:2px 0; }
.ceres-chat-pending { display:grid; gap:5px; }
.ceres-chat-pending progress { width:min(100%,340px); accent-color:var(--primary,#eeeee7); }
.ceres-chat-pending .ceres-chat-file-error { color:#efa996; }

/* The engraved controls and the inset transcript have different materials.
   The transcript itself stays flat for long, selectable production notes. */
.ceres-thread {
  color:#e4e6de; padding:clamp(11px,2vw,20px); border:1px solid #474942; border-radius:4px;
  background:linear-gradient(167deg,#21231f,#171916 65%);
  box-shadow:inset 0 1px #b1b1a020,0 1px 2px #0005;
}
.ceres-thread .ceres-chat-history {
  background:#101411; border:1px solid #070908; border-radius:3px; margin:4px 0 12px;
  box-shadow:0 1px #81837640,inset 0 2px 6px #0007; scrollbar-color:#565a50 #141614;
}
.ceres-chat-history .ceres-chat-entry { padding:13px clamp(10px,1.8vw,22px); border:0; }
.ceres-chat-history .ceres-chat-entry + .ceres-chat-entry { border-top:1px solid #32362e; }
.ceres-chat-entry .ceres-chat-byline { gap:3px 9px; font:11px/1.45 var(--mono,monospace); }
.ceres-chat-byline::before { content:""; width:9px; height:3px; align-self:center; border-radius:1px; background:#dbdec9; }
.ceres-chat-entry[data-author-role="guest"] .ceres-chat-byline::before { background:#b88c81; }
.ceres-chat-entry .ceres-chat-byline strong { color:#eef0de; font-size:12px; font-weight:650; }
.ceres-chat-byline span { color:#abb09f; }
.ceres-chat-byline time { margin-inline-start:auto; color:#b3b8a9; font-variant-numeric:tabular-nums; }
.ceres-chat-history .ceres-chat-entry p { margin:7px 0 0; max-width:76ch; font:15px/1.56 var(--sans,system-ui); color:#e2e4dc; }
.ceres-thread :is(.ceres-chat-compose label,.ceres-chat-identity),.ceres-chat-filters > label {
  color:#cecec0; font:600 11px/1.4 var(--mono,monospace); letter-spacing:.025em; text-shadow:0 -1px #050605;
}
.ceres-thread .ceres-chat-compose :is(input,textarea,select),.ceres-chat-filters select {
  border:1px solid #4b5046; border-radius:3px; background:#101410; color:#f0f0e5;
  box-shadow:inset 0 2px 4px #0006; font:15px/1.45 var(--sans,system-ui); text-shadow:none;
}
.ceres-thread .ceres-chat-compose .button.primary {
  min-height:42px; color:#1e211a; border:1px solid #bcbdab; border-radius:3px;
  background:linear-gradient(#e9eadb,#cacdbc); box-shadow:inset 0 1px #fff8,0 1px 2px #000;
}
.ceres-chat-compose .button.primary:active:enabled { box-shadow:inset 0 2px 3px #62645777; }
.ceres-thread .ceres-chat-file-link { text-underline-offset:4px; color:#e5e8d4; }
@media(max-width:420px) {
  .ceres-chat-history .ceres-chat-entry { padding:10px 9px; }
  .ceres-chat-byline time { width:100%; margin:0 0 0 18px; font-size:10px; }
  .ceres-chat-history .ceres-chat-entry p { font-size:14px; }
}
@media(forced-colors:active) {
  .ceres-thread,.ceres-thread .ceres-chat-history,.ceres-thread .ceres-chat-compose :is(button,input,textarea) { box-shadow:none; border-color:CanvasText; }
  .ceres-chat-entry .ceres-chat-byline,.ceres-thread label { text-shadow:none; }
}
@media (max-width:620px) {
  .ceres-chat-compose { display:grid; grid-template-columns:minmax(0,1fr); }
  .ceres-chat-compose label:first-child { max-width:none; }
  .ceres-chat-compose button { justify-self:start; }
  .ceres-chat-compose .field,.ceres-chat-filters .field { font-size:16px; }
}
.staff .ceres-chat-filters { align-items:center; gap:10px 16px; }
.staff .ceres-chat-filters > label { flex:0 1 360px; }
.staff .ceres-chat-audience { color:var(--quiet); font-size:12px; }
.staff .ceres-internal-thread { margin-top:8px; padding:0; border:0; border-radius:0; background:none; box-shadow:none; }
.staff .ceres-internal-thread .ceres-chat-history { background:none; border:0; border-radius:0; box-shadow:none; margin:4px 0 10px; }
.staff .ceres-internal-thread .ceres-chat-entry { padding:10px 2px; }
.staff .ceres-internal-thread .ceres-chat-entry + .ceres-chat-entry { border-top:1px solid var(--line); }
.staff .ceres-internal-thread .ceres-chat-byline::before { display:none; }
.staff .ceres-internal-thread .ceres-chat-byline strong { overflow-wrap:anywhere; }
.staff .ceres-internal-thread .ceres-chat-byline time { width:auto; margin:0 0 0 auto; font-size:11px; }
.staff .ceres-internal-thread .ceres-chat-entry p { margin:3px 0 0; }
.staff .ceres-internal-thread .ceres-chat-compose {
  display:grid; grid-template-columns:minmax(0,1fr) auto auto;
  grid-template-areas:'entry entry entry' 'name files send';
  align-items:center; gap:3px 12px; padding:8px 10px 5px;
  border:1px solid #474b42; border-radius:5px; background:#141615;
}
.staff .ceres-internal-thread .ceres-chat-compose:focus-within { border-color:#8f9685; }
.staff .ceres-internal-thread .ceres-chat-compose:has(.ceres-chat-files[open]) {
  grid-template-areas:'entry entry entry' 'files files files' 'name . send';
}
.staff .ceres-internal-thread .ceres-chat-compose > label:first-child { grid-area:entry; width:100%; max-width:none; }
.staff .ceres-internal-thread .ceres-chat-compose textarea { width:100%; min-height:50px; border:0; padding:4px 2px; background:transparent; box-shadow:none; }
.staff .ceres-internal-thread .ceres-chat-identity { grid-area:name; justify-self:start; display:block; min-width:0; max-width:100%;
  margin:0; padding:6px 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-decoration:none; color:var(--quiet); }
.staff .ceres-internal-thread .ceres-chat-identity:hover { text-decoration:underline; }
.staff .ceres-internal-thread .ceres-chat-files { grid-area:files; width:auto; min-width:0; }
.staff .ceres-internal-thread .ceres-chat-files > summary { display:list-item; color:var(--quiet); font-size:13px; white-space:nowrap; }
.staff .ceres-internal-thread .ceres-chat-files[open] { padding-block:4px 8px; border-block:1px solid var(--line); }
.staff .ceres-internal-thread .ceres-chat-compose > button { grid-area:send; justify-self:end; min-height:36px; padding:6px 12px; }
.staff .ceres-internal-thread .ceres-chat-compose > button:disabled { background:#272a25; color:#b3b5ab; border-color:#383c33; box-shadow:none; }
@media(max-width:620px) {
  .staff .ceres-chat-filters > label { flex-basis:100%; }
  .staff .ceres-internal-thread .ceres-chat-compose { padding:6px 7px 3px; gap:2px 6px; }
  .staff .ceres-internal-thread .ceres-chat-compose :is(.ceres-chat-identity,.ceres-chat-files > summary,button) { min-height:44px; align-content:center; }
  .staff .ceres-internal-thread .ceres-chat-compose textarea { font-size:16px; }
}

/* A single glass surface contains a conversation, including its empty state. */
:is(.staff,.review) :is(.comms-screen,.dash-card.comms-screen) {
  --comms-mark:#b2bfae;
  --comms-ink:#e0e5df;
  --comms-soft:#afb9b1;
  --comms-rule:#38413c;
  --comms-rim:clamp(5px,.6vw,8px);
  --comms-inset:clamp(11px,1.8vw,23px);
  position:relative; isolation:isolate; min-width:0; max-width:100%;
  margin:8px 0 0; padding:var(--comms-inset);
  color:var(--comms-ink); color-scheme:dark;
  border:var(--comms-rim) solid #343935; border-radius:5px;
  border-image:url("/assets/deck-glass-bezel.webp") 22 / var(--comms-rim) stretch;
  background:
    linear-gradient(154deg,#61716a16 0%,transparent 42%),
    radial-gradient(ellipse at 38% 0%,#1e2924 0%,#161d19 51%,#111613 100%);
  box-shadow:inset 0 1px 5px #080c09ae,0 1px 0 #7b807934;
  overflow-wrap:anywhere;
}
:is(.staff,.review) .comms-screen[data-comms-context=client] { --comms-mark:#c9bba2; }
:is(.staff,.review) .comms-screen[data-comms-context=inbox] { --comms-mark:#a8b7c0; }
:is(.staff,.review) .comms-screen::before {
  content:""; position:absolute; inset:0; z-index:-1; pointer-events:none; border-radius:inherit;
  background:repeating-linear-gradient(0deg,transparent 0 3px,#080d0a11 3px 4px);
  opacity:var(--glass-light,.9);
}
:is(.staff,.review) .comms-screen .comms-screen-heading {
  display:flex; align-items:center; gap:9px; margin:0 0 8px; padding:1px 0 10px;
  color:var(--comms-soft); border-bottom:1px solid var(--comms-rule);
  font:570 12px/1.4 var(--mono,monospace); letter-spacing:.025em; text-transform:none;
}
.comms-screen .comms-screen-heading::before {
  content:""; width:5px; height:5px; flex:none; border-radius:50%;
  background:var(--comms-mark); box-shadow:0 0 3px #a0b29c21;
}
:is(.staff,.review) .comms-screen .ceres-thread {
  width:100%; min-width:0; margin:0; padding:0; border:0; background:none; box-shadow:none;
}
:is(.staff,.review) .comms-screen .ceres-thread .comms-scroll {
  margin:0; padding:0; min-height:0; max-height:min(40svh,340px);
  color:var(--comms-ink); background:transparent; border:0; border-radius:0; box-shadow:none;
  scrollbar-color:#647069 #18201b; overscroll-behavior-y:contain;
}
:is(.staff,.review) .comms-screen .comms-scroll:focus-visible { outline:1.5px solid var(--comms-mark); outline-offset:2px; }
:is(.staff,.review) .comms-screen .ceres-chat-entry { padding:12px 3px; }
:is(.staff,.review) .comms-screen .ceres-chat-entry+.ceres-chat-entry { border-top:1px solid var(--comms-rule); }
:is(.staff,.review) .comms-screen .ceres-chat-entry p { color:var(--comms-ink); max-width:76ch; font:400 15px/1.55 var(--sans,system-ui,sans-serif); }
:is(.staff,.review) .comms-screen .ceres-chat-byline { align-items:baseline; gap:2px 9px; }
:is(.staff,.review) .comms-screen .ceres-chat-byline::before { display:none; }
:is(.staff,.review) .comms-screen .ceres-chat-byline :is(time,span) { width:auto; margin:0; color:var(--comms-soft); font:400 11px/1.4 var(--mono,monospace); }
:is(.staff,.review) .comms-screen .ceres-chat-byline time { margin-inline-start:auto; }
:is(.staff,.review) .comms-screen .ceres-chat-byline strong { color:var(--comms-ink); }
:is(.staff,.review) .comms-screen .ceres-chat-quiet,
:is(.staff,.review) .comms-screen .ceres-chat-status { color:var(--comms-soft); line-height:1.5; }
:is(.staff,.review) .comms-screen .ceres-thread > .ceres-chat-quiet { margin:0; padding:16px 3px 22px; }
:is(.staff,.review) .comms-screen .ceres-thread .comms-composer {
  margin-top:5px; padding:12px 0 1px;
  background:none; border:0; border-top:1px solid var(--comms-rule); border-radius:0; box-shadow:none;
}
:is(.staff,.review) .comms-screen .comms-composer label { color:var(--comms-soft); }
:is(.staff,.review) .comms-screen .comms-composer :is(textarea,input.field,select.field) {
  min-width:0; color:var(--comms-ink); background:#101713; border:1px solid #48544a;
  border-radius:3px; box-shadow:inset 0 1px 3px #080c09a6;
}
:is(.staff,.review) .comms-screen .comms-composer textarea { min-height:54px; padding:9px 11px; }
:is(.staff,.review) .comms-screen .comms-composer textarea::placeholder { color:#aab5ac; }
:is(.staff,.review) .comms-screen .comms-composer :is(textarea,input.field,select.field):focus-visible {
  outline:1.5px solid #c5d5c8; outline-offset:1px; border-color:#86958a;
}
.staff .comms-screen .ceres-chat-files { text-align:start; }
.staff .comms-screen .ceres-chat-files summary { max-width:100%; overflow-wrap:anywhere; }
.staff .comms-screen .ceres-chat-identity { color:var(--comms-soft); }
.staff .comms-screen .ceres-chat-compose [type=submit] { min-height:40px; }
.staff .cockpit .dash-card.comms-screen { padding:var(--comms-inset); }
.staff .comms-screen[data-comms-context=inbox] .dash-card-head { margin-bottom:0; align-items:baseline; }
.staff .comms-screen[data-comms-context=inbox] .comms-screen-heading { flex:auto; }
.staff .comms-screen[data-comms-context=inbox] .dash-source-items { max-height:min(40svh,340px); overflow-y:auto; overscroll-behavior:contain; }
.staff .comms-screen[data-comms-context=inbox] .dash-source-items li { border-color:var(--comms-rule); }
html[data-screen-effects=off] .comms-screen::before { display:none; }
@media(max-width:620px) {
  :is(.staff,.review) :is(.comms-screen,.dash-card.comms-screen) { --comms-inset:10px; }
  :is(.staff,.review) .comms-screen .comms-composer :is(textarea,input.field,select.field) { font-size:16px; }
  .staff .comms-screen .ceres-chat-compose [type=submit] { min-height:44px; }
  .staff .comms-screen .ceres-internal-thread .comms-composer { grid-template-columns:minmax(0,1fr) auto; grid-template-areas:'entry entry' 'name send' 'files files'; }
  .staff .comms-screen .ceres-internal-thread .comms-composer:has(.ceres-chat-files[open]) { grid-template-areas:'entry entry' 'files files' 'name send'; }
}
@media(forced-colors:active) {
  :is(.staff,.review) :is(.comms-screen,.dash-card.comms-screen) { border:1px solid CanvasText; border-image:none; background:Canvas; color:CanvasText; box-shadow:none; }
  .comms-screen::before,.comms-screen .comms-screen-heading::before { display:none; }
  :is(.staff,.review) .comms-screen .comms-composer :is(textarea,input.field,select.field) { color:FieldText; border:1px solid FieldText; background:Field; }
}
