:root {
  --bg: #0b1d33; --panel: #12294a; --panel2: #1b3a63; --line: #2c5688; --text: #eef4fb; --muted: #9db6d2;
  --accent: #f2c744; --good: #7ddc7a; --bad: #ef7b6c;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; touch-action: none; }
.hidden { display: none !important; }
button, input { font: inherit; color: inherit; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.top { position: fixed; top: var(--site-bar, 0px); left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px max(10px, env(safe-area-inset-right)) 4px max(10px, env(safe-area-inset-left)); z-index: 12; pointer-events: none; }
.top > * { pointer-events: auto; }
.top h1 { margin: 0; font-size: 1.2rem; letter-spacing: .03em; color: var(--accent); text-shadow: 0 1px 4px rgba(0,0,0,.6); white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 6px; }
.langs { display: inline-flex; }
.chip { background: rgba(18,41,74,.85); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-size: .85rem; cursor: pointer; }
.langs .chip:first-child { border-radius: 999px 0 0 999px; }
.langs .chip:last-child { border-radius: 0 999px 999px 0; border-left: 0; }
.chip.active { background: var(--accent); color: #1a1a10; border-color: var(--accent); font-weight: 700; }

.hud { position: fixed; top: calc(var(--site-bar, 0px) + 46px); left: max(10px, env(safe-area-inset-left)); display: flex; flex-wrap: wrap; gap: 6px; z-index: 4; pointer-events: none; max-width: calc(100% - 20px); }
.stat { background: rgba(8,20,38,.62); border: 1px solid rgba(120,170,220,.35); border-radius: 10px; padding: 3px 10px; min-width: 76px; backdrop-filter: blur(2px); }
.stat small { display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
.stat b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.stat.fuel { min-width: 120px; }
.bar { display: block; height: 9px; margin-top: 7px; background: rgba(255,255,255,.14); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #f28a2e, #f2c744); transform-origin: left; }
.alert { background: #b3261e; color: #fff; font-weight: 800; border-radius: 10px; padding: 6px 14px; letter-spacing: .08em; animation: blink .4s infinite alternate; }
@keyframes blink { to { opacity: .45; } }

.pad { position: fixed; left: 0; right: 0; bottom: 0; display: none; justify-content: space-between; align-items: flex-end; padding: 12px max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); z-index: 4; pointer-events: none; }
body.touch .pad:not(.hidden) { display: flex; }
.pad > * { pointer-events: auto; }
.pad-left { display: flex; flex-direction: column; gap: 12px; }
.pbtn { width: 76px; height: 76px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); background: rgba(18,41,74,.55); color: #fff; font-size: 1.7rem; touch-action: none; user-select: none; -webkit-user-select: none; }
.pbtn.on, .pbtn:active { background: rgba(242,199,68,.75); color: #1a1a10; }
.pbtn.eng { width: 92px; height: 92px; font-size: .95rem; font-weight: 800; border-color: rgba(242,150,60,.9); }
.pbtn.eng.on { background: rgba(242,120,40,.85); }

.overlay { position: fixed; inset: 0; background: rgba(4,12,24,.55); z-index: 10; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: calc(var(--site-bar, 0px) + 52px) 12px 16px; touch-action: pan-y; }
#account { z-index: 2147483001; background: rgba(0,0,0,.65); align-items: center; padding-top: 12px; }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; width: 100%; max-width: 520px; margin: auto; display: grid; gap: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.sheet.wide { max-width: 620px; margin-top: 0; }
.sheet h2, .sheet h3 { margin: 0; }
.sheet h3 { font-size: .95rem; color: var(--muted); font-weight: 600; }
.sheet p { margin: 0; }
.tagline { color: var(--text); }
.hint { color: var(--muted); font-size: .88rem; }
.error { color: var(--bad); min-height: 1.2em; font-size: .9rem; }
.big { font-size: 1.3rem; font-weight: 800; color: var(--accent); text-align: center; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; text-align: center; }
.stats small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.stats b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.btn { background: var(--accent); color: #1c1a0c; border: 0; border-radius: 12px; padding: 12px 14px; font-weight: 700; cursor: pointer; min-height: 46px; }
.btn.ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--line); font-weight: 600; }
.btn:disabled { opacity: .4; cursor: default; }
.big-btn { font-size: 1.25rem; min-height: 56px; }
.actions { display: flex; gap: 8px; }
.actions .btn { flex: 1; }
label { display: block; font-size: .88rem; color: var(--muted); margin: 6px 0 4px; }
input[type=text], input[type=password], input[type=email] { width: 100%; background: #08162b; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.ups { display: grid; gap: 6px; }
.up { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.up b { display: block; }
.up small { color: var(--muted); }
.pips { display: flex; gap: 3px; margin-top: 4px; }
.pips i { width: 14px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); }
.pips i.on { background: var(--accent); }
.up .btn { min-height: 38px; padding: 6px 12px; white-space: nowrap; }

.top-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.top-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.top-table td:first-child { width: 2em; color: var(--muted); }
.top-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.top-table tr.me td { color: var(--accent); font-weight: 700; }

@media (max-height: 520px) { .stats b { font-size: 1.05rem; } .big-btn { min-height: 46px; } }

/* ───────── Ugly Relaxing Fly ───────── */
.money { color: var(--accent); font-weight: 800; font-variant-numeric: tabular-nums; cursor: default; }
.stat.wide { min-width: 170px; }
.stat.bars { min-width: 130px; }
.stat.bars .bar { margin: 3px 0 5px; }
.bar.thr i { background: linear-gradient(90deg, #4aa3e8, #9be0ff); }
.stat b.warn { color: var(--accent); }
.stat b.bad { color: var(--bad); }
.stat b.good { color: var(--good); }
.hud-actions { position: fixed; top: calc(var(--site-bar, 0px) + 46px); right: max(10px, env(safe-area-inset-right)); display: flex; flex-direction: column; gap: 6px; z-index: 4; }
.alert.info { background: #1d6fb8; animation: none; }
.alert.ok { background: #2e7d32; animation: none; }
.pad-right { display: flex; align-items: flex-end; gap: 10px; }
.pbtn.small { width: 64px; height: 64px; font-size: .8rem; font-weight: 700; border-color: rgba(239,123,108,.9); }
.sheet { background: rgba(18,41,74,.96); }
.tabs { display: flex; gap: 4px; }
.tabs button { flex: 1; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 4px; font-weight: 600; cursor: pointer; }
.tabs button.on { background: var(--accent); color: #1a1a10; border-color: var(--accent); }
.tab-body { display: grid; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 120px; }
select { background: #08162b; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; max-width: 100%; }
.card { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; display: grid; gap: 6px; }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.card.dim { opacity: .55; }
.card .head { display: flex; align-items: center; gap: 10px; }
.card .head img { width: 86px; height: auto; flex: none; }
.card .head .grow { flex: 1; min-width: 0; }
.card b { display: block; }
.card small { color: var(--muted); }
.card .btn { min-height: 38px; padding: 6px 12px; white-space: nowrap; }
.card .acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.job { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.job .ico { font-size: 1.5rem; }
.job .pay { color: var(--accent); font-weight: 800; font-size: 1.1rem; }
.job small { display: block; color: var(--muted); }
.job .why { color: var(--bad); font-size: .78rem; }
.planepick { display: flex; gap: 6px; flex-wrap: wrap; }
.planepick button { flex: 1; min-width: 120px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; cursor: pointer; display: grid; justify-items: center; gap: 2px; }
.planepick button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.planepick img { width: 80px; height: auto; }
.lines { display: grid; gap: 4px; }
.lines > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 3px 0; }
.lines > div.total { font-weight: 800; color: var(--accent); border-bottom: 0; font-size: 1.15rem; }
.lines > div.minus span:last-child { color: var(--bad); }
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: rgba(18,41,74,.96); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 16px; z-index: 20; max-width: 92vw; text-align: center; }
.keys { color: var(--muted); font-size: .82rem; }
.keys kbd { background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; font: inherit; color: var(--text); }
.hud { max-width: calc(100% - 118px); }
.hud .alert { flex: 0 1 auto; max-width: 100%; }
