/* ==========================================================================
  SPPhoneSMS — global theme stylesheet
   Single source of truth for every view in index.html.
   Sections: 1 tokens · 2 reset · 3 shell · 4 sidebar · 5 topbar · 6 views
             7 buttons · 8 cards/panels · 9 phone mock · 10 products
             11 api docs · 12 animations · 13 responsive
   ========================================================================== */

/* ------------------------------ 1. TOKENS ------------------------------- */
:root {
  /* surfaces */
  --bg-main: #0E1118;
  --bg-card: #161B26;
  --bg-elevated: #1C2333;
  --bg-inset: #10141D;

  /* brand */
  --accent: #FF7A00;
  --accent-soft: #FF9B3D;
  --accent-deep: #E56A00;
  --accent-glow: #FF7A0040;
  --accent-tint: #FF7A0014;

  /* status */
  --accent-warning: #2C1A10;
  --warning-border: #FF7A0033;
  --green: #22C55E;
  --green-soft: #22C55E1F;
  --red: #F43F5E;
  --red-soft: #F43F5E1F;

  /* type */
  --text-main: #EDF1F7;
  --text-muted: #8F9CAE;
  --text-dim: #5D6879;

  /* lines + shape */
  --border: #232B3A;
  --border-soft: #FFFFFF0F;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* depth */
  --shadow-sm: 0 2px 8px #00000040;
  --shadow: 0 12px 30px #00000059;
  --shadow-lg: 0 30px 70px #000000a6;

  /* metrics */
  --sidebar-w: 264px;
  --gap: 20px;
  --ease: all 0.2s ease-in-out;

  /* legacy aliases — keep older markup/scripts working */
  --bg-primary: var(--bg-main);
  --accent-orange: var(--accent);
  --text-secondary: var(--text-muted);

  color-scheme: dark;
}

/* ------------------------------- 2. RESET ------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* soft ambient light behind the whole app */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 78% -8%, #FF7A0016, transparent 65%),
    radial-gradient(700px 500px at 0% 100%, #2B6CFF0F, transparent 60%);
}

h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
strong { font-weight: 650; }

code, pre, .inline-code, .otp, .price {
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------- 2b. SCROLLBARS ----------------------------- */
* { scrollbar-width: thin; scrollbar-color: #2B3446 transparent; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #2B3446;
  border: 2px solid var(--bg-main);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-corner { background: transparent; }

/* ------------------------------- 3. SHELL ------------------------------- */
.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
  width: 100%;
}

.main-window {
  flex: 1 1 auto;
  min-width: 0;              /* lets inner tables shrink instead of overflowing */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ------------------------------ 4. SIDEBAR ------------------------------ */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, #141926 0%, #0F131C 100%);
  border-right: 1px solid var(--border);
  transition: transform 0.28s ease-in-out;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 6px 0;
  transition: var(--ease);
}
.brand:hover { transform: translateX(2px); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, var(--accent-soft), var(--accent-deep));
  box-shadow: 0 6px 18px var(--accent-glow);
  flex: 0 0 auto;
}
.brand-mark svg { width: 20px; height: 20px; }

.brand-text {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.2px;
  color: var(--text-muted);
  white-space: nowrap;
}
.brand-text strong {
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: var(--ease);
}

.nav-tab .nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  transition: var(--ease);
}

.nav-tab:hover {
  background: #FFFFFF08;
  border-color: var(--border-soft);
  color: var(--text-main);
  transform: translateX(3px) scale(1.015);
}
.nav-tab:hover .nav-icon { color: var(--accent); transform: scale(1.08); }

.nav-tab.active-tab {
  background: linear-gradient(90deg, var(--accent-tint), transparent 85%);
  border-color: var(--warning-border);
  color: var(--text-main);
}
.nav-tab.active-tab .nav-icon { color: var(--accent); }

/* left indicator rail on the active tab */
.nav-tab.active-tab::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

/* bottom account block — pinned by auto margin */
.side-account {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.account-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  margin-bottom: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: var(--ease);
}
.account-card:hover { border-color: var(--warning-border); }

.account-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #232B3A;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.account-meta { display: flex; flex-direction: column; line-height: 1.25; }
.account-meta strong { font-size: 14px; }
.account-meta small { color: var(--text-dim); font-size: 12px; }

/* mobile drawer backdrop — app.js removes [hidden] to reveal it */
.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: #05070Bcc;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease-in-out;
}
.sidebar-scrim[hidden] { display: none; }

/* ------------------------------- 5. TOPBAR ------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 28px;
  background: #0E1118d9;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-title {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.topbar-side {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--ease);
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { color: var(--accent); border-color: var(--warning-border); transform: scale(1.06); }

.menu-toggle { display: none; }  /* shown under 1024px */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: var(--ease);
}
.chip strong { color: var(--text-main); }
.chip-live { color: var(--green); border-color: #22C55E33; background: var(--green-soft); }
.chip-wallet:hover { border-color: var(--warning-border); }

/* live status dot with a soft pulse */
.dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 2.4s ease-in-out infinite;
}

/* ---------------------- 6. VIEW FLIPPING MECHANISM ---------------------- */
.view { display: none; }

.view.active-view {
  display: block;
  padding: 26px 28px 46px;
  animation: viewIn 0.3s ease-in-out both;
}

/* consistent vertical rhythm between the blocks of any view, so switching
   tabs never changes the page's outer boundaries */
.view.active-view > * + * { margin-top: 22px; }

/* ------------------------------ 7. BUTTONS ------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--ease);
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  color: #17110A;
  box-shadow: 0 6px 16px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 26px #FF7A0059;
  filter: saturate(1.15) brightness(1.05);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-tint);
  transform: translateY(-2px) scale(1.02);
}

.btn-ghost {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text-main);
}
.btn-ghost:hover {
  background: #232B3A;
  border-color: var(--warning-border);
  transform: translateY(-1px);
}

.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 7px; }
.btn-block { width: 100%; }

/* --------------------------- 8. CARDS & PANELS -------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: var(--ease);
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.panel-flush { padding: 18px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.panel-title { font-size: 16.5px; font-weight: 650; letter-spacing: -0.2px; }
.panel-sub { margin-top: 5px; color: var(--text-muted); font-size: 13.5px; }

.panel-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  transition: var(--ease);
}
.panel-link:hover { color: var(--accent-soft); transform: translateX(3px); }

/* a card nested inside a panel steps down a shade so edges stay readable */
.panel .card { background: var(--bg-inset); }

.accent { color: var(--accent); }

/* -------------------------------- 9. HOME ------------------------------- */
.hero-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 34px;
}

.hero-copy { flex: 1 1 480px; min-width: 0; }

.eyebrow {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-pill);
  background: var(--accent-warning);
  color: var(--accent-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.hero-title {
  margin-top: 16px;
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -1px;
}

.hero-sub {
  margin-top: 14px;
  max-width: 56ch;
  color: var(--text-muted);
  font-size: 15px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 22px;
}

/* pill-shaped primary call to action */
.btn-pill { border-radius: var(--radius-pill); padding: 12px 30px; font-size: 14.5px; }

/* feature grid — 4 square channel boxes */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.feature-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  aspect-ratio: 1 / 1;
  max-width: 122px;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-inset);
  color: var(--text-muted);
  text-align: center;
  transition: var(--ease);
}
.feature-box:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--text-main);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px var(--accent-glow);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--accent);
  transition: var(--ease);
}
.feature-box:hover .feature-icon { background: var(--accent); color: #17110A; }
.feature-icon svg { width: 20px; height: 20px; }

.feature-label { font-size: 11.5px; font-weight: 600; line-height: 1.3; }

/* metrics strip — auto-fits from 4 columns down to 1 */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}
.metric-card:hover {
  border-color: var(--warning-border);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.metric-label {
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1.15;
}
.metric-value small {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0;
}

.metric-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 12.5px;
}
.metric-foot.up { color: var(--green); }

.meter {
  height: 5px;
  margin-top: 12px;
  border-radius: var(--radius-pill);
  background: #FFFFFF0D;
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  box-shadow: 0 0 12px var(--accent-glow);
  animation: growX 0.9s ease-in-out both;
}

/* wallet row */
.wallet-panel { padding: 18px; }

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.wallet-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.wallet-card:hover { border-color: var(--warning-border); transform: translateY(-3px); }

.wallet-primary {
  border-color: var(--warning-border);
  background: linear-gradient(160deg, var(--accent-warning), var(--bg-inset) 70%);
}

.wallet-label {
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.wallet-value { font-size: 24px; font-weight: 700; letter-spacing: -0.6px; }
.wallet-foot { color: var(--text-dim); font-size: 12.5px; }
.wallet-card .btn { margin-top: 8px; }

/* "Pick a service" ribbon — horizontal scroll on small screens */
.service-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scroll-snap-type: x proximity;
}
.service-strip::-webkit-scrollbar { height: 6px; }

.service-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 148px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-inset);
  cursor: pointer;
  transition: var(--ease);
}
.service-chip:hover {
  border-color: var(--accent);
  transform: translateY(-5px) scale(1.03);
  box-shadow: var(--shadow);
}
.service-chip.active-chip {
  border-color: var(--accent);
  background: linear-gradient(165deg, var(--accent-warning), var(--bg-inset));
}

.service-name { font-size: 14px; font-weight: 600; }
.service-price { color: var(--text-dim); font-size: 12px; }

/* shared app glyph — used in the strip, the phone mock and the platform list */
.service-logo,
.push-app {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.push-app { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }

.app-fb { background: linear-gradient(145deg, #1877F2, #0C5DC4); }
.app-ig { background: linear-gradient(145deg, #F9CE34, #EE2A7B 55%, #6228D7); }
.app-tt { background: linear-gradient(145deg, #25F4EE, #111 55%, #FE2C55); }
.app-tg { background: linear-gradient(145deg, #37BBFE, #007DBB); }
.app-wa { background: linear-gradient(145deg, #4AD860, #1CA050); }
.app-gg { background: linear-gradient(145deg, #4285F4, #34A853 60%, #EA4335); }

/* --------------------- 9b. HERO DEVICE FRAME ---------------------------- */
/* CSS-only smartphone console: fixed 320×620 frame, dark header bar, and a
   clipped (hidden-overflow) message viewport with alternating bubbles. */
.device-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 14px 0 6px;
  min-width: 0;
}

/* glowing backdrop boundary behind the device */
.device-glow {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, #FF7A0038 0%, #FF7A0012 45%, transparent 70%);
  filter: blur(14px);
  animation: breathe 6s ease-in-out infinite;
}

.device-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 320px;
  max-width: 100%;
  height: 620px;
  border-radius: 34px;
  border: 1px solid #FFFFFF1F;
  background: linear-gradient(160deg, #2A3244 0%, #141926 45%, #0C1017 100%);
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px #000000cc,
    inset 0 1px 0 #FFFFFF26;
  overflow: hidden;
  animation: slideUpFade 0.6s ease-in-out both;
}

/* dark console header bar */
.device-header {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 13px 16px;
  background: #0A0D14;
  border-bottom: 1px solid var(--border);
}
.device-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.device-dot:nth-child(1) { background: #FF5F57; }
.device-dot:nth-child(2) { background: #FEBC2E; }
.device-dot:nth-child(3) { background: #28C840; }
.device-title {
  margin-left: auto;
  color: var(--text-dim);
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

/* message viewport — clips content instead of scrolling */
.device-screen {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 16px 14px;
  background:
    radial-gradient(120% 70% at 50% 0%, #FF7A001F, transparent 60%),
    linear-gradient(180deg, #131824, #0B0E15);
  box-shadow: inset 0 0 0 1px #FFFFFF0F;
}

.thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

.msg-bubble {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  animation: slideUpFade 0.65s ease-in-out both;
}
.msg-bubble:nth-of-type(1) { animation-delay: 0.18s; }
.msg-bubble:nth-of-type(2) { animation-delay: 0.34s; }
.msg-bubble:nth-of-type(3) { animation-delay: 0.5s; }
.msg-bubble p {
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  word-break: break-word;
}
.msg-tag {
  display: block;
  margin-bottom: 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
}

/* 1 · incoming system node */
.msg-in {
  align-self: flex-start;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-bottom-left-radius: 4px;
}
.msg-in .msg-tag { color: var(--text-dim); }

/* 2 · outgoing console terminal command */
.msg-out {
  align-self: flex-end;
  background: var(--bg-inset);
  border-color: var(--warning-border);
  color: var(--accent-soft);
  border-bottom-right-radius: 4px;
}
.msg-out .msg-tag { color: var(--accent); }

/* 3 · highlighted server log confirmation */
.msg-log {
  align-self: flex-start;
  background: var(--green-soft);
  border-color: #22C55E40;
  color: #6EE7A0;
  border-top-left-radius: 4px;
}
.msg-log .msg-tag { color: var(--green); }

/* orange action chip pinned to the thread tail */
.thread-chip {
  align-self: flex-end;
  margin-top: auto;
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  color: #17110A;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px var(--accent-glow);
  transition: var(--ease);
  animation: slideUpFade 0.65s 0.64s ease-in-out both;
}
.thread-chip:hover {
  transform: translateY(-2px);
  filter: saturate(1.15) brightness(1.05);
}
.thread-chip:active { transform: translateY(0) scale(0.97); }

/* ------------------------------ 10. PRODUCTS ---------------------------- */
.alert {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.alert-warn {
  background: var(--accent-warning);
  border: 1px solid var(--warning-border);
  color: #F3D3B5;
}

.alert-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #FF7A0026;
  color: var(--accent);
}
.alert-icon svg { width: 19px; height: 19px; }

.alert-text { font-size: 13.5px; }
.alert-text strong { color: var(--accent-soft); }
.alert .btn { margin-left: auto; }

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.col-title { font-size: 14px; font-weight: 650; }

.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.platform-col { display: flex; flex-direction: column; gap: 14px; }

.platform-list { display: flex; flex-direction: column; gap: 8px; }

.platform-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  text-align: left;
  cursor: pointer;
  transition: var(--ease);
}
.platform-tab:hover {
  border-color: var(--accent);
  transform: translateX(4px) scale(1.01);
  box-shadow: var(--shadow-sm);
}
.platform-tab.active-tab {
  border-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-warning), var(--bg-card) 80%);
}
.platform-tab.active-tab .platform-arrow { color: var(--accent); transform: translateX(2px); }

.platform-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.platform-meta strong { font-size: 14px; }
.platform-meta small { color: var(--text-dim); font-size: 11.5px; }

.platform-arrow {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  transition: var(--ease);
}

.col-note {
  padding: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: #FFFFFF05;
}
.col-note strong { display: block; margin-bottom: 4px; color: var(--accent-soft); font-size: 12.5px; }
.col-note p { color: var(--text-muted); font-size: 12.5px; }

.search { display: flex; }
.search input {
  width: 190px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 13px;
  transition: var(--ease);
}
.search input::placeholder { color: var(--text-dim); }
.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

/* ------------------------------- 10b. TABLES ---------------------------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}

.price-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 14px;
}

.price-table thead th {
  padding: 0 14px 6px;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

.price-table tbody tr {
  background: var(--bg-card);
  transition: var(--ease);
}
.price-table tbody td {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.price-table tbody td:first-child {
  border-left: 1px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius);
}
.price-table tbody td:last-child {
  border-right: 1px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
  text-align: right;
  white-space: nowrap;
}

/* row hover — border + tint instead of transform, which table rows ignore */
.price-table tbody tr:hover { background: var(--bg-elevated); }
.price-table tbody tr:hover td { border-color: var(--warning-border); }
.price-table tbody tr:hover .price { color: var(--accent); }
.price-table tbody tr:hover .flag { transform: scale(1.08); }
.price-table tbody tr:hover .btn-rent {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 8px 18px #FF7A004D;
}

.flag {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 21px;
  margin-right: 10px;
  vertical-align: middle;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  box-shadow: inset 0 0 0 1px #FFFFFF26;
  transition: var(--ease);
}
.flag-us { background: linear-gradient(160deg, #3C3B6E 45%, #B22234 45%); }
.flag-kh { background: linear-gradient(180deg, #032EA1 30%, #E00025 30% 70%, #032EA1 70%); }
.flag-hk { background: linear-gradient(160deg, #DE2910, #B01F0C); }
.flag-gb { background: linear-gradient(160deg, #012169 40%, #C8102E 40%); }

.country-name { font-weight: 550; }
.country-name small { color: var(--text-dim); font-weight: 500; }

.price { font-size: 14.5px; font-weight: 700; transition: var(--ease); }

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 650;
}
.pill-good { background: var(--green-soft); color: #6EE7A0; }
.pill-mid  { background: var(--accent-tint); color: var(--accent-soft); }
.pill-bad  { background: var(--red-soft); color: #FB7185; }

/* Active Numbers + History */
.dual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 190px;
  padding: 24px 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: #FFFFFF05;
  text-align: center;
  transition: var(--ease);
}
.empty-state:hover { border-color: var(--warning-border); background: var(--accent-tint); }

.empty-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-dim);
}
.empty-icon svg { width: 22px; height: 22px; }

.empty-title { font-size: 14.5px; font-weight: 650; }
.empty-sub { max-width: 34ch; color: var(--text-dim); font-size: 12.5px; }

/* ------------------------------ 11. API DOCS ---------------------------- */
.doc-grid {
  display: grid;
  grid-template-columns: minmax(0, 226px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

/* quick-jump list sticks under the topbar */
.doc-nav {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.doc-nav-title {
  margin-bottom: 6px;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.doc-link {
  padding: 8px 11px;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 550;
  transition: var(--ease);
}
.doc-link:hover {
  border-left-color: var(--warning-border);
  background: #FFFFFF08;
  color: var(--text-main);
  transform: translateX(3px);
}
.doc-link.active-link {
  border-left-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}

.doc-nav-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.doc-nav-foot strong { font-size: 13px; }
.doc-nav-foot p { margin: 4px 0 10px; color: var(--text-dim); font-size: 12px; }

.doc-body { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.doc-section { scroll-margin-top: 90px; }
.doc-section .panel-sub { margin-bottom: 16px; }

.inline-code {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-inset);
  color: var(--accent-soft);
  font-size: 12.5px;
}

/* base-url copy row */
.copy-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-inset);
  transition: var(--ease);
}
.copy-box:hover { border-color: var(--warning-border); }
.copy-box code {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--text-main);
  font-size: 13.5px;
}
.copy-box .btn { flex: 0 0 auto; }

/* app.js flips this class for ~1.2s after a successful copy */
.btn-copy.copied {
  border-color: #22C55E4D;
  background: var(--green-soft);
  color: #6EE7A0;
}

.fact-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.fact-row li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-inset);
  transition: var(--ease);
}
.fact-row li:hover { border-color: var(--warning-border); transform: translateY(-3px); }
.fact-row span {
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.fact-row strong { font-size: 14px; }

/* code blocks */
.code-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0A0D14;
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #FFFFFF05;
}

/* ---------------------------- 13. AUTH / LOGIN --------------------------- */
/* When active, the login view becomes a flex box that stretches through the
   remaining viewport height (its parent .main-window is a column flex), so
   the auth card sits dead-centre below the sticky topbar on any screen. */
#login-view.active-view,
#create-account-view.active-view {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 48px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 34px 32px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-card));
  box-shadow: var(--shadow);
}

.auth-head { text-align: center; }

.auth-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, var(--accent-soft), var(--accent-deep));
  box-shadow: 0 8px 22px var(--accent-glow);
}
.auth-badge svg { width: 23px; height: 23px; }

.auth-title {
  margin-top: 14px;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.3px;
}

.auth-sub {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* form status banner (success / error) — text is injected by app.js */
.form-status {
  margin: 20px 0 0;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 550;
  text-align: center;
}
.form-status[hidden] { display: none; }
.form-status.is-success { border-color: #22C55E40; background: var(--green-soft); color: #6EE7A0; }
.form-status.is-error { border-color: #F43F5E40; background: var(--red-soft); color: #FDA4AF; }

.auth-form { margin-top: 22px; }

.form-field { margin-bottom: 16px; }

.form-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.form-link {
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  transition: var(--ease);
}
.form-link:hover { color: var(--accent-soft); }

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  color: var(--text-main);
  font: inherit;
  font-size: 14.5px;
  transition: var(--ease);
}
.form-input::placeholder { color: var(--text-dim); }
.form-input:hover { border-color: #2B3446; }

/* accent focus ring (replaces the global focus-visible outline for inputs) */
.form-input:focus,
.form-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* keep dark-theme rendering when the browser autofills the fields */
.form-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-inset) inset;
  -webkit-text-fill-color: var(--text-main);
  caret-color: var(--text-main);
}

/* invalid state — red ring + inline message rendered by app.js */
.form-input.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  color: var(--red);
  font-size: 12.5px;
  font-weight: 550;
}
.field-error[hidden] { display: none; }

/* password field with the eye toggle docked inside its right edge */
.input-wrap { position: relative; }
.input-wrap .form-input { padding-right: 48px; }

.eye-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--ease);
}
.eye-toggle:hover { color: var(--accent); background: #FFFFFF0A; }
.eye-toggle:active { transform: translateY(-50%) scale(0.92); }
.eye-toggle svg { width: 18px; height: 18px; }
.eye-toggle svg[hidden] { display: none; }

.form-actions { margin-top: 22px; }

.auth-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 12.5px;
}
.auth-foot .form-link { margin-left: 4px; }

/* ---------------------------- 14. RESPONSIVE ----------------------------- */
/* ≤1024px — the fixed sidebar becomes a slide-in drawer driven by app.js
   (.open class + scrim), and the multi-column grids stack into one column. */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 45;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: grid; }

  /* reveal the drawer backdrop while the sidebar is open */
  .sidebar.open + .sidebar-scrim { display: block; }

  .split-grid { grid-template-columns: 1fr; }
  .doc-grid { grid-template-columns: 1fr; }
  .deposit-grid { grid-template-columns: 1fr; }
}

/* ≤640px — compact spacing; the centred auth card simply narrows with the
   viewport and never overflows thanks to width: 100% + side padding. */
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar-title { font-size: 15.5px; }
  .chip-live { display: none; }
  .view.active-view { padding: 18px 14px 34px; }
  #login-view.active-view,
  #create-account-view.active-view { padding: 20px 14px 32px; }
  .auth-card { padding: 26px 20px 22px; }
  .panel { padding: 16px; }
  .label-row { flex-wrap: wrap; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------ 15. CREATE ACCOUNT / SIGNUP -------------------- */
/* The registration card reuses every auth style; it only adds icon-led
   inputs, a second eye toggle and the terms checkbox below. */
.auth-card-wide { max-width: 460px; }

/* text input with a leading icon; password rows add the trailing eye */
.input-icon-wrap { position: relative; }

.input-lead {
  position: absolute;
  top: 50%;
  left: 13px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  pointer-events: none;
  transition: var(--ease);
}
.input-lead svg { width: 17px; height: 17px; }

.input-icon-wrap .form-input { padding-left: 42px; }
.input-icon-wrap.has-eye .form-input { padding-right: 48px; }

.input-icon-wrap:hover .input-lead { color: var(--text-muted); }
.input-icon-wrap:focus-within .input-lead { color: var(--accent); }

/* terms & conditions checkbox */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.form-check {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
  transition: var(--ease);
}
.form-check.is-invalid {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-radius: 3px;
}

.checkbox-text {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}
.checkbox-text .form-link { font-size: inherit; }

.field-hint {
  margin-top: 7px;
  color: var(--text-dim);
  font-size: 12px;
}

/* --------------------- 16. NETWORK STATUS / LOADING ---------------------- */
/* offline chip variant — app.js toggles it from browser online/offline events */
.chip-offline {
  color: var(--red);
  border-color: #F43F5E33;
  background: var(--red-soft);
}

/* submit buttons while a real network request is in flight */
.btn[disabled],
.btn.is-loading {
  opacity: 0.7;
  cursor: progress;
  pointer-events: none;
  transform: none;
}

.btn.is-loading::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------ 17. DEPOSIT ------------------------------ */
.deposit-grid {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.payment-list { display: flex; flex-direction: column; gap: 8px; }

.payment-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-inset);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: var(--ease);
}
.payment-tab:hover {
  border-color: var(--warning-border);
  color: var(--text-main);
  transform: translateX(2px);
}
.payment-tab.active-tab {
  border-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-warning), var(--bg-card) 80%);
  color: var(--text-main);
}
.payment-tab.active-tab .platform-arrow { color: var(--accent); transform: translateX(2px); }
.payment-tab.active-tab .method-logo { box-shadow: 0 6px 16px var(--accent-glow); }

.method-logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 9px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.logo-khqr { background: linear-gradient(145deg, #1E3A8A, #2563EB); }
.logo-usdt { background: linear-gradient(145deg, #137347, #26A17B); }

.form-col .form-label { margin-top: 16px; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.amount-chip {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-inset);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--ease);
}
.amount-chip:hover {
  border-color: var(--warning-border);
  color: var(--text-main);
  transform: translateY(-1px);
}
.amount-chip.active-chip {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}

/* QR payment modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #05070Bd9;
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease-in-out;
}
.modal-backdrop[hidden] { display: none; }

.modal-card {
  width: 100%;
  max-width: 340px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  animation: viewIn 0.25s ease-in-out both;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.modal-title { font-size: 15px; font-weight: 650; letter-spacing: -0.2px; }
.modal-close { width: 30px; height: 30px; }

.qr-stage {
  display: grid;
  place-items: center;
  width: 240px;
  height: 240px;
  margin: 0 auto;
  padding: 10px;
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
}
.qr-stage img,
.qr-stage canvas { display: block; }
.qr-stage.qr-error {
  background: var(--bg-inset);
  color: var(--red);
  font-size: 13px;
  text-align: center;
}

.qr-amount { margin-top: 14px; text-align: center; color: var(--text-muted); font-size: 14px; }
.qr-amount strong { color: var(--text-main); font-size: 18px; }
.qr-ref { margin-top: 8px; text-align: center; color: var(--text-dim); font-size: 12px; }
.qr-ref code {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-inset);
  color: var(--accent-soft);
}
.qr-note {
  margin-top: 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.5;
}

body.modal-open { overflow: hidden; }

/* empty history table cell — reuses the shared .empty-state component */
.price-table td.empty-cell { padding: 0; border-bottom: 0; }
.empty-cell .empty-state { border: none; background: transparent; min-height: 140px; }
.empty-cell .empty-state:hover { background: transparent; border-color: transparent; }
