/* ============================================================
   OBSERVABLE 21 — casino skin (SPEC D1–D5) + LangSmith drawer (D7)
   ============================================================ */
:root {
  --bg: #0A1120;
  --bg-hi: #1B2B47;
  --panel: #14203A;
  --felt: #1D6A4F;
  --gold: #C8A24A;
  --gold-hi: #F0D493;
  --win: #7FD6A8;
  --bust: #E0605A;
  --bust-deep: #B3241F;
  --card: #FBF8F1;
  --card-edge: #CFC3AA;
  --ink: #F2E7CF;
  --ink-dim: #8E9BB3;
  --ink-faint: #5D6A82;
  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-ui: 'Jost', system-ui, sans-serif;
  --font-talk: 'Cormorant Garamond', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: radial-gradient(1200px 700px at 50% -10%, var(--bg-hi) 0%, var(--bg) 62%) fixed;
  color: var(--ink);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}

/* ---------- D4 · header ---------- */
#header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  padding: 18px 28px;
}
.brand h1 {
  font-family: var(--font-display); font-weight: 600; text-transform: uppercase;
  letter-spacing: .3em; font-size: 20px; color: var(--ink);
}
.brand-sub {
  display: block; margin-top: 3px;
  color: var(--ink-dim); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
}
#auth-status { display: flex; align-items: center; gap: 12px; }
.operator-id { color: var(--ink-dim); font-size: 12px; letter-spacing: .06em; }

.gold-pill {
  display: inline-block; text-decoration: none; cursor: pointer;
  background: linear-gradient(180deg, #D9B767, #B3873C);
  color: #20180A; font-family: var(--font-ui); font-weight: 600; font-size: 13px;
  letter-spacing: .06em; padding: 8px 18px; border-radius: 999px; border: none;
  transition: filter .15s ease;
}
.gold-pill:hover { filter: brightness(1.08); }

/* status rail */
.status-pill {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid rgba(200,162,74,.35);
  background: rgba(200,162,74,.07);
  border-radius: 999px; padding: 8px 18px;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--win); box-shadow: 0 0 8px var(--win);
  animation: dot-pulse 1.6s ease-in-out infinite;
}
.round-label { color: var(--ink-dim); font-size: 13px; letter-spacing: .08em; }
.phase-word {
  font-family: var(--font-display); font-weight: 600; text-transform: uppercase;
  letter-spacing: .3em; font-size: 12px; color: #E8CF95;
  transition: opacity 180ms ease;
}
.status-pill.paused .live-dot { background: var(--gold-hi); box-shadow: 0 0 8px var(--gold-hi); }
.status-pill.dormant { opacity: .55; }
.status-pill.dormant .live-dot { background: var(--ink-faint); box-shadow: none; animation: none; }

/* ---------- floor layout (the table is the app) ---------- */
#floor {
  display: grid; grid-template-columns: minmax(0, 1fr);
  padding: 6px 28px 44px; align-items: start;
}
#table-wrap { display: flex; justify-content: center; }

/* ---------- D1 · felt (~80vh tall, cards scale with it) ---------- */
#felt {
  position: relative;
  width: min(100%, calc(80vh * 1.9435));
  aspect-ratio: 1205 / 620;
  border-radius: 22px;
  background: url('/static/img/table-felt.jpg') center / cover no-repeat;
  box-shadow: inset 0 0 120px rgba(0,0,0,.45), 0 30px 60px rgba(0,0,0,.5);
}

/* felt badges (table comment + rules) */
.felt-badge {
  position: absolute; transform: translate(-50%, -50%);
  text-align: center; display: flex; flex-direction: column; gap: 2px;
}
#table-comment {
  transform: translate(0, -50%);
  background: rgba(8,14,24,.78); border: 1px solid rgba(200,162,74,.35);
  border-radius: 12px; padding: 9px 14px; min-width: 92px; text-align: left;
}
#table-comment .badge-title {
  font-family: var(--font-display); font-weight: 600; font-size: 9px;
  letter-spacing: .3em; text-transform: uppercase; color: var(--gold);
  transition: opacity .18s ease;
}
#table-comment .comment-text {
  font-size: 13.5px; font-weight: 500; line-height: 1.45; color: var(--ink);
  transition: opacity .18s ease;
}
#rules-legend {
  font-family: var(--font-display); font-weight: 600; font-size: 11px;
  letter-spacing: .24em; text-transform: uppercase; color: rgba(242,231,207,.55);
  white-space: nowrap;
  transition: opacity .4s ease;
}

/* ---------- win celebration (the table's existing centre space) ---------- */
#win-banner {
  position: absolute; left: 50%; top: 37%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-align: center; pointer-events: none; z-index: 6;
  padding: 16px 44px 20px; border-radius: 14px;
}
#win-banner::before {
  content: ""; position: absolute; inset: -46px -80px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(240,212,147,.22), rgba(200,162,74,.08) 50%, transparent 72%);
  pointer-events: none;
}
#win-banner .wb-suits {
  font-size: 15px; letter-spacing: .55em; text-indent: .55em;
  color: var(--gold); opacity: .9;
}
#win-banner .wb-eyebrow {
  font-family: var(--font-display); font-weight: 600; font-size: 10px;
  letter-spacing: .34em; text-transform: uppercase; color: var(--gold-hi);
}
#win-banner .wb-name {
  font-family: var(--font-display); font-weight: 600; font-size: 22px;
  letter-spacing: .1em; text-transform: uppercase; line-height: 1.05;
  background: linear-gradient(100deg, #7d5f22 0%, var(--gold) 28%, var(--gold-hi) 50%, var(--gold) 72%, #7d5f22 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: wb-shine 2.6s linear infinite;
}
#win-banner .wb-sub {
  font-family: var(--font-talk); font-style: normal; font-weight: 500;
  font-size: 20px; color: var(--ink-dim); letter-spacing: .04em;
}
#win-banner.show { animation: wb-pop .55s cubic-bezier(.18, 1.35, .4, 1) both; }
@keyframes wb-pop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.78); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes wb-shine { from { background-position: 210% 0; } to { background-position: -110% 0; } }
#felt.win-celebrate #rules-legend { opacity: 0; }

/* ---------- D2 · seats ---------- */
.seat {
  position: absolute; transform: translateX(-50%);
  width: 216px;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
}
.dealer-meta { display: flex; align-items: baseline; gap: 10px; }
.hand-value { font-size: 17px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.player-value {
  font-size: 20px; letter-spacing: .02em;
  text-shadow: 0 1px 10px rgba(0,0,0,.55);
}
.seat-status {
  font-family: var(--font-display); font-weight: 600; font-size: 10px;
  letter-spacing: .26em; text-transform: uppercase; color: var(--gold);
}

.plate {
  display: flex; align-items: center; gap: 11px;
  background: rgba(8,14,24,.78);
  border-radius: 999px; padding: 7px 13px 7px 7px;
}
.portrait {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background-color: #1a2740; background-position: 50% 20%; background-size: cover;
  border: 1.5px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .3s, box-shadow .3s, filter .3s;
}
.portrait .mono {
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  color: #20180A; background: radial-gradient(circle at 50% 30%, var(--gold-hi), var(--gold));
  width: 100%; height: 100%; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.plate-name {
  font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink); white-space: nowrap;
}
.plate-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  flex: none;
  /* Fixed width, sized for the longest label ("OUCH! 21!"): the plate must
     never change width as the state word changes, or the seat shakes. */
  width: 88px;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim);
}
.pill-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; animation: dot-pulse 1s ease-in-out infinite;
}

/* seat state machine (ring + pill colour) */
.seat .portrait { border-color: rgba(255,255,255,.2); }
.seat .plate-pill { color: var(--ink-dim); }
.seat.thinking .portrait {
  border-color: var(--gold-hi); box-shadow: 0 0 0 4px rgba(240,212,147,.15);
  animation: ring-pulse 1.8s ease-in-out infinite;
}
.seat.thinking .plate-pill { color: var(--gold-hi); }
.seat.acting .portrait { border-color: var(--win); }
.seat.acting .plate-pill { color: var(--win); }
.seat.stood .portrait { border-color: var(--gold); }
.seat.stood .plate-pill { color: var(--gold); }
.seat.bust .portrait { border-color: var(--bust-deep); filter: saturate(.55); }
.seat.bust .plate-pill { color: var(--bust); }
.seat.blackjack .portrait {
  border-color: #fff;
  box-shadow: 0 0 0 4px rgba(200,162,74,.35), 0 0 18px rgba(200,162,74,.4);
}
.seat.blackjack .plate-pill { color: var(--gold-hi); }

.rationale {
  font-family: var(--font-talk); font-style: italic; font-weight: 500;
  font-size: 16px; color: var(--ink-dim); text-align: center; line-height: 1.35;
  max-width: 264px; min-height: 2.7em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* pause freezes all seat animation */
#felt.paused .portrait, #felt.paused .pill-dot, #felt.paused .live-dot {
  animation-play-state: paused;
}

/* ---------- D3 · cards (big & readable: rank + suit, red/black) ---------- */
.fan { display: flex; justify-content: center; min-height: 96px; perspective: 900px; }
.dealer-fan { min-height: 132px; }
.card {
  width: 64px; height: 92px; border-radius: 7px;
  background: var(--card); border: 1px solid var(--card-edge);
  box-shadow: 0 10px 18px rgba(0,0,0,.5);
  margin-right: -20px;
  display: flex; flex-direction: column; padding: 7px 9px;
  transform: rotate(var(--rot, 0deg));
  position: relative;
}
.dealer-fan .card { width: 86px; height: 122px; margin-right: -28px; padding: 9px 11px; }
.fan.tight .card { margin-right: -32px; }
.dealer-fan.tight .card { margin-right: -32px; }
.card .rank {
  font-family: var(--font-talk); font-weight: 600; font-size: 23px; line-height: 1;
}
.dealer-fan .card .rank { font-size: 31px; }
.card .suit-glyph { font-size: 19px; line-height: 1.15; }
.dealer-fan .card .suit-glyph { font-size: 25px; }
.card.red { color: var(--bust-deep); }
.card.black { color: #1c2430; }

.card.hole {
  background: repeating-linear-gradient(45deg, #22304d 0 6px, #1a2740 6px 12px);
  border-color: #33456e;
}
.card.dealing { animation: deal-in 320ms cubic-bezier(.2,.8,.2,1); }
.card.flipping { animation: flip 260ms ease; }
.card.newest { outline: 1.5px solid var(--gold); outline-offset: 1px; }

/* ---------- D5 · inspector modal (talk / events / state) ---------- */
#inspector-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(4,8,14,.6); backdrop-filter: blur(3px);
}
#inspector {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 41;
  width: min(1170px, 96vw); max-height: 90vh;
  display: flex; flex-direction: column;
  background: #0b1220;
  border: 1px solid rgba(200,162,74,.35);
  border-radius: 24px;
  box-shadow: 0 40px 90px rgba(0,0,0,.65);
  padding: 27px 30px 21px;
}
.insp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.insp-close {
  background: transparent; border: 1px solid rgba(255,255,255,.14); color: var(--ink-dim);
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  font-size: 22px; line-height: 1; transition: all .15s ease;
}
.insp-close:hover { color: var(--ink); border-color: rgba(255,255,255,.3); }
.insp-body {
  flex: 1; min-height: 280px; max-height: calc(90vh - 265px);
  overflow-y: auto; margin-top: 4px;
}
#inspector .tab-body { max-height: none; overflow: visible; }
#inspector .talk-body { max-height: none; mask-image: none; }

.panel-title {
  font-family: var(--font-display); font-weight: 600; text-transform: uppercase;
  letter-spacing: .24em; font-size: 16px; color: var(--gold); margin-bottom: 18px;
}
.hidden { display: none !important; }

.talk-body {
  max-height: 260px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  mask-image: linear-gradient(180deg, #000 80%, rgba(0,0,0,.6));
}
.talk-line { font-family: var(--font-talk); font-style: italic; font-weight: 500; font-size: 30px; color: var(--ink); line-height: 1.35; }
.talk-line .who {
  display: block; margin-bottom: 2px;
  font-family: var(--font-ui); font-style: normal; font-size: 10px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--gold);
}
.talk-line .ts { font-family: var(--font-ui); font-style: normal; font-size: 10px; color: var(--ink-faint); margin-left: 6px; }
.talk-thinking { display: inline-flex; gap: 4px; padding: 4px 0 0; }
.talk-thinking span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold-hi);
  animation: dot-pulse 1s ease-in-out infinite;
}
.talk-thinking span:nth-child(2) { animation-delay: .2s; }
.talk-thinking span:nth-child(3) { animation-delay: .4s; }

/* tabs */
.tab-bar { display: flex; gap: 9px; margin-bottom: 18px; }
.tab {
  background: transparent; border: 1px solid rgba(255,255,255,.12); color: var(--ink-dim);
  font-family: var(--font-ui); font-size: 16px; letter-spacing: .1em; text-transform: uppercase;
  padding: 9px 21px; border-radius: 999px; cursor: pointer; transition: all .15s ease;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: #20180A; background: linear-gradient(180deg, #D9B767, #B3873C);
  border-color: transparent; font-weight: 600;
}
.tab-body { max-height: 300px; overflow-y: auto; }
.log-body {
  mask-image: linear-gradient(180deg, #000 80%, rgba(0,0,0,.6));
}
.log-body p {
  font-family: ui-monospace, Consolas, monospace; font-size: 17px;
  padding: 7px 2px; color: #9FB0C8;
  border-bottom: 1px solid rgba(255,255,255,.04);
  animation: fade-in 200ms ease;
  word-break: break-word;
}
.log-body .ts { color: var(--ink-faint); }
.log-body .ev-win { color: var(--win); }
.log-body .ev-bust { color: var(--bust); }
.log-body .ev-gold { color: var(--gold-hi); }
.log-body .ev-dim { color: var(--ink-dim); }
.state-json {
  font-family: ui-monospace, Consolas, monospace; font-size: 16px;
  color: #9FB0C8; white-space: pre-wrap; word-break: break-word; line-height: 1.5;
}

/* diagram tab */
.arch-wrap {
  padding: 9px 6px 15px;
  max-width: 1100px;
  margin: 0 auto;
}
.arch-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}
.arch-notes {
  margin-top: 20px;
  display: grid;
  gap: 14px;
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink-dim);
}
.arch-notes strong { color: var(--ink); font-weight: 600; }

/* operator block (modal footer) */
#operator-block {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 3px 3px; margin-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
}
#operator-block .gold-pill { font-size: 18px; padding: 11px 26px; }
.speed-control {
  color: var(--ink-dim); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
#speed-select {
  background: rgba(10,16,28,.9); color: var(--ink);
  border: 1px solid rgba(200,162,74,.35); border-radius: 999px;
  padding: 10px 18px; font-family: var(--font-ui); font-size: 18px; cursor: pointer;
}
.operator-feedback { color: var(--win); font-size: 12px; opacity: 0; transition: opacity .3s; }
.operator-feedback.show { opacity: 1; }
.operator-locked span { color: var(--ink-faint); font-size: 12px; letter-spacing: .06em; }

/* ---------- keyframes ---------- */
@keyframes dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ring-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(240,212,147,.15); }
  50% { box-shadow: 0 0 0 7px rgba(240,212,147,.28); }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes deal-in {
  0% { transform: rotate(var(--rot, 0deg)) translate(46px, -30px); opacity: 0; }
  100% { transform: rotate(var(--rot, 0deg)); opacity: 1; }
}
@keyframes flip {
  from { transform: rotate(var(--rot, 0deg)) rotateY(90deg); }
  to { transform: rotate(var(--rot, 0deg)) rotateY(0deg); }
}

/* ============================================================
   1b fallback — below 1100px: dealer band + seat grid
   ============================================================ */
@media (max-width: 1100px) {
  #floor { grid-template-columns: 1fr; }
  #felt {
    aspect-ratio: auto; width: 100%;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px; padding: 14px;
    background: linear-gradient(160deg, #175540, #0f3d2c);
  }
  .seat { position: static; transform: none; width: 100%; }
  .dealer-seat {
    grid-column: 1 / -1; min-height: 122px;
    background: linear-gradient(180deg, #1D6A4F, #14523C);
    border: 1px solid rgba(200,162,74,.35); border-radius: 14px;
    padding: 14px 18px;
    box-shadow: inset 0 2px 0 rgba(255,255,255,.08), 0 18px 40px rgba(0,0,0,.45);
  }
  .dealer-meta { order: -1; }
  #table-comment { position: static; transform: none; justify-self: end; grid-column: 1 / -1; }
  #rules-legend { position: static; transform: none; grid-column: 1 / -1; white-space: normal; }
  .player-seat { grid-column: span 2; }
}
@media (max-width: 760px) {
  .player-seat { grid-column: span 4; }
  #header { padding: 14px 18px; }
  #floor { padding: 6px 18px 30px; }
}

/* ============================================================
   D7 · LangSmith observability drawer — its own light surface,
   no casino tokens inside
   ============================================================ */
:root {
  --ls-bg: #FFFFFF; --ls-bg-alt: #F9FAFB; --ls-line: #E5E7EB; --ls-line-soft: #F3F4F6;
  --ls-ink: #111827; --ls-ink-2: #374151; --ls-ink-3: #6B7280; --ls-ink-4: #9CA3AF;
  --ls-primary: #2563EB; --ls-primary-2: #1D4ED8; --ls-primary-soft: #EFF6FF;
  --ls-primary-chip: #DBEAFE;
  --ls-green: #10B981; --ls-green-ink: #059669; --ls-green-soft: #DCFCE7; --ls-green-line: #A7F3D0;
  --ls-amber: #F59E0B; --ls-amber-ink: #B45309; --ls-amber-line: #FDE68A;
  --ls-red: #DC2626; --ls-red-ink: #B91C1C; --ls-red-soft: #FEE2E2;
  --ls-span-chain: #3B82F6; --ls-span-chain-soft: #93C5FD;
  --ls-span-llm: #FB923C; --ls-span-llm-soft: #FDBA74;
  --ls-span-tool: #6EE7B7;
  --ls-mono: ui-monospace, Menlo, Consolas, monospace;
}

.ls-trigger {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05);
  color: var(--ink-dim); border-radius: 999px; padding: 7px 14px;
  font-family: ui-monospace, Consolas, monospace; font-size: 11px; letter-spacing: .08em;
  transition: all .15s ease;
}
.ls-trigger:hover { color: var(--ink); border-color: rgba(255,255,255,.3); }
.ls-trigger img { width: 14px; height: 14px; }

.ls-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(6,11,20,.62);
  opacity: 0; pointer-events: none; transition: opacity 320ms cubic-bezier(.2,.8,.2,1);
}
.ls-backdrop.open { opacity: 1; pointer-events: auto; }

.ls-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 100;
  width: clamp(480px, 35vw, 720px);
  background: var(--ls-bg); color: var(--ls-ink);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  transform: translateX(102%);
  transition: transform 320ms cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(0,0,0,.5);
}
.ls-drawer.open { transform: translateX(0); }
@media (max-width: 900px) {
  .ls-drawer {
    width: 100%; top: auto; height: 82vh;
    transform: translateY(102%); border-radius: 16px 16px 0 0;
  }
  .ls-drawer.open { transform: translateY(0); }
}

.ls-mono { font-family: var(--ls-mono); }
.ls-label {
  font-size: 9.5px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ls-ink-4);
}
.ls-block { padding: 14px 16px; border-bottom: 1px solid var(--ls-line-soft); }

/* header */
.ls-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--ls-line);
}
.ls-header img.ls-mark { width: 20px; height: 20px; }
.ls-header .ls-name { font-size: 15px; font-weight: 600; color: var(--ls-ink); }
.ls-chip {
  font-family: var(--ls-mono); font-size: 9px; letter-spacing: .08em;
  border: 1px solid var(--ls-line); color: var(--ls-ink-3);
  border-radius: 4px; padding: 2px 6px;
}
.ls-chip.sim { background: var(--ls-amber-soft, #FFFBEB); border-color: var(--ls-amber-line); color: var(--ls-amber-ink); }
.ls-spacer { flex: 1; }
.ls-close {
  width: 26px; height: 26px; border: none; background: transparent; cursor: pointer;
  color: var(--ls-ink-3); font-size: 16px; border-radius: 6px; line-height: 1;
}
.ls-close:hover { background: var(--ls-bg-alt); color: var(--ls-ink); }

/* breadcrumb */
.ls-crumbs {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px; font-size: 11px; color: var(--ls-ink-3);
  border-bottom: 1px solid var(--ls-line-soft);
}
.ls-crumbs .crumb-id { font-family: var(--ls-mono); color: var(--ls-ink); }
.ls-chip.ok { background: var(--ls-green-soft); color: var(--ls-green-ink); font-weight: 600; border: none; }
.ls-live { margin-left: auto; font-family: var(--ls-mono); font-size: 10px; color: var(--ls-ink-4); }

/* stat strip */
.ls-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--ls-line-soft); border-bottom: 1px solid var(--ls-line-soft); }
.ls-stat { background: var(--ls-bg); padding: 12px 16px; }
.ls-stat .val { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ls-ink); margin-top: 3px; }
.ls-lat-pills { display: flex; gap: 6px; margin-top: 5px; }
.ls-lat {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--ls-mono); font-size: 10px; padding: 2px 8px;
  border-radius: 999px; border: 1px solid var(--ls-line); color: var(--ls-ink-2);
}
.ls-lat .dot { width: 5px; height: 5px; border-radius: 50%; }
.ls-lat.p50 { border-color: var(--ls-green-line); } .ls-lat.p50 .dot { background: var(--ls-green); }
.ls-lat.p99 { border-color: var(--ls-amber-line); } .ls-lat.p99 .dot { background: var(--ls-amber); }

/* tabs */
.ls-tabs { display: flex; gap: 18px; padding: 0 16px; border-bottom: 1px solid var(--ls-line); }
.ls-tab {
  background: none; border: none; cursor: pointer;
  padding: 11px 2px; font-size: 13px; font-weight: 500; color: var(--ls-ink-3);
  border-bottom: 2px solid transparent;
}
.ls-tab.active { color: var(--ls-ink); font-weight: 600; border-bottom-color: var(--ls-primary); }

.ls-body { flex: 1; overflow-y: auto; }

/* span rows (trace) */
.ls-subbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; }
.ls-toggle {
  border: 1px solid var(--ls-line); background: var(--ls-bg-alt); color: var(--ls-ink-2);
  font-size: 11px; padding: 4px 10px; border-radius: 6px; cursor: pointer;
}
.ls-toggle.active { background: var(--ls-primary-soft); border-color: var(--ls-primary); color: var(--ls-primary-2); }
.ls-subbar .meta { margin-left: auto; font-family: var(--ls-mono); font-size: 10px; color: var(--ls-ink-4); }

.ls-span {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; margin: 0 8px; border-radius: 6px;
}
.ls-span.sel { background: var(--ls-primary-soft); box-shadow: inset 2px 0 0 var(--ls-primary); }
.ls-span .indent { flex: none; }
.ls-badge {
  flex: none; width: 30px; height: 15px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 6px; font-weight: 700; letter-spacing: .05em;
}
.ls-badge.chain { background: var(--ls-span-chain); color: #fff; }
.ls-badge.chain-soft { background: var(--ls-span-chain-soft); color: #1E3A8A; }
.ls-badge.llm { background: var(--ls-span-llm-soft); color: #7C2D12; }
.ls-badge.tool { background: var(--ls-span-tool); color: #065F46; }
.ls-span .name { font-size: 12px; color: var(--ls-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-span.sel .name { color: var(--ls-primary-2); font-weight: 600; }
.ls-span .dur { font-family: var(--ls-mono); font-size: 10px; color: var(--ls-ink-3); flex: none; }
.ls-span .tok { font-family: var(--ls-mono); font-size: 10px; color: var(--ls-ink-4); flex: none; }
.ls-span .track {
  flex: none; width: 150px; height: 5px; border-radius: 3px; background: var(--ls-line-soft);
  position: relative; overflow: hidden;
}
.ls-span .track .bar { position: absolute; top: 0; bottom: 0; background: var(--ls-primary); border-radius: 3px; }
.ls-span .track .bar.tool { background: var(--ls-span-tool); }
.ls-span .track .bar.llm { background: var(--ls-span-llm); }
.ls-chip.err { background: var(--ls-red-soft); color: var(--ls-red); border: none; }

/* feedback pills */
.ls-feedback { display: flex; flex-wrap: wrap; gap: 8px; }
.ls-fb {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--ls-line); border-radius: 999px; padding: 4px 9px;
  font-size: 11px; color: var(--ls-ink-2); background: var(--ls-bg);
}
.ls-fb .dot { width: 6px; height: 6px; border-radius: 50%; }
.ls-fb .v { font-family: var(--ls-mono); color: var(--ls-primary); font-size: 11px; }
.ls-fb.amber { background: #FFFBEB; border-color: var(--ls-amber-line); }
.ls-fb.green .dot { background: var(--ls-green); }
.ls-fb.amber .dot { background: var(--ls-amber); }
.ls-fb.blue .dot { background: var(--ls-primary); }
.ls-fb.red .dot { background: var(--ls-red); }

/* per-agent table */
.ls-table { width: 100%; border-collapse: collapse; }
.ls-table th {
  font-size: 9.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ls-ink-4); text-align: left; padding: 6px 8px;
}
.ls-table th.num, .ls-table td.num { text-align: right; font-family: var(--ls-mono); }
.ls-table td { font-size: 12px; color: var(--ls-ink-2); padding: 7px 8px; border-top: 1px solid var(--ls-line-soft); }
.ls-table td.num { font-size: 11px; }
.ls-good { color: var(--ls-green-ink) !important; }
.ls-warn { color: var(--ls-amber-ink) !important; }
.ls-bad { color: var(--ls-red-ink) !important; }

/* metrics tab */
.ls-headline { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.ls-headline .big { font-size: 30px; font-weight: 600; color: var(--ls-ink); font-variant-numeric: tabular-nums; }
.ls-headline .delta { font-family: var(--ls-mono); font-size: 11px; color: var(--ls-green-ink); }
.ls-headline .side { margin-left: auto; text-align: right; font-size: 13px; color: var(--ls-ink-2); }
.ls-headline .side .bad { color: var(--ls-red); font-family: var(--ls-mono); }
.ls-spark { width: 100%; height: auto; display: block; }
.ls-spark-cap { display: flex; justify-content: space-between; font-family: var(--ls-mono); font-size: 10px; color: var(--ls-ink-4); margin-top: 4px; }

.ls-eval { display: grid; grid-template-columns: 1fr 200px 42px; align-items: center; gap: 10px; padding: 5px 0; }
.ls-eval .nm { font-size: 12px; color: var(--ls-ink-2); }
.ls-eval .trk { height: 7px; border-radius: 4px; background: var(--ls-line-soft); overflow: hidden; }
.ls-eval .trk .fill { height: 100%; border-radius: 4px; }
.ls-eval .vl { font-family: var(--ls-mono); font-size: 11px; text-align: right; color: var(--ls-ink-2); }

/* recent runs */
.ls-run { display: grid; grid-template-columns: 118px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--ls-line-soft); }
.ls-run .nm { font-size: 12px; font-weight: 500; color: var(--ls-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-run .inp { font-family: var(--ls-mono); font-size: 10px; color: var(--ls-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-run .lat { display: inline-flex; align-items: center; gap: 6px; font-family: var(--ls-mono); font-size: 10px; color: var(--ls-ink-2); }
.ls-run .lat .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ls-green); }
.ls-run .lat.err .dot { background: var(--ls-red); }
.ls-run .lat.slow .dot { background: var(--ls-amber); }

/* footer */
.ls-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--ls-line);
}
.ls-btn { border: none; cursor: pointer; border-radius: 7px; padding: 7px 13px; font-size: 12px; font-weight: 500; }
.ls-btn.primary { background: var(--ls-primary); color: #fff; }
.ls-btn.primary:hover { background: var(--ls-primary-2); }
.ls-btn.ghost { background: var(--ls-bg); border: 1px solid var(--ls-line); color: var(--ls-ink-2); }
.ls-footer img.wordmark { width: 74px; opacity: .45; margin-left: auto; }

/* D6 · welcome modal — "Deep Agents Gamble" */
#welcome-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6, 10, 16, .8);
  backdrop-filter: blur(3px);
}
#welcome-modal {
  position: fixed; z-index: 51;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(580px, calc(100vw - 44px));
  max-height: calc(100vh - 60px); overflow: auto;
  background: linear-gradient(168deg, #12251C 0%, #0C1811 55%, #0A130E 100%);
  border: 1px solid rgba(200, 162, 74, .55);
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65), 0 0 0 6px rgba(200, 162, 74, .06), inset 0 1px 0 rgba(240, 212, 147, .16);
  padding: 42px 46px 34px;
  text-align: center;
  animation: wel-in .5s cubic-bezier(.18, .9, .32, 1.15);
}
@keyframes wel-in {
  from { opacity: 0; transform: translate(-50%, -47%) scale(.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
#welcome-modal .wel-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: 28px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-hi); margin: 0 0 8px;
}
#welcome-modal .wel-tag {
  font-family: var(--font-talk); font-style: italic; font-weight: 500;
  font-size: 15px; color: var(--gold); margin: 0 0 20px;
}
#welcome-modal .wel-copy {
  font-family: var(--font-talk); font-size: 14.5px; line-height: 1.55;
  color: var(--ink); margin: 0 0 14px;
}
#welcome-modal .wel-tagline {
  font-family: var(--font-talk); font-style: italic; font-weight: 600;
  font-size: 15.5px; color: var(--gold-hi); margin: 4px 0 24px;
}
#welcome-modal .wel-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.wel-btn {
  font-family: var(--font-talk); font-size: 12.5px; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase;
  padding: 11px 20px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid rgba(200, 162, 74, .6); color: var(--ink);
  transition: all .16s ease;
}
.wel-btn:hover { border-color: var(--gold-hi); color: var(--gold-hi); transform: translateY(-1px); }
.wel-btn.primary {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: #171204; border-color: transparent; font-weight: 700;
}
.wel-btn.primary:hover { filter: brightness(1.08); color: #171204; }
.wel-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: 0; color: var(--ink-dim);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.wel-close:hover { color: var(--gold-hi); }
