/* ==========================================================================
   AEGIS Protocol — Pro-Trader Risk & Liquidation Terminal Styles
   Brand Kit Compliance: 100% tokenized via brand/kit/tokens.css
   Typography: Marcellus (--display) & Inter (--text)
   Surfaces: 16px flat radius, 1px --rule borders, --raised fill
   ========================================================================== */

@import url("../brand/kit/tokens.css");
@import url("/brand/kit/tokens.css");

:root {
  --bg-base: linear-gradient(135deg, #FFF6EC 0%, #D6F5EC 45%, #DCCBFF 100%);
  --ground: #F7F1FA;
  --raised: #FFFFFF;
  --ink: #161230;
  --ink-2: #5C5778;
  --rule: rgba(22, 18, 48, 0.13);
  --accent: #07705F;
  --on-accent: #FFFFFF;
  --hedge: #A34A08;
  --danger: #B8254F;
  --violet: #6930EA;
  --display: "Marcellus", Georgia, serif;
  --text: "Inter", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-base: linear-gradient(135deg, #2B2A33 0%, #1C2238 45%, #0F2C2C 100%);
    --ground: #1C2238;
    --raised: #22403F;
    --ink: #E8ECF8;
    --ink-2: #A7AFCB;
    --rule: rgba(220, 230, 255, 0.12);
    --accent: #5FD9BE;
    --on-accent: #04110E;
    --hedge: #FFBE7A;
    --danger: #FF8A9A;
    --violet: #C9A6FF;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg-base: linear-gradient(135deg, #2B2A33 0%, #1C2238 45%, #0F2C2C 100%);
  --ground: #1C2238;
  --raised: #22403F;
  --ink: #E8ECF8;
  --ink-2: #A7AFCB;
  --rule: rgba(220, 230, 255, 0.12);
  --accent: #5FD9BE;
  --on-accent: #04110E;
  --hedge: #FFBE7A;
  --danger: #FF8A9A;
  --violet: #C9A6FF;
  color-scheme: dark;
}

/* Reset & Baseline */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--bg-base);
  background-attachment: fixed;
  transition: background 500ms ease;
  scroll-behavior: smooth;
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  background: var(--bg-base) fixed;
  background-color: var(--ground);
  color: var(--ink);
  font-family: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  transition: color 500ms ease, background 500ms ease;
}

/* Typography & Numerics */
h1, h2, h3, .display-font {
  font-family: var(--display);
  font-weight: 400;
  text-wrap: balance;
  letter-spacing: -0.01em;
}

.font-mono, .metric-value, .stat-val, .clob-row, .terminal-body {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Semantic Token Text Colors */
.text-accent { color: var(--accent); }
.text-hedge { color: var(--hedge); }
.text-danger { color: var(--danger); }
.text-violet { color: var(--violet); }
.text-muted { color: var(--ink-2); }

/* Header Navigation Bar */
.app-header {
  height: 52px;
  background: color-mix(in srgb, var(--raised) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--rule);
  padding: 0 clamp(10px, 2vw, 20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 2100;
  flex-wrap: nowrap;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-shrink: 0;
}

.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-width: 0;
  position: relative;
  z-index: 20;
}

.view-mode-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.mode-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 150ms ease;
}

.mode-pill-btn:hover {
  color: var(--ink);
}

.mode-pill-btn.active {
  background: var(--raised);
  color: var(--ink);
  border-color: var(--rule);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.mode-pill-svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  stroke: currentColor;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}

.brand-logo-svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 9px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.1em;
}

.header-separator {
  width: 1px;
  height: 20px;
  background: var(--rule);
}

.network-badge, .latency-badge, .session-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--ground);
  font-size: 11px;
  color: var(--ink-2);
  white-space: nowrap;
}

.network-badge strong, .latency-badge strong, .session-badge strong {
  color: var(--ink);
  font-weight: 600;
}

.network-badge.interactive {
  cursor: pointer;
  transition: all 0.15s ease;
}

.network-badge.interactive:hover {
  border-color: var(--accent);
  background: var(--raised);
}

.network-badge.wrong-network {
  border-color: var(--hedge);
  background: rgba(245, 158, 11, 0.12);
  color: var(--hedge);
}

.network-badge.wrong-network strong {
  color: var(--hedge);
}

.network-badge.wrong-network .pulse-indicator {
  background: var(--hedge);
  box-shadow: 0 0 6px var(--hedge);
}

.pulse-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Wrong Network Top Alert Banner */
.wrong-network-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(245, 158, 11, 0.12);
  border-bottom: 1px solid var(--hedge);
  padding: 10px 24px;
  font-size: 13px;
  color: var(--ink);
  position: relative;
  z-index: 100;
}

.wrong-network-content {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.wrong-network-content svg {
  color: var(--hedge);
  flex-shrink: 0;
}

.btn-switch-network {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--hedge);
  color: var(--ground);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-switch-network:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.btn-switch-network:active {
  transform: translateY(0);
}

.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--ground);
  color: var(--ink);
  cursor: pointer;
  transition: all 150ms ease;
  flex-shrink: 0;
}

.btn-theme-toggle:hover {
  background: var(--raised);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-theme-toggle .theme-icon-svg {
  width: 17px;
  height: 17px;
  display: block;
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-theme-toggle:active .theme-icon-svg {
  transform: rotate(180deg);
}

.btn-tour-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--ground);
  color: var(--ink);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}

.btn-tour-toggle:hover {
  background: var(--raised);
  border-color: var(--accent);
  color: var(--accent);
}

.wallet-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 150ms ease, transform 150ms ease;
}

.wallet-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.wallet-btn.connected {
  background: var(--ground);
  border-color: var(--rule);
  color: var(--ink);
}

.wallet-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* App Container */
.app-container {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px clamp(10px, 2vw, 22px) 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Card Surfaces (Compact & Sleek) */
.card {
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 12px 16px;
  min-width: 0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
  min-width: 0;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 18px;
  color: var(--ink);
}

.header-extra {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-2);
}

/* Progressive Horizontal Metrics Ticker (Seamless Infinite Loop matching Landing Page Marquee) */
.hero-metrics-ticker {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-bottom: 2px;
}

.hero-metrics-viewport {
  overflow: hidden;
  width: 100%;
  mask-image: linear-gradient(90deg, transparent 0%, #000 2%, #000 98%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 2%, #000 98%, transparent 100%);
  padding: 4px 0 6px;
}

.hero-metrics-track {
  --metric-gap: 12px;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--metric-gap);
  width: max-content;
  will-change: transform;
  animation: metricsTicker 38s linear infinite;
  padding-right: var(--metric-gap);
}

.hero-metrics-viewport:hover .hero-metrics-track {
  animation-play-state: paused;
}

@keyframes metricsTicker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* Reduced, Sleek, Compact Metric Cards */
.metric-card {
  width: 175px;
  min-width: 175px;
  flex: 0 0 175px;
  background: color-mix(in srgb, var(--raised) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--rule);
  border-radius: 11px;
  padding: 8px 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.metric-label {
  font-size: 9.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 2px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.metric-unit {
  font-size: 9.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.metric-sub {
  font-size: 9.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
}

.pill-accent { background: var(--ground); color: var(--accent); border-color: var(--accent); }
.pill-hedge { background: var(--ground); color: var(--hedge); border-color: var(--hedge); }
.pill-danger { background: var(--ground); color: var(--danger); border-color: var(--danger); }
.pill-muted { background: var(--ground); color: var(--ink-2); border-color: var(--rule); }
.pill-violet { background: var(--ground); color: var(--violet); border-color: var(--violet); }

/* Simulation Bar */
.simulation-bar {
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sim-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sim-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  margin-right: 2px;
}

.sim-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--ground);
  color: var(--ink);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
}

.sim-btn:hover {
  background: var(--raised);
  border-color: var(--ink-2);
}

.sim-btn.btn-danger {
  color: var(--danger);
  border-color: var(--danger);
}
.sim-btn.btn-danger:hover {
  background: var(--danger);
  color: var(--on-accent);
}

.sim-btn.btn-hedge {
  color: var(--hedge);
  border-color: var(--hedge);
}
.sim-btn.btn-hedge:hover {
  background: var(--hedge);
  color: var(--on-accent);
}

.sim-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--rule);
  border-radius: 999px;
  transition: 200ms ease;
}

.slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--raised);
  border-radius: 50%;
  transition: 200ms ease;
}

.toggle-switch input:checked + .slider {
  background-color: var(--accent);
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(16px);
}

.toggle-label {
  font-size: 12px;
  color: var(--ink-2);
}

/* Core Workspace 12-Column Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.2fr);
  gap: 16px;
}

.workspace-main, .workspace-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Position Stats Grid (Compact) */
.position-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.stat-box {
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 8px 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-name {
  font-size: 10.5px;
  color: var(--ink-2);
}

.stat-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.stat-sub {
  font-size: 10px;
  color: var(--ink-2);
}

/* Dynamic SVG Health Factor Gauge */
.health-gauge-section {
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  flex-wrap: wrap;
  gap: 6px;
}

.gauge-svg-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}

.gauge-svg {
  width: 100%;
  max-width: 210px;
  height: auto;
  overflow: visible;
}

/* Linear Gauge Buffer Bar */
.gauge-track {
  height: 8px;
  background: var(--rule);
  border-radius: 999px;
  position: relative;
  display: flex;
  overflow: visible;
  margin-top: 10px;
}

.gauge-zone {
  height: 100%;
}

.zone-danger { background: var(--danger); border-radius: 999px 0 0 999px; }
.zone-warning { background: var(--hedge); }
.zone-safe { background: var(--accent); border-radius: 0 999px 999px 0; }

.gauge-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: left 300ms cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.marker-pin {
  width: 14px;
  height: 14px;
  background: var(--ink);
  border: 2px solid var(--raised);
  border-radius: 50%;
}

.marker-label {
  position: absolute;
  top: 18px;
  background: var(--ink);
  color: var(--raised);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 24px;
}

/* Active Hedge Box */
.active-hedge-box {
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 10px 14px;
}

.hedge-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}

.hedge-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}

.hedge-status-badge .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.active-hedge-box.hedged .status-dot {
  background: var(--hedge);
}

.hedge-meta {
  font-size: 12px;
  color: var(--ink-2);
}

.hedge-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr));
  gap: 12px;
}

.hedge-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hedge-item .lbl {
  font-size: 11px;
  color: var(--ink-2);
}

.hedge-item .val {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

/* TradingView Pro Execution Chart */
.tv-chart-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 0;
}

.tv-header-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.tv-symbol-selector {
  display: flex;
  align-items: center;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.tv-symbol-btn {
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--text);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tv-symbol-btn:hover {
  color: var(--ink);
}

.tv-symbol-btn.active {
  background: var(--raised);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tv-header-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.tv-intervals {
  display: flex;
  align-items: center;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.tv-interval-btn {
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 3px 8px;
  font-family: var(--text);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tv-interval-btn:hover {
  color: var(--ink);
}

.tv-interval-btn.active {
  background: var(--raised);
  color: var(--ink);
  font-weight: 700;
}

.tv-sentinel-legend {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-pill {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid var(--rule);
}

.legend-pill.pill-danger {
  background: rgba(184, 37, 79, 0.1);
  color: var(--danger);
  border-color: rgba(184, 37, 79, 0.3);
}

.legend-pill.pill-hedge {
  background: rgba(163, 74, 8, 0.1);
  color: var(--hedge);
  border-color: rgba(163, 74, 8, 0.3);
}

.tv-chart-wrapper {
  position: relative;
  width: 100%;
  height: 480px;
  min-height: 440px;
  border-radius: 12px;
  border: 1px solid var(--rule);
  background: var(--ground);
  overflow: hidden;
}

.tv-widget-embed {
  width: 100%;
  height: 100%;
}

.tv-widget-embed iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
}

/* Floating AEGIS Watermark Logo */
.aegis-chart-watermark {
  position: absolute;
  top: 14px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 5;
  opacity: 0.35;
  background: var(--raised);
  border: 1px solid var(--rule);
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.watermark-logo-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.watermark-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.watermark-title {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.watermark-sub {
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
}

@media (max-width: 768px) {
  .tv-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .tv-chart-wrapper {
    height: 380px;
  }
}

/* HyperCore CLOB Orderbook */
.orderbook-card .card-header {
  margin-bottom: 12px;
}

.orderbook-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clob-table {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.clob-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  position: relative;
  overflow: hidden;
}

.clob-head {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
}

.clob-asks .clob-row:not(.clob-head) {
  color: var(--danger);
}

.clob-bids .clob-row:not(.clob-head) {
  color: var(--accent);
}

.depth-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  opacity: 0.12;
  pointer-events: none;
}

.clob-asks .depth-bar { background: var(--danger); }
.clob-bids .depth-bar { background: var(--accent); }

.clob-mid-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 8px;
  margin: 4px 0;
}

.mid-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.mid-source {
  font-size: 11px;
  color: var(--ink-2);
}

/* Pro Configuration Form Controls */
.config-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
}

.form-select {
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--ground);
  color: var(--ink);
  padding: 0 10px;
  font-family: inherit;
  font-size: 11.5px;
  outline: none;
}

.form-range {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.range-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-2);
}

.radio-pill-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.radio-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--ground);
  font-size: 11px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 150ms ease;
}

.radio-pill input {
  accent-color: var(--accent);
}

.radio-pill:has(input:checked) {
  border-color: var(--accent);
  background: var(--raised);
}

.btn-primary {
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-killswitch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--danger);
  background: var(--ground);
  color: var(--danger);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.btn-killswitch:hover {
  background: var(--danger);
  color: var(--on-accent);
}

/* Token Flywheel Card */
.token-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.token-metric-item {
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.t-lbl {
  font-size: 12px;
  color: var(--ink-2);
}

.t-val {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.t-sub {
  font-size: 11px;
  color: var(--ink-2);
}

.progress-bar {
  height: 6px;
  background: var(--rule);
  border-radius: 999px;
  margin-top: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--violet);
  border-radius: 999px;
}

/* Real-Time Terminal Audit Log */
.audit-card {
  padding: 20px 24px;
}

.terminal-body {
  height: 180px;
  overflow-y: auto;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink);
  display: flex;
  flex-direction: column-reverse;
}

.log-entry {
  display: flex;
  gap: 12px;
  word-break: break-all;
}

.log-time {
  color: var(--ink-2);
  flex-shrink: 0;
}

.log-tag {
  font-weight: 600;
  flex-shrink: 0;
}

.log-tag.accent { color: var(--accent); }
.log-tag.hedge { color: var(--hedge); }
.log-tag.danger { color: var(--danger); }
.log-tag.violet { color: var(--violet); }

/* Notification Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  font-size: 13px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 200ms ease;
  max-width: 360px;
}

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

/* Responsive Media Queries (Zero horizontal overflow at 390px) */
@media (max-width: 1024px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-header {
    height: 46px;
    padding: 0 10px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 0;
  }
  .brand-badge {
    gap: 6px;
    min-width: 0;
    flex-shrink: 0;
  }
  .brand-logo-svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }
  .brand-title {
    font-size: 16px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .header-separator, .latency-badge, .session-badge, .beta-badge, .btn-settings-toggle, .brand-sub, .network-badge {
    display: none !important;
  }
  .header-center {
    display: none !important;
  }
  .btn-tour-toggle {
    display: none !important;
  }
  .header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .faucet-pill-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    height: 26px;
    padding: 0 8px;
    font-size: 10.5px;
    font-weight: 600;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 12%, var(--ground));
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap !important;
    flex-shrink: 0;
    transition: all 150ms ease;
  }
  .faucet-pill-btn:hover {
    background: var(--accent);
    color: var(--on-accent);
  }
  .btn-theme-toggle {
    width: 26px;
    height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 999px;
  }
  .btn-theme-toggle .theme-icon-svg {
    width: 14px;
    height: 14px;
  }
  .wallet-btn {
    height: 26px;
    padding: 0 8px;
    font-size: 10.5px;
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .app-drawer-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    flex-shrink: 0;
  }
  .app-container {
    padding: 8px 10px 24px;
    gap: 8px;
  }
  .workspace-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .workspace-main, .workspace-sidebar {
    gap: 8px;
  }
  .card {
    padding: 9px 11px;
    border-radius: 12px;
  }
  .card-header {
    margin-bottom: 6px;
  }
  .header-title {
    font-size: 14.5px;
    gap: 6px;
  }
  .header-title svg {
    width: 14px;
    height: 14px;
  }
  .header-extra {
    font-size: 10px;
    gap: 6px;
  }
  .status-pill {
    font-size: 9.5px;
    padding: 1px 6px;
  }
  .hero-metrics-ticker {
    margin-bottom: 0;
  }
  .hero-metrics-track {
    --metric-gap: 8px;
  }
  .metric-card {
    width: 135px;
    min-width: 135px;
    flex: 0 0 135px;
    padding: 5px 8px;
    border-radius: 9px;
  }
  .metric-label {
    font-size: 8px;
    margin-bottom: 1px;
  }
  .metric-value {
    font-size: 12px;
    margin-bottom: 1px;
  }
  .metric-unit, .metric-sub {
    font-size: 8px;
  }
  .simulation-bar {
    padding: 6px 8px;
    gap: 6px;
    border-radius: 10px;
  }
  .sim-title {
    font-size: 10.5px;
    gap: 4px;
  }
  .sim-left {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .sim-btn {
    width: 100%;
    text-align: center;
    height: 24px;
    font-size: 10px;
    border-radius: 5px;
  }
  .sim-right {
    gap: 6px;
  }
  .toggle-switch {
    width: 30px;
    height: 17px;
  }
  .slider::before {
    width: 11px;
    height: 11px;
    left: 3px;
    bottom: 3px;
  }
  .toggle-switch input:checked + .slider::before {
    transform: translateX(13px);
  }
  .toggle-label {
    font-size: 10px;
  }
  .position-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 8px;
  }
  .stat-box {
    padding: 6px 8px;
    border-radius: 8px;
    gap: 1px;
  }
  .stat-name {
    font-size: 9.5px;
  }
  .stat-val {
    font-size: 12px;
    font-weight: 700;
  }
  .gauge-svg {
    max-width: 135px;
    height: auto;
    margin: 0 auto;
    display: block;
  }
  .control-row {
    padding: 5px 0;
    gap: 6px;
  }
  .control-label {
    font-size: 10.5px;
  }
  .control-val {
    font-size: 10.5px;
  }
  .primary-btn, .btn-hedge-action {
    height: 34px;
    font-size: 11.5px;
    border-radius: 8px;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 0 8px;
    gap: 4px;
  }
  .brand-title {
    font-size: 15px;
  }
  .wallet-btn {
    height: 25px;
    padding: 0 7px;
    font-size: 10px;
    max-width: 100px;
  }
  .faucet-pill-btn {
    height: 25px;
    padding: 0 6px;
    font-size: 10px;
  }
}

/* Session Key Delegation Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal-card {
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

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

.modal-header-row h3 {
  font-family: var(--display);
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 0;
}

.modal-close-icon {
  background: transparent;
  border: none;
  color: var(--ink-2);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-desc {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}

.modal-input {
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink);
  outline: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* ==========================================================================
   VIEW MODE SWITCHING & LITE AUTO-PILOT INTERFACE
   ========================================================================== */

/* View Mode Visibility Rules */
body.mode-pro .lite-only,
body:not(.mode-lite) .lite-only {
  display: none !important;
}

body.mode-pro .pro-only,
body:not(.mode-lite) .pro-only {
  display: block;
}

body.mode-lite .pro-only {
  display: none !important;
}

body.mode-lite .lite-only {
  display: flex !important;
}

body.mode-lite .lite-card {
  display: flex !important;
  flex-direction: column;
}

body.mode-lite .lite-telemetry-card {
  display: flex !important;
  flex-direction: column;
}

/* --- Lite Auto-Pilot Card --- */
.lite-card {
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.lite-card-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  margin-top: -8px;
}

.header-icon-svg {
  flex-shrink: 0;
  stroke: var(--accent);
}

.lite-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.lite-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  flex-wrap: wrap;
}

.lite-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ground);
  border: 1px solid var(--rule);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.lite-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.lite-faucet-note {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-2);
}

/* Micro-amount testnet deposit chips */
.micro-amount-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.micro-chip-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--rule);
  background: var(--ground);
  color: var(--ink);
  cursor: pointer;
  transition: all 150ms ease;
  min-width: 0;
  font-family: inherit;
}

.micro-chip-btn:hover {
  background: var(--raised);
  border-color: var(--ink-2);
}

.micro-chip-btn.active {
  background: var(--raised);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.micro-chip-btn .chip-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.micro-chip-btn.active .chip-val {
  color: var(--accent);
}

.micro-chip-btn .chip-usd {
  font-size: 11px;
  color: var(--ink-2);
  white-space: nowrap;
}

/* Strategy Preset Cards */
.presets-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.preset-card {
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 180ms ease;
  user-select: none;
  min-width: 0;
}

.preset-card:hover {
  background: var(--raised);
  border-color: var(--ink-2);
}

.preset-card.active {
  background: var(--raised);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.preset-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preset-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-name {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.preset-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
}

.preset-radio-indicator {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  position: relative;
  flex-shrink: 0;
  transition: all 150ms ease;
}

.preset-card.active .preset-radio-indicator {
  border-color: var(--accent);
  background: var(--accent);
}

.preset-card.active .preset-radio-indicator::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--on-accent);
}

.preset-specs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px;
  background: var(--ground);
  border-radius: 8px;
  border: 1px solid var(--rule);
  font-size: 11px;
}

.preset-card.active .preset-specs-grid {
  background: var(--ground);
}

.preset-spec {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.preset-spec .spec-k {
  color: var(--ink-2);
  font-size: 10.5px;
}

.preset-spec .spec-v {
  font-weight: 600;
  color: var(--ink);
}

.preset-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-2);
  margin: 0;
}

/* Lite Telemetry Readout Box */
.lite-summary-box {
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  min-width: 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-row .s-k {
  color: var(--ink-2);
}

.summary-row .s-v {
  font-weight: 600;
  color: var(--ink);
}

/* Lite Action Button Area */
.lite-action-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.lite-activate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  width: 100%;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: all 180ms ease;
}

.lite-activate-btn.armed {
  background: var(--ground);
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-icon-svg {
  flex-shrink: 0;
  stroke: currentColor;
}

.lite-guarantee-note {
  font-size: 11px;
  line-height: 1.4;
  color: var(--ink-2);
  text-align: center;
}

/* Lite Telemetry Safeguards Card in Main Column */
.lite-telemetry-card {
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 24px;
  gap: 16px;
  min-width: 0;
}

.lite-telemetry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.lite-feature-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
}

.feat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--raised);
  border: 1px solid var(--rule);
  color: var(--accent);
  flex-shrink: 0;
}

.feat-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.feat-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.feat-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
}

.feat-desc code {
  font-family: inherit;
  font-size: 11px;
  background: var(--raised);
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid var(--rule);
}

@media (max-width: 768px) {
  .micro-amount-chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .preset-specs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    font-size: 10.5px;
  }
  .lite-card {
    padding: 18px 16px;
  }
}

/* ==========================================================================
   AEGIS Terminal Navigation & Session Drawer (Top-Left Hamburger Menu)
   ========================================================================== */
.app-drawer-btn {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.app-drawer-btn:hover {
  border-color: var(--accent);
  background: var(--raised);
}

.app-drawer-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.app-drawer-btn[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.app-drawer-btn[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.app-drawer-btn[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.app-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(340px, 88vw);
  background: var(--raised);
  border-right: 1px solid var(--rule);
  z-index: 2501;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
}

.app-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-logo-svg {
  width: 26px;
  height: 26px;
}

.drawer-title {
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.drawer-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--ink-2);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.drawer-close-btn:hover {
  color: var(--ink);
}

/* Slim One-Line Drawer Feature Cards */
.drawer-nav-slim {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-card-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--ink);
  font-family: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
  width: 100%;
  box-sizing: border-box;
}

.drawer-card-item:hover {
  background: var(--raised);
  border-color: var(--accent);
  transform: translateX(2px);
}

.drawer-card-item.active {
  background: var(--raised);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.drawer-card-item .d-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--ink-2);
  transition: color 150ms ease;
}

.drawer-card-item:hover .d-icon,
.drawer-card-item.active .d-icon {
  color: var(--accent);
}

.drawer-card-item .d-title {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-card-item .d-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ground);
  color: var(--ink-2);
  border: 1px solid var(--rule);
}

.drawer-card-item .d-badge.pill-accent {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.drawer-card-item .d-arrow {
  color: var(--ink-2);
  font-size: 13px;
}

.drawer-divider-slim {
  height: 1px;
  background: var(--rule);
  margin: 4px 0;
}

.drawer-status-footer {
  padding: 10px 12px;
  background: color-mix(in srgb, var(--ground) 60%, transparent);
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.status-footer-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Terminal View Settings Modal & Backdrop
   ========================================================================== */
.btn-settings-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--ground);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.btn-settings-toggle:hover {
  background: var(--raised);
  border-color: var(--ink-2);
}

.settings-backdrop, .wallet-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.settings-backdrop.active, .wallet-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.settings-modal, .wallet-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(460px, 92vw);
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 22px;
  z-index: 3001;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-modal.active, .wallet-modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.settings-modal-header, .wallet-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.settings-modal-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.settings-modal-title-row h3 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
}

.settings-close-btn, .wallet-modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--ink-2);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.settings-close-btn:hover, .wallet-modal-close-btn:hover {
  color: var(--ink);
}

.settings-modal-sub {
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 16px;
}

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

.settings-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.settings-toggle-item:hover {
  border-color: var(--ink-2);
}

.settings-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.settings-toggle-text strong {
  font-size: 12.5px;
  color: var(--ink);
}

.settings-toggle-text small {
  font-size: 11px;
  color: var(--ink-2);
}

.settings-toggle-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.settings-modal-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: flex-end;
}

.settings-reset-btn {
  font-size: 12px;
  color: var(--ink-2);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 150ms ease;
}

.settings-reset-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ==========================================================================
   AEGIS Multi-Wallet Selection Modal & WalletConnect (Official SDK)
   Compliant with AEGIS Brand Kit (tokens.css) & AGENTS.md
   ========================================================================== */
.wallet-select-modal {
  width: min(520px, calc(100vw - 32px));
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

.wallet-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Modal Alert Banner (Loading / Step / Error) */
.wallet-modal-alert {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

.wallet-modal-alert.is-loading {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--ground));
}

.wallet-modal-alert.is-info {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--ground));
}

.wallet-modal-alert.is-error {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--ground));
}

.wallet-alert-content {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.wallet-alert-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.wallet-modal-alert.is-error .wallet-alert-icon {
  color: var(--danger);
}

.wallet-alert-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--rule);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: walletSpin 0.75s linear infinite;
}

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

.wallet-alert-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wallet-alert-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.wallet-alert-desc {
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.35;
  word-break: break-word;
}

.wallet-alert-cancel-btn {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--text);
  color: var(--ink-2);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.wallet-alert-cancel-btn:hover {
  background: var(--raised);
  color: var(--ink);
  border-color: var(--ink-2);
}

.wallet-alert-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.wallet-alert-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-family: var(--text);
  font-weight: 600;
  text-decoration: none;
  background: var(--raised);
  border: 1px solid var(--rule);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.wallet-alert-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.wallet-alert-btn.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.wallet-alert-btn.primary:hover {
  filter: brightness(1.08);
  color: var(--on-accent);
}

/* Featured WalletConnect Hero Card */
.wallet-featured-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 14px;
  cursor: pointer;
  color: var(--ink);
  text-align: left;
  transition: all 150ms ease;
  width: 100%;
}

.wallet-featured-card:hover {
  background: var(--raised);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.wallet-featured-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, #3B99FC 12%, var(--raised));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wallet-featured-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wallet-featured-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.wallet-featured-desc {
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.35;
}

.wallet-option-arrow {
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}

.wallet-featured-card:hover .wallet-option-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

/* Grid of Individual Wallets */
.wallet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

@media (max-width: 480px) {
  .wallet-select-modal,
  .settings-modal {
    width: min(520px, calc(100vw - 32px));
    padding: 16px 14px 20px 14px;
    max-height: 85vh;
  }

  .settings-close-btn,
  .wallet-modal-close-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .wallet-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .wallet-grid-item {
    padding: 11px 12px;
  }

  .wallet-featured-card {
    padding: 12px 14px;
  }

  .wallet-select-footer {
    padding-bottom: env(safe-area-inset-bottom, 12px);
  }
}

.wallet-grid-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  cursor: pointer;
  color: var(--ink);
  text-align: left;
  transition: all 150ms ease;
  width: 100%;
  min-width: 0;
}

.wallet-grid-item:hover {
  background: var(--raised);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.wallet-grid-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.wallet-grid-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.wallet-grid-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.wallet-grid-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.wallet-grid-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-grid-sub {
  font-size: 10.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-badge {
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink-2);
  border: 1px solid var(--rule);
  flex-shrink: 0;
}

.wallet-badge.detected {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  border-color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.wallet-injected-fallback-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px dashed var(--rule);
  border-radius: 10px;
  font-size: 11px;
  font-family: var(--text);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 150ms ease;
}

.wallet-injected-fallback-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
  background: var(--ground);
}

.wallet-select-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wallet-footer-security {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.35;
}

.wallet-footer-net {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--ink-2);
}

/* ==========================================================================
   Dedicated Pro Trading Terminal & Markets View (#tradingTerminalView)
   ========================================================================== */
#tradingTerminalView {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.tt-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 12px 18px;
  flex-wrap: wrap;
  gap: 14px;
}

.tt-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.tt-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ground);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tt-back-btn:hover {
  background: var(--raised);
  border-color: var(--accent);
  color: var(--accent);
}

.tt-separator {
  width: 1px;
  height: 24px;
  background: var(--rule);
}

.tt-coin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tt-coin-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ground);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tt-coin-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.tt-coin-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tt-coin-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tt-coin-pair {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.tt-coin-fullname {
  font-size: 11px;
  color: var(--ink-2);
}

.tt-topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.tt-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tt-stat-lbl {
  font-size: 10px;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tt-stat-val {
  font-size: 13.5px;
  font-weight: 600;
}

/* Workspace Grid (Sidebar + Chart) */
.tt-workspace-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: start;
}

.tt-market-sidebar {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.market-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.market-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.market-count-pill {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--ground);
  color: var(--ink-2);
  border: 1px solid var(--rule);
}

.market-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.market-search-wrap .search-icon {
  position: absolute;
  left: 10px;
  color: var(--ink-2);
  pointer-events: none;
}

.market-search-input {
  width: 100%;
  height: 34px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0 10px 0 32px;
  font-family: var(--text);
  font-size: 11.5px;
  color: var(--ink);
  transition: border-color 0.15s ease;
}

.market-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.market-cat-tabs {
  display: flex;
  align-items: center;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  overflow-x: auto;
}

.market-cat-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 3px 8px;
  font-family: var(--text);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.market-cat-btn:hover {
  color: var(--ink);
}

.market-cat-btn.active {
  background: var(--raised);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.markets-scroll-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 2px;
}

.market-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  width: 100%;
  text-align: left;
  font-family: var(--text);
  gap: 8px;
}

.market-row-item:hover {
  background: var(--ground);
}

.market-row-item.active {
  background: var(--ground);
  border-color: var(--accent);
}

.market-row-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.market-token-logo-wrap {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ground);
  border: 1px solid var(--rule);
  overflow: hidden;
}

.market-token-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.market-token-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  background: var(--ground);
  text-transform: uppercase;
}

.market-row-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.market-row-symbol-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.market-row-symbol {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.market-row-lev {
  font-size: 9px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0 4px;
  line-height: 1.3;
}

.market-row-name {
  font-size: 10px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.market-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}

.market-row-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.market-row-change {
  font-size: 10px;
  font-weight: 600;
}

.market-row-change.pos {
  color: var(--accent);
}

.market-row-change.neg {
  color: var(--danger);
}

.custom-ticker-box {
  border-top: 1px solid var(--rule);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.custom-ticker-lbl {
  font-size: 10px;
  color: var(--ink-2);
  text-transform: uppercase;
}

.custom-ticker-input-row {
  display: flex;
  gap: 6px;
}

.custom-ticker-input {
  flex: 1;
  height: 30px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 11px;
  color: var(--ink);
}

.custom-ticker-btn {
  height: 30px;
  padding: 0 10px;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 6px;
  font-family: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

/* TradingView & HyperCore Chart Main Container in TT */
.tt-chart-main {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tt-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.tt-chart-toolbar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.tt-engine-pills {
  display: inline-flex;
  align-items: center;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.tt-engine-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}

.tt-engine-btn:hover {
  color: var(--ink);
}

.tt-engine-btn.active {
  background: var(--raised);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tt-ohlc-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--ink-2);
  flex-wrap: wrap;
}

.tt-ohlc-bar strong {
  color: var(--ink);
  font-weight: 600;
}

.tt-intervals {
  display: flex;
  align-items: center;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.tt-interval-btn {
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 3px 8px;
  font-family: var(--text);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tt-interval-btn:hover {
  color: var(--ink);
}

.tt-interval-btn.active {
  background: var(--raised);
  color: var(--ink);
  font-weight: 700;
}

.tt-hypercore-canvas-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#hypercore_canvas_chart {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28, 34, 56, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  z-index: 10;
}

.chart-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--rule);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.tt-chart-container {
  position: relative;
  width: 100%;
  height: 580px;
  min-height: 520px;
  border-radius: 12px;
  border: 1px solid var(--rule);
  background: var(--ground);
  overflow: hidden;
}

.tt-tv-embed {
  width: 100%;
  height: 100%;
}

.tt-tv-embed iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
}

@media (max-width: 960px) {
  .tt-workspace-grid {
    grid-template-columns: 1fr;
  }
  .tt-chart-container {
    height: 420px;
  }
}

/* ==========================================================================
   WALLET ACCOUNT MODAL & REAL-TIME BALANCES
   ========================================================================== */
.wallet-account-card {
  max-width: 540px;
}

.wallet-address-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 10px 14px;
}

.wallet-address-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.wallet-avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.wallet-address-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wallet-full-addr {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-network-label {
  font-size: 11px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 5px;
}

.wallet-address-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.wallet-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--raised);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
}

.wallet-action-btn:hover {
  background: var(--ground);
  border-color: var(--accent);
  color: var(--accent);
}

.wallet-balances-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wallet-bal-card {
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.wallet-bal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.wallet-token-name {
  font-size: 11.5px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.token-badge-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  background: var(--raised);
  border: 1px solid var(--rule);
  color: var(--accent);
}

.wallet-bal-val {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.wallet-bal-sub {
  font-size: 11px;
  color: var(--ink-2);
}

.wallet-vault-card {
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallet-vault-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-2);
}

.wallet-vault-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
}

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: inherit;
}

.btn-danger-outline:hover {
  background: var(--danger);
  color: #FFFFFF;
}

/* Flash tick animations */
@keyframes priceFlashGreen {
  0% { background-color: rgba(7, 112, 95, 0.28); color: var(--accent); }
  100% { background-color: transparent; }
}

@keyframes priceFlashRed {
  0% { background-color: rgba(184, 37, 79, 0.28); color: var(--danger); }
  100% { background-color: transparent; }
}

.price-flash-up {
  animation: priceFlashGreen 900ms ease-out;
}

.price-flash-down {
  animation: priceFlashRed 900ms ease-out;
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(7, 112, 95, 0.5);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(7, 112, 95, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(7, 112, 95, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(7, 112, 95, 0);
  }
}

.faucet-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ground);
  border: 1px solid var(--rule);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: inherit;
  white-space: nowrap !important;
  flex-shrink: 0;
  line-height: 1;
}

.faucet-pill-btn:hover {
  background: var(--raised);
  border-color: var(--accent);
}

/* Responsive Header Utilities */
.hide-compact {
  display: inline-flex;
}
.hide-laptop {
  display: inline-flex;
}

@media (max-width: 1350px) {
  .hide-compact { display: none !important; }
}

@media (max-width: 1180px) {
  .hide-laptop { display: none !important; }
}

/* Wallet Selection Modal Options (Official WalletConnect & Injected) */
.wallet-select-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 12px 0;
}

.wallet-option-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--ink);
  font-family: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 150ms ease;
  width: 100%;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.wallet-option-card:hover {
  background: var(--raised);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.wallet-option-card:active {
  background: var(--raised);
  border-color: var(--accent);
  transform: scale(0.985);
}

.wallet-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--raised);
  border: 1px solid var(--rule);
  flex-shrink: 0;
  color: var(--ink);
}

.wallet-option-icon.wc-icon {
  background: rgba(59, 153, 252, 0.1);
  border-color: rgba(59, 153, 252, 0.25);
}

.wallet-option-details {
  flex: 1;
  min-width: 0;
}

.wallet-option-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.wallet-option-desc {
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 2px;
  line-height: 1.3;
}

.wallet-option-arrow {
  color: var(--ink-2);
  font-size: 14px;
  transition: transform 150ms ease, color 150ms ease;
}

.wallet-option-card:hover .wallet-option-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

.wallet-select-footer {
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.4;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
  text-align: center;
}

/* ==========================================================================
   AEGIS Terminal — Interactive Spotlight Onboarding Tour (Brand Kit Compliant)
   Typography: Marcellus (--display) & Inter (--text)
   Theme: Supports Light (:root) and Dark ([data-theme="dark"]) tokens
   Radius: 16px flat radius, 1px --rule borders, --raised fill
   ========================================================================== */

.aegis-tour-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 250ms ease;
}

.aegis-tour-container.active {
  display: block !important;
  opacity: 1;
  pointer-events: auto;
}

.aegis-tour-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2001;
  pointer-events: auto;
}

.aegis-tour-mask-fill {
  fill: rgba(22, 18, 48, 0.72);
  transition: fill 200ms ease;
}

[data-theme="dark"] .aegis-tour-mask-fill {
  fill: rgba(4, 17, 14, 0.86);
}

#aegisTourMaskHole {
  transition: x 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
              y 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
              width 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
              height 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.aegis-tour-highlight-ring {
  position: fixed;
  border: 2px solid var(--accent);
  border-radius: 16px;
  box-shadow: 0 0 0 4px rgba(7, 112, 95, 0.20), 0 0 24px rgba(7, 112, 95, 0.35);
  pointer-events: none;
  z-index: 2002;
  transition: top 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
              left 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
              width 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
              height 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 200ms ease;
}

[data-theme="dark"] .aegis-tour-highlight-ring {
  box-shadow: 0 0 0 4px rgba(95, 217, 190, 0.25), 0 0 30px rgba(95, 217, 190, 0.45);
}

.aegis-tour-popover {
  position: fixed;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(22, 18, 48, 0.16);
  padding: 20px;
  z-index: 2005;
  color: var(--ink);
  font-family: var(--text);
  box-sizing: border-box;
  pointer-events: auto;
  transition: top 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
              left 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 200ms ease;
}

[data-theme="dark"] .aegis-tour-popover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.70);
}

.aegis-tour-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.aegis-tour-badge-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.aegis-tour-step-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--accent);
  background: rgba(7, 112, 95, 0.12);
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--text);
}

[data-theme="dark"] .aegis-tour-step-badge {
  background: rgba(95, 217, 190, 0.16);
}

.aegis-tour-pulsing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: aegisTourPulse 1.6s infinite ease-in-out;
}

@keyframes aegisTourPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.aegis-tour-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--ground);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 150ms ease;
}

.aegis-tour-close-btn:hover {
  background: var(--raised);
  color: var(--ink);
  border-color: var(--ink-2);
}

.aegis-tour-body {
  margin-bottom: 16px;
}

.aegis-tour-title {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 8px 0;
  text-wrap: balance;
}

.aegis-tour-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}

.aegis-tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  gap: 12px;
}

.aegis-tour-skip-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--text);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 150ms ease;
}

.aegis-tour-skip-btn:hover {
  color: var(--ink);
  text-decoration: underline;
}

.aegis-tour-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.aegis-tour-dots .tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rule);
  transition: all 200ms ease;
}

.aegis-tour-dots .tour-dot.active {
  background: var(--accent);
  width: 14px;
  border-radius: 999px;
}

.aegis-tour-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.aegis-tour-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 150ms ease;
}

.btn-tour-back {
  background: var(--ground);
  border: 1px solid var(--rule);
  color: var(--ink);
}

.btn-tour-back:hover {
  background: var(--raised);
  border-color: var(--ink-2);
}

.btn-tour-next {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--on-accent);
}

.btn-tour-next:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-tour-next:active {
  transform: translateY(0);
}

@media (max-width: 480px) {
  .aegis-tour-popover {
    width: calc(100vw - 32px);
    left: 16px !important;
    padding: 16px;
  }
  .aegis-tour-title {
    font-size: 17px;
  }
  .aegis-tour-desc {
    font-size: 12.5px;
  }
}

/* ==========================================================================
   Autonomous Delta-Hedging Simulator (Brand Kit Compliant)
   Exact replica of the Light-Mode Video Scene and Brand Motif
   Tokens: --ground, --raised, --ink, --ink-2, --rule, --accent, --hedge, --danger
   ========================================================================== */

/* Quick Trigger Buttons */
.sim-btn.btn-hedge-sim {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(7, 112, 95, 0.06);
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}
.sim-btn.btn-hedge-sim:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-vault-sim {
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 150ms ease;
}
.btn-vault-sim:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.hedge-meta-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-inline-sim {
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: all 150ms ease;
}
.btn-inline-sim:hover {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

/* Simulator Modal Dialog */
.sim-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(1040px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(22, 18, 48, 0.22);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.sim-modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.sim-modal-card {
  padding: 28px 36px 36px;
}

/* Modal Header */
.sim-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  gap: 16px;
  flex-wrap: wrap;
}

.sim-eyebrow {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
  margin-bottom: 4px;
}

.sim-headline {
  font-family: var(--display);
  font-size: 28px;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.sim-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.sim-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--hedge);
  color: var(--hedge);
  background: rgba(163, 74, 8, 0.08);
  transition: all 250ms ease;
}

.sim-status-pill.healthy {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(7, 112, 95, 0.08);
}

.sim-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hedge);
}

.sim-status-pill.healthy .sim-pulse-dot {
  background: var(--accent);
}

.sim-trigger-label {
  font-size: 13.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.sim-trigger-label strong {
  color: var(--ink);
  font-weight: 600;
}

.sim-close-btn {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-2);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.sim-close-btn:hover {
  color: var(--ink);
  background: var(--ground);
}

/* Control Bar */
.sim-control-bar {
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sim-control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sim-control-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sim-control-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sim-preset-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sim-chip {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--raised);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
}

.sim-chip:hover {
  border-color: var(--ink-2);
}

.sim-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--raised);
}

.sim-custom-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}

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

.sim-input-item label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
}

.sim-input-item input {
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--ink);
  font-family: inherit;
  outline: none;
}

.sim-input-item input:focus {
  border-color: var(--accent);
}

.sim-slider-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.sim-slider-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.sim-slider-val {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sim-range-input {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--rule);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.sim-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--hedge);
  border: 2px solid var(--raised);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 150ms ease;
}

.sim-range-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.sim-slider-ticks {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.sim-tick-btn {
  background: none;
  border: 1px solid transparent;
  padding: 2px 8px;
  font-size: 10.5px;
  color: var(--ink-2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 120ms ease;
}

.sim-tick-btn:hover {
  color: var(--ink);
  background: var(--raised);
  border-color: var(--rule);
}

.sim-tick-btn.active {
  color: var(--hedge);
  font-weight: 600;
  background: var(--raised);
  border-color: var(--hedge);
}

/* Two-Column Body Grid */
.sim-body-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 28px;
  margin-top: 22px;
  align-items: start;
}

.sim-chart-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sim-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sim-chart-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.05em;
}

.sim-chart-price {
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.sim-svg-wrap {
  width: 100%;
  height: 220px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  position: relative;
  padding: 16px 20px 38px;
  overflow: hidden;
}

.sim-chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sim-chart-legend {
  position: absolute;
  bottom: 10px;
  left: 18px;
  right: 18px;
  display: flex;
  gap: 20px;
  font-size: 11px;
  color: var(--ink-2);
}

.sim-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sim-legend-line {
  width: 14px;
  height: 3px;
  border-radius: 2px;
}

.sim-legend-rose {
  background: var(--danger);
}

.sim-legend-teal {
  background: var(--accent);
}

.sim-readout-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--ground);
  padding: 16px 20px;
}

.sim-readout-left {
  border-right: 1px solid var(--rule);
  padding-right: 16px;
}

.sim-readout-right {
  padding-left: 20px;
}

.sim-readout-lbl {
  font-size: 12px;
  color: var(--ink-2);
}

.sim-readout-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 4px;
}

.sim-readout-sub {
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 2px;
}

.sim-col-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sim-hf-card {
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 24px 28px;
}

.sim-hf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.sim-hf-title {
  font-size: 11.5px;
  color: var(--ink-2);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.sim-hf-number {
  font-family: var(--display);
  font-size: 64px;
  line-height: 0.95;
  color: var(--hedge);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  transition: color 200ms ease;
}

.sim-cr-wrap {
  text-align: right;
}

.sim-cr-title {
  font-size: 12px;
  color: var(--ink-2);
}

.sim-cr-number {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.sim-hf-track {
  position: relative;
  height: 4px;
  border-radius: 4px;
  background: var(--rule);
  margin-top: 22px;
  overflow: hidden;
}

.sim-hf-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--hedge);
  border-radius: 4px;
  transition: width 150ms ease, background 250ms ease;
}

.sim-spec-card {
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 20px 24px;
}

.sim-spec-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.sim-spec-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.sim-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
}

.sim-spec-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sim-spec-key {
  color: var(--ink-2);
}

.sim-spec-val {
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 900px) {
  .sim-body-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .sim-modal-card {
    padding: 20px;
  }
}

@media (max-width: 600px) {
  .sim-headline {
    font-size: 20px;
  }
  .sim-readout-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .sim-readout-left {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding-right: 0;
    padding-bottom: 12px;
  }
  .sim-readout-right {
    padding-left: 0;
  }
  .sim-hf-number {
    font-size: 48px;
  }
}







