:root {
    --ink: #102a2a;
    --ink-soft: #294241;
    --paper: #f3efe5;
    --paper-deep: #e9e2d2;
    --white: #fffdf8;
    --signal: #ff6b35;
    --signal-dark: #d94c1f;
    --mint: #bfe6d0;
    --mint-strong: #4fa984;
    --yellow: #f5cf5b;
    --red: #d94a4a;
    --line: rgba(16, 42, 42, 0.15);
    --shadow: 0 24px 70px rgba(16, 42, 42, 0.12);
    --radius: 24px;
    --font: "Manrope", sans-serif;
    --mono: "DM Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(rgba(16, 42, 42, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 42, 42, 0.035) 1px, transparent 1px),
        var(--paper);
    background-size: 36px 36px;
    font-family: var(--font);
    line-height: 1.5;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }

.hidden { display: none !important; }
.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; }

.ambient {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(1px);
    pointer-events: none;
    opacity: 0.7;
}
.ambient-a { width: 420px; height: 420px; top: -210px; right: 8%; background: radial-gradient(circle, rgba(191,230,208,.8), transparent 68%); }
.ambient-b { width: 360px; height: 360px; bottom: -180px; left: 2%; background: radial-gradient(circle, rgba(245,207,91,.28), transparent 70%); }

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 14px clamp(20px, 4vw, 64px);
    background: rgba(243, 239, 229, 0.86);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.brand { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; }
.brand > span:last-child { display: grid; line-height: 1; }
.brand strong { font-size: 17px; letter-spacing: .22em; }
.brand small { margin-top: 6px; color: var(--ink-soft); font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { display: flex; align-items: flex-end; gap: 3px; width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: var(--ink); }
.brand-mark i { width: 3px; border-radius: 3px; background: var(--paper); animation: signal 1.8s ease-in-out infinite; }
.brand-mark i:nth-child(1) { height: 7px; }
.brand-mark i:nth-child(2) { height: 15px; animation-delay: .18s; }
.brand-mark i:nth-child(3) { height: 10px; animation-delay: .36s; }
@keyframes signal { 0%,100% { transform: scaleY(.7); opacity: .62; } 50% { transform: scaleY(1); opacity: 1; } }

.topbar-status { display: flex; gap: 18px; align-items: center; font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.save-status { display: inline-flex; gap: 7px; align-items: center; color: var(--ink-soft); }
.save-status i { width: 7px; height: 7px; border-radius: 50%; background: #a8ada5; }
.save-status.saved i { background: var(--mint-strong); box-shadow: 0 0 0 4px rgba(79,169,132,.14); }
.stage-label { padding-left: 18px; border-left: 1px solid var(--line); }

.app-shell { width: min(1220px, calc(100% - 40px)); margin: 0 auto; padding: clamp(36px, 6vw, 84px) 0 90px; }
.screen { animation: reveal .5s cubic-bezier(.2,.7,.2,1) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.screen-welcome { display: grid; grid-template-columns: minmax(0, .85fr) minmax(460px, 1fr); gap: clamp(40px, 7vw, 100px); align-items: start; }
.hero-copy { position: sticky; top: 130px; padding-top: 28px; }
.eyebrow { display: block; margin-bottom: 12px; color: var(--signal-dark); font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 22px; font-size: clamp(44px, 7vw, 92px); font-weight: 800; letter-spacing: -.065em; line-height: .96; }
h2 { margin-bottom: 12px; font-size: clamp(24px, 3vw, 36px); letter-spacing: -.045em; line-height: 1.08; }
.hero-lead { max-width: 590px; color: var(--ink-soft); font-size: clamp(17px, 2vw, 21px); line-height: 1.65; }
.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 48px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--line); }
.hero-facts div { display: flex; min-height: 112px; padding: 20px; flex-direction: column; justify-content: space-between; background: rgba(255,253,248,.66); }
.hero-facts strong { font-family: var(--mono); font-size: 24px; font-weight: 500; }
.hero-facts span { color: var(--ink-soft); font-size: 11px; text-transform: uppercase; }

.intake-card, .question-card, .finish-card, .system-message {
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid rgba(16, 42, 42, .12);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.intake-card { padding: clamp(24px, 4vw, 46px); }
.card-heading { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 34px; }
.card-heading h2 { margin: 0; }
.step-number { display: grid; width: 46px; height: 46px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: var(--mono); }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { display: grid; gap: 8px; }
.field-wide { grid-column: 1 / -1; }
.field > span, .result-label { font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.field small { color: #6f7c78; font-weight: 500; }
.field input, .field select, .field textarea, .result-code {
    width: 100%;
    min-height: 50px;
    padding: 13px 15px;
    color: var(--ink);
    background: #fffefb;
    border: 1px solid rgba(16,42,42,.18);
    border-radius: 12px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .result-code:focus { border-color: var(--mint-strong); box-shadow: 0 0 0 4px rgba(79,169,132,.14); }
.checks { display: grid; gap: 14px; margin: 28px 0 18px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; }
.checks legend { padding: 0 8px; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.checks label, .toggle-field { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.checks input, .toggle-field input { width: 18px; height: 18px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--ink); }
.privacy-copy { margin: 0 0 24px; color: #687572; font-size: 11px; line-height: 1.6; }
.privacy-copy a { text-decoration-color: var(--signal); text-underline-offset: 3px; }
.form-error { min-height: 18px; margin: 0 0 12px; color: var(--red); font-size: 13px; font-weight: 700; }

.button { display: inline-flex; min-height: 48px; padding: 12px 19px; align-items: center; justify-content: center; gap: 12px; border: 1px solid transparent; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 800; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-2px); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button-primary { color: #fffaf0; background: var(--ink); box-shadow: 0 10px 25px rgba(16,42,42,.2); }
.button-primary:hover { background: #193b3a; }
.button-outline { color: var(--ink); background: transparent; border-color: rgba(16,42,42,.25); }
.button-outline:hover { background: rgba(255,255,255,.5); }
.button-quiet { background: var(--paper-deep); border-color: transparent; }
.button-full { width: 100%; justify-content: space-between; padding-inline: 24px; }
.button-small { min-height: 38px; padding: 8px 14px; font-size: 11px; }
.button-row { display: flex; gap: 12px; align-items: center; }
.button-row-center { justify-content: center; flex-wrap: wrap; }
.text-button, .text-link { padding: 4px; color: var(--ink-soft); background: none; border: 0; cursor: pointer; font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }

.resume-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; padding: 20px 24px; background: var(--yellow); border: 1px solid rgba(16,42,42,.2); border-radius: 18px; }
.resume-panel .eyebrow { margin-bottom: 4px; color: var(--ink); }

.section-intro { max-width: 780px; margin-bottom: 48px; }
.section-intro h1 { font-size: clamp(46px, 7vw, 82px); }
.section-intro p { max-width: 660px; color: var(--ink-soft); font-size: 18px; }
.manual-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.manual-nav { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 2px; }
.manual-nav > span { margin-right: 4px; color: #74817d; font-family: var(--mono); font-size: 9px; text-transform: uppercase; }
.manual-nav button { min-height: 36px; padding: 7px 13px; color: var(--ink); background: rgba(255,253,248,.7); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 11px; font-weight: 700; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.manual-nav button:hover { transform: translateY(-1px); background: var(--mint); border-color: var(--mint-strong); }
.manual-section { grid-column: span 4; min-height: 280px; padding: 26px; background: rgba(255,253,248,.82); border: 1px solid var(--line); border-radius: 20px; }
.manual-section h3 { margin-bottom: 12px; font-size: 18px; }
.manual-intro { position: relative; grid-column: span 12; min-height: auto; overflow: hidden; padding: clamp(28px, 5vw, 48px); color: var(--paper); background: var(--ink); }
.manual-intro::after { content: "FARO"; position: absolute; right: -12px; bottom: -42px; color: rgba(255,255,255,.045); font-size: clamp(80px, 15vw, 170px); font-weight: 800; letter-spacing: -.08em; line-height: 1; pointer-events: none; }
.manual-intro .eyebrow { color: var(--mint); }
.manual-intro h3 { max-width: 700px; margin-bottom: 12px; font-size: clamp(30px, 5vw, 52px); letter-spacing: -.05em; }
.manual-intro > p { max-width: 800px; margin-bottom: 28px; color: rgba(243,239,229,.78); font-size: 16px; line-height: 1.7; }
.manual-facts { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; }
.manual-facts div { display: grid; min-height: 86px; padding: 16px; align-content: space-between; background: rgba(255,255,255,.055); }
.manual-facts span { color: rgba(243,239,229,.6); font-family: var(--mono); font-size: 9px; text-transform: uppercase; }
.manual-facts strong { color: var(--white); font-size: 18px; }
.manual-description { margin-bottom: 18px; color: #6c7976; font-size: 12px; line-height: 1.6; }
.manual-section ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.manual-section li { position: relative; padding-left: 18px; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.manual-section li::before { content: ""; position: absolute; top: .55em; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.manual-wide { grid-column: 1 / -1; margin-top: 18px; padding: clamp(28px, 5vw, 48px); border: 1px solid var(--line); border-radius: 24px; }
.manual-heading { max-width: 760px; margin-bottom: 30px; }
.manual-heading h2 { margin-bottom: 10px; }
.manual-heading p { color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
.manual-flow { background: rgba(255,253,248,.72); }
.flow-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 16px; }
.flow-step { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; min-height: 170px; padding: 24px; background: var(--white); }
.flow-number { display: grid; width: 38px; height: 38px; place-items: center; color: var(--paper); background: var(--ink); border-radius: 50%; font-family: var(--mono); font-size: 11px; }
.flow-step h3 { margin-bottom: 8px; font-size: 16px; }
.flow-step p { margin-bottom: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.flow-step .flow-when { margin-bottom: 8px; color: var(--signal-dark); font-weight: 700; }
.saved-replies-section { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.saved-replies-section .eyebrow { color: var(--mint); }
.saved-replies-section .manual-heading p { color: rgba(243,239,229,.68); }
.saved-reply-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.saved-reply { padding: 22px; background: rgba(255,255,255,.065); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; }
.saved-reply header { display: grid; gap: 5px; margin-bottom: 16px; }
.saved-reply header span { color: var(--mint); font-family: var(--mono); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.saved-reply header strong { color: var(--white); font-size: 14px; }
.saved-use { color: rgba(243,239,229,.68); font-size: 11px; line-height: 1.55; }
.saved-use b { color: var(--yellow); }
.saved-reply blockquote { margin: 16px 0 0; padding: 16px; color: var(--ink); background: var(--white); border-radius: 12px; font-size: 12px; line-height: 1.65; }
.manual-examples { background: rgba(191,230,208,.24); }
.example-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.example-card { padding: 22px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.example-card h3 { margin-bottom: 16px; font-size: 16px; }
.example-customer { display: grid; gap: 4px; margin-bottom: 16px; padding: 13px; color: var(--ink-soft); background: var(--paper); border-radius: 10px; font-size: 12px; }
.example-customer span { color: #7b8582; font-family: var(--mono); font-size: 8px; text-transform: uppercase; }
.example-answer { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 9px; align-items: start; margin-top: 9px; }
.example-answer > span { display: grid; min-height: 24px; place-items: center; border-radius: 999px; font-family: var(--mono); font-size: 8px; text-transform: uppercase; }
.example-answer p { margin: 2px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.example-answer.is-good > span { color: var(--ink); background: var(--mint); }
.example-answer.is-bad > span { color: white; background: var(--red); }
.example-reason { margin: 18px 0 0; padding-top: 14px; color: #687572; border-top: 1px solid var(--line); font-size: 10px; line-height: 1.55; }
.sticky-action { position: sticky; bottom: 20px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; padding: 16px 18px 16px 24px; color: var(--paper); background: rgba(16,42,42,.96); border-radius: 18px; box-shadow: 0 16px 50px rgba(16,42,42,.25); }
.sticky-action span { max-width: 560px; font-size: 13px; }
.sticky-action .button { color: var(--ink); background: var(--mint); box-shadow: none; }

.assessment-layout { display: grid; grid-template-columns: 270px minmax(0, 720px); gap: clamp(30px, 8vw, 110px); align-items: start; justify-content: center; padding-top: 40px; }
.progress-rail { position: sticky; top: 120px; padding-top: 8px; }
.progress-rail p { color: var(--ink-soft); font-size: 14px; }
.progress-track { height: 6px; margin: 32px 0 10px; overflow: hidden; background: rgba(16,42,42,.12); border-radius: 999px; }
.progress-track i { display: block; width: 10%; height: 100%; background: var(--signal); border-radius: inherit; transition: width .35s ease; }
.progress-rail > strong { font-family: var(--mono); font-size: 12px; }
.progress-rail .button { margin-top: 28px; }
.question-card { min-height: 500px; padding: clamp(28px, 5vw, 56px); }
.question-meta { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 40px; }
.channel-chip { display: inline-flex; padding: 7px 10px; align-items: center; gap: 7px; border-radius: 999px; background: var(--mint); font-family: var(--mono); font-size: 10px; text-transform: uppercase; }
.question-number { color: #78837f; font-family: var(--mono); font-size: 11px; }
.question-card h2 { margin-bottom: 32px; font-size: clamp(25px, 4vw, 42px); line-height: 1.2; }
.question-context { margin: -18px 0 28px; padding: 14px 16px; color: var(--ink-soft); background: var(--paper); border-left: 3px solid var(--yellow); font-size: 13px; }
.option-list { display: grid; gap: 12px; }
.option { display: flex; padding: 17px 18px; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.option:hover { transform: translateX(4px); border-color: var(--mint-strong); }
.option:has(input:checked) { background: var(--mint); border-color: var(--mint-strong); }
.option input { accent-color: var(--ink); }
.answer-area { min-height: 170px !important; font-size: 15px; line-height: 1.7; }
.question-actions { display: flex; justify-content: flex-end; margin-top: 34px; }

.simulation-heading { display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; margin-bottom: 28px; }
.simulation-heading h1 { margin-bottom: 0; font-size: clamp(42px, 6vw, 72px); }
.sim-controls { display: flex; align-items: center; gap: 14px; }
.sim-clock { display: grid; min-width: 132px; padding: 12px 18px; color: var(--paper); background: var(--ink); border-radius: 16px; }
.sim-clock small { color: var(--mint); font-family: var(--mono); font-size: 9px; text-transform: uppercase; }
.sim-clock strong { font-family: var(--mono); font-size: 25px; font-weight: 500; }
.sim-clock.warning { background: var(--signal-dark); }
.simulation-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: min(680px, calc(100vh - 190px)); min-height: 540px; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.inbox-panel { min-width: 0; overflow: hidden; border-right: 1px solid var(--line); }
.inbox-title { display: flex; height: 70px; padding: 0 20px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.inbox-title span { color: var(--signal-dark); font-family: var(--mono); font-size: 10px; text-transform: uppercase; }
.thread-list { height: calc(100% - 70px); overflow-y: auto; }
.thread-item { width: 100%; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 12px; padding: 16px 18px; align-items: center; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.thread-item:hover, .thread-item.active { background: rgba(191,230,208,.3); }
.thread-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: var(--paper); background: var(--ink); font-weight: 800; }
.thread-copy { min-width: 0; }
.thread-copy strong, .thread-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-copy strong { font-size: 13px; }
.thread-copy span { margin-top: 4px; color: #73807c; font-size: 11px; }
.thread-meta { display: grid; justify-items: end; gap: 7px; color: #7f8986; font-family: var(--mono); font-size: 9px; }
.unread-badge { display: grid; min-width: 19px; height: 19px; padding: 0 5px; place-items: center; color: white; background: var(--signal); border-radius: 999px; }
.thread-item.stale .thread-meta { color: var(--red); font-weight: 500; }
.chat-panel, .chat-active { min-width: 0; height: 100%; }
.chat-empty { display: grid; height: 100%; place-content: center; justify-items: center; color: #7e8985; }
.chat-empty span { font-size: 50px; font-weight: 300; }
.chat-active { display: grid; grid-template-rows: 70px minmax(0, 1fr) auto; }
.chat-header { display: flex; padding: 0 22px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.chat-header > div { display: grid; }
.chat-header span { color: var(--signal-dark); font-family: var(--mono); font-size: 9px; text-transform: uppercase; }
.chat-header strong { margin-top: 4px; font-size: 15px; }
.message-list { display: flex; gap: 12px; padding: 26px; flex-direction: column; overflow-y: auto; background: linear-gradient(135deg, rgba(243,239,229,.72), rgba(255,253,248,.65)); }
.message { max-width: min(76%, 540px); padding: 13px 15px; border-radius: 16px; font-size: 13px; line-height: 1.55; }
.message.inbound { align-self: flex-start; background: white; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.message.outbound { align-self: flex-end; color: white; background: var(--ink); border-bottom-right-radius: 4px; }
.message small { display: block; margin-top: 6px; color: #7d8885; font-family: var(--mono); font-size: 8px; text-transform: uppercase; }
.message.outbound small { color: var(--mint); }
.reply-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 16px; border-top: 1px solid var(--line); }
.reply-box textarea { width: 100%; min-height: 54px; max-height: 130px; padding: 14px 16px; resize: none; border: 1px solid var(--line); border-radius: 15px; outline: none; }
.reply-box textarea:focus { border-color: var(--mint-strong); box-shadow: 0 0 0 4px rgba(79,169,132,.12); }
.send-button { align-self: stretch; padding: 0 20px; color: var(--paper); background: var(--signal-dark); border: 0; border-radius: 15px; cursor: pointer; font-size: 12px; font-weight: 800; }
.send-button span { font-size: 18px; }

.guide-drawer { position: fixed; z-index: 100; inset: 0; visibility: hidden; }
.guide-drawer.open { visibility: visible; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(16,42,42,.48); opacity: 0; transition: opacity .25s ease; }
.drawer-panel { position: absolute; top: 0; right: 0; width: min(520px, 92vw); height: 100%; padding: 0 24px 40px; overflow-y: auto; background: var(--paper); box-shadow: -20px 0 60px rgba(16,42,42,.2); transform: translateX(102%); transition: transform .28s cubic-bezier(.2,.7,.2,1); }
.guide-drawer.open .drawer-backdrop { opacity: 1; }
.guide-drawer.open .drawer-panel { transform: translateX(0); }
.drawer-panel > header { position: sticky; top: 0; z-index: 2; display: flex; min-height: 82px; align-items: center; justify-content: space-between; background: rgba(243,239,229,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.drawer-panel > header > div { display: grid; }
.drawer-panel > header .eyebrow { margin-bottom: 3px; }
.drawer-panel > header button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; font-size: 24px; }
.drawer-panel .manual-section { min-height: auto; margin-top: 16px; }
.drawer-panel .manual-nav { position: sticky; top: 82px; z-index: 2; margin: 0 -24px; padding: 12px 24px; background: rgba(243,239,229,.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.drawer-panel .manual-nav > span { display: none; }
.drawer-panel .manual-intro { padding: 26px; }
.drawer-panel .manual-intro h3 { font-size: 32px; }
.drawer-panel .manual-intro > p { font-size: 13px; }
.drawer-panel .manual-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.drawer-panel .manual-facts div { min-height: 72px; }
.drawer-panel .manual-wide { margin-top: 16px; padding: 24px; border-radius: 20px; }
.drawer-panel .manual-heading h2 { font-size: 26px; }
.drawer-panel .flow-list, .drawer-panel .saved-reply-list, .drawer-panel .example-list { grid-template-columns: 1fr; }
.drawer-panel .flow-step { min-height: auto; padding: 18px; }
.drawer-panel .saved-reply, .drawer-panel .example-card { padding: 18px; }

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(16,42,42,.6); backdrop-filter: blur(6px); }
.register-dialog, .import-dialog { width: min(540px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 22px; box-shadow: 0 30px 100px rgba(16,42,42,.35); }
.register-dialog form, .import-dialog form { display: grid; gap: 18px; padding: clamp(24px, 5vw, 40px); background: var(--white); }
.dialog-heading h2 { margin-bottom: 8px; }
.dialog-heading p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.toggle-field { padding: 14px; background: var(--paper); border-radius: 12px; }

.finish-card { max-width: 800px; margin: 10px auto; padding: clamp(34px, 7vw, 74px); text-align: center; }
.finish-card h1 { max-width: 660px; margin-inline: auto; font-size: clamp(42px, 7vw, 72px); }
.finish-card > p { max-width: 630px; margin: 0 auto 28px; color: var(--ink-soft); }
.finish-icon { display: grid; width: 64px; height: 64px; margin: 0 auto 30px; place-items: center; color: var(--ink); background: var(--mint); border-radius: 50%; font-size: 26px; }
.result-label { display: block; margin-bottom: 8px; text-align: left; }
.result-code { margin-bottom: 22px; resize: none; color: #354946; background: var(--paper); font-family: var(--mono); font-size: 10px; line-height: 1.55; word-break: break-all; }
.copy-status { min-height: 24px; margin-top: 18px !important; color: var(--mint-strong) !important; font-weight: 800; }
.system-message { max-width: 720px; margin: 80px auto; padding: 50px; text-align: center; }
.system-message h1 { font-size: clamp(42px, 6vw, 70px); }

@media (max-width: 900px) {
    .screen-welcome { grid-template-columns: 1fr; }
    .hero-copy { position: static; padding-top: 0; }
    .manual-section:not(.manual-intro) { grid-column: span 6; }
    .manual-intro { grid-column: span 12; }
    .example-list { grid-template-columns: 1fr; }
    .assessment-layout { grid-template-columns: 1fr; gap: 24px; padding-top: 0; }
    .progress-rail { position: static; }
    .progress-rail h2, .progress-rail p { margin-bottom: 8px; }
    .progress-track { margin-top: 18px; }
    .simulation-grid { grid-template-columns: 290px minmax(0, 1fr); }
}

@media (max-width: 680px) {
    .topbar { min-height: 64px; padding: 10px 15px; }
    .brand small, .save-status { display: none; }
    .stage-label { padding-left: 0; border: 0; }
    .app-shell { width: min(100% - 24px, 1220px); padding: 30px 0 70px; }
    .screen-welcome { gap: 30px; }
    h1 { font-size: 44px; }
    .hero-facts { margin-top: 28px; }
    .hero-facts div { min-height: 92px; padding: 14px 12px; }
    .hero-facts strong { font-size: 19px; }
    .hero-facts span { font-size: 9px; }
    .intake-card { border-radius: 18px; }
    .field-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .resume-panel, .sticky-action { align-items: stretch; flex-direction: column; }
    .resume-panel .button-row { display: grid; grid-template-columns: 1fr 1fr; }
    .manual-grid { grid-template-columns: 1fr; }
    .manual-section, .manual-intro { grid-column: auto; min-height: auto; }
    .manual-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .flow-list, .saved-reply-list { grid-template-columns: 1fr; }
    .flow-step { min-height: auto; padding: 20px 16px; }
    .manual-wide { padding: 24px 18px; border-radius: 18px; }
    .question-card { min-height: 0; padding: 25px 20px; border-radius: 18px; }
    .question-card h2 { font-size: 26px; }
    .simulation-heading { align-items: stretch; flex-direction: column; }
    .simulation-heading h1 { font-size: 42px; }
    .sim-controls { justify-content: space-between; }
    .simulation-grid { display: block; height: calc(100vh - 245px); min-height: 520px; position: relative; overflow: hidden; }
    .inbox-panel { height: 100%; border: 0; }
    .chat-panel { position: absolute; inset: 0; background: var(--white); transform: translateX(102%); transition: transform .25s ease; }
    .simulation-grid.chat-open .chat-panel { transform: translateX(0); }
    .chat-header::before { content: "‹"; display: grid; width: 32px; height: 32px; margin-right: 8px; place-items: center; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
    .chat-header { justify-content: flex-start; padding: 0 12px; }
    .chat-header > div { margin-right: auto; }
    .chat-header .button { padding: 7px 10px; }
    .message-list { padding: 18px 14px; }
    .message { max-width: 88%; }
    .reply-box { padding: 10px; }
    .send-button { padding: 0 13px; }
    .finish-card { padding: 34px 20px; border-radius: 18px; }
    .finish-card h1 { font-size: 40px; }
    .button-row-center { display: grid; }
    .button-row-center .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
