/* Squeeze — интерфейс в духе Apple HIG: системный шрифт, материалы, пружинная анимация. */

:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;

  /* пружины (затухающий осциллятор, отклик 0.35–0.55 с) */
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --spring-bouncy: cubic-bezier(0.34, 1.4, 0.64, 1);
  --spring-snappy: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 0.75, 0.2);
  --t-spring: 680ms;
  --t-bouncy: 900ms;
  --t-snappy: 430ms;

  --r-xs: 7px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 30px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 50px;
  --sidebar-w: 248px;
  --content-w: 1080px;

  /* светлая тема */
  --bg: #f2f2f7;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-2: #f2f2f7;
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.2);
  --fill-3: rgba(118, 118, 128, 0.24);
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.6);
  --label-3: rgba(60, 60, 67, 0.3);
  --sep: rgba(60, 60, 67, 0.18);
  --sep-opaque: #c6c6c8;
  --material: rgba(249, 249, 249, 0.78);
  --material-thick: rgba(255, 255, 255, 0.9);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.06);
  --shadow-pop: 0 10px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.06);

  --blue: #007aff;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --yellow: #ffcc00;
  --cyan: #32ade6;
  --indigo: #5856d6;
  --purple: #af52de;
  --gray: #8e8e93;
  --tint: var(--blue);
  --on-tint: #ffffff;
  --green-soft: rgba(52, 199, 89, 0.14);
  --red-soft: rgba(255, 59, 48, 0.12);
  --orange-soft: rgba(255, 149, 0, 0.14);
  --cyan-soft: rgba(50, 173, 230, 0.14);
  --blue-soft: rgba(0, 122, 255, 0.12);
  --seg-pill: #ffffff;
  --sheet-bg: #f2f2f7;
  --sheet-group: #ffffff;
  --island-bg: #000000;
  --island-edge: 0 0 0 0 transparent;
  --chart-grid: rgba(60, 60, 67, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --bg-2: #1c1c1e;
    --card: #1c1c1e;
    --card-2: #2c2c2e;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.32);
    --fill-3: rgba(118, 118, 128, 0.36);
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, 0.6);
    --label-3: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.6);
    --sep-opaque: #38383a;
    --material: rgba(22, 22, 24, 0.74);
    --material-thick: rgba(30, 30, 32, 0.92);
    --shadow: none;
    --shadow-pop: 0 18px 60px rgba(0, 0, 0, 0.6);
    --blue: #0a84ff;
    --green: #30d158;
    --red: #ff453a;
    --orange: #ff9f0a;
    --yellow: #ffd60a;
    --cyan: #64d2ff;
    --indigo: #5e5ce6;
    --purple: #bf5af2;
    --gray: #8e8e93;
    --green-soft: rgba(48, 209, 88, 0.16);
    --red-soft: rgba(255, 69, 58, 0.16);
    --orange-soft: rgba(255, 159, 10, 0.16);
    --cyan-soft: rgba(100, 210, 255, 0.14);
    --blue-soft: rgba(10, 132, 255, 0.18);
    --seg-pill: #636366;
    --sheet-bg: #1c1c1e;
    --sheet-group: #2c2c2e;
    --island-bg: #1c1c1e;
    --island-edge: 0 0 0 0.5px rgba(255, 255, 255, 0.12);
    --chart-grid: rgba(235, 235, 245, 0.06);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-2: #1c1c1e;
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --fill: rgba(118, 118, 128, 0.24);
  --fill-2: rgba(118, 118, 128, 0.32);
  --fill-3: rgba(118, 118, 128, 0.36);
  --label: #ffffff;
  --label-2: rgba(235, 235, 245, 0.6);
  --label-3: rgba(235, 235, 245, 0.3);
  --sep: rgba(84, 84, 88, 0.6);
  --sep-opaque: #38383a;
  --material: rgba(22, 22, 24, 0.74);
  --material-thick: rgba(30, 30, 32, 0.92);
  --shadow: none;
  --shadow-pop: 0 18px 60px rgba(0, 0, 0, 0.6);
  --blue: #0a84ff;
  --green: #30d158;
  --red: #ff453a;
  --orange: #ff9f0a;
  --yellow: #ffd60a;
  --cyan: #64d2ff;
  --indigo: #5e5ce6;
  --purple: #bf5af2;
  --gray: #8e8e93;
  --green-soft: rgba(48, 209, 88, 0.16);
  --red-soft: rgba(255, 69, 58, 0.16);
  --orange-soft: rgba(255, 159, 10, 0.16);
  --cyan-soft: rgba(100, 210, 255, 0.14);
  --blue-soft: rgba(10, 132, 255, 0.18);
  --seg-pill: #636366;
  --sheet-bg: #1c1c1e;
  --sheet-group: #2c2c2e;
  --island-bg: #1c1c1e;
  --island-edge: 0 0 0 0.5px rgba(255, 255, 255, 0.12);
  --chart-grid: rgba(235, 235, 245, 0.06);
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.0204, 0.072, 0.1433, 0.2255, 0.312, 0.3982, 0.4808, 0.5579, 0.6281, 0.691, 0.7463, 0.7942, 0.8353, 0.87, 0.8989, 0.9229, 0.9423, 0.958, 0.9705, 0.9802, 0.9877, 0.9934, 0.9975, 1.0005, 1.0025, 1.0039, 1.0046, 1.005, 1.005, 1.0049, 1.0046, 1.0042, 1.0038, 1.0033, 1.0029, 1.0025, 1.0021, 1.0018, 1.0015, 1);
    --spring-bouncy: linear(0, 0.0296, 0.1056, 0.2111, 0.3321, 0.4576, 0.5794, 0.6915, 0.7905, 0.8742, 0.9421, 0.9948, 1.0334, 1.0596, 1.0753, 1.0825, 1.0831, 1.0789, 1.0714, 1.0619, 1.0515, 1.0411, 1.0312, 1.0223, 1.0145, 1.0081, 1.0029, 0.999, 0.9962, 0.9944, 0.9934, 0.993, 0.9932, 0.9936, 0.9943, 0.9952, 0.996, 0.9969, 0.9977, 0.9984, 1);
    --spring-snappy: linear(0, 0.0167, 0.0594, 0.1192, 0.1892, 0.2641, 0.3402, 0.4147, 0.4857, 0.552, 0.613, 0.6682, 0.7176, 0.7614, 0.7999, 0.8333, 0.8621, 0.8869, 0.9079, 0.9256, 0.9405, 0.9528, 0.9631, 0.9714, 0.9782, 0.9837, 0.9881, 0.9916, 0.9943, 0.9964, 0.998, 0.9992, 1.0001, 1.0007, 1.0011, 1.0013, 1.0015, 1.0015, 1.0015, 1.0015, 1);
  }
}

/* ------------------------------------------------------------------ основа */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.29;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--tint); text-decoration: none; }
img, svg { display: block; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 60%, transparent); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }
.rounded { font-family: var(--font-rounded); }
.muted { color: var(--label-2); }
.faint { color: var(--label-3); }
.up { color: var(--green); }
.down { color: var(--red); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ типографика */
.t-large { font-family: var(--font-display); font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: 0.011em; margin: 0; }
.t-title1 { font-family: var(--font-display); font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: 0.013em; margin: 0; }
.t-title2 { font-family: var(--font-display); font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.012em; margin: 0; }
.t-title3 { font-size: 20px; line-height: 25px; font-weight: 600; letter-spacing: -0.017em; margin: 0; }
.t-headline { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.022em; margin: 0; }
.t-body { font-size: 17px; line-height: 22px; }
.t-callout { font-size: 16px; line-height: 21px; letter-spacing: -0.02em; }
.t-sub { font-size: 15px; line-height: 20px; letter-spacing: -0.015em; }
.t-foot { font-size: 13px; line-height: 18px; letter-spacing: -0.005em; }
.t-cap { font-size: 12px; line-height: 16px; letter-spacing: 0; }
.t-cap2 { font-size: 11px; line-height: 13px; letter-spacing: 0.006em; }

/* ------------------------------------------------------------------ каркас */
.shell { min-height: 100dvh; }
.main {
  padding-top: calc(var(--safe-top) + 8px);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 28px);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  max-width: var(--content-w);
  margin: 0 auto;
  view-transition-name: page;
}
.page { display: block; }

/* компактная панель сверху (появляется, когда большой заголовок уехал) */
.navbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: calc(44px + var(--safe-top)); padding-top: var(--safe-top);
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border-bottom: 0.5px solid transparent;
  transition: background 220ms ease, border-color 220ms ease, -webkit-backdrop-filter 220ms ease, backdrop-filter 220ms ease;
  pointer-events: none;
}
.navbar .nav-title { font-weight: 600; font-size: 17px; opacity: 0; transform: translateY(6px); transition: opacity 220ms ease, transform 420ms var(--spring); }
.navbar.show { background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom-color: var(--sep); }
.navbar.show .nav-title { opacity: 1; transform: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 44px 4px 14px; }
.page-head .t-large { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-actions { display: flex; align-items: center; gap: 8px; padding-bottom: 4px; }

/* нижняя панель вкладок (телефон) */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 50;
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--sep);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--gray); font-size: 10px; font-weight: 500; letter-spacing: 0.01em;
  position: relative; transition: color 200ms ease;
}
.tab svg { width: 26px; height: 26px; transition: transform var(--t-snappy) var(--spring-bouncy); }
.tab:active svg { transform: scale(0.86); }
.tab[aria-current="page"] { color: var(--tint); }
.tab .dot { position: absolute; top: 5px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }

/* боковая панель (компьютер) */
.sidebar { display: none; }
@media (min-width: 960px) {
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 30;
    padding: 22px 12px 18px; background: var(--material);
    -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
    border-right: 0.5px solid var(--sep);
  }
  .main { margin-left: calc(var(--sidebar-w) + max(0px, (100vw - var(--sidebar-w) - var(--content-w)) / 2)); padding: 28px 40px 60px; }
  .main { padding-right: max(40px, env(safe-area-inset-right, 0px)); }
  .navbar { left: var(--sidebar-w); }
  .page-head { padding-top: 12px; }
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand b { font-size: 17px; font-weight: 600; }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px;
  color: var(--label); font-size: 15px; font-weight: 500; transition: background 160ms ease;
}
.side-link svg { width: 22px; height: 22px; color: var(--tint); }
.side-link:hover { background: var(--fill); }
.side-link[aria-current="page"] { background: var(--fill-2); }
.side-foot { margin-top: auto; padding: 10px; }

/* ------------------------------------------------------------------ карточки и списки */
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px; position: relative; }
.card.flat { box-shadow: none; }
.section { margin-top: 28px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px 8px; }
.section-title h2 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.012em; font-family: var(--font-display); }
.section-title a, .section-title button { font-size: 15px; color: var(--tint); }
.grid { display: grid; gap: 12px; }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }

/* сгруппированный список как в «Настройках» */
.group-label { padding: 0 16px 7px; font-size: 13px; color: var(--label-2); letter-spacing: -0.005em; }
.group-note { padding: 7px 16px 0; font-size: 13px; line-height: 18px; color: var(--label-2); }
.group { background: var(--card); border-radius: var(--r-sm); overflow: hidden; box-shadow: var(--shadow); }
.group + .group-note + .group-label, .group + .group-label { margin-top: 30px; }
.group-wrap { margin-top: 30px; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px; position: relative; width: 100%; text-align: left;
  background: var(--card); transition: background 120ms ease;
}
.row::after { content: ""; position: absolute; right: 0; bottom: 0; left: 16px; border-bottom: 0.5px solid var(--sep); }
.row.has-icon::after { left: 58px; }
.row:last-child::after { display: none; }
button.row:active, a.row:active, .row.tap:active { background: var(--fill); }
.row .lbl { flex: 1; min-width: 0; padding: 11px 0; }
.row .lbl small { display: block; color: var(--label-2); font-size: 13px; line-height: 17px; margin-top: 1px; }
.row .val { color: var(--label-2); text-align: right; flex-shrink: 0; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .chev { width: 8px; height: 14px; color: var(--label-3); flex-shrink: 0; }
.row.danger { color: var(--red); }
.row.center { justify-content: center; color: var(--tint); }
.icon-tile { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.icon-tile svg { width: 19px; height: 19px; }

/* ------------------------------------------------------------------ кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 20px; border-radius: var(--r-md); font-size: 17px; font-weight: 600; letter-spacing: -0.022em;
  background: var(--tint); color: var(--on-tint);
  transition: transform 420ms var(--spring-bouncy), opacity 160ms ease, background 160ms ease;
  will-change: transform; user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(0.965); transition-duration: 120ms; transition-timing-function: ease-out; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn.block { width: 100%; }
.btn.gray { background: var(--fill); color: var(--tint); }
.btn.plain { background: transparent; color: var(--tint); padding: 0 8px; }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger-soft { background: var(--red-soft); color: var(--red); }
.btn.small { height: 34px; padding: 0 14px; font-size: 15px; border-radius: 999px; }
.btn.mini { height: 28px; padding: 0 12px; font-size: 13px; border-radius: 999px; }
.btn .spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--tint); transition: transform 380ms var(--spring-bouncy); }
.icon-btn:active { transform: scale(0.88); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.spinning svg { animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ переключатель iOS */
.switch { position: relative; width: 51px; height: 31px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--fill-3); transition: background 260ms ease; }
.switch .knob {
  position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06);
  transition: transform var(--t-snappy) var(--spring-bouncy), width 220ms var(--spring);
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked ~ .knob { transform: translateX(20px); }
.switch input:active ~ .knob { width: 32px; }
.switch input:checked:active ~ .knob { transform: translateX(15px); }
.switch input:focus-visible ~ .track { outline: 3px solid color-mix(in srgb, var(--tint) 60%, transparent); outline-offset: 2px; }
.switch input:disabled ~ * { opacity: 0.5; }

/* ------------------------------------------------------------------ сегментированный контрол */
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 9px; background: var(--fill); height: 32px; isolation: isolate; }
.seg button { position: relative; z-index: 1; font-size: 13px; font-weight: 500; border-radius: 7px; color: var(--label); padding: 0 10px; white-space: nowrap; transition: opacity 160ms; }
.seg button:active { opacity: 0.6; }
.seg button[aria-pressed="true"] { font-weight: 600; }
.seg .pill {
  position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 0; border-radius: 7px; background: var(--seg-pill);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
  transition: transform var(--t-snappy) var(--spring-snappy), width var(--t-snappy) var(--spring-snappy);
}
.seg.large { height: 38px; border-radius: 11px; }
.seg.large button { font-size: 15px; border-radius: 9px; }
.seg.large .pill { border-radius: 9px; }

/* ------------------------------------------------------------------ поля ввода */
.field { display: block; }
.field + .field { margin-top: 10px; }
.field > span { display: block; font-size: 13px; color: var(--label-2); padding: 0 4px 6px; }
.input {
  width: 100%; height: 50px; padding: 0 16px; border-radius: var(--r-md); border: 0; outline: none;
  background: var(--fill); color: var(--label); font-size: 17px;
  transition: box-shadow 200ms ease, background 200ms ease;
}
.input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 45%, transparent); background: var(--card); }
.input::placeholder { color: var(--label-3); }
.input.code { font-family: var(--font-rounded); font-size: 24px; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.row .input { height: 36px; background: transparent; padding: 0; text-align: right; border-radius: 0; }
.row .input:focus { box-shadow: none; }
.input-wrap { position: relative; }
.input-wrap .eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; color: var(--label-2); }
.form-error { color: var(--red); font-size: 15px; padding: 10px 4px 0; min-height: 20px; }
.stepper { display: inline-flex; align-items: center; background: var(--fill); border-radius: 9px; height: 32px; overflow: hidden; }
.stepper button { width: 44px; height: 32px; display: grid; place-items: center; font-size: 20px; color: var(--label); }
.stepper button:active { background: var(--fill-2); }
.stepper .sep { width: 1px; height: 18px; background: var(--sep); }
.stepper-val { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; color: var(--label); }

/* ------------------------------------------------------------------ бейджи, точки */
.pill-badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--fill); color: var(--label-2); white-space: nowrap; }
.pill-badge.green { background: var(--green-soft); color: var(--green); }
.pill-badge.red { background: var(--red-soft); color: var(--red); }
.pill-badge.orange { background: var(--orange-soft); color: var(--orange); }
.pill-badge.cyan { background: var(--cyan-soft); color: var(--cyan); }
.pill-badge.blue { background: var(--blue-soft); color: var(--blue); }
.pill-badge svg { width: 14px; height: 14px; }
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.live-dot.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: pulse 2.2s var(--ease-out) infinite; }
@keyframes pulse { 0% { transform: scale(0.6); opacity: 0.7; } 80%, 100% { transform: scale(1.9); opacity: 0; } }
.chg { display: inline-flex; align-items: center; justify-content: center; min-width: 66px; height: 26px; padding: 0 8px; border-radius: 7px; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; color: #fff; background: var(--gray); }
.chg.up { background: var(--green); color: #fff; }
.chg.down { background: var(--red); color: #fff; }

/* ------------------------------------------------------------------ главный блок (капитал) */
.hero { padding: 22px 20px 18px; overflow: hidden; }
.hero-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.hero-label { font-size: 15px; color: var(--label-2); display: flex; align-items: center; gap: 6px; }
.hero-value { font-family: var(--font-rounded); font-size: clamp(34px, 10.4vw, 48px); line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; white-space: nowrap; }
.hero-value .cur { font-size: 0.48em; font-weight: 600; color: var(--label-2); margin-left: 6px; letter-spacing: 0; }
@media (max-width: 520px) { .hero-value .cur { display: none; } .hero .clock-ring, .hero .clock-ring svg { width: 62px; height: 62px; } .hero .clock-ring .c-txt { font-size: 13px; } }
.hero-sub { margin-top: 4px; font-size: 15px; color: var(--label-2); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.hero-status { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-glow { position: absolute; inset: -40% -20% auto auto; width: 70%; height: 140%; pointer-events: none; opacity: 0.38; filter: blur(50px); transition: background 1.2s ease; z-index: 0; }
.hero > *:not(.hero-glow) { position: relative; z-index: 1; }
.spark-hero { margin-top: 14px; height: 54px; width: 100%; display: block; }

/* кольцо свечи: обратный отсчёт */
.clock { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.clock-ring { position: relative; width: 74px; height: 74px; }
.clock-ring svg { width: 74px; height: 74px; transform: rotate(-90deg); }
.clock-ring .c-bg { stroke: var(--fill-2); }
.clock-ring .c-fg { stroke: var(--tint); transition: stroke-dashoffset 1s linear; }
.clock-ring .c-txt { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-rounded); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.clock small { font-size: 11px; color: var(--label-2); text-align: center; line-height: 13px; }

/* ------------------------------------------------------------------ кольца «тишины» */
.ring { position: relative; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); overflow: visible; }
.ring .r-bg { stroke: var(--fill-2); }
.ring .r-fg { transition: stroke-dashoffset 1.1s var(--spring), stroke 400ms ease; }
.ring .r-notch { stroke: var(--label-3); }
.ring .r-txt { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-rounded); font-weight: 700; font-variant-numeric: tabular-nums; }
.ring.quiet .r-fg { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--cyan) 55%, transparent)); }

/* ------------------------------------------------------------------ список монет */
.coins { padding: 6px 0; }
.coin-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 10px 16px; width: 100%; text-align: left; position: relative; transition: background 140ms ease; border-radius: 0; }
.coin-row::after { content: ""; position: absolute; left: 70px; right: 0; bottom: 0; border-bottom: 0.5px solid var(--sep); }
.coin-row:last-child::after { display: none; }
.coin-row:active { background: var(--fill); }
.coin-name { min-width: 0; }
.coin-name b { display: block; font-size: 17px; font-weight: 600; }
.coin-name > span { display: block; font-size: 13px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-name > span.state-long { color: var(--green); }
.coin-name > span.state-short { color: var(--red); }
.coin-name > span.state-armed { color: var(--cyan); }
.coin-price { text-align: right; }
.coin-price b { display: block; font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; transition: color 600ms ease; }
.coin-spark { width: 64px; height: 30px; }
@media (max-width: 420px) { .coin-spark { display: none; } .coin-row { grid-template-columns: auto 1fr auto; } }
.flash-up { animation: flashUp 900ms ease; }
.flash-down { animation: flashDown 900ms ease; }
@keyframes flashUp { 0% { color: var(--green); } 100% { color: inherit; } }
@keyframes flashDown { 0% { color: var(--red); } 100% { color: inherit; } }

.monogram { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: 0; color: #fff; flex-shrink: 0; }

/* ------------------------------------------------------------------ сигналы и позиции */
.alert-card { display: flex; gap: 14px; align-items: flex-start; }
.alert-card .icon-tile { width: 40px; height: 40px; border-radius: 12px; }
.alert-card .icon-tile svg { width: 24px; height: 24px; }
.alert-body { flex: 1; min-width: 0; }
.alert-body p { margin: 4px 0 0; white-space: pre-line; color: var(--label-2); font-size: 15px; line-height: 20px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; margin-top: 12px; }
.kv dt { color: var(--label-2); white-space: nowrap; }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.rbar { position: relative; height: 6px; border-radius: 999px; background: var(--fill-2); margin: 14px 0 6px; overflow: visible; }
.rbar .rfill { position: absolute; top: 0; bottom: 0; border-radius: 999px; transition: left 800ms var(--spring), width 800ms var(--spring); }
.rbar .rmark { position: absolute; top: -5px; width: 2px; height: 16px; border-radius: 2px; background: var(--label-3); }
.rbar .rnow { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--card); border: 3px solid currentColor; transition: left 800ms var(--spring); }
.rbar-legend { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.rbar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rbar-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.coin-name .side-l { color: var(--green); }
.coin-name .side-s { color: var(--red); }

/* ------------------------------------------------------------------ лента событий */
.day-label { font-size: 13px; color: var(--label-2); padding: 18px 4px 8px; font-weight: 600; }
.event { display: flex; gap: 12px; padding: 12px 16px; position: relative; align-items: flex-start; }
.event::after { content: ""; position: absolute; left: 58px; right: 0; bottom: 0; border-bottom: 0.5px solid var(--sep); }
.event:last-child::after { display: none; }
.event .icon-tile { margin-top: 1px; }
.event-body { flex: 1; min-width: 0; }
.event-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.event-top b { font-size: 15px; font-weight: 600; line-height: 20px; }
.event-top time { font-size: 13px; color: var(--label-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.event-body p { margin: 2px 0 0; font-size: 15px; line-height: 20px; color: var(--label-2); white-space: pre-line; }
.event .src { font-size: 11px; font-weight: 600; color: var(--label-2); background: var(--fill); border-radius: 5px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.empty { text-align: center; padding: 48px 20px; color: var(--label-2); }
.empty svg { width: 48px; height: 48px; margin: 0 auto 12px; color: var(--label-3); }
.empty b { display: block; color: var(--label); font-size: 17px; margin-bottom: 4px; }

/* ------------------------------------------------------------------ график */
.chart-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.chart-price { font-family: var(--font-rounded); font-size: 40px; line-height: 46px; font-weight: 700; letter-spacing: -0.02em; }
.coin-pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 4px 14px; margin: 0 -4px; scrollbar-width: none; scroll-snap-type: x proximity; }
.coin-pills::-webkit-scrollbar { display: none; }
.coin-pill { flex-shrink: 0; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--fill); font-size: 15px; font-weight: 600; color: var(--label); display: inline-flex; align-items: center; gap: 6px; scroll-snap-align: start; transition: background 240ms ease, color 240ms ease, transform 380ms var(--spring-bouncy); }
.coin-pill:active { transform: scale(0.94); }
.coin-pill[aria-pressed="true"] { background: var(--label); color: var(--bg); }
.coin-pill .live-dot { width: 6px; height: 6px; }
.chart-card { padding: 0; overflow: hidden; }
.chart-box { position: relative; height: min(62vh, 560px); min-height: 340px; }
.chart-legend { position: absolute; top: 10px; left: 12px; z-index: 3; pointer-events: none; font-size: 12px; line-height: 16px; color: var(--label-2); font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 2px 10px; max-width: calc(100% - 90px); }
.chart-legend b { color: var(--label); font-weight: 600; }
.chart-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-top: 0.5px solid var(--sep); flex-wrap: wrap; }
.legend-keys { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--label-2); }
.legend-keys i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.chart-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--label-2); z-index: 2; background: var(--card); transition: opacity 300ms ease; }
.levels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .levels { grid-template-columns: repeat(4, 1fr); } }
.level { padding: 14px 16px; }
.level small { display: block; font-size: 13px; color: var(--label-2); }
.level b { display: block; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 4px; letter-spacing: -0.02em; }
.level span { display: block; font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ статистика */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 16px; }
.stat small { font-size: 13px; color: var(--label-2); display: block; }
.stat b { display: block; font-family: var(--font-rounded); font-size: 28px; line-height: 34px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.trade-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 16px; position: relative; }
.trade-row::after { content: ""; position: absolute; left: 58px; right: 0; bottom: 0; border-bottom: 0.5px solid var(--sep); }
.trade-row:last-child::after { display: none; }
.trade-row .side { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.trade-row .side svg { width: 18px; height: 18px; }
.trade-row .side.long { background: var(--green-soft); color: var(--green); }
.trade-row .side.short { background: var(--red-soft); color: var(--red); }
.trade-row b { font-weight: 600; font-size: 16px; }
.trade-row small { display: block; font-size: 13px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.trade-row .res { text-align: right; font-variant-numeric: tabular-nums; }
.trade-row .res b { font-family: var(--font-rounded); }

/* ------------------------------------------------------------------ модальные листы */
.sheet-layer { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.36); opacity: 0; transition: opacity 380ms ease; }
.sheet {
  position: relative; width: 100%; max-width: 640px; max-height: calc(100dvh - var(--safe-top) - 10px);
  background: var(--sheet-bg); border-radius: 14px 14px 0 0; box-shadow: var(--shadow-pop);
  transform: translateY(100%); transition: transform var(--t-spring) var(--spring);
  display: flex; flex-direction: column; overflow: hidden; touch-action: pan-y;
}
.sheet-layer.open .sheet { transform: translateY(0); }
.sheet-layer.open .sheet-backdrop { opacity: 1; }
.sheet-layer.closing .sheet { transform: translateY(105%); transition: transform 320ms var(--ease-in); }
.sheet-layer.closing .sheet-backdrop { opacity: 0; transition-duration: 280ms; }
.sheet-grab { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-3); margin: 6px auto 0; flex-shrink: 0; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 12px 6px; flex-shrink: 0; }
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; grid-column: 2; }
.sheet-head .close { grid-column: 3; justify-self: end; }
.sheet-body { overflow-y: auto; padding: 8px 16px calc(24px + var(--safe-bottom)); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-body .group { box-shadow: none; }
.sheet-body .group, .sheet-body .row { background: var(--sheet-group); }
@media (min-width: 720px) {
  .sheet-layer { align-items: center; }
  .sheet { border-radius: 16px; transform: translateY(24px) scale(0.96); opacity: 0; transition: transform 520ms var(--spring), opacity 240ms ease; max-height: min(86dvh, 820px); }
  .sheet-layer.open .sheet { transform: none; opacity: 1; }
  .sheet-layer.closing .sheet { transform: translateY(12px) scale(0.97); opacity: 0; transition-duration: 220ms; }
  .sheet-grab { display: none; }
}
.prose { font-size: 15px; line-height: 21px; color: var(--label-2); }
.prose p { margin: 0 0 10px; }
.prose ol, .prose ul { margin: 0 0 10px; padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose b { color: var(--label); font-weight: 600; }
.qr { width: 200px; height: 200px; margin: 6px auto 14px; background: #fff; border-radius: 14px; padding: 8px; }
.code-box { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 15px; background: var(--fill); border-radius: 10px; padding: 10px 12px; word-break: break-all; user-select: all; -webkit-user-select: all; }

/* ------------------------------------------------------------------ «остров» уведомлений */
.island-layer { position: fixed; top: calc(var(--safe-top) + 8px); left: 0; right: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.island {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; color: #fff;
  background: var(--island-bg); border-radius: 26px; padding: 0 14px; height: 40px; width: 150px; overflow: hidden;
  box-shadow: var(--island-edge), 0 10px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(-30px) scale(0.6); opacity: 0;
  transition: transform var(--t-bouncy) var(--spring-bouncy), opacity 200ms ease, width 620ms var(--spring-bouncy), height 620ms var(--spring-bouncy), border-radius 620ms var(--spring);
}
.island.in { transform: none; opacity: 1; }
.island.wide { width: min(420px, calc(100vw - 24px)); height: 72px; border-radius: 30px; padding: 0 18px; }
.island.out { transform: translateY(-20px) scale(0.85); opacity: 0; width: 150px; height: 40px; transition-duration: 380ms, 300ms, 380ms, 380ms, 380ms; transition-timing-function: var(--ease-in); }
.island .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.island .ic svg { width: 20px; height: 20px; }
.island .tx { min-width: 0; opacity: 0; transform: translateY(4px); transition: opacity 260ms ease 160ms, transform 500ms var(--spring) 160ms; }
.island.wide .tx { opacity: 1; transform: none; }
.island .tx b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.island .tx span { display: block; font-size: 13px; color: rgba(255, 255, 255, 0.65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ вход и регистрация */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--safe-top) + 24px) 20px calc(var(--safe-bottom) + 24px); position: relative; overflow: hidden; }
.aurora { position: fixed; inset: -20%; z-index: 0; pointer-events: none; opacity: 0.55; }
.aurora i { position: absolute; width: 48vmax; height: 48vmax; border-radius: 50%; filter: blur(70px); animation: drift 22s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { background: color-mix(in srgb, var(--cyan) 55%, transparent); left: 8%; top: 12%; }
.aurora i:nth-child(2) { background: color-mix(in srgb, var(--indigo) 45%, transparent); right: 6%; top: 30%; animation-duration: 28s; animation-delay: -6s; }
.aurora i:nth-child(3) { background: color-mix(in srgb, var(--green) 35%, transparent); left: 30%; bottom: 4%; animation-duration: 32s; animation-delay: -12s; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(6vmax, -4vmax) scale(1.15); } }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 400px; background: var(--material-thick); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border-radius: var(--r-xl); padding: 34px 24px 26px; box-shadow: var(--shadow-pop); }
.auth-card .app-icon { width: 76px; height: 76px; border-radius: 18px; margin: 0 auto 18px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); }
.auth-card h1 { text-align: center; }
.auth-card .lead { text-align: center; color: var(--label-2); margin: 8px 0 24px; font-size: 15px; line-height: 20px; }
.auth-card .btn { margin-top: 18px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--label-2); line-height: 18px; }
.shake { animation: shake 520ms var(--ease-out); }
@keyframes shake { 0%, 100% { transform: translateX(0); } 15% { transform: translateX(-10px); } 30% { transform: translateX(9px); } 45% { transform: translateX(-7px); } 60% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

/* ------------------------------------------------------------------ числа с прокруткой цифр */
.roll { display: inline-flex; overflow: hidden; vertical-align: top; height: 1.13em; line-height: 1.13em; }
.roll .d { display: inline-block; height: 1.13em; overflow: hidden; position: relative; }
.roll .d > span { display: flex; flex-direction: column; transition: transform 900ms var(--spring); }
.roll .d > span > i { font-style: normal; height: 1.13em; line-height: 1.13em; text-align: center; }
.roll .c { display: inline-block; }

/* ------------------------------------------------------------------ анимации появления */
.boot .reveal { animation: rise 760ms var(--spring) both; animation-delay: calc(var(--i, 0) * 55ms + 80ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.985); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
.page-enter { animation: pageIn 460ms var(--spring) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pop-in { animation: popIn 560ms var(--spring-bouncy) both; }
@keyframes popIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
.skeleton { background: linear-gradient(90deg, var(--fill) 0%, var(--fill-2) 50%, var(--fill) 100%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: 8px; color: transparent !important; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

::view-transition-old(page) { animation: vtOut 200ms var(--ease-in) both; }
::view-transition-new(page) { animation: vtIn 460ms var(--spring) both; }
@keyframes vtOut { to { opacity: 0; transform: scale(0.985); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(12px); } }

.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r-md); background: var(--orange-soft); color: var(--label); font-size: 15px; margin-top: 12px; }
.banner svg { width: 22px; height: 22px; color: var(--orange); flex-shrink: 0; }
.banner.red { background: var(--red-soft); }
.banner.red svg { color: var(--red); }
.banner.blue { background: var(--blue-soft); }
.banner.blue svg { color: var(--blue); }

.attribution { font-size: 12px; color: var(--label-3); text-align: center; margin-top: 30px; }
.attribution a { color: var(--label-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .aurora { display: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
