/* ==========================================================================
   Magnus Boost — Telegram Mini App
   Дизайн-система: SMM-панель (мобайл-фёрст, две темы)
   ========================================================================== */

:root {
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --dock-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tap: 44px;
}

body[data-theme="dark"] {
  --bg: #080a10;
  --bg-soft: #0d1018;
  --surface: #12161f;
  --surface-2: #191e2a;
  --surface-3: #212734;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --ink: #eef1f7;
  --ink-2: #a3abc0;
  --ink-3: #6f7891;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-ink: #ffffff;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --bad: #fb7185;
  --bad-soft: rgba(251, 113, 133, 0.14);
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.9);
  --glow: 0 0 0 1px rgba(124, 92, 255, 0.35), 0 12px 30px -14px rgba(124, 92, 255, 0.6);
  --skeleton: linear-gradient(90deg, #171b26 25%, #222836 50%, #171b26 75%);
}

body[data-theme="coffee"] {
  --bg: #f3eee5;
  --bg-soft: #efe8dc;
  --surface: #fffdf8;
  --surface-2: #f8f2e8;
  --surface-3: #f0e7d8;
  --border: rgba(66, 48, 28, 0.12);
  --border-strong: rgba(66, 48, 28, 0.22);
  --ink: #241c12;
  --ink-2: #6d6151;
  --ink-3: #94886f;
  --accent: #8b4b23;
  --accent-2: #c8873c;
  --accent-ink: #fffaf2;
  --accent-soft: rgba(139, 75, 35, 0.12);
  --ok: #1f8a5b;
  --ok-soft: rgba(31, 138, 91, 0.12);
  --warn: #a9700c;
  --warn-soft: rgba(169, 112, 12, 0.14);
  --bad: #b3372f;
  --bad-soft: rgba(179, 55, 47, 0.12);
  --shadow: 0 16px 36px -24px rgba(70, 50, 25, 0.5);
  --glow: 0 0 0 1px rgba(139, 75, 35, 0.28), 0 12px 26px -16px rgba(139, 75, 35, 0.5);
  --skeleton: linear-gradient(90deg, #f0e8dc 25%, #f8f3ea 50%, #f0e8dc 75%);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* ── Boot ─────────────────────────────────────────────────────────────── */

.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: var(--bg);
  z-index: 90;
  padding: 24px;
  text-align: center;
}

/* Telegram WebView иногда игнорирует UA-стиль [hidden] —
   без !important splash остаётся поверх уже загруженного приложения */
.boot[hidden],
.app[hidden],
.toast[hidden],
[hidden] {
  display: none !important;
}

.boot__mark {
  width: 104px;
  height: 104px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  animation: pulse 1.6s ease-in-out infinite;
}

.boot__mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.boot__text {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.boot__btn {
  margin-top: 8px;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.93); opacity: 0.75; }
}

/* ── Layout ───────────────────────────────────────────────────────────── */

.app {
  min-height: 100vh;
  padding-bottom: calc(var(--dock-h) + var(--safe-b) + 12px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + var(--safe-t)) 14px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar__back {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 11px;
  display: none;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink);
}

.topbar__back.is-on {
  display: grid;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1;
  margin: 0;
  padding: 4px 6px 4px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}

.topbar__brand:active {
  opacity: 0.72;
  transform: scale(0.98);
}

.topbar__mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: visible;
  background: transparent;
}

.topbar__mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.topbar__titles {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar__name {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__sub {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  text-transform: lowercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.balance-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink);
  white-space: nowrap;
}

.balance-chip__val {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
}

.balance-chip__plus {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  color: var(--accent-ink);
  border: 0;
  background-color: var(--accent);
  background-image: linear-gradient(135deg, var(--accent), var(--accent-2));
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.view {
  padding: 16px 14px 24px;
  max-width: 760px;
  margin: 0 auto;
  animation: fade 0.18s ease;
}

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ── Dock ─────────────────────────────────────────────────────────────── */

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px 6px calc(8px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
}

.dock__btn {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 6px 2px;
  border-radius: var(--r-md);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}

.dock__btn svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dock__btn.is-active {
  color: var(--ink);
  background: var(--accent-soft);
}

.dock__btn.is-active svg {
  stroke: var(--accent-2);
}

/* ── Typography / sections ────────────────────────────────────────────── */

.kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 25px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}

.section {
  margin-top: 22px;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.section__meta {
  font-size: 12px;
  color: var(--ink-3);
}

.section__link {
  font-size: 13px;
  color: var(--accent-2);
  font-weight: 500;
}

.crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--ink-3);
}

.crumb button {
  color: var(--ink-2);
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumb em {
  font-style: normal;
  color: var(--ink);
  font-weight: 500;
  max-width: 52vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Cards ────────────────────────────────────────────────────────────── */

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

.card + .card {
  margin-top: 12px;
}

.wallet {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 18px;
  color: #fff;
  background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 45%, #0e7490 100%);
  box-shadow: 0 22px 44px -26px rgba(76, 29, 149, 0.9);
}

body[data-theme="coffee"] .wallet {
  background: linear-gradient(135deg, #6b3a1a 0%, #8b4b23 45%, #c8873c 100%);
  box-shadow: 0 20px 40px -26px rgba(107, 58, 26, 0.7);
}

.wallet::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.wallet__label {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.75;
}

.wallet__sum {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.wallet__hint {
  margin: 6px 0 14px;
  font-size: 13px;
  opacity: 0.85;
}

.wallet__row {
  position: relative;
  display: flex;
  gap: 8px;
}

.wallet__btn {
  flex: 1;
  height: 42px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
}

.wallet__btn--solid {
  background: #fff;
  color: #251a4d;
  border-color: #fff;
}

body[data-theme="coffee"] .wallet__btn--solid {
  color: #5b2f12;
}

/* ── Stats ────────────────────────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.spend-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  padding: 14px 14px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.spend-card__k {
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.spend-card__v {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.row--static {
  cursor: default;
  pointer-events: none;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 10px;
  text-align: left;
}

.stat__v {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
}

.stat__k {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-3);
}

.stat--ok .stat__v { color: var(--ok); }
.stat--warn .stat__v { color: var(--warn); }
.stat--bad .stat__v { color: var(--bad); }

/* ── Action tiles ─────────────────────────────────────────────────────── */

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

/* Главная: две строки по 3 */
.tiles--home {
  grid-template-columns: repeat(3, 1fr);
}

.tile {
  display: grid;
  gap: 4px;
  padding: 14px;
  min-height: 92px;
  align-content: start;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  transition: transform 0.12s, border-color 0.15s;
}

.tile:active {
  transform: scale(0.98);
}

.tile__ico {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  margin-bottom: 4px;
}

.tile__ico svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent-2);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile__label {
  font-weight: 600;
  font-size: 14px;
}

.tile__hint {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.3;
}

.tile--wide {
  grid-column: span 2;
  min-height: 0;
}

.tile--accent {
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
  border-color: var(--border-strong);
}

/* ── Lists / rows ─────────────────────────────────────────────────────── */

.list {
  display: grid;
  gap: 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  min-height: var(--tap);
  transition: border-color 0.15s, transform 0.12s;
}

.row:active {
  transform: scale(0.995);
  border-color: var(--border-strong);
}

.row__badge {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  overflow: hidden;
}

.row__body {
  flex: 1;
  min-width: 0;
}

.row__title {
  font-size: 14.5px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.row__meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

.row__chev {
  color: var(--ink-3);
  font-size: 20px;
  line-height: 1;
  flex: 0 0 auto;
}

.net-ico svg {
  width: 22px;
  height: 22px;
  display: block;
}

.grid-nets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.net-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  min-height: 60px;
}

.net-card__name {
  font-weight: 500;
  font-size: 14px;
}

.net-card__sub {
  font-size: 11px;
  color: var(--ink-3);
}

/* ── Service item ─────────────────────────────────────────────────────── */

.svc {
  display: flex;
  gap: 11px;
  width: 100%;
  padding: 13px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
}

.svc:active {
  border-color: var(--border-strong);
}

.svc__ico {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
}

.svc__body {
  flex: 1;
  min-width: 0;
}

.svc__name {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.svc__tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
}

.svc__meta {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.price-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-3);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge--hot { background: var(--warn-soft); color: var(--warn); }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }
.badge--accent { background: var(--accent-soft); color: var(--accent-2); }
.badge--mute { background: var(--surface-3); color: var(--ink-2); }

mark.hl,
.hl {
  background: color-mix(in oklab, var(--accent) 28%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 650;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ── Search / chips ───────────────────────────────────────────────────── */

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  stroke: var(--ink-3);
  fill: none;
  stroke-width: 1.9;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  outline: none;
  font-size: 15px;
}

.search input::placeholder {
  color: var(--ink-3);
}

.search__clear {
  color: var(--ink-3);
  font-size: 18px;
  padding: 0 2px;
}

.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.chips--wrap {
  flex-wrap: wrap;
  overflow: visible;
}

.chip {
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}


.chip__hot {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #1a1200;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.chip.is-on {
  color: var(--accent-ink);
  border: 1px solid transparent;
  background-color: var(--accent);
  background-image: linear-gradient(135deg, var(--accent), var(--accent-2));
  background-origin: border-box;
  background-clip: border-box;
  background-repeat: no-repeat;
}

.chip__n {
  opacity: 0.7;
  font-size: 11px;
  margin-left: 3px;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: var(--r-md);
  font-size: 14.5px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink);
  transition: transform 0.12s, opacity 0.15s;
}

.btn:active { transform: scale(0.98); }

.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.btn--primary {
  border: 1px solid transparent;
  color: var(--accent-ink);
  background-color: var(--accent);
  background-image: linear-gradient(135deg, var(--accent), var(--accent-2));
  background-origin: border-box;
  background-clip: border-box;
  background-repeat: no-repeat;
  box-shadow: var(--glow);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--ink-2);
}

.btn--danger {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: transparent;
}

.btn--block {
  width: 100%;
}

.btn--sm {
  min-height: 36px;
  padding: 0 13px;
  font-size: 13px;
  border-radius: 11px;
}

.btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.stack {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.stack--row {
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

/* ── Forms ────────────────────────────────────────────────────────────── */

.field {
  margin-bottom: 13px;
}

.field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 11px 13px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  outline: none;
  font-size: 15px;
  transition: border-color 0.15s, background 0.15s;
  appearance: none;
}

.field textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.45;
  font-family: var(--font-ui);
}
.field textarea#bulkListText {
  min-height: 180px;
}

.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.field__hint {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.35;
}

.field__err {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--bad);
}

.field.is-bad input,
.field.is-bad select,
.field.is-bad textarea {
  border-color: var(--bad);
}

.split {
  display: flex;
  gap: 8px;
}

.split > input {
  flex: 1;
  min-width: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ── Methods ──────────────────────────────────────────────────────────── */

.methods {
  display: grid;
  gap: 8px;
}

.method {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
}

.method.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.method__radio {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: grid;
  place-items: center;
}

.method.is-on .method__radio {
  border-color: var(--accent);
}

.method.is-on .method__radio::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.method__name {
  font-size: 14px;
  font-weight: 500;
}

.method__fee {
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ── Meta grid / detail ───────────────────────────────────────────────── */

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.meta-item {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.meta-item__k {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 2px;
}

.meta-item__v {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.svc-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.28;
}

.desc {
  margin: 10px 0 0;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.desc--clamp {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.desc.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.btn-desc-more {
  display: inline-block;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.btn-desc-more:active {
  opacity: 0.75;
}

.link-out {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--accent-2);
}

/* ── Order bar (sticky) ───────────────────────────────────────────────── */

.orderbar {
  position: sticky;
  bottom: calc(var(--dock-h) + var(--safe-b));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}

.orderbar__cost {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.1;
}

.orderbar__sub {
  font-size: 11.5px;
  color: var(--ink-3);
}

.orderbar__sub.is-bad {
  color: var(--bad);
}

.orderbar .btn {
  flex: 0 0 auto;
  margin-left: auto;
}

/* ── Insufficient funds banner ────────────────────────────────────────── */

.funds-warn {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}

.funds-warn[hidden] {
  display: none !important;
}

.funds-warn__ico {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: #1a1200;
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}

.funds-warn__body {
  flex: 1 1 auto;
  min-width: 0;
}

.funds-warn__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.funds-warn__meta {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-3);
}

.funds-warn__miss {
  color: var(--warn);
  font-weight: 700;
}

.funds-warn__sep {
  margin: 0 0.2em;
  opacity: 0.55;
}

.funds-warn__hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--ink-4, var(--ink-3));
  opacity: 0.85;
}

.funds-warn__btn {
  flex: 0 0 auto;
  white-space: nowrap;
  border-color: color-mix(in srgb, var(--accent) 70%, transparent) !important;
  color: var(--ink);
  background: transparent;
  font-size: 12.5px;
  padding: 8px 12px;
}

@media (max-width: 420px) {
  .funds-warn {
    flex-wrap: wrap;
  }

  .funds-warn__btn {
    width: 100%;
    margin-left: 40px;
  }
}

/* ── Orders ───────────────────────────────────────────────────────────── */

.order-card {
  display: flex;
  gap: 11px;
  width: 100%;
  padding: 13px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
}

.order-card__ico {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
}

.order-card__mark {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--surface);
}

.order-card__mark--ok { background: var(--ok); }
.order-card__mark--warn { background: var(--warn); }
.order-card__mark--bad { background: var(--bad); }

.order-card__body {
  flex: 1;
  min-width: 0;
}

.order-card__top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.order-card__title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.order-card__cost {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.order-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.progress {
  margin-top: 8px;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  border-radius: 999px;
  background-color: var(--accent);
  background-image: linear-gradient(90deg, var(--accent), var(--accent-2));
  background-repeat: no-repeat;
  transition: width 0.4s ease;
}

.progress__bar--ok { background: var(--ok); }
.progress__bar--bad { background: var(--bad); }

.st-ok { color: var(--ok); }
.st-warn { color: var(--warn); }
.st-bad { color: var(--bad); }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pager__page {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--border);
}

.pager__page.is-on {
  color: var(--accent-ink);
  border: 1px solid transparent;
  background-color: var(--accent);
  background-image: linear-gradient(135deg, var(--accent), var(--accent-2));
  background-origin: border-box;
  background-clip: border-box;
  background-repeat: no-repeat;
}

.pager__ellipsis {
  color: var(--ink-3);
  padding: 0 2px;
}

.pager__meta {
  text-align: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-3);
}

/* ── Steps (wizard) ───────────────────────────────────────────────────── */

.steps {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.step {
  flex: 1;
  display: grid;
  gap: 5px;
  justify-items: center;
  font-size: 10.5px;
  color: var(--ink-3);
  text-align: center;
}

.step__dot {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-3);
}

.step.is-done .step__dot { background: var(--ok); }
.step.is-on .step__dot {
  background-color: var(--accent);
  background-image: linear-gradient(90deg, var(--accent), var(--accent-2));
  background-origin: border-box;
  background-clip: border-box;
}
.step.is-on { color: var(--ink); font-weight: 600; }

/* ── Analysis progress ────────────────────────────────────────────────── */

.analyzing {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 30px 18px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.analyzing__stage {
  font-weight: 600;
}

.analyzing__meta {
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ── Preview table ────────────────────────────────────────────────────── */

.preview {
  margin-top: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  overflow: hidden;
}

.preview__head,
.preview__row {
  display: grid;
  grid-template-columns: 30px 1fr 74px;
  gap: 8px;
  padding: 9px 11px;
  font-size: 12px;
  align-items: center;
}

.preview__head {
  background: var(--surface-3);
  color: var(--ink-3);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.preview__row {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.preview__link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}

.preview__qty {
  text-align: right;
  font-weight: 600;
  font-family: var(--font-display);
}

.preview__more {
  padding: 9px 11px;
  font-size: 11.5px;
  color: var(--ink-3);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  text-align: center;
}

.spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 46px;
  margin-top: 12px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.spark__bar {
  flex: 1;
  min-width: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  opacity: 0.85;
}

/* ── Summary rows ─────────────────────────────────────────────────────── */

.sum {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.sum__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
}

.sum__row span:first-child {
  color: var(--ink-3);
}

.sum__row strong {
  font-family: var(--font-display);
  font-weight: 600;
}

.sum__row--total {
  padding-top: 9px;
  border-top: 1px solid var(--border);
  font-size: 15px;
}

.note {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  line-height: 1.45;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-2);
}

.note--warn {
  background: var(--warn-soft);
  border-color: transparent;
  color: var(--warn);
}

.note--bad {
  background: var(--bad-soft);
  border-color: transparent;
  color: var(--bad);
}

.note--ok {
  background: var(--ok-soft);
  border-color: transparent;
  color: var(--ok);
}

/* ── Автопросмотры ────────────────────────────────────────────────────── */

.row.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.vs-how {
  display: grid;
  gap: 10px;
}

.vs-how__row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
}

.vs-how__n {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-2);
}

.vs-danger {
  color: var(--bad);
}

.vs-react {
  margin: 4px 0 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.vs-react.is-on {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: linear-gradient(135deg, var(--accent-soft), transparent 75%), var(--surface-2);
}
.vs-react__head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.vs-react__emoji {
  flex: none;
  font-size: 15px;
  letter-spacing: -3px;
  filter: saturate(0.6);
  transition: filter 0.2s ease;
}
.vs-react.is-on .vs-react__emoji {
  filter: none;
}
.vs-react__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.vs-react__title {
  font-weight: 600;
  color: var(--ink);
}
.vs-react__sub {
  font-size: 12px;
  color: var(--ink-2);
}
.vs-react__opts {
  padding: 0 14px 12px;
}
.vs-react__opts .field__hint {
  margin-top: 8px;
}
.vs-range {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.vs-range__box {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: text;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.vs-range__box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.vs-range__box span {
  flex: none;
  font-size: 12px;
  color: var(--ink-3);
}
.vs-range__box input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  appearance: textfield;
  -moz-appearance: textfield;
}
.vs-range__box input::placeholder {
  font-weight: 400;
  color: var(--ink-3);
}
.vs-range__box input::-webkit-outer-spin-button,
.vs-range__box input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.vs-range__dash {
  flex: none;
  color: var(--ink-3);
}
.vs-range__unit {
  flex: none;
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}
@media (max-width: 360px) {
  .vs-range__unit {
    display: none;
  }
}
.vs-switch {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  transition: background-color 0.2s ease;
}
.vs-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink-2);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s ease;
}
.vs-switch.is-on {
  background: var(--accent);
  border-color: transparent;
}
.vs-switch.is-on::after {
  transform: translateX(16px);
  background: var(--accent-ink);
}

/* ── Copy field / addresses ───────────────────────────────────────────── */

.copy-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.copy-box code {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.addr {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.addr__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
}

.addr__amt {
  font-size: 12.5px;
  color: var(--ok);
  margin-bottom: 7px;
}

#directTimerBadge {
  font-variant-numeric: tabular-nums;
  min-width: 4.5em;
  text-align: center;
}

/* ── FAQ ──────────────────────────────────────────────────────────────── */

.faq {
  display: grid;
  gap: 8px;
}

.faq__item {
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
}

.faq__q span:last-child {
  color: var(--ink-3);
  flex: 0 0 auto;
}

.faq__a {
  padding: 0 14px 13px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* ── Toast / states ───────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(var(--dock-h) + var(--safe-b) + 14px);
  z-index: 80;
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  text-align: center;
  animation: toastIn 0.2s ease;
  max-width: 480px;
  margin: 0 auto;
}

.toast--ok { border-color: var(--ok); }
.toast--bad { border-color: var(--bad); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 42px 18px;
  text-align: center;
}

.empty__ico {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 22px;
  margin-bottom: 4px;
}

.empty__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.empty__text {
  margin: 0;
  max-width: 300px;
  font-size: 13.5px;
  color: var(--ink-3);
}

.skeleton {
  height: 62px;
  border-radius: var(--r-md);
  background: var(--skeleton);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.skeleton--sm { height: 34px; }
.skeleton--lg { height: 120px; }

.loading {
  display: grid;
  gap: 9px;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ── Desktop table (широкие экраны) ───────────────────────────────────── */

.table-wrap {
  display: none;
}

@media (min-width: 720px) {
  .view { padding: 20px 20px 28px; }
  .tiles:not(.tiles--home) { grid-template-columns: repeat(4, 1fr); }
  .tile--wide { grid-column: span 2; }
  .grid-nets { grid-template-columns: repeat(3, 1fr); }
  .table-wrap {
    display: block;
    overflow-x: auto;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    background: var(--surface);
  }
  .otable {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
  }
  .otable th {
    text-align: left;
    padding: 10px 12px;
    background: var(--surface-3);
    color: var(--ink-3);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }
  .otable td {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    vertical-align: middle;
  }
  .otable tr:hover td { background: var(--surface-2); }
  .otable .id-cell button {
    color: var(--accent-2);
    font-weight: 600;
  }
  .otable .svc-cell {
    display: flex;
    align-items: center;
    gap: 7px;
    max-width: 260px;
  }
  .otable .svc-cell span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .otable .act-cell button {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--ink-2);
  }
}
