/* Inter for text, Manrope for headings, self-hosted so the Mini App never waits on
   a third-party font host. Each subset declares the unicode-range it covers, so a
   Latin-only screen does not download the Cyrillic files. */
@font-face {
  font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-cyrillic-ext.woff2) format("woff2");
  unicode-range: u+0460-052f, u+1c80-1c8a, u+20b4, u+2de0-2dff, u+a640-a69f, u+fe2e-fe2f;
}
@font-face {
  font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-cyrillic.woff2) format("woff2");
  unicode-range: u+0301, u+0400-045f, u+0490-0491, u+04b0-04b1, u+2116;
}
@font-face {
  font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: u+0100-02ba, u+02bd-02c5, u+02c7-02cc, u+02ce-02d7, u+02dd-02ff, u+0304,
    u+0308, u+0329, u+1d00-1dbf, u+1e00-1e9f, u+1ef2-1eff, u+2020, u+20a0-20ab, u+20ad-20c0,
    u+2113, u+2c60-2c7f, u+a720-a7ff;
}
@font-face {
  font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-latin.woff2) format("woff2");
  unicode-range: u+00??, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da, u+02dc, u+0304,
    u+0308, u+0329, u+2000-206f, u+20ac, u+2122, u+2191, u+2193, u+2212, u+2215, u+feff, u+fffd;
}
@font-face {
  font-family: Manrope; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-cyrillic-ext.woff2) format("woff2");
  unicode-range: u+0460-052f, u+1c80-1c8a, u+20b4, u+2de0-2dff, u+a640-a69f, u+fe2e-fe2f;
}
@font-face {
  font-family: Manrope; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-cyrillic.woff2) format("woff2");
  unicode-range: u+0301, u+0400-045f, u+0490-0491, u+04b0-04b1, u+2116;
}
@font-face {
  font-family: Manrope; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-latin-ext.woff2) format("woff2");
  unicode-range: u+0100-02ba, u+02bd-02c5, u+02c7-02cc, u+02ce-02d7, u+02dd-02ff, u+0304,
    u+0308, u+0329, u+1d00-1dbf, u+1e00-1e9f, u+1ef2-1eff, u+2020, u+20a0-20ab, u+20ad-20c0,
    u+2113, u+2c60-2c7f, u+a720-a7ff;
}
@font-face {
  font-family: Manrope; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-latin.woff2) format("woff2");
  unicode-range: u+00??, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da, u+02dc, u+0304,
    u+0308, u+0329, u+2000-206f, u+20ac, u+2122, u+2191, u+2193, u+2212, u+2215, u+feff, u+fffd;
}

/* Colour follows deltaclient.xyz: near-black canvas, deep navy cards, a single
   periwinkle accent, neutral grey secondary text. Structure stays Apple's
   (inset-grouped lists, translucent chrome, tracking that changes with size).
   Dark is the default; `html[data-theme="light"]` swaps the same names, so every
   rule below stays theme-agnostic. */
:root {
  color-scheme: dark;

  --bg: #111216;
  --surface: #171c33;
  --surface2: #1e2440;
  --surface3: #2a3150;
  --fill: rgba(255, 255, 255, 0.07);
  --fill2: rgba(255, 255, 255, 0.12);
  --fill3: rgba(255, 255, 255, 0.17);
  --sep: rgba(255, 255, 255, 0.1);

  --label: #fafafa;
  --label2: rgba(250, 250, 250, 0.6);
  --label3: rgba(250, 250, 250, 0.34);

  --blue: #859bff;
  --teal: #5bb8e0;
  --green: #00c98a;
  --orange: #ffb066;
  --pink: #c24c5c;
  --red: #c24c5c;
  --gray: #71717a;

  /* Glyph colour per tint: the light hues take a near-black glyph, the muted
     ones white, so a tinted tile is legible whichever hue it draws. */
  --on-blue: #0a0d1a;
  --on-teal: #0a0d1a;
  --on-green: #0a0d1a;
  --on-orange: #0a0d1a;
  --on-pink: #fff;
  --on-red: #fff;
  --on-gray: #fff;

  /* Names the markup uses. */
  --text: var(--label);
  --dim: var(--label2);
  --accent: var(--blue);
  --accent-soft: rgba(133, 155, 255, 0.16);
  /* Glyphs and text that sit on a filled accent. Periwinkle is too light to carry
     white, so — as on the reference site — near-black goes on top. */
  --on-accent: #0a0d1a;
  --ink: #a9b8ff;
  --card: var(--surface);
  --card2: var(--surface2);
  --line: var(--sep);
  --good: var(--green);
  --warn: var(--orange);
  --bad: var(--red);
  --accent-line: rgba(133, 155, 255, 0.38);
  --radius: 14px;

  /* Tints as text need more lift than the same colour as a fill. */
  --good-soft: rgba(0, 201, 138, 0.18);
  --bad-soft: rgba(194, 76, 92, 0.22);
  --warn-soft: rgba(255, 176, 102, 0.18);
  --ink-good: #34e3ab;
  --ink-bad: #f0808f;
  --ink-warn: #ffb066;
  --grad-hero: linear-gradient(150deg, #6b7ae8, #4a56b4 52%, #2a3150);
  --av-s: 46%;
  --av-l: 44%;

  /* Chrome and materials, so the accessibility fallbacks stay one-line swaps. */
  --ambient: radial-gradient(115% 46% at 50% -12%, rgba(133, 155, 255, 0.11), transparent 70%);
  --chrome: rgba(17, 18, 22, 0.78);
  --chrome-solid: #111216;
  --chrome-line: rgba(255, 255, 255, 0.1);
  --chrome-fade: rgba(10, 13, 26, 0.62);
  --sheet-bg: rgba(23, 28, 51, 0.9);
  --sheet-solid: #171c33;
  --sheet-line: rgba(255, 255, 255, 0.12);
  --sheet-shadow: 0 -18px 50px rgba(0, 0, 0, 0.6);
  --grab: rgba(250, 250, 250, 0.3);
  --thumb: var(--surface3);
  --thumb-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  --toast-bg: rgba(42, 49, 80, 0.92);
  --toast-solid: #2a3150;
  --toast-fg: #fafafa;
  --card-shadow: none;
  --lift: 0 14px 34px rgba(10, 13, 26, 0.62);
  --glow: 0 5px 18px rgba(133, 155, 255, 0.34), 0 1px 3px rgba(133, 155, 255, 0.2);
  --veil-rgb: 10, 13, 26;
  --veil-a: 0.6;

  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-title: Manrope, Inter, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Continuity curve used for taps; gestures go through springs in motion.js. */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

/* Light set. The reference site is dark-only, so this keeps its hues and moves
   them onto paper: the accent darkens (periwinkle on white cannot carry white
   text, let alone read as a button) and fills invert to dark-on-light. */
html[data-theme="light"] {
  color-scheme: light;

  --bg: #f3f4f8;
  --surface: #fff;
  --surface2: #f3f4f8;
  --surface3: #e5e7f0;
  --fill: rgba(42, 49, 80, 0.07);
  --fill2: rgba(42, 49, 80, 0.12);
  --fill3: rgba(42, 49, 80, 0.17);
  --sep: rgba(42, 49, 80, 0.14);

  --label: #111216;
  --label2: rgba(17, 18, 22, 0.6);
  --label3: rgba(17, 18, 22, 0.32);

  --blue: #4c5fd7;
  --teal: #2f8fbd;
  --green: #00996a;
  --orange: #c2751f;
  --pink: #b03a4a;
  --red: #b03a4a;
  --gray: #71717a;

  /* Every light-theme hue is dark enough to carry a white glyph. */
  --on-blue: #fff;
  --on-teal: #fff;
  --on-green: #fff;
  --on-orange: #fff;
  --on-pink: #fff;
  --on-red: #fff;
  --on-gray: #fff;

  --accent-soft: rgba(76, 95, 215, 0.12);
  --accent-line: rgba(76, 95, 215, 0.3);
  --on-accent: #fff;
  --ink: #3b4cbb;

  --good-soft: rgba(0, 153, 106, 0.14);
  --bad-soft: rgba(176, 58, 74, 0.13);
  --warn-soft: rgba(194, 117, 31, 0.15);
  --ink-good: #007a55;
  --ink-bad: #a32e3f;
  --ink-warn: #98590f;
  --grad-hero: linear-gradient(150deg, #6473dd, #4c5fd7 52%, #333e9e);
  --av-s: 52%;
  --av-l: 48%;

  --ambient: radial-gradient(115% 46% at 50% -12%, rgba(76, 95, 215, 0.1), transparent 70%);
  --chrome: rgba(249, 250, 252, 0.82);
  --chrome-solid: #f9fafc;
  --chrome-line: rgba(42, 49, 80, 0.14);
  --chrome-fade: rgba(42, 49, 80, 0.07);
  --sheet-bg: rgba(255, 255, 255, 0.9);
  --sheet-solid: #fff;
  --sheet-line: rgba(42, 49, 80, 0.12);
  --sheet-shadow: 0 -18px 50px rgba(42, 49, 80, 0.22);
  --grab: rgba(42, 49, 80, 0.3);
  --thumb: #fff;
  --thumb-shadow: 0 3px 8px rgba(42, 49, 80, 0.16);
  /* Transient messages stay dark in both themes, as they do on iOS. */
  --toast-bg: rgba(23, 28, 51, 0.92);
  --toast-solid: #171c33;
  --toast-fg: #fafafa;
  --card-shadow: 0 1px 2px rgba(42, 49, 80, 0.07);
  --lift: 0 12px 26px rgba(76, 95, 215, 0.22);
  --glow: 0 5px 16px rgba(76, 95, 215, 0.3), 0 1px 3px rgba(76, 95, 215, 0.18);
  --veil-rgb: 42, 49, 80;
  --veil-a: 0.4;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.31 var(--font-sans);
  letter-spacing: -0.008em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* A single faint ambient wash so the flat canvas still reads as a lit surface. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--ambient);
}

/* Sheets dim and push the page back, so focus moves to the modal layer. */
#app {
  padding: 12px 16px 108px; max-width: 560px; margin: 0 auto;
  transform: scale(calc(1 - 0.024 * var(--sheet-p, 0)));
  transform-origin: 50% 0;
  border-radius: calc(20px * var(--sheet-p, 0));
  overflow: clip;
}

h1, h2 { font-family: var(--font-title); }

/* ---------- headers ---------- */
.header { display: flex; align-items: flex-end; gap: 10px; margin: 6px 0 16px; }
.header h1 { font-size: 1.75rem; line-height: 1.14; letter-spacing: -0.018em; font-weight: 700; margin: 0; }
.header .sub { color: var(--label2); font-size: 0.9375rem; line-height: 1.33;
  letter-spacing: -0.006em; margin-top: 3px; }

.hero { margin: 10px 0 18px; }
.hero h1 { margin: 0; font-size: 2.125rem; line-height: 1.06; letter-spacing: -0.021em; font-weight: 700; }
.hero p { margin: 7px 0 0; color: var(--label2); font-size: 0.9375rem; line-height: 1.33;
  letter-spacing: -0.006em; }

/* Grouped-list header, as in Settings. */
.sec {
  color: var(--label2); font-size: 0.8125rem; line-height: 1.38; font-weight: 400;
  letter-spacing: 0.04em; text-transform: uppercase; margin: 26px 4px 8px;
}
.sec.first { margin-top: 6px; }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--card-shadow);
  padding: 14px; margin-bottom: 10px;
}
.card.tap { cursor: pointer; }
/* A card that happens to be a link must still read as a card: the browser default
   paints anchors blue and underlines every line of text inside them. */
a.card, a.card:visited { display: block; color: inherit; text-decoration: none; }
a.card .chev { color: var(--label3); flex: 0 0 auto; }
/* The ribbon hangs over the top edge, so the card needs headroom of its own —
   otherwise it collides with whatever sits in the first row. */
.card.best {
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent);
  position: relative; padding-top: 22px;
}
.ribbon {
  position: absolute; top: -7px; right: 12px; background: var(--accent); color: var(--on-accent);
  font-size: 0.6875rem; line-height: 1.18; font-weight: 600; letter-spacing: 0.005em;
  padding: 3px 8px; border-radius: 999px;
}

.banner {
  display: flex; gap: 13px; align-items: center;
  background: var(--surface); border-radius: 16px; box-shadow: var(--card-shadow);
  padding: 14px; margin-bottom: 14px;
}
.banner .ico {
  width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto; color: var(--on-accent);
  background: var(--accent); display: grid; place-items: center;
}
.banner b { display: block; font-size: 1.0625rem; line-height: 1.29;
  letter-spacing: -0.011em; font-weight: 600; }
.banner span { color: var(--label2); font-size: 0.8125rem; line-height: 1.38; letter-spacing: 0; }

.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; row-gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--label2); font-size: 0.8125rem; line-height: 1.38; letter-spacing: 0; }

.cmd { display: flex; gap: 13px; align-items: flex-start; }
.cmd .ico {
  width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft);
  display: grid; place-items: center; flex: 0 0 auto; color: var(--accent);
}
.cmd b { font-size: 1.0625rem; line-height: 1.29; letter-spacing: -0.011em; font-weight: 600; }
.cmd p { margin: 3px 0 0; color: var(--label2); font-size: 0.8125rem; line-height: 1.38; letter-spacing: 0; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 600; font-size: 0.8125rem; color: #fff;
}

/* ---------- search ---------- */
.search {
  display: flex; align-items: center; gap: 8px; color: var(--label2);
  background: var(--fill); border-radius: 12px; padding: 9px 11px; margin-bottom: 14px;
}
.search input { flex: 1; background: none; border: 0; outline: none; color: var(--text);
  font: inherit; font-size: 1.0625rem; letter-spacing: -0.011em; }
.search input::placeholder { color: var(--label3); }

/* ---------- pills, tags ---------- */
.pill {
  font-size: 0.8125rem; line-height: 1.38; letter-spacing: 0; white-space: nowrap;
  padding: 3px 9px; border-radius: 999px; background: var(--fill); color: var(--label2);
}
.pill.accent { background: var(--accent-soft); color: var(--ink); }
.pill.good { background: var(--good-soft); color: var(--ink-good); }
.pill.bad { background: var(--bad-soft); color: var(--ink-bad); }
.pill.warn { background: var(--warn-soft); color: var(--ink-warn); }

.tags { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.tags::-webkit-scrollbar { display: none; }
.tag {
  white-space: nowrap; padding: 6px 13px; border-radius: 999px; scroll-snap-align: start;
  font-size: 0.9375rem; letter-spacing: -0.006em;
  background: var(--fill); color: var(--text); border: 0;
}
.tag.on { background: var(--accent); color: var(--on-accent); }

/* ---------- segmented control ---------- */
.seg {
  position: relative; display: flex; background: var(--fill); border-radius: 10px;
  padding: 2px; margin-bottom: 14px; isolation: isolate;
}
.seg-thumb {
  position: absolute; top: 2px; bottom: 2px; z-index: -1; border-radius: 8px;
  background: var(--thumb); box-shadow: var(--thumb-shadow);
  left: calc(2px + var(--i, 0) * (100% - 4px) / var(--n, 1));
  width: calc((100% - 4px) / var(--n, 1));
  transition: left 0.28s var(--ease);
}
.seg button {
  flex: 1; background: none; border: 0; color: var(--label2); font-family: inherit;
  font-size: 0.8125rem; line-height: 1.38; letter-spacing: 0; padding: 8px 4px;
  border-radius: 8px; transition: color 0.18s linear;
}
.seg button.on { color: var(--text); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: block; width: 100%; padding: 14px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent); font-family: inherit;
  font-size: 1.0625rem; line-height: 1.29; letter-spacing: -0.011em; font-weight: 600;
  margin-top: 10px;
}
/* Only the primary action glows: the accent lit from below is what makes it read
   as the one button to press. Secondary buttons must stay flat or the screen hums. */
.btn { box-shadow: var(--glow); }
.btn.ghost { background: var(--fill); color: var(--accent); box-shadow: none; }
.btn.line { background: var(--fill); color: var(--text); box-shadow: none; }
.btn.danger { background: var(--bad-soft); color: var(--ink-bad); box-shadow: none; }
/* The gap replaces the whitespace between an icon and its label: flex drops
   inter-node spaces, so `${svg(...)} Фильтры` would render glued together. */
.btn.sm { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: auto; padding: 8px 14px; border-radius: 10px; margin: 0;
  font-size: 0.9375rem; letter-spacing: -0.006em; white-space: nowrap; }
.icobtn {
  width: 38px; height: 38px; border-radius: 10px; border: 0; background: var(--fill);
  color: var(--text); display: grid; place-items: center; flex: 0 0 auto;
}
.icobtn.accent { background: var(--accent); color: var(--on-accent); }
/* Small buttons keep their labels intact, so a crowded row has to wrap rather
   than push the last one out of its card. */
.row.actions { gap: 8px; row-gap: 8px; margin-top: 11px; }

/* Press feedback lands on pointer-down and is short enough to feel like contact. */
.is-press { transition: transform 0.1s ease-out, background 0.08s linear, opacity 0.08s linear; }
.btn.is-press, .qcard.is-press, .card.tap.is-press, .tile.is-press { transform: scale(0.975); }
.btn.is-press { filter: brightness(0.86); box-shadow: none; }
.qcard.is-press, .card.tap.is-press, .guide-row.is-press, .kv-row.is-press { background: var(--fill2); }
.icobtn.is-press, .tag.is-press, .pro-btn.is-press, .seg button.is-press { background: var(--fill3); }
.tabbar button.is-press { opacity: 0.45; }

/* ---------- form controls ---------- */
label.field { display: block; margin: 14px 0 0; }
label.field span { display: block; font-size: 0.8125rem; line-height: 1.38; letter-spacing: 0;
  color: var(--label2); margin-bottom: 7px; }
/* A control that serves the field above it: compact, so it cannot be mistaken
   for the primary action, and its result line collapses while it is empty. */
.field-aside { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.field-aside > .muted:empty { display: none; }
/* A primary action needs more air than the gap between two stacked fields,
   otherwise it reads as part of the last control. */
label.field + .btn, .field-aside + .btn { margin-top: 20px; }
input[type=text], input[type=tel], input[type=number], textarea, select {
  width: 100%; background: var(--fill); border: 0; color: var(--text);
  border-radius: 12px; padding: 12px 13px; font: inherit;
  font-size: 1.0625rem; letter-spacing: -0.011em; outline: none;
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow 0.15s ease-out;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.41; }
input[type=file] {
  width: 100%; background: var(--fill); color: var(--label2);
  border: 1px dashed var(--surface3); border-radius: 12px; padding: 13px;
  font: inherit; font-size: 0.8125rem;
}
input[type=file]::file-selector-button {
  background: var(--surface3); color: var(--text); border: 0; border-radius: 8px;
  padding: 7px 12px; margin-right: 12px; font: inherit; font-size: 0.8125rem; font-weight: 500;
}
input:focus, textarea:focus, select:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
input::placeholder, textarea::placeholder { color: var(--label3); }
.check { display: flex; align-items: center; gap: 10px; margin-top: 13px;
  font-size: 1rem; letter-spacing: -0.008em; }
.check input { width: 21px; height: 21px; accent-color: var(--accent); }

/* ---------- tab bar: translucent chrome, content scrolls underneath ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--chrome);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 0.5px solid var(--chrome-line);
  padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
  display: flex; max-width: 560px; margin: 0 auto;
}
/* Scroll edge effect instead of a hard divider where content meets the bar. */
.tabbar::before {
  content: ""; position: absolute; left: 0; right: 0; top: -22px; height: 22px;
  background: linear-gradient(to top, var(--chrome-fade), transparent);
  pointer-events: none;
}
.tabbar button {
  flex: 1; background: none; border: 0; color: var(--label3); font-family: inherit;
  font-size: 0.625rem; line-height: 1.2; letter-spacing: 0.01em; font-weight: 500;
  display: grid; gap: 3px; justify-items: center; padding: 4px 2px;
  transition: color 0.18s linear;
}
.tabbar button.on { color: var(--accent); }

/* ---------- sheet: draggable material that arrives rather than fades ---------- */
body.sheet-open { overflow: hidden; }
.sheet-wrap {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(var(--veil-rgb), calc(var(--veil-a) * var(--sheet-p, 1)));
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: var(--sheet-bg);
  backdrop-filter: blur(34px) saturate(180%);
  -webkit-backdrop-filter: blur(34px) saturate(180%);
  border-top: 0.5px solid var(--sheet-line);
  border-radius: 14px 14px 0 0;
  padding: 0 16px calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--sheet-shadow);
}
.sheet.enter { animation: materialize 0.42s var(--ease); }
@keyframes materialize {
  from { transform: translateY(100%) scale(0.96); opacity: 0.2; filter: blur(8px); }
  to { transform: none; opacity: 1; filter: blur(0); }
}
/* The handle is the always-available drag target, and marks the sheet as grabbable. */
.grabber {
  position: sticky; top: 0; z-index: 2; margin: 0 -16px 2px; padding: 7px 0 11px;
  display: grid; place-items: center; touch-action: none; cursor: grab;
}
.grabber::after {
  content: ""; width: 36px; height: 5px; border-radius: 999px;
  background: var(--grab);
}
.sheet h2 { margin: 0 0 5px; font-size: 1.375rem; line-height: 1.2;
  letter-spacing: -0.013em; font-weight: 650; }
.sheet .hint { color: var(--label2); font-size: 0.8125rem; line-height: 1.38;
  letter-spacing: 0; margin: 0 0 8px; }

/* ---------- inset grouped lists ---------- */
.guide-list, .kv, .steps {
  background: var(--surface); border-radius: 12px; overflow: hidden; margin-bottom: 10px;
  box-shadow: var(--card-shadow);
}
.kv { margin: 10px 0; }
.guide-row { position: relative; display: flex; gap: 13px; align-items: center; padding: 11px 14px;
  min-height: 48px; }
.guide-row .ico {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent);
  display: grid; place-items: center; flex: 0 0 auto; color: var(--on-accent);
}
.guide-row .grow b { font-size: 1.0625rem; line-height: 1.29; letter-spacing: -0.011em;
  font-weight: 400; display: block; }
.guide-row .grow p { margin: 2px 0 0; color: var(--label2); font-size: 0.8125rem;
  line-height: 1.38; letter-spacing: 0; }
.guide-row .chev { color: var(--label3); flex: 0 0 auto; }
.guide-row input[type=checkbox] {
  width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--accent); pointer-events: none;
}
/* Hairline separators, inset past the icon like a native table view. */
.guide-row:not(:last-child)::after, .kv-row:not(:last-child)::after,
.step:not(:last-child)::after {
  content: ""; position: absolute; left: 57px; right: 0; bottom: 0; height: 1px;
  background: var(--sep); transform: scaleY(0.5); transform-origin: bottom;
}
.guide-row:not(:has(.ico)):not(:last-child)::after { left: 14px; }
.kv-row:not(:last-child)::after, .step:not(:last-child)::after { left: 14px; }

.kv-row { position: relative; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 12px 14px; min-height: 44px;
  font-size: 1.0625rem; letter-spacing: -0.011em; }
.kv-row span { color: var(--label2); font-size: 1rem; letter-spacing: -0.008em; }

.step { position: relative; display: flex; gap: 13px; padding: 13px 14px;
  font-size: 1rem; line-height: 1.41; letter-spacing: -0.008em; }
.step .n {
  width: 24px; height: 24px; border-radius: 999px; flex: 0 0 auto; background: var(--accent);
  color: var(--on-accent); display: grid; place-items: center; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0;
}

/* ---------- home ---------- */
.offer {
  background: var(--surface); border-radius: 16px; padding: 14px; margin-bottom: 12px;
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.offer b { display: block; font-size: 1.0625rem; line-height: 1.29; letter-spacing: -0.011em;
  font-weight: 600; margin-bottom: 3px; }
.offer > span { display: block; color: var(--label2); font-size: 0.8125rem; line-height: 1.38;
  letter-spacing: 0; }

/* Wallet-style card: the one place a gradient earns its keep. */
.pro {
  position: relative; overflow: hidden; border-radius: 18px; padding: 16px; margin-bottom: 12px;
  background: var(--grad-hero);
  box-shadow: var(--lift);
  color: #fff;
}
.pro::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(85% 60% at 88% -12%, rgba(255, 255, 255, 0.26), transparent 70%);
}
.pro > * { position: relative; }
.pro b { font-size: 1.0625rem; line-height: 1.29; letter-spacing: -0.011em; font-weight: 600; }
/* Vibrancy: on a live gradient, secondary text needs contrast and weight, not grey. */
.pro-dim { font-size: 0.8125rem; line-height: 1.38; letter-spacing: 0.005em;
  color: rgba(255, 255, 255, 0.82); font-weight: 500; }
.pro-btn {
  background: rgba(255, 255, 255, 0.22); border: 0; color: #fff; font-family: inherit;
  font-size: 0.8125rem; letter-spacing: 0.005em; font-weight: 600;
  padding: 7px 11px; border-radius: 999px; display: flex; align-items: center; gap: 3px;
}
.pro-bal { margin: 18px 0 14px; }
.pro-bal span { display: block; font-size: 0.8125rem; letter-spacing: 0.005em;
  color: rgba(255, 255, 255, 0.82); font-weight: 500; }
.pro-bal b { font-size: 2.125rem; line-height: 1.06; letter-spacing: -0.021em; font-weight: 700; }
.pro-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.28); padding-top: 12px;
  font-size: 0.8125rem; line-height: 1.38; letter-spacing: 0.005em;
  color: rgba(255, 255, 255, 0.86); font-weight: 500;
}
.pro-foot button {
  background: none; border: 0; color: #fff; font-family: inherit; padding: 0; flex: 0 0 auto;
  font-size: 0.8125rem; letter-spacing: 0.005em; font-weight: 600;
  display: flex; align-items: center; gap: 2px;
}

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border-radius: 14px; padding: 13px 14px;
  box-shadow: var(--card-shadow); }
.tile span { color: var(--label2); font-size: 0.8125rem; line-height: 1.38; letter-spacing: 0; }
.tile b { display: block; font-size: 1.75rem; line-height: 1.14; letter-spacing: -0.018em;
  font-weight: 700; margin-top: 5px; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick .qcard { background: var(--surface); border-radius: 14px; padding: 13px 14px;
  box-shadow: var(--card-shadow); }
.quick .ico {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent);
  display: grid; place-items: center; color: var(--on-accent); margin-bottom: 10px;
}
.quick b { display: block; font-size: 1rem; line-height: 1.31; letter-spacing: -0.008em;
  font-weight: 600; }
.quick span { display: block; color: var(--label2); font-size: 0.8125rem; line-height: 1.38;
  letter-spacing: 0; margin-top: 2px; }

/* ---------- misc ---------- */
.log { font-size: 0.8125rem; line-height: 1.38; letter-spacing: 0; color: var(--label2);
  border-left: 2px solid var(--surface3); padding: 2px 0 2px 10px; margin-top: 8px; }
.log.warn { border-color: var(--orange); }
.log.error { border-color: var(--red); color: var(--ink-bad); }
.empty { text-align: center; color: var(--label2); padding: 44px 16px;
  font-size: 1rem; line-height: 1.41; letter-spacing: -0.008em; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translate(-50%, 0); z-index: 60; max-width: 88%;
  background: var(--toast-bg);
  backdrop-filter: blur(22px) saturate(180%); -webkit-backdrop-filter: blur(22px) saturate(180%);
  color: var(--toast-fg); padding: 11px 17px; border-radius: 999px;
  font-size: 0.9375rem; line-height: 1.33; letter-spacing: -0.006em; font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  will-change: transform, opacity;
}

.skel { height: 64px; border-radius: 14px; background: var(--surface);
  animation: pulse 1.6s ease-in-out infinite; margin-bottom: 10px; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---------- accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  .sheet.enter { animation: none; }
  .seg-thumb, .is-press, .tabbar button, .seg button { transition: none; }
  .skel { animation: none; opacity: 0.6; }
  .btn.is-press, .qcard.is-press, .card.tap.is-press, .tile.is-press { transform: none; }
  #app { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  body::before { display: none; }
  .tabbar { background: var(--chrome-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .sheet { background: var(--sheet-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .toast { background: var(--toast-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .search, .pill, .tag, .seg, .btn.ghost, .btn.line, .icobtn, input, textarea, select {
    background: var(--surface2);
  }
}
@media (prefers-contrast: more) {
  :root { --label2: rgba(250, 250, 250, 0.84); --label3: rgba(250, 250, 250, 0.56);
    --sep: rgba(255, 255, 255, 0.32); --edge: rgba(255, 255, 255, 0.28);
    --chrome-solid: #111216; --sheet-solid: #1e2440; }
  html[data-theme="light"] { --label2: rgba(17, 18, 22, 0.84); --label3: rgba(17, 18, 22, 0.58);
    --sep: rgba(42, 49, 80, 0.45); --edge: rgba(42, 49, 80, 0.36);
    --chrome-solid: #fff; --sheet-solid: #fff; }
  body::before { display: none; }
  .card, .banner, .tile, .qcard, .guide-list, .kv, .steps, .offer {
    box-shadow: inset 0 0 0 1px var(--edge);
  }
  .tabbar, .sheet, .toast { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabbar { background: var(--chrome-solid); }
  .sheet { background: var(--sheet-solid); }
}
