:root {
  --green: #76b900;
  --green-bright: #8fd400;
  --green-soft: rgba(118, 185, 0, 0.12);
  --ink: #f5f7f2;
  --muted: #939b91;
  --muted-strong: #bcc2b8;
  --canvas: #070907;
  --surface: #0d100d;
  --surface-raised: #131713;
  --surface-soft: #171b17;
  --line: rgba(255, 255, 255, 0.09);
  --danger: #ff685f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(rgba(118,185,0,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118,185,0,.025) 1px, transparent 1px),
    var(--canvas);
  background-size: 44px 44px;
}

button { font: inherit; }
button:focus-visible { outline: 2px solid var(--green-bright); outline-offset: 3px; }

.ambient {
  position: fixed;
  z-index: 0;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  filter: blur(150px);
  pointer-events: none;
}
.ambient-one { top: -440px; left: 7%; background: rgba(118,185,0,.17); }
.ambient-two { right: -480px; bottom: -440px; background: rgba(118,185,0,.08); }

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  min-height: 620px;
}

.topbar {
  flex: 0 0 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 3vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(7,9,7,.82);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-logo-frame { position: relative; display: block; width: 148px; height: 48px; overflow: hidden; }
.brand-logo { position: absolute; top: 50%; left: 50%; width: 202px; max-width: none; height: auto; mix-blend-mode: screen; transform: translate(-50%, -50%); }
.brand-subtitle { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .22em; white-space: nowrap; }

.topbar-meta { display: flex; align-items: center; gap: 18px; }
.session-time { display: flex; align-items: center; gap: 8px; color: var(--muted-strong); font: 600 11px/1 ui-monospace, monospace; letter-spacing: .08em; }
.session-time > span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(118,185,0,.7); }
.status { display: flex; align-items: center; gap: 9px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted-strong); background: rgba(255,255,255,.025); font-size: 10px; font-weight: 600; letter-spacing: .04em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #596058; }
.status[data-state="active"] .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(118,185,0,.11); animation: pulse 1.8s ease-in-out infinite; }
.status[data-state="speaking"] .status-dot { background: var(--green-bright); box-shadow: 0 0 14px rgba(143,212,0,.72); animation: pulse .7s ease-in-out infinite; }
.status[data-state="error"] { color: #ffaaa5; border-color: rgba(255,104,95,.24); }
.status[data-state="error"] .status-dot { background: var(--danger); }

.workspace { flex: 1; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(360px, .8fr); min-height: 0; }
.conversation-panel, .insights-panel { min-width: 0; min-height: 0; }
.conversation-panel { position: relative; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: rgba(10,12,10,.68); }
.insights-panel { display: flex; flex-direction: column; background: rgba(15,18,15,.88); }

.panel-header { flex: 0 0 auto; border-bottom: 1px solid var(--line); }
.conversation-heading { display: flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 58px; padding: 0 clamp(28px, 4vw, 64px); }
.eyebrow { display: block; margin-bottom: 13px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .2em; }
.transcript-label { display: flex; align-items: center; gap: 9px; color: var(--muted-strong); font-size: 9px; font-weight: 760; letter-spacing: .16em; text-transform: uppercase; }
.transcript-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(118,185,0,.55); }
.quiet-button { flex: 0 0 auto; padding: 7px 0; border: 0; color: var(--muted); background: transparent; font-size: 10px; cursor: pointer; }
.quiet-button:hover { color: var(--green-bright); }

.transcript { flex: 1; min-height: 0; padding: 32px clamp(28px, 4vw, 64px) 140px; overflow-y: auto; scroll-behavior: smooth; scrollbar-color: rgba(118,185,0,.28) transparent; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; padding-bottom: 36px; text-align: center; }
.empty-state h2 { margin: 22px 0 7px; font-size: 18px; font-weight: 560; letter-spacing: -.02em; }
.empty-state p { max-width: 360px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.voice-orb { display: flex; align-items: center; justify-content: center; gap: 4px; width: 74px; height: 74px; border: 1px solid rgba(118,185,0,.24); border-radius: 50%; background: radial-gradient(circle, rgba(118,185,0,.14), rgba(118,185,0,.03) 66%); box-shadow: 0 0 42px rgba(118,185,0,.08); }
.voice-orb span { width: 2px; height: 12px; border-radius: 3px; background: var(--green); }
.voice-orb span:nth-child(2), .voice-orb span:nth-child(4) { height: 23px; }
.voice-orb span:nth-child(3) { height: 34px; }

.message { display: flex; gap: 11px; max-width: min(760px, 88%); margin: 0 0 24px; animation: message-in .24s ease-out; }
.message.user { flex-direction: row-reverse; margin-left: auto; }
.message-avatar { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(118,185,0,.25); border-radius: 4px; color: var(--green-bright); background: var(--green-soft); font-size: 9px; font-weight: 800; letter-spacing: .07em; }
.message.user .message-avatar { border-color: transparent; color: #11150d; background: var(--green); }
.message-content { min-width: 0; }
.message-meta { display: flex; gap: 8px; align-items: center; min-height: 18px; margin: 0 0 5px; color: #6f776e; font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.message.user .message-meta { justify-content: flex-end; }
.message-bubble { padding: 13px 16px; border: 1px solid var(--line); border-radius: 3px 15px 15px 15px; color: #e7eae4; background: var(--surface-raised); box-shadow: 0 10px 30px rgba(0,0,0,.12); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.message.user .message-bubble, .message.assistant.pending .message-bubble { white-space: pre-wrap; }
.message.user .message-bubble { border-color: rgba(118,185,0,.7); border-radius: 15px 3px 15px 15px; color: #0a0d08; background: var(--green); }
.message.assistant .message-bubble > :first-child { margin-top: 0; }
.message.assistant .message-bubble > :last-child { margin-bottom: 0; }
.message.assistant .message-bubble p { margin: 0 0 .78em; }
.message.assistant .message-bubble h1,
.message.assistant .message-bubble h2,
.message.assistant .message-bubble h3,
.message.assistant .message-bubble h4 { margin: 1em 0 .45em; color: #f5f7f2; font-weight: 680; line-height: 1.25; }
.message.assistant .message-bubble h1 { font-size: 1.3em; }
.message.assistant .message-bubble h2 { font-size: 1.18em; }
.message.assistant .message-bubble h3,
.message.assistant .message-bubble h4 { font-size: 1.05em; }
.message.assistant .message-bubble ul,
.message.assistant .message-bubble ol { margin: .55em 0 .85em; padding-left: 1.45em; }
.message.assistant .message-bubble li { margin: .28em 0; padding-left: .12em; }
.message.assistant .message-bubble li::marker { color: var(--green); }
.message.assistant .message-bubble strong { color: #fff; font-weight: 720; }
.message.assistant .message-bubble a { color: var(--green-bright); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.message.assistant .message-bubble code { padding: .13em .38em; border: 1px solid rgba(118,185,0,.16); border-radius: 4px; color: #d9f7a7; background: #090c09; font: .88em/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.message.assistant .message-bubble pre { max-width: 100%; margin: .75em 0; padding: 12px 13px; overflow-x: auto; border: 1px solid rgba(118,185,0,.16); border-radius: 7px; background: #090c09; }
.message.assistant .message-bubble pre code { padding: 0; border: 0; background: transparent; white-space: pre; }
.message.assistant .message-bubble blockquote { margin: .75em 0; padding: .15em 0 .15em .85em; border-left: 2px solid var(--green); color: var(--muted-strong); }
.message.assistant .message-bubble hr { height: 1px; margin: 1em 0; border: 0; background: var(--line); }
.message.assistant .message-bubble table { display: block; max-width: 100%; margin: .75em 0; overflow-x: auto; border-collapse: collapse; font-size: .88em; }
.message.assistant .message-bubble th,
.message.assistant .message-bubble td { padding: 6px 9px; border: 1px solid rgba(255,255,255,.11); text-align: left; vertical-align: top; }
.message.assistant .message-bubble th { color: var(--green-bright); background: rgba(118,185,0,.07); font-weight: 680; }
.message.pending .message-bubble::after { content: ""; display: inline-block; width: 5px; height: 12px; margin-left: 4px; border-radius: 1px; vertical-align: -1px; background: currentColor; opacity: .48; animation: blink .8s steps(2) infinite; }
.message.assistant.pending:has(.message-bubble:empty) .message-bubble { display: flex; align-items: center; gap: 5px; min-width: 62px; min-height: 44px; }
.message.assistant.pending:has(.message-bubble:empty) .message-bubble::before { content: "•••"; color: var(--green); letter-spacing: .2em; animation: fade 1.1s ease-in-out infinite; }
.message.assistant.pending:has(.message-bubble:empty) .message-bubble::after { display: none; }

.call-dock { position: absolute; z-index: 3; left: clamp(24px, 4vw, 64px); right: clamp(24px, 4vw, 64px); bottom: 22px; display: flex; align-items: center; gap: 10px; min-height: 78px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.11); border-radius: 15px; background: rgba(18,22,18,.9); box-shadow: 0 20px 60px rgba(0,0,0,.42); backdrop-filter: blur(18px); }
.icon-button { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted-strong); background: #0c0f0c; cursor: pointer; }
.icon-button:hover:not(:disabled) { color: var(--green); border-color: rgba(118,185,0,.35); }
.icon-button:disabled { opacity: .38; cursor: not-allowed; }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-button .mic-off { display: none; }
.icon-button.is-muted { color: #ffaaa5; border-color: rgba(255,104,95,.3); }
.icon-button.is-muted .mic-on { display: none; }
.icon-button.is-muted .mic-off { display: block; }
.call-button { display: flex; align-items: center; gap: 12px; min-width: 212px; height: 52px; padding: 0 19px 0 9px; border: 0; border-radius: 11px; color: #0b0e09; background: var(--green); box-shadow: 0 9px 25px rgba(118,185,0,.13); cursor: pointer; transition: transform .16s ease, background .16s ease; }
.call-button:hover:not(:disabled) { transform: translateY(-1px); background: var(--green-bright); }
.call-button:disabled { opacity: .62; cursor: wait; }
.call-button-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: rgba(6,9,5,.1); }
.call-button-icon svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.call-button > span:last-child { display: flex; flex-direction: column; align-items: flex-start; }
.call-button strong { font-size: 12px; font-weight: 760; }
.call-button small { margin-top: 2px; font-size: 8px; font-weight: 600; opacity: .65; }
.call-button .end-icon { display: none; }
.call-button.is-active { color: #f8f9f5; background: #242a24; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.call-button.is-active:hover { background: #303730; }
.call-button.is-active .start-icon { display: none; }
.call-button.is-active .end-icon { display: block; }
.dock-copy { display: flex; align-items: center; gap: 7px; margin-left: auto; padding-right: 9px; color: #737b72; font-size: 9px; white-space: nowrap; }
.lock-dot { width: 6px; height: 6px; border-radius: 50%; background: #4e574d; }

.insights-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: clamp(30px, 4.3vh, 54px) clamp(25px, 3vw, 44px) 30px; }
.insights-heading p { max-width: 360px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.phase-pill { flex: 0 0 auto; padding: 6px 8px; border: 1px solid rgba(118,185,0,.25); border-radius: 4px; color: var(--green); background: rgba(118,185,0,.06); font-size: 7px; font-weight: 800; letter-spacing: .16em; }
.phase-pill[data-state="updating"] { color: var(--green-bright); animation: pulse 1s ease-in-out infinite; }
.phase-pill[data-state="current"] { color: #0a0d08; border-color: var(--green); background: var(--green); }
.phase-pill[data-state="error"] { color: #ffaaa5; border-color: rgba(255,104,95,.3); background: rgba(255,104,95,.06); }
.insights-body { flex: 1; min-height: 0; padding: 27px clamp(25px, 3vw, 44px); overflow-y: auto; }
.requirements-stream { display: grid; gap: 10px; }
.requirements-placeholder { display: flex; min-height: 220px; padding: 32px 28px; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed rgba(118,185,0,.18); border-radius: 11px; text-align: center; background: rgba(118,185,0,.018); }
.requirements-placeholder-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 14px; border: 1px solid rgba(118,185,0,.28); border-radius: 50%; color: var(--green); background: rgba(118,185,0,.07); font: 300 22px/1 ui-monospace, monospace; }
.requirements-placeholder h3 { margin: 0 0 7px; color: #b8beb4; font-size: 12px; font-weight: 620; }
.requirements-placeholder p { max-width: 280px; margin: 0; color: #626a61; font-size: 9px; line-height: 1.55; }
.requirement-item { position: relative; padding: 16px 16px 17px 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.018); transition: border-color .25s ease, background .25s ease, transform .25s ease; }
.requirement-item::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: rgba(118,185,0,.58); }
.requirement-item::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 28%, rgba(143,212,0,.18) 48%, rgba(143,212,0,.04) 58%, transparent 72%); opacity: 0; transform: translateX(-125%); }
.requirement-item.is-new { animation: requirement-in .42s ease-out, discovery-pulse 1.4s cubic-bezier(.2,.8,.2,1); }
.requirement-item.is-new::before { animation: discovery-rail 1.4s cubic-bezier(.2,.8,.2,1); }
.requirement-item.is-new::after { animation: discovery-sheen 1.05s ease-out .08s; }
.requirement-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.requirement-section { color: var(--green); font-size: 7px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.requirement-evidence { padding: 3px 5px; border-radius: 3px; color: #777f75; background: rgba(255,255,255,.045); font-size: 6px; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; }
.requirement-evidence.inferred { color: #c8a665; background: rgba(200,166,101,.08); }
.requirement-item p { margin: 0; color: #e1e5dd; font-size: 13px; font-weight: 560; line-height: 1.5; overflow-wrap: anywhere; }
.future-note { display: grid; grid-template-columns: 22px 1fr; gap: 11px; align-items: start; margin-top: 25px; color: #626a61; }
.future-line { width: 22px; height: 1px; margin-top: 7px; background: rgba(118,185,0,.5); }
.future-note p { margin: 0; font-size: 8px; line-height: 1.55; }

.toast { position: fixed; z-index: 20; left: 50%; bottom: 26px; max-width: min(440px, calc(100vw - 36px)); padding: 12px 16px; border: 1px solid rgba(255,104,95,.32); border-radius: 9px; color: #ffd3d0; background: rgba(44,15,13,.95); box-shadow: 0 16px 48px rgba(0,0,0,.4); font-size: 11px; line-height: 1.45; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .18s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes pulse { 50% { opacity: .55; transform: scale(.85); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes fade { 50% { opacity: .35; } }
@keyframes message-in { from { opacity: 0; transform: translateY(7px); } }
@keyframes requirement-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes discovery-pulse {
  0% { border-color: rgba(118,185,0,.2); background: rgba(118,185,0,.025); box-shadow: 0 0 0 rgba(118,185,0,0); }
  22% { border-color: rgba(143,212,0,.82); background: rgba(118,185,0,.12); box-shadow: 0 0 0 1px rgba(143,212,0,.16), 0 0 30px rgba(118,185,0,.22); }
  58% { border-color: rgba(118,185,0,.5); background: rgba(118,185,0,.065); box-shadow: 0 0 18px rgba(118,185,0,.1); }
  100% { border-color: var(--line); background: rgba(255,255,255,.018); box-shadow: 0 0 0 rgba(118,185,0,0); }
}
@keyframes discovery-rail {
  0%, 100% { width: 2px; background: rgba(118,185,0,.58); box-shadow: none; }
  24% { width: 4px; background: var(--green-bright); box-shadow: 0 0 14px rgba(143,212,0,.7); }
}
@keyframes discovery-sheen {
  0% { opacity: 0; transform: translateX(-125%); }
  22% { opacity: .9; }
  100% { opacity: 0; transform: translateX(125%); }
}

@media (max-width: 1040px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; }
  .workspace { grid-template-columns: 1fr; }
  .conversation-panel { min-height: calc(100vh - 76px); border-right: 0; }
  .insights-panel { min-height: 560px; border-top: 1px solid var(--line); }
  .call-dock { position: fixed; left: 20px; right: 20px; }
}

@media (max-width: 640px) {
  .topbar { flex-basis: 64px; padding: 0 17px; }
  .brand { gap: 7px; }
  .brand-logo-frame { width: 118px; height: 42px; }
  .brand-logo { width: 165px; }
  .brand-subtitle { font-size: 6px; letter-spacing: .16em; }
  .status { max-width: 120px; overflow: hidden; }
  .status span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .session-time { display: none !important; }
  .conversation-heading { min-height: 52px; padding: 0 20px; }
  .quiet-button { font-size: 0; }
  .quiet-button::after { content: "Clear"; font-size: 9px; }
  .transcript { padding: 24px 18px 132px; }
  .message { max-width: 94%; }
  .message-bubble { font-size: 13px; }
  .call-dock { left: 10px; right: 10px; bottom: 10px; min-height: 70px; padding: 9px; }
  .icon-button { width: 44px; height: 44px; }
  .call-button { flex: 1; min-width: 0; height: 48px; padding-right: 12px; }
  .dock-copy { display: none; }
  .insights-heading, .insights-body { padding-left: 20px; padding-right: 20px; }
}

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