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

:root {
  --bg: #0f0f13;
  --surface: #1a1a24;
  --surface2: #22222f;
  --border: rgba(255,255,255,0.08);
  --accent: #6c63ff;
  --accent2: #8b83ff;
  --text: #f0f0f8;
  --text2: #9090a8;
  --green: #4caf82;
  --radius: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  position: relative;
  min-height: 100vh;
}

/* PAGES */
.page {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 0 32px;
  animation: fadeIn 0.2s ease;
}
.page.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* HEADER */
.page-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 12px;
}
.page-header h2 { font-size: 18px; font-weight: 600; }
.back-btn {
  background: none;
  border: none;
  color: var(--accent2);
  font-size: 28px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

/* HERO */
.hero {
  padding: 48px 24px 32px;
  text-align: center;
}
.logo { font-size: 64px; margin-bottom: 16px; }
.hero h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.subtitle { color: var(--text2); font-size: 15px; }

/* MENU BUTTONS */
.menu {
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.menu-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.menu-btn:active { background: var(--surface2); }
.menu-btn.locked { opacity: 0.5; }
.menu-icon { font-size: 22px; }
.menu-text { flex: 1; font-size: 16px; font-weight: 500; }
.menu-arrow { color: var(--text2); font-size: 20px; }

/* INSTALL OPTIONS */
.install-options {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
}
.option-btn.primary {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(108,99,255,0.15), rgba(108,99,255,0.05));
}
.option-btn:active { opacity: 0.8; }
.opt-icon { font-size: 28px; }
.opt-text { flex: 1; }
.opt-text strong { display: block; font-size: 15px; margin-bottom: 2px; }
.opt-text small { color: var(--text2); font-size: 13px; }
.opt-arrow { color: var(--text2); font-size: 20px; }

/* SETUP THIS DEVICE */
.setup-content {
  padding: 20px 16px;
}
.device-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--surface2);
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 15px;
}
.device-badge .db-icon { font-size: 24px; }
.device-badge .db-label { color: var(--text2); font-size: 13px; }

.section-label {
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding: 0 4px;
}

/* TOGGLE */
.app-toggle {
  display: flex;
  background: var(--surface2);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}
.toggle-btn {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.toggle-btn.active {
  background: var(--accent);
  color: #fff;
}

/* DOWNLOAD BOX */
.download-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.download-box .app-name {
  font-weight: 600;
  margin-bottom: 4px;
}
.download-box .app-desc {
  color: var(--text2);
  font-size: 13px;
  margin-bottom: 12px;
}
.download-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--accent2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

/* ACTION BUTTONS */
.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-top: 8px;
  transition: opacity 0.15s;
}
.action-btn:active { opacity: 0.8; }
.action-btn.secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

/* SUB LINK */
.sub-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.sub-url {
  flex: 1;
  font-size: 12px;
  color: var(--text2);
  word-break: break-all;
  line-height: 1.4;
}
.copy-btn {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

/* QR */
.qr-container {
  text-align: center;
  margin-bottom: 20px;
}
#qr-code { display: inline-block; background: #fff; padding: 12px; border-radius: 12px; }
.qr-hint { color: var(--text2); font-size: 13px; margin-top: 8px; }

.divider-label {
  text-align: center;
  color: var(--text2);
  font-size: 13px;
  margin-bottom: 12px;
}

/* OTHER DEVICE */
.other-device-content {
  padding: 20px 16px;
}

/* PROFILE */
.profile-content {
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.avatar { font-size: 64px; }
.profile-name { font-size: 20px; font-weight: 600; }
.profile-card {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.profile-row:last-child { border-bottom: none; }
.badge-inactive {
  background: rgba(255,80,80,0.15);
  color: #ff6060;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
}
.badge-active {
  background: rgba(76,175,130,0.15);
  color: var(--green);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
}

/* SUPPORT */
.support-content {
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.support-icon { font-size: 64px; }
.support-content p { color: var(--text2); font-size: 15px; }
.support-content .action-btn { max-width: 300px; }

/* COMING SOON */
.coming-soon {
  padding: 48px 24px;
  text-align: center;
}
.cs-icon { font-size: 64px; margin-bottom: 16px; }
.coming-soon h3 { font-size: 22px; margin-bottom: 8px; }
.coming-soon p { color: var(--text2); }

/* TOAST */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(108,99,255,0.95);
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  z-index: 999;
  backdrop-filter: blur(10px);
  transition: opacity 0.3s;
}
.toast.hidden { opacity: 0; pointer-events: none; }
