/* BSM Mail — палитра и компоненты как у bsm.best (frontend/src/index.css) */
:root {
  --bg: #05080f; --bg-2: #0a0f19; --panel: #0b111c; --panel-2: #101827; --border: #1a2333; --border-2: #243047;
  --text: #f1f5fb; --muted: #8b97ab; --primary: #1677ff; --primary-2: #3b8bff; --cyan: #22d3ee; --good: #22c55e;
  --gold: #fbbf24; --purple: #a855f7; --danger: #f87171;
  --hero: linear-gradient(120deg, #07101f 0%, #0a1830 55%, #0b2142 100%);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35); --radius: 18px; --nav-h: 64px;
  --display: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--text); background: var(--bg); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); overflow: hidden; -webkit-font-smoothing: antialiased; }
#app { height: 100%; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { width: 100%; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 12px; padding: 11px 13px; font: inherit; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
textarea { resize: vertical; min-height: 220px; line-height: 1.5; }
.display { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .3px; line-height: 1; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.i.fill { fill: currentColor; stroke: none; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 11px 18px; font-weight: 700; font-size: .88rem; text-transform: uppercase; letter-spacing: .3px; cursor: pointer; white-space: nowrap; transition: filter .15s, background .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-dark { background: var(--panel-2); border-color: var(--border); }
.btn-dark:hover { background: var(--border); }
.btn-ghost { background: transparent; border-color: var(--border-2); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 26%, transparent); }
.btn-sm { padding: 8px 13px; font-size: .8rem; }
.btn-block { width: 100%; }
.ibtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; color: var(--muted); border: 1px solid transparent; transition: background .15s, color .15s; }
.ibtn:hover { background: var(--panel-2); color: var(--text); }
.ibtn.on { color: var(--gold); }
.ibtn.danger:hover { color: var(--danger); }
.tbtn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .85rem; transition: background .15s, color .15s; }
.tbtn:hover { background: var(--panel-2); color: var(--text); }
.tbtn.danger:hover { color: var(--danger); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; font-size: .72rem; font-weight: 800; color: #fff; background: var(--primary); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; font-weight: 700; font-size: .74rem; letter-spacing: .3px; color: #e5ecf7; background: rgba(255,255,255,.08); }

/* ---------- вход ---------- */
.login-wrap { flex: 1; display: grid; place-items: center; padding: 20px; background: var(--hero); position: relative; overflow: auto; }
.login-wrap::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 300px at 20% 10%, rgba(22,119,255,.18), transparent 60%), radial-gradient(500px 300px at 85% 90%, rgba(34,211,238,.10), transparent 60%); pointer-events: none; }
.login { position: relative; width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--border-2); border-radius: 20px; padding: 32px 30px 26px; box-shadow: var(--shadow); }
.login-logo { width: 84px; height: 84px; border-radius: 50%; margin: -74px auto 10px; display: block; box-shadow: 0 10px 30px rgba(22,119,255,.35); background: #000; }
.login h1 { text-align: center; font-size: 2rem; margin: 0 0 2px; }
.login .sub { text-align: center; color: var(--muted); font-size: .86rem; margin-bottom: 22px; }
.login label { display: block; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 14px 0 0; }
.login input { margin-top: 6px; }
.login .btn { margin-top: 20px; }
.login .err { color: var(--danger); font-size: .86rem; margin-top: 12px; text-align: center; min-height: 1.2em; }
.login .foot { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 20px; }
.login .foot a { color: var(--primary-2); }

/* ---------- шапка ---------- */
.navbar { position: relative; z-index: 30; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.navbar-inner { display: flex; align-items: center; gap: 16px; height: var(--nav-h); padding: 0 18px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img { width: 36px; height: 36px; border-radius: 50%; }
.brand-title { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: .5px; white-space: nowrap; }
.brand-title span { color: var(--primary-2); }
.search { flex: 1; max-width: 560px; position: relative; }
.search input { height: 40px; padding: 0 40px 0 40px; border-radius: 12px; background: var(--panel-2); }
.search .i { position: absolute; left: 12px; top: 11px; color: var(--muted); pointer-events: none; }
.search .clear { position: absolute; right: 6px; top: 5px; width: 30px; height: 30px; }
.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.account { position: relative; }
.account-btn { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px 0 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); font-weight: 600; font-size: .86rem; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--cyan)); color: #fff; font-weight: 800; font-size: .8rem; text-transform: uppercase; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--panel); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; z-index: 40; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; word-break: break-all; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 10px; font-weight: 600; font-size: .88rem; text-align: left; }
.menu-item:hover { background: var(--panel-2); }
.menu-item.danger { color: var(--danger); }
.nav-burger { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 10px; }

/* ---------- раскладка ---------- */
.main { flex: 1; display: grid; grid-template-columns: 240px 400px 1fr; min-height: 0; }
.side { border-right: 1px solid var(--border); background: var(--bg-2); display: flex; flex-direction: column; padding: 14px 12px; gap: 6px; overflow: auto; }
.side .btn-compose { margin-bottom: 10px; }
.folder { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-weight: 600; font-size: .9rem; color: var(--muted); width: 100%; text-align: left; transition: background .15s, color .15s; }
.folder:hover { background: var(--panel-2); color: var(--text); }
.folder.on { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--text); }
.folder.on .i { color: var(--primary-2); }
.folder .n { margin-left: auto; font-size: .74rem; font-weight: 800; color: var(--muted); }
.folder.on .n, .folder.unread .n { color: #fff; background: var(--primary); padding: 1px 7px; border-radius: 999px; }
.side .foot { margin-top: auto; padding: 12px 10px 4px; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.side .foot a { color: var(--primary-2); }
.quota { height: 5px; background: var(--border); border-radius: 999px; overflow: hidden; margin-top: 8px; }

.list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.list-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); min-height: 58px; flex-wrap: wrap; }
.list-head h2 { font-size: 1.35rem; margin: 0 4px 0 2px; }
.list-head .cnt { color: var(--muted); font-size: .8rem; font-weight: 600; }
.list-head .sp { flex: 1; }
.filters { display: flex; gap: 4px; }
.filters button { height: 30px; padding: 0 10px; border-radius: 8px; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); border: 1px solid transparent; }
.filters button.on { color: var(--text); background: var(--panel-2); border-color: var(--border-2); }
.list-body { flex: 1; overflow: auto; }
.msg { display: grid; grid-template-columns: 40px 1fr auto; grid-template-rows: auto auto auto; column-gap: 10px; padding: 11px 12px 11px 10px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; position: relative; }
.msg .pick { grid-row: span 3; align-self: start; position: relative; width: 36px; height: 36px; margin-top: 2px; }
.msg .pick .avatar { width: 36px; height: 36px; font-size: .78rem; transition: opacity .12s; }
.msg .pick .chk { position: absolute; inset: 9px; opacity: 0; transition: opacity .12s; }
.msg:hover .pick .avatar, .msg.sel .pick .avatar { opacity: 0; }
.msg:hover .pick .chk, .msg.sel .pick .chk { opacity: 1; }
.msg .snip { grid-column: 2 / 4; color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; min-height: 1.1em; }
.msg .hover { position: absolute; right: 10px; bottom: 8px; display: none; gap: 2px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 10px; padding: 2px; box-shadow: var(--shadow); }
.msg .hover .ibtn { width: 32px; height: 30px; }
@media (hover: hover) { .msg:hover .hover { display: inline-flex; } .msg:hover .snip { padding-right: 112px; } }
.msg:hover { background: var(--panel); }
.msg.on { background: color-mix(in srgb, var(--primary) 14%, var(--panel)); }
.msg.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.msg .chk { width: 18px; height: 18px; border-radius: 6px; border: 1px solid var(--border-2); display: grid; place-items: center; color: transparent; background: var(--panel-2); }
.msg.sel .chk { background: var(--primary); border-color: var(--primary); color: #fff; }
.msg .who { font-weight: 600; font-size: .9rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .subj { font-weight: 500; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.msg .subj .i { width: 14px; height: 14px; color: var(--muted); }
.msg.unread .who { color: var(--text); }
.msg.unread .subj { font-weight: 800; }
.msg.unread .who::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary-2); margin-right: 7px; vertical-align: 2px; }
.msg .when { font-size: .76rem; color: var(--muted); white-space: nowrap; }
.msg .star { grid-column: 3; justify-self: end; width: 22px; height: 22px; display: grid; place-items: center; color: var(--border-2); border-radius: 6px; margin-top: 2px; }
.msg .star:hover { color: var(--gold); background: var(--panel-2); }
.msg.flagged .star { color: var(--gold); }
.msg.flagged .star .i { fill: currentColor; }
.empty { display: grid; place-items: center; padding: 60px 20px; color: var(--muted); text-align: center; gap: 12px; }
.empty img { width: 72px; opacity: .25; filter: grayscale(1); border-radius: 50%; }
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-top: 1px solid var(--border); font-size: .8rem; color: var(--muted); }
.bulk { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--panel); flex-wrap: wrap; }
.bulk .n { font-weight: 700; font-size: .85rem; margin-right: 6px; }

.read { min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.read-empty { flex: 1; display: grid; place-items: center; color: var(--muted); }
.read-empty img { width: 150px; opacity: .14; border-radius: 50%; margin: 0 auto 14px; display: block; filter: grayscale(1); }
.read-top { display: flex; align-items: center; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--border); min-height: 58px; flex-wrap: wrap; }
.read-top .sp { flex: 1; }
.read-body { flex: 1; overflow: auto; padding: 22px 26px 40px; }
.read h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; margin: 0 0 14px; line-height: 1.2; word-break: break-word; }
.hdr { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); margin-bottom: 18px; }
.hdr .avatar { width: 42px; height: 42px; font-size: 1rem; flex-shrink: 0; }
.hdr .lines { min-width: 0; flex: 1; font-size: .88rem; line-height: 1.5; }
.hdr .name { font-weight: 800; font-size: 1rem; }
.hdr .email { color: var(--muted); }
.hdr .muted b { color: var(--text); font-weight: 600; }
.hdr .when { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.att { display: inline-flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--border-2); background: var(--panel); border-radius: 12px; font-size: .84rem; font-weight: 600; max-width: 100%; }
.att .sz { color: var(--muted); font-weight: 500; }
.att .i { color: var(--cyan); }
.att:hover { background: var(--panel-2); }
.body-text { white-space: pre-wrap; word-break: break-word; line-height: 1.6; font-size: .96rem; max-width: 900px; }
.body-text a { color: var(--primary-2); text-decoration: underline; }
.body-text .q { color: var(--muted); border-left: 3px solid var(--border-2); padding-left: 12px; margin: 4px 0; display: block; }
.body-html { background: var(--panel); border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.body-html iframe { width: 100%; border: 0; display: block; min-height: 60px; background: transparent; color-scheme: normal; }
.remote-note { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; font-size: .84rem; color: var(--muted); }

/* ---------- написание ---------- */
.compose-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; }
.compose { width: 100%; max-width: 860px; max-height: calc(100vh - 32px); background: var(--panel); border: 1px solid var(--border-2); border-radius: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.compose-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--panel-2); }
.compose-head h3 { font-size: 1.35rem; margin: 0; flex: 1; }
.compose-body { padding: 14px 18px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.frow { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 10px; }
.frow label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.frow input { height: 40px; padding: 0 12px; }
.frow .more { color: var(--primary-2); font-weight: 700; font-size: .78rem; text-transform: uppercase; }
.compose textarea { flex: 1; min-height: 240px; }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.files .att button { color: var(--muted); display: inline-flex; }
.files .att button:hover { color: var(--danger); }
.compose-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.compose-foot .sp { flex: 1; }
.compose-foot .status { color: var(--muted); font-size: .8rem; }
.drop { outline: 2px dashed var(--primary-2); outline-offset: -6px; }

/* ---------- всплывашки ---------- */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 90; pointer-events: none; }
.toast { padding: 11px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: .88rem; font-weight: 600; animation: up .2s ease-out; pointer-events: auto; }
.toast.err { border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.toast.ok { border-color: color-mix(in srgb, var(--good) 40%, transparent); color: var(--good); }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }
.popup { position: absolute; z-index: 60; background: var(--panel); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; min-width: 200px; }
.loading { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--primary-2), transparent); background-size: 50% 100%; animation: ld 1s linear infinite; z-index: 99; }
@keyframes ld { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; z-index: 70; backdrop-filter: blur(4px); }
.modal { position: relative; width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--border-2); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); }
.modal h3 { font-size: 1.4rem; margin: 0 0 14px; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.modal .folders button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 10px; font-weight: 600; text-align: left; }
.modal .folders button:hover { background: var(--panel-2); }

/* ---------- мобильная ---------- */
.mob-back { display: none; }
@media (max-width: 1100px) { .main { grid-template-columns: 220px 1fr; } .read { grid-column: 1 / -1; display: none; } .main.reading .read { display: flex; } .main.reading .list, .main.reading .side { display: none; } .mob-back { display: inline-flex; } }
@media (max-width: 760px) {
  .main { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: var(--nav-h); bottom: 0; width: 280px; z-index: 35; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); border-right: 1px solid var(--border-2); }
  .side.open { transform: none; }
  .side-backdrop { position: fixed; inset: var(--nav-h) 0 0 0; background: rgba(0,0,0,.5); z-index: 34; }
  .nav-burger { display: inline-flex; }
  .brand-title { display: none; }
  .search { max-width: none; }
  .account-btn .name { display: none; }
  .read-body { padding: 16px 14px 40px; }
  .read h1 { font-size: 1.4rem; }
  .compose-backdrop { padding: 0; }
  .compose { max-height: 100vh; height: 100%; border-radius: 0; }
  .frow { grid-template-columns: 56px 1fr auto; }
  .list-head h2 { font-size: 1.15rem; }
  .fab { position: fixed; right: 18px; bottom: 18px; width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(22,119,255,.4); z-index: 33; }
}
@media (min-width: 761px) { .fab { display: none; } }

.menu-keys { padding: 8px 10px 4px; letter-spacing: .3px; border-top: 1px solid var(--border); margin-top: 6px; }
.btn-compose { background: linear-gradient(135deg, var(--primary), #2b9bff); box-shadow: 0 8px 20px rgba(22,119,255,.28); }
.btn-compose:hover { filter: brightness(1.08); }
.navbar { box-shadow: 0 1px 0 var(--border), 0 8px 24px rgba(0,0,0,.25); }

/* ---------- темы как на bsm.best (frontend/src/index.css) ---------- */
:root[data-theme='light'] { --bg: #f3f6fb; --bg-2: #e9eef6; --panel: #ffffff; --panel-2: #f5f8fc; --border: #dde4ee; --border-2: #cbd5e3; --text: #0b1220; --muted: #5a677c; --cyan: #0891b2; --good: #16a34a; --gold: #d97706; --hero: linear-gradient(120deg, #ffffff 0%, #eef4ff 60%, #dde9ff 100%); --shadow: 0 10px 30px rgba(15, 30, 60, .08); --bg-image: none; color-scheme: light; }
:root[data-theme='galaxy'] { --bg: #0f0c29; --bg-image: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%); --bg-2: #0b0920; --panel: #1a1640; --panel-2: #221d52; --border: #3a3478; --border-2: #4a439a; --text: #f2f0ff; --muted: #a6a0d0; --primary: #7c3aed; --primary-2: #a78bfa; --cyan: #b9a8ff; --hero: linear-gradient(120deg, #1a1640 0%, #2b2563 60%, #3b2a7a 100%); }
:root[data-theme='amber'] { --bg: #1f1305; --bg-image: linear-gradient(135deg, #1f1305 0%, #7c2d12 52%, #431407 100%); --bg-2: #160d03; --panel: #2a1a0a; --panel-2: #34200d; --border: #5c3a1a; --border-2: #774b22; --text: #fff8f0; --muted: #d2aa84; --primary: #ea580c; --primary-2: #fb923c; --cyan: #fdba74; --hero: linear-gradient(120deg, #2a1a0a 0%, #402812 60%, #5a2a10 100%); }
:root[data-theme='emerald'] { --bg: #04130f; --bg-image: linear-gradient(135deg, #04130f 0%, #064e3b 50%, #022c22 100%); --bg-2: #03100b; --panel: #0a231c; --panel-2: #0e2d24; --border: #1f4c3e; --border-2: #2a6352; --text: #eefdf6; --muted: #8dbfab; --primary: #059669; --primary-2: #34d399; --cyan: #6ee7b7; --hero: linear-gradient(120deg, #0a231c 0%, #13382d 60%, #0d4a37 100%); }
:root { --bg-image: none; }
body { background-image: var(--bg-image); background-attachment: fixed; }
.side, .list, .read, .navbar { background-color: color-mix(in srgb, var(--bg) 72%, transparent); }
.side { background-color: color-mix(in srgb, var(--bg-2) 80%, transparent); }
.btn-compose { background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 30%, transparent); }
:root[data-theme='light'] .avatar { color: #fff; }
:root[data-theme='light'] .login-logo { box-shadow: 0 10px 30px rgba(22,119,255,.25); }
.themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 8px 10px 4px; border-top: 1px solid var(--border); margin-top: 6px; }
.theme-sw { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: .68rem; font-weight: 700; color: var(--muted); border-radius: 10px; padding: 6px 2px; }
.theme-sw:hover { background: var(--panel-2); }
.theme-sw i { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; }
.theme-sw.on i { border-color: var(--primary-2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-2) 35%, transparent); }
.theme-sw.on { color: var(--text); }

.avatar.logo { background: #000; overflow: hidden; }
.avatar.logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* ---------- настройки и подпись ---------- */
.modal-wide { max-width: 640px; }
.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sf { display: flex; flex-direction: column; gap: 4px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.sf.wide { grid-column: 1 / -1; }
.sf input { height: 38px; padding: 0 12px; margin: 0; }
.sw { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .86rem; margin-top: 12px; cursor: pointer; }
.sw input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.sig-prev { width: 100%; height: 150px; border: 1px solid var(--border-2); border-radius: 12px; background: #fff; }
.sig-box { border: 1px dashed var(--border-2); border-radius: 12px; padding: 8px 12px 10px; }
.sig-box .sw { margin: 0 0 6px; }
.sig-box.off .sig-mini { display: none; }
.sig-mini { background: #fff; color: #111; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.sig-mini img { width: 44px !important; height: 44px !important; border-radius: 22px !important; }
.sig-mini table { margin-top: 0 !important; }
.quote-box textarea { min-height: 120px; color: var(--muted); font-size: .88rem; }
.quote-box .small { margin-bottom: 4px; }
@media (max-width: 760px) { .sgrid { grid-template-columns: 1fr; } }
