:root {
  --ink: #0B0E12; --panel: #121820; --panel2: #18212b; --line: #202c3a;
  --mint: #2FD67B; --amber: #F5B942; --red: #FF6B6B;
  --text: #E9EEF4; --muted: #8B98A9;
  --bs-body-bg: var(--ink); --bs-body-color: var(--text); --bs-border-color: var(--line);
  --bs-body-font-family: 'DM Sans', system-ui, sans-serif;
}
body {
  background: var(--ink) radial-gradient(900px 420px at 88% -8%, rgba(47,214,123,.13), transparent 60%) no-repeat;
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .display, .brand { font-family: 'Sora', sans-serif; letter-spacing: -.02em; }
.text-muted, small.text-muted { color: var(--muted) !important; }
a { color: var(--mint); text-decoration: none; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

/* surfaces */
.card-x { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 1.25rem; }
.chip { display: inline-block; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .85rem; font-weight: 500; transition: .2s; }
.chip:hover, .chip.on { color: var(--mint); border-color: var(--mint); background: rgba(47,214,123,.08); }
.chip.warn { color: var(--amber); border-color: rgba(245,185,66,.4); }
.chip.bad { color: var(--red); border-color: rgba(255,107,107,.4); }

/* buttons + fields */
.btn-mint { position: relative; overflow: hidden; background: var(--mint); color: #06210F; font-weight: 700; border: 0; border-radius: 999px; padding: .7rem 1.4rem; transition: transform .15s, box-shadow .2s, background .2s; }
.btn-mint:hover { background: #4be58f; color: #06210F; box-shadow: 0 8px 28px rgba(47,214,123,.28); }
.btn-mint:active { transform: scale(.97); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: .7rem 1.4rem; font-weight: 500; transition: .2s; }
.btn-ghost:hover { border-color: var(--mint); color: var(--mint); }
.btn-sm { padding: .4rem .9rem; font-size: .85rem; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.45); transform: scale(0); animation: rip .55s linear; pointer-events: none; }
@keyframes rip { to { transform: scale(4); opacity: 0; } }
.form-control, .form-select { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; color: var(--text); padding: .75rem 1rem; }
.form-control:focus, .form-select:focus { background: var(--panel2); color: var(--text); border-color: var(--mint); box-shadow: 0 0 0 3px rgba(47,214,123,.18); }
.form-label { color: var(--muted); font-size: .88rem; }
.form-check-input:checked { background-color: var(--mint); border-color: var(--mint); }
.modal-content { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; }
.modal-header, .modal-footer { border-color: var(--line); }

/* app shell */
.shell { display: flex; min-height: 100vh; }
.side { width: 248px; position: sticky; top: 0; height: 100vh; flex-direction: column; padding: 1.5rem 1rem; border-right: 1px solid var(--line); background: rgba(18,24,32,.6); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.3rem; color: var(--text); }
.brand i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--mint); color: #06210F; font-size: 1.05rem; }
.nav-i { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border-radius: 14px; color: var(--muted); border: 0; background: none; width: 100%; text-align: left; transition: .2s; }
.nav-i:hover { color: var(--text); background: var(--panel2); }
.nav-i.on { color: var(--mint); background: rgba(47,214,123,.1); }
.main { flex: 1; min-width: 0; }
.page { max-width: 1080px; margin: 0 auto; padding: 1.25rem 1rem 6.5rem; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem 0; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; justify-content: space-around; padding: .45rem .5rem calc(.45rem + env(safe-area-inset-bottom)); background: rgba(11,14,18,.9); backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.bottom a, .bottom button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: .35rem; border: 0; background: none; color: var(--muted); font-size: .72rem; border-radius: 12px; }
.bottom i { font-size: 1.25rem; }
.bottom .on { color: var(--mint); }

/* dashboard */
.hero-card { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center; background: linear-gradient(135deg, #14202b, var(--panel)); border: 1px solid var(--line); border-radius: 26px; padding: 1.5rem; }
.ring { width: 150px; height: 150px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--mint); stroke-dasharray: 339.3; stroke-dashoffset: calc(339.3 * (1 - var(--pct) / 100)); animation: ring 1.4s cubic-bezier(.2,.7,.2,1); filter: drop-shadow(0 0 8px rgba(47,214,123,.45)); }
@keyframes ring { from { stroke-dashoffset: 339.3; } }
.ring-wrap { position: relative; }
.ring-wrap b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 1.5rem Sora; }
.hero-num { font: 700 clamp(2rem, 7vw, 3rem)/1 Sora; letter-spacing: -.03em; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: .9rem 1rem; }
.tile .k { color: var(--muted); font-size: .82rem; }
.tile .v { font: 600 1.15rem Sora; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.tile .v.mint { color: var(--mint); }
.tbl { width: 100%; font-size: .88rem; }
.tbl th { color: var(--muted); font-weight: 500; padding: .6rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: .65rem .6rem; border-bottom: 1px solid rgba(32,44,58,.6); white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.neg { color: var(--red); } .pos { color: var(--mint); }
.stat { font: 700 1.9rem Sora; letter-spacing: -.03em; }

/* guarantees drawer (right edge) */
.g-handle { position: fixed; right: 0; top: 42%; z-index: 1020; writing-mode: vertical-rl; padding: .9rem .55rem; background: var(--amber); color: #2a1b00; font-weight: 700; border: 0; border-radius: 14px 0 0 14px; box-shadow: 0 6px 24px rgba(245,185,66,.25); transition: padding .2s; }
.g-handle:hover { padding-right: .8rem; }
.offcanvas.drawer { background: var(--panel); border-left: 1px solid var(--line); width: min(420px, 92vw); }

/* toasts */
.toast-wrap { position: fixed; top: 1rem; right: 1rem; left: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 14px; max-width: 420px; }
.t-ok { border-color: rgba(47,214,123,.5); } .t-ok i { color: var(--mint); }
.t-err { border-color: rgba(255,107,107,.5); } .t-err i { color: var(--red); }

/* auth + landing */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 420px; }
.land-nav { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.25rem; max-width: 1120px; margin: 0 auto; }
.land-hero { max-width: 1120px; margin: 0 auto; padding: 2.5rem 1.25rem 3rem; display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: center; }
.land-hero h1 { font-size: clamp(2.4rem, 7vw, 4.4rem); line-height: 1.02; font-weight: 700; }
.calc-card { background: linear-gradient(160deg, #15212c, var(--panel)); border: 1px solid var(--line); border-radius: 28px; padding: 1.5rem; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.calc-out { font: 700 clamp(2.2rem, 8vw, 3.2rem) Sora; color: var(--mint); letter-spacing: -.03em; }
input[type=range] { accent-color: var(--mint); width: 100%; }
.steps { max-width: 1120px; margin: 0 auto; padding: 1rem 1.25rem 4rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.step-n { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgba(47,214,123,.12); color: var(--mint); font: 700 1rem Sora; margin-bottom: .8rem; }
.rise { opacity: 0; transform: translateY(14px); animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (max-width: 991.98px) {
  .hero-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .land-hero, .steps { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rise { opacity: 1; transform: none; }
}
