/* Quantum Mail — Mini App. Цвета берутся из темы Telegram, вне Telegram — свои светлая и тёмная. */

:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --bg-2: var(--tg-theme-secondary-bg-color, #f2f3f7);
  --section: var(--tg-theme-section-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #11141a);
  --hint: var(--tg-theme-hint-color, #8a909b);
  --sub: var(--tg-theme-subtitle-text-color, #6b7280);
  --link: var(--tg-theme-link-color, #2b7bf3);
  --accent: var(--tg-theme-button-color, #2b7bf3);
  --on-accent: var(--tg-theme-button-text-color, #ffffff);
  --accent-text: var(--tg-theme-accent-text-color, #2b7bf3);
  --sep: var(--tg-theme-section-separator-color, rgba(120, 128, 140, .16));
  --danger: var(--tg-theme-destructive-text-color, #e5484d);
  --ok: #22a06b;
  --warn: #f5a524;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(16, 20, 28, .04), 0 10px 30px rgba(16, 20, 28, .06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html[data-theme="dark"] {
  --bg: #17181c; --bg-2: #0e0f12; --section: #1c1e23; --text: #eceef2; --hint: #7d838f;
  --sub: #9aa1ad; --sep: rgba(255, 255, 255, .07); --shadow: none;
  --link: #5aa2ff; --accent: #3d8bfd; --accent-text: #6aa9ff;
}

html.in-tg { --shadow: none; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg-2); color: var(--text); font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { min-height: 100vh; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

#app { max-width: 720px; margin: 0 auto; padding-bottom: calc(84px + var(--safe-bottom)); }
.screen { animation: enter .22s cubic-bezier(.2, .8, .2, 1); }

/* ------------------------------------------------------------------ шапка */

.topbar { position: sticky; top: 0; z-index: 5; padding: 14px 16px 8px;
  background: color-mix(in srgb, var(--bg-2) 82%, transparent);
  backdrop-filter: saturate(1.8) blur(18px); -webkit-backdrop-filter: saturate(1.8) blur(18px); }
.topbar-row { display: flex; align-items: center; gap: 10px; }
.title { flex: 1; font-size: 30px; font-weight: 760; letter-spacing: -.025em; margin: 2px 0 0; line-height: 1.15; }
.subtitle { color: var(--hint); font-size: 13.5px; margin-top: 2px; }
.icon-btn { flex: none; width: 38px; height: 38px; border-radius: 12px; border: 0; display: grid;
  place-items: center; background: var(--section); color: var(--accent-text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.spin svg { animation: spin .8s linear infinite; }

.search { display: flex; align-items: center; gap: 8px; height: 40px; margin-top: 12px; padding: 0 12px;
  border-radius: 12px; background: var(--section); color: var(--hint); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  color: var(--text); font-size: 15px; }
.search input::placeholder { color: var(--hint); }
.search .clear { border: 0; background: none; color: var(--hint); padding: 4px; display: grid; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px;
  border-radius: 999px; border: 0; background: var(--section); color: var(--text); font-size: 13.5px;
  font-weight: 560; transition: background .15s, color .15s; }
.chip.active { background: var(--accent); color: var(--on-accent); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip .n { font-size: 12px; opacity: .7; }

/* ---------------------------------------------------------------- список */

.group { margin: 10px 12px 0; background: var(--section); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); }
.day { margin: 18px 22px 6px; font-size: 13px; font-weight: 600; color: var(--hint); }
.row { position: relative; display: grid; grid-template-columns: 46px 1fr; gap: 12px; padding: 12px 14px;
  cursor: pointer; transition: background .12s; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 72px; right: 0; height: 1px; background: var(--sep); }
.row:active { background: color-mix(in srgb, var(--text) 5%, transparent); }
.row-main { min-width: 0; }
.row-top { display: flex; align-items: baseline; gap: 8px; }
.sender { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 520; }
.time { flex: none; color: var(--hint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.subject-line { display: flex; align-items: center; gap: 6px; margin-top: 1px; }
.subject { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview { margin-top: 2px; color: var(--hint); font-size: 13.5px; line-height: 1.38; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; color: var(--hint); font-size: 12px; }
.meta .tag { display: inline-flex; align-items: center; gap: 5px; }
.meta .tag i { width: 7px; height: 7px; border-radius: 50%; }
.unread .sender, .unread .subject { font-weight: 700; }
.unread .time { color: var(--accent-text); font-weight: 650; }
.pip { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  font-weight: 680; font-size: 16.5px; letter-spacing: .01em; user-select: none;
  box-shadow: inset 0 -2px 6px rgba(0, 0, 0, .08); }
.avatar.sm { width: 40px; height: 40px; font-size: 15px; }
.avatar.lg { width: 52px; height: 52px; font-size: 19px; }

.more { display: flex; justify-content: center; padding: 16px; }

/* ------------------------------------------------------------- состояния */

.empty { text-align: center; padding: 56px 28px 24px; color: var(--hint); }
.empty .art { width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 28px; display: grid; place-items: center;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 22%, var(--section)), var(--section));
  color: var(--accent-text); }
.empty h2 { margin: 0 0 6px; color: var(--text); font-size: 20px; font-weight: 720; letter-spacing: -.01em; }
.empty p { margin: 0 auto 20px; max-width: 320px; }

.sk { background: linear-gradient(90deg, var(--bg-2) 25%, color-mix(in srgb, var(--bg-2) 45%, var(--section)) 37%, var(--bg-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
.sk-row { display: grid; grid-template-columns: 46px 1fr; gap: 12px; padding: 14px; }
.sk-row .a { width: 46px; height: 46px; border-radius: 50%; }
.sk-row .l { height: 12px; margin: 5px 0 9px; }

.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor; animation: spin .75s linear infinite; }
.spinner.lg { width: 40px; height: 40px; border-width: 3.5px; color: var(--accent); }

/* ---------------------------------------------------------------- кнопки */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px;
  border-radius: 14px; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 650;
  font-size: 15.5px; transition: transform .1s, opacity .2s, background .15s; }
.btn:active { transform: scale(.98); }
.btn.block { display: flex; width: 100%; }
.btn.soft { background: color-mix(in srgb, var(--accent) 13%, var(--section)); color: var(--accent-text); }
.btn.plain { background: var(--section); color: var(--text); }
.btn.danger { background: color-mix(in srgb, var(--danger) 12%, var(--section)); color: var(--danger); }
.btn.sm { height: 34px; padding: 0 13px; font-size: 13.5px; border-radius: 10px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 16px 16px calc(14px + var(--safe-bottom));
  background: linear-gradient(to top, var(--bg-2) 62%, transparent); }
.cta .btn { max-width: 688px; margin: 0 auto; }

/* ----------------------------------------------------------- нижнее меню */

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center; gap: 4px;
  padding: 6px 12px calc(6px + var(--safe-bottom));
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(22px) saturate(1.8);
  -webkit-backdrop-filter: blur(22px) saturate(1.8); border-top: 1px solid var(--sep); }
.tab { position: relative; flex: 1; max-width: 180px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0 4px; border: 0; background: none; color: var(--hint); font-size: 11px; font-weight: 620; }
.tab.active { color: var(--accent-text); }
.tab .count { position: absolute; top: 1px; left: calc(50% + 7px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* ----------------------------------------------------------------- письмо */

.reader { padding: 6px 12px 130px; }
.msg-subject { margin: 8px 6px 14px; font-size: 23px; font-weight: 760; line-height: 1.25; letter-spacing: -.015em;
  overflow-wrap: anywhere; }
.card { background: var(--section); border-radius: var(--radius); box-shadow: var(--shadow); }
.from { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.from .who { flex: 1; min-width: 0; }
.from .name { font-weight: 680; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.from .addr { color: var(--hint); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.from .date { flex: none; color: var(--hint); font-size: 12.5px; text-align: right; }
.recipients { border-top: 1px solid var(--sep); padding: 10px 14px; color: var(--hint); font-size: 13px; overflow-wrap: anywhere; }
.recipients b { color: var(--sub); font-weight: 600; }

.files { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 2px; scrollbar-width: none; }
.files::-webkit-scrollbar { display: none; }
.file { flex: none; display: flex; align-items: center; gap: 10px; max-width: 250px; padding: 9px 12px 9px 9px;
  border: 0; border-radius: 14px; background: var(--section); text-align: left; box-shadow: var(--shadow); }
.file .ext { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none;
  color: #fff; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
.file .fname { font-size: 13.5px; font-weight: 600; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .fsize { font-size: 12px; color: var(--hint); }

.notice { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 10px 10px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--warn) 13%, var(--section)); font-size: 13.5px; }
.notice .txt { flex: 1; }
.paper { margin-top: 12px; overflow: hidden; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.paper iframe { display: block; width: 100%; min-height: 80px; border: 0; background: #fff; }
.plain-text { margin-top: 12px; padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.plain-text a { color: var(--link); }

.actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center; gap: 10px;
  padding: 10px 16px calc(10px + var(--safe-bottom)); background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(22px) saturate(1.8); -webkit-backdrop-filter: blur(22px) saturate(1.8); border-top: 1px solid var(--sep); }
.actions .btn { flex: 1; max-width: 220px; height: 46px; }

/* ------------------------------------------------------------------ ящики */

.section-title { margin: 24px 22px 8px; font-size: 13px; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; color: var(--hint); }
.item { position: relative; display: flex; align-items: center; gap: 12px; padding: 13px 14px; }
.item + .item::before { content: ""; position: absolute; top: 0; left: 66px; right: 0; height: 1px; background: var(--sep); }
.item .body { flex: 1; min-width: 0; }
.item .t1 { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .t2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.item.tap { cursor: pointer; }
.item.tap:active { background: color-mix(in srgb, var(--text) 5%, transparent); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: var(--bg-2);
  color: var(--sub); font-size: 11.5px; font-weight: 640; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--hint); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--hint); }
.status.online i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.status.connecting i { background: var(--warn); animation: pulse 1.4s ease infinite; }
.status.offline i, .status.reauth i { background: var(--danger); }
.status.offline, .status.reauth { color: var(--danger); }
.chev { color: var(--hint); flex: none; }
.plus { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--accent) 14%, var(--section)); color: var(--accent-text); }
.link-text { color: var(--accent-text); font-weight: 620; }

/* ------------------------------------------------------- мастер подключения */

.hero { padding: 30px 24px 6px; text-align: center; }
.hero .logo { width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #4f8bff, #7b5cff); box-shadow: 0 12px 30px rgba(79, 112, 255, .35); }
.hero .logo.white { background: #fff; box-shadow: 0 10px 28px rgba(0, 0, 0, .12); }
.hero h1 { margin: 0 0 6px; font-size: 25px; font-weight: 760; letter-spacing: -.02em; }
.hero p { margin: 0 auto; max-width: 360px; color: var(--hint); }
.provider-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 5px 11px; border-radius: 999px;
  background: var(--section); font-size: 13px; font-weight: 600; }

.field { margin: 18px 16px 0; }
.field label { display: block; margin: 0 6px 7px; font-size: 13px; color: var(--hint); font-weight: 560; }
.input { width: 100%; height: 52px; padding: 0 16px; border: 1.5px solid transparent; border-radius: 15px; outline: 0;
  background: var(--section); color: var(--text); font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.input.mono { font-family: var(--mono); font-size: 14px; letter-spacing: .02em; text-overflow: ellipsis; }
.input.mono[type="password"] { letter-spacing: .12em; }
.input::placeholder { color: var(--hint); }
.input.mono::placeholder { font-family: var(--font); font-size: 15px; letter-spacing: 0; }
.help { margin: 7px 8px 0; font-size: 12.5px; color: var(--hint); }
.error-text { margin: 10px 18px 0; color: var(--danger); font-size: 13.5px; }

.options { margin: 18px 16px 0; display: grid; gap: 10px; }
.option { display: flex; gap: 14px; align-items: flex-start; width: 100%; padding: 16px; border: 1.5px solid transparent;
  border-radius: var(--radius); background: var(--section); text-align: left; box-shadow: var(--shadow); transition: border-color .15s, transform .1s; }
.option:active { transform: scale(.99); border-color: var(--accent); }
.option .oi { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--bg-2); }
.option h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 4px; font-size: 16px; font-weight: 680; }
.option p { margin: 0; color: var(--hint); font-size: 13.5px; }
.option.off { opacity: .6; }
.option .go { align-self: center; color: var(--hint); }
.rec { padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok);
  font-size: 11px; font-weight: 750; letter-spacing: .02em; }

.steps { margin: 16px 16px 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; margin-bottom: 8px; padding: 12px 14px 12px 50px; border-radius: 15px; background: var(--section); font-size: 14px; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 13px; top: 11px; width: 25px; height: 25px;
  border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent-text); font-size: 13px; font-weight: 760; }
.copy { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 9px 10px 9px 12px; border-radius: 11px; background: var(--bg-2);
  font: 12.5px/1.4 var(--mono); word-break: break-all; }
.copy span { flex: 1; }

.waiting { text-align: center; padding: 56px 28px 12px; }
.waiting h2 { margin: 22px 0 8px; font-size: 21px; font-weight: 720; }
.waiting p { margin: 0 auto 22px; max-width: 320px; color: var(--hint); }
.done { text-align: center; padding: 64px 28px 12px; }
.done .check { width: 88px; height: 88px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: var(--ok); box-shadow: 0 14px 34px color-mix(in srgb, var(--ok) 40%, transparent); animation: pop .45s cubic-bezier(.2, 1.5, .4, 1); }
.done h1 { margin: 0 0 6px; font-size: 25px; font-weight: 760; }
.done p { margin: 0 0 6px; color: var(--hint); }

/* ------------------------------------------------------------ написать */

.fab { position: fixed; right: max(16px, calc(50% - 344px)); bottom: calc(80px + var(--safe-bottom)); z-index: 9;
  display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 17px; border: 0; border-radius: 18px;
  background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 700;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 38%, transparent); transition: transform .12s; }
.fab:active { transform: scale(.95); }

.msg-head { display: flex; align-items: flex-start; gap: 10px; margin: 8px 6px 14px; }
.msg-head .msg-subject { flex: 1; margin: 0; }
.actions.tools { gap: 0; padding-top: 4px; padding-bottom: calc(4px + var(--safe-bottom)); }
.tool { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0;
  border: 0; background: none; color: var(--accent-text); font-size: 11.5px; font-weight: 640; }
.tool:active { opacity: .55; }
.tool[disabled] { opacity: .35; }

.compose { padding: 2px 12px 0; }
.compose-title { font-size: 25px; }
.fields { overflow: visible; }
.frow { position: relative; display: flex; align-items: flex-start; gap: 8px; min-height: 48px; padding: 6px 14px;
  border-bottom: 1px solid var(--sep); }
.fields > .frow:last-child { border-bottom: 0; }
.frow > label { flex: none; width: 62px; padding-top: 9px; color: var(--hint); font-size: 14px; }
.finput, .fselect { flex: 1; min-width: 0; height: 36px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15.5px; }
.fselect { -webkit-appearance: none; appearance: none; text-overflow: ellipsis; }
.fstatic { flex: 1; min-width: 0; padding-top: 8px; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { flex: none; padding: 9px 0 0; border: 0; background: none; color: var(--accent-text); font-size: 13.5px; font-weight: 640; }

.rwrap { position: relative; flex: 1; min-width: 0; }
.rbox { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 36px; padding: 3px 0; cursor: text; }
.rchip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 4px 3px 4px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 13%, var(--section)); font-size: 14px; }
.rchip .rname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rchip.bad { background: color-mix(in srgb, var(--danger) 14%, var(--section)); color: var(--danger); }
.rchip button { display: grid; padding: 3px; border: 0; background: none; color: inherit; opacity: .55; }
.rinput { flex: 1; min-width: 110px; height: 30px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15.5px; }
.suggest { position: absolute; left: -8px; right: 0; top: calc(100% + 4px); z-index: 20; overflow: hidden; border-radius: 14px;
  background: var(--section); box-shadow: 0 14px 36px rgba(0, 0, 0, .2); }
.sg { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; text-align: left; }
.sg + .sg { border-top: 1px solid var(--sep); }
.sg span { display: flex; flex-direction: column; min-width: 0; }
.sg b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg small { color: var(--hint); font-size: 12.5px; }
.avatar.xs { width: 30px; height: 30px; font-size: 12px; }

.editor-card { margin-top: 10px; overflow: hidden; }
.field .editor-card { margin-top: 0; }
.toolbar { display: flex; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--sep); overflow-x: auto; scrollbar-width: none; }
.toolbar::-webkit-scrollbar { display: none; }
.tb { flex: none; width: 38px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 9px; background: none;
  color: var(--sub); font: 16px Georgia, "Times New Roman", serif; }
.tb.on { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent-text); }
.editor { min-height: 170px; padding: 14px 16px; outline: 0; font-size: 15.5px; line-height: 1.55; overflow-wrap: anywhere; }
.field .editor { min-height: 110px; }
.editor:empty::before { content: attr(data-placeholder); color: var(--hint); pointer-events: none; }
.editor a { color: var(--link); }
.editor ul, .editor ol { margin: 4px 0; padding-left: 22px; }
.link-row { display: flex; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--sep); }
.link-input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--sep); border-radius: 9px; outline: 0;
  background: var(--bg-2); color: var(--text); font-size: 15px; }

.attach-bar { display: flex; gap: 8px; margin-top: 12px; }
.attach-list { display: grid; gap: 8px; margin-top: 10px; }
.achip { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 9px; border-radius: 14px; background: var(--section); }
.achip .ext { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; color: #fff;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; }
.achip .ainfo { flex: 1; min-width: 0; }
.achip .fname { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.achip .fsize { font-size: 12px; color: var(--hint); }
.achip .icon-btn { width: 32px; height: 32px; color: var(--hint); background: var(--bg-2); }
.switch-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; background: var(--section); font-size: 14px; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--accent); }

.quote-card { display: flex; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--section);
  color: var(--accent-text); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
.quote-card .q1 { color: var(--text); font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-card .q2 { margin-top: 3px; color: var(--hint); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.quote-card .q3 { margin-top: 6px; color: var(--hint); font-size: 12px; }
.sig-hint { margin: 12px 6px 0; color: var(--hint); font-size: 13px; }
.sig-hint a { color: var(--accent-text); font-weight: 620; text-decoration: none; }

.box-hero { display: flex; align-items: center; gap: 14px; padding: 22px 18px 4px; }
.box-hero .t1 { font-size: 18px; font-weight: 720; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.box-hero .t2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); z-index: 60; max-width: calc(100% - 32px);
  padding: 11px 16px; border-radius: 14px; background: rgba(22, 24, 30, .94); color: #fff; font-size: 14px; font-weight: 560;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
