/* ============================================================
   VARIABLES — TUI-matched palette
   ============================================================ */

:root {
  --bg: #1c1c1e;
  --bg-card: #232326;
  --bg-hover: #2a2a2e;
  --bg-input: #18181a;
  --border: #3a3a3c;
  --border-subtle: #2c2c2e;
  --text: #d1d1d6;
  --text-muted: #8e8e93;
  --text-dim: #5a5a5e;
  --white: #f2f2f7;
  --primary: #8b8aff;
  --primary-hover: #a0a0ff;
  --primary-dim: rgba(139, 138, 255, 0.12);
  --primary-glow: rgba(139, 138, 255, 0.18);
  --green: #32d74b;
  --green-dim: rgba(50, 215, 75, 0.12);
  --yellow: #ffd60a;
  --red: #ff453a;
  --btc-orange: #f7931a;
  --lightning-purple: #8b8aff;
  --monero-orange: #ff6600;
  --mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono',
    'Consolas', 'Liberation Mono', monospace;

  --block-confirmed: #4c3f94;
  --block-confirmed-top: #6050ae;
  --block-confirmed-side: #382d74;
  --block-pending: #946f3f;
  --block-pending-top: #ae8450;
  --block-pending-side: #74552d;

  --icon-gh: #d1d1d6;
  --icon-x: #d1d1d6;
}

[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-card: #ffffff;
  --bg-hover: #ebebed;
  --bg-input: #f0f0f2;
  --border: #d2d2d7;
  --border-subtle: #e5e5ea;
  --text: #3a3a3c;
  --text-muted: #6e6e73;
  --text-dim: #aeaeb2;
  --white: #1c1c1e;
  --primary: #6360ff;
  --primary-hover: #504dff;
  --primary-dim: rgba(99, 96, 255, 0.08);
  --primary-glow: rgba(99, 96, 255, 0.14);
  --green: #248a3d;
  --green-dim: rgba(36, 138, 61, 0.08);
  --icon-gh: #3a3a3c;
  --icon-x: #3a3a3c;
}


/* ============================================================
   RESET
   ============================================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.65;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ============================================================
   SHELL
   ============================================================ */

.shell {
  width: 100%;
  max-width: 1340px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 60px;
}

@media (max-width: 900px) { .shell { padding: 0 28px; } }
@media (max-width: 600px) { .shell { padding: 0 16px; } }

main { flex: 1; padding: 28px 0 40px; }

footer {
  padding: 20px 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.3px;
}

@media (min-width: 901px) {
  main:has(.page-columns) + footer {
    padding-right: 328px;
  }
}

/* ============================================================
   NAV
   ============================================================ */

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: none;
  position: relative;
}

nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 1px;
  background: var(--border);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-left a {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s;
}

.nav-left a:hover { transform: scale(1.12); }
.nav-logo:hover { transform: none; }
.nav-logo img { height: 38px; width: auto; }
.logo-light { display: none; }
[data-theme="light"] .logo-dark { display: none; }
[data-theme="light"] .logo-light { display: block; }
.nav-left svg { width: 26px; height: 26px; }
.icon-gh { fill: var(--icon-gh); }
.icon-x { fill: var(--icon-x); }
.icon-nostr { fill: var(--primary); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-right a,
.nav-right .theme-toggle {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 17px;
  font-family: var(--mono);
  line-height: 1.2;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  transition: color 0.15s;
}

.nav-right a:hover,
.nav-right .theme-toggle:hover { color: var(--white); }

.nav-right a.active {
  color: var(--primary);
  font-weight: 700;
}

.nav-right .theme-toggle {
  font-size: 19px;
  padding-top: 5px;
  padding-bottom: 5px;
}

/* ============================================================
   HAMBURGER — hidden on desktop, shown on mobile
   ============================================================ */

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  margin-top: 32px;
  margin-bottom: 10px;
  letter-spacing: -0.2px;
}

h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  margin-top: 20px;
  margin-bottom: 6px;
}

p { margin-bottom: 14px; color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
strong { color: var(--white); }
small { color: var(--text-muted); font-size: 12px; }
em { font-style: normal; }
hr { border: none; border-top: 1px solid var(--border-subtle); margin: 36px 0; }

/* ============================================================
   CODE
   ============================================================ */

code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--white);
}

pre {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  overflow-x: auto;
  margin-bottom: 0;
  transition: border-color 0.15s;
}

pre:hover { border-color: var(--primary); }
pre code { background: none; padding: 0; }

.pre-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.pre-wrapper pre { padding-right: 44px; }

.copy-icon {
  position: absolute;
  top: 50%; right: 10px;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-dim);
  cursor: pointer; padding: 6px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
  z-index: 5;
}

.copy-icon:hover { color: var(--primary); background: var(--bg-hover); }
.copy-icon.copied { color: var(--green); }
.copy-icon svg { width: 16px; height: 16px; fill: currentColor; }

/* ============================================================
   CREDENTIAL BOX
   ============================================================ */

.credential-box {
  position: relative;
  font-family: var(--mono); font-size: 13px;
  background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 14px 50px 14px 18px;
  color: var(--white); word-break: break-all;
  user-select: all; margin-bottom: 16px; cursor: pointer;
  transition: border-color 0.15s;
}

.credential-box:hover { border-color: var(--primary); }
.credential-box .copy-icon { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); }

/* ============================================================
   LISTS / TABLES
   ============================================================ */

ul, ol { padding-left: 24px; margin-bottom: 16px; }
li { margin-bottom: 4px; color: var(--text); }
table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
th { color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; font-size: 11px; }
.table-highlight td:last-child { color: var(--primary); font-weight: 600; }

/* ============================================================
   FORMS
   ============================================================ */

label { display: block; color: var(--text-muted); font-size: 12px; margin-bottom: 6px; margin-top: 16px; text-transform: uppercase; letter-spacing: 0.5px; }

input[type="text"], textarea {
  width: 100%; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 12px 16px; color: var(--white);
  font-size: 13px; font-family: var(--mono);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.account-form { max-width: 480px; }
.account-form input[type="text"] { margin-bottom: 12px; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 26px; border: none; border-radius: 6px;
  font-size: 13px; font-weight: 700; font-family: var(--mono);
  cursor: pointer; text-decoration: none; text-align: center;
  letter-spacing: 0.2px;
  transition: background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary); color: #000;
  box-shadow: 0 2px 12px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover); color: #000;
  box-shadow: 0 4px 20px rgba(139, 138, 255, 0.3);
}

.btn-secondary {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  color: var(--white); border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; gap: 12px; margin-top: 24px; }
.btn-row .btn { flex: 1; }

/* ============================================================
   HERO
   ============================================================ */

.section-header {
  text-align: center; font-size: 22px; font-weight: 700;
  color: var(--white); margin-top: 0; margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.section-subtitle {
  text-align: center; color: var(--text-muted);
  margin-bottom: 16px; font-size: 13px;
}

.hero-title {
  font-size: 26px; font-weight: 700; color: var(--white);
  text-align: center; margin: 0 0 12px; letter-spacing: -0.3px;
}

.hero-desc {
  margin: 0 0 20px; text-align: left;
  color: var(--text); font-size: 14px; line-height: 1.7;
}

.hero-desc em { font-style: italic; color: var(--primary); }

.hero-closer {
  color: var(--text-muted); font-size: 14px; font-style: italic;
  margin: 8px 0 20px; text-align: left;
}

/* ============================================================
   PAGE COLUMNS — hero/TUI/install left, support card right
   ============================================================ */

.page-columns {
  display: grid;
  grid-template-columns: 1fr 268px;
  column-gap: 48px;
  align-items: start;
}

.page-main,
.page-bottom {
  grid-column: 1;
  min-width: 0;
}

.page-sidebar {
  grid-column: 2;
  grid-row: 1 / -1;
  position: sticky;
  top: calc(50vh - 230px);
}

.page-sidebar .product-card {
  width: 100%;
  padding: 32px 22px;
}

.page-sidebar .product-card h3 { font-size: 15px; margin-bottom: 10px; }
.page-sidebar .card-price .amount { font-size: 26px; }
.page-sidebar .card-price { margin-bottom: 24px; }
.page-sidebar .product-specs { margin-bottom: 24px; }
.page-sidebar .product-specs li { font-size: 12px; padding: 5px 0; }
.page-sidebar .pay-btn { width: 42px; height: 42px; }
.page-sidebar .pay-btn svg { width: 18px; height: 18px; }
.page-sidebar .payment-methods { gap: 12px; }
.page-sidebar .payment-note { font-size: 10px; }

.card-perk {
  text-align: center;
  font-size: 12px;
  color: var(--primary);
  margin: 0 auto 20px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  line-height: 1.5;
  max-width: 200px;
}

.pay-label {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   FEATURE BLOCKCHAIN (isometric 3D)
   ============================================================ */

.feature-chain-wrapper {
  margin: 0 0 0 0;
}

.legend-confirmed { color: var(--block-confirmed); font-size: 10px; }
.legend-pending { color: var(--block-pending); font-size: 10px; }
.legend-center { text-align: center; }

.feature-chain {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 26px 10px 14px 28px;
  scroll-snap-type: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  align-items: flex-end;
  scrollbar-width: none;
}

.feature-chain:active { cursor: grabbing; }
.feature-chain::-webkit-scrollbar { height: 0; }

.chain-divider {
  flex: 0 0 3px;
  height: 148px;
  margin: 0 18px;
  background: repeating-linear-gradient(
    to bottom,
    var(--text-dim) 0px, var(--text-dim) 10px,
    transparent 10px, transparent 16px
  );
  width: 3px;
}

.feature-block {
  --size: 120px;
  --d: 18px;
  flex: 0 0 var(--size);
  width: var(--size);
  height: var(--size);
  border-radius: 0;
  position: relative;
  margin-top: var(--d);
  margin-left: var(--d);
  padding: 16px 8px;
  overflow: visible;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, filter 0.25s;
}

.feature-block.block-confirmed {
  --front: var(--block-confirmed);
  --ftop: var(--block-confirmed-top);
  --fside: var(--block-confirmed-side);
}

.feature-block.block-pending {
  --front: var(--block-pending);
  --ftop: var(--block-pending-top);
  --fside: var(--block-pending-side);
}

.feature-block {
  background: var(--front);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.feature-block > * { position: relative; z-index: 3; }

.feature-block::before {
  content: '';
  position: absolute;
  left: 0; top: calc(-1 * var(--d));
  width: 100%; height: var(--d);
  background: var(--ftop);
  transform: skewX(45deg);
  transform-origin: bottom right;
  z-index: 2; pointer-events: none;
}

.feature-block::after {
  content: '';
  position: absolute;
  left: calc(-1 * var(--d)); top: 0;
  width: var(--d); height: 100%;
  background: var(--fside);
  transform: skewY(45deg);
  transform-origin: bottom right;
  z-index: 1; pointer-events: none;
}

.feature-block:hover {
  transform: translateY(-2px) scale(1.045);
  box-shadow:
    0 0 30px var(--primary-dim),
    0 0 60px rgba(139, 138, 255, 0.06);
  filter: brightness(1.08);
  z-index: 10;
}

.feature-block h3 { margin: 0 0 10px 0; font-size: 11px; color: #f2f2f7; white-space: nowrap; }
.feature-block h3 .bi { width: 14px; height: 14px; vertical-align: -2px; display: inline-block; }
.feature-block.block-tight h3 { margin-left: -3px; }
.feature-block p { color: rgba(255,255,255,0.6); font-size: 11px; margin: 0; line-height: 1.3; }

/* ============================================================
   PRODUCT CARDS
   ============================================================ */

.product-cards {
  display: flex;
  gap: 48px;
  justify-content: center;
  margin: 36px 0;
}

.product-cards-single {
  display: flex;
  justify-content: center;
  margin: 36px 0;
}

@media (max-width: 700px) {
  .product-cards { flex-direction: column; align-items: center; gap: 32px; }
}

.product-card {
  width: 520px;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 32px 36px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 16px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  border-color: var(--primary);
}

.product-card h3 { margin-top: 0; text-align: center; font-size: 17px; margin-bottom: 6px; }

.product-card .card-price { text-align: center; margin-bottom: 24px; }
.product-card .card-price .amount { font-size: 32px; font-weight: 700; color: var(--white); }
.product-card .card-price .period { color: var(--text-muted); font-size: 14px; }

.product-specs {
  list-style: none; padding: 0; margin: 0 auto 24px; flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  width: fit-content;
}

.product-specs li {
  display: flex;
  align-items: flex-start;
  padding: 4px 0;
  color: var(--text);
  font-size: 13px;
}

.product-specs li::before { content: "\2713"; color: var(--green); font-weight: 700; margin-right: 8px; flex-shrink: 0; }

/* Node card narrower when alongside support */
.product-cards:not(.product-cards-single) .product-card {
  width: 320px;
}

.product-cards:not(.product-cards-single) .product-specs {
  grid-template-columns: 1fr;
}

/* ============================================================
   PLAN OPTIONS
   ============================================================ */

.plan-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.plan-option-bullet {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
}

.plan-option-bullet input[type='radio'] {
  position: absolute; opacity: 0; pointer-events: none;
}

.plan-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border); background: transparent;
  flex-shrink: 0;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.plan-option-line { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.plan-option-main { color: var(--text); font-size: 13px; font-weight: 600; }
.plan-option-save { color: var(--green); font-size: 12px; }
.plan-option-bullet:hover .plan-dot { border-color: var(--primary); }

.plan-option-bullet input[type='radio']:checked + .plan-dot {
  border-color: var(--primary); background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.plan-option-bullet input[type='radio']:checked + .plan-dot + .plan-option-line .plan-option-main {
  color: var(--white);
}

/* ============================================================
   PAYMENT BUTTONS
   ============================================================ */

.payment-methods { display: flex; justify-content: center; gap: 16px; margin-bottom: 8px; }

.pay-btn {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.pay-btn:hover { transform: scale(1.12); }
.pay-btn svg { width: 22px; height: 22px; }

.pay-btn.pay-bitcoin { color: var(--btc-orange); }
.pay-btn.pay-bitcoin:hover { border-color: var(--btc-orange); box-shadow: 0 0 16px rgba(247,147,26,0.25); }
.pay-btn.pay-bitcoin svg { fill: var(--btc-orange); }

.pay-btn.pay-lightning { color: var(--lightning-purple); }
.pay-btn.pay-lightning:hover { border-color: var(--lightning-purple); box-shadow: 0 0 16px rgba(139,138,255,0.25); }
.pay-btn.pay-lightning svg { fill: var(--lightning-purple); }

.pay-btn.pay-monero { color: var(--monero-orange); }
.pay-btn.pay-monero:hover { border-color: var(--monero-orange); box-shadow: 0 0 16px rgba(255,102,0,0.25); }
.pay-btn.pay-monero svg { fill: var(--monero-orange); }

.payment-note { text-align: center; color: var(--text-dim); font-size: 11px; margin-top: 10px; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 8px rgba(139,138,255,0.4); } 50% { box-shadow: 0 0 20px rgba(139,138,255,0.8); } }
.pay-btn.spinning { opacity: 0.9; pointer-events: none; animation: pulse-glow 1s ease-in-out infinite; border-color: var(--accent) !important; }
.pay-btn.spinning svg { animation: spin 1s linear infinite; }

/* ============================================================
   HOW IT WORKS — STEPS
   ============================================================ */

.steps {
  display: flex;
  gap: 0;
  margin: 24px 0;
}

@media (max-width: 600px) {
  .steps { flex-direction: column; align-items: center; }
}

.step {
  flex: 1;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 28px 24px;
  text-align: left;
  background: var(--bg-card);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.step:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  border-color: var(--primary);
}

.step h3 { margin-top: 0; font-size: 15px; margin-bottom: 10px; text-align: center; }
.step p { color: var(--text-muted); font-size: 13px; margin-bottom: 0; line-height: 1.6; }

.step-num {
  color: var(--primary);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  margin-right: 6px;
}

.step-arrow {
  flex: 0 0 60px;
  color: var(--primary);
  font-size: 22px;
  display: grid;
  place-items: center;
}

@media (max-width: 600px) {
  .step-arrow {
    transform: rotate(90deg);
    flex: 0 0 40px;
  }
}

/* ============================================================
   INSTALL BLOCK
   ============================================================ */

.install-block {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 12px auto;
}

.page-main .install-block { margin: 0 0 12px; width: 100%; }
.page-main .legend-center { text-align: center; }

.install-block pre {
  white-space: nowrap;
  overflow-x: auto;
  font-size: 15px;
  padding: 18px 22px;
  text-align: center;
}

.install-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin: 0 auto 14px auto;
}

/* ============================================================
   TUI / TERMINAL PREVIEW
   ============================================================ */

.tui-section {
  margin: 0;
}

.tui-shell-3d {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.tui-shell-3d .tui-preview {
  position: relative;
  border-radius: 0;
  border: none;
  overflow: hidden;
}

.tui-preview {
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: #1a1a1c;
}

[data-theme="light"] .tui-preview { background: #f5f5f7; }

.tui-titlebar {
  background: #1a1a1c;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid #3a3a3c;
}

[data-theme="light"] .tui-titlebar {
  background: #e8e8ea;
  border-color: #d2d2d7;
}

.tui-dot { width: 10px; height: 10px; border-radius: 50%; }
.tui-dot-red { background: #ff453a; }
.tui-dot-yellow { background: #ffd60a; }
.tui-dot-green { background: #32d74b; }

.tui-titlebar span {
  color: #5a5a5e;
  font-size: 12px;
  font-family: var(--mono);
  margin-left: 8px;
}

[data-theme="light"] .tui-titlebar span { color: #8e8e93; }

/* --- TUI body: sidebar + content --- */

.tui-body {
  display: flex;
  height: 540px;
}

.tui-sidebar {
  width: 130px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #3a3a3c;
}

[data-theme="light"] .tui-sidebar { border-right-color: #d2d2d7; }

.tui-sidebar-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: #8e8e93;
  background: transparent;
  border: none;
  border-bottom: 1px solid #3a3a3c;
  cursor: pointer;
  text-align: center;
  position: relative;
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
}

.tui-sidebar-item:last-child { border-bottom: none; }

[data-theme="light"] .tui-sidebar-item {
  color: #6e6e73;
  border-bottom-color: #d2d2d7;
}

.tui-sidebar-item:hover {
  color: #d1d1d6;
  background: rgba(255,255,255,0.03);
}

[data-theme="light"] .tui-sidebar-item:hover {
  color: #1c1c1e;
  background: rgba(0,0,0,0.03);
}

.tui-sidebar-item.active {
  color: #f2f2f7;
  background: rgba(139, 138, 255, 0.22);
}

[data-theme="light"] .tui-sidebar-item.active {
  color: #1c1c1e;
  background: rgba(99, 96, 255, 0.15);
}

.tui-marker {
  font-size: 12px;
  margin-right: 6px;
  color: #f2f2f7;
  line-height: 1;
}

[data-theme="light"] .tui-marker {
  color: #1c1c1e;
}

/* --- TUI content area --- */

.tui-content {
  flex: 1;
  min-width: 0;
  position: relative;
}

.tui-screen { display: none; }
.tui-screen.active { display: block; height: 100%; overflow: hidden; }

/* ============================================================
   CALLOUTS
   ============================================================ */

.callout {
  border-left: 3px solid;
  padding: 16px 18px;
  margin: 18px 0;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
}

.callout p { margin-bottom: 4px; }
.callout p:last-child { margin-bottom: 0; }

.callout-warning {
  border-color: var(--yellow);
  background: rgba(255, 214, 10, 0.04);
}

.callout-danger {
  border-color: var(--red);
  background: rgba(255, 69, 58, 0.04);
}

/* ============================================================
   STATUS / UTILITY
   ============================================================ */

.status-running { color: var(--green); }
.status-suspended { color: var(--red); }
.status-pending { color: var(--yellow); }
.expiry-warning { color: var(--yellow); }
.expiry-danger { color: var(--red); }

.lightning { color: var(--primary); }
.error-msg { color: var(--red); font-size: 13px; margin-bottom: 14px; }

/* ============================================================
   DASHBOARD CARDS
   ============================================================ */

.dash-card {
  background: var(--bg-card);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 12px;
}

.dash-card-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--white);
}

.dash-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.dash-table { margin-bottom: 0; }
.dash-table td { padding: 5px 0; border-bottom: none; font-size: 13px; }
.dash-table-label { color: var(--text-muted); width: 70px; }

.dash-split {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.dash-split-right { text-align: right; }

.dash-split-border {
  margin-top: 14px;
  padding-top: 14px;
}

.dash-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 4px;
}

.dash-value {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
}

.dash-expiry { margin-top: 14px; }

.dash-value-lg {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.dash-days {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

.back-link {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 22px;
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--mono);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: color 0.15s, border-color 0.15s;
}

.back-link:hover {
  color: var(--white);
  border-color: var(--primary);
  text-decoration: none;
}

/* ============================================================
   DOCS LAYOUT
   ============================================================ */

.docs-layout { display: flex; gap: 40px; }

.docs-sidebar {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-left: 0;
}

.docs-sidebar a {
  display: block;
  padding: 6px 12px 6px 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 1px;
  text-align: left;
  transition: color 0.15s;
}

.docs-sidebar a:hover { color: var(--white); text-decoration: none; }
.docs-sidebar::after { display: none; }

.docs-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.docs-toggle:hover {
  color: var(--white);
  border-color: var(--primary);
}

.docs-content { flex: 1; min-width: 0; }

@media (max-width: 768px) {
  .docs-layout { flex-direction: column; gap: 20px; }
  .docs-sidebar {
    width: 100%; position: static;
    flex-direction: column;
    padding-bottom: 0; margin-bottom: 12px;
  }

  .docs-toggle { display: inline-flex; margin-bottom: 0; }
  .docs-sidebar a { display: none; }
  .docs-sidebar.docs-open a {
    display: block;
    border-bottom: 1px solid var(--border-subtle);
  }
  .docs-sidebar.docs-open a:last-child { border-bottom: none; }
  .docs-sidebar.docs-open { border-bottom: 1px solid var(--border); padding-bottom: 12px; }
}

.credential {
  font-family: var(--mono); font-size: 13px;
  background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 14px 18px; color: var(--white);
  word-break: break-all; user-select: all; margin-bottom: 16px;
}

/* ============================================================
   TUI DATA — HTML recreations of the TUI screens
   ============================================================ */

.td {
  padding: 24px 22px 18px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: #d1d1d6;
  height: 100%;
  display: flex;
  flex-direction: column;
}

[data-theme="light"] .td { color: #3a3a3c; }

.td strong { color: #f2f2f7; font-weight: 700; }
[data-theme="light"] .td strong { color: #1c1c1e; }

.td-muted { color: #5a5a5e; }
[data-theme="light"] .td-muted { color: #aeaeb2; }

.td-green { color: #32d74b; }
[data-theme="light"] .td-green { color: #248a3d; }

.td-red { color: #ff453a; }

/* --- Title --- */

.td-title {
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: #f2f2f7;
  margin-bottom: 20px;
}

[data-theme="light"] .td-title { color: #1c1c1e; }

/* --- Stats + summary row (channels) --- */

.td-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 22px;
}

.td-stats { flex-shrink: 0; }

.td-stat {
  margin-bottom: 12px;
  color: #8e8e93;
}

.td-stat:last-child { margin-bottom: 0; }

.td-stat-gap { margin-bottom: 30px; }

[data-theme="light"] .td-stat { color: #6e6e73; }

.td-summary {
  border: 1px solid #3a3a3c;
  border-radius: 0;
  padding: 8px 16px;
  text-align: center;
  min-width: 300px;
  flex-shrink: 0;
}

[data-theme="light"] .td-summary { border-color: #d2d2d7; }

.td-summary-head {
  font-weight: 700;
  color: #f2f2f7;
  margin-bottom: 6px;
}

[data-theme="light"] .td-summary-head { color: #1c1c1e; }

.td-summary-pct { color: #8e8e93; font-size: 11px; margin-top: 4px; }
[data-theme="light"] .td-summary-pct { color: #6e6e73; }

.td-summary-total { color: #8e8e93; font-size: 11px; }
[data-theme="light"] .td-summary-total { color: #6e6e73; }

/* --- Capacity bars --- */

.td-bar {
  display: flex;
  height: 14px;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
}

.td-bar-local {
  background: #00af00;
  display: block;
  height: 100%;
}

.td-bar-remote {
  background: #5f5fff;
  display: block;
  height: 100%;
}

[data-theme="light"] .td-bar-local { background: #00af00; }
[data-theme="light"] .td-bar-remote { background: #5f5fff; }

/* Bar width classes (CSP blocks inline styles) */
.td-w31 { width: 31%; } .td-w36 { width: 36%; }
.td-w40 { width: 40%; } .td-w43 { width: 43%; }
.td-w49 { width: 49%; } .td-w51 { width: 51%; }
.td-w57 { width: 57%; } .td-w60 { width: 60%; }
.td-w64 { width: 64%; } .td-w69 { width: 69%; }

/* --- Buttons (solid background, TUI style) --- */

.td-btns {
  display: flex;
  gap: 8px;
  margin: 0 4px 32px;
}

.td-btn {
  flex: 1;
  padding: 2px 4px;
  font-size: 12px;
  font-weight: 700;
  background: #3a3a3c;
  color: #f2f2f7;
  text-align: center;
}

[data-theme="light"] .td-btn {
  background: #d2d2d7;
  color: #1c1c1e;
}

/* --- Channel list (inline bars) --- */

.td-ch-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  padding: 0 2px;
}

.td-ch-name {
  width: 140px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f2f2f7;
}

[data-theme="light"] .td-ch-name { color: #1c1c1e; }

.td-bar-ch {
  flex: 1;
  height: 14px;
  min-width: 40px;
}

.td-ch-vals {
  flex-shrink: 0;
  color: #8e8e93;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

[data-theme="light"] .td-ch-vals { color: #6e6e73; }

.td-ch-sep {
  height: 1px;
  background: #3a3a3c;
  margin: 6px 0 10px;
}

[data-theme="light"] .td-ch-sep { background: #d2d2d7; }

/* --- Table rows (shared) --- */

.td-tbl-head {
  display: flex;
  gap: 0;
  font-size: 11px;
  font-weight: 700;
  color: #5a5a5e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 2px;
}

[data-theme="light"] .td-tbl-head { color: #aeaeb2; }

.td-tbl-row {
  display: flex;
  gap: 0;
  padding: 5px 2px;
  color: #d1d1d6;
}

[data-theme="light"] .td-tbl-row { color: #3a3a3c; }

/* Wallet table (Date | Memo | Value | Balance) */
.td-wl-date  { width: 18%; flex-shrink: 0; }
.td-wl-memo  { width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-wl-val   { width: 21%; text-align: right; flex-shrink: 0; }
.td-wl-bal   { width: 21%; text-align: right; flex-shrink: 0; color: #8e8e93; }
[data-theme="light"] .td-wl-bal { color: #6e6e73; }

/* On-chain UTXO table (Date | Label | Address | Value) */
.td-oc-date  { width: 16%; flex-shrink: 0; }
.td-oc-label { width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-oc-addr  { width: 30%; text-align: right; flex-shrink: 0; color: #8e8e93; }
.td-oc-val   { width: 24%; text-align: right; flex-shrink: 0; }
[data-theme="light"] .td-oc-addr { color: #6e6e73; }

/* On-chain TX table (Date | Label | Value | Balance) */
.td-tx-date  { width: 16%; flex-shrink: 0; }
.td-tx-label { width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-tx-val   { width: 23%; text-align: right; flex-shrink: 0; }
.td-tx-bal   { width: 23%; text-align: right; flex-shrink: 0; color: #8e8e93; }
[data-theme="light"] .td-tx-bal { color: #6e6e73; }

.td-section {
  font-weight: 700;
  color: #f2f2f7;
  margin-top: 22px;
  margin-bottom: 6px;
  font-size: 12px;
  text-align: center;
}

.td-section-first { margin-top: 6px; }

[data-theme="light"] .td-section { color: #1c1c1e; }

/* --- Add-on screen --- */

.td-addon-layout {
  display: flex;
  flex-direction: column;
  min-height: 510px;
  padding: 0 22px;
}

.td-addon-half {
  flex: 1;
  display: flex;
  align-items: center;
}

.td-addon-inner {
  padding: 0;
}

.td-addon-name {
  font-size: 13px;
  color: #f2f2f7;
  margin-bottom: 8px;
}

[data-theme="light"] .td-addon-name { color: #1c1c1e; }

.td-addon-desc {
  color: #8e8e93;
  margin-bottom: 10px;
}

[data-theme="light"] .td-addon-desc { color: #6e6e73; }

.td-addon-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.td-addon-detail {
  color: #5a5a5e;
  font-size: 12px;
}

[data-theme="light"] .td-addon-detail { color: #aeaeb2; }

.td-addon-sep {
  border-top: 1px dashed #3a3a3c;
  flex-shrink: 0;
}

[data-theme="light"] .td-addon-sep { border-color: #d2d2d7; }

/* --- Status dots --- */

.td-dot-green {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #32d74b;
  flex-shrink: 0;
}

[data-theme="light"] .td-dot-green { background: #248a3d; }

/* --- Boxes (system screen) --- */

.td-box {
  border: 1px solid #3a3a3c;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

[data-theme="light"] .td-box { border-color: #d2d2d7; }

.td-box-title {
  font-weight: 700;
  color: #f2f2f7;
  margin-bottom: 4px;
}

[data-theme="light"] .td-box-title { color: #1c1c1e; }

.td-box-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #d1d1d6;
  line-height: 1.7;
}

[data-theme="light"] .td-box-line { color: #3a3a3c; }

.td-btc { color: #f7931a; }
[data-theme="light"] .td-btc { color: #f7931a; }

/* --- Responsive --- */

@media (max-width: 600px) {
  .td { padding: 12px 14px 30px; font-size: 11px; height: auto; min-height: 100%; }
  .td-addon-layout { padding: 0 14px; }
  .td-hero { flex-direction: column; gap: 10px; }
  .td-summary { min-width: 0; }
  .td-ch-vals { font-size: 10px; }
  .td-btns { gap: 4px; margin-left: 0; margin-right: 0; }
  .td-btn { padding: 2px 8px; font-size: 11px; white-space: nowrap; }

  /* TUI data tables — show all columns, tighter layout */
  .td-tbl-head,
  .td-tbl-row { font-size: 10px; }

  /* Wallet: DATE | MEMO | VALUE | BALANCE */
  .td-wl-date  { width: 22%; white-space: nowrap; }
  .td-wl-memo  { width: 30%; }
  .td-wl-val   { width: 24%; }
  .td-wl-bal   { width: 24%; }

  /* On-chain UTXOs: DATE | LABEL | ADDRESS | VALUE */
  .td-oc-date  { width: 20%; white-space: nowrap; }
  .td-oc-label { width: 28%; }
  .td-oc-addr  { width: 28%; font-size: 9px; }
  .td-oc-val   { width: 24%; }

  /* On-chain TXs: DATE | LABEL | VALUE | BALANCE */
  .td-tx-date  { width: 20%; white-space: nowrap; }
  .td-tx-label { width: 30%; }
  .td-tx-val   { width: 25%; }
  .td-tx-bal   { width: 25%; }
}

/* ============================================================
   MOBILE — hamburger nav, page columns, TUI, typography
   ============================================================ */

/* --- Hamburger nav: show burger, convert nav-right to dropdown --- */

@media (max-width: 768px) {
  nav { flex-wrap: wrap; }

  .nav-hamburger { display: flex; }

  .nav-right {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    border-top: 1px solid var(--border-subtle);
    padding-top: 8px;
    margin-top: 12px;
  }

  .nav-right.nav-open { display: flex; }

  .nav-right a,
  .nav-right .theme-toggle {
    padding: 12px 0;
    font-size: 15px;
    justify-content: flex-start;
    border-radius: 0;
  }

  .nav-right a:not(:last-of-type) {
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav-right .theme-toggle {
    padding-top: 12px;
    font-size: 18px;
  }
}

@media (max-width: 600px) {
  nav { padding: 12px 0; }
  .nav-left { gap: 14px; }
  .nav-logo img { height: 30px; }
  .nav-left svg { width: 20px; height: 20px; }
}

/* --- Page columns: single column on mobile --- */

@media (max-width: 900px) {
  .page-columns {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }

  .page-main,
  .page-bottom {
    grid-column: 1;
  }

  .page-sidebar {
    grid-column: 1;
    grid-row: auto;
    position: static;
    height: auto;
  }

  .page-sidebar .product-card {
    max-width: 520px;
    margin: 0 auto;
    padding: 32px 36px;
  }

  .page-sidebar .card-price .amount { font-size: 32px; }
  .page-sidebar .product-card h3 { font-size: 17px; }
  .page-sidebar .product-specs li { font-size: 13px; padding: 4px 0; }
  .page-sidebar .pay-btn { width: 48px; height: 48px; }
  .page-sidebar .pay-btn svg { width: 22px; height: 22px; }
  .page-sidebar .payment-methods { gap: 16px; }
  .page-sidebar .payment-note { font-size: 11px; }
}

@media (max-width: 600px) {
  .page-sidebar .product-card {
    padding: 24px 20px;
  }
}

/* --- Hero typography --- */

@media (max-width: 600px) {
  .hero-title { font-size: 22px; }
  .hero-desc { font-size: 13px; }
  .hero-closer { font-size: 13px; }

  .section-header { font-size: 18px; }
  .section-subtitle { font-size: 12px; }

  h1 { font-size: 20px; }
  h2 { font-size: 16px; }
}

/* --- TUI preview --- */

@media (max-width: 900px) {
  .tui-body { height: 480px; }
  .tui-screen.active { overflow-y: auto; }
}

@media (max-width: 600px) {
  .tui-body { height: 420px; }
  .tui-sidebar { width: 90px; }
  .tui-sidebar-item { font-size: 11px; padding: 0 8px; }
  .tui-titlebar span { font-size: 10px; }
  .td-ch-name { width: 100px; }
}

@media (max-width: 380px) {
  .tui-body { height: 380px; }
  .tui-sidebar { width: 74px; }
  .tui-sidebar-item { font-size: 10px; padding: 0 6px; }
  .tui-marker { font-size: 9px; margin-right: 3px; }
  .td-ch-name { width: 70px; font-size: 10px; }
  .td-ch-vals { display: none; }
}

/* --- Install block --- */

@media (max-width: 600px) {
  .install-block pre {
    font-size: 12px;
    padding: 14px 16px;
    text-align: left;
  }
}

/* --- Steps --- */

@media (max-width: 600px) {
  .step { padding: 20px 18px; }
  .step h3 { font-size: 14px; }
  .step p { font-size: 12px; }
}

/* --- Product card --- */

@media (max-width: 500px) {
  .product-card { padding: 24px 20px; }
  .product-card h3 { font-size: 15px; }
  .product-card .card-price .amount { font-size: 28px; }
}

/* --- Feature chain --- */

@media (max-width: 600px) {
  .feature-block {
    --size: 105px;
    --d: 14px;
    padding: 12px 6px;
  }
  .feature-block h3 { font-size: 10px; }
  .feature-block p { font-size: 10px; }
  .feature-chain { padding: 20px 8px 12px 20px; gap: 10px; }
  .chain-divider { height: 120px; margin: 0 10px; }
}

/* --- Dashboard cards --- */

@media (max-width: 600px) {
  .dash-card { padding: 16px; }
  .dash-value-lg { font-size: 16px; }
  .btn-row { flex-direction: column; gap: 8px; }
  .btn-row .btn { flex: none; }
}