/* Design tokens (from the smiles mockup). The app is dark only. */
:root {
  --bg: #15111b;
  --bg-deep: #0f0918;
  --accent: #7e83ff;
  --accent-soft: #8b87ff;
  --sheet: #b9a6f7;
  --on-sheet: #1a1030;
  --card: #180c2a;
  --card-hi: #221537;
  --art: #04000f;
  --text: #efeaff;
  --muted: #7c6aa8;
  --faint: #4a3b6b;
  --danger: #ff7a90;
  --ok: #7be0b0;
  --radius-sheet: 28px;
  --radius-card: 22px;
  --nav-h: 76px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  color-scheme: dark;
}

@font-face {
  font-family: "Wanted Sans";
  src: url("/static/fonts/ui.woff2?v=08b4335088d1") format("woff2");
  font-weight: 400 1000;
  font-display: swap;
}
/* The "Icons" font family is declared in icons.css (generated). */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  /* Color emoji fonts come before system-ui: some system fonts carry
     monochrome copies of common emoji that would otherwise win. */
  font-family: "Icons", "Wanted Sans", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* --- icons --- */
.ico { font-family: "Icons"; font-style: normal; line-height: 1; display: inline-block; }
.t .ico { color: var(--accent-soft); } /* icons inside user text get the accent */

/* --- logo --- */
.logo { width: 44px; height: 28px; color: var(--accent-soft); display: block; }
.logo.big { width: 96px; height: 62px; }

/* --- top bar --- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  height: 76px;
  display: grid; grid-template-columns: 48px 1fr 48px; align-items: center;
  padding: 0 20px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.topbar .center { justify-self: center; }
.topbar .right { justify-self: end; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--sheet); font-size: 22px;
}
.icon-btn:active { background: var(--card); }

/* --- sheet (the lavender panel that holds a feed) --- */
.sheet {
  margin: 8px 20px calc(var(--nav-h) + var(--safe-b) + 28px);
  background: var(--sheet);
  border-radius: var(--radius-sheet);
  padding: 0 16px 16px;
  flex: 1;
}
.sheet-head {
  height: 92px;
  display: grid; place-items: center;
  color: var(--on-sheet);
  font-size: 30px;
}
.sheet-head .label { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.sheet-note { color: var(--on-sheet); text-align: center; padding: 0 20px 20px; font-size: 14px; opacity: .75; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* --- post card --- */
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
  cursor: pointer;
}
.card:active { background: var(--card-hi); }
.card-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.card-head .name { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-head .inline-body { margin-left: auto; font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.card-body {
  font-size: 30px; line-height: 1.3;
  text-align: center;
  padding: 12px 0 16px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.card-body.long { font-size: 22px; text-align: left; }
.card-foot { display: flex; align-items: center; gap: 22px; color: var(--accent-soft); padding-top: 4px; }
.card-foot .handle { margin-left: auto; min-width: 0; color: var(--faint); font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot > :not(.handle) { flex: none; }
.card.deleted { opacity: .5; cursor: default; }
.replying { color: var(--muted); font-size: 13px; margin-top: -8px; }

.react {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 17px;
  color: var(--accent-soft);
  padding: 4px 6px; margin: -4px -6px; border-radius: 12px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.react:active { background: var(--card-hi); }
.react svg { width: 26px; height: 26px; }
.react .others { font-size: 15px; letter-spacing: -2px; }
.replies-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 17px; }
.replies-link .ico { font-size: 22px; }

/* --- avatars (drawn on canvas from 16x8 symbol art) --- */
.avatar {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  background: var(--art);
  overflow: hidden;
  display: grid; place-items: center;
  font-size: 20px;
}
.avatar canvas { width: 100%; height: 100%; display: block; }
.avatar.lg { width: 96px; height: 96px; font-size: 44px; }
.avatar.sm { width: 32px; height: 32px; font-size: 15px; }

/* --- symbol art --- */
.art {
  background: var(--art);
  border-radius: 16px;
  padding: 16px 14px;
  container-type: inline-size;
  overflow: hidden;
}
.art pre {
  margin: 0 auto;
  font-family: var(--mono);
  /* a monospace cell is ~0.6em wide; fit --w cells into the container */
  font-size: min(14px, calc(100cqw / (var(--w, 48) * 0.602)));
  line-height: 1.2; /* ~2:1 cells, matching the converter */
  letter-spacing: 0;
  white-space: pre;
  width: fit-content;
  color: #fff;
}

/* 4x4x4 palette: .cN where N = r*16 + g*4 + b, levels 00 55 aa ff */
.c0{color:#000000}.c1{color:#000055}.c2{color:#0000aa}.c3{color:#0000ff}.c4{color:#005500}.c5{color:#005555}.c6{color:#0055aa}.c7{color:#0055ff}.c8{color:#00aa00}.c9{color:#00aa55}.c10{color:#00aaaa}.c11{color:#00aaff}.c12{color:#00ff00}.c13{color:#00ff55}.c14{color:#00ffaa}.c15{color:#00ffff}
.c16{color:#550000}.c17{color:#550055}.c18{color:#5500aa}.c19{color:#5500ff}.c20{color:#555500}.c21{color:#555555}.c22{color:#5555aa}.c23{color:#5555ff}.c24{color:#55aa00}.c25{color:#55aa55}.c26{color:#55aaaa}.c27{color:#55aaff}.c28{color:#55ff00}.c29{color:#55ff55}.c30{color:#55ffaa}.c31{color:#55ffff}
.c32{color:#aa0000}.c33{color:#aa0055}.c34{color:#aa00aa}.c35{color:#aa00ff}.c36{color:#aa5500}.c37{color:#aa5555}.c38{color:#aa55aa}.c39{color:#aa55ff}.c40{color:#aaaa00}.c41{color:#aaaa55}.c42{color:#aaaaaa}.c43{color:#aaaaff}.c44{color:#aaff00}.c45{color:#aaff55}.c46{color:#aaffaa}.c47{color:#aaffff}
.c48{color:#ff0000}.c49{color:#ff0055}.c50{color:#ff00aa}.c51{color:#ff00ff}.c52{color:#ff5500}.c53{color:#ff5555}.c54{color:#ff55aa}.c55{color:#ff55ff}.c56{color:#ffaa00}.c57{color:#ffaa55}.c58{color:#ffaaaa}.c59{color:#ffaaff}.c60{color:#ffff00}.c61{color:#ffff55}.c62{color:#ffffaa}.c63{color:#ffffff}

/* --- bottom nav --- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: linear-gradient(transparent, var(--bg) 35%);
  display: flex; justify-content: space-evenly; align-items: center;
  max-width: 560px; margin: 0 auto; padding-left: 12px; padding-right: 12px;
}
.nav a {
  width: 48px; height: 48px; display: grid; place-items: center;
  font-size: 27px; color: var(--sheet); opacity: .5; border-radius: 16px;
}
.nav a.on { opacity: 1; }
.nav a .avatar { width: 30px; height: 30px; font-size: 15px; outline: 2px solid transparent; outline-offset: 2px; }
.nav a.on .avatar { outline-color: var(--sheet); }
/* Compose sits in the middle of the nav like the other tabs; the accent
   color alone marks it as the main action. */
.nav-compose {
  width: 48px; height: 48px; border-radius: 16px;
  color: var(--accent);
  display: grid; place-items: center; font-size: 28px;
}
.nav-compose:active { background: var(--card); }

/* --- buttons & fields --- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 56px; border-radius: 20px;
  font-size: 17px; font-weight: 650;
}
.btn.primary { background: var(--accent); color: var(--bg); }
.btn.secondary { background: var(--bg-deep); color: var(--accent-soft); }
.btn.small { width: auto; height: 38px; padding: 0 18px; border-radius: 14px; font-size: 15px; }
.btn.ghost { background: transparent; color: var(--accent-soft); }
.btn:disabled { opacity: .45; cursor: default; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; color: var(--muted); font-weight: 600; }
.input {
  height: 54px; border-radius: 16px; border: 1.5px solid var(--faint);
  background: var(--bg-deep); padding: 0 16px; font-size: 17px; width: 100%;
}
.input:focus { outline: none; border-color: var(--accent); }
.input-wrap { position: relative; }
.input-wrap .prefix { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-wrap .input { padding-left: 34px; }
.hint { font-size: 13px; color: var(--muted); min-height: 18px; }
.hint.bad { color: var(--danger); }
.hint.good { color: var(--ok); }
.symbol-field {
  min-height: 54px; border-radius: 16px; border: 1.5px solid var(--faint);
  background: var(--bg-deep); padding: 10px 16px; font-size: 24px; text-align: left;
  width: 100%;
}

/* --- welcome --- */
.welcome { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0 40px calc(48px + var(--safe-b)); }
.welcome .hero { flex: 1; display: grid; place-items: center; }
.welcome .actions { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.welcome .browse { margin-top: 8px; font-size: 14px; color: var(--muted); text-align: center; }
.panel { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.panel h2 { margin: 0; font-size: 22px; }
.panel p { margin: 0; color: var(--muted); }

/* --- pages --- */
.page { padding: 12px 24px calc(var(--nav-h) + var(--safe-b) + 36px); display: flex; flex-direction: column; gap: 28px; }
.page h1 { font-size: 22px; margin: 0; }
.page.tight { padding-bottom: 12px; }
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding-top: 8px; }
.profile-head .name { font-size: 30px; }
.profile-head .handle { color: var(--faint); font-size: 14px; font-weight: 600; }
.stats { display: flex; gap: 24px; color: var(--muted); font-size: 14px; }
.stats b { color: var(--text); font-weight: 700; }
.row-actions { display: flex; gap: 10px; justify-content: center; }
.user-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 16px; }
.user-row:active { background: var(--card); }
.user-row .who { display: flex; flex-direction: column; min-width: 0; }
.user-row .name { font-size: 18px; }
.user-row .handle { font-size: 13px; color: var(--muted); }
.empty { text-align: center; color: var(--on-sheet); opacity: .7; padding: 24px 16px 32px; font-size: 28px; }
.page .empty { color: var(--muted); }
.more { display: flex; justify-content: center; padding-top: 4px; }
.more .btn { color: var(--on-sheet); background: rgba(255,255,255,.25); }

/* --- composer --- */
.composer {
  position: fixed; inset: 0; z-index: 30;
  background: var(--bg);
  display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto;
}
.composer-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; gap: 8px; }
.composer-scroll { flex: 1; overflow-y: auto; padding: 8px 20px 16px; display: flex; flex-direction: column; gap: 16px; }
.editor {
  width: 100%; min-height: 120px; resize: none;
  background: transparent; border: 0; outline: none;
  font-size: 30px; line-height: 1.35; caret-color: var(--accent);
}
.editor.single { min-height: 0; height: 52px; font-size: 26px; border: 1.5px solid var(--faint); border-radius: 16px; padding: 8px 14px; background: var(--bg-deep); }
.editor::placeholder { color: var(--faint); }
.counter { font-size: 13px; color: var(--muted); text-align: right; }
.counter.over { color: var(--danger); }
.attach { position: relative; }
.attach .remove { position: absolute; top: 8px; right: 8px; }
.art-tools { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.art-tools input[type=range] { flex: 1; accent-color: var(--accent); }
.chip {
  height: 32px; padding: 0 12px; border-radius: 12px; background: var(--card);
  color: var(--accent-soft); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--accent); color: var(--bg); }
.reply-to { border-left: 3px solid var(--faint); padding-left: 12px; color: var(--muted); font-size: 20px; }

/* --- symbol keyboard --- */
.kb {
  background: var(--bg-deep);
  border-top-left-radius: 22px; border-top-right-radius: 22px;
  display: flex; flex-direction: column;
  height: min(46dvh, 380px);
  padding-bottom: var(--safe-b);
  user-select: none; -webkit-user-select: none;
}
.kb-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 8px 8px 4px; scrollbar-width: none; flex: none; }
.kb-tabs::-webkit-scrollbar { display: none; }
.kb-tab { flex: none; width: 40px; height: 36px; border-radius: 12px; font-size: 20px; display: grid; place-items: center; opacity: .6; }
.kb-tab.on { background: var(--card); opacity: 1; }
.kb-search { padding: 4px 10px; flex: none; }
.kb-search .input { height: 40px; font-size: 15px; border-radius: 12px; }
.kb-grid {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); align-content: start;
  padding: 4px 8px;
}
.key {
  height: 46px; border-radius: 12px; font-size: 26px; line-height: 1;
  display: grid; place-items: center; position: relative;
  -webkit-touch-callout: none;
}
.key:active { background: var(--card-hi); }
.key.skins::after { content: ""; position: absolute; right: 6px; bottom: 6px; border: 3px solid transparent; border-right-color: var(--muted); border-bottom-color: var(--muted); }
.kb-row { display: flex; gap: 8px; padding: 6px 8px 8px; flex: none; }
.kb-row .btn { height: 44px; border-radius: 14px; background: var(--card); color: var(--accent-soft); font-size: 20px; }
.kb-row .space { flex: 1; }
.kb-row .wide { width: 64px; flex: none; }
/* Typing mode: only the suggestions and the way back stay; the system
   keyboard takes the rest of the screen. */
.kb.typing { height: auto; }
.kb.typing > :is(.kb-tabs, .kb-search, .kb-grid), .kb.typing .kb-row > :not(.kb-type) { display: none; }
.kb.typing .kb-type { flex: 1; width: auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 600; }
.kb.typing .kb-type .ico { font-size: 20px; }
/* A physical keyboard can type words already. */
@media (hover: hover) and (pointer: fine) { .kb:not(.typing) .kb-type { display: none; } }
.kb-head { grid-column: 1 / -1; padding: 12px 6px 4px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.kb-more { grid-column: 1 / -1; height: 1px; }
.kb-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 24px; font-size: 14px; }
.skin-pop {
  position: fixed; z-index: 50; display: flex; gap: 2px; padding: 6px;
  background: var(--card-hi); border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.skin-pop .key { width: 46px; }

/* --- sheets over the page (reaction picker) --- */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(5,0,15,.55); display: flex; flex-direction: column; justify-content: flex-end; }
.overlay > .kb { max-width: 560px; width: 100%; margin: 0 auto; }

/* --- toast --- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 24px); z-index: 60;
  transform: translateX(-50%) translateY(10px);
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 14px; max-width: calc(100vw - 32px);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translateX(-50%); }

.spinner { display: grid; place-items: center; padding: 32px; font-size: 26px; color: var(--on-sheet); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .3 } to { opacity: .9 } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } #toast { transition: none; } }

/* --- rooms --- */
.room-chip {
  display: inline-flex; align-items: center; gap: 2px;
  height: 30px; padding: 0 10px; border-radius: 12px;
  background: var(--card-hi); font-size: 16px; letter-spacing: -1px; flex: none;
}
.room-chip.more { color: var(--accent-soft); letter-spacing: 0; }
.room-strip {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: -12px -16px 16px; padding: 0 16px;
}
.room-strip::-webkit-scrollbar { display: none; }
.room-strip .room-chip { background: var(--card); height: 36px; font-size: 18px; }
.segmented { display: flex; gap: 4px; background: var(--bg-deep); padding: 4px; border-radius: 16px; }
.segmented a, .segmented button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; border-radius: 12px; color: var(--muted); font-weight: 600; font-size: 15px;
}
.segmented a.on, .segmented button.on { background: var(--card); color: var(--text); }
.finder { display: flex; flex-direction: column; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips.center { justify-content: center; }
.chip .ico { font-size: 15px; }
.list { display: flex; flex-direction: column; gap: 4px; }
.list-title { font-size: 13px; font-weight: 700; color: var(--muted); padding: 8px 4px 4px; }
.room-row, .kw-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 12px; border-radius: 16px; min-width: 0;
}
.room-row:active, .kw-row:active { background: var(--card); }
.room-row .emblem, .kw-row .emblem { font-size: 26px; flex: none; min-width: 44px; text-align: center; letter-spacing: -2px; }
.room-row .who { display: flex; flex-direction: column; min-width: 0; }
.room-row .name, .kw-row .name { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw-row .name { flex: 1; }
.meta { font-size: 13px; color: var(--muted); }
.room-head { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.room-head .emblem { font-size: 56px; letter-spacing: -4px; line-height: 1.1; }
.room-head .room-name { color: var(--faint); font-size: 15px; font-weight: 600; }
.panel p { margin: 0; }
.request-row { padding: 12px; border-radius: 16px; background: var(--card); display: flex; flex-direction: column; gap: 4px; }
.request-row .note { font-size: 18px; }
.composer-top .title { font-weight: 700; margin-right: auto; margin-left: 8px; }
.composer.picker { z-index: 35; }

/* --- typed-word symbol suggestions --- */
.editor-foot { display: flex; align-items: center; gap: 12px; }
.editor-foot .counter { margin-left: auto; }
.typing-hint { font-size: 13px; color: var(--faint); }
.typing-hint .fine { display: none; }
/* A physical keyboard types words straight into the editor; touch devices use the ⌨ key. */
@media (hover: hover) and (pointer: fine) { .typing-hint .fine { display: inline; } .typing-hint .touch { display: none; } }

/* --- mentions --- */
.mention {
  display: inline-block; padding: 0 .28em; margin: 0 .08em; border-radius: .5em; line-height: 1.3;
  background: rgba(126, 131, 255, .16); box-shadow: inset 0 0 0 1px rgba(126, 131, 255, .38);
}
a.mention:active { background: rgba(126, 131, 255, .3); }
.mention.gone { opacity: .5; }
.chips.mentions { font-size: 18px; color: var(--muted); }

/* --- notifications --- */
.bell { position: relative; justify-self: end; }
.badge {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: var(--bg); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  font-family: "Wanted Sans", system-ui, sans-serif;
}
.notes { display: flex; flex-direction: column; gap: 10px; }
.note-row {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: start; text-align: left;
  padding: 16px; border-radius: var(--radius-card); background: var(--card); color: var(--text); width: 100%;
}
.note-row.unread .note-time::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.note-mark { font-size: 24px; color: var(--accent-soft); display: grid; place-items: center; min-height: 32px; }
.note-mark.symbols { font-size: 22px; letter-spacing: -.1em; word-break: break-all; line-height: 1.1; }
.note-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.faces { display: flex; }
.faces .avatar { box-shadow: 0 0 0 2px var(--card); }
.faces .avatar + .avatar { margin-left: -8px; }
.note-line { font-size: 15px; line-height: 1.5; }
.note-line .names { font-size: 18px; }
.note-line .verb, .more-people { color: var(--muted); }
.note-post { color: var(--muted); font-size: 18px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.note-time { font-size: 12px; color: var(--faint); white-space: nowrap; }

/* --- room dialect --- */
.room-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.captions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 4px 12px; }
.caption {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px;
  background: var(--bg-deep); color: var(--muted); font-size: 14px;
}
.caption .seq { font-size: 18px; }
.caption .q { color: var(--faint); font-size: 16px; }
.caption .eq, .caption .meaning { display: none; }
.caption.open { color: var(--text); }
.caption.open .eq { display: inline; color: var(--faint); }
.caption.open .meaning { display: inline; }
.caption.open .q { display: none; }
a.room-head { color: inherit; }
.dialect-title { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 20px; margin: 24px 0 8px; }
.dialect { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.word-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 18px; background: var(--card);
}
.word { font-size: 26px; white-space: nowrap; }
.word-meaning { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 16px; overflow-wrap: anywhere; }
.word-meaning .meta { font-size: 12px; color: var(--muted); }
.vote {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px;
  background: var(--bg-deep); color: var(--accent-soft); font-size: 14px; font-weight: 600;
}
.vote.on { background: var(--accent); color: var(--bg); }
.propose { max-width: none; margin-bottom: calc(var(--nav-h) + var(--safe-b) + 32px); }
.word-pick {
  height: 56px; border-radius: 16px; background: var(--card); font-size: 28px; color: var(--text);
  display: grid; place-items: center;
}
.word-pick .placeholder { font-size: 14px; color: var(--muted); }

/* --- suggestions popup under typed words --- */
.editor-wrap { position: relative; display: flex; flex-direction: column; }
.suggest-pop {
  position: absolute; z-index: 6; display: flex; align-items: center; gap: 4px;
  max-width: 100%; padding: 6px; border-radius: 18px;
  background: var(--card-hi); box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.pop-keys { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.pop-keys::-webkit-scrollbar { display: none; }
.pop-keys .key { flex: none; width: 44px; height: 44px; font-size: 24px; }
.pop-keys .key:first-child { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--accent); } /* Enter picks this one */
.pop-keys .key.cand { width: auto; padding: 0 12px; font-size: 22px; white-space: nowrap; }
.pop-empty { color: var(--muted); font-size: 13px; padding: 0 10px; white-space: nowrap; }
.pop-translate {
  flex: none; width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center;
  color: var(--accent-soft); font-size: 20px; background: var(--bg-deep);
}
.pop-translate.busy { opacity: .5; }

/* --- stickers --- */
.composer.top { z-index: 45; }
.sticker {
  margin: 4px 4px 14px; padding: 16px; border-radius: 20px; background: var(--bg-deep);
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.st-big { font-size: 44px; line-height: 1.1; }
.st-line { font-size: 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.st-g { white-space: nowrap; }
.st-meta { font-size: 15px; color: var(--muted); }
.st-option {
  position: relative; overflow: hidden; width: 100%; height: 48px; border-radius: 14px; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--card); color: var(--text); font-size: 24px;
}
.st-option::before {
  content: ""; position: absolute; inset: 0; width: calc(var(--share, 0) * 100%);
  background: rgba(126, 131, 255, .28); transition: width .3s;
}
.st-option.mine { box-shadow: inset 0 0 0 1.5px var(--accent); }
.st-option > * { position: relative; }
.st-pct { font-size: 15px; }
.st-range { width: 100%; accent-color: var(--accent); }
.st-track { position: relative; width: 100%; height: 44px; }
.st-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: linear-gradient(90deg, var(--faint), var(--accent)); }
.st-thumb { position: absolute; top: 50%; left: calc(var(--at, .5) * (100% - 40px)); transform: translateY(-50%); font-size: 36px; line-height: 1; }
.st-attach { position: relative; }
.st-station { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.line-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.5em; height: 1.5em; padding: 0 .12em;
  border-radius: 999px; box-shadow: inset 0 0 0 .14em var(--line, var(--muted)); font-size: .62em; line-height: 1;
}
.st-big .line-badge { font-size: 26px; }
.st-trains { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.st-train {
  display: grid; grid-template-columns: 1.6em 1.3em 4.6em 4.6em; align-items: center; justify-content: center;
  gap: 8px; font-size: 20px;
}
.st-train .line-badge { font-size: 16px; justify-self: center; }
.st-when { white-space: nowrap; text-align: left; }
.room-board {
  display: flex; gap: 10px; margin-top: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.room-board::-webkit-scrollbar { display: none; }
.room-board .sticker { margin: 0; flex: 1 0 min(240px, 78%); scroll-snap-align: center; }
.st-attach .sticker { margin: 0; }
.st-step { margin: 8px 0 0; font-size: 20px; }
.st-options { display: flex; flex-direction: column; gap: 10px; }
.st-edit { display: flex; align-items: center; gap: 8px; }
.st-edit .word-pick { flex: 1; }
.st-attach .remove { top: -10px; right: -10px; background: var(--card-hi); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.st-score { font-size: 30px; }
.st-game.st-on { box-shadow: inset 0 0 0 1.5px var(--danger); }
.st-bases { display: inline-grid; grid-template-columns: repeat(3, 12px); grid-template-rows: 10px 10px; font-size: 13px; line-height: 10px; color: var(--accent-soft); }
.st-bases .b2 { grid-column: 2; grid-row: 1; }
.st-bases .b3 { grid-column: 1; grid-row: 2; }
.st-bases .b1 { grid-column: 3; grid-row: 2; }
.st-outs { color: var(--danger); letter-spacing: 2px; font-size: 16px; }
