:root {
  color-scheme: dark;
  --bg-0: #08111d;
  --bg-1: #0d1b2b;
  --ink: #eef7f4;
  --muted: #8fa2b4;
  --muted-2: #5f7286;
  --line: rgba(191, 225, 214, 0.14);
  --card: rgba(11, 24, 38, 0.82);
  --card-2: rgba(17, 35, 53, 0.84);
  --card-strong: rgba(235, 249, 242, 0.08);
  --green: #62f2ae;
  --green-2: #18c98a;
  --mint-soft: rgba(98, 242, 174, 0.14);
  --amber: #ffd166;
  --amber-soft: rgba(255, 209, 102, 0.14);
  --coral: #ff705d;
  --coral-soft: rgba(255, 112, 93, 0.15);
  --blue: #67c7ff;
  --blue-soft: rgba(103, 199, 255, 0.14);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Commissioner", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16% -8%, rgba(98, 242, 174, 0.2), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(103, 199, 255, 0.18), transparent 26%),
    linear-gradient(145deg, #07101b 0%, #0d1b2b 42%, #101b18 100%);
  color: var(--ink);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 72%);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.orb {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(44px);
  opacity: 0.62;
}

.orb-a {
  width: 220px;
  height: 220px;
  top: -96px;
  left: -62px;
  background: rgba(98, 242, 174, 0.32);
}

.orb-b {
  width: 260px;
  height: 260px;
  right: -124px;
  top: 110px;
  background: rgba(103, 199, 255, 0.24);
}

.orb-c {
  width: 240px;
  height: 240px;
  left: 24%;
  bottom: -150px;
  background: rgba(255, 209, 102, 0.18);
}

.app-shell {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 18px 12px 24px;
  position: relative;
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 20px 16px 18px;
  border: 1px solid rgba(221, 255, 242, 0.14);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(12, 29, 46, 0.9), rgba(7, 18, 30, 0.92));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius-xl) - 1px);
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 4%, rgba(98, 242, 174, 0.18), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(255, 209, 102, 0.12), transparent 20%);
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

.hero-topline,
.section-label,
.stat-label,
.config-label,
.orbit-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-topline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(98, 242, 174, 0.12);
}

.hero-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin: 18px 0 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: cover;
  object-position: center;
  background: #050b12;
  border: 1px solid rgba(221, 241, 255, 0.16);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.3),
    0 0 0 6px rgba(98, 242, 174, 0.06);
}

.hero-header h1 {
  margin: 0;
  font-size: clamp(27px, 7vw, 40px);
  line-height: 0.96;
  font-weight: 900;
  letter-spacing: -0.06em;
}

#brand-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.status-pill {
  flex: none;
  padding: 10px 13px;
  border-radius: 999px;
  color: #052017;
  background: linear-gradient(135deg, var(--green), #b7ffd8);
  box-shadow: 0 10px 30px rgba(98, 242, 174, 0.24);
  font-size: 12px;
  font-weight: 900;
}

.status-pill.inactive {
  color: #dfe8ef;
  background: rgba(143, 162, 180, 0.18);
  box-shadow: none;
}

.state-box,
.empty-card,
.warning-box {
  border-radius: var(--radius-md);
  padding: 16px;
}

.state-box {
  color: #c4d4df;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.loading-line {
  height: 5px;
  width: 54%;
  margin-bottom: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  animation: scan 1.2s ease-in-out infinite;
}

@keyframes scan {
  0% {
    transform: translateX(-18%);
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(88%);
    opacity: 0.4;
  }
}

.state-error,
.warning-box {
  color: #ffd1cb;
  background: var(--coral-soft);
  border: 1px solid rgba(255, 112, 93, 0.28);
}

.subscription-orbit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(98, 242, 174, 0.12), rgba(103, 199, 255, 0.06)),
    rgba(255, 255, 255, 0.05);
}

.orbit-title {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 900;
}

.orbit-badge {
  font-family: "JetBrains Mono", monospace;
  padding: 9px 11px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(98, 242, 174, 0.1);
  border: 1px solid rgba(98, 242, 174, 0.22);
  font-size: 12px;
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-card,
.expiry-card,
.usage-card,
.connection-panel,
.step-item,
.device-card,
.media-note,
.link-card,
.action-row,
.empty-card,
.modal-card,
.config-box,
.guide-checklist,
.quick-import-card {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stat-card {
  min-height: 100px;
  padding: 15px 14px;
  border-radius: var(--radius-md);
}

.stat-value {
  margin-top: 10px;
  font-size: 18px;
  line-height: 1.16;
  font-weight: 900;
  word-break: break-word;
}

.expiry-card {
  margin-top: 12px;
  padding: 16px 14px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.12), transparent 42%),
    var(--card);
}

.expiry-days {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  color: var(--amber);
  letter-spacing: -0.04em;
}

.expiry-right {
  color: #cfdae2;
  text-align: right;
  font-weight: 800;
  line-height: 1.35;
}

.warning-box {
  margin-top: 12px;
  font-weight: 800;
}

.usage-card {
  margin-top: 12px;
  padding: 16px 14px;
  border-radius: var(--radius-lg);
  background: var(--card-2);
}

.usage-header,
.usage-scale,
.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.usage-header {
  font-weight: 900;
}

#traffic-mode-label,
#usage-percent {
  font-family: "JetBrains Mono", monospace;
  color: var(--green);
  font-size: 12px;
}

.progress-bar {
  height: 11px;
  margin: 15px 0 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
}

.progress-bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width 0.35s ease;
}

.usage-scale {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.traffic-note {
  margin-top: 12px;
  color: #c1d0da;
  line-height: 1.55;
  font-size: 14px;
}

.section-label {
  margin: 22px 4px 11px;
}

.connection-panel {
  padding: 15px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 8% 0%, rgba(98, 242, 174, 0.14), transparent 34%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), transparent 42%),
    var(--card);
}

.connection-hero {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.connection-kicker {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.connection-hero h2 {
  margin: 6px 0 8px;
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.connection-hero p {
  margin: 0;
  color: #c1d0da;
  line-height: 1.5;
  font-size: 14px;
}

.connection-badge {
  flex: none;
  padding: 10px 11px;
  border-radius: 14px;
  color: #06111d;
  background: linear-gradient(135deg, var(--green), #c6ffdd);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 900;
}

.step-track {
  display: grid;
  gap: 9px;
  margin-top: 15px;
}

.step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
}

.step-item > span {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #06111d;
  background: var(--green);
  font-family: "JetBrains Mono", monospace;
  font-weight: 900;
}

.step-item strong {
  display: block;
  font-weight: 900;
}

.step-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 13px;
}

.device-card {
  min-height: 98px;
  padding: 13px;
  border-radius: var(--radius-md);
  color: var(--ink);
  background: linear-gradient(160deg, rgba(103, 199, 255, 0.08), rgba(255, 255, 255, 0.045));
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.device-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-bottom: 9px;
  border-radius: 12px;
  background: rgba(98, 242, 174, 0.12);
  border: 1px solid rgba(98, 242, 174, 0.2);
}

.device-card strong,
.media-note strong {
  display: block;
  font-weight: 900;
}

.device-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.3;
}

.media-note {
  margin-top: 13px;
  padding: 13px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.12), rgba(103, 199, 255, 0.05)),
    rgba(255, 255, 255, 0.055);
}

.media-note span {
  display: block;
  margin-top: 5px;
  color: #c1d0da;
  line-height: 1.45;
  font-size: 13px;
}

.quick-import-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-import-card,
.device-card,
.link-card,
.action-row,
.secondary-btn,
.modal-close {
  font: inherit;
}

.quick-import-card {
  min-height: 88px;
  padding: 13px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.quick-import-card strong,
.link-card strong {
  display: block;
  font-weight: 900;
}

.quick-import-card small,
.link-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.quick-icon {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #06111d;
  background: var(--green);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 900;
}

.quick-happ .quick-icon {
  background: linear-gradient(135deg, var(--green), #b9ffd9);
}

.quick-hiddify .quick-icon {
  background: linear-gradient(135deg, #67c7ff, #d8f3ff);
}

.quick-v2raytun .quick-icon {
  background: linear-gradient(135deg, #ffd166, #fff0b3);
}

.quick-streisand .quick-icon {
  background: linear-gradient(135deg, #ff8a72, #ffd1c7);
}

.link-card,
.action-row {
  width: 100%;
  border-radius: var(--radius-lg);
  padding: 16px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.link-card {
  background:
    linear-gradient(135deg, rgba(98, 242, 174, 0.12), rgba(103, 199, 255, 0.06)),
    var(--card);
}

.action-list {
  display: grid;
  gap: 9px;
}

.action-row {
  background: rgba(255, 255, 255, 0.055);
}

.link-card-arrow,
.action-row span:last-child {
  color: var(--green);
  font-size: 24px;
  line-height: 1;
}

.page-footer {
  padding: 18px 0 4px;
  color: var(--muted-2);
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.empty-card {
  color: #d4e1e8;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.06);
}

.empty-card h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.empty-card p {
  color: var(--muted);
  line-height: 1.55;
}

.empty-card code {
  color: var(--green);
  font-family: "JetBrains Mono", monospace;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 8, 14, 0.62);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(100%, 480px);
  max-height: 86vh;
  overflow: auto;
  padding: 18px 16px 16px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(22, 45, 66, 0.96), rgba(9, 20, 33, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.48);
}

.modal-header {
  font-size: 19px;
  font-weight: 900;
}

.modal-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  font-size: 24px;
  cursor: pointer;
}

.modal-body {
  margin-top: 16px;
  color: #c0d0dc;
}

.modal-body p {
  line-height: 1.55;
}

.modal-body ol {
  margin: 14px 0 18px;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.guide-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.guide-pills span {
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(98, 242, 174, 0.1);
  border: 1px solid rgba(98, 242, 174, 0.18);
  font-size: 12px;
  font-weight: 900;
}

.guide-checklist {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 13px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
}

.guide-checklist strong {
  margin-bottom: 2px;
  color: var(--green);
}

.guide-checklist div {
  position: relative;
  padding-left: 22px;
  color: #c1d0da;
  line-height: 1.45;
  font-size: 13px;
}

.guide-checklist div::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 900;
}

.config-box {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
}

.config-box code {
  display: block;
  max-height: 132px;
  margin-top: 8px;
  overflow: auto;
  word-break: break-all;
  color: #d7f6ea;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  line-height: 1.5;
}

.secondary-btn {
  width: 100%;
  margin-top: 14px;
  padding: 15px 16px;
  border: 0;
  border-radius: 16px;
  color: #06111d;
  background: linear-gradient(135deg, var(--green), #b7ffd8);
  font-weight: 900;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 30;
  width: min(calc(100% - 32px), 420px);
  padding: 14px 16px;
  border: 1px solid rgba(98, 242, 174, 0.26);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(8, 17, 29, 0.94);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
  transform: translateX(-50%);
  font-weight: 800;
  text-align: center;
}

@media (hover: hover) {
  .quick-import-card:hover,
  .device-card:hover,
  .link-card:hover,
  .action-row:hover,
  .secondary-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(98, 242, 174, 0.28);
  }
}

@media (max-width: 380px) {
  .app-shell {
    padding: 12px 8px 18px;
  }

  .hero-card {
    padding: 16px 12px 14px;
    border-radius: 28px;
  }

  .hero-header {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .status-pill {
    width: max-content;
  }

  .stats-grid,
  .device-grid,
  .quick-import-grid {
    grid-template-columns: 1fr;
  }

  .expiry-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .expiry-right {
    text-align: left;
  }
}
