:root {
  --bg: #090d18; --card: #121829; --card2: #182036; --line: #232c46; --text: #eef1fb; --muted: #8e98b8;
  --acc: #8b73ff; --ahi: #b3a2ff; --good: #4de0b2; --warn: #ffc56b; --bad: #ff7a8a;
  --top: env(safe-area-inset-top, 0px); --bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; min-height: 100vh; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
a { color: var(--ahi); text-decoration: none; }
h1 { font-size: 28px; line-height: 1.15; margin: 0 0 6px; letter-spacing: -.02em; }
h2 { font-size: 17px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

.view { padding: calc(var(--top) + 18px) 18px calc(var(--bottom) + 96px); max-width: 560px; margin: 0 auto; }
.view.bare { padding-bottom: calc(var(--bottom) + 28px); }
.splash { display: grid; place-items: center; gap: 10px; min-height: 70vh; color: var(--muted); }
.splash img { border-radius: 18px; }

.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 18px; }
.head .sub { color: var(--muted); font-size: 15px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); display: grid; place-items: center; font-size: 18px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.card.hero { background: linear-gradient(145deg, #2a2160, #141b33 70%); border-color: #3a3175; }
.card.soon { border-style: dashed; background: transparent; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row + .row { margin-top: 10px; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list .item:first-child { border-top: 0; padding-top: 2px; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--good); box-shadow: 0 0 0 4px rgba(77, 224, 178, .15); }
.dot.idle { background: var(--warn); }

.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--card2); color: var(--muted); letter-spacing: .02em; }
.pill.good { background: rgba(77, 224, 178, .14); color: var(--good); }
.pill.warn { background: rgba(255, 197, 107, .14); color: var(--warn); }
.pill.bad { background: rgba(255, 122, 138, .14); color: var(--bad); }
.pill.acc { background: rgba(139, 115, 255, .18); color: var(--ahi); }
.big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.stats .card { margin: 0; }

.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 15px 16px; font: inherit; font-weight: 650; text-align: center; background: var(--acc); color: #fff; cursor: pointer; }
.btn:disabled { opacity: .55; }
.btn.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid rgba(255, 122, 138, .35); }
.btn.slim { display: inline-block; width: auto; padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn + .btn { margin-top: 10px; }
.link { background: none; border: 0; color: var(--ahi); font: inherit; padding: 8px 0; cursor: pointer; }

.form label { display: block; font-size: 14px; color: var(--muted); margin: 14px 0 6px; }
.form input { width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: 16px; }
.form input:focus { outline: 2px solid var(--acc); outline-offset: 0; border-color: transparent; }
.form .btn { margin-top: 20px; }
.msg { min-height: 22px; margin-top: 12px; font-size: 14px; }
.msg.bad { color: var(--bad); }
.msg.ok { color: var(--good); }

.brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 34px 0 22px; }
.brand img { width: 76px; height: 76px; border-radius: 20px; margin-bottom: 14px; box-shadow: 0 12px 40px rgba(139, 115, 255, .35); }
.foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; }
.foot a { margin: 0 6px; }

.steps { counter-reset: s; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step .num { width: 32px; height: 32px; border-radius: 10px; background: var(--card2); display: grid; place-items: center; font-weight: 700; flex: none; color: var(--ahi); }
.step.done .num { background: rgba(77, 224, 178, .16); color: var(--good); }
.howto { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.howto li { margin: 4px 0; }
.howto b { color: var(--text); }

.empty { text-align: center; padding: 40px 10px 20px; }
.empty .art { font-size: 44px; margin-bottom: 8px; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 8px calc(var(--bottom) + 6px); background: rgba(9, 13, 24, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); z-index: 5; }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 0; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--ahi); }

.offline { position: sticky; top: 0; z-index: 6; padding: calc(var(--top) + 8px) 16px 8px; background: #3a2c10; color: var(--warn); font-size: 13px; text-align: center; }
.offline:not([hidden]) + .view { padding-top: 18px; }

.sheet-wrap { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 10; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; background: var(--card); border-radius: 22px 22px 0 0; padding: 10px 18px calc(var(--bottom) + 18px); border-top: 1px solid var(--line); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom) + 84px); background: var(--card2); border: 1px solid var(--line); color: var(--text); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 11; max-width: 90vw; }

.hero .pill + h2 { margin-top: 12px; }

/* ------------------------------------------------------------------ motion: everything below is decoration only */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero::before { content: ""; position: absolute; width: 260px; height: 260px; right: -90px; top: -110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 115, 255, .55), transparent 65%); z-index: -1; }
.hero::after { content: ""; position: absolute; width: 200px; height: 200px; left: -80px; bottom: -120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 224, 178, .22), transparent 65%); z-index: -1; }
.wave { display: inline-block; transform-origin: 70% 70%; }
.sparkle { position: absolute; color: var(--good); pointer-events: none; font-size: 14px; opacity: 0; }
.brand { position: relative; }
.btn, .iconbtn, .tabs a, a.card { transition: transform .15s ease, filter .15s ease, background .2s ease; }
.btn:active:not(:disabled), .iconbtn:active, a.card:active { transform: scale(.96); }
.btn:not(.ghost):not(.danger) { background: linear-gradient(100deg, #7b62ff, #9b86ff 50%, #7b62ff); background-size: 200% 100%; box-shadow: 0 8px 24px rgba(139, 115, 255, .28); }
.tabs a { position: relative; }
.tabs a::before { content: ""; position: absolute; top: -2px; left: 50%; width: 52px; height: 32px; margin-left: -26px; border-radius: 16px;
  background: rgba(139, 115, 255, .16); transform: scale(.4); opacity: 0; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), opacity .2s; z-index: -1; }
.tabs a.on::before { transform: scale(1); opacity: 1; }
.stats .card .big { background: linear-gradient(90deg, var(--text), var(--ahi)); -webkit-background-clip: text; background-clip: text; color: transparent; }

@media (prefers-reduced-motion: no-preference) {
  .view > * { animation: rise .5s cubic-bezier(.2, .9, .3, 1.15) both; }
  .view > *:nth-child(2) { animation-delay: .06s; }
  .view > *:nth-child(3) { animation-delay: .12s; }
  .view > *:nth-child(4) { animation-delay: .18s; }
  .view > *:nth-child(5) { animation-delay: .24s; }
  .view > *:nth-child(n+6) { animation-delay: .3s; }
  .list .item { animation: slide .45s ease-out both; }
  .list .item:nth-child(2) { animation-delay: .08s; } .list .item:nth-child(3) { animation-delay: .16s; } .list .item:nth-child(n+4) { animation-delay: .24s; }
  .sheet { animation: up .35s cubic-bezier(.2, .9, .3, 1.1) both; }
  .sheet-wrap { animation: fade .25s ease-out both; }
  .toast { animation: toast .4s cubic-bezier(.2, .9, .3, 1.3) both; }

  .hero::before { animation: orb 9s ease-in-out infinite alternate; }
  .hero::after { animation: orb2 11s ease-in-out infinite alternate; }
  .btn:not(.ghost):not(.danger) { animation: sheen 4s ease-in-out infinite; }
  .dot.on { animation: ping 2s ease-out infinite; }
  .pill.good::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; animation: blink 1.6s ease-in-out infinite; }
  .pill.acc { background: linear-gradient(90deg, rgba(139, 115, 255, .18), rgba(179, 162, 255, .38), rgba(139, 115, 255, .18)); background-size: 200% 100%; animation: shimmer 2.6s linear infinite; }
  .wave { animation: wave 2.2s ease-in-out .6s 2; }
  .brand img { animation: float 4s ease-in-out infinite, glow 4s ease-in-out infinite; }
  .splash img { animation: breathe 1.4s ease-in-out infinite; }
  .sparkle { animation: twinkle 3s ease-in-out infinite; }
  .tabs a.on svg { animation: pop .45s cubic-bezier(.3, 1.8, .5, 1); }
  .iconbtn.spin { animation: spin .8s linear infinite; }
  .empty .art { display: inline-block; animation: bob 2.4s ease-in-out infinite; }
  .empty .art.ring { transform-origin: 50% 10%; animation: ring 2.8s ease-in-out infinite; }
  .step.done .num { animation: pop .5s cubic-bezier(.3, 1.8, .5, 1) .3s both; }
  .card.soon { animation: rise .5s both, dash 3s ease-in-out infinite; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes slide { from { opacity: 0; transform: translateX(-14px); } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 20px) scale(.9); } }
@keyframes orb { to { transform: translate(-70px, 60px) scale(1.25); } }
@keyframes orb2 { to { transform: translate(90px, -40px) scale(1.3); } }
@keyframes sheen { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(77, 224, 178, .55); } 80%, 100% { box-shadow: 0 0 0 9px rgba(77, 224, 178, 0); } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-8deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes glow { 0%, 100% { box-shadow: 0 12px 40px rgba(139, 115, 255, .3); } 50% { box-shadow: 0 18px 56px rgba(139, 115, 255, .6); } }
@keyframes breathe { 50% { transform: scale(1.08); } }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(90deg); } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes ring { 0%, 50%, 100% { transform: rotate(0); } 5%, 15%, 25% { transform: rotate(14deg); } 10%, 20%, 30% { transform: rotate(-14deg); } }
@keyframes dash { 50% { border-color: rgba(139, 115, 255, .55); } }
.sparkle.s1 { top: -4px; left: calc(50% + 46px); }
.sparkle.s2 { top: 40px; left: calc(50% - 64px); font-size: 10px; animation-delay: 1s; }
.sparkle.s3 { top: 70px; left: calc(50% + 58px); font-size: 11px; animation-delay: 2s; }
.view.quiet > *, .view.quiet .list .item, .view.quiet .wave { animation: none; }
