:root {
    --ink: #17191e;
    --ink-2: #23262e;
    --paper: #f3efe7;
    --panel: #f7f4ee;
    --card: #fffdf8;
    --bubble: #fff;
    --head: #fff;
    --line: rgba(23, 25, 30, 0.1);
    --line-strong: rgba(23, 25, 30, 0.18);
    --muted: #6f695f;
    --accent: #3a32b8;
    --mine: #1c1e24;
    --mine-text: #f6f1e8;
    --send: #17191e;
    --send-text: #f6f1e8;
    --warn: #8a5a12;
    --warn-bg: #f8efd8;
    --chip: #e7e1d6;
    --wash: rgba(23, 25, 30, 0.04);
    --wash-strong: rgba(23, 25, 30, 0.06);
    --tint: #e7e3f8;
    --tint-soft: rgba(58, 50, 184, 0.1);
    --shadow: rgba(23, 25, 30, 0.16);
    --danger: #8a2a2a;
    --rail-bg: #17191e;
    --rail-text: #f3eee6;
    --rail-muted: #b7b1a6;
    --serif: "Fraunces", "Iowan Old Style", Palatino, serif;
    --sans: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    --rail: 76px;
    --list: 340px;
}
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] {
    color-scheme: dark;
    --ink: #f3efe7;
    --ink-2: #e7e1d4;
    --paper: #12141a;
    --panel: #181b22;
    --card: #22262f;
    --bubble: #2a2e38;
    --head: #161922;
    --line: rgba(243, 238, 230, 0.1);
    --line-strong: rgba(243, 238, 230, 0.18);
    --muted: #b7b1a6;
    --accent: #c4befc;
    --mine: #3a32b8;
    --mine-text: #f6f1e8;
    --send: #f3efe7;
    --send-text: #17191e;
    --warn: #e6c07a;
    --warn-bg: #3a2e18;
    --chip: #343846;
    --wash: rgba(243, 238, 230, 0.06);
    --wash-strong: rgba(243, 238, 230, 0.1);
    --tint: #332e62;
    --tint-soft: rgba(196, 190, 252, 0.16);
    --shadow: rgba(0, 0, 0, 0.45);
    --danger: #f0a8a8;
    --rail-bg: #0c0e13;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; }
body {
    margin: 0;
    background: var(--rail-bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.45;
}
button, input, textarea { font: inherit; color: inherit; }
input, textarea, select { font-size: 16px; }
button { cursor: pointer; }
.visually-hidden, .skip {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.skip:focus {
    position: fixed;
    top: 8px;
    left: 8px;
    width: auto;
    height: auto;
    margin: 0;
    clip: auto;
    background: var(--paper);
    padding: 8px 12px;
    z-index: 20;
}
.live {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.app {
    position: fixed;
    top: var(--vv-top, 0px);
    left: 0;
    width: 100%;
    height: var(--vv-height, 100svh);
    display: grid;
    grid-template-columns: var(--rail) var(--list) minmax(0, 1fr);
    background: var(--paper);
    overflow: hidden;
}

.rail {
    background: var(--rail-bg);
    color: var(--rail-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0 14px;
    gap: 18px;
}
.rail-mark {
    color: var(--rail-text);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
}
.rail-mark svg { width: 28px; height: 28px; }
.rail-spaces { display: flex; flex-direction: column; gap: 10px; width: 100%; align-items: center; }
.space {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(243, 238, 230, 0.2);
    background: transparent;
    color: var(--rail-text);
    font-weight: 700;
    letter-spacing: -0.03em;
}
.space[aria-pressed="true"] {
    background: #f3eee6;
    color: #17191e;
    border-color: #f3eee6;
}
.rail-you {
    margin-top: 10px;
    text-align: center;
    width: 100%;
    padding: 0 8px;
}
.rail-you strong, .rail-you span { display: block; }
.rail-you strong { font-size: 11px; letter-spacing: -0.02em; }
.rail-you span { color: var(--rail-muted); font-size: 10px; margin-top: 2px; }
.rail-out {
    display: block;
    margin: 8px auto 0;
    border: 0;
    background: transparent;
    color: var(--rail-muted);
    font-size: 11px;
    font-weight: 650;
    padding: 4px;
}
.theme-toggle {
    position: relative;
    width: 58px;
    height: 30px;
    margin-top: auto;
    padding: 0;
    border: 1px solid rgba(243, 238, 230, 0.28);
    border-radius: 999px;
    background: rgba(8, 16, 18, 0.35);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
    color: #f3eee6;
    flex: 0 0 auto;
}
.theme-toggle:hover { border-color: rgba(243, 238, 230, 0.55); }
.theme-toggle:focus-visible { outline: 2px solid #34e0f5; outline-offset: 2px; }
.theme-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(#ffe9a0, #ffd84d);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
html[data-theme="dark"] .theme-knob { transform: translateX(28px); }
.theme-sun, .theme-moon {
    position: absolute;
    top: 50%;
    width: 15px;
    height: 15px;
    margin-top: -7.5px;
    opacity: 0.62;
    pointer-events: none;
}
.theme-sun { left: 6px; }
.theme-moon { right: 6px; }
html[data-theme="light"] .theme-sun,
html[data-theme="dark"] .theme-moon { color: #17191e; opacity: 1; }
.thread-theme { display: none; margin-top: 0; margin-left: auto; }
.gate-theme {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    z-index: 5;
    margin-top: 0;
}
.app, .list, .thread, .thread-head, .bubble, .sheet-card, .rail {
    transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}
.gate-body { background: var(--paper); overflow: auto; }
.gate {
    width: min(440px, calc(100% - 40px));
    margin: 10vh auto 48px;
}
.gate-mark { color: var(--ink); width: 36px; height: 36px; display: grid; }
.gate-mark svg { width: 32px; height: 32px; }
.gate h1 {
    font-family: var(--serif);
    font-weight: 560;
    font-size: clamp(3rem, 8vw, 4.4rem);
    letter-spacing: -0.04em;
    line-height: 0.95;
    margin: 8px 0 12px;
}
.gate-lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 22px; }
.gate label { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
.gate input {
    width: 100%;
    border: 1px solid var(--line-strong);
    background: var(--card);
    border-radius: 12px;
    min-height: 48px;
    padding: 0 14px;
}
.gate .send { margin-top: 18px; width: 100%; }
.gate-demo { margin-top: 18px; }

.list, .thread { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.list { border-right: 1px solid var(--line); background: var(--panel); }
.list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 8px;
}
.list-kicker, .empty-kicker, .sheet-label {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}
.list-head h1, .empty h2, .sheet-head h2 {
    font-family: var(--serif);
    font-weight: 560;
    letter-spacing: -0.03em;
    margin: 2px 0 0;
}
.list-head h1 { font-size: 1.7rem; }
.list-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; flex-wrap: wrap; }
.quiet-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 0 18px 10px;
    color: var(--muted);
    font-size: 13px;
}
.quiet-bar input { width: auto; }
.details-mute, #details-mute { margin-top: 8px; }
#alerts[aria-pressed="true"] { color: var(--ink); }
.text-btn {
    border: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 700;
    padding: 8px 4px;
}
.search { display: block; padding: 8px 18px 8px; }
.views { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 12px; }
.views button, .ghost, .also {
    border: 1px solid var(--line-strong);
    background: var(--card);
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 650;
    font-size: 13px;
}
.views button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.hit-kicker { margin: 4px 8px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.search input, .channel-row input, .sheet-field, .composer textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    background: var(--card);
    border-radius: 12px;
    padding: 11px 12px;
}
.search input:focus, .channel-row input:focus, .sheet-field:focus, .composer textarea:focus, .space:focus-visible, .text-btn:focus-visible, .send:focus-visible, .row:focus-visible, .person:focus-visible, .views button:focus-visible, .ghost:focus-visible, .mentions button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.list-scroll, .thread-scroll { overflow: auto; overflow-x: hidden; min-height: 0; overflow-anchor: none; }
.thread-flow { min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.thread-flow > * { flex-shrink: 0; }
.list-scroll { padding: 0 10px 16px; }
.group-label {
    margin: 14px 8px 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.row {
    width: 100%;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 14px;
    padding: 8px;
}
.row:hover { background: var(--wash); }
.row[aria-current="true"] { background: var(--tint-soft); }
.avatar, .hash {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--chip);
    color: var(--ink);
    font-weight: 700;
    font-size: 13px;
}
.hash { font-family: var(--serif); font-size: 20px; font-weight: 560; }
.row-copy { min-width: 0; }
.row-copy strong, .row-copy em {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.row-copy strong { font-size: 14.5px; font-weight: 650; }
.row-copy em { font-style: normal; color: var(--muted); font-size: 13px; margin-top: 2px; }
.row-meta { text-align: right; }
.row-meta time { color: var(--muted); font-size: 12px; }
.badge {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    margin-top: 6px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
}
.badge.quiet {
    background: transparent;
    color: var(--muted);
    box-shadow: inset 0 0 0 1px var(--line);
}
.muted-mark, .ended-mark {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.none { color: var(--muted); padding: 12px; }

.thread { background: var(--paper); min-height: 0; }
.thread-body { display: flex; min-height: 0; flex: 1; }
.thread-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; flex: 1; }
.thread-pane {
    width: min(380px, 42%);
    border-left: 1px solid var(--line);
    background: var(--card);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.pane-head, .pane-head h3 { display: flex; align-items: center; justify-content: space-between; }
.pane-head { padding: 14px 14px 0; }
.pane-head h3 { margin: 0; font-family: var(--serif); font-weight: 560; font-size: 1.3rem; }
.thread-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 5;
    height: 56px;
    min-height: 56px;
    padding: 0 8%;
    background: var(--head);
    border-bottom: 1px solid var(--line);
}
.back {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ink);
    flex: 0 0 auto;
}
.back svg { width: 22px; height: 22px; display: block; }
.who-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0 8px 0 0;
    border-radius: 12px;
}
.who-bar:hover { background: var(--wash); }
.thread-head .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 13px;
    flex: 0 0 auto;
}
.thread-title { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.thread-head h2 {
    font-family: var(--sans);
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.thread-topic {
    margin: 1px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.thread-main > .composer, .pane-head, .pane-composer { flex-shrink: 0; }
.thread-main > .thread-scroll { flex: 1; padding: 8px 8% 16px; }
.thread-pane .thread-scroll { flex: 1; padding: 8px 16px 16px; }
.empty { max-width: 28rem; margin: 12vh auto 0; }
.empty h2 { font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1; }
.empty p:last-child { color: var(--muted); font-size: 1.05rem; }
.day {
    width: fit-content;
    margin: 16px auto 12px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--wash-strong);
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none;
}
.run { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 0; max-width: min(520px, 86%); }
.run.continued { margin-top: 2px; }
.run.self { margin-left: auto; align-items: flex-end; }
.run.other { align-items: flex-start; }
.who { display: flex; align-items: center; gap: 8px; margin: 0 4px 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.bubble {
    margin: 0;
    padding: 8px 12px;
    background: var(--bubble);
    border: 0;
    border-radius: 18px 18px 18px 4px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.35;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.emoji-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.run.self .emoji-row { justify-content: flex-end; }
.emoji-row button, .emoji-picker button {
    border: 0;
    background: var(--card);
    border-radius: 999px;
    min-width: 32px;
    min-height: 32px;
    padding: 2px 7px;
    font-size: 16px;
    line-height: 1;
}
.emoji-row button[aria-pressed="true"], .emoji-picker button[aria-pressed="true"] { background: var(--tint); }
.emoji-picker {
    position: fixed;
    z-index: 30;
    display: flex;
    gap: 2px;
    padding: 6px;
    background: var(--card);
    border-radius: 999px;
    box-shadow: 0 8px 24px var(--shadow);
}
.run.self .bubble {
    background: var(--mine);
    color: var(--mine-text);
    border-radius: 18px 18px 4px 18px;
}
.run.continued.other .bubble { border-radius: 6px 18px 18px 6px; }
.run.continued.self .bubble { border-radius: 18px 6px 6px 18px; }
.bubble a { color: inherit; }
.forwarded { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.03em; opacity: 0.72; margin-bottom: 4px; }
.file-link { font-weight: 700; }
.bubble img { display: block; max-width: min(280px, 100%); border-radius: 12px; }
.pins { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.pin {
    width: 100%;
    text-align: left;
    border: 1px solid var(--line-strong);
    background: var(--card);
    border-radius: 12px;
    padding: 8px 12px;
}
.pin small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.pin strong { display: block; font-weight: 650; }
.action {
    width: calc(100% - 4px);
    display: block;
    text-align: left;
    border: 0;
    border-radius: 16px;
    padding: 14px 14px 16px;
    margin: 0 2px 10px;
    background: var(--warn-bg);
}
.action.offer { background: var(--tint); }
.action em { display: block; font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--warn); }
.action.offer em { color: var(--accent); }
.action strong { display: block; margin-top: 6px; font-family: var(--serif); font-size: 1.35rem; font-weight: 560; letter-spacing: -0.03em; line-height: 1.15; }
.thread-main.drop { outline: 2px dashed var(--accent); outline-offset: -8px; }
.app.field .row { padding-top: 14px; padding-bottom: 14px; }
.app.field .row-copy strong { font-size: 16px; }
.app.field .send, .app.field .ghost, .app.field .voice-play, .app.field .voice-speed { min-height: 48px; }
.mention { color: var(--accent); font-weight: 700; }
.run.self .mention { color: #d9d3ff; }
.edited { color: var(--muted); font-size: 12px; margin-left: 6px; }
.voice-note { position: relative; display: flex; align-items: center; gap: 8px; }
.voice-note audio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.voice-play, .voice-speed {
    border: 0;
    border-radius: 999px;
    background: var(--send);
    color: var(--send-text);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    min-height: 36px;
    padding: 0 12px;
}
.voice-speed { background: transparent; color: inherit; padding: 0 4px; }
.thread-link { border: 0; background: transparent; color: var(--accent); font-weight: 700; padding: 0 4px; font-size: 13px; }
.offer {
    background: var(--tint);
    border-radius: 18px;
    padding: 16px 18px;
    margin: 8px 0 18px;
}
.offer .kicker { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin: 0; }
.offer p:nth-of-type(2) { margin: 8px 0 12px; font-family: var(--serif); font-size: 1.35rem; letter-spacing: -0.03em; line-height: 1.15; }
.offer-actions { display: flex; gap: 8px; }
.mode { margin: 8px 0; color: var(--muted); }
.mentions {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
    background: var(--card);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 6px;
}
.mentions button { text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 8px; font-weight: 650; }
.mentions button[aria-selected="true"], .mentions button:hover { background: var(--tint-soft); }
.ghost[aria-pressed="true"] { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.more { position: relative; }
.more-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 3;
    background: var(--card);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    min-width: 180px;
}
.more-menu button { border: 0; background: transparent; text-align: left; padding: 8px; border-radius: 8px; }
.more-menu button:hover { background: var(--wash); }
.quote {
    display: block;
    margin-bottom: 6px;
    padding-left: 8px;
    border-left: 2px solid currentColor;
    opacity: 0.75;
    font-size: 13px;
}
.status { margin: 2px 4px 0; color: var(--muted); font-size: 11px; letter-spacing: 0; }
.reacts { display: none; }
.alert {
    width: min(640px, 100%);
    margin: 8px auto 16px;
    background: var(--warn-bg);
    border: 1px solid rgba(138, 90, 18, 0.25);
    border-radius: 18px;
    padding: 16px 16px 14px;
}
.alert p { margin: 8px 0 12px; font-family: var(--serif); font-size: 1.45rem; letter-spacing: -0.03em; line-height: 1.15; }
.alert .kicker { color: var(--warn); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.alert.routine { background: transparent; border-style: dashed; }
.alert.critical { border-width: 2px; }
.alert .record { margin: 0 0 12px; font-family: var(--sans); font-size: 13px; letter-spacing: 0; line-height: 1.4; color: var(--ink); }
.ack {
    border: 0;
    background: var(--send);
    color: var(--send-text);
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 700;
}
.ack[disabled] { background: transparent; color: var(--warn); padding-left: 0; }

.thread-main > .composer, .pane-composer { padding: 8px 8% calc(12px + env(safe-area-inset-bottom)); position: relative; }
.to-end {
    position: absolute;
    right: 16px;
    bottom: calc(100% + 10px);
    z-index: 4;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--card);
    color: var(--ink);
    box-shadow: 0 6px 18px var(--shadow);
    display: grid;
    place-items: center;
}
.to-end svg { width: 20px; height: 20px; display: block; }
.pane-composer { padding-left: 16px; padding-right: 16px; }
.also { display: flex; align-items: center; gap: 8px; width: fit-content; margin: 0 0 8px; border-radius: 10px; }
.replying {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
}
.replying span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-row { display: flex; gap: 8px; align-items: flex-end; min-width: 0; }
.composer-row .ghost, .composer-row .send { flex: 0 0 auto; }
.composer textarea {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    resize: none;
    max-height: 140px;
    min-height: 46px;
    line-height: 1.4;
}
.send {
    border: 0;
    background: var(--send);
    color: var(--send-text);
    border-radius: 999px;
    min-height: 46px;
    padding: 0 16px;
    font-weight: 700;
}
.send:disabled { opacity: 0.4; }
.composer-hint { margin: 6px 4px 0; color: var(--muted); font-size: 12px; }

.sheet { border: 0; padding: 0; background: transparent; }
.sheet::backdrop { background: rgba(23, 25, 30, 0.46); }
.sheet-card {
    width: min(440px, calc(100vw - 32px));
    background: var(--panel);
    color: var(--ink);
    border-radius: 22px;
    padding: 18px;
    border: 1px solid var(--line);
}
.sheet-head, .channel-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-head h2 { font-size: 2rem; }
.sheet-label { margin: 16px 0 8px; }
.person {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 12px;
    padding: 8px;
}
.person:hover { background: var(--wash); }
.person small { display: block; color: var(--muted); font-size: 12px; }
.person[aria-pressed="true"] { background: var(--tint); }
.pack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 16px; }
.pack a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--tint); }
.pack img { width: 100%; height: 100%; object-fit: cover; }
.pack .file-link { aspect-ratio: auto; padding: 8px; }
.person .grow { flex: 1; min-width: 0; }
.sheet-field { display: block; width: 100%; margin-top: 8px; }
.member-actions { margin-left: auto; display: flex; gap: 8px; }
.sheet-error { color: var(--danger); font-weight: 700; }

@media (max-width: 860px) {
    .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
    .rail {
        flex-direction: row;
        height: 60px;
        padding: 0 12px;
        gap: 12px;
    }
    .rail-spaces { flex-direction: row; width: auto; }
    .rail-you { margin: 0; text-align: right; width: auto; }
    .rail-theme { margin-top: 0; margin-left: auto; }
    .thread-theme { display: block; }
    .space { width: 36px; height: 36px; border-radius: 11px; }
    .app.show-thread { grid-template-rows: minmax(0, 1fr); }
    .app.show-thread .rail, .app.show-thread .list { display: none; }
    .app:not(.show-thread) .thread { display: none; }
    .composer-hint { display: none; }
    .back { display: inline-flex; }
    .who-bar:hover { background: transparent; }
    .app.show-thread .thread-head {
        height: calc(56px + env(safe-area-inset-top));
        padding-top: env(safe-area-inset-top);
        padding-left: max(4px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
    .thread-main > .thread-scroll, .thread-main > .composer {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
    .thread { position: relative; }
    .thread-pane { position: absolute; inset: 0; width: auto; z-index: 4; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; }
    .theme-knob, .app, .list, .thread, .thread-head, .bubble, .sheet-card, .rail { transition: none; }
}
.lock-screen {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--paper);
    color: var(--ink);
    padding: 24px;
}
.lock-screen[hidden] { display: none !important; }
.lock-card { width: min(420px, 100%); }
.lock-card h2 { font-family: var(--serif); font-weight: 560; font-size: 2rem; margin: 0 0 8px; }
.lock-card .sheet-field { width: 100%; box-sizing: border-box; font-size: 16px; }
.admin-row, .support-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.admin-row .grow, .support-row .grow { flex: 1; min-width: 0; }
