/* Вид как у PR1ME Partners (@ad_pr1me_bot): Montserrat, световые баннеры, объёмные карточки, две темы. */
:root {
  --page: #04060a; --card: linear-gradient(145deg, #0f141c 0%, #0a0e15 55%, #070a10 100%);
  --card-border: rgba(255, 255, 255, .045);
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, .055);
  --inset: rgba(255, 255, 255, .04); --line: rgba(220, 232, 255, .1); --line-strong: rgba(220, 232, 255, .3);
  --fg: #f4f7fb; --dim: #95a0af; --soft: #b9c4d3; --accent: #cfe4ff;
  --green: #4fd69c; --amber: #e9b96b; --red: #f2777d;
  --btn: linear-gradient(180deg, #ffffff, #dbe5f2); --btn-fg: #070b12; --btn-shadow: 0 10px 24px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .8);
  --band: url("tg-band.webp");
  --band-fade: linear-gradient(90deg, rgba(4, 6, 10, .92) 0%, rgba(4, 6, 10, .74) 55%, rgba(4, 6, 10, .52) 100%);
  --page-glow: radial-gradient(1px 1px at 12% 18%, rgba(223, 234, 255, .7), transparent 60%), radial-gradient(1px 1px at 27% 72%, rgba(223, 234, 255, .5), transparent 60%), radial-gradient(1.5px 1.5px at 41% 33%, rgba(223, 234, 255, .6), transparent 60%), radial-gradient(1px 1px at 58% 84%, rgba(223, 234, 255, .45), transparent 60%), radial-gradient(1px 1px at 66% 12%, rgba(223, 234, 255, .6), transparent 60%), radial-gradient(1.5px 1.5px at 79% 46%, rgba(223, 234, 255, .55), transparent 60%), radial-gradient(1px 1px at 90% 80%, rgba(223, 234, 255, .5), transparent 60%), radial-gradient(ellipse 70% 40% at 90% 0%, rgba(90, 140, 220, .1), transparent 70%);
  --sky: url("portal-mobile.webp"); --sky-shade: linear-gradient(180deg, rgba(4, 6, 10, .78) 0%, rgba(4, 6, 10, .72) 45%, rgba(4, 6, 10, .6) 100%);
  --bar: #05070b; --sheet: #0a0e15; --logo-filter: none;
  --chat: #0e1621; --bubble: #182533; --pill: rgba(255, 255, 255, .1); --tg-blue: #2AABEE;
  --font: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  color-scheme: dark;
}
html[data-theme="light"] {
  --page: #f2f5fa; --card: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  --card-border: rgba(16, 32, 64, .08);
  --card-shadow: inset 0 1px 0 #ffffff;
  --inset: #eaeff6; --line: rgba(16, 32, 64, .1); --line-strong: rgba(16, 32, 64, .2);
  --fg: #0c1424; --dim: #556175; --soft: #3d4a5e; --accent: #1f5fbf;
  --green: #0e7a4b; --amber: #9a5d00; --red: #c42b38;
  --btn: linear-gradient(180deg, #1a2436, #0c1424); --btn-fg: #ffffff; --btn-shadow: 0 8px 20px -6px rgba(12, 20, 36, .45), inset 0 1px 0 rgba(255, 255, 255, .18);
  --band: url("tg-band-light.webp");
  --band-fade: linear-gradient(90deg, rgba(255, 255, 255, .88) 0%, rgba(255, 255, 255, .66) 55%, rgba(255, 255, 255, .42) 100%);
  --page-glow: radial-gradient(ellipse 70% 40% at 90% 0%, rgba(90, 140, 230, .16), transparent 70%), radial-gradient(ellipse 60% 40% at 0% 100%, rgba(120, 160, 230, .12), transparent 70%);
  --sky: url("tg-band-light.webp"); --sky-shade: linear-gradient(180deg, rgba(242, 245, 250, .6), rgba(242, 245, 250, .72));
  --bar: #ffffff; --sheet: #ffffff; --logo-filter: invert(1);
  --chat: #dfe9f3; --bubble: #ffffff; --pill: rgba(16, 32, 64, .28);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
html { background: var(--page); }
/* Фон всего приложения: свет как в PR1ME Partners и звёзды поверх него */
body::before { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; background: var(--sky-shade), var(--sky) center top / cover no-repeat; }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--page-glow); }
body { background: transparent; color: var(--fg); font-family: var(--font); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { position: relative; height: 100%; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding-top: var(--safe-top); }

/* Шапка: все элементы на одной базовой линии. Буквы логотипа по высоте равны заглавным GRAMADS (0,7 кегля). */
.top { flex: none; position: relative; display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 56px; }
.lockup { display: inline-flex; align-items: baseline; gap: 5px; font-weight: 700; font-size: 14px; line-height: 1; letter-spacing: .02em; white-space: nowrap; }
.lockup .coin { position: relative; top: 2.1px; width: 14px; height: 14px; margin-right: 1px; }
.lockup .by { font-weight: 500; font-size: 11px; letter-spacing: 0; color: var(--dim); }
.lockup .pr1me { display: block; height: 9.8px; width: 63px; overflow: visible; color: var(--fg); }
.back { position: absolute; left: 8px; top: 8px; background: none; border: 0; color: var(--fg); font-size: 13.5px; font-weight: 600; padding: 6px 8px; }
.theme { position: absolute; right: 12px; top: 9px; display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--inset); border: 1px solid var(--line); }
.theme button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; color: var(--dim); display: flex; align-items: center; justify-content: center; padding: 0; }
.theme svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme button[aria-pressed="true"] { background: var(--fg); color: var(--page); }

.view-banner { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 14px 10px; padding: 7px 8px 7px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line-strong); font-size: 12.5px; font-weight: 600; }
.body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 14px; padding: 2px 14px 24px; -webkit-overflow-scrolling: touch; }

@media (min-aspect-ratio: 1/1) { html:not([data-theme="light"]) { --sky: url("portal-desktop.webp"); } }
.nav::after { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); background: var(--bar); box-shadow: inset 0 1px 0 var(--line); }
.nav { position: relative; isolation: isolate; flex: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 0 6px calc(8px + var(--safe-bottom)); }
.nav button { position: relative; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 600; font-size: 10.5px; color: var(--dim); padding: 10px 0 2px; }
.nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav button[aria-current="page"] { color: var(--fg); }
.nav button[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 36%; right: 36%; height: 2px; border-radius: 0 0 2px 2px; background: var(--fg); }

.coin { display: inline-block; width: .9em; height: .9em; flex: none; border-radius: 50%; }
/* Логотип внутри строки: текст остаётся на общей линии, значок центрируется по заглавным буквам */
.gram { white-space: nowrap; }
.gram .coin { vertical-align: -.1em; margin-right: .24em; }
.with-coin { display: inline-flex; align-items: center; gap: .24em; white-space: nowrap; }

/* Баннер со светом: шапка каждого экрана */
.hero { flex: none; position: relative; isolation: isolate; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 5px; background: var(--page); box-shadow: var(--card-shadow); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--band) 60% 30% / cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--band-fade); }
.hero .cap { color: var(--soft); }
h1 { margin: 0; font-weight: 700; font-size: 23px; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
.mega { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; font-weight: 700; font-size: 38px; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mega small { font-size: 18px; font-weight: 600; letter-spacing: 0; color: var(--soft); }
.quiet { color: var(--soft); font-size: 12.5px; }
.warnline { color: var(--amber); font-size: 12.5px; font-weight: 600; }
.share { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.share div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.share b { font-weight: 700; font-size: 18px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.share span { font-size: 11px; color: var(--soft); line-height: 1.25; }

.tag { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 11.5px; padding: 3px 9px 3px 8px; border-radius: 999px; background: var(--inset); border: 1px solid var(--line); color: var(--green); margin-bottom: 6px; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.bad { color: var(--red); } .tag.warn { color: var(--amber); } .tag.off { color: var(--dim); }

/* Разделы и карточки */
.pad { flex: none; display: flex; flex-direction: column; gap: 10px; }
.sec { flex: none; display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--card-border); background: var(--card); box-shadow: var(--card-shadow); padding: 14px 14px 6px; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.sec-h h2 { margin: 0; font-weight: 700; font-size: 15px; }
.cap { font-size: 11px; font-weight: 600; color: var(--dim); }
.s { font-size: 12px; color: var(--dim); overflow-wrap: anywhere; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row .b { flex: 1; }
.form { flex: none; display: flex; flex-direction: column; gap: 12px; border-radius: 16px; border: 1px solid var(--card-border); background: var(--card); box-shadow: var(--card-shadow); padding: 14px; }

.b { border: 0; border-radius: 12px; min-height: 46px; padding: 11px 16px; background: var(--btn); color: var(--btn-fg); box-shadow: var(--btn-shadow); font-weight: 700; font-size: 14px; }
.b.o { background: var(--inset); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.b.d { background: none; color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.b.w { width: 100%; }
.b.sm { min-height: 32px; padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.b.big { min-height: 58px; font-size: 16px; border-radius: 14px; }
.b:active { transform: scale(.985); }
.b:disabled { opacity: .4; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--dim); font-weight: 600; font-size: 12.5px; }

.li { display: flex; gap: 11px; align-items: center; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 11px 0; text-align: left; min-width: 0; }
.li:last-child { border-bottom: 0; }
.li .m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.li .name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .t { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.v { font-weight: 600; font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chev { color: var(--dim); flex: none; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.dot.bad { background: var(--red); } .dot.warn { background: var(--amber); } .dot.off { background: var(--dim); }
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--green); }

.kv { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--dim); font-size: 13px; flex: none; }
.kv > span:last-child { text-align: right; font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; min-width: 0; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--soft); overflow-wrap: anywhere; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--dim); }
.method { color: inherit; font: inherit; cursor: pointer; }
.field .method { border: 1px solid var(--line); background: var(--inset); border-radius: 10px; padding: 10px 13px; }
.method-ico { width: 32px; height: 32px; border-radius: 50%; flex: none; object-fit: contain; }
.copy-row { display: flex; align-items: center; gap: 10px; background: var(--inset); border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 13px; }
.copy-row .mono { flex: 1; min-width: 0; font-size: 14px; color: inherit; }
.copy-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px; background: #fff; cursor: pointer; }
.copy-btn svg { width: 21px; height: 21px; fill: none; stroke: #04060a; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); background: var(--inset); border-radius: 10px; padding: 12px 13px; font-size: 16px; font-weight: 500; min-width: 0; }
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--line-strong); outline: none; }
.field input::placeholder, .field textarea::placeholder { color: var(--dim); font-weight: 400; }
.file-info { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--inset); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.file-info .t { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }

/* Экран загрузки */
.splash { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; background: var(--page); transition: opacity .3s ease; }
.splash.out { opacity: 0; pointer-events: none; }
.splash-name { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 26px; line-height: 1; letter-spacing: .02em; }
.splash-name .coin { width: 26px; height: 26px; }
/* Подпись внизу, как в играх */
.splash-by { position: absolute; left: 0; right: 0; bottom: calc(26px + var(--safe-bottom)); display: flex; align-items: baseline; justify-content: center; gap: 5px; font-weight: 500; font-size: 11px; line-height: 1; color: var(--dim); }
.splash-by .pr1me { display: block; height: 7.7px; width: 49.5px; overflow: visible; color: var(--dim); }
.loader { position: relative; width: min(200px, 56vw); height: 2px; border-radius: 2px; overflow: hidden; background: var(--line); }
.loader i { position: absolute; inset: 0; border-radius: 2px; background: var(--fg); transform-origin: left center; animation: load 1.3s cubic-bezier(.65, 0, .35, 1) infinite; }
@keyframes load { 0% { transform: scaleX(0); opacity: 1; } 80% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
.loading, .empty { color: var(--dim); padding: 40px 18px; text-align: center; font-size: 13px; }
.gate { padding: 80px 26px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.gate p { margin: 0; color: var(--dim); max-width: 34ch; }

.sheet-wrap { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; z-index: 5; }
.sheet { width: 100%; background: var(--sheet); border-radius: 22px 22px 0 0; padding: 18px 16px calc(16px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 10px; max-height: 88%; overflow-y: auto; box-shadow: 0 -1px 0 var(--line); }
.sheet b.h { font-weight: 700; font-size: 20px; line-height: 1.2; overflow-wrap: anywhere; }
.sheet p { margin: 0; font-size: 13px; color: var(--dim); }
.toast { position: absolute; left: 14px; right: 14px; bottom: calc(68px + var(--safe-bottom)); background: var(--fg); color: var(--page); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; font-weight: 600; z-index: 6; }
.toast.bad { background: var(--red); color: #fff; }

/* Первый вход: слайды */
.onboarding { position: absolute; inset: 0; z-index: 4; isolation: isolate; overflow: hidden; background: var(--sky-shade), var(--sky) center top / cover no-repeat, var(--page); display: flex; flex-direction: column; }
.slides { flex: 1; min-height: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
/* Все слайды устроены одинаково: блок одной высоты, заголовок всегда на одной линии */
.slide { flex: none; width: 100%; scroll-snap-align: start; padding: calc(16px + var(--safe-top)) 20px 8px; display: flex; flex-direction: column; justify-content: flex-end; overflow-y: auto; }
.slide-text { flex: none; min-height: 128px; display: flex; flex-direction: column; gap: 8px; }
.slide p { margin: 0; color: var(--soft); font-size: 14px; }
.slide-foot { flex: none; padding: 14px 20px calc(16px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.skip { min-height: 18px; }
.dots { display: flex; gap: 7px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.dots i.on { background: var(--fg); width: 18px; border-radius: 3px; }
.demo { flex: none; height: 240px; margin-bottom: 18px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.demo > .tg { height: 100%; display: flex; flex-direction: column; }
.demo > .tg .tg-feed { flex: 1; justify-content: center; }
.demo.block { padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--card-shadow); }
.demo.block .demo-field, .demo.block .demo-nums div { background: var(--inset); border-color: var(--line); box-shadow: none; }
.demo-field { background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--card-shadow); border-radius: 12px; padding: 10px 13px; font-weight: 600; font-size: 13.5px; }
.demo-field i { display: block; font-style: normal; font-size: 11px; font-weight: 600; color: var(--dim); margin-bottom: 2px; }
.demo-btn { text-align: center; background: var(--btn); color: var(--btn-fg); box-shadow: var(--btn-shadow); border-radius: 12px; padding: 13px; font-weight: 700; font-size: 14px; }
.demo-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.demo-nums div { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--card-shadow); border-radius: 12px; padding: 12px 13px; }
.demo-nums b { font-weight: 700; font-size: 22px; line-height: 1.2; }
.demo-nums span { font-size: 12px; color: var(--dim); }
.demo-bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.demo-bar i { display: block; width: 60%; height: 100%; background: var(--green); }

/* Как это выглядит у получателя: чат Telegram */
.tg { border-radius: 16px; overflow: hidden; background: var(--chat); border: 1px solid var(--line); box-shadow: var(--card-shadow); }
.tg-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--bubble); }
.tg-ava { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--tg-blue); display: flex; align-items: center; justify-content: center; }
.tg-ava svg { width: 21px; height: 21px; fill: #fff; margin-left: -2px; }
.tg-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tg-name b { display: inline-flex; align-items: center; gap: 4px; font-size: 14.5px; font-weight: 600; }
.tg-name span { font-size: 12px; color: var(--dim); }
.tg-check { width: 15px; height: 15px; fill: var(--tg-blue); flex: none; }
.tg-check .c { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tg-feed { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.tg-pill { align-self: center; padding: 2px 10px; border-radius: 11px; background: var(--pill); color: #fff; font-size: 12px; font-weight: 500; }
.tg-msg { position: relative; align-self: flex-start; width: 88%; background: var(--bubble); border-radius: 14px 14px 14px 4px; padding: 9px 11px 6px; display: flex; flex-direction: column; gap: 3px; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.tg-msg::before { content: ""; position: absolute; left: -6px; bottom: 0; width: 10px; height: 12px; background: var(--bubble); clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.tg-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tg-top b { font-weight: 700; font-size: 20px; line-height: 1.2; }
.tg-top i { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--green); }
.tg-from { font-size: 11.5px; color: var(--dim); }
.tg-text { margin-top: 3px; font-size: 14px; line-height: 1.35; }
.tg-time { align-self: flex-end; font-size: 11px; color: var(--dim); }

@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: up .2s ease-out; }
  @keyframes up { from { transform: translateY(24px); } to { transform: none; } }
}
