:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, sans-serif;
  color: #f5edea;
  background: #141218;
  --line: #39303b;
  --surface: #1f1a23;
  --muted: #c7b7c4;
  --accent: #ffcba7;
  --subtle: #efd6c8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, textarea, input { font: inherit; }
button { cursor: pointer; min-height: 44px; }
button:disabled { opacity: .55; cursor: default; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.masthead {
  display: flex; align-items: center; gap: 18px; min-height: 74px;
  border-bottom: 1px solid var(--line); padding: 10px max(20px, calc((100vw - 1192px) / 2));
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 1.22rem; font-weight: 720; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid #5f4646; border-radius: 12px; color: var(--accent); }
.product { border-left: 1px solid var(--line); padding-left: 18px; color: var(--muted); font-size: .82rem; }
.new { margin-left: auto; white-space: nowrap; }
.studio {
  max-width: 1232px; padding: 34px 20px 60px; margin-inline: auto;
  display: grid; grid-template-columns: minmax(258px, 350px) minmax(0, 1fr); gap: clamp(28px, 5vw, 74px); align-items: start;
}
.guide { min-width: 0; }
.portrait { position: relative; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; aspect-ratio: 1 / 1.04; background: #28202c; }
.portrait img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 40%; transition: filter .4s; }
.portrait-shade { position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, #110b17ed); pointer-events: none; }
figcaption { position: absolute; inset: auto 17px 16px; display: flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 650; }
.indicator { width: .6rem; height: .6rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px #ffcba780; }
.wave { margin-left: auto; display: flex; gap: 3px; align-items: center; height: 22px; }
.wave i { display: block; width: 3px; height: 5px; background: var(--accent); border-radius: 9px; opacity: .55; }
.guide:is([data-mode="working"], [data-mode="listening"], [data-mode="speaking"]) .wave i { animation: wave .85s infinite alternate ease-in-out; opacity: .9; }
.guide:is([data-mode="working"], [data-mode="speaking"]) img { animation: drift 6s infinite alternate ease-in-out; }
.guide[data-mode="listening"] img { filter: brightness(1.09); }
.wave i:nth-child(2n) { animation-delay: -.4s !important; }
.wave i:nth-child(3n) { animation-delay: -.6s !important; }
@keyframes wave { to { height: 20px; } }
@keyframes drift { to { transform: scale(1.035); } }
.activity { margin-top: 15px; padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.activity-head, .delivery-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; }
.activity h2, .delivery h2 { margin: 0; font-size: 1.04rem; }
#run-status, #report-status { color: var(--accent); font-size: .82rem; }
.counts { margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.counts strong { display: block; font-size: 1.27rem; }
.counts span, .event-log, .notice { color: var(--muted); font-size: .84rem; }
.event-log { margin: 12px 0 0; padding: 0; list-style: none; }
.event-log:empty { display: none; }
.event-log li { padding: 7px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.conversation { min-width: 0; padding-top: clamp(10px, 4vw, 38px); }
.welcome h1 { margin: 0; font: 500 clamp(2.25rem, 5.3vw, 4.55rem)/1.02 Georgia, serif; letter-spacing: -.038em; }
.welcome p { color: var(--muted); margin: 15px 0 27px; line-height: 1.5; }
.thread { display: grid; gap: 11px; }
.thread:not(:empty) { margin-bottom: 14px; }
.message { margin: 0; padding: 11px 14px; border-radius: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user { justify-self: end; max-width: 91%; background: #413146; }
.message.assistant { justify-self: start; border: 1px solid var(--line); color: var(--subtle); }
.composer { border: 1px solid #57445a; border-radius: 18px; background: var(--surface); padding: 12px; }
.composer textarea { width: 100%; min-height: 72px; resize: vertical; background: transparent; color: inherit; border: 0; padding: 9px; line-height: 1.45; font-size: 1rem; }
.composer textarea::placeholder { color: var(--muted); }
.composer-bar, .delivery-actions, .job-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.composer-bar { padding-top: 8px; }
.composer-bar .primary { margin-left: auto; }
.primary, .quiet, .mic { font-weight: 650; border: 1px solid transparent; padding: 9px 13px; border-radius: 11px; }
.primary { background: var(--accent); color: #25191e; }
.quiet, .mic { background: #241e28; color: var(--subtle); border-color: #59485d; }
.mic { display: grid; place-items: center; width: 44px; padding: 0; }
.mic[aria-pressed="true"] { background: var(--accent); color: #25191e; }
.voice-choice { display: flex; align-items: center; gap: 5px; color: var(--subtle); font-size: .85rem; min-height: 44px; cursor: pointer; }
.voice-choice input { accent-color: var(--accent); }
.notice { line-height: 1.5; min-height: 1.1rem; margin: 10px 0 0; }
.job-controls { margin-top: 14px; }
.delivery { margin-top: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: clamp(13px, 3vw, 24px); }
.delivery-actions { margin: 14px 0; }
#report-preview { font: inherit; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 18px; max-height: 63vh; overflow: auto; padding: 13px; background: #16131a; border-radius: 11px; }
details summary { cursor: pointer; padding-block: 9px; }
details ul { padding-left: 1.3rem; overflow-wrap: anywhere; }
details li { margin-bottom: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 730px) {
  .masthead { min-height: 62px; gap: 10px; padding-inline: 14px; }
  .product { padding-left: 10px; }
  .studio { padding: 15px 14px 38px; grid-template-columns: minmax(0,1fr); gap: 18px; }
  .guide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 9px; }
  .portrait { aspect-ratio: auto; min-height: 157px; border-radius: 15px; }
  .portrait img { position: absolute; }
  figcaption { inset: auto 10px 11px; gap: 6px; }
  .activity { margin: 0; padding: 10px; border-radius: 15px; }
  .activity-head { display: block; }
  .activity h2 { font-size: .88rem; }
  .counts { margin-top: 8px; gap: 4px; }
  .counts strong { font-size: 1.03rem; }
  .counts span { display: block; font-size: .7rem; }
  .event-log { font-size: .72rem; max-height: 104px; overflow: auto; }
  .event-log li { padding: 4px 0; }
  .conversation { padding-top: 0; }
  .desktop { display: none; }
  .welcome p { margin: 9px 0 17px; }
}
@media (max-width: 350px) { .product { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
