:root {
    --bg: #090a0c;
    --bg-elevated: #0d0f12;
    --surface: #111318;
    --surface-2: #16191f;
    --surface-3: #1b1f26;
    --surface-soft: rgba(255,255,255,.035);
    --text: #f3f0e9;
    --text-soft: #c7c3ba;
    --muted: #92969f;
    --muted-2: #6e737c;
    --gold: #c6a25b;
    --gold-bright: #dfc27e;
    --gold-soft: rgba(198,162,91,.13);
    --border: rgba(255,255,255,.085);
    --border-strong: rgba(255,255,255,.14);
    --border-gold: rgba(198,162,91,.30);
    --danger: #d87676;
    --success: #6fbd93;
    --shadow-1: 0 12px 34px rgba(0,0,0,.28);
    --shadow-2: 0 24px 70px rgba(0,0,0,.42);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --header-h: 68px;
    --focus: 0 0 0 3px rgba(223,194,126,.20);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% -10%, rgba(198,162,91,.055), transparent 26rem),
        linear-gradient(180deg, #0a0b0d 0%, #090a0c 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button, a, select, input, textarea { outline: none; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
    box-shadow: var(--focus);
}
a { color: inherit; text-decoration: none; }

.app-header {
    height: var(--header-h);
    padding: 0 28px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    background: rgba(9,10,12,.86);
    backdrop-filter: blur(18px) saturate(130%);
}

.brand { display: inline-flex; align-items: center; gap: 9px; width: fit-content; }
.brand-mark {
    width: 30px; height: 30px; display: grid; place-items: center;
    border: 1px solid var(--border-gold); border-radius: 9px;
    color: var(--gold-bright); font-family: Georgia, serif; font-size: 18px;
    background: linear-gradient(145deg, rgba(198,162,91,.11), rgba(255,255,255,.015));
}
.brand-word { font-size: 13px; font-weight: 800; letter-spacing: .18em; }
.brand-dot { width: 4px; height: 4px; border-radius: 999px; background: var(--gold); margin-left: -4px; margin-top: -14px; }

.main-nav {
    height: 100%; display: flex; align-items: center; gap: 6px;
}
.nav-link {
    height: 38px; padding: 0 15px; display: flex; align-items: center;
    color: var(--muted); font-size: 13px; font-weight: 650; border-radius: 10px;
    transition: color .16s ease, background .16s ease;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.045); }
.nav-link.is-active { color: var(--text); background: rgba(255,255,255,.06); }
.nav-link.is-active::after {
    content: ""; width: 14px; height: 1px; position: absolute; margin-top: 40px; background: var(--gold);
}
.header-status { justify-self: end; display: flex; gap: 8px; align-items: center; color: var(--muted-2); font-size: 12px; }
.status-pulse { width: 7px; height: 7px; border-radius: 999px; background: var(--success); box-shadow: 0 0 0 4px rgba(111,189,147,.08); }

.app-main { min-height: calc(100vh - var(--header-h)); }
.eyebrow { color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .18em; }

.btn {
    min-height: 40px; border-radius: 10px; border: 1px solid transparent;
    padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    cursor: pointer; font-weight: 700; font-size: 13px; transition: .16s ease;
}
.btn-primary { color: #12100c; background: linear-gradient(180deg, #dec079, #c9a55e); border-color: #e4c983; }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-secondary { color: var(--text-soft); background: rgba(255,255,255,.04); border-color: var(--border); }
.btn-secondary:hover { color: var(--text); border-color: var(--border-strong); background: rgba(255,255,255,.065); }
.btn-ghost { color: var(--muted); background: transparent; border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.04); }
.btn-danger-quiet { color: #e59a9a; background: rgba(216,118,118,.06); border-color: rgba(216,118,118,.18); }
.btn-danger-quiet:hover { background: rgba(216,118,118,.11); }
.btn-icon { font-size: 18px; line-height: 1; }
.count-badge {
    min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center;
    background: var(--gold-soft); color: var(--gold-bright); font-size: 11px; border: 1px solid var(--border-gold);
}

.select-wrap { position: relative; }
.select-wrap::after { content: "⌄"; position: absolute; right: 13px; top: 50%; transform: translateY(-56%); color: var(--muted); pointer-events: none; }
.select-control {
    appearance: none; width: 100%; min-height: 42px; padding: 0 36px 0 13px;
    color: var(--text); background: #111318; border: 1px solid var(--border); border-radius: 10px;
    cursor: pointer;
}
.select-control:hover { border-color: var(--border-strong); }
.select-wrap-lg { width: min(560px, 46vw); }
.select-compact { width: 68px; min-height: 36px; padding-left: 10px; }

.chat-page { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 18px 0 26px; }
.persona-toolbar {
    min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
    padding: 12px 14px 12px 18px; background: rgba(17,19,24,.78); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-1); position: sticky; top: calc(var(--header-h) + 12px); z-index: 50;
    backdrop-filter: blur(14px);
}
.toolbar-primary { display: flex; align-items: center; gap: 12px; min-width: 0; }
.field-label { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.participant-picker { position: relative; }
.popover {
    position: absolute; right: 0; top: calc(100% + 10px); width: 390px; max-height: 460px; overflow: hidden;
    background: #121419; border: 1px solid var(--border-strong); border-radius: 15px; box-shadow: var(--shadow-2); z-index: 80;
}
.popover-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--border); }
.popover-head strong { display: block; font-size: 14px; }
.popover-head span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.persona-check-list { padding: 7px; overflow-y: auto; max-height: 380px; }
.persona-check { display: grid; grid-template-columns: 18px 34px 1fr; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; cursor: pointer; }
.persona-check:hover { background: rgba(255,255,255,.04); }
.persona-check input { accent-color: var(--gold); }
.mini-avatar, .thinking-avatar, .persona-list-avatar {
    display: grid; place-items: center; border: 1px solid var(--border-gold); color: var(--gold-bright);
    background: var(--gold-soft); font-family: Georgia, serif;
}
.mini-avatar { width: 34px; height: 34px; border-radius: 9px; }
.persona-check-copy { min-width: 0; }
.persona-check-copy strong { display: block; font-size: 13px; }
.persona-check-copy small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.switch-control { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 7px; border-radius: 10px; }
.switch-control:hover { background: rgba(255,255,255,.03); }
.switch-control input, .toggle-card input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui {
    width: 36px; height: 20px; border-radius: 999px; background: #252932; border: 1px solid var(--border-strong);
    position: relative; flex: 0 0 auto; transition: .18s ease;
}
.switch-ui::after {
    content: ""; width: 14px; height: 14px; position: absolute; top: 2px; left: 2px; border-radius: 999px;
    background: #a8adb5; transition: .18s ease;
}
.switch-control input:checked + .switch-ui, .toggle-card input:checked + .switch-ui { background: rgba(198,162,91,.24); border-color: var(--border-gold); }
.switch-control input:checked + .switch-ui::after, .toggle-card input:checked + .switch-ui::after { left: 18px; background: var(--gold-bright); }
.switch-copy { line-height: 1.1; }
.switch-copy strong { display: block; font-size: 12px; }
.switch-copy small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 10px; }
.round-control { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }

.conversation-shell {
    min-height: calc(100vh - var(--header-h) - 122px); margin-top: 14px;
    border: 1px solid var(--border); border-radius: var(--radius-xl); background: rgba(13,15,18,.72); box-shadow: 0 30px 90px rgba(0,0,0,.18);
    display: flex; flex-direction: column; overflow: clip;
}
.conversation-topline {
    min-height: 54px; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border); background: rgba(255,255,255,.014);
}
.session-label { display: flex; align-items: baseline; gap: 10px; }
.session-label strong { font-size: 13px; font-weight: 650; color: var(--text-soft); }
.conversation-tools { display: flex; align-items: center; gap: 10px; }
.call-estimate { color: var(--muted-2); font-size: 11px; }
.icon-button {
    width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid transparent;
    color: var(--muted); background: transparent; cursor: pointer; transition: .15s ease;
}
.icon-button:hover { color: var(--text); border-color: var(--border); background: rgba(255,255,255,.035); }

.chat-feed {
    flex: 1; min-height: 420px; max-height: calc(100vh - 330px); overflow-y: auto; scroll-behavior: smooth;
    padding: 34px clamp(18px, 5vw, 72px) 28px;
}
.empty-state { width: min(760px, 100%); margin: clamp(20px, 6vh, 70px) auto 0; text-align: center; }
.empty-emblem {
    width: 54px; height: 54px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 16px;
    font-family: Georgia, serif; font-size: 25px; color: var(--gold-bright); border: 1px solid var(--border-gold);
    background: linear-gradient(145deg, rgba(198,162,91,.12), rgba(255,255,255,.02)); box-shadow: 0 18px 40px rgba(0,0,0,.22);
}
.empty-state h1 { margin: 8px 0 10px; font-size: clamp(28px, 4vw, 43px); line-height: 1.06; letter-spacing: -.035em; font-weight: 650; }
.empty-state > p { margin: 0 auto; max-width: 590px; color: var(--muted); font-size: 14px; }
.prompt-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: left; }
.prompt-card {
    min-height: 120px; padding: 15px; border: 1px solid var(--border); border-radius: 14px; color: var(--text-soft);
    background: rgba(255,255,255,.025); cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.prompt-card:hover { transform: translateY(-2px); border-color: var(--border-gold); background: rgba(198,162,91,.045); }
.prompt-card > span { display: block; margin-bottom: 22px; color: var(--gold); font-size: 10px; letter-spacing: .12em; }
.prompt-card strong { display: block; color: var(--text); font-size: 13px; }
.prompt-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }

.message-row { width: min(920px, 100%); margin: 0 auto 24px; display: flex; gap: 12px; }
.message-row.user { justify-content: flex-end; }
.message-avatar {
    width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px;
    color: var(--gold-bright); background: var(--gold-soft); border: 1px solid var(--border-gold); font-family: Georgia, serif;
}
.message-wrap { min-width: 0; max-width: min(760px, 86%); }
.message-row.user .message-wrap { max-width: min(680px, 82%); }
.message-meta { min-height: 24px; display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.message-meta strong { font-size: 12px; }
.message-meta span { color: var(--muted-2); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message-bubble {
    padding: 15px 17px; border: 1px solid var(--border); border-radius: 5px 15px 15px 15px;
    background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.018)); color: #dedbd4;
    font-size: 14px; line-height: 1.66; overflow-wrap: anywhere;
}
.message-row.user .message-bubble {
    color: #ece9e3; background: #1b1e24; border-color: rgba(255,255,255,.10); border-radius: 15px 5px 15px 15px;
}
.message-bubble p { margin: 0 0 10px; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble pre { overflow-x: auto; padding: 12px; border-radius: 10px; background: #0a0b0e; border: 1px solid var(--border); color: #ddd8ce; }
.message-bubble code { font-family: "Cascadia Code", Consolas, monospace; font-size: .92em; color: #ead7ad; }
.message-bubble ul { padding-left: 20px; }
.message-copy-button {
    margin-top: 6px; padding: 3px 6px; border: 0; background: transparent; color: var(--muted-2); cursor: pointer; font-size: 10px;
}
.message-copy-button:hover { color: var(--text-soft); }
.round-divider { width: min(920px, 100%); margin: 4px auto 20px; display: flex; align-items: center; gap: 10px; color: var(--muted-2); font-size: 10px; letter-spacing: .12em; }
.round-divider::before, .round-divider::after { content: ""; height: 1px; background: var(--border); flex: 1; }

.thinking-strip {
    margin: 0 clamp(18px, 5vw, 72px) 10px; min-height: 50px; padding: 8px 12px; align-items: center; gap: 10px;
    border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.024);
}
.thinking-strip:not([hidden]) { display: flex; }
.thinking-avatar { width: 32px; height: 32px; border-radius: 9px; }
.thinking-strip strong { display: block; font-size: 12px; }
.thinking-strip span { display: block; color: var(--muted); font-size: 10px; }
.thinking-dots { display: flex; gap: 4px; margin-left: auto; padding-right: 6px; }
.thinking-dots i { width: 5px; height: 5px; border-radius: 999px; background: var(--gold); opacity: .25; animation: think 1.15s infinite ease-in-out; }
.thinking-dots i:nth-child(2) { animation-delay: .15s; }
.thinking-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes think { 0%, 70%, 100% { opacity: .22; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }

.composer-wrap { padding: 0 clamp(14px, 4vw, 54px) 22px; background: linear-gradient(180deg, rgba(13,15,18,0), rgba(13,15,18,.98) 22%); }
.selected-participants { min-height: 24px; margin: 0 5px 7px; display: flex; flex-wrap: wrap; gap: 6px; }
.participant-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 23px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,.025); color: var(--muted); font-size: 10px; }
.participant-chip.primary { color: var(--gold-bright); border-color: var(--border-gold); background: var(--gold-soft); }
.composer {
    border: 1px solid var(--border-strong); border-radius: 17px; background: #15181e; box-shadow: 0 18px 46px rgba(0,0,0,.22);
    transition: border-color .16s ease, box-shadow .16s ease;
}
.composer:focus-within { border-color: var(--border-gold); box-shadow: 0 18px 46px rgba(0,0,0,.22), 0 0 0 3px rgba(198,162,91,.05); }
.composer textarea {
    width: 100%; max-height: 180px; resize: none; border: 0; padding: 15px 16px 8px; color: var(--text); background: transparent;
    line-height: 1.55; font-size: 14px;
}
.composer textarea::placeholder { color: #696e76; }
.composer-footer { min-height: 48px; padding: 5px 7px 7px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composer-hint { color: var(--muted-2); font-size: 10px; }
.composer-actions { display: flex; gap: 5px; align-items: center; }
.send-button {
    min-width: 96px; height: 38px; border: 1px solid #d6b670; border-radius: 11px; background: linear-gradient(180deg, #d8b970, #bf9951);
    color: #17130d; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
    transition: .16s ease;
}
.send-button:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.send-button:disabled { opacity: .45; cursor: not-allowed; }
.send-arrow { font-size: 18px; line-height: 1; margin-top: -2px; }
.inline-warning { color: #d6a879; font-size: 11px; margin: 8px 4px 0; }

/* Configuration */
.config-page { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 56px; }
.config-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.config-heading h1 { margin: 7px 0 7px; font-size: clamp(30px, 4vw, 44px); line-height: 1.04; letter-spacing: -.035em; font-weight: 650; }
.config-heading p { max-width: 730px; margin: 0; color: var(--muted); font-size: 14px; }
.flash-message { margin-bottom: 18px; padding: 11px 14px; border: 1px solid rgba(111,189,147,.20); border-radius: 10px; background: rgba(111,189,147,.07); color: #a9d7be; font-size: 12px; }
.config-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 14px; align-items: start; }
.persona-list-panel, .editor-panel { border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgba(17,19,24,.72); box-shadow: var(--shadow-1); }
.persona-list-panel { position: sticky; top: calc(var(--header-h) + 18px); overflow: hidden; }
.panel-title-row { min-height: 62px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.panel-title-row strong { display: block; margin-top: 3px; font-size: 13px; }
.persona-list { padding: 7px; max-height: calc(100vh - 190px); overflow-y: auto; }
.persona-list-item { display: grid; grid-template-columns: 38px 1fr 10px; gap: 10px; align-items: center; padding: 10px; border-radius: 11px; border: 1px solid transparent; }
.persona-list-item:hover { background: rgba(255,255,255,.035); }
.persona-list-item.is-selected { background: rgba(198,162,91,.055); border-color: var(--border-gold); }
.persona-list-avatar { width: 38px; height: 38px; border-radius: 10px; }
.persona-list-copy { min-width: 0; }
.persona-list-copy strong { display: block; font-size: 12px; }
.persona-list-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.state-dot { width: 7px; height: 7px; border-radius: 999px; background: #535760; }
.state-dot.is-on { background: var(--success); }
.empty-list { padding: 28px 16px; color: var(--muted); text-align: center; font-size: 12px; }
.editor-panel { overflow: hidden; }
.editor-panel-head { min-height: 80px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); }
.editor-panel-head h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.02em; }
.editor-actions { display: flex; gap: 7px; }
.editor-actions form { margin: 0; }
.persona-form { padding: 22px; }
.form-row.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { margin-bottom: 18px; }
.form-field > label, .label-row > label { display: block; margin-bottom: 7px; color: var(--text-soft); font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.form-field input[type="text"], .form-field input:not([type]), .form-field textarea {
    width: 100%; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: #0e1014;
    transition: border-color .16s ease, background .16s ease;
}
.form-field input[type="text"], .form-field input:not([type]) { height: 44px; padding: 0 12px; }
.form-field textarea { min-height: 320px; padding: 13px; resize: vertical; line-height: 1.58; }
.form-field input:focus, .form-field textarea:focus { border-color: var(--border-gold); background: #101217; }
.field-help { display: block; margin-top: 6px; color: var(--muted-2); font-size: 10px; }
.validation-message { display: block; margin-top: 5px; color: #e39a9a; font-size: 10px; }
.toggle-card { min-height: 44px; display: flex !important; align-items: center; gap: 10px; padding: 7px 10px; margin: 0 !important; border: 1px solid var(--border); border-radius: 10px; background: #0e1014; cursor: pointer; }
.toggle-card span:last-child strong { display: block; font-size: 11px; }
.toggle-card span:last-child small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 9px; }
.label-row { display: flex; align-items: center; justify-content: space-between; }
.char-count { color: var(--muted-2); font-size: 10px; }
.form-footer { padding-top: 18px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.provider-card { display: flex; align-items: center; gap: 10px; }
.provider-indicator { width: 9px; height: 9px; border-radius: 999px; background: #8b5b5b; box-shadow: 0 0 0 4px rgba(216,118,118,.06); }
.provider-indicator.is-ready { background: var(--success); box-shadow: 0 0 0 4px rgba(111,189,147,.06); }
.provider-card strong { display: block; font-size: 11px; }
.provider-card small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 9px; }
.btn-save { min-width: 160px; }

.error-page { width: min(720px, calc(100% - 40px)); margin: 80px auto; text-align: center; }
.error-page h1 { font-size: 38px; margin: 8px 0; }
.error-page p { color: var(--muted); margin-bottom: 22px; }

@media (max-width: 980px) {
    .app-header { grid-template-columns: 1fr auto; }
    .main-nav { order: 3; position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); height: auto; padding: 5px; border: 1px solid var(--border); border-radius: 14px; background: rgba(14,16,20,.94); box-shadow: var(--shadow-2); z-index: 120; }
    .nav-link.is-active::after { display: none; }
    .header-status { display: none; }
    .persona-toolbar { align-items: stretch; flex-direction: column; top: calc(var(--header-h) + 10px); }
    .toolbar-primary { width: 100%; }
    .select-wrap-lg { width: 100%; }
    .toolbar-actions { justify-content: space-between; flex-wrap: wrap; }
    .conversation-shell { min-height: calc(100vh - 220px); }
    .chat-feed { max-height: calc(100vh - 400px); }
    .config-grid { grid-template-columns: 1fr; }
    .persona-list-panel { position: static; }
    .persona-list { max-height: 300px; }
}

@media (max-width: 700px) {
    :root { --header-h: 60px; }
    .app-header { padding: 0 16px; }
    .brand-word { font-size: 12px; }
    .chat-page, .config-page { width: min(100% - 20px, 1240px); }
    .chat-page { padding-top: 10px; }
    .persona-toolbar { border-radius: 14px; padding: 10px; }
    .toolbar-primary { display: block; }
    .field-label { display: block; margin: 0 0 6px 3px; }
    .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .participant-picker .btn { width: 100%; }
    .popover { position: fixed; left: 10px; right: 10px; bottom: 80px; top: auto; width: auto; max-height: 70vh; }
    .switch-control { min-height: 40px; border: 1px solid var(--border); }
    .round-control { grid-column: 1 / -1; justify-content: flex-end; }
    .conversation-shell { margin-top: 10px; border-radius: 18px; }
    .conversation-topline { padding: 9px 12px; }
    .call-estimate { display: none; }
    .chat-feed { min-height: 330px; max-height: calc(100vh - 420px); padding: 24px 12px; }
    .empty-state { margin-top: 20px; }
    .empty-state h1 { font-size: 30px; }
    .prompt-grid { grid-template-columns: 1fr; }
    .prompt-card { min-height: 88px; }
    .prompt-card > span { margin-bottom: 10px; }
    .message-wrap, .message-row.user .message-wrap { max-width: 90%; }
    .message-meta span { max-width: 210px; }
    .thinking-strip { margin-inline: 12px; }
    .composer-wrap { padding: 0 10px 16px; }
    .composer-hint { display: none; }
    .composer-footer { justify-content: flex-end; }
    .config-page { padding-top: 24px; padding-bottom: 90px; }
    .config-heading { align-items: stretch; flex-direction: column; }
    .config-heading .btn { width: 100%; }
    .form-row.two-cols { grid-template-columns: 1fr; gap: 0; }
    .editor-panel-head { align-items: flex-start; flex-direction: column; }
    .editor-actions { width: 100%; }
    .editor-actions form { flex: 1; }
    .editor-actions .btn { width: 100%; }
    .persona-form { padding: 16px; }
    .form-footer { align-items: stretch; flex-direction: column; }
    .btn-save { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
