@font-face { font-family: "Inter"; src: url("/fonts/Inter.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/SpaceGrotesk.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/JetBrainsMono.ttf") format("truetype"); font-weight: 100 800; font-display: swap; }
:root {
  --ink:#0B0F19; --indigo:#4338CA; --flap:#E0E7FF; --crease:#312E81; --emerald:#047857; --amber:#B45309; --coral:#BE123C;
  --surface:#F5F6F8; --border:#DDE1E7; --white:#FFFFFF; --muted:#2A303C; --radius:8px; --page:40px;
  --mono:"JetBrains Mono", ui-monospace, monospace; --display:"Space Grotesk", Inter, "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; background:var(--white); color:var(--ink); font-family: Inter, "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif; font-size:14px; line-height:1.45; -webkit-font-smoothing:antialiased; }
a { color:var(--indigo); text-decoration:none; } a:hover { text-decoration:underline; }
button, input, select, textarea { font:inherit; color:inherit; }
:focus-visible { outline:2px solid var(--indigo); outline-offset:2px; }
.mono { font-family:var(--mono); }
.hidden { display:none !important; }

/* nav */
.nav { position:sticky; top:0; z-index:30; display:flex; align-items:center; gap:18px; padding:0 var(--page); height:48px;
  background-color:var(--white); background-image:radial-gradient(rgba(11,15,25,.14) .7px, transparent .7px); background-size:10px 10px; border-bottom:1px solid var(--border); }
.brand { display:flex; align-items:center; gap:10px; color:var(--ink); flex:none; }
.brand:hover { text-decoration:none; }
.brand img { width:24px; height:24px; display:block; }
.brand .word { font-family:var(--display); font-weight:580; letter-spacing:-.05em; font-size:18px; line-height:1; text-transform:lowercase; }
.brand .tag { font-family:var(--mono); font-size:10px; font-weight:500; color:var(--muted); display:block; margin-top:3px; letter-spacing:.02em; }
.tabs { display:flex; gap:2px; }
.tabs a { padding:7px 11px; border-radius:var(--radius); color:var(--muted); font-weight:500; font-size:13px; }
.tabs a:hover { background:var(--surface); text-decoration:none; }
.tabs a.on { color:var(--ink); background:var(--surface); box-shadow:inset 0 -2px 0 var(--indigo); }
.cmdk { flex:1 1 auto; max-width:360px; margin-left:auto; display:flex; align-items:center; gap:8px; height:36px; padding:0 10px 0 12px; border:1px solid var(--border); border-radius:var(--radius); background:var(--white); color:var(--muted); cursor:pointer; }
.cmdk .label { flex:1; font-size:13px; text-align:left; }
kbd, .chip { font-family:var(--mono); font-size:11px; font-weight:500; border:1px solid var(--border); border-radius:4px; padding:1px 6px; background:var(--surface); color:var(--ink); line-height:18px; }
.nav-right { display:flex; align-items:center; gap:12px; flex:none; }
.loader { display:grid; grid-template-columns:repeat(3,6px); gap:2px; width:22px; height:22px; }
.loader i { width:6px; height:6px; border-radius:1.5px; background:var(--border); }
.loader.busy i { animation:sq 1.44s ease-in-out infinite; }
.loader i:nth-child(2){animation-delay:.08s}.loader i:nth-child(3){animation-delay:.16s}.loader i:nth-child(4){animation-delay:.24s}.loader i:nth-child(5){animation-delay:.32s}.loader i:nth-child(6){animation-delay:.40s}.loader i:nth-child(7){animation-delay:.48s}.loader i:nth-child(8){animation-delay:.56s}.loader i:nth-child(9){animation-delay:.64s}
@keyframes sq { 0%,72%,100% { background:#DDE1E7; } 28% { background:#4338CA; } }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; height:34px; padding:0 14px; border-radius:var(--radius); border:1px solid var(--border); background:var(--white); color:var(--ink); cursor:pointer; font-weight:500; font-size:13px; white-space:nowrap; }
.btn:hover { border-color:var(--ink); }
.btn.primary { background:var(--indigo); border-color:var(--indigo); color:var(--white); }
.btn.primary:hover { background:var(--crease); }
.btn.ghost { border-color:transparent; background:transparent; }
.btn.small { height:28px; padding:0 10px; font-size:12px; }
.btn:disabled { opacity:.5; cursor:not-allowed; }

main { padding:20px var(--page) 64px; max-width:1440px; margin:0 auto; }
.section { margin-bottom:30px; }
.sh { display:flex; align-items:baseline; gap:10px; margin:0 0 12px; flex-wrap:wrap; }
.sh h2 { margin:0; font-family:var(--display); font-size:17px; font-weight:600; letter-spacing:-.01em; }
.sh .note { font-family:var(--mono); font-size:11px; color:var(--muted); }
.sh .right { margin-left:auto; display:flex; gap:8px; align-items:center; }
.page-title { font-family:var(--display); font-size:28px; font-weight:600; letter-spacing:-.02em; margin:0 0 4px; }
.page-sub { color:var(--muted); margin:0 0 22px; }

.card { border:1px solid var(--border); border-radius:var(--radius); background:var(--white); padding:16px; min-width:0; }
.grid { display:grid; gap:14px; }
.g3 { grid-template-columns:repeat(3, minmax(0,1fr)); }
.g2 { grid-template-columns:repeat(2, minmax(0,1fr)); }
.g4 { grid-template-columns:repeat(4, minmax(0,1fr)); }

/* today strip */
.today { display:grid; grid-template-columns:repeat(5, minmax(0,1fr)); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.today > div { padding:14px 16px; border-right:1px solid var(--border); min-width:0; }
.today > div:last-child { border-right:none; }
.today .first { background:var(--surface); }
.k { font-family:var(--mono); font-size:10.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.v { font-family:var(--display); font-size:26px; font-weight:600; letter-spacing:-.02em; line-height:1.2; margin-top:6px; }
.v.sm { font-size:16px; }
.s { font-size:12px; color:var(--muted); margin-top:2px; }

.pill { display:inline-flex; align-items:center; gap:6px; font-family:var(--mono); font-size:11px; font-weight:500; line-height:1; padding:5px 8px; border:1px solid var(--border); border-radius:999px; background:var(--white); color:var(--ink); white-space:nowrap; }
.pill .dot { width:6px; height:6px; border-radius:50%; background:currentColor; flex:none; }
.pill.live { color:var(--emerald); border-color:#04785744; }
.pill.hold { color:var(--amber); border-color:#B4530944; }
.pill.alert { color:var(--coral); border-color:#BE123C44; }
.pill.idle { color:var(--muted); }
.pill.draft { color:var(--indigo); border-color:#4338CA44; }

.ws-top { display:flex; justify-content:space-between; gap:8px; align-items:flex-start; }
.ws-title { font-weight:600; }
.ws-body { margin:8px 0 0; color:var(--muted); font-size:13px; }

.list { border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.row { display:grid; grid-template-columns:34px minmax(0,1fr) auto auto; gap:14px; align-items:center; padding:12px 16px; border-bottom:1px solid var(--border); }
.row:last-child { border-bottom:none; }
.row .n { font-family:var(--mono); font-size:11px; color:var(--muted); }
.row .t { font-weight:600; }
.row .d { color:var(--muted); font-size:12.5px; }
.row .meta { font-family:var(--mono); font-size:11px; color:var(--muted); }

table.tbl { width:100%; border-collapse:collapse; }
.tbl th { text-align:left; font-family:var(--mono); font-size:10.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); font-weight:500; background:var(--surface); padding:10px 12px; border-bottom:1px solid var(--border); }
.tbl td { padding:11px 12px; border-bottom:1px solid var(--border); vertical-align:top; font-size:13px; }
.tbl tr:last-child td { border-bottom:none; }
.tbl td.name { font-weight:600; }
.tbl-wrap { border:1px solid var(--border); border-radius:var(--radius); overflow:auto; }
.empty { padding:18px; color:var(--muted); font-size:13px; text-align:center; }

/* matrix teaser */
.teaser { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); gap:14px; }
.msg { display:grid; grid-template-columns:auto minmax(0,1fr); gap:10px; padding:12px 14px; border-bottom:1px solid var(--border); }
.msg:last-child { border-bottom:none; }
.avatar { width:28px; height:28px; border-radius:6px; display:grid; place-items:center; font-family:var(--mono); font-size:11px; font-weight:600; color:var(--white); background:var(--ink); }
.avatar.claude { background:#B45309; } .avatar.chatgpt { background:#047857; } .avatar.cursor { background:#4338CA; } .avatar.deepseek { background:#4F46E5; } .avatar.gemini { background:#0369A1; } .avatar.me { background:var(--surface); color:var(--ink); border:1px solid var(--border); }
.ai-agents { display:grid; gap:12px; }
.ai-agent { display:grid; gap:8px; }
.ai-top { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.ai-name { font-weight:700; }
.ai-on { display:flex; align-items:center; gap:8px; font-size:13px; }
.ai-agent input[type="password"] { width:100%; }
.ai-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
@media (max-width: 760px) {
  .ai-actions { display:grid; }
  .ai-actions .btn, .ai-on { min-height:44px; }
  .ai-agent input[type="password"] { min-height:44px; font-size:16px; }
}
.msg .who { font-size:12px; font-weight:600; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.msg .who .meta { font-family:var(--mono); font-weight:400; font-size:11px; color:var(--muted); }
.msg .body { font-size:13px; white-space:pre-wrap; overflow-wrap:anywhere; margin-top:2px; }
.clip { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

.kv { display:flex; justify-content:space-between; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); font-size:13px; }
.kv:last-child { border-bottom:none; }
.kv span:last-child { font-family:var(--mono); font-size:12px; text-align:right; }

/* services */
.svc-top { display:flex; justify-content:space-between; gap:8px; align-items:flex-start; }
.svc-name { font-weight:600; }
.svc-id { font-family:var(--mono); font-size:11px; color:var(--muted); margin-top:2px; overflow-wrap:anywhere; }
.svc-kv { margin-top:10px; }

.links { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:12px; }
.link { display:flex; flex-direction:column; gap:3px; border:1px solid var(--border); border-radius:var(--radius); padding:12px 14px; color:var(--ink); min-width:0; }
.link:hover { border-color:var(--indigo); text-decoration:none; }
.link .lt { font-weight:600; display:flex; justify-content:space-between; gap:8px; align-items:center; }
.link .lu { font-family:var(--mono); font-size:11.5px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.group-h { font-family:var(--mono); font-size:10.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); margin:18px 0 8px; }

footer { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:18px var(--page); border-top:1px solid var(--border); font-size:12px; color:var(--muted); }
footer .mono { font-size:11px; }

/* matrix app */
.mx { display:grid; grid-template-columns:280px minmax(0,1fr); border:1px solid var(--border); border-radius:var(--radius); height:calc(100vh - 64px - 140px); min-height:520px; overflow:hidden; }
.mx-side { border-right:1px solid var(--border); background:var(--surface); display:flex; flex-direction:column; min-height:0; }
.mx-side .top { padding:12px; border-bottom:1px solid var(--border); display:flex; gap:8px; }
.mx-threads { overflow:auto; flex:1; }
.mx-thread { display:block; width:100%; text-align:left; border:none; background:transparent; padding:11px 14px; border-bottom:1px solid var(--border); cursor:pointer; }
.mx-thread:hover { background:#ECEEF2; }
.mx-thread.on { background:var(--white); box-shadow:inset 3px 0 0 var(--indigo); }
.mx-thread .tt { font-weight:600; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mx-thread .tm { font-family:var(--mono); font-size:10.5px; color:var(--muted); margin-top:2px; }
.mx-main { display:flex; flex-direction:column; min-height:0; min-width:0; }
.mx-head { display:flex; align-items:center; gap:10px; padding:10px 16px; border-bottom:1px solid var(--border); min-height:52px; }
.mx-head .title { font-weight:600; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mx-log { flex:1; overflow:auto; padding:6px 4px; }
.mx-log .msg.err .body { color:var(--coral); }
.mx-compose { border-top:1px solid var(--border); padding:12px; display:flex; flex-direction:column; gap:10px; background:var(--white); }
.seg { display:inline-flex; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.seg button { border:none; background:var(--white); padding:6px 12px; cursor:pointer; font-size:13px; font-weight:500; border-right:1px solid var(--border); display:flex; gap:6px; align-items:center; }
.seg button:last-child { border-right:none; }
.seg button.on { background:var(--ink); color:var(--white); }
.seg button .soon { font-family:var(--mono); font-size:10px; opacity:.8; }
.compose-row { display:flex; gap:10px; align-items:flex-end; }
textarea, input[type=text], input[type=url], input[type=password], select { border:1px solid var(--border); border-radius:var(--radius); padding:8px 10px; background:var(--white); width:100%; }
textarea { resize:vertical; min-height:44px; max-height:240px; }
select.inline { width:auto; height:32px; padding:0 8px; font-family:var(--mono); font-size:12px; }
.hint { font-family:var(--mono); font-size:11px; color:var(--muted); }

/* planner */
.toolbar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
.filters { display:inline-flex; flex-wrap:wrap; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.filters button { border:none; border-right:1px solid var(--border); background:var(--white); padding:6px 12px; cursor:pointer; font-size:13px; }
.filters button:last-child { border-right:none; }
.filters button.on { background:var(--ink); color:var(--white); }
.filters .c { font-family:var(--mono); font-size:11px; opacity:.75; margin-left:4px; }
.board { display:grid; grid-template-columns:repeat(5, minmax(220px,1fr)); gap:12px; overflow-x:auto; padding-bottom:6px; }
.col { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:10px; min-height:120px; }
.col.drop { outline:2px dashed var(--indigo); outline-offset:-4px; }
.col-h { display:flex; justify-content:space-between; align-items:center; margin:2px 4px 10px; }
.col-h .k { color:var(--ink); }
.pcard { background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:11px 12px; margin-bottom:8px; cursor:grab; }
.pcard:hover { border-color:var(--ink); }
.pcard .pn { font-weight:600; font-size:13px; }
.pcard .po { font-family:var(--mono); font-size:11px; color:var(--muted); margin-top:3px; }
.pcard .px { font-size:12.5px; margin-top:7px; color:var(--muted); }
.pcard .px b { color:var(--ink); font-weight:600; }
.pcard .pb { font-size:12px; margin-top:6px; color:var(--coral); }
.pcard .pa { display:flex; justify-content:space-between; align-items:center; margin-top:9px; gap:6px; }

dialog { border:1px solid var(--border); border-radius:12px; padding:0; width:min(620px, calc(100vw - 24px)); box-shadow:0 20px 60px rgba(11,15,25,.18); }
dialog::backdrop { background:rgba(11,15,25,.35); }
.dlg-h { padding:14px 18px; border-bottom:1px solid var(--border); font-family:var(--display); font-weight:600; font-size:17px; }
.dlg-b { padding:16px 18px; display:grid; gap:12px; grid-template-columns:1fr 1fr; }
.dlg-b label { display:flex; flex-direction:column; gap:5px; font-size:12px; font-weight:500; color:var(--muted); }
.dlg-b label.full { grid-column:1 / -1; }
.dlg-f { padding:12px 18px; border-top:1px solid var(--border); display:flex; gap:8px; justify-content:flex-end; }
.dlg-f .left { margin-right:auto; }

/* palette */
.pal { position:fixed; inset:0; background:rgba(11,15,25,.35); z-index:50; display:flex; justify-content:center; align-items:flex-start; padding-top:12vh; }
.pal-box { width:min(560px, calc(100vw - 24px)); background:var(--white); border-radius:12px; border:1px solid var(--border); overflow:hidden; box-shadow:0 20px 60px rgba(11,15,25,.2); }
.pal-box input { border:none; border-bottom:1px solid var(--border); border-radius:0; padding:14px 16px; font-size:15px; }
.pal-box input:focus { outline:none; }
.pal-list { max-height:50vh; overflow:auto; }
.pal-item { display:flex; justify-content:space-between; gap:10px; padding:10px 16px; cursor:pointer; font-size:13px; }
.pal-item.on, .pal-item:hover { background:var(--surface); }
.pal-item .kind { font-family:var(--mono); font-size:11px; color:var(--muted); }

/* login */
.login-wrap { min-height:100vh; display:grid; place-items:center; padding:24px; background-image:radial-gradient(rgba(11,15,25,.10) .7px, transparent .7px); background-size:10px 10px; }
.login { width:min(380px, 100%); background:var(--white); border:1px solid var(--border); border-radius:12px; padding:28px; }
.login .brand { margin-bottom:22px; }
.login h1 { font-family:var(--display); font-size:20px; margin:0 0 4px; font-weight:600; }
.login p { color:var(--muted); margin:0 0 18px; font-size:13px; }
.login form { display:grid; gap:12px; }
.login .err { color:var(--coral); font-size:13px; min-height:18px; }
.login .foot { margin-top:18px; font-family:var(--mono); font-size:11px; color:var(--muted); text-align:center; }

/* responsive */
@media (max-width: 1100px) {
  .links { grid-template-columns:repeat(2, minmax(0,1fr)); }
  .today { grid-template-columns:repeat(3, minmax(0,1fr)); }
  .today > div { border-bottom:1px solid var(--border); }
  .g4 { grid-template-columns:repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  :root { --page:16px; }
  .nav { height:auto; flex-wrap:wrap; padding-top:10px; padding-bottom:8px; gap:10px; }
  .tabs { order:3; width:100%; overflow-x:auto; }
  .cmdk { max-width:none; order:1; flex:1 1 100px; margin-left:auto; }
  .nav-right { order:2; }
  .cmdk .label { display:none; }
  .brand .tag { display:none; }
  .nav-right .loader { display:none; }
  .g3, .g2, .g4, .teaser, .links { grid-template-columns:minmax(0,1fr); }
  .today { grid-template-columns:repeat(2, minmax(0,1fr)); }
  .today > div:first-child { grid-column:1 / -1; }
  .row { grid-template-columns:24px minmax(0,1fr); }
  .row .meta, .row > .pill { grid-column:2; justify-self:start; }
  .mx { grid-template-columns:minmax(0,1fr); height:auto; min-height:0; }
  .mx-side { border-right:none; border-bottom:1px solid var(--border); max-height:200px; }
  .mx-log { min-height:300px; max-height:55vh; }
  .board { grid-template-columns:repeat(5, minmax(250px, 82vw)); }
  .dlg-b { grid-template-columns:1fr; }
  .tbl.collapse thead { display:none; }
  .tbl.collapse tr { display:block; border-bottom:1px solid var(--border); padding:6px 0; }
  .tbl.collapse td { display:block; border:none; padding:3px 12px; }
  footer { flex-direction:column; }
}
.pcard .pa { flex-wrap:wrap; }
.pcard .pa select { flex:1 1 110px; min-width:0; max-width:100%; }
.pcard .pa > div { flex:none; }

/* ---- v2 home layout: compact top, matrix zone, reply box, compact agents ---- */
.today > div { padding:10px 14px; }
.today .v { font-size:20px; margin-top:3px; }
.today .v.sm { font-size:13px; }
.today .s { margin-top:1px; }
.cmdk { height:30px; }
.mx-zone { position:relative; border:1px solid #C7D2FE; border-radius:calc(var(--radius) + 4px); padding:14px; background:linear-gradient(180deg, #EEF2FF 0%, #F7F8FF 100%); box-shadow:inset 3px 0 0 var(--indigo); }
.mx-zone .list, .mx-zone .card { background:var(--white); }
.mx-reply { margin-top:12px; border:1px solid #C7D2FE; border-radius:var(--radius); background:var(--white); padding:12px; display:grid; gap:8px; }
.mx-reply-top { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.mx-reply-top .seg button { padding:4px 10px; font-size:12px; }
.mx-reply .compose-row textarea { min-height:40px; }
.btn.mic { gap:7px; }
.btn.mic .mic-dot { width:8px; height:8px; border-radius:50%; background:var(--coral); opacity:.55; }
.btn.mic.on { border-color:var(--coral); color:var(--coral); }
.btn.mic.on .mic-dot { opacity:1; animation:micpulse 1s ease-in-out infinite; }
.btn:disabled { opacity:.5; cursor:not-allowed; }
@keyframes micpulse { 50% { transform:scale(1.6); opacity:.4; } }
.ws-list { background:var(--white); }
.ws-row { display:grid; grid-template-columns:160px minmax(0,1fr) auto; gap:14px; align-items:start; padding:8px 14px; border-bottom:1px solid var(--border); }
.ws-row:last-child { border-bottom:none; }
.ws-who { display:flex; gap:8px; align-items:center; min-width:0; }
.avatar.sm { width:22px; height:22px; font-size:9.5px; border-radius:5px; flex:none; }
.avatar.team { background:var(--crease); }
.ws-text { min-width:0; display:flex; gap:8px; align-items:baseline; }
.ws-line { color:var(--muted); font-size:13px; line-height:22px; display:-webkit-box; -webkit-line-clamp:1; line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; min-width:0; flex:1 1 auto; }
.ws-line.open { display:block; -webkit-line-clamp:unset; line-clamp:unset; overflow:visible; }
.ws-more { flex:none; border:none; background:none; padding:0; color:var(--indigo); font-family:var(--mono); font-size:11px; cursor:pointer; line-height:22px; }
.ws-more:hover { text-decoration:underline; }
.ws-pills { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
@media (max-width: 860px) {
  .ws-row { grid-template-columns:minmax(0,1fr); gap:4px; }
  .ws-line { -webkit-line-clamp:2; line-clamp:2; }
  .ws-pills { justify-content:flex-start; }
  .mx-zone { padding:10px; }
}

/* ---- v2b: section dividers, consistent nav buttons, clickable waiting rows ---- */
main > .section + .section { border-top:1px solid var(--border); padding-top:22px; position:relative; }
main > .section + .section::before { content:""; position:absolute; top:-1px; left:0; width:56px; height:2px; background:var(--indigo); }
.sh .right .btn { height:30px; }
.quick { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
a.btn:hover { text-decoration:none; }
.row-link { color:inherit; cursor:pointer; transition:background .12s; }
.row-link:hover { background:#F5F7FF; text-decoration:none; }
.row-link:hover .respond { border-color:var(--indigo); color:var(--indigo); }
.row-link .t { color:var(--ink); }
.btn.respond { pointer-events:none; }
@media (max-width: 760px) { .row-link .respond { grid-column:2; justify-self:start; } }

/* ---- Group Meeting: IRC channel + whiteboard + media center ---- */
.mt-title { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.mt-title .page-sub { margin-bottom:14px; }
.mt-status { margin-bottom:16px; color:var(--emerald); }
.mt-status.bad { color:var(--coral); }
.meet { display:grid; grid-template-columns:210px minmax(0,1fr) 360px; grid-template-areas:"left board chat" "left media chat"; gap:12px; padding:12px; border-radius:14px;
  background:#0B0F19; background-image:radial-gradient(rgba(165,180,252,.10) .8px, transparent .8px); background-size:12px 12px; box-shadow:0 0 0 1px #1F2937, 0 18px 40px -24px rgba(67,56,202,.55); }
.mt-panel { background:#111827; border:1px solid #1F2937; border-radius:10px; color:#E5E7EB; min-width:0; }
.mt-left { grid-area:left; padding:10px 8px; }
.mt-board { grid-area:board; padding:10px; display:flex; flex-direction:column; gap:10px; }
.mt-chat { grid-area:chat; display:flex; flex-direction:column; min-height:0; height:100%; max-height:calc(100vh - 140px); }
.mt-media { grid-area:media; display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) minmax(0,1fr); gap:12px; padding:10px; }
.mt-h { font-family:var(--mono); font-size:10.5px; letter-spacing:.08em; text-transform:uppercase; color:#A5B4FC; display:flex; align-items:center; gap:8px; justify-content:space-between; margin:0 0 8px; }
.mt-chat > .mt-h { padding:10px 12px 0; justify-content:flex-start; }
.meet .hint { color:#9CA3AF; }
.mt-member { display:grid; grid-template-columns:10px 12px minmax(0,1fr); grid-template-rows:auto auto; column-gap:6px; width:100%; text-align:left; background:none; border:none; color:inherit; padding:6px 6px; border-radius:6px; cursor:pointer; font-family:var(--mono); font-size:12.5px; }
.mt-member:hover { background:#1F2937; }
.mt-dot { width:8px; height:8px; border-radius:50%; background:#4B5563; align-self:center; }
.mt-member.live .mt-dot { background:#34D399; box-shadow:0 0 8px #34D399; }
.mt-mode { color:#FBBF24; font-weight:700; }
.mt-nick { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mt-note { grid-column:3; font-size:10.5px; line-height:1.25; color:#9CA3AF; white-space:normal; }
.mt-member.soon .mt-nick { opacity:.65; }
.mt-log { flex:1 1 auto; overflow-y:auto; padding:8px 12px; font-family:var(--mono); font-size:12.5px; line-height:1.55; min-height:280px; }
.mt-line { white-space:pre-wrap; overflow-wrap:anywhere; }
.mt-line .ts { color:#6B7280; }
.mt-line .nick { font-weight:700; }
.mt-line.sys { color:#9CA3AF; font-style:italic; }
.mt-line.ai .txt { color:#F3F4F6; }
.mt-line a { color:#93C5FD; }
.mt-mention { color:#0B0F19; background:#A5B4FC; border-radius:3px; padding:0 3px; }
.mt-compose { display:flex; gap:8px; align-items:center; padding:10px 12px; border-top:1px solid #1F2937; }
.mt-prompt { font-family:var(--mono); font-size:12px; color:#A5B4FC; }
.meet input[type=text], .meet select.inline { background:#0B0F19; color:#E5E7EB; border-color:#374151; font-family:var(--mono); font-size:12.5px; }
.meet input[type=text]:focus { border-color:#818CF8; }
.mt-tools { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.tool { height:30px; padding:0 10px; border-radius:7px; border:1px solid #374151; background:#0B0F19; color:#E5E7EB; font-size:12px; font-family:var(--mono); cursor:pointer; white-space:nowrap; }
.tool:hover { border-color:#818CF8; }
.tool.on { background:#4338CA; border-color:#4338CA; color:#fff; }
.tool.hot { border-color:#BE123C; color:#FDA4AF; }
.tool:disabled { opacity:.4; cursor:not-allowed; }
.mt-sep { width:1px; height:22px; background:#374151; margin:0 4px; }
.mt-swatches { display:flex; gap:4px; }
.sw { width:22px; height:22px; border-radius:50%; border:2px solid #374151; cursor:pointer; padding:0; }
.sw.on { border-color:#FBBF24; box-shadow:0 0 0 2px #0B0F19, 0 0 0 4px #FBBF24; }
.mt-canvas { position:relative; width:100%; aspect-ratio:16 / 9; border-radius:8px; overflow:hidden; box-shadow:0 0 0 1px #374151; background:#fff; }
.mt-canvas canvas { position:absolute; inset:0; width:100%; height:100%; display:block; }
.mt-ink { cursor:crosshair; touch-action:none; }
.mt-yt { aspect-ratio:16 / 9; border-radius:8px; overflow:hidden; background:#000; box-shadow:0 0 0 1px #374151; margin-bottom:8px; }
.mt-yt iframe { width:100%; height:100%; border:0; display:block; }
.mt-yt-empty { height:100%; display:grid; place-content:center; text-align:center; gap:6px; color:#9CA3AF; font-family:var(--mono); font-size:11.5px; padding:10px; }
.mt-yt-empty .big { font-size:28px; color:#BE123C; }
.mt-row { display:flex; gap:6px; }
.mt-audio { display:grid; gap:8px; max-height:260px; overflow-y:auto; }
.mt-track { background:#0B0F19; border:1px solid #1F2937; border-radius:8px; padding:6px 8px; }
.mt-track-n { font-family:var(--mono); font-size:11.5px; margin-bottom:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mt-track audio { width:100%; height:32px; }
.mt-gallery { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:6px; }
.mt-thumb { padding:0; border:1px solid #374151; border-radius:6px; overflow:hidden; background:#000; cursor:pointer; aspect-ratio:16 / 10; }
.mt-thumb:hover { border-color:#FBBF24; }
.mt-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
@media (max-width: 1250px) {
  .meet { grid-template-columns:190px minmax(0,1fr); grid-template-areas:"left board" "chat chat" "media media"; }
  .mt-chat { max-height:520px; }
}
@media (max-width: 760px) {
  .meet { grid-template-columns:minmax(0,1fr); grid-template-areas:"board" "chat" "left" "media"; padding:8px; }
  .mt-media { grid-template-columns:minmax(0,1fr); }
}

/* ---- Group Meeting v2: stable layout + layered canvas + room context ---- */
.meet { align-items:stretch; }
.mt-chat { contain:size; max-height:none; } /* chat never resizes the grid, so the board can't move mid-stroke */
.mt-log { flex:1 1 0; min-height:0; }
.mt-canvas canvas { pointer-events:none; }
.mt-canvas .mt-live { pointer-events:auto; cursor:crosshair; touch-action:none; -webkit-user-select:none; user-select:none; }
.mt-ink { cursor:default; }
.mt-ctx { font-size:10.5px; color:#6B7280; font-style:normal; }
.mt-note.typing { color:#FBBF24; }
@media (max-width: 1250px) { .mt-chat { contain:none; height:520px; } }
@media (max-width: 760px) { .mt-chat { height:460px; } }

/* ---- Group Meeting: wake button ---- */
.mt-title-r { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.mt-title-r .mt-status { margin-bottom:0; }
.btn.wake { background:linear-gradient(90deg,#4338CA,#BE123C); border-color:transparent; }

/* ---- Chess arena ---- */
.ch { display:grid; grid-template-columns:230px minmax(0,1fr) 320px; gap:14px; align-items:start; padding:14px; border-radius:14px; background:#0B0F19; background-image:radial-gradient(rgba(165,180,252,.10) .8px, transparent .8px); background-size:12px 12px; color:#E5E7EB; }
.ch-left, .ch-right, .ch-mid { background:#111827; border:1px solid #1F2937; border-radius:10px; padding:12px; min-width:0; }
.ch-mid { display:flex; flex-direction:column; gap:8px; align-items:stretch; }
.ch-roster { display:grid; gap:6px; }
.ch-chip { display:flex; align-items:center; gap:8px; padding:7px 9px; border:1px solid #374151; border-radius:8px; background:#0B0F19; cursor:grab; font-size:13px; user-select:none; }
.ch-chip:hover { border-color:#818CF8; }
.ch-chip.picked { border-color:#FBBF24; box-shadow:0 0 0 2px #FBBF2455; }
.ch-chip .ch-kind { margin-left:auto; font-family:var(--mono); font-size:10px; color:#9CA3AF; }
.ch-chip.live .ch-kind { color:#34D399; }
.ch-slot { border:1.5px dashed #374151; border-radius:10px; padding:8px 10px; display:flex; align-items:center; gap:12px; min-height:52px; cursor:pointer; transition:border-color .15s, background .15s; }
.ch-slot.over { border-color:#FBBF24; background:#1F2937; }
.ch-slot.turn { border-style:solid; border-color:#34D399; box-shadow:0 0 14px -4px #34D399; }
.ch-side { font-family:var(--mono); font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:#A5B4FC; width:70px; flex:none; }
.ch-seated { display:flex; align-items:center; gap:6px; }
.ch-seated .ch-chip { cursor:default; }
.ch-x { background:none; border:1px solid #374151; color:#E5E7EB; border-radius:6px; width:26px; height:26px; cursor:pointer; }
.ch-drop { color:#6B7280; font-family:var(--mono); font-size:12px; }
.ch-turn { margin-left:auto; font-family:var(--mono); font-size:11.5px; color:#FBBF24; }
.ch-board-wrap { width:100%; max-width:560px; margin:0 auto; }
.ch-board { display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); grid-template-rows:repeat(8,minmax(0,1fr)); aspect-ratio:1; border-radius:8px; overflow:hidden; box-shadow:0 0 0 2px #374151, 0 18px 40px -20px rgba(67,56,202,.7); }
.ch-sq { position:relative; display:grid; place-items:center; min-width:0; min-height:0; overflow:hidden; }
.ch-sq.l { background:#E0E7FF; } .ch-sq.d { background:#6366F1; }
.ch-sq.last.l { background:#C7D2FE; } .ch-sq.last.d { background:#4338CA; }
.ch-sq.check { background:radial-gradient(circle,#F43F5E 0%,#BE123C 60%,transparent 75%) !important; }
.ch-pc { font-size:min(6.2vw,52px); line-height:1; user-select:none; }
.ch-pc.w { color:#FFFFFF; text-shadow:0 0 1px #0B0F19,0 0 2px #0B0F19,0 2px 3px rgba(0,0,0,.5); }
.ch-pc.b { color:#0B0F19; text-shadow:0 1px 0 rgba(255,255,255,.35); }
.ch-rk, .ch-fl { position:absolute; font-family:var(--mono); font-size:9.5px; color:#312E81; opacity:.8; }
.ch-rk { top:2px; left:3px; } .ch-fl { bottom:1px; right:3px; }
.ch-cap { font-size:13px; min-height:22px; text-align:center; }
.ch-pcs { font-size:20px; letter-spacing:1px; }
.ch-pcs.w { color:#fff; text-shadow:0 0 2px #000; } .ch-pcs.b { color:#9CA3AF; }
.ch-ctrl { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; align-items:center; margin-top:4px; }
.ch .btn:not(.primary) { background:#0B0F19; color:#E5E7EB; border-color:#374151; }
.ch .btn:disabled { opacity:.45; }
.ch-err { color:#FDA4AF !important; width:100%; text-align:center; }
.ch-banner { border-radius:8px; padding:10px 12px; font-weight:600; margin-bottom:12px; background:#1F2937; }
.ch-banner.running { background:#064E3B; color:#A7F3D0; } .ch-banner.over { background:#4338CA; color:#fff; } .ch-banner.paused { background:#78350F; color:#FDE68A; }
.ch-moves { font-family:var(--mono); font-size:12.5px; max-height:220px; overflow-y:auto; margin-bottom:12px; }
.ch-mrow { display:grid; grid-template-columns:34px 1fr 1fr; padding:2px 4px; }
.ch-mrow:nth-child(odd) { background:#0B0F19; }
.ch-mrow .n { color:#6B7280; }
.ch-feed { display:grid; gap:6px; max-height:360px; overflow-y:auto; font-size:12.5px; }
.ch-cm { background:#0B0F19; border:1px solid #1F2937; border-radius:8px; padding:6px 8px; }
.ch-cm.flag { border-color:#BE123C; }
.ch-cm-mv { font-family:var(--mono); color:#FBBF24; }
.ch .mt-h { color:#A5B4FC; }
.ch .hint { color:#9CA3AF; }
@media (max-width: 1150px) { .ch { grid-template-columns:minmax(0,1fr); } .ch-roster { grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); } }

/* ---- Full-screen blue skin for /meeting and /chess ---- */
.fx-bar { display:flex; align-items:center; gap:14px; flex-wrap:wrap; padding:8px 16px; border-bottom:1px solid rgba(147,197,253,.18); background:rgba(8,20,64,.55); flex:none; }
.fx-title { margin:0; font-family:var(--display); font-size:18px; font-weight:600; letter-spacing:-.01em; color:#fff; }
.fx-sub { font-family:var(--mono); font-size:11.5px; color:#93C5FD; }
.fx-bar .mt-title-r { margin:0 0 0 auto; }
body.full { background:#0A1A4F; background-image:radial-gradient(rgba(147,197,253,.10) .8px, transparent .8px), linear-gradient(160deg,#0B2470 0%,#081A52 55%,#06123B 100%); background-size:12px 12px, 100% 100%; background-attachment:fixed; color:#E6EEFF; }
body.full footer { display:none; }
body.full .nav { background-color:#081A4D; background-image:radial-gradient(rgba(147,197,253,.16) .7px, transparent .7px); border-bottom-color:rgba(147,197,253,.22); }
body.full .brand, body.full .brand .word { color:#fff; }
body.full .brand .tag, body.full .tabs a { color:#BFDBFE; }
body.full .tabs a:hover { background:rgba(147,197,253,.12); }
body.full .tabs a.on { color:#fff; background:rgba(147,197,253,.16); box-shadow:inset 0 -2px 0 #60A5FA; }
body.full .cmdk { background:rgba(255,255,255,.06); border-color:rgba(147,197,253,.25); color:#BFDBFE; }
body.full kbd { background:rgba(255,255,255,.08); border-color:rgba(147,197,253,.25); color:#E6EEFF; }
body.full #logout { color:#BFDBFE; }
body.full .loader i { background:rgba(147,197,253,.25); }
body.full main { max-width:none; margin:0; padding:0; height:calc(100vh - 48px); height:calc(100dvh - 48px); display:flex; flex-direction:column; overflow:hidden; }
body.full .btn:not(.primary):not(.wake) { background:rgba(255,255,255,.06); border-color:rgba(147,197,253,.28); color:#E6EEFF; }
body.full .btn:not(.primary):not(.wake):hover { border-color:#93C5FD; }
body.full .mt-status { color:#6EE7B7; }

/* meeting fills the viewport */
body.full .meet { flex:1 1 0; min-height:0; border-radius:0; box-shadow:none; background:transparent; padding:0; gap:0;
  grid-template-columns:220px minmax(0,1fr) 380px; grid-template-rows:minmax(0,1fr) 236px; }
body.full .mt-panel { background:rgba(10,30,90,.55); border:0; border-radius:0; color:#E6EEFF; }
body.full .mt-left { border-right:1px solid rgba(147,197,253,.16); overflow-y:auto; }
body.full .mt-chat { border-left:1px solid rgba(147,197,253,.16); height:auto; }
body.full .mt-media { border-top:1px solid rgba(147,197,253,.16); min-height:0; overflow:hidden; }
body.full .mt-board { min-height:0; background:rgba(6,18,59,.35); }
body.full .mt-fit { flex:1 1 0; min-height:0; container-type:size; display:flex; align-items:center; justify-content:center; }
body.full .mt-canvas { width:min(100cqw, 100cqh * 16 / 9); flex:none; box-shadow:0 0 0 1px rgba(147,197,253,.35), 0 14px 40px -18px rgba(0,0,0,.6); }
body.full .mt-media-col { display:flex; flex-direction:column; min-height:0; min-width:0; }
body.full .mt-yt { flex:1 1 0; min-height:0; aspect-ratio:auto; }
body.full .mt-audio, body.full .mt-gallery { flex:1 1 0; min-height:0; overflow-y:auto; max-height:none; align-content:start; }
body.full .mt-compose { border-top-color:rgba(147,197,253,.16); }
body.full .mt-member:hover { background:rgba(147,197,253,.10); }
body.full .mt-track, body.full .ch-cm, body.full .ch-chip, body.full .ch-mrow:nth-child(odd) { background:rgba(4,12,40,.55); border-color:rgba(147,197,253,.18); }
body.full input, body.full select, body.full textarea { background:rgba(4,12,40,.6); border-color:rgba(147,197,253,.28); color:#E6EEFF; }

/* chess fills the viewport */
body.full .ch { flex:1 1 0; min-height:0; border-radius:0; padding:0; gap:0; background:transparent; align-items:stretch; grid-template-columns:250px minmax(0,1fr) 360px; }
body.full .ch-left, body.full .ch-mid, body.full .ch-right { background:rgba(10,30,90,.55); border:0; border-radius:0; padding:14px; min-height:0; }
body.full .ch-left { border-right:1px solid rgba(147,197,253,.16); overflow-y:auto; }
body.full .ch-mid { background:rgba(6,18,59,.35); }
body.full .ch-right { border-left:1px solid rgba(147,197,253,.16); display:flex; flex-direction:column; }
body.full .ch-moves { max-height:32%; flex:none; }
body.full .ch-feed { flex:1 1 0; min-height:0; max-height:none; align-content:start; }
body.full .ch-board-wrap { flex:1 1 0; min-height:0; max-width:none; container-type:size; display:flex; align-items:center; justify-content:center; }
body.full .ch-board { width:min(100cqw, 100cqh); flex:none; }
body.full .ch-pc { font-size:calc(min(100cqw, 100cqh) * .088); }
body.full .ch-slot { border-color:rgba(147,197,253,.3); }

@media (max-width: 1250px) {
  body.full:not(.stream-chess) main { height:auto; overflow:visible; }
  body.full .meet { grid-template-columns:190px minmax(0,1fr); grid-template-rows:auto; }
  body.full .mt-fit { container-type:normal; display:block; }
  body.full .mt-canvas { width:100%; }
  body.full .mt-media { height:auto; }
  body.full .mt-yt { aspect-ratio:16 / 9; flex:none; }
}
@media (max-width: 1150px) {
  body.full:not(.stream-chess) .ch { grid-template-columns:minmax(0,1fr); }
  body.full:not(.stream-chess) .ch-board-wrap { container-type:normal; display:block; max-width:560px; margin:0 auto; width:100%; }
  body.full:not(.stream-chess) .ch-board { width:100%; }
  body.full:not(.stream-chess) .ch-pc { font-size:min(9vw,52px); }
}
@media (max-width: 760px) { body.full .meet { grid-template-columns:minmax(0,1fr); } }
body.full .brand img { filter:brightness(0) invert(1); }
.fx-clear { height:24px !important; padding:0 8px !important; font-size:11px !important; opacity:.75; } .fx-clear:hover { opacity:1; }

/* ---- Mobile pass ---- */
.menu-btn { display:none; }
@media (max-width: 760px) {
  html, body { overflow-x:clip; }
  body { padding-left:env(safe-area-inset-left); padding-right:env(safe-area-inset-right); }
  .nav { flex-wrap:nowrap; height:56px; padding:0 8px 0 14px; gap:8px; }
  .cmdk { display:none; }
  .nav-right { margin-left:auto; order:0; }
  #logout { min-height:44px; padding:0 12px; }
  .menu-btn { display:inline-flex; flex-direction:column; justify-content:center; align-items:center; gap:5px; order:5; width:44px; height:44px; border:1px solid var(--border); border-radius:10px; background:transparent; cursor:pointer; padding:0; }
  .menu-btn i { display:block; width:18px; height:2px; border-radius:2px; background:currentColor; transition:transform .2s, opacity .2s; }
  .nav.open .menu-btn i:nth-child(1) { transform:translateY(7px) rotate(45deg); } .nav.open .menu-btn i:nth-child(2) { opacity:0; } .nav.open .menu-btn i:nth-child(3) { transform:translateY(-7px) rotate(-45deg); }
  .tabs { display:none; position:absolute; top:56px; left:0; right:0; flex-direction:column; gap:0; padding:6px 10px 12px; background:var(--white); border-bottom:1px solid var(--border); box-shadow:0 18px 30px -18px rgba(11,15,25,.45); overflow:visible; width:auto; }
  .nav.open .tabs { display:flex; }
  .tabs a { min-height:48px; display:flex; align-items:center; padding:0 14px; font-size:15px; }
  body.full .tabs { background:#081A4D; border-bottom-color:rgba(147,197,253,.22); }
  body.full .menu-btn { border-color:rgba(147,197,253,.3); color:#E6EEFF; }
  /* tap targets */
  .btn, .btn.small { min-height:44px; }
  main a:not(.btn) { display:inline-block; padding-block:12px; margin-block:-10px; }
  body.full { background-attachment:scroll; }

  /* meeting on phones: board first, then members, chat, media */
  body.full main { display:block; height:auto; overflow:visible; }
  body.full .fx-bar { padding:8px 12px; gap:6px 8px; }
  body.full .fx-sub { display:none; }
  body.full .fx-bar .mt-title-r { flex-wrap:wrap; gap:6px; margin-left:auto; justify-content:flex-end; }
  body.full .fx-bar .mt-status { font-size:10.5px; width:100%; text-align:right; }
  .fx-clear { position:relative; height:30px !important; min-height:0 !important; }
  .fx-clear::after { content:""; position:absolute; inset:-7px -2px; }
  body.full .btn.wake { min-height:36px; height:36px; position:relative; } body.full .btn.wake::after { content:""; position:absolute; inset:-4px 0; }
  body.full .meet { display:flex; flex-direction:column; gap:0; height:auto; }
  body.full .mt-board { order:1; padding:8px 0 10px; }
  body.full .mt-left { order:2; border-right:0; border-top:1px solid rgba(147,197,253,.16); padding:6px 8px; overflow:visible; }
  body.full .mt-chat { order:3; height:68vh; height:68dvh; min-height:340px; contain:size; border-left:0; border-top:1px solid rgba(147,197,253,.16); }
  body.full .mt-media { order:4; display:grid; grid-template-columns:minmax(0,1fr); height:auto; overflow:visible; }
  body.full .mt-tools { flex-wrap:nowrap; overflow-x:auto; padding:0 8px 2px; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
  body.full .mt-tools::-webkit-scrollbar { display:none; }
  body.full .mt-tools > * { flex:none; }
  body.full .mt-tools .tool, body.full .mt-tools select { min-height:44px; }
  body.full .mt-swatches .sw { width:36px; height:36px; position:relative; } .mt-swatches .sw::after { content:""; position:absolute; inset:-4px -2px; }
  body.full .mt-fit { display:block; flex:none; container-type:normal; padding:8px 0 0; }
  body.full .mt-board { min-height:auto; }
  body.full .mt-canvas { width:100%; border-radius:0; }
  body.full .mt-members { display:flex; gap:6px; overflow-x:auto; align-items:center; scrollbar-width:none; }
  body.full .mt-members::-webkit-scrollbar { display:none; }
  body.full .mt-members .mt-h { margin:0 4px 0 0; flex:none; }
  body.full .mt-member { display:inline-flex; width:auto; flex:none; align-items:center; gap:6px; min-height:44px; padding:0 12px; border:1px solid rgba(147,197,253,.22); border-radius:22px; }
  body.full .mt-member .mt-note { display:none; }
  body.full .mt-compose { position:sticky; bottom:0; background:rgba(8,20,64,.96); padding:8px 10px calc(8px + env(safe-area-inset-bottom)); }
  body.full .mt-compose input { min-height:44px; font-size:16px; } /* 16px stops iOS zoom on focus */
  body.full .mt-yt { aspect-ratio:16 / 9; flex:none; }
  body.full .mt-row input, body.full input { min-height:44px; font-size:16px; }

  /* chess on phones: roster chips, full-width board, moves + talk below. The stream layout stays fixed. */
  body.full:not(.stream-chess) .ch { display:flex; flex-direction:column; gap:0; }
  body.full:not(.stream-chess) .ch-left { order:1; border-right:0; padding:8px 10px; overflow:visible; }
  body.full:not(.stream-chess) .ch-left .mt-h { margin-bottom:6px; }
  body.full:not(.stream-chess) .ch-roster { display:flex; gap:6px; overflow-x:auto; scrollbar-width:none; }
  body.full:not(.stream-chess) .ch-roster::-webkit-scrollbar { display:none; }
  body.full:not(.stream-chess) .ch-roster .ch-chip { flex:none; min-height:44px; }
  body.full:not(.stream-chess) .ch-mid { order:2; padding:8px 0; gap:6px; }
  body.full:not(.stream-chess) .ch-slot { margin:0 8px; min-height:52px; }
  body.full:not(.stream-chess) .ch-x { width:44px; height:44px; }
  body.full:not(.stream-chess) .ch-board-wrap { container-type:normal; display:block; flex:none; max-width:none; width:100%; margin:0; }
  body.full:not(.stream-chess) .ch-left { display:block; min-height:auto; } body.full:not(.stream-chess) .ch-mid, body.full:not(.stream-chess) .ch-right { min-height:auto; }
  body.full:not(.stream-chess) .ch-roster { align-items:center; }
  body.full:not(.stream-chess) .ch-board { width:100%; border-radius:0; }
  body.full:not(.stream-chess) .ch-pc { font-size:min(10vw,52px); }
  body.full:not(.stream-chess) .ch-right { order:3; border-left:0; border-top:1px solid rgba(147,197,253,.16); display:block; }
  body.full:not(.stream-chess) .ch-moves { max-height:240px; }
  body.full:not(.stream-chess) .ch-feed { max-height:none; }
}
@media (max-width: 760px) and (pointer: coarse) { .mt-live { touch-action:none; } }
@media (max-width: 760px) {
  body.full:not(.stream-chess) .ch-roster { flex-wrap:wrap; overflow:visible; }
  body.full:not(.stream-chess) .ch-roster > .mt-h { width:100%; flex:none; margin:0 0 2px; }
  body.full:not(.stream-chess) .ch-roster .ch-chip { flex:1 1 30%; min-width:0; padding:6px 8px; }
  body.full:not(.stream-chess) .ch-roster .ch-chip .ch-kind { display:none; }
  body.full:not(.stream-chess) .ch-roster .ch-chip span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
}
@media (max-width: 760px) {
  main a:not(.btn) { padding-block:14px; margin-block:-12px; }
  .seg button { min-height:44px; padding:0 14px; }
  .brand { min-height:44px; }
}

/* ===== v3 skin: blue-led color, borders and structure on every page ===== */
:root { --blue:#1D4ED8; --blue2:#2563EB; --sky:#60A5FA; --edge:#C9D8F3; --tint:#F2F6FE; --navy:#081A4D; }
html, body { background:#EAF0FB; }
body:not(.full) { background-color:#EAF0FB; background-image:radial-gradient(rgba(29,78,216,.07) .8px, transparent .8px); background-size:14px 14px; }
/* nav: navy on every page, tabs always look like buttons */
.nav { background-color:var(--navy); background-image:radial-gradient(rgba(147,197,253,.16) .7px, transparent .7px); border-bottom:1px solid rgba(147,197,253,.22); box-shadow:0 8px 20px -14px rgba(8,26,77,.8); }
.brand, .brand .word { color:#fff; } .brand .tag { color:#93C5FD; } .brand img { filter:brightness(0) invert(1); }
.tabs { gap:6px; }
.tabs a { color:#DBEAFE; background:rgba(255,255,255,.07); border:1px solid rgba(147,197,253,.32); border-radius:8px; padding:6px 12px; box-shadow:none; transition:background .12s, border-color .12s; }
.tabs a:hover { background:rgba(96,165,250,.20); border-color:rgba(147,197,253,.6); color:#fff; text-decoration:none; }
.tabs a:active, .tabs a.on, body.full .tabs a.on { background:var(--blue2); border-color:var(--sky); color:#fff; box-shadow:0 6px 16px -8px #2563EB; }
.cmdk { background:rgba(255,255,255,.07); border-color:rgba(147,197,253,.3); color:#BFDBFE; }
.cmdk kbd { background:rgba(255,255,255,.08); border-color:rgba(147,197,253,.3); color:#E6EEFF; }
#logout { color:#DBEAFE; border:1px solid rgba(147,197,253,.32); }
#logout:hover { border-color:var(--sky); }
.loader i { background:rgba(147,197,253,.25); }
.menu-btn { color:#E6EEFF; border-color:rgba(147,197,253,.32) !important; }
@media (max-width: 1280px) and (min-width: 761px) { .tabs a { padding:6px 9px; font-size:12.5px; } .cmdk .label { display:none; } .cmdk { max-width:120px; } .brand .tag { display:none; } }
@media (max-width: 760px) {
  .tabs, body.full .tabs { background:var(--navy); border-bottom:1px solid rgba(147,197,253,.22); gap:6px; padding:10px 12px 14px; }
  .tabs a { justify-content:flex-start; }
}
/* page header */
.page-title { color:#0B1F5C; display:flex; align-items:center; gap:10px; }
.page-title::before { content:""; width:6px; height:26px; border-radius:3px; background:linear-gradient(180deg,var(--blue2),#06B6D4); flex:none; }
.page-sub { color:#3B4A6B; }
/* sections become framed panels with a blue accent rail */
main > .section { background:#fff; border:1px solid var(--edge); border-radius:12px; padding:16px 18px 18px; margin-bottom:18px; position:relative; overflow:hidden; box-shadow:0 12px 28px -22px rgba(29,78,216,.45); }
main > .section::before, main > .section + .section::before { content:""; position:absolute; top:0; left:0; right:0; width:auto; height:3px; background:linear-gradient(90deg,var(--blue) 0%,#4F46E5 55%,#06B6D4 100%); }
main > .section + .section { border-top:1px solid var(--edge); padding-top:16px; }
.sh { padding-bottom:10px; margin-bottom:14px; border-bottom:1px solid #E1E9F8; }
.sh h2 { color:#0B1F5C; display:flex; align-items:center; gap:8px; }
.sh h2::before { content:""; width:8px; height:8px; border-radius:2px; background:var(--blue2); box-shadow:0 0 0 3px #DBE7FF; }
.sh .note { color:#4B5B7C; }
/* cards, lists, tables */
.card { border-color:var(--edge); background:linear-gradient(180deg,#FFFFFF 0%,#F7FAFF 100%); box-shadow:inset 3px 0 0 #93B4F5; }
.list, .tbl-wrap, .today, .link, .col, .pcard, .mx, .filters, .seg { border-color:var(--edge); }
.row, .msg, .kv, .tbl td, .ws-row, .mx-thread, .mx-head, .mx-compose { border-color:#E1E9F8; }
.list { background:#fff; }
.row:nth-child(even), .ws-row:nth-child(even) { background:#F8FAFF; }
.row-link:hover { background:#EEF4FF !important; }
.tbl th { background:#E9F0FE; color:#1E3A8A; border-bottom-color:var(--edge); }
.tbl tr:nth-child(even) td { background:#FAFCFF; }
.today { background:var(--tint); }
.today > div { border-color:var(--edge); }
.today .first { background:linear-gradient(135deg,#0B2470,#1D4ED8); color:#fff; }
.today .first .k, .today .first .s { color:#BFDBFE; }
.today .v { color:#0B1F5C; } .today .first .v { color:#fff; }
.link { background:#fff; box-shadow:inset 0 3px 0 #BFD3FA; }
.link:hover { border-color:var(--blue2); box-shadow:inset 0 3px 0 var(--blue2), 0 10px 20px -16px rgba(29,78,216,.6); }
.group-h { color:#1E3A8A; border-left:3px solid var(--blue2); padding-left:8px; }
.col { background:#EFF4FE; } .col-h .k { color:#1E3A8A; }
.pcard { box-shadow:inset 3px 0 0 #93B4F5; } .pcard:hover { border-color:var(--blue2); }
.btn { border-color:#BFD0F0; }
.btn:hover { border-color:var(--blue2); color:#1E3A8A; }
.btn.primary { background:var(--blue); border-color:var(--blue); color:#fff; } .btn.primary:hover { background:#1E40AF; color:#fff; }
.seg button.on, .filters button.on { background:var(--blue); color:#fff; }
.seg button, .filters button { border-color:var(--edge); }
textarea, input[type=text], input[type=url], input[type=password], select { border-color:#BFD0F0; }
textarea:focus, input:focus, select:focus { outline:2px solid #93C5FD; outline-offset:0; border-color:var(--blue2); }
.mx-side { background:#F1F5FE; } .mx-thread:hover { background:#E6EEFD; } .mx-thread.on { box-shadow:inset 3px 0 0 var(--blue2); }
.mx-head { background:#F7FAFF; } .mx-compose { background:#F7FAFF; }
.mx { background:#fff; box-shadow:0 12px 28px -22px rgba(29,78,216,.45); }
footer { background:var(--navy); color:#93C5FD; border-top:1px solid rgba(147,197,253,.22); }
/* talk-to-the-matrix box on the homepage */
.talk-zone { background:linear-gradient(180deg,#EEF4FF 0%,#F8FAFF 100%); border:1px solid #BCD0F7; box-shadow:inset 3px 0 0 var(--blue2); padding:14px; }
.talk-zone .mx-reply { margin:0 0 12px; border:1.5px solid #93B4F5; box-shadow:0 10px 24px -18px rgba(29,78,216,.6); padding:14px; }
.talk-zone .mx-reply .compose-row textarea { min-height:52px; font-size:15px; }
.talk-zone .btn.mic { min-width:92px; height:44px; background:#FFF1F2; border-color:#FDA4AF; color:#9F1239; font-weight:600; }
.talk-zone .btn.mic.on { background:#BE123C; color:#fff; border-color:#BE123C; } .talk-zone .btn.mic.on .mic-dot { background:#fff; }
.talk-zone .compose-row .btn.primary { height:44px; min-width:80px; }
@media (max-width: 760px) {
  main > .section { padding:12px 12px 14px; border-radius:10px; margin-bottom:12px; }
  .talk-zone { padding:10px; }
  .talk-zone .compose-row { flex-wrap:wrap; }
  .talk-zone .compose-row textarea { flex:1 1 100%; font-size:16px; }
  .talk-zone .compose-row .btn { flex:1 1 0; }
  .talk-zone .teaser { grid-template-columns:minmax(0,1fr); }
  /* matrix: message box right under the nav, conversation below (newest first) */
  body[data-page="matrix"] .page-title, body[data-page="matrix"] .page-sub { display:none; }
  body[data-page="matrix"] main { padding-top:8px; }
  body[data-page="matrix"] .mx { display:flex; flex-direction:column; height:auto; min-height:0; }
  body[data-page="matrix"] .mx-main { order:1; }
  body[data-page="matrix"] .mx-side { order:2; max-height:none; border-bottom:0; border-top:1px solid var(--edge); }
  body[data-page="matrix"] .mx-threads { max-height:260px; }
  body[data-page="matrix"] .mx-compose { order:-1; border-top:0; border-bottom:1px solid #E1E9F8; }
  body[data-page="matrix"] .mx-head { order:0; }
  body[data-page="matrix"] .mx-log { order:1; display:flex; flex-direction:column-reverse; max-height:none; min-height:120px; overflow:visible; }
  body[data-page="matrix"] .mx-compose textarea { font-size:16px; }
  body[data-page="matrix"] .mx-compose .compose-row .btn { min-height:44px; }
  body[data-page="matrix"] .mx-compose select.inline { height:44px; }
}
.avatar.juno { background:#A21CAF; } .avatar.all { background:linear-gradient(135deg,#1D4ED8,#A21CAF); font-size:9px; }
.mx-compose .btn.mic { height:44px; background:#FFF1F2; border-color:#FDA4AF; color:#9F1239; font-weight:600; }
.mx-compose .btn.mic.on { background:#BE123C; color:#fff; border-color:#BE123C; } .mx-compose .btn.mic.on .mic-dot { background:#fff; }
.mx-compose .compose-row .btn.primary { height:44px; }
.msg .body.clip { display:block; -webkit-line-clamp:unset; line-clamp:unset; overflow:visible; } /* full replies everywhere */

/* ---- PWA + shared mic ---- */
.btn.mic { position:relative; overflow:hidden; }
.btn.mic.on::before { content:""; position:absolute; left:0; bottom:0; height:3px; width:calc(var(--lvl, 0) * 100%); background:#FB7185; transition:width .08s; }
.mt-micnote { font-family:var(--mono); font-size:11px; color:#93C5FD; padding:4px 12px 0; }
.mt-micnote:empty { display:none; }
.mt-compose .btn.mic { height:36px; min-height:36px; padding:0 10px; background:rgba(190,18,60,.18); border-color:rgba(251,113,133,.5); color:#FECDD3; }
.mt-compose .btn.mic.on { background:#BE123C; color:#fff; }
@media (max-width: 760px) { .mt-compose .btn.mic { min-height:44px; } }
/* installed app: respect the notch / home indicator (status bar is translucent) */
@media (display-mode: standalone) {
  .nav { padding-top:env(safe-area-inset-top); height:calc(48px + env(safe-area-inset-top)); padding-left:max(14px, env(safe-area-inset-left)); padding-right:max(8px, env(safe-area-inset-right)); }
  main { padding-bottom:calc(64px + env(safe-area-inset-bottom)); }
  footer { padding-bottom:calc(18px + env(safe-area-inset-bottom)); }
  body.full .mt-compose { padding-bottom:calc(8px + env(safe-area-inset-bottom)); }
}
@media (display-mode: standalone) and (min-width: 761px) { body.full main { height:calc(100dvh - 48px - env(safe-area-inset-top)); } }
@media (display-mode: standalone) and (max-width: 760px) {
  .nav { height:calc(56px + env(safe-area-inset-top)); }
  .tabs { top:calc(56px + env(safe-area-inset-top)); }
}
.offline-page { min-height:100vh; display:grid; place-items:center; padding:24px; }
.offline-box { max-width:380px; text-align:center; color:#E6EEFF; display:grid; gap:12px; justify-items:center; }
.offline-box h1 { font-family:var(--display); margin:6px 0 0; color:#fff; }
.offline-box p { color:#BFDBFE; margin:0 0 6px; }
.offline-box img { border-radius:16px; }
/* Cursor: its own cyan in the blue skin */
.avatar.cursor { background:linear-gradient(135deg,#0891B2,#0E7490); box-shadow:0 0 0 2px rgba(103,232,249,.35); }

/* ---- voice mode toggle (Direct voice / Review first) ---- */
.voice-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:6px; }
.voice-row .hint { flex:1 1 180px; min-width:0; margin:0; }
.voice-mode { display:inline-flex; flex:none; padding:2px; gap:2px; border-radius:999px; background:#EAF1FF; border:1px solid #BFD3FB; }
.voice-mode button { border:0; background:transparent; color:#1E3A8A; font:600 11px/1 var(--mono, ui-monospace, monospace); letter-spacing:.02em; padding:6px 10px; border-radius:999px; cursor:pointer; white-space:nowrap; }
.voice-mode button:hover { background:rgba(37,99,235,.10); }
.voice-mode button.on { background:#1D4ED8; color:#fff; box-shadow:0 1px 4px rgba(29,78,216,.35); }
.mt-voice { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:6px 12px 0; }
.mt-voice .mt-micnote { padding:0; flex:1 1 140px; min-width:0; }
.mt-voice .voice-mode { background:rgba(147,197,253,.12); border-color:rgba(147,197,253,.35); }
.mt-voice .voice-mode button { color:#BFDBFE; }
.mt-voice .voice-mode button.on { background:#2563EB; color:#fff; }
@media (max-width: 760px) {
  .voice-mode button { min-height:32px; padding:8px 12px; font-size:12px; }
}

/* ---- Chess table talk: White and Black read apart at a glance ---- */
.ch-cm { border-left:3px solid transparent; }
.ch-cm-top { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:3px; }
.ch-cm-tag { flex:none; font-family:var(--mono); font-size:9px; font-weight:700; letter-spacing:.08em; padding:2px 6px; border-radius:999px; line-height:1.4; }
.ch-cm-name { font-weight:700; font-size:12.5px; }
.ch-cm-text { line-height:1.4; color:#E5E7EB; }
.ch-cm.side-white {
  background:linear-gradient(90deg, rgba(251,191,36,.20), rgba(11,15,25,.55) 46%);
  border-color:rgba(251,191,36,.55);
  border-left-color:#FBBF24;
}
.ch-cm.side-white .ch-cm-tag { background:#FBBF24; color:#1C1404; }
.ch-cm.side-white .ch-cm-name { color:#FDE68A; }
.ch-cm.side-black {
  background:linear-gradient(90deg, rgba(244,114,182,.20), rgba(11,15,25,.55) 46%);
  border-color:rgba(244,114,182,.5);
  border-left-color:#F472B6;
}
.ch-cm.side-black .ch-cm-tag { background:#F472B6; color:#1C0A14; }
.ch-cm.side-black .ch-cm-name { color:#FBCFE8; }
.ch-cm.flag { box-shadow:inset 0 0 0 1px #FB7185; }
body.full .ch-cm.side-white {
  background:linear-gradient(90deg, rgba(251,191,36,.22), rgba(4,12,40,.72) 48%);
  border-color:rgba(251,191,36,.5);
  border-left-color:#FBBF24;
}
body.full .ch-cm.side-black {
  background:linear-gradient(90deg, rgba(244,114,182,.22), rgba(4,12,40,.72) 48%);
  border-color:rgba(244,114,182,.48);
  border-left-color:#F472B6;
}
body.full .ch-cm-text { color:#E6EEFF; }
.ch-cm.side-cast {
  background:linear-gradient(90deg, rgba(45,212,191,.20), rgba(11,15,25,.55) 48%);
  border-color:rgba(45,212,191,.5);
  border-left-color:#2DD4BF;
}
.ch-cm.side-cast .ch-cm-tag { background:#2DD4BF; color:#042F2E; }
.ch-cm.side-cast .ch-cm-name { color:#99F6E4; letter-spacing:.01em; }
.ch-cm.side-cast .ch-cm-text { font-style:italic; color:#CCFBF1; }
body.full .ch-cm.side-cast {
  background:linear-gradient(90deg, rgba(45,212,191,.22), rgba(4,12,40,.72) 50%);
  border-color:rgba(45,212,191,.48);
  border-left-color:#2DD4BF;
}
.ch-cast-note { margin-left:8px; font-family:var(--mono); font-size:10px; font-weight:500; letter-spacing:.04em; color:#5EEAD4; text-transform:none; }

/* ---- Chess portraits: big semi-animated faces for the two seated engines ---- */
.ch-portraits { display:grid; gap:10px; margin-bottom:12px; }
.ch-portrait { position:relative; display:flex; flex-direction:column; align-items:center; text-align:center; gap:2px; padding:8px 8px 10px; border-radius:16px; border:1px solid rgba(147,197,253,.28); background:rgba(4,12,40,.45); cursor:pointer; }
.ch-portrait.side-white { box-shadow:inset 0 0 0 1px rgba(251,191,36,.25), inset 4px 0 0 #FBBF24; }
.ch-portrait.side-black { box-shadow:inset 0 0 0 1px rgba(244,114,182,.25), inset 4px 0 0 #F472B6; }
.ch-portrait.turn { border-color:#34D399; }
.ch-portrait.over { border-color:#FBBF24; background:rgba(251,191,36,.08); }
.ch-portrait .ch-x { position:absolute; top:6px; right:6px; }
.ch-face { width:120px; height:132px; }
.ch-face svg { width:100%; height:100%; display:block; overflow:visible; }
.ch-face-empty { width:100%; height:100%; display:grid; place-items:center; font-size:46px; color:rgba(191,219,254,.7); border:1.5px dashed rgba(147,197,253,.4); border-radius:22px; }
.ch-portrait-meta { display:grid; justify-items:center; gap:2px; min-width:0; }
.ch-portrait-name { font-size:16px; color:#fff; line-height:1.2; }
.ch-mood-label { font-family:var(--mono); font-size:11px; letter-spacing:.04em; color:#99F6E4; text-transform:uppercase; }
.ch-portrait-turn { font-family:var(--mono); font-size:11px; color:#FBBF24; min-height:1em; }
.ch-portrait.side-white .ch-cm-tag { background:#FBBF24; color:#1C1404; }
.ch-portrait.side-black .ch-cm-tag { background:#F472B6; color:#1C0A14; }
.ch-portrait.mood-happy .ch-mood-label, .ch-portrait.mood-win .ch-mood-label { color:#FDE68A; }
.ch-portrait.mood-mad .ch-mood-label, .ch-portrait.mood-lose .ch-mood-label { color:#FDA4AF; }
.ch-portrait.mood-check .ch-mood-label { color:#FDBA74; }
.ch-portrait.mood-smug .ch-mood-label { color:#C4B5FD; }
body.full .ch { grid-template-columns:320px minmax(0,1fr) 380px; }
body.full .ch-face { width:168px; height:186px; }
body.full .ch-portrait-name { font-size:18px; }
.ch-svg .bob { transform-origin:80px 168px; animation:ch-breathe 3.6s ease-in-out infinite; }
.ch-portrait.side-black .ch-svg .bob { animation-delay:-1.3s; }
.ch-svg .blink { transform-box:fill-box; transform-origin:center; animation:ch-blink 4.8s infinite; }
.ch-portrait.side-black .ch-svg .blink { animation-delay:-2.2s; }
.ch-svg .pupils, .ch-svg .brow, .ch-svg .star, .ch-svg .sweat { transform-box:fill-box; transform-origin:center; }
.ch-svg .ground { fill:rgba(4,12,40,.35); }
.ch-svg [data-for] { display:none; }
.ch-svg.mood-idle [data-for~="idle"],
.ch-svg.mood-think [data-for~="think"],
.ch-svg.mood-smug [data-for~="smug"],
.ch-svg.mood-happy [data-for~="happy"],
.ch-svg.mood-mad [data-for~="mad"],
.ch-svg.mood-check [data-for~="check"],
.ch-svg.mood-win [data-for~="win"],
.ch-svg.mood-lose [data-for~="lose"] { display:inline; }
.ch-svg.mood-think .pupils { transform:translateY(-4px); }
.ch-svg.mood-think .brow { transform:translateY(-5px); }
.ch-svg.mood-smug .blink { animation:none; transform:scaleY(.55); }
.ch-svg.mood-smug .pupils { transform:translate(2px, 2px); }
.ch-svg.mood-smug .brow.lb { transform:translateY(-6px) rotate(-12deg); }
.ch-svg.mood-happy .brow, .ch-svg.mood-win .brow { transform:translateY(-2px); }
.ch-svg.mood-happy .bob, .ch-svg.mood-win .bob { animation:ch-bounce .9s ease-in-out infinite; }
.ch-svg.mood-mad .brow.lb { transform:rotate(18deg) translateY(2px); }
.ch-svg.mood-mad .brow.rb { transform:rotate(-18deg) translateY(2px); }
.ch-svg.mood-mad .bob { animation:ch-shake .42s linear infinite; }
.ch-svg.mood-check .pupils { transform:scale(1.28); }
.ch-svg.mood-check .brow { transform:translateY(-7px); }
.ch-svg.mood-check .bob { animation:ch-breathe 1.3s ease-in-out infinite; }
.ch-svg.mood-check .sweat { animation:ch-sweat 1.1s ease-in-out infinite; }
.ch-svg.mood-lose .blink { animation:none; transform:scaleY(.12); }
.ch-svg.mood-lose .brow { transform:translateY(4px); }
.ch-svg.mood-lose .bob { animation:none; transform:translateY(4px); }
.ch-svg.mood-win .star { animation:ch-spin 2.6s linear infinite; }
@keyframes ch-breathe { 0%,100% { transform:translateY(0) scale(1); } 50% { transform:translateY(1.6px) scale(1.016, 1.022); } }
@keyframes ch-blink { 0%, 90%, 100% { transform:scaleY(1); } 94%, 97% { transform:scaleY(.08); } }
@keyframes ch-shake { 0%,100% { transform:translateX(0) rotate(0); } 25% { transform:translateX(-2.5px) rotate(-2deg); } 75% { transform:translateX(2.5px) rotate(2deg); } }
@keyframes ch-bounce { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-6px); } }
@keyframes ch-sweat { 0%,100% { transform:translateY(0); opacity:1; } 70% { transform:translateY(6px); opacity:.2; } }
@keyframes ch-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ch-svg .bob, .ch-svg .blink, .ch-svg .star, .ch-svg .sweat { animation:none !important; }
}
@media (max-width: 1150px) {
  body.full .ch { grid-template-columns:minmax(0,1fr); }
  .ch-portraits { grid-template-columns:1fr 1fr; }
  body.full .ch-face, .ch-face { width:112px; height:124px; }
}
@media (max-width: 760px) {
  body.full .ch-portraits { display:flex; gap:8px; }
  body.full .ch-portrait { flex:1 1 0; min-width:0; padding:6px; }
  body.full .ch-face { width:72px; height:80px; }
  body.full .ch-portrait-name { font-size:13px; }
  body.full .ch-mood-label, body.full .ch-portrait-turn { font-size:9px; }
  .ch-face-empty { font-size:28px; border-radius:14px; }
}

/* ---- Ninefold Chips ---- */
.ch-chips { display:grid; gap:6px; margin-bottom:10px; padding:8px; border-radius:12px; border:1px solid rgba(245,193,108,.4); background:linear-gradient(180deg, rgba(245,193,108,.12), rgba(4,12,40,.35)); }
.ch-chips-h { display:flex; justify-content:space-between; align-items:baseline; gap:8px; font-weight:700; color:#FDE68A; }
.ch-chips-you { font-family:var(--mono); font-size:13px; color:#fff; }
.ch-chips-note { font-family:var(--mono); font-size:10px; color:#F5D7A1; letter-spacing:.02em; }
.ch-pool { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:4px; }
.ch-pool-side { display:flex; flex-direction:column; align-items:center; gap:1px; padding:4px 2px; border-radius:8px; background:rgba(4,12,40,.45); font-size:10px; text-transform:uppercase; letter-spacing:.05em; color:#CBD5E1; }
.ch-pool-side b { font-size:14px; color:#fff; }
.ch-pool-side.white { box-shadow:inset 0 -2px 0 #FBBF24; }
.ch-pool-side.black { box-shadow:inset 0 -2px 0 #F472B6; }
.ch-pool-side.draw { box-shadow:inset 0 -2px 0 #2DD4BF; }
.ch-bet-row { display:flex; gap:4px; flex-wrap:wrap; align-items:center; }
.ch-bet-side { flex:1 1 0; min-width:0; border-radius:999px; border:1px solid rgba(147,197,253,.3); background:rgba(4,12,40,.5); color:#E6EEFF; font:600 11px/1 var(--mono); padding:7px 4px; cursor:pointer; text-transform:uppercase; }
.ch-bet-side.white.on { background:#FBBF24; color:#1C1404; border-color:#FBBF24; }
.ch-bet-side.black.on { background:#F472B6; color:#1C0A14; border-color:#F472B6; }
.ch-bet-side.draw.on { background:#2DD4BF; color:#042F2E; border-color:#2DD4BF; }
.ch-chips input[type=number] { width:72px; height:32px; padding:0 8px; }
.ch-bet-row .btn.on { border-color:#FBBF24; color:#FDE68A; }
.ch-your-bet { font-size:12.5px; color:#FDE68A; }
.ch-open-bets { display:grid; gap:3px; }
.ch-open-bet { display:flex; justify-content:space-between; gap:8px; font-size:11.5px; padding:2px 6px; border-radius:6px; background:rgba(4,12,40,.4); }
.ch-open-bet.white { box-shadow:inset 2px 0 0 #FBBF24; }
.ch-open-bet.black { box-shadow:inset 2px 0 0 #F472B6; }
.ch-open-bet.draw { box-shadow:inset 2px 0 0 #2DD4BF; }
.ch-mini-board { display:grid; gap:2px; }
.ch-mini-row { display:flex; justify-content:space-between; gap:8px; font-size:12px; }
.ch-mini-row .up { color:#86EFAC; font-family:var(--mono); }
.ch-mini-row .down { color:#FDA4AF; font-family:var(--mono); }
.ch-board-link { font-family:var(--mono); font-size:11px; color:#FDE68A; }
body.full .ch-moves { max-height:22%; }
body.full .ch-chips { flex:none; }

.sb { padding:22px 28px 32px; display:flex; flex-direction:column; gap:16px; min-height:0; }
body.full .sb { flex:1 1 0; overflow:auto; }
.sb-h { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; flex-wrap:wrap; }
.sb-h h1 { margin:0; font-family:var(--display); font-size:42px; color:#fff; letter-spacing:-.03em; }
.sb-h p { margin:4px 0 0; color:#F5D7A1; font-family:var(--mono); font-size:13px; }
.sb-toggle { display:flex; gap:6px; }
.sb-toggle button { border-radius:999px; border:1px solid rgba(245,193,108,.45); background:transparent; color:#FDE68A; font:600 13px/1 var(--mono); padding:10px 16px; cursor:pointer; }
.sb-toggle button.on { background:#FBBF24; color:#1C1404; border-color:#FBBF24; }
.sb-cols { display:grid; grid-template-columns:1fr 1fr; gap:18px; align-items:start; }
.sb-cols h2 { margin:0 0 8px; font-size:14px; letter-spacing:.12em; text-transform:uppercase; color:#FDE68A; }
.sb-row { display:grid; grid-template-columns:42px minmax(0,1fr) auto; grid-template-areas:"rank name net" "rank meta meta"; gap:0 10px; align-items:baseline; padding:10px 12px; margin-bottom:6px; border-radius:12px; background:rgba(4,12,40,.5); }
.sb-row.up { box-shadow:inset 4px 0 0 #86EFAC; }
.sb-row.down { box-shadow:inset 4px 0 0 #FB7185; }
.sb-rank { grid-area:rank; font-family:var(--display); font-size:28px; color:#FDE68A; }
.sb-name { grid-area:name; font-size:22px; font-weight:700; color:#fff; }
.sb-kind { margin-left:8px; font-family:var(--mono); font-size:11px; font-weight:500; letter-spacing:.06em; text-transform:uppercase; color:#93C5FD; }
.sb-net { grid-area:net; font-family:var(--mono); font-size:26px; }
.sb-row.up .sb-net { color:#86EFAC; }
.sb-row.down .sb-net { color:#FDA4AF; }
.sb-meta { grid-area:meta; color:#CBD5E1; font-size:13px; }
.sb-even, .sb-foot { color:#E6EEFF; font-size:14px; }
.sb-foot { display:flex; justify-content:space-between; gap:12px; }
.sb-foot a { color:#FDE68A; }
body.score-clean .nav { display:none; }
body.score-clean main { height:100vh; height:100dvh; }
/* ---- Today's chip graph across the top of the chess stream ---- */
.ch-strip { display:flex; align-items:stretch; gap:12px; height:62px; padding:6px 14px 4px; flex:none; border-bottom:1px solid rgba(147,197,253,.18); background:rgba(4,12,40,.55); }
.ch-strip-k { align-self:center; font-family:var(--mono); font-size:11px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:#FDE68A; }
.ch-strip-track { flex:1; min-width:0; display:flex; align-items:flex-end; gap:8px; overflow-x:auto; scrollbar-width:none; }
.ch-strip-track::-webkit-scrollbar { display:none; }
.ch-strip-p { flex:0 0 auto; width:72px; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:1px; }
.ch-strip-nm { max-width:72px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:#fff; line-height:1.1; }
.ch-strip-bar { width:70%; border-radius:3px 3px 0 0; min-height:4px; }
.ch-strip-bar.up { background:linear-gradient(180deg,#FDE68A,#FBBF24); }
.ch-strip-bar.down { background:linear-gradient(180deg,#FDA4AF,#F472B6); }
.ch-strip-nv { font-family:var(--mono); font-size:10px; line-height:1.1; }
.ch-strip-nv.up { color:#86EFAC; }
.ch-strip-nv.down { color:#FDA4AF; }
.ch-strip-zero { flex:0 0 2px; align-self:stretch; margin:4px 2px; background:rgba(147,197,253,.35); border-radius:2px; }
.ch-strip-empty { align-self:center; color:#93C5FD; font-size:12px; padding:0 6px; }
.ch-strip-link { align-self:center; font-family:var(--mono); font-size:11px; color:#FDE68A; white-space:nowrap; }
@media (max-width: 760px) {
  .ch-strip { height:54px; padding:4px 8px; gap:8px; }
  .ch-strip-p { width:58px; }
  .ch-strip-nm, .ch-strip-nv { font-size:10px; }
}
.ch-plain-face { width:48px; height:52px; flex:none; }
.ch-plain-face svg { width:100%; height:100%; display:block; }
body:not(.stream-chess) .ch-stream-toggle { display:none !important; }
@media (max-width: 760px) {
  .sb { padding:12px; }
  .sb-h h1 { font-size:28px; }
  .sb-cols { grid-template-columns:minmax(0,1fr); }
  .sb-name { font-size:18px; }
  .sb-net { font-size:20px; }
  .ch-bet-side { min-height:36px; }
}

.ch-vs { display:flex; align-items:flex-start; justify-content:center; gap:18px; text-align:center; padding:2px 8px 6px; }
.ch-vs-side { min-width:0; flex:1 1 0; }
.ch-vs-name { font-weight:800; font-size:22px; line-height:1.15; color:#F8FAFC; }
.ch-vs-ver { min-height:1.1em; font-size:14px; font-weight:700; color:#FDE68A; }
.ch-vs-mid { align-self:center; font-size:16px; font-weight:800; color:#F9A8D4; letter-spacing:.08em; text-transform:uppercase; }
body.full .ch-vs-name { font-size:32px; }
body.full .ch-vs-ver { font-size:18px; }
.ch-stage { margin:0 0 8px; padding:8px 10px; border-radius:12px; background:rgba(8,18,48,.92); border:2px solid #FDE68A; display:grid; gap:6px; }
.ch-stage-top { display:flex; justify-content:space-between; align-items:baseline; gap:10px; flex-wrap:wrap; }
.ch-stage-total { font-size:28px; font-weight:800; color:#fff; line-height:1; }
.ch-stage-bettors { font-size:16px; font-weight:700; color:#E2E8F0; }
.ch-stage-clock { font-size:20px; font-weight:800; color:#FDE68A; font-variant-numeric:tabular-nums; }
.ch-stage-clock.closed { color:#FDA4AF; }
.ch-poolbar { display:flex; height:18px; border-radius:9px; overflow:hidden; background:rgba(255,255,255,.08); }
.ch-poolbar-seg.white { background:#FBBF24; }
.ch-poolbar-seg.draw { background:#93C5FD; }
.ch-poolbar-seg.black { background:#F472B6; }
.ch-stage-sides { display:grid; grid-template-columns:1.2fr .8fr 1.2fr; gap:8px; }
.ch-stage-side { display:flex; flex-direction:column; gap:2px; font-size:13px; color:#CBD5E1; }
.ch-stage-side b { font-size:18px; color:#fff; }
.ch-stage-fav { font-size:20px; font-weight:800; color:#FDE68A; }
.ch-portrait-name, .ch-pre-name, .ch-vs-name, .ch-ladder-name, .ch-chip-name { display:inline-flex; align-items:center; justify-content:center; gap:4px; flex-wrap:wrap; max-width:100%; }
.ch-ver { position:relative; display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; margin-left:4px; padding:0; border-radius:99px; border:1px solid #FDE68A; background:transparent; color:#FDE68A; font:700 11px/1 var(--mono, monospace); vertical-align:middle; cursor:pointer; flex:none; }
.ch-ver-pop { display:none; position:absolute; z-index:8; left:50%; top:calc(100% + 6px); transform:translateX(-50%); min-width:140px; padding:6px 8px; border-radius:8px; background:#0B1220; color:#F8FAFC; border:1px solid #FDE68A; font:600 13px/1.3 "Segoe UI", sans-serif; white-space:nowrap; }
.ch-ver:hover .ch-ver-pop, .ch-ver.open .ch-ver-pop, .ch-ver:focus-visible .ch-ver-pop { display:block; }
.ch-ladder { display:grid; gap:6px; margin:0 0 12px; }
.ch-ladder-k { font-size:13px; letter-spacing:.14em; text-transform:uppercase; font-weight:800; color:#FDE68A; }
.ch-ladder-next { font-size:16px; font-weight:800; color:#fff; }
.ch-ladder-row { display:grid; grid-template-columns:minmax(0,1.4fr) auto auto auto; gap:8px; align-items:center; padding:6px 8px; border-radius:10px; background:rgba(255,255,255,.05); }
.ch-ladder-row.top { outline:2px solid #FDE68A; }
.ch-ladder-name { font-size:16px; font-weight:800; color:#F8FAFC; min-width:0; }
.ch-ladder-meta, .ch-ladder-wl { font-size:14px; color:#E2E8F0; white-space:nowrap; }
.ch-ladder-go { font-size:12px; font-weight:800; color:#86EFAC; }
.ch-howto { display:grid; gap:3px; margin:8px 0; padding:8px 10px; border-radius:12px; border:1px solid rgba(147,197,253,.45); background:rgba(4,12,40,.55); }
.ch-howto-k { font-size:12px; letter-spacing:.12em; text-transform:uppercase; font-weight:800; color:#FDE68A; }
.ch-howto p { margin:0; font-size:13px; color:#E2E8F0; }
.ch-howto-cmds { font-family:var(--mono, ui-monospace, monospace); color:#fff; }
.ch-pre-ver { min-height:1.1em; font-size:14px; font-weight:700; color:#FDE68A; }
body.full .ch-stage-total { font-size:36px; }
body.full .ch-stage-clock { font-size:26px; }
body.full .ch-stage-fav { font-size:24px; }
body.full .ch-ladder-name { font-size:18px; }
body.full .ch-pre-ver { font-size:16px; }
.ch-board-wrap { position:relative; }
.ch-pre { position:absolute; inset:0; z-index:6; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; padding:10px 12px; background:rgba(6,16,48,.92); border-radius:12px; text-align:center; overflow:hidden; }
.ch-pre-head { width:120px; height:132px; }
.ch-pre-head svg { width:100%; height:100%; display:block; }
.ch-pre-dance { transform-origin:50% 80%; animation:ch-head-dance 1.15s ease-in-out infinite; }
.ch-pre.spinning .ch-pre-dance { animation-duration:.38s; }
.ch-pre-brand { font-size:11px; font-weight:600; color:#93C5FD; }
@keyframes ch-head-dance { 0%,100% { transform:translateY(0) rotate(-8deg); } 50% { transform:translateY(-8px) rotate(8deg); } }
.ch-pre[hidden] { display:none; }
.ch-pre-kicker { font-size:22px; font-weight:800; color:#FDE68A; }
.ch-pre-count { font-size:64px; line-height:1; font-weight:800; color:#fff; font-variant-numeric:tabular-nums; }
.ch-pre-pair { display:flex; align-items:flex-end; justify-content:center; gap:18px; width:100%; }
.ch-pre-slot { width:min(180px, 34%); }
.ch-pre-slot svg { width:100%; height:auto; display:block; }
.ch-pre-name { font-size:13px; font-weight:700; color:#E2E8F0; margin-top:4px; }
.ch-pre-vs { font-size:28px; font-weight:800; color:#F9A8D4; align-self:center; }
.ch-pre-note { margin:0; font-size:13px; color:#CBD5E1; max-width:46ch; }
.ch-pre-tally { display:grid; gap:4px; width:min(420px, 100%); }
.ch-pre-row { display:flex; justify-content:space-between; gap:8px; padding:4px 8px; border-radius:8px; background:rgba(255,255,255,.06); font-size:13px; }
.ch-pre-row.on { outline:2px solid #FDE68A; }
.ch-pre-vote { display:flex; flex-wrap:wrap; gap:6px; justify-content:center; align-items:center; }
.ch-fighter .ch-body { transform-origin:100px 250px; animation:ch-warmup .7s ease-in-out infinite; }
.ch-fighter .arm-l { transform-origin:39px 150px; animation:ch-arm .6s ease-in-out infinite; }
.ch-fighter .arm-r { transform-origin:161px 150px; animation:ch-arm .6s ease-in-out infinite reverse; }
@keyframes ch-warmup { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-8px); } }
@keyframes ch-arm { 0%,100% { transform:rotate(18deg); } 50% { transform:rotate(-28deg); } }
.ch-talk-wrap { position:relative; min-height:180px; flex:1 1 auto; display:flex; flex-direction:column; }
.ch-wager { position:absolute; inset:0; z-index:4; overflow:auto; padding:10px 12px; border-radius:12px; background:rgba(8,18,48,.94); border:2px solid #FDE68A; display:grid; gap:6px; align-content:start; }
.ch-wager-k { font-size:12px; letter-spacing:.14em; text-transform:uppercase; color:#FDE68A; font-weight:800; }
.ch-wager-fav { font-size:28px; font-weight:800; color:#fff; line-height:1.1; }
.ch-wager-pay { font-size:13px; color:#E2E8F0; }
.ch-wager-list { display:grid; gap:4px; }
.ch-wager-bet, .ch-wager-roll { display:flex; justify-content:space-between; gap:8px; font-size:15px; padding:4px 6px; border-radius:8px; background:rgba(255,255,255,.06); }
.ch-wager-bet.white { box-shadow:inset 3px 0 0 #FBBF24; }
.ch-wager-bet.black { box-shadow:inset 3px 0 0 #F472B6; }
.ch-wager-bet.draw { box-shadow:inset 3px 0 0 #93C5FD; }
.ch-wager-empty { font-size:13px; color:#CBD5E1; }
.ch-wager-today { display:flex; flex-wrap:wrap; gap:6px 10px; font-size:13px; color:#F8FAFC; }
.ch-strip-ladder { font-size:12px; color:#E2E8F0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:46vw; }
.ch-watch { display:grid; gap:4px; }
.ch-watch-row { display:flex; justify-content:space-between; gap:8px; align-items:center; font-size:13px; }
@media (prefers-reduced-motion: reduce) {
  .ch-fighter .ch-body, .ch-fighter .arm-l, .ch-fighter .arm-r { animation:none; }
}

/* Chess stream: one viewport, big board, wagers in the old head column. */
body.full[data-page="chess"] { height:100vh; height:100dvh; overflow:hidden; }
body.full[data-page="chess"] main { overflow:hidden; min-height:0; height:calc(100vh - 48px); height:calc(100dvh - 48px); }
body.full.score-clean[data-page="chess"] main { height:100vh; height:100dvh; }
body.full.streamer[data-page="chess"] main { height:calc(100vh - 36px); height:calc(100dvh - 36px); }
body.full[data-page="chess"] .fx-bar { flex:none; padding:4px 12px; }
body.full[data-page="chess"] .fx-sub { display:none; }
body.full[data-page="chess"] .ch-strip { align-self:stretch; width:100%; height:auto; flex:none; margin:0 0 2px; padding:3px 10px; border-radius:8px; border:1px solid rgba(253,230,138,.4); background:rgba(8,18,48,.92); overflow:hidden; }
body.full[data-page="chess"] .ch-strip-track { align-items:center; overflow:hidden; }
body.full[data-page="chess"] .ch-strip-p { width:auto; height:auto; flex-direction:column; align-items:stretch; justify-content:center; gap:2px; }
body.full[data-page="chess"] .ch-strip-top { display:flex; align-items:baseline; gap:6px; white-space:nowrap; }
body.full[data-page="chess"] .ch-strip-nm { max-width:none; overflow:visible; text-overflow:clip; font-size:12px; line-height:1.2; }
body.full[data-page="chess"] .ch-strip-nv { font-size:12px; line-height:1.2; }
body.full[data-page="chess"] .ch-strip-meter { display:block; height:3px; width:100%; border-radius:2px; background:rgba(255,255,255,.08); }
body.full[data-page="chess"] .ch-strip-bar { display:block; height:3px; min-height:0; width:auto; border-radius:2px; }
body.full[data-page="chess"] .ch-strip-set { display:flex; align-items:center; gap:14px; padding-right:28px; }
body.full[data-page="chess"] .ch-strip-marquee { display:flex; width:max-content; animation:ch-strip-move 32s linear infinite; }
@keyframes ch-strip-move { to { transform:translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  body.full[data-page="chess"] .ch-strip-marquee { animation:none; }
  body.full[data-page="chess"] .ch-strip-track { overflow-x:auto; }
}
body.full[data-page="chess"] .ch { flex:1 1 auto; min-height:0; overflow:hidden; align-items:stretch; grid-template-columns:300px minmax(0,1fr) 300px; }
body.full[data-page="chess"] .ch-left,
body.full[data-page="chess"] .ch-mid,
body.full[data-page="chess"] .ch-right { display:flex; flex-direction:column; min-height:0; overflow:hidden; padding:8px; }
body.full[data-page="chess"] .ch-wager-stack { flex:none; min-height:0; overflow:hidden; display:grid; gap:4px; align-content:start; }
body.full[data-page="chess"] .ch-ladder { flex:none; overflow:hidden; margin:6px 0; }
body.full[data-page="chess"] .ch-ladder-k { font-size:10px; letter-spacing:.12em; margin:0 0 2px; }
body.full[data-page="chess"] .ch-ladder-next { font-size:11px; font-weight:600; color:#CBD5E1; margin:0 0 2px; }
body.full[data-page="chess"] .ch-ladder-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; align-items:baseline; padding:1px 0; background:transparent; outline:none; border-radius:0; }
body.full[data-page="chess"] .ch-ladder-line { font-size:12px; color:#F8FAFC; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
body.full[data-page="chess"] .ch-ladder-brand { font-size:10px; font-weight:600; color:#93C5FD; }
body.full[data-page="chess"] .ch-ladder-wl { font-size:12px; color:#E2E8F0; font-variant-numeric:tabular-nums; }
body.full[data-page="chess"] .ch-roster { flex:1 1 auto; margin-top:8px; max-height:none; min-height:0; overflow:auto; padding:4px 6px; border:1px solid rgba(147,197,253,.2); border-radius:8px; background:rgba(4,12,40,.4); }
body.full[data-page="chess"] .ch-roster .mt-h { font-size:10px; margin:0 0 4px; }
body.full[data-page="chess"] .ch-roster .ch-chip { padding:3px 6px; font-size:12px; gap:6px; }
body.full[data-page="chess"] .ch-mid { gap:2px; }
body.full[data-page="chess"] .ch-sidename { display:flex; align-items:center; gap:8px; flex:none; min-width:0; max-width:100%; min-height:0; padding:4px 6px; }
body.full[data-page="chess"] .ch-sidename .ch-portrait { border:0; background:transparent; box-shadow:none; padding:0; border-radius:0; width:auto; flex:none; flex-direction:row; }
body.full[data-page="chess"] .ch-sidename .ch-portrait-meta,
body.full[data-page="chess"] .ch-sidename .ch-x,
body.full[data-page="chess"] .ch-slot { display:none !important; }
body.full[data-page="chess"] .ch-sidename .ch-face { width:72px; height:80px; }
body.full[data-page="chess"] .ch-sidename-copy { display:flex; flex-direction:column; align-items:flex-start; gap:0; min-width:0; }
body.full[data-page="chess"] .ch-sidename-brand { font-size:11px; font-weight:600; color:#93C5FD; }
body.full[data-page="chess"] .ch-sidename-who { font-size:15px; font-weight:700; color:#fff; line-height:1.2; display:inline-flex; align-items:baseline; flex-wrap:wrap; gap:0 4px; }
body.full[data-page="chess"] .ch-think { display:none; align-items:center; gap:3px; height:14px; }
body.full[data-page="chess"] .ch-sidename.to-move .ch-think { display:inline-flex; }
body.full[data-page="chess"] .ch-think i { width:4px; height:4px; border-radius:50%; background:currentColor; opacity:.35; }
body.full[data-page="chess"] .ch-sidename.to-move:not(.paused) .ch-think i { animation:ch-dots 1s infinite; }
body.full[data-page="chess"] .ch-think i:nth-child(2) { animation-delay:.15s; }
body.full[data-page="chess"] .ch-think i:nth-child(3) { animation-delay:.3s; }
body.full[data-page="chess"] .ch-sidename.side-white.to-move { color:#FBBF24; border-radius:10px; box-shadow:0 0 0 2px #FBBF24, 0 0 10px rgba(251,191,36,.4); }
body.full[data-page="chess"] .ch-sidename.side-black.to-move { color:#F472B6; border-radius:10px; box-shadow:0 0 0 2px #F472B6, 0 0 10px rgba(244,114,182,.4); }
body.full[data-page="chess"] .ch-sidename.to-move .ch-face { border-radius:10px; box-shadow:0 0 0 2px currentColor; }
body.full[data-page="chess"] .ch-sidename.waiting { opacity:.5; }
body.full[data-page="chess"] .ch-sidename.paused .ch-think i { animation:none; opacity:.9; }
body.stream-chess[data-page="chess"] .ch-board,
body.stream-chess[data-page="chess"] .ch-sidename { --fit:min(100cqw, 100cqh); --board:max(var(--fit) - 40px, min(var(--fit), 100cqw - 200px)); }
body.stream-chess[data-page="chess"] .ch-board { width:var(--board); height:var(--board); }
body.stream-chess[data-page="chess"] .ch-sidename { position:absolute; z-index:3; box-sizing:border-box; display:grid; grid-template-columns:1fr auto 1fr; justify-items:center; align-items:center; column-gap:4px; row-gap:2px; width:calc((100cqw - var(--board)) / 2 - 10px); max-width:calc((100cqw - var(--board)) / 2 - 10px); margin:0; padding:4px 4px 5px; overflow:hidden; text-align:center; background:rgba(8,18,48,.82); }
body.stream-chess[data-page="chess"] .ch-sidename .ch-portrait { grid-column:2; width:auto; flex-direction:column; }
body.stream-chess[data-page="chess"] .ch-sidename .ch-think { position:static; grid-column:3; justify-self:start; }
body.stream-chess[data-page="chess"] .ch-sidename.side-black { left:4px; right:auto; top:calc(50% - var(--board) / 2); bottom:auto; }
body.stream-chess[data-page="chess"] .ch-sidename.side-white { right:4px; left:auto; bottom:calc(50% - var(--board) / 2); top:auto; }
body.stream-chess[data-page="chess"] .ch-sidename .ch-face { width:min(64px, 100%); height:auto; aspect-ratio:72 / 80; }
body.stream-chess[data-page="chess"] .ch-sidename-copy { grid-column:1 / -1; width:100%; min-width:0; align-items:center; }
body.stream-chess[data-page="chess"] .ch-sidename-brand,
body.stream-chess[data-page="chess"] .ch-sidename-who { display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:center; }
body.stream-chess[data-page="chess"] .ch-sidename-brand { font-size:10px; line-height:1.15; }
body.stream-chess[data-page="chess"] .ch-sidename-who { font-size:12px; line-height:1.15; justify-content:center; }
body.full[data-page="chess"] .ch-pre { overflow:hidden; gap:4px; padding:8px; }
body.full[data-page="chess"] .ch-pre-kicker { font-size:15px; }
body.full[data-page="chess"] .ch-pre-count { font-size:36px; }
body.full[data-page="chess"] .ch-pre-head { width:96px; height:106px; }
body.full[data-page="chess"] .ch-pre-name { font-size:14px; }
body.full[data-page="chess"] .ch-pre-note { font-size:12px; }
body.full[data-page="chess"] .ch-pre-vs { font-size:22px; }
@keyframes ch-dots { 0%,80%,100% { opacity:.3; transform:translateY(0); } 40% { opacity:1; transform:translateY(-2px); } }
body.full[data-page="chess"] .ch-board-wrap { flex:1 1 auto; min-width:0; min-height:0; width:100%; max-width:none; margin:0; container-type:size; display:flex; align-items:center; justify-content:center; }
body.full[data-page="chess"] .ch-board { box-sizing:border-box; width:min(100cqw, 100cqh); height:min(100cqw, 100cqh); max-width:100%; max-height:100%; aspect-ratio:1 / 1; min-width:0; min-height:0; flex:0 0 auto; align-self:center; }
body.stream-chess[data-page="chess"] .ch-board { width:var(--board); height:var(--board); }
body.full[data-page="chess"] .ch-cap { flex:none; min-height:0; }
body.full[data-page="chess"] .ch-ctrl { flex:none; margin:0; }
body.full[data-page="chess"] .ch-stage { margin:0; padding:6px 8px; gap:3px; }
body.full[data-page="chess"] .ch-stage-total { font-size:16px; }
body.full[data-page="chess"] .ch-stage-clock,
body.full[data-page="chess"] .ch-stage-fav,
body.full[data-page="chess"] .ch-stage-side b,
body.full[data-page="chess"] .ch-stage-bettors { font-size:13px; }
body.full[data-page="chess"] .ch-stage.closed .ch-poolbar,
body.full[data-page="chess"] .ch-stage.closed .ch-stage-sides { display:none; }
body.full[data-page="chess"] .ch-wager { position:static; inset:auto; max-height:120px; overflow:auto; padding:6px 8px; gap:3px; border-width:1px; }
body.full[data-page="chess"] .ch-wager.closed { max-height:none; overflow:hidden; padding:4px 8px; }
body.full[data-page="chess"] .ch-wager-fav { font-size:14px; }
body.full[data-page="chess"] .ch-wager-line { display:flex; justify-content:space-between; gap:8px; align-items:baseline; font-size:13px; }
body.full[data-page="chess"] .ch-wager-bet,
body.full[data-page="chess"] .ch-wager-roll { font-size:12px; padding:2px 4px; }
body.full[data-page="chess"] .ch-howto { margin:0; padding:6px 8px; gap:2px; }
body.full[data-page="chess"] .ch-howto p { font-size:12px; }
body.full[data-page="chess"] .ch-banner { flex:none; margin:0 0 6px; padding:6px 8px; }
body.full[data-page="chess"] .ch-moves { height:108px; max-height:108px; flex:none; overflow:auto; margin:0 0 6px; }
body.full[data-page="chess"] .ch-moves-h { flex:none; }
body.full[data-page="chess"] .ch-talk-wrap { position:static; flex:1 1 auto; min-height:0; overflow:hidden; display:flex; flex-direction:column; }
body.full[data-page="chess"] .ch-feed { flex:1 1 auto; min-height:0; max-height:none; overflow:auto; }
body.full[data-page="chess"] .ch-chips { flex:none; max-height:28%; overflow:auto; }
body.score-clean .ch-roster,
body.score-clean .ch-ctrl,
body.score-clean .fx-clear,
body.score-clean .ch-slot,
body.score-clean .ch-chips { display:none !important; }
body.streamer .nav { height:36px; }
body.streamer .tabs,
body.streamer .cmdk,
body.streamer .menu-btn,
body.streamer .nav-right { display:none !important; }
body[data-page="chess"] .ch-stream-toggle { display:inline-flex; align-items:center; margin-left:auto; height:22px; padding:0 8px; border-radius:999px; border:1px solid rgba(253,230,138,.7); background:transparent; color:#FDE68A; font-size:11px; font-weight:700; cursor:pointer; }
.ch-stream-toggle { display:none; }
body.streamer .ch-stream-toggle { opacity:0; }
body.streamer .nav:hover .ch-stream-toggle,
body.streamer .ch-stream-toggle:focus-visible { opacity:1; }
.ch-bigbet { position:fixed; z-index:50; top:56px; right:10px; width:250px; padding:10px 12px; border-radius:12px; border:2px solid #FDE68A; background:rgba(8,18,48,.96); color:#fff; box-shadow:0 12px 28px rgba(0,0,0,.35); transform:translateX(120%); transition:transform .4s ease; pointer-events:none; }
.ch-bigbet.show { transform:translateX(0); }
body.score-clean .ch-bigbet { top:8px; }
body.streamer .ch-bigbet { top:44px; }
.ch-bigbet-k { font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:#FDE68A; font-weight:800; }
.ch-bigbet-who { font-size:18px; font-weight:800; line-height:1.15; }
.ch-bigbet-amt { font-size:14px; }
.ch-bigbet-fav { font-size:13px; color:#FDE68A; }
@media (prefers-reduced-motion: reduce) { .ch-bigbet { transition:none; } }
.mt-logview { position:fixed; inset:0; z-index:60; display:flex; align-items:flex-end; justify-content:center; background:rgba(6,16,48,.55); }
.mt-logbox { width:min(680px, 100%); max-height:min(78vh, 720px); display:flex; flex-direction:column; background:#0B1228; color:#E6EEFF; border-radius:14px 14px 0 0; padding:12px 14px 16px; box-shadow:0 -12px 40px rgba(0,0,0,.35); }
.mt-loghead { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.mt-loglines { overflow:auto; min-height:0; }
.mt-logday { margin:12px 0 4px; font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:#93C5FD; }
.mt-logline { font-family:var(--mono); font-size:12.5px; line-height:1.45; padding:2px 0; }
.mt-logline .ts { color:#94A3B8; }
.mt-logline .nick { color:#FDE68A; font-weight:700; }
.mt-logmedia { color:#93C5FD; }
@media (max-width: 900px) {
  body:not(.stream-chess)[data-page="chess"] { overflow-x:clip; }
  body:not(.stream-chess)[data-page="chess"] .nav { max-width:100%; min-width:0; overflow-x:auto; }
  body:not(.stream-chess)[data-page="chess"] .cmdk { display:none; }
  body:not(.stream-chess)[data-page="chess"] main { padding:8px 8px 28px; }
  body:not(.stream-chess) .ch-plain { grid-template-columns:minmax(0,1fr); gap:8px; padding:8px; overflow-x:clip; }
  body:not(.stream-chess) .ch-plain .ch-mid { order:1; padding:8px; gap:6px; }
  body:not(.stream-chess) .ch-plain .ch-left { order:2; display:grid; grid-template-columns:minmax(0,1fr); gap:8px; padding:8px; min-width:0; max-width:100%; }
  body:not(.stream-chess) .ch-plain .ch-mid,
  body:not(.stream-chess) .ch-plain .ch-right { min-width:0; max-width:100%; }
  body:not(.stream-chess) .ch-plain .ch-right { order:3; padding:8px; }
  body:not(.stream-chess) .ch-plain .ch-roster,
  body:not(.stream-chess) .ch-plain .ch-ctrl { grid-column:1 / -1; }
  body:not(.stream-chess) .ch-plain .ch-roster { display:flex; flex-wrap:nowrap; gap:6px; overflow-x:auto; overflow-y:hidden; width:100%; max-width:100%; min-width:0; grid-template-columns:none; -webkit-overflow-scrolling:touch; scrollbar-width:thin; }
  body:not(.stream-chess) .ch-plain .ch-roster > .mt-h { position:sticky; left:0; z-index:1; flex:0 0 auto; margin:0; background:#111827; }
  body:not(.stream-chess) .ch-plain .ch-roster .ch-chip { flex:0 0 auto; min-height:44px; max-width:none; }
  body:not(.stream-chess) .ch-plain .ch-roster .ch-chip-name { overflow:visible; text-overflow:clip; white-space:nowrap; }
  body:not(.stream-chess) .ch-plain .ch-board-wrap { max-width:none; width:100%; margin:0; }
  body:not(.stream-chess) .ch-plain .ch-board { width:100%; height:auto; aspect-ratio:1; }
  body:not(.stream-chess) .ch-plain .ch-pc { font-size:min(9vw, 44px); }
  body:not(.stream-chess) .ch-plain .ch-slot { min-height:48px; min-width:0; flex-wrap:wrap; gap:6px; }
  body:not(.stream-chess) .ch-plain .ch-side { width:auto; }
  body:not(.stream-chess) .ch-plain .ch-seated,
  body:not(.stream-chess) .ch-plain .ch-chip { min-width:0; }
  body:not(.stream-chess) .ch-plain .ch-chip-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body:not(.stream-chess) .ch-plain .ch-ctrl .btn,
  body:not(.stream-chess) .ch-plain .ch-bet-side,
  body:not(.stream-chess) .ch-plain .ch-x { min-height:44px; }
  body:not(.stream-chess) .ch-plain .ch-moves { max-height:160px; }
}
@media (max-width: 640px) {
  body:not(.stream-chess) .ch-plain .ch-left { grid-template-columns:minmax(0,1fr); }
}
@media (max-width: 760px) {
  body.full .meet { padding:6px; gap:6px; }
  body.full .mt-board { padding:6px; gap:6px; }
  body.full .mt-left { padding:6px; }
  body.full .mt-tools { flex-wrap:wrap; overflow:visible; gap:4px; padding:0; }
  body.full .mt-tools > * { flex:0 1 auto; }
  body.full .mt-tools .tool,
  body.full .mt-tools select { min-height:36px; height:36px; padding:0 8px; font-size:11px; }
  body.full .mt-chat { display:flex; flex-direction:column; height:auto; min-height:0; max-height:none; contain:none; overflow:visible; }
  body.full .mt-chat > .mt-h { order:0; flex:none; }
  body.full .mt-log { order:1; flex:none; height:320px; min-height:300px; max-height:350px; overflow-y:auto; padding:6px 8px; }
  body.full .mt-voice { order:2; position:static; flex:none; padding:6px 8px 0; }
  body.full .mt-compose { order:3; position:static; flex:none; padding:8px; gap:6px; }
  body.full .mt-media { padding:6px; gap:8px; }
  body.full .mt-yt { margin-bottom:4px; }
  body.full .mt-audio { max-height:120px; gap:4px; }
  body.full .mt-h { margin-bottom:4px; }
  body.full .mt-members { display:grid; grid-template-columns:1fr 1fr; gap:4px; overflow:visible; align-items:stretch; }
  body.full .mt-members .mt-h { grid-column:1 / -1; width:100%; margin:0 0 2px; }
  body.full .mt-member { display:grid; width:100%; min-height:0; flex:none; border-radius:6px; padding:3px 4px; font-size:11px; }
  body.full .mt-note { font-size:9.5px; line-height:1.2; }
  body.full .mt-member .mt-note { display:block; }
  body.full .fx-bar { padding:6px 8px; }
}
