/* CIRCUIT BREAKERS - High-Fidelity Retro Cyber-Finance Design System */
:root {
  --bg-dark: #0B0E14;
  --bg-panel: #16120E;
  --bg-panel-light: #221B15;
  --paper-cream: #ECE4D4;
  
  --ink-main: #ECE4D4;
  --ink-soft: #A39B8B;
  --ink-dark: #120F0C;
  
  --phosphor-green: #00FF66;
  --phosphor-dim: #055C27;
  --cyan-electric: #00E5FF;
  --amber-caution: #FFC400;
  --crimson-alert: #FF1744;
  --copper-gold: #C5A059;
  
  --font-mono: 'Share Tech Mono', monospace;
  --font-pixel: 'Silkscreen', cursive, monospace;
  --font-sans: 'Space Grotesk', sans-serif;
  
  --shadow-pixel: 4px 5px 0px #000000;
  --shadow-glow: 0px 0px 20px rgba(0, 255, 102, 0.25);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--ink-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* CRT SCANLINE OVERLAY */
.crt-overlay::after {
  content: " ";
  display: block;
  position: fixed;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  z-index: 99;
  background-size: 100% 3px, 6px 100%;
  pointer-events: none;
  opacity: 0.7;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* TICKER MARQUEE */
.ticker-bar {
  background: #050709;
  border-bottom: 2px solid #221B15;
  color: var(--phosphor-green);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  overflow: hidden;
  padding: 8px 0;
  white-space: nowrap;
}

.ticker-content {
  display: inline-block;
  animation: marquee 35s linear infinite;
}

.ticker-content span {
  margin-right: 30px;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* TOPBAR */
.topbar {
  background: var(--bg-panel);
  border-bottom: 3px solid #000;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  flex-wrap: wrap;
  gap: 15px;
}

.brand {
  font-family: var(--font-pixel);
  font-size: 18px;
  color: var(--paper-cream);
  text-decoration: none;
  letter-spacing: 2px;
}

.brand span {
  color: var(--amber-caution);
}

.header-badges {
  display: flex;
  gap: 10px;
}

.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border: 1px solid currentColor;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.badge-live {
  color: var(--phosphor-green);
  border-color: var(--phosphor-green);
}

.badge-live .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--phosphor-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--phosphor-green);
  animation: blink 1.8s infinite;
  margin-right: 4px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.badge-chain {
  color: var(--cyan-electric);
  border-color: var(--cyan-electric);
}

.badge-success {
  color: var(--phosphor-green);
  border-color: var(--phosphor-green);
}

/* BUTTONS */
.btn {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 10px 16px;
  border: 2px solid #000;
  box-shadow: var(--shadow-pixel);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.1s, box-shadow 0.1s, background-color 0.15s;
}

.btn:hover:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 2px 3px 0px #000;
}

.btn:active:not(:disabled) {
  transform: translate(4px, 5px);
  box-shadow: 0px 0px 0px #000;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(1);
}

.btn-primary {
  background: var(--amber-caution);
  color: var(--ink-dark);
}

.btn-accent {
  background: var(--cyan-electric);
  color: var(--ink-dark);
}

.btn-ghost {
  background: var(--bg-panel-light);
  color: var(--paper-cream);
  border-color: var(--ink-soft);
}

.btn-audio {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--bg-panel-light);
  font-size: 11px;
  padding: 6px 12px;
}

.btn-check {
  background: var(--bg-panel-light);
  color: var(--phosphor-green);
  border-color: var(--phosphor-dim);
}

.btn-check.done {
  background: var(--phosphor-dim);
  color: var(--paper-cream);
  border-color: var(--phosphor-green);
}

/* MAIN CONTENT */
.main-content {
  padding-top: 30px;
  padding-bottom: 60px;
}

/* HERO GRID */
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 30px;
  align-items: center;
  margin-bottom: 40px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--amber-caution);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.hero-title {
  font-family: var(--font-pixel);
  font-size: clamp(24px, 3.5vw, 42px);
  line-height: 1.25;
  color: var(--paper-cream);
  margin-bottom: 16px;
  text-shadow: 0 0 10px rgba(236, 228, 212, 0.2);
}

.hero-lede {
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 54ch;
  margin-bottom: 20px;
}

.hero-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--ink-soft);
  color: var(--paper-cream);
  padding: 4px 8px;
  text-transform: uppercase;
}

/* DEVICE CARD */
.device-card {
  background: var(--bg-panel);
  border: 3px solid #000;
  box-shadow: var(--shadow-pixel), var(--shadow-glow);
  padding: 15px;
  position: relative;
  text-align: center;
}

.device-badge {
  position: absolute;
  top: -12px;
  left: 15px;
  background: var(--amber-caution);
  color: var(--ink-dark);
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 3px 8px;
  border: 2px solid #000;
}

.device-art {
  width: 100%;
  max-width: 360px;
  height: auto;
  border: 2px solid #000;
  display: block;
  margin: 10px auto;
  image-rendering: pixelated;
}

.device-foot {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  border-top: 2px solid var(--bg-panel-light);
  padding-top: 10px;
  margin-top: 10px;
}

.meter-label { color: var(--ink-soft); }
.meter-val { color: var(--phosphor-green); font-weight: 700; }

/* TERMINAL PANEL (REGISTRATION) */
.terminal-panel {
  background: var(--bg-panel);
  border: 3px solid #000;
  box-shadow: var(--shadow-pixel);
  padding: 30px;
  margin-bottom: 40px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--bg-panel-light);
  padding-bottom: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-header h2 {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--paper-cream);
  letter-spacing: 1px;
}

.step-indicator {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--amber-caution);
  color: var(--ink-dark);
  font-weight: 700;
  padding: 4px 8px;
}

/* FORM SECTIONS */
.form-section {
  background: rgba(9, 11, 14, 0.4);
  border: 1px solid var(--bg-panel-light);
  padding: 20px;
}

.section-title {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  color: var(--cyan-electric);
  margin-bottom: 4px;
}

.section-desc {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin-bottom: 18px;
}

.submit-action-wrap {
  margin-top: 25px;
  text-align: center;
}

.btn-large {
  font-size: 15px;
  padding: 16px 28px;
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 25px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--paper-cream);
  letter-spacing: 1px;
}

.input-prefix-wrap, .input-btn-wrap {
  display: flex;
  align-items: center;
}

.prefix {
  background: var(--bg-panel-light);
  border: 2px solid #000;
  border-right: none;
  color: var(--amber-caution);
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 12px 14px;
}

input[type="text"], input[type="url"] {
  width: 100%;
  background: #090B0E;
  border: 2px solid #000;
  color: var(--phosphor-green);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 12px 14px;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

input[type="text"]:focus, input[type="url"]:focus {
  border-color: var(--cyan-electric);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.input-btn-wrap input {
  border-right: none;
}

.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 25px;
  gap: 15px;
}

/* SOCIAL TASKS */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.task-card {
  background: var(--bg-panel-light);
  border: 2px solid #000;
  padding: 18px;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 16px;
  align-items: start;
  transition: border-color 0.2s;
}

.task-card.completed {
  border-color: var(--phosphor-green);
  background: rgba(0, 255, 102, 0.05);
}

.task-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-panel);
  border: 2px solid #000;
  color: var(--amber-caution);
  font-family: var(--font-pixel);
  display: grid;
  place-items: center;
  font-size: 14px;
  margin-top: 2px;
}

.task-body {
  display: flex;
  flex-direction: column;
}

.task-body h4 {
  font-size: 15px;
  color: var(--paper-cream);
  margin-bottom: 4px;
  line-height: 1.3;
}

.task-body p {
  font-size: 13px;
  color: var(--ink-soft);
}

.task-action {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: center;
}

.task-action .btn {
  height: 42px;
  padding: 0 16px;
  white-space: nowrap;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* TASK 3 ROW ALIGNMENT */
.reply-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  width: 100%;
  flex-wrap: wrap;
}

.reply-action-row input[type="url"] {
  flex: 1 1 260px;
  min-width: 200px;
  height: 42px;
}

.reply-action-row .task-action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin: 0;
}

/* PROGRESS BAR */
.progress-box {
  background: var(--bg-panel-light);
  border: 2px solid #000;
  padding: 15px;
  margin-bottom: 20px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.progress-bar-track {
  height: 12px;
  background: #090B0E;
  border: 1px solid #000;
  position: relative;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--phosphor-green);
  box-shadow: 0 0 10px var(--phosphor-green);
  transition: width 0.3s ease;
}

/* SUCCESS MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.88);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-content {
  background: var(--bg-panel);
  border: 3px solid #000;
  box-shadow: var(--shadow-pixel), var(--shadow-glow);
  max-width: 580px;
  width: 100%;
  padding: 25px;
  position: relative;
}

.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.close-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 24px;
  cursor: pointer;
}

.receipt-title {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--amber-caution);
  margin-bottom: 6px;
}

.receipt-note {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.ticket-details {
  background: #090B0E;
  border: 2px solid #000;
  padding: 15px;
  font-family: var(--font-mono);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.ticket-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--bg-panel-light);
  padding-bottom: 6px;
}

.t-key { color: var(--ink-soft); }
.t-val { color: var(--paper-cream); font-weight: 700; word-break: break-all; }
.t-link { color: var(--cyan-electric); }

/* SUBSTATIONS SECTION */
.substations-sec {
  margin-top: 40px;
}

.sec-head {
  margin-bottom: 25px;
}

.sec-head h2 {
  font-family: var(--font-pixel);
  font-size: 18px;
  color: var(--paper-cream);
  margin-bottom: 6px;
}

.sec-head p {
  color: var(--ink-soft);
}

.substation-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.sub-card-featured {
  background: var(--bg-panel);
  border: 3px solid #000;
  box-shadow: var(--shadow-pixel);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.sub-card-equities {
  border-top: 4px solid var(--cyan-electric);
}

.sub-card-treasury {
  border-top: 4px solid var(--amber-caution);
}

.sub-card-featured:hover {
  transform: translateY(-2px);
  box-shadow: 6px 8px 0px #000;
}

.sub-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  height: 32px;
}

.sub-icon-emoji {
  font-size: 22px;
  line-height: 1;
  height: 24px;
  display: flex;
  align-items: center;
}

.sub-icon-img {
  height: 24px;
  display: flex;
  align-items: center;
}

.rh-logo-icon {
  height: 22px;
  width: auto;
  max-width: 28px;
  object-fit: contain;
  display: block;
}

.sub-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border: 1px solid currentColor;
  letter-spacing: 1px;
}

.sub-badge-cyan { color: var(--cyan-electric); border-color: var(--cyan-electric); }
.sub-badge-amber { color: var(--amber-caution); border-color: var(--amber-caution); }

.sub-card-featured h3 {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--paper-cream);
  margin-bottom: 8px;
}

.sub-desc {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.asset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: #090B0E;
  border: 1px solid var(--cyan-electric);
  color: var(--cyan-electric);
  padding: 4px 10px;
  border-radius: 2px;
}

.pill-gold {
  border-color: var(--amber-caution);
  color: var(--amber-caution);
}

.sub-foot {
  margin-top: auto;
  border-top: 2px solid var(--bg-panel-light);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
}

.sub-label { color: var(--ink-soft); }
.val-cyan { color: var(--cyan-electric); font-weight: 700; }
.val-amber { color: var(--amber-caution); font-weight: 700; }

/* TL;DR YIELD EXPLAINER */
.tldr-yield-sec {
  margin-top: 30px;
  margin-bottom: 30px;
}

.tldr-yield-card {
  background: var(--bg-panel);
  border: 2px solid #000;
  border-left: 5px solid var(--phosphor-green);
  box-shadow: var(--shadow-pixel);
  padding: 24px;
}

.tldr-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tldr-head h3 {
  font-family: var(--font-pixel);
  font-size: 15px;
  color: var(--paper-cream);
  letter-spacing: 1px;
}

.tldr-answer {
  font-size: 15px;
  color: var(--paper-cream);
  margin-bottom: 20px;
  line-height: 1.5;
}

.tldr-answer strong {
  color: var(--phosphor-green);
}

.tldr-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.tldr-step {
  background: #090B0E;
  border: 1px solid var(--bg-panel-light);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.t-step-num {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--amber-caution);
  margin-bottom: 8px;
}

.tldr-step h4 {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--paper-cream);
  margin-bottom: 6px;
}

.tldr-step p {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

.tldr-link {
  color: var(--cyan-electric);
  text-decoration: underline;
}

/* TOPBAR NAV LINKS */
.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 0.2s;
  padding: 4px 8px;
  border-bottom: 2px solid transparent;
}

.nav-link:hover, .nav-link.active {
  color: var(--cyan-electric);
  border-bottom: 2px solid var(--cyan-electric);
}

/* DAPP HERO HEADERS */
.dapp-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 30px;
  margin-bottom: 35px;
  padding-bottom: 25px;
  border-bottom: 2px solid var(--bg-panel-light);
  flex-wrap: wrap;
  gap: 20px;
}

.dapp-hero-left {
  flex: 1 1 500px;
}

.dapp-hero-stats {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.dapp-stat-box {
  background: var(--bg-panel);
  border: 2px solid #000;
  box-shadow: var(--shadow-pixel);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.d-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 1px;
}

.d-stat-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
}

/* DEDICATED DOCS 2-COLUMN LAYOUT */
.docs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  align-items: start;
  margin-bottom: 50px;
}

.docs-sidebar {
  position: sticky;
  top: 90px;
}

.sidebar-card {
  background: var(--bg-panel);
  border: 2px solid #000;
  box-shadow: var(--shadow-pixel);
  padding: 20px;
}

.sidebar-title {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--amber-caution);
  border-bottom: 2px solid var(--bg-panel-light);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

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

.side-link {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--paper-cream);
  text-decoration: none;
  padding: 8px 10px;
  border-left: 2px solid transparent;
  transition: all 0.2s;
  background: rgba(9, 11, 14, 0.4);
}

.side-link:hover {
  color: var(--cyan-electric);
  border-left-color: var(--cyan-electric);
  background: rgba(0, 229, 255, 0.08);
  padding-left: 14px;
}

.docs-content-pane {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* DOCUMENTATION SECTION */
.docs-sec {
  margin-top: 60px;
  margin-bottom: 40px;
  scroll-margin-top: 80px;
}

.docs-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-panel);
  border: 2px solid #000;
  padding: 12px 16px;
  margin-bottom: 25px;
  box-shadow: var(--shadow-pixel);
}

.toc-link {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan-electric);
  text-decoration: none;
  background: #090B0E;
  padding: 6px 12px;
  border: 1px solid #221B15;
  transition: all 0.2s;
}

.toc-link:hover {
  border-color: var(--cyan-electric);
  background: rgba(0, 229, 255, 0.1);
}

.docs-panels-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.doc-panel {
  background: var(--bg-panel);
  border: 2px solid #000;
  box-shadow: var(--shadow-pixel);
  padding: 26px;
  scroll-margin-top: 80px;
}

.doc-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--bg-panel-light);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.doc-panel-head h3 {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--paper-cream);
}

.panel-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--amber-caution);
  background: #090B0E;
  padding: 2px 8px;
  border: 1px solid var(--amber-caution);
}

.doc-panel p {
  color: var(--paper-cream);
  font-size: 14.5px;
  line-height: 1.6;
}

.panel-desc {
  color: var(--ink-soft) !important;
  margin-bottom: 18px;
}

/* VOCABULARY GLOSSARY */
.doc-glossary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.glossary-item {
  background: #090B0E;
  border: 1px solid var(--bg-panel-light);
  padding: 16px;
}

.glossary-item dt {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan-electric);
  margin-bottom: 6px;
}

.glossary-item dd {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

/* HOW IT WORKS STEPS GRID */
.doc-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.step-box {
  background: #090B0E;
  border: 1px solid var(--bg-panel-light);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
}

.step-num {
  font-family: var(--font-pixel);
  font-size: 18px;
  color: var(--amber-caution);
  margin-bottom: 8px;
}

.step-box h4 {
  font-size: 14px;
  color: var(--paper-cream);
  margin-bottom: 6px;
}

.step-box p {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* DOCUMENTATION TABLES */
.doc-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--bg-panel-light);
  background: #090B0E;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: left;
}

.doc-table th {
  background: var(--bg-panel-light);
  color: var(--amber-caution);
  padding: 12px 14px;
  border-bottom: 2px solid #000;
  font-size: 11px;
  letter-spacing: 1px;
}

.doc-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #161A22;
  color: var(--paper-cream);
}

.tag-weight {
  color: var(--cyan-electric);
  font-weight: 700;
}

/* FAQ ACCORDIONS */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: #090B0E;
  border: 1px solid var(--bg-panel-light);
  padding: 14px 18px;
}

.faq-item summary {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  color: var(--paper-cream);
  cursor: pointer;
  outline: none;
  user-select: none;
}

.faq-item summary:hover {
  color: var(--cyan-electric);
}

.faq-item p {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ENERGIZE & YIELD DESK */
.energize-terminal-sec {
  scroll-margin-top: 80px;
  border-top: 4px solid var(--phosphor-green);
}

.badge-energize {
  background: var(--phosphor-green);
  color: var(--ink-dark);
}

.wallet-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #090B0E;
  border: 2px solid #000;
  padding: 16px 20px;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 16px;
}

.ws-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 1px;
}

.ws-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--paper-cream);
}

.breaker-desk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.breaker-desk-card {
  background: var(--bg-panel-light);
  border: 2px solid #000;
  box-shadow: var(--shadow-pixel);
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.breaker-desk-card.energized {
  border-color: var(--phosphor-green);
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.2), var(--shadow-pixel);
}

.breaker-desk-card.igniting {
  animation: flashIgnition 0.6s ease-in-out;
}

@keyframes flashIgnition {
  0% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(2.5) contrast(1.5); transform: scale(1.02); box-shadow: 0 0 30px #00FF66; }
  100% { filter: brightness(1); transform: scale(1); }
}

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

.bd-id {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--paper-cream);
}

.bd-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  border: 1px solid currentColor;
}

.badge-tripped {
  color: #FF5555;
  border-color: #FF5555;
  background: rgba(255, 85, 85, 0.1);
}

.badge-energized {
  color: var(--phosphor-green);
  border-color: var(--phosphor-green);
  background: rgba(0, 255, 102, 0.1);
}

.bd-art-wrap {
  position: relative;
  border: 2px solid #000;
  overflow: hidden;
  margin-bottom: 14px;
  background: #050709;
}

.bd-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
  transition: filter 0.3s;
}

.bd-art-energized .bd-img {
  filter: drop-shadow(0 0 10px rgba(0, 255, 102, 0.4));
}

.switch-status {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.85);
  font-family: var(--font-mono);
  font-size: 10px;
  color: #FF5555;
  text-align: center;
  padding: 4px 0;
  border-top: 1px solid #000;
  letter-spacing: 1px;
}

.switch-active {
  color: var(--phosphor-green);
  background: rgba(0, 255, 102, 0.15);
  border-top: 1px solid var(--phosphor-green);
  text-shadow: 0 0 6px var(--phosphor-green);
}

.bd-specs {
  background: #090B0E;
  border: 1px solid #161A22;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  margin-bottom: 16px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.spec-row span {
  color: var(--ink-soft);
}

.bd-action {
  margin-top: auto;
}

.btn-full {
  width: 100%;
}

/* EMPTY INVENTORY & WALLET CONNECT STATES */
.empty-inventory-state {
  grid-column: 1 / -1;
  background: var(--bg-panel);
  border: 2px dashed var(--bg-panel-light);
  box-shadow: var(--shadow-pixel);
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

.empty-icon {
  font-size: 36px;
  margin-bottom: 14px;
}

.empty-title {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--paper-cream);
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.empty-desc {
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 520px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.user-addr-mono {
  font-family: var(--font-mono);
  color: var(--cyan-electric);
  word-break: break-all;
}

.btn-connect {
  background: var(--paper-cream);
  color: var(--ink-dark);
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 1px;
  padding: 8px 14px;
  border: 2px solid #000;
  box-shadow: 2px 2px 0px #000;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-connect:hover {
  background: var(--amber-caution);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px #000;
}

.btn-connect.connected {
  background: #090B0E;
  color: var(--phosphor-green);
  border-color: var(--phosphor-dim);
}

.btn-connect.connected::before {
  content: "●";
  color: var(--phosphor-green);
  font-size: 10px;
}

.empty-wallet-icon-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  margin-bottom: 14px;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.25);
}

/* WALLET SELECTION MODAL */
.wallet-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.wallet-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.wallet-modal-card {
  background: #110E0B;
  border: 2px solid #000;
  border-top: 4px solid var(--cyan-electric);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), var(--shadow-pixel);
  width: 100%;
  max-width: 400px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.wallet-modal-overlay.open .wallet-modal-card {
  transform: scale(1) translateY(0);
}

.wallet-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--bg-panel-light);
  padding-bottom: 14px;
}

.wm-title-group h3 {
  font-family: var(--font-pixel);
  font-size: 15px;
  color: var(--paper-cream);
  letter-spacing: 1.5px;
}

.wm-title-group p {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.wm-close-btn {
  background: var(--bg-panel-light);
  border: 1px solid #000;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s;
}

.wm-close-btn:hover {
  color: var(--crimson-alert);
  border-color: var(--crimson-alert);
}

.wallet-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-opt-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #191410;
  border: 1px solid #2B2117;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  width: 100%;
}

.wallet-opt-btn:hover {
  background: #251D14;
  border-color: var(--cyan-electric);
  transform: translateX(3px);
}

.w-opt-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.w-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.w-name {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--paper-cream);
}

.w-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--phosphor-green);
  background: rgba(0, 255, 102, 0.1);
  border: 1px solid var(--phosphor-dim);
  padding: 2px 6px;
}

.w-ext-icon {
  color: var(--ink-soft);
  font-size: 14px;
}

.wallet-more-toggle {
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan-electric);
  padding: 10px 4px 4px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  width: 100%;
  border-top: 1px dashed var(--bg-panel-light);
  margin-top: 6px;
}

.wallet-more-toggle:hover {
  text-decoration: underline;
}

.wallet-more-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* FOOTER */
.foot {
  border-top: 2px solid var(--bg-panel-light);
  padding: 30px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}

.foot-in {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.foot-links a {
  color: var(--cyan-electric);
  text-decoration: none;
  margin-left: 15px;
}

/* TOPBAR LAYOUT */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-panel);
  border: 2px solid #000;
  box-shadow: var(--shadow-pixel);
  color: var(--cyan-electric);
  font-family: var(--font-pixel);
  font-size: 20px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}

.mobile-menu-btn:hover {
  background: var(--bg-panel-light);
  border-color: var(--cyan-electric);
}

.mobile-only-drawer-item {
  display: none;
}

/* RESPONSIVE MOBILE NAVIGATION & LAYOUTS */
@media (max-width: 860px) {
  .wrap {
    padding: 0 12px;
    box-sizing: border-box;
    width: 100%;
  }

  .topbar-in {
    min-height: 60px;
    height: auto;
    padding: 10px 12px;
  }

  .brand {
    font-size: 15px;
  }

  .header-badges {
    display: none;
  }
  
  .btn-audio {
    padding: 0 8px;
    font-size: 10px;
    height: 36px;
  }

  .mobile-menu-btn {
    display: flex;
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: #110E0B;
    border-bottom: 3px solid var(--cyan-electric);
    border-top: 1px solid var(--bg-panel-light);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.9);
    padding: 18px 14px;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
  }

  .nav-links.open {
    display: flex;
    animation: drawerSlide 0.2s ease-out;
  }

  @keyframes drawerSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .nav-link {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-panel);
    border: 1px solid #000;
    border-left: 3px solid transparent;
    font-size: 13.5px;
    box-shadow: var(--shadow-pixel);
    box-sizing: border-box;
  }

  .nav-link:hover, .nav-link.active {
    border-left-color: var(--cyan-electric);
    border-bottom: 1px solid #000;
    background: rgba(0, 229, 255, 0.08);
  }

  .mobile-only-drawer-item {
    display: block;
    padding-top: 10px;
    border-top: 1px solid var(--bg-panel-light);
    text-align: center;
  }

  /* PANEL & FORM CONTAINERS */
  .terminal-panel {
    padding: 18px 12px;
    margin-bottom: 25px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .form-section {
    padding: 14px 10px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  /* TASK CARDS - 2 COLUMN HEADER + FULL WIDTH BUTTONS */
  .task-card {
    display: grid;
    grid-template-columns: 32px 1fr;
    column-gap: 10px;
    row-gap: 12px;
    padding: 14px 12px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .task-icon {
    grid-column: 1;
    grid-row: 1;
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .task-body {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .task-body h4 {
    font-size: 13.5px;
    word-break: break-word;
  }

  .task-body p {
    font-size: 12px;
    line-height: 1.4;
  }

  /* TASK ACTION BUTTONS STACKING */
  .task-action {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
    margin-top: 4px;
    align-self: stretch;
  }

  .task-action .btn {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    white-space: normal;
    text-align: center;
    justify-content: center;
    box-sizing: border-box;
    font-size: 12px;
    flex: none;
  }

  /* TASK 3 URL INPUT & BUTTONS FIX */
  .reply-action-row {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
    margin-top: 6px;
    height: auto;
  }

  .reply-action-row input[type="url"], #replyUrl {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    box-sizing: border-box !important;
    font-size: 12px;
    padding: 8px 10px;
  }

  .reply-action-row .task-action {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    margin-top: 0;
  }

  .reply-action-row .task-action .btn {
    width: 100%;
    font-size: 11px;
    padding: 0 6px;
  }

  /* Other Responsive Grid Adjustments */
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
    margin-bottom: 25px;
  }

  .substation-grid-2col {
    grid-template-columns: 1fr;
  }

  .breaker-desk-grid {
    grid-template-columns: 1fr;
  }

  .dapp-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .wallet-status-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .ws-action {
    width: 100%;
  }

  .ws-action .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 26px;
  }

  .reply-action-row .task-action {
    grid-template-columns: 1fr;
  }
}
