/* РиэлтораНЕТ — дизайн-система. Без фреймворков, без сборки. */

:root {
  --brand: #00c2ea;
  --brand-600: #00a6c9;
  --brand-700: #00819d;
  --brand-50: #e6f9fd;
  --brand-100: #c9f1fa;
  --ink: #1d262e;
  --ink-2: #3a4650;
  --muted: #66737f;
  --line: #e2e9ef;
  --bg: #f4f7f9;
  --surface: #ffffff;
  --dark: #121a21;

  --st-new: #0a9bbd;   --st-new-bg: #e3f7fc;
  --st-progress: #c27803; --st-progress-bg: #fff4dc;
  --st-done: #14833b;  --st-done-bg: #e2f6e8;
  --st-rejected: #6b7785; --st-rejected-bg: #eef1f4;
  --danger: #d23b3b;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 48, .06);
  --shadow: 0 1px 2px rgba(16, 32, 48, .04), 0 8px 24px -8px rgba(16, 32, 48, .12);
  --shadow-lg: 0 24px 60px -20px rgba(0, 80, 110, .35);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.15; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.25rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.25em; }
.icon--fill { fill: currentColor; stroke: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.section { padding: clamp(56px, 9vw, 112px) 0; }
.section--tight { padding: clamp(40px, 6vw, 72px) 0; }
.section__head { max-width: 680px; margin-bottom: clamp(28px, 4vw, 48px); }
.section__head--center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--brand-700); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-2); }
.grid { display: grid; gap: 20px; }
@media (min-width: 720px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } .grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .grid--4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 560px) and (max-width: 999px) { .grid--4 { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Buttons ---------- */
.btn {
  --_bg: var(--surface); --_fg: var(--ink); --_bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 1.5px solid var(--_bd);
  background: var(--_bg); color: var(--_fg); font: inherit; font-weight: 700; font-size: 1rem;
  cursor: pointer; text-align: center; line-height: 1.2; white-space: nowrap;
  transition: transform .15s var(--ease), background-color .2s, box-shadow .2s, border-color .2s;
}
.btn:hover { color: var(--_fg); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn--primary { --_bg: var(--brand); --_fg: #fff; --_bd: var(--brand); box-shadow: 0 8px 20px -8px rgba(0, 166, 201, .7); }
.btn--primary:hover { --_bg: var(--brand-600); --_bd: var(--brand-600); box-shadow: 0 12px 24px -10px rgba(0, 166, 201, .8); }
.btn--dark { --_bg: var(--ink); --_fg: #fff; --_bd: var(--ink); }
.btn--ghost { --_bg: transparent; --_bd: transparent; }
.btn--ghost:hover { --_bg: rgba(0, 0, 0, .04); box-shadow: none; }
.btn--light { --_bg: var(--brand-50); --_fg: var(--brand-700); --_bd: var(--brand-50); }
.btn--tg { --_bg: #229ed9; --_fg: #fff; --_bd: #229ed9; }
.btn--lg { min-height: 58px; padding: 16px 30px; font-size: 1.075rem; }
.btn--sm { min-height: 38px; padding: 8px 14px; font-size: .9rem; }
.btn--block { width: 100%; }
.btn--icon { width: 44px; min-height: 44px; padding: 0; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- Cards & badges ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow-sm); }
.card--hover { transition: transform .25s var(--ease), box-shadow .25s; }
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card__title h2, .card__title h3 { margin: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; white-space: nowrap; background: var(--st-new-bg); color: var(--st-new);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--new { background: var(--st-new-bg); color: var(--st-new); }
.badge--progress { background: var(--st-progress-bg); color: var(--st-progress); }
.badge--done { background: var(--st-done-bg); color: var(--st-done); }
.badge--rejected { background: var(--st-rejected-bg); color: var(--st-rejected); }
.badge--plain::before { display: none; }

.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(244, 247, 249, .82); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); transition: box-shadow .2s, background-color .2s; }
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--line); background: rgba(255, 255, 255, .9); }
.site-header__inner { height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.logo { display: inline-flex; align-items: center; }
.logo img { height: 30px; width: auto; }
.site-nav { display: none; gap: 4px; margin-left: auto; }
.site-nav a { padding: 8px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: .95rem; }
.site-nav a:hover { background: rgba(0, 0, 0, .04); color: var(--ink); }
.site-header__cta { margin-left: auto; display: flex; gap: 8px; }
@media (min-width: 900px) { .site-nav { display: flex; } .site-header__cta { margin-left: 8px; } }
@media (max-width: 480px) { .site-header__cta .btn--light { display: none; } .logo img { height: 26px; } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(32px, 6vw, 72px) 0 clamp(56px, 8vw, 96px); }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70vw; max-width: 900px; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(0, 194, 234, .22), rgba(0, 194, 234, 0)); z-index: -1;
}
.hero__grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero__grid { grid-template-columns: 1.1fr .9fr; } }
.hero h1 { margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--brand-600); position: relative; white-space: nowrap; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 28px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 10px; }
.hero__art { position: relative; aspect-ratio: 1; max-width: 520px; margin: 0 auto; width: 100%; }
.hero__art .blob { position: absolute; inset: 8%; border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%; background: linear-gradient(145deg, #dff7fd, #bdeefa); animation: morph 14s ease-in-out infinite; }
.hero__art img { position: absolute; filter: drop-shadow(0 24px 30px rgba(0, 90, 120, .25)); }
.hero__art .a1 { width: 52%; left: 24%; top: 12%; animation: float 7s ease-in-out infinite; }
.hero__art .a2 { width: 30%; left: 2%; bottom: 10%; animation: float 8s ease-in-out -2s infinite; }
.hero__art .a3 { width: 28%; right: 2%; bottom: 16%; animation: float 9s ease-in-out -4s infinite; }
.float-card { position: absolute; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; border-radius: var(--r); box-shadow: var(--shadow-lg); font-weight: 700; font-size: .9rem; }
.float-card small { display: block; color: var(--muted); font-weight: 600; font-size: .75rem; }
.float-card .dot { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); }
.float-card--1 { top: 6%; right: 0; animation: float 6s ease-in-out -1s infinite; }
.float-card--2 { bottom: 0; left: 18%; animation: float 7s ease-in-out -3s infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes morph { 0%, 100% { border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%; } 50% { border-radius: 55% 45% 40% 60% / 55% 60% 40% 45%; } }

/* ---------- Feature / service cards ---------- */
.service { display: flex; flex-direction: column; gap: 10px; }
.service__img { width: 112px; height: 112px; margin: -8px 0 8px -8px; }
.service__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.tag { font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--bg); color: var(--ink-2); }

.steps { counter-reset: step; }
.step { position: relative; padding-top: 64px; }
.step::before {
  counter-increment: step; content: counter(step); position: absolute; top: 20px; left: clamp(20px, 3vw, 32px);
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 800;
}
.step h3 { margin-top: 8px; }

/* Dark band */
.band { background: var(--dark); color: #e9f2f6; border-radius: var(--r-xl); padding: clamp(28px, 5vw, 64px); position: relative; overflow: hidden; }
.band::after { content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 194, 234, .35), transparent); }
.band h2 { color: #fff; }
.band .muted { color: #9fb2bd; }
.band__grid { display: grid; gap: 32px; position: relative; z-index: 1; align-items: center; }
@media (min-width: 900px) { .band__grid { grid-template-columns: 1.2fr .8fr; } }
.checklist { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; }
.checklist .icon { color: var(--brand); margin-top: 2px; }

.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-big { padding: 20px; border-radius: var(--r); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); }
.stat-big b { display: block; font-size: clamp(1.6rem, 3vw, 2.2rem); color: #fff; letter-spacing: -.02em; }

/* ---------- News ---------- */
.news-track { display: grid; gap: 20px; }
@media (min-width: 720px) { .news-track { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 719px) {
  .news-track { grid-auto-flow: column; grid-auto-columns: 82%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin: 0 -20px; padding-inline: 20px; scrollbar-width: none; }
  .news-track::-webkit-scrollbar { display: none; }
  .news-track > * { scroll-snap-align: start; }
}
.news-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; color: inherit; }
.news-card:hover { color: inherit; }
.news-card__img { aspect-ratio: 16/10; background: var(--brand-50); overflow: hidden; }
.news-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.news-card:hover .news-card__img img { transform: scale(1.04); }
.news-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.news-card__body h3 { margin: 0; }
.news-card__more { margin-top: auto; padding-top: 8px; font-weight: 700; color: var(--brand-700); display: inline-flex; align-items: center; gap: 6px; }

.article { max-width: 760px; margin: 0 auto; }
.article__cover { border-radius: var(--r-lg); overflow: hidden; margin: 24px 0 32px; box-shadow: var(--shadow); }
.article__cover img { width: 100%; }
.prose { font-size: 1.075rem; color: var(--ink-2); }
.prose img { border-radius: var(--r); margin: 1em 0; }
.prose h1, .prose h2, .prose h3 { color: var(--ink); margin-top: 1.4em; }
.prose a { text-decoration: underline; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; }
.form-row { display: grid; gap: 18px; }
@media (min-width: 640px) { .form-row--2 { grid-template-columns: 1fr 1fr; } .form-row--3 { grid-template-columns: repeat(3, 1fr); } }
.field { display: grid; gap: 8px; }
.field > label, .field__label { font-weight: 700; font-size: .92rem; color: var(--ink-2); }
.field .req { color: var(--brand-700); }
.field input[type=text], .field input[type=tel], .field input[type=email], .field input[type=search], .field textarea, .field select, .input {
  width: 100%; min-height: 54px; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: #c8d4dd; }
.field input:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(0, 194, 234, .15); }
.field--error input, .field--error textarea { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: .85rem; font-weight: 600; }
.field__help { color: var(--muted); font-size: .85rem; }
.form-errors { padding: 12px 16px; border-radius: 12px; background: #fdecec; color: var(--danger); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; cursor: pointer; user-select: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; transition: all .15s var(--ease);
}
.chip span::before { content: ""; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid #b9c6d0; transition: all .15s; flex: none; }
.chip:hover span { border-color: #b9c6d0; }
.chip input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.chip input:checked + span::before { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--brand); }
.chip input:focus-visible + span { box-shadow: 0 0 0 4px rgba(0, 194, 234, .2); }

.toggle { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, background-color .15s; }
.toggle:hover { border-color: #c8d4dd; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__track { position: relative; width: 46px; height: 28px; border-radius: 999px; background: #d3dde5; flex: none; transition: background-color .2s; }
.toggle__track::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 var(--ease); }
.toggle input:checked ~ .toggle__track { background: var(--brand); }
.toggle input:checked ~ .toggle__track::after { transform: translateX(18px); }
.toggle:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.toggle__text b { display: block; }
.toggle__text small { color: var(--muted); }

.form-card { background: var(--surface); border-radius: var(--r-xl); padding: clamp(24px, 4vw, 48px); box-shadow: var(--shadow); border: 1px solid var(--line); }
.form-legal { font-size: .8rem; color: var(--muted); text-align: center; margin: 0; }

/* Copy field */
.copy { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); }
.copy input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: .92rem; color: var(--ink-2); padding: 8px 0; }
.copy input:focus { outline: none; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 100; left: 50%; top: 16px; transform: translateX(-50%); display: grid; gap: 10px; width: min(560px, calc(100% - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); animation: toast-in .35s var(--ease); font-weight: 600; }
.toast .icon { margin-top: 2px; }
.toast--success .icon { color: #5ee08a; }
.toast--error .icon, .toast--warning .icon { color: #ffb36b; }
.toast--info .icon { color: var(--brand); }
.toast__close { margin-left: auto; background: none; border: 0; color: #9fb2bd; cursor: pointer; padding: 0; }
.toast.is-hiding { animation: toast-out .3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-12px); } }

/* ---------- Dialog ---------- */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-xl); width: min(440px, calc(100% - 24px)); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.modal::backdrop { background: rgba(18, 26, 33, .55); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: toast-in .25s var(--ease); }
.modal__body { padding: 28px; text-align: center; }
.modal__qr { background: #fff; border-radius: var(--r); padding: 12px; border: 1px solid var(--line); margin: 16px auto 20px; max-width: 300px; }
.modal__qr img { width: 100%; image-rendering: pixelated; }
.modal__actions { display: grid; gap: 10px; }

/* ---------- Footer ---------- */
.site-footer { padding: 48px 0 40px; border-top: 1px solid var(--line); background: var(--surface); }
.site-footer__grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer nav a { color: var(--ink-2); font-weight: 600; }

.fab { position: fixed; z-index: 30; right: 20px; bottom: 20px; box-shadow: var(--shadow-lg); }
@media (max-width: 899px) { .has-tabbar .fab { bottom: 88px; } }

/* ---------- Simple pages (client flow, login) ---------- */
.simple { min-height: 100vh; display: flex; flex-direction: column; }
.simple__top { padding: 20px 0; }
.simple__main { flex: 1; padding: 8px 0 64px; }
.narrow { max-width: 640px; margin: 0 auto; }
.center { text-align: center; }
.agent-chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; }
.agent-chip img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

.cert { position: relative; border-radius: var(--r-xl); padding: clamp(28px, 5vw, 48px); color: #fff; overflow: hidden; background: linear-gradient(135deg, #00b4dc 0%, #0089a8 60%, #0b5d75 100%); box-shadow: var(--shadow-lg); }
.cert::before { content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; right: -140px; top: -160px; background: rgba(255, 255, 255, .12); }
.cert::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; left: -80px; bottom: -120px; background: rgba(255, 255, 255, .08); }
.cert > * { position: relative; z-index: 1; }
.cert__label { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; opacity: .85; font-weight: 700; }
.cert__code { font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 800; letter-spacing: .02em; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.cert__row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.cert__row .pill { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .22); color: #fff; }
.cert__gift { position: absolute; right: 18px; bottom: 10px; width: 120px; opacity: .95; }
@media (max-width: 520px) { .cert__gift { width: 84px; right: 8px; bottom: 6px; } }

.login-card { max-width: 440px; margin: 0 auto; text-align: center; }
.login-card__icon { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 20px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); }
.login-card__icon .icon { width: 36px; height: 36px; }
.tg-widget { min-height: 48px; display: flex; justify-content: center; margin: 24px 0 8px; }

/* ---------- Cabinet ---------- */
.app { display: grid; min-height: 100vh; }
@media (min-width: 900px) { .app { grid-template-columns: 264px 1fr; } }
.sidebar { display: none; }
@media (min-width: 900px) {
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 24px 16px; background: var(--surface); border-right: 1px solid var(--line); }
}
.sidebar .logo { padding: 4px 12px 28px; }
.sidebar nav { display: grid; gap: 4px; }
.navlink { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--ink-2); font-weight: 600; border: 0; background: none; font: inherit; cursor: pointer; width: 100%; text-align: left; }
.navlink:hover { background: var(--bg); color: var(--ink); }
.navlink.is-active { background: var(--brand-50); color: var(--brand-700); }
.navlink.is-active .icon { color: var(--brand-600); }
.sidebar__bottom { margin-top: auto; display: grid; gap: 4px; }
.me { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); background: var(--bg); margin-bottom: 8px; }
.me img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.me b { display: block; font-size: .95rem; line-height: 1.2; }
.me small { color: var(--muted); }

.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 16px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .logo img { height: 26px; }
.topbar__right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.topbar__avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
@media (min-width: 900px) { .topbar { display: none; } }

.tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .95); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.tabbar a .icon { width: 24px; height: 24px; }
.tabbar a.is-active { color: var(--brand-700); }
@media (min-width: 900px) { .tabbar { display: none; } }

.main { min-width: 0; padding: 24px 16px 104px; }
@media (min-width: 900px) { .main { padding: 40px clamp(24px, 4vw, 56px) 64px; } }
.main__inner { max-width: 1120px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(1.6rem, 3vw, 2.25rem); margin: 0; }
.page-head p { margin: 6px 0 0; }

.balance { display: grid; gap: 12px; margin-bottom: 24px; grid-template-columns: 1fr 1fr; }
.balance .stat--hero { grid-column: 1 / -1; }
@media (max-width: 719px) { .balance .stat:not(.stat--hero) { padding: 16px; } .balance .stat__value { font-size: 1.4rem; } }
@media (min-width: 720px) { .balance { gap: 16px; grid-template-columns: 1.3fr 1fr 1fr; } .balance .stat--hero { grid-column: auto; } }
.stat { position: relative; padding: 22px 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.stat__label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.stat__value { font-size: clamp(1.7rem, 3vw, 2.25rem); font-weight: 800; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat--hero { background: linear-gradient(135deg, #00b4dc, #0089a8); color: #fff; border: 0; box-shadow: 0 16px 32px -16px rgba(0, 137, 168, .7); }
.stat--hero .stat__label { color: rgba(255, 255, 255, .85); }
.stat--hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.stat__hint { font-size: .8rem; opacity: .8; margin-top: 4px; }

.share-grid { display: grid; gap: 16px; margin-bottom: 24px; }
@media (min-width: 1000px) { .share-grid { grid-template-columns: 1fr 1fr; } }
.share { display: flex; flex-direction: column; gap: 14px; }
.share__head { display: flex; gap: 14px; align-items: flex-start; }
.share__head img { width: 56px; height: 56px; flex: none; margin: -4px 0; }
.share__head h3 { margin: 0 0 4px; }
.share__head p { margin: 0; color: var(--muted); font-size: .92rem; }
.share__actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 559px) {
  .share__actions .btn { flex-direction: column; gap: 4px; min-height: 64px; padding: 8px 4px; border-radius: 14px; font-size: .8rem; }
  .copy .btn span { display: none; }
  .copy .btn { width: 40px; padding: 0; }
}

.cols { display: grid; gap: 24px; }
.grid > *, .cols > *, .share-grid > *, .balance > * { min-width: 0; }
@media (min-width: 1100px) { .cols { grid-template-columns: 1.4fr 1fr; align-items: start; } }

.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; padding-bottom: 2px; }
.filters::-webkit-scrollbar { display: none; }
.filter { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font: inherit; font-size: .875rem; font-weight: 700; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.filter b { font-weight: 800; color: var(--muted); }
.filter.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter.is-active b { color: rgba(255, 255, 255, .7); }

.search { position: relative; margin-bottom: 12px; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; min-height: 46px; padding: 10px 14px 10px 42px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); font: inherit; }
.search input:focus { outline: none; border-color: var(--brand); background: #fff; }

.list { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--bg); transition: background-color .15s; }
.row:hover { background: #edf2f5; }
.row__avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; background: var(--brand-50); color: var(--brand-700); object-fit: cover; }
.row__main { min-width: 0; flex: 1; }
.row__title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__meta { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__side { text-align: right; display: grid; gap: 4px; justify-items: end; flex: none; }
.row__side small { color: var(--muted); font-size: .78rem; }

.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty img { width: 96px; margin: 0 auto 12px; opacity: .9; }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }

.welcome { display: grid; gap: 20px; align-items: center; margin-bottom: 24px; background: var(--dark); color: #dbe7ec; border: 0; }
.welcome h2 { color: #fff; font-size: 1.4rem; }
@media (min-width: 720px) { .welcome { grid-template-columns: auto 1fr auto; } }
.welcome img { width: 88px; }

.doc { display: grid; gap: 16px; }
.doc h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 10px; }
.doc h2 .num { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: .95rem; flex: none; }
.doc ul { padding-left: 1.2em; margin: 0 0 1em; }
.doc li { margin-bottom: 6px; }
.option { padding: 16px 18px; border-radius: var(--r); background: var(--bg); }
.option b { color: var(--brand-700); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
