/* Гарант — мини-приложение Telegram. Тёмно-синяя тема с неоновыми акцентами.
   Неон несёт смысл, а не украшает:
     cyan  — действие (кнопки, ссылки, фокус)
     mint  — деньги в безопасности (заморожены на гаранте, выплачено)
     pink  — спор, опасное действие
     amber — срок, нужно внимание
     violet — команда гаранта (арбитр, владелец) */

@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(/fonts/unbounded-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(/fonts/unbounded-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, 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-display: swap;
  font-weight: 200 800;
  src: url(/fonts/manrope-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fonts/manrope-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, 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: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/fonts/jetbrains-mono-latin-500-normal.woff2) format('woff2');
}

:root {
  color-scheme: dark;
  --bg: #060d29;
  --surface: #0b1537;
  --surface-2: #111d4a;
  --surface-3: #18285e;
  --line: rgba(118, 152, 255, 0.13);
  --line-2: rgba(118, 152, 255, 0.26);
  --text: #eaf0ff;
  --muted: #94a1d0;
  --faint: #5f6ca0;

  --cyan: #22e6ff;
  --cyan-ink: #031330;
  --mint: #2dffaa;
  --mint-ink: #022519;
  --pink: #ff3f8e;
  --amber: #ffc53d;
  --violet: #a487ff;

  --cyan-soft: rgba(34, 230, 255, 0.1);
  --mint-soft: rgba(45, 255, 170, 0.09);
  --pink-soft: rgba(255, 63, 142, 0.1);
  --amber-soft: rgba(255, 197, 61, 0.1);
  --violet-soft: rgba(164, 135, 255, 0.12);

  --glow-cyan: 0 0 22px rgba(34, 230, 255, 0.38);
  --glow-mint: 0 0 22px rgba(45, 255, 170, 0.34);
  --glow-pink: 0 0 22px rgba(255, 63, 142, 0.38);

  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --tabbar-h: 68px;

  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --ui: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
/* Свечение «ночного неба» — одно на весь экран, не на каждой карточке */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(90% 46% at 18% -6%, rgba(56, 92, 255, 0.34), transparent 70%),
    radial-gradient(60% 36% at 100% 0%, rgba(34, 230, 255, 0.13), transparent 72%),
    radial-gradient(70% 40% at 50% 108%, rgba(164, 135, 255, 0.1), transparent 70%);
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--cyan); text-decoration: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 8px; }
::selection { background: rgba(34, 230, 255, 0.3); }
[hidden] { display: none !important; }

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
.c-cyan { color: var(--cyan); }
.c-mint { color: var(--mint); }
.c-pink { color: var(--pink); }
.c-amber { color: var(--amber); }
.c-violet { color: var(--violet); }
.icon { display: block; flex: none; }

#app {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 16px calc(32px + env(safe-area-inset-bottom));
}
#app.with-tabbar { padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }

.boot { min-height: 70vh; display: grid; place-items: center; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--surface-3); border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- заголовок экрана ---------- */
.topbar { display: flex; align-items: center; gap: 12px; min-height: 52px; margin-bottom: 6px; }
.topbar h1 {
  flex: 1; margin: 0;
  font: 600 21px/1.15 var(--display);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.topbar .sub { display: block; font: 600 12.5px/1.3 var(--ui); color: var(--muted); letter-spacing: 0; margin-top: 3px; }
.backlink { background: none; border: 0; color: var(--cyan); padding: 8px 2px; cursor: pointer; font-weight: 700; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); display: grid; place-items: center;
  font: 600 15px var(--display); cursor: pointer;
}

/* ---------- группы и строки ---------- */
.group-title { color: var(--muted); font-size: 13px; font-weight: 700; margin: 22px 4px 8px; }
.group-title .count { color: var(--faint); font-weight: 600; margin-left: 6px; }
.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.section + .section { margin-top: 12px; }
.pad { padding: 16px; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 52px;
  position: relative; width: 100%; text-align: left; background: none; border: 0; cursor: default;
}
button.row { cursor: pointer; transition: background 0.15s; }
button.row:active { background: var(--surface-2); }
.row + .row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
.row .grow { flex: 1; min-width: 0; }
.row .label { color: var(--muted); }
.row .value { text-align: right; overflow-wrap: anywhere; }
.row .chev { color: var(--faint); }
.foot { color: var(--muted); font-size: 13px; margin: 8px 4px 0; }

/* ---------- кнопки ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px; border: 0; border-radius: 14px; padding: 12px 16px; cursor: pointer;
  font: 750 15px/1.2 var(--ui); letter-spacing: 0.01em;
  background: var(--cyan); color: var(--cyan-ink); box-shadow: var(--glow-cyan);
  transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
.btn.money { background: var(--mint); color: var(--mint-ink); box-shadow: var(--glow-mint); }
.btn.ghost { background: transparent; color: var(--cyan); border: 1px solid rgba(34, 230, 255, 0.38); box-shadow: none; }
.btn.danger { background: transparent; color: var(--pink); border: 1px solid rgba(255, 63, 142, 0.38); box-shadow: none; }
.btn.plain { background: none; color: var(--cyan); box-shadow: none; min-height: 40px; }
.btn.small { min-height: 40px; font-size: 14px; border-radius: 11px; padding: 8px 12px; }
.btn + .btn { margin-top: 10px; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { margin-top: 0; }

/* ---------- поля ---------- */
.field { display: block; padding: 12px 16px 14px; position: relative; }
.field + .field::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
.field > span { display: block; font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-md);
  padding: 11px 13px; outline: none; font-size: 16px; font-weight: 600; resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus { border-color: rgba(34, 230, 255, 0.6); box-shadow: 0 0 0 3px rgba(34, 230, 255, 0.12); }
.field textarea { min-height: 110px; line-height: 1.45; font-weight: 500; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); font-weight: 500; }
.field .counter { position: absolute; right: 16px; top: 12px; font-size: 12px; color: var(--faint); font-weight: 600; }
.field .help { display: block; font-size: 12.5px; color: var(--faint); margin-top: 6px; font-weight: 600; }

.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 3px; gap: 3px; }
.seg button {
  flex: 1; border: 0; background: none; border-radius: 10px; padding: 9px 6px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: var(--muted); white-space: nowrap;
}
.seg button[aria-pressed='true'] { background: var(--surface-3); color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(34, 230, 255, 0.35); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.chips button[aria-pressed='true'] { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-soft); }

.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--cyan); flex: none; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); transition: 0.2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: 0.2s; }
.switch input:checked + i { background: rgba(255, 197, 61, 0.22); border-color: var(--amber); }
.switch input:checked + i::after { left: 23px; background: var(--amber); box-shadow: 0 0 12px rgba(255, 197, 61, 0.6); }

.search {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 14px; padding: 0 14px; margin-bottom: 10px;
}
.search input { flex: 1; border: 0; background: none; outline: none; padding: 13px 0; font-size: 16px; font-weight: 600; min-width: 0; }
.search input::placeholder { color: var(--faint); }
.search .icon { color: var(--muted); }

/* ---------- статусы ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 750; color: var(--muted); }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.pill.mint { color: var(--mint); }
.pill.amber { color: var(--amber); }
.pill.pink { color: var(--pink); }
.pill.cyan { color: var(--cyan); }
.pill.violet { color: var(--violet); }
.pill.off::before { box-shadow: none; background: var(--faint); }
.badge {
  min-width: 24px; height: 24px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center;
  font: 700 12px/1 var(--ui); background: var(--cyan-soft); color: var(--cyan); border: 1px solid rgba(34, 230, 255, 0.4);
}
.badge.pink { background: var(--pink-soft); color: var(--pink); border-color: rgba(255, 63, 142, 0.45); }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(255, 197, 61, 0.45); }
.badge.violet { background: var(--violet-soft); color: var(--violet); border-color: rgba(164, 135, 255, 0.45); }
.tag {
  display: inline-block; font-size: 11.5px; font-weight: 750; padding: 3px 8px; border-radius: 999px;
  background: var(--violet-soft); color: var(--violet); border: 1px solid rgba(164, 135, 255, 0.35); vertical-align: 1px;
}
.tag.pink { background: var(--pink-soft); color: var(--pink); border-color: rgba(255, 63, 142, 0.35); }

/* ---------- список сделок ---------- */
.deal-row { align-items: flex-start; gap: 14px; }
.deal-row .t { font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-row .sub { font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-row .pill { margin-top: 6px; }
.deal-row .amt { text-align: right; flex: none; }
.deal-row .amt b { display: block; font: 600 15px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.deal-row .amt small { color: var(--faint); font-size: 11.5px; font-weight: 700; }
.needs { position: absolute; left: 6px; top: 22px; width: 4px; height: 4px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); }

.empty { text-align: center; padding: 36px 24px; color: var(--muted); }
.empty b { display: block; color: var(--text); font: 600 15px/1.35 var(--display); margin-bottom: 8px; }

.notice { border-radius: var(--r-md); padding: 13px 15px; margin-top: 12px; font-size: 14px; border: 1px solid; }
.notice b { display: block; margin-bottom: 3px; font-weight: 800; }
.notice .btn { margin-top: 12px; }
.notice.amber { background: var(--amber-soft); border-color: rgba(255, 197, 61, 0.32); }
.notice.amber b { color: var(--amber); }
.notice.mint { background: var(--mint-soft); border-color: rgba(45, 255, 170, 0.28); }
.notice.mint b { color: var(--mint); }
.notice.pink { background: var(--pink-soft); border-color: rgba(255, 63, 142, 0.34); }
.notice.pink b { color: var(--pink); }
.notice.cyan { background: var(--cyan-soft); border-color: rgba(34, 230, 255, 0.3); }
.notice.cyan b { color: var(--cyan); }
.notice.violet { background: var(--violet-soft); border-color: rgba(164, 135, 255, 0.34); }
.notice.violet b { color: var(--violet); }

/* ---------- сделка ---------- */
.deal-head { padding: 20px 18px 18px; position: relative; overflow: hidden; }
.deal-head .title { font-weight: 750; font-size: 16px; overflow-wrap: anywhere; color: var(--muted); }
.amount { font: 600 36px/1.08 var(--display); letter-spacing: -0.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.amount small { font: 700 14px var(--ui); color: var(--muted); margin-left: 8px; letter-spacing: 0.02em; }
.deal-head .pill { margin-top: 10px; font-size: 13px; }
.deal-head.locked { border-color: rgba(45, 255, 170, 0.3); }
.deal-head.dispute { border-color: rgba(255, 63, 142, 0.34); }

/* Путь денег — главный элемент: где деньги прямо сейчас */
.track { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px -4px 0; }
.track .rail { position: absolute; left: 16.66%; right: 16.66%; top: 17px; height: 2px; background: var(--surface-3); border-radius: 2px; }
.track .fill {
  position: absolute; left: 16.66%; top: 17px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(45, 255, 170, 0.15), var(--mint)); box-shadow: 0 0 10px rgba(45, 255, 170, 0.7);
  transition: width 0.6s ease;
}
.track .stop { position: relative; text-align: center; font-size: 12px; font-weight: 700; color: var(--faint); }
.track .node {
  width: 12px; height: 12px; margin: 12px auto 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--surface-3); position: relative; z-index: 1;
}
.track .passed .node { border-color: var(--mint); }
.track .here { color: var(--text); }
.track .here .node {
  width: 36px; height: 36px; margin: 0 auto 6px; border: 0;
  background: var(--mint); color: var(--mint-ink); display: grid; place-items: center; box-shadow: var(--glow-mint);
}
.track .here.locked .node::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--mint);
  opacity: 0.5; animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(0.85); opacity: 0.7; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
.track.idle .here .node { background: var(--surface-3); color: var(--muted); box-shadow: none; }
.track.dispute .fill { background: linear-gradient(90deg, rgba(255, 63, 142, 0.15), var(--pink)); box-shadow: 0 0 10px rgba(255, 63, 142, 0.7); }
.track.dispute .passed .node { border-color: var(--pink); }
.track.dispute .here .node { background: var(--pink); color: #2a0012; box-shadow: var(--glow-pink); }
.track.dispute .here.locked .node::after { border-color: var(--pink); }

.next { padding: 16px; }
.next > p { margin: 0 0 12px; }
.deadline { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--amber); margin: -4px 0 14px; }

.pay-amount { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.addr {
  display: flex; flex-wrap: wrap; gap: 4px 10px; font: 500 15px/1.5 var(--mono);
  padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); margin: 8px 0;
}
.addr span:first-child, .addr span:last-child { color: var(--cyan); }
.links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--cyan);
  cursor: pointer; padding: 6px 0; font-size: 14px; font-weight: 700;
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-weight: 650; }

.timeline { list-style: none; margin: 0; padding: 14px 16px 14px 18px; }
.timeline li { position: relative; padding: 0 0 14px 20px; font-size: 14px; }
.timeline li::before { content: ''; position: absolute; left: 0; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.timeline li:first-child::before { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.timeline li::after { content: ''; position: absolute; left: 3px; top: 17px; bottom: 1px; width: 1px; background: var(--line-2); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline time { display: block; color: var(--faint); font-size: 12px; font-weight: 700; }
ol.steps { counter-reset: s; }
ol.steps li { counter-increment: s; }
ol.steps li::before {
  content: counter(s); width: 20px; height: 20px; top: 0; left: -2px; display: grid; place-items: center;
  font: 600 11px var(--display); color: var(--cyan-ink); background: var(--cyan); box-shadow: 0 0 10px rgba(34, 230, 255, 0.5);
}
ol.steps li { padding-left: 30px; }
ol.steps li::after { left: 8px; top: 24px; }

/* чат */
.chat { padding: 14px 12px 4px; display: flex; flex-direction: column; gap: 6px; max-height: 440px; overflow-y: auto; }
.msg { max-width: 82%; padding: 8px 12px 6px; border-radius: 16px 16px 16px 6px; background: var(--surface-2); align-self: flex-start; font-size: 14.5px; }
.msg.mine { align-self: flex-end; border-radius: 16px 16px 6px 16px; background: linear-gradient(135deg, rgba(34, 230, 255, 0.24), rgba(56, 92, 255, 0.3)); border: 1px solid rgba(34, 230, 255, 0.28); }
.msg.admin { background: var(--violet-soft); border: 1px solid rgba(164, 135, 255, 0.3); align-self: stretch; max-width: none; border-radius: 14px; }
.msg .who { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
.msg.admin .who { color: var(--violet); }
.msg time { display: block; font-size: 11px; color: var(--faint); text-align: right; margin-top: 2px; font-weight: 700; }
.msg img { display: block; max-width: 100%; max-height: 280px; border-radius: 10px; margin: 4px 0; cursor: zoom-in; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 12px; }
.composer textarea {
  flex: 1; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-2); padding: 10px 15px;
  min-height: 42px; max-height: 120px; resize: none; outline: none; font-size: 15px; line-height: 1.35; font-weight: 500;
}
.composer textarea:focus { border-color: rgba(34, 230, 255, 0.5); }
.composer button { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; }
.composer .send { background: var(--cyan); color: var(--cyan-ink); box-shadow: var(--glow-cyan); }
.composer .attach { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* ---------- PIN ---------- */
.pin-screen { min-height: 88vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 15px var(--display); letter-spacing: 0.04em; margin-bottom: 28px; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: var(--cyan-ink);
  background: linear-gradient(135deg, var(--cyan), #4f7dff); box-shadow: var(--glow-cyan);
}
.pin-screen h2, .sheet h2 { font: 600 19px/1.3 var(--display); margin: 0 0 8px; }
.pin-screen p, .sheet .sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; max-width: 330px; }
.sheet .sub { margin-left: auto; margin-right: auto; }
.sheet.form .sub { margin-left: 0; margin-right: 0; }
.dots { display: flex; gap: 16px; justify-content: center; height: 22px; align-items: center; margin: 4px 0 10px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--faint); transition: 0.15s; }
.dots i.on { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 12px rgba(34, 230, 255, 0.8); }
.dots.shake { animation: shake 0.35s; }
.dots.shake i.on, .dots.err i { border-color: var(--pink); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-err { min-height: 20px; color: var(--pink); font-size: 13.5px; font-weight: 700; margin-bottom: 10px; }
.keypad { display: grid; grid-template-columns: repeat(3, 74px); gap: 14px 26px; justify-content: center; margin-top: 6px; }
.keypad button {
  width: 74px; height: 74px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface);
  font: 500 26px var(--display); cursor: pointer; transition: border-color 0.1s, box-shadow 0.1s, background 0.1s;
}
.keypad button:active { border-color: var(--cyan); box-shadow: inset 0 0 18px rgba(34, 230, 255, 0.25); background: var(--surface-2); }
.sheet .keypad button { background: var(--surface-2); }
.keypad button.fn { background: none; border: 0; font: 750 14px var(--ui); color: var(--cyan); }
.keypad button.fn:disabled { color: var(--faint); }
.keypad button.fn:active { box-shadow: none; }

/* ---------- нижняя навигация ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 6px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(6, 13, 41, 0.86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar nav { max-width: 560px; margin: 0 auto; display: flex; align-items: flex-end; justify-content: space-around; }
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 2px;
  background: none; border: 0; color: var(--faint); font-size: 11px; font-weight: 750; cursor: pointer; position: relative;
}
.tabbar button[aria-current='page'] { color: var(--cyan); }
.tabbar button[aria-current='page'] .icon { filter: drop-shadow(0 0 6px rgba(34, 230, 255, 0.7)); }
.tabbar .create .ring {
  width: 52px; height: 52px; border-radius: 17px; margin-top: -22px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--cyan), #4f7dff); color: var(--cyan-ink); box-shadow: var(--glow-cyan);
}
.tabbar .create { color: var(--muted); }
.tabbar .dot { position: absolute; top: 2px; right: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); }

/* ---------- нижний лист ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(2, 6, 22, 0.66); z-index: 50; display: flex; align-items: flex-end;
  justify-content: center; animation: fade 0.18s ease; backdrop-filter: blur(3px);
}
.sheet {
  background: var(--surface); width: 100%; max-width: 560px; border-radius: 24px 24px 0 0; border: 1px solid var(--line-2); border-bottom: 0;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; animation: up 0.24s ease; text-align: center;
}
.sheet::before { content: ''; display: block; width: 38px; height: 4px; border-radius: 4px; background: var(--surface-3); margin: 0 auto 14px; }
.sheet.form { text-align: left; }
.sheet .field { padding-left: 0; padding-right: 0; }
.sheet .field::before { display: none; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80;
  background: var(--surface-3); color: var(--text); padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 700;
  max-width: calc(100% - 32px); text-align: center; border: 1px solid rgba(45, 255, 170, 0.4); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
#toast.err { border-color: rgba(255, 63, 142, 0.6); box-shadow: 0 0 24px rgba(255, 63, 142, 0.25); }

/* ---------- панель ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 15px; min-width: 0; }
.tile b { display: block; font: 600 19px/1.2 var(--display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 700; margin-top: 4px; }
.tile.mint b { color: var(--mint); }
.tile.pink { border-color: rgba(255, 63, 142, 0.5); background: var(--pink-soft); }
.tile.pink b { color: var(--pink); }
.tile.wide { grid-column: 1 / -1; }
.menu-row .ic {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--cyan); border: 1px solid var(--line);
}
.menu-row .ic.violet { color: var(--violet); }
.menu-row .ic.mint { color: var(--mint); }
.menu-row .ic.pink { color: var(--pink); }
.menu-row .ic.amber { color: var(--amber); }
.menu-row .t { font-weight: 750; }
.menu-row .sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.item { padding: 14px 16px; position: relative; }
.item + .item::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
.item .head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.item .head b { font-weight: 800; }
.item .amt { font: 600 15px var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.item .meta { font-size: 13px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.item .btn-row { margin-top: 12px; }
.wallet-card { padding: 18px 16px; }
.wallet-card .bal { font: 600 28px/1.15 var(--display); font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.wallet-card .bal small { font: 700 13px var(--ui); color: var(--muted); margin-left: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 360px) {
  .keypad { grid-template-columns: repeat(3, 66px); gap: 12px 20px; }
  .keypad button { width: 66px; height: 66px; }
  .amount { font-size: 30px; }
}
