:root {
    color-scheme: dark;
    --bg: #0a0f18;
    --bg-raised: #0f1623;
    --panel: rgba(18, 27, 42, 0.92);
    --panel-2: #151f30;
    --line: rgba(148, 163, 184, 0.16);
    --line-strong: rgba(148, 163, 184, 0.28);
    --text: #eef4ff;
    --muted: #8fa0b8;
    --accent: #77a8ff;
    --accent-strong: #4d8cff;
    --accent-soft: rgba(77, 140, 255, 0.14);
    --green: #66d7a3;
    --red: #ff7f8f;
    --orange: #ffbe6b;
    --shadow: 0 22px 80px rgba(0, 0, 0, 0.34);
    --radius: 20px;
    --font-scale: 1;
}

html[data-text-size="large"] {
    --font-scale: 1.08;
}

html[data-text-size="huge"] {
    --font-scale: 1.18;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
    font-size: calc(16px * var(--font-scale));
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 0%, rgba(55, 103, 190, 0.18), transparent 28rem),
        radial-gradient(circle at 90% 8%, rgba(72, 65, 165, 0.12), transparent 26rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

button,
select,
label.button {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

a {
    color: inherit;
}

code {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: .9em;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: 100%;
    max-width: 460px;
}

.login-card {
    padding: 38px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(14, 21, 33, .92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 28px;
    border: 1px solid rgba(119, 168, 255, .35);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(119, 168, 255, .22), rgba(77, 140, 255, .06));
    color: #dce9ff;
    font-weight: 800;
    letter-spacing: -.04em;
}

.brand-mark.small {
    width: 36px;
    height: 36px;
    margin: 0;
    border-radius: 11px;
    font-size: .78rem;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--accent);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .14em;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-size: clamp(1.7rem, 4vw, 2.45rem);
    line-height: 1.08;
    letter-spacing: -.04em;
}

h2 {
    margin-bottom: 0;
    font-size: 1.12rem;
    letter-spacing: -.02em;
}

.login-copy,
.page-heading p,
.card-footnote,
.security-note {
    color: var(--muted);
    line-height: 1.55;
}

.login-form {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.login-form label,
.field > span {
    color: #cbd7e7;
    font-size: .82rem;
    font-weight: 700;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    outline: none;
    background: #0c1320;
    color: var(--text);
    transition: border-color .18s ease, box-shadow .18s ease;
}

input {
    min-height: 46px;
    padding: 0 13px;
}

select {
    min-height: 42px;
    padding: 0 36px 0 12px;
}

input:focus,
select:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px rgba(77, 140, 255, .13);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 750;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.button:not(:disabled):active {
    transform: scale(.985);
}

.button.primary {
    background: linear-gradient(180deg, #669dff, #3f7ee9);
    color: #fff;
    box-shadow: 0 8px 30px rgba(63, 126, 233, .22);
}

.button.primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #75a8ff, #4c89f2);
}

.button.primary:disabled {
    opacity: .5;
}

.button.secondary {
    border-color: var(--line-strong);
    background: #182338;
    color: #dfeaff;
}

.button.secondary:hover {
    border-color: rgba(119, 168, 255, .45);
    background: #1a2941;
}

.button.ghost {
    border-color: var(--line);
    background: transparent;
    color: #b8c5d7;
}

.button.large {
    min-height: 50px;
    margin-top: 8px;
}

.button.compact {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: .82rem;
}

.alert {
    margin: 18px 0;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: .87rem;
    line-height: 1.45;
}

.alert.warning {
    border: 1px solid rgba(255, 190, 107, .25);
    background: rgba(255, 190, 107, .08);
    color: #ffd9a6;
}

.alert.error {
    border: 1px solid rgba(255, 127, 143, .25);
    background: rgba(255, 127, 143, .08);
    color: #ffc0c8;
}

.security-note {
    margin: 20px 0 0;
    font-size: .76rem;
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 66px;
    padding: 10px clamp(16px, 4vw, 42px);
    border-bottom: 1px solid var(--line);
    background: rgba(9, 14, 23, .88);
    backdrop-filter: blur(16px);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.topbar-brand > div:last-child {
    display: flex;
    align-items: baseline;
    gap: 9px;
}

.topbar-brand strong {
    font-size: .96rem;
}

.topbar-brand span {
    color: var(--muted);
    font-size: .72rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.device-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 5px 4px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(18, 27, 42, .8);
}

.device-profile > span {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 800;
}

.device-profile select {
    width: auto;
    min-width: 130px;
    min-height: 32px;
    border: 0;
    background-color: #101827;
    font-size: .78rem;
}

.status-pill,
.subtle-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(18, 27, 42, .75);
    color: #b8c5d7;
    font-size: .73rem;
    font-weight: 700;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px rgba(102, 215, 163, .7);
}

.icon-link {
    color: var(--muted);
    font-size: .78rem;
    text-decoration: none;
}

.icon-link:hover {
    color: var(--text);
}

.main-nav {
    display: flex;
    gap: 5px;
    padding: 13px clamp(16px, 4vw, 42px) 0;
}

.nav-button {
    padding: 9px 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 750;
}

.nav-button.active {
    background: var(--accent-soft);
    color: #cfe0ff;
}

.content {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 30px clamp(16px, 4vw, 42px) 60px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 28px;
}

.page-heading > div {
    max-width: 760px;
}

.page-heading p:not(.eyebrow) {
    max-width: 700px;
    margin-bottom: 0;
}

.start-button {
    flex-direction: column;
    min-width: 190px;
    min-height: 58px;
    line-height: 1.08;
}

.start-button span {
    opacity: .72;
    font-size: .68rem;
    font-weight: 600;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr);
    gap: 18px;
}

.card {
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(20, 30, 47, .92), rgba(14, 22, 35, .94));
    box-shadow: 0 12px 42px rgba(0, 0, 0, .12);
}

.materials-card {
    grid-row: span 2;
}

.card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.material-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 13px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
}

.material-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(119, 168, 255, .2);
    border-radius: 12px;
    background: rgba(77, 140, 255, .08);
    color: #a8c7ff;
    font-size: .72rem;
    font-weight: 900;
}

.material-details {
    min-width: 0;
}

.material-details strong,
.material-details span {
    display: block;
}

.material-details strong {
    margin-bottom: 4px;
    font-size: .9rem;
}

.material-details span {
    overflow: hidden;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.45;
    text-overflow: ellipsis;
}

.material-actions {
    display: flex;
    align-items: flex-start;
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.file-list {
    grid-column: 2 / -1;
    display: grid;
    gap: 8px;
}

.file-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(7, 12, 20, .28);
}

.file-chip-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.file-chip-main > div {
    min-width: 0;
}

.file-chip strong,
.file-chip span {
    display: block;
}

.file-chip strong {
    overflow: hidden;
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-chip span:not(.file-extension) {
    margin-top: 2px;
    color: var(--muted);
    font-size: .68rem;
}

.file-extension {
    flex: 0 0 auto;
    padding: 4px 6px;
    border-radius: 6px;
    background: #1d2a40;
    color: #a9c8ff;
    font-size: .62rem;
    font-weight: 800;
}

.remove-file {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #7889a1;
    font-size: 1.15rem;
}

.remove-file:hover {
    background: rgba(255, 127, 143, .08);
    color: var(--red);
}

.empty-inline {
    padding: 7px 0 0;
    color: #718199;
    font-size: .75rem;
}

.card-footnote {
    margin: 14px 0 0;
    font-size: .72rem;
}

.readiness-list {
    display: grid;
    gap: 7px;
}

.readiness-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 0;
}

.check-circle {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 29px;
    height: 29px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    color: #7f8ea5;
    font-size: .7rem;
    font-weight: 800;
}

.readiness-item.complete .check-circle {
    border-color: rgba(102, 215, 163, .45);
    background: rgba(102, 215, 163, .12);
    color: var(--green);
}

.readiness-item.complete .check-circle::after {
    content: "✓";
}

.readiness-item.complete .check-circle {
    font-size: 0;
}

.readiness-item.complete .check-circle::after {
    font-size: .78rem;
}

.readiness-item strong,
.readiness-item div > span {
    display: block;
}

.readiness-item strong {
    margin-bottom: 2px;
    font-size: .82rem;
}

.readiness-item div > span {
    color: var(--muted);
    font-size: .72rem;
}

.cost-total {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 7px 0 17px;
}

.cost-total span {
    color: var(--muted);
    font-size: .8rem;
}

.cost-total strong {
    font-size: 2rem;
    letter-spacing: -.05em;
}

.cost-breakdown {
    display: grid;
    gap: 9px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.cost-breakdown div,
.cost-all-time {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.cost-breakdown span,
.cost-all-time span {
    color: var(--muted);
    font-size: .75rem;
}

.cost-breakdown strong,
.cost-all-time strong {
    font-size: .76rem;
}

.cost-all-time {
    padding-top: 14px;
}

.next-card p:not(.eyebrow) {
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.55;
}

.mini-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
}

.mini-flow span {
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(7, 12, 20, .24);
    color: #c6d3e6;
    font-size: .7rem;
    font-weight: 650;
}

.mini-flow b {
    color: #63738b;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.api-profile-card {
    grid-row: span 2;
}

.field {
    display: grid;
    gap: 7px;
}

.field small {
    color: var(--muted);
    font-size: .7rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 12px;
}

.info-box {
    margin: 14px 0 0;
    padding: 11px 12px;
    border: 1px solid rgba(119, 168, 255, .15);
    border-radius: 10px;
    background: rgba(77, 140, 255, .06);
    color: #98aac2;
    font-size: .73rem;
    line-height: 1.5;
}

.profile-list {
    display: grid;
}

.profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-top: 1px solid var(--line);
}

.profile-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.profile-main > div {
    min-width: 0;
}

.profile-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 35px;
    height: 35px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: #a9c7ff;
    font-size: .65rem;
    font-weight: 900;
}

.profile-main strong,
.profile-main span {
    display: block;
}

.profile-main strong {
    margin-bottom: 2px;
    font-size: .82rem;
}

.profile-main span {
    color: var(--muted);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: .68rem;
}

.profile-actions {
    display: flex;
    gap: 4px;
}

.text-button {
    padding: 5px 7px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #9eb8df;
    font-size: .72rem;
    font-weight: 700;
}

.text-button:hover {
    background: rgba(119, 168, 255, .08);
    color: #d7e6ff;
}

.text-button.danger {
    color: #c58a95;
}

.text-button.danger:hover {
    background: rgba(255, 127, 143, .07);
    color: #ff9da9;
}

.profile-form {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(7, 12, 20, .26);
}

.profile-form.hidden {
    display: none;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.empty-state {
    padding: 26px 10px;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    color: var(--muted);
    font-size: .78rem;
    text-align: center;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 18px;
}

.toggle-row strong,
.toggle-row span {
    display: block;
}

.toggle-row strong {
    margin-bottom: 3px;
    font-size: .82rem;
}

.toggle-row span {
    color: var(--muted);
    font-size: .72rem;
}

.toggle-row input {
    width: 20px;
    min-height: 20px;
}

.security-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 18px;
    color: #9cadc3;
    font-size: .78rem;
    line-height: 1.5;
}

.toast {
    position: fixed;
    z-index: 99;
    right: 22px;
    bottom: 22px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: #152033;
    box-shadow: var(--shadow);
    color: #e8f0fc;
    font-size: .78rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    border-color: rgba(255, 127, 143, .3);
}

.toast.info {
    border-color: rgba(119, 168, 255, .3);
}

.compact-ui .card {
    padding: 17px;
}

.compact-ui .material-row {
    padding: 13px 0;
}

.compact-ui .content {
    padding-top: 22px;
}

@media (max-width: 900px) {
    .dashboard-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .materials-card,
    .api-profile-card {
        grid-row: auto;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .start-button {
        width: 100%;
    }
}

@media (max-width: 680px) {
    .topbar {
        align-items: flex-start;
        padding: 10px 13px;
    }

    .topbar-actions {
        gap: 6px;
    }

    .status-pill,
    .icon-link,
    .desktop-only,
    .device-profile > span {
        display: none;
    }

    .device-profile {
        padding: 3px;
    }

    .device-profile select {
        min-width: 116px;
    }

    .main-nav {
        padding: 9px 13px 0;
    }

    .content {
        padding: 24px 13px 44px;
    }

    .page-heading {
        margin-bottom: 20px;
    }

    .card {
        padding: 17px;
        border-radius: 17px;
    }

    .material-row {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .material-actions {
        grid-column: 2;
    }

    .file-list {
        grid-column: 1 / -1;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .profile-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .profile-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .login-card {
        padding: 27px 22px;
    }
}


/* Phase 2: realtime transcription */

.realtime-active .main-nav {
    display: none;
}

.realtime-active .content {
    width: min(1600px, 100%);
    padding-top: 18px;
}

.interview-view {
    min-height: calc(100vh - 110px);
}

.interview-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.interview-header h1 {
    margin-bottom: 0;
}

.interview-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-cost {
    min-width: 74px;
    color: var(--green);
    font-size: .95rem;
    font-weight: 800;
    text-align: right;
}

.realtime-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, .65fr);
    gap: 18px;
    align-items: start;
}

.live-transcript-card {
    min-height: min(720px, calc(100vh - 170px));
}

.live-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.live-status-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.live-status-main strong,
.live-status-main span {
    display: block;
}

.live-status-main strong {
    margin-bottom: 3px;
    font-size: .92rem;
}

.live-status-main span {
    color: var(--muted);
    font-size: .72rem;
}

.realtime-dot {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #64748b;
    box-shadow: 0 0 0 5px rgba(100, 116, 139, .08);
}

.realtime-dot.connecting,
.realtime-dot.processing {
    background: var(--orange);
    box-shadow: 0 0 0 5px rgba(255, 190, 107, .08);
}

.realtime-dot.live {
    background: var(--green);
    box-shadow: 0 0 13px rgba(102, 215, 163, .45);
}

.realtime-dot.speaking {
    background: var(--accent);
    box-shadow: 0 0 16px rgba(119, 168, 255, .65);
}

.realtime-dot.paused {
    background: #94a3b8;
}

.realtime-dot.error {
    background: var(--red);
    box-shadow: 0 0 12px rgba(255, 127, 143, .45);
}

.session-clock {
    flex: 0 0 auto;
    text-align: right;
}

.session-clock span,
.session-clock strong {
    display: block;
}

.session-clock span {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: .61rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.session-clock strong {
    font-variant-numeric: tabular-nums;
    font-size: 1.05rem;
}

.mic-meter-wrap {
    margin: 18px 0;
}

.mic-meter-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: .68rem;
}

.mic-meter {
    overflow: hidden;
    height: 7px;
    border-radius: 999px;
    background: #09101b;
}

.mic-meter-fill {
    width: 1%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #557fd2, #75abff);
    transition: width .06s linear;
}

.live-transcript {
    min-height: 480px;
}

.transcript-section-label {
    margin: 22px 0 9px;
    color: #72839b;
    font-size: .64rem;
    font-weight: 900;
    letter-spacing: .14em;
}

.partial-transcript {
    min-height: 120px;
    padding: 18px;
    border: 1px solid rgba(119, 168, 255, .18);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(77, 140, 255, .075), rgba(7, 12, 20, .18));
    color: #8192aa;
    font-size: clamp(1.12rem, 2.4vw, 1.55rem);
    line-height: 1.48;
}

.partial-transcript.has-text {
    color: #f4f8ff;
}

.history-label {
    margin-top: 28px;
}

.transcript-history {
    display: grid;
    gap: 10px;
}

.empty-transcript {
    padding: 24px 0;
    color: #66778f;
    font-size: .8rem;
}

.transcript-turn {
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(7, 12, 20, .28);
}

.transcript-turn-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
    color: #71839c;
    font-size: .65rem;
    font-weight: 700;
}

.transcript-turn p {
    margin: 0;
    color: #dce6f5;
    font-size: .9rem;
    line-height: 1.55;
}

.realtime-diagnostics {
    position: sticky;
    top: 83px;
}

.diagnostic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    overflow: hidden;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--line);
}

.diagnostic-grid > div {
    min-width: 0;
    padding: 11px;
    background: #111a29;
}

.diagnostic-grid span,
.diagnostic-grid strong {
    display: block;
}

.diagnostic-grid span {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: .64rem;
}

.diagnostic-grid strong {
    overflow: hidden;
    color: #dce7f8;
    font-size: .76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.realtime-settings {
    display: grid;
    gap: 13px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.realtime-controls {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.event-log-details {
    margin-top: 18px;
}

.event-log-details summary {
    cursor: pointer;
    color: #8294ad;
    font-size: .72rem;
    font-weight: 700;
}

.event-log {
    display: grid;
    gap: 5px;
    max-height: 220px;
    margin-top: 10px;
    overflow: auto;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #080d16;
}

.event-log-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 7px;
    align-items: baseline;
    font-size: .6rem;
}

.event-log-row span {
    color: #586981;
}

.event-log-row strong {
    color: #7998c7;
}

.event-log-row code {
    overflow: hidden;
    color: #8c9cb1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 940px) {
    .realtime-grid {
        grid-template-columns: 1fr;
    }

    .realtime-diagnostics {
        position: static;
    }

    .live-transcript-card {
        min-height: auto;
    }
}

@media (max-width: 680px) {
    .interview-header {
        align-items: stretch;
        flex-direction: column;
    }

    .interview-header-actions {
        justify-content: space-between;
    }

    .live-status-row {
        align-items: flex-start;
    }

    .partial-transcript {
        min-height: 105px;
        padding: 15px;
    }

    .diagnostic-grid {
        grid-template-columns: 1fr 1fr;
    }

    .realtime-active .topbar {
        position: static;
    }
}


/* Phase 3: interview analysis + live answer copilot */

.hidden {
    display: none !important;
}

.subtle-badge.ready {
    border-color: rgba(102, 215, 163, .32);
    background: rgba(102, 215, 163, .09);
    color: #a7ebca;
}

.subtle-badge.warning {
    border-color: rgba(255, 190, 107, .3);
    background: rgba(255, 190, 107, .08);
    color: #ffd59d;
}

.analysis-copy {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.55;
}

.analysis-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0;
}

.analysis-stats div {
    padding: 10px 8px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(7, 12, 20, .24);
    text-align: center;
}

.analysis-stats strong,
.analysis-stats span {
    display: block;
}

.analysis-stats strong {
    margin-bottom: 2px;
    color: #dce9ff;
    font-size: 1rem;
}

.analysis-stats span {
    color: var(--muted);
    font-size: .62rem;
}

.analysis-button {
    width: 100%;
}

.copilot-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(330px, .75fr);
    gap: 18px;
    align-items: start;
}

.copilot-main-column,
.copilot-side-column {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.copilot-side-column .realtime-diagnostics {
    position: static;
}

.answer-card {
    min-height: 54vh;
    display: flex;
    flex-direction: column;
}

.answer-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.answer-state {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.answer-state .eyebrow {
    margin-bottom: 3px;
}

.answer-state strong {
    display: block;
    overflow: hidden;
    color: #dce8f9;
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.answer-state-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #66778f;
    box-shadow: 0 0 0 4px rgba(102, 119, 143, .08);
}

.answer-state-dot.listening {
    background: var(--green);
    box-shadow: 0 0 14px rgba(102, 215, 163, .45);
}

.answer-state-dot.checking,
.answer-state-dot.generating {
    background: var(--accent);
    box-shadow: 0 0 14px rgba(119, 168, 255, .55);
    animation: answerPulse 1.15s ease-in-out infinite;
}

.answer-state-dot.held {
    background: #bd9cff;
    box-shadow: 0 0 14px rgba(189, 156, 255, .38);
}

.answer-state-dot.pending {
    background: var(--orange);
    box-shadow: 0 0 14px rgba(255, 190, 107, .38);
}

.answer-state-dot.error {
    background: var(--red);
}

@keyframes answerPulse {
    0%, 100% { opacity: .55; }
    50% { opacity: 1; }
}

.answer-hold-badge {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
}

.answer-hold-badge.held {
    border-color: rgba(189, 156, 255, .24);
    background: rgba(189, 156, 255, .08);
    color: #d8c7ff;
}

.current-question {
    margin-top: 16px;
    padding: 11px 13px;
    border-left: 3px solid var(--accent-strong);
    border-radius: 0 10px 10px 0;
    background: rgba(77, 140, 255, .07);
}

.current-question span,
.current-question strong {
    display: block;
}

.current-question span {
    margin-bottom: 4px;
    color: var(--accent);
    font-size: .62rem;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.current-question strong {
    color: #dfe9f8;
    font-size: .86rem;
    line-height: 1.4;
}

.suggested-answer {
    flex: 1;
    min-height: 290px;
    padding: 22px 2px 18px;
    color: #f3f7ff;
    font-size: clamp(1.18rem, 2.1vw, 1.62rem);
    font-weight: 540;
    line-height: 1.55;
    letter-spacing: -.018em;
    white-space: pre-wrap;
}

.suggested-answer.empty {
    display: grid;
    place-items: center;
    color: #65768f;
    font-size: .92rem;
    font-weight: 500;
    text-align: center;
}

.pending-answer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 4px 0 14px;
    padding: 12px 13px;
    border: 1px solid rgba(255, 190, 107, .26);
    border-radius: 12px;
    background: rgba(255, 190, 107, .07);
}

.pending-answer strong,
.pending-answer span {
    display: block;
}

.pending-answer strong {
    margin-bottom: 3px;
    color: #ffe0b3;
    font-size: .8rem;
}

.pending-answer span {
    color: #b8a88f;
    font-size: .7rem;
    line-height: 1.4;
}

.pending-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 7px;
}

.answer-controls {
    display: flex;
    gap: 9px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.answer-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 11px;
    color: #64758d;
    font-size: .64rem;
}

.answer-history {
    display: grid;
    gap: 8px;
    max-height: 350px;
    overflow: auto;
}

.answer-history-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 10px;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(7, 12, 20, .22);
    color: inherit;
    text-align: left;
}

.answer-history-item:hover {
    border-color: rgba(119, 168, 255, .28);
    background: rgba(77, 140, 255, .05);
}

.answer-history-time {
    grid-row: span 2;
    padding-top: 2px;
    color: #61738c;
    font-size: .62rem;
}

.answer-history-item strong {
    overflow: hidden;
    color: #d7e4f5;
    font-size: .76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.answer-history-item > span:last-child {
    overflow: hidden;
    color: #8293aa;
    font-size: .68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-context-card {
    overflow: visible;
}

.compact-meter {
    margin-top: 16px;
}

.compact-partial {
    min-height: 88px;
    max-height: 150px;
    margin-top: 7px;
    padding: 12px;
    overflow: auto;
    font-size: .88rem;
    line-height: 1.45;
}

.auto-answer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding: 11px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.auto-answer-row strong,
.auto-answer-row span {
    display: block;
}

.auto-answer-row strong {
    margin-bottom: 3px;
    font-size: .76rem;
}

.auto-answer-row span {
    color: var(--muted);
    font-size: .66rem;
}

.auto-answer-row input {
    width: 20px;
    min-height: 20px;
}

.recent-transcript-details {
    margin-top: 13px;
}

.recent-transcript-details summary {
    cursor: pointer;
    color: #8fa1b9;
    font-size: .72rem;
    font-weight: 750;
}

.compact-history {
    max-height: 300px;
    margin-top: 10px;
}

.compact-history .transcript-turn {
    padding: 9px 10px;
}

.compact-history .transcript-turn p {
    margin-bottom: 0;
    font-size: .7rem;
    line-height: 1.45;
}

.compact-history .transcript-turn-meta {
    margin-bottom: 5px;
    font-size: .58rem;
}

@media (max-width: 1020px) {
    .copilot-grid {
        grid-template-columns: 1fr;
    }

    .answer-card {
        min-height: 48vh;
    }

    .copilot-side-column {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

@media (max-width: 720px) {
    .analysis-stats {
        grid-template-columns: 1fr 1fr;
    }

    .copilot-side-column {
        grid-template-columns: 1fr;
    }

    .answer-card {
        min-height: 52vh;
    }

    .suggested-answer {
        min-height: 250px;
        padding-top: 17px;
        font-size: clamp(1.1rem, 5vw, 1.42rem);
    }

    .answer-card-header {
        align-items: flex-start;
    }

    .answer-state strong {
        white-space: normal;
    }

    .pending-answer,
    .answer-controls,
    .answer-meta {
        align-items: stretch;
        flex-direction: column;
    }

    .pending-actions {
        width: 100%;
    }

    .pending-actions .button {
        flex: 1;
    }

    .answer-controls .button {
        width: 100%;
    }
}
