/* ==========================================================================
   Capital U design system
   --------------------------------------------------------------------------
   Palette (from the brand sheet):
     Onyx           #0A0A0A   ground, sidebar, hero
     Lime Moss      #86BE25   primary accent
     Khaki Beige    #BEB7A4   warm neutral
     Steel Azure    #064789   informational / secondary data series
     Burnt Tangerine#E52210   critical only

   Contrast rule: Lime Moss carries BLACK text (white on it is ~2.4:1 and
   fails WCAG). Only Onyx surfaces take white text. --lime-ink is a darkened
   lime used for text and links on light backgrounds (6.1:1 on white).
   ========================================================================== */

:root {
  --onyx: #0A0A0A;
  --onyx-800: #1a1a1a;
  --onyx-700: #2a2a2a;
  --onyx-600: #3d3d3d;

  --lime: #86BE25;
  --lime-600: #74a71f;
  --lime-100: #eef7de;
  --lime-050: #f7fbef;
  --lime-ink: #4d7212;

  --khaki: #BEB7A4;
  --khaki-100: #f2f0ea;
  --khaki-050: #faf9f6;

  --azure: #064789;
  --azure-100: #e4edf6;
  --azure-ink: #053a70;

  --tangerine: #E52210;
  --tangerine-100: #fdeae8;
  --tangerine-ink: #b81a0c;

  --amber: #b45309;
  --amber-100: #fef3e2;

  --ink: #131313;
  --ink-2: #4a4a48;
  --ink-3: #77756f;
  --line: #e4e2dc;
  --surface: #ffffff;
  --canvas: #faf9f6;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(10,10,10,.05), 0 8px 24px -12px rgba(10,10,10,.16);
  --shadow-lg: 0 24px 60px -24px rgba(10,10,10,.35);
  --sidebar-w: 258px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.12rem; }
h4 { font-size: .95rem; }
p { margin: 0 0 1em; }
a { color: var(--lime-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: .82rem; }

.muted { color: var(--ink-3); }
.dim   { color: var(--ink-2); }
.tiny  { font-size: .78rem; }
.mono  { font-family: var(--mono); font-size: .85em; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.mt1 { margin-top: .5rem; } .mt2 { margin-top: 1rem; } .mt3 { margin-top: 1.75rem; }
.mb1 { margin-bottom: .5rem; } .mb2 { margin-bottom: 1rem; } .mb3 { margin-bottom: 1.75rem; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row-tight { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.grow { flex: 1 1 220px; min-width: 0; }

/* ---------- Logo -------------------------------------------------------
   The supplied artwork is flat JPEG with no alpha, so the background travels
   with the mark. A blend mode removes it: `screen` drops black on a dark
   surface, `multiply` drops white on a light one. This also means a small
   mismatch between the file's background and ours is invisible, rather than
   showing as a rectangle around the logo. */
.logo { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; letter-spacing: -.02em; }
.logo svg, .logo img { height: 30px; width: auto; display: block; }
.logo-img.on-dark { mix-blend-mode: screen; }
.logo-img.on-light { mix-blend-mode: multiply; }
.logo-mark { color: currentColor; }
.logo-word { font-size: 1.18rem; }
.logo-word span { color: var(--lime); }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--lime); color: var(--onyx); }
.btn-primary:hover { background: var(--lime-600); }
.btn-dark { background: var(--onyx); color: #fff; }
.btn-dark:hover { background: var(--onyx-700); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--khaki-100); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); }
.btn-danger { background: var(--tangerine); color: #fff; }
.btn-danger:hover { background: var(--tangerine-ink); }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }

/* ==========================================================================
   FORMS
   ========================================================================== */
label { display: block; font-weight: 600; font-size: .82rem; margin-bottom: .3rem; color: var(--ink-2); }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=search], select, textarea {
  width: 100%; padding: .58rem .75rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; font-size: .92rem;
  background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime-100);
}
textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
.field { margin-bottom: .9rem; }

/* Radio choice with its consequence spelled out, for picks where the labels
   alone ("HR" / "Manager") do not say what changes. */
.choice {
  display: flex; gap: .55rem; align-items: flex-start; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .55rem .7rem; margin-bottom: .4rem; font-weight: 400;
}
.choice:hover { background: var(--khaki-100); }
.choice input { width: auto; margin-top: .2rem; flex: none; }
.choice > span { display: flex; flex-direction: column; gap: .1rem; }
.choice:has(input:checked) { border-color: var(--lime); background: var(--lime-050); }

/* A collection pack: who it is for, and the button that sends it. */
.pack {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .75rem;
}
.pack:hover { background: var(--khaki-100); }
.field .hint { font-size: .76rem; color: var(--ink-3); margin-top: .25rem; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 1rem; }
.check { display: flex; align-items: flex-start; gap: .55rem; font-weight: 500; color: var(--ink); }
.check input { width: auto; margin-top: .25rem; flex: none; }
.required { color: var(--tangerine); }

/* ==========================================================================
   CARDS, PANELS, TABLES
   ========================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
}
.card-tight { padding: .9rem 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .9rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.05rem; }
.tile .label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.tile .value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin: .25rem 0 .1rem; }
.tile .value.small { font-size: 1.2rem; }
.tile .foot { font-size: .76rem; color: var(--ink-3); }
.tile-dark { background: var(--onyx); border-color: var(--onyx); color: #fff; }
.tile-dark .label, .tile-dark .foot { color: rgba(255,255,255,.6); }
.tile-dark .value { color: var(--lime); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th, td { padding: .58rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; white-space: nowrap; }
tbody tr:hover { background: var(--khaki-050); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.compact th, table.compact td { padding: .38rem .5rem; }

/* ==========================================================================
   BADGES, TONES, NOTICES
   ========================================================================== */
.badge {
  display: inline-block; padding: .16rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  border: 1px solid transparent;
}
.tone-good     { background: var(--lime-100);      color: var(--lime-ink);      border-color: #d3e9ac; }
.tone-ok       { background: var(--lime-050);      color: var(--lime-ink);      border-color: #e3f0cd; }
.tone-watch    { background: var(--amber-100);     color: var(--amber);         border-color: #f8dcb4; }
.tone-risk     { background: var(--tangerine-100); color: var(--tangerine-ink); border-color: #f7c5bf; }
.tone-critical { background: var(--tangerine);     color: #fff;                 border-color: var(--tangerine); }
.tone-info     { background: var(--azure-100);     color: var(--azure-ink);     border-color: #c6d9ec; }
.tone-muted    { background: var(--khaki-100);     color: var(--ink-2);         border-color: var(--line); }

.notice {
  border-radius: var(--radius-sm); padding: .8rem 1rem; font-size: .88rem;
  border: 1px solid; display: flex; gap: .6rem; align-items: flex-start;
}
.notice p:last-child { margin-bottom: 0; }
.notice-info     { background: var(--azure-100);     border-color: #c6d9ec; color: var(--azure-ink); }
.notice-success  { background: var(--lime-100);      border-color: #d3e9ac; color: var(--lime-ink); }
.notice-warning  { background: var(--amber-100);     border-color: #f8dcb4; color: var(--amber); }
.notice-danger   { background: var(--tangerine-100); border-color: #f7c5bf; color: var(--tangerine-ink); }
.notice-neutral  { background: var(--khaki-100);     border-color: var(--line); color: var(--ink-2); }

.flash-stack { position: sticky; top: .75rem; z-index: 30; display: grid; gap: .5rem; margin-bottom: 1.1rem; }

/* Meter / progress ------------------------------------------------------ */
.meter { height: 7px; background: var(--khaki-100); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--lime); border-radius: 999px; }
.meter.is-risk > span { background: var(--tangerine); }
.meter.is-watch > span { background: var(--amber); }
.meter.is-info > span { background: var(--azure); }

/* ==========================================================================
   PORTAL SHELL
   ========================================================================== */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--onyx); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-head { padding: 1.15rem 1.15rem .9rem; color: #fff; }
.sidebar-head .logo { color: #fff; }
.sidebar-company {
  margin: 0 .8rem .75rem; padding: .6rem .75rem; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06); font-size: .8rem;
}
.sidebar-company strong { display: block; color: #fff; font-size: .88rem; }
.sidebar-company span { color: rgba(255,255,255,.55); }
.sidebar nav { padding: .25rem .6rem 1.25rem; flex: 1; }
.nav-group { margin-top: 1.05rem; }
.nav-group > span {
  display: block; padding: 0 .55rem .4rem; font-size: .66rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: rgba(255,255,255,.35);
}
.sidebar a.nav-link {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .48rem .6rem; border-radius: var(--radius-sm); color: rgba(255,255,255,.72);
  font-size: .875rem; font-weight: 500; margin-bottom: 1px;
}
.sidebar a.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.sidebar a.nav-link.active { background: var(--lime); color: var(--onyx); font-weight: 650; }
.nav-count {
  background: rgba(255,255,255,.16); color: #fff; border-radius: 999px;
  padding: .05rem .42rem; font-size: .7rem; font-weight: 700;
}
.nav-link.active .nav-count { background: rgba(10,10,10,.18); color: var(--onyx); }
.nav-count.hot { background: var(--tangerine); color: #fff; }
/* Still clickable - it lands on the get-started page, which is the answer. */
.sidebar a.nav-link.locked { color: rgba(255,255,255,.34); }
.nav-lock { font-size: .7rem; opacity: .5; }
.sidebar-foot { padding: .9rem 1.15rem 1.2rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .8rem; }
.sidebar-foot a { color: rgba(255,255,255,.65); display: block; padding: .2rem 0; }
.sidebar-foot a:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: .8rem 1.6rem; display: flex; justify-content: space-between;
  align-items: center; gap: 1rem; flex-wrap: wrap; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 1.28rem; margin: 0; }
.topbar .sub { font-size: .8rem; color: var(--ink-3); }
.content { padding: 1.6rem; max-width: 1500px; width: 100%; }

/* Second-level navigation: the pages inside the section the sidebar has
   highlighted. Sections with a single page render no strip at all. */
.subnav {
  background: #fff; border-bottom: 1px solid var(--line); padding: 0 1.6rem;
  display: flex; gap: .25rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.subnav a {
  padding: .6rem .8rem; font-size: .84rem; font-weight: 550; color: var(--ink-3);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.subnav a:hover { color: var(--ink); text-decoration: none; }
.subnav a.active { color: var(--onyx); border-bottom-color: var(--lime); font-weight: 650; }

/* In-page jump strip, for the client results page - one long page beats six
   short ones, but it still needs a way to skip down it. */
.jump { display: flex; flex-wrap: wrap; gap: .3rem; }
.jump a {
  font-size: .78rem; font-weight: 600; color: var(--ink-2); background: var(--khaki-100);
  border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem;
}
.jump a:hover { background: var(--lime-100); color: var(--lime-ink); text-decoration: none; }

h2.sec {
  font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); margin: 2rem 0 .7rem; padding-bottom: .35rem;
  border-bottom: 1px solid var(--line); scroll-margin-top: 5rem;
}
h2.sec:first-of-type { margin-top: 0; }

.menu-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { display: none; }
  .sidebar.open nav, .sidebar.open .sidebar-foot { display: block; }
  .sidebar-head { display: flex; justify-content: space-between; align-items: center; }
  .menu-toggle { display: block; }
  .content { padding: 1rem; }
  .topbar { padding: .75rem 1rem; }
  .subnav { padding: 0 1rem; }
}

/* ==========================================================================
   PUBLIC SITE
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 40; background: rgba(10,10,10,.92);
  backdrop-filter: blur(10px); color: #fff; border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header .inner {
  max-width: 1180px; margin: 0 auto; padding: .9rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.site-header .logo { color: #fff; }
.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a { color: rgba(255,255,255,.75); font-size: .9rem; font-weight: 500; }
.site-nav a:hover, .site-nav a.active { color: #fff; text-decoration: none; }

.hero { background: var(--onyx); color: #fff; padding: 5rem 1.5rem 4.5rem; position: relative; overflow: hidden; }
.hero::after {
  content: ''; position: absolute; right: -180px; top: -140px; width: 620px; height: 620px;
  background: radial-gradient(circle, rgba(134,190,37,.20), transparent 68%); pointer-events: none;
}
.hero .inner { max-width: 1180px; margin: 0 auto; position: relative; z-index: 1; }
.hero .eyebrow {
  font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--lime); font-weight: 700; margin-bottom: 1rem;
}
.hero h1 { font-size: clamp(2.3rem, 5.5vw, 3.9rem); max-width: 16ch; margin-bottom: 1.1rem; }
.hero h1 em { font-style: normal; color: var(--lime); }
.hero p.lead { font-size: 1.1rem; color: rgba(255,255,255,.78); max-width: 62ch; margin-bottom: 2rem; }

section.band { padding: 4.25rem 1.5rem; }
section.band .inner { max-width: 1180px; margin: 0 auto; }
section.band.tinted { background: var(--khaki-050); }
section.band.dark { background: var(--onyx); color: #fff; }
section.band.dark h2 { color: #fff; }
section.band.dark p { color: rgba(255,255,255,.75); }
.section-eyebrow {
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--lime-ink); font-weight: 700; margin-bottom: .7rem;
}
section.band.dark .section-eyebrow { color: var(--lime); }
.section-lead { font-size: 1.05rem; color: var(--ink-2); max-width: 65ch; }

.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.feature .n {
  width: 34px; height: 34px; border-radius: 10px; background: var(--lime); color: var(--onyx);
  display: grid; place-items: center; font-weight: 800; font-size: .9rem; margin-bottom: .85rem;
}
.feature h3 { font-size: 1.02rem; }
.feature p { color: var(--ink-2); font-size: .9rem; margin: 0; }

.tick-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.tick-list li { display: flex; gap: .7rem; align-items: flex-start; font-size: .98rem; }
.tick-list li::before {
  content: '✓'; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--lime); color: var(--onyx); display: grid; place-items: center;
  font-size: .74rem; font-weight: 800; margin-top: .16rem;
}
section.band.dark .tick-list li { color: rgba(255,255,255,.88); }

.cta-band { background: var(--lime); color: var(--onyx); padding: 3.25rem 1.5rem; text-align: center; }
.cta-band h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin-bottom: .5rem; }
.cta-band p { color: rgba(10,10,10,.72); max-width: 55ch; margin: 0 auto 1.6rem; }

.site-footer { background: var(--onyx); color: rgba(255,255,255,.6); padding: 2.75rem 1.5rem 2rem; font-size: .86rem; }
.site-footer .inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.site-footer a { color: rgba(255,255,255,.75); }
.site-footer .logo { color: #fff; margin-bottom: .6rem; }

/* Auth ------------------------------------------------------------------ */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--onyx); padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 2.1rem 2rem; box-shadow: var(--shadow-lg); }
.auth-card .logo { color: var(--onyx); justify-content: center; margin-bottom: 1.5rem; }
.auth-card h1 { font-size: 1.32rem; text-align: center; margin-bottom: .3rem; }
.auth-card .sub { text-align: center; color: var(--ink-3); font-size: .87rem; margin-bottom: 1.5rem; }
.code-input {
  font-size: 1.9rem !important; letter-spacing: .55em; text-align: center;
  font-weight: 700; padding-left: .55em !important; font-family: var(--mono);
}

/* Timeline -------------------------------------------------------------- */
.phase { border-left: 3px solid var(--line); padding-left: 1.1rem; margin-bottom: 1.6rem; position: relative; }
.phase::before {
  content: ''; position: absolute; left: -8px; top: .35rem; width: 13px; height: 13px;
  border-radius: 50%; background: var(--lime); border: 3px solid var(--canvas);
}
.phase.is-done::before { background: var(--onyx); }
.phase.is-future::before { background: var(--khaki); }
.phase h3 { font-size: .95rem; margin-bottom: .1rem; }
.phase .window { font-size: .76rem; color: var(--ink-3); margin-bottom: .7rem; }
.action-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem .9rem; margin-bottom: .55rem; }
.action-item.overdue { border-color: #f7c5bf; background: var(--tangerine-100); }
.action-item .title { font-weight: 600; font-size: .92rem; }
.action-item .meta { font-size: .77rem; color: var(--ink-3); display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .3rem; }

/* Quadrant -------------------------------------------------------------- */
.quadrant { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.quadrant .q { border-radius: var(--radius-sm); padding: .85rem; border: 1px solid var(--line); min-height: 108px; }
.quadrant .q h4 { font-size: .78rem; margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.quadrant .q .n { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.quadrant .q.hh { background: var(--lime-100); border-color: #d3e9ac; }
.quadrant .q.hl { background: var(--amber-100); border-color: #f8dcb4; }
.quadrant .q.lh { background: var(--azure-100); border-color: #c6d9ec; }
.quadrant .q.ll { background: var(--tangerine-100); border-color: #f7c5bf; }
.quadrant .q .names { font-size: .74rem; color: var(--ink-2); margin-top: .35rem; line-height: 1.45; }

/* Chat ------------------------------------------------------------------ */
.thread { display: grid; gap: .7rem; max-height: 62vh; overflow-y: auto; padding-right: .3rem; }
.bubble { max-width: 78%; padding: .7rem .9rem; border-radius: 14px; font-size: .9rem; }
.bubble .who { font-size: .72rem; font-weight: 700; opacity: .72; margin-bottom: .2rem; }
.bubble.them { background: var(--khaki-100); border-bottom-left-radius: 4px; }
.bubble.me { background: var(--onyx); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.bubble .ctx { font-size: .72rem; opacity: .75; margin-top: .35rem; font-style: italic; }

/* Misc ------------------------------------------------------------------ */
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1.1rem; }
.tabs a {
  padding: .5rem .85rem; font-size: .86rem; font-weight: 600; color: var(--ink-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a.active { color: var(--ink); border-bottom-color: var(--lime); }
.tabs a:hover { text-decoration: none; color: var(--ink); }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-3); }
.empty .mark { font-size: 2rem; opacity: .35; margin-bottom: .5rem; }

details.disclose { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
details.disclose > summary { padding: .6rem .85rem; cursor: pointer; font-weight: 600; font-size: .88rem; list-style: none; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::before { content: '▸ '; color: var(--ink-3); }
details.disclose[open] > summary::before { content: '▾ '; }
details.disclose > div { padding: 0 .85rem .85rem; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; font-size: .86rem; }
.kv dt { color: var(--ink-3); font-weight: 600; }
.kv dd { margin: 0; }

.evidence { background: var(--khaki-050); border: 1px solid var(--line); border-left: 3px solid var(--khaki); border-radius: var(--radius-sm); padding: .7rem .9rem; font-size: .86rem; }
.ai-block { background: var(--azure-100); border: 1px solid #c6d9ec; border-left: 3px solid var(--azure); border-radius: var(--radius-sm); padding: .85rem 1rem; }
.ai-block .stamp { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--azure-ink); margin-bottom: .4rem; }

.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 320px; }

@media print {
  .sidebar, .topbar, .subnav, .jump, .btn, .flash-stack { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ==========================================================================
   SVG CHARTS
   Server-rendered, so they appear on the first analysis run and survive a
   blocked CDN. See capitalu/services/charts.py for why.
   ========================================================================== */
.svg-chart { display: block; max-width: 100%; height: auto; }
.svg-donut { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.svg-legend { font-size: .82rem; display: flex; flex-direction: column; gap: .3rem; }
.svg-legend.row { flex-direction: row; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .5rem; }
.svg-legend .dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: .4rem; vertical-align: baseline;
}

/* ==========================================================================
   TABS (pure CSS)
   Radio inputs rather than JavaScript: the panels are all server-rendered, so
   switching is instant and works with scripting disabled. The inputs sit
   before the panels so the sibling selectors below can reach them.
   ========================================================================== */
.tabs > input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.tabbar {
  display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--line);
  margin-bottom: 1.4rem; -webkit-overflow-scrolling: touch;
}
.tabbar label {
  padding: .55rem .9rem; font-size: .88rem; font-weight: 600; color: var(--ink-3);
  border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer;
  margin-bottom: -1px;
}
.tabbar label:hover { color: var(--ink); }
.tabpanel { display: none; }

.tabs > #tab-summary:checked  ~ .tabbar label[for="tab-summary"],
.tabs > #tab-results:checked  ~ .tabbar label[for="tab-results"],
.tabs > #tab-risk:checked     ~ .tabbar label[for="tab-risk"],
.tabs > #tab-findings:checked ~ .tabbar label[for="tab-findings"],
.tabs > #tab-actions:checked  ~ .tabbar label[for="tab-actions"] {
  color: var(--onyx); border-bottom-color: var(--lime);
}
.tabs > #tab-summary:checked  ~ .tabpanel[data-tab="summary"],
.tabs > #tab-results:checked  ~ .tabpanel[data-tab="results"],
.tabs > #tab-risk:checked     ~ .tabpanel[data-tab="risk"],
.tabs > #tab-findings:checked ~ .tabpanel[data-tab="findings"],
.tabs > #tab-actions:checked  ~ .tabpanel[data-tab="actions"] { display: block; }

/* Printing has no tabs - show everything. */
@media print { .tabpanel { display: block !important; } .tabbar { display: none; } }
