/* Theme: "auto" follows the device; Settings can pin light or dark (data-theme on <html>).
   The button color is the user's own and is set on --accent by app.js. */
:root {
  --bg: #f6f5f2; --panel: #ffffff; --side: #eeece6; --row: #f8f7f3; --fg: #1d1c1a; --muted: #6d6a62;
  --line: #dcd8ce; --accent: #2f5d50; --accent-fg: #ffffff; --err: #a33a2a; --think: #2e9e5b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161716; --panel: #1f2120; --side: #121312; --row: #1a1c1b; --fg: #e8e6e1; --muted: #9a978f;
    --line: #333735; --err: #e58a7a; --think: #3ddc84;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161716; --panel: #1f2120; --side: #121312; --row: #1a1c1b; --fg: #e8e6e1; --muted: #9a978f;
  --line: #333735; --err: #e58a7a; --think: #3ddc84;
  color-scheme: dark;
}
:root { --me: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
}
button, input, textarea { font: inherit; color: inherit; }
button {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px;
  padding: 8px 14px; cursor: pointer;
}
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button.link { border: 0; background: none; padding: 4px 6px; color: var(--muted); text-decoration: underline; }
button.icon { border: 0; background: none; font-size: 20px; padding: 4px 8px; }
button:disabled { opacity: .5; cursor: default; }
.wide { width: 100%; }
.muted { color: var(--muted); }
.err { color: var(--err); min-height: 1.4em; margin: 0; }
[hidden] { display: none !important; }

.login { min-height: 100%; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left)); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 24px; width: min(360px, 100%); display: flex; flex-direction: column; gap: 12px;
}
.card h1 { font-size: 20px; margin: 0; }
.card p { margin: 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
  background: var(--bg); font-size: 15px;
}
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; gap: 8px; justify-content: flex-end; }

.app { display: grid; grid-template-columns: var(--side-w, 260px) 1fr; height: 100%; position: relative; }
.side {
  background: var(--side); border-right: 1px solid var(--line); display: flex;
  flex-direction: column; gap: 12px; padding: 14px; min-height: 0;
}
.threads { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; padding: 2px; }
.thread {
  display: flex; align-items: center; border-radius: 8px;
  background: var(--row); border: 1px solid var(--line);
}
.thread:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.thread.on { background: var(--panel); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.thread .open {
  flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 8px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thread .del { border: 0; background: none; color: var(--muted); padding: 6px 8px; visibility: hidden; }
.thread:hover .del, .thread.on .del { visibility: visible; }
.thread .del.armed { color: var(--err); visibility: visible; }
.me { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 13px; white-space: nowrap; }
.me span { flex: 1 1 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 0 5px 2px; }
.me button.link { padding: 4px 5px; flex: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; position: relative; }
/* The top bar lines up with the sidebar: the same 14px from the top, and the title sits in a
   box the size and shape of the sidebar's buttons. In a room the room's tools share this line. */
.top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.top h2 {
  font-size: 15px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.55; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  max-width: min(320px, 40%); flex: none;
}
#side-toggle { display: none; }
/* One centered reading column, as in the Claude desktop app: the conversation, the room bar
   and the message box all keep to it, so two sides of a room stay close together. */
.main { --col: 760px; --gutter: max(16px, calc((100% - var(--col)) / 2)); }
.log { flex: 1; overflow-y: auto; padding: 24px var(--gutter); display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; max-width: 85%; background: var(--me); padding: 10px 16px; border-radius: 18px; }
.msg.assistant { align-self: flex-start; }
.msg.md { white-space: normal; }
.msg.md > :first-child { margin-top: 0; } .msg.md > :last-child { margin-bottom: 0; }
.msg.md p, .msg.md ul, .msg.md ol, .msg.md pre, .msg.md blockquote, .msg.md .table { margin: 0 0 .7em; }
.msg.md h3, .msg.md h4, .msg.md h5, .msg.md h6 { margin: 1em 0 .4em; line-height: 1.3; }
.msg.md h3 { font-size: 1.2em; } .msg.md h4 { font-size: 1.08em; } .msg.md h5, .msg.md h6 { font-size: 1em; }
.msg.md ul, .msg.md ol { padding-left: 1.4em; } .msg.md li + li { margin-top: .25em; }
.msg.md li > ul, .msg.md li > ol { margin: .25em 0 0; }
.msg.md code { font: .9em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--row); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; }
.msg.md pre { background: var(--row); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre; }
.msg.md pre code { background: none; border: 0; padding: 0; }
.msg.md blockquote { border-left: 3px solid var(--line); padding-left: 12px; color: var(--muted); }
.msg.md hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.msg.md a { color: var(--accent); }
.msg.md .table { overflow-x: auto; }
.msg.md table { border-collapse: collapse; font-size: .95em; }
.msg.md th, .msg.md td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; vertical-align: top; }
.msg.md th { background: var(--row); }
.msg.thinking { color: var(--think); }
.msg.thinking .body { display: inline; }   /* the dots stay on the same line as "is thinking" */
.msg.thinking::after { content: "..."; display: inline-block; width: 1.4em; text-align: left; animation: dots 1.2s steps(1) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) { .msg.thinking::after { animation: none; } }
/* Turns are numbered in order, like the GORIN log; notes (errors, "Stopped.") are not turns. */
.log { counter-reset: turn; }
.log .msg:not(.note) { counter-increment: turn; }
.log .msg:not(.note):not(.persona)::before { content: "#" counter(turn) attr(data-time); display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.log .msg.persona .who::after { content: attr(data-time); font-weight: 400; color: var(--muted); font-size: 11px; }
.log .msg.persona .who::before { content: "#" counter(turn) " · "; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.msg.user.host { align-self: center; max-width: 75%; }
.msg.persona.right { align-self: flex-end; border-radius: 18px 18px 6px 18px; }
.msg.note { align-self: center; color: var(--muted); font-size: 13px; }
.empty { margin: auto; color: var(--muted); }
/* Jump to the latest, as in GORIN: red with a count when replies arrive while you read above. */
.jump { position: absolute; right: max(16px, calc(var(--gutter) - 8px)); bottom: 110px; z-index: 3; display: inline-flex; align-items: center; gap: 4px;
  height: 36px; min-width: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); color: var(--fg);
  box-shadow: 0 2px 10px rgb(0 0 0 / .15); font-size: 14px; justify-content: center; }
.jump[hidden] { display: none; }
.jump.has-new { background: #e0404a; border-color: #e0404a; color: #fff; font-weight: 600; }
.me a.link { padding: 4px 5px; flex: none; color: var(--muted); text-decoration: underline; font-size: 13px; }
.compose { display: flex; gap: 8px; padding: 10px var(--gutter) 4px; align-items: flex-end; }
/* the + and Send buttons match the message box's one-line height and stay at its foot as it grows */
.compose { --control-h: 44px; position: relative; }
.mention-menu { position: absolute; left: var(--gutter); bottom: calc(100% + 4px); z-index: 20; min-width: 240px; max-width: min(420px, calc(100% - 2 * var(--gutter)));
  max-height: 260px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.mention-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.mention-row.on, .mention-row:hover { background: var(--row); }
.mention-row .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--who); flex: none; }
.mention-row .name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-row .handle { margin-left: auto; color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.compose textarea { flex: 1; resize: none; max-height: 40vh; min-width: 0; min-height: var(--control-h); }
.compose button { height: var(--control-h); flex: none; }
.hint { font-size: 12px; margin: 0; padding: 0 var(--gutter) max(10px, env(safe-area-inset-bottom)); }
.hint.compose-alert { color: var(--err); padding-bottom: 4px; }

.icon-btn { font-size: 20px; line-height: 1; padding: 0 14px; min-width: var(--control-h, 44px); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px var(--gutter) 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 13px;
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 4px 3px 10px;
}
.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chip.err { color: var(--err); border-color: var(--err); padding-right: 10px; }
.chip.wait { color: var(--muted); padding-right: 10px; }
.chip button { border: 0; background: none; padding: 0 6px; color: var(--muted); }
.msg .files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.msg .files span { font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; background: var(--panel); }
.main.drop .log { outline: 2px dashed var(--accent); outline-offset: -8px; }

.settings { width: min(400px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
/* a short window scrolls the dialog; its rows keep their height instead of being squeezed */
.settings > *, .settings .stack > * { flex-shrink: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.settings h2 { font-size: 14px; margin: 4px 0 0; }
.settings hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; border: 0; border-radius: 0; background: var(--bg); padding: 8px 6px; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%; padding: 0;
  border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line);
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--fg); }
.swatches input[type="color"] { width: 38px; height: 32px; padding: 2px; border-radius: 8px; cursor: pointer; }

.small { font-size: 12px; }
.pick { flex-direction: row; align-items: center; gap: 6px; margin-left: auto; white-space: nowrap; }
.pick select, .personas select { font: inherit; font-size: 13px; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; max-width: 40vw; }
.tag { margin-left: auto; font-size: 12px; border: 1px solid var(--accent); color: var(--fg); border-radius: 999px; padding: 2px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.thread .open small { color: var(--muted); margin-left: 6px; }
.personas { width: min(560px, 100%); }
.personas textarea { resize: vertical; min-height: 10em; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.plist { display: flex; flex-direction: column; gap: 8px; }
.prow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border: 1px solid var(--line); background: var(--row); border-radius: 8px; padding: 8px 10px; }
.prow .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .pname small { color: var(--muted); margin-left: 6px; }
.prow button { padding: 4px 10px; font-size: 13px; }
#ct-empty.armed { color: var(--err); border-color: var(--err); }
.prow button.armed { color: var(--err); border-color: var(--err); }
.personas h2 { font-size: 14px; margin: 6px 0 0; }
.equip-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.equip-add select { flex: 1; min-width: 0; }
label.check { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; }
label.check input { width: auto; }
.prow.equip { cursor: grab; }
.prow.equip.dragging { opacity: .5; }
.prow.equip.over { border-color: var(--accent); }
.prow.equip button { min-width: 32px; }
.trash .row { justify-content: flex-start; }
.new-row { display: flex; flex-wrap: wrap; gap: 8px; }
.new-row button { flex: 1 1 7em; }
.threads .group { margin: 6px 2px 0; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
/* one line: members, then the controls; it wraps only when the window is too narrow */
.top h2 .title-edit { font: inherit; border: 0; padding: 0; margin: 0; background: none; width: 16em; max-width: 100%; outline: none; }
.top h2:has(.title-edit) { border-color: var(--accent); }
.room-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; flex: 1 1 auto; min-width: 0; }
.members { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.member { display: inline-flex; align-items: center; border: 1px solid var(--line); border-left: 4px solid var(--who); border-radius: 999px; background: var(--row); overflow: hidden; }
.member button { border: 0; background: none; border-radius: 0; padding: 3px 8px; font-size: 13px; }
.member button + button { padding: 3px 6px; color: var(--muted); }
.msg .who .handle { font-weight: 400; color: var(--muted); }
.pick-name { font: inherit; font-size: 14px; flex: 0 1 12em; min-width: 0; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: inherit; }
.prow .pick-name + small { flex: 1; min-width: 0; color: var(--muted); }
.room-warm { flex: 1 1 100%; order: 10; margin: 0; font-size: 12.5px; color: var(--muted); }
.room-warm .wbit.reading { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.room-warm .wbit.ready { color: var(--muted); }
.warm { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.warm[data-state="reading"] { color: var(--fg); font-weight: 600; }
.warm[data-state="ready"]::before { content: "● "; color: #2e9e5b; }
.warm[data-state="failed"] { color: var(--err); }
.member-edit { font: inherit; font-size: 13px; border: 0; background: none; color: inherit; padding: 3px 8px; width: 9em; outline: none; }
.member:has(.member-edit) { border-color: var(--accent); }
.member button.armed { color: var(--err); }
.member.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.member.off { opacity: .55; }
.room-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; margin-left: auto; }
.room-controls select, .room-controls button, .room-controls input { height: 36px; }
.room-controls select { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; min-width: 0; max-width: 100%; }
.room-controls button { padding: 5px 12px; }
.room-controls .run { display: inline-flex; align-items: center; gap: 6px; }
.room-controls input { width: 4.5em; padding: 5px 6px; }
.msg.persona {
  max-width: 82%; padding: 10px 16px; border-radius: 18px 18px 18px 6px;
  background: color-mix(in srgb, var(--who) 9%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--who) 24%, var(--line));
}
.msg .who { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.msg.persona .who { color: var(--who); }
/* drag bars: a thin line that shows on hover, with a wider invisible handle */
.grip { position: absolute; top: 0; bottom: 0; width: 10px; cursor: col-resize; z-index: 4; touch-action: none; }
.grip::after { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .15s; }
.grip:hover::after, .grip:focus-visible::after, .grip.dragging::after { background: var(--accent); }
.grip:focus-visible { outline: none; }
#side-grip { left: calc(var(--side-w, 260px) - 5px); }
#col-grip { left: calc(50% + min(var(--col), 100% - 32px) / 2 - 5px); top: 76px; bottom: 90px; }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing .log { pointer-events: none; }
.ct-group { margin: 10px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.overlay { position: fixed; inset: 0; background: rgb(0 0 0 / .35); display: grid; place-items: center; padding: 16px; }

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 85vw); z-index: 5; transform: translateX(-100%); transition: transform .2s; }
  .app.side-open .side { transform: none; box-shadow: 0 0 40px rgb(0 0 0 / .3); }
  #side-toggle { display: inline-block; }
  .grip { display: none; }
}

.overlay > .card { position: relative; }
.overlay > .card h1 { padding-right: 28px; }
.dlg-x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.dlg-x:hover { background: var(--line); color: var(--fg, inherit); }

/* what a reply made: an effect to play again, or code to copy */
.made { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.made-fx { align-self: flex-start; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.made details { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--bg); }
.made summary { cursor: pointer; font-size: 13px; }
.made pre { max-height: 320px; overflow: auto; font-size: 12px; margin: 8px 0; white-space: pre; }
.fx-frame { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; z-index: 40; background: transparent; }
.fx-stop { position: fixed; z-index: 41; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); font-size: 12px; padding: 4px 12px; border-radius: 999px; }
/* a switch with a two-line description: the box and its name sit level with the first line */
#pe-plugins label.check, #pe-admin label.check, #pe-features label.check { align-items: baseline; }
#pe-plugins .nm, #pe-admin .nm, #pe-features .nm { white-space: nowrap; color: var(--fg); }
#pe-plugins .muted, #pe-admin .muted, #pe-features .muted { flex: 1; min-width: 0; }

/* the engine section of the persona editor */
.moves { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.move-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 40px auto 64px minmax(0, 1fr); gap: 6px; align-items: center; font-size: 13px; }
.move-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-row input[type=number], .move-row .when { padding: 4px 6px; font-size: 12px; }
.cs-head { justify-content: space-between; align-items: center; padding-right: 32px; }
.cs-lang button { white-space: nowrap; padding: 6px 12px; }
.cs-points { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

/* a sitting on the engine */
.end-btn { background: #c0392b; color: #fff; border-color: #c0392b; font-weight: 600; }
.care-card { margin: 8px auto 0; width: min(760px, calc(100% - 2 * var(--gutter, 16px))); border: 1px solid var(--err); border-radius: 10px; padding: 8px 12px; font-size: 13px; background: var(--panel); }
.care-card p { margin: 2px 0; }
.care-card .tel { font-weight: 600; white-space: nowrap; }
.qnr { width: min(640px, 100%); }
.q-item { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.q-item.q-miss { outline: 2px solid var(--err); outline-offset: 4px; border-radius: 6px; }
.q-q { font-weight: 600; font-size: 14px; }
.q-sub { font-size: 13px; color: var(--muted); }
.q-scale { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.q-dot { flex-direction: row; align-items: center; gap: 4px; font-size: 13px; color: var(--fg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.q-dot input { width: auto; margin: 0; }
.q-end { font-size: 12px; color: var(--muted); }
.q-branch { display: flex; flex-direction: column; gap: 6px; padding-left: 10px; border-left: 2px solid var(--line); }
.q-text { width: 100%; }
.q-late, .q-consent { font-size: 13px; }
.qnr textarea.q-text { min-height: 0; height: auto; resize: vertical; }
.q-intro { font-size: 13px; margin: 0; }
.care-card a { color: var(--accent); }
.room-notice { align-self: center; margin: 6px auto; font-size: 12px; color: var(--muted); text-align: center; }
.msg .who.mentionable { cursor: pointer; }
.msg .who.mentionable:hover { text-decoration: underline; }

/* flip cards: the other language on the back of each message */
.msg { transition: transform .17s ease-in; transform-origin: center; }
.msg.flipping { transform: rotateX(90deg); }
.flip-btn { display: block; margin-top: 4px; padding: 0 2px; border: 0; background: none; color: var(--muted); font-size: 11px; cursor: pointer; opacity: .65; }
.msg .flip-btn { min-width: 0; height: auto; }
.msg:hover .flip-btn, .flip-btn:focus-visible { opacity: 1; }
.msg.user .flip-btn { margin-left: auto; }
.new-chat-pick { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.new-chat-pick p { margin: 0; }
.new-chat-pick label { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--fg); }
.new-chat-pick select { font: inherit; font-size: 14px; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 220px; max-width: 80vw; }

/* request access, and what tier 1 does not have */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.login { flex-direction: column; }
body.tier1 #new-chat, body.tier1 #new-room, body.tier1 #personas-open, body.tier1 #attach,
body.tier1 #persona-pick, body.tier1 .pick { display: none !important; }
.lib-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.prow .pname.acct { white-space: normal; }

/* public rooms */
#room-bar.pub-mode .room-controls > :not(.pub-only) { display: none; }
#room-bar:not(.pub-mode) .pub-only { display: none; }
#pub-controls { display: inline-flex; gap: 6px; align-items: center; }
#pub-controls select { font: inherit; font-size: 13px; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.pub-switch { flex-direction: row; align-items: center; gap: 4px; font-size: 13px; color: var(--fg); }
.msg.user.other { background: var(--row); }
.msg.user.other .who { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.side-note { padding: 0 12px; }
.pnote { flex: 1 1 140px; min-width: 0; padding: 4px 8px; font-size: 12px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; }
.watch-bar { display: flex; align-items: center; gap: 12px; padding: 8px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: var(--panel); }
.watch-bar #watch-title { font-weight: 600; flex: 1; min-width: 0; }
body.watching #side, body.watching #side-grip, body.watching #compose, body.watching .hint, body.watching #side-toggle { display: none !important; }
body.watching .app { grid-template-columns: 1fr !important; }
body.watching .main { grid-column: 1 / -1; }
body.watching .flip-btn, body.watching #title { display: none !important; }
