:root {
    color-scheme: light dark;
    --stage: #141613;
    --stage-2: #1f241f;
    --panel: #f5f3ee;
    --panel-2: #ebe7df;
    --ink: #1d211d;
    --muted: #6d716a;
    --line: #d8d2c7;
    --white: #fffdf8;
    --green: #24835d;
    --green-2: #2fb477;
    --red: #c8463e;
    --blue: #356fd6;
    --amber: #b7791f;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--panel);
    color: var(--ink);
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

.app-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
    min-height: 100vh;
}

.call-stage {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 100vh;
    background: var(--stage);
    color: var(--white);
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-lockup,
.dialog-header,
.status-row,
.section-heading,
.participant,
.control-dock,
.meter-wrap {
    display: flex;
    align-items: center;
}

.brand-lockup,
.dialog-header {
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--green);
    color: white;
    font-size: 13px;
    font-weight: 800;
}

.eyebrow {
    margin: 0 0 2px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.dialog-header .eyebrow,
.side-panel .eyebrow {
    color: var(--muted);
}

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

h1 {
    margin-bottom: 0;
    font-size: clamp(20px, 2.2vw, 30px);
    line-height: 1.1;
}

h2 {
    margin-bottom: 0;
    font-size: 16px;
}

.status-row {
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status-pill.neutral {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.88);
}

.status-pill.live {
    background: rgba(47, 180, 119, 0.16);
    color: #8ee0b7;
}

.status-pill.recording {
    background: rgba(200, 70, 62, 0.18);
    color: #ffaea8;
}

.timer {
    min-width: 58px;
    color: rgba(255, 255, 255, 0.72);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.voice-area {
    display: grid;
    grid-template-rows: minmax(210px, 1fr) auto auto;
    gap: 24px;
    padding: 26px;
}

.participant-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 16px;
    align-content: center;
}

.participant {
    position: relative;
    min-height: 220px;
    justify-content: center;
    gap: 18px;
    padding: 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: var(--stage-2);
}

.participant.active-speaker {
    border-color: rgba(47, 180, 119, 0.8);
    box-shadow: inset 0 0 0 1px rgba(47, 180, 119, 0.2);
}

.participant.recording {
    border-color: rgba(200, 70, 62, 0.9);
    box-shadow: inset 0 0 0 1px rgba(200, 70, 62, 0.25);
}

.avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 92px;
    height: 92px;
    border-radius: 50%;
}

.avatar svg {
    width: 38px;
    height: 38px;
}

.ai-avatar {
    background: #dfece5;
    color: var(--green);
}

.employee-avatar {
    background: #e4e9f5;
    color: var(--blue);
}

.participant-copy {
    min-width: 0;
}

.participant-copy span {
    display: block;
    margin-bottom: 7px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 14px;
}

.participant-copy strong {
    display: block;
    max-width: 260px;
    color: white;
    font-size: 18px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.question-band {
    min-height: 116px;
    padding: 22px 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.question-band span {
    display: block;
    margin-bottom: 10px;
    color: #98d8ba;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.question-band p {
    margin-bottom: 0;
    color: var(--white);
    font-size: clamp(20px, 2.4vw, 32px);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.meter-wrap {
    gap: 12px;
    min-height: 18px;
    color: rgba(255, 255, 255, 0.3);
}

.meter-wrap > span {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.meter {
    width: min(280px, 38vw);
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.meter div {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--green-2);
    transition: width 80ms linear;
}

.control-dock {
    justify-content: center;
    gap: 12px;
    padding: 18px 24px 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.icon-button,
.record-button,
.join-button {
    cursor: pointer;
    transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}

.icon-button {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.icon-button svg {
    width: 22px;
    height: 22px;
}

.icon-button:hover:not(:disabled),
.record-button:hover:not(:disabled),
.join-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.icon-button.active {
    background: var(--amber);
}

.icon-button.danger {
    background: var(--red);
}

.record-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 136px;
    height: 52px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--green);
    color: white;
    font-weight: 800;
}

.record-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.record-button.recording {
    background: var(--red);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

.side-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    min-width: 0;
    min-height: 100vh;
    background: var(--panel);
    border-left: 1px solid var(--line);
}

.panel-section {
    min-width: 0;
    padding: 24px;
    border-bottom: 1px solid var(--line);
}

.transcript-section {
    min-height: 0;
    border-bottom: 0;
}

.section-heading {
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.section-heading span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.question-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.question-list li {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.question-list li:first-child {
    border-top: 0;
}

.question-index {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--panel-2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.question-list li.current .question-index {
    background: var(--green);
    color: white;
}

.question-list li.done .question-index {
    background: var(--blue);
    color: white;
}

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

.question-list strong {
    margin-bottom: 3px;
    font-size: 13px;
}

.question-list span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.transcript-list {
    display: grid;
    gap: 14px;
    max-height: calc(100vh - 315px);
    overflow: auto;
    padding-right: 4px;
}

.answer-item {
    padding: 0 0 14px;
    border-bottom: 1px solid var(--line);
}

.answer-item:last-child {
    border-bottom: 0;
}

.answer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.answer-item p {
    margin-bottom: 0;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.empty-state {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
}

.setup-dialog {
    width: min(420px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.setup-dialog::backdrop {
    background: rgba(20, 22, 19, 0.74);
}

.setup-dialog form {
    display: grid;
    gap: 16px;
    padding: 24px;
}

.setup-dialog label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.setup-dialog input {
    width: 100%;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--ink);
}

.setup-dialog input:focus {
    border-color: var(--green);
    outline: 3px solid rgba(36, 131, 93, 0.18);
}

.join-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    border-radius: 8px;
    background: var(--green);
    color: white;
    font-weight: 800;
}

.join-button svg {
    width: 20px;
    height: 20px;
}

.form-error {
    min-height: 18px;
    margin-bottom: 0;
    color: var(--red);
    font-size: 13px;
    line-height: 1.4;
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .side-panel {
        min-height: auto;
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .transcript-list {
        max-height: none;
    }
}

@media (max-width: 680px) {
    .top-bar,
    .voice-area {
        padding-left: 16px;
        padding-right: 16px;
    }

    .top-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .status-row {
        justify-content: flex-start;
    }

    .participant-stack {
        grid-template-columns: 1fr;
    }

    .participant {
        min-height: 168px;
        justify-content: flex-start;
    }

    .avatar {
        width: 72px;
        height: 72px;
    }

    .avatar svg {
        width: 30px;
        height: 30px;
    }

    .control-dock {
        gap: 8px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .icon-button {
        width: 46px;
        height: 46px;
    }

    .record-button {
        min-width: 112px;
        height: 46px;
        padding: 0 14px;
    }
}
