:root {
  --bg: #070a12;
  --bg2: #0d1220;
  --card: rgba(255, 255, 255, .045);
  --card-solid: #121829;
  --line: rgba(255, 255, 255, .08);
  --text: #f2f5fb;
  --muted: #8d97ad;
  --accent: #2ee6a6;
  --accent2: #22b8ff;
  --accent-ink: #03241a;
  --danger: #ff6b81;
  --warn: #ffc857;
  --radius: 20px;
  --tabbar: 64px;
  --grad: linear-gradient(135deg, #2ee6a6 0%, #22b8ff 100%);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  background:
    radial-gradient(900px 500px at 50% -180px, rgba(46, 230, 166, .14), transparent 60%),
    radial-gradient(700px 400px at 110% 30%, rgba(34, 184, 255, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
main {
  max-width: 520px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(var(--tabbar) + 28px + env(safe-area-inset-bottom));
}
main.no-tabs { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
h1 { font-size: 28px; line-height: 1.15; margin: 6px 0 8px; letter-spacing: -0.025em; font-weight: 750; }
h2 { font-size: 18px; margin: 0 0 12px; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }
a { color: var(--accent2); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.loader { color: var(--muted); text-align: center; padding: 120px 0; }

/* top bar */
.top { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; min-height: 40px; }
.top .logo { width: 34px; height: 34px; border-radius: 10px; }
.top .title { font-weight: 700; letter-spacing: -0.01em; }
.top .sp { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--accent2); font: inherit; font-size: 16px; padding: 6px 2px; cursor: pointer; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.card.glow { border-color: rgba(46, 230, 166, .25); box-shadow: 0 10px 40px -18px rgba(46, 230, 166, .45); }

/* status orb */
.orb-wrap { display: grid; place-items: center; padding: 18px 0 6px; }
.orb { position: relative; width: 196px; height: 196px; border-radius: 50%; display: grid; place-items: center; }
.orb::before, .orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.orb::before { background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .08), rgba(255, 255, 255, .015) 70%); border: 1px solid var(--line); }
.orb::after { inset: -14px; border: 2px solid transparent; }
.orb.on::after { border-color: rgba(46, 230, 166, .35); animation: pulse 2.6s ease-out infinite; }
.orb.on::before { background: radial-gradient(circle at 50% 35%, rgba(46, 230, 166, .35), rgba(34, 184, 255, .08) 70%); border-color: rgba(46, 230, 166, .5); box-shadow: 0 0 70px rgba(46, 230, 166, .35), inset 0 0 40px rgba(46, 230, 166, .2); }
.orb.off::before { background: radial-gradient(circle at 50% 35%, rgba(255, 107, 129, .18), rgba(255, 255, 255, .02) 70%); border-color: rgba(255, 107, 129, .35); }
.orb svg { position: relative; width: 84px; height: 84px; z-index: 1; }
@keyframes pulse { 0% { transform: scale(.92); opacity: 1; } 100% { transform: scale(1.12); opacity: 0; } }
.status-title { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; margin: 14px 0 2px; text-align: center; }
.status-sub { color: var(--muted); text-align: center; margin: 0 0 6px; }
.status-title.on { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 10px; text-align: center; }
.stat b { display: block; font-size: 18px; letter-spacing: -0.01em; white-space: nowrap; }
.stat span { color: var(--muted); font-size: 12px; }

/* buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 15px 16px; margin: 10px 0 0; border-radius: 15px; cursor: pointer;
  font-family: inherit; font-weight: 650; font-size: 17px; line-height: 1.2; text-decoration: none;
  background: rgba(255, 255, 255, .07); color: var(--text); border: 1px solid var(--line);
  transition: transform .12s, opacity .12s;
}
.btn.primary { background: var(--grad); color: var(--accent-ink); border: 0; box-shadow: 0 10px 30px -12px rgba(46, 230, 166, .7); }
.btn.store { background: #fff; color: #000; border: 0; }
.btn.store svg { width: 20px; height: 20px; }
.btn.danger { color: var(--danger); }
.btn.small { width: auto; margin: 0; padding: 9px 14px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.98); }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }

/* price */
.price-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.price { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.price small { font-size: 16px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.perks { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.perks li { display: flex; gap: 10px; align-items: center; color: #cfd6e4; font-size: 15px; }
.perks li::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; background: rgba(46, 230, 166, .16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%232ee6a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }

/* credentials */
.creds { background: rgba(0, 0, 0, .35); border: 1px dashed rgba(255, 255, 255, .16); border-radius: 16px; padding: 14px 16px; margin: 4px 0 6px; }
.creds label { display: block; color: var(--muted); font-size: 13px; margin-top: 10px; }
.creds label:first-child { margin-top: 0; }
.creds input { width: 100%; background: transparent; border: 0; color: var(--text); padding: 2px 0; font: 700 23px/1.3 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .02em; outline: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 .btn { margin: 0; font-size: 15px; padding: 14px 10px; flex-direction: column; gap: 4px; }
.grid2 .btn .ic { font-size: 22px; }
.warn { background: rgba(255, 200, 87, .08); border: 1px solid rgba(255, 200, 87, .28); color: #ffe2a3; border-radius: 14px; padding: 12px 14px; font-size: 15px; margin: 12px 0; }
.ok { background: rgba(46, 230, 166, .08); border: 1px solid rgba(46, 230, 166, .3); color: #b6f7de; border-radius: 14px; padding: 12px 14px; font-size: 15px; margin: 12px 0; }
.check { display: flex; gap: 12px; align-items: center; margin: 16px 0 4px; font-size: 16px; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--accent); flex: none; }
.hint { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 15px; margin: 12px 0 0; }
.hint b { color: var(--text); font-weight: 600; }

/* forms */
.field { margin: 12px 0; }
.field label { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.field input { width: 100%; padding: 15px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); color: var(--text); font-family: inherit; font-size: 17px; outline: none; }
.field input:focus { border-color: rgba(46, 230, 166, .5); }
.err { color: var(--danger); font-size: 15px; min-height: 20px; margin-top: 8px; }

/* devices */
.dev { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.dev:first-of-type { border-top: 0; padding-top: 2px; }
.dev .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(34, 184, 255, .12); font-size: 20px; flex: none; }
.dev .name { flex: 1; font-weight: 650; min-width: 0; }
.dev .sub { color: var(--muted); font-size: 13px; font-weight: 400; }
.empty { text-align: center; padding: 18px 0 6px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 6px; }

/* key screen */
.qr { background: #fff; border-radius: 18px; padding: 16px; width: min(100%, 280px); margin: 8px auto 4px; }
.qr svg { display: block; width: 100%; height: auto; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 20px 46px; }
.steps > li:last-child { padding-bottom: 4px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: -3px; width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.steps > li::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 4px; width: 2px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps b { font-weight: 650; }
.shot { margin-top: 10px; background: #f2f2f7; color: #111; border-radius: 16px; padding: 12px; font-size: 14px; }
.shot .bar { display: flex; justify-content: space-between; align-items: center; font-weight: 600; gap: 8px; }
.shot .pill { background: #fff; border-radius: 11px; padding: 10px 12px; margin-top: 8px; display: flex; justify-content: space-between; align-items: center; }
.shot .plus { color: #007aff; font-size: 24px; line-height: 1; }
.shot .toggle { width: 44px; height: 27px; border-radius: 14px; background: #34c759; position: relative; flex: none; }
.shot .toggle::after { content: ""; position: absolute; right: 2px; top: 2px; width: 23px; height: 23px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.shot .blue { color: #007aff; }
.shot .wg { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: #88171a; color: #fff; font-size: 11px; font-weight: 800; margin-right: 8px; }
.seg { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); padding: 4px; border-radius: 14px; margin: 14px 0; }
.seg button { flex: 1; padding: 10px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-family: inherit; font-weight: 650; font-size: 15px; cursor: pointer; }
.seg button.on { background: rgba(255, 255, 255, .1); color: var(--text); }
details { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 10px 0; }
summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 12px; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 18px; font-size: 16px; line-height: 1.35; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--grad); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.msg.admin { align-self: flex-start; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg time { display: block; font-size: 11px; opacity: .6; margin-top: 3px; }
.chat-day { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 2px; }
.composer {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 20;
  padding: 10px 16px; background: rgba(7, 10, 18, .9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line);
}
.composer form { max-width: 520px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; max-height: 120px; min-height: 44px; padding: 11px 14px; border-radius: 22px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--text); font-family: inherit; font-size: 16px; outline: none; }
.composer button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--grad); color: var(--accent-ink); font-size: 20px; cursor: pointer; flex: none; }
.composer button:disabled { opacity: .4; }
main.with-composer { padding-bottom: calc(var(--tabbar) + 96px + env(safe-area-inset-bottom)); }

/* tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(7, 10, 18, .88); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--line);
}
.tabbar nav { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar button { position: relative; background: none; border: 0; color: var(--muted); font-family: inherit; font-size: 11px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; cursor: pointer; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.on { color: var(--accent); }
.badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* welcome */
.hero { text-align: center; padding: 6px 0 4px; }
.hero h1 { font-size: 32px; margin-top: 18px; }
.hero h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 6px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; text-align: left; }
.feature .ic { font-size: 22px; }
.feature b { display: block; margin-top: 6px; font-size: 15px; }
.feature span { color: var(--muted); font-size: 13px; }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + 22px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); z-index: 50;
  background: #fff; color: #111; padding: 12px 18px; border-radius: 14px; font-weight: 650; font-size: 15px;
  opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* iPhone mockups for instructions */
.phone { position: relative; width: 236px; margin: 14px auto 6px; padding: 10px; border-radius: 38px; background: #1b1f27; box-shadow: 0 0 0 2px #2c323d, 0 20px 50px -20px rgba(0, 0, 0, .8); }
.phone .scr { position: relative; border-radius: 29px; overflow: hidden; background: #f2f2f7; color: #111; min-height: 300px; font: 13px/1.3 -apple-system, system-ui, sans-serif; }
.phone .scr.dark { background: #000; color: #fff; }
.phone .sb { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px 4px; font-weight: 600; font-size: 12px; }
.phone .sb .isl { width: 70px; height: 20px; border-radius: 12px; background: #000; }
.phone .vpn { background: #fff; color: #000; border-radius: 4px; padding: 0 4px; font-size: 10px; font-weight: 800; margin-right: 4px; }
.phone .scr.light .vpn { background: #111; color: #fff; }
.phone .hdr { padding: 6px 14px 8px; font-weight: 700; font-size: 20px; display: flex; justify-content: space-between; align-items: center; }
.phone .row2 { display: flex; align-items: center; gap: 10px; background: #fff; margin: 6px 10px; padding: 10px; border-radius: 12px; }
.phone .row2 .t { flex: 1; min-width: 0; }
.phone .row2 .t small { display: block; color: #8e8e93; font-size: 11px; }
.phone .app { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; flex: none; }
.phone .wgicon { background: linear-gradient(135deg, #a3191c, #6b0f12); }
.phone .getbtn { background: #007aff; color: #fff; border-radius: 14px; padding: 5px 14px; font-weight: 700; font-size: 12px; }
.phone .blue { color: #007aff; }
.phone .tog { width: 40px; height: 24px; border-radius: 12px; background: #34c759; position: relative; flex: none; }
.phone .tog::after { content: ""; position: absolute; right: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.phone .tog.off { background: #e5e5ea; }
.phone .tog.off::after { right: auto; left: 2px; }
.phone .sheet { position: absolute; left: 0; right: 0; bottom: 0; background: #f2f2f7; border-radius: 16px 16px 0 0; padding: 12px 10px 14px; box-shadow: 0 -8px 30px rgba(0, 0, 0, .25); }
.phone .apps { display: flex; gap: 8px; justify-content: space-between; padding: 6px 2px 10px; }
.phone .apps div { text-align: center; font-size: 10px; width: 46px; }
.phone .apps .app { width: 42px; height: 42px; margin: 0 auto 4px; }
.phone .menu { background: #fff; border-radius: 12px; overflow: hidden; }
.phone .menu div { padding: 10px 12px; border-top: 1px solid #e5e5ea; display: flex; justify-content: space-between; }
.phone .menu div:first-child { border-top: 0; }
.phone .dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); }
.phone .alert { position: absolute; left: 22px; right: 22px; top: 96px; background: rgba(242, 242, 247, .97); border-radius: 14px; text-align: center; overflow: hidden; }
.phone .alert .body { padding: 14px 12px; }
.phone .alert .body b { display: block; margin-bottom: 4px; }
.phone .alert .btns { display: flex; border-top: 1px solid #d1d1d6; }
.phone .alert .btns div { flex: 1; padding: 10px; color: #007aff; }
.phone .alert .btns div + div { border-left: 1px solid #d1d1d6; font-weight: 700; }
.phone .safari { position: absolute; left: 0; right: 0; bottom: 0; background: #f9f9f9; border-top: 1px solid #ddd; display: flex; justify-content: space-around; padding: 10px 0 16px; color: #007aff; font-size: 18px; }
.phone .page { margin: 6px 10px; background: #0b0f19; color: #e6ebf5; border-radius: 12px; padding: 12px; font-size: 12px; }
.hl { position: relative; z-index: 2; box-shadow: 0 0 0 3px #ff2d55 !important; border-radius: 12px; animation: hl 1.4s ease-in-out infinite; }
@keyframes hl { 50% { box-shadow: 0 0 0 6px rgba(255, 45, 85, .35) !important; } }
.cap { text-align: center; color: var(--muted); font-size: 13px; margin: 2px 0 6px; }
.keycard { display: flex; gap: 14px; align-items: center; }
.keycard .ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: rgba(46, 230, 166, .12); flex: none; }
