/* Mail Up — сайт для компьютера. Цвета — как в приложении: стандартный дизайн или «под тариф»
   (Pearl / Aurora / Obsidian, data-design на <html>), светлая/тёмная тема (data-theme). */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --radius: 14px;

  --accent: #026FD7; --accent-2: #0050B5; --accent-text: #005FC6; --on-accent: #fff;
  --bg: #F6F6F3; --pane: #FBFBF9; --card: #FFFFFF; --fill: #EDEDEA; --fill-2: #F3F3F0; --hover: rgba(0,0,0,.035);
  --line: #E4E4E0; --line-2: #EDEDE9;
  --text: #18181A; --text-2: #5C5C62; --text-3: #8A8A90;
  --active: #E3EEFC; --active-text: #0A4DA8;
  --ok: #2F9E57; --warn: #D99A00; --danger: #D24C49;
  --glow-1: transparent; --glow-2: transparent; --glow-3: transparent;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 24px 70px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.06);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --accent: #3D8FEA; --accent-2: #2A75CC; --accent-text: #6AA9F0;
  --bg: #0E0E10; --pane: #131315; --card: #1A1A1D; --fill: #26262A; --fill-2: #1F1F22; --hover: rgba(255,255,255,.04);
  --line: #2A2A2E; --line-2: #222226;
  --text: #F2F2EF; --text-2: #B0B0AE; --text-3: #85857F;
  --active: #16283E; --active-text: #8DBDF4;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
  --shadow-lg: 0 24px 70px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.3);
  color-scheme: dark;
}

/* Дизайн «под тариф» */
:root[data-design="pearl"] { --accent: #5B5FC7; --accent-2: #464AA8; --accent-text: #4F53B8; --active: #E7E8FB; --active-text: #3E42A0;
  --bg: #F4F4F9; --pane: #FAFAFD; --glow-1: rgba(200,205,235,.55); --glow-2: rgba(233,227,247,.6); }
:root[data-design="pearl"][data-theme="dark"] { --accent: #6F74DE; --accent-2: #5A5FC8; --accent-text: #B7BAFF; --active: #22234A; --active-text: #C5C7FF;
  --bg: #0F0F14; --pane: #14141A; --card: #1B1B22; --fill: #2A2A33; --glow-1: rgba(120,126,190,.22); --glow-2: rgba(160,150,200,.16); }
:root[data-design="aurora"] { --accent: #6D4AFF; --accent-2: #5534E0; --accent-text: #5B36F0; --active: #ECE6FF; --active-text: #4A2BC4;
  --bg: #F6F4FE; --pane: #FBFAFF; --glow-1: rgba(99,102,241,.32); --glow-2: rgba(124,58,237,.22); --glow-3: rgba(14,165,233,.22); }
:root[data-design="aurora"][data-theme="dark"] { --accent: #7F5CFA; --accent-2: #6A47E8; --accent-text: #B4A2FF; --active: #2A2152; --active-text: #CDBFFF;
  --bg: #0A0914; --pane: #100E1C; --card: #17152A; --fill: #25223D; --fill-2: #1C1A30;
  --glow-1: rgba(99,102,241,.35); --glow-2: rgba(124,58,237,.3); --glow-3: rgba(14,165,233,.22); }
:root[data-design="obsidian"] { --accent: #9A7714; --accent-2: #7E6110; --accent-text: #8A6A12; --active: #F6EBC9; --active-text: #6E540C;
  --bg: #F8F5EC; --pane: #FCFAF4; --card: #FFFDF7; --fill: #EDE6D3; --fill-2: #F5F0E3;
  --glow-1: rgba(212,175,55,.3); --glow-2: rgba(244,208,111,.25); }
:root[data-design="obsidian"][data-theme="dark"] { --accent: #A8841F; --accent-2: #8A6A12; --accent-text: #F4D06F; --active: #2E2713; --active-text: #F4D06F;
  --bg: #0A0907; --pane: #100E0B; --card: #16140F; --fill: #26221A; --fill-2: #1D1A13; --line: #2B261C; --line-2: #221E16;
  --glow-1: rgba(212,175,55,.3); --glow-2: rgba(244,208,111,.18); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

.boot { height: 100vh; display: grid; place-items: center; }
.boot-logo { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, #3D8FEA, #7C5CFF); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* Свечение дизайна вверху */
.glow { position: fixed; inset: 0 0 auto 0; height: 420px; pointer-events: none; z-index: 0;
  background: radial-gradient(600px 300px at 8% -10%, var(--glow-1), transparent 70%),
              radial-gradient(520px 280px at 92% -5%, var(--glow-3), transparent 70%),
              radial-gradient(500px 260px at 55% -12%, var(--glow-2), transparent 70%); }

/* ---------- Вход ---------- */
.login { position: relative; z-index: 1; height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); }
.login-hero { position: relative; overflow: hidden; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between;
  background: #07070C; color: #F4F2FF; }
.login-hero::before { content: ""; position: absolute; inset: -20% -10% auto -20%; height: 120%;
  background: radial-gradient(520px 420px at 25% 20%, rgba(108,92,255,.55), transparent 65%),
              radial-gradient(460px 380px at 85% 35%, rgba(0,190,255,.28), transparent 65%),
              radial-gradient(420px 360px at 40% 95%, rgba(124,58,237,.35), transparent 65%); filter: blur(10px); }
.login-hero > * { position: relative; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3D8FEA, #7C5CFF); box-shadow: 0 10px 30px rgba(108,92,255,.45); }
.login-title { font-size: 54px; line-height: 1.04; font-weight: 800; letter-spacing: -.035em; max-width: 560px; margin: 0; }
.login-sub { font-size: 18px; line-height: 1.5; color: #A9A5C8; max-width: 480px; margin: 18px 0 0; }
.feature-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 620px; }
.feature { padding: 16px; border-radius: 18px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); backdrop-filter: blur(12px); }
.feature b { display: block; font-size: 14px; margin: 10px 0 4px; }
.feature span { font-size: 12.5px; color: #8C88AD; line-height: 1.4; }
.login-side { display: grid; place-items: center; padding: 40px; }
.login-card { width: 100%; max-width: 400px; text-align: center; }
.login-card h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 6px; }
.login-card p { color: var(--text-2); margin: 0 0 26px; }
.qr-wrap { position: relative; width: 248px; height: 248px; margin: 0 auto; padding: 14px; border-radius: 26px; background: #fff;
  box-shadow: var(--shadow-lg); display: grid; place-items: center; }
.qr-wrap img, .qr-wrap svg { width: 100%; height: 100%; image-rendering: pixelated; }
.qr-badge { position: absolute; width: 52px; height: 52px; border-radius: 14px; border: 5px solid #fff;
  background: linear-gradient(135deg, #3D8FEA, #7C5CFF); display: grid; place-items: center; }
.qr-expired { position: absolute; inset: 0; border-radius: 26px; background: rgba(255,255,255,.92); display: grid; place-items: center; color: #18181A; }
.code { margin: 26px auto 8px; display: flex; justify-content: center; gap: 8px; }
.code span { width: 44px; height: 54px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: grid; place-items: center; font: 600 26px var(--mono); }
.code span:nth-child(3) { margin-right: 10px; }
.steps { text-align: left; margin: 26px auto 0; display: grid; gap: 12px; max-width: 340px; }
.step { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); font-size: 14px; }
.step i { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--fill); color: var(--text); font-style: normal; font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.waiting { margin-top: 22px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.dot-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); animation: pulse 1.4s infinite; }

/* ---------- Почта: три колонки ---------- */
.shell { position: relative; z-index: 1; height: 100vh; display: grid; grid-template-columns: 252px minmax(340px, 400px) minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; padding: 18px 12px 12px; gap: 4px; min-height: 0; border-right: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--pane) 70%, transparent); backdrop-filter: blur(20px); }
.sidebar .brand { padding: 2px 8px 16px; font-size: 16px; }
.sidebar .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
.compose-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; margin: 0 4px 14px; border: 0; border-radius: 13px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 15px; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .15s, box-shadow .15s; }
.compose-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 45%, transparent); }
.nav-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border: 0; border-radius: 10px; background: none; width: 100%;
  text-align: left; color: var(--text); font-size: 14px; }
.nav-item:hover { background: var(--hover); }
.nav-item.on { background: var(--active); color: var(--active-text); font-weight: 600; }
.nav-item svg { flex: none; opacity: .8; }
.nav-item .count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nav-item.on .count { color: inherit; }
.mb-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin: 0 3px; }
.sidebar-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 4px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 12px; }
.me .avatar { width: 34px; height: 34px; font-size: 13px; }
.me-name { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.me-plan { font-size: 11.5px; color: var(--text-3); }
.plan-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.plan-chip.starter { background: linear-gradient(135deg, #F3F1FB, #BFC6DE); color: #1C1A33; }
.plan-chip.pro { background: linear-gradient(135deg, #4F46E5, #7C3AED 55%, #0EA5E9); color: #fff; }
.plan-chip.max { background: linear-gradient(135deg, #26231C, #0E0D0B); color: #F6E7B8; border: 1px solid #5c4a1c; }
.plan-chip.free { background: var(--fill); color: var(--text-2); }

/* Список */
.list-pane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line-2); background: color-mix(in srgb, var(--pane) 55%, transparent); }
.list-head { padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 12px; }
.list-title { display: flex; align-items: center; gap: 10px; }
.list-title h1 { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -.025em; }
.list-title .sub { font-size: 12.5px; color: var(--text-3); margin-left: auto; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 0; background: none; color: var(--text-2); display: inline-grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on { color: var(--accent-text); background: var(--active); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.search { position: relative; }
.search input { width: 100%; height: 38px; border-radius: 11px; border: 1px solid transparent; background: var(--fill); padding: 0 12px 0 36px; outline: none; transition: background .15s, border-color .15s; }
.search input:focus { background: var(--card); border-color: var(--accent); }
.search svg { position: absolute; left: 12px; top: 11px; color: var(--text-3); }
.search kbd { position: absolute; right: 10px; top: 9px; font: 11px var(--mono); color: var(--text-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: none; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { background: var(--hover); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.list { flex: 1; overflow-y: auto; padding: 4px 8px 20px; }
.row { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 11px 10px; border-radius: 13px; cursor: default; border: 0; background: none; width: 100%; text-align: left; }
.row:hover { background: var(--hover); }
.row.on { background: var(--active); }
.row .avatar { width: 38px; height: 38px; font-size: 14px; }
.row-top { display: flex; align-items: baseline; gap: 8px; }
.row-from { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.unread .row-from { font-weight: 750; }
.row-time { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-subj { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row.unread .row-subj { font-weight: 600; }
.row-snip { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row-icons { display: flex; gap: 6px; align-items: center; margin-top: 5px; }
/* Непрочитанное: полоска слева, подсветка строки, светящаяся точка на аватаре (яркий цвет дизайна — виден и на Obsidian) */
.row-avatar { position: relative; width: 38px; height: 38px; }
.unread-dot { position: absolute; right: -3px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; background: var(--accent-text);
  border: 2.5px solid var(--pane); box-shadow: 0 0 10px color-mix(in srgb, var(--accent-text) 70%, transparent); }
.row.unread { background: color-mix(in srgb, var(--accent-text) 8%, transparent); }
.row.unread:hover { background: color-mix(in srgb, var(--accent-text) 12%, transparent); }
.row.unread::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent-text);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent-text) 60%, transparent); }
.row.unread .row-from, .row.unread .row-subj { color: var(--text); }
.row:not(.unread) .row-from { font-weight: 500; color: var(--text-2); }
.row:not(.unread) .row-subj { color: var(--text-2); }
.row.unread .row-time { color: var(--accent-text); font-weight: 700; }
.row.on.unread { background: var(--active); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--fill); color: var(--text-2); }
.tag.ai { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); }
.list-empty, .reader-empty { height: 100%; display: grid; place-items: center; text-align: center; color: var(--text-3); padding: 40px; }
.list-empty b, .reader-empty b { display: block; color: var(--text); font-size: 16px; margin: 12px 0 4px; }
.more { display: block; margin: 8px auto; }

.avatar { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; letter-spacing: -.02em; }

/* Чтение */
.reader { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.reader-bar { display: flex; align-items: center; gap: 2px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.reader-bar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.reader-scroll { flex: 1; overflow-y: auto; }
.reader-inner { max-width: 860px; margin: 0 auto; padding: 26px 34px 60px; }
.subject { font-size: 26px; line-height: 1.2; font-weight: 750; letter-spacing: -.02em; margin: 0 0 18px; overflow-wrap: anywhere; }
.sender { display: flex; align-items: center; gap: 12px; }
.sender .avatar { width: 44px; height: 44px; font-size: 16px; }
.sender-name { font-weight: 650; font-size: 15px; }
.sender-addr { color: var(--text-3); font-size: 13px; }
.sender-meta { margin-left: auto; text-align: right; color: var(--text-3); font-size: 12.5px; }
.ai-card { margin: 20px 0 6px; padding: 16px 18px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.ai-card h3 { margin: 0 0 6px; font-size: 13px; color: var(--accent-text); display: flex; align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: .06em; }
.ai-card .summary { font-size: 15.5px; font-weight: 600; line-height: 1.4; }
.ai-card ul { margin: 8px 0 0; padding-left: 20px; color: var(--text-2); }
.ai-card .meta { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.ai-card.muted { background: var(--fill-2); border-color: var(--line-2); }
.ai-card.muted h3 { color: var(--text-2); }
.body { margin-top: 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line-2); overflow: hidden; }
.body-text { padding: 22px 24px; font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.body iframe { display: block; width: 100%; border: 0; background: #fff; min-height: 120px; }
.body-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; color: var(--text-3); background: var(--fill-2); }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.att { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); max-width: 280px; }
.att:hover { border-color: var(--accent); }
.att b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att span { font-size: 11.5px; color: var(--text-3); }
.att-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--fill); display: grid; place-items: center; font: 700 10px var(--mono); color: var(--text-2); flex: none; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; }
.btn:hover { border-color: color-mix(in srgb, var(--text) 25%, transparent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { border-color: transparent; background: none; }
.btn:disabled { opacity: .5; cursor: default; }
.banner { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: var(--fill-2); color: var(--text-2); font-size: 13.5px; display: flex; gap: 10px; align-items: center; }

/* Написать */
.compose { position: fixed; right: 28px; bottom: 24px; z-index: 30; width: min(640px, calc(100vw - 56px)); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column; border-radius: 20px; background: var(--card); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  animation: rise .22s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
@keyframes rise { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.compose-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line-2); font-weight: 700; }
.field-row { display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid var(--line-2); min-height: 44px; }
.field-row label { width: 54px; color: var(--text-3); font-size: 13.5px; flex: none; }
.field-row input, .field-row select { flex: 1; border: 0; outline: none; background: none; height: 42px; font-size: 14.5px; min-width: 0; }
.compose textarea { flex: 1; min-height: 260px; border: 0; outline: none; resize: none; background: none; padding: 16px 20px; font-size: 15px; line-height: 1.55; }
.compose-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.error { color: var(--danger); font-size: 13px; }

/* Мелочи */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 40; padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg);
  font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: rise .2s; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.menu { position: absolute; z-index: 200; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 7px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: 13.5px; }
.menu button:hover { background: var(--hover); }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 6px 4px; }
.kbd-hint { font: 11px var(--mono); color: var(--text-3); margin-left: auto; }
.scrim { position: fixed; inset: 0; z-index: 19; }

@media (max-width: 1100px) { .shell { grid-template-columns: 220px minmax(300px, 340px) minmax(0, 1fr); } .reader-inner { padding: 22px 22px 50px; } }
@media (max-width: 760px) { .login { grid-template-columns: 1fr; } .login-hero { display: none; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); } .sidebar { display: none; }
  .shell.reading .list-pane { display: none; } .shell:not(.reading) .reader { display: none; }
}

/* ---------- Главная страница (до входа): всегда тёмная, в стиле подписки ---------- */
.landing { --l-bg: #07070C; --l-surface: #12111C; --l-line: rgba(255,255,255,.09); --l-text: #F4F2FF; --l-2: #A9A5C8; --l-3: #8C88AD;
  --l-accent: #7C5CFF; --l-accent-2: #6366F1; --l-cyan: #22D3EE; --l-gold: #F4D06F;
  position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden; background: var(--l-bg); color: var(--l-text); z-index: 2; scroll-behavior: smooth; }
.landing a { color: inherit; text-decoration: none; }
.l-glow { position: absolute; inset: 0 0 auto 0; height: 1100px; pointer-events: none;
  background: radial-gradient(700px 520px at 12% 0%, rgba(108,92,255,.42), transparent 65%),
              radial-gradient(620px 480px at 92% 8%, rgba(0,190,255,.22), transparent 65%),
              radial-gradient(560px 460px at 55% 55%, rgba(124,58,237,.18), transparent 65%); }
.l-wrap { position: relative; max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.l-nav { position: sticky; top: 0; z-index: 5; backdrop-filter: blur(18px) saturate(1.4); background: rgba(7,7,12,.6); border-bottom: 1px solid transparent; transition: border-color .2s; }
.l-nav.scrolled { border-bottom-color: var(--l-line); }
.l-nav .l-wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.l-nav .brand { color: var(--l-text); }
.l-links { display: flex; gap: 26px; font-size: 14.5px; color: var(--l-2); }
.l-links a:hover { color: var(--l-text); }
.l-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 13px; border: 1px solid var(--l-line);
  background: rgba(255,255,255,.06); color: var(--l-text); font-weight: 650; font-size: 15px; transition: transform .15s, background .15s, box-shadow .15s; }
.l-btn:hover { background: rgba(255,255,255,.1); transform: translateY(-1px); }
.l-btn.primary { border: 0; background: linear-gradient(135deg, #6366F1, #8B5CF6 55%, #0EA5E9); box-shadow: 0 14px 40px rgba(124,58,237,.45); }
.l-btn.primary:hover { box-shadow: 0 18px 50px rgba(124,58,237,.6); }
.l-btn.big { height: 54px; padding: 0 26px; border-radius: 16px; font-size: 16px; }
.l-hero { padding: 84px 0 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; align-items: center; }
.l-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid var(--l-line);
  font-size: 12.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: #CFCBFF; }
.l-h1 { font-size: clamp(42px, 5.2vw, 68px); line-height: 1.02; font-weight: 820; letter-spacing: -.04em; margin: 22px 0 0; }
.l-h1 em { font-style: normal; background: linear-gradient(120deg, #A78BFA, #67E8F9 60%, #F4D06F); -webkit-background-clip: text; background-clip: text; color: transparent; }
.l-lead { font-size: 19px; line-height: 1.55; color: var(--l-2); margin: 22px 0 0; max-width: 520px; }
.l-cta { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; align-items: center; }
.l-note { font-size: 13px; color: var(--l-3); margin-top: 16px; }

/* Живой макет почты в первом экране */
.l-mock { position: relative; border-radius: 22px; background: rgba(18,17,28,.85); border: 1px solid var(--l-line); box-shadow: 0 40px 120px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.03) inset;
  overflow: hidden; transform: perspective(1600px) rotateY(-7deg) rotateX(3deg); transition: transform .6s; }
.l-mock:hover { transform: perspective(1600px) rotateY(-2deg) rotateX(1deg); }
.l-mock-bar { display: flex; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--l-line); }
.l-mock-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3946; }
.l-mock-body { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 380px; }
.l-mock-list { border-right: 1px solid var(--l-line); padding: 10px; display: grid; gap: 4px; align-content: start; }
.l-mock-row { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 9px; padding: 9px; border-radius: 10px; }
.l-mock-row.on { background: rgba(124,92,255,.18); }
.l-mock-row .avatar { width: 26px; height: 26px; font-size: 10px; }
.l-mock-row b { display: block; font-size: 11.5px; } .l-mock-row span { display: block; font-size: 10.5px; color: var(--l-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-mock-read { padding: 22px 22px; }
.l-mock-read h4 { margin: 0 0 12px; font-size: 17px; letter-spacing: -.01em; }
.l-ai { padding: 14px 16px; border-radius: 14px; background: linear-gradient(135deg, rgba(99,102,241,.22), rgba(14,165,233,.12)); border: 1px solid rgba(124,92,255,.35); }
.l-ai small { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 750; letter-spacing: .08em; color: #C4B5FD; text-transform: uppercase; }
.l-ai p { margin: 6px 0 0; font-size: 13.5px; font-weight: 650; line-height: 1.4; }
.l-ai ul { margin: 8px 0 0; padding-left: 18px; font-size: 12px; color: var(--l-2); }
.l-lines { margin-top: 16px; display: grid; gap: 8px; } .l-lines i { display: block; height: 8px; border-radius: 4px; background: rgba(255,255,255,.07); }
.l-floating { position: absolute; padding: 10px 14px; border-radius: 14px; background: rgba(23,21,42,.92); border: 1px solid var(--l-line); box-shadow: 0 20px 50px rgba(0,0,0,.5);
  font-size: 12.5px; display: flex; align-items: center; gap: 10px; animation: float 6s ease-in-out infinite; }
.l-floating b { display: block; font-size: 13px; }
@keyframes float { 50% { transform: translateY(-8px); } }

.l-providers { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; padding: 36px 0 20px; color: var(--l-3); font-weight: 650; letter-spacing: .02em; }
.l-section { padding: 96px 0 10px; }
.l-kicker { font-size: 13px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: #A78BFA; }
.l-h2 { font-size: clamp(32px, 3.6vw, 46px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; margin: 12px 0 0; max-width: 720px; }
.l-sub { font-size: 17px; color: var(--l-2); margin: 16px 0 0; max-width: 620px; line-height: 1.55; }
.l-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 44px; }
.l-card { position: relative; padding: 26px; border-radius: 22px; background: var(--l-surface); border: 1px solid var(--l-line); overflow: hidden; transition: transform .2s, border-color .2s; }
.l-card:hover { transform: translateY(-3px); border-color: rgba(167,139,250,.35); }
.l-card .ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; }
.l-card h3 { font-size: 18px; margin: 18px 0 6px; letter-spacing: -.01em; }
.l-card p { margin: 0; color: var(--l-2); font-size: 14.5px; line-height: 1.55; }
.l-card.wide { grid-column: span 2; }
.l-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 44px; }
.l-step { padding: 26px; border-radius: 22px; border: 1px solid var(--l-line); background: rgba(255,255,255,.03); }
.l-step b { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: rgba(124,92,255,.2); color: #C4B5FD; font-size: 15px; }
.l-step h3 { margin: 16px 0 6px; font-size: 17px; } .l-step p { margin: 0; color: var(--l-2); font-size: 14.5px; line-height: 1.55; }

/* Тарифы */
.l-period { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid var(--l-line); margin-top: 32px; }
.l-period button { border: 0; background: none; color: #CFCBFF; height: 40px; padding: 0 18px; border-radius: 10px; font-weight: 650; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.l-period button.on { background: #F4F2FF; color: #14112E; }
.l-period small { color: #4ADE80; font-weight: 800; } .l-period button.on small { color: #15803D; }
.l-plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 28px; align-items: stretch; }
.l-plan { position: relative; display: flex; flex-direction: column; padding: 24px; border-radius: 24px; min-height: 420px; overflow: hidden; }
.l-plan .mat { font-size: 11.5px; font-weight: 800; letter-spacing: .16em; opacity: .7; }
.l-plan h3 { font-size: 28px; margin: 4px 0 0; letter-spacing: -.02em; }
.l-plan .price { font-size: 42px; font-weight: 820; letter-spacing: -.04em; margin-top: 22px; font-variant-numeric: tabular-nums; }
.l-plan .price small { font-size: 15px; font-weight: 500; opacity: .7; letter-spacing: 0; }
.l-plan .per { font-size: 13px; opacity: .72; min-height: 18px; }
.l-plan ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 11px; font-size: 14.5px; }
.l-plan li { display: flex; gap: 10px; align-items: flex-start; } .l-plan li svg { flex: none; margin-top: 2px; }
.l-plan .l-btn { margin-top: auto; width: 100%; }
.l-plan.free { background: var(--l-surface); border: 1px solid var(--l-line); }
.l-plan.starter { background: linear-gradient(150deg, #F3F1FB, #D9DCEC 45%, #BFC6DE); color: #1C1A33; }
.l-plan.starter .l-btn { background: #1C1A33; color: #F3F1FB; border: 0; }
.l-plan.pro { background: radial-gradient(90% 60% at 90% 0%, rgba(255,255,255,.3), transparent 60%), radial-gradient(80% 50% at 0% 100%, rgba(34,211,238,.35), transparent 70%), linear-gradient(155deg, #4F46E5, #7C3AED 48%, #0EA5E9);
  box-shadow: 0 30px 80px rgba(124,58,237,.45); transform: translateY(-10px); }
.l-plan.pro .l-btn { background: #fff; color: #3B2DB8; border: 0; }
.l-plan.max { background: radial-gradient(100% 60% at 100% 0%, rgba(244,208,111,.32), transparent 55%), linear-gradient(160deg, #26231C, #0E0D0B 55%, #1B1812); color: #F6E7B8; border: 1px solid #3d3320; }
.l-plan.max .l-btn { background: linear-gradient(135deg, #F6E7B8, #D4AF37); color: #1A1608; border: 0; }
.l-badge { position: absolute; top: 20px; right: 20px; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.92); color: #3B2DB8; font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.l-plans-note { margin-top: 18px; font-size: 13px; color: var(--l-3); }

.l-privacy { margin-top: 96px; padding: 44px; border-radius: 28px; background: linear-gradient(135deg, rgba(99,102,241,.16), rgba(14,165,233,.08)); border: 1px solid rgba(124,92,255,.25);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.l-privacy ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.l-privacy li { display: flex; gap: 12px; font-size: 15px; color: var(--l-2); line-height: 1.5; } .l-privacy li b { color: var(--l-text); }
.l-faq { margin-top: 36px; display: grid; gap: 10px; max-width: 820px; }
.l-faq details { border-radius: 18px; background: var(--l-surface); border: 1px solid var(--l-line); padding: 0 22px; }
.l-faq summary { cursor: pointer; list-style: none; padding: 20px 0; font-weight: 650; font-size: 16px; display: flex; justify-content: space-between; gap: 12px; }
.l-faq summary::after { content: "+"; color: var(--l-3); font-size: 22px; line-height: 1; transition: transform .2s; }
.l-faq details[open] summary::after { transform: rotate(45deg); }
.l-faq p { margin: 0 0 20px; color: var(--l-2); line-height: 1.6; }
.l-final { margin: 110px 0 0; text-align: center; padding: 70px 30px; border-radius: 32px; background: radial-gradient(600px 300px at 50% 0%, rgba(124,92,255,.35), transparent 70%), var(--l-surface); border: 1px solid var(--l-line); }
.l-footer { margin-top: 70px; padding: 30px 0 40px; border-top: 1px solid var(--l-line); display: flex; gap: 24px; align-items: center; color: var(--l-3); font-size: 13.5px; flex-wrap: wrap; }
.l-back { position: absolute; top: 24px; left: 28px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; color: #CFCBFF; font-weight: 600; font-size: 14px; background: none; border: 0; }
.l-back:hover { color: #fff; }

@media (max-width: 1000px) {
  .l-hero { grid-template-columns: 1fr; } .l-mock { transform: none; } .l-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .l-grid, .l-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .l-card.wide { grid-column: span 2; } .l-privacy { grid-template-columns: 1fr; }
  .l-links { display: none; }
}
@media (max-width: 640px) {
  .l-wrap { padding: 0 18px; } .l-grid, .l-steps, .l-plans { grid-template-columns: 1fr; } .l-card.wide { grid-column: auto; }
  .l-plan.pro { transform: none; } .l-mock-body { grid-template-columns: 1fr; } .l-mock-list { display: none; } .l-privacy { padding: 26px; }
}

/* Переключатель языка RU / DE */
.lang-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--fill); }
.lang-switch button { border: 0; background: none; height: 28px; min-width: 38px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--text-3); }
.lang-switch button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.lang-switch.dark { background: rgba(255,255,255,.07); border: 1px solid var(--l-line); }
.lang-switch.dark button { color: #8C88AD; } .lang-switch.dark button.on { background: #F4F2FF; color: #14112E; }

/* Возможности: при наведении — подробный пример поверх карточки */
.l-sub .l-hint { display: block; margin-top: 10px; font-size: 13.5px; color: #8C88AD; }
.l-card { min-height: 230px; cursor: default; }
.l-card .l-card-text { transition: opacity .25s, transform .25s; }
.l-card-more { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 26px 24px; opacity: 0; transform: translateY(14px);
  transition: opacity .3s, transform .35s cubic-bezier(.2,.8,.2,1);
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--c) 14%, #12111C) 28%, color-mix(in srgb, var(--c) 18%, #12111C)); pointer-events: none; }
.l-card-more small { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); }
.l-card-more p { margin: 10px 0 0; color: #E8E6F8; font-size: 14.5px; line-height: 1.55; }
.l-card:hover, .l-card:focus-visible { border-color: color-mix(in srgb, var(--c) 55%, transparent); box-shadow: 0 20px 60px color-mix(in srgb, var(--c) 18%, transparent); }
.l-card:hover .l-card-more, .l-card:focus-visible .l-card-more { opacity: 1; transform: none; }
.l-card:hover .l-card-text, .l-card:focus-visible .l-card-text { opacity: 0; transform: translateY(-6px); }
.l-card::after { content: ""; position: absolute; inset: auto -40% -60% auto; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%); opacity: 0; transition: opacity .35s; pointer-events: none; }
.l-card:hover::after { opacity: 1; }
@media (hover: none) { .l-card-more { position: static; opacity: 1; transform: none; background: none; padding: 12px 0 0; } .l-card:hover .l-card-text { opacity: 1; transform: none; } }

.expired { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(14px); }
.expired-card { max-width: 420px; text-align: center; padding: 34px; border-radius: 24px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.expired-card .brand-mark { display: grid; place-items: center; background: linear-gradient(135deg, #3D8FEA, #7C5CFF); }
.expired-card h2 { margin: 0 0 8px; font-size: 22px; } .expired-card p { color: var(--text-2); margin: 0 0 22px; line-height: 1.5; }

/* Просмотр вложений: окно поверх письма, скачивание — только по кнопке */
.att-ico.kind-pdf { background: #FDE2E1; color: #B42318; } .att-ico.kind-image { background: #DCEBFF; color: #1D5FB8; }
.att-ico.kind-video { background: #EDE3FF; color: #6A3FC9; } .att-ico.kind-audio { background: #FFF0D6; color: #A15C00; }
.att-ico.kind-text { background: #E3F5E9; color: #1F7A42; }
:root[data-theme="dark"] .att-ico.kind-pdf { background: #3D1B1B; color: #FF9D94; } :root[data-theme="dark"] .att-ico.kind-image { background: #16283E; color: #8DBDF4; }
:root[data-theme="dark"] .att-ico.kind-video { background: #2A2152; color: #CDBFFF; } :root[data-theme="dark"] .att-ico.kind-audio { background: #3A2A0F; color: #F4C56F; }
:root[data-theme="dark"] .att-ico.kind-text { background: #16341F; color: #7FD99A; }
.viewer { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: rgba(8,8,12,.82); backdrop-filter: blur(18px) saturate(1.2);
  animation: fade .18s ease-out; color: #F2F2EF; }
@keyframes fade { from { opacity: 0; } }
.viewer-bar { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.viewer-bar .att-ico { width: 38px; height: 38px; }
.viewer-name { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50vw; }
.viewer-meta { font-size: 12.5px; color: #A9A9B4; }
.viewer-btn { height: 38px; min-width: 38px; padding: 0 10px; border-radius: 11px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #F2F2EF;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; }
.viewer-btn:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.viewer-btn:disabled { opacity: .35; cursor: default; }
.viewer-btn.wide { padding: 0 16px; background: #F2F2EF; color: #111; border-color: transparent; }
.viewer-btn.wide:hover:not(:disabled) { background: #fff; }
.viewer-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 24px; }
.viewer-image { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 30px 90px rgba(0,0,0,.6); animation: rise .25s; }
.viewer-frame { width: min(1100px, 100%); height: 100%; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.viewer-media { max-width: 100%; max-height: 100%; border-radius: 12px; }
.viewer-text { width: min(1000px, 100%); height: 100%; overflow: auto; margin: 0; padding: 24px 28px; border-radius: 14px; background: #16161A; color: #E8E8E6;
  font: 13px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.viewer-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: #C9C9D1; max-width: 420px; }
.viewer-empty b { font-size: 17px; color: #fff; overflow-wrap: anywhere; }
.viewer-file { width: 88px; height: 108px; border-radius: 16px; display: grid; place-items: center; font: 800 18px var(--mono); background: #26262E; color: #E8E8E6;
  box-shadow: 0 20px 50px rgba(0,0,0,.5); margin-bottom: 6px; }
.viewer-big-ico { font-size: 56px; opacity: .8; }

/* Кнопки поменьше, меню, карточка ИИ, приглашение в календарь */
.btn.sm-btn { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.menu-head { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.ai-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ai-card .reason { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.ai-card.muted h3 { text-transform: none; letter-spacing: 0; font-size: 14px; }
.ai-card .meta { align-items: center; }
.body-bar { flex-wrap: wrap; }
.cal-card { display: flex; gap: 16px; align-items: flex-start; margin: 14px 0 0; padding: 16px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.cal-tile { width: 58px; height: 62px; flex: none; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; background: #fff; box-shadow: var(--shadow); }
.cal-tile span { background: #E5484D; color: #fff; font-size: 11px; font-weight: 800; text-align: center; padding: 3px 0; letter-spacing: .04em; }
.cal-tile b { flex: 1; display: grid; place-items: center; font-size: 26px; font-weight: 600; color: #111; }
.cal-title { font-weight: 650; font-size: 16px; }
.cal-meta { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-2); margin-top: 3px; }
.cal-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.cal-actions a.btn { text-decoration: none; color: var(--text); }
.cal-note { font-size: 12px; color: var(--text-3); }
.body iframe { overflow: hidden; }

/* Подробности отправителя (нажатие на отправителя) — как в Почте iPhone */
.sender { cursor: pointer; margin: 0 -10px; padding: 8px 10px; border-radius: 14px; transition: background .15s; }
.sender:hover, .sender.open { background: var(--hover); }
.sender:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sender-chev { color: var(--text-3); font-weight: 400; font-size: 13px; }
.sender-details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; align-items: start; margin-top: 10px; padding: 14px 16px;
  border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 13.5px; }
.sd-key { color: var(--text-3); padding-top: 5px; }
.sd-val { min-width: 0; padding-top: 0; }
.sd-val > span { display: inline-block; padding-top: 5px; }
.addr-list { display: flex; flex-wrap: wrap; gap: 6px; }
.addr-chip { max-width: 100%; height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--fill); color: var(--accent-text);
  font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.addr-chip span { color: var(--text-3); font-weight: 400; margin-left: 4px; }
.addr-chip:hover { filter: brightness(.95); }

/* ================= Разделы как в приложении: настройки, ИИ, черновики, архив NAS (2026-10-03) ================= */
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warn { color: var(--warn); } .ok { color: var(--ok); }
.mobile-only { display: none; }
.spinner.light { border-color: rgba(255,255,255,.35); border-top-color: #fff; width: 16px; height: 16px; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost.danger { color: var(--danger); background: none; border-color: transparent; }
.icon-btn.danger { color: var(--danger); }
.icon-btn.ai { color: var(--accent-text); }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-text); font-weight: 600; font-size: 13.5px; }

/* Боковая панель */
.compose-row { display: flex; gap: 8px; margin: 0 4px 14px; }
.compose-row .compose-btn { flex: 1; margin: 0; }
.ai-nav { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 13px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, var(--card)); color: var(--accent-text); font-weight: 700; }
.ai-nav:hover, .ai-nav.on { background: color-mix(in srgb, var(--accent) 22%, var(--card)); }
.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin: 0 -4px; padding: 0 4px; }
.me { padding: 4px; }
.me > span:first-child { flex: 1; min-width: 0; }
.me-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: 0; border-radius: 12px; background: none; text-align: left; }
.me-btn:hover { background: var(--hover); }
.me-btn .me-name { display: block; }
.profile-badge { border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; flex: none; line-height: 1; }
.menu .count { margin-left: auto; font-size: 11px; color: var(--text-3); }

/* Список: статус, фильтр, история, действия */
.list-status { display: flex; align-items: center; gap: 8px; margin-top: -6px; font-size: 12.5px; color: var(--text-3); }
.list-status .spinner { width: 12px; height: 12px; border-width: 1.5px; }
.filter-note { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--active); color: var(--active-text); }
.filter-note button { border: 0; background: none; color: inherit; font-size: 15px; line-height: 1; padding: 0 4px; }
.search-clear { position: absolute; right: 8px; top: 7px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--line); color: var(--text-2); line-height: 1; }
.storage-warn { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 11px; border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--text); font-size: 12.5px; font-weight: 600; text-align: left; }
.history-waves { position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 16px; border: 0; overflow: hidden;
  background: none; color: #128a4a; font-size: 12.5px; font-weight: 700; text-align: left; }
:root[data-theme="dark"] .history-waves { color: #5BE39A; }
.history-waves span:last-child { position: relative; }
.waves { position: absolute; inset: 0; }
.waves i { position: absolute; left: -50%; right: -50%; top: -60%; height: 140%; border-radius: 0 0 45% 45%; animation: wave 6s linear infinite; }
.waves i:nth-child(1) { background: rgba(46,204,113,.20); }
.waves i:nth-child(2) { background: rgba(46,204,113,.14); animation-duration: 9s; animation-direction: reverse; top: -75%; }
.waves i:nth-child(3) { background: rgba(120,230,170,.14); animation-duration: 12s; top: -90%; }
@keyframes wave { from { transform: translateX(-12%) rotate(0); } 50% { transform: translateX(12%) rotate(1deg); } to { transform: translateX(-12%) rotate(0); } }
.list-pane { position: relative; }
.ai-fab { position: absolute; right: 18px; bottom: 18px; display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 18px; border-radius: 999px; border: 0;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #C084FC)); color: #fff; font-weight: 700;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 45%, transparent); }
.ai-fab:hover { transform: translateY(-1px); }
.row { cursor: pointer; }
.row-actions { position: absolute; right: 8px; top: 8px; display: none; gap: 2px; padding: 3px; border-radius: 10px; background: var(--card); box-shadow: var(--shadow); }
.row:hover .row-actions { display: flex; }
.row:hover .row-time { visibility: hidden; }
.row-actions button { width: 28px; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--text-2); display: grid; place-items: center; }
.row-actions button:hover { background: var(--hover); color: var(--text); }
.row-actions button.on { color: #F29A1F; }
.menu svg { flex: none; opacity: .75; }

/* Письмо: спам, перевод, переписка, ИИ */
.spam-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; font-size: 13.5px;
  background: color-mix(in srgb, var(--danger) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }
.spam-bar svg { color: var(--danger); flex: none; } .spam-bar span { flex: 1; }
.btn.ai-btn { background: color-mix(in srgb, var(--accent) 12%, var(--card)); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-text); }
.translation { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, #2F80ED 10%, var(--card)); border: 1px solid color-mix(in srgb, #2F80ED 22%, transparent);
  font-size: 14px; line-height: 1.55; color: var(--text-2); }
.translation.small { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tr-label { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; color: #2F80ED; margin-bottom: 4px; }
.translation.small .tr-label { margin: 0; }
.thread { margin-top: 26px; display: flex; flex-direction: column; gap: 8px; }
.thread-card { border-radius: 14px; background: var(--card); border: 1px solid var(--line-2); }
.thread-head { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; border-radius: 14px; }
.thread-head:hover { background: var(--hover); }
.thread-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--text-2); flex: none; }
.thread-ico.mine { background: var(--active); color: var(--accent-text); }
.thread-top { display: flex; gap: 8px; align-items: baseline; } .thread-top b { flex: 1; min-width: 0; font-size: 14px; }
.thread-top > span { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.thread-snip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: var(--text-2); margin-top: 2px; }
.thread-body { padding: 0 16px 14px 58px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.quote { white-space: pre-wrap; font-size: 13.5px; color: var(--text-2); padding-left: 10px; border-left: 2px solid var(--line); overflow-wrap: anywhere; }

/* Страницы (настройки, ИИ, черновики, архив) — на месте списка и письма */
.shell.page-mode .page { grid-column: 2 / -1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.page-scroll { flex: 1; overflow-y: auto; }
.page-inner { max-width: 1060px; margin: 0 auto; padding: 26px 34px 60px; }
.page-inner.narrow { max-width: 780px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -.025em; display: flex; align-items: center; gap: 10px; }
.page-sub { color: var(--text-3); font-size: 13.5px; margin-top: 3px; line-height: 1.45; }
.mb-dot.big { width: 13px; height: 13px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 60px 20px; color: var(--text-3); text-align: center; }
.empty-state b { color: var(--text); font-size: 16px; }

.settings { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.set-nav { overflow-y: auto; padding: 18px 10px; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 2px;
  background: color-mix(in srgb, var(--pane) 55%, transparent); }
.set-nav .nav-label { padding-top: 12px; }
.set-nav .nav-item.danger { color: var(--danger); }
.set-me { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; }
.set-me b { display: block; font-size: 15px; } .set-me div > span { font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.set-me .avatar { font-size: 17px; }
.set-nav .nav-item { height: auto; min-height: 34px; padding: 6px 10px; line-height: 1.25; }
.set-body { overflow-y: auto; min-width: 0; }
.set-inner { max-width: 1000px; padding: 26px 34px 60px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; align-items: start; }
.set-section { margin-bottom: 20px; }
.set-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 0 4px 8px; }
.set-card { border-radius: 16px; background: var(--card); border: 1px solid var(--line-2); overflow: hidden; }
.set-foot { font-size: 12.5px; color: var(--text-3); margin: 8px 6px 0; line-height: 1.45; }
.set-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 9px 14px; border: 0; background: none; text-align: left; font-size: 14.5px; color: var(--text); }
.set-row + .set-row, .set-card > * + .set-row { border-top: 1px solid var(--line-2); }
button.set-row:hover:not(:disabled), .draft-row:hover { background: var(--hover); cursor: pointer; }
button.set-row:disabled { cursor: default; opacity: .8; }
.set-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.set-ico.sm { width: 24px; height: 24px; border-radius: 7px; }
.set-row-title { flex: 1; min-width: 0; }
.set-row-title.danger { color: var(--danger); }
.set-row-value { color: var(--text-3); font-size: 13.5px; text-align: right; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.set-row-sub { font-size: 12.5px; color: var(--text-3); line-height: 1.4; }
.set-row-sub.warn { color: var(--warn); }
.set-chev { color: var(--text-3); display: grid; transition: transform .15s; }
.set-note { padding: 12px 14px; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.set-note.warn { color: var(--warn); }
.set-error { color: var(--danger); font-size: 13px; margin: 8px 4px; }
.set-select { height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--fill-2); padding: 0 8px; font-size: 13.5px; }
.switch { position: relative; width: 44px; height: 26px; border-radius: 999px; border: 0; background: var(--line); flex: none; transition: background .2s; padding: 0; }
.switch span { position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch.on { background: var(--ok); } .switch.on span { transform: translateX(18px); }
.switch:disabled { opacity: .5; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--fill); max-width: 100%; flex-wrap: wrap; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 9px; background: none; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg button small { font-weight: 500; color: var(--text-3); }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }
.form { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.input { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--fill-2); padding: 0 12px; outline: none; font-size: 14.5px; min-width: 0; }
.input:focus { border-color: var(--accent); background: var(--card); }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.preset-grid .chip { height: 34px; justify-content: center; }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.date-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.date-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-3); }
.cstep { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; font-size: 14px; }
.cstep + .cstep { border-top: 1px solid var(--line-2); }
.cstep-ico { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; margin-top: 1px; }
.cstep-ico.ok { background: var(--ok); } .cstep-ico.bad { background: var(--danger); }
.howto { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 14px; line-height: 1.45; }
.howto-n { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; flex: none; margin-top: 1px; }
.done-card { max-width: 520px; margin: 30px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.done-card h2 { margin: 6px 0 0; } .done-card .set-section { width: 100%; text-align: left; margin-top: 10px; }
.done-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; }
.history-job { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--fill-2); }
.hj-top { display: flex; align-items: center; justify-content: space-between; } .hj-top b { font-size: 26px; letter-spacing: -.02em; }
.hj-grid { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13px; color: var(--text-2); }
.bar { height: 8px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s; }
.bar span.ok { background: var(--ok); } .bar span.warn { background: var(--warn); } .bar span.bad { background: var(--danger); }
.mem-top { display: flex; align-items: baseline; gap: 6px; } .mem-top b { font-size: 20px; } .mem-top span { color: var(--text-3); font-size: 13px; }
.modal-back { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.35); backdrop-filter: blur(6px); }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 18px; border-radius: 20px; background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: rise .2s; }
.modal.small { width: min(400px, 100%); background: var(--card); }
.modal h3 { margin: 0 0 6px; font-size: 18px; } .modal p { margin: 0 0 16px; color: var(--text-2); line-height: 1.5; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; } .modal-head h3 { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.spam-choices { display: flex; flex-direction: column; gap: 8px; } .spam-choices .btn { justify-content: center; overflow-wrap: anywhere; }
.disabled-block { opacity: .45; pointer-events: none; }
.notif-preview { padding: 16px; border-radius: 18px; background: var(--fill); margin-bottom: 20px; }
.notif { display: flex; gap: 10px; padding: 12px; border-radius: 20px; background: color-mix(in srgb, var(--card) 85%, transparent); backdrop-filter: blur(20px); box-shadow: var(--shadow); font-size: 14px; }
.notif.off { opacity: .4; }
.notif-ico { width: 38px; height: 38px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.notif-top { display: flex; gap: 8px; } .notif-top b { flex: 1; min-width: 0; } .notif-top span { font-size: 12.5px; color: var(--text-3); }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-field { display: flex; flex-direction: column; gap: 3px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.tpl-field span { font-size: 12px; color: var(--text-3); }
.tpl-field input { border: 0; outline: none; background: none; font-size: 15px; padding: 0; }
.cost-card { margin: 16px 0 20px; padding: 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line-2); }
.cost-top { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 14px; }
.cost-big { font-size: 34px; font-weight: 750; letter-spacing: -.03em; } .cost-mid { font-size: 22px; font-weight: 650; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 92px; border-bottom: 1px solid var(--line-2); }
.bars span { flex: 1; border-radius: 3px 3px 0 0; background: var(--fill); min-width: 2px; }
.bars span.on { background: var(--accent); }
.bars-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-top: 6px; }

/* Подписка и токены (тарифные «карты» как в приложении) */
.plan-card { position: relative; padding: 22px 24px; border-radius: 22px; margin-bottom: 20px; overflow: hidden; color: #fff; box-shadow: var(--shadow-lg); }
.plan-card.pearl { background: linear-gradient(135deg, #F7F6FD, #C9CFE6 60%, #A7B0D3); color: #1C1A33; }
.plan-card.aurora { background: radial-gradient(400px 200px at 0% 0%, #0EA5E9 0%, transparent 70%), linear-gradient(135deg, #4F46E5, #7C3AED 60%, #2E1065); }
.plan-card.obsidian { background: radial-gradient(500px 220px at 100% 0%, rgba(244,208,111,.25), transparent 70%), linear-gradient(135deg, #26231C, #0E0D0B); color: #F6E7B8; border: 1px solid #5c4a1c; }
.plan-card.free { background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.pc-top { display: flex; justify-content: space-between; align-items: center; }
.pc-label { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; opacity: .75; }
.pc-chip { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.18); }
.pc-name { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 10px 0 2px; }
.pc-meta { font-size: 13.5px; opacity: .8; }
.pc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.pc-stats div { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.12); }
.plan-card.pearl .pc-stats div { background: rgba(255,255,255,.55); }
.pc-stats b { display: block; font-size: 17px; } .pc-stats span { font-size: 11.5px; opacity: .75; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.plan-tile { position: relative; padding: 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.plan-tile.mine { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.plan-tile.pearl { border-top: 4px solid #A7B0D3; } .plan-tile.aurora { border-top: 4px solid #7C3AED; } .plan-tile.obsidian { border-top: 4px solid #C9A227; }
.pt-badge { position: absolute; right: 14px; top: 14px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; background: var(--active); color: var(--active-text); }
.pt-name { font-size: 18px; font-weight: 750; } .pt-price { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; }
.pt-price small { font-size: 13px; font-weight: 500; color: var(--text-3); } .pt-from { font-size: 12.5px; color: var(--accent-text); font-weight: 600; }
.plan-tile ul { margin: 12px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 8px; }
.pack { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.pack svg { grid-row: span 3; color: var(--accent-text); } .pack span { font-size: 12px; color: var(--text-3); } .pack em { font-style: normal; font-weight: 700; color: var(--accent-text); }
.tokens-hero { position: relative; display: flex; align-items: center; gap: 28px; padding: 22px; margin-bottom: 20px; border-radius: 22px;
  background: radial-gradient(400px 200px at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), var(--card); border: 1px solid var(--line-2); }
.ring-bg { fill: none; stroke: var(--fill); stroke-width: 14; } .ring-fg { fill: none; stroke: var(--accent); stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset .6s; }
.ring-text { position: absolute; left: 22px; width: 170px; text-align: center; } .ring-text b { display: block; font-size: 24px; } .ring-text span { font-size: 12px; color: var(--text-3); }
.tokens-side { flex: 1; min-width: 0; }
.tk-line { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.stack { display: flex; gap: 3px; height: 12px; margin-bottom: 12px; } .stack span { border-radius: 999px; min-width: 6px; }
.emoji-row, .color-row { display: flex; flex-wrap: wrap; gap: 8px; }
.emoji-row button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--fill-2); font-size: 19px; }
.emoji-row button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.color-row button { width: 30px; height: 30px; border-radius: 50%; border: 0; }
.color-row button.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }

/* Чат с ИИ */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-bottom: 1px solid var(--line-2); }
.chat-head b { font-size: 16px; }
.chat-list { flex: 1; overflow-y: auto; }
.chat-inner { max-width: 780px; margin: 0 auto; padding: 22px 22px 30px; display: flex; flex-direction: column; gap: 10px; }
.chat-hello { text-align: center; padding: 40px 10px 20px; color: var(--text-2); }
.chat-hello h2 { margin: 14px 0 8px; color: var(--text); font-size: 24px; letter-spacing: -.02em; }
.chat-hello p { max-width: 520px; margin: 0 auto; line-height: 1.55; }
.chat-hello-ico { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #C084FC)); box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 40%, transparent); }
.chat-context { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin-top: 16px; padding: 8px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 13.5px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.5; }
.bubble.user { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.bubble.ai { align-self: flex-start; background: var(--card); border: 1px solid var(--line-2); border-bottom-left-radius: 6px; }
.bubble.error { color: var(--danger); }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-voice { font-size: 12px; opacity: .85; margin-top: 4px; }
.bubble-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.bubble.question { border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.q-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.q-options .chip { height: 32px; background: var(--card); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.q-options .chip:hover { background: var(--active); }
.q-answer { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.bubble.thinking { display: flex; gap: 5px; padding: 14px 16px; }
.bubble.thinking span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.bubble.thinking span:nth-child(2) { animation-delay: .2s; } .bubble.thinking span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat-input { padding: 10px 22px 16px; max-width: 824px; width: 100%; margin: 0 auto; }
.composer { display: flex; align-items: flex-end; gap: 6px; padding: 6px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.composer:focus-within { border-color: var(--accent); }
.composer.listening { border-color: #E5484D; box-shadow: 0 0 0 4px rgba(229,72,77,.15); }
.composer textarea { flex: 1; min-height: 36px; max-height: 200px; resize: none; border: 0; outline: none; background: none; padding: 8px 4px; font-size: 15px; line-height: 1.45; field-sizing: content; }
.send-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.send-btn:disabled { opacity: .35; cursor: default; }
.mic-wrap { display: inline-flex; align-items: center; gap: 2px; }
.mic-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 9px; border-radius: 999px; border: 0;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-text); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.mic-btn.on { background: #E5484D; color: #fff; animation: pulse-red 1.4s infinite; }
@keyframes pulse-red { 50% { box-shadow: 0 0 0 6px rgba(229,72,77,.2); } }
.lang-btn { height: 26px; padding: 0 6px; border: 0; border-radius: 7px; background: none; font: 700 10.5px var(--mono); color: var(--text-3); }
.lang-btn:hover { background: var(--hover); }
.chat-note { font-size: 11.5px; color: var(--text-3); text-align: center; margin-top: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 5px; border-radius: 11px; background: var(--card); color: var(--text); border: 1px solid var(--line); max-width: 260px; }
.file-chip img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; flex: none; }
.file-ext { width: 38px; height: 38px; border-radius: 8px; background: var(--fill); display: grid; place-items: center; font: 700 10px var(--mono); color: var(--text-2); flex: none; }
.file-chip b { font-size: 12.5px; max-width: 160px; } .file-chip span span, .file-chip > span > span { font-size: 11px; color: var(--text-3); }
.draft-body { white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line-2); font-size: 15px; line-height: 1.6; }
.draft-edit { width: 100%; min-height: 300px; resize: vertical; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); font-size: 15px; line-height: 1.6; outline: none; }
.draft-edit:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.revise { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.revise .chip { height: 36px; }
.revise-input { flex: 1; min-width: 280px; display: flex; align-items: center; gap: 4px; padding: 3px 3px 3px 12px; border-radius: 999px; background: var(--card); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.revise-input input { flex: 1; border: 0; outline: none; background: none; height: 34px; font-size: 14px; min-width: 0; }
.page-head .btn { flex: none; }
.set-card .field-row { padding: 0 16px; }
.field-row select { cursor: pointer; }
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.total-card { padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line-2); } .total-card b { display: block; font-size: 26px; margin: 2px 0; }

/* Архив NAS */
.nas { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-3); }
.crumbs button { border: 0; background: none; padding: 2px 4px; border-radius: 6px; color: var(--accent-text); font-size: 12.5px; }
.crumbs button:hover { background: var(--hover); }
.nas-dir { display: flex; align-items: center; gap: 12px; width: 100%; height: 46px; padding: 0 12px; border: 0; border-radius: 12px; background: none; text-align: left; font-size: 14.5px; }
.nas-dir:hover { background: var(--hover); } .nas-dir span { flex: 1; } .nas-dir svg { color: var(--accent-text); flex: none; } .nas-dir svg:last-child { color: var(--text-3); }

@media (max-width: 1100px) { .two-col { grid-template-columns: minmax(0, 1fr); } .settings { grid-template-columns: 210px minmax(0, 1fr); } .pc-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .mobile-only { display: grid; }
  .shell.page-mode .page { grid-column: 1; }
  .settings { grid-template-columns: minmax(0, 1fr); } .set-nav { display: none; }
  .nas { grid-template-columns: minmax(0, 1fr); }
  .set-inner, .page-inner { padding: 18px 16px 50px; }
  .tokens-hero { flex-direction: column; } .ring-text { left: 0; right: 0; width: auto; top: 85px; }
}
@media (max-width: 860px) {
  /* Настройки на телефоне: корень — список разделов, раздел — на весь экран с «‹ Настройки» */
  .settings.at-root .set-body { display: none; }
  .settings.at-root .set-nav { display: flex; border-right: 0; padding: calc(10px + env(safe-area-inset-top)) 12px calc(30px + env(safe-area-inset-bottom)); gap: 2px; }
  .settings.at-root .set-nav .nav-item { min-height: 46px; font-size: 15.5px; gap: 12px; }
  .settings.at-root .set-nav .set-ico.sm { width: 28px; height: 28px; border-radius: 8px; }
  .settings.at-root .set-nav .nav-item.on:not(.danger) { background: none; color: var(--text); }
  .set-body .mobile-back { width: 100%; position: sticky; top: 0; z-index: 3; }
  /* У страницы своя «‹» (подраздел) — верхняя «‹ Настройки» не нужна */
  .set-body:has(.page-head > .icon-btn:first-child) > .mobile-back { display: none !important; }
  .set-body:has(.page-head > .icon-btn:first-child) .set-inner { padding-top: calc(14px + env(safe-area-inset-top)); }
}
.mobile-flex { display: none !important; }
@media (max-width: 860px) { .mobile-flex { display: flex !important; } }
.mobile-back { align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 0; border-bottom: 1px solid var(--line-2); background: var(--pane); color: var(--accent-text); font-weight: 600; flex: none; }

/* Написать — страница, ответ — блок под письмом (2026-10-03) */
.cm-card, .cm-inline { border-radius: 18px; background: var(--card); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.cm-inline { margin-top: 22px; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); animation: rise .2s; }
.cm-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 18px; border-bottom: 1px solid var(--line-2); color: var(--text-2); }
.cm-head b { color: var(--text); font-size: 14px; }
.cm-card .field-row, .cm-inline .field-row { padding: 0 18px; }
.field-row .link-btn { flex: none; font-size: 12.5px; }
.cm-body { display: block; width: 100%; min-height: 160px; resize: vertical; border: 0; outline: none; background: none; padding: 14px 18px; font-size: 15px; line-height: 1.6; }
.cm-body.big { min-height: 46vh; }
.cm-quote { padding: 0 18px 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cm-quote .quote { max-height: 260px; overflow: auto; width: 100%; }
.cm-page .page-head h1 { font-size: 24px; }
/* Свой просмотр PDF (pdf.js): страницы листом, тулбар снизу; клик мимо страницы закрывает */
.viewer-stage:has(.pdf-scroll) { padding: 0; }
.pdf-scroll { position: relative; width: 100%; height: 100%; overflow: auto; display: flex; flex-direction: column; align-items: center; }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 28px 24px 96px; }
.pdf-page { display: block; background: #fff; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.55); animation: rise .25s; }
.pdf-tools { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 6px;
  border-radius: 16px; background: rgba(28,28,34,.86); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 18px 50px rgba(0,0,0,.5); color: #F2F2EF; }
.pdf-count, .pdf-zoom { font: 600 13px var(--mono); padding: 0 10px; min-width: 64px; text-align: center; color: #D8D8DE; }
.pdf-tools .viewer-btn.on { background: #F2F2EF; color: #111; }
.profile-switch { display: flex; align-items: center; gap: 10px; width: 100%; margin: -6px 0 12px; padding: 7px 10px 7px 7px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--card); color: var(--text-2); text-align: left; }
.profile-switch:hover { border-color: var(--accent); }
.ps-label { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.ps-name { font-weight: 650; font-size: 14px; color: var(--text); }
.sidebar > span:has(.profile-switch) { display: block; }
.pending-tray { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.sources { align-self: flex-start; display: flex; flex-direction: column; gap: 6px; max-width: 82%; }
.source-card { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  background: var(--card); color: var(--text); min-width: 260px; }
.source-card:hover { border-color: var(--accent); }
.source-modal { width: min(720px, 100%); background: var(--card); }
.bubble-btn { text-align: left; font: inherit; color: inherit; cursor: pointer; } .bubble-btn:hover { border-color: var(--accent); }
/* Переписка как чат (поверх чата ИИ): ваши письма справа, их — слева */
.source-modal.convo { width: min(760px, 100%); height: min(86vh, 900px); display: flex; flex-direction: column; background: var(--bg); }
.convo-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 6px 2px 10px; }
.convo-row { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.convo-row.mine { align-items: flex-end; }
.convo-meta { font-size: 11.5px; color: var(--text-3); padding: 0 8px; }
.convo-bubble { max-width: 82%; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--card); border: 1px solid var(--line-2);
  font-size: 14.5px; line-height: 1.5; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.convo-row.mine .convo-bubble { border-radius: 18px 18px 6px 18px; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.convo-row.mine .link-btn { color: #fff; opacity: .9; }
.convo-row.mine .quote { color: rgba(255,255,255,.85); border-left-color: rgba(255,255,255,.5); }
.convo-subject { font-size: 12.5px; font-weight: 700; opacity: .85; }
.convo-att { font-size: 12px; opacity: .85; }

/* Фильтры списка писем */
.filter-note .filter-text { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.filters-modal { display: flex; flex-direction: column; gap: 8px; }
.filters-label { margin-top: 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.filters-checks { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.filters-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filters-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.filters-dates { display: flex; flex-direction: column; gap: 8px; }
.filters-inline { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.filters-inline .days { width: 90px; text-align: center; }
.filters-hint { font-size: 12.5px; color: var(--text-3); }
@media (max-width: 560px) { .filters-grid { grid-template-columns: 1fr; } }
.atts { margin-bottom: 4px; }
.att-all { border-style: dashed; } .att-all .att-ico { display: grid; place-items: center; color: var(--accent-text); background: var(--active); }
.att-pair { padding: 0; gap: 0; overflow: hidden; }
.att-open { display: inline-flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border: 0; background: none; min-width: 0; color: inherit; flex: 1; }
.att-dl { display: grid; place-items: center; width: 40px; align-self: stretch; border: 0; border-left: 1px solid var(--line); background: none; color: var(--accent-text); flex: none; }
.att-dl:hover { background: var(--hover); } .att-dl:disabled { opacity: .5; }
.zip-status { display: flex; align-items: center; gap: 10px; flex-basis: 100%; padding: 10px 12px; border-radius: 12px; background: var(--active); font-size: 13px; }
.zip-status span:last-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; color: var(--text-2); }
.zip-status b { color: var(--text); font-weight: 600; }
.zip-bar { display: block; height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; } .zip-bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }

/* ---------- Главная: приложения для компьютера ---------- */
.l-apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 760px; margin-top: 30px; }
.l-app { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 20px; background: var(--l-surface); border: 1px solid var(--l-line);
  transition: transform .15s, border-color .15s, box-shadow .15s; }
.l-app:hover { transform: translateY(-2px); border-color: rgba(124,92,255,.55); box-shadow: 0 18px 50px rgba(124,58,237,.25); }
.l-app > span:nth-child(2) { flex: 1; min-width: 0; }
.l-app b { display: block; font-size: 16px; letter-spacing: -.01em; }
.l-app small { display: block; color: var(--l-3); font-size: 13px; margin-top: 2px; }
.l-app > svg { color: var(--l-2); flex: none; }
.l-app-icon { flex: none; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #6366F1, #8B5CF6 55%, #0EA5E9); box-shadow: 0 10px 30px rgba(124,58,237,.4); }
@media (max-width: 720px) { .l-apps { grid-template-columns: minmax(0, 1fr); } }
.login-lang { position: absolute; top: 20px; right: 24px; }

/* ---------- Приложение для компьютера (desktop/): своя верхняя полоса 34 px, за неё окно тащится.
   Mac — системные кнопки слева поверх страницы, Windows — свои кнопки справа (.win-titlebar из core.js) ---------- */
html[data-desktop] { --titlebar: 30px; }
.desk-titlebar { position: fixed; inset: 0 0 auto 0; height: var(--titlebar); z-index: 999; display: grid; place-items: center; pointer-events: none;
  background: var(--pane); border-bottom: 1px solid var(--line); color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: .01em; }
.desk-titlebar span { max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body:has(.landing) .desk-titlebar { background: #0B0A12; border-bottom-color: rgba(255,255,255,.08); color: #8C88AD; }
html[data-desktop] .glow { top: var(--titlebar); }
html[data-desktop] body::before { content: ""; position: fixed; inset: 0 0 auto 0; height: var(--titlebar); z-index: 1000; -webkit-app-region: drag; }
html[data-desktop] .shell { padding-top: var(--titlebar); }
html[data-desktop] .landing { top: var(--titlebar); }
html[data-desktop] .login-hero { padding-top: calc(56px + var(--titlebar)); }
html[data-desktop] .login-side .l-back, html[data-desktop] .login-lang { top: calc(20px + var(--titlebar)); }
html[data-desktop] .compose { max-height: calc(100vh - 48px - var(--titlebar)); }
html[data-desktop] .modal { max-height: calc(100vh - 40px - var(--titlebar)); margin-top: var(--titlebar); }
/* «Огоньки» (выбор владельца 2026-11-06, палитра «Классика Mac»): свернуть — жёлтая, развернуть — зелёная, закрыть — красная;
   значки появляются при наведении на группу */
.win-titlebar { position: fixed; top: 0; right: 0; z-index: 1001; display: flex; gap: 8px; height: var(--titlebar); padding: 0 12px; align-items: center; -webkit-app-region: no-drag; }
.win-btn { width: 13px; height: 13px; display: grid; place-items: center; border: 0; border-radius: 50%; padding: 0; color: transparent;
  box-shadow: inset 0 0 0 .5px rgba(0,0,0,.18); transition: transform .15s, box-shadow .2s, color .15s; }
.win-btn.minimize { background: #FEBC2E; --glow: rgba(254,188,46,.55); } .win-btn.maximize { background: #28C840; --glow: rgba(40,200,64,.5); }
.win-btn.close { background: #FF5F57; --glow: rgba(255,95,87,.55); }
.win-btn { position: relative; } .win-btn::before { content: ""; position: absolute; inset: -6px -4px; } /* попасть проще, чем в 13 px */
.win-titlebar:hover .win-btn { color: rgba(0,0,0,.55); }
.win-btn:hover { transform: scale(1.12); box-shadow: inset 0 0 0 .5px rgba(0,0,0,.18), 0 0 10px var(--glow); }
.win-btn:active { transform: scale(.92); }

/* ---------- Окно «Установить приложение» ---------- */
.apps-modal { width: min(600px, 100%); }
.apps-loading { display: grid; place-items: center; padding: 30px; }
.app-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); margin-top: 10px; }
.app-card.mine { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.app-card.soon { opacity: .6; }
.app-card-icon { flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #6366F1, #8B5CF6 55%, #0EA5E9); }
.app-card-text { flex: 1; min-width: 0; }
.app-card-text b { display: block; font-size: 15px; }
.app-card-text small { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 2px; line-height: 1.4; }
.app-card-text .app-card-hint { color: var(--text-2); margin-top: 6px; }
.app-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 600; vertical-align: 2px;
  background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.app-card .btn { flex: none; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.apps-foot { margin-top: 14px; font-size: 12px; color: var(--text-3); text-align: center; }
@media (max-width: 560px) { .app-card { flex-wrap: wrap; } .app-card .btn { width: 100%; justify-content: center; } }

/* ---------- Полосы прокрутки: тонкие, без стрелок, цвет — от текста (на тёмной главной светлые) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 10px; background: color-mix(in srgb, currentColor 22%, transparent) padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, currentColor 38%, transparent); }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, currentColor 25%, transparent) transparent; } }

/* ---------- Приложение для компьютера: предложение обновиться ---------- */
.update-toast { position: fixed; left: 16px; bottom: 16px; z-index: 950; width: 320px; display: flex; gap: 12px; padding: 14px; border-radius: 16px;
  background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: rise .2s; }
.update-toast[hidden] { display: none; }
.update-icon { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #6366F1, #8B5CF6 55%, #0EA5E9); }
.update-text { flex: 1; min-width: 0; }
.update-text b { display: block; font-size: 14px; }
.update-text small { display: block; margin-top: 3px; color: var(--text-2); font-size: 12.5px; line-height: 1.4; }
.update-actions { display: flex; gap: 8px; margin-top: 10px; }
.update-actions .btn { height: 32px; padding: 0 14px; }
.update-bar { margin-top: 10px; height: 6px; border-radius: 6px; background: var(--fill); overflow: hidden; }
.update-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s; }
.update-bar.busy i { width: 35%; animation: update-busy 1.1s ease-in-out infinite; }
@keyframes update-busy { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.me { gap: 2px; } .me > .icon-btn { flex: none; } .me > .menu-wrap, .me > :first-child { flex: 1; min-width: 0; } .me-btn { min-width: 0; }

/* ---------- Настройки → Доступ для ИИ-агентов ---------- */
.set-pad { padding: 12px 14px; display: grid; gap: 10px; }
.agent-copy { display: grid; gap: 4px; }
.agent-copy-box { display: flex; gap: 8px; align-items: center; }
.agent-copy-box code { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; background: var(--fill); font: 12.5px/1.4 var(--mono); overflow-x: auto; white-space: nowrap; }
.agent-new .input { width: 100%; }
.agent-scopes { display: grid; gap: 8px; }
.agent-scope { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.agent-scope.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.agent-scope input { margin-top: 3px; accent-color: var(--accent); }
.agent-scope b { display: block; font-size: 14px; } .agent-scope small { display: block; color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.agent-new .btn.primary { justify-self: start; display: inline-flex; align-items: center; gap: 6px; }
.agent-log { align-items: flex-start; }
.agent-dot { flex: none; width: 8px; height: 8px; margin: 7px 4px 0; border-radius: 50%; background: var(--ok); }
.agent-dot.fail { background: var(--danger); }
.draft-agent { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; }

/* Подсказки адресатов («Кому», «Копия») */
.rcpt { position: relative; flex: 1; min-width: 0; display: flex; }
.rcpt > input { flex: 1; border: 0; outline: none; background: none; height: 42px; font-size: 14.5px; min-width: 0; }
.rcpt-list { position: absolute; left: -8px; right: -8px; top: 100%; z-index: 30; background: var(--card); border: 1px solid var(--line-2);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 4px; max-height: 320px; overflow-y: auto; }
.rcpt-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; background: none; border-radius: 8px;
  text-align: left; cursor: pointer; color: var(--text); font: inherit; }
.rcpt-item.on { background: var(--fill); }
.rcpt-item .avatar { width: 30px; height: 30px; font-size: 12px; flex: none; }
.rcpt-text { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; line-height: 1.25; }
.rcpt-text b { font-weight: 600; }
.rcpt-text span { color: var(--text-3); font-size: 12.5px; }

/* ---------- Вход: вкладки, почта и пароль, Google ---------- */
.login-tabs { margin: 0 auto 26px; max-width: 340px; }
.auth-form { display: grid; gap: 10px; text-align: left; }
.auth-form h2, .auth-form > p { text-align: center; }
.auth-form > p { margin: 0 0 14px; }
.auth-form .input { height: 46px; font-size: 15px; }
.auth-form .btn.primary { height: 46px; justify-content: center; font-size: 15px; margin-top: 4px; }
.google-btn { height: 46px; justify-content: center; gap: 10px; font-size: 15px; font-weight: 600; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--line); }
.google-btn:hover { background: var(--fill-2); }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12.5px; margin: 6px 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-switch { text-align: center; color: var(--text-2); font-size: 13.5px; margin-top: 8px; }
.pending-card { display: grid; justify-items: center; gap: 4px; }
.pending-card p { max-width: 320px; }
.pending-ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 14px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }

/* ---------- Телефон (2026-12-02): высота без панели Safari, выдвижное меню, без подсказок клавиатуры ---------- */
.shell, .login { height: 100dvh; }
.boot { height: 100dvh; }
.m-menu { display: none; }
@keyframes drawer-in { from { transform: translateX(-100%); } }
@media (max-width: 860px) {
  .m-menu { display: grid; margin-left: -6px; }
  .shell.drawer .sidebar { display: flex; position: fixed; z-index: 41; inset: 0 auto 0 0; width: min(300px, 86vw); background: var(--pane); backdrop-filter: none;
    box-shadow: var(--shadow-lg); animation: drawer-in .22s cubic-bezier(.2,.8,.2,1);
    padding-top: calc(18px + env(safe-area-inset-top)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .drawer-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); animation: fade .2s; }
  .list-head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .list-title { gap: 4px; }
  .list-title h1 { flex: 1; min-width: 0; font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
  .ai-fab { bottom: calc(18px + env(safe-area-inset-bottom)); }
  .list { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .reader-bar { padding: calc(8px + env(safe-area-inset-top)) 8px 8px; overflow-x: auto; scrollbar-width: none; }
  .reader-inner { padding: 18px 14px calc(40px + env(safe-area-inset-bottom)); }
  .sender { flex-wrap: wrap; } .sender-meta { margin-left: 0; text-align: left; flex-basis: 100%; }
  .mobile-back { padding-top: env(safe-area-inset-top); height: calc(44px + env(safe-area-inset-top)); }
  .page-head h1, .cm-page .page-head h1 { font-size: 21px; min-width: 0; }
  .cm-page .page-head h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
}
/* Сенсорный экран: подсказки клавиш не нужны */
@media (hover: none) and (pointer: coarse) { .search kbd, .keys-hint { display: none; } }
