/* aivance identity, without wordmark or signet.
   Five greys, one evidence amber. Amber marks only what is sourced, verified or active.
   Instrument Sans for display and text, IBM Plex Mono for sources and measurements. */
:root {
  /* Dark, futuristic shell. Amber still marks only what is sourced, verified or active. */
  --canvas: #0d0e14;
  --surface: rgba(22, 23, 31, 0.78);
  --surface-solid: #16171f;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  --muted: #a6a7b4;
  --faint: #767786;
  --ink: #f1f1f5;
  --amber: #F0A75C;
  --amber-dark: #F6BC7F;
  --amber-surface: rgba(240, 167, 92, 0.12);
  --amber-line: rgba(240, 167, 92, 0.35);
  --on-amber: #1A1208;
  --red: #FF8A80;
  --red-surface: rgba(255, 138, 128, 0.10);
  --glass: rgba(18, 19, 26, 0.72);
  --glass-strong: rgba(14, 15, 21, 0.95);
  --glow: 0 0 0 1px rgba(255,255,255,.06), 0 30px 80px -20px rgba(80, 90, 255, .35), 0 10px 30px -10px rgba(0,0,0,.6);
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: #07080d;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mono-label {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* Top bar */
.topbar-inner {
  max-width: 1320px; margin: 0 auto;
  padding: 14px max(20px, env(safe-area-inset-right, 0px)) 14px max(20px, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.product { font-weight: 600; letter-spacing: -0.02em; font-size: 16px; }
.topbar-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.sep { color: var(--line-strong); }

/* Layout */
.layout {
  max-width: 1320px; margin: 0 auto;
  padding: 32px max(20px, env(safe-area-inset-right, 0px)) 48px max(20px, env(safe-area-inset-left, 0px));
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; align-items: start;
}
.col-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.col-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 72px; max-height: calc(100vh - 88px); min-width: 0; }
@media (max-width: 1040px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-side { position: static; max-height: none; }
}

.intro { display: flex; flex-direction: column; gap: 10px; max-width: 62ch; }
h1 {
  font-size: clamp(30px, 4vw, 44px); font-weight: 600; letter-spacing: -0.055em; line-height: 1.05;
  margin: 0; text-wrap: balance;
}
h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.035em; margin: 0; line-height: 1.2; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.lede { color: var(--muted); margin: 0; font-size: 16px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.empty p:last-child { margin: 8px 0 0; color: var(--muted); }

/* Buttons */
.btn {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius);
  padding: 9px 14px; cursor: pointer; font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--ink); }
.btn:focus-visible, .chip:focus-visible, .fig:focus-visible, .dropzone:focus-within { outline: 2px solid var(--amber); outline-offset: 2px; }
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }
.btn-primary:hover { background: var(--amber-dark); border-color: var(--amber-dark); }
.btn-primary[data-active="true"] { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; padding: 12px 14px; }
.btn[disabled] { opacity: .55; cursor: wait; }

/* Upload */
.upload { display: flex; flex-direction: column; gap: 14px; }
.dropzone {
  display: flex; flex-direction: column; gap: 4px; padding: 22px; border: 1px dashed var(--line-strong);
  border-radius: var(--radius); cursor: pointer; background: var(--canvas); transition: border-color .15s, background .15s;
}
.dropzone.is-over { border-color: var(--amber); background: var(--amber-surface); }
.dz-title { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.dz-hint { color: var(--muted); font-size: 14px; }
.upload-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 16px; }
.steps:empty { display: none; }
.steps li { font-family: var(--mono); font-size: 12.5px; color: var(--faint); display: flex; gap: 8px; }
.steps li.done { color: var(--ink); }
.steps li.done::before { content: "✓"; color: var(--amber); }
.steps li.pending::before { content: "·"; }
.steps li.active::before { content: "→"; color: var(--ink); }
.error { color: var(--red); font-size: 14px; margin: 0; }

/* Report */
#report { display: flex; flex-direction: column; gap: 20px; }
.asset { display: flex; flex-direction: column; gap: 20px; }
.asset-head { display: flex; flex-direction: column; gap: 4px; }
.asset-head .addr { color: var(--muted); margin: 0; }
.mock-note { font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; background: var(--canvas); margin: 0; }

.verdict { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px 28px; align-items: start; }
@media (max-width: 640px) { .verdict { grid-template-columns: minmax(0, 1fr); } }
.decision { font-size: 64px; font-weight: 600; letter-spacing: -0.06em; line-height: .9; }
.decision[data-d="NO-GO"] { color: var(--red); }
.verdict-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.reasons { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.coverage { display: flex; flex-direction: column; gap: 6px; }
.coverage-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; display: flex; }
.coverage-bar span { display: block; height: 100%; background: var(--amber); }
.coverage-text { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.scenario-note { font-family: var(--mono); font-size: 12px; border: 1px solid var(--amber-line); background: var(--amber-surface); color: var(--ink); border-radius: var(--radius); padding: 8px 12px; display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.scenario-note button { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; background: none; border: 0; color: var(--amber); cursor: pointer; padding: 0; }

.section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }

.fig {
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  transition: border-color .15s, box-shadow .2s, background .2s;
}
.fig:hover { border-color: var(--line-strong); }
.fig .lbl { font-size: 13px; color: var(--muted); }
.fig .val { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; overflow-wrap: anywhere; }
.fig .src { font-family: var(--mono); font-size: 11.5px; color: var(--faint); overflow-wrap: anywhere; }
.fig.sourced .src { color: var(--amber); }
.fig[data-status="red"] { border-color: var(--red); background: var(--red-surface); }
.fig[data-status="red"] .src { color: var(--red); }
.fig.is-selected { border-color: var(--ink); }
.fig.is-highlighted { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-surface); }
.fig .changed { font-family: var(--mono); font-size: 11px; color: var(--ink); }
sup.ref { font-family: var(--mono); font-size: 10.5px; color: var(--amber); margin-left: 2px; font-weight: 500; letter-spacing: 0; }
sup.ref.none { color: var(--faint); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--line); }
thead th { border-top: 0; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: var(--canvas); }
td.num { font-variant-numeric: tabular-nums; }
td .fig-inline { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; }
td .fig-inline.is-highlighted { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }
.muted { color: var(--muted); }

.sources { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-family: var(--mono); font-size: 12.5px; }
.sources li { display: flex; gap: 10px; }
.sources .n { color: var(--amber); min-width: 44px; }
.sources .n.none { color: var(--faint); }

/* Side column */
.inspector { display: flex; flex-direction: column; gap: 12px; }
.inspector-empty p { margin: 0; color: var(--muted); }
.chain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.chain li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.chain li:first-child { border-top: 0; padding-top: 0; }
.chain .k { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.chain .v { min-width: 0; overflow-wrap: anywhere; }
.chain .v.big { font-size: 20px; font-weight: 600; letter-spacing: -0.03em; }
.chain .v.mono { font-family: var(--mono); font-size: 13px; }
.chain .v.amber { color: var(--amber); }
.tag { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.tag.verified { border-color: var(--amber); color: var(--amber); background: var(--amber-surface); }
.tag.contradicted { border-color: var(--red); color: var(--red); background: var(--red-surface); }

.voice { display: flex; flex-direction: column; gap: 12px; min-height: 0; flex: 1 1 auto; }
.voice-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.voice-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.voice-status { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding-top: 2px; }
.voice-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.voice-status[data-state="connecting"] .dot { background: var(--muted); animation: pulse 1s infinite; }
.voice-status[data-state="listening"] .dot { background: var(--ink); }
.voice-status[data-state="speaking"] .dot { background: var(--amber); animation: pulse .8s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.meter { display: flex; gap: 4px; align-items: center; height: 28px; }
.meter span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: height .08s linear, background .2s; }
.meter.speaking span { background: var(--amber); }
.meter.listening span { background: var(--ink); }

.suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--canvas); border-radius: 999px; padding: 5px 11px; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--line-strong); }

.transcript { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 80px; max-height: 340px; }
.transcript:empty::before { content: "The conversation appears here."; color: var(--faint); font-size: 14px; }
.transcript li { display: flex; flex-direction: column; gap: 2px; }
.transcript .who { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.transcript li.agent .who { color: var(--amber); }
.transcript li.tool { font-family: var(--mono); font-size: 12px; color: var(--muted); flex-direction: row; gap: 6px; }
.transcript li.tool::before { content: "→"; color: var(--amber); }
.transcript .txt { font-size: 14.5px; }

.ask { display: flex; gap: 8px; }
.ask input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--canvas); border-radius: var(--radius); padding: 9px 12px; font-size: 14px; }
.ask input:focus { outline: 2px solid var(--amber); outline-offset: 1px; }

.footer { max-width: 1320px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-right, 0px)) 32px max(20px, env(safe-area-inset-left, 0px)); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.decision.long { font-size: 36px; letter-spacing: -0.045em; max-width: 7em; }

/* =====================================================================
   Chat-first shell
   ===================================================================== */
[hidden] { display: none !important; }

/* Aurora background: dark sky, colour rising from the horizon */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 70% at 50% 0%, #0b0d18 0%, #07080d 55%, #07080d 100%); }
.aurora .blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .75; mix-blend-mode: screen; will-change: transform; }
.aurora .b1 { width: 70vmax; height: 46vmax; left: -18vmax; bottom: -20vmax; background: #3b5bff; animation: drift1 22s ease-in-out infinite alternate; }
.aurora .b2 { width: 60vmax; height: 42vmax; right: -16vmax; bottom: -18vmax; background: #c03cff; animation: drift2 26s ease-in-out infinite alternate; }
.aurora .b3 { width: 54vmax; height: 36vmax; left: 22vw; bottom: -26vmax; background: #ff4d8d; opacity: .6; animation: drift3 30s ease-in-out infinite alternate; }
.aurora .b4 { width: 40vmax; height: 26vmax; left: 34vw; bottom: -22vmax; background: #ff8a4c; opacity: .45; animation: drift1 34s ease-in-out infinite alternate-reverse; }
.aurora .horizon { position: absolute; left: -10%; right: -10%; bottom: 0; height: 55%;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 64px 64px; transform: perspective(600px) rotateX(62deg); transform-origin: bottom;
  mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 85%); -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 85%); }
.aurora .grain { position: absolute; inset: 0; opacity: .14; mix-blend-mode: overlay;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes drift1 { to { transform: translate3d(8vw, -6vh, 0) scale(1.08); } }
@keyframes drift2 { to { transform: translate3d(-10vw, -4vh, 0) scale(1.12); } }
@keyframes drift3 { to { transform: translate3d(-6vw, -8vh, 0) scale(.92); } }

/* Top bar */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 30; }
.topbar-inner { max-width: none; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 14px max(16px, env(safe-area-inset-left, 0px)); }
.brand { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px; cursor: pointer; font-weight: 600; letter-spacing: -0.02em; font-size: 15px; }
.brand-mark { width: 22px; height: 22px; border-radius: 7px; background: conic-gradient(from 210deg, #3b5bff, #c03cff, #ff4d8d, #ff8a4c, #3b5bff); box-shadow: 0 0 18px rgba(140, 90, 255, .6); }
.topbar-actions { display: flex; gap: 8px; }
.pill { border: 1px solid var(--line-strong); background: rgba(255,255,255,.04); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 999px; padding: 7px 14px; font-size: 13.5px; cursor: pointer; transition: background .15s, border-color .15s; }
.pill:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.3); }

/* Stage */
.stage { position: relative; z-index: 1; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 88px 16px 40px; gap: 26px; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; max-width: 820px; transition: opacity .3s, transform .3s; }
.hero h1 { font-size: clamp(32px, 5.2vw, 56px); letter-spacing: -0.045em; line-height: 1.04; font-weight: 600;
  background: linear-gradient(180deg, #ffffff 30%, #c9cbe0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { margin: -6px 0 0; color: var(--muted); font-size: 16px; max-width: 54ch; }
.announce { display: inline-flex; align-items: center; gap: 12px; padding: 7px 16px 7px 7px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: rgba(20,21,30,.6); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 14.5px; font-weight: 500; transition: border-color .15s, transform .15s; margin-bottom: 4vh; }
.announce:hover { border-color: rgba(255,255,255,.35); transform: translateY(-1px); }
.announce-icons { display: inline-flex; }
.ai-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: #fff;
  border: 2px solid #12131a; margin-left: -7px; }
.ai-dot:first-child { margin-left: 0; }
.ai-dot.outlook { background: #0a64d8; }
.ai-dot.dealroom { background: #4a3aff; }
.ai-dot.grok { background: #111; border-color: #2a2b33; }

/* Composer */
.composer-wrap { width: 100%; max-width: 760px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.composer { position: relative; width: 100%; border-radius: 28px; padding: 18px 14px 12px 22px; background: var(--glass); border: 1px solid var(--line-strong);
  backdrop-filter: blur(28px) saturate(140%); -webkit-backdrop-filter: blur(28px) saturate(140%); box-shadow: var(--glow); transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: rgba(160, 150, 255, .45); box-shadow: 0 0 0 4px rgba(120, 110, 255, .12), var(--glow); }
.composer textarea { width: 100%; resize: none; border: 0; outline: 0; background: transparent; font-size: 17px; line-height: 1.5; min-height: 30px; max-height: 220px; padding: 0 8px 0 0; }
.composer textarea::placeholder { color: #8d8e9c; }
.composer-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.spacer { flex: 1; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; border: 1px solid transparent; background: transparent; color: #d8d9e3; transition: background .15s, border-color .15s; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: rgba(255,255,255,.08); border-color: var(--line); }
.icon-btn:focus-visible, .send-btn:focus-visible, .pill:focus-visible, .quick-chip:focus-visible, .menu button:focus-visible { outline: 2px solid #9f95ff; outline-offset: 2px; }
.icon-btn.mic[aria-pressed="true"] { background: rgba(240,167,92,.16); border-color: var(--amber-line); color: var(--amber); animation: pulse 1.4s infinite; }
.send-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 0; cursor: pointer; background: #f4f4f8; color: #0b0c12; transition: transform .15s, opacity .15s; }
.send-btn:hover:not([disabled]) { transform: scale(1.06); }
.send-btn[disabled] { opacity: .3; cursor: default; }
.composer.is-busy .send-btn { animation: pulse 1s infinite; }
.drop-hint { position: absolute; inset: 0; border-radius: inherit; display: none; place-items: center; font-weight: 500; background: rgba(60, 60, 140, .55); border: 1.5px dashed rgba(255,255,255,.6); }
.composer.is-over .drop-hint { display: grid; }

.conn { display: flex; gap: 6px; flex-wrap: wrap; }
.conn span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #cfd0dc; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.conn span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 8px #4ade80; }

/* + menu */
.plus-wrap { position: relative; }
.menu { position: absolute; left: -6px; bottom: calc(100% + 10px); width: 320px; max-width: calc(100vw - 40px); padding: 6px; border-radius: 16px; z-index: 20;
  background: var(--glass-strong); border: 1px solid var(--line-strong); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: 0 20px 60px rgba(0,0,0,.55);
  animation: pop .14s ease-out; }
/* menu opens upward everywhere (it overflowed the viewport on the home screen) */
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } }
.menu button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; }
.menu button:hover { background: rgba(255,255,255,.07); }
.mi-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.06); border: 1px solid var(--line); flex: none; }
.mi-icon.brand-outlook { color: #4ea1ff; }
.mi-icon.brand-dealroom { color: #8f86ff; }
.mi-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mi-text strong { font-weight: 500; font-size: 14.5px; }
.mi-text small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-badge { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: #dcdcea; flex: none; }
.mi-badge.on { border-color: rgba(74,222,128,.45); color: #86efac; background: rgba(74,222,128,.08); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* Quick actions */
.quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.quick-chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; cursor: pointer; font-size: 14px;
  border: 1px solid var(--line-strong); background: rgba(24, 22, 48, .55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: background .15s, border-color .15s, transform .15s; }
.quick-chip:hover { background: rgba(60, 55, 120, .6); border-color: rgba(255,255,255,.3); transform: translateY(-1px); }

/* Chat thread */
.thread { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 760px; display: none; flex-direction: column; gap: 18px; }
body.chatting .stage { justify-content: flex-end; padding-bottom: 20px; }
body.chatting .hero { display: none; }
body.chatting .thread { display: flex; flex: 1; justify-content: flex-end; }
body.chatting .composer-wrap { position: sticky; bottom: 16px; }
body.chatting .quick { display: none; }
.msg { display: flex; flex-direction: column; gap: 10px; animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.msg.user { align-self: flex-end; max-width: 82%; padding: 11px 16px; border-radius: 20px 20px 6px 20px; background: rgba(255,255,255,.1); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.assistant { align-self: stretch; padding: 16px 18px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.msg.voice-line { font-size: 14.5px; }
.msg .who { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 20px; }
.md li { margin: 2px 0; }
.md h3, .md h4 { margin: 14px 0 6px; font-size: 15.5px; }
.md code { font-family: var(--mono); font-size: 13px; background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 5px; }
.md a { color: #b4adff; }
.md strong { color: #fff; }
.msg.error { border-color: rgba(255,138,128,.4); color: #ffc4be; }
.tool-trail { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-trail span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; }
.tool-trail span::before { content: "→ "; color: var(--amber); }
.typing { display: inline-flex; gap: 5px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #b9b5ff; animation: bounce 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 50% { transform: translateY(-5px); opacity: .5; } }

/* Email + report cards inside the thread */
.emails { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.email { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.email .subj { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email .meta { grid-column: 1; font-size: 12.5px; color: var(--muted); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email .prev { grid-column: 1; font-size: 13.5px; color: #c4c5d2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.email button { grid-column: 2; grid-row: 1 / span 3; }
.btn-glow { border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer; font-weight: 500; font-size: 13.5px; color: #fff;
  background: linear-gradient(135deg, #4a5cff, #b34cff 55%, #ff5d8f); box-shadow: 0 6px 20px -6px rgba(150, 80, 255, .7); transition: transform .15s, filter .15s; white-space: nowrap; }
.btn-glow:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn-glow[disabled] { opacity: .5; cursor: wait; transform: none; }
.report-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.report-card .rc-verdict { font-size: 28px; font-weight: 600; letter-spacing: -0.04em; }
.report-card .rc-verdict[data-d="NO-GO"] { color: var(--red); }
.report-card .rc-verdict[data-d="GO"] { color: #86efac; }
.msg .steps { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* Report workspace overlay */
.workspace { position: fixed; inset: 0; z-index: 25; overflow-y: auto; background: rgba(7, 8, 13, .82); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); animation: fadein .2s ease-out; }
@keyframes fadein { from { opacity: 0; } }
.workspace-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  max-width: 1320px; margin: 0 auto; padding: 66px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); }
.workspace .layout { padding-top: 8px; }
.workspace .col-side { top: 110px; max-height: calc(100vh - 126px); }
.workspace .card, .workspace .fig, .workspace .table-wrap { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
body.report-open { overflow: hidden; }

/* Toast */
.toast { position: fixed; z-index: 40; left: 50%; top: 70px; transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; font-size: 14px; max-width: calc(100vw - 32px);
  background: var(--glass-strong); border: 1px solid var(--line-strong); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); animation: pop .2s ease-out; }
.toast.err { border-color: rgba(255,138,128,.5); color: #ffc4be; }

@media (max-width: 640px) {
  .stage { padding-top: 76px; }
  .announce { margin-bottom: 1vh; font-size: 13.5px; }
  .hero-sub { font-size: 15px; }
  .composer { border-radius: 22px; padding: 14px 10px 10px 16px; }
  .composer textarea { font-size: 16px; }
  .email { grid-template-columns: minmax(0, 1fr); }
  .email button { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 6px; }


}
/* the composer is its own stacking context (backdrop-filter); keep its menu above the chips */
.composer { z-index: 3; }
.quick { position: relative; z-index: 1; }

/* dealt wordmark: Instrument Sans Bold, evidence-amber dot in the bowl of the "d" */
.wordmark { position: relative; display: inline-block; font-family: var(--sans); font-weight: 700; letter-spacing: -0.015em; line-height: 1; color: #f0eff5; font-size: 26px; }
.wm-dot { position: absolute; left: var(--dot-x, .30em); top: var(--dot-y, .612em); width: .115em; height: .115em; border-radius: 50%; background: var(--amber); transform: translate(-50%, -50%); }
.brand .wordmark { font-size: 26px; }
.wordmark-hero { font-size: clamp(56px, 8vw, 92px); margin-bottom: -4px; }

/* =====================================================================
   White theme: overrides the dark shell above. Keep this block last.
   ===================================================================== */
:root {
  --canvas: #fafafa;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --line: #ececef;
  --line-strong: #dedee3;
  --muted: #6b6c76;
  --faint: #9a9ba5;
  --ink: #111216;
  --amber: #c9771f;
  --amber-dark: #a8620f;
  --amber-surface: #fdf4ea;
  --amber-line: #f0cfa8;
  --on-amber: #ffffff;
  --red: #d93b30;
  --red-surface: #fdf0ef;
  --green: #16a34a;
  --glass: #ffffff;
  --glass-strong: #ffffff;
  --glow: 0 1px 2px rgba(17,18,22,.04), 0 8px 28px -12px rgba(17,18,22,.12);
  color-scheme: light;
}
body { background: #ffffff; color: var(--ink); }
.topbar { background: rgba(255,255,255,.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; }
body.chatting .topbar { border-bottom-color: var(--line); }
.wordmark { color: var(--ink); }
.hero h1 { background: none; color: var(--ink); -webkit-background-clip: border-box; background-clip: border-box; }

.pill { background: #fff; border-color: var(--line-strong); color: var(--ink); backdrop-filter: none; -webkit-backdrop-filter: none; }
.pill:hover { background: #f4f4f6; border-color: #cfcfd6; }
.pill-ai { display: inline-flex; align-items: center; gap: 8px; padding-left: 8px; }
.logo-stack { display: inline-flex; }
.logo-stack img { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: #fff; border: 1px solid var(--line-strong); margin-left: -6px; }
.logo-stack img:first-child { margin-left: 0; }

.announce { background: #fff; border-color: var(--line-strong); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: var(--glow); }
.announce:hover { border-color: #c9c9d1; }
.announce .logo-stack img { width: 26px; height: 26px; }

.composer { background: #fff; border-color: var(--line-strong); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: var(--glow); }
.composer:focus-within { border-color: #c4c4cc; box-shadow: 0 0 0 4px rgba(17,18,22,.04), var(--glow); }
.composer textarea::placeholder { color: var(--faint); }
.icon-btn { color: #44454d; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: #f2f2f4; border-color: transparent; }
.icon-btn:focus-visible, .send-btn:focus-visible, .pill:focus-visible, .quick-chip:focus-visible, .menu button:focus-visible { outline: 2px solid var(--ink); }
.send-btn { background: var(--ink); color: #fff; }
.drop-hint { background: rgba(250,250,250,.94); border-color: #b9b9c2; color: var(--ink); }

.conn span { color: var(--ink); background: #f6f6f8; }
.conn span::before { background: var(--green); box-shadow: none; }

.menu { background: #fff; border-color: var(--line); box-shadow: 0 16px 48px -12px rgba(17,18,22,.18); backdrop-filter: none; -webkit-backdrop-filter: none; }
.menu button:hover { background: #f4f4f6; }
.mi-icon { background: #fff; border-color: var(--line); }
.mi-badge { color: var(--ink); border-color: var(--line-strong); }
.mi-badge.on { color: var(--green); border-color: #bfe5cc; background: #effaf3; }

.quick-chip { background: #fff; border-color: var(--line-strong); backdrop-filter: none; -webkit-backdrop-filter: none; }
.quick-chip:hover { background: #f6f6f8; border-color: #cfcfd6; }

.msg.user { background: #f2f2f4; border-color: transparent; }
.msg.assistant { background: #fff; border-color: transparent; padding-left: 0; padding-right: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.md code { background: #f2f2f4; }
.md a { color: #2f5bd3; }
.md strong { color: var(--ink); }
.msg.error { border-color: #f3c7c3; color: var(--red); padding: 14px 16px; }
.typing i { background: #b9b9c2; }
.email { background: #fff; border-color: var(--line); }
.email .prev { color: var(--muted); }
.btn-glow { background: var(--ink); color: #fff; box-shadow: none; }
.btn-glow:hover { filter: none; background: #2a2b31; }
.report-card .rc-verdict[data-d="GO"] { color: var(--green); }

.workspace { background: #fafafa; backdrop-filter: none; -webkit-backdrop-filter: none; }
.workspace-bar { background: #fafafa; }
.workspace .card, .workspace .fig, .workspace .table-wrap { backdrop-filter: none; -webkit-backdrop-filter: none; }
.card, .fig, .table-wrap { box-shadow: 0 1px 2px rgba(17,18,22,.03); }
.toast { background: #fff; box-shadow: 0 10px 30px -10px rgba(17,18,22,.2); backdrop-filter: none; -webkit-backdrop-filter: none; }
.toast.err { color: var(--red); border-color: #f3c7c3; }

/* Connect-to-AI modal */
.ai-modal { width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: #fff; color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(17,18,22,.3); overflow: auto; }
.ai-modal::backdrop { background: rgba(17,18,22,.28); backdrop-filter: blur(3px); }
.ai-modal[open] { animation: pop .18s ease-out; }
.ai-head { display: flex; justify-content: space-between; gap: 16px; padding: 24px 24px 8px; }
.ai-head h2 { margin-top: 6px; }
.ai-sub { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; }
.ai-tabs { display: flex; gap: 8px; padding: 12px 24px 0; }
.ai-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; font-weight: 500; }
.ai-tabs button img { width: 18px; height: 18px; }
.ai-tabs button[aria-selected="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.ai-body { display: flex; flex-direction: column; gap: 18px; padding: 20px 24px 24px; }
.ai-field { display: flex; flex-direction: column; gap: 8px; }
.copy-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafafa; }
.copy-row code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; overflow-x: auto; white-space: nowrap; }
.ai-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.ai-steps code, .ai-tools code { font-family: var(--mono); font-size: 12.5px; background: #f2f2f4; padding: 1px 6px; border-radius: 5px; }
.ai-tools { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; }
.ai-tools li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 9px 14px; font-size: 13.5px; border-top: 1px solid var(--line); align-items: baseline; }
.ai-tools li:first-child { border-top: 0; }
.ai-tools li span { color: var(--muted); }
@media (max-width: 640px) { .ai-tools li { grid-template-columns: 1fr; gap: 2px; } .pill-ai .logo-stack { display: none; } }

/* Investment memo: every number is a link to its source */
.memo p { margin: 0 0 12px; font-size: 16.5px; line-height: 1.75; max-width: 70ch; }
.memo p:last-child { margin-bottom: 0; }
.memo-d[data-d="GO"] { color: var(--green); }
.memo-d[data-d="NO-GO"] { color: var(--red); }
.cite { font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); background: none; border: 0; padding: 0 1px; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; border-radius: 3px; }
.cite:hover, .cite:focus-visible { background: var(--amber-surface); outline: none; }
.cite.assumed { text-decoration-style: dashed; text-decoration-color: #b9b9c2; }

/* Source popover */
.cite-pop { position: fixed; z-index: 60; width: 320px; max-width: calc(100vw - 24px); padding: 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 18px 50px -14px rgba(17,18,22,.28); display: flex; flex-direction: column; gap: 10px; animation: pop .14s ease-out; }
.cp-head { display: flex; gap: 10px; align-items: center; }
.cp-head img, .cp-head .sb { width: 32px; height: 32px; border-radius: 8px; flex: none; border: 1px solid var(--line); padding: 5px; background: #fff; }
.cp-head div { display: flex; flex-direction: column; min-width: 0; }
.cp-head strong { font-size: 14.5px; }
.cp-head small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb { display: grid; place-items: center; font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: .02em; padding: 0 !important; }
.sb-pdf { background: #fdecea !important; color: #c5221f; border-color: #f6c9c5 !important; }
.sb-msci { background: #0b1f45 !important; color: #fff; border-color: #0b1f45 !important; }
.sb-cortile { background: #111216 !important; color: #fff; font-size: 13px; }
.sb-a { background: #f2f2f4 !important; color: var(--muted); font-size: 13px; }
.sb-web { background: var(--amber-surface) !important; color: var(--amber); font-size: 13px; }
.cp-fig { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 12px; border-radius: 10px; background: #fafafa; }
.cp-fig span { color: var(--muted); font-size: 13px; }
.cp-fig b { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-note { margin: 0; font-size: 13px; color: var(--muted); }
.cp-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cp-foot a { font-size: 13px; font-weight: 500; color: var(--ink); }

/* Rental comps with photos */
.comps { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.comp { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.comp-img { position: relative; display: block; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #f1f1f4, #e6e6ea); }
.comp-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.comp-dist { position: absolute; left: 10px; top: 10px; font-family: var(--mono); font-size: 11px; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--ink); }
.comp-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.comp-op { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.comp-op img { border-radius: 3px; }
.comp h3 { margin: 0; font-size: 15.5px; letter-spacing: -0.02em; }
.comp-meta { margin: 0; font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.comp-rooms { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.comp-rooms li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; font-size: 13.5px; align-items: baseline; }
.comp-rooms li small { grid-column: 1 / -1; color: var(--faint); font-size: 11.5px; }

.connect-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mail-src { vertical-align: -2px; margin-right: 8px; }

/* Report inside the chat */
.workspace { display: none !important; }
.report-card { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--glow); }
.report-card .btn-glow { align-self: flex-start; }
.rc-head { display: flex; align-items: center; gap: 14px; }
.rc-head strong { display: block; font-size: 16.5px; letter-spacing: -0.02em; }
.rc-head small { color: var(--muted); font-size: 13px; }
.report-card .rc-verdict { font-size: 30px; font-weight: 700; letter-spacing: -0.04em; padding: 2px 12px; border-radius: 10px; background: #effaf3; }
.report-card .rc-verdict[data-d="NO-GO"] { background: var(--red-surface); }
.rc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rc-kpis div { padding: 10px 12px; border-radius: 10px; background: #fafafa; display: flex; flex-direction: column; }
.rc-kpis small { color: var(--muted); font-size: 12px; }
.rc-kpis b { font-size: 18px; font-variant-numeric: tabular-nums; }
.rc-reasons { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.rc-photos { display: flex; align-items: center; }
.rc-photos img { width: 44px; height: 44px; object-fit: cover; border-radius: 50%; border: 2px solid #fff; margin-left: -10px; box-shadow: 0 1px 3px rgba(17,18,22,.15); }
.rc-photos img:first-child { margin-left: 0; }
.rc-photos span { margin-left: 10px; font-size: 13px; color: var(--muted); }
.inline-report { margin-top: 6px; }
.inline-report .asset { display: flex; flex-direction: column; gap: 16px; }
.inline-report .card { box-shadow: none; }
.inline-report .verdict { display: none; }  /* the chat card above already shows the verdict */
.comp-op .sb { width: 18px; height: 18px; border-radius: 5px; font-size: 8.5px; border: 0; }
@media (max-width: 640px) { .rc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
body.chatting .composer-wrap { padding-top: 18px; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 18px); bottom: 0; padding-bottom: 16px; }
.comp-op .sb { font-size: 10px; }

/* ---------- Voice orb (active voice session) ---------- */
.vorb {
  --lvl: 0;
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 10px 10px 12px; border-radius: 999px;
  background: rgba(12, 13, 20, .74); border: 1px solid rgba(255,255,255,.09);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.2);
  animation: vorb-in .45s cubic-bezier(.2,.9,.25,1.15);
}
.vorb[hidden] { display: none; }
@keyframes vorb-in { from { opacity: 0; scale: .8; translate: 0 12px; } }

.vorb-orb { position: relative; width: 60px; height: 60px; flex: none; }
.vo-glow {
  position: absolute; inset: -18px; border-radius: 50%;
  background: radial-gradient(circle, rgba(240,167,92,.55), rgba(124,92,255,.28) 45%, transparent 70%);
  filter: blur(10px);
  opacity: calc(.25 + var(--lvl) * 1.4);
  transform: scale(calc(.85 + var(--lvl) * 1.1));
  transition: opacity .12s linear, transform .12s linear;
}
.vo-core {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden; isolation: isolate;
  background: linear-gradient(140deg, #2f3dff 0%, #7c5cff 50%, #f0a75c 100%);
  box-shadow: inset 0 0 16px rgba(255,255,255,.28), 0 0 22px rgba(124,92,255,.35);
  transform: scale(calc(1 + var(--lvl) * .32));
  transition: transform .09s linear, filter .4s;
}
.vo-core i {
  position: absolute; width: 75%; height: 75%; border-radius: 50%;
  filter: blur(9px); mix-blend-mode: screen; opacity: .7;
  transform-origin: 50% 50%;
  animation: vo-swirl var(--swirl, 7s) linear infinite;
}
.vo-core i:nth-child(1) { background: #5eead4; left: -14%; top: -12%; }
.vo-core i:nth-child(2) { background: #ffb36b; right: -18%; bottom: -14%; animation-direction: reverse; animation-duration: calc(var(--swirl, 7s) * 1.3); }
.vo-core i:nth-child(3) { background: #b69cff; left: 18%; bottom: -26%; animation-duration: calc(var(--swirl, 7s) * .8); }
.vo-core b { /* glassy highlight */
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, rgba(255,255,255,.55), transparent 38%);
}
@keyframes vo-swirl {
  from { transform: rotate(0deg) translateX(14%) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(14%) rotate(-360deg); }
}
.vo-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(240,167,92,.65); opacity: 0;
}

.vorb[data-state="connecting"] .vo-core { animation: vo-breathe 1.5s ease-in-out infinite; filter: saturate(.6) brightness(.85); }
.vorb[data-state="listening"]  { --swirl: 9s; }
.vorb[data-state="listening"] .vo-core { filter: saturate(.8); }
.vorb[data-state="speaking"]   { --swirl: 2.6s; }
.vorb[data-state="speaking"] .vo-ring { animation: vo-ripple 1.8s cubic-bezier(.2,.6,.3,1) infinite; }
.vorb[data-state="speaking"] .vo-ring.r2 { animation-delay: .9s; }
@keyframes vo-breathe { 50% { transform: scale(.86); opacity: .75; } }
@keyframes vo-ripple { from { transform: scale(1); opacity: .75; } to { transform: scale(1.85); opacity: 0; } }

.vorb-meta { display: flex; flex-direction: column; gap: 2px; min-width: 96px; }
.vorb-label { font-weight: 600; font-size: 15px; color: #f0eff5; }
.vorb[data-state="speaking"] .vorb-label { color: var(--amber); }
.vorb-sub { font-size: 12px; color: var(--muted); }
.vorb-end {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #f0eff5; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.vorb-end:hover { background: rgba(255,90,90,.18); border-color: rgba(255,90,90,.45); }
.vorb-end:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

@media (max-width: 640px) {
  .vorb { right: 16px; left: 16px; bottom: auto; top: 72px; justify-content: flex-start; }
  .vorb-meta { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .vo-core i, .vo-ring, .vorb[data-state="connecting"] .vo-core { animation: none !important; }
  .vorb { animation: none; }
}

/* Voice orb on the white theme */
.vorb { background: rgba(255,255,255,.94); border-color: var(--line); box-shadow: 0 18px 50px -14px rgba(17,18,22,.28); }
.vorb .vorb-label { color: var(--ink); }
.vorb[data-state="speaking"] .vorb-label { color: var(--amber); }
.vorb .vorb-sub { color: var(--muted); }
.vorb .vorb-end { color: var(--ink); border-color: var(--line-strong); background: #fff; }

/* Dot terrain background (ai-vance footer style), behind everything */
.terrain { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: 40vh; min-height: 220px; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%); mask-image: linear-gradient(to bottom, transparent, #000 35%);
  transition: opacity .4s ease; }
body.chatting .terrain { opacity: .45; }
@media (max-width: 640px) { .terrain { height: 32vh; } }

/* =====================================================================
   Black theme with colour: overrides the white theme above. Keep last.
   ===================================================================== */
:root {
  --canvas: #0d0e13;
  --surface: #12131a;
  --surface-solid: #12131a;
  --line: rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.14);
  --muted: #9a9ba8;
  --faint: #6c6d79;
  --ink: #f2f2f5;
  --amber: #f0a75c;
  --amber-dark: #e08d3c;
  --amber-surface: rgba(240,167,92,.14);
  --amber-line: rgba(240,167,92,.35);
  --on-amber: #111216;
  --red: #ff6b5e;
  --red-surface: rgba(255,107,94,.13);
  --green: #3ddc84;
  --glass: rgba(18,19,26,.72);
  --glass-strong: rgba(18,19,26,.88);
  --glow: 0 1px 0 rgba(255,255,255,.04) inset, 0 18px 50px -18px rgba(0,0,0,.7);
  color-scheme: dark;
}
body { background: #06070b; color: var(--ink); }

/* Colour: soft glows rising from the bottom, in the dealt orb palette */
.aurora { background: radial-gradient(90% 55% at 50% -10%, rgba(124,92,255,.16), transparent 70%), #06070b; }
.aurora .blob { opacity: .5; filter: blur(110px); }
.aurora .b1 { background: #2f3dff; }
.aurora .b2 { background: #7c5cff; }
.aurora .b3 { background: #c9771f; opacity: .55; }
.aurora .b4 { background: #ff5f8a; opacity: .3; }
.aurora .grain { opacity: .1; }
body.chatting .aurora .blob { opacity: .32; }
.terrain { z-index: 0; }
body.chatting .terrain { opacity: .55; }

.topbar { background: rgba(6,7,11,.6); }
.hero h1 { background: linear-gradient(180deg, #ffffff 30%, #b9b6d6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wm-dot { background: var(--amber); }

.pill, .announce, .quick-chip { background: rgba(255,255,255,.05); border-color: var(--line-strong); color: var(--ink); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pill:hover, .quick-chip:hover, .announce:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.24); }
.logo-stack img { background: #fff; border-color: rgba(255,255,255,.2); }

.composer { background: var(--glass); border-color: var(--line-strong); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.composer:focus-within { border-color: rgba(255,255,255,.26); box-shadow: 0 0 0 4px rgba(124,92,255,.14), var(--glow); }
.icon-btn { color: #c9cad3; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: rgba(255,255,255,.08); }
.send-btn { background: var(--ink); color: #0b0c10; }
.drop-hint { background: rgba(6,7,11,.92); border-color: var(--line-strong); }
.conn span { background: rgba(255,255,255,.07); }

.menu, .toast, .cite-pop, .ai-modal { background: #14151c; border-color: var(--line-strong); box-shadow: 0 24px 60px -16px rgba(0,0,0,.8); }
.menu button:hover { background: rgba(255,255,255,.06); }
.mi-icon { background: rgba(255,255,255,.05); }
.mi-badge.on { border-color: rgba(61,220,132,.4); background: rgba(61,220,132,.1); }

.msg.user { background: rgba(255,255,255,.08); }
.msg.assistant { background: transparent; }
.md code, .ai-steps code, .ai-tools code { background: rgba(255,255,255,.08); }
.md a { color: #9db4ff; }
.typing i { background: #6c6d79; }
.email, .comp, .report-card { background: rgba(18,19,26,.82); border-color: var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn-glow { background: var(--ink); color: #0b0c10; }
.btn-glow:hover { background: #ffffff; }
.msg.error, .toast.err { border-color: rgba(255,107,94,.4); }

.ai-modal::backdrop { background: rgba(0,0,0,.55); }
.ai-tabs button { background: rgba(255,255,255,.04); color: var(--ink); }
.copy-row, .cp-fig, .rc-kpis div { background: rgba(255,255,255,.05); }
.cite.assumed { text-decoration-color: #6c6d79; }
.cp-head img { background: #fff; }
.sb-a { background: rgba(255,255,255,.08) !important; }
.sb-cortile { background: #2a2b33 !important; }
.comp-img { background: linear-gradient(135deg, #1a1b23, #23242e); }
.comp-dist { background: rgba(6,7,11,.8); }
.report-card .rc-verdict { background: rgba(61,220,132,.12); }
.rc-photos img { border-color: #12131a; }
body.chatting .composer-wrap { background: none; }
.icon-btn:focus-visible, .send-btn:focus-visible, .pill:focus-visible, .quick-chip:focus-visible, .menu button:focus-visible { outline: 2px solid rgba(240,167,92,.7); outline-offset: 2px; }

/* Voice orb back on dark glass */
.vorb { background: rgba(12,13,20,.78); border-color: rgba(255,255,255,.09); box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.vorb .vorb-label { color: #f0eff5; }
.vorb[data-state="speaking"] .vorb-label { color: var(--amber); }
.vorb .vorb-end { color: #f0eff5; border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.06); }

/* live agent log: which tool is working (aurora palette: blue #3B5BFF, violet #C03CFF, pink #FF4D8D, orange #FF8A4C) */
.steps.live-steps { display: flex; flex-direction: column; gap: 7px; }
.steps li.tool-step { align-items: center; gap: 10px; animation: stepIn .35s ease both; }
.steps li.tool-step::before { content: none; }
.tb { font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
      color: #f1f1f5; background: rgba(192, 60, 255, .14); border: 1px solid rgba(192, 60, 255, .45); }
.tb-v7-go, .tb-msci-rca, .tb-bank-of-england { background: rgba(59, 91, 255, .16); border-color: rgba(59, 91, 255, .55); }
.tb-parallel, .tb-hesa, .tb-cognee { background: rgba(192, 60, 255, .16); border-color: rgba(192, 60, 255, .55); }
.tb-scrapers, .tb-cortile, .tb-postcodes-io { background: rgba(255, 77, 141, .14); border-color: rgba(255, 77, 141, .5); }
.tb-dealt { background: linear-gradient(90deg, rgba(59, 91, 255, .25), rgba(192, 60, 255, .25)); border-color: rgba(192, 60, 255, .6); }
.steps li.tool-step .ta { color: var(--ink); }
.steps li.tool-step .td { color: var(--muted); }
.steps li.tool-step.active .ta { color: #d9a6ff; }
.dots i { display: inline-block; width: 5px; height: 5px; margin: 0 2px; border-radius: 50%;
          background: linear-gradient(135deg, #3B5BFF, #C03CFF); animation: dot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes stepIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* brochure evidence view (the highlighted value itself stays amber: sourced) */
.cp-view { margin-top: 8px; width: 100%; text-align: left; font: inherit; font-size: 12.5px; color: #e9d5ff; cursor: pointer;
           background: linear-gradient(90deg, rgba(59, 91, 255, .14), rgba(192, 60, 255, .14));
           border: 1px solid rgba(192, 60, 255, .45); border-radius: 8px; padding: 6px 10px; }
.cp-view:hover { background: linear-gradient(90deg, rgba(59, 91, 255, .26), rgba(192, 60, 255, .26)); }
.pdf-modal { width: min(1100px, 94vw); height: 90vh; padding: 0; border: 1px solid rgba(192, 60, 255, .35); border-radius: 14px;
             background: #0d0e14; color: #f1f1f5; box-shadow: 0 30px 90px -20px rgba(192, 60, 255, .35), 0 10px 40px -10px rgba(59, 91, 255, .35); }
.pdf-modal::backdrop { background: rgba(7, 8, 13, .7); backdrop-filter: blur(4px); }
.pdf-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.pdf-head strong { flex: 1; font-size: 13px; }
.pdf-head a { color: #d9a6ff; font-size: 12.5px; text-decoration: none; margin-right: 8px; }
.pdf-head button { background: none; border: 0; color: #f1f1f5; font-size: 22px; cursor: pointer; }
.pdf-body { height: calc(100% - 46px); overflow: auto; background: #12131a; display: flex; justify-content: center; }
.pdf-body img { max-width: 100%; height: auto; align-self: flex-start; box-shadow: 0 6px 30px rgba(0, 0, 0, .5); }
