:root {
  color-scheme: dark;
  --text: #f4eded;
  --muted: #afa1a5;
  --muted-2: #7c7075;
  --accent: #bb1739;
  --accent-2: #d64e36;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --panel: rgba(255, 255, 255, 0.04);
  --panel-2: rgba(255, 255, 255, 0.06);
  --ok: #35c46a;
  --radius: 18px;
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 4%, rgba(187, 23, 57, 0.28), transparent 30%),
    radial-gradient(circle at 88% 0%, rgba(112, 21, 38, 0.22), transparent 26%),
    linear-gradient(180deg, #0b0809 0%, #050505 45%, #080707 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

/* --- Загрузка --- */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.boot__mark {
  width: 62px; height: 62px; border-radius: 18px;
  background: linear-gradient(135deg, var(--accent) 0%, #7f182a 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 34px rgba(187, 23, 57, 0.4);
  animation: pulse 1.6s ease-in-out infinite;
}
.boot p { color: var(--muted); font-size: 0.94rem; margin: 0; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.94); opacity: 0.75; } }

/* --- Каркас --- */
.app { padding: 16px 16px 0; max-width: 620px; margin: 0 auto; }

.topbar { display: flex; align-items: center; gap: 11px; padding: 6px 0 18px; }
.topbar__mark {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--accent) 0%, #7f182a 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(187, 23, 57, 0.35);
}
.topbar__name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.topbar__name span { color: var(--accent-2); }
.topbar__user { margin-left: auto; color: var(--muted-2); font-size: 0.82rem; }

h1.screen-title {
  font-family: "Space Grotesk", "Arial Black", sans-serif;
  font-size: 1.72rem; letter-spacing: -0.04em; margin: 0 0 4px; font-weight: 700;
}
.screen-sub { color: var(--muted); font-size: 0.94rem; margin: 0 0 18px; line-height: 1.5; }

/* --- Карточка-плитка --- */
.tile {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 18px; margin-bottom: 12px;
}
.tile--flat { background: transparent; }

/* --- Виртуальная карта --- */
.paycard {
  position: relative; border-radius: 20px; padding: 20px; margin-bottom: 14px; overflow: hidden;
  background:
    radial-gradient(circle at 82% 12%, rgba(214, 78, 54, 0.34), transparent 46%),
    linear-gradient(150deg, #1d0e11 0%, #130809 55%, #0a0405 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.paycard__top { display: flex; align-items: center; justify-content: space-between; }
.paycard__chip { width: 38px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #d8a04a, #a4712a); }
.paycard__num { font-family: "Space Grotesk", ui-monospace, monospace; font-size: 1.16rem; letter-spacing: 0.1em; margin: 22px 0 16px; }
.paycard__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.paycard__label { font-size: 0.58rem; letter-spacing: 0.14em; color: #9a8a8c; text-transform: uppercase; }
.paycard__val { font-size: 0.86rem; font-weight: 600; margin-top: 3px; }
.paycard__balance { font-family: "Space Grotesk", sans-serif; font-size: 1.5rem; font-weight: 700; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-strong); }
.status--active { color: var(--ok); border-color: rgba(53, 196, 106, 0.35); background: rgba(53, 196, 106, 0.1); }
.status--pending { color: var(--accent-2); border-color: rgba(214, 78, 54, 0.35); background: rgba(214, 78, 54, 0.1); }
.status--frozen { color: var(--muted-2); }

/* --- Пустое состояние --- */
.empty { text-align: center; padding: 34px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty__ic {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px;
  background: linear-gradient(135deg, rgba(187, 23, 57, 0.3), rgba(127, 24, 42, 0.14));
  border: 1px solid var(--line-strong); color: var(--accent-2);
  display: flex; align-items: center; justify-content: center;
}
.empty h3 { margin: 0 0 6px; font-size: 1.06rem; }
.empty p { margin: 0 0 18px; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

/* --- Кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px; padding: 13px 20px; border: 1px solid transparent; border-radius: 14px;
  font: inherit; font-weight: 700; font-size: 0.98rem; color: var(--text); cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.985); }
.btn--primary { background: linear-gradient(135deg, var(--accent) 0%, #7f182a 100%); box-shadow: 0 10px 22px rgba(187, 23, 57, 0.28); }
.btn--ghost { background: var(--panel-2); border-color: var(--line-strong); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn + .btn { margin-top: 10px; }

/* --- Список строк --- */
.row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); margin-bottom: 9px; text-align: left;
  font: inherit; color: var(--text); cursor: pointer;
}
.row__ic { width: 34px; height: 34px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--panel-2); font-size: 1rem; }
.row__body { min-width: 0; flex: 1; }
.row__title { font-size: 0.95rem; font-weight: 600; }
.row__sub { font-size: 0.8rem; color: var(--muted-2); margin-top: 2px; }
.row__right { margin-left: auto; color: var(--muted); font-size: 0.86rem; white-space: nowrap; }
.row__chevron { color: var(--muted-2); }

/* --- Форма выпуска --- */
.field { margin-bottom: 16px; }
.field__label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.02em; }
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; min-height: 46px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: linear-gradient(135deg, var(--accent) 0%, #7f182a 100%); border-color: transparent; }
input.amount {
  width: 100%; min-height: 50px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--text); font: inherit; font-size: 1.1rem; font-weight: 700;
  padding: 12px 16px; outline: none;
}
input.amount:focus { border-color: var(--accent-2); }

.notice {
  border: 1px solid rgba(214, 78, 54, 0.3); background: rgba(214, 78, 54, 0.09);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 14px;
  color: #f0cfc8; font-size: 0.9rem; line-height: 1.5;
}
.notice b { color: #fff; }

/* --- Нижняя навигация --- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: 4px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(10, 8, 9, 0.94); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.tabbar button {
  flex: 1; background: none; border: 0; color: var(--muted-2); font: inherit; font-size: 0.7rem; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 4px; border-radius: 12px; cursor: pointer;
}
.tabbar button[aria-current="true"] { color: var(--accent-2); background: rgba(214, 78, 54, 0.1); }
.tabbar svg { width: 21px; height: 21px; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25); border-top-color: #fff;
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.center-pad { padding: 40px 0; text-align: center; color: var(--muted); }
