/* Кубышка — личный кабинет (Telegram mini app).
   Brand system from the Уфа storefronts: emerald fascia, leaf-green wordmark, navy 3D letters,
   red–orange–yellow coins, orange «займы!». */

:root {
  --green: #0e8a4c;          /* fascia */
  --green-600: #0b7440;
  --green-800: #075230;
  --green-900: #053a22;
  --leaf: #5bad2f;           /* office wordmark green */
  --navy: #25317f;           /* storefront letters */
  --orange: #f27a12;
  --orange-red: #e5381b;
  --yellow: #ffc21a;         /* coins */
  --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);

  /* tile tones: background / foreground */
  --t-green-bg: #e2f4e8; --t-green: #0b7440;
  --t-navy-bg: #e7e9fa;  --t-navy: #25317f;
  --t-sky-bg: #e0f0fd;   --t-sky: #1572c4;
  --t-coral-bg: #ffe9e3; --t-coral: #d2341b;
  --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-sky-bg: #13324a;   --t-sky: #7cc3ff;
  --t-coral-bg: #3d1e17; --t-coral: #ff9078;
  --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; }

/* inline svg icon */
.i { display: inline-flex; width: 1.25em; height: 1.25em; flex: none; }
.i svg { width: 100%; height: 100%; display: block; }

/* ---------- Coin mark ---------- */

.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%; } }

/* single coin (counters, history) */
.coin {
  display: inline-block; flex: none; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff5a8, var(--yellow) 55%, var(--orange) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45), inset -1px -2px 0 rgba(0, 0, 0, 0.12);
}
.coin--sm { width: 26px; height: 26px; }
.coin--lg { width: 34px; height: 34px; }

/* ---------- Wordmark ---------- */

.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; }

/* ---------- Brand bar (the storefront fascia) ---------- */

.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 .back {
  width: 36px; height: 36px; margin-left: -6px; flex: none;
  border: 0; border-radius: 50%; color: #fff;
  background: rgba(255, 255, 255, 0.14);
  display: grid; place-items: center;
}
.bar .back svg { width: 20px; height: 20px; }
.pts {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  border: 0; border-radius: 999px; padding: 5px 12px 5px 5px;
  background: rgba(255, 255, 255, 0.16); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  font: 700 17px/1 var(--font-head);
}
.pts .coin { width: 24px; height: 24px; }
.pts:active { background: rgba(255, 255, 255, 0.26); }

/* Tall version on the welcome screen */
.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; }

/* ---------- Typography ---------- */

.eyebrow { font: 600 13px/1.2 var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.title { font-size: 28px; font-weight: 800; }
.lead { color: var(--muted); }
.lead.small { font-size: 14px; margin-top: -6px; }
.lead.big { font-size: 18px; color: var(--ink); line-height: 1.4; }
.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; }
h3.sub { font: 700 17px/1.2 var(--font-head); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 4px; }
h3.sub .link { font: 500 14px/1 var(--font-body); }
.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); }

/* ---------- Surfaces ---------- */

.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; }
.card.center { align-items: center; text-align: center; }
.panel { background: var(--surface-2); border-radius: var(--r-md); padding: 4px 14px; display: flex; flex-direction: column; }
.panel.tint { background: var(--tint); }
.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; }
.rows .total dd { font: 800 20px/1.2 var(--font-head); }
.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); }

.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--tint); font-size: 14px; line-height: 1.4; }
.note > .i { width: 20px; height: 20px; color: var(--green); margin-top: -1px; }
:root[data-theme='dark'] .note > .i { color: #4cc488; }
.note--warn { background: #fff4e0; color: #6d4300; }
.note--warn > .i { color: var(--orange); }
:root[data-theme='dark'] .note--warn { background: #3a2a0c; color: #ffd48a; }
.note--muted { background: var(--surface-2); color: var(--muted); }
.note--muted > .i { color: var(--muted) !important; }

/* icon tiles */
.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.xl { width: 72px; height: 72px; border-radius: 22px; }
.tile.xl .i { width: 36px; height: 36px; }
.tile.navy { background: var(--t-navy-bg); color: var(--t-navy); }
.tile.sky { background: var(--t-sky-bg); color: var(--t-sky); }
.tile.coral { background: var(--t-coral-bg); color: var(--t-coral); }
.tile.amber { background: var(--t-amber-bg); color: var(--t-amber); }

/* ---------- Buttons ---------- */

.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.refresh { display: inline-flex; align-items: center; gap: 6px; align-self: center; font-size: 14px; color: var(--muted); padding: 4px 8px; }
.link.refresh .i { width: 16px; height: 16px; }
.link.is-busy { opacity: 0.5; }

/* ---------- Forms ---------- */

.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 slider (coin thumb) ---------- */

.slider-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.slider-head .value { font: 800 38px/1 var(--font-head); color: var(--ink); white-space: nowrap; }
.slider-head .value small { font-size: 24px; }
.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; }

/* ---------- Steps / progress ---------- */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.steps i { height: 5px; border-radius: 3px; background: var(--line); }
.steps i.on { background: linear-gradient(90deg, var(--leaf), var(--green)); }

/* ---------- Куби speaks ---------- */

.say { display: flex; gap: 10px; align-items: flex-end; }
.kubi { flex: none; width: 42px; height: 42px; filter: drop-shadow(0 3px 6px rgba(242, 122, 18, 0.35)); animation: kubi-in 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.kubi svg { width: 100%; height: 100%; display: block; }
.bubble {
  position: relative; flex: 1; min-width: 0;
  background: var(--surface); border-radius: 18px 18px 18px 6px; box-shadow: var(--shadow-sm);
  padding: 10px 14px 12px; font-size: 15px; line-height: 1.42;
  animation: bubble-in 0.35s 0.1s ease-out both;
}
.bubble .who { display: block; font: 700 12px/1.2 var(--font-body); color: var(--orange); letter-spacing: 0.02em; margin-bottom: 3px; }
@keyframes kubi-in { from { transform: scale(0.4) rotate(-30deg); opacity: 0; } }
@keyframes bubble-in { from { transform: translateY(6px); opacity: 0; } }

/* ---------- Hero cards ---------- */

.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; }

/* new-loan offer */
.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); }

.burst { animation: burst 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes burst { from { transform: scale(0.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Action cards ---------- */

.acts { display: flex; flex-direction: column; gap: 10px; }
.act, .choice, .doc-link {
  width: 100%; border: 0; text-align: left; color: var(--ink);
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-sm);
  padding: 13px 12px 13px 13px;
  transition: transform 0.1s;
  animation: rise 0.4s ease-out both;
}
.acts > :nth-child(2) { animation-delay: 0.05s; }
.acts > :nth-child(3) { animation-delay: 0.1s; }
.acts > :nth-child(4) { animation-delay: 0.15s; }
.acts > :nth-child(5) { animation-delay: 0.2s; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.act:active, .choice:active, .doc-link:active { transform: scale(0.985); }
.act-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.act-txt b { font: 600 16px/1.25 var(--font-body); }
.act-txt small { font-size: 13.5px; line-height: 1.3; color: var(--muted); }
.act-amt { font-size: 18px; white-space: nowrap; color: var(--ink); }
.chev { flex: none; width: 18px; height: 18px; color: var(--muted); opacity: 0.7; }
.chev svg { width: 100%; height: 100%; display: block; }

.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { padding: 16px 14px; border-radius: 20px; }
.choice .act-txt b { font-size: 17px; }

/* ---------- Contract fold ---------- */

.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 / result ---------- */

.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.ok { background: var(--green); box-shadow: 0 0 0 12px var(--tint); }
.result-icon.bad { background: var(--surface-2); box-shadow: 0 0 0 10px var(--tint); }
.result-icon.bad svg { color: var(--muted); }
.result-icon.sm { width: 64px; height: 64px; }
.result-icon.sm svg { width: 32px; height: 32px; }
.card.center .result-icon.bad { box-shadow: 0 0 0 8px var(--surface-2); background: var(--tint); }
.card.center .result-icon.bad svg { color: var(--green); }
@keyframes pop { 0% { transform: scale(0.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* success stage with scattered coins */
.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 ---------- */

.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-name.long { font-size: 12.5px; letter-spacing: -0.015em; }
.bank[aria-pressed='true'] { border-color: var(--green); background: var(--tint); box-shadow: 0 0 0 3px var(--focus); }
.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; }
.bank .mark.more { background: var(--surface-2); color: var(--green); box-shadow: inset 0 0 0 1.5px var(--line); }
.bank .mark.more svg { width: 16px; height: 16px; }
.bank--more { border-style: dashed; color: var(--muted); }
.bank--row { grid-column: 1 / -1; min-height: 46px; padding: 6px 12px; font-size: 15px; }
.bank--row .mark { width: 26px; height: 26px; font-size: 13px; }

/* ---------- Offices ---------- */

.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; }

/* ---------- Bottom sheet ---------- */

.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-body .panel { background: var(--surface); }
.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);
}
.sheet-body .say .bubble { background: var(--surface); }

.done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; padding: 10px 6px 4px; font-size: 17px; line-height: 1.45; }

.program-about { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--t-coral-bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
.program-about .i { width: 24px; height: 24px; color: var(--t-coral); margin-top: 1px; }

/* options (radio cards) */
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt, .demo-item {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface);
}
.opt[aria-pressed='true'], .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; }
.opt-amt { font: 800 19px/1 var(--font-head); white-space: nowrap; }
.demo-list { display: flex; flex-direction: column; gap: 6px; }
.demo-item { padding: 9px 12px; border-radius: 13px; }
.demo-item .opt-txt b { font-size: 14px; font-weight: 500; }
.demo-item .opt-txt small { font-size: 12px; }

/* date chips */
.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[aria-pressed='true'] { border-color: var(--green); background: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(14, 138, 76, 0.3); }
.date[aria-pressed='true'] span, .date[aria-pressed='true'] small { color: rgba(255, 255, 255, 0.85); }

/* ---------- Photos ---------- */

.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%; }
.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; }
.shot--selfie { box-shadow: 0 0 0 3px var(--green), var(--shadow-sm); }
.shot-busy { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; background: rgba(4, 22, 13, 0.55); color: #fff; font-weight: 500; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.3); border-top-color: #fff; animation: spin 0.8s linear infinite; }
.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; }

/* ---------- Копилка ---------- */

.kop-hero {
  position: relative; overflow: hidden; color: #fff;
  border-radius: 26px; padding: 18px 18px 16px;
  background:
    radial-gradient(90% 70% at 85% 35%, rgba(255, 194, 26, 0.32), transparent 62%),
    linear-gradient(155deg, #12a058 0%, var(--green-800) 70%, var(--green-900) 100%);
  box-shadow: 0 14px 34px rgba(7, 82, 48, 0.32);
  display: grid; grid-template-columns: 1fr 132px; grid-template-areas: 'main jar' 'prog prog'; gap: 6px 8px;
}
.kop-glow { position: absolute; width: 220px; height: 220px; right: -50px; top: -40px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 226, 122, 0.35), transparent 65%); animation: glow 3s ease-in-out infinite; pointer-events: none; }
.kop-main { grid-area: main; display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; min-width: 0; }
.kop-label { font: 700 16px/1.2 var(--font-head); letter-spacing: 0.01em; opacity: 0.92; display: flex; align-items: center; gap: 6px; }
.kop-count { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.kop-num { font-size: 64px; line-height: 0.95; color: #ffe27a; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.15), 0 0 24px rgba(255, 194, 26, 0.35); }
.kop-unit { font: 700 20px/1 var(--font-head); opacity: 0.9; }
.level-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); font-weight: 600; font-size: 14px; }
.jar { grid-area: jar; width: 132px; height: 152px; position: relative; z-index: 1; justify-self: end; margin: -4px -4px 0 0; }
.jar svg { width: 100%; height: 100%; display: block; overflow: visible; }
.jc { animation: jar-in 0.6s cubic-bezier(0.3, 1.45, 0.5, 1) both; }
@keyframes jar-in { from { transform: translateY(-150px); opacity: 0; } 40% { opacity: 1; } }
.jar.settled .jc { animation: none; }
.jar-drop { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.kop-progress { grid-area: prog; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.kop-bar { height: 12px; border-radius: 6px; background: rgba(0, 0, 0, 0.22); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2); overflow: hidden; }
.kop-bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--yellow), var(--orange)); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.1), inset 0 2px 0 rgba(255, 255, 255, 0.35); animation: grow 1.1s 0.3s cubic-bezier(0.3, 0.8, 0.3, 1) both; }
.kop-next { font-size: 14.5px; opacity: 0.95; }
.kop-next b { color: #ffe27a; }

/* level medals */
.medal { display: inline-block; flex: none; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5), inset -1px -2px 0 rgba(0, 0, 0, 0.15); }
.medal.m0 { background: radial-gradient(circle at 35% 30%, #f6b98d, #c06a35 70%); }
.medal.m1 { background: radial-gradient(circle at 35% 30%, #ffffff, #aab6c2 70%); }
.medal.m2 { background: radial-gradient(circle at 35% 30%, #fff5a8, var(--yellow) 55%, var(--orange) 100%); }
.medal.m3 { background: radial-gradient(circle at 35% 30%, #a8f0c4, var(--leaf) 50%, var(--green-600) 100%); }
.levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-sm); padding: 12px 6px; }
.lvl { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; position: relative; min-width: 0; }
.lvl .medal { width: 34px; height: 34px; margin-bottom: 3px; }
.lvl b { font: 700 14px/1.1 var(--font-head); }
.lvl small { font-size: 11.5px; color: var(--muted); }
.lvl.next .medal { filter: grayscale(1); opacity: 0.4; }
.lvl.next b { color: var(--muted); }
.lvl.cur .medal { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--green), inset 0 0 0 2px rgba(255, 255, 255, 0.5); }
.lvl:not(:last-child)::after { content: ''; position: absolute; top: 17px; left: calc(50% + 24px); right: calc(-50% + 24px); height: 2px; border-radius: 1px; background: var(--line); }
.lvl.past::after { background: var(--green) !important; }

/* streak */
.streak { gap: 14px; }
.streak-top { display: flex; align-items: center; gap: 12px; }
.flame { flex: none; width: 46px; height: 46px; filter: grayscale(1) opacity(0.4); }
.flame.lit { filter: drop-shadow(0 4px 8px rgba(229, 56, 27, 0.35)); animation: flicker 1.8s ease-in-out infinite; transform-origin: 50% 90%; }
.flame svg { width: 100%; height: 100%; display: block; }
@keyframes flicker { 50% { transform: scale(1.06, 0.96) rotate(-2deg); } }
.streak-n { font: 800 22px/1.1 var(--font-head); }
.streak-top small { color: var(--muted); font-size: 13.5px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week i { aspect-ratio: 1; max-width: 40px; width: 100%; justify-self: center; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font: 700 13px/1 var(--font-head); font-style: normal; box-shadow: inset 0 0 0 1.5px var(--line); }
.week i.on { background: linear-gradient(160deg, var(--yellow), var(--orange)); color: #fff; box-shadow: 0 3px 8px rgba(242, 122, 18, 0.35); }
.week i.on .i { width: 15px; height: 15px; }
.week i.next { box-shadow: inset 0 0 0 2px var(--orange); color: var(--orange); }

/* badges */
.badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.badge { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 14px 6px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.medal-lg { position: relative; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--line); }
.medal-lg > .i { width: 26px; height: 26px; }
.badge.earned .medal-lg { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.4), 0 4px 12px rgba(0, 0, 0, 0.12); animation: pop 0.5s ease-out both; }
.badge.t-green .medal-lg { background: linear-gradient(145deg, #7ccf4a, var(--green)); }
.badge.t-sky .medal-lg { background: linear-gradient(145deg, #5cc0ff, #1572c4); }
.badge.t-amber .medal-lg { background: linear-gradient(145deg, #ffd85c, #f29a0e); }
.badge.t-orange .medal-lg { background: linear-gradient(145deg, #ffb547, var(--orange-red)); }
.badge.t-navy .medal-lg { background: linear-gradient(145deg, #6b78e6, var(--navy)); }
.badge.t-gold .medal-lg { background: linear-gradient(145deg, #fff08a, var(--yellow) 50%, var(--orange)); color: #6b3d00; }
.badge.locked .medal-lg { color: var(--muted); }
.badge.locked .medal-lg > .i { opacity: 0.55; }
.got, .lock { position: absolute; right: -4px; bottom: -3px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--surface); }
.got { background: var(--green); color: #fff; }
.lock { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.got svg, .lock svg { width: 11px; height: 11px; }
.bt { font-size: 12.5px; font-weight: 600; line-height: 1.25; min-height: 2.5em; display: flex; align-items: center; }
.badge.locked .bt { color: var(--muted); }
.bp { font: 800 13px/1 var(--font-head); padding: 4px 8px; border-radius: 999px; background: #fff3cf; color: #9a5a00; }
.badge.locked .bp { background: var(--surface-2); color: var(--muted); }
:root[data-theme='dark'] .bp { background: #3a2c0d; color: #ffcb66; }
:root[data-theme='dark'] .badge.locked .bp { background: var(--surface-2); color: var(--muted); }

/* news toggle */
.news { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; }
.news-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.news-txt b { font-weight: 600; }
.news-txt small { color: var(--muted); font-size: 13.5px; }
.plus-pill { font: 800 13px/1 var(--font-head); padding: 3px 7px; border-radius: 999px; background: linear-gradient(160deg, var(--yellow), var(--orange)); color: #fff; }
.switch { position: relative; flex: none; width: 52px; height: 32px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background 0.2s; }
.switch .track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.5, 1); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--focus); }
.switch input:disabled + .track { opacity: 0.6; }

/* history */
.history { gap: 6px; }
.history ul { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; padding-bottom: 2px; }
.history li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.history li b { font-weight: 500; font-size: 15px; }
.history li small { color: var(--muted); font-size: 12.5px; }
.plus { font: 800 18px/1 var(--font-head); color: var(--green); }
:root[data-theme='dark'] .plus { color: #6fd59c; }
.kop-note { text-align: center; padding: 0 8px; }

/* ---------- Tab bar ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 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; }
.tbadge { position: absolute; top: -6px; right: -2px; font: 800 11px/1 var(--font-head); color: #fff; padding: 3px 5px; border-radius: 999px; background: linear-gradient(160deg, var(--orange), var(--orange-red)); box-shadow: 0 0 0 2px var(--surface); animation: pop 0.4s ease-out; }

/* ---------- Footer & toast ---------- */

.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.award { background: linear-gradient(120deg, #15233a, #123b2a); padding: 10px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 194, 26, 0.35); }
.toast.out { opacity: 0; transform: translateY(8px); transition: 0.25s; }
.award { display: flex; align-items: center; gap: 12px; }
.award > .coin { animation: spin-y 1s ease-in-out 2; }
.award b { display: block; font: 800 19px/1.15 var(--font-head); color: #ffe27a; }
.award span { font-size: 13.5px; opacity: 0.85; }
@keyframes spin-y { 50% { transform: scaleX(0.15); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } }

/* flying coins */
.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; }
  .kop-num { font-size: 54px; }
  .kop-hero { grid-template-columns: 1fr 112px; }
  .jar { width: 112px; height: 130px; }
  .slider-head .value { font-size: 32px; }
  .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; }
}
