/* ==========================================================================
   DIGNITY GOLD SOVEREIGN NETWORK OS, EXPLORER & MINE RWA FORGE
   Signature Aesthetics: Deep Obsidian & 24K Royal Gold + High-Contrast Light
   ========================================================================== */

:root {
  --bg-darkest: #06070a;
  --bg-deep: #0a0d14;
  --bg-surface: #10141f;
  --bg-card: rgba(16, 20, 31, 0.85);
  --bg-card-hover: rgba(24, 30, 48, 0.95);
  --bg-card-active: #182033;

  --border-subtle: rgba(229, 184, 66, 0.15);
  --border-card: rgba(229, 184, 66, 0.25);
  --border-focus: #e5b842;

  --gold-core: #e5b842;        /* 24K Metallic Gold */
  --gold-light: #f7d57f;       /* Champagne Gold */
  --gold-dark: #b8860b;        /* Deep Burnished Gold */
  --gold-glow: rgba(229, 184, 66, 0.25);

  --emerald-core: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --cyan-core: #38bdf8;
  --violet-core: #a855f7;
  --amber-core: #f59e0b;
  --rose-core: #f43f5e;

  --green-core: #4ade80;
  --teal-core: #2dd4bf;
  --red-core: #ef4444;

  /* Scrims. On a dark ground these are black washes; the light theme inverts
     them to warm washes so a JS-written panel is not a dark box on cream. */
  --scrim-20: rgba(0, 0, 0, 0.20);
  --scrim-25: rgba(0, 0, 0, 0.25);
  --scrim-30: rgba(0, 0, 0, 0.30);
  --scrim-35: rgba(0, 0, 0, 0.35);
  --scrim-40: rgba(0, 0, 0, 0.40);
  --scrim-50: rgba(0, 0, 0, 0.50);
  --rule-subtle: #334155;

  --text-pure: #ffffff;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --input-bg: rgba(0, 0, 0, 0.45);
  --code-bg: #090c13;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.8);
}

/* Institutional Clean Light Theme */
body.theme-light {
  --bg-darkest: #faf8f5;
  --bg-deep: #f3efe6;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #ffffff;
  --bg-card-active: #f7f4ed;

  --border-subtle: #e6dfcf;
  --border-card: #d4c8ae;
  --border-focus: #b8860b;

  --gold-core: #8a6508;
  --gold-light: #6b4708;
  --gold-dark: #573a06;
  --gold-glow: rgba(138, 101, 8, 0.12);

  /* AA-verified against --bg-deep (#f3efe6), the lightest large surface that
     carries text. Ratios: emerald 4.78, green 6.21, cyan 5.17, teal 4.77,
     amber 6.18, gold 4.64, violet 6.09, rose 5.48, red 5.64. */
  --emerald-core: #047857;
  --emerald-glow: rgba(4, 120, 87, 0.12);
  --green-core: #166534;
  --cyan-core: #0369a1;
  --teal-core: #0f766e;
  --amber-core: #92400e;
  --violet-core: #7e22ce;
  --rose-core: #be123c;
  --red-core: #b91c1c;

  --scrim-20: rgba(28, 25, 23, 0.04);
  --scrim-25: rgba(28, 25, 23, 0.05);
  --scrim-30: rgba(28, 25, 23, 0.06);
  --scrim-35: rgba(28, 25, 23, 0.07);
  --scrim-40: rgba(28, 25, 23, 0.05);
  --scrim-50: rgba(28, 25, 23, 0.07);
  --rule-subtle: #ded5c2;

  --text-pure: #1c1917;
  --text-primary: #292524;
  --text-secondary: #57534e;
  --text-muted: #78716c;

  --input-bg: #ffffff;
  --code-bg: #f8fafc;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

body {
  background-color: var(--bg-darkest);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Background Texture */
.bg-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(229, 184, 66, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(184, 134, 11, 0.04) 0%, transparent 40%);
  z-index: -1;
}

/* Global Header */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 2rem;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e5b842 0%, #b8860b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 0 16px var(--gold-glow);
  color: #000;
  font-weight: 900;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold-core);
  text-transform: uppercase;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

/* Sub-Nav Strip Container */
.subnav-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 60px;
  z-index: 95;
  padding: 0.35rem 1.25rem;
  backdrop-filter: blur(14px);
  width: 100%;
}

.subnav-scroll-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--gold-core);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all 0.2s;
  user-select: none;
}

.subnav-scroll-btn:hover {
  background: var(--gold-core);
  color: #000;
  border-color: var(--gold-core);
}

.subnav-scroll-btn:active {
  transform: scale(0.95);
}

/* Nav Tabs Container */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--scrim-30);
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  white-space: nowrap;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.nav-tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.nav-tab {
  flex-shrink: 0;
  white-space: nowrap;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.42rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.nav-tab .tab-icon {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.85;
}

.nav-tab:hover {
  color: var(--text-pure);
  background: var(--bg-card-hover);
  border-color: rgba(212, 175, 55, 0.3);
}

.nav-tab.active {
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
  color: #0b1120;
  border-color: #d4af37;
  box-shadow: 0 2px 10px var(--gold-glow);
  font-weight: 800;
}

.live-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0b1120;
  animation: pulse-dot 1.2s infinite;
  display: inline-block;
}

body.theme-light .nav-tab.active .live-dot-pulse {
  background: #fff;
}

@keyframes pulse-dot {
  0% { transform: scale(0.8); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.6; }
}

/* Mobile Hamburger Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 8px 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mobile-menu-btn:hover {
  border-color: var(--gold-core);
}

.mobile-menu-btn .bar {
  width: 100%;
  height: 2px;
  background: var(--gold-core);
  border-radius: 2px;
  transition: all 0.25s ease;
}

/* Mobile Drawer Overlay */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 86%;
  max-width: 380px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-card);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.75);
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 10;
}

.drawer-brand .brand-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold-core);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.drawer-brand .brand-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.drawer-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.drawer-close-btn:hover {
  background: var(--gold-core);
  color: #000;
  border-color: var(--gold-core);
}

.drawer-section {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.drawer-section-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--gold-core);
  letter-spacing: 0.1em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-active);
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.drawer-nav-item:hover,
.drawer-nav-item:active {
  background: var(--bg-card-hover);
  color: var(--text-pure);
  border-color: rgba(212, 175, 55, 0.4);
}

.drawer-nav-item.active {
  background: rgba(212, 175, 55, 0.14);
  border-color: var(--gold-core);
  color: var(--gold-core);
  font-weight: 700;
}

.drawer-nav-item .item-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gold-core);
  font-weight: 700;
  background: rgba(212, 175, 55, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.drawer-nav-item.active .item-tag {
  background: var(--gold-core);
  color: #000;
}

.drawer-nav-item .item-name {
  flex: 1;
}

/* Mobile Bottom App Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(11, 17, 32, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-card);
  display: none;
  z-index: 900;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.bottom-nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-tab:hover,
.bottom-nav-tab:active {
  color: var(--text-pure);
}

.bottom-nav-tab.active {
  color: var(--gold-core);
}

.bottom-nav-icon {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.bottom-nav-tab.active .bottom-nav-icon {
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-core);
}

.bottom-nav-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}


.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.edge-shield-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--emerald-core);
  font-weight: 700;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-core);
  box-shadow: 0 0 8px var(--emerald-core);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.theme-toggle-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.theme-toggle-btn:hover {
  border-color: var(--gold-core);
}

.l1-height-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.l1-height-badge .lbl { color: var(--text-muted); }
.l1-height-badge .val { color: var(--gold-core); font-weight: 800; }

/* Ticker Bar */
.ticker-banner {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  overflow-x: auto;
  gap: 1.5rem;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.ticker-label { color: var(--text-muted); }
.ticker-val { font-weight: 700; color: var(--text-primary); }
.ticker-val.gold { color: var(--gold-core); }

.highlight-cyan { color: var(--cyan-core) !important; }
.highlight-emerald { color: var(--emerald-core) !important; }
.highlight-amber { color: var(--amber-core) !important; }
.highlight-violet { color: var(--violet-core) !important; }

/* Main Content */
.main-content {
  max-width: 1540px;
  margin: 0 auto;
  padding: 2rem;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

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

/* Search Banner */
.search-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  gap: 0.75rem;
}

.search-icon {
  width: 20px;
  height: 20px;
  stroke: var(--gold-core);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-pure);
  font-size: 0.88rem;
  font-family: var(--font-sans);
}

.search-btn {
  background: var(--gold-core);
  color: #000;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.2s;
}
.search-btn:hover { opacity: 0.9; }

.search-quick-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
}

.tag-title { color: var(--text-muted); }

.quick-filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.72rem;
  transition: all 0.2s;
}

.quick-filter-btn:hover, .quick-filter-btn.active {
  background: var(--gold-glow);
  border-color: var(--gold-core);
  color: var(--gold-core);
}

/* Telemetry Grid */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.telemetry-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.25rem;
  backdrop-filter: blur(8px);
}

.telemetry-card .lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.telemetry-card .val {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: var(--font-heading);
  margin-bottom: 0.25rem;
}

.telemetry-card .sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Stream Columns Grid */
.stream-columns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.stream-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  color: var(--text-pure);
  font-size: 0.95rem;
}

.card-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.blocks-stream-list, .tx-stream-list {
  max-height: 520px;
  overflow-y: auto;
}

.block-row-item, .tx-row-item {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
  cursor: pointer;
}

.block-row-item:hover, .tx-row-item:hover {
  background: var(--bg-card-hover);
}

/* RWA Forge Grid */
.rwa-forge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.issue-rwa-btn {
  background: var(--gold-core);
  color: #000;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--gold-glow);
  transition: all 0.2s;
}

.issue-rwa-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--gold-glow);
}

.rwa-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.rwa-filter-group {
  display: flex;
  gap: 0.4rem;
}

.rwa-filter-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.rwa-filter-btn:hover, .rwa-filter-btn.active {
  background: var(--bg-card);
  border-color: var(--border-card);
  color: var(--gold-core);
}

.rwa-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.rwa-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s;
}

.rwa-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
}

.rwa-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.rwa-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.badge-gold { background: rgba(229, 184, 66, 0.15); color: var(--gold-core); border: 1px solid var(--gold-core); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: var(--amber-core); border: 1px solid var(--amber-core); }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: var(--emerald-core); border: 1px solid var(--emerald-core); }

.rwa-id-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.rwa-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-pure);
  margin-bottom: 0.25rem;
}

.rwa-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.rwa-metrics-box {
  background: var(--scrim-25);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 1rem;
}

.rwa-metric-lbl { font-size: 0.68rem; color: var(--text-muted); font-weight: 700; }
.rwa-metric-val { font-size: 1.15rem; font-weight: 800; color: var(--gold-core); font-family: var(--font-mono); }

.rwa-footer-info {
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
  margin-bottom: 1rem;
}

.rwa-inspect-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 0.5rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.rwa-inspect-btn:hover {
  background: var(--gold-core);
  color: #000;
}

/* Smart Contracts Sandbox */
.contracts-sandbox-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
}

.contracts-nav-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contract-nav-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.contract-nav-item:hover, .contract-nav-item.active {
  border-color: var(--gold-core);
  background: var(--bg-card-hover);
}

.contract-nav-item .c-name {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-core);
}

.contract-nav-item .c-std {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.code-viewer-box {
  background: var(--code-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #93c5fd;
  overflow-x: auto;
  max-height: 280px;
}

/* DigExchange Styles */
.exchange-layout-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
}

.orderbook-tables-wrapper {
  padding: 1rem;
}

.ob-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.ob-spread-bar {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  background: var(--scrim-30);
  margin: 0.5rem 0;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.trade-form-card, .jurisdiction-profiles-card, .retire-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.trade-form-card form {
  padding: 1.25rem;
}

.form-group {
  margin-bottom: 0.85rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--input-bg);
  border: 1px solid var(--border-card);
  color: var(--text-pure);
  border-radius: 6px;
  outline: none;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.submit-action-btn {
  background: var(--gold-core);
  color: #000;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s;
  display: block;
  width: 100%;
}
.submit-action-btn:hover { opacity: 0.9; }

.profiles-list {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-item {
  border-left: 3px solid var(--gold-core);
  padding-left: 0.75rem;
}
.profile-item .p-title { font-weight: 700; font-size: 0.82rem; color: var(--text-pure); }
.profile-item .p-sub { font-size: 0.72rem; color: var(--text-muted); }

/* IoT Sensors Grid */
.iot-sensors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.iot-sensor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
}

.iot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.iot-site { font-size: 0.72rem; font-weight: 700; color: var(--cyan-core); }
.iot-status-badge { font-size: 0.65rem; background: rgba(16, 185, 129, 0.15); color: var(--emerald-core); padding: 0.15rem 0.4rem; border-radius: 3px; font-weight: 700; }

.iot-param { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.5rem; }
.iot-reading-value { font-size: 1.4rem; font-weight: 800; color: var(--emerald-core); font-family: var(--font-mono); margin-bottom: 0.5rem; }
.iot-footer { font-size: 0.7rem; color: var(--text-muted); border-top: 1px solid var(--border-subtle); padding-top: 0.4rem; }

/* Vaults Grid */
.vaults-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.vault-depository-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.25rem;
}

.vault-card-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.vault-title { font-size: 1rem; font-weight: 800; color: var(--text-pure); }
.vault-sub { font-size: 0.75rem; color: var(--text-muted); }

.vault-stat-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
}
.vault-stat { display: flex; justify-content: space-between; }
.vault-stat .lbl { color: var(--text-muted); }
.vault-stat .val { font-weight: 700; }
.vault-stat .val.gold { color: var(--gold-core); }

.vault-insurance-pill {
  background: rgba(229, 184, 66, 0.08);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--gold-core);
  margin-bottom: 0.75rem;
}

.vault-footer {
  font-size: 0.7rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.5rem;
}

.policies-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.policy-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.25rem;
}

.policy-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.policy-num { font-family: var(--font-mono); font-weight: 800; color: var(--gold-core); }
.policy-underwriter { font-size: 0.75rem; color: var(--text-secondary); }
.policy-limit-tag { background: rgba(16, 185, 129, 0.15); color: var(--emerald-core); font-weight: 800; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.75rem; }
.policy-type { font-size: 0.8rem; font-weight: 700; color: var(--text-pure); margin-bottom: 0.25rem; }
.policy-facility { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.policy-risks { font-size: 0.72rem; color: var(--text-secondary); background: var(--scrim-20); padding: 0.5rem; border-radius: 4px; margin-bottom: 0.75rem; }
.policy-footer { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--emerald-core); font-weight: 700; }

/* X402 Feed */
.x402-feed-box {
  max-height: 400px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.x402-stream-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.stream-ctrl-btn {
  background: var(--emerald-core);
  color: #000;
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.75rem;
  cursor: pointer;
  margin-top: 0.5rem;
}
.stream-ctrl-btn.active { background: var(--rose-core); color: #fff; }

/* Table Container */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.data-table th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 700;
  text-align: left;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.small-action-btn {
  background: transparent;
  border: 1px solid var(--border-card);
  color: var(--gold-core);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s;
}
.small-action-btn:hover {
  background: var(--gold-core);
  color: #000;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}
.modal-close-btn:hover { color: var(--text-pure); }

.cancel-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
}

/* Passport Grid */
.passport-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.78rem;
}
.passport-field { display: flex; flex-direction: column; gap: 0.2rem; }
.passport-field .lbl { color: var(--text-muted); font-size: 0.7rem; font-weight: 700; }
.passport-field .val { color: var(--text-pure); font-weight: 600; }
.passport-field .val.mono { font-family: var(--font-mono); font-size: 0.72rem; word-break: break-all; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast-item {
  background: var(--bg-surface);
  border: 1px solid var(--gold-core);
  color: var(--text-pure);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  font-size: 0.82rem;
  font-weight: 600;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Trust stack sub-nav */
.sub-nav-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.sub-nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.sub-nav-btn:hover, .sub-nav-btn.active {
  border-color: var(--gold-core);
  color: var(--gold-core);
  background: var(--bg-surface);
}

.subview-panel { display: none; }
.subview-panel.active { display: block; }

/* Developer Documentation & Real Smart Contracts Hub */
.dev-doc-section { display: none; }
.dev-doc-section.active { display: block; animation: fadeIn 0.2s ease-out; }

.dev-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.dev-overview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
}

.do-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.do-icon { font-size: 1.5rem; }
.do-title { font-size: 1.1rem; font-weight: 800; color: var(--gold-core); }

.do-bullet-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

.dev-contracts-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
}

.dev-contracts-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dev-contract-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.dev-contract-item:hover, .dev-contract-item.active {
  border-color: var(--gold-core);
  background: var(--bg-card-hover);
}

.dev-contract-item .dc-name {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-core);
}

.dev-contract-item .dc-lang {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.dev-contract-display {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
}

.dcd-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.dcd-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-pure);
}

.dcd-badge {
  font-size: 0.72rem;
  color: var(--gold-core);
  font-family: var(--font-mono);
  margin-top: 0.25rem;
}

.copy-code-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--gold-core);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-code-btn:hover {
  background: var(--gold-core);
  color: #000;
}

.dcd-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.dcd-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.6rem 0.75rem;
  background: var(--scrim-25);
  border-radius: 6px;
  margin-bottom: 1rem;
}

.dev-code-viewer {
  background: var(--code-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.5;
  color: #93c5fd;
  overflow-x: auto;
  max-height: 520px;
}

/* SDK Tabs */
.sdk-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.sdk-tab-bar {
  display: flex;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.5rem 1rem;
  gap: 0.5rem;
}

.sdk-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.sdk-tab-btn:hover, .sdk-tab-btn.active {
  background: var(--gold-core);
  color: #000;
}

.sdk-code-block { display: none; }
.sdk-code-block.active { display: block; }
.sdk-code-block .dev-code-viewer { border: none; border-radius: 0; }

.rpc-console-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

/* ========================================================================== */
/* RESPONSIVE DESIGN SYSTEM — IPAD, TABLET & PHONE ADAPTATIONS                */
/* ========================================================================== */

/* Tablet & iPad Breakpoint (<= 1024px) */
@media (max-width: 1024px) {
  .header-container {
    padding: 0.65rem 1.25rem;
  }

  .brand-sub {
    display: none;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .edge-shield-pill {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .subnav-container {
    top: 58px;
    padding: 0.35rem 0.85rem;
  }

  .main-content {
    padding: 1.25rem 1.25rem 4rem 1.25rem;
  }

  /* Multi-column Grids adapt for Tablet/iPad */
  .telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .stream-columns-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .contracts-sandbox-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .exchange-layout-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .dev-contracts-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .divisions-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .ticker-banner {
    padding: 0.45rem 1.25rem;
    gap: 1.25rem;
  }
}

/* Native Phone App Breakpoint (<= 640px) */
@media (max-width: 640px) {
  body {
    padding-bottom: 72px; /* Space for fixed bottom app bar */
  }

  .header-container {
    padding: 0.5rem 0.85rem;
    height: 54px;
  }

  .brand-icon-box {
    width: 32px;
    height: 32px;
  }

  .brand-name {
    font-size: 0.92rem;
    letter-spacing: 0.04em;
  }

  .brand-sub {
    display: none;
  }

  .edge-shield-pill {
    display: none;
  }

  .l1-height-badge {
    display: none;
  }

  #themeToggleText {
    display: none;
  }

  .theme-toggle-btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.72rem;
  }

  .mobile-menu-btn {
    display: flex;
    width: 34px;
    height: 34px;
    padding: 7px 6px;
  }

  /* Subnav Strip on Mobile */
  .subnav-container {
    top: 54px;
    padding: 0.25rem 0.6rem;
    gap: 0.25rem;
  }

  .subnav-scroll-btn {
    display: none; /* Rely on native smooth swipe on phones */
  }

  .nav-tabs {
    background: transparent;
    border: none;
    padding: 0.15rem 0;
    gap: 0.35rem;
  }

  .nav-tab {
    padding: 0.36rem 0.68rem;
    font-size: 0.72rem;
    border-radius: 6px;
  }

  .nav-tab .tab-icon {
    font-size: 0.68rem;
  }

  /* Fixed Mobile Bottom App Bar */
  .mobile-bottom-nav {
    display: flex;
  }

  .main-content {
    padding: 0.85rem 0.75rem 4.5rem 0.75rem;
  }

  .ticker-banner {
    padding: 0.4rem 0.75rem;
    font-size: 0.7rem;
    gap: 1rem;
  }

  /* All Grids collapse cleanly to Single Column on Mobile */
  .telemetry-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .stream-columns-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .contracts-sandbox-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .exchange-layout-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dev-contracts-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .divisions-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .neuromap-benefits-grid {
    grid-template-columns: 1fr !important;
  }

  #neuromapMineSelector {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* Panel Header Adjustments */
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .panel-title {
    font-size: 1.25rem;
  }

  .panel-desc {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .header-action-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
  }

  /* Tables & ASCII Diagrams */
  .ascii-diagram-wrapper,
  .table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Mobile Drawer Sizing */
  .mobile-drawer {
    width: 88%;
    max-width: 320px;
  }

  .drawer-header {
    padding: 1rem 1.25rem;
  }

  .drawer-section {
    padding: 0.85rem 1.1rem;
  }

  .drawer-nav-item {
    padding: 0.65rem 0.8rem;
    font-size: 0.78rem;
  }
}

/* Extra Small Phones (<= 380px) */
@media (max-width: 380px) {
  .brand-name {
    font-size: 0.84rem;
  }

  #neuromapMineSelector {
    grid-template-columns: 1fr !important;
  }

  .bottom-nav-label {
    font-size: 0.6rem;
  }
}



/* ==========================================================================
   AUDIT REMEDIATION — 2026-09-12
   1. Demonstration notice + legal footer
   2. Missing .btn family (deck slide controls rendered unstyled)
   3. Phone overflow: 6 views pushed the document past the viewport at <=640px
   4. Divisions grid: 4+1 orphan at desktop
   5. Last nav tab clipped against the right scroll arrow
   ========================================================================== */

/* --- 1. Demonstration notice ---------------------------------------------- */
.demo-notice {
  position: relative;
  z-index: 60;
  margin: 0;
  padding: 0.7rem 1.5rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #3b2f0b;
  background: linear-gradient(180deg, rgba(255, 236, 179, 0.96), rgba(253, 224, 140, 0.92));
  border-bottom: 1px solid rgba(184, 134, 11, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  text-align: center;
}
.demo-notice strong { color: #7a5c00; font-weight: 800; letter-spacing: 0.02em; }
body.theme-dark .demo-notice {
  color: #ffe9a8;
  background: linear-gradient(180deg, rgba(88, 66, 6, 0.92), rgba(61, 46, 4, 0.88));
  border-bottom-color: rgba(229, 184, 66, 0.45);
}
body.theme-dark .demo-notice strong { color: #ffd75e; }

/* --- 1b. Legal footer ------------------------------------------------------ */
.site-footer {
  margin-top: 3rem;
  padding: 2rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
  max-width: 1400px;
  margin: 0 auto 1.5rem;
}
.footer-block { min-width: 0; }
.footer-block p { margin: 0; }
.footer-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-core);
  margin-bottom: 0.5rem;
}
.footer-legal {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}
.site-footer a { color: var(--gold-core); }

/* --- 2. .btn family (was entirely absent from this stylesheet) ------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-pure);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
}
.btn:hover { background: var(--bg-card-hover); border-color: var(--border-focus); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--gold-core), var(--gold-light));
  border-color: var(--gold-core);
  color: #1b1503;
}
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--gold-core), var(--gold-light)); }
.btn-secondary { background: var(--bg-card); color: var(--text-secondary); }
.btn-secondary:hover { color: var(--text-pure); }

/* --- 4. Divisions grid: 5 cards, balanced 3+2 instead of 4+1 -------------- */
@media (min-width: 1025px) {
  .divisions-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }
  .divisions-grid > * { min-width: 0; }
}

/* --- 5. Last nav tab was clipped against the right scroll arrow ----------- */
.nav-tabs { padding-right: 1.25rem; scroll-padding-inline: 0.5rem; }
.nav-tabs > :last-child { margin-right: 0.5rem; }

/* --- 3. Phone overflow remediation (<=640px) ------------------------------ */
@media (max-width: 640px) {
  /* Grid children must be allowed to shrink below their content width,
     otherwise a wide <pre>/table forces the 1fr track open (was 740px). */
  .contracts-sandbox-grid,
  .dev-contracts-layout,
  .exchange-layout-grid,
  .stream-columns-grid,
  .divisions-grid,
  .vaults-grid,
  .neuromap-benefits-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .contracts-sandbox-grid > *,
  .dev-contracts-layout > *,
  .exchange-layout-grid > *,
  .stream-columns-grid > *,
  .divisions-grid > *,
  .vaults-grid > *,
  .view-panel > * {
    min-width: 0;
  }

  /* vaults-grid had no phone override at all and stayed at repeat(3, 1fr) */
  .vaults-grid { gap: 1rem; }

  /* Button rows that neither wrapped nor scrolled */
  .rwa-filter-group,
  .sub-nav-bar,
  .search-quick-tags,
  .rwa-toolbar,
  .sdk-tab-row {
    flex-wrap: wrap;
    max-width: 100%;
  }
  .rwa-filter-group > *,
  .sub-nav-bar > *,
  .search-quick-tags > * { flex: 0 0 auto; }

  /* Code and data that must scroll inside their own box, never the page */
  .code-viewer-box,
  pre,
  table { max-width: 100%; overflow-x: auto; }

  /* Final guard: nothing escapes the viewport horizontally */
  .main-content, .view-panel { max-width: 100%; overflow-x: clip; }
}

/* --- 4b. Divisions grid now owned by the stylesheet (inline style removed) - */
.divisions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
@media (min-width: 1025px) {
  .divisions-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.divisions-grid > .card { display: flex; flex-direction: column; }
.divisions-grid > .card > div:last-child { margin-top: auto; }

/* --- 6. .panel-header had NO rule: title, description and action controls
   stacked instead of forming one condensed header line. This is the
   "whole line and below doesn't fit" defect. Applies to all 12 views. ----- */
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}
.panel-header > :first-child { flex: 1 1 min(100%, 32rem); min-width: 0; }
.panel-header > :last-child:not(:first-child) { flex: 0 0 auto; margin-left: auto; }
.panel-title {
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.25;
  margin: 0 0 0.3rem;
  color: var(--text-pure);
}
.panel-desc {
  font-size: 0.83rem;
  line-height: 1.5;
  margin: 0;
  color: var(--text-secondary);
  max-width: 72ch;
}
.header-action-badge {
  align-self: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Condense the deck: the slide had a fixed 480px floor plus 36px padding,
   which left a half-screen of dead space under every slide. */
.deck-container {
  min-height: 0 !important;
  padding: 1.5rem 1.75rem !important;
  margin-top: 1rem !important;
}
#deckSlideContent { min-height: 0; }

@media (max-width: 640px) {
  .panel-header { gap: 0.75rem; }
  .panel-header > :last-child:not(:first-child) { margin-left: 0; width: 100%; }
  .panel-header > :last-child:not(:first-child) .btn { flex: 1 1 auto; }
  .deck-container { padding: 1.1rem !important; }
}

/* --- 7. Condense the demonstration notice on phones ----------------------- */
@media (max-width: 640px) {
  .demo-notice {
    padding: 0.5rem 0.85rem;
    font-size: 0.68rem;
    line-height: 1.4;
    text-align: left;
  }
  .site-footer { padding: 1.5rem 1rem 1rem; margin-top: 2rem; }
  .footer-inner { gap: 1.25rem; margin-bottom: 1.25rem; }
}

/* ==========================================================================
   NAV CONDENSATION — 2026-09-12
   13 tabs previously carried a mono tag plus a long descriptor, giving the
   strip a 2,500px scroll width at every viewport. Labels are now single
   short words; the full name lives in the title attribute.
   ========================================================================== */
.nav-tabs {
  gap: 0.15rem;
  padding: 0.2rem 0.35rem;
}
.nav-tab {
  flex: 0 0 auto;
  padding: 0.42rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  border-radius: 6px;
}
.nav-tab .tab-label { display: inline-block; }
.nav-tab .tab-icon { display: none; }
.nav-tab .live-dot-pulse { margin-left: 0.35rem; }

/* Wide desktop: let the 13 tabs spread evenly and fill the strip */
@media (min-width: 1280px) {
  .nav-tabs { gap: 0.1rem; }
  .nav-tab { flex: 1 1 0; justify-content: center; padding-inline: 0.5rem; font-size: 0.75rem; }
  .subnav-scroll-btn { display: none; }
}

/* Mid widths: tighter still, arrows stay available */
@media (min-width: 641px) and (max-width: 1279px) {
  .nav-tab { padding: 0.4rem 0.6rem; font-size: 0.72rem; }
}

/* Phones: compact touch targets, horizontal scroll with momentum */
@media (max-width: 640px) {
  .nav-tabs { gap: 0.2rem; padding: 0.25rem 0.4rem; }
  .nav-tab { padding: 0.45rem 0.65rem; font-size: 0.72rem; }
}

/* ==========================================================================
   DOCUMENT DATA ROOM
   ========================================================================== */
.doc-roomnote {
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold-core);
  border-radius: 8px;
  background: var(--bg-card);
  padding: 0.8rem 1rem;
  margin-bottom: 1.75rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-secondary);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}
.doc-section { margin-bottom: 1.9rem; }
.doc-section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gold-core);
  margin: 0 0 0.35rem;
}
.doc-count {
  font-size: 0.66rem;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  letter-spacing: 0;
}
.doc-section-note {
  margin: 0 0 0.7rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 80ch;
}
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
  gap: 0.7rem;
}
.doc-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}
.doc-card:hover {
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}
.doc-card:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.doc-ext {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 7px;
  border: 1px solid var(--border-card);
  background: var(--bg-deep);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold-core);
}
.doc-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; flex: 1 1 auto; }
.doc-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-pure);
  line-height: 1.3;
}
.doc-blurb {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.doc-size {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .doc-card { padding: 0.7rem 0.75rem; gap: 0.6rem; }
  .doc-ext { width: 2.1rem; height: 2.1rem; }
  .doc-size { display: none; }
}

/* ==========================================================================
   DATA ROOM ACCESS GATE
   ========================================================================== */
.doc-lockbadge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-muted);
}
.doc-lockbadge.is-open { color: var(--emerald-core, #0f7b53); border-color: currentColor; }

.gate {
  border: 1px solid var(--border-card);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 1.15rem 1.25rem 1.25rem;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow-sm);
}
.gate-head { display: flex; align-items: flex-start; gap: 0.85rem; margin-bottom: 1rem; }
.gate-lock {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.55rem;
  border-radius: 7px;
  border: 1px solid var(--border-card);
  background: var(--bg-deep);
  color: var(--gold-core);
}
.gate-title { margin: 0 0 0.25rem; font-size: 1rem; color: var(--text-pure); }
.gate-sub { margin: 0; font-size: 0.8rem; line-height: 1.5; color: var(--text-secondary); max-width: 68ch; }

.gate-form { display: flex; flex-direction: column; gap: 0.75rem; }
.gate-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.gate-field { display: flex; flex-direction: column; gap: 0.28rem; min-width: 0; }
.gate-field > span {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.gate-field > span i { text-transform: none; letter-spacing: 0; font-style: normal; opacity: 0.75; }
.gate-field input,
.gate-field select,
.gate-field textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-pure);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.4;
}
.gate-field textarea { resize: vertical; min-height: 2.6rem; }
.gate-field input:focus,
.gate-field select:focus,
.gate-field textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-core) 22%, transparent);
}
.gate-field.has-error input,
.gate-field.has-error select { border-color: #c2410c; }
.gate-error { font-size: 0.7rem; font-style: normal; color: #c2410c; min-height: 0; }
.gate-field.has-error .gate-error { min-height: 1rem; }

.gate-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gate-actions { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; margin-top: 0.15rem; }
.gate-status { font-size: 0.78rem; color: var(--text-muted); }
.gate-status.is-error { color: #c2410c; }
.gate-status.is-info { color: var(--gold-core); }
.gate-fine { margin: 0.1rem 0 0; font-size: 0.72rem; color: var(--text-muted); max-width: 70ch; }

/* Before the server answers, the gated grid stays hidden by its own attribute. */
.doc-grid.is-gated { opacity: 0; }

@media (max-width: 640px) {
  .gate { padding: 1rem; }
  .gate-row { grid-template-columns: minmax(0, 1fr); }
  .gate-head { gap: 0.6rem; }
  .gate-actions .btn { width: 100%; }
  .doc-lockbadge { margin-left: 0; }
}

/* `display: grid` on .doc-grid beats the [hidden] attribute's display:none,
   so the locked grid kept reserving a screen of empty space. */
.doc-grid[hidden], [hidden] { display: none !important; }
.doc-grid.is-gated { opacity: 1; }

/* ==========================================================================
   SYSTEM CONNECTIVITY MAP
   Replaces the fixed-width ASCII topology block, which reflowed into an
   unreadable wall of text at every viewport below ~1600px.
   ========================================================================== */
.system-map-shell {
  margin-top: 1rem;
  padding: 1.1rem 1.15rem 1.25rem;
  border: 1px solid var(--border-card);
  border-radius: 14px;
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow-sm);
}
.sm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.8rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}
.sm-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  color: var(--gold-core);
  font-weight: 700;
}
.sm-lede { margin: 0.3rem 0 0; font-size: 0.82rem; color: var(--text-secondary); max-width: 74ch; line-height: 1.5; }
.sm-legendkey {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); white-space: nowrap;
}
.sm-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--emerald-core, #10b981);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--emerald-core, #10b981) 60%, transparent);
  animation: sm-pulse 2.4s ease-out infinite;
}
@keyframes sm-pulse {
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --- toolbar ------------------------------------------------------------- */
.sm-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.85rem;
}
.sm-layers { display: flex; flex-wrap: wrap; gap: 0.32rem; }
.sm-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.sm-chip:hover { color: var(--text-pure); border-color: var(--border-card); }
.sm-chip.is-on { border-color: var(--gold-core); color: var(--text-pure); background: var(--bg-card-active, var(--bg-card)); }
.sm-chip:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.sm-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; background: currentColor; }
.sm-controls { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.sm-play.is-running { filter: brightness(0.95); }

/* --- layer colours (single source of truth for chips, lines, arrows) ------ */
.sm-layer-physical { color: #b8860b; }
.sm-layer-title    { color: #0f766e; }
.sm-layer-ledger   { color: #1d4ed8; }
.sm-layer-instrument { color: #7c3aed; }
.sm-layer-market   { color: #b45309; }
.sm-layer-capital  { color: #047857; }
.sm-layer-esg      { color: #15803d; }
.sm-layer-holder   { color: #9333ea; }
body.theme-dark .sm-layer-physical { color: #e5b842; }
body.theme-dark .sm-layer-title    { color: #2dd4bf; }
body.theme-dark .sm-layer-ledger   { color: #60a5fa; }
body.theme-dark .sm-layer-instrument { color: #c084fc; }
body.theme-dark .sm-layer-market   { color: #fbbf24; }
body.theme-dark .sm-layer-capital  { color: #34d399; }
body.theme-dark .sm-layer-esg      { color: #4ade80; }
body.theme-dark .sm-layer-holder   { color: #d8b4fe; }

/* --- the canvas ---------------------------------------------------------- */
.sm-stage {
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 10px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem;
}
.sm-svg { display: block; width: 100%; min-width: 900px; height: auto; }

.sm-colrule { stroke: var(--border-subtle); stroke-width: 1; stroke-dasharray: 3 6; opacity: 0.65; }
.sm-colhead {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  letter-spacing: 0.09em; fill: var(--text-muted);
}

/* nodes */
.sm-node { cursor: pointer; transition: opacity 0.22s ease; }
.sm-node-box {
  fill: var(--bg-surface);
  stroke: var(--border-card);
  stroke-width: 1.2;
  transition: stroke 0.18s ease, fill 0.18s ease;
}
.sm-node-accent { fill: currentColor; opacity: 0.9; }
.sm-kind-origin     { color: #b8860b; }
.sm-kind-physical   { color: #0f766e; }
.sm-kind-title      { color: #1d4ed8; }
.sm-kind-core       { color: #7c3aed; }
.sm-kind-instrument { color: #b45309; }
.sm-kind-market     { color: #047857; }
.sm-kind-holder     { color: #9333ea; }
body.theme-dark .sm-kind-origin     { color: #e5b842; }
body.theme-dark .sm-kind-physical   { color: #2dd4bf; }
body.theme-dark .sm-kind-title      { color: #60a5fa; }
body.theme-dark .sm-kind-core       { color: #c084fc; }
body.theme-dark .sm-kind-instrument { color: #fbbf24; }
body.theme-dark .sm-kind-market     { color: #34d399; }
body.theme-dark .sm-kind-holder     { color: #d8b4fe; }

.sm-node-label { font-size: 14px; font-weight: 800; fill: var(--text-pure); }
.sm-node-sub   { font-size: 11px; fill: var(--text-muted); font-family: var(--font-mono); }
.sm-node-hint  { font-size: 10px; fill: currentColor; opacity: 0; font-family: var(--font-mono); transition: opacity 0.18s ease; }
.sm-node:hover .sm-node-hint,
.sm-node:focus .sm-node-hint,
.sm-node.is-hot .sm-node-hint { opacity: 0.85; }
.sm-node:hover .sm-node-box,
.sm-node.is-hot .sm-node-box { stroke: currentColor; stroke-width: 2; }
.sm-node:focus { outline: none; }
.sm-node:focus-visible .sm-node-box { stroke: currentColor; stroke-width: 2.4; }

/* edges */
.sm-edge-hit { stroke: transparent; stroke-width: 16; fill: none; }
.sm-edge-line {
  stroke: currentColor; stroke-width: 1.5; fill: none; opacity: 0.5;
  transition: opacity 0.22s ease, stroke-width 0.22s ease;
}
.sm-arrowhead { fill: currentColor; opacity: 0.75; }
.sm-edge-flow {
  stroke: currentColor; stroke-width: 2.4; fill: none; opacity: 0;
  stroke-dasharray: 5 15; stroke-linecap: round;
}
.sm-edge.is-hot .sm-edge-line { opacity: 1; stroke-width: 2.2; }
.sm-edge.is-hot .sm-edge-flow { opacity: 0.95; animation: sm-flow 1.15s linear infinite; }
@keyframes sm-flow { to { stroke-dashoffset: -40; } }

.sm-svg.is-isolating .sm-node.is-dim { opacity: 0.2; }
.sm-svg.is-isolating .sm-edge.is-dim .sm-edge-line { opacity: 0.08; }
.sm-svg.is-isolating .sm-edge.is-dim .sm-arrowhead { opacity: 0.08; }
.sm-edge.is-muted { opacity: 0.07; pointer-events: none; }

.sm-packet {
  fill: currentColor; color: var(--gold-core);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--gold-core) 70%, transparent));
}

/* narration + detail */
.sm-narration {
  margin-top: 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold-core);
  background: var(--bg-surface);
  font-size: 0.83rem;
  line-height: 1.55;
  color: var(--text-secondary);
  min-height: 3.2rem;
}
.sm-detail {
  margin-top: 0.8rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-card);
  border-radius: 11px;
  background: var(--bg-surface);
}
.sm-detail-head { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.sm-detail-head h4 { margin: 0; font-size: 1.02rem; color: var(--text-pure); }
.sm-detail-kind {
  font-family: var(--font-mono); font-size: 0.63rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: currentColor;
  border: 1px solid currentColor; border-radius: 999px; padding: 0.12rem 0.5rem;
}
.sm-detail-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted);
}
.sm-detail-close:hover { color: var(--text-pure); }
.sm-detail-role { margin: 0 0 0.85rem; font-size: 0.85rem; line-height: 1.6; color: var(--text-secondary); max-width: 86ch; }
.sm-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 0.85rem; margin: 0; }
.sm-detail-grid > div { min-width: 0; }
.sm-detail-grid dt {
  font-family: var(--font-mono); font-size: 0.63rem; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--gold-core); margin-bottom: 0.2rem;
}
.sm-detail-grid dd { margin: 0; font-size: 0.79rem; line-height: 1.5; color: var(--text-secondary); }

@media (max-width: 640px) {
  .system-map-shell { padding: 0.85rem; }
  .sm-toolbar { gap: 0.55rem; }
  .sm-controls { width: 100%; }
  .sm-controls .btn { flex: 1 1 auto; }
  .sm-stage { padding: 0.25rem; }
  .sm-svg { min-width: 820px; }
  .sm-narration { font-size: 0.79rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sm-edge.is-hot .sm-edge-flow { animation: none; opacity: 0.9; }
  .sm-live { animation: none; }
  .sm-node, .sm-edge-line { transition: none; }
}

/* ==========================================================================
   OPERATOR ONBOARDING DESK
   ========================================================================== */
.ob-rails { margin-bottom: 1rem; overflow-x: auto; }
.ob-steps {
  display: flex; align-items: center; gap: 0.4rem;
  list-style: none; margin: 0; padding: 0; min-width: max-content;
}
.ob-steps li {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.7rem 0.35rem 0.4rem;
  border: 1px solid var(--border-subtle); border-radius: 999px;
  background: var(--bg-surface);
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted);
  white-space: nowrap;
}
.ob-steps li span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: var(--bg-deep); color: var(--text-muted); font-size: 0.62rem;
}
.ob-steps li.is-on { border-color: var(--gold-core); color: var(--text-pure); }
.ob-steps li.is-on span { background: var(--gold-core); color: #1b1503; }
.ob-steps li.is-done { color: var(--text-secondary); }
.ob-steps li.is-done span { background: var(--emerald-core, #0f7b53); color: #fff; }

.ob-note {
  border: 1px solid var(--border-card); border-left: 3px solid var(--gold-core);
  border-radius: 9px; background: var(--bg-card);
  padding: 0.8rem 1rem; margin-bottom: 1.1rem;
  font-size: 0.81rem; line-height: 1.55; color: var(--text-secondary);
  backdrop-filter: blur(14px) saturate(135%); -webkit-backdrop-filter: blur(14px) saturate(135%);
}

.ob-form { display: flex; flex-direction: column; gap: 1rem; }
.ob-step {
  border: 1px solid var(--border-subtle); border-radius: 12px;
  background: var(--bg-card); padding: 1.1rem 1.15rem 1.25rem; margin: 0;
  backdrop-filter: blur(14px) saturate(135%); -webkit-backdrop-filter: blur(14px) saturate(135%);
}
.ob-step legend {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--gold-core); padding: 0 0.4rem;
}
.ob-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 0.8rem; }
.ob-field { display: flex; flex-direction: column; gap: 0.28rem; min-width: 0; }
.ob-field.ob-wide { grid-column: 1 / -1; }
.ob-field > span {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted);
}
.ob-field > span i { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--gold-core); opacity: 0.85; }
.ob-field input, .ob-field select, .ob-field textarea {
  width: 100%; padding: 0.5rem 0.65rem; border-radius: 8px;
  border: 1px solid var(--border-subtle); background: var(--bg-surface);
  color: var(--text-pure); font-family: inherit; font-size: 0.85rem; line-height: 1.4;
}
.ob-field textarea { resize: vertical; }
.ob-field input:focus, .ob-field select:focus, .ob-field textarea:focus {
  outline: none; border-color: var(--border-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-core) 22%, transparent);
}
.ob-field.has-error input, .ob-field.has-error select, .ob-field.has-error textarea { border-color: #c2410c; }
.ob-error { display: block; font-size: 0.7rem; font-style: normal; color: #c2410c; }
.ob-hint { font-size: 0.76rem; color: var(--text-muted); margin: 0.7rem 0 0; line-height: 1.5; }
.ob-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.ob-actions { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.ob-status { font-size: 0.78rem; color: var(--text-muted); }
.ob-status.is-error { color: #c2410c; }

/* --- generated package --- */
.ob-pkghead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.8rem;
}
.ob-pkgid { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 700; color: var(--text-pure); }
.ob-pkghash { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-muted); word-break: break-all; }
.ob-doctabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.8rem; }
.ob-doctab {
  padding: 0.35rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--border-subtle); background: var(--bg-surface);
  color: var(--text-secondary); font-size: 0.72rem; cursor: pointer;
}
.ob-doctab.is-on { border-color: var(--gold-core); color: var(--text-pure); }
.ob-docbody { display: none; }
.ob-docbody.is-on { display: block; }

.doc {
  border: 1px solid var(--border-subtle); border-radius: 10px;
  background: var(--bg-surface); padding: 1.25rem 1.4rem;
  max-height: 34rem; overflow-y: auto;
  font-size: 0.84rem; line-height: 1.62; color: var(--text-secondary);
}
.doc-head { border-bottom: 2px solid var(--gold-core); padding-bottom: 0.7rem; margin-bottom: 0.9rem; }
.doc-mark { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em; color: var(--gold-core); }
.doc-head h2 { margin: 0.3rem 0 0.2rem; font-size: 1.12rem; color: var(--text-pure); }
.doc-ref { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); }
.doc .notice {
  background: color-mix(in srgb, var(--gold-core) 12%, transparent);
  border: 1px solid var(--border-card); border-left: 3px solid var(--gold-core);
  border-radius: 7px; padding: 0.7rem 0.85rem; margin-bottom: 1rem;
  font-size: 0.74rem; line-height: 1.5;
}
.doc-parties {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.5rem 1rem; padding: 0.7rem 0; margin-bottom: 0.9rem;
  border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
}
.doc-parties span {
  display: block; font-family: var(--font-mono); font-size: 0.6rem;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted);
}
.doc-body h3 { font-size: 0.88rem; color: var(--text-pure); margin: 1.1rem 0 0.35rem; }
.doc-body p, .doc-body li { font-size: 0.82rem; }
.doc-body .lede { font-style: italic; color: var(--text-muted); }
.doc .blank {
  background: color-mix(in srgb, #c2410c 14%, transparent);
  border-bottom: 1px dashed #c2410c; padding: 0 0.2rem; color: #9a3412; font-style: italic;
}
.doc-table { width: 100%; border-collapse: collapse; margin: 0.6rem 0; font-size: 0.78rem; }
.doc-table th, .doc-table td { border: 1px solid var(--border-subtle); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
.doc-table th { width: 38%; background: var(--bg-deep); color: var(--text-muted); font-weight: 600; }
.doc-freeform { border: 1px dashed var(--border-card); border-radius: 6px; padding: 0.6rem 0.7rem; min-height: 2.6rem; font-size: 0.8rem; }
.cp li { margin: 0.3rem 0; }
.doc-sign { margin-top: 1.3rem; padding-top: 0.9rem; border-top: 1px solid var(--border-subtle); }
.doc-sign h3 { font-size: 0.88rem; color: var(--text-pure); margin: 0 0 0.4rem; }
.sign-note { font-size: 0.74rem; color: var(--text-muted); }
.sign-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1rem; margin-top: 0.7rem; }
.sign-label { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); }
.sign-line { border-bottom: 1px solid var(--text-muted); padding: 0.7rem 0 0.25rem; font-size: 0.9rem; color: var(--text-pure); }
.sign-line.pending { color: var(--text-muted); font-style: italic; }
.sign-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.25rem; }

.ob-execute { margin-top: 1rem; padding: 1rem 1.1rem; border: 1px solid var(--border-card); border-radius: 10px; background: var(--bg-card); }
.ob-execute h4 { margin: 0 0 0.3rem; font-size: 0.95rem; color: var(--text-pure); }
.ob-check { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.8rem; color: var(--text-secondary); margin: 0.7rem 0; line-height: 1.5; }
.ob-check input { margin-top: 0.2rem; flex: 0 0 auto; }
.ob-done-badge {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px;
  border: 1px solid var(--gold-core); color: var(--gold-core);
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.07em; margin-bottom: 0.5rem;
}
.ob-done h4 { margin: 0.2rem 0 0.4rem; }
.ob-done-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 0.7rem; margin: 0.8rem 0 0; }
.ob-done-meta dt { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-core); }
.ob-done-meta dd { margin: 0.15rem 0 0; font-size: 0.78rem; color: var(--text-secondary); }
.ob-done-meta .mono { font-family: var(--font-mono); font-size: 0.62rem; word-break: break-all; }

@media (max-width: 640px) {
  .ob-step { padding: 0.9rem; }
  .doc { padding: 0.9rem; max-height: 28rem; }
  .doc-table th { width: 45%; }
  .ob-actions .btn { flex: 1 1 auto; }
}

@media print {
  body.printing-package > *:not(.main-content) { display: none !important; }
  body.printing-package .view-panel:not(#view-join) { display: none !important; }
  body.printing-package .ob-step:not([data-step="5"]) { display: none !important; }
  body.printing-package .ob-doctabs, body.printing-package .ob-execute,
  body.printing-package .ob-actions, body.printing-package .ob-rails,
  body.printing-package .panel-header, body.printing-package .ob-note { display: none !important; }
  body.printing-package .ob-docbody { display: block !important; page-break-after: always; }
  body.printing-package .doc { max-height: none; overflow: visible; border: none; }
}

/* --- onboarding pipeline ------------------------------------------------- */
.ob-pipeline { margin-top: 1.6rem; }
.ob-pipe-title {
  display: flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--gold-core); margin: 0 0 0.3rem;
}
.ob-pipe-count {
  font-size: 0.66rem; padding: 0.1rem 0.42rem; border-radius: 999px;
  border: 1px solid var(--border-card); color: var(--text-muted); letter-spacing: 0;
}
.ob-pipe-note { margin: 0 0 0.9rem; font-size: 0.78rem; color: var(--text-muted); max-width: 80ch; line-height: 1.5; }
.ob-pipe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 0.8rem; }
.ob-pipe-card {
  min-width: 0; padding: 0.95rem 1rem 0.85rem;
  border: 1px solid var(--border-subtle); border-radius: 11px;
  background: var(--bg-card); border-left-width: 3px;
  backdrop-filter: blur(14px) saturate(135%); -webkit-backdrop-filter: blur(14px) saturate(135%);
}
.ob-pipe-card.is-submitted { border-left-color: #c2410c; }
.ob-pipe-card.is-diligence { border-left-color: var(--gold-core); }
.ob-pipe-card.is-accepted  { border-left-color: var(--emerald-core, #0f7b53); }
.ob-pipe-stage {
  display: inline-block; font-family: var(--font-mono); font-size: 0.6rem;
  letter-spacing: 0.08em; padding: 0.12rem 0.5rem; border-radius: 999px;
  border: 1px solid currentColor; margin-bottom: 0.45rem;
}
.ob-pipe-card.is-submitted .ob-pipe-stage { color: #c2410c; }
.ob-pipe-card.is-diligence .ob-pipe-stage { color: var(--gold-core); }
.ob-pipe-card.is-accepted  .ob-pipe-stage { color: var(--emerald-core, #0f7b53); }
.ob-pipe-card h4 { margin: 0 0 0.2rem; font-size: 0.92rem; color: var(--text-pure); line-height: 1.3; }
.ob-pipe-meta { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); margin-bottom: 0.55rem; }
.ob-pipe-body { margin: 0 0 0.6rem; font-size: 0.79rem; line-height: 1.55; color: var(--text-secondary); }
.ob-pipe-body code { font-family: var(--font-mono); font-size: 0.74rem; }
.ob-pipe-open { margin: 0 0 0.6rem; padding-left: 1.05rem; }
.ob-pipe-open li { font-size: 0.76rem; line-height: 1.5; color: var(--text-secondary); margin-bottom: 0.35rem; }
.ob-pipe-card footer {
  padding-top: 0.55rem; border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-muted); line-height: 1.45;
}

/* ==========================================================================
   KIOSK MODE — the app running inside a device frame
   Strips the page furniture that belongs to the desktop site, keeps the app.
   ========================================================================== */
.is-kiosk .demo-notice,
.is-kiosk .site-footer,
.is-kiosk .subnav-container,
.is-kiosk #view-anywhere { display: none !important; }
.is-kiosk body { padding-bottom: 64px; }
.is-kiosk .header-container { height: 48px; padding: 0.4rem 0.7rem; }
.is-kiosk .brand-sub, .is-kiosk .edge-shield-pill { display: none !important; }
.is-kiosk .mobile-bottom-nav { display: flex !important; }
.is-kiosk .mobile-menu-btn { display: inline-flex !important; }
.is-kiosk .main-content { padding-top: 0.6rem; }
.is-kiosk .ticker-banner { font-size: 0.62rem; }

/* The phone frame draws a Dynamic Island over the top of the screen, because that
   is where the hardware puts it. iOS reserves a safe area beneath it in standalone
   mode, so the kiosk page reserves the same band: a solid status strip, with the
   sticky header docked below it. Without this the island sits on the wordmark.
   46px is the island's lower edge (8px offset + 20px tall) divided back out of the
   0.6209 frame scale, rounded up. */
.is-kiosk body { padding-top: 46px; }
.is-kiosk .header-container { top: 46px; }
.is-kiosk body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 46px;
  background: var(--bg-deep);
  z-index: 101;
}

/* ==========================================================================
   ANYWHERE — live device frames
   The frames hold real iframes at true device resolution, scaled down with a
   transform so what is shown is the application itself, not a picture of it.
   ========================================================================== */
.aw-lede {
  border: 1px solid var(--border-card); border-left: 3px solid var(--gold-core);
  border-radius: 10px; background: var(--bg-card);
  padding: 0.85rem 1rem; margin-bottom: 1.1rem;
  font-size: 0.83rem; line-height: 1.6; color: var(--text-secondary); max-width: 88ch;
  backdrop-filter: blur(14px) saturate(135%); -webkit-backdrop-filter: blur(14px) saturate(135%);
}

.aw-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1.2rem; }
.aw-controls-label {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text-muted); margin-right: 0.3rem;
}
.aw-chip {
  padding: 0.34rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--border-subtle); background: var(--bg-surface);
  color: var(--text-secondary); font-size: 0.73rem; cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.aw-chip:hover { color: var(--text-pure); border-color: var(--border-card); }
.aw-chip.is-on { border-color: var(--gold-core); color: var(--text-pure); }
.aw-chip:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

.aw-stage {
  display: grid;
  grid-template-columns: auto auto minmax(min(100%, 18rem), 1fr);
  gap: 1.6rem;
  align-items: start;
}

.aw-device { margin: 0; }
.aw-device figcaption {
  margin-top: 0.6rem; text-align: center;
  font-family: var(--font-mono); font-size: 0.64rem; color: var(--text-muted);
}

/* --- the screen: a true-resolution iframe scaled into the bezel ---------- */
.aw-screen { position: relative; overflow: hidden; background: #0b0f19; }
.aw-frame {
  border: 0; display: block; transform-origin: 0 0; background: #faf8f5;
  /* Promote the scaled iframe onto its own layer. Without this Chromium can
     decline to paint an iframe whose layout box is much larger than the
     overflow-hidden parent clipping it. */
  will-change: transform;
  backface-visibility: hidden;
}
.aw-loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.62rem; color: #8a8275;
  background: var(--bg-deep); transition: opacity 0.3s ease;
}
.aw-screen.is-ready .aw-loading { opacity: 0; pointer-events: none; }

/* --- phone: 393 x 852 at 0.62 = 244 x 528 ------------------------------- */
.aw-phone-shell {
  position: relative; width: 268px; height: 552px;
  border-radius: 40px; padding: 12px;
  background: linear-gradient(160deg, #2c2c31, #141418 45%, #33333a);
  box-shadow: 0 18px 40px rgba(0,0,0,0.28), inset 0 0 0 2px rgba(255,255,255,0.07);
}
.aw-phone .aw-screen { width: 244px; height: 528px; border-radius: 30px; }
.aw-phone .aw-frame { width: 393px; height: 852px; transform: scale(0.6209); }
.aw-island {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 76px; height: 20px; border-radius: 12px; background: #0a0a0c; z-index: 3;
}
.aw-btn { position: absolute; background: #26262b; border-radius: 2px; }
.aw-btn-power { right: -2px; top: 150px; width: 3px; height: 58px; }
.aw-btn-vol-up { left: -2px; top: 120px; width: 3px; height: 34px; }
.aw-btn-vol-dn { left: -2px; top: 164px; width: 3px; height: 34px; }

/* --- tablet: 820 x 1180 at 0.42 = 344 x 496 ----------------------------- */
.aw-tablet-shell {
  position: relative; width: 372px; height: 524px;
  border-radius: 24px; padding: 14px;
  background: linear-gradient(160deg, #2c2c31, #141418 45%, #33333a);
  box-shadow: 0 18px 40px rgba(0,0,0,0.28), inset 0 0 0 2px rgba(255,255,255,0.07);
}
.aw-tablet .aw-screen { width: 344px; height: 496px; border-radius: 12px; }
.aw-tablet .aw-frame { width: 820px; height: 1180px; transform: scale(0.4195); }
.aw-cam {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: #0a0a0c; z-index: 3;
}

/* --- talking points ------------------------------------------------------ */
.aw-points { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.aw-point {
  border: 1px solid var(--border-subtle); border-radius: 10px;
  background: var(--bg-card); padding: 0.8rem 0.9rem;
  backdrop-filter: blur(14px) saturate(135%); -webkit-backdrop-filter: blur(14px) saturate(135%);
}
.aw-point-k {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em; color: var(--gold-core);
}
.aw-point h4 { margin: 0.15rem 0 0.25rem; font-size: 0.88rem; color: var(--text-pure); }
.aw-point p { margin: 0; font-size: 0.78rem; line-height: 1.5; color: var(--text-secondary); }

/* --- install -------------------------------------------------------------- */
.aw-install { margin-top: 1.8rem; }
.aw-install-title {
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--gold-core); margin: 0 0 0.7rem;
}
.aw-install-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 0.8rem; }
.aw-install-card {
  border: 1px solid var(--border-subtle); border-radius: 10px;
  background: var(--bg-card); padding: 0.85rem 0.95rem; min-width: 0;
  backdrop-filter: blur(14px) saturate(135%); -webkit-backdrop-filter: blur(14px) saturate(135%);
}
.aw-os {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.5rem;
}
.aw-install-card ol { margin: 0; padding-left: 1.1rem; }
.aw-install-card li { font-size: 0.79rem; line-height: 1.55; color: var(--text-secondary); margin-bottom: 0.2rem; }
.aw-os-note { margin: 0.5rem 0 0; font-size: 0.73rem; color: var(--text-muted); line-height: 1.45; }
.aw-install-fine { margin: 0.85rem 0 0; font-size: 0.74rem; color: var(--text-muted); max-width: 84ch; line-height: 1.5; }

/* --- responsive ----------------------------------------------------------- */
@media (max-width: 1180px) {
  .aw-stage { grid-template-columns: auto minmax(min(100%, 16rem), 1fr); }
  .aw-tablet { display: none; }
}
@media (max-width: 720px) {
  .aw-stage { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .aw-points { width: 100%; }
  .aw-device figcaption { margin-bottom: 0.4rem; }
}
@media (max-width: 400px) {
  /* Shrink the frame rather than letting it push the page sideways. */
  .aw-phone-shell { transform: scale(0.86); transform-origin: top center; }
  .aw-phone { height: 500px; }
}

@media (prefers-reduced-motion: reduce) {
  .aw-loading { transition: none; }
}

/* ==========================================================================
   TOUCH TARGETS
   On a coarse pointer the nav tabs, chips and the theme toggle were 25-28px
   tall. Apple's guideline is 44pt; 44 is impractical for a 15-tab strip, but
   nothing interactive should sit under 40px under a thumb. Scoped to
   pointer:coarse so the desktop layout keeps its density.
   ========================================================================== */
@media (pointer: coarse) {
  .nav-tab,
  .aw-chip,
  .sm-chip,
  .gate-field select,
  .ob-doctab,
  .doc-card,
  .theme-toggle-btn,
  .subnav-scroll-btn,
  .mine-select-pill,
  .sub-nav-btn,
  .rwa-filter-btn,
  .quick-filter-btn,
  .sdk-tab-btn {
    min-height: 40px;
  }
  .nav-tab, .aw-chip, .sm-chip, .ob-doctab {
    display: inline-flex;
    align-items: center;
  }
  .theme-toggle-btn, .subnav-scroll-btn { display: inline-flex; align-items: center; justify-content: center; }
  .subnav-scroll-btn { min-width: 40px; }

  /* Form controls people actually tap through on a phone. */
  .ob-field input, .ob-field select, .ob-field textarea,
  .gate-field input, .gate-field select {
    min-height: 44px;
    font-size: 16px; /* stops iOS Safari zooming the viewport on focus */
  }
  .ob-field textarea, .gate-field textarea { min-height: 66px; }
  .ob-check input[type="checkbox"] { width: 22px; height: 22px; }
  .btn { min-height: 44px; }
}
