/* Кубышка — личный кабинет (мини-приложение Telegram).
   Фирменный стиль взят с вывесок офисов в Уфе: изумрудно-зелёная вывеска, логотип цвета листвы, тёмно-синие
   объёмные буквы, красно-оранжево-жёлтые монеты, оранжевое «займы!». */

:root {
  --green: #0e8a4c;          /* фон вывески */
  --green-600: #0b7440;
  --green-800: #075230;
  --green-900: #053a22;
  --leaf: #5bad2f;           /* зелёный логотипа на вывеске */
  --navy: #25317f;           /* буквы на вывеске */
  --orange: #f27a12;
  --orange-red: #e5381b;
  --yellow: #ffc21a;         /* монеты */
  --red-dot: #e2311d;

  --bg: #f2f5f1;
  --surface: #ffffff;
  --surface-2: #f4f7f3;
  --tint: #e7f4ec;
  --ink: #15233a;
  --muted: #5d6c64;
  --line: #dce5de;
  --danger: #d4321f;
  --link: var(--green);
  --focus: rgba(14, 138, 76, 0.28);
  --shadow: 0 1px 2px rgba(7, 82, 48, 0.06), 0 6px 24px rgba(7, 82, 48, 0.08);
  --shadow-sm: 0 1px 2px rgba(7, 82, 48, 0.06), 0 3px 12px rgba(7, 82, 48, 0.06);

  /* цвета плиток с иконками: фон / иконка */
  --t-green-bg: #e2f4e8; --t-green: #0b7440;
  --t-navy-bg: #e7e9fa;  --t-navy: #25317f;
  --t-amber-bg: #fff2d3; --t-amber: #a35f00;

  --font-head: 'Fira Sans Condensed', 'Roboto Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Fira Sans', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-lg: 22px;
  --r-md: 14px;
  --tabbar-h: 62px;
  --safe-top: max(env(safe-area-inset-top, 0px), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0c1611;
  --surface: #14221a;
  --surface-2: #1a2b21;
  --tint: #133524;
  --ink: #e9f2ec;
  --muted: #94aa9c;
  --line: #24392d;
  --danger: #ff6b55;
  --link: #4cc488;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.2);
  --t-green-bg: #163a27; --t-green: #6fd59c;
  --t-navy-bg: #1f264f;  --t-navy: #a3adff;
  --t-amber-bg: #3a2c0d; --t-amber: #ffcb66;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html.locked, html.locked body { overflow: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--link); }
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

#app { max-width: 520px; margin: 0 auto; }
.boot { min-height: 100vh; display: grid; place-items: center; }

.screen {
  min-height: var(--tg-viewport-stable-height, 100vh);
  display: flex;
  flex-direction: column;
}
.screen.with-tabs { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom)); }
.content { flex: 1; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* встроенная SVG-иконка */
.i { display: inline-flex; width: 1.25em; height: 1.25em; flex: none; }
.i svg { width: 100%; height: 100%; display: block; }

/* ---------- Знак из монет ---------- */

.coins { --s: 30px; position: relative; width: calc(var(--s) * 1.3); height: calc(var(--s) * 1.1); flex: none; }
.coins i {
  position: absolute;
  width: calc(var(--s) * 0.62);
  height: calc(var(--s) * 0.62);
  border-radius: 50%;
  box-shadow: inset calc(var(--s) * -0.03) calc(var(--s) * -0.04) 0 rgba(0, 0, 0, 0.12);
}
.coins i:nth-child(1) { left: 0; bottom: 0; background: radial-gradient(circle at 35% 30%, #ff8a4c, var(--orange-red) 70%); }
.coins i:nth-child(2) { right: 0; bottom: 0; background: radial-gradient(circle at 35% 30%, #ffb547, var(--orange) 70%); }
.coins i:nth-child(3) {
  left: 50%; top: 0; transform: translateX(-50%);
  background: radial-gradient(circle at 35% 30%, #fff38f, var(--yellow) 68%);
}
.coins--xl { --s: 92px; }
.coins--lg { --s: 64px; }
.coins--loading i { animation: coin-hop 1.2s ease-in-out infinite; }
.coins--loading i:nth-child(2) { animation-delay: 0.15s; }
.coins--loading i:nth-child(3) { animation-name: coin-hop-top; animation-delay: 0.3s; }
.boot .coins { --s: 56px; }
@keyframes coin-hop { 0%, 60%, 100% { translate: 0 0; } 30% { translate: 0 -28%; } }
@keyframes coin-hop-top { 0%, 60%, 100% { translate: 0 0; } 30% { translate: 0 -34%; } }

/* ---------- Логотип-надпись ---------- */

.wordmark {
  font: 800 27px/1 var(--font-head);
  letter-spacing: -0.02em;
  color: var(--navy);
  text-shadow:
    1.5px 0 0 #fff, -1.5px 0 0 #fff, 0 1.5px 0 #fff, 0 -1.5px 0 #fff,
    1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
    2px 3px 0 rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}
.wordmark sup { font-size: 0.38em; vertical-align: 1.3em; margin-left: 1px; text-shadow: none; color: #fff; }

/* ---------- Фирменная шапка (в стиле вывески офиса) ---------- */

.bar {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(115deg, transparent 0 55%, rgba(255, 255, 255, 0.07) 55% 70%, transparent 70%),
    linear-gradient(180deg, var(--green) 0%, var(--green-600) 100%);
  color: #fff;
  padding: calc(10px + var(--safe-top)) 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
}
.bar .logo { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar .logo .coins { --s: 27px; }
.bar .logo .wordmark { font-size: 25px; }
.bar .slogan {
  margin-left: auto;
  font: italic 600 15px/1.1 var(--font-head);
  color: rgba(255, 255, 255, 0.9);
  text-align: right;
}
/* Высокий вариант на экране входа */
.bar--hero {
  flex-direction: column;
  align-items: flex-start;
  padding: calc(22px + var(--safe-top)) 20px 64px;
  gap: 16px;
}
.bar--hero .logo .wordmark { font-size: 40px; }
.bar--hero .logo .coins { --s: 46px; }
.bar--hero .slogan { margin: 0; text-align: left; font-size: 22px; }
.bar--hero .hero-coins { position: absolute; right: -18px; bottom: 18px; opacity: 0.95; }
.lift { margin-top: -44px; position: relative; z-index: 1; }

/* ---------- Типографика ---------- */

.title { font-size: 28px; font-weight: 800; }
.lead { color: var(--muted); }
.lead b { color: var(--ink); }
.promo {
  font: italic 800 32px/1 var(--font-head);
  background: linear-gradient(90deg, var(--orange-red), var(--orange) 60%, #f9a21b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 4px;
}
.fineprint { font-size: 12px; line-height: 1.4; color: var(--muted); }
.fineprint a, .link { color: var(--link); font-weight: 500; text-decoration: none; background: none; border: 0; padding: 0; }
.link.muted { color: var(--muted); }
.link:disabled { cursor: default; }
.num { font-family: var(--font-head); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 6px; }
.section { font-size: 21px; font-weight: 800; }
.section-head .link { font-size: 15px; }
.row-between { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 15px; }

.bullets { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.bullets li { display: flex; gap: 10px; align-items: baseline; font: 600 18px/1.25 var(--font-head); }
.bullets li::before {
  content: ''; flex: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--red-dot); translate: 0 1px;
}
.bullets li:nth-child(even)::before { background: var(--yellow); }

/* ---------- Карточки и панели ---------- */

.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.card h2 { font-size: 20px; font-weight: 800; }
.rows { display: flex; flex-direction: column; margin: 0; }
.rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rows > div:last-child { border-bottom: 0; }
.rows dt { color: var(--muted); }
.rows dd { margin: 0; font-weight: 500; text-align: right; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* плитки с иконками */
.tile {
  flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--t-green-bg); color: var(--t-green);
}
.tile .i { width: 23px; height: 23px; }
.tile.lg { width: 52px; height: 52px; border-radius: 16px; }
.tile.lg .i { width: 26px; height: 26px; }
.tile.navy { background: var(--t-navy-bg); color: var(--t-navy); }
.tile.amber { background: var(--t-amber-bg); color: var(--t-amber); }

/* ---------- Кнопки ---------- */

.btn {
  position: relative;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  padding: 0 20px;
  font: 700 18px/1.1 var(--font-head);
  letter-spacing: 0.01em;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 3px 0 var(--green-800);
  transition: transform 0.08s, box-shadow 0.08s, opacity 0.2s;
  text-align: center;
}
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--green-800); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn--accent { background: linear-gradient(180deg, #f8892a, var(--orange) 60%, #e9670a); box-shadow: 0 3px 0 #b84f05; min-height: 56px; }
.btn--accent:active:not(:disabled) { box-shadow: 0 1px 0 #b84f05; }
.btn--ghost { background: var(--surface); color: var(--green); box-shadow: inset 0 0 0 2px var(--line); }
:root[data-theme='dark'] .btn--ghost { color: #4cc488; }
.btn--ghost:active:not(:disabled) { box-shadow: inset 0 0 0 2px var(--green); transform: none; }
.btn--tg { background: #2aabee; box-shadow: 0 3px 0 #1a7fb6; }
.btn .i { width: 22px; height: 22px; }
.btn.is-busy { color: transparent; pointer-events: none; }
.btn.is-busy::after {
  content: ''; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.7s linear infinite;
}
.btn--ghost.is-busy::after { border-color: var(--line); border-top-color: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }

.actions {
  position: sticky; bottom: 0; z-index: 5;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent, var(--bg) 22%);
  display: flex; flex-direction: column; gap: 10px;
}

.link.is-busy { opacity: 0.5; }

/* ---------- Формы ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 14px; font-weight: 500; color: var(--muted); }
.input {
  width: 100%; height: 52px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); outline: none;
  font-size: 17px;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
}
.input:focus { border-color: var(--green); box-shadow: 0 0 0 4px var(--focus); }
.input::placeholder { color: #9aa8a0; }
:root[data-theme='dark'] .input::placeholder { color: #5f7467; }
.field.has-error .input { border-color: var(--danger); }
.field .error { font-size: 13px; color: var(--danger); }
.field .hint { font-size: 13px; color: var(--muted); }

.otp {
  height: 66px; text-align: center;
  font: 800 34px/1 var(--font-head); letter-spacing: 0.55em; padding-left: 0.55em;
}
.devcode { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; padding: 8px 12px; border-radius: 10px; background: #fff4e0; color: #6d4300; font-size: 13.5px; line-height: 1.35; }
.devcode .link { color: #a35600; font-weight: 600; text-decoration: underline; }
:root[data-theme='dark'] .devcode { background: #3a2a0c; color: #ffd48a; }
:root[data-theme='dark'] .devcode .link { color: #ffc35c; }

.shake { animation: shake 0.35s; }
@keyframes shake { 20% { translate: -6px 0; } 40% { translate: 6px 0; } 60% { translate: -4px 0; } 80% { translate: 4px 0; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 8px 13px; font-size: 14.5px; font-weight: 500;
}
.chip:active { border-color: var(--green); background: var(--tint); }
.quick { margin-top: 2px; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.quick .chip { padding: 8px 4px; text-align: center; white-space: nowrap; font-size: 14px; }

/* ---------- Ползунок (бегунок в виде монеты) ---------- */

.range {
  --p: 50%;
  width: 100%; height: 34px; margin: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.range::-webkit-slider-runnable-track {
  height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, var(--leaf), var(--green)) 0 / var(--p) 100% no-repeat, var(--line);
}
.range::-moz-range-track { height: 8px; border-radius: 4px; background: var(--line); }
.range::-moz-range-progress { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--leaf), var(--green)); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 32px; height: 32px; margin-top: -12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff38f, var(--yellow) 55%, var(--orange) 100%);
  border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.range::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff38f, var(--yellow) 55%, var(--orange) 100%);
  border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.range-scale { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: -6px; }

/* ---------- Крупные карточки вверху экрана (займ, предложение) ---------- */

.hero-card {
  position: relative; overflow: hidden;
  border-radius: 24px;
  padding: 18px 18px 16px;
  color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, 0.16), transparent 60%),
    linear-gradient(160deg, var(--green) 0%, var(--green-800) 100%);
  box-shadow: 0 10px 30px rgba(7, 82, 48, 0.28);
  display: flex; flex-direction: column; gap: 8px;
}
.hero-card::after {
  content: ''; position: absolute; right: -60px; bottom: -70px; width: 190px; height: 190px; border-radius: 50%;
  border: 26px solid rgba(255, 194, 26, 0.09); pointer-events: none;
}
.hero-card .label { font: 500 15px/1.25 var(--font-body); opacity: 0.9; }
.hero-card .big { font: 800 50px/1 var(--font-head); letter-spacing: -0.02em; }
.hero-card .big small { font-size: 32px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.st {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 5px 11px 5px 9px; border-radius: 999px;
  font: 600 13px/1.1 var(--font-body); white-space: nowrap;
}
.st i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st.ok { background: #dff5e6; color: #0b6b3b; }
.st.warn { background: #fff0bf; color: #7a4a00; }
.st.bad { background: #ffe0d9; color: #b3240f; }
.st.bad i, .st.warn i { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.split > div { background: rgba(255, 255, 255, 0.12); border-radius: 14px; padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.split span { font-size: 12.5px; opacity: 0.82; line-height: 1.2; }
.split b { font-size: 18px; white-space: nowrap; }
.split .hl { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; background: rgba(255, 194, 26, 0.2); box-shadow: inset 0 0 0 1px rgba(255, 194, 26, 0.45); }
.split .hl span { font-size: 14px; opacity: 0.95; }

.timeline { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.2); margin-top: 8px; position: relative; }
.timeline > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: linear-gradient(90deg, var(--leaf), var(--yellow)); animation: grow 0.9s 0.15s cubic-bezier(0.3, 0.8, 0.3, 1) both; }
.timeline > i::after { content: ''; position: absolute; right: -5px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25); }
.timeline.warn > i { background: linear-gradient(90deg, var(--yellow), var(--orange)); }
.timeline.bad > i { background: linear-gradient(90deg, var(--yellow), var(--orange) 55%, var(--orange-red)); }
.timeline.bad > i::after { background: #ffd2c8; box-shadow: 0 0 0 4px rgba(229, 56, 27, 0.4); }
@keyframes grow { from { width: 0 !important; } }
.tl-labels { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; opacity: 0.85; }
.hero-tag { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); font-size: 13px; font-weight: 500; }
.hero-tag .i { width: 15px; height: 15px; color: #ffd0c4; }

/* предложение повторного займа */
.hero-card.offer { padding: 20px 20px 18px; gap: 4px; }
.hero-card.offer .label { max-width: 75%; font-weight: 600; }
.offer-pre { font: 600 18px/1.2 var(--font-head); margin-top: 10px; opacity: 0.95; }
.hero-card.offer .big { font-size: 56px; color: #ffe27a; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.12); }
.hero-card.offer .big small { font-size: 36px; }
.hero-deco { position: absolute !important; right: 14px; top: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); font-size: 13px; font-weight: 500; }
.tag .i { width: 14px; height: 14px; color: var(--yellow); }

.chev { flex: none; width: 18px; height: 18px; color: var(--muted); opacity: 0.7; }
.chev svg { width: 100%; height: 100%; display: block; }

.info-row { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; }
.info-row > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.info-row b { font: 700 18px/1.2 var(--font-head); }
.info-row small { color: var(--muted); font-size: 13.5px; }

/* ---------- Раскрывающийся блок договора ---------- */

.fold { padding: 0; gap: 0; }
.fold summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 13px 14px; cursor: pointer; }
.fold summary::-webkit-details-marker { display: none; }
.fold-title { flex: 1; font-weight: 500; }
.fold .tile { width: 38px; height: 38px; border-radius: 12px; }
.fold .tile .i { width: 20px; height: 20px; }
.fold .chev { transition: transform 0.2s; }
.fold[open] .chev { transform: rotate(90deg); }
.fold .rows { padding: 0 16px 8px; border-top: 1px solid var(--line); }

/* ---------- Судебное взыскание / экран результата ---------- */

.court { gap: 12px; }
.court-head { display: flex; align-items: center; gap: 12px; }
.court-head b { display: block; font: 700 18px/1.2 var(--font-head); }
.court-head small { color: var(--muted); }
.court-sum { padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.court-sum span { font-size: 14px; color: var(--muted); }
.court-sum .big { font: 800 42px/1.05 var(--font-head); }
.court-sum .big small { font-size: 28px; }

.result { align-items: center; text-align: center; padding-top: 28px; }
.result-icon { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; animation: pop 0.45s ease-out; flex: none; }
.result-icon svg { width: 46px; height: 46px; color: #fff; }
.result-icon.bad { background: var(--surface-2); box-shadow: 0 0 0 10px var(--tint); }
.result-icon.bad svg { color: var(--muted); }
@keyframes pop { 0% { transform: scale(0.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* сцена успеха с разлетающимися монетами */
.burst-stage { position: relative; width: 260px; height: 190px; display: grid; place-items: center; margin-bottom: 4px; }
.burst-stage .glow { position: absolute; inset: 10px 30px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 194, 26, 0.45), transparent 65%); animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { transform: scale(1.12); opacity: 0.7; } }
.coins--pop { animation: pop-big 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
@keyframes pop-big { from { transform: scale(0.2) rotate(-25deg); opacity: 0; } }
.sc {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px;
  border-radius: 50%; animation: scatter 0.8s var(--d) cubic-bezier(0.15, 0.9, 0.3, 1.2) both;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4), inset -1px -2px 0 rgba(0, 0, 0, 0.12);
}
.sc::after { content: ''; position: absolute; inset: 0; border-radius: 50%; }
.sc.c0 { background: radial-gradient(circle at 35% 30%, #ff9a6b, var(--orange-red) 70%); }
.sc.c1 { background: radial-gradient(circle at 35% 30%, #ffc06b, var(--orange) 70%); }
.sc.c2 { background: radial-gradient(circle at 35% 30%, #fff5a8, var(--yellow) 70%); }
@keyframes scatter { from { transform: translate(0, 0) scale(0.2); opacity: 0; } to { transform: translate(var(--x), var(--y)) scale(var(--s)); opacity: 1; } }

/* ---------- Банки ---------- */

.banks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bank {
  display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 8px 8px 8px 9px;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  font-size: 14px; font-weight: 500; text-align: left; min-width: 0;
}
.bank-name { min-width: 0; overflow-wrap: break-word; hyphens: auto; line-height: 1.2; }
.bank:active { border-color: var(--green); background: var(--tint); }
.bank .mark { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 800 14px/1 var(--font-head); color: #fff; }
.bank .mark.light { color: #222; }

/* ---------- Отделения ---------- */

.city { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.city span { font: 600 12px/1 var(--font-body); color: var(--muted); background: var(--surface-2); padding: 4px 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.office { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 13px 14px 10px; display: flex; flex-direction: column; gap: 10px; }
.office.nearest { box-shadow: 0 0 0 2px var(--green), var(--shadow); }
.office-main { display: flex; align-items: flex-start; gap: 12px; }
.office-main .tile { width: 40px; height: 40px; border-radius: 13px; }
.office-main .tile .i { width: 21px; height: 21px; }
.office-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 1px; }
.office-txt b { font-weight: 600; line-height: 1.3; }
.office-meta { font-size: 13.5px; color: var(--muted); }
.badge-near { align-self: flex-start; font: 700 11px/1 var(--font-body); text-transform: uppercase; letter-spacing: 0.05em; color: #fff; background: var(--green); padding: 4px 7px; border-radius: 6px; margin-bottom: 3px; }
.dist { flex: none; font: 700 15px/1.2 var(--font-head); color: var(--green); background: var(--tint); padding: 5px 9px; border-radius: 999px; white-space: nowrap; }
:root[data-theme='dark'] .dist { color: #6fd59c; }
.office-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 14px; }
.route { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; color: var(--link); padding: 2px 0; }
.route .i { width: 17px; height: 17px; }
.office-hours { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); text-align: right; }
.office-hours .i { width: 15px; height: 15px; }

.hotline { flex-direction: row; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); margin-top: 4px; }
.hotline > div { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.hotline b { font-size: 22px; }
.hotline small { color: var(--muted); font-size: 13px; }

/* ---------- Нижняя панель ---------- */

.sheet-wrap { position: fixed; inset: 0; z-index: 40; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(4, 22, 13, 0.52); animation: fade 0.22s ease both; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto;
  max-height: calc(100% - 28px - var(--safe-top)); overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 26px 26px 0 0;
  padding: 8px 16px calc(16px + var(--safe-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
  animation: sheet-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.sheet-wrap.closing .sheet-backdrop { animation: fade-out 0.22s ease both; }
.sheet-wrap.closing .sheet-panel { animation: sheet-out 0.22s ease-in both; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes fade-out { to { opacity: 0; } }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; margin-bottom: 8px; }
.sheet-head h2 { font-size: 25px; font-weight: 800; padding-top: 4px; }
.sheet-head .x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface); color: var(--muted); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.sheet-head .x svg { width: 16px; height: 16px; }
.sheet-lead { margin-bottom: 14px; }
.sheet-body { display: flex; flex-direction: column; gap: 12px; }
.sheet-actions {
  position: sticky; bottom: calc(-16px - var(--safe-bottom)); z-index: 2;
  display: flex; flex-direction: column; gap: 10px;
  margin: 6px -16px calc(-16px - var(--safe-bottom)); padding: 14px 16px calc(16px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent, var(--bg) 18px);
}
/* список типов клиента в режиме разработчика */
.demo-item {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 9px 12px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--surface);
}
.demo-item[aria-pressed='true'] { border-color: var(--green); background: var(--tint); }
.radio { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); position: relative; transition: border-color 0.15s; }
[aria-pressed='true'] > .radio { border-color: var(--green); }
[aria-pressed='true'] > .radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--green); }
.opt-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.opt-txt b { font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.opt-txt small { font-size: 13px; color: var(--muted); line-height: 1.3; }
.demo-list { display: flex; flex-direction: column; gap: 6px; }
.demo-item .opt-txt b { font-size: 14px; font-weight: 500; }
.demo-item .opt-txt small { font-size: 12px; }

/* кнопки выбора даты */
.dates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.date {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 10px 2px 9px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface);
}
.date span { font-size: 12.5px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.date b { font: 800 27px/1.05 var(--font-head); }
.date small { font-size: 12px; color: var(--muted); }
.date b.small { font: 700 15px/1.2 var(--font-head); padding: 6px 0; }
.date:active { border-color: var(--green); background: var(--green); color: #fff; }
.date:active span, .date:active small { color: rgba(255, 255, 255, 0.85); }

/* ---------- Фото ---------- */

.shot {
  position: relative; aspect-ratio: 4 / 3; border-radius: 22px; overflow: hidden;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(14, 138, 76, 0.04) 14px 28px),
    var(--surface);
  box-shadow: var(--shadow-sm);
  display: grid; place-items: center;
}
.shot--selfie { aspect-ratio: 1 / 1; max-width: 300px; width: 100%; align-self: center; border-radius: 50%; box-shadow: 0 0 0 3px var(--green), var(--shadow-sm); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot-ph { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.shot-ic { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; background: var(--tint); color: var(--green); }
.shot-ic .i { width: 40px; height: 40px; }
.corner { position: absolute; width: 28px; height: 28px; border: 3.5px solid var(--green); }
.corner.tl { left: 14px; top: 14px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.corner.tr { right: 14px; top: 14px; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.corner.bl { left: 14px; bottom: 14px; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.corner.br { right: 14px; bottom: 14px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.shot--selfie .corner { display: none; }
.hints { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hints li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.35; }
.hint-ic { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--green); margin-top: -1px; }
.hint-ic .i { width: 13px; height: 13px; }

/* ---------- Куби: диалог ---------- */

.chat { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.chat-head { display: flex; align-items: center; gap: 14px; padding: 0 2px; }
.chat-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chat-head b { font: 800 21px/1.1 var(--font-head); display: inline-flex; align-items: center; gap: 8px; }
.chat-head small { color: var(--muted); font-size: 13.5px; }
.online { flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--leaf); box-shadow: 0 0 0 3px rgba(91, 173, 47, 0.22); }

/* Куби в 3D: изолированный блок фиксированного размера, чтобы перерисовка не вызывала перерасчёт раскладки страницы */
.kubi-stage {
  position: relative; flex: none; width: 92px; height: 92px; border-radius: 50%; overflow: hidden; contain: strict;
  /* фон — золотая монета «Кубышки» */
  background: radial-gradient(circle at 50% 42%, #fff3d6 0%, #ffd98a 55%, var(--yellow) 100%);
  box-shadow: 0 6px 18px rgba(242, 122, 18, 0.28), inset 0 0 0 3px rgba(255, 255, 255, 0.55);
}
.kubi-stage canvas, .kubi-flat { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: opacity 0.35s; }
.kubi-stage canvas { opacity: 0; }
.kubi-stage.ready canvas { opacity: 1; }
.kubi-stage.ready .kubi-flat { opacity: 0; }
.kubi-flat svg { width: 100%; height: 100%; display: block; }
.online.typing { animation: pulse 0.9s ease-in-out infinite; }
.chat-log { display: flex; flex-direction: column; gap: 8px; }
.chat-more {
  align-self: center; border: 0; border-radius: 999px; padding: 7px 13px;
  background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--line);
}

.msg { display: flex; align-items: flex-end; gap: 8px; min-width: 0; }
.msg.new { animation: msg-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.kubi { flex: none; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; box-shadow: 0 2px 6px rgba(242, 122, 18, 0.3); }
.kubi svg { width: 100%; height: 100%; display: block; }
.kubi-sp { flex: none; width: 34px; }
.k-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: calc(100% - 42px); }
.bubble-k {
  background: var(--surface); border-radius: 18px 18px 18px 6px; box-shadow: var(--shadow-sm);
  padding: 11px 14px; font-size: 15.5px; line-height: 1.45; overflow-wrap: anywhere;
  display: flex; flex-direction: column; gap: 8px;
}
.bubble-k p { white-space: pre-line; }
.msg.k.gold .bubble-k { box-shadow: 0 0 0 2px var(--yellow), 0 10px 26px rgba(255, 194, 26, 0.35); }
.msg.me { justify-content: flex-end; }
.bubble-me {
  max-width: 80%; background: var(--green); color: #fff; border-radius: 18px 18px 6px 18px;
  padding: 9px 14px; font-weight: 500; font-size: 15px; line-height: 1.35; box-shadow: 0 2px 8px rgba(14, 138, 76, 0.25);
  overflow-wrap: anywhere;
}
.bubble-me.has-photo { padding: 4px 4px 8px; display: flex; flex-direction: column; gap: 6px; }
.bubble-me img { display: block; width: 168px; height: 112px; object-fit: cover; border-radius: 15px; }
.bubble-me.has-photo span { padding: 0 10px; font-size: 13.5px; opacity: 0.9; }
.typing .bubble-k { padding: 13px 16px; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: 0.45; animation: blink 1.1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.18s; }
.dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink { 30% { opacity: 1; transform: translateY(-3px); } }

.msg-links { display: flex; flex-wrap: wrap; gap: 8px; }
.btn--sm { width: auto; min-height: 44px; padding: 0 16px; border-radius: 14px; font-size: 16px; }
.ln { color: var(--link); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ln--pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 8px; border-radius: 999px; background: var(--tint); text-decoration: none; font-size: 14px; white-space: nowrap; }
.ln--pill .i { width: 14px; height: 14px; }

/* список отделений внутри сообщения */
.o-item { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 11px; border-radius: 14px; background: var(--surface-2); }
.o-ic { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--t-green-bg); color: var(--t-green); }
.o-ic .i { width: 18px; height: 18px; }
.o-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.o-addr { font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.3; }
.o-txt small { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; line-height: 1.3; }
.o-txt small .i { width: 13px; height: 13px; }
.o-route { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--green); }
.o-route .i { width: 17px; height: 17px; }
:root[data-theme='dark'] .o-route { color: #6fd59c; }

/* текущий шаг диалога, на который отвечает клиент */
.chat-step {
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
  animation: msg-in 0.4s 0.12s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
.answers { display: flex; flex-direction: column; gap: 8px; }
.answers.row { flex-direction: row; }
.answers.row .answer { flex: 1; }
.answer {
  min-height: 50px; border-radius: 14px; padding: 10px 14px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--green);
  font: 700 17px/1.2 var(--font-head); transition: transform 0.08s;
}
:root[data-theme='dark'] .answer { color: #6fd59c; }
.answer.primary, :root[data-theme='dark'] .answer.primary { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 3px 0 var(--green-800); }
.answer:active { transform: translateY(2px); }
.answer.primary:active { box-shadow: 0 1px 0 var(--green-800); }
.text-toggle {
  align-self: center; display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; padding: 4px 8px; color: var(--muted); font-size: 14px; font-weight: 500;
}
.text-toggle .i { width: 18px; height: 18px; }
.text-row { display: flex; gap: 8px; align-items: center; }
.text-row .input { flex: 1; min-width: 0; height: 50px; }
.send {
  flex: none; width: 50px; height: 50px; border: 0; border-radius: 50%;
  background: var(--green); color: #fff; display: grid; place-items: center; box-shadow: 0 3px 0 var(--green-800);
}
.send svg { width: 22px; height: 22px; }
.send:disabled { opacity: 0.35; box-shadow: none; }
.sub-label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.chat-step .otp { margin-top: 2px; }
.chat-step .fineprint.center { text-align: center; }
.chat-step .shot { aspect-ratio: 16 / 10; background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(14, 138, 76, 0.05) 14px 28px), var(--surface-2); box-shadow: none; }
.chat-step .shot--selfie { aspect-ratio: 1 / 1; max-width: 190px; box-shadow: 0 0 0 3px var(--green); }
.chat-step .shot-ic { width: 60px; height: 60px; border-radius: 20px; }
.chat-step .shot-ic .i { width: 32px; height: 32px; }
.cities .chip { font-weight: 600; }

/* сумма с ползунком (повторный займ) */
.amount { display: flex; flex-direction: column; gap: 10px; }
.amount-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.amount-head label { color: var(--muted); }
.amount-box { display: flex; align-items: baseline; gap: 4px; }
.amount-val {
  width: 6.4ch; padding: 0 0 2px; border: 0; border-bottom: 2px dashed var(--line); outline: none; background: none;
  font-size: 38px; line-height: 1; text-align: right; color: var(--ink);
}
.amount-val:focus { border-bottom-color: var(--green); }
.amount-box span { font: 800 26px/1 var(--font-head); }

.chat-end { display: flex; justify-content: center; padding: 2px 0 4px; }
.restart {
  display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 999px; padding: 9px 15px;
  background: none; color: var(--muted); font-size: 14.5px; font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--line);
}
.restart .i { width: 17px; height: 17px; }
.chat .burst-stage { align-self: center; height: 160px; margin: -4px 0 -10px; }

/* ---------- Панель вкладок ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 520px; margin: 0 auto;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: var(--surface);
  box-shadow: 0 -1px 0 var(--line), 0 -6px 20px rgba(7, 82, 48, 0.06);
}
.tab { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); padding: 0; }
.tab-ic { position: relative; width: 58px; height: 30px; border-radius: 999px; display: grid; place-items: center; transition: background 0.2s; }
.tab-ic .i { width: 24px; height: 24px; }
.tab-label { font: 600 12px/1 var(--font-body); }
.tab.on { color: var(--green); }
.tab.on .tab-ic { background: var(--tint); }
:root[data-theme='dark'] .tab.on { color: #6fd59c; }

/* ---------- Подвал и всплывающие уведомления ---------- */

.footer { padding: 10px 16px 18px; display: grid; gap: 6px; text-align: center; justify-items: center; }
.mockchip {
  margin-top: 4px; border: 0; border-radius: 999px; padding: 7px 12px;
  background: #fff1d6; color: #8a4f00; font-size: 12.5px; font-weight: 600; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mockchip span { font-weight: 400; }
:root[data-theme='dark'] .mockchip { background: #3a2a0c; color: #ffd48a; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(14px + var(--safe-bottom)); z-index: 60;
  max-width: 488px; margin: 0 auto; padding: 13px 16px; border-radius: 16px;
  background: #15233a; color: #fff; font-size: 15px; line-height: 1.35; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: toast-in 0.3s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.has-tabs .toast { bottom: calc(var(--tabbar-h) + 12px + var(--safe-bottom)); }
.toast.error { background: #8f1f12; }
.toast.out { opacity: 0; transform: translateY(8px); transition: 0.25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } }

/* летящие монеты */
.burst-layer { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.flycoin {
  position: absolute; width: 20px; height: 20px; margin: -10px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
  animation: fly 1.15s cubic-bezier(0.12, 0.75, 0.35, 1) both;
}
.flycoin.c0 { background: radial-gradient(circle at 35% 30%, #ff9a6b, var(--orange-red) 70%); }
.flycoin.c1 { background: radial-gradient(circle at 35% 30%, #ffc06b, var(--orange) 70%); }
.flycoin.c2 { background: radial-gradient(circle at 35% 30%, #fff5a8, var(--yellow) 70%); }
@keyframes fly {
  0% { transform: translate(0, 0) scale(0.3) rotate(0); opacity: 1; }
  75% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot)); opacity: 0; }
}

@keyframes fade { from { opacity: 0; } }
.fade-in { animation: fade 0.25s ease; }

@media (max-width: 370px) {
  .hero-card .big { font-size: 44px; }
  .hero-card.offer .big { font-size: 48px; }
  .amount-val { font-size: 32px; }
  .bubble-k { font-size: 15px; }
  .date b { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
