:root {
    --bg: #fbfaf7; --surface: #ffffff; --ink: #1c1c1e; --ink-2: #6b6b70; --ink-3: #a2a2a8;
    --line: rgba(0, 0, 0, .09); --fill: rgba(60, 60, 67, .08); --fill-2: rgba(60, 60, 67, .14);
    --accent: #1c1c1e; --on-accent: #ffffff; --danger: #d6392b; --ok: #2f9e62;
    --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
    --sans: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000; --surface: #1c1c1e; --ink: #f2f2f4; --ink-2: #a0a0a8; --ink-3: #6c6c74;
        --line: rgba(255, 255, 255, .12); --fill: rgba(120, 120, 128, .2); --fill-2: rgba(120, 120, 128, .32);
        --accent: #f2f2f4; --on-accent: #111113; --danger: #ff6557; --ok: #4cc585;
    }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    background: var(--bg); color: var(--ink); font: 16px/1.4 var(--sans);
    -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none; -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
h1, h2, p, blockquote { margin: 0; }
.icon { display: inline-flex; width: 22px; height: 22px; flex: none; }
.icon svg { width: 100%; height: 100%; }

/* ---------- кнопки, поля ---------- */
.btn {
    display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px;
    padding: 0 18px; border-radius: 14px; background: var(--fill); font-weight: 600; text-align: center;
}
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.link { background: none; font-weight: 500; color: var(--ink-2); min-height: 40px; }
.btn.danger, .inline.danger, .danger { color: var(--danger); }
.btn:disabled { opacity: .5; }
.btn:active, .icon-btn:active, .tool:active { opacity: .6; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
    border-radius: 50%; flex: none;
}
.icon-btn.filled { background: var(--accent); color: var(--on-accent); }
.icon-btn.subtle { color: var(--ink-2); background: var(--fill); width: 30px; height: 30px; }
.icon-btn.subtle .icon { width: 16px; height: 16px; }
.inline { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--ink-2); padding: 6px 4px; }
.inline .icon { width: 16px; height: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--ink-2); }
input:not([type=range]):not([type=checkbox]), textarea, select {
    font: inherit; color: var(--ink); background: var(--fill); border: 0; border-radius: 12px;
    padding: 12px 14px; width: 100%; min-height: 46px; -webkit-appearance: none; appearance: none;
}
textarea { resize: none; line-height: 1.4; display: block; }
textarea.big { min-height: 130px; font-family: var(--serif); font-size: 17px; }
.hint { font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.avatar {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none;
    border-radius: 50%; color: #fff; font-weight: 700; font-size: 15px;
}
.avatar.mini { width: 20px; height: 20px; font-size: 11px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- вход ---------- */
.auth {
    min-height: 100%; max-width: 380px; margin: 0 auto; padding: calc(var(--sat) + 12vh) 24px 40px;
    display: flex; flex-direction: column; align-items: center; text-align: center;
}
.auth-mark, .empty-mark {
    width: 64px; height: 64px; border-radius: 18px; background: var(--accent); color: var(--on-accent);
    display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
}
.auth-mark .icon, .empty-mark .icon { width: 34px; height: 34px; }
.auth h1 { font: 700 34px/1.1 var(--serif); letter-spacing: -.01em; }
.auth-sub { color: var(--ink-2); margin: 8px 0 28px; }
.auth-form { width: 100%; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.form-error { color: var(--danger); font-size: 14px; min-height: 1.4em; }

/* ---------- библиотека ---------- */
.library { max-width: 1100px; margin: 0 auto; padding: calc(var(--sat) + 18px) calc(20px + var(--sar)) calc(var(--sab) + 40px) calc(20px + var(--sal)); }
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 0 12px; }
.lib-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.lib-head h1 { font: 700 34px/1.1 var(--serif); letter-spacing: -.01em; }
.offline-chip { font-size: 12px; color: var(--ink-2); background: var(--fill); padding: 2px 8px; border-radius: 99px; }
.lib-actions { display: flex; align-items: center; gap: 12px; }
.avatar-btn { border-radius: 50%; }
.partner-strip {
    display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2);
    padding: 10px 14px; background: var(--fill); border-radius: 12px; margin-bottom: 8px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 28px 20px; padding-top: 16px; align-items: end; }
@media (max-width: 420px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 24px 18px; } }
.tile { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tile-open { display: block; width: 100%; border-radius: 6px; transition: transform .15s; }
.tile-open:active { transform: scale(.97); }
.cover {
    aspect-ratio: 2 / 3; width: 100%; border-radius: 5px; overflow: hidden; background: var(--fill);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 8px 22px rgba(0, 0, 0, .16); position: relative;
}
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.14), transparent 4%, rgba(255,255,255,.1) 6%, transparent 9%); pointer-events: none; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-gen {
    height: 100%; padding: 14% 12%; display: flex; flex-direction: column; justify-content: space-between; text-align: left;
    background: linear-gradient(160deg, hsl(var(--hue) 38% 42%), hsl(var(--hue) 45% 26%)); color: #fff;
}
.cover-title { font: 700 clamp(13px, 4.2vw, 17px)/1.2 var(--serif); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cover-author { font-size: 11px; opacity: .8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); min-height: 30px; }
.tile-progress { font-variant-numeric: tabular-nums; }
.tile-partner { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.tile-partner.live .avatar { animation: pulse 2s ease-in-out infinite; }
.tile-meta .icon-btn { margin-left: auto; background: none; }
.empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 12vh 20px; }
.empty h2 { font: 700 22px var(--serif); }
.empty p { color: var(--ink-2); max-width: 300px; margin-bottom: 12px; }
.empty .btn { width: auto; padding: 0 28px; }

/* ---------- шторки ---------- */
.sheet {
    position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0); transition: background .28s;
    display: flex; align-items: flex-end; justify-content: center;
}
.sheet.open { background: rgba(0, 0, 0, .32); }
.sheet-panel {
    width: 100%; max-width: 560px; max-height: calc(100% - var(--sat) - 24px); display: flex; flex-direction: column;
    background: var(--surface); color: var(--ink); border-radius: 18px 18px 0 0;
    transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, .18);
}
.sheet-panel.tall { height: 82%; }
.sheet.open .sheet-panel { transform: none; }
@media (min-width: 720px) {
    .sheet { align-items: center; }
    .sheet-panel { border-radius: 18px; max-height: min(720px, 86%); transform: translateY(24px); opacity: 0; transition: transform .22s, opacity .22s; }
    .sheet-panel.tall { height: min(720px, 86%); }
    .sheet.open .sheet-panel { opacity: 1; }
    .sheet-grip { display: none; }
}
.sheet-grip { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 6px auto 0; flex: none; padding: 0; }
.sheet-grip::before { content: ""; display: block; height: 22px; margin-top: -8px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px 10px 20px; flex: none; }
.sheet-head h2 { font: 700 20px var(--sans); }
.sheet-body {
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding: 4px 20px calc(var(--sab) + 20px); display: flex; flex-direction: column; gap: 14px; flex: 1;
}
.sheet-panel.actions { background: none; box-shadow: none; padding: 0 10px; max-width: 420px; }
.actions .sheet-grip { display: none; }
.actions .sheet-body { padding: 0 0 calc(var(--sab) + 10px); gap: 8px; }
.actions-title { text-align: center; font-size: 13px; color: var(--ink-2); background: var(--surface); padding: 14px 18px; border-radius: 14px 14px 0 0; margin-bottom: -8px; border-bottom: 1px solid var(--line); }
.actions-list { background: var(--surface); border-radius: 14px; overflow: hidden; }
.actions-title + .actions-list { border-radius: 0 0 14px 14px; }
.actions-list button, .actions-cancel { width: 100%; min-height: 56px; font-size: 18px; padding: 0 16px; }
.actions-list button + button { border-top: 1px solid var(--line); }
.actions-cancel { background: var(--surface); border-radius: 14px; font-weight: 600; }
.toast {
    position: fixed; left: 50%; top: calc(var(--sat) + 64px); transform: translate(-50%, -12px); opacity: 0; z-index: 80;
    background: rgba(40, 40, 44, .94); color: #fff; padding: 11px 18px; border-radius: 99px; font-size: 14px;
    max-width: calc(100% - 32px); text-align: center; transition: opacity .25s, transform .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.color-row { display: flex; gap: 12px; padding-top: 4px; }
.color-dot { width: 34px; height: 34px; border-radius: 50%; }
.color-dot.on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }

/* ---------- экран чтения ---------- */
.reader {
    --page-bg: #fff; --page-fg: #1c1c1e;
    --glass: color-mix(in srgb, var(--page-bg) 93%, var(--page-fg));
    --glass-line: color-mix(in srgb, var(--page-fg) 14%, transparent);
    --soft: color-mix(in srgb, var(--page-fg) 55%, var(--page-bg));
    position: fixed; inset: 0; background: var(--page-bg); color: var(--page-fg); overflow: hidden;
    transition: background .25s; user-select: none; -webkit-user-select: none;
}
.reader-stage { position: absolute; inset: var(--sat) var(--sar) var(--sab) var(--sal); }
foliate-view { display: block; width: 100%; height: 100%; }
.reader-foot {
    position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 14px); padding: 0 calc(7% + var(--sar)) 0 calc(7% + var(--sal));
    display: flex; justify-content: space-between; font-size: 12px; color: var(--soft); opacity: .75;
    pointer-events: none; font-variant-numeric: tabular-nums; transition: opacity .2s;
}
.chrome-on .reader-foot { opacity: 0; }
.chrome { position: absolute; left: 0; right: 0; z-index: 5; transition: opacity .22s, transform .22s; opacity: 0; pointer-events: none; }
.chrome-on .chrome { opacity: 1; pointer-events: auto; transform: none; }
.reader-top {
    top: 0; padding: calc(var(--sat) + 8px) calc(12px + var(--sar)) 10px calc(12px + var(--sal));
    display: flex; align-items: center; gap: 10px; transform: translateY(-8px);
    background: linear-gradient(var(--page-bg) 55%, transparent);
}
.reader-title { flex: 1; text-align: center; font-size: 14px; font-weight: 600; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-top-spacer { width: 40px; flex: none; }
.icon-btn.glass { width: 40px; height: 40px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.reader-bottom {
    bottom: 0; padding: 0 calc(10px + var(--sar)) calc(var(--sab) + 10px) calc(10px + var(--sal));
    display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateY(10px);
}
.bottom-card {
    width: 100%; max-width: 520px; padding: 14px 16px 8px; border-radius: 22px;
    background: var(--glass); border: 1px solid var(--glass-line);
    backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .14);
}
.live-chip {
    display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding: 7px 14px; border-radius: 99px; max-width: 100%;
    background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track { position: relative; height: 28px; }
.track-rail { position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; background: var(--glass-line); overflow: hidden; }
.track-fill { height: 100%; background: var(--page-fg); border-radius: 2px; }
.track-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.track-input::-webkit-slider-runnable-track { background: none; height: 28px; }
.track-input::-moz-range-track { background: none; }
.track-input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: 5px; border-radius: 50%; background: var(--page-fg); border: 3px solid var(--page-bg); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.track-input::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--page-fg); border: 3px solid var(--page-bg); }
.track-partner {
    position: absolute; top: -10px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%;
    font-size: 11px; font-weight: 700; line-height: 1; z-index: 2; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px var(--page-bg);
}
.track-partner::after { content: ""; position: absolute; left: 9px; top: 20px; width: 2px; height: 5px; background: inherit; border-radius: 1px; }
.track-partner.live { animation: pulse 2s ease-in-out infinite; }
.track-meet { position: absolute; top: 15px; margin-left: -2px; color: var(--soft); pointer-events: none; }
.track-meet .icon { width: 13px; height: 13px; }
.track-labels { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--soft); font-variant-numeric: tabular-nums; }
.track-chapter { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; justify-content: space-around; margin-top: 8px; border-top: 1px solid var(--glass-line); padding-top: 6px; }
.tool { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; padding: 6px 8px; min-width: 64px; border-radius: 12px; color: var(--page-fg); }
.tool .icon { width: 24px; height: 24px; }
.badge { position: absolute; top: 0; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff3b30; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; }
.reader-loading { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--page-bg); color: var(--soft); padding: 32px; text-align: center; }
.reader-loading .btn { width: auto; padding: 0 24px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--glass-line); border-top-color: var(--page-fg); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner, .live-dot, .track-partner.live { animation-duration: 6s; } * { transition-duration: .01ms !important; } }

/* выделение текста */
.sel-bar {
    position: fixed; z-index: 30; display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 16px;
    background: rgba(38, 38, 42, .96); color: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); max-width: calc(100% - 16px);
}
.sel-color { width: 30px; height: 30px; border-radius: 50%; margin: 3px; flex: none; border: 2px solid rgba(255, 255, 255, .25); }
.sel-color.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.sel-sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .2); margin: 0 4px; }
.sel-action { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; padding: 8px 10px; border-radius: 10px; white-space: nowrap; }
.sel-action .icon { width: 18px; height: 18px; }

/* содержание */
.toc { display: flex; flex-direction: column; }
.toc-item { display: flex; justify-content: space-between; gap: 16px; text-align: left; padding: 13px 4px; border-bottom: 1px solid var(--line); font-size: 16px; }
.toc-item.current { font-weight: 700; }
.toc-pct { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; flex: none; }

/* заметки */
.notes { display: flex; flex-direction: column; gap: 10px; }
.ahead { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--fill); font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.ahead .icon { width: 18px; height: 18px; margin-top: 1px; }
.note-row { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 14px; border-radius: 14px; background: var(--fill); width: 100%; }
.note-row-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.note-author { font-weight: 600; color: var(--ink); }
.note-where { margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--fill-2); }
.tag .icon { width: 13px; height: 13px; }
blockquote { border-left: 3px solid var(--ink-3); padding-left: 12px; font: 16px/1.45 var(--serif); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.note-text { font-size: 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-row-foot { display: flex; gap: 12px; font-size: 13px; color: var(--ink-2); }
.ann { display: flex; flex-direction: column; gap: 12px; }
.ann + .ann { border-top: 1px solid var(--line); padding-top: 16px; }
.ann-head { display: flex; flex-direction: column; gap: 10px; }
.ann-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ann-actions .sel-color { width: 24px; height: 24px; border-color: transparent; }
.grow { flex: 1; }
.reactions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.react { width: 42px; height: 38px; border-radius: 12px; background: var(--fill); font-size: 19px; filter: grayscale(.7); opacity: .75; }
.react.on { filter: none; opacity: 1; background: var(--fill-2); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.react-other { display: inline-flex; align-items: center; gap: 3px; font-size: 19px; padding: 4px 8px; border-radius: 12px; background: var(--fill); }
.thread { display: flex; flex-direction: column; gap: 10px; }
.reply { display: flex; gap: 8px; align-items: flex-start; }
.reply-body { background: var(--fill); border-radius: 4px 16px 16px 16px; padding: 9px 13px; max-width: 86%; }
.reply-body p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.reply-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.reply-meta .inline { font-size: 12px; padding: 0; }
.composer { display: flex; align-items: flex-end; gap: 8px; position: sticky; bottom: 0; background: var(--surface); padding: 6px 0 2px; }
.composer textarea { border-radius: 20px; min-height: 40px; padding: 9px 14px; }
.composer .icon-btn { width: 40px; height: 40px; }

/* письмо */
.letter { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0, 0, 0, 0); transition: background .25s; }
.letter.open { background: rgba(0, 0, 0, .4); }
.letter-card {
    width: 100%; max-width: 420px; max-height: 80%; overflow-y: auto; background: #fffdf8; color: #2b2520; border-radius: 6px; padding: 26px 24px 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 16px;
    transform: translateY(20px) rotate(-1deg) scale(.96); opacity: 0; transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .25s;
}
.letter.open .letter-card { transform: none; opacity: 1; }
.letter-from { display: flex; align-items: center; gap: 12px; }
.letter-from div { display: flex; flex-direction: column; }
.letter-from span:not(.avatar) { font-size: 13px; color: #8a8178; }
.letter-card blockquote { color: #8a8178; border-color: #d8cfc2; font-size: 15px; }
.letter-text { font: 19px/1.5 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; }
.letter-actions { display: flex; gap: 10px; }
.letter-actions .btn { background: rgba(60, 50, 40, .08); color: #2b2520; }
.letter-actions .btn.primary { background: #2b2520; color: #fffdf8; }

/* оформление */
.themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.theme { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.theme-swatch { width: 100%; aspect-ratio: 1.15; border-radius: 12px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font: 600 17px var(--serif); }
.theme.on .theme-swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.theme.on { color: var(--ink); font-weight: 600; }
.size-row { display: flex; align-items: center; background: var(--fill); border-radius: 14px; overflow: hidden; }
.size-btn { flex: 1; height: 48px; font: 600 24px var(--serif); }
.size-btn.small { font-size: 16px; }
.size-label { width: 64px; text-align: center; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; border-inline: 1px solid var(--line); line-height: 28px; }
.fonts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.font { height: 46px; border-radius: 12px; background: var(--fill); font-size: 16px; }
.font.on { box-shadow: inset 0 0 0 2px var(--ink); }
.setting { display: flex; flex-direction: column; gap: 6px; }
.setting > span { font-size: 13px; color: var(--ink-2); }
.seg { display: flex; background: var(--fill); border-radius: 11px; padding: 2px; }
.seg button { flex: 1; min-height: 36px; border-radius: 9px; font-size: 14px; padding: 0 6px; }
.seg button.on { background: var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, .14); font-weight: 600; }
@media (prefers-color-scheme: dark) { .seg button.on { background: var(--fill-2); } }

/* вместе */
.together-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 16px; background: var(--fill); }
.together-card .btn { background: var(--surface); }
.who { display: flex; align-items: center; gap: 12px; }
.who div, .switch div { display: flex; flex-direction: column; min-width: 0; }
.who div span, .switch div span { font-size: 14px; color: var(--ink-2); line-height: 1.35; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.switch input { -webkit-appearance: none; appearance: none; width: 51px; height: 31px; border-radius: 99px; background: var(--fill-2); position: relative; flex: none; transition: background .2s; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked { background: #34c759; }
.switch input:checked::after { transform: translateX(20px); }
.meet-head { display: flex; align-items: center; gap: 8px; }
.meet-head .inline { margin-left: auto; }
.meet-head .icon { width: 18px; height: 18px; }
.meet-label { font: 600 18px/1.3 var(--serif); }
.meet-label span { font: 400 14px var(--sans); color: var(--ink-2); }
.meet-status { display: flex; flex-wrap: wrap; gap: 8px; }
.meet-status span { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding: 5px 10px 5px 6px; border-radius: 99px; background: var(--surface); color: var(--ink-2); }
.meet-status span.ok { color: var(--ok); font-weight: 600; }
.meet-thread { display: flex; flex-direction: column; gap: 12px; }
.meet-open { font-size: 14px; color: var(--ink-2); }
