/* =====================================================================
   Käbbel — "café" design system
   Warm surfaces on a table-coloured backdrop, pill controls, pebble
   avatars, turn cards, and a round table for voice.
   ===================================================================== */

@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("../fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("../fonts/inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------------------------------------------------------------- tokens */

:root {
    --font: "Inter", "Apple Color Emoji", "Segoe UI Emoji", "Kabbel Emoji", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    /* the same monospace stack as the desktop client and the first web client */
    --mono: Consolas, "Cascadia Mono", "JetBrains Mono", "DejaVu Sans Mono", Menlo, "Noto Sans Mono", monospace, "Kabbel Emoji";
    --display: var(--mono);
    --display-track: -.01em;
    --chat-font: 15px;
    --group-gap: 8px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);

    --accent: #e8793f;

    /* Espresso (dark, default) */
    --bg-0: #120e0b;
    --bg-1: #1a1511;
    --bg-2: #1f1915;
    --card: #29221c;
    --surface: #312821;
    --surface-2: #3a3027;
    --bg-float: #2a231d;
    --mine: color-mix(in oklab, var(--accent) 17%, #29221c);
    --mine-line: color-mix(in oklab, var(--accent) 32%, transparent);
    --hover: rgba(255, 228, 196, .055);
    --line-hover: rgba(255, 228, 196, .045);
    --line: rgba(255, 228, 196, .08);
    --line-2: rgba(255, 228, 196, .13);
    --line-3: rgba(255, 228, 196, .21);
    --text-1: #f7eee3;
    --text-msg: #ebdfd1;
    --text-2: #c8b8a6;
    --text-3: #958573;
    --text-4: #6b5d50;
    --sage: #9cba6b;
    --amber: #f0b44e;
    --plum: #cf6da8;
    --sky: #7fb2d9;
    --danger: #ec5e4f;
    --online: var(--sage);
    --idle: var(--amber);
    --dnd: var(--plum);
    --offline: #6f6357;
    --link: #f0a774;
    --sticker: #f6ecdc;
    --sticker-ink: #2b2119;
    --wood-a: #7a5536;
    --wood-b: #4b3221;
    --wood-rim: #2d1e14;
    --code-bg: #17120e;
    --tip-bg: #0a0806;
    --scrim: rgba(10, 7, 5, .62);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-2: 0 10px 28px rgba(0, 0, 0, .34), 0 2px 6px rgba(0, 0, 0, .24);
    --shadow-3: 0 26px 70px rgba(0, 0, 0, .55), 0 6px 18px rgba(0, 0, 0, .3);
    --ring: var(--bg-2);
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .8 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

    --accent-soft: color-mix(in oklab, var(--accent) 16%, transparent);
    --accent-soft-2: color-mix(in oklab, var(--accent) 30%, transparent);
    --accent-strong: color-mix(in oklab, var(--accent) 84%, black);
    --accent-text: color-mix(in oklab, var(--accent) 70%, white);
    --sage-soft: color-mix(in oklab, var(--sage) 18%, transparent);
    --danger-soft: color-mix(in oklab, var(--danger) 16%, transparent);
    --on-accent: #fff;
    color-scheme: dark;
}

[data-accent="blue"] { --accent: #58a6ff; --on-accent: #05101d; }
[data-accent="desert"] { --accent: #e18245; --on-accent: #1d1b16; }
[data-accent="sage"] { --accent: #7fa352; }
[data-accent="plum"] { --accent: #b5609a; }
[data-accent="sky"] { --accent: #4f93c4; }
[data-accent="honey"] { --accent: #d99a2b; }
[data-accent="berry"] { --accent: #d4566e; }

/* Classic: the desktop client's colours (UITheme) — blue-black, flat, thin outlines */
[data-theme="classic"] {
    --bg-0: #07090c;
    --bg-1: #0b0e12;
    --bg-2: #0f1217;
    --card: #141922;
    --surface: #19202b;
    --surface-2: #212a37;
    --bg-float: #121720;
    --mine: color-mix(in oklab, var(--accent) 14%, #141922);
    --mine-line: color-mix(in oklab, var(--accent) 30%, transparent);
    --hover: rgba(150, 185, 235, .055);
    --line-hover: rgba(150, 185, 235, .04);
    --line: rgba(150, 185, 235, .085);
    --line-2: rgba(150, 185, 235, .14);
    --line-3: rgba(150, 185, 235, .22);
    --text-1: #e9edf2;
    --text-msg: #dde3ea;
    --text-2: #aeb7c4;
    --text-3: #7b8594;
    --text-4: #545e6c;
    --sage: #43b081;
    --amber: #dfb159;
    --danger: #db5e56;
    --offline: #5b6472;
    --link: #8ec5bc;
    --sticker: #e4ebf4;
    --sticker-ink: #0b1320;
    --code-bg: #05070a;
    --tip-bg: #030405;
    --scrim: rgba(0, 0, 0, .6);
    --grain: none;
}

/* Desert Night: the kitty terminal scheme on this machine (DesertNight by sainnhe), with its mono font */
[data-theme="desert"] {
    --mono: "Adwaita Mono", Consolas, "Cascadia Mono", "JetBrains Mono", "DejaVu Sans Mono", Menlo, "Noto Sans Mono", monospace, "Kabbel Emoji";
    --bg-0: #1d1b16;
    --bg-1: #211f19;
    --bg-2: #24221c;
    --card: #2b2922;
    --surface: #353227;
    --surface-2: #3f3b2e;
    --bg-float: #2b2922;
    --mine: color-mix(in oklab, var(--accent) 16%, #2b2922);
    --mine-line: color-mix(in oklab, var(--accent) 32%, transparent);
    --hover: rgba(212, 176, 123, .06);
    --line-hover: rgba(212, 176, 123, .045);
    --line: rgba(212, 176, 123, .1);
    --line-2: rgba(212, 176, 123, .16);
    --line-3: rgba(212, 176, 123, .26);
    --text-1: #ecd8b4;
    --text-msg: #d4b07b;
    --text-2: #b99a6c;
    --text-3: #87765d;
    --text-4: #5f5444;
    --sage: #99b05f;
    --amber: #e5a440;
    --plum: #d261a5;
    --sky: #949fb4;
    --danger: #e56b55;
    --offline: #6b5f4c;
    --link: #bfab36;
    --sticker: #ecd8b4;
    --sticker-ink: #24221c;
    --code-bg: #1d1b16;
    --tip-bg: #14130f;
    --scrim: rgba(10, 9, 6, .62);
    --grain: none;
}

[data-theme="midnight"] {
    --bg-0: #050403;
    --bg-1: #0b0907;
    --bg-2: #0e0b09;
    --card: #17130f;
    --surface: #1f1914;
    --surface-2: #29211a;
    --bg-float: #1a1511;
    --mine: color-mix(in oklab, var(--accent) 14%, #17130f);
    --code-bg: #0a0806;
}

[data-theme="light"] {
    --bg-0: #e7ddd0;
    --bg-1: #f3ece3;
    --bg-2: #faf6f0;
    --card: #fffdf9;
    --surface: #f1e9de;
    --surface-2: #e8ddcf;
    --bg-float: #fffdf9;
    --mine: color-mix(in oklab, var(--accent) 13%, #fffdf9);
    --mine-line: color-mix(in oklab, var(--accent) 30%, transparent);
    --hover: rgba(70, 45, 20, .055);
    --line-hover: rgba(70, 45, 20, .045);
    --line: rgba(70, 45, 20, .1);
    --line-2: rgba(70, 45, 20, .15);
    --line-3: rgba(70, 45, 20, .24);
    --text-1: #2a1f16;
    --text-msg: #3a2c20;
    --text-2: #5f4d3d;
    --text-3: #8a7765;
    --text-4: #b4a491;
    --sage: #6d8f3e;
    --amber: #c9861d;
    --plum: #a84d86;
    --danger: #c9473a;
    --offline: #a99a89;
    --link: #b8561f;
    --sticker: #ffffff;
    --wood-a: #d3a77b;
    --wood-b: #b0835b;
    --wood-rim: #8a6243;
    --code-bg: #f4ede4;
    --tip-bg: #2a1f16;
    --scrim: rgba(50, 35, 20, .38);
    --shadow-2: 0 10px 28px rgba(70, 45, 20, .12), 0 2px 6px rgba(70, 45, 20, .08);
    --shadow-3: 0 26px 70px rgba(70, 45, 20, .2), 0 6px 18px rgba(70, 45, 20, .1);
    --accent-text: color-mix(in oklab, var(--accent) 78%, black);
    --grain: none;
    color-scheme: light;
}

/* ---------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-1);
    background: var(--bg-0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv11", "ss01";
    overflow: hidden;
}
#root { height: 100dvh; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
img { display: block; }
kbd {
    font-family: var(--font); font-size: 11px; font-weight: 650; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px;
    display: inline-grid; place-items: center; color: var(--text-2); background: var(--surface); border: 1px solid var(--line-2);
}
mark { background: color-mix(in oklab, var(--amber) 40%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }
::selection { background: color-mix(in oklab, var(--accent) 35%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico { flex: none; display: block; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---------------------------------------------------------------- primitives */

.pill {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 18px;
    border-radius: 999px; font-weight: 650; font-size: 14px; white-space: nowrap; user-select: none; position: relative;
    background: var(--surface); color: var(--text-1); border: 1px solid transparent;
    transition: background .15s, color .15s, border-color .15s, transform .12s var(--spring), opacity .15s;
}
.pill:hover:not(:disabled) { background: var(--surface-2); }
.pill:active:not(:disabled) { transform: scale(.97); }
.pill:disabled { opacity: .5; }
.pill-accent { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px -8px var(--accent); }
.pill-accent:hover:not(:disabled) { background: var(--accent-strong); }
.pill-ghost { background: transparent; border-color: var(--line-2); color: var(--text-2); }
.pill-ghost:hover:not(:disabled) { background: var(--hover); color: var(--text-1); border-color: var(--line-3); }
.pill-sage { background: color-mix(in oklab, var(--sage) 85%, black); color: #fff; }
.pill-sage:hover:not(:disabled) { background: color-mix(in oklab, var(--sage) 72%, black); }
.pill-danger { background: var(--danger); color: #fff; }
.pill-danger:hover:not(:disabled) { background: color-mix(in oklab, var(--danger) 85%, black); }
.pill-danger-ghost { background: transparent; color: var(--danger); border-color: color-mix(in oklab, var(--danger) 45%, transparent); }
.pill-danger-ghost:hover:not(:disabled) { background: var(--danger); color: #fff; }
.pill-sm { height: 32px; padding: 0 13px; font-size: 13px; gap: 6px; }
.pill-xs { height: 26px; padding: 0 10px; font-size: 12px; gap: 5px; }
.pill-lg { height: 48px; padding: 0 24px; font-size: 15px; }
.pill-block { width: 100%; }
.pill .spinner { display: none; }
.pill.loading .btn-label { opacity: 0; }
.pill.loading .spinner { display: block; position: absolute; }
.pill.done { background: var(--sage); color: #fff; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

.round-btn {
    position: relative; width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center; border-radius: 50%;
    color: var(--text-2); transition: background .15s, color .15s, transform .12s var(--spring);
}
.round-btn:hover:not(:disabled), .round-btn.popped { background: var(--hover); color: var(--text-1); }
.round-btn:active:not(:disabled) { transform: scale(.92); }
.round-btn.on { background: var(--surface); color: var(--text-1); }
.round-btn.sm { width: 32px; height: 32px; }
.round-btn.xs { width: 24px; height: 24px; }
.round-btn.accent { background: var(--accent); color: var(--on-accent); }
.round-btn:disabled { opacity: .35; }
.link-btn { color: var(--link); font-weight: 600; }
.link-btn:hover:not(:disabled) { text-decoration: underline; }
.link-btn:disabled { color: var(--text-3); }
.push-left { margin-right: auto; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.tag { display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 750; letter-spacing: .02em; text-transform: lowercase; vertical-align: 1px; }
.tag-bot { background: var(--accent); color: var(--on-accent); }
.tag-owner { background: color-mix(in oklab, var(--amber) 20%, transparent); color: var(--amber); }
.tag-mod { background: color-mix(in oklab, var(--sky) 20%, transparent); color: var(--sky); }
.tag-plain { background: var(--surface); color: var(--text-2); margin-left: 8px; }

.input {
    width: 100%; height: 44px; padding: 0 14px; background: var(--bg-1); border: 1.5px solid var(--line-2); border-radius: 14px;
    color: var(--text-1); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 11px 14px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; padding-right: 38px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23958573' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input::placeholder, .composer-input::placeholder { color: var(--text-4); }
.input:hover { border-color: var(--line-3); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.input.mono { font-family: var(--mono); font-size: 13.5px; }
.input-search { height: 38px; border-radius: 999px; padding: 0 16px; }
.input-search::-webkit-search-cancel-button { filter: grayscale(1); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-prefix { position: absolute; left: 14px; display: grid; }
.input.with-prefix { padding-left: 38px; }
.field { display: grid; gap: 7px; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.field-count { margin-left: auto; font-weight: 500; color: var(--text-4); font-variant-numeric: tabular-nums; }
.field-error { color: var(--danger); font-size: 13px; }
.field-error:empty { display: none; }
.field-hint { font-size: 12.5px; color: var(--text-3); margin-top: -6px; }
.field-hint.ok { color: var(--sage); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field > .pill, .field > .btn-row { justify-self: start; }
.fine { font-size: 12.5px; color: var(--text-3); }
.muted { color: var(--text-3); }

.switch-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; cursor: pointer; position: relative; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.sr-text { flex: 1; display: grid; gap: 2px; }
.sr-text strong { font-weight: 650; font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.sr-text span { font-size: 13px; color: var(--text-3); }
.toggle-input { position: absolute; opacity: 0; pointer-events: none; }
.toggle { flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--surface-2); position: relative; transition: background .2s; }
.toggle::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-1); transition: transform .25s var(--spring), background .2s; }
.toggle-input:checked + .toggle { background: var(--accent); }
.toggle-input:checked + .toggle::after { transform: translateX(18px); background: #fff; }
.toggle-input:focus-visible + .toggle { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); cursor: pointer; position: relative; }
.check-input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { width: 22px; height: 22px; border-radius: 8px; border: 1.5px solid var(--line-3); display: grid; place-items: center; color: transparent; flex: none; transition: background .15s, border-color .15s; }
.check-input:checked + .check-box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.check-input:focus-visible + .check-box { outline: 2px solid var(--accent); outline-offset: 2px; }

.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 999px; background: linear-gradient(to right, var(--accent) 0 var(--fill, 50%), var(--surface-2) var(--fill, 50%)); outline: none; cursor: pointer; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--text-1); border: 4px solid var(--accent); box-shadow: var(--shadow-1); transition: transform .15s var(--spring); }
.slider::-webkit-slider-thumb:hover { transform: scale(1.12); }
.slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--text-1); border: 4px solid var(--accent); }
.slider-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; }
.range-val { margin-left: auto; font-size: 13px; font-weight: 650; color: var(--text-2); min-width: 54px; text-align: right; font-variant-numeric: tabular-nums; }
.slider-marks { grid-column: 1; display: flex; justify-content: space-between; font-size: 11px; color: var(--text-4); margin-top: -6px; }

.seg-tabs { display: flex; gap: 3px; padding: 3px; border-radius: 999px; background: var(--bg-1); border: 1px solid var(--line); }
.seg-tabs.wide { width: 100%; }
.seg-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; font-weight: 650; font-size: 13px; color: var(--text-3); white-space: nowrap; transition: background .15s, color .15s; }
.seg-tab:hover { color: var(--text-1); }
.seg-tab.on { background: var(--card); color: var(--text-1); box-shadow: var(--shadow-1); }
.seg-tabs.small .seg-tab { height: 28px; font-size: 12.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--card); color: var(--text-2); font-weight: 650; font-size: 13px; border: 1px solid var(--line); flex: none; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.chip:hover { color: var(--text-1); border-color: var(--line-3); }
.chip.active { background: var(--text-1); color: var(--bg-2); border-color: transparent; }
.chip.static { height: 26px; padding: 0 10px; font-size: 12px; cursor: default; }
.chips.small .chip { height: 30px; padding: 0 12px; }
.chip-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; display: inline-grid; place-items: center; }
.role-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 600; color: var(--text-2); }
.role-chip i { width: 9px; height: 9px; border-radius: 3px; transform: rotate(45deg); }
.verified { color: var(--accent); display: inline-grid; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); flex: none; display: inline-block; box-shadow: 0 0 0 0 var(--sage); animation: livePulse 2.2s infinite; }
.mini-stack { display: inline-flex; padding-left: 6px; }
.mini-stack > * { margin-left: -6px; box-shadow: 0 0 0 2px var(--ring); }
.mini-stack .guild-icon { box-shadow: 0 0 0 2px var(--ring); }

.status-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; transform: rotate(45deg); background: var(--offline); flex: none; }
.status-swatch.online { background: var(--online); }
.status-swatch.idle { background: var(--idle); }
.status-swatch.dnd { background: var(--dnd); }
.status-swatch.invisible { background: transparent; box-shadow: inset 0 0 0 2px var(--offline); }

.empty-state { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 48px 24px; color: var(--text-3); max-width: 420px; margin: auto; }
.empty-state h3 { color: var(--text-1); font-family: var(--display); font-size: 20px; font-weight: 700; margin-top: 10px; }
.es-art { display: grid; place-items: center; }
.es-icon { width: 72px; height: 72px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 42% 58% 55% 45% / 48% 45% 55% 52%; animation: blob 8s ease-in-out infinite; }
.empty-mini { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 28px 12px; color: var(--text-3); font-size: 13.5px; }
.empty-mini.big { padding: 36px 12px; }
.empty-mini strong { color: var(--text-1); font-size: 15px; }
.empty-art { width: 56px; height: 56px; display: grid; place-items: center; background: var(--surface); color: var(--text-3); border-radius: 42% 58% 55% 45% / 48% 45% 55% 52%; }
.tile-empty { color: var(--text-3); font-size: 13.5px; padding: 6px 2px; }
.warn-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: color-mix(in oklab, var(--amber) 13%, transparent); color: var(--text-1); font-size: 14px; }
.warn-box .ico { color: var(--amber); margin-top: 1px; }
.modal-text { font-size: 15px; color: var(--text-2); line-height: 1.55; }
.modal-text strong { color: var(--text-1); }
.topic-body { font-size: 15px; line-height: 1.6; color: var(--text-msg); }

/* pebble avatars */
.avatar {
    --av: 40px;
    position: relative; width: var(--av); height: var(--av); flex: none; display: inline-grid; place-items: center;
    border-radius: var(--shape, 50%);
    background: linear-gradient(145deg, var(--av-a), var(--av-b));
    color: #fff; font-weight: 700; font-size: calc(var(--av) * .36); user-select: none;
    transition: box-shadow .2s var(--ease), border-radius .4s var(--ease), transform .2s var(--spring);
}
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar.emoji { background: color-mix(in oklab, var(--av-a) 28%, var(--surface)); }
.avatar-emoji { font-size: calc(var(--av) * .56); line-height: 1; }
.avatar-initials { letter-spacing: -.02em; text-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.avatar[data-status="online"] { box-shadow: 0 0 0 2px var(--ring), 0 0 0 4px var(--online); }
.avatar[data-status="idle"] { box-shadow: 0 0 0 2px var(--ring), 0 0 0 4px var(--idle); }
.avatar[data-status="dnd"] { box-shadow: 0 0 0 2px var(--ring), 0 0 0 4px var(--dnd); }
.avatar[data-status="offline"] { filter: saturate(.35) brightness(.85); }
.avatar[data-status="invisible"] { outline: 2px dashed var(--offline); outline-offset: 2px; }
.avatar.speaking, .speaking > .avatar, .chair.speaking .avatar { box-shadow: 0 0 0 2px var(--ring), 0 0 0 4px var(--sage); }
.avatar.speaking::after, .speaking > .avatar::after, .chair.speaking .avatar::after {
    content: ""; position: absolute; inset: -4px; border-radius: inherit; border: 2px solid var(--sage); animation: ripple 1.3s var(--ease-out) infinite; pointer-events: none;
}
.avatar.muted { opacity: .7; }

.guild-icon {
    --gi: 44px; position: relative; width: var(--gi); height: var(--gi); flex: none; border-radius: 50%; display: grid; place-items: center;
    background: radial-gradient(circle at 30% 25%, var(--gi-a), var(--gi-b)); color: #fff; font-weight: 750; font-size: calc(var(--gi) * .36); overflow: hidden; user-select: none;
}
.guild-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gi-emoji { font-size: calc(var(--gi) * .52); line-height: 1; }
.swatch-chan { width: var(--sw); height: var(--sw); flex: none; border-radius: 30%; background: hsl(var(--hue) 58% 60%); box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .14); }
.swatch-chan.k-announce { border-radius: 2px; transform: rotate(45deg) scale(.85); }
.swatch-chan.k-hybrid { background: linear-gradient(135deg, hsl(var(--hue) 58% 60%) 50%, var(--sage) 50%); }
.swatch-chan.k-voice { border-radius: 50%; }
[data-theme="light"] .swatch-chan { background: hsl(var(--hue) 55% 52%); }
[data-theme="light"] .swatch-chan.k-hybrid { background: linear-gradient(135deg, hsl(var(--hue) 55% 52%) 50%, var(--sage) 50%); }
.logo-mark { display: inline-grid; place-items: center; flex: none; }
.logo-mark svg { display: block; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: var(--display-track); }

/* ---------------------------------------------------------------- app layout: panels on a table */

.app {
    display: grid;
    grid-template-rows: 52px minmax(0, 1fr);
    grid-template-columns: 264px minmax(0, 1fr);
    gap: 0 8px;
    padding: 0 8px 8px;
    height: 100dvh;
    background: var(--grain), var(--bg-0);
    animation: appIn .5s var(--ease-out);
}
.main-wrap { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.main { flex: 1; min-height: 0; display: flex; flex-direction: column; --ring: var(--bg-2); }

/* top bar */
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 2px; overflow: hidden; --ring: var(--bg-0); }
.tb-logo { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 10px 0 6px; border-radius: 999px; flex: none; transition: background .15s; }
.tb-logo:hover { background: var(--hover); }
.tb-word { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: var(--display-track); }
.deck { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; padding: 6px 6px 8px; -webkit-mask-image: linear-gradient(to right, transparent, #000 10px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 10px, #000 calc(100% - 28px), transparent); }
.deck::-webkit-scrollbar { display: none; }
.deck-sep { width: 1px; height: 18px; background: var(--line-2); flex: none; margin: 0 6px; }
.tab-g {
    position: relative; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px 0 7px; border-radius: 999px; flex: none;
    color: var(--text-2); font-weight: 650; font-size: 13px; white-space: nowrap; border: 1px solid transparent;
    transition: background .15s, color .15s, border-color .15s, box-shadow .2s, transform .15s var(--spring);
}
.tab-g:hover { background: var(--hover); color: var(--text-1); }
.tab-g.active { background: var(--card); color: var(--text-1); border-color: var(--line-2); box-shadow: var(--shadow-1); }
.tab-g.active::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 18px; height: 4px; margin-left: -9px; border-radius: 4px; background: var(--accent); }
.tab-g.unread:not(.active) { color: var(--text-1); }
.tab-g.muted { opacity: .55; }
.tab-g .guild-icon { box-shadow: 0 0 0 2px var(--line); }
.tg-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.tg-icon.home { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tg-count { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; animation: badgeIn .3s var(--spring); }
.tg-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.tg-live { color: var(--sage); display: inline-grid; }
.tg-fav { color: var(--amber); display: inline-grid; margin-left: -3px; }
.tab-ghost { color: var(--text-3); padding: 0 11px 0 9px; }
.tab-ghost.active { border-color: var(--line-2); }
.tab-g.dragging { opacity: .35; }
.tab-g.drop-before::before, .tab-g.drop-after::before { content: ""; position: absolute; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: var(--accent); }
.tab-g.drop-before::before { left: -5px; }
.tab-g.drop-after::before { right: -5px; }
.tab-g.preview { pointer-events: none; }
.tb-right { display: flex; align-items: center; gap: 4px; flex: none; }
.tb-search { display: flex; align-items: center; gap: 8px; height: 34px; min-width: 190px; margin-right: 4px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--bg-1); border: 1px solid var(--line); color: var(--text-3); font-size: 13.5px; transition: border-color .15s, color .15s; }
.tb-search:hover { border-color: var(--line-3); color: var(--text-2); }
.tb-search kbd { margin-left: auto; }
.tb-btn { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); transition: background .15s, color .15s; }
.tb-btn:hover, .tb-btn.popped { background: var(--hover); color: var(--text-1); }
.tb-dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg-0); }
.tb-me { padding: 3px; border-radius: 50%; transition: background .15s; }
.tb-me:hover, .tb-me.popped { background: var(--hover); }

/* call capsule */
.capsule { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: color-mix(in oklab, var(--sage) 14%, var(--bg-1)); border: 1px solid color-mix(in oklab, var(--sage) 35%, transparent); animation: popIn .3s var(--spring); }
.cap-open { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.cap-open:hover { background: var(--hover); }
.cap-live { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); animation: livePulse 2s infinite; }
.cap-live.warn { background: var(--amber); }
.cap-room { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-time { color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12px; }
.cap-stack { display: inline-flex; padding-left: 6px; --ring: var(--bg-1); }
.cap-stack .avatar { margin-left: -5px; box-shadow: 0 0 0 2px var(--ring); }
.cap-btn { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--text-1); }
.cap-btn:hover { background: var(--hover); }
.cap-btn.off { color: var(--danger); background: var(--danger-soft); }
.cap-btn.leave:hover { background: var(--danger); color: #fff; }

/* left pane */
/* the pane is only as tall as what's in it */
.pane { position: relative; align-self: start; min-height: 0; max-height: 100%; display: flex; flex-direction: column; background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; --ring: var(--bg-1); }
.pane-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 8px 12px; }
.pane-guilds { display: none; }
.cover { margin: 8px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); overflow: hidden; flex: none; --ring: var(--card); }
.cover-art { position: relative; height: 44px; background-size: cover; background-position: center; }
.cover-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 30%, color-mix(in oklab, var(--card) 85%, transparent)); }
.cover-id { position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 0 10px; margin-top: -18px; }
.cover-icon { padding: 3px; border-radius: 50%; background: var(--card); display: grid; flex: none; }
.cover-titles { min-width: 0; padding-bottom: 2px; display: grid; }
.cover-titles h2 { display: flex; align-items: center; gap: 5px; font-family: var(--display); font-size: 16px; font-weight: 700; letter-spacing: var(--display-track); min-width: 0; }
.cover-titles h2 > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-meta { display: flex; align-items: center; gap: 6px; margin-right: auto; font-size: 12px; color: var(--text-3); cursor: default; }
.cover-actions { display: flex; align-items: center; gap: 0; padding: 2px 6px 6px 12px; }
.cover.small { margin: 0; }

/* guild header: one slim row over a wash of the guild's banner */
.ghead { position: relative; flex: none; display: flex; align-items: center; gap: 9px; margin: 8px 8px 0; padding: 7px 4px 7px 8px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); overflow: hidden; isolation: isolate; --ring: var(--card); }
.ghead::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--art) center / cover; opacity: .4; -webkit-mask-image: linear-gradient(to right, transparent 35%, #000); mask-image: linear-gradient(to right, transparent 35%, #000); }
.ghead .guild-icon { box-shadow: 0 0 0 2px var(--card); }
.gh-names { flex: 1; min-width: 0; display: grid; }
.gh-names h2 { display: flex; align-items: center; gap: 5px; min-width: 0; font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: var(--display-track); line-height: 1.25; }
.gh-names h2 > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); cursor: default; }
.gh-here, .gh-quiet { display: inline-flex; align-items: center; gap: 5px; }
.gh-meta .live-dot { width: 6px; height: 6px; }

.sec { display: flex; align-items: center; gap: 4px; padding: 10px 4px 3px 8px; }
.sec-label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; color: var(--text-3); text-align: left; }
.sec-label, .turn-time, .cr-time, .mr-meta time { font-family: var(--mono); }
.sec-label > span:first-child { white-space: nowrap; }
.sec-rule { flex: 1; }
.sec-add { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); opacity: 0; transition: opacity .12s; }
.sec:hover .sec-add, .sec-add:focus-visible { opacity: 1; }
.sec-add:hover { background: var(--hover); color: var(--text-1); }
/* guild pane groups: a small label, conversations as chips, tables as tiles */
.grp { padding-top: 12px; }
.grp-label { padding: 0 2px 6px; font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips + .tables { margin-top: 4px; }
.chip-ch { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 28px; padding: 0 9px 0 8px; border-radius: 8px; background: var(--hover); color: var(--text-2); font-size: 13px; font-weight: 550; text-decoration: none; transition: background .12s, color .12s, box-shadow .12s; }
.chip-ch:hover { background: var(--surface); color: var(--text-1); }
.chip-ch.active { background: var(--accent-soft); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--accent-soft-2); }
.chip-ch.unread { color: var(--text-1); font-weight: 700; }
.chip-ch.muted { opacity: .5; }
.cc-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-kind { display: inline-flex; align-items: center; gap: 2px; margin-left: -2px; color: var(--text-4); font-size: 11px; font-weight: 700; }
.cc-kind.live { color: var(--sage); }
.cc-at, .cc-n { height: 16px; min-width: 16px; margin-right: -3px; padding: 0 5px; border-radius: 8px; font-size: 10.5px; font-weight: 800; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.cc-at { background: var(--accent); color: var(--on-accent); }
.cc-n { background: var(--surface-2); color: var(--text-1); }
.chip-new { display: flex; align-items: center; gap: 6px; margin-top: 12px; height: 28px; padding: 0 10px 0 8px; border-radius: 8px; border: 1px dashed var(--line-2); color: var(--text-3); font-size: 12.5px; font-weight: 600; transition: color .12s, border-color .12s; }
.chip-new:hover { color: var(--text-1); border-color: var(--line-3); }

.tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 4px; }
.room { position: relative; min-width: 0; display: grid; gap: 4px; padding: 6px 8px; border-radius: 8px; border: 1px dashed var(--line-2); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .2s; --ring: var(--bg-1); }
.room:hover { background: var(--hover); border-color: var(--line-3); }
.room.live { background: var(--card); border-style: solid; border-color: var(--line); --ring: var(--card); }
.room.live:hover { border-color: var(--line-3); }
.room.active { border-style: solid; border-color: var(--accent-soft-2); }
.room.connected { border-color: color-mix(in oklab, var(--sage) 60%, transparent); box-shadow: 0 0 0 2px var(--sage-soft); }
.room-name { display: block; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room.live .room-name { font-weight: 700; color: var(--text-1); }
.room-sub { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 18px; overflow: hidden; }
.room-sub .room-state { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.room-sub .room-stack { flex: none; }
.room-count { font-size: 11px; font-weight: 650; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.room:not(.live) .room-count { color: var(--text-4); font-weight: 550; }

/* List layout: one row per channel / table, in three sizes */
.as-list { --row-h: 32px; --row-font: 14px; --row-gap: 9px; --row-pad: 10px; }
.as-list.list-big { --row-h: 44px; --row-font: 15px; --row-gap: 11px; --row-pad: 12px; }
.as-list.list-compact { --row-h: 24px; --row-font: 13px; --row-gap: 7px; --row-pad: 8px; }
.as-list .grp { padding-top: 10px; }
.as-list.list-compact .grp { padding-top: 6px; }
.as-list.list-compact .grp-label { padding-bottom: 3px; }
.rows { display: grid; gap: 1px; }
.list-big .rows { gap: 2px; }
.chan-row, .room-row { position: relative; display: flex; align-items: center; gap: var(--row-gap); min-height: var(--row-h); padding: 0 8px 0 var(--row-pad); border-radius: 8px; color: var(--text-2); font-size: var(--row-font); font-weight: 550; text-decoration: none; cursor: pointer; transition: background .12s, color .12s; --ring: var(--bg-1); }
.list-compact :is(.chan-row, .room-row) { border-radius: 6px; }
.list-big :is(.chan-row, .room-row) { padding-block: 5px; }
.chan-row:hover, .room-row:hover { background: var(--hover); color: var(--text-1); }
.chan-row.active, .room-row.active { background: var(--accent-soft); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--accent-soft-2); }
.chan-row.unread { color: var(--text-1); font-weight: 700; }
.chan-row.muted { opacity: .5; }
.cr-main { flex: 1; min-width: 0; display: grid; }
.cr-main .cc-name { min-width: 0; }
.cr-topic { font-size: 12px; font-weight: 500; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-row.live { color: var(--text-1); }
.room-row.connected { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--sage) 55%, transparent); }
.room-row .room-wave { width: 12px; justify-content: center; }
.list-compact .room-row .room-wave { width: 8px; transform: scale(.8); }
.room-row .room-count { font-size: 11px; }
.room-row .room-state .live-dot { width: 6px; height: 6px; }
.room-row .room-go { top: 50%; bottom: auto; right: 4px; height: 22px; margin-top: -11px; padding: 0 10px; font-size: 11.5px; }
.list-compact .room-row .room-go { height: 18px; margin-top: -9px; padding: 0 8px; font-size: 11px; }
.room-wave { display: inline-flex; align-items: center; gap: 2px; height: 14px; flex: none; }
.room-wave i { display: block; width: 3px; height: 5px; border-radius: 2px; background: var(--text-4); transition: height .2s; }
.live .room-wave i, .room-wave.big i { background: var(--sage); }
.room-wave i:nth-child(2) { height: 9px; }
.room-wave i:nth-child(3) { height: 7px; }
.talking .room-wave i, .view-room.live .room-wave i, .hybrid-strip.live .room-wave i, .live-row .room-wave i { animation: bars 1s ease-in-out infinite; }
.room-wave i:nth-child(2) { animation-delay: .15s !important; }
.room-wave i:nth-child(3) { animation-delay: .3s !important; }
.room-wave i:nth-child(4) { animation-delay: .45s !important; }
.room-wave.big { height: 20px; gap: 3px; }
.room-wave.big i { width: 4px; }
.room-stack { display: inline-flex; padding-left: 6px; }
.room-stack .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--ring); }
.room-state { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--sage); white-space: nowrap; }
/* join button: tucked away until you point at the table */
.room-go { position: absolute; top: 4px; right: 4px; height: 26px; padding: 0 11px; border-radius: 999px; background: color-mix(in oklab, var(--sage) 85%, black); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; opacity: 0; transform: scale(.94); pointer-events: none; transition: opacity .12s, transform .15s var(--spring), background .15s; }
.room-go:hover:not(:disabled) { background: color-mix(in oklab, var(--sage) 72%, black); }
.room-go:disabled { background: var(--surface-2); color: var(--text-3); }
.room .room-go { top: auto; bottom: 4px; right: 4px; height: 22px; padding: 0 10px; font-size: 11.5px; }
:is(.room, .live-row, .room-row):is(:hover, :focus-within) .room-go { opacity: 1; transform: none; pointer-events: auto; }
@media (hover: hover) { .live-row:is(:hover, :focus-within) .mini-stack { opacity: 0; } }
@media (hover: none) { .live-row .room-go { position: static; margin: 0; opacity: 1; transform: none; pointer-events: auto; } .room .room-go, .room-row .room-go { display: none; } }

/* home pane */
.home-head { padding: 16px 16px 4px; flex: none; }
.hh-greet { display: grid; }
.hh-hi { color: var(--text-3); font-size: 14px; font-weight: 600; }
.hh-greet strong { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: var(--display-track); line-height: 1.1; }
.hh-sub { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 12.5px; color: var(--text-3); }
.home-navs { display: grid; gap: 2px; padding: 8px 0 2px; }
.home-nav { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--text-2); font-weight: 650; }
.home-nav:hover { background: var(--hover); color: var(--text-1); }
.home-nav.active { background: var(--card); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--line-2); }
.home-nav .tg-count { margin-left: auto; }
.sec-label.static { cursor: default; }
.chat-list { display: grid; gap: 2px; }
.chat-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 8px; text-decoration: none; color: var(--text-2); transition: background .12s; }
.chat-row:hover { background: var(--hover); }
.chat-row.active { background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); --ring: var(--card); }
.cr-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.cr-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cr-name { font-size: 14px; font-weight: 650; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-time { margin-left: auto; font-size: 11.5px; color: var(--text-3); flex: none; }
.cr-bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cr-preview { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.unread .cr-preview { color: var(--text-1); font-weight: 600; }
.cr-close { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center; background: var(--surface); color: var(--text-2); }
.chat-row:hover .cr-close { display: grid; }
.chat-row:hover .cr-time { visibility: hidden; }

/* me card */
.pop-me { width: 310px; }
.me-card { display: grid; }
.me-head { display: flex; align-items: center; gap: 12px; padding: 18px 16px 12px; --ring: var(--bg-float); }
.me-names { display: grid; min-width: 0; }
.me-names strong { font-size: 16px; font-weight: 700; }
.me-names span { font-size: 13px; color: var(--text-3); }
.me-status { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 12px; }
.me-chip { display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 12px; border-radius: 14px; background: var(--bg-1); border: 1.5px solid var(--line); font-weight: 650; font-size: 13px; color: var(--text-2); }
.me-chip:hover { color: var(--text-1); border-color: var(--line-3); }
.me-chip.on { border-color: var(--accent); color: var(--text-1); background: var(--accent-soft); }
.me-note { display: flex; align-items: center; gap: 4px; margin: 10px 12px; padding: 3px 4px 3px 3px; border-radius: 999px; background: var(--bg-1); border: 1.5px solid var(--line); }
.me-note:focus-within { border-color: var(--accent); }
.me-note-emoji { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; }
.me-note-emoji:hover { background: var(--hover); }
.me-note-input { flex: 1; min-width: 0; height: 32px; background: transparent; border: 0; outline: none; color: var(--text-1); font-size: 13.5px; }
.me-note-input::placeholder { color: var(--text-4); }
.me-note-clear { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); }
.me-list { padding: 6px; border-top: 1px solid var(--line); }
.me-item { display: flex; align-items: center; gap: 11px; width: 100%; height: 38px; padding: 0 12px; border-radius: 12px; color: var(--text-2); font-size: 14px; font-weight: 550; text-align: left; }
.me-item:hover { background: var(--hover); color: var(--text-1); }
.me-item kbd { margin-left: auto; }
.me-item.danger { color: var(--danger); }
.me-item.danger:hover { background: var(--danger-soft); }
.me-sep { height: 1px; background: var(--line); margin: 4px 8px; }

/* ---------------------------------------------------------------- stage header */

.view { display: flex; flex-direction: column; flex: 1; min-height: 0; position: relative; }
.view-enter { animation: viewIn .26s var(--ease-out); }
.stage-head { flex: none; display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 6px 10px 6px 18px; border-bottom: 1px solid var(--line); position: relative; z-index: 3; }
.sh-back { display: none; margin-left: -8px; }
.mnav { display: none; }
.sh-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; }
button.sh-title { border-radius: 14px; padding: 4px 8px 4px 4px; margin-left: -4px; }
button.sh-title:hover { background: var(--hover); }
.sh-names { min-width: 0; display: grid; gap: 1px; }
.sh-names h1 { display: flex; align-items: center; font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: var(--display-track); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-sub { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.view-chat:not(.is-dm) .sh-sub:not(.muted) { cursor: pointer; }
.view-chat:not(.is-dm) .sh-sub:not(.muted):hover { color: var(--text-2); }
.sh-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.sh-search { width: 0; overflow: hidden; transition: width .25s var(--ease); }
.sh-search.open { width: 220px; }
.sh-search-input { width: 100%; height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--bg-1); outline: none; color: var(--text-1); font-size: 13.5px; }
.sh-search-input:focus { border-color: var(--accent); }
.sh-people { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px 0 4px; border-radius: 999px; color: var(--text-2); font-weight: 700; font-size: 13px; border: 1px solid var(--line); margin-left: 4px; --ring: var(--bg-2); transition: background .15s, border-color .15s; }
.sh-people:hover { background: var(--hover); color: var(--text-1); }
.sh-people.on { background: var(--card); color: var(--text-1); border-color: var(--line-3); --ring: var(--card); }
.sh-people.round-btn { padding: 0; width: 34px; border: 0; }
.sh-count { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- conversation */

.chat-body { flex: 1; min-height: 0; display: flex; position: relative; }
.convo { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.scroller { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.stream { display: flex; flex-direction: column; justify-content: flex-end; min-height: 100%; padding: 4px 22px 16px; }


/* channel start: a centred chapter heading, not a profile header */
.ch-start { display: grid; justify-items: center; gap: 8px; padding: 56px 12px 22px; text-align: center; }
.ch-start-head { display: flex; align-items: center; gap: 14px; width: min(560px, 100%); }
.ch-start-rule { flex: 1; height: 1px; min-width: 24px; background: linear-gradient(90deg, transparent, hsl(var(--hue) 45% 55% / .55)); }
.ch-start-rule:last-child { background: linear-gradient(90deg, hsl(var(--hue) 45% 55% / .55), transparent); }
.ch-start h1 { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: var(--display-track); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
.ch-start h1 span:last-child { overflow: hidden; text-overflow: ellipsis; }
.ch-start-line { color: var(--text-3); font-size: 13px; }
.ch-start-line strong { color: var(--text-2); font-weight: 600; }
.ch-start-topic { color: var(--text-2); font-size: 13.5px; max-width: 520px; padding: 6px 12px; border-left: 2px solid hsl(var(--hue) 45% 55% / .6); text-align: left; }
.ch-start-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 2px; }
.ch-start-act { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.ch-start-act:hover { color: var(--text-1); background: var(--hover); }
.ch-start-act + .ch-start-act::before { content: '·'; margin: 0 8px 0 -10px; color: var(--text-3); pointer-events: none; }

.skeletons { padding: 20px 0 8px; display: grid; gap: 16px; }
.sk-turn { display: flex; gap: 10px; align-items: flex-start; }
.sk-turn.right { justify-content: flex-end; }
.sk-card { display: grid; gap: 8px; padding: 12px 14px; border-radius: 20px; background: var(--card); }
.sk { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 40%, var(--surface) 80%); background-size: 300% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.sk-av { width: 38px; height: 38px; border-radius: 42% 58% 55% 45% / 48% 45% 55% 52%; }

.chapter { display: flex; align-items: baseline; gap: 10px; margin: 20px 0 2px; padding-left: 2px; }
.ch-day { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--text-1); }
.ch-day::before { content: ""; width: 12px; height: 3px; border-radius: 4px; background: var(--accent); }
.ch-date { font-size: 12.5px; color: var(--text-3); }
.fresh { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; }
.fresh::after { content: ""; flex: 1; border-top: 1px dashed color-mix(in oklab, var(--accent) 55%, transparent); }
.fresh-tag { display: inline-flex; align-items: center; gap: 4px; height: 19px; padding: 0 8px 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 800; }
.fresh-since { font-size: 12px; color: var(--accent-text); font-weight: 600; }

.note { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 10px 0; }
.note-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 6px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); max-width: 100%; }
.note-pill strong { color: var(--text-1); }
.note-lead { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: 13px; flex: none; }
.note-pill time { color: var(--text-4); font-size: 11.5px; margin-left: 4px; }
.greet { height: 30px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--sage); border: 1.5px solid color-mix(in oklab, var(--sage) 45%, transparent); transition: background .15s, transform .15s var(--spring); }
.greet:hover:not(:disabled) { background: var(--sage); color: #fff; transform: rotate(-2deg); }
.greet.done { color: var(--text-3); border-color: var(--line); }

/* turns */
.turn { display: flex; align-items: flex-start; gap: 8px; margin-top: var(--group-gap); max-width: min(760px, calc(100% - 210px)); align-self: flex-start; --ring: var(--bg-2); }
.turn.mine { align-self: flex-end; flex-direction: row-reverse; }
.turn-av { flex: none; margin-top: 2px; border-radius: 50%; transition: transform .15s var(--spring); }
.turn-av:hover { transform: rotate(-6deg) scale(1.05); }
.turn-card { position: relative; min-width: 0; padding: 6px 12px 7px; border-radius: 4px 12px 12px 12px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0, 0, 0, .12); }
.turn.mine .turn-card { border-radius: 12px 4px 12px 12px; background: var(--mine); border-color: var(--mine-line); }
.turn.has-mention .turn-card { border-color: color-mix(in oklab, var(--amber) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--amber) 14%, transparent); }
.turn-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 0; }
.turn.mine .turn-head { justify-content: flex-end; }
.turn-name { font-weight: 700; font-size: 13.5px; color: var(--text-1); }
.turn-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.turn.mine .turn-name { color: var(--accent-text); }
.turn-time { font-size: 11px; color: var(--text-3); font-weight: 500; white-space: nowrap; }
.compact-only { display: none; }
.line { position: relative; margin: 0 -8px; padding: 2px 8px; border-radius: 10px; font-size: var(--chat-font); line-height: 1.45; color: var(--text-msg); outline: none; transition: background .12s; }
.line + .line { margin-top: 1px; }
.line:hover, .line.editing { background: var(--line-hover); }
.line.mentions-me { background: color-mix(in oklab, var(--amber) 9%, transparent); }
.line.pending .line-text, .line.pending .media { opacity: .5; }
.line.enter { animation: lineIn .32s var(--ease-out); }
.line.flash { animation: flash 1.8s var(--ease-out); }
.line-text { overflow-wrap: anywhere; }
.line-text .jumbo { font-size: 46px; line-height: 1.15; display: inline-block; }
.edited { font-size: 11px; color: var(--text-4); margin-left: 6px; font-style: italic; }
.pin-flag { position: absolute; top: 4px; right: 4px; color: var(--accent); opacity: .8; }
.sending { display: inline-block; width: 12px; height: 12px; margin-left: 4px; border-radius: 50%; border: 2px solid var(--text-4); border-right-color: transparent; animation: spin .8s linear infinite; vertical-align: -2px; }
.reply-chip { display: flex; align-items: center; gap: 6px; max-width: 100%; margin: 2px 0 4px; padding: 3px 10px 3px 6px; border-radius: 999px; background: color-mix(in oklab, var(--text-1) 6%, transparent); font-size: 12.5px; color: var(--text-3); text-align: left; transition: background .12s; }
.reply-chip:hover { background: color-mix(in oklab, var(--text-1) 10%, transparent); color: var(--text-2); }
.reply-chip strong { color: var(--text-2); font-weight: 700; white-space: nowrap; }
.reply-chip .rc-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.reply-chip .avatar { --ring: transparent; }
.reply-chip.gone { font-style: italic; }

/* actions beside the card */
.acts { position: absolute; top: -2px; left: calc(100% + 16px); display: none; align-items: center; gap: 1px; padding: 3px; border-radius: 999px; background: var(--bg-float); border: 1px solid var(--line-2); box-shadow: var(--shadow-2); z-index: 4; white-space: nowrap; }
.acts::before { content: ""; position: absolute; right: 100%; top: 0; bottom: 0; width: 20px; }
.turn.mine .acts { left: auto; right: calc(100% + 16px); }
.turn.mine .acts::before { right: auto; left: 100%; }
.line:hover .acts, .line:focus-within .acts, .acts:has(.popped) { display: flex; animation: popIn .14s var(--ease-out); }
.line.editing .acts { display: none; }
.act-time { padding: 0 8px 0 10px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.act { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.act:hover, .act.popped { background: var(--hover); color: var(--text-1); }
.menu-quick { display: flex; justify-content: space-between; gap: 4px; padding: 2px; }
.mq { width: 36px; height: 36px; border-radius: 50%; background: var(--surface); font-size: 18px; transition: transform .15s var(--spring); }
.mq:hover { transform: scale(1.15) rotate(-6deg); }

/* stickers (reactions) */
.stickers { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 5px 0 2px; }
.sticker { display: inline-flex; align-items: center; gap: 4px; height: 23px; padding: 0 8px 0 5px; border-radius: 999px; background: var(--sticker); color: var(--sticker-ink); font-size: 12.5px; font-weight: 800; transform: rotate(var(--tilt, 0deg)); box-shadow: 0 2px 0 rgba(0, 0, 0, .28); border: 2px solid transparent; font-variant-numeric: tabular-nums; transition: transform .18s var(--spring); }
.sticker:hover { transform: rotate(0deg) scale(1.08); }
.sticker.mine { border-color: var(--accent); }
.st-emoji { font-size: 14px; line-height: 1; }
.sticker.pop .st-emoji { animation: reactPop .5s var(--spring); }
.sticker.add { background: transparent; color: var(--text-3); box-shadow: none; border: 1.5px dashed var(--line-3); opacity: 0; transform: none; padding: 0 7px; }
.line:hover .sticker.add, .sticker.add.popped { opacity: 1; }
.sticker.add:hover { color: var(--text-1); border-color: var(--text-3); }

/* rich content */
.mention { display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-weight: 650; cursor: pointer; transition: background .12s, color .12s; }
.mention:hover { background: var(--accent); color: var(--on-accent); }
.mention.me { background: color-mix(in oklab, var(--amber) 28%, transparent); color: var(--text-1); }
.spoiler { background-color: var(--text-3); color: transparent; border-radius: 6px; padding: 0 3px; cursor: pointer; background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgba(255, 255, 255, .12) 4px 8px); transition: background-color .15s; }
.spoiler * { visibility: hidden; }
.spoiler.revealed { background: var(--hover); background-image: none; color: inherit; cursor: text; }
.spoiler.revealed * { visibility: visible; }
.inline-code { font-family: var(--mono); font-size: .86em; padding: 2px 6px; border-radius: 6px; background: var(--code-bg); border: 1px solid var(--line); }
blockquote { margin: 3px 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--accent-soft-2); color: var(--text-2); }
a.link { color: var(--link); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--link) 40%, transparent); text-underline-offset: 3px; word-break: break-all; }
a.link:hover { text-decoration-color: var(--link); }
.code-block { margin: 6px 0 3px; max-width: 680px; border-radius: 14px; overflow: hidden; background: var(--code-bg); border: 1px solid var(--line); }
.code-head { display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 6px 0 12px; border-bottom: 1px dashed var(--line-2); font-size: 11.5px; color: var(--text-3); font-weight: 700; text-transform: lowercase; letter-spacing: .04em; }
.code-copy { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; color: var(--text-3); }
.code-copy:hover { background: var(--hover); color: var(--text-1); }
.code-copy.done { color: var(--sage); }
.code-block pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-family: var(--mono); font-size: calc(var(--chat-font) - 1.5px); line-height: 1.6; color: var(--text-msg); tab-size: 4; }
.tk-kw { color: #e3906a; }
.tk-str { color: #b7c97a; }
.tk-num { color: #e8b75c; }
.tk-com { color: var(--text-4); font-style: italic; }
.tk-fn { color: #8fc1d6; }
.tk-type { color: #d9a3c7; }
.tk-const { color: #e8b75c; }
[data-theme="light"] .tk-kw { color: #b4501d; }
[data-theme="light"] .tk-str { color: #5b7a1e; }
[data-theme="light"] .tk-num, [data-theme="light"] .tk-const { color: #9a6a0c; }
[data-theme="light"] .tk-fn { color: #2f6d8a; }
[data-theme="light"] .tk-type { color: #964a7e; }

.media { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 2px; align-items: flex-start; }
.media.multi { display: grid; grid-template-columns: repeat(2, minmax(0, 240px)); gap: 6px; }
.photo { position: relative; display: block; width: min(var(--w), 100%); aspect-ratio: var(--ratio); max-height: 340px; border-radius: 16px; overflow: hidden; background: var(--surface); cursor: zoom-in; box-shadow: 0 2px 0 rgba(0, 0, 0, .2); transform: rotate(-.6deg); transition: transform .25s var(--spring); }
.photo:nth-child(even) { transform: rotate(.6deg); }
.photo:hover { transform: rotate(0) scale(1.01); }
.photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--hover), transparent); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.photo.loaded::before { display: none; }
.photo img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.photo.loaded img { opacity: 1; }
.media.multi .photo { width: 100%; }
.file { display: flex; align-items: center; gap: 12px; width: min(400px, 100%); padding: 10px 8px 10px 10px; border-radius: 16px; background: color-mix(in oklab, var(--text-1) 5%, transparent); border: 1px solid var(--line); }
.file-ext { width: 42px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 10px 16px 10px 10px; background: var(--sky); color: #fff; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.file-ext.ext-zip, .file-ext.ext-rar, .file-ext.ext-7z { background: var(--amber); }
.file-meta { flex: 1; min-width: 0; display: grid; }
.file-name { color: var(--text-1); font-weight: 650; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-name:hover { text-decoration: underline; }
.file-size { font-size: 12px; color: var(--text-3); }
.preview { display: flex; max-width: 440px; margin: 5px 0 2px; border-radius: 10px; overflow: hidden; text-decoration: none; background: color-mix(in oklab, var(--text-1) 5%, transparent); border: 1px solid var(--line); transition: border-color .15s; }
.preview:hover { border-color: var(--line-3); }
.preview-art { width: 104px; flex: none; background-size: cover; background-position: center; }
.preview-body { display: grid; gap: 3px; padding: 8px 12px 10px; min-width: 0; }
.preview-site { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: lowercase; }
.preview-site i { width: 8px; height: 8px; border-radius: 50%; background: var(--embed); }
.preview-title { color: var(--text-1); font-size: 14.5px; }
.preview-desc { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.edit-box { display: grid; gap: 6px; margin: 2px 0; }
.edit-input { width: 100%; resize: none; padding: 10px 12px; border-radius: 14px; background: var(--bg-1); border: 1.5px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); color: var(--text-1); outline: none; font-size: var(--chat-font); line-height: 1.45; }
.edit-btns { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.edit-hint { font-size: 12px; color: var(--text-3); margin-right: auto; }
.quote-card { display: flex; gap: 12px; padding: 12px; border-radius: 16px; background: var(--bg-1); border: 1px solid var(--line); --ring: var(--bg-1); }
.quote-card strong { margin-right: 6px; }
.qc-time { font-size: 12px; color: var(--text-3); }
.quote-card p { margin-top: 2px; color: var(--text-2); }

.catchup { position: absolute; top: 12px; left: 50%; z-index: 5; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-2); transform: translate(-50%, -160%); visibility: hidden; transition: transform .3s var(--spring), visibility 0s .3s; }
.catchup.show { transform: translate(-50%, 0); visibility: visible; transition: transform .3s var(--spring); }
.cu-go { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.cu-go:hover, .cu-x:hover { background: rgba(255, 255, 255, .16); }
.cu-x { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.jump-fab { position: absolute; right: 30px; bottom: 100px; z-index: 5; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-float); color: var(--text-1); border: 1px solid var(--line-2); box-shadow: var(--shadow-2); opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none; transition: opacity .2s, transform .25s var(--spring); }
.jump-fab.show { opacity: 1; transform: none; pointer-events: auto; }
.jump-fab:hover { background: var(--accent); color: var(--on-accent); }
.jump-count { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg-2); }

.hybrid-strip { flex: none; display: flex; align-items: center; gap: 12px; margin: 8px 16px 0; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--card); border: 1px dashed var(--line-2); --ring: var(--card); }
.hybrid-strip.live { border-style: solid; border-color: color-mix(in oklab, var(--sage) 40%, transparent); }
.hybrid-strip.connected { background: color-mix(in oklab, var(--sage) 12%, var(--card)); }
.hybrid-strip .hs-text { flex: 1; min-width: 0; display: grid; }
.hs-text strong { font-size: 13.5px; }
.hs-text span { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-avatars { display: flex; padding-left: 6px; }
.hs-avatars .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--ring); }

.drop-zone { position: absolute; inset: 10px; z-index: 20; display: none; place-items: center; border-radius: 20px; background: color-mix(in oklab, var(--bg-2) 82%, transparent); border: 3px dashed var(--accent); backdrop-filter: blur(4px); }
.view.dragging-files .drop-zone { display: grid; animation: fadeIn .15s; }
.drop-inner { display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--text-2); animation: dropIn .3s var(--spring); }
.drop-inner .ico { color: var(--accent); }
.drop-inner strong { font-family: var(--display); font-size: 22px; color: var(--text-1); }

/* composer */
.composer-dock { position: relative; flex: none; padding: 2px 18px 12px; }
.composer { background: var(--card); border-radius: 14px; border: 1.5px solid var(--line-2); box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: color-mix(in oklab, var(--accent) 60%, transparent); box-shadow: var(--shadow-1), 0 0 0 3px var(--accent-soft); }
.composer.shake { animation: shake .4s; }
.composer.locked { display: flex; align-items: center; gap: 10px; padding: 0 20px; height: 52px; color: var(--text-3); font-size: 13.5px; box-shadow: none; border-style: dashed; }
.composer-row { display: flex; align-items: flex-end; gap: 2px; padding: 4px; }
.composer-prompt { align-self: center; padding: 0 0 0 4px; font-family: var(--mono); font-weight: 700; color: var(--accent); user-select: none; }
.composer-input { flex: 1; min-width: 0; min-height: calc(var(--chat-font) * 1.45 + 14px); resize: none; background: transparent; border: 0; outline: none; color: var(--text-1); font-size: var(--chat-font); line-height: 1.45; padding: 7px 8px; max-height: 40vh; overflow-y: auto; }
.cbtn { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--text-3); transition: background .15s, color .15s; }
.cbtn .ico { transition: transform .2s var(--spring); }
.cbtn:hover, .cbtn.popped { background: var(--hover); color: var(--text-1); }
.cbtn:hover .ico { transform: rotate(-10deg); }
.send { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--text-4); transition: background .2s, color .2s, transform .2s var(--spring); }
.composer.has-content .send { background: var(--accent); color: var(--on-accent); transform: rotate(-12deg); }
.composer.has-content .send:hover { transform: rotate(0) scale(1.06); }
.char-count { align-self: center; font-size: 12px; color: var(--text-3); font-weight: 700; font-variant-numeric: tabular-nums; padding: 0 4px; }
.char-count:empty { display: none; }
.char-count.over { color: var(--danger); }
.typing { position: absolute; left: 34px; bottom: calc(100% - 4px); display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 6px; border-radius: 999px; background: var(--bg-float); border: 1px solid var(--line); box-shadow: var(--shadow-1); font-size: 12.5px; color: var(--text-2); font-weight: 600; opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .2s, transform .25s var(--spring); --ring: var(--bg-float); }
.typing.show { opacity: 1; transform: none; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: typing 1.3s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
.reply-row { display: none; align-items: center; gap: 8px; padding: 8px 8px 0 16px; font-size: 13px; color: var(--text-3); }
.reply-row > .ico { color: var(--accent); }
.composer.replying .reply-row { display: flex; }
.rr-text { flex: 1; min-width: 0; display: flex; gap: 6px; white-space: nowrap; overflow: hidden; }
.rr-text strong { color: var(--text-1); }
.rr-text span { overflow: hidden; text-overflow: ellipsis; }
.ping { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 750; color: var(--text-3); background: var(--surface); }
.ping.on { color: var(--accent-text); background: var(--accent-soft); }
.tray { display: none; gap: 10px; padding: 12px 12px 2px; overflow-x: auto; }
.composer.has-files .tray { display: flex; }
.tray-item { position: relative; flex: none; display: flex; align-items: center; gap: 10px; width: 220px; padding: 6px 10px 6px 6px; border-radius: 16px; background: var(--bg-1); border: 1px solid var(--line); animation: popIn .2s var(--spring); }
.tray-item img, .tray-file { width: 52px; height: 52px; flex: none; border-radius: 12px; object-fit: cover; background: var(--surface); display: grid; place-items: center; color: var(--text-3); }
.tray-meta { min-width: 0; display: grid; }
.tray-name { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tray-size { font-size: 11.5px; color: var(--text-3); }
.tray-x { position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--danger); color: #fff; box-shadow: var(--shadow-1); }
.suggest { position: absolute; left: 24px; right: 24px; bottom: calc(100% - 2px); z-index: 6; display: none; max-height: 340px; overflow-y: auto; padding: 6px; border-radius: 20px; background: var(--bg-float); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); --ring: var(--bg-float); }
.suggest.show { display: block; animation: popUp .16s var(--ease-out); }
.sg-title { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.sg-keys { font-weight: 500; color: var(--text-4); }
.sg-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 12px; border-radius: 12px; color: var(--text-2); text-align: left; }
.sg-item.active { background: var(--accent-soft); color: var(--text-1); }
.sg-main { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-args { color: var(--text-3); font-weight: 500; font-family: var(--mono); font-size: 12px; }
.sg-sub { margin-left: auto; padding-left: 12px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-emoji { font-size: 20px; width: 24px; text-align: center; }
.sg-slash { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-family: var(--mono); font-weight: 800; }

/* side table panel */
.panel { display: none; flex: none; width: 252px; margin: 8px 8px 8px 0; flex-direction: column; border-radius: 10px; background: var(--bg-1); border: 1px solid var(--line); overflow: hidden; --ring: var(--bg-1); }
.chat-body.panel-open .panel { display: flex; animation: sideIn .25s var(--ease-out); }
.panel-head { display: flex; align-items: center; gap: 4px; padding: 8px 6px 4px 8px; }
.panel-head .seg-tabs { flex: 1; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 12px; }
.people { display: grid; gap: 8px; }
.seat-label { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 4px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.seat-toggle:hover { color: var(--text-1); }
.seat-n { margin-left: auto; color: var(--text-3); font-weight: 650; font-variant-numeric: tabular-nums; }
.seat-chev { transition: transform .2s var(--ease); color: var(--text-3); }
.seat-group.open .seat-chev { transform: rotate(180deg); }
.seats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.seat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 5px; border-radius: 12px; transition: background .12s; }
.seat:hover, .seat.popped { background: var(--hover); }
.seat:hover .avatar { transform: rotate(-5deg); }
.seat.away { opacity: .55; }
.seat-av { position: relative; display: grid; }
.seat-badge { position: absolute; top: -5px; right: -6px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; color: #2b2119; box-shadow: 0 0 0 2px var(--bg-1); }
.seat-badge.host { background: var(--amber); }
.seat-badge.mod { background: var(--sky); }
.seat-act { position: absolute; bottom: -4px; right: -7px; width: 18px; height: 18px; border-radius: 50%; display: grid; opacity: 0; transition: opacity .12s; place-items: center; background: var(--card); border: 1px solid var(--line-2); color: var(--text-2); font-size: 10px; }
.seat:hover .seat-act, .seat.popped .seat-act { opacity: 1; }
.seat-name { max-width: 100%; padding: 0 3px; font-size: 11.5px; font-weight: 650; color: var(--role, var(--text-2)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-legend { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.pins { display: grid; gap: 8px; }
.pin-card { display: grid; gap: 6px; padding: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); text-align: left; transform: rotate(-.4deg); transition: transform .2s var(--spring), border-color .15s; --ring: var(--card); }
.pin-card:nth-child(even) { transform: rotate(.4deg); }
.pin-card:hover { transform: rotate(0) translateY(-1px); border-color: var(--line-3); }
.pin-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.pin-meta strong { color: var(--text-1); font-size: 13px; }
.pin-text { font-size: 13.5px; color: var(--text-msg); max-height: 150px; overflow: hidden; }
.pin-text .code-block { max-width: 100%; }
.media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mg-item { aspect-ratio: 1; border-radius: 12px; background-size: cover; background-position: center; transition: transform .2s var(--spring); }
.mg-item:hover { transform: scale(1.04) rotate(-1.5deg); }

/* ID card */
.pop-id { width: 330px; }
.idcard { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 16px 16px; text-align: center; --ring: var(--bg-float); }
.panel-body .idcard { --ring: var(--bg-1); padding: 0 0 8px; }
.id-aura { position: relative; align-self: stretch; margin: 0 -16px; padding: 28px 0 10px; display: grid; place-items: center; background: radial-gradient(ellipse 70% 90% at 50% 0%, color-mix(in oklab, var(--aura-a) 60%, transparent), transparent 75%), radial-gradient(ellipse 50% 70% at 85% 10%, color-mix(in oklab, var(--aura-b) 45%, transparent), transparent 70%); }
.panel-body .id-aura { margin: -6px -12px 0; }
.id-badges { position: absolute; top: 10px; right: 12px; display: flex; gap: 4px; }
.id-badge { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in oklab, var(--bg-0) 55%, transparent); backdrop-filter: blur(6px); }
.id-names { display: grid; justify-items: center; gap: 3px; }
.id-names h3 { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: var(--display-track); }
.id-handle { display: flex; gap: 8px; font-size: 13.5px; color: var(--text-3); }
.id-pron { padding: 0 8px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 12px; }
.id-presence { display: inline-flex; align-items: center; gap: 7px; margin-top: 4px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.id-now { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 6px 14px; border-radius: 999px; background: var(--surface); font-size: 13px; color: var(--text-1); }
.id-now span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.id-about { align-self: stretch; margin: 0; padding: 10px 14px; border: 0; border-radius: 16px; background: color-mix(in oklab, var(--text-1) 5%, transparent); font-size: 13.5px; color: var(--text-msg); text-align: left; position: relative; }
.id-about::before { content: "“"; position: absolute; top: -10px; left: 10px; font-family: var(--display); font-size: 34px; color: var(--accent); line-height: 1; }
.id-facts { align-self: stretch; display: grid; gap: 6px; text-align: left; }
.id-fact { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.id-fact strong { color: var(--text-1); }
.id-fact-ic { width: 28px; height: 28px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--text-3); }
.id-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.id-mutual { display: inline-flex; align-items: center; gap: 8px; }
.id-note { align-self: stretch; resize: none; padding: 8px 12px; border-radius: 14px; border: 1.5px dashed var(--line-2); background: transparent; color: var(--text-2); font-size: 13px; outline: none; overflow: hidden; }
.id-note:focus { border-style: solid; border-color: var(--accent); }
.id-msg { align-self: stretch; display: flex; gap: 6px; }
.id-msg-input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--bg-1); border: 1.5px solid var(--line-2); color: var(--text-1); outline: none; font-size: 13.5px; }
.id-msg-input:focus { border-color: var(--accent); }
.id-msg .round-btn { width: 40px; height: 40px; }
.panel-body .id-msg { display: none; }
.id-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

/* ---------------------------------------------------------------- the round table */

.view-room { background: var(--bg-2); }
.table-wrap { flex: 1; min-height: 0; display: grid; place-items: center; padding: 24px 48px 8px; overflow: hidden; }
.table-scene { position: relative; width: min(100%, 900px, calc((100dvh - 290px) * 1.6)); aspect-ratio: 16 / 10; }
.tbl-shadow { display: none; }
.tbl { position: absolute; left: 30%; right: 30%; top: 32%; bottom: 32%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; text-align: center; border-radius: 16px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow-2); }
.tbl::before { content: none; }
.tbl-name { position: relative; font-family: var(--display); font-size: clamp(16px, 2vw, 22px); font-weight: 700; color: var(--text-1); letter-spacing: var(--display-track); }
.tbl-status { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: var(--surface); color: var(--text-1); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl .pill { position: relative; }
.tbl-hint { position: relative; font-size: 12px; color: var(--text-3); }
.chair { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 1; --ring: var(--bg-2); animation: seatIn .4s var(--spring) backwards; }
.chair-av { position: relative; display: grid; transition: transform .25s var(--spring); }
.chair .avatar { box-shadow: 0 10px 22px rgba(0, 0, 0, .35); }
.chair.speaking .chair-av { transform: scale(1.08) rotate(-3deg); }
.chair:hover .chair-av { transform: translateY(-3px); }
.chair-name { padding: 2px 10px; border-radius: 999px; background: var(--bg-float); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--text-1); white-space: nowrap; box-shadow: var(--shadow-1); }
.chair.me .chair-name { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.chair.muted .chair-name { color: var(--text-3); }
.chair.silenced .chair-av { opacity: .5; }
.chair-flag { position: absolute; bottom: -2px; right: -5px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--danger); color: #fff; box-shadow: 0 0 0 3px var(--bg-2); }
.chair-flag.left { right: auto; left: -5px; background: var(--surface-2); color: var(--text-1); }
.chair.empty { animation: none; }
.chair-ghost { width: 54px; height: 54px; display: grid; place-items: center; color: var(--text-4); border: 2px dashed var(--line-3); border-radius: 46% 54% 52% 48% / 55% 45% 55% 45%; transition: border-color .15s, color .15s, background .15s; }
.chair.small .chair-ghost { width: 44px; height: 44px; }
.chair.empty:not(:disabled):hover .chair-ghost { border-color: var(--sage); color: var(--sage); background: var(--sage-soft); }
.chair.empty:disabled { cursor: default; opacity: .6; }
.room-dock { flex: none; display: flex; justify-content: center; padding: 0 16px 22px; min-height: 22px; }
.dock { display: flex; align-items: center; gap: 6px; padding: 7px; border-radius: 999px; background: var(--bg-float); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); animation: slideUp .35s var(--spring); }
.dock-signal { display: inline-flex; align-items: center; gap: 6px; padding: 0 8px 0 12px; font-size: 12px; color: var(--sage); font-weight: 700; font-variant-numeric: tabular-nums; }
.dock-sep { width: 1px; height: 26px; background: var(--line-2); margin: 0 4px; }
.dock-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 14px; border-radius: 999px; background: var(--surface); color: var(--text-1); font-weight: 650; font-size: 13.5px; transition: background .15s, color .15s, transform .15s var(--spring); }
.dock-btn:hover { background: var(--surface-2); }
.dock-btn:active { transform: scale(.95); }
.dock-btn.off { background: var(--danger-soft); color: var(--danger); }
.dock-btn.on .ico { color: var(--sage); }

/* ---------------------------------------------------------------- home */

.home-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px 24px; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; max-width: 1240px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); --ring: var(--card); min-width: 0; }
.tile-hero { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px 14px 20px; background: radial-gradient(ellipse 60% 120% at 0% 0%, var(--accent-soft-2), transparent 70%), var(--card); }
.hero-text { display: grid; gap: 2px; }
.hero-text h2 { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: var(--display-track); }
.hero-text p { color: var(--text-2); font-size: 13.5px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-stat { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 6px; padding: 6px 12px 7px; min-width: 96px; border-radius: 8px; background: var(--bg-1); border: 1px solid var(--line); text-align: left; transition: transform .15s var(--spring), border-color .15s; }
.hero-stat:not(:disabled):hover { transform: translateY(-2px); border-color: var(--line-3); }
.hero-stat .ico { color: var(--accent); }
.hero-stat strong { font-family: var(--display); font-size: 18px; line-height: 1.1; }
.hero-stat span { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-3); }
.hero-stat.zero { opacity: .55; }
.hero-stat:disabled { cursor: default; }
.tile-head { display: flex; align-items: center; gap: 10px; }
.tile-head h3 { font-size: 14px; font-weight: 750; }
.tile-ic { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tile-badge { margin-left: auto; padding: 1px 9px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 700; }
.tile-wide { grid-column: 1 / -1; }
.face-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 2px; }
.face { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 2px 5px; border-radius: 12px; font-size: 12px; font-weight: 650; color: var(--text-2); transition: background .12s; }
.face:hover { background: var(--hover); color: var(--text-1); }
.face:hover .avatar { transform: rotate(-6deg); }
.live-list, .req-list, .mention-list { display: grid; gap: 2px; }
.live-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; cursor: pointer; transition: background .12s; }
.live-row:hover { background: var(--hover); }
.live-row .room-wave i { background: var(--sage); }
.lr-text { flex: 1; min-width: 0; display: grid; }
.lr-text strong { font-size: 13.5px; }
.live-row .room-go { top: 50%; right: 6px; margin-top: -13px; }
.lr-text span { font-size: 12px; color: var(--text-3); }
.req-row { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.req-text { flex: 1; min-width: 0; display: grid; }
.req-text span { font-size: 12.5px; color: var(--text-3); }
.req-btns { display: flex; gap: 6px; }
.mention-row { display: flex; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 12px; text-align: left; transition: background .12s; }
.mention-row:hover { background: var(--hover); }
.mr-text { flex: 1; min-width: 0; }
.mr-meta { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--text-3); }
.mr-meta strong { color: var(--text-1); font-size: 13.5px; }
.mr-time { margin-left: auto; }
.mr-text p { font-size: 14px; color: var(--text-msg); margin-top: 2px; }
.friends-wrap { display: grid; gap: 16px; max-width: 1240px; }
.friends-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.friends-bar .input-search { max-width: 280px; margin-left: auto; }
.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.friend-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 22px 14px 14px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); text-align: center; cursor: pointer; transition: transform .2s var(--spring), border-color .15s; --ring: var(--card); }
.friend-card:hover { transform: translateY(-3px) rotate(-.5deg); border-color: var(--line-3); }
.friend-card.away { opacity: .7; }
.fc-name { margin-top: 10px; font-size: 15px; font-weight: 750; }
.fc-user { font-size: 12.5px; color: var(--text-3); }
.fc-act { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.fc-btns { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.pop-add { width: 360px; }
.add-friend { display: grid; gap: 8px; padding: 16px; }
.af-title { font-family: var(--display); font-size: 18px; }
.af-sub { font-size: 13px; color: var(--text-3); }
.af-row { display: flex; gap: 8px; margin-top: 4px; }
.af-msg { font-size: 13px; }
.af-msg:empty { display: none; }
.af-msg.error { color: var(--danger); }
.af-msg.success { color: var(--sage); }
.af-suggest { display: grid; gap: 2px; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line-2); --ring: var(--bg-float); }
.af-label { font-size: 12px; font-weight: 700; color: var(--text-3); padding: 0 6px 4px; }
.af-person { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; text-align: left; font-weight: 600; }
.af-person:hover { background: var(--hover); }
.af-person small { margin-left: auto; color: var(--text-3); font-weight: 500; }

/* ---------------------------------------------------------------- explore */

.explore-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 18px 28px; display: grid; grid-auto-rows: max-content; gap: 14px; align-content: start; }
.explore-search { width: 300px; }
.explore-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.explore-content { display: grid; gap: 18px; min-width: 0; }
.spotlight { display: grid; grid-template-columns: 1fr 1fr; min-height: 210px; border-radius: 12px; overflow: hidden; background: var(--card); border: 1px solid var(--line); --ring: var(--card); }
.spot-art { background: var(--art) center / cover; position: relative; }
.spot-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 55%, var(--card)); }
.spot-body { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 20px 24px 20px 12px; }
.spot-kicker { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 750; }
.spot-title { display: flex; align-items: center; gap: 12px; }
.spot-title h2 { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: var(--display-track); line-height: 1.1; }
.spot-body p { color: var(--text-2); font-size: 14px; }
.spot-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--text-3); }
.spot-meta > span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.spot-btns { display: flex; gap: 8px; margin-top: 2px; }
.spot-btns .pill { height: 34px; padding: 0 15px; font-size: 13.5px; }
.shelf { min-width: 0; }
.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.shelf-head h2 { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 16px; font-weight: 700; letter-spacing: var(--display-track); }
.shelf-head h2 .ico { color: var(--accent); }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 280px); gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x mandatory; }
.g-card { position: relative; display: flex; flex-direction: column; gap: 7px; padding: 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); overflow: hidden; cursor: pointer; isolation: isolate; scroll-snap-align: start; transition: transform .2s var(--spring), border-color .15s, box-shadow .2s; --ring: var(--card); }
.g-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--art) center / cover; opacity: .2; -webkit-mask-image: linear-gradient(to bottom, #000, transparent 70%); mask-image: linear-gradient(to bottom, #000, transparent 70%); }
.g-card:hover { transform: translateY(-3px); border-color: var(--line-3); box-shadow: var(--shadow-2); }
.gc-top { display: flex; align-items: center; gap: 10px; }
.gc-top .guild-icon { box-shadow: 0 0 0 3px var(--card); }
.gc-titles { min-width: 0; display: grid; gap: 2px; }
.gc-titles h3 { display: flex; align-items: center; gap: 5px; font-size: 14.5px; font-weight: 750; }
.gc-titles h3 > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-stats { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.gc-desc { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 37px; }
.gc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.gc-cat { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.explore-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.g-card:hover .pill-ghost:not(.joined) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.modal-peek .modal-body { padding: 0; gap: 0; }
.peek-art { position: relative; height: 210px; display: flex; align-items: flex-end; padding: 20px 22px; background-size: cover; background-position: center; }
.peek-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(18, 12, 8, .85), transparent 70%); }
.peek-id { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; color: #fff6ea; }
.peek-id h2 { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 25px; font-weight: 700; }
.peek-meta { font-size: 13px; opacity: .85; }
.peek-desc { padding: 18px 22px 0; color: var(--text-2); font-size: 15px; }
.peek-shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 16px 22px 22px; }
.peek-shot { aspect-ratio: 16 / 10; border-radius: 14px; background-size: cover; background-position: center; }

/* ---------------------------------------------------------------- floating layer */

.layer { position: relative; z-index: 900; }
.floating { position: fixed; z-index: 900; animation: popIn .16s var(--ease-out); }
.floating[data-side="top"] { transform-origin: bottom center; }
.floating[data-side="bottom"] { transform-origin: top center; }
.floating[data-side="left"] { transform-origin: right center; }
.floating[data-side="right"] { transform-origin: left center; }
.floating.closing { animation: popOut .12s forwards; pointer-events: none; }
.tooltip { position: fixed; z-index: 1000; pointer-events: none; max-width: 280px; padding: 6px 11px; border-radius: 10px; background: var(--tip-bg); color: #f7eee3; font-size: 12.5px; font-weight: 650; line-height: 1.35; box-shadow: var(--shadow-2); opacity: 0; transform: translateY(2px); transition: opacity .1s, transform .15s var(--ease-out); }
.tooltip.show { opacity: 1; transform: none; }
.menu { min-width: 220px; max-width: 300px; padding: 6px; border-radius: 18px; background: var(--bg-float); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); max-height: calc(100dvh - 16px); overflow-y: auto; }
.menu-wide { min-width: 240px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 12px; border-radius: 12px; color: var(--text-2); font-size: 14px; font-weight: 550; text-align: left; outline: none; }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); color: var(--text-1); }
.menu-item .ico { color: var(--text-3); }
.menu-item:hover .ico { color: inherit; }
.menu-item.accent { color: var(--accent-text); }
.menu-item.accent .ico { color: inherit; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .ico { color: inherit; }
.menu-item.danger:hover, .menu-item.danger:focus-visible { background: var(--danger-soft); }
.menu-item.disabled { opacity: .4; pointer-events: none; }
.mi-label { flex: 1; min-width: 0; display: grid; }
.mi-label small { font-size: 12px; color: var(--text-3); font-weight: 450; }
.menu-item kbd { margin-left: auto; }
.mi-check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-3); display: grid; place-items: center; flex: none; }
.mi-check.on { background: var(--accent); border-color: var(--accent); }
.mi-check.on .ico { color: #fff; }
.menu-sep { height: 1px; margin: 5px 8px; background: var(--line); }
.menu-header { padding: 8px 12px 4px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.menu-volume { padding: 8px 12px 10px; display: grid; gap: 8px; }
.mv-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--text-3); }
.vol-val { color: var(--text-1); font-variant-numeric: tabular-nums; }
.popover { padding: 0; border-radius: 22px; background: var(--bg-float); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); overflow: hidden; --ring: var(--bg-float); }
.pop-title { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 16px; }
.pop-title strong { font-family: var(--display); font-size: 17px; }
.pop-title .pill { margin-left: auto; }
.pop-search, .pop-inbox { width: 420px; max-width: calc(100vw - 16px); }
.search-results { display: grid; max-height: min(560px, calc(100dvh - 120px)); }
.sr-head { padding: 14px 16px 10px; font-size: 13px; color: var(--text-3); border-bottom: 1px solid var(--line); }
.sr-head strong { color: var(--text-1); }
.sr-list { overflow-y: auto; padding: 6px; display: grid; gap: 2px; }
.sr-item { display: flex; gap: 10px; padding: 10px; border-radius: 14px; text-align: left; }
.sr-item:hover { background: var(--hover); }
.sr-main { min-width: 0; flex: 1; }
.sr-meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--text-3); }
.sr-meta strong { font-size: 13.5px; color: var(--text-1); }
.sr-main p { font-size: 14px; color: var(--text-msg); margin-top: 2px; }
.inbox { display: grid; max-height: min(600px, calc(100dvh - 100px)); }
.inbox .seg-tabs { margin: 0 12px 8px; }
.inbox-list { overflow-y: auto; padding: 4px 6px 8px; display: grid; gap: 2px; }
.inbox-item { position: relative; display: flex; gap: 12px; padding: 10px; border-radius: 16px; text-align: left; }
.inbox-item:hover { background: var(--hover); }
.inbox-item.unread::after { content: ""; position: absolute; right: 12px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ii-main { flex: 1; min-width: 0; }
.ii-meta { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--text-3); padding-right: 16px; }
.ii-meta strong { font-size: 13.5px; color: var(--text-1); }
.ii-where { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ii-time { margin-left: auto; white-space: nowrap; }
.ii-main p { font-size: 14px; color: var(--text-msg); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.pop-emoji { width: 372px; max-width: calc(100vw - 16px); }
.emoji-picker { display: grid; grid-template-rows: auto auto 1fr; height: min(420px, calc(100dvh - 120px)); }
.ep-head { padding: 12px 12px 6px; }
.ep-search { width: 100%; height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--bg-1); outline: none; color: var(--text-1); }
.ep-search:focus { border-color: var(--accent); }
.ep-tabs { display: flex; gap: 2px; padding: 2px 10px 8px; overflow-x: auto; scrollbar-width: none; }
.ep-tab { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); }
.ep-tab:hover { color: var(--text-1); background: var(--hover); }
.ep-tab.active { color: var(--on-accent); background: var(--accent); }
.ep-grid { position: relative; overflow-y: auto; padding: 0 8px 10px; min-height: 0; border-top: 1px solid var(--line); }
.ep-section h4 { position: sticky; top: 0; z-index: 1; padding: 10px 6px 6px; background: var(--bg-float); font-size: 12px; font-weight: 700; color: var(--text-3); }
.ep-cells { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.ep-cell { aspect-ratio: 1; display: grid; place-items: center; border-radius: 14px; font-size: 24px; line-height: 1; transition: background .08s, transform .15s var(--spring); }
.ep-cell:hover { background: var(--hover); transform: scale(1.15) rotate(-6deg); }
.ep-empty { display: grid; justify-items: center; gap: 8px; padding: 40px 10px; color: var(--text-3); }
.ep-empty span { font-size: 36px; }

/* modals */
.modal-root { position: relative; z-index: 800; }
.modal-wrap { position: fixed; inset: 0; z-index: 800; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(4px); animation: fadeIn .18s; }
.modal { position: relative; width: 100%; max-width: 520px; max-height: calc(100dvh - 48px); display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 26px; box-shadow: var(--shadow-3); animation: modalIn .3s var(--spring); overflow: hidden; --ring: var(--bg-2); }
.modal-sm { max-width: 460px; }
.modal-md { max-width: 600px; }
.modal-lg { max-width: 860px; }
.modal-wrap.closing .modal { animation: modalOut .16s forwards; }
.modal-wrap.closing .modal-backdrop { animation: fadeOut .16s forwards; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 22px 18px 4px 24px; }
.modal-titles { flex: 1; min-width: 0; }
.modal-head h2 { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: var(--display-track); }
.modal-head p { margin-top: 3px; font-size: 14px; color: var(--text-3); }
.modal-x { width: 36px; height: 36px; border-radius: 50%; }
.modal-body { padding: 16px 24px 22px; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 18px 18px; }
.modal-gi { display: grid; }

/* start a guild */
.start { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 22px; }
.start-preview { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 20px; background: var(--grain), var(--bg-0); border: 1px solid var(--line); }
.sp-bar { display: flex; padding: 8px; border-radius: 999px; background: var(--bg-1); }
.start-form { display: grid; gap: 16px; align-content: start; min-width: 0; }
.icon-picks { display: grid; grid-template-columns: repeat(auto-fill, 42px); gap: 6px; }
.icon-pick { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: var(--bg-1); border: 1.5px solid var(--line); overflow: hidden; transition: transform .15s var(--spring), border-color .15s; }
.icon-pick:hover { transform: rotate(-8deg) scale(1.08); }
.icon-pick.on { border-color: var(--accent); background: var(--accent-soft); }
.icon-pick img { width: 100%; height: 100%; object-fit: cover; }
.icon-pick.upload { color: var(--text-3); border-style: dashed; }
.layouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.layout { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--bg-1); border: 1.5px solid var(--line); text-align: left; transition: border-color .15s; }
.layout:hover { border-color: var(--line-3); }
.layout.on { border-color: var(--accent); background: var(--accent-soft); }
.layout-emoji { font-size: 22px; }
.layout-text { display: grid; min-width: 0; }
.layout-text strong { font-size: 14px; }
.layout-text small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.start-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.join { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 22px; align-items: center; }
.join-art { display: grid; justify-items: center; gap: 8px; padding: 26px 20px; border-radius: 20px; background: var(--bg-1); border: 2px dashed var(--line-3); text-align: center; }
.join-art p { font-size: 13px; color: var(--text-3); }
.ja-ticket { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); transform: rotate(-8deg); box-shadow: var(--shadow-2); }
.join-form { display: grid; gap: 12px; justify-items: start; }
.join-form .field { width: 100%; }

/* invite */
.invite-share { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border-radius: 20px; background: repeating-linear-gradient(-45deg, transparent 0 10px, color-mix(in oklab, var(--text-1) 3%, transparent) 10px 20px), var(--bg-1); border: 2px dashed var(--line-3); }
.invite-code { display: grid; gap: 2px; min-width: 0; }
.ic-label { font-size: 12px; font-weight: 700; color: var(--text-3); }
.ic-code { font-family: var(--mono); font-size: 28px; letter-spacing: .08em; color: var(--text-1); }
.ic-url { font-family: var(--mono); font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-btns { display: grid; gap: 6px; }
.invite-people { display: grid; gap: 2px; max-height: 220px; overflow-y: auto; }
.ip-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 12px; }
.ip-row:hover { background: var(--hover); }
.ip-name { flex: 1; min-width: 0; display: grid; }
.ip-name small { font-size: 12px; color: var(--text-3); }

/* channel kinds */
.kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kind { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 18px; background: var(--bg-1); border: 1.5px solid var(--line); text-align: left; transition: border-color .15s, transform .15s var(--spring); }
.kind:hover { border-color: var(--line-3); transform: translateY(-2px); }
.kind.on { border-color: var(--accent); background: var(--accent-soft); }
.kind-ic { width: 38px; height: 38px; margin-bottom: 4px; border-radius: 13px; display: grid; place-items: center; background: var(--surface); color: var(--text-2); }
.kind.on .kind-ic { background: var(--accent); color: var(--on-accent); }
.kind strong { font-size: 15px; }
.kind span:last-child { font-size: 12.5px; color: var(--text-3); }

/* small sheets */
.newdm { width: 340px; display: grid; }
.newdm .input-search { margin: 0 12px 8px; width: calc(100% - 24px); }
.newdm-list { max-height: 320px; overflow-y: auto; padding: 0 6px 8px; }
.newdm-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 14px; text-align: left; }
.newdm-row:hover { background: var(--hover); }
.nd-name { flex: 1; display: grid; }
.nd-name small { font-size: 12px; color: var(--text-3); }
.nd-go { color: var(--text-3); }
.with-emoji .input { padding-left: 48px; padding-right: 40px; }
.note-emoji { position: absolute; left: 7px; z-index: 1; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; color: var(--text-3); }
.note-emoji:hover { background: var(--hover); }
.note-clear { position: absolute; right: 9px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); background: var(--surface); }
.shortcuts { display: grid; gap: 20px; }
.shortcuts h4 { font-family: var(--display); font-size: 15px; margin-bottom: 4px; }
.sc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line-2); font-size: 14px; }
.sc-keys { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* palette */
.modal-wrap:has(.modal-palette) { place-items: start center; padding-top: 11vh; }
.modal-palette { max-width: 620px; }
.modal-palette .modal-body { padding: 0; gap: 0; }
.palette { display: grid; grid-template-rows: auto 1fr auto; max-height: min(560px, 76dvh); }
.pal-head { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 62px; border-bottom: 1px solid var(--line); color: var(--accent); }
.pal-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 17px; color: var(--text-1); }
.pal-input::placeholder { color: var(--text-4); }
.pal-list { overflow-y: auto; padding: 6px 8px 8px; min-height: 0; }
.pal-group { padding: 10px 12px 4px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.pal-item { display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 12px; border-radius: 14px; color: var(--text-2); text-align: left; }
.pal-item.active { background: var(--accent-soft); color: var(--text-1); }
.pal-item.unread .pal-label { color: var(--text-1); font-weight: 750; }
.pal-lead { width: 24px; display: grid; place-items: center; color: var(--text-3); }
.pal-label { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-label mark { background: transparent; color: var(--accent-text); font-weight: 800; padding: 0; border-radius: 0; }
.pal-sub { flex: 1; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-empty { display: grid; justify-items: center; gap: 4px; padding: 36px 0; color: var(--text-3); }
.pal-empty strong { color: var(--text-1); }
.pal-foot { display: flex; align-items: center; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.pal-foot > span { display: inline-flex; align-items: center; gap: 4px; }
.pal-tip { margin-left: auto; }
.pal-tip code { font-family: var(--mono); color: var(--text-2); background: var(--surface); padding: 1px 6px; border-radius: 6px; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }

/* toasts drop from the top */
.toast-root { position: fixed; top: 70px; left: 50%; z-index: 950; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
/* the switcher opens near the top, so toasts rise from the bottom while it's open */
body:has(.modal-palette) .toast-root { top: auto; bottom: 24px; }
body:has(.modal-palette) .toast { animation-name: toastUp; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; width: min(420px, calc(100vw - 24px)); padding: 8px 8px 8px 10px; border-radius: 22px; background: var(--bg-float); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); animation: toastIn .4s var(--spring); --ring: var(--bg-float); }
.toast.clickable { cursor: pointer; }
.toast.clickable:hover { border-color: var(--line-3); }
.toast.closing { animation: toastOut .22s forwards; }
.toast-icon { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tone-success .toast-icon { background: var(--sage-soft); color: var(--sage); }
.tone-danger .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.toast-text strong { font-size: 14px; font-weight: 700; }
.toast-text span { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toast-action { height: 30px; padding: 0 12px; border-radius: 999px; background: var(--surface); font-weight: 650; font-size: 13px; }
.toast-x { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); }
.toast-x:hover { color: var(--text-1); background: var(--hover); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 850; display: flex; flex-direction: column; background: rgba(12, 8, 5, .92); backdrop-filter: blur(8px); animation: fadeIn .18s; }
.lightbox.closing { animation: fadeOut .16s forwards; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; color: #f7eee3; }
.lb-name { font-weight: 650; font-size: 14px; opacity: .85; }
.lb-actions { display: flex; gap: 4px; }
.lb-actions .icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: rgba(247, 238, 227, .8); }
.lb-actions .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.lb-stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: auto; padding: 0 24px 8px; cursor: zoom-out; }
.lb-img { max-width: min(92vw, 1400px); max-height: calc(100dvh - 120px); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); cursor: zoom-in; transition: transform .3s var(--ease-out); animation: lbIn .3s var(--ease-out); }
.lightbox.zoomed .lb-img { transform: scale(1.8); cursor: zoom-out; }
.lb-hint { text-align: center; padding: 6px 0 14px; color: rgba(247, 238, 227, .45); font-size: 12px; }

.conn-banner { position: absolute; left: 50%; top: 12px; z-index: 30; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 14px; border-radius: 999px; background: var(--amber); color: #2b1d08; font-size: 13.5px; box-shadow: var(--shadow-3); transform: translate(-50%, -80px); transition: transform .4s var(--spring); white-space: nowrap; }
.conn-banner.show { transform: translate(-50%, 0); }
.conn-banner.ok { background: var(--sage); color: #14200a; padding-right: 16px; }
.cb-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.cb-btn { height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(0, 0, 0, .15); font-weight: 700; }
.cb-btn:hover { background: rgba(0, 0, 0, .25); }

/* ---------------------------------------------------------------- preference sheets */

.sheet-wrap { position: fixed; inset: 0; z-index: 700; display: grid; place-items: center; padding: 28px; }
.sheet-wrap.closing { animation: fadeOut .18s forwards; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(5px); animation: fadeIn .2s; }
.sheet { position: relative; width: min(1000px, 100%); height: min(780px, 100%); display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 28px; box-shadow: var(--shadow-3); overflow: hidden; animation: sheetPop .35s var(--spring); --ring: var(--bg-2); }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 18px 16px 4px 22px; }
.sheet-lead { display: grid; }
.sheet-head h1 { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: var(--display-track); }
.sheet-head-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sheet-version { font-size: 11.5px; color: var(--text-4); }
.sheet-tabs { display: flex; gap: 6px; padding: 10px 18px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); flex: none; }
.sheet-tabs::-webkit-scrollbar { display: none; }
.sheet-tab { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 15px 0 12px; border-radius: 999px; flex: none; color: var(--text-2); font-weight: 650; font-size: 13.5px; transition: background .15s, color .15s; }
.sheet-tab:hover { background: var(--hover); color: var(--text-1); }
.sheet-tab.on { background: var(--text-1); color: var(--bg-2); }
.sheet-tab.danger { color: var(--danger); }
.tab-new { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.sheet-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.sheet-content { max-width: 780px; margin: 0 auto; padding: 24px 28px 120px; }
.sheet-page { display: grid; gap: 20px; animation: pageIn .25s var(--ease-out); }
.page-head h2 { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: var(--display-track); }
.page-head p { margin-top: 4px; color: var(--text-3); font-size: 14.5px; }
.pref-group { display: grid; gap: 8px; }
.pref-group > h3 { font-size: 13px; font-weight: 750; color: var(--text-2); padding-left: 4px; }
.pref-card { display: grid; gap: 10px; padding: 14px 18px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); --ring: var(--card); }
.choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.choices.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border-radius: 18px; background: var(--bg-1); border: 1.5px solid var(--line); text-align: left; transition: border-color .15s, transform .15s var(--spring); }
.choice:hover { border-color: var(--line-3); }
.choice.on { border-color: var(--accent); }
.choice-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--text-2); }
.choice.on .choice-ic { background: var(--accent); color: var(--on-accent); }
.choice-text { display: grid; gap: 2px; padding-right: 22px; }
.choice-text strong { font-size: 14px; }
.choice-text span { font-size: 12.5px; color: var(--text-3); }
.choice-tick { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-3); color: transparent; }
.choice.on .choice-tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.grp-name-row { display: flex; align-items: flex-start; gap: 12px; }
.grp-name-row + .grp-name-row { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.grp-name-row .field { flex: 1; min-width: 0; }
.grp-name-ic { width: 34px; height: 34px; margin-top: 22px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.grp-ideas { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.grp-ideas .chip { height: 26px; padding: 0 10px; font-size: 12px; }
.theme-choices { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.theme-choices .choice { padding: 8px 8px 12px; }
.theme-choices .choice-text { padding: 0 4px; }
.theme-prev { display: flex; flex-direction: column; width: 100%; height: 78px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.theme-prev .tp-bar { height: 12px; flex: none; }
.tp-body { flex: 1; display: flex; gap: 4px; padding: 4px; }
.tp-pane { width: 30%; border-radius: 6px; }
.tp-cards { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 6px; }
.tp-cards i { display: block; height: 10px; width: 62%; border-radius: 5px; }
.tp-cards .tp-mine { align-self: flex-end; width: 44%; background: var(--accent) !important; }
.theme-prev[data-t="classic"] { background: #07090c; }
.theme-prev[data-t="classic"] .tp-pane { background: #0b0e12; }
.theme-prev[data-t="classic"] .tp-cards { background: #0f1217; }
.theme-prev[data-t="classic"] .tp-cards i { background: #19202b; }
.theme-prev[data-t="desert"] { background: #1d1b16; }
.theme-prev[data-t="desert"] .tp-pane { background: #211f19; }
.theme-prev[data-t="desert"] .tp-cards { background: #24221c; }
.theme-prev[data-t="desert"] .tp-cards i { background: #3f3b2e; }
.theme-prev[data-t="desert"] .tp-mine { background: #e18245 !important; }
.theme-prev[data-t="dark"] { background: #120e0b; }
.theme-prev[data-t="dark"] .tp-pane { background: #1a1511; }
.theme-prev[data-t="dark"] .tp-cards { background: #1f1915; }
.theme-prev[data-t="dark"] .tp-cards i { background: #312821; }
.theme-prev[data-t="light"] { background: #e7ddd0; }
.theme-prev[data-t="light"] .tp-pane { background: #f3ece3; }
.theme-prev[data-t="light"] .tp-cards { background: #faf6f0; }
.theme-prev[data-t="light"] .tp-cards i { background: #e8ddcf; }
.theme-prev[data-t="midnight"] { background: #050403; }
.theme-prev[data-t="midnight"] .tp-pane { background: #0b0907; }
.theme-prev[data-t="midnight"] .tp-cards { background: #0e0b09; }
.theme-prev[data-t="midnight"] .tp-cards i { background: #1f1914; }
.theme-prev[data-t="system"] { background: linear-gradient(135deg, #e7ddd0 50%, #07090c 50%); }
.theme-prev[data-t="system"] .tp-pane, .theme-prev[data-t="system"] .tp-cards { background: transparent; }
.theme-prev[data-t="system"] .tp-cards i { background: #958573; }
.accent-row { display: flex; flex-wrap: wrap; gap: 8px; }
.accent-swatch { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px 0 8px; border-radius: 999px; background: var(--bg-1); border: 1.5px solid var(--line); font-weight: 650; font-size: 13px; transition: border-color .15s; }
.accent-swatch:hover { border-color: var(--line-3); }
.accent-swatch.on { border-color: var(--text-1); }
.as-dot { width: 22px; height: 22px; border-radius: 42% 58% 55% 45% / 48% 45% 55% 52%; }
.look-box { padding: 6px 20px 18px; border-radius: 22px; background: var(--bg-2); border: 1px solid var(--line); pointer-events: none; }
.look-preview { display: flex; flex-direction: column; }
.look-preview .turn { --group-gap: 8px; }
.profile-editor { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; align-items: start; }
.pe-form { display: grid; gap: 18px; }
.profile-preview { position: sticky; top: 0; display: grid; gap: 8px; }
.pp-card { border-radius: 22px; background: var(--bg-float); border: 1px solid var(--line-2); overflow: hidden; box-shadow: var(--shadow-2); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; transition: transform .15s var(--spring); }
.swatch:hover { transform: scale(1.1); }
.swatch.on { box-shadow: 0 0 0 3px var(--bg-2), 0 0 0 5px var(--text-1); }
.save-bar { position: absolute; left: 50%; bottom: 20px; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 6px 6px 6px 18px; border-radius: 999px; background: var(--text-1); color: var(--bg-2); font-weight: 650; font-size: 14px; box-shadow: var(--shadow-3); transform: translate(-50%, 180%); transition: transform .4s var(--spring); white-space: nowrap; }
.save-bar.show { transform: translate(-50%, 0); }
.save-bar > span { display: inline-flex; align-items: center; gap: 8px; }
.sb-btns { display: flex; gap: 6px; }
.save-bar .pill-ghost { color: var(--bg-2); border-color: color-mix(in oklab, var(--bg-2) 30%, transparent); }
.save-bar .pill-ghost:hover { background: color-mix(in oklab, var(--bg-2) 10%, transparent); color: var(--bg-2); }
.acct-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.acct-row + .acct-row { border-top: 1px solid var(--line); padding-top: 12px; }
.acct-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.acct-label { font-size: 12px; font-weight: 700; color: var(--text-3); }
.acct-value { display: flex; align-items: baseline; gap: 8px; font-size: 15px; }
.acct-value.muted { font-size: 13.5px; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pw-meter i { height: 5px; border-radius: 3px; background: var(--surface-2); transition: background .2s; }
.pw-meter[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-score="2"] i:nth-child(-n+2) { background: var(--amber); }
.pw-meter[data-score="3"] i:nth-child(-n+3) { background: #b5c46a; }
.pw-meter[data-score="4"] i { background: var(--sage); }
.pw-hint { font-size: 12.5px; color: var(--text-3); }
.mic-test { display: flex; align-items: center; gap: 16px; }
.mic-test .pill { flex: none; min-width: 168px; }
.mm-wrap { position: relative; flex: 1; }
.mic-meter { display: flex; gap: 3px; height: 30px; align-items: center; }
.mic-meter i { flex: 1; height: 100%; border-radius: 999px; background: var(--surface-2); transition: background .05s; }
.mic-meter i.on { background: var(--text-3); }
.mic-meter i.on.hot { background: var(--sage); }
.mm-threshold { position: absolute; top: -6px; bottom: -6px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--amber); box-shadow: 0 0 0 2px var(--card); transition: left .2s; }
.mm-status { font-size: 13px; color: var(--text-3); }
.mm-status:empty { display: none; }
.sens-wrap { display: grid; gap: 10px; }
.ptt-row { display: flex; align-items: center; gap: 12px; }
.keybind { min-width: 130px; height: 38px; padding: 0 16px; border-radius: 999px; background: var(--bg-1); border: 1.5px solid var(--line-2); font-family: var(--mono); font-weight: 700; }
.keybind-recording { border-color: var(--danger); color: var(--danger); animation: pulseBorder 1.2s infinite; }
.kb-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; font-size: 14px; }
.kb-row + .kb-row { border-top: 1px dashed var(--line-2); padding-top: 10px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat { display: grid; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--bg-1); min-width: 0; }
.stat strong { font-family: var(--display); font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spark-wrap { padding: 10px; border-radius: 16px; background: var(--bg-1); }
.spark { width: 100%; height: 90px; display: block; }
.lab-row { display: flex; align-items: center; gap: 14px; padding: 6px 0; }
.lab-row + .lab-row { border-top: 1px dashed var(--line-2); padding-top: 12px; }
.lab-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--text-2); flex: none; }
.lab-text { flex: 1; display: grid; gap: 2px; }
.lab-text span { font-size: 13px; color: var(--text-3); }
.news-list { display: grid; gap: 14px; }
.news { display: grid; grid-template-columns: 220px minmax(0, 1fr); border-radius: 22px; overflow: hidden; background: var(--card); border: 1px solid var(--line); }
.news-art { background-size: cover; background-position: center; min-height: 140px; }
.news-body { display: grid; gap: 6px; align-content: center; padding: 18px 20px; }
.news-date { font-size: 12px; font-weight: 750; color: var(--accent-text); }
.news-body h3 { font-family: var(--display); font-size: 19px; }
.news-body p { color: var(--text-2); }
.gs-top { display: flex; align-items: flex-start; gap: 22px; }
.gs-icon { display: grid; justify-items: center; gap: 8px; width: 130px; text-align: center; flex: none; }
.gs-fields { flex: 1; display: grid; gap: 14px; }
.icon-upload { position: relative; border-radius: 50%; }
.iu-badge { position: absolute; right: 0; bottom: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 3px var(--card); }
.gs-banner { height: 160px; border-radius: 18px; background-size: cover; background-position: center; border: 1px solid var(--line); }
.gs-banner.empty { background: repeating-linear-gradient(45deg, var(--bg-1), var(--bg-1) 10px, var(--surface) 10px, var(--surface) 20px); }
.people-table { display: grid; gap: 2px; }
.pt-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 16px; }
.pt-row:hover { background: var(--hover); }
.pt-name { flex: 1; min-width: 0; display: grid; }
.pt-name small { font-size: 12px; color: var(--text-3); }
.invite-cards { display: grid; gap: 8px; }
.invite-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border-radius: 18px; background: var(--card); border: 2px dashed var(--line-2); }
.ic-code-btn { font-family: var(--mono); font-size: 17px; font-weight: 700; letter-spacing: .06em; color: var(--text-1); }
.ic-code-btn:hover { color: var(--accent-text); }
.ic-detail { flex: 1; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); min-width: 200px; }
.ban-list { display: grid; gap: 8px; }
.ban-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.ban-text { flex: 1; display: grid; }
.ban-text span { font-size: 13px; color: var(--text-3); }

/* ---------------------------------------------------------------- sign in */

.auth { position: fixed; inset: 0; z-index: 600; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(440px, 1fr); background: var(--bg-2); animation: fadeIn .4s; }
.auth.out { animation: authOut .38s forwards; }
.auth-brand-side { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; padding: 32px 44px 44px; overflow: hidden; color: #f7eee3; background: radial-gradient(ellipse 70% 60% at 30% 20%, rgba(232, 121, 63, .35), transparent 70%), radial-gradient(ellipse 60% 50% at 90% 90%, rgba(207, 109, 168, .25), transparent 70%), var(--grain), linear-gradient(160deg, #2b1e15, #120d09); }
.bp-top { display: flex; align-items: center; gap: 10px; }
.bp-scene { position: relative; flex: 1; min-height: 280px; max-height: 420px; }
.bp-table { position: absolute; left: 22%; right: 22%; top: 34%; bottom: 14%; border-radius: 50%; background: radial-gradient(ellipse at 50% 30%, #7a5536, #4b3221 75%); border: 7px solid #2d1e14; box-shadow: 0 30px 60px rgba(0, 0, 0, .5), inset 0 6px 24px rgba(255, 220, 180, .14); }
.bp-pebble { position: absolute; width: 66px; height: 66px; border-radius: 43% 57% 52% 48% / 55% 45% 55% 45%; box-shadow: 0 12px 24px rgba(0, 0, 0, .4); animation: bob 5s ease-in-out infinite; }
.bp-pebble.p1 { left: 14%; top: 50%; background: linear-gradient(145deg, #f2a25c, #d9653b); }
.bp-pebble.p2 { left: 40%; top: 20%; background: linear-gradient(145deg, #a9c27a, #6f9150); animation-delay: -1.2s; border-radius: 55% 45% 48% 52% / 45% 58% 42% 55%; }
.bp-pebble.p3 { right: 13%; top: 46%; background: linear-gradient(145deg, #d68fb7, #9c4f84); animation-delay: -2.4s; border-radius: 48% 52% 60% 40% / 52% 44% 56% 48%; }
.bp-pebble.p4 { left: 46%; bottom: 0; background: linear-gradient(145deg, #7fb6c9, #3f7f99); animation-delay: -3.3s; border-radius: 58% 42% 46% 54% / 50% 56% 44% 50%; }
.bp-bubble { position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 18px 18px 18px 6px; background: #f7eee3; color: #2b2119; font-weight: 700; font-size: 14px; white-space: nowrap; box-shadow: 0 10px 24px rgba(0, 0, 0, .3); animation: bob 6s ease-in-out infinite; }
.bp-bubble.b1 { left: 4%; top: 30%; }
.bp-bubble.b2 { left: 50%; top: 4%; border-radius: 18px 18px 6px 18px; animation-delay: -2s; }
.bp-bubble.b3 { right: 2%; top: 30%; border-radius: 18px 18px 6px 18px; animation-delay: -4s; }
.bp-bubble.b4 { left: 18%; bottom: 6%; animation-delay: -3s; background: #f0b44e; }
.bp-emoji { font-size: 16px; }
.bp-copy h2 { font-family: var(--display); font-size: 44px; font-weight: 700; letter-spacing: var(--display-track); line-height: 1.05; }
.bp-copy p { max-width: 440px; margin-top: 10px; font-size: 16px; opacity: .8; }
.auth-main { display: grid; place-items: center; padding: 32px; overflow-y: auto; }
.auth-card { width: min(420px, 100%); }
.auth-form { display: grid; gap: 16px; }
.auth-switch { margin-bottom: 8px; }
.auth-head { display: grid; gap: 6px; }
.auth-head h1 { font-family: var(--display); font-size: 32px; font-weight: 700; letter-spacing: var(--display-track); line-height: 1.1; }
.auth-head p { color: var(--text-3); font-size: 15px; }
.known-session { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px 12px 12px; border-radius: 20px; background: var(--card); border: 1.5px solid var(--line-2); text-align: left; transition: border-color .15s, transform .15s var(--spring); --ring: var(--card); }
.known-session:hover { border-color: var(--accent); transform: translateY(-1px); }
.known-session > .ico { color: var(--accent); }
.ks-text { flex: 1; min-width: 0; display: grid; }
.ks-text span { font-size: 12.5px; color: var(--text-3); }
.or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-alt { font-size: 14px; color: var(--text-3); text-align: center; }
.pw { position: relative; }
.pw .input { padding-right: 46px; }
.pw-eye { position: absolute; right: 7px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); }
.pw-eye:hover, .pw-eye.on { color: var(--text-1); background: var(--hover); }
.otp-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp { width: 100%; height: 58px; border-radius: 18px; text-align: center; font-size: 24px; font-weight: 750; background: var(--bg-1); border: 1.5px solid var(--line-2); color: var(--text-1); outline: none; transition: border-color .15s, box-shadow .15s, transform .15s var(--spring); }
.otp:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); transform: translateY(-2px) rotate(-2deg); }
.envelope { position: relative; width: 70px; height: 70px; border-radius: 24px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); transform: rotate(-6deg); box-shadow: var(--shadow-2); }
.env-check { position: absolute; right: -8px; bottom: -8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--sage); color: #fff; box-shadow: 0 0 0 4px var(--bg-2); transform: scale(0); transition: transform .35s var(--spring); }
.auth-form.verified .env-check, .envelope.ok .env-check { transform: scale(1); }
.demo-hint { text-align: center; font-size: 12px; color: var(--text-4); }
.check.shake { animation: shake .4s; }
.step-enter { animation: stepIn .3s var(--ease-out); }

/* splash */
.splash { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; background: var(--grain), var(--bg-0); transition: opacity .45s, visibility .45s; }
.splash.out { opacity: 0; visibility: hidden; }
.splash-inner { display: grid; justify-items: center; gap: 14px; text-align: center; max-width: 360px; padding: 0 24px; }
.splash-cup { position: relative; animation: bob 2.4s ease-in-out infinite; }
.steam { position: absolute; left: 50%; top: -22px; display: flex; gap: 6px; transform: translateX(-50%); }
.steam i { display: block; width: 4px; height: 16px; border-radius: 4px; background: var(--text-3); opacity: 0; animation: steam 1.8s ease-in-out infinite; }
.steam i:nth-child(2) { animation-delay: .4s; }
.steam i:nth-child(3) { animation-delay: .8s; }
.splash-title { font-family: var(--display); font-size: 19px; margin-top: 8px; }
.splash-tip { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.tip-tag { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 750; }

/* ---------------------------------------------------------------- transcript (compact) mode */

[data-density="compact"] .turn { max-width: none; align-self: stretch; margin-top: calc(var(--group-gap) / 3); gap: 0; }
[data-density="compact"] .turn-av { display: none; }
[data-density="compact"] .turn-card { display: flex; align-items: baseline; gap: 10px; padding: 0; background: none; border: 0; box-shadow: none; border-radius: 0; flex: 1; }
[data-density="compact"] .turn-head { flex: none; margin: 0; flex-wrap: nowrap; }
[data-density="compact"] .turn-head .turn-time:not(.compact-only) { display: none; }
[data-density="compact"] .compact-only { display: inline; color: var(--text-4); font-variant-numeric: tabular-nums; }
[data-density="compact"] .turn-name::after { content: ":"; color: var(--text-3); }
[data-density="compact"] .line { flex: 1; min-width: 0; margin: 0; }
[data-density="compact"] .acts { left: auto; right: 8px; top: -18px; }
[data-density="compact"] .acts::before { display: none; }
[data-density="compact"] .turn.has-mention { background: color-mix(in oklab, var(--amber) 8%, transparent); border-radius: 10px; }

/* ---------------------------------------------------------------- motion */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.94); } }
@keyframes popOut { to { opacity: 0; transform: scale(.96); } }
@keyframes popUp { from { opacity: 0; transform: translateY(8px); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes sheetPop { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.94); } }
@keyframes toastUp { from { opacity: 0; transform: translateY(16px) scale(.94); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.96); } }
@keyframes lineIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes sideIn { from { opacity: 0; transform: translateX(14px); } }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes seatIn { from { opacity: 0; transform: translate(-50%, -30%) scale(.7); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } }
@keyframes dropIn { from { opacity: 0; transform: scale(.9); } }
@keyframes badgeIn { from { transform: scale(0); } }
@keyframes appIn { from { opacity: 0; } }
@keyframes authOut { to { opacity: 0; transform: scale(1.02); } }
@keyframes lbIn { from { opacity: 0; transform: scale(.94); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes flash { 0%, 30% { background: var(--accent-soft-2); } 100% { background: transparent; } }
@keyframes reactPop { 0% { transform: scale(.4); } 60% { transform: scale(1.4) rotate(-10deg); } 100% { transform: scale(1); } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--sage) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes ripple { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(1.3); } }
@keyframes bars { 0%, 100% { height: 4px; } 50% { height: 14px; } }
@keyframes pulseBorder { 50% { box-shadow: 0 0 0 6px var(--danger-soft); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-2deg); } }
@keyframes blob { 0%, 100% { border-radius: 42% 58% 55% 45% / 48% 45% 55% 52%; } 50% { border-radius: 55% 45% 42% 58% / 52% 58% 42% 48%; } }
@keyframes steam { 0% { opacity: 0; transform: translateY(6px) scaleY(.6); } 40% { opacity: .7; } 100% { opacity: 0; transform: translateY(-14px) scaleY(1.2); } }

[data-motion="reduced"] *, [data-motion="reduced"] *::before, [data-motion="reduced"] *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1280px) {
    .app { grid-template-columns: 248px minmax(0, 1fr); }
    .tb-search { min-width: 0; }
    .tb-search span, .tb-search kbd { display: none; }
}

@media (max-width: 1100px) {
    .chat-body.panel-open .panel { position: absolute; right: 0; top: 0; bottom: 0; z-index: 8; box-shadow: var(--shadow-3); }
    .turn { max-width: 92%; }
    .acts, .turn.mine .acts { left: auto; right: 6px; top: -34px; }
    .acts::before { display: none; }
    .profile-editor { grid-template-columns: 1fr; }
    .profile-preview { position: static; max-width: 340px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .start, .join { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    /* Phones: one screen at a time, like an Android app. The list (DMs, or a guild's channels with a strip
       of your guilds on top) or the chat you opened from it, plus a bottom bar on the top-level screens. */
    .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 52px minmax(0, 1fr) auto; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); gap: 0; }
    .topbar { padding: 0 8px; }
    .deck, .tb-word { display: none; }
    .tb-right { margin-left: auto; }
    .tb-right > .tb-btn { display: none; } /* Activity lives in the bottom bar */
    .pane, .main-wrap { grid-row: 2; grid-column: 1; border: 0; border-radius: 0; }
    .pane { align-self: stretch; max-height: none; background: var(--bg-2); }
    .app.m-list .main-wrap { display: none; }
    .app:not(.m-list) .pane { display: none; }
    .app.m-top .mnav { display: flex; }
    .sh-back { display: grid; }
    .mnav { grid-row: 3; align-items: stretch; height: calc(64px + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom); background: var(--bg-1); border-top: 1px solid var(--line); }
    .mn-item { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-3); font-size: 12px; font-weight: 650; -webkit-tap-highlight-color: transparent; }
    .mn-ic { position: relative; display: grid; place-items: center; width: 60px; height: 32px; border-radius: 999px; transition: background .2s, color .2s; }
    .mn-item.active { color: var(--text-1); }
    .mn-item.active .mn-ic { background: var(--accent-soft-2); color: var(--accent-text); }
    .mn-item:active .mn-ic { background: var(--hover); }
    .mn-ic .tg-count { position: absolute; top: -3px; left: 34px; }
    .mn-dot { position: absolute; top: 4px; right: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg-1); }
    .pane-guilds { display: flex; gap: 6px; overflow-x: auto; margin: 0 -8px 6px; padding: 10px 8px; border-bottom: 1px dashed var(--line-2); scrollbar-width: none; scroll-snap-type: x proximity; }
    .pane-guilds::-webkit-scrollbar { display: none; }
    .pg-chip { flex: none; display: inline-flex; align-items: center; gap: 7px; max-width: 190px; height: 38px; padding: 0 12px 0 6px; border-radius: 999px; background: var(--card); color: var(--text-2); font-size: 13px; font-weight: 650; scroll-snap-align: center; -webkit-tap-highlight-color: transparent; }
    .pg-chip > span:not(.tg-count) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .pg-chip.active { background: var(--accent-soft-2); color: var(--text-1); }
    .pg-chip.ghost { background: transparent; border: 1px dashed var(--line-2); padding: 0 12px; }
    .pg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-1); }
    .composer-dock { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
    .app.m-top .composer-dock { padding-bottom: 10px; }
    .pane-scroll, .stream, .home-scroll, .explore-scroll { overscroll-behavior-y: contain; }
    button, a { -webkit-tap-highlight-color: transparent; }
    .stream { padding: 4px 12px 14px; }
    .composer-dock { padding: 2px 8px 10px; }
    .typing { left: 20px; }
    .jump-fab { right: 16px; }
    .sheet-wrap { padding: 0; }
    .sheet { width: 100%; height: 100%; border-radius: 0; }
    .sheet-content { padding: 18px 16px 120px; }
    .theme-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .spotlight { grid-template-columns: 1fr; }
    .spot-art { min-height: 160px; }
    .spot-art::after { background: linear-gradient(to bottom, transparent 50%, var(--card)); }
    .news { grid-template-columns: 1fr; }
    .auth { grid-template-columns: 1fr; }
    .auth-brand-side { display: none; }
    .toast-root { top: 64px; }
}

@media (max-width: 640px) {
    .tb-search { width: 40px; padding: 0; justify-content: center; border: 0; background: transparent; }
    .tb-right { gap: 2px; min-width: 0; }
    .tb-logo { padding: 0 4px; }
    .cap-room, .cap-time, .cap-stack { display: none; }
    .cap-open { padding: 0 8px; }
    .stage-head { padding: 6px 8px 6px 12px; min-height: 52px; }
    .sh-names h1 { font-size: 17px; }
    .sh-actions .round-btn:not(.sh-people) { display: none; }
    .sh-actions .sh-search { display: none; }
    .sh-people { padding-right: 10px; }
    .turn { max-width: 96%; gap: 8px; }
    .turn-av .avatar { --av: 32px !important; }
    .table-wrap { padding: 16px 12px 6px; }
    .table-scene { width: 100%; aspect-ratio: 1 / 1.05; }
    .chair .avatar { --av: 46px !important; }
    .chair-name { font-size: 11.5px; }
    .tbl { left: 18%; right: 18%; top: 24%; bottom: 24%; }
    .dock-label { display: none; }
    .dock-btn { padding: 0; width: 44px; justify-content: center; }
    .dock-signal .dock-ping { display: none; }
    button.dock-signal { padding: 0; width: 44px; justify-content: center; }
    .dock .pill { padding: 0 14px; }
    .home-scroll, .explore-scroll { padding: 14px 12px 28px; }
    .tile-hero { padding: 18px; }
    .hero-text h2 { font-size: 22px; }
    .explore-search { width: 160px; }
    .modal-wrap { padding: 0; place-items: end stretch; }
    .modal { max-width: none !important; border-radius: 26px 26px 0 0; max-height: 92dvh; animation: sheetIn .35s var(--spring); }
    .modal-wrap:has(.modal-palette) { padding-top: 0; place-items: end stretch; }
    body:has(.modal-palette) .toast-root { top: 64px; bottom: auto; }
    .pal-foot > span:not(.pal-tip) { display: none; }
    .pal-tip { margin-left: 0; }
    body:has(.modal-palette) .toast { animation-name: toastIn; }
    .field-grid, .kinds, .choices.three, .choices.two { grid-template-columns: 1fr; }
    .auth-main { padding: 22px 16px; place-items: start center; }
    .otp { height: 50px; font-size: 20px; }
    .pop-id, .pop-search, .pop-inbox, .pop-emoji, .pop-me, .pop-add { width: calc(100vw - 16px); }
    .mic-test { flex-direction: column; align-items: stretch; }
    .save-bar { left: 12px; right: 12px; transform: translateY(180%); justify-content: space-between; }
    .save-bar.show { transform: none; }
    .gs-top { flex-direction: column; }
}

/* ---------------------------------------------------------------- live client additions */

.invite-box { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.invite-box .input { flex: 1 1 200px; height: 34px; }
.ib-text { display: grid; min-width: 120px; }
.ib-text strong { font-size: 14px; }
.ib-msg { font-size: 12px; color: var(--text-3); }
.ib-msg.error { color: var(--danger); }
.g-card.skeleton { min-height: 96px; cursor: default; gap: 10px; justify-content: center; }
.g-card.skeleton:hover { transform: none; box-shadow: none; }
.sk.short { width: 40%; }
.af-person { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 2px; }
.af-person > span:not(.avatar) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.af-person small { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.af-state { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.add-friend .af-suggest { display: grid; gap: 2px; max-height: 280px; overflow-y: auto; }
.send-failed { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); vertical-align: middle; }
.img-gone { display: inline-block; padding: 6px 10px; border-radius: 8px; background: var(--surface); color: var(--text-3); font-size: 12.5px; }
.start-steps { display: grid; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--bg-1); border: 1px dashed var(--line-2); }
.start-steps p { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.start-steps .ico { color: var(--accent); }
.acct-row a.pill { text-decoration: none; }

/* Sound page: "Show my devices" + notes under the device pickers */
.device-help { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.device-help:not(:has(> :not([hidden]))) { display: none; }
.device-help .fine { margin: 0; }

/* call quality: bars in the dock and capsule, details popover */
.link-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.link-bars i { width: 3px; border-radius: 1px; background: currentColor; opacity: .22; }
.link-bars i:nth-child(1) { height: 5px; }
.link-bars i:nth-child(2) { height: 8px; }
.link-bars i:nth-child(3) { height: 12px; }
.link-bars i.on { opacity: 1; }
.link-bars[data-grade="good"] { color: var(--sage); }
.link-bars[data-grade="okay"] { color: var(--amber); }
.link-bars[data-grade="poor"] { color: var(--danger); }
.link-bars[data-grade="none"] { color: var(--text-3); }
button.dock-signal { height: 36px; border-radius: 999px; padding: 0 10px; color: var(--text-2); }
button.dock-signal:hover { background: var(--hover); color: var(--text-1); }
.cap-link { display: inline-flex; padding: 0 2px; }
.cap-link .link-bars { height: 10px; }
.cap-link .link-bars i:nth-child(1) { height: 4px; }
.cap-link .link-bars i:nth-child(2) { height: 7px; }
.cap-link .link-bars i:nth-child(3) { height: 10px; }
.cap-link .link-bars[data-grade="none"] { display: none; }
.pop-link { width: 290px; padding: 12px 14px; }
.lq-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13.5px; }
.lq-rows { display: grid; gap: 6px; }
.lq-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--text-2); }
.lq-row b, .lq-person b { color: var(--text-1); font-variant-numeric: tabular-nums; font-weight: 700; }
.lq-sub { margin: 12px 0 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.lq-people { display: grid; gap: 6px; max-height: 180px; overflow: auto; }
.lq-person { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.lq-person.quiet { opacity: .6; }
.lq-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lq-note { margin: 12px 0 0; }
.ch-start.dm h1 .avatar { flex: none; }
.ch-start-ties { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }
