:root {
  --bg: #050814;
  --surface: rgba(14, 23, 43, .84);
  --surface-2: #111a31;
  --line: rgba(124, 156, 217, .17);
  --text: #f7f9ff;
  --muted: #8e9bb7;
  --blue: #3478ff;
  --cyan: #24d4ff;
  --violet: #8a6bff;
  --green: #45dd7d;
  --amber: #ffb13d;
  --red: #ff5c68;
  --safe-bottom: max(14px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { min-height: 100%; background: var(--bg); color-scheme: dark; }
body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -14%, rgba(40, 93, 224, .22), transparent 37%),
    linear-gradient(180deg, #050814 0%, #070b18 54%, #050814 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.ambient { position: fixed; width: 420px; height: 420px; border-radius: 50%; filter: blur(120px); opacity: .12; pointer-events: none; }
.ambient--one { top: -250px; left: -190px; background: #217cff; }
.ambient--two { right: -220px; bottom: -280px; background: #734cff; }

.app-shell { width: min(100%, 720px); min-height: 100svh; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 14px 112px; position: relative; z-index: 1; }
.boot-screen { min-height: 78svh; display: grid; place-items: center; align-content: center; text-align: center; }
.boot-screen h1 { margin: 18px 0 4px; font-size: 24px; letter-spacing: -.04em; }
.boot-screen p { margin: 0; color: var(--muted); font-size: 12px; }
.loader { width: 24px; height: 24px; margin-top: 28px; border: 2px solid rgba(90, 150, 255, .18); border-top-color: #46adff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.topbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 15px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand { min-width: 0; display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border: 2px solid #6b9bff; border-radius: 50%; background: radial-gradient(circle at 35% 28%, #315da5, #071326 54%, #02050c); box-shadow: inset 0 0 0 3px #071020, 0 0 26px rgba(52,120,255,.27); }
.brand-mark--large { width: 82px; height: 82px; }
.brand-mark span { font-size: 11px; font-weight: 950; font-style: italic; letter-spacing: -.07em; text-shadow: 0 0 10px #4bbfff; }
.brand-mark--large span { font-size: 20px; }
.brand strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(15px, 4vw, 19px); letter-spacing: -.025em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.online { display: inline-flex; align-items: center; gap: 6px; color: #64718b; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(69,221,125,.7); }

.screen { padding: 26px 2px 8px; animation: screen-in .25s ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.welcome, .page-title, .section-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.welcome, .page-title { margin-bottom: 21px; }
.eyebrow { margin: 0 0 6px; color: #6580ac; font-size: 9px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(25px, 7vw, 36px); line-height: 1.07; letter-spacing: -.038em; }
h2 { margin-bottom: 0; font-size: 21px; letter-spacing: -.025em; }
h3 { margin-bottom: 0; font-size: 16px; }
.round-button, .avatar { width: 43px; height: 43px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; }
.avatar { display: grid; place-items: center; background: linear-gradient(145deg, #7760d9, #1b2345); border-color: rgba(138,107,255,.7); font-weight: 850; }

.subscription-card { min-height: 198px; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: clamp(21px, 5vw, 32px); overflow: hidden; border: 1px solid rgba(68,131,255,.42); border-radius: 28px; background: linear-gradient(135deg, rgba(12,28,58,.98), rgba(10,21,42,.86)); box-shadow: 0 25px 80px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.04); }
.subscription-card::after { content: ""; width: 310px; height: 310px; position: absolute; top: -180px; right: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(23,178,255,.22), transparent 65%); pointer-events: none; }
.status-line { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; font-size: clamp(17px,4.6vw,24px); font-weight: 850; }
.shield { width: 42px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; color: white; font-size: 21px; background: linear-gradient(145deg, #41df7a, #087e45); clip-path: polygon(50% 0,92% 15%,86% 72%,50% 100%,14% 72%,8% 15%); filter: drop-shadow(0 8px 16px rgba(36,208,105,.25)); }
.shield--warning { background: linear-gradient(145deg, #ffbb54, #b36507); }
.shield--danger { background: linear-gradient(145deg, #ff7780, #b51d37); }
.subscription-copy { min-width: 0; position: relative; z-index: 1; }
.subscription-copy > p { margin: 14px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.subscription-copy > p strong { display: block; color: #dce4f4; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid rgba(69,221,125,.2); border-radius: 999px; color: var(--green); background: rgba(34,185,96,.1); font-size: 11px; font-weight: 750; }
.status-pill--warning { color: var(--amber); border-color: rgba(255,177,61,.25); background: rgba(255,177,61,.09); }
.status-pill--danger { color: var(--red); border-color: rgba(255,92,104,.25); background: rgba(255,92,104,.09); }
.price-orb { width: 116px; height: 116px; flex: 0 0 auto; position: relative; z-index: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--cyan) 0 78%, rgba(69,101,160,.2) 78%); box-shadow: 0 0 42px rgba(36,212,255,.12); }
.price-orb::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: #091127; }
.price-orb div { position: relative; display: grid; text-align: center; }
.price-orb strong { font-size: 21px; line-height: 1; }
.price-orb span { margin-top: 5px; color: var(--cyan); font-size: 10px; font-weight: 800; }

.primary, .secondary, .danger-button { width: 100%; min-height: 58px; border-radius: 18px; font-weight: 800; font-size: 15px; cursor: pointer; transition: transform .14s ease, filter .14s ease; }
.primary { margin-top: 16px; border: 0; background: linear-gradient(100deg, #2865fb, #199cf9); box-shadow: 0 17px 36px rgba(32,107,255,.26); }
.secondary { margin-top: 12px; border: 1px solid #2f86ff; color: #52a8ff; background: rgba(25,73,152,.1); }
.danger-button { margin-top: 12px; border: 1px solid rgba(255,92,104,.45); color: #ff7b83; background: rgba(255,92,104,.08); }
.primary:active, .secondary:active, .danger-button:active { transform: scale(.985); }
.primary:disabled, .secondary:disabled { opacity: .48; cursor: default; }
.microcopy { margin: 11px 0 0; text-align: center; color: #6d7b98; font-size: 10px; }

.section { margin-top: 30px; }
.section-title { margin-bottom: 14px; }
.section-title button { border: 0; color: #4ca7ff; background: transparent; font-size: 12px; cursor: pointer; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-card { min-height: 91px; display: flex; align-items: center; gap: 12px; padding: 15px; text-align: left; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(17,29,54,.95), rgba(10,17,33,.94)); cursor: pointer; }
.action-card strong { font-size: 12px; line-height: 1.35; }
.icon { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(58,130,255,.22); border-radius: 13px; color: #5aa6ff; background: rgba(42,117,255,.13); font-size: 19px; font-weight: 850; }
.icon--cyan { color: var(--cyan); background: rgba(36,212,255,.1); }
.icon--violet { color: #a48fff; background: rgba(138,107,255,.12); }
.icon--green { color: var(--green); background: rgba(69,221,125,.1); }
.icon--amber { color: var(--amber); background: rgba(255,177,61,.1); }

.network-card, .panel, .renew-card { border: 1px solid var(--line); border-radius: 23px; background: linear-gradient(135deg, rgba(15,25,47,.95), rgba(8,15,29,.93)); }
.network-card { min-height: 108px; margin-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 19px; }
.healthy { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--green); font-size: 10px; }
.flags { display: flex; padding-right: 4px; }
.flags span { width: 38px; height: 38px; display: grid; place-items: center; margin-left: -8px; border: 3px solid #0b1223; border-radius: 50%; background: #111b31; font-size: 19px; }

.hero-metric { min-height: 143px; position: relative; display: flex; align-items: center; gap: 17px; padding: 23px; overflow: hidden; border-radius: 27px; background: linear-gradient(105deg, #2758e9, #1e8eff 62%, #20cfea); box-shadow: 0 22px 55px rgba(32,111,255,.28); }
.hero-metric::after { content: ""; width: 190px; height: 190px; position: absolute; top: -50px; right: -48px; border: 30px solid rgba(255,255,255,.1); border-radius: 50%; }
.hero-metric .icon { color: white; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.13); }
.hero-metric div:nth-child(2) { display: grid; position: relative; z-index: 1; }
.hero-metric strong { font-size: 39px; line-height: .95; }
.hero-metric span { font-size: 19px; font-weight: 800; }
.hero-metric small { margin-top: 9px; color: rgba(255,255,255,.78); font-size: 11px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 11px; }
.metric { min-height: 86px; display: flex; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.metric > div { min-width: 0; display: grid; }
.metric strong { overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.metric span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.attention-bar { margin-top: 11px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.attention-bar button { min-height: 65px; padding: 11px 7px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); cursor: pointer; }
.attention-bar strong, .attention-bar span { display: block; }
.attention-bar strong { color: #edf3ff; font-size: 18px; }
.attention-bar span { margin-top: 3px; color: var(--muted); font-size: 8px; }

.search { min-height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 15px; border: 1px solid var(--line); border-radius: 16px; background: rgba(13,22,41,.88); }
.search span { color: #6d7d9a; font-size: 22px; }
.search input { width: 100%; border: 0; outline: 0; color: white; background: transparent; font-size: 14px; }
.search input::placeholder { color: #576580; }
.filter-tabs { display: flex; gap: 7px; margin: 13px 0 16px; overflow-x: auto; scrollbar-width: none; }
.filter-tabs button { padding: 9px 12px; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; color: #7d8aa4; background: rgba(12,20,38,.8); font-size: 10px; cursor: pointer; }
.filter-tabs button.active { color: white; border-color: rgba(61,137,255,.55); background: rgba(40,102,211,.32); }

.list { display: grid; gap: 9px; }
.client-row, .list-row { width: 100%; min-height: 72px; display: flex; align-items: center; gap: 11px; padding: 12px 14px; text-align: left; border: 1px solid var(--line); border-radius: 18px; background: rgba(13,22,41,.86); cursor: pointer; }
.state-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(69,221,125,.4); }
.state-dot--soon, .state-dot--unknown { background: var(--amber); box-shadow: 0 0 9px rgba(255,177,61,.35); }
.state-dot--expired, .state-dot--disabled { background: var(--red); box-shadow: 0 0 9px rgba(255,92,104,.35); }
.client-avatar { width: 43px; height: 43px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(69,221,125,.17); border-radius: 50%; color: #70de96; background: rgba(69,221,125,.08); font-weight: 850; }
.client-main, .row-main { min-width: 0; display: grid; }
.client-main strong, .row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.client-main small, .row-main small { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; color: #697792; font-size: 9px; }
.client-side { margin-left: auto; display: grid; text-align: right; }
.client-side strong { font-size: 12px; }
.client-side small { margin-top: 4px; font-size: 9px; }
.state-active { color: var(--green); }
.state-soon, .state-unknown { color: var(--amber); }
.state-expired, .state-disabled { color: var(--red); }
.chevron { color: #4d5c78; font-size: 21px; }
.row-action { margin-left: auto; padding: 8px 10px; border: 1px solid rgba(67,133,255,.35); border-radius: 11px; color: #67afff; background: rgba(43,112,255,.1); font-size: 10px; cursor: pointer; }
.row-action--success { color: var(--green); border-color: rgba(69,221,125,.3); background: rgba(69,221,125,.08); }
.row-action--danger { color: var(--red); border-color: rgba(255,92,104,.3); background: rgba(255,92,104,.08); }
.button-pair { margin-left: auto; display: flex; gap: 5px; }
.empty { padding: 38px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); font-size: 12px; }

.renew-card { padding: 22px; }
.renew-card p { margin-bottom: 8px; color: #86a0cb; font-size: 10px; }
.renew-card h2 { font-size: 18px; }
.renew-card > div { margin-top: 21px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.renew-card strong { color: white; font-size: 18px; }
.payment-methods, .tool-list { margin-top: 12px; display: grid; gap: 9px; }
.payment-methods button, .tool-list button { min-height: 72px; display: flex; align-items: center; gap: 12px; padding: 13px 14px; text-align: left; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); cursor: pointer; }
.payment-methods button > span:nth-child(2), .tool-list button > span:nth-child(2) { min-width: 0; display: grid; }
.payment-methods small, .tool-list small { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 9px; }
.payment-methods b, .tool-list b { margin-left: auto; color: #50607d; font-size: 20px; }
.support-hero { padding: 27px 20px; margin-bottom: 13px; text-align: center; border: 1px solid var(--line); border-radius: 23px; background: linear-gradient(145deg, rgba(19,34,65,.94), rgba(9,17,33,.94)); }
.support-hero .icon { margin: 0 auto 14px; }
.support-hero p { max-width: 330px; margin: 9px auto 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.panel { padding: 18px; }
.panel + .panel { margin-top: 10px; }
.qr-image { width: min(74vw, 300px); display: block; margin: 4px auto 17px; padding: 12px; border-radius: 22px; background: white; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.connection-link { padding: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--line); border-radius: 13px; color: #9eb7de; background: #080e1d; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }

.bottom-nav { width: min(calc(100% - 22px), 700px); position: fixed; z-index: 20; left: 50%; bottom: var(--safe-bottom); transform: translateX(-50%); display: grid; grid-template-columns: repeat(4,1fr); gap: 2px; padding: 8px; border: 1px solid rgba(127,155,211,.18); border-radius: 24px; background: rgba(10,17,32,.93); box-shadow: 0 22px 65px rgba(0,0,0,.46); backdrop-filter: blur(22px); }
.bottom-nav button { min-height: 60px; display: grid; place-items: center; align-content: center; gap: 4px; border: 0; border-radius: 17px; color: #68758e; background: transparent; cursor: pointer; }
.bottom-nav button > span { min-height: 23px; font-size: 21px; font-weight: 850; line-height: 1; }
.bottom-nav button small { font-size: 8px; font-weight: 750; }
.bottom-nav button.active { color: #4d9eff; background: rgba(41,104,211,.13); text-shadow: 0 0 18px rgba(59,150,255,.65); }

.modal-backdrop { position: fixed; z-index: 40; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 30px 10px 0; background: rgba(1,4,12,.72); backdrop-filter: blur(9px); animation: fade-in .2s ease; }
.modal { width: min(100%, 680px); max-height: min(88svh, 850px); overflow-y: auto; padding: 21px 17px calc(21px + env(safe-area-inset-bottom)); border: 1px solid rgba(129,159,219,.22); border-bottom: 0; border-radius: 28px 28px 0 0; background: #0b1223; box-shadow: 0 -25px 80px rgba(0,0,0,.55); animation: modal-in .24s ease; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { transform: translateY(30px); opacity: .5; } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 18px; }
.modal-head p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.modal-close { width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; color: #91a0bc; background: var(--surface); font-size: 20px; cursor: pointer; }
.form-grid { display: grid; gap: 12px; }
.form-grid--two { grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 7px; color: #8190ac; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.field input, .field textarea, .field select { width: 100%; min-height: 49px; padding: 12px 13px; outline: 0; border: 1px solid var(--line); border-radius: 14px; color: white; background: #080e1d; font-size: 13px; text-transform: none; letter-spacing: 0; }
.field textarea { min-height: 105px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: rgba(61,137,255,.65); box-shadow: 0 0 0 3px rgba(52,120,255,.09); }
.checkbox { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; color: #c8d1e3; background: #080e1d; font-size: 12px; }
.checkbox input { width: 19px; height: 19px; accent-color: var(--blue); }

.toast { max-width: calc(100% - 34px); position: fixed; z-index: 60; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 9px; padding: 12px 15px; border: 1px solid rgba(75,225,134,.24); border-radius: 15px; color: #dffdeb; background: rgba(9,23,27,.96); box-shadow: 0 18px 55px rgba(0,0,0,.45); font-size: 11px; animation: toast-in .22s ease both; }
.toast--error { color: #ffe1e3; border-color: rgba(255,92,104,.28); background: rgba(35,10,18,.96); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%,8px); } }
.fatal { min-height: 76svh; display: grid; place-items: center; text-align: center; }
.fatal-card { max-width: 420px; padding: 28px 22px; border: 1px solid var(--line); border-radius: 25px; background: var(--surface); }
.fatal-card .icon { margin: 0 auto 16px; }
.fatal-card p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

@media (max-width: 390px) {
  .subscription-card { min-height: 184px; padding: 19px; }
  .price-orb { width: 96px; height: 96px; }
  .price-orb::before { inset: 8px; }
  .price-orb strong { font-size: 18px; }
  .status-line { align-items: flex-start; }
  .shield { width: 36px; height: 42px; font-size: 18px; }
  .action-card { gap: 8px; padding: 13px 10px; }
  .icon { width: 36px; height: 36px; }
  .metric { padding: 11px; }
  .metric .icon { display: none; }
  .client-row { gap: 8px; padding-inline: 10px; }
  .client-avatar { width: 38px; height: 38px; }
}
@media (min-width: 760px) {
  .app-shell { margin-top: 18px; padding-inline: 38px; border: 1px solid rgba(132,160,212,.12); border-radius: 34px; background: rgba(5,9,19,.55); box-shadow: 0 40px 120px rgba(0,0,0,.32); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
