:root {
  --ink: #071018;
  --navy: #102033;
  --panel: #152a40;
  --line: rgba(212, 177, 90, 0.28);
  --gold: #d4b15a;
  --gold-2: #f0d38a;
  --ice: #8fd0e4;
  --paper: #f4efe4;
  --muted: #9bb0c3;
  --red: #d45b4a;
  --green: #7cbc7a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--ink); color: var(--paper); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background:
    radial-gradient(1200px 500px at 10% 10%, rgba(143, 208, 228, 0.12), transparent 50%),
    linear-gradient(180deg, #0a1622, #071018);
}
.login-hero { position: relative; overflow: hidden; }
.login-hero img { width: 100%; height: 100vh; object-fit: cover; object-position: 30% 20%; filter: saturate(0.9); }
.login-hero .veil {
  position: absolute; inset: auto 0 0; padding: 32px;
  background: linear-gradient(transparent, rgba(7, 16, 24, 0.92));
}
.login-hero h1 { font-family: "Libre Baskerville", serif; font-weight: 400; margin: 0 0 8px; }
.login-hero p { margin: 0; color: var(--gold-2); font-style: italic; }
.login-card { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card form {
  width: min(420px, 100%);
  background: var(--navy);
  border: 1px solid var(--line);
  padding: 28px;
}
.login-card h2 { font-family: "Libre Baskerville", serif; margin: 0 0 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 22px; }
label { display: block; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin: 12px 0 6px; }
input, select, textarea {
  width: 100%;
  background: #0c1a28;
  border: 1px solid var(--line);
  color: var(--paper);
  padding: 10px 12px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--gold); color: #1a1408; border: 0; padding: 10px 16px; cursor: pointer; font-weight: 700;
}
.btn.ghost { background: transparent; color: var(--paper); border: 1px solid var(--line); }
.btn.danger { background: var(--red); color: white; }
.btn.ice { background: var(--ice); color: #082028; }
.err { color: var(--red); font-size: 14px; }

.shell { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.side {
  background: var(--navy);
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  position: sticky; top: 0; height: 100vh; overflow: auto;
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.brand img { width: 54px; height: 54px; object-fit: cover; object-position: 40% 12%; border: 1px solid var(--gold); }
.brand strong { display: block; font-family: "Libre Baskerville", serif; font-size: 15px; }
.brand span { color: var(--muted); font-size: 12px; }
.nav a {
  display: block; padding: 8px 10px; color: var(--muted); border-left: 2px solid transparent; margin: 2px 0;
}
.nav a:hover, .nav a.active { color: var(--paper); border-left-color: var(--gold); background: rgba(212, 177, 90, 0.08); }
.side .cta { display: grid; gap: 8px; margin: 16px 0 24px; }
.loop { display: grid; gap: 6px; margin-top: 18px; }
.loop div { font-size: 12px; color: var(--muted); }
.loop b { color: var(--gold-2); font-weight: 600; }

.main { padding: 22px 28px 80px; }
.top {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 22px;
}
.top h1 { font-family: "Libre Baskerville", serif; font-size: 28px; font-weight: 400; margin: 0; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: 1.3fr 0.7fr; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 16px;
}
.card h3 { margin: 0 0 10px; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.stat { font-family: "Libre Baskerville", serif; font-size: 28px; }
.pill { display: inline-block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border: 1px solid var(--line); color: var(--gold-2); }
.pill.red { color: #ffd0c8; border-color: var(--red); }
.pill.green { color: #d6f0d4; border-color: var(--green); }
.list { display: grid; gap: 10px; }
.list article { border-top: 1px solid var(--line); padding-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,0.06); vertical-align: top; }
th { color: var(--gold); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.chat { max-width: none; }
.talk-ai { display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 28px; align-items: start; margin-bottom: 8px; }
.talk-face { position: sticky; top: 16px; }
.talk-face img {
  width: 100%; height: 380px; object-fit: cover; object-position: 40% 12%;
  border: 1px solid var(--gold); display: block; background: #000;
}
.ty-avatar { position: relative; }
.ty-avatar-stage {
  position: relative;
  width: 100%;
  height: 380px;
  overflow: hidden;
  border: 1px solid var(--gold);
  background: #050b12;
}
.ty-avatar-canvas, .ty-avatar-fallback {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: 32% 8%;
  background: #050b12;
}
.ty-avatar-canvas { cursor: pointer; }
.ty-avatar.is-ready .ty-avatar-fallback {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.ty-avatar-live {
  position: absolute; left: 8px; bottom: 8px;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  background: rgba(7, 16, 24, 0.72); color: var(--gold-2);
  border: 1px solid var(--gold); padding: 2px 7px;
}
.ty-avatar[data-expr="speaking"] .ty-avatar-live { color: #d6f0d4; border-color: var(--green); }
.ty-avatar[data-expr="listening"] .ty-avatar-live { color: var(--ice); border-color: var(--ice); }
.ty-avatar[data-expr="thinking"] .ty-avatar-live { color: var(--gold-2); border-color: var(--gold); }
.ty-avatar[data-expr="speaking"] .ty-avatar-stage {
  box-shadow: 0 0 0 1px var(--green), 0 12px 28px rgba(124, 188, 122, 0.16);
}
.ty-avatar[data-expr="listening"] .ty-avatar-stage {
  box-shadow: 0 0 0 1px var(--ice);
}
.ty-avatar[data-expr="thinking"] .ty-avatar-stage {
  box-shadow: 0 0 0 1px var(--gold);
}
.ty-avatar-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 8px; flex-wrap: wrap;
}
.ty-avatar-bar .btn { padding: 6px 10px; font-size: 12px; }
.ty-lang { display: flex; gap: 4px; }
.ty-lang-btn {
  font: inherit; font-size: 11px; letter-spacing: 0.04em;
  padding: 4px 8px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); cursor: pointer; border-radius: 2px;
}
.ty-lang-btn[aria-pressed="true"] {
  border-color: var(--gold); color: var(--gold-2); background: rgba(201, 162, 39, 0.08);
}
.ty-voice-note {
  flex-basis: 100%;
  font-size: 11px; color: var(--muted);
}
.ty-avatar.is-compact .ty-avatar-stage { height: 180px; }
.ty-avatar.is-compact .ty-avatar-bar { margin-top: 6px; }
.ty-tile .ty-avatar { text-align: left; }
.talk-face .nameplate { margin-top: 12px; padding: 12px 4px 0; border-top: 1px solid var(--line); }
.talk-face .nameplate strong { display: block; font-family: "Libre Baskerville", serif; font-size: 22px; font-weight: 400; }
.talk-face .nameplate span { display: block; color: var(--gold-2); margin-top: 4px; }
.talk-face .nameplate em { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; }
.talk-composer { position: sticky; bottom: 0; background: var(--ink); padding: 12px 0 8px; margin-top: 16px; }
.talk-cta {
  display: flex; gap: 16px; align-items: center; margin: 0 0 22px;
  background: var(--panel); border: 1px solid var(--gold); padding: 12px 16px 12px 12px;
}
.talk-cta img { width: 88px; height: 110px; object-fit: cover; object-position: 40% 12%; border: 1px solid var(--gold); flex-shrink: 0; }
.talk-cta strong { display: block; font-family: "Libre Baskerville", serif; font-size: 22px; font-weight: 400; }
.talk-cta span { display: block; color: var(--gold-2); margin-top: 4px; }
.talk-cta em { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
details.card summary { cursor: pointer; color: var(--gold); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 15px; }
.bubble { padding: 12px 14px; margin: 10px 0; max-width: 80%; white-space: pre-wrap; }
.bubble.tyacoon { background: #0f2436; border-left: 3px solid var(--gold); }
.bubble.user { background: #1d3a2a; margin-left: auto; }
.face-tile {
  width: 180px; height: 220px; object-fit: cover; object-position: 40% 10%;
  border: 1px solid var(--gold); background: #000;
}
.room { display: grid; grid-template-columns: 1fr 320px; gap: 16px; min-height: 70vh; }
iframe.jitsi { width: 100%; height: 64vh; border: 0; background: #000; }
.footer-jobs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.flash { background: #1e3d2a; border: 1px solid var(--green); padding: 10px 12px; margin-bottom: 12px; }
.warn { background: #3a1e1a; border: 1px solid var(--red); padding: 10px 12px; margin-bottom: 12px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.proof { display: grid; gap: 14px; margin-bottom: 22px; }
.proof-card { background: var(--panel); border: 1px solid var(--line); padding: 18px 18px 14px; }
.proof-card h2 { font-family: "Libre Baskerville", serif; font-size: 20px; font-weight: 400; margin: 8px 0 6px; }
.proof-card .stat { font-size: 26px; margin: 4px 0 8px; }
.cite { font-size: 12px; color: var(--muted); }
.kua { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 8px; border: 1px solid var(--line); }
.kua.known { color: #d6f0d4; border-color: var(--green); }
.kua.unknown { color: var(--gold-2); border-color: var(--gold); }
.kua.founder-confirmed, .kua.customer-confirmed { color: #d6f0d4; border-color: var(--green); }
.kua.assumption { color: #ffd0c8; border-color: var(--red); }
.kua.unconfirmed { color: var(--gold-2); border-color: var(--gold); }
.kua.ontrack { color: #d6f0d4; border-color: var(--green); }
.kua.atrisk, .kua.behind { color: #ffd0c8; border-color: var(--red); }
.kua.planned { color: var(--gold-2); border-color: var(--gold); }
.kua.achieved { color: #d6f0d4; border-color: var(--green); }
.loop-strip {
  background: var(--panel); border: 1px solid var(--gold); padding: 14px 16px; margin: 0 0 18px;
}
.loop-strip a { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.loop-strip p { margin: 0; }
.loop-rail {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 16px;
}
.loop-node {
  background: #0b1a28; border: 1px solid var(--line); padding: 10px;
}
.loop-node.done { border-color: var(--green); }
.loop-node.current, .loop-node.now { border-color: var(--gold); }
.loop-node.blocked { border-color: var(--red); }
.loop-node strong { display: block; font-size: 13px; margin: 6px 0 4px; }
.loop-node .cite { margin: 0; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { border: 1px solid var(--line); padding: 8px 12px; color: var(--muted); text-decoration: none; }
.tab.active { border-color: var(--gold); color: var(--gold-2); }
.lead-line { font-family: "Libre Baskerville", serif; font-size: 22px; margin: 0 0 18px; }
.connector { margin-bottom: 16px; }
.connector h3 { margin-top: 0; }
.ty-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.ty-tile { background: #0b1a28; border: 1px solid var(--line); padding: 10px; text-align: center; }
.ty-tile img { width: 100%; height: 180px; object-fit: cover; object-position: 40% 10%; border: 1px solid var(--gold); }
.ty-tile video { width: 100%; height: 180px; object-fit: cover; background: #000; }
.sources { font-size: 12px; color: var(--muted); margin-top: 6px; }
.observe { margin: 12px 0; }
.live-lobby { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.live-meet { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 20px; min-height: 70vh; align-items: start; }
.live-floor .nameplate { margin: 12px 0 8px; }
.live-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.live-controls { margin: 12px 0; }
.live-fallback { margin-top: 16px; }
.live-fallback.is-needed { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.live-captions { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow: auto; }
.live-captions li { border-bottom: 1px solid rgba(255,255,255,0.06); padding: 10px 0; }
.live-captions li[data-role="tyacoon"] { border-left: 3px solid var(--gold); padding-left: 10px; }
.live-captions li[data-role="founder"] { border-left: 3px solid var(--ice); padding-left: 10px; }
.live-captions li.is-interim { opacity: 0.7; }
body.is-live-floor .shell { display: block; min-height: 100vh; background: #05080d; }
body.is-live-floor .side, body.is-live-floor .top, body.is-live-floor .footer-jobs, body.is-live-floor .flash, body.is-live-floor .main > .card { display: none; }
body.is-live-floor .main { padding: 0; max-width: none; }
.live-stage {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; padding: 18px 18px 28px; position: relative;
  background: radial-gradient(1200px 600px at 50% 20%, #152033 0%, #05080d 62%);
}
.live-leave { position: absolute; top: 16px; right: 16px; z-index: 4; }
.live-x {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(10,16,24,0.72);
  color: #f3efe4; font-size: 28px; line-height: 1; cursor: pointer;
}
.live-portrait { width: min(92vw, 420px); margin: 48px auto 8px; }
body.is-live-floor .live-portrait .ty-avatar { width: 100%; }
body.is-live-floor .live-portrait .ty-avatar-stage { width: 100%; height: min(58vh, 520px); }
body.is-live-floor .live-portrait .ty-avatar-bar { justify-content: center; }
.live-state-lg {
  font-family: "Libre Baskerville", serif; font-size: 28px; margin: 8px 0 4px; text-align: center;
}
.live-voice-note { text-align: center; color: var(--muted); max-width: 420px; margin: 0 0 10px; font-size: 14px; }
.live-path-label { text-align: center; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-2); margin: 0 0 8px; }
.live-path-label[hidden] { display: none; }
.live-captions-overlay {
  width: min(92vw, 420px); max-height: 18vh; margin: 0 auto 16px; font-size: 13px;
}
.live-captions-title { display: none; }
.live-dock { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(92vw, 420px); padding-bottom: 12px; }
.live-hold {
  width: min(88vw, 280px); height: 64px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #e8d7a3, var(--gold)); color: #14110b; font-weight: 700; font-size: 16px;
  box-shadow: 0 10px 28px rgba(201, 162, 39, 0.28);
}
.live-hold[aria-pressed="true"] { background: var(--ice); color: #041018; }
.live-hold:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.live-interrupt { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; }
.live-type-instead { width: 100%; color: var(--muted); font-size: 13px; }
.live-type-instead summary { cursor: pointer; text-align: center; list-style: none; }
.live-type-instead[open] { background: #0d1824; border: 1px solid var(--line); padding: 12px; }
.live-type-instead.is-needed summary { color: var(--gold-2); }
.live-type-instead textarea { width: 100%; margin: 8px 0; }
body.is-live-floor[data-live-mode="error"] .live-state-lg { color: #e7b0a8; }
@media (max-width: 980px) {
  .login-wrap, .shell, .grid.cols-4, .grid.cols-3, .grid.cols-2, .room, .talk-ai, .live-meet, .live-lobby { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; }
  .login-hero { height: 38vh; }
  .login-hero img { height: 38vh; }
  .talk-face { position: relative; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
  .talk-face img { width: 110px; height: 140px; flex-shrink: 0; }
  .talk-face .ty-avatar { width: 110px; flex-shrink: 0; }
  .talk-face .ty-avatar-stage { width: 110px; height: 140px; }
  .talk-face .ty-avatar-bar { flex-direction: column; align-items: stretch; gap: 4px; }
  .talk-face .nameplate { margin: 0; padding: 0; border: 0; flex: 1; min-width: 140px; }
  .talk-face .cite { flex-basis: 100%; }
  .lead-line { font-size: 18px; }
}
