:root {
  --green-900: #0f3a28;
  --green-800: #164d36;
  --green-700: #1d6142;
  --green-600: #23744f;
  --green-500: #2f8a5f;
  --green-100: #dcece2;
  --green-50: #eef6f1;

  --bg: #f3f7f4;
  --surface: #ffffff;
  --field: #e9f0eb;
  --text: #13261c;
  --muted: #6b7d72;
  --line: #e2eae5;
  --ink-soft: #5f7468;
  --bubble-them: #ffffff;
  --chat-bg: #e8f0ea;

  --danger: #d63a3a;
  --danger-bg: #fdeceb;
  --warn: #c56a0b;
  --warn-bg: #fff2e2;
  --info: #2a5fcf;
  --info-bg: #e8effd;
  --ok: #1d7a4a;
  --ok-bg: #e2f3e9;

  --shadow: 0 1px 2px rgba(15, 58, 40, .06), 0 4px 14px rgba(15, 58, 40, .06);
  --radius: 18px;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html[data-theme="dark"] {
  --green-700: #2c8a5c;
  --green-600: #2f9663;
  --green-100: #1f3a2d;
  --green-50: #18291f;
  --bg: #0e1712;
  --surface: #16221b;
  --field: #1f2e25;
  --text: #e6efe9;
  --muted: #8ea398;
  --line: #24352b;
  --ink-soft: #4b6156;
  --bubble-them: #1c2b22;
  --chat-bg: #101b15;
  --danger-bg: #3a1b1b;
  --warn-bg: #3a2a16;
  --info-bg: #19243d;
  --ok: #5fd193;
  --ok-bg: #18301f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }
input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.ic { width: 22px; height: 22px; flex-shrink: 0; }

/* ---------- Оболочка приложения ---------- */
body { background: var(--bg); }
.app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding-top: max(8px, env(safe-area-inset-top));
}
@media (min-width: 481px) { .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }

#view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#view.enter { animation: enter .22s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

.content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 20px; scrollbar-width: none; }
.content::-webkit-scrollbar { display: none; }
.pad-x { padding: 0 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

/* ---------- Шапка ---------- */
.topbar { display: flex; align-items: center; gap: 8px; padding: 6px 12px 10px 16px; flex-shrink: 0; min-height: 56px; }
.topbar .icon-btn:first-child { margin-left: -8px; }
.tb-title { flex: 1; min-width: 0; }
.tb-title h1 { font-size: 28px; font-weight: 800; letter-spacing: -.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title h1.sm { font-size: 20px; }
.tb-sub { font-size: 13px; color: var(--muted); }
.tb-right { display: flex; align-items: center; gap: 2px; }
.brand { display: flex; align-items: center; gap: 8px; flex: 1; color: var(--green-700); }
.brand .logo { width: 30px; height: 30px; }
.brand span { font-size: 26px; font-weight: 800; letter-spacing: -.3px; color: var(--green-800); }
html[data-theme="dark"] .brand span { color: var(--text); }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text); flex-shrink: 0;
}
.icon-btn:hover { background: var(--field); }
.icon-btn.accent { color: var(--green-700); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg); }
.link-btn { color: var(--green-700); font-weight: 700; font-size: 14px; padding: 6px 4px; white-space: nowrap; }

/* ---------- Поиск, ярлыки, чипы ---------- */
.search {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px;
  background: var(--field); border-radius: 14px; color: var(--muted);
}
.search .ic { width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; color: var(--text); }
.search input::placeholder { color: var(--muted); }

.quick-row { display: flex; justify-content: space-between; padding: 16px 14px 8px; }
.quick { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; width: 64px; color: var(--muted); }
.quick-ic {
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--green-100); color: var(--green-700);
}
.quick-ic .av { --s: 56px; }

.chips { display: flex; gap: 8px; padding: 14px 16px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.flat { padding: 4px 0 12px; }
.chip {
  flex-shrink: 0; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--field); color: var(--text); white-space: nowrap;
}
.chip.active { background: var(--green-700); color: #fff; }

/* ---------- Аватары ---------- */
.av {
  width: var(--s); height: var(--s); border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: calc(var(--s) * .34);
}
.av .ic { width: calc(var(--s) * .46); height: calc(var(--s) * .46); }
.av.ring { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--green-500); }
.av.add { background: var(--field); color: var(--green-700); border: 2px dashed var(--green-500); }

/* ---------- Список чатов ---------- */
.chat-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 16px; }
.chat-row:hover, .row:hover:not(.static), .news-row:hover, .notif:hover { background: var(--green-50); }
.chat-body { flex: 1; min-width: 0; padding: 4px 0; }
.chat-top, .chat-bottom { display: flex; align-items: center; gap: 8px; }
.chat-name { flex: 1; min-width: 0; font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.chat-name .ic { width: 15px; height: 15px; }
.verified { color: var(--green-500); width: 16px !important; height: 16px !important; vertical-align: -3px; }
.kind { color: var(--muted); }
.chat-time { font-size: 12px; color: var(--muted); }
.chat-bottom { margin-top: 3px; }
.chat-prev { flex: 1; min-width: 0; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--green-600); color: #fff;
  font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.badge.muted { background: #a7b5ad; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 24px; color: var(--muted); text-align: center; font-size: 14px; }
.empty .ic { width: 36px; height: 36px; opacity: .5; }

/* ---------- Нижняя навигация ---------- */
.tabbar {
  flex-shrink: 0; display: flex; justify-content: space-around;
  padding: 8px 8px max(10px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar[hidden] { display: none; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); width: 76px; }
.tab-ic { position: relative; display: flex; }
.tab.active { color: var(--green-700); }
.tab-badge {
  position: absolute; top: -5px; left: 14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-style: normal; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--surface);
}

/* ---------- Чат ---------- */
.chat-top-bar { background: var(--surface); border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.chat-head { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.chat-head > div { min-width: 0; }
.chat-head-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-status { font-size: 12.5px; color: var(--muted); }
.chat-head-status.online, .chat-head-status.typing { color: var(--green-600); }
.chat-content {
  background: var(--chat-bg);
  background-image: radial-gradient(rgba(29, 97, 66, .07) 1px, transparent 1px);
  background-size: 18px 18px;
  padding: 10px 10px 14px;
}
.e2e {
  display: flex; align-items: center; gap: 6px; width: fit-content; margin: 4px auto 10px; padding: 6px 12px;
  border-radius: 12px; font-size: 12px; color: var(--ink-soft); background: var(--surface);
}
html[data-theme="dark"] .e2e { color: var(--muted); }
.e2e .ic { width: 14px; height: 14px; }
.day { display: flex; justify-content: center; margin: 10px 0 6px; }
.day span { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 10px; background: rgba(15, 58, 40, .1); color: var(--ink-soft); }
html[data-theme="dark"] .day span { background: rgba(255, 255, 255, .08); color: var(--muted); }
.msg { display: flex; margin: 3px 0; animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.me { justify-content: flex-end; }
.bubble {
  position: relative; max-width: 80%; padding: 8px 12px 6px; border-radius: 18px;
  font-size: 15px; line-height: 1.38; background: var(--bubble-them); box-shadow: 0 1px 1px rgba(0, 0, 0, .06);
  overflow-wrap: anywhere;
}
.msg.them .bubble { border-bottom-left-radius: 6px; }
.msg.me .bubble { background: var(--green-700); color: #fff; border-bottom-right-radius: 6px; }
.author { font-size: 12.5px; font-weight: 700; color: var(--green-600); margin-bottom: 2px; }
.meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 8px 0 -2px 10px; font-size: 11px; opacity: .65; }
.tick { width: 15px; height: 15px; }
.bubble-btn {
  display: block; width: 100%; clear: both; margin-top: 10px; padding: 9px; border-radius: 12px; text-align: center;
  font-weight: 700; font-size: 14px; background: var(--green-50); color: var(--green-700);
}
.transfer, .filemsg { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.transfer .ic, .filemsg .ic { width: 38px; height: 38px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .18); }
.msg.them .transfer .ic, .msg.them .filemsg .ic { background: var(--green-50); color: var(--green-700); }
.transfer b { display: block; font-size: 18px; }
.transfer span, .filemsg span { font-size: 12.5px; opacity: .8; }
.filemsg b { display: block; font-size: 14px; }
.photo { width: 220px; height: 160px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 56px; margin: -2px -6px 0; }
.geo { min-width: 210px; }
.geo-map {
  height: 100px; border-radius: 12px; margin: -2px -6px 6px; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #cfe3d6 0 10px, #dcece2 10px 20px); color: var(--danger);
}
.geo-map .ic { width: 32px; height: 32px; }
.geo span { font-size: 13.5px; }
.share { display: block; padding: 8px 10px; border-left: 3px solid currentColor; border-radius: 6px; background: rgba(255, 255, 255, .14); margin: 2px 0; }
.share b { display: block; font-size: 14px; }
.share span { font-size: 12.5px; opacity: .85; }
.msg.them .share { background: var(--green-50); border-color: var(--green-600); }

.composer {
  flex-shrink: 0; display: flex; align-items: center; gap: 6px; padding: 8px 10px max(10px, env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
.composer input {
  flex: 1; min-width: 0; height: 42px; padding: 0 16px; border-radius: 21px; border: 0; outline: 0;
  background: var(--field); font-size: 15px;
}
.composer.readonly { padding: 10px 16px max(10px, env(safe-area-inset-bottom)); }
.composer.readonly .btn { margin: 0; }
.send-btn {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--green-700); color: #fff;
}
.send-btn .ic { width: 19px; height: 19px; margin-left: -2px; }

/* ---------- Кнопки ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; border-radius: 15px;
  background: var(--green-700); color: #fff; font-weight: 700; font-size: 15.5px; text-align: center;
  transition: transform .1s, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn .ic { width: 19px; height: 19px; }
.btn.secondary, .btn.ghost { background: var(--green-50); color: var(--green-700); }
.btn.danger { background: var(--danger); }
.btn.sm { width: auto; height: 38px; padding: 0 18px; border-radius: 12px; font-size: 14px; }

/* ---------- Сервисы ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }
.tile {
  display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); min-height: 124px;
}
.tile b { margin-top: 8px; font-size: 14.5px; }
.tile span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.tile-ic {
  width: var(--s); height: var(--s); border-radius: calc(var(--s) * .3); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.tile-ic .ic { width: calc(var(--s) * .5); height: calc(var(--s) * .5); }
.tile-ic.soft { color: var(--green-700); }
.banner {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: var(--radius);
  background: var(--green-50); border: 1px solid var(--green-100); color: var(--green-800);
}
html[data-theme="dark"] .banner { color: var(--text); }
.banner > div { flex: 1; min-width: 0; }
.banner b { display: block; font-size: 14px; }
.banner span { font-size: 12.5px; opacity: .75; }
.banner.danger { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
html[data-theme="dark"] .banner.danger { color: #ff8b8b; }

/* ---------- Списки ---------- */
.section-t { padding: 18px 16px 8px; font-size: 16px; font-weight: 800; }
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; min-height: 62px; }
.row-body { flex: 1; min-width: 0; }
.row-t { font-size: 15px; font-weight: 650; line-height: 1.3; display: flex; align-items: center; gap: 8px; }
.row-s { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.row .chev { width: 18px; height: 18px; color: var(--muted); }
.meta-r { font-size: 13px; font-weight: 700; color: var(--green-700); white-space: nowrap; }
.missed { color: var(--danger); }
.tiny { width: 14px; height: 14px; }
.tiny.in, .tiny.out { color: var(--green-600); }
.tiny.missed { color: var(--danger); }
.group { margin: 12px 16px 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.group .row + .row { border-top: 1px solid var(--line); }
.note {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px;
  background: var(--field); font-size: 13px; color: var(--ink-soft); margin: 4px 0 14px;
}
html[data-theme="dark"] .note { color: var(--muted); }
.note .ic { width: 18px; height: 18px; color: var(--green-600); }
.note.strong { background: var(--green-50); color: var(--text); }
.note.strong b { display: block; font-size: 14px; }
.note.strong span { font-size: 12.5px; color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.pill .ic { width: 13px; height: 13px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.wait { background: var(--warn-bg); color: var(--warn); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.danger { background: var(--danger); color: #fff; }
.ok-t { color: var(--ok); }

.switch { width: 46px; height: 28px; border-radius: 14px; background: #c4d0c9; position: relative; flex-shrink: 0; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch.on { background: var(--green-600); }
.switch.on::after { transform: translateX(18px); }
html[data-theme="dark"] .switch:not(.on) { background: #3a4a41; }

/* ---------- Статусы ---------- */
.stories-row { display: flex; gap: 14px; padding: 4px 16px 6px; overflow-x: auto; scrollbar-width: none; }
.stories-row::-webkit-scrollbar { display: none; }
.story-chip { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; width: 64px; flex-shrink: 0; padding-top: 4px; }

/* ---------- Профиль ---------- */
.profile-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 16px 6px; text-align: center; }
.profile-card h2 { margin-top: 10px; font-size: 22px; }
.profile-card p { color: var(--muted); font-size: 14px; margin-bottom: 8px; }

/* ---------- Уведомления ---------- */
.notif { display: flex; gap: 12px; width: 100%; padding: 12px 16px; align-items: flex-start; }
.notif .row-t { justify-content: space-between; }
.notif .when { font-size: 12px; font-weight: 500; color: var(--muted); }
.notif.unread { background: var(--green-50); }
.notif.unread .row-t::after { content: ''; }

/* ---------- Госуслуги ---------- */
.verify {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius);
  background: linear-gradient(135deg, #3c7bf0, #2a4fbf); color: #fff; margin-bottom: 8px;
}
.verify .ic { width: 30px; height: 30px; }
.verify b { display: block; }
.verify span { font-size: 12.5px; opacity: .85; }
.debt { padding: 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.debt.paid { opacity: .65; }
.debt-top { display: flex; gap: 6px; margin-bottom: 4px; }
.debt b { font-size: 15px; }
.debt-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.debt-bottom s { color: var(--muted); font-size: 13px; margin-right: 8px; }
.debt-bottom strong { font-size: 19px; }

/* ---------- Банк ---------- */
.bank-card {
  padding: 18px 20px 20px; border-radius: 22px; color: #fff;
  background: radial-gradient(160px 120px at 92% 0%, rgba(255, 255, 255, .16), transparent 70%), linear-gradient(135deg, #1d6142, #0f3a28);
  box-shadow: 0 10px 24px rgba(15, 58, 40, .25);
}
.bc-top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; opacity: .9; }
.bc-plus { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .14); }
.bc-balance { font-size: 34px; font-weight: 800; letter-spacing: -.5px; margin-top: 14px; }
.bc-cash { font-size: 13px; opacity: .8; margin-top: 2px; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); padding: 18px 10px 4px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.act span { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--green-100); color: var(--green-700); }
.products { display: flex; gap: 10px; padding: 14px 16px 0; overflow-x: auto; scrollbar-width: none; }
.product { flex: 0 0 132px; padding: 12px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.product .ic { color: var(--green-600); margin-bottom: 6px; }
.product b { font-size: 13px; }
.product span { font-size: 12px; color: var(--muted); }
.amount { font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.amount.plus { color: var(--ok); }

/* ---------- Платежи ---------- */
.pay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 8px; padding: 8px 16px 4px; }
.pay-cat { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-align: center; line-height: 1.25; }
.pay-cat span { width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--green-100); color: var(--green-700); }

/* ---------- Образование ---------- */
.progress { height: 6px; border-radius: 3px; background: var(--field); margin-top: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green-500); border-radius: 3px; transition: width .4s; }
.progress.big { height: 10px; margin: 0 0 14px; border-radius: 5px; }
.pct { font-size: 13px; font-weight: 700; color: var(--green-700); }
.avg { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: var(--radius); background: var(--green-700); color: #fff; }
.avg span { font-size: 13px; opacity: .85; }
.avg b { display: block; font-size: 28px; }
.avg-week { font-size: 13px; opacity: .85; }
.days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 14px 16px 6px; }
.dayb { display: flex; flex-direction: column; align-items: center; padding: 8px 0; border-radius: 14px; background: var(--field); }
.dayb b { font-size: 14px; }
.dayb span { font-size: 11px; color: var(--muted); }
.dayb.active { background: var(--green-700); color: #fff; }
.dayb.active span { color: rgba(255, 255, 255, .8); }
.ltime { width: 46px; font-size: 13px; font-weight: 700; color: var(--green-700); }
.grade { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.grade.g5 { background: var(--ok-bg); color: var(--ok); }
.grade.g4 { background: var(--info-bg); color: var(--info); }
.grade.g3 { background: var(--warn-bg); color: var(--warn); }

/* ---------- Новости ---------- */
.news-row { display: flex; gap: 12px; width: 100%; padding: 12px 16px; align-items: flex-start; }
.thumb { width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.thumb .ic { width: 28px; height: 28px; }
.tag { font-size: 11.5px; font-weight: 700; }
.t-gov { color: var(--info); }
.t-region { color: var(--green-600); }
.t-safety { color: var(--danger); }
.news-row .row-t { margin-top: 2px; }
.hero { height: 180px; margin: 0 16px; border-radius: 22px; display: flex; align-items: center; justify-content: center; color: #fff; }
.hero .ic { width: 64px; height: 64px; opacity: .9; }
.article { padding: 16px; }
.article h2 { font-size: 22px; line-height: 1.25; margin: 6px 0 8px; }
.article p { font-size: 15.5px; line-height: 1.6; margin-top: 12px; }
.article .btn { margin-top: 22px; }

/* ---------- LizaAlert ---------- */
.liza-feat { padding: 16px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.lf-top { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.lf-top h2 { font-size: 18px; margin-top: 8px; }
.lf-top p { font-size: 14px; }
.liza-feat .btn { margin-top: 2px; }
.facts { margin: 16px 0; display: grid; gap: 4px; }
.facts dt { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.facts dd { font-size: 15px; line-height: 1.45; }

/* ---------- Безопасность ---------- */
.sec-hero { margin: 0 16px; padding: 22px 18px; border-radius: 22px; text-align: center; background: linear-gradient(160deg, #1d6142, #0f3a28); color: #fff; }
.sec-hero .ic { width: 48px; height: 48px; }
.sec-hero h2 { font-size: 20px; margin: 10px 0 6px; }
.sec-hero p { font-size: 14px; line-height: 1.5; opacity: .88; }
.keygrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); font-family: ui-monospace, Menlo, monospace; font-size: 15px; text-align: center; letter-spacing: 1px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 8px 2px 0; line-height: 1.45; }
.hint.center { text-align: center; margin-bottom: 14px; }

/* ---------- Нижний лист ---------- */
.sheet-wrap { position: absolute; inset: 0; z-index: 40; }
.sheet-bg { position: absolute; inset: 0; background: rgba(5, 20, 13, .45); opacity: 0; transition: opacity .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%; overflow-y: auto;
  padding: 8px 16px 30px; border-radius: 26px 26px 0 0; background: var(--surface);
  transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet .list { margin: 0 -16px; }
.sheet .btn + .btn { margin-top: 10px; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet-head { margin-bottom: 16px; }
.sheet-head h2 { font-size: 20px; line-height: 1.25; }
.sheet-head p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.sheet-text { font-size: 15px; line-height: 1.55; margin-bottom: 18px; }
.sheet-profile { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; margin-bottom: 14px; }
.sheet-profile h2 { margin-top: 8px; font-size: 20px; }
.sheet-profile p { color: var(--muted); font-size: 14px; }
.about-logo { width: 80px; height: 80px; border-radius: 24px; background: var(--green-700); color: #fff; display: flex; align-items: center; justify-content: center; }
.about-logo .logo { width: 52px; height: 52px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field span { font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .field textarea {
  border: 1.5px solid transparent; outline: 0; background: var(--field); border-radius: 14px; padding: 12px 14px; font-size: 16px; resize: none;
}
.field input:focus, .field textarea:focus { border-color: var(--green-500); }
.pick { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 14px; scrollbar-width: none; }
.pick-item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.pick-item input { position: absolute; opacity: 0; pointer-events: none; }
.pick-item .av { transition: box-shadow .15s; }
.pick-item input:checked + .av { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--green-500); }
.att-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.att { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.att span { width: 56px; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center; color: #fff; }
.qr-box { width: 220px; margin: 4px auto 16px; padding: 10px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.qr { display: block; width: 100%; }
.details { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.details li { display: flex; gap: 10px; align-items: center; font-size: 14.5px; }
.details .ic { width: 18px; height: 18px; color: var(--green-600); }

/* ---------- Тост ---------- */
.toast {
  position: absolute; z-index: 60; left: 16px; right: 16px; bottom: 96px;
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px;
  background: #13261c; color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s;
}
html[data-theme="dark"] .toast { background: #2a3d32; }
.toast .ic { width: 20px; height: 20px; color: #7ed8b0; }
.toast.show { opacity: 1; transform: none; }

/* ---------- Звонок ---------- */
.call {
  position: absolute; inset: 0; z-index: 45; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 48px 24px 40px; color: #fff;
  background: radial-gradient(400px 300px at 50% 30%, #2f8a5f, transparent 70%), linear-gradient(180deg, #164d36, #071a12);
  opacity: 0; transition: opacity .25s;
}
.call.video { background: radial-gradient(400px 400px at 50% 40%, #3f6fd1, transparent 70%), linear-gradient(180deg, #1a2550, #070b1a); }
.call.open { opacity: 1; }
.call-top { display: flex; align-items: center; gap: 6px; font-size: 13px; opacity: .8; }
.call-top .ic { width: 14px; height: 14px; }
.call-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.call-mid h2 { margin-top: 14px; font-size: 26px; }
.call-mid p { font-size: 16px; opacity: .8; font-variant-numeric: tabular-nums; }
.call-mid .av { animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .35); } 70% { box-shadow: 0 0 0 26px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }
.self-view { position: absolute; top: 80px; right: 20px; width: 92px; height: 128px; border-radius: 18px; background: #24324f; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.call-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
.cb { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 11.5px; opacity: .95; }
.cb .ic { width: 60px; height: 60px; padding: 18px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.cb.off .ic { background: #fff; color: #13261c; }
.cb.end .ic { background: #e5484d; }

/* ---------- Истории ---------- */
.story { position: absolute; inset: 0; z-index: 46; color: #fff; display: flex; flex-direction: column; padding: 20px 12px 20px; transition: background .3s; }
.bars { display: flex; gap: 4px; position: relative; z-index: 2; }
.bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.bars b { display: block; height: 100%; width: 0; background: #fff; }
.bars i.done b { width: 100%; }
.bars i.run b { animation: fill 4.5s linear forwards; }
@keyframes fill { to { width: 100%; } }
.story-head { display: flex; align-items: center; gap: 10px; margin-top: 12px; position: relative; z-index: 2; }
.story-head b { font-size: 15px; }
.story-head span { flex: 1; font-size: 13px; opacity: .75; }
.story-head .icon-btn { color: #fff; }
.story-head .icon-btn:hover { background: rgba(255, 255, 255, .15); }
.story-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 0 24px; }
.story-emoji { font-size: 96px; }
.story-body p { font-size: 26px; font-weight: 800; line-height: 1.25; text-shadow: 0 2px 12px rgba(0, 0, 0, .25); }
.story-zone { position: absolute; top: 120px; bottom: 100px; width: 40%; z-index: 1; }
.story-zone.left { left: 0; }
.story-zone.right { right: 0; }
.story-reply { display: flex; gap: 8px; position: relative; z-index: 2; }
.story-reply input { flex: 1; height: 44px; padding: 0 18px; border-radius: 22px; border: 1.5px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .15); color: #fff; outline: 0; font-size: 15px; }
.story-reply input::placeholder { color: rgba(255, 255, 255, .7); }
.story-reply .send-btn { background: rgba(255, 255, 255, .2); }
