.conversation-header { display:flex; align-items:center; justify-content:space-between; gap:24px; margin:32px 0 24px; }
.conversation-header h1 { max-width:none; font-size:clamp(1.9rem, 4vw, 2.5rem) !important; }
.conversation-header p { margin:8px 0 0; }
.local-note { display:flex; align-items:center; gap:8px; font-size:.8rem; white-space:nowrap; color:var(--sushi-muted); }
.local-note > span { width:7px; height:7px; background:#647647; border-radius:50%; }
.header-actions { display:flex; flex-direction:column; align-items:flex-end; gap:7px; flex-shrink:0; }
.download-note { font-size:.65rem; line-height:1.3; color:var(--sushi-muted); }
.conversation-workspace { display:grid; grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr); border:1px solid var(--sushi-line); border-radius:14px; overflow:hidden; }
.companion-stage { position:relative; min-width:0; height:560px; border:0 !important; border-right:1px solid var(--sushi-line) !important; box-shadow:none !important; overflow:hidden; background:var(--sushi-bg) !important; }
.companion-frame { display:block; width:100%; height:100%; border:0; }
.avatar-toolbar { position:absolute; z-index:2; top:18px; left:20px; right:20px; display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:.8rem; }
#companion-name { font-weight:600; }
.zoom-control { display:flex; gap:8px; align-items:center; font-size:.7rem; color:var(--sushi-muted); }
.zoom-control input { width:70px; accent-color:var(--sushi-yellow); }
.avatar-load { position:absolute; inset:70px 20px; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:16px; text-align:center; color:var(--sushi-muted); font-size:.85rem; pointer-events:none; }
.avatar-load button { pointer-events:auto; }
.avatar-caption { position:absolute; bottom:16px; left:16px; right:16px; text-align:center; pointer-events:none; }
.companion-stage-state { display:inline-flex; align-items:center; gap:7px; background:var(--sushi-surface); padding:3px 12px; border-radius:20px; font-size:.75rem; color:var(--sushi-muted); }
.companion-stage-state::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.companion-stage[data-mode="speaking"] .companion-stage-state { color:#526a31 !important; }
.companion-stage[data-mode="listening"] .companion-stage-state { color:#8a5900; }
.companion-line { margin:8px auto 0; padding:8px 12px; max-width:42ch; max-height:100px; overflow:hidden; background:var(--sushi-surface) !important; border:1px solid var(--sushi-line) !important; border-radius:8px; font-size:.85rem; line-height:1.5; }
.companion-line:empty { display:none; }
.conversation-panel { min-width:0; height:560px; display:flex; flex-direction:column; padding:20px; box-sizing:border-box; background:var(--sushi-surface); }
.conversation-topline { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-bottom:14px; border-bottom:1px solid var(--sushi-line); }
.conversation-topline h2, .setup-intro h2 { margin:0; font-size:1rem; line-height:1.4; font-weight:600; }
.chat-utilities { display:flex; gap:4px; flex-wrap:wrap; justify-content:flex-end; }
.chat-utilities button { font-size:.72rem; padding:5px 7px; min-height:32px; }
.transcript { flex:1; min-height:120px; overflow-y:auto; overscroll-behavior:contain; padding:20px 2px; scroll-behavior:smooth; }
.empty-chat { padding:24px 8px; }
.empty-chat h3 { margin:0 0 8px; font-size:1.3rem; line-height:1.35; font-weight:500; }
.empty-chat p { margin:0 0 22px; font-size:.9rem; line-height:1.65; max-width:34ch; }
.prompt { display:flex; justify-content:space-between; align-items:center; gap:20px; width:100%; text-align:left; font-size:.8rem; padding:10px 0; background:transparent !important; border-width:0 0 1px !important; border-radius:0 !important; }
.message { margin:0 0 20px; font-size:.9rem; line-height:1.65; overflow-wrap:anywhere; }
.message-label { display:block; margin-bottom:4px; font-weight:600; font-size:.72rem; color:var(--sushi-muted); }
.message p { color:var(--sushi-ink) !important; white-space:pre-wrap; margin:0; }
.message.user { padding:12px 14px; background:var(--sushi-bg); border-radius:10px; }
.message.interrupted .message-label::after { content:" · interrupted"; font-weight:400; }
.conversation-status { font-size:.75rem; line-height:1.5; min-height:18px; margin:0 0 8px; }
.conversation-error { color:#8e2e24; font-size:.8rem; line-height:1.5; padding:10px 0; }
.composer { border:1px solid var(--sushi-line); border-radius:10px; padding:10px; }
.composer:focus-within { border-color:var(--sushi-yellow); }
.composer textarea { display:block; box-sizing:border-box; width:100%; min-height:50px; max-height:140px; resize:vertical; padding:0 2px 10px; font:inherit; font-size:.9rem; line-height:1.5; border:0 !important; background:transparent !important; box-shadow:none !important; outline:none; }
textarea::placeholder { color:var(--sushi-muted); opacity:1; }
.composer-actions { display:flex; align-items:center; gap:8px; }
button, select { font:inherit; cursor:pointer; }
.composer-actions button, #start-button { min-height:40px; padding:8px 14px; font-size:.8rem; display:inline-flex; align-items:center; justify-content:center; gap:8px; }
#send-button { margin-left:auto; }
button.primary { background:var(--sushi-ink) !important; color:var(--sushi-surface) !important; border-color:var(--sushi-ink) !important; }
button.primary:hover:not(:disabled) { background:#393e32 !important; color:#fff !important; }
button:disabled { opacity:.5; cursor:not-allowed; }
#mic-button[aria-pressed="true"] { border-color:var(--sushi-yellow) !important; color:var(--sushi-yellow) !important; background:var(--sushi-bg) !important; }
.composer-hint { margin:7px 0 0; font-size:.65rem; line-height:1.5; }
.session-setup { margin-top:24px; padding:0 0 20px; border-bottom:1px solid var(--sushi-line); }
.setup-intro { display:flex; align-items:center; justify-content:space-between; gap:24px; }
.setup-intro p { margin:5px 0 0; font-size:.85rem; line-height:1.6; }
#load-status { font-size:.8rem; line-height:1.5; margin:12px 0; overflow-wrap:anywhere; }
#load-progress { width:100%; height:5px; accent-color:var(--sushi-yellow); }
details { border-top:1px solid var(--sushi-line); padding-top:14px; }
summary { cursor:pointer; font-size:.8rem; font-weight:500; width:fit-content; }
.settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:24px; padding-top:20px; }
.settings-grid label:not(.check-setting) { display:block; font-size:.8rem; font-weight:500; margin-bottom:6px; }
.settings-grid select { box-sizing:border-box; width:100%; min-height:42px; border:1px solid var(--sushi-line); border-radius:5px; padding:8px; color:var(--sushi-ink); background:var(--sushi-surface); font-size:.85rem; }
.setting-note { font-size:.75rem; line-height:1.6; margin:6px 0 0; }
.check-setting { display:flex; align-items:center; gap:8px; font-size:.8rem; margin-top:8px; }
.check-setting input { accent-color:var(--sushi-yellow); }
.conversation-footer { display:flex; justify-content:space-between; gap:24px; padding-top:16px; font-size:.75rem; line-height:1.7; }
.conversation-footer p { max-width:70ch; margin:0; }
.conversation-footer a { flex-shrink:0; }
.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; }
[hidden] { display:none !important; }
:focus-visible { outline:2px solid var(--sushi-yellow); outline-offset:4px; }
@media (max-width:700px) {
  .conversation-header { display:block; margin-top:24px; }
  .local-note { margin-top:12px; }
  .header-actions { display:grid; grid-template-columns:1fr auto; align-items:center; margin-top:14px; }
  .header-actions .local-note { margin:0; font-size:.7rem; }
  .download-note { grid-column:1 / -1; text-align:right; }
  .conversation-workspace { grid-template-columns:1fr; }
  .companion-stage { height:320px; border-right:0 !important; border-bottom:1px solid var(--sushi-line) !important; }
  .conversation-panel { height:490px; padding:14px; }
  .avatar-toolbar { top:12px; left:14px; right:14px; }
  .avatar-caption { bottom:10px; }
  .empty-chat { padding:12px 4px; }
  .empty-chat p { margin-bottom:12px; }
  .setup-intro { flex-direction:column; align-items:stretch; gap:12px; }
  .settings-grid { grid-template-columns:1fr; gap:18px; }
  .conversation-footer { flex-direction:column; gap:12px; }
}
@media (prefers-reduced-motion:reduce) { .transcript { scroll-behavior:auto; } }
/* Memory uses the existing history dialog and plain, editable controls. */
.memory-dialog { max-width: 38rem; }
.memory-dialog > label:not(.check-setting) { display: block; margin-top: 1rem; margin-bottom: .4rem; font-weight: 600; }
.memory-dialog > select, .memory-dialog > textarea { box-sizing: border-box; width: 100%; font: inherit; padding: .65rem; border: 1px solid var(--border, #ccc); border-radius: .5rem; color: inherit; background: transparent; }
.memory-dialog > .check-setting { margin-top: 1.2rem; }
.memory-dialog .setting-note { line-height: 1.5; }
.memory-dialog [data-memory-count], .memory-dialog [data-memory-save] { font-size: .85rem; }
.memory-dialog button { padding: .6rem .8rem; border-radius: .45rem; font: inherit; font-size: .85rem; cursor: pointer; }
.memory-dialog pre, .memory-dialog blockquote { white-space: pre-wrap; overflow-wrap: anywhere; }
#gemma-file-options { margin-block: 1rem; }
#gemma-file-options > label { display: block; margin-block: .75rem .4rem; }
#gemma-file { max-width: 100%; font: inherit; }
