:root {
  --bg: #0d121c;
  --bg2: #141b2a;
  --card: #182133;
  --card2: #1e2940;
  --line: rgba(255, 255, 255, .08);
  --gold: #f2c94c;
  --gold2: #c99a2e;
  --text: #e9edf4;
  --muted: #8f9bb0;
  --red: #ff6b5b;
  --green: #4fd18b;
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--text); }
body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 1.4;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 120% 50% at 50% -10%, #22314f 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
main { padding: 16px 16px 100px; max-width: 560px; margin: 0 auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select {
  font: inherit; color: var(--text); width: 100%;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); }
textarea { min-height: 140px; resize: vertical; }

h2 { font-size: 22px; font-weight: 800; margin: 18px 0 12px; }
h3 { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 24px 0 10px; }
.muted { color: var(--muted); font-size: 13px; }
.gold { color: var(--gold); }
.center { text-align: center; }

/* hero */
.hero { display: flex; align-items: center; gap: 14px; padding: 8px 0 4px; }
.hero svg { width: 54px; height: 62px; flex: none; }
.hero .t { font-size: 26px; font-weight: 900; letter-spacing: .5px; line-height: 1;
  background: linear-gradient(180deg, #fff3c4, #f2c94c 50%, #b8862b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .s { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 600; }

/* list rows */
.list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px;
  font-weight: 600;
}
.row:active { transform: scale(.98); }
.row.sel { border-color: var(--gold); background: rgba(242, 201, 76, .08); }
.row[disabled] { opacity: .45; }
.row .grow { flex: 1; min-width: 0; }
.row small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; margin-top: 2px; }
.chev { color: var(--muted); font-size: 22px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: linear-gradient(160deg, #2c3a58, #1b2436); color: var(--gold);
  border: 1px solid rgba(242, 201, 76, .3);
}
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.profile { display: flex; align-items: center; gap: 14px; }
.profile .name { font-size: 19px; font-weight: 800; }
.link { color: var(--gold); font-weight: 700; font-size: 13px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stat { border-radius: var(--radius); padding: 14px; border: 1px solid var(--line); background: var(--card); }
.stat span { font-size: 12px; font-weight: 700; color: var(--muted); }
.stat b { display: block; font-size: 24px; font-weight: 900; margin: 4px 0 2px; }
.stat small { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat.red b { color: var(--red); }
.stat.green b { color: var(--green); }

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--card2); white-space: nowrap; }
.pill.red { background: rgba(255, 107, 91, .14); color: var(--red); }
.pill.green { background: rgba(79, 209, 139, .14); color: var(--green); }
.st { font-size: 18px; }

.empty { color: var(--muted); text-align: center; padding: 22px 10px; font-size: 14px; }
.price { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }

/* buttons */
.primary {
  width: 100%; padding: 16px; border-radius: 16px; font-weight: 800; font-size: 16px;
  background: linear-gradient(180deg, #f6d36b, var(--gold2)); color: #1a1408;
  box-shadow: 0 8px 24px rgba(242, 201, 76, .2);
}
.primary:disabled { opacity: .5; }
.ghost { width: 100%; padding: 14px; border-radius: 16px; font-weight: 700; border: 1px solid var(--line); background: var(--card); }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn-ok { padding: 12px; border-radius: 14px; font-weight: 800; background: rgba(79, 209, 139, .16); color: var(--green); }
.btn-no { padding: 12px; border-radius: 14px; font-weight: 800; background: rgba(255, 107, 91, .14); color: var(--red); }
.small-btn { padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; background: var(--card2); color: var(--muted); }

/* choice */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; font-size: 40px;
}
.big b { font-size: 15px; }
.big.sel { border-color: var(--gold); background: rgba(242, 201, 76, .08); }
.years { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.years button { padding: 12px 0; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-weight: 700; }
.years button.sel { border-color: var(--gold); color: var(--gold); }

/* form */
.step { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; font-weight: 800; font-size: 16px; }
.step i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: #1a1408; font-size: 13px; font-weight: 900; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button { padding: 14px 6px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.seg button.sel { border-color: var(--gold); background: rgba(242, 201, 76, .1); color: var(--gold); }
.amount { margin-top: 10px; position: relative; }
.amount input { font-size: 22px; font-weight: 800; padding-right: 70px; }
.amount span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.quick { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.quick button { padding: 7px 12px; border-radius: 999px; background: var(--card2); font-size: 13px; font-weight: 700; color: var(--muted); }

.cars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.car {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; font-weight: 700; font-size: 13px;
}
.car svg { width: 100%; height: 44px; }
.car.sel { border-color: var(--gold); background: rgba(242, 201, 76, .1); color: var(--gold); }
.car.wide { grid-column: span 3; flex-direction: row; justify-content: center; padding: 12px; }
.chosen { display: flex; align-items: center; gap: 12px; }

.summary { margin-top: 22px; }
.summary .row { cursor: default; }

/* tabs */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(13, 18, 28, .92); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
#tabs button { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
#tabs button i { font-style: normal; font-size: 20px; filter: grayscale(1); opacity: .7; }
#tabs button.on { color: var(--gold); }
#tabs button.on i { filter: none; opacity: 1; }
.badge { position: absolute; top: -2px; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; display: grid; place-items: center; }
[hidden] { display: none !important; }

/* sheet */
#sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; }
#sheet .panel { width: 100%; background: var(--bg2); border-radius: 24px 24px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); animation: up .2s ease-out; }
#sheet .panel p { font-size: 17px; text-align: center; margin-bottom: 18px; }
#sheet .panel .btns { grid-template-columns: 1fr 1.4fr; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

/* toast */
#toast { position: fixed; left: 16px; right: 16px; bottom: 90px; z-index: 30; text-align: center; pointer-events: none; }
#toast div { display: inline-block; background: #263049; padding: 12px 18px; border-radius: 14px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: up .2s ease-out; }
#toast div.bad { background: #5a2420; }

.loader { display: grid; place-items: center; height: 60vh; }
.loader span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
