/* ============================================================================
   VFF ULTIMA — Design System v1.0
   «Ultramarine & Copper» — тёплая премиум-эстетика без «детскости» и без
   холодного киберпанка. Пергаментно-тёплые поверхности, чернильный текст,
   ультрамариновый бренд, медный коммерческий акцент, шалфейный success.
   ---------------------------------------------------------------------------
   Порядок файла:
   1. Tokens (light / dark)
   2. Reset & base
   3. Layout (shell, topbar, screen, bottom nav)
   4. Primitives (card, btn, badge, progress, list, kv, avatar, inputs)
   5. Composites (hero card, device row, tariff, receipt, QR, sheet, toast)
   6. Utilities
   ========================================================================== */

/* ============================================================ 1. TOKENS === */
:root {
  /* --- Brand: Ultramarine --------------------------------------------- */
  --ultra-900: #0E1F44;
  --ultra-800: #16305F;
  --ultra-700: #1B3A78;
  --ultra-600: #21509E;
  --ultra-500: #2A62C4;
  --ultra-400: #4A7FDB;
  --ultra-300: #7FA5E8;
  --ultra-100: #E4EDFB;
  --ultra-50:  #F0F5FD;

  /* --- Accent: Copper (коммерческий акцент, «Ultima») ------------------ */
  --copper-700: #964F21;
  --copper-600: #B4632B;
  --copper-500: #C97A3D;
  --copper-400: #DC9A63;
  --copper-300: #EBB68C;
  --copper-100: #F8E7D8;
  --copper-50:  #FCF3EA;

  /* --- Semantic ------------------------------------------------------- */
  --sage-700: #255640;
  --sage-600: #2F6B4F;
  --sage-500: #3E8A62;
  --sage-400: #6FB68C;
  --sage-100: #DFF0E6;
  --amber-600: #A26A11;
  --amber-500: #C8891C;
  --amber-100: #FBEED2;
  --coral-600: #B4472F;
  --coral-500: #C9553B;
  --coral-100: #FAE3DD;

  /* --- Ink (текст) ---------------------------------------------------- */
  --ink-900: #101826;
  --ink-800: #182133;
  --ink-700: #1F2B40;
  --ink-600: #2E3A4E;
  --ink-500: #445066;
  --ink-400: #5C6880;
  --ink-300: #7E8AA0;
  --ink-200: #A7B0C0;
  --ink-100: #C9CFDA;

  /* --- Surfaces (тёплый пергамент, НЕ стерильный белый) --------------- */
  --bg:            #F8F5EE;
  --bg-wash-1:     rgba(42, 98, 196, 0.07);   /* ультрамариновая дымка  */
  --bg-wash-2:     rgba(201, 122, 61, 0.08);  /* медная дымка           */
  --bg-wash-3:     rgba(62, 138, 98, 0.06);   /* шалфейная дымка        */
  --surface:       #FFFFFF;
  --surface-2:     #FDFBF7;
  --surface-sunk:  #F2EEE4;
  --surface-ink:   linear-gradient(150deg, #1B2A44 0%, #101826 62%);
  --line:          #E9E3D6;
  --line-2:        #DED6C6;
  --line-strong:   #CFC5B1;

  /* --- Text roles ----------------------------------------------------- */
  --text:          var(--ink-900);
  --text-2:        var(--ink-500);
  --text-3:        var(--ink-300);
  --text-on-brand: #FFFFFF;
  --text-on-ink:   #F4F1EA;
  --text-on-ink-2: #A9B2C4;

  /* --- Radii ---------------------------------------------------------- */
  --r-xs: 10px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-2xl: 32px;
  --r-pill: 999px;

  /* --- Spacing -------------------------------------------------------- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px;

  /* --- Warm soft shadows (никогда холодный серый) --------------------- */
  --sh-xs:  0 1px 2px rgba(22, 28, 42, 0.05);
  --sh-sm:  0 1px 3px rgba(22, 28, 42, 0.05), 0 6px 14px -8px rgba(22, 28, 42, 0.10);
  --sh-md:  0 2px 6px rgba(22, 28, 42, 0.05), 0 14px 30px -14px rgba(22, 28, 42, 0.18);
  --sh-lg:  0 24px 54px -22px rgba(22, 28, 42, 0.28);
  --sh-ultra:  0 10px 26px -12px rgba(27, 58, 120, 0.55);
  --sh-copper: 0 10px 26px -12px rgba(150, 79, 33, 0.50);
  --ring:   0 0 0 3px rgba(42, 98, 196, 0.18);
  --ring-copper: 0 0 0 3px rgba(201, 122, 61, 0.20);

  /* --- Gradients ------------------------------------------------------ */
  --grad-brand:  linear-gradient(135deg, #2A62C4 0%, #1B3A78 100%);
  --grad-copper: linear-gradient(135deg, #DC9A63 0%, #B4632B 100%);
  --grad-ink:    linear-gradient(150deg, #1B2A44 0%, #101826 62%);
  --grad-mint:   linear-gradient(135deg, #6FB68C 0%, #2F6B4F 100%);

  /* --- Motion --------------------------------------------------------- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.42, 0.64, 1);
  --t-fast: 140ms;
  --t-mid:  240ms;
  --t-slow: 340ms;

  /* --- Typography ----------------------------------------------------- */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
               Consolas, monospace;

  /* --- Structural ----------------------------------------------------- */
  --nav-h: 68px;
  --max-w: 520px;
  color-scheme: light;
}

/* --- Dark theme: тёплая тёмная (не чистый чёрный, с пудровым подтоном) -- */
[data-theme="dark"] {
  --bg:            #14161C;
  --bg-wash-1:     rgba(74, 127, 219, 0.10);
  --bg-wash-2:     rgba(220, 154, 99, 0.10);
  --bg-wash-3:     rgba(111, 182, 140, 0.07);
  --surface:       #1B1E26;
  --surface-2:     #20242D;
  --surface-sunk:  #101218;
  --surface-ink:   linear-gradient(150deg, #232839 0%, #14161C 62%);
  --line:          #2A2F3A;
  --line-2:        #343A47;
  --line-strong:   #454C5C;

  --text:          #F2EFE8;
  --text-2:        #AEB6C4;
  --text-3:        #7C8496;
  --text-on-ink:   #F6F3EC;
  --text-on-ink-2: #A9B2C4;

  --ultra-500: #6E9BE8;
  --ultra-600: #4A7FDB;
  --ultra-700: #7FA5E8;
  --ultra-100: rgba(74, 127, 219, 0.16);
  --ultra-50:  rgba(74, 127, 219, 0.09);
  --copper-600: #E0A874;
  --copper-500: #DC9A63;
  --copper-300: #EBB68C;
  --copper-100: rgba(220, 154, 99, 0.16);
  --copper-50:  rgba(220, 154, 99, 0.08);
  --sage-600: #6FB68C;
  --sage-100: rgba(111, 182, 140, 0.16);
  --amber-500: #E0A93F;
  --amber-100: rgba(224, 169, 63, 0.16);
  --coral-500: #E0776A;
  --coral-100: rgba(224, 119, 106, 0.16);

  --sh-sm:  0 1px 3px rgba(0, 0, 0, 0.30), 0 6px 14px -8px rgba(0, 0, 0, 0.40);
  --sh-md:  0 2px 6px rgba(0, 0, 0, 0.30), 0 14px 30px -14px rgba(0, 0, 0, 0.55);
  --sh-lg:  0 24px 54px -22px rgba(0, 0, 0, 0.70);
  color-scheme: dark;
}

/* ====================================================== 2. RESET/BASE === */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
  transition: background var(--t-mid) var(--ease), color var(--t-mid) var(--ease);
}

/* Живая дымка на фоне приложения: три очень мягких пятна */
body::before {
  content: "";
  position: fixed;
  inset: -10% -10% auto -10%;
  height: 70vh;
  background:
    radial-gradient(46% 42% at 12% 8%,  var(--bg-wash-1) 0%, transparent 68%),
    radial-gradient(40% 38% at 92% 12%, var(--bg-wash-2) 0%, transparent 66%),
    radial-gradient(38% 34% at 50% 78%, var(--bg-wash-3) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
svg { display: block; flex: none; }

::selection { background: rgba(42, 98, 196, 0.18); }

/* Мягкий скроллбар (desktop) */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 999px; border: 2px solid transparent;
  background-clip: content-box;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ========================================================= 3. LAYOUT === */
#app { position: relative; z-index: 1; }

.shell {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* --- Topbar --------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: calc(var(--s-4) + env(safe-area-inset-top)) var(--s-4) var(--s-3);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-mid) var(--ease), background var(--t-mid) var(--ease);
}
.topbar.is-stuck { border-bottom-color: var(--line); }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 36px; height: 36px; flex: none;
  border-radius: 11px;
  background: var(--grad-brand);
  display: grid; place-items: center;
  box-shadow: var(--sh-ultra);
  color: #fff;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-size: 14.5px; font-weight: 700; letter-spacing: 0.01em;
  display: flex; align-items: center; gap: 5px;
}
.brand-sub {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-3);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }

/* --- Screen --------------------------------------------------------- */
.screen {
  flex: 1;
  padding: var(--s-5) var(--s-4) calc(var(--nav-h) + 34px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  animation: screen-in var(--t-slow) var(--ease) both;
}
.screen--flush { padding-top: var(--s-3); }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.page-title {
  display: flex; align-items: flex-end; gap: var(--s-3);
}
.page-title h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.page-title .sub { color: var(--text-3); font-size: 13.5px; margin-top: 3px; }

/* --- Bottom navigation ---------------------------------------------- */
.navbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.navbar-inner {
  width: 100%; max-width: var(--max-w);
  display: flex; align-items: stretch;
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  position: relative;
  color: var(--text-3);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em;
  transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.nav-item svg { transition: transform var(--t-mid) var(--ease-spring); }
.nav-item.active { color: var(--ultra-600); }
.nav-item.active svg { transform: translateY(-1px) scale(1.06); }
.nav-item:active { transform: scale(0.94); }
.nav-item .nav-dot {
  position: absolute; top: 8px; right: calc(50% - 16px);
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--copper-500);
  box-shadow: 0 0 0 2px var(--surface);
}
.nav-item .nav-active-mark {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 4px 4px;
  background: var(--grad-brand);
  opacity: 0; transition: opacity var(--t-mid) var(--ease);
}
.nav-item.active .nav-active-mark { opacity: 1; }

/* ===================================================== 4. PRIMITIVES === */
/* --- Card ------------------------------------------------------------ */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--sh-sm);
  transition: border-color var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease),
              transform var(--t-fast) var(--ease);
}
.card--tap { cursor: pointer; }
.card--tap:active { transform: scale(0.985); }
@media (hover: hover) {
  .card--tap:hover { box-shadow: var(--sh-md); border-color: var(--line-2); }
}
.card--flat { box-shadow: none; }
.card--sunk { background: var(--surface-sunk); box-shadow: none; }
.card--ink { background: var(--surface-ink); border-color: rgba(255,255,255,0.08); color: var(--text-on-ink); }
.card--brand { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: var(--sh-ultra); }
.card--copper { background: var(--grad-copper); border-color: transparent; color: #fff; box-shadow: var(--sh-copper); }
.card--pad-lg { padding: var(--s-5); }
.card--tint-ultra { background: var(--ultra-50); border-color: color-mix(in srgb, var(--ultra-500) 18%, transparent); }
.card--tint-copper { background: var(--copper-50); border-color: color-mix(in srgb, var(--copper-500) 20%, transparent); }
.card--tint-sage { background: var(--sage-100); border-color: color-mix(in srgb, var(--sage-500) 22%, transparent); }
.card--tint-coral { background: var(--coral-100); border-color: color-mix(in srgb, var(--coral-500) 22%, transparent); }

/* Секция */
.section { display: flex; flex-direction: column; gap: var(--s-3); }
.section-head { display: flex; align-items: center; gap: var(--s-3); padding: 0 2px; }
.section-head h2 { font-size: 16px; font-weight: 680; letter-spacing: -0.015em; }
.section-head .link { margin-left: auto; color: var(--ultra-600); font-size: 13px; font-weight: 600; }

.label {
  font-size: 11px; font-weight: 650; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--text-3);
}
.label--copper { color: var(--copper-600); }
.label--brand { color: var(--ultra-600); }
.card--ink .label, .card--brand .label, .card--copper .label { color: rgba(255,255,255,0.72); }

.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 13px; }
.xsmall { font-size: 11.5px; }
.strong { font-weight: 650; }
.row { display: flex; align-items: center; gap: var(--s-3); }
.row--between { justify-content: space-between; }
.row--top { align-items: flex-start; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Buttons --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 48px; padding: 0 var(--s-5);
  border-radius: var(--r-md);
  font-size: 15px; font-weight: 650; letter-spacing: -0.01em;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-mid) var(--ease),
              background var(--t-mid) var(--ease), color var(--t-mid) var(--ease),
              border-color var(--t-mid) var(--ease), opacity var(--t-mid) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn.is-disabled { opacity: 0.45; pointer-events: none; }
.btn--block { width: 100%; }
.btn--sm { height: 38px; padding: 0 var(--s-4); font-size: 13.5px; border-radius: var(--r-sm); }
.btn--lg { height: 54px; font-size: 16px; }
.btn--pill { border-radius: var(--r-pill); }

.btn--primary { background: var(--grad-brand); color: #fff; box-shadow: var(--sh-ultra); }
@media (hover: hover) { .btn--primary:hover { filter: brightness(1.06); } }
.btn--copper { background: var(--grad-copper); color: #fff; box-shadow: var(--sh-copper); }
.btn--soft { background: var(--ultra-100); color: var(--ultra-700); }
.btn--soft-copper { background: var(--copper-100); color: var(--copper-700); }
.btn--ghost {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); box-shadow: var(--sh-xs);
}
@media (hover: hover) { .btn--ghost:hover { border-color: var(--line-strong); } }
.btn--quiet { background: transparent; color: var(--text-2); }
.btn--danger { background: var(--coral-100); color: var(--coral-600); }
.btn--danger-solid { background: var(--coral-600); color: #fff; }
.btn--icon { width: 40px; height: 40px; padding: 0; border-radius: var(--r-sm); }
.btn--icon-round { width: 40px; height: 40px; padding: 0; border-radius: 50%; }

/* --- Badge / Chip ---------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.005em;
  background: var(--surface-sunk); color: var(--text-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge svg { width: 13px; height: 13px; }
.badge--sage { background: var(--sage-100); color: var(--sage-700); }
.badge--amber { background: var(--amber-100); color: var(--amber-600); }
.badge--coral { background: var(--coral-100); color: var(--coral-600); }
.badge--ultra { background: var(--ultra-100); color: var(--ultra-700); }
.badge--copper { background: var(--copper-100); color: var(--copper-700); }
.badge--ink { background: var(--ink-900); color: #fff; }
.badge--outline { background: transparent; border-color: var(--line-2); color: var(--text-2); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.dot--live { box-shadow: 0 0 0 0 currentColor; animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --- Progress -------------------------------------------------------- */
.progress {
  height: 8px; border-radius: var(--r-pill);
  background: var(--surface-sunk);
  overflow: hidden;
}
.progress--thin { height: 5px; }
.progress__fill {
  height: 100%; border-radius: var(--r-pill);
  background: var(--grad-brand);
  transition: width 620ms var(--ease);
}
.progress__fill--copper { background: var(--grad-copper); }
.progress__fill--sage { background: var(--grad-mint); }
.progress__fill--amber { background: linear-gradient(135deg,#E0A93F,#C8891C); }
.progress__fill--danger { background: linear-gradient(135deg,#E0776A,#B4472F); }
.card--ink .progress, .card--brand .progress { background: rgba(255,255,255,0.14); }
.card--ink .progress__fill { background: var(--grad-copper); }

/* --- Avatar ---------------------------------------------------------- */
.avatar {
  width: 44px; height: 44px; flex: none;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 700; color: #fff;
  background: var(--grad-brand);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.avatar--sm { width: 36px; height: 36px; border-radius: 12px; font-size: 13px; }
.avatar--round { border-radius: 50%; }
.avatar--copper { background: var(--grad-copper); }
.avatar--ink { background: var(--grad-ink); }
.avatar--sage { background: var(--grad-mint); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* --- List rows ------------------------------------------------------- */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-width: 0;
  transition: background var(--t-fast) var(--ease);
  width: 100%; text-align: left;
}
.list-row:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.list-row:last-child { border-bottom-width: 1px; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.list-row:only-child { border-radius: var(--r-lg); }
.list-row:active { background: var(--surface-2); }
.list-row__icon {
  width: 38px; height: 38px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--ultra-50); color: var(--ultra-600);
}
.list-row__icon--copper { background: var(--copper-50); color: var(--copper-600); }
.list-row__icon--sage { background: var(--sage-100); color: var(--sage-600); }
.list-row__icon--coral { background: var(--coral-100); color: var(--coral-600); }
.list-row__icon--plain { background: var(--surface-sunk); color: var(--text-2); }
.list-row__title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.list-row__sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.list-row__chev { color: var(--text-3); margin-left: auto; }

/* --- KV (ключ-значение) --------------------------------------------- */
.kv { display: flex; flex-direction: column; gap: 0; }
.kv__row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.kv__row:last-child { border-bottom: 0; padding-bottom: 0; }
.kv__row:first-child { padding-top: 0; }
.kv__k { font-size: 13.5px; color: var(--text-2); }
.kv__v { font-size: 13.5px; font-weight: 600; text-align: right; }
.kv__v.num { font-size: 13.5px; }

/* --- Inputs ---------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > .label { padding-left: 2px; }
.input {
  height: 48px; width: 100%;
  padding: 0 var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  font-size: 15px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--ultra-500); box-shadow: var(--ring); }
.input--mono { font-family: var(--font-mono); font-size: 14px; }
.input-row { display: flex; gap: var(--s-2); }
.input-row .input { flex: 1; }

/* --- Toggle ---------------------------------------------------------- */
.toggle {
  width: 50px; height: 30px; flex: none; border-radius: var(--r-pill);
  background: var(--line-2); position: relative;
  transition: background var(--t-mid) var(--ease);
}
.toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.22);
  transition: transform var(--t-mid) var(--ease-spring);
}
.toggle[aria-checked="true"] { background: var(--ultra-500); }
.toggle[aria-checked="true"]::after { transform: translateX(20px); }

/* --- Segmented control ----------------------------------------------- */
.segmented {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface-sunk);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}
.segmented button {
  flex: 1; height: 36px; border-radius: var(--r-xs);
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: background var(--t-mid) var(--ease), color var(--t-mid) var(--ease),
              box-shadow var(--t-mid) var(--ease);
}
.segmented button.active {
  background: var(--surface); color: var(--text); box-shadow: var(--sh-xs);
}

/* --- Tabs (scrolling pills) ------------------------------------------ */
.tabs {
  display: flex; gap: var(--s-2); overflow-x: auto; padding: 2px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; height: 38px; padding: 0 var(--s-4);
  border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: all var(--t-mid) var(--ease);
}
.tab.active {
  background: var(--ink-900); border-color: var(--ink-900); color: #fff;
  box-shadow: var(--sh-sm);
}
[data-theme="dark"] .tab.active { background: var(--ultra-500); border-color: var(--ultra-500); color: #0E1017; }

/* --- Data tiles ------------------------------------------------------ */
.stat {
  display: flex; flex-direction: column; gap: 3px;
  padding: var(--s-4);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.stat__value { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.stat__label { font-size: 12px; color: var(--text-3); font-weight: 550; }
.stat--sunk { background: var(--surface-sunk); box-shadow: none; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.stat-grid--3 { grid-template-columns: repeat(3, 1fr); }

/* --- Icon square ----------------------------------------------------- */
.icon-sq {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-sunk); color: var(--text-2);
}
.icon-sq--ultra { background: var(--ultra-50); color: var(--ultra-600); }
.icon-sq--copper { background: var(--copper-50); color: var(--copper-600); }
.icon-sq--sage { background: var(--sage-100); color: var(--sage-600); }
.icon-sq--coral { background: var(--coral-100); color: var(--coral-600); }
.icon-sq--amber { background: var(--amber-100); color: var(--amber-600); }

/* ===================================================== 5. COMPOSITES === */
/* --- Greeting -------------------------------------------------------- */
.greeting { display: flex; align-items: center; gap: var(--s-4); }
.greeting h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.025em; }
.greeting .sub { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }

/* --- Hero / Balance card (Ultima Black) ------------------------------ */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: var(--s-5);
  background: var(--grad-ink);
  color: var(--text-on-ink);
  box-shadow: var(--sh-lg);
  border: 1px solid rgba(255,255,255,0.07);
}
.hero::before {
  content: "";
  position: absolute; inset: -40% -30% auto auto;
  width: 320px; height: 320px;
  background: radial-gradient(circle at 60% 40%, rgba(220,154,99,0.34) 0%, transparent 62%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute; inset: auto auto -60% -20%;
  width: 300px; height: 300px;
  background: radial-gradient(circle at 40% 40%, rgba(74,127,219,0.30) 0%, transparent 62%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.hero__amount {
  font-family: var(--font-mono);
  font-size: 34px; font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.1;
}
.hero__amount .cur { font-size: 20px; opacity: 0.75; margin-left: 3px; }
.hero__meta { font-size: 12.5px; color: var(--text-on-ink-2); }
.hero__actions { display: flex; gap: var(--s-2); margin-top: var(--s-5); }

/* --- Chip row (quick actions) ---------------------------------------- */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-2); }
.quick {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; padding: 14px 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
  box-shadow: var(--sh-xs);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-mid) var(--ease),
              box-shadow var(--t-mid) var(--ease);
}
.quick:active { transform: scale(0.95); }
@media (hover: hover) { .quick:hover { border-color: var(--ultra-300); box-shadow: var(--sh-sm); } }
.quick svg { color: var(--ultra-600); }

/* --- Plan hero (subscription status) --------------------------------- */
.plan-top { display: flex; align-items: flex-start; gap: var(--s-3); }
.plan-name { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.plan-days {
  font-family: var(--font-mono); font-size: 26px; font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.1;
}

/* --- Device row ------------------------------------------------------ */
.device {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
  overflow: hidden;
  transition: box-shadow var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease);
}
.device.is-paused { opacity: 0.62; }
.device__main {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4); width: 100%; text-align: left;
}
.device__body { flex: 1; min-width: 0; }
.device__name { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.device__meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.device__stats {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 11px var(--s-4);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12px; color: var(--text-2);
}
.device__stats .sep { width: 1px; height: 12px; background: var(--line-2); }

/* --- Planet / usage visual ------------------------------------------- */
.usage {
  display: flex; align-items: center; gap: var(--s-5);
}
.gauge { position: relative; width: 92px; height: 92px; flex: none; }
.gauge svg { transform: rotate(-90deg); }
.gauge__center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gauge__value { font-family: var(--font-mono); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.gauge__unit { font-size: 9.5px; color: var(--text-3); font-weight: 600; letter-spacing: 0.06em; }

/* --- Tariff card ----------------------------------------------------- */
.tariff {
  position: relative;
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-4);
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  transition: border-color var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease),
              transform var(--t-fast) var(--ease);
  text-align: left; width: 100%;
}
.tariff:active { transform: scale(0.985); }
.tariff.is-selected {
  border-color: var(--ultra-500);
  box-shadow: var(--sh-md), 0 0 0 3px var(--ultra-100);
}
.tariff.is-featured { border-color: color-mix(in srgb, var(--copper-500) 45%, transparent); }
.tariff.is-featured.is-selected {
  border-color: var(--copper-500);
  box-shadow: var(--sh-md), 0 0 0 3px var(--copper-100);
}
.tariff__price { font-family: var(--font-mono); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.tariff__price s { color: var(--text-3); font-size: 13px; font-weight: 400; margin-right: 6px; }
.tariff__per { font-size: 12px; color: var(--text-3); }
.tariff__features { display: flex; flex-direction: column; gap: 6px; }
.feature { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.feature svg { color: var(--sage-500); }
.tariff__flag {
  position: absolute; top: -10px; right: 14px;
  height: 22px; padding: 0 10px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--grad-copper); color: #fff; box-shadow: var(--sh-copper);
}
.tariff__flag--brand { background: var(--grad-brand); box-shadow: var(--sh-ultra); }
.tariff__check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid; place-items: center; color: transparent; flex: none;
  transition: all var(--t-mid) var(--ease);
}
.tariff.is-selected .tariff__check { background: var(--ultra-500); border-color: var(--ultra-500); color: #fff; }
.tariff.is-featured.is-selected .tariff__check { background: var(--copper-500); border-color: var(--copper-500); }

/* --- Receipt / payment row ------------------------------------------- */
.receipt {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--sh-xs);
}
.receipt__amount { font-family: var(--font-mono); font-weight: 700; font-size: 15px; }
.receipt--pending { border-style: dashed; }

/* --- Amount preset --------------------------------------------------- */
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.preset {
  position: relative;
  height: 62px; border-radius: var(--r-md);
  background: var(--surface); border: 1.5px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 17px; font-weight: 700;
  box-shadow: var(--sh-xs);
  transition: all var(--t-mid) var(--ease);
}
.preset:active { transform: scale(0.97); }
.preset.is-selected {
  border-color: var(--ultra-500); background: var(--ultra-50); color: var(--ultra-700);
  box-shadow: 0 0 0 3px var(--ultra-100);
}
.preset__note {
  position: absolute; bottom: 5px; left: 0; right: 0; text-align: center;
  font-family: var(--font); font-size: 10px; font-weight: 650; color: var(--copper-600);
  letter-spacing: 0.02em;
}

/* --- Payment method -------------------------------------------------- */
.pay-methods { display: flex; flex-direction: column; gap: var(--s-2); }
.pay {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 13px var(--s-4);
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  transition: all var(--t-mid) var(--ease);
  width: 100%; text-align: left;
}
.pay.is-selected { border-color: var(--ultra-500); box-shadow: 0 0 0 3px var(--ultra-100); }
.pay__mark {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--line-strong); display: grid; place-items: center;
  color: transparent; transition: all var(--t-mid) var(--ease);
}
.pay.is-selected .pay__mark { background: var(--ultra-500); border-color: var(--ultra-500); color: #fff; }

/* --- Code / key block ------------------------------------------------ */
.code {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 12px var(--s-3);
  background: var(--surface-sunk);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 12px;
  word-break: break-all;
  color: var(--text-2);
}
.code--ink { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.16); color: var(--text-on-ink-2); }

/* --- QR -------------------------------------------------------------- */
.qr-frame {
  padding: var(--s-4);
  background: #fff; border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  display: grid; place-items: center;
  border: 1px solid var(--line);
}
.qr-frame svg { display: block; }

/* --- Bar chart ------------------------------------------------------- */
.chart {
  display: flex; align-items: flex-end; gap: 6px;
  height: 108px; padding-top: var(--s-3);
}
.chart__bar {
  flex: 1; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--ultra-400) 0%, var(--ultra-600) 100%);
  min-height: 4px; position: relative;
  animation: bar-in 620ms var(--ease) both;
  transform-origin: bottom;
}
.chart__bar--peak { background: var(--grad-copper); }
.chart__bar--rest { background: var(--line-2); }
@keyframes bar-in { from { transform: scaleY(0.02); opacity: 0.2; } to { transform: none; opacity: 1; } }
.chart__labels { display: flex; gap: 6px; margin-top: 8px; }
.chart__labels span { flex: 1; text-align: center; font-size: 10px; color: var(--text-3); }

/* --- Timeline / activity -------------------------------------------- */
.feed { display: flex; flex-direction: column; gap: 0; }
.feed__item { display: flex; gap: var(--s-3); padding: 12px 0; position: relative; }
.feed__item:not(:last-child)::before {
  content: ""; position: absolute; left: 15px; top: 40px; bottom: -2px;
  width: 1px; background: var(--line);
}
.feed__icon {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: var(--surface-sunk); color: var(--text-2);
  z-index: 1;
}
.feed__title { font-size: 13.5px; font-weight: 600; }
.feed__time { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.feed__amount { margin-left: auto; font-family: var(--font-mono); font-size: 13px; font-weight: 700; }

/* --- Referral -------------------------------------------------------- */
.refcode {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 12px var(--s-4);
  background: var(--surface-sunk); border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2);
  border: 1px dashed var(--line-strong);
}

/* --- Steps (инструкции) --------------------------------------------- */
.steps { display: flex; flex-direction: column; gap: var(--s-4); counter-reset: s; }
.step { display: flex; gap: var(--s-3); }
.step__num {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--ultra-100); color: var(--ultra-700);
  font-size: 12.5px; font-weight: 700;
}
.step__body { font-size: 13.5px; color: var(--text-2); }
.step__body b { color: var(--text); font-weight: 650; }

/* --- Admin: server tile --------------------------------------------- */
.server {
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-4);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
}
.server__head { display: flex; align-items: center; gap: var(--s-3); }
.server__flag {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 18px;
  background: var(--surface-sunk);
}
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-2) var(--s-4); }
.metric__k { font-size: 11px; color: var(--text-3); font-weight: 600; }
.metric__v { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }

/* --- Modal / sheet --------------------------------------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16, 24, 38, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in var(--t-mid) var(--ease) both;
  padding: 0;
}
.overlay--center { align-items: center; padding: var(--s-4); }
.overlay.is-closing { animation: fade-out var(--t-fast) var(--ease) both; pointer-events: none; }   /* 19.10: исчезающее окно не принимает нажатий — иначе быстрый тап попадал в прошлое окно (например, «Удалить» другого устройства) */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

.sheet {
  width: 100%; max-width: var(--max-w);
  max-height: 88dvh; overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  padding: var(--s-3) var(--s-5) var(--s-4);
  box-shadow: var(--sh-lg);
  animation: sheet-up var(--t-slow) var(--ease) both;
  display: flex; flex-direction: column; gap: var(--s-4);
}
.overlay.is-closing .sheet { animation: sheet-down var(--t-mid) var(--ease) both; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-down { from { transform: none; opacity: 1; } to { transform: translateY(20px); opacity: 0; } }

.sheet__grip {
  width: 40px; height: 4px; border-radius: 4px;
  background: var(--line-2); margin: 0 auto 4px;
}
.sheet__title { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.sheet__sub { font-size: 13.5px; color: var(--text-2); margin-top: 3px; }
/* Кнопки шторки всегда на виду: прилипают к низу при скролле содержимого. */
.sheet__foot {
  position: sticky; bottom: calc(-1 * var(--s-4));
  display: flex; gap: var(--s-3);
  margin: var(--s-2) calc(-1 * var(--s-5)) calc(-1 * var(--s-4));
  padding: var(--s-4) var(--s-5) calc(var(--s-4) + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.sheet__foot .btn { flex: 1; }

.dialog {
  width: 100%; max-width: 360px;
  background: var(--surface); border-radius: var(--r-xl);
  padding: var(--s-5);
  box-shadow: var(--sh-lg);
  animation: dialog-in var(--t-slow) var(--ease-spring) both;
  display: flex; flex-direction: column; gap: var(--s-3);
}
@keyframes dialog-in { from { transform: scale(0.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* --- Toast ----------------------------------------------------------- */
/* Тосты живут над нижней навигацией: не перекрывают шапку и не мешают
   встроенной кнопке Telegram «Закрыть». */
.toasts {
  position: fixed; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  left: 0; right: 0;
  z-index: 200; display: flex; flex-direction: column-reverse; align-items: center; gap: 8px;
  pointer-events: none; padding: 0 var(--s-4);
}
.toast {
  display: flex; align-items: center; gap: 10px;
  max-width: var(--max-w); width: 100%;
  padding: 12px var(--s-4);
  border-radius: var(--r-md);
  background: var(--ink-900); color: #fff;
  box-shadow: var(--sh-lg);
  font-size: 13.5px; font-weight: 550;
  animation: toast-in var(--t-slow) var(--ease-spring) both;
}
.toast.is-out { animation: toast-out var(--t-mid) var(--ease) both; }
.toast--ok { background: linear-gradient(135deg,#2F6B4F,#255640); }
.toast--warn { background: linear-gradient(135deg,#C8891C,#A26A11); }
.toast--err { background: linear-gradient(135deg,#C9553B,#B4472F); }
.toast svg { flex: none; }
@keyframes toast-in { from { transform: translateY(16px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { from { opacity: 1; } to { transform: translateY(10px); opacity: 0; } }

/* --- Skeleton -------------------------------------------------------- */
.skel {
  background: linear-gradient(90deg, var(--surface-sunk) 25%, var(--surface-2) 37%, var(--surface-sunk) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* --- Empty state ----------------------------------------------------- */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--s-2); padding: var(--s-7) var(--s-5);
  color: var(--text-3); font-size: 13.5px;
}
.empty__art {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center;
  background: var(--surface-sunk); color: var(--text-3); margin-bottom: var(--s-2);
}

/* --- Login / guest landing ------------------------------------------ */
.login {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--s-4);
  padding: var(--s-7) var(--s-5); text-align: center;
}
.login h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.login p { color: var(--text-2); font-size: 14.5px; max-width: 320px; }

/* --- Footer (слоган) ------------------------------------------------- */
.footnote {
  text-align: center; padding: var(--s-2) var(--s-4) 0;
  font-size: 11.5px; color: var(--text-3);
}
.footnote b { color: var(--text-2); font-weight: 600; }

/* --- Divider with label --------------------------------------------- */
.divider {
  display: flex; align-items: center; gap: var(--s-3);
  color: var(--text-3); font-size: 11px; font-weight: 650;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* --- Banner ---------------------------------------------------------- */
.banner {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 13px var(--s-4);
  border-radius: var(--r-md);
  font-size: 13px;
  background: var(--amber-100); color: var(--amber-600);
  border: 1px solid color-mix(in srgb, var(--amber-500) 25%, transparent);
}
.banner--brand { background: var(--ultra-50); color: var(--ultra-700); border-color: color-mix(in srgb, var(--ultra-500) 22%, transparent); }
.banner--copper { background: var(--copper-50); color: var(--copper-700); border-color: color-mix(in srgb, var(--copper-500) 25%, transparent); }

/* ====================================================== 6. UTILITIES === */
.hidden { display: none !important; }
.stack-2 { display: flex; flex-direction: column; gap: var(--s-2); }
.stack-3 { display: flex; flex-direction: column; gap: var(--s-3); }
.stack-4 { display: flex; flex-direction: column; gap: var(--s-4); }
.stack-5 { display: flex; flex-direction: column; gap: var(--s-5); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.text-c { text-align: center; }
.mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.rel { position: relative; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Планшет/десктоп: приложение по центру, с мягкой рамкой */
@media (min-width: 560px) {
  body { padding: 0; }
  .shell {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 70%, transparent);
  }
  .navbar { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* ===================================================== 7. MONOCHROME (16.10) ===
   Владелец 16.10: только эти цвета — страница #0E0E0E, карточка #161616, вложенные блоки и пустая часть
   полос #1E1E1E, рамки и разделители #2A2A28, второстепенный текст #96968F, основной текст / заливка /
   активное #F2F2F0. Без синих/зелёных/голубых акцентов, градиентов, свечения и теней. Графики — только серые
   (#F2F2F0, #9A9A95, #5E5E5A). Шрифты: заголовки — Unbounded 700–900, текст — IBM Plex Sans, метки —
   IBM Plex Mono капсом с разрядкой (файлы — ./fonts, OFL). Карточки — радиус 16, рамка 1px, без теней;
   кнопки и бейджи — пилюли; основная кнопка — белая с тёмным текстом, второстепенная — контурная.
   Блок стоит последним и переопределяет токены и места с цветом «в коде» выше.
   ============================================================================ */
@font-face { font-family: "Unbounded"; src: url("./fonts/Unbounded-VF.ttf") format("truetype"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./fonts/IBMPlexSans-VF.ttf") format("truetype"); font-weight: 100 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("./fonts/IBMPlexMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("./fonts/IBMPlexMono-Medium.ttf") format("truetype"); font-weight: 500 700; font-display: swap; }

:root, [data-theme="light"], [data-theme="dark"] {
  --mono-page: #0E0E0E; --mono-card: #161616; --mono-inner: #1E1E1E; --mono-line: #2A2A28;
  --mono-muted: #96968F; --mono-text: #F2F2F0;
  --mono-g1: #F2F2F0; --mono-g2: #9A9A95; --mono-g3: #5E5E5A;

  --ultra-900: #F2F2F0; --ultra-800: #F2F2F0; --ultra-700: #F2F2F0; --ultra-600: #F2F2F0; --ultra-500: #F2F2F0;
  --ultra-400: #96968F; --ultra-300: #96968F; --ultra-100: #1E1E1E; --ultra-50: #1E1E1E;
  --copper-700: #F2F2F0; --copper-600: #F2F2F0; --copper-500: #F2F2F0; --copper-400: #96968F; --copper-300: #96968F;
  --copper-100: #1E1E1E; --copper-50: #1E1E1E;
  --sage-700: #F2F2F0; --sage-600: #F2F2F0; --sage-500: #F2F2F0; --sage-400: #96968F; --sage-100: #1E1E1E;
  --amber-600: #F2F2F0; --amber-500: #F2F2F0; --amber-100: #1E1E1E;
  --coral-600: #F2F2F0; --coral-500: #F2F2F0; --coral-100: #1E1E1E;
  --ink-900: #F2F2F0; --ink-800: #F2F2F0; --ink-700: #F2F2F0; --ink-600: #96968F; --ink-500: #96968F; --ink-400: #96968F;
  --ink-300: #96968F; --ink-200: #2A2A28; --ink-100: #2A2A28;

  --bg: #0E0E0E; --bg-wash-1: transparent; --bg-wash-2: transparent; --bg-wash-3: transparent;
  --surface: #161616; --surface-2: #161616; --surface-sunk: #1E1E1E; --surface-ink: #161616;
  --line: #2A2A28; --line-2: #2A2A28; --line-strong: #2A2A28;
  --text: #F2F2F0; --text-2: #96968F; --text-3: #96968F; --text-on-brand: #161616; --text-on-ink: #F2F2F0; --text-on-ink-2: #96968F;

  --r-lg: 16px; --r-xl: 16px; --r-2xl: 16px;
  --sh-xs: none; --sh-sm: none; --sh-md: none; --sh-lg: none; --sh-ultra: none; --sh-copper: none;
  --ring: 0 0 0 1px #96968F; --ring-copper: 0 0 0 1px #96968F;
  --grad-brand: #F2F2F0; --grad-copper: #F2F2F0; --grad-ink: #161616; --grad-mint: #F2F2F0;

  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Unbounded", "IBM Plex Sans", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

body { background: #0E0E0E; color: #F2F2F0; }
body::before { display: none; }
::selection { background: #2A2A28; color: #F2F2F0; }
*, *::before, *::after { text-shadow: none !important; }

/* заголовки — Unbounded; метки — IBM Plex Mono капсом с разрядкой */
h1, h2, h3, .plan-name, .plan-days, .page-title, .section-title, .brand-name { font-family: var(--font-head); font-weight: 800; letter-spacing: -0.01em; }
.label, .gauge__unit, .divider { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: #96968F; font-weight: 400; }
.logo-vff { font-family: var(--font-head); font-weight: 900; letter-spacing: -0.02em; color: #F2F2F0; display: inline-block; }
.brand-mark { background: none !important; box-shadow: none !important; color: #F2F2F0; width: auto; }

/* карточки: #161616, радиус 16, рамка 1px, без теней и градиентов */
.card, .card--ink, .card--brand, .card--copper, .card--tint-ultra, .card--tint-copper, .card--tint-sage, .card--tint-coral,
.stat, .quick, .tariff, .receipt, .pay, .sheet, .modal, .toast, .hero {
  background: #161616; color: #F2F2F0; border: 1px solid #2A2A28; border-radius: 16px; box-shadow: none !important;
}
.card--sunk, .stat--sunk { background: #1E1E1E; }
.card--ink .label, .card--brand .label, .card--copper .label { color: #96968F; }
.card--ink .progress, .card--brand .progress { background: #1E1E1E; }
.hero::before, .hero::after, .card--ink::before, .card--ink::after { display: none !important; }

/* кнопки: пилюли; основная — белая с тёмным текстом, второстепенная — контурная */
.btn { border-radius: 999px; box-shadow: none !important; }
.btn--primary, .btn--copper, .btn--danger-solid { background: #F2F2F0; color: #161616; border: 1px solid #F2F2F0; }
.btn--soft, .btn--soft-copper, .btn--ghost, .btn--danger, .btn--secondary { background: transparent; color: #F2F2F0; border: 1px solid #2A2A28; }
.btn--quiet { background: transparent; color: #96968F; }
.btn--icon { border-radius: 999px; }

/* бейджи — пилюли; статус «Активна» — белая с тёмным текстом и точкой, неактивные — контур, серый текст */
.badge { border-radius: 999px; background: transparent; color: #96968F; border: 1px solid #2A2A28; }
.badge--sage, .badge--amber, .badge--coral, .badge--ultra, .badge--copper, .badge--ink, .badge--outline, .badge--off {
  background: transparent; color: #96968F; border-color: #2A2A28;
}
.badge--on { background: #F2F2F0; color: #161616; border-color: #F2F2F0; }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; margin-right: 6px; }

/* полосы: трек #1E1E1E, заливка #F2F2F0 */
.progress { background: #1E1E1E; }
.progress__fill, .progress__fill--copper, .progress__fill--sage, .progress__fill--amber, .progress__fill--danger,
.card--ink .progress__fill { background: #F2F2F0; box-shadow: none; }

/* вкладки, навигация, выбор */
.tab.active, [data-theme="dark"] .tab.active, .segmented button.active { background: #F2F2F0; border-color: #F2F2F0; color: #161616; box-shadow: none; }
.nav-item.active { color: #F2F2F0; }
.tariff.is-selected, .pay.is-selected { border-color: #F2F2F0; box-shadow: none !important; }
.tariff.is-selected .tariff__check, .pay.is-selected .pay__mark { background: #F2F2F0; border-color: #F2F2F0; color: #161616; }
.tariff__flag, .tariff__flag--brand { background: #F2F2F0; color: #161616; box-shadow: none; }
.input:focus { border-color: #96968F; box-shadow: none; }
:focus-visible { box-shadow: 0 0 0 1px #96968F; }

/* иконки — линейные, на нейтральном блоке */
.icon-sq, [class*="icon-sq--"] { background: #1E1E1E !important; color: #F2F2F0 !important; border: 1px solid #2A2A28; box-shadow: none; }
.avatar { background: #1E1E1E; color: #F2F2F0; box-shadow: none; }
.dot--live { animation: none; box-shadow: none; }

/* тосты и затемнение — без цвета */
.toast, .toast--ok, .toast--warn, .toast--err { background: #161616; color: #F2F2F0; border: 1px solid #2A2A28; }
.skel { background: #1E1E1E; animation: none; }
.code--ink { background: #1E1E1E; border-color: #2A2A28; color: #96968F; }

/* график: два столбика на день — трафик #F2F2F0, CDN #9A9A95; легенда сверху; подпись — только у максимума */
.chart { align-items: flex-end; }
.chart__slot { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; position: relative; }
.chart__bar { flex: 0 1 9px; max-width: 9px; background: #F2F2F0; border-radius: 3px 3px 0 0; box-shadow: none; }
.chart__bar--cdn { background: #9A9A95; }
.chart__bar--peak, .chart__bar--rest { background: #F2F2F0; }
.chart__val { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--font-mono); font-size: 10px; color: #F2F2F0; }
.chart__labels span { color: #96968F; font-family: var(--font-mono); }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: #F2F2F0; margin-bottom: 18px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-key { width: 10px; height: 10px; border-radius: 50%; background: #F2F2F0; display: inline-block; }
.chart-key--cdn { background: #9A9A95; }
