:root {
    --bg: #0b0c10;
    --ink: #f4efe4;
    --muted: #9c9588;
    --line: rgba(244, 239, 228, 0.1);
    --panel: rgba(20, 22, 28, 0.78);
    --accent: #e7ff6a;
    --accent-ink: #14160c;
    --hire: #9dffc5;
    --reject: #ffb4a8;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: Outfit, system-ui, sans-serif;
}

body {
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

body.is-call {
    overflow: hidden;
    height: 100%;
}

[hidden] {
    display: none !important;
}

.noise {
    pointer-events: none;
    position: fixed;
    inset: 0;
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    z-index: 0;
}

.orb {
    pointer-events: none;
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    z-index: 0;
}

.orb-a {
    width: 42vw;
    height: 42vw;
    max-width: 480px;
    max-height: 480px;
    background: rgba(231, 255, 106, 0.16);
    top: -12%;
    right: -8%;
}

.orb-b {
    width: 50vw;
    height: 50vw;
    max-width: 560px;
    max-height: 560px;
    background: rgba(92, 120, 255, 0.16);
    bottom: -18%;
    left: -12%;
}

.top, .setup, .call, .end {
    position: relative;
    z-index: 1;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.75rem;
    flex-shrink: 0;
    z-index: 30;
}

.top-nav {
    display: flex;
    gap: 1.1rem;
    align-items: center;
}

.top-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.88rem;
}

.top-nav a.is-on,
.top-nav a:hover {
    color: var(--ink);
}

.brand {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: -0.03em;
    display: flex;
    gap: 0.55rem;
    align-items: center;
}

.brand-mark {
    color: var(--accent);
}

.top-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
}

.setup {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1.75rem 1.25rem;
}

.setup-inner {
    width: min(560px, 100%);
    text-align: center;
    margin: 0 auto;
}

.eyebrow {
    margin: 0 0 0.9rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.68rem;
    color: var(--accent);
}

.setup-inner h1 {
    font-family: Fraunces, Georgia, serif;
    font-weight: 650;
    font-size: clamp(2.5rem, 7vw, 3.9rem);
    letter-spacing: -0.045em;
    line-height: 1.04;
    margin: 0 auto 1.05rem;
}

.lede {
    max-width: 32rem;
    margin: 0 auto 1.35rem;
    color: var(--muted);
    font-size: 1.06rem;
    line-height: 1.65;
}

.setup-points {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    margin: 0 auto 1.75rem;
    padding: 0;
}

.setup-points li {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.78rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.panel {
    padding: 1.55rem 1.45rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--panel);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    text-align: center;
}

.field { margin-bottom: 1.2rem; }

.label {
    display: block;
    margin-bottom: 0.55rem;
    font-size: 0.78rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
}

.chip {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    border-radius: 999px;
    padding: 0.42rem 0.85rem;
    cursor: pointer;
    font: inherit;
    font-size: 0.88rem;
}

.chip.is-on {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: transparent;
    font-weight: 600;
}

.duration-hint {
    margin: 0.55rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
}

.cta {
    width: 100%;
    margin-top: 0.4rem;
    border: 0;
    border-radius: 16px;
    padding: 0.95rem 1.2rem;
    background: var(--accent);
    color: var(--accent-ink);
    font: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

.cta:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cta.ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.err {
    color: var(--reject);
    margin: 0.75rem 0 0;
}

.maintenance {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(11, 12, 16, 0.72);
    backdrop-filter: blur(18px);
}

.maintenance[hidden] {
    display: none !important;
}

.maintenance-card {
    width: min(440px, 100%);
    padding: 2rem 1.7rem;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    text-align: left;
}

.maintenance-card h2 {
    font-family: Fraunces, Georgia, serif;
    font-size: 2rem;
    letter-spacing: -0.03em;
    margin: 0.35rem 0 0.85rem;
}

.maintenance-card p:last-child {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.call {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    gap: 1.25rem;
    width: min(1100px, 100%);
    margin: 0 auto;
    padding: 0 1.25rem 1rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

aside.recruiter {
    padding: 1.4rem;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    min-height: 0;
    overflow: auto;
}

.avatar-wrap { position: relative; width: fit-content; margin-bottom: 1rem; }

.avatar {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-weight: 650;
    background: linear-gradient(160deg, #e7ff6a, #7aa0ff);
    color: #12140c;
}

.live {
    position: absolute;
    left: 78px;
    top: 8px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hire);
}

aside.recruiter h2 {
    font-family: Fraunces, serif;
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
}

.role, .meta, .status {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.status {
    margin-top: 1rem;
    color: var(--accent);
}

.thread-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.thread {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.15rem 0.35rem 1rem 0;
}

.bubble {
    max-width: 78%;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.bubble.recruiter {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
}

.bubble.candidate {
    align-self: flex-end;
    background: var(--accent);
    color: var(--accent-ink);
}

.bubble.typing {
    color: var(--muted);
    font-style: italic;
}

.composer {
    display: flex;
    gap: 0.6rem;
    align-items: flex-end;
    flex-shrink: 0;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel);
}

.composer textarea {
    flex: 1;
    resize: none;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    outline: none;
}

.composer button {
    border: 0;
    border-radius: 12px;
    padding: 0.7rem 1rem;
    background: var(--accent);
    color: var(--accent-ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.end {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    padding: 2rem 1.25rem 4rem;
}

.end-card {
    width: min(680px, 100%);
    padding: 2rem 1.6rem;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.end-card.hire { border-color: rgba(157, 255, 197, 0.4); }
.end-card.reject { border-color: rgba(255, 180, 168, 0.35); }

.end-card h2 {
    font-family: Fraunces, serif;
    font-size: 2rem;
    margin: 0.4rem 0 0.9rem;
}

#end-body { color: var(--muted); line-height: 1.6; white-space: pre-wrap; }

#btn-debrief {
    margin-top: 1.15rem;
}

.debrief {
    margin: 1.2rem 0 0.15rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line);
    text-align: left;
}

.debrief-summary {
    margin: 0 0 0.35rem;
    color: var(--ink);
    line-height: 1.6;
    white-space: pre-wrap;
}

.debrief-summary:empty {
    display: none;
}

.debrief-h {
    margin: 1.15rem 0 0.2rem;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.debrief-item {
    padding: 0.95rem 0 0.2rem;
    border-top: 1px solid var(--line);
}

.debrief-item:first-of-type,
.debrief-h + .debrief-item {
    border-top: 0;
    padding-top: 0.55rem;
}

.debrief-head {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    margin-bottom: 0.45rem;
}

.debrief-badge {
    flex-shrink: 0;
    margin-top: 0.12rem;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    font-weight: 600;
}

.debrief-item.ok .debrief-badge {
    background: rgba(157, 255, 197, 0.16);
    color: var(--hire);
}

.debrief-item.weak .debrief-badge {
    background: rgba(231, 255, 106, 0.14);
    color: var(--accent);
}

.debrief-item.miss .debrief-badge {
    background: rgba(255, 180, 168, 0.16);
    color: var(--reject);
}

.debrief-q {
    margin: 0;
    font-weight: 600;
    line-height: 1.45;
}

.debrief-label {
    margin: 0.55rem 0 0.15rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.debrief-text,
.debrief-why {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    white-space: pre-wrap;
}

.debrief-why {
    margin-top: 0.55rem;
    color: var(--ink);
}

#debrief-error {
    margin-top: 0.85rem;
}

@media (max-width: 860px) {
    .call {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
        gap: 0.5rem;
        padding: 0 0.75rem 0.5rem;
    }
    aside.recruiter {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 0.65rem;
        row-gap: 0.08rem;
        padding: 0.4rem 0.75rem;
        border-radius: 16px;
    }
    aside.recruiter .avatar-wrap {
        grid-row: 1 / span 2;
        margin-bottom: 0;
    }
    aside.recruiter .avatar {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        font-size: 0.7rem;
    }
    aside.recruiter .live {
        display: none;
    }
    aside.recruiter h2 {
        font-size: 0.9rem;
        margin: 0;
        align-self: end;
        line-height: 1.15;
    }
    aside.recruiter .role {
        font-size: 0.7rem;
        margin: 0;
        grid-column: 2;
        align-self: start;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    aside.recruiter .meta {
        display: none;
    }
    aside.recruiter .status {
        grid-column: 3;
        grid-row: 1 / span 2;
        margin: 0;
        font-size: 0.7rem;
        text-align: right;
        align-self: center;
        line-height: 1.2;
    }
    .bubble { max-width: 92%; }
}
