
:root {
  --paper: #F1F2EF;
  --panel: #F7F8F5;
  --ink: #16233B;
  --ink-soft: #45516A;
  --ink-faint: #8B93A3;
  --line: #C9CDD2;
  --line-strong: #9AA1AC;
  --blue: #1650E0;
  --blue-deep: #0E3ABF;
  --blue-wash: #DCE4FA;
  --ok: #1F7A46;
  --warn: #B45309;
  --danger: #B23A2A;
  --font-ui: "Inter", system-ui, sans-serif;
  /* Inter, not Inter Tight: Tight's space glyph collapses at bold display
     sizes ("Sign in" reads as "Signin"). Tracking gives the condensed feel. */
  --font-display: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* RealtimeKit component theming (documented CSS variable hooks) */
  --rtk-color-brand-300: #5B82EC;
  --rtk-color-brand-400: #3D69E8;
  --rtk-color-brand-500: #1650E0;
  --rtk-color-brand-600: #0E3ABF;
  --rtk-color-brand-700: #0A2C93;
  --rtk-border-radius: 0px;
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(90deg, transparent 0 27px, rgba(22,35,59,0.035) 27px 28px),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(22,35,59,0.022) 27px 28px);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: 34px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.container { max-width: 1080px; margin: 0 auto; padding: 24px; }
.narrow { max-width: 560px; }

/* ---- mono utilities ---- */
.mono { font-family: var(--font-mono); font-size: 12px; }
.kicker {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft);
}
.kicker::before { content: ">>> "; color: var(--blue); }
.link-action {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--blue); text-decoration: underline; text-underline-offset: 3px;
}
.link-action::after { content: " \2197"; }

/* ---- top navigation ---- */
.topnav {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 14px 24px; border-bottom: 1px solid var(--line-strong);
  background: var(--paper); position: sticky; top: 0; z-index: 10;
}
.topnav .grow { flex: 1; }
.topnav a.nav {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink); padding: 6px 12px; border-left: 1px solid var(--line);
}
.topnav a.nav:hover { color: var(--blue); text-decoration: none; }
.topnav a.nav.active { color: var(--blue); }
.topnav a.nav .num { color: var(--ink-faint); margin-right: 6px; }
.topnav a.nav.active .num { color: var(--blue); }
.topnav .who { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; color: var(--ink-soft); padding: 6px 0 6px 12px; }
.main { padding: 32px 24px; max-width: 1080px; margin: 0 auto; }
@media (max-width: 760px) { .topnav { padding: 10px 12px; } .topnav a.nav { border-left: none; padding: 6px 8px; } }

/* ---- wordmark ---- */
.wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: var(--ink);
}
.wordmark .mark {
  width: 14px; height: 12px; background: var(--blue); display: inline-block;
  clip-path: polygon(24% 0, 76% 0, 100% 100%, 0 100%);
}

/* ---- section bars (001 / TITLE >>>) ---- */
.secbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--ink); color: #F1F2EF; padding: 5px 12px; margin: 0 0 0 0;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
}
.secbar .tail { color: rgba(241,242,239,0.6); }

/* ---- panels ---- */
.card { background: var(--panel); border: 1px solid var(--line-strong); padding: 0; margin-bottom: 20px; }
.card .body { padding: 16px; }
.card.plain { padding: 16px; }
.frame { position: relative; }
.frame::before, .frame::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
}
.frame::before { top: -5px; left: -5px; border-top: 1.5px solid var(--ink); border-left: 1.5px solid var(--ink); }
.frame::after { bottom: -5px; right: -5px; border-bottom: 1.5px solid var(--ink); border-right: 1.5px solid var(--ink); }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stat { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: 13px; }

/* ---- chips: bordered mono status tags with a state dot ---- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px;
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink-soft);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; white-space: nowrap; vertical-align: middle;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); flex-shrink: 0; }
.chip.blue { border-color: var(--blue); color: var(--blue); } .chip.blue::before { background: var(--blue); }
.chip.ok { border-color: var(--ok); color: var(--ok); } .chip.ok::before { background: var(--ok); }
.chip.warn { border-color: var(--danger); color: var(--danger); } .chip.warn::before { background: var(--danger); }
.chip.rec::before { animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% {opacity:1} 50% {opacity:0.25} 100% {opacity:1} }
@media (prefers-reduced-motion: reduce) { .chip.rec::before { animation: none; } }

/* ---- buttons ---- */
.btn {
  display: inline-block; padding: 10px 20px; border: 1px solid var(--ink);
  background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
}
.btn:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.wide { width: 100%; text-align: center; }

/* ---- forms ---- */
label {
  display: block; font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); margin: 16px 0 5px;
}
input, textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong);
  background: #FDFDFB; color: var(--ink); font-family: var(--font-ui); font-size: 14px;
}
input:focus, textarea:focus { border-color: var(--blue); outline: none; }
textarea { min-height: 80px; resize: vertical; }

/* ---- searchable combobox ---- */
.combo { position: relative; }
.combo-panel {
  position: absolute; z-index: 20; left: 0; right: 0; top: 100%;
  background: #FDFDFB; border: 1px solid var(--line-strong); border-top: none;
  max-height: 280px; overflow-y: auto;
}
.combo-note {
  padding: 7px 12px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
}
.combo-item {
  display: flex; justify-content: space-between; gap: 12px; padding: 7px 12px;
  font-family: var(--font-mono); font-size: 12.5px; cursor: pointer; color: var(--ink);
}
.combo-item:hover, .combo-item.active { background: var(--blue-wash); color: var(--blue-deep); }
.combo-item .off { color: var(--ink-faint); flex-shrink: 0; }
.combo-item:hover .off, .combo-item.active .off { color: var(--blue-deep); }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft);
  padding: 8px; border-bottom: 1px solid var(--line-strong);
}
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* ---- log readout (audit) ---- */
.log { font-family: var(--font-mono); font-size: 12px; line-height: 1.9; }
.log .row { display: flex; gap: 10px; border-bottom: 1px solid var(--line); padding: 2px 0; flex-wrap: wrap; }
.log .t { color: var(--ink-faint); flex-shrink: 0; }
.log .a { color: var(--blue); text-transform: uppercase; letter-spacing: 0.04em; }
.log .h { color: var(--ink-faint); margin-left: auto; }

/* ---- documents ---- */
.doc {
  background: #FDFDFB; border: 1px solid var(--line-strong); max-width: 720px;
  padding: 48px 56px; margin: 0 auto; font-size: 15.5px; line-height: 1.75; color: var(--ink);
}
.doc h1 { font-size: 27px; margin-bottom: 18px; }
.doc h2 {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-soft);
  margin: 30px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-strong);
}
.doc h3 { font-size: 15px; margin: 18px 0 8px; }
.doc p { margin: 10px 0; }
.doc ul { margin: 10px 0 10px 22px; }
.doc li { margin: 5px 0; }
.doc hr { border: none; border-top: 1px solid var(--line); margin: 26px 0; }
.doc strong { font-weight: 600; }
.doc code { font-family: var(--font-mono); font-size: 0.85em; background: var(--blue-wash); padding: 1px 5px; }
@media (max-width: 760px) { .doc { padding: 28px 20px; } }
@media print {
  .no-print, .topnav { display: none !important; }
  .doc { border: none; padding: 0; }
  body { background: white; color: black; }
}

/* ---- booking slots ---- */
.slot-day { margin: 16px 0; }
.slot-day h3 { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot {
  padding: 7px 14px; border: 1px solid var(--line-strong); background: #FDFDFB;
  font-family: var(--font-mono); font-size: 12px; cursor: pointer; color: var(--ink);
}
.slot:hover { border-color: var(--blue); color: var(--blue); }
.slot.selected { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---- meeting room ---- */
.room { max-width: 980px; margin: 0 auto; }
.videobox {
  background: #0B1220; border: 1px solid var(--ink); width: 100%;
  display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative;
  aspect-ratio: 16/9;
}
.videobox video { width: 100%; height: 100%; object-fit: cover; }
.videobox .placeholder { color: #9AA1AC; font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
/* Call surface. The stage contains the RealtimeKit UI, which positions
   itself fixed/full-bleed internally; contain:paint makes this box the
   containing block for those internals. Desktop: tall stage in the page.
   Mobile: the call takes the whole viewport, FaceTime-style. */
.callwrap { position: relative; }
.stage {
  position: relative; height: clamp(560px, calc(100dvh - 200px), 880px); overflow: hidden;
  contain: layout paint; background: #0B1220; border: 1px solid var(--ink);
}
/* No display override here: the component's :host is a flex column and a
   document-level display:block would collapse its grid to zero height. */
.stage rtk-meeting { height: 100%; width: 100%; }

/* Floating capture-state pill: always visible over the call. */
.rec-pill {
  position: absolute; top: 12px; left: 12px; z-index: 30;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  padding: 6px 12px; border: 1px solid rgba(237,231,220,0.4); background: rgba(11,18,32,0.72);
  color: #EDE7DC; cursor: pointer; backdrop-filter: blur(8px);
}
.rec-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #8B93A3; }
.rec-pill.on { border-color: #E5484D; }
.rec-pill.on::before { background: #E5484D; animation: pulse 1.6s ease-out infinite; }
.callflash { position: absolute; top: 56px; left: 12px; right: 12px; z-index: 25; }

/* Way back to the video when chat or another panel covers it. */
.return-pill {
  position: absolute; top: 12px; right: 12px; z-index: 30;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 7px 14px; border: 1px solid var(--blue);
  background: var(--blue); color: #fff; cursor: pointer;
}
.return-pill::before { content: "\2190"; }
.return-pill:hover { background: var(--blue-deep); border-color: var(--blue-deep); }

/* Consent sheet. Desktop: a panel below the stage. Mobile: a bottom sheet. */
.sheet { background: var(--panel); border: 1px solid var(--line-strong); margin-top: 20px; padding: 16px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sheet-title {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft);
}
.sheet-close { display: none; background: none; border: none; color: inherit; font-size: 15px; padding: 4px 8px; cursor: pointer; }
.sheet-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.sheet-note { color: var(--ink-soft); font-size: 13px; margin-top: 12px; }
.callhead { margin-bottom: 14px; }

@media (max-width: 760px) {
  body:has(.callwrap) { overflow: hidden; }
  body:has(.callwrap) .secured { display: none; }
  .container:has(.callwrap) { max-width: none; padding: 0; }
  .callhead, .deskpanel { display: none; }
  .room { max-width: none; }
  .callwrap { position: fixed; inset: 0; z-index: 40; background: #0B1220; }
  .stage { height: 100dvh; border: none; }
  .rec-pill { top: calc(10px + env(safe-area-inset-top)); }
  .callflash { top: calc(52px + env(safe-area-inset-top)); }
  .sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0;
    background: rgba(16,22,36,0.94); border: none; border-top: 1px solid #3A4560;
    color: #EDE7DC; padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
    transform: translateY(105%); transition: transform 200ms ease-out;
    backdrop-filter: blur(14px);
  }
  .sheet.open { transform: translateY(0); }
  .sheet-title { color: #B9C2D6; }
  .sheet-close { display: block; color: #B9C2D6; }
  .sheet-note { color: #8E97AB; }
  .sheet .chip { background: transparent; border-color: #4A5570; color: #B9C2D6; }
  .sheet .chip::before { background: #7A8399; }
  .sheet .chip.ok { border-color: #3FA26C; color: #6FCF97; }
  .sheet .chip.ok::before { background: #6FCF97; }
  .sheet .chip.blue { border-color: #5B82EC; color: #8FA9F5; }
  .sheet .chip.blue::before { background: #8FA9F5; }
  .sheet-actions .btn { flex: 1 1 100%; text-align: center; padding: 14px; }
  .sheet .btn { color: #EDE7DC; border-color: #5A6580; background: transparent; }
  .sheet .btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
  .sheet .btn.danger { border-color: #E5484D; color: #FF8A8E; }
}
@media (prefers-reduced-motion: reduce) { .sheet { transition: none; } }

/* ---- misc ---- */
.flash { padding: 12px 16px; border: 1px solid var(--blue); background: var(--blue-wash); margin-bottom: 16px; font-size: 14px; }
.flash.err { border-color: var(--danger); background: #F7E5E2; }
.secured {
  text-align: center; margin: 40px 0 16px; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint);
}
.secured a { color: var(--ink-soft); }
.diagram {
  overflow-x: auto; background: var(--panel); border: 1px solid var(--line-strong);
  padding: 14px 10px; margin-top: 14px;
}
.diagram svg { display: block; min-width: 720px; width: 100%; height: auto; }

.hero-hatch {
  height: 64px; margin-top: 48px;
  background: repeating-linear-gradient(45deg, transparent 0 7px, rgba(22,35,59,0.13) 7px 8px);
  border-top: 1px solid var(--line-strong);
}
