/* XO Sense console
   ----------------
   Yellow on black, taken from the mark itself rather than guessed: the fox
   sits in #FECB03 on #0E0E0E and the interface uses the same two.

   Yellow is load-bearing, so it is rationed. It marks exactly two things --
   the brand, and the one action on a screen that matters. Everything else is
   a grey from the same cold family. A dashboard where six things are yellow
   is a dashboard where nothing is.

   Rajdhani for headings and numerals: squared and slightly condensed, it
   reads as instrumentation rather than as a marketing page, and it sits well
   next to a mark built out of straight lines and chip pins. Inter for prose,
   JetBrains Mono where columns must align. */

:root {
  --ink:        #0B0B0B;
  --panel:      #141414;
  --panel-2:    #1C1C1C;
  --panel-3:    #242424;
  --line:       #262626;
  --line-lit:   #363636;

  --brand:      #FECB03;
  --brand-lit:  #FED936;
  --brand-dim:  #6B5602;
  --brand-ink:  #0B0B0B;

  --good:       #6FBF4B;
  --warn:       #FFA726;
  --bad:        #E5533D;
  --info:       #6E9BC5;

  --text:       #E8E6E0;
  --text-2:     #A6A49E;
  --muted:      #78766F;

  --rail: 236px;
  --r: 4px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .num {
  font-family: Rajdhani, Inter, sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}
h1 { font-size: 27px; line-height: 1.2; }
h2 { font-size: 19px; }
h3 { font-size: 16px; color: var(--text-2); font-weight: 500; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono, td.mono {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
}

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ------------------------------------------------------------------ shell */

.shell { display: flex; min-height: 100vh; }

.rail {
  width: var(--rail);
  flex: 0 0 var(--rail);
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 22px 0 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.rail .brand { padding: 0 20px 22px; }
.rail .brand img { height: 30px; display: block; }
.rail nav { display: flex; flex-direction: column; gap: 1px; }
.rail nav a {
  padding: 9px 20px;
  color: var(--text-2);
  border-left: 2px solid transparent;
  font-size: 14px;
}
.rail nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.rail nav a.on {
  background: var(--panel-2);
  border-left-color: var(--brand);
  color: var(--text);
}
.rail .foot {
  margin-top: auto;
  padding: 14px 20px 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.rail .foot strong { display: block; color: var(--text-2); font-weight: 500; }

.page { flex: 1; min-width: 0; padding: 26px 30px 60px; max-width: 1240px; }
.page > header { margin-bottom: 22px; }
.page > header p { margin: 4px 0 0; color: var(--muted); max-width: 62ch; }

/* ------------------------------------------------------------------ panel */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.panel > h2 { margin-bottom: 12px; }
.panel > h2 + .sub { margin: -8px 0 14px; color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* -------------------------------------------------------------- latency strip
   The dashboard hero. Every recent turn as one bar, oldest at the left,
   coloured by which path answered it. The budget line is drawn across the
   top: bars that touch it are the ones worth looking at. */

.strip {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 118px;
  padding: 10px 0 0;
  position: relative;
  border-bottom: 1px solid var(--line-lit);
}
.strip .budget {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px dashed var(--bad);
  opacity: 0.55;
}
.strip .budget span {
  position: absolute; right: 0; top: -18px;
  font-size: 11px; color: var(--bad);
  font-family: "JetBrains Mono", monospace;
}
.strip i {
  flex: 1 1 0;
  min-width: 3px;
  /* Dim fill, bright cap. A solid yellow bar at this density reads as one
     block; the cap is what lets you see individual turns. */
  background: #3A2F02;
  border-top: 2px solid var(--brand);
  display: block;
}
.strip i.model { background: #2A3B4A; border-top-color: var(--info); }
.strip.empty { align-items: center; justify-content: center; color: var(--muted); border-bottom: none; }

.legend { display: flex; gap: 18px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.legend b { display: inline-block; width: 9px; height: 9px; margin-right: 6px; }
.legend .d { background: var(--brand); }
.legend .m { background: var(--info); }

/* ------------------------------------------------------------------ stats */

.stat { border-left: 2px solid var(--line-lit); padding-left: 12px; }
.stat .v { font-family: Rajdhani, sans-serif; font-size: 30px; font-weight: 600; line-height: 1.1; }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat.good { border-left-color: var(--brand); }
.stat.warn { border-left-color: var(--info); }
.stat.bad  { border-left-color: var(--bad); }

/* ------------------------------------------------------------------ table */

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-family: Rajdhani, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-lit);
  white-space: nowrap;
}
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: var(--panel-2); }
td.num, th.num { text-align: right; font-family: "JetBrains Mono", monospace; font-size: 12.5px; }
.empty-row td { color: var(--muted); text-align: center; padding: 30px; }

/* ------------------------------------------------------------------- pills */

.pill {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line-lit);
  border-radius: 999px;
  font-size: 11.5px;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-2);
  white-space: nowrap;
}
.pill.resolved    { border-color: var(--brand); color: var(--brand); }
.pill.in_progress { border-color: var(--info); color: var(--info); }
.pill.transferred { border-color: var(--muted); color: var(--muted); }
.pill.interrupted { border-color: var(--line-lit); color: var(--muted); }
.pill.failed      { border-color: var(--bad); color: var(--bad); }
.pill.direct      { border-color: var(--brand); color: var(--brand); }
.pill.model       { border-color: var(--info); color: var(--info); }
.pill.up          { border-color: var(--brand); color: var(--brand); }
.pill.down        { border-color: var(--bad); color: var(--bad); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; }
.dot.up { background: var(--brand); }
.dot.down { background: var(--bad); }

/* ------------------------------------------------------------------- forms */

label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number],
select, textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line-lit);
  border-radius: var(--r);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; }
textarea { min-height: 84px; resize: vertical; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 180px; }
.row > .tight { flex: 0 0 auto; }

button, .btn {
  background: var(--brand);
  color: var(--brand-ink);
  border: 1px solid var(--brand);
  border-radius: var(--r);
  padding: 8px 16px;
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
}
button:hover, .btn:hover { background: var(--brand); border-color: var(--brand); text-decoration: none; }
button.ghost, .btn.ghost {
  background: transparent; color: var(--text-2); border-color: var(--line-lit);
}
button.ghost:hover, .btn.ghost:hover { background: var(--panel-2); color: var(--text); }
button.small { padding: 4px 10px; font-size: 12.5px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ------------------------------------------------------------------ flashes */

.flash {
  border: 1px solid var(--line-lit);
  border-left-width: 2px;
  border-radius: 0;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13.5px;
  background: var(--panel);
}
.flash.ok    { border-left-color: var(--brand); }
.flash.warn  { border-left-color: var(--info); }
.flash.error { border-left-color: var(--bad); }

/* ----------------------------------------------------------------- login */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login {
  width: 100%;
  max-width: 372px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 30px 28px;
}
.login img { height: 34px; display: block; margin-bottom: 26px; }
.login .hint {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}

/* ------------------------------------------------------------- transcript */

.turn { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.turn .i { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--muted); padding-top: 3px; }
.turn .heard { color: var(--text-2); }
.turn .said { margin-top: 5px; }
.turn .meta { text-align: right; white-space: nowrap; }
.turn .meta .lat { font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--muted); display: block; margin-top: 5px; }
.turn .meta .lat.over { color: var(--bad); }

/* ------------------------------------------------------------------- live */

#feed { max-height: 460px; overflow-y: auto; }
#feed .ev { display: grid; grid-template-columns: 62px 128px 1fr; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
#feed .ev .t { font-family: "JetBrains Mono", monospace; font-size: 11.5px; color: var(--muted); }
#feed .ev .ty { font-family: "JetBrains Mono", monospace; font-size: 11.5px; color: var(--brand); }
#feed .ev.ended .ty { color: var(--muted); }

.tools { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }

@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .rail { width: 100%; flex: none; height: auto; position: static; padding-bottom: 8px; }
  .rail nav { flex-direction: row; overflow-x: auto; }
  .rail nav a { border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
  .rail nav a.on { border-left: none; border-bottom-color: var(--brand); }
  .rail .foot { display: none; }
  .page { padding: 20px 16px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}


/* ------------------------------------------------------------------ footer */

.foot-bar {
  margin-top: 48px;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}
.foot-bar img { height: 20px; opacity: 0.85; }
.foot-bar a { color: var(--text-2); }
.foot-bar a:hover { color: var(--brand); text-decoration: none; }
.foot-bar .spacer { margin-left: auto; }

/* ----------------------------------------------------------------- support
   Bottom-right, above everything, and deliberately not yellow: it must be
   findable without competing with the one action on the page that is. */

.support {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
}
.support button {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line-lit);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13.5px;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
.support button:hover { border-color: var(--brand); color: var(--brand); background: var(--panel-2); }
.support .sheet {
  position: absolute;
  right: 0;
  bottom: 48px;
  width: 296px;
  background: var(--panel);
  border: 1px solid var(--line-lit);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 16px 44px rgba(0,0,0,.6);
}
.support .sheet h3 { margin: 0 0 6px; color: var(--text); }
.support .sheet p { margin: 0 0 12px; font-size: 13px; color: var(--text-2); }
.support .sheet a { display: block; padding: 6px 0; font-size: 13.5px; }
.support[hidden] { display: none; }

/* --------------------------------------------------------------- use cases */

.usecases { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); }
.usecase {
  display: block;
  border: 1px solid var(--line-lit);
  border-radius: var(--r);
  padding: 13px 15px;
  cursor: pointer;
  background: var(--panel);
}
.usecase:hover { border-color: var(--brand-dim); }
.usecase input { position: absolute; opacity: 0; }
.usecase strong { display: block; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.usecase span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.usecase:has(input:checked) { border-color: var(--brand); background: var(--panel-2); }
.usecase:has(input:checked) strong { color: var(--brand); }

/* --------------------------------------------------------------- marketing */

.marketing { max-width: 880px; margin: 0 auto; padding: 26px 24px 60px; }
.mast { display: flex; align-items: center; justify-content: space-between; margin-bottom: 40px; }
.mast nav a { font-size: 14px; }
.marketing h1 { font-size: 32px; margin-bottom: 10px; }
.marketing .lede { color: var(--text-2); max-width: 60ch; font-size: 15.5px; margin: 0; }
.marketing h2 { font-size: 16px; color: var(--text-2); font-weight: 500; }

/* ------------------------------------------------------------------ thread
   One column, both channels. A voice turn and a typed line look the same
   apart from a glyph, because to the caller they were the same conversation. */

.thread { flex: 1; overflow-y: auto; max-height: 56vh; padding-right: 6px; }
.bubble { max-width: 78%; margin-bottom: 12px; }
.bubble .body {
  padding: 9px 13px; border-radius: 10px; font-size: 14.5px; line-height: 1.55;
  background: var(--panel-2); border: 1px solid var(--line);
}
.bubble.caller { margin-right: auto; }
.bubble.agent { margin-left: auto; }
.bubble.agent .body { background: #2A2405; border-color: var(--brand-dim); }
.bubble.operator .body { background: var(--panel-3); border-style: dashed; }
.bubble.system { max-width: 100%; text-align: center; }
.bubble.system .body { background: none; border: none; color: var(--muted); font-size: 12.5px; }
.bubble .meta {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-top: 4px; font-size: 11.5px; color: var(--muted);
}
.bubble.agent .meta { justify-content: flex-end; }
.bubble .meta .ch { font-family: "JetBrains Mono", monospace; }

.composer { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-lit); }
.composer input { flex: 1; }
