/* Nova Share — the Nova "deep space" design: glass panels on a drifting nebula, violet → blue → cyan. */
:root {
  --bg: #0c0918; --bg2: #120e26; --glass: rgba(26, 20, 52, .58); --glass-hi: rgba(40, 32, 78, .62);
  --line: rgba(196, 181, 253, .12); --line2: rgba(196, 181, 253, .22);
  --text: #f1eeff; --muted: #a29bc4; --faint: #6f6894;
  --v: #8b5cf6; --b: #3b82f6; --c: #22d3ee; --pink: #e879f9;
  --ok: #34d399; --warn: #fbbf24; --bad: #fb7185;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #3b82f6 75%, #22d3ee 100%);
  --r: 20px; --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, sans-serif;
  color-scheme: dark;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { -webkit-user-select: none; user-select: none; }
.hidden { display: none !important; }
svg { display: block; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(196, 181, 253, .16); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
small { display: block; font-size: 12.5px; margin-top: 2px; }
.mono { font-family: "Cascadia Code", "SF Mono", Consolas, monospace; }

/* ---------- living background ---------- */
.space { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.neb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; will-change: transform; }
.n1 { width: 70vmax; height: 70vmax; left: -22vmax; top: -30vmax; background: radial-gradient(circle, #7c3aed 0%, transparent 65%); animation: drift1 38s ease-in-out infinite alternate; }
.n2 { width: 60vmax; height: 60vmax; right: -24vmax; bottom: -30vmax; background: radial-gradient(circle, #2563eb 0%, transparent 65%); opacity: .38; animation: drift2 46s ease-in-out infinite alternate; }
.n3 { width: 38vmax; height: 38vmax; left: 45%; top: 30%; background: radial-gradient(circle, #0891b2 0%, transparent 65%); opacity: .16; animation: drift3 30s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(10vmax, 8vmax) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-12vmax, -6vmax) scale(1.12); } }
@keyframes drift3 { to { transform: translate(-16vmax, 10vmax) scale(.9); } }
.stars { position: absolute; inset: -50%; background-image:
  radial-gradient(1px 1px at 12% 18%, #fff8, transparent), radial-gradient(1px 1px at 72% 34%, #fff6, transparent),
  radial-gradient(1.5px 1.5px at 38% 72%, #fff7, transparent), radial-gradient(1px 1px at 88% 82%, #fff5, transparent),
  radial-gradient(1px 1px at 56% 12%, #fff6, transparent), radial-gradient(1.5px 1.5px at 22% 56%, #c4b5fd88, transparent),
  radial-gradient(1px 1px at 64% 64%, #a5f3fc88, transparent), radial-gradient(1px 1px at 8% 88%, #fff5, transparent);
  background-size: 420px 420px; animation: twinkle 7s ease-in-out infinite alternate, starfall 240s linear infinite; }
@keyframes twinkle { from { opacity: .45; } to { opacity: .9; } }
@keyframes starfall { to { transform: translateY(420px); } }

/* ---------- glass, buttons, inputs ---------- */
.glass { background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); box-shadow: 0 18px 50px rgba(5, 2, 20, .45), inset 0 1px 0 rgba(255, 255, 255, .05); }
.btn { position: relative; overflow: hidden; font: inherit; font-size: 14px; font-weight: 650; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(255, 255, 255, .06); cursor: pointer; text-decoration: none;
  transition: transform .15s var(--ease), background .2s, box-shadow .25s, border-color .2s; white-space: nowrap; }
.btn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(196, 181, 253, .35); }
.btn:active { transform: scale(.96); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn.primary { border: 0; background: var(--grad); background-size: 160% 160%; box-shadow: 0 8px 28px rgba(124, 58, 237, .45), inset 0 1px 0 rgba(255,255,255,.25); animation: sheen 6s ease-in-out infinite; color: #fff; }
.btn.primary:hover { box-shadow: 0 10px 36px rgba(99, 102, 241, .6), inset 0 1px 0 rgba(255,255,255,.3); }
@keyframes sheen { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.btn.ghost { background: transparent; }
.btn.danger { color: #fda4af; }
.btn.danger:hover { background: rgba(251, 113, 133, .12); border-color: rgba(251, 113, 133, .35); }
.btn.big { padding: 15px 20px; font-size: 16px; border-radius: 14px; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }
.btn.sm svg { width: 15px; height: 15px; }
.btn.icon { padding: 8px; width: 36px; height: 36px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn .ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.35); transform: scale(0); animation: ripple .6s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
input, textarea, select { font: inherit; font-size: 15px; color: var(--text); background: rgba(10, 6, 28, .55); border: 1px solid var(--line2); border-radius: 13px; padding: 12px 14px; outline: none;
  -webkit-user-select: text; user-select: text; transition: border-color .2s, box-shadow .2s, background .2s; min-width: 0; }
select { cursor: pointer; }
select option { background: #1a1436; }
input:focus, textarea:focus, select:focus { border-color: var(--v); box-shadow: 0 0 0 4px rgba(139, 92, 246, .22); background: rgba(16, 10, 40, .7); }
input::placeholder { color: var(--faint); }
.switch { position: relative; width: 48px; height: 28px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: rgba(255,255,255,.12); cursor: pointer; transition: background .3s var(--ease), box-shadow .3s; }
.switch span::after { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .35s var(--spring); box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.switch input:checked + span { background: var(--grad); box-shadow: 0 0 18px rgba(139, 92, 246, .5); }
.switch input:checked + span::after { transform: translateX(20px); }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: rgba(10, 6, 28, .5); border: 1px solid var(--line); }
.seg button { flex: 1; font: inherit; font-size: 13px; font-weight: 600; border: 0; background: transparent; color: var(--muted); padding: 8px 10px; border-radius: 10px; cursor: pointer; transition: all .25s var(--ease); white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.active { color: #fff; background: rgba(139, 92, 246, .32); box-shadow: inset 0 0 0 1px rgba(196, 181, 253, .35), 0 4px 14px rgba(124, 58, 237, .3); }
.seg.small { display: inline-flex; } .seg.small button { font-size: 12px; padding: 6px 12px; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; padding: 5px 11px; border-radius: 99px; background: rgba(255,255,255,.07); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok, .chip.live { color: #6ee7b7; background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .25); }
.chip.live i { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: beat 1.8s infinite; }
.chip.warn { color: #fcd34d; background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .25); }
.chip.off { color: var(--faint); }
.chip.net { color: #67e8f9; background: rgba(34, 211, 238, .1); border-color: rgba(34, 211, 238, .25); }
.chip.codechip { font-family: "Cascadia Code", Consolas, monospace; color: #c4b5fd; letter-spacing: .08em; }
@keyframes beat { 70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

/* ---------- splash ---------- */
.splash { position: fixed; inset: 0; z-index: 90; display: grid; place-content: center; justify-items: center; gap: 22px; background: radial-gradient(circle at 50% 45%, #1b1340, var(--bg) 70%); transition: opacity .6s var(--ease), visibility .6s; }
.splash.out { opacity: 0; visibility: hidden; }
.logo-orbit { position: relative; width: 160px; height: 160px; display: grid; place-items: center; animation: pop .9s var(--spring) both; }
.logo-orbit img { position: relative; z-index: 2; filter: drop-shadow(0 12px 34px rgba(139, 92, 246, .7)); }
.logo-orbit .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: #c4b5fd; border-right-color: rgba(34, 211, 238, .6); animation: spin 1.6s linear infinite; }
.logo-orbit .r2 { inset: 14px; border-top-color: rgba(232, 121, 249, .8); border-right-color: transparent; border-left-color: rgba(99, 102, 241, .7); animation-duration: 2.4s; animation-direction: reverse; }
.splash-name { font-size: 26px; font-weight: 500; letter-spacing: -.02em; animation: rise .8s .25s var(--ease) both; }
.splash-name b { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.splash-bar { width: 170px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; animation: rise .8s .4s var(--ease) both; }
.splash-bar i { display: block; height: 100%; width: 40%; border-radius: 4px; background: var(--grad); animation: load 1.1s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes float { 50% { transform: translateY(-10px); } }
@keyframes wave { from { transform: scale(1); opacity: .9; } to { transform: scale(2); opacity: 0; } }

/* ---------- common blocks ---------- */
.card { border-radius: var(--r); padding: 20px 22px; margin-bottom: 18px; animation: cardIn .6s var(--ease) both; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.card-head h3 { margin: 0; font-size: 15.5px; letter-spacing: .01em; }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #c4b5fd; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-radius: 14px; background: rgba(255,255,255,.035); border: 1px solid transparent; transition: border-color .2s, background .2s; animation: cardIn .45s var(--ease) both; min-width: 0; }
.item:hover { border-color: var(--line2); background: rgba(255,255,255,.055); }
.ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, rgba(139, 92, 246, .35), rgba(34, 211, 238, .22)); overflow: hidden; }
.ico svg { width: 21px; height: 21px; fill: none; stroke: #e9e4ff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico img { width: 100%; height: 100%; object-fit: cover; }
.ico.up { background: linear-gradient(135deg, rgba(139, 92, 246, .45), rgba(99, 102, 241, .25)); }
.ico.down { background: linear-gradient(135deg, rgba(34, 211, 238, .35), rgba(59, 130, 246, .25)); }
.grow { flex: 1; min-width: 0; }
.item b, .item .name { font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 22px; text-align: center; color: var(--faint); font-size: 13.5px; border: 1px dashed var(--line2); border-radius: 14px; }
.bar { position: relative; height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 8px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--grad); background-size: 200% 100%; transition: width .4s var(--ease); animation: barflow 2s linear infinite; }
.bar.done i { background: var(--ok); animation: none; }
.bar.bad i { background: var(--bad); animation: none; }
@keyframes barflow { to { background-position: -200% 0; } }
.progress-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* QR + code */
.qr { width: 220px; height: 220px; background: #fff; border-radius: 18px; padding: 10px; box-shadow: 0 0 0 6px rgba(139, 92, 246, .25), 0 20px 50px rgba(124, 58, 237, .4); animation: pop .5s var(--spring); flex: none; }
.qr svg { width: 100%; height: 100%; }
.code { font-family: "Cascadia Code", Consolas, monospace; font-size: 30px; font-weight: 800; letter-spacing: .18em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-user-select: text; user-select: text; }
.linkbox { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 13px; background: rgba(10, 6, 28, .55); border: 1px solid var(--line2); min-width: 0; }
.linkbox span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: #c4b5fd; font-family: "Cascadia Code", Consolas, monospace; -webkit-user-select: text; user-select: text; }

/* modal & toast */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(6, 3, 18, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade .25s; padding: 16px; }
.modal-card { position: relative; width: min(460px, 100%); max-height: 92vh; overflow-y: auto; border-radius: 26px; padding: 28px; animation: pop .45s var(--spring); }
.modal-card.center { text-align: center; }
.modal-card h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; }
.modal-card p { font-size: 13.5px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: var(--text); cursor: pointer; font-size: 14px; z-index: 2; }
.x:hover { background: rgba(255,255,255,.14); }
.toast { position: fixed; left: 50%; top: calc(18px + var(--sat)); z-index: 95; transform: translate(-50%, -16px); opacity: 0; pointer-events: none; padding: 11px 18px; border-radius: 14px; max-width: calc(100vw - 32px);
  background: rgba(30, 22, 62, .94); border: 1px solid var(--line2); font-size: 14px; font-weight: 550; box-shadow: 0 14px 40px rgba(0,0,0,.45); transition: all .35s var(--spring); backdrop-filter: blur(16px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(251, 113, 133, .45); }

/* orbit art (drop zones, empty states) */
.orbit { position: relative; width: 120px; height: 120px; display: grid; place-items: center; margin: 0 auto; }
.orbit .core { position: relative; z-index: 2; width: 74px; height: 74px; border-radius: 24px; display: grid; place-items: center; background: var(--grad); box-shadow: 0 14px 40px rgba(124, 58, 237, .55); animation: float 5s ease-in-out infinite; }
.orbit .core svg { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.orbit .o { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(196, 181, 253, .25); }
.orbit .o1 { animation: spin 18s linear infinite; }
.orbit .o2 { inset: -22px; border-color: rgba(34, 211, 238, .14); animation: spin 28s linear infinite reverse; }
.orbit .o1::after, .orbit .o2::after { content: ""; position: absolute; top: 10%; left: 12%; width: 8px; height: 8px; border-radius: 50%; background: #c4b5fd; box-shadow: 0 0 12px #a78bfa; }
.orbit .o2::after { background: #67e8f9; box-shadow: 0 0 12px #22d3ee; top: 82%; left: 8%; }
.beacon { position: relative; width: 96px; height: 96px; flex: none; display: grid; place-items: center; }
.beacon i { position: relative; z-index: 2; width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); box-shadow: 0 10px 34px rgba(124, 58, 237, .6); transition: filter .4s; }
.beacon i svg { width: 32px; height: 32px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.beacon span { position: absolute; inset: 13px; border-radius: 50%; border: 2px solid rgba(167, 139, 250, .7); animation: wave 2.7s ease-out infinite; }
.beacon span:nth-child(2) { animation-delay: .9s; } .beacon span:nth-child(3) { animation-delay: 1.8s; }
.beacon.off i { filter: grayscale(1) brightness(.55); box-shadow: none; } .beacon.off span { display: none; }
