/* Водительский сайт «Миллионник». Один столбец под телефон (на компьютере — по центру, 440px).
   Тёмная тема по умолчанию, светлая — если в телефоне светлая. Жёлтый — главное действие и деньги. */
:root {
  --bg: #0d0d0f; --card: #18181b; --card2: #222226; --line: #2b2b30; --fg: #f3f3f1; --mu: #a3a3a9;
  --acc: #ffd21f; --acc-ink: #1a1606; --acc-text: #ffd21f; --ok: #4ade80; --ok-bg: #12261a; --bad: #f87171; --bad-bg: #2a1414;
  --warn-bg: #2b2410; --field: #141417; --field-line: #3a3a40; --veil: rgba(0,0,0,.62);
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-head: "Manrope", "Inter", system-ui, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f3f0; --card: #ffffff; --card2: #efefea; --line: #e2e2dc; --fg: #141412; --mu: #66665f;
    --acc: #ffd21f; --acc-ink: #1a1606; --acc-text: #7a6000; --ok: #15803d; --ok-bg: #e4f5e9; --bad: #dc2626; --bad-bg: #fdecec;
    --warn-bg: #fff5cc; --field: #ffffff; --field-line: #d4d4cc; --veil: rgba(0,0,0,.45);
    color-scheme: light;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 var(--f-body); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-head); margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 30px; line-height: 1.15; font-weight: 800; }
h2 { font-size: 23px; line-height: 1.2; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
svg { width: 20px; height: 20px; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.mu { color: var(--mu); font-size: 13px; }
.sub { color: var(--mu); font-size: 15px; }
.hl, .acc-c { color: var(--acc-text); }
.ok-c { color: var(--ok); }
.mu-c { color: var(--mu); }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.t { font-weight: 600; }
.big { font-family: var(--f-head); font-weight: 800; font-size: 24px; line-height: 1.2; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; width: 100%; height: 100%; }

/* Каркас */
.app { max-width: 440px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.stage { flex: 1; padding: calc(12px + env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) 28px max(18px, env(safe-area-inset-left, 0px)); }
.col { display: flex; flex-direction: column; gap: 12px; }
.top { display: flex; align-items: center; gap: 10px; min-height: 42px; }
.back, .icon-btn { width: 40px; height: 40px; border: 0; background: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.back { margin-left: -8px; }
.icon-btn { margin-left: auto; color: var(--mu); }
.back svg, .icon-btn svg { width: 24px; height: 24px; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--f-head); font-weight: 800; font-size: 17px; }
.logo { width: 32px; height: 32px; border-radius: 10px; background: var(--acc); color: var(--acc-ink); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.prog { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.prog > div { height: 100%; background: var(--acc); border-radius: 3px; transition: width .4s; }

/* Карточки и плашки */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 15px 16px; }
.plq { border-radius: 16px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.plq > svg { width: 22px; height: 22px; }
.plq.ok { background: var(--ok-bg); } .plq.ok > svg { color: var(--ok); }
.plq.warn { background: var(--warn-bg); border: 1px solid var(--acc); } .plq.warn > svg { color: var(--acc-text); }
.plq-t { margin-top: 2px; }
.plq .mini { margin-top: 10px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* Кнопки */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border-radius: 15px; padding: 15px 16px; font-size: 16px; font-weight: 600; border: 1px solid transparent; text-decoration: none; text-align: center; background: none; }
.btn.y { background: var(--acc); color: var(--acc-ink); }
.btn.g { border-color: var(--field-line); }
.btn.wa { background: #1fa855; color: #fff; }
.btn.sm { padding: 11px 12px; font-size: 15px; }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .6; }
.link { background: none; border: 0; color: var(--acc-text); font-size: 15px; font-weight: 500; padding: 8px; text-align: center; text-decoration: none; display: block; width: 100%; cursor: pointer; }
.mu-link { color: var(--mu); font-size: 14px; }
.inl { width: 16px; height: 16px; vertical-align: -3px; }
.mini { font-size: 13px; font-weight: 600; border: 1px solid var(--field-line); border-radius: 10px; padding: 6px 10px; display: inline-flex; align-items: center; gap: 5px; background: none; text-decoration: none; flex: none; color: var(--fg); }
.mini svg { width: 15px; height: 15px; }

/* Строки-ссылки */
.row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border: 0; border-top: 1px solid var(--line); background: none; width: 100%; text-align: left; }
.list-card { padding-block: 4px; }
.list-card .row:first-child { border-top: 0; }
.link-card.row { border: 1px solid var(--line); padding: 14px 16px; }
.row-s { display: flex; align-items: center; gap: 12px; }
.ic { width: 38px; height: 38px; border-radius: 11px; background: var(--card2); display: flex; align-items: center; justify-content: center; flex: none; }
.ic svg { width: 21px; height: 21px; }
.ic.acc { color: var(--acc-text); }
.ic.fill-acc { background: var(--acc); color: var(--acc-ink); }
.big-ic { width: 56px; height: 56px; border-radius: 16px; }
.big-ic svg { width: 30px; height: 30px; }
.chev { width: 20px; height: 20px; color: var(--mu); margin-left: auto; }

/* Поля */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--mu); }
.inp, .rgrid input { width: 100%; background: var(--field); border: 1px solid var(--field-line); border-radius: 13px; padding: 13px 14px; font-size: 16px; }
.inp:focus, .rgrid input:focus { outline: none; border-color: var(--acc); }
.inp.pin { letter-spacing: 8px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.chk input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--acc); flex: none; }
.chk a { color: var(--acc-text); }
.err { color: var(--bad); font-size: 14px; }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgba(127,127,127,.35); border-top-color: currentColor; animation: sp .8s linear infinite; display: inline-block; flex: none; }
@keyframes sp { to { transform: rotate(360deg); } }

/* Первый экран */
.rung { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rung:first-of-type { border-top: 0; }
.amt { font-family: var(--f-head); font-weight: 800; font-size: 17px; }
.n { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: var(--card2); flex: none; }
.n.y { background: var(--acc); color: var(--acc-ink); }
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.feats svg { width: 24px; height: 24px; color: var(--acc-text); display: block; margin: 0 auto 2px; }
.feats span { color: var(--mu); font-size: 13px; }
.stats-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-p { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.stat-p b { display: block; font-family: var(--f-head); font-size: 20px; }
.stat-p span { color: var(--mu); font-size: 13px; }

/* Главная водителя */
.top-friend { text-align: left; width: 100%; }
.top-friend .bar { margin: 10px 0 8px; }

/* Друзья */
.lv { border: 1px solid var(--line); border-radius: 13px; padding: 9px 4px; text-align: center; }
.lv b { display: block; font-family: var(--f-head); font-size: 17px; color: var(--acc-text); }
.reflink { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--card2); border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px; font-size: 15px; text-align: left; }
.reflink #refLinkText { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reflink > svg { width: 18px; height: 18px; color: var(--mu); }
.bar { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar > i, .bar > div { display: block; height: 100%; border-radius: 4px; background: var(--acc); width: 0; transition: width .6s; }
.fr-h { display: flex; justify-content: space-between; margin-bottom: 4px; }
.fr { padding: 11px 0; border-top: 1px solid var(--line); }
.fr-h + .fr { border-top: 0; }
.fr-top { display: flex; align-items: center; gap: 10px; }
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
.fr .bar { margin-top: 8px; }
.fr.hi .bar > i { background: var(--ok); } .fr.mid .bar > i { background: var(--acc); } .fr.lo .bar > i { background: var(--bad); }
.fr.won .fr-top > svg { color: var(--ok); width: 22px; height: 22px; }
.fr.off { opacity: .55; }
.tag { font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--mu); margin-left: 6px; font-weight: 400; white-space: nowrap; }
.lines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.line { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.line b { font-family: var(--f-head); font-size: 20px; }
.line .s { font-size: 12px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; border: 1px solid var(--field-line); background: none; border-radius: 11px; padding: 9px 4px; font-size: 14px; }
.seg button[aria-selected="true"] { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); font-weight: 600; }
.drv { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; display: flex; flex-direction: column; gap: 6px; }
.drv .r { display: flex; justify-content: space-between; gap: 10px; }
.drv .nm { font-weight: 600; }
.drv .from, .drv .trips, .drv .meta { color: var(--mu); font-size: 13px; }
.drv .st { font-weight: 700; color: var(--acc-text); white-space: nowrap; }
.drv .st.ok { color: var(--ok); }
.drv .bar.ok > div { background: var(--ok); }
.drv .meta { display: flex; justify-content: space-between; gap: 8px; }
.drv .hot { color: var(--bad); }
.empty { text-align: center; color: var(--mu); padding: 30px 10px; display: flex; flex-direction: column; gap: 4px; }
.empty b { color: var(--fg); }

/* Как работают бонусы */
.chain { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.person { text-align: center; opacity: .35; transition: opacity .3s; }
.person.on { opacity: 1; }
.face { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 4px; background: var(--card2); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.person.on .face { border-color: var(--acc); }
.person.me .face { background: var(--acc); color: var(--acc-ink); }
.person.new .face { animation: pop .4s; }
@keyframes pop { 50% { transform: scale(1.15); } }
.who { font-size: 12px; color: var(--mu); }
.got { min-height: 22px; }
.coin { display: inline-block; font-size: 12px; font-weight: 700; color: var(--ok); animation: up .5s both; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
.say .stepno { color: var(--mu); font-size: 13px; }
.say h3 { margin: 4px 0 6px; }
.say p { color: var(--mu); }
.say b { color: var(--fg); }
.dots { display: flex; justify-content: center; gap: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--acc); }
.calc { display: flex; flex-direction: column; gap: 8px; }
.calc input[type=range] { width: 100%; accent-color: var(--acc); }
.calc .total { font-family: var(--f-head); font-weight: 800; font-size: 30px; color: var(--acc-text); }

/* Фото документов */
.doc-dots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.doc-dots button { text-align: center; font-size: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 2px; color: var(--mu); background: none; }
.doc-dots button.done { border-color: var(--ok); color: var(--ok); }
.doc-dots button.done::before { content: "✓ "; }
.doc-dots button.cur { border-color: var(--acc); color: var(--acc-text); font-weight: 600; }
.doc-dots button:disabled:not(.cur) { opacity: .5; cursor: default; }
.doc-frame { border: 2px dashed var(--field-line); border-radius: 18px; min-height: 210px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; color: var(--mu); }
.doc-frame .ph { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.doc-frame .ph svg { width: 46px; height: 46px; }
.doc-frame .ph b { color: var(--fg); }
.doc-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.doc-frame .scan { position: absolute; left: 0; right: 0; height: 3px; background: var(--acc); box-shadow: 0 0 18px var(--acc); animation: scan 1.6s ease-in-out infinite; z-index: 2; }
@keyframes scan { 0%, 100% { top: 8%; } 50% { top: 90%; } }
.doc-frame .veil { position: absolute; inset: 0; background: var(--veil); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; z-index: 1; }
.tips { margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--mu); display: flex; flex-direction: column; gap: 4px; }
.tips li { display: flex; gap: 6px; }
.tips svg { width: 16px; height: 16px; color: var(--ok); margin-top: 2px; }
.thumbs-u { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.thumbs-u .t { display: flex; flex-direction: column; gap: 4px; align-items: center; font-size: 12px; color: var(--mu); font-weight: 400; }
.thumbs-u .im { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; background: var(--card2); overflow: hidden; }
.thumbs-u .im img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs-u button { background: none; border: 0; color: var(--acc-text); font-size: 12px; padding: 0; }
.rgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rgrid .wide, .rgrid .rgroup, .rgrid .tax-row { grid-column: 1 / -1; }
.rgroup { font-family: var(--f-head); font-weight: 700; font-size: 15px; margin-top: 6px; }
.rgroup:first-child { margin-top: 0; }
.rgrid input { padding: 10px 12px; font-size: 15px; }
.rgrid .miss input { border-color: var(--bad); background: var(--bad-bg); }
.tax-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--card2); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.tax-row .link { width: auto; padding: 0; font-size: 14px; }

/* Готово */
.bigok { width: 88px; height: 88px; border-radius: 50%; background: var(--acc); color: var(--acc-ink); display: flex; align-items: center; justify-content: center; margin: 22px auto 4px; }
.bigok svg { width: 48px; height: 48px; }

/* Кнопки приложений — в цветах самих приложений, одинаковые в обеих темах */
.appbtn { display: block; width: 100%; padding: 2px; border-radius: 20px; border: 0; text-align: left; color: #fff; }
.appbtn > span { display: flex; align-items: center; gap: 14px; background: #000; color: #fff; border-radius: 18px; padding: 14px 16px; }
.appbtn b { display: block; font-size: 17px; font-weight: 600; }
.appbtn small { font-size: 13px; color: #b8b8be; }
.appbtn .dl { width: 24px; height: 24px; }
.ring { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.ring svg { width: 26px; height: 26px; }
.ring .in { width: 36px; height: 36px; border-radius: 50%; background: #000; display: flex; align-items: center; justify-content: center; color: #fff; }
.ring .in svg { width: 20px; height: 20px; }
.yp { background: #ffcc00; }
.mz { background: linear-gradient(90deg, #ff3b30, #ff9500, #ffcc00, #34c759, #0a84ff, #5e5ce6); }
.mzring { background: conic-gradient(from 200deg, #ff3b30, #ff9500, #ffcc00, #34c759, #0a84ff, #5e5ce6, #ff2d55, #ff3b30); }
.ink-k { color: #000; } .ink-y { color: #ffcc00; }

/* Мои данные */
.car-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.car-name { font-size: 17px; margin-top: 2px; }
.plate { display: inline-block; border: 1.5px solid var(--fg); border-radius: 6px; padding: 1px 8px; font-weight: 600; letter-spacing: .5px; margin-top: 5px; }
.pill { font-size: 12px; font-weight: 600; border-radius: 8px; padding: 4px 9px; white-space: nowrap; background: var(--ok-bg); color: var(--ok); }
.pill.off { background: var(--card2); color: var(--mu); }
.car-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Реклама */
.promo-card { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.promo-card canvas { width: 100%; height: auto; display: block; }
.ad-text { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; font-size: 14px; white-space: pre-line; }
.ad-text .mini { margin-top: 10px; }

/* Помощь */
details.faq { border-top: 1px solid var(--line); padding: 12px 0; }
details.faq:first-of-type { border-top: 0; }
details.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary svg { width: 18px; height: 18px; color: var(--mu); transition: transform .2s; margin-top: 2px; }
details.faq[open] summary svg { transform: rotate(90deg); }
details.faq p { color: var(--mu); font-size: 14px; margin-top: 8px; }
.docs { font-size: 12px; color: var(--mu); text-align: center; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.docs a { color: var(--mu); }

/* Нижнее меню */
.tabbar { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 8px max(8px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); z-index: 5; }
.tabbar button { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--mu); min-width: 64px; padding: 2px; }
.tabbar svg { width: 25px; height: 25px; }
.tabbar button[aria-current="page"] { color: var(--acc-text); }

/* Окна снизу */
.sheet-bg { position: fixed; inset: 0; background: var(--veil); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet { background: var(--card); width: 100%; max-width: 440px; border-radius: 24px 24px 0 0; padding: 10px max(18px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 10px; max-height: 88vh; overflow: auto; }
.grab { width: 42px; height: 5px; border-radius: 3px; background: var(--field-line); margin: 0 auto 6px; }
.opt { display: flex; align-items: center; gap: 14px; border-radius: 16px; padding: 15px; font-size: 17px; font-weight: 600; text-decoration: none; border: 1px solid var(--line); background: var(--card2); }
.opt .lg { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.opt .lg svg { width: 24px; height: 24px; }
.opt .and { background: #22c55e; color: #06210f; }
.opt .ios { background: #f2f2f2; color: #111; }
.steps-ios { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--mu); }
.steps-ios b { color: var(--fg); }
.steps-ios svg { width: 16px; height: 16px; vertical-align: -3px; }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; z-index: 60; max-width: calc(100% - 32px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
