/* ============ Токены ============ */
:root {
  --bg: #F2F0E9;
  --bg-2: #E9E6DC;
  --surface: #FFFFFF;
  --surface-2: #F5F3EC;
  --line: #E0DCD0;
  --text: #131417;
  --muted: #6C6F77;
  --faint: #A3A59F;
  --accent: #C9F23D;
  --accent-ink: #131417;
  --accent-text: #4C6600;
  --accent-soft: rgba(150, 190, 20, .14);
  --amber: #A86400;
  --amber-soft: #FDEFD3;
  --danger: #D03B3B;
  --shadow: 0 1px 0 rgba(20, 20, 10, .04), 0 8px 24px -12px rgba(30, 30, 10, .18);
  --shadow-lg: 0 24px 60px -20px rgba(20, 20, 10, .35);
  --r: 18px;
  --r-sm: 12px;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C0D0F;
    --bg-2: #111316;
    --surface: #16181C;
    --surface-2: #1D2025;
    --line: #2A2E35;
    --text: #F1F0EA;
    --muted: #8F939B;
    --faint: #5B5F67;
    --accent: #D4FF3A;
    --accent-ink: #0C0D0F;
    --accent-text: #D4FF3A;
    --accent-soft: rgba(212, 255, 58, .1);
    --amber: #FFB547;
    --amber-soft: rgba(255, 181, 71, .12);
    --danger: #FF6464;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -18px rgba(0, 0, 0, .8);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .9);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C0D0F;
  --bg-2: #111316;
  --surface: #16181C;
  --surface-2: #1D2025;
  --line: #2A2E35;
  --text: #F1F0EA;
  --muted: #8F939B;
  --faint: #5B5F67;
  --accent: #D4FF3A;
  --accent-ink: #0C0D0F;
  --accent-text: #D4FF3A;
  --accent-soft: rgba(212, 255, 58, .1);
  --amber: #FFB547;
  --amber-soft: rgba(255, 181, 71, .12);
  --danger: #FF6464;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -18px rgba(0, 0, 0, .8);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .9);
  color-scheme: dark;
}

/* ============ База ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -.01em; }
.muted { color: var(--muted); }
code, .kbd { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============ Логотип ============ */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.logo { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--text); }
.logo svg { width: 24px; height: 24px; }
.lg-ring { fill: none; stroke: var(--bg); stroke-opacity: .35; stroke-width: 1.6; }
.lg-sweep { fill: var(--accent); opacity: .85; transform-origin: 20px 20px; }
.lg-sweep.spin { animation: sweep 3.2s linear infinite; }
.lg-dot { fill: var(--accent); }
@keyframes sweep { to { transform: rotate(360deg); } }
.brand-lg .logo { width: 46px; height: 46px; border-radius: 14px; }
.brand-lg .logo svg { width: 36px; height: 36px; }
.brand-lg .brand-name { font-size: 22px; }

/* ============ Кнопки и поля ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 14px;
  padding: 13px 18px; font-weight: 700; font-size: 15px;
  transition: transform .12s ease, background .2s, opacity .2s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-ghost { background: var(--surface-2); border-color: var(--line); }
.btn-ghost.danger { color: var(--danger); }
.btn-sm { padding: 8px 13px; font-size: 13.5px; border-radius: 11px; }
.btn-block { width: 100%; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.field small { color: var(--muted); font-size: 12.5px; }
.field-tight { margin: 10px 0 0; }
.field input, .field select, .grant input {
  width: 100%; height: 48px; padding: 0 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px;
  font-size: 16px; font-weight: 600; outline: none;
  transition: border-color .2s, box-shadow .2s;
  appearance: none; -webkit-appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field input::placeholder, .grant input::placeholder { color: var(--faint); font-weight: 500; }
.field input:focus, .field select:focus, .grant input:focus { border-color: var(--text); box-shadow: 0 0 0 4px var(--accent-soft); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-err { color: var(--danger); font-size: 13.5px; font-weight: 600; min-height: 0; margin: 0 0 10px; }
.form-err:empty { display: none; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 18px; }
.seg-3 { grid-template-columns: repeat(3, 1fr); margin: 0; }
.seg-btn { border: 0; background: transparent; padding: 10px; border-radius: 10px; font-weight: 700; color: var(--muted); }
.seg-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* показать / скрыть пароль */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 52px !important; }
.pw-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.pw-toggle:hover { color: var(--text); background: var(--surface); }
.pw-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; }
.pw-toggle .eye-off, .pw-toggle.on .eye { display: none; }
.pw-toggle.on .eye-off { display: block; }

/* переключатель языка */
.lang { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; }
.lang button { border: 0; background: transparent; padding: 5px 9px; border-radius: 8px; font-size: 12.5px; font-weight: 800; color: var(--muted); letter-spacing: .03em; }
.lang button.on { background: var(--text); color: var(--bg); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sub-h { margin-top: 18px; }
.lang-seg { margin: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }

/* ============ Вход ============ */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: calc(28px + var(--safe-t)) 16px 28px; position: relative; overflow: hidden; }
.auth-glow { position: absolute; width: 520px; height: 520px; top: -260px; right: -200px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 45%, transparent), transparent 65%); filter: blur(10px); opacity: .55; pointer-events: none; }
.auth-inner { width: 100%; max-width: 420px; position: relative; }
.auth-title { font-size: clamp(30px, 8.5vw, 40px); line-height: 1.05; margin: 34px 0 14px; font-weight: 700; letter-spacing: -.03em; }
.auth-title em { font-style: normal; background: linear-gradient(transparent 62%, var(--accent) 62%, var(--accent) 92%, transparent 92%); padding: 0 2px; }
:root[data-theme="dark"] .auth-title em { background: none; color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-title em { background: none; color: var(--accent); } }
.auth-sub { color: var(--muted); margin: 0 0 26px; font-size: 15.5px; max-width: 36ch; }
.auth-card { padding: 18px; }
.text-link { display: block; margin: 12px auto 0; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.text-link:hover { color: var(--text); }
.form-h { font-size: 20px; margin-bottom: 8px; }
.form-p { margin: 0 0 16px; font-size: 14px; }
.form-ok { color: var(--accent-text); font-weight: 700; font-size: 14px; margin: 0 0 12px; line-height: 1.45; }
.auth-note { text-align: center; color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* ============ Каркас приложения ============ */
.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(96px + var(--safe-b)); }
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + var(--safe-t)) 16px 12px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 6px 11px 6px 9px; white-space: nowrap; max-width: 62vw; overflow: hidden; text-overflow: ellipsis; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; position: relative; }
.status.live .pulse { background: #3BD16F; }
.status.live .pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #3BD16F; opacity: 0; animation: ping 2s ease-out infinite; }
.status.warn .pulse { background: var(--amber); }
@keyframes ping { 0% { transform: scale(.4); opacity: .8; } 100% { transform: scale(1.4); opacity: 0; } }

.views { padding: 14px 16px 0; }
.view { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 16px; }
.view-head h2 { font-size: 22px; }

/* ============ Таббар ============ */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b)); z-index: 30;
  width: min(calc(100% - 24px), 440px);
  display: grid; grid-template-columns: 1fr 64px 1fr 1fr; align-items: center;
  padding: 6px; border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.tab { position: relative; border: 0; background: transparent; display: grid; justify-items: center; gap: 2px; padding: 7px 4px 6px; border-radius: 18px; color: var(--muted); font-size: 11px; font-weight: 700; }
.tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--text); background: var(--surface-2); }
.tab-add { width: 52px; height: 52px; margin: 0 auto; border-radius: 18px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 90%, transparent); }
.tab-add svg { width: 24px; height: 24px; stroke-width: 2.6; }
.badge { position: absolute; top: 3px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font: 800 10.5px/18px var(--body); font-style: normal; }

/* ============ Лента ============ */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 10px; }
.stat b { display: block; font: 700 22px/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.stat:first-child { background: var(--text); color: var(--bg); border-color: var(--text); }
.stat:first-child b { color: var(--accent); }
.stat:first-child span { color: color-mix(in srgb, var(--bg) 70%, transparent); }

.chips-scroll { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px 2px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: 99px; font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.feed { display: grid; gap: 10px; }
.offer {
  position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 12px;
  padding: 10px; text-decoration: none; overflow: hidden;
  transition: transform .15s ease;
}
.offer:active { transform: scale(.985); }
.offer.unread::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.offer.fresh { animation: drop .5s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes drop { from { opacity: 0; transform: translateY(-14px) scale(.98); } to { opacity: 1; transform: none; } }
.offer-body { padding-right: 30px; }
.offer-x { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); display: grid; place-items: center; padding: 0; transition: background .15s, color .15s; }
.offer-x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.offer-x:hover, .offer-x:active { background: var(--danger); border-color: var(--danger); color: #fff; }
.offer.gone { animation: gone .26s ease forwards; pointer-events: none; }
@keyframes gone { to { opacity: 0; transform: translateX(40px) scale(.96); } }
.feed-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.feed-head .mini-link { color: var(--danger); }
.toast.with-action { pointer-events: auto; display: flex; align-items: center; gap: 14px; }
.toast-btn { border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 13px; padding: 6px 12px; border-radius: 9px; }
.offer-img { width: 96px; height: 96px; border-radius: 12px; background: var(--surface-2) center/cover no-repeat; border: 1px solid var(--line); }
.offer-img.empty { display: grid; place-items: center; color: var(--faint); }
.offer-img.empty svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.offer-body { min-width: 0; display: flex; flex-direction: column; }
.offer-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.kind { font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 3px 7px; border-radius: 6px; text-transform: uppercase; }
.kind-new { background: var(--accent); color: var(--accent-ink); }
.kind-refresh { background: var(--amber-soft); color: var(--amber); }
.offer-time { font-size: 12px; color: var(--muted); font-weight: 700; margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.offer-title { font-weight: 700; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.offer-price { font: 700 18px/1.2 var(--display); letter-spacing: -.02em; margin-top: auto; padding-top: 4px; }
.offer-meta { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty-state { text-align: center; padding: 40px 18px 30px; }
.radar { width: 132px; height: 132px; margin: 0 auto 22px; border-radius: 50%; position: relative; background: radial-gradient(circle, transparent 30%, var(--line) 30.5%, transparent 31.5%, transparent 62%, var(--line) 62.5%, transparent 63.5%), var(--surface); border: 1px solid var(--line); overflow: hidden; }
.radar::before { content: ""; position: absolute; inset: 0; background: conic-gradient(from 0deg, transparent 0 290deg, color-mix(in srgb, var(--accent) 70%, transparent) 360deg); animation: sweep 2.6s linear infinite; border-radius: 50%; }
.radar::after { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); top: 30%; left: 62%; box-shadow: 0 0 12px var(--accent); animation: blip 2.6s ease-in-out infinite; }
@keyframes blip { 0%, 60% { opacity: 0; } 70% { opacity: 1; } 100% { opacity: 0; } }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin: 0 auto 18px; max-width: 30ch; }

.install-banner { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 14px; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: linear-gradient(120deg, var(--accent-soft), var(--surface) 70%); }
.install-banner b { font-size: 14.5px; }
.install-banner p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.install-banner .btn { margin-left: auto; flex: none; }

/* ============ Поиски ============ */
.searches { display: grid; gap: 10px; }
.search { padding: 14px; }
.search.off { opacity: .55; }
.search-head { display: flex; gap: 12px; align-items: flex-start; }
.search-name { font: 600 15.5px/1.25 var(--display); letter-spacing: -.01em; word-break: break-word; }
.search-q { font-size: 13px; color: var(--muted); margin-top: 3px; word-break: break-word; }
.search-q s { text-decoration: none; color: var(--danger); opacity: .8; }
.search-head .switch { margin-left: auto; flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0; }
.tag { font-size: 11.5px; font-weight: 700; padding: 4px 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
h3 .tag { vertical-align: 2px; margin-left: 6px; }
.search-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed var(--line); padding-top: 10px; font-size: 13px; color: var(--muted); font-weight: 700; }
.search-foot b { color: var(--text); font-family: var(--display); }
.link-btn { border: 0; background: none; color: var(--danger); font-weight: 700; font-size: 13px; padding: 4px 0; }

.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; cursor: pointer; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .22s cubic-bezier(.3, .9, .4, 1.2); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); background: var(--accent-ink); }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; cursor: pointer; }
.switch-row b { display: block; font-size: 14.5px; }
.switch-row small { color: var(--muted); font-size: 12.5px; }
.switch-row .switch { margin-left: auto; }

/* ============ Профиль ============ */
.block { padding: 16px; margin-bottom: 12px; }
.block h3 { font-size: 15px; margin-bottom: 8px; }
.block p { margin: 0 0 12px; font-size: 14px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.row-btns .btn-primary { flex: 1; }
.block > .btn-block { margin-top: 8px; }
.ios-hint { font-size: 13.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; line-height: 1.5; }

.plan { padding: 18px; margin-bottom: 12px; position: relative; overflow: hidden; background: var(--text); color: var(--bg); border-color: var(--text); }
.plan::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; border: 28px solid var(--accent); opacity: .9; }
.plan .plan-label { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: color-mix(in srgb, var(--bg) 60%, transparent); }
.plan .plan-title { font: 700 22px/1.15 var(--display); margin: 6px 0 4px; position: relative; z-index: 1; max-width: 70%; }
.plan .plan-sub { font-size: 13.5px; color: color-mix(in srgb, var(--bg) 70%, transparent); position: relative; z-index: 1; }
.plan .plan-login { font-weight: 800; color: var(--accent); }
.plan.expired::after { border-color: var(--danger); }

.plan .btn { position: relative; z-index: 1; margin-top: 16px; }
.plan .plan-hint { position: relative; z-index: 1; margin: 14px 0 0; font-size: 13px; color: color-mix(in srgb, var(--bg) 70%, transparent); }
.expired-banner { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); background: linear-gradient(120deg, color-mix(in srgb, var(--danger) 12%, transparent), var(--surface) 70%); }
.revenue { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 14px; }
.revenue div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.revenue b { display: block; font: 700 17px var(--display); }
.revenue span { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.grant { display: grid; gap: 8px; margin-bottom: 14px; }
.grant input { height: 44px; font-size: 15px; }
.users { display: grid; gap: 6px; max-height: 340px; overflow: auto; }
.user-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; font-size: 13px; cursor: pointer; }
.user-row b { font-weight: 800; }
.user-row .u-until { text-align: right; font-weight: 700; }
.user-row .u-until.bad { color: var(--danger); }
.user-row .u-meta { color: var(--muted); grid-column: 1 / -1; font-size: 12px; }
.foot { text-align: center; font-size: 12px; margin: 18px 0 8px; }

/* ============ Шторка ============ */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 6, 8, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 26px 26px 0 0; border: 1px solid var(--line); border-bottom: 0;
  box-shadow: var(--shadow-lg); animation: up .32s cubic-bezier(.2, .9, .3, 1);
}
@keyframes up { from { transform: translateY(100%); } }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 9px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 12px; }
.sheet-head h2 { font-size: 20px; }
.sheet-body { overflow-y: auto; padding: 4px 16px 10px; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 16px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface); }
.group { margin-bottom: 16px; }
.label { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .02em; margin-bottom: 8px; }

.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.label-row .label { margin: 0; }
.mini-link { border: 0; background: none; padding: 2px 0; font-weight: 800; font-size: 12.5px; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.alt-sep { color: var(--faint); }
.preview { margin: 4px 0 6px; }
.preview-sum { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 10px; font-weight: 700; }
.preview-sum b { font: 700 24px var(--display); color: var(--accent-text); }
.preview-list { display: grid; gap: 6px; }
.mini { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 6px; border-radius: 12px; background: var(--surface-2); text-decoration: none; }
.mini i { width: 48px; height: 48px; border-radius: 9px; background: var(--line) center/cover; }
.mini span { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini b { font: 700 13px var(--display); white-space: nowrap; }

/* ============ Оплата ============ */
.pay-hero { text-align: center; padding: 6px 0 18px; border-bottom: 1px dashed var(--line); margin-bottom: 18px; }
.pay-big { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.pay-big b { font: 700 46px/1 var(--display); letter-spacing: -.04em; }
.pay-big span { font-weight: 700; color: var(--muted); }
.pay-hero p { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.pay-step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; margin-bottom: 18px; }
.pay-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 700 14px var(--display); }
.pay-step-body { display: grid; gap: 8px; min-width: 0; }
.pay-step-body b { font-size: 15px; padding-top: 4px; }
.pay-step-body small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.pay-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px dashed color-mix(in srgb, var(--accent-text) 60%, var(--line)); background: var(--accent-soft); color: var(--text); font: 700 24px/1 ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .14em; }
.pay-code svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; opacity: .7; }
.pay-code.copied { border-style: solid; border-color: var(--accent-text); }
.btn-tg { background: #229ED9; color: #fff; border-color: #229ED9; }
.btn-tg svg, .tg-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tg-link { display: flex; align-items: center; justify-content: center; gap: 8px; color: #229ED9; text-decoration: none; }
.btn-mono { background: #111; color: #fff; border-color: #111; }
:root[data-theme="dark"] .btn-mono { background: #fff; color: #111; border-color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-mono { background: #fff; color: #111; border-color: #fff; } }
.mono-cat { font-size: 18px; line-height: 1; }
.card-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.pay-ios { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent-text) 30%, var(--line)); border-radius: 12px; padding: 10px 12px; color: var(--text) !important; font-weight: 600; }
.pay-status { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; font-weight: 700; color: var(--muted); text-align: left; }
.pay-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); flex: none; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.pay-done { text-align: center; padding: 10px 0 4px; animation: fade .3s ease; }
.pay-done b { font: 700 24px var(--display); display: block; margin-top: 14px; }
.pay-done p { color: var(--muted); margin: 6px 0 0; font-weight: 600; }
.pay-check { width: 84px; height: 84px; margin: 0 auto; border-radius: 50%; background: var(--accent); display: grid; place-items: center; animation: pop .45s cubic-bezier(.2, .9, .3, 1.4); }
.pay-check svg { width: 44px; height: 44px; fill: none; stroke: var(--accent-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .4s .25s ease forwards; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.grant small { font-size: 12px; }
.admin-msg { margin: 10px 0 10px; }
.msg-card { padding: 16px; margin-bottom: 12px; border: 1px solid color-mix(in srgb, #229ED9 45%, var(--line)); background: linear-gradient(120deg, color-mix(in srgb, #229ED9 12%, transparent), var(--surface) 70%); animation: drop .45s cubic-bezier(.2, .9, .3, 1.2); }
.msg-card b { display: block; font-size: 14.5px; margin-bottom: 6px; }
.msg-card p { margin: 0 0 12px; white-space: pre-wrap; font-size: 14.5px; line-height: 1.5; }
.msg-card small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.bc-aud { margin-bottom: 14px; }
.field textarea { width: 100%; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; font-size: 15px; font-weight: 600; outline: none; resize: vertical; min-height: 96px; }
.field textarea:focus { border-color: var(--text); box-shadow: 0 0 0 4px var(--accent-soft); }
.check-row { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-weight: 700; font-size: 14px; cursor: pointer; }
.pending { margin-bottom: 14px; }
.pend-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; }
.pend-row.claimed { background: var(--amber-soft); }
.pend-row .u-meta { color: var(--muted); font-size: 12px; }
.pend-row .btn { grid-row: span 2; }

/* ============ Тост ============ */
.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 80; background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.skeleton { height: 118px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (min-width: 600px) {
  .views { padding-top: 22px; }
  .sheet { border-radius: 26px; margin-bottom: 24px; max-height: 86dvh; border-bottom: 1px solid var(--line); }
  .sheet-wrap { align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
