/* --- OneMin Design System & CSS Variables --- */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;

  /* Sleek Cyberpunk/Fintech Dark Palette */
  --bg-base: 220 25% 6%;
  --bg-surface: 220 22% 10%;
  --bg-panel: 220 20% 12% / 0.75;
  
  --color-primary: 180 100% 45%;
  --color-primary-hover: 180 100% 38%;
  --color-primary-glow: 180 100% 45% / 0.15;
  
  --color-secondary: 260 85% 65%;
  --color-success: 145 80% 50%;
  --color-warning: 35 100% 60%;
  --color-danger: 345 85% 55%;
  
  --text-primary: 0 0% 95%;
  --text-secondary: 220 12% 70%;
  --text-muted: 220 10% 50%;
  
  --border-light: 220 20% 20% / 0.5;
  --border-glow: 180 100% 45% / 0.25;

  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: hsl(var(--bg-base));
  color: hsl(var(--text-primary));
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

p {
  color: hsl(var(--text-secondary));
}

.gradient-text {
  background: linear-gradient(135deg, hsl(var(--color-primary)) 0%, hsl(var(--color-secondary)) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.glass-panel {
  background-color: hsl(var(--bg-panel));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid hsl(var(--border-light));
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: hsl(var(--border-glow));
  box-shadow: 0 8px 32px 0 rgba(0, 240, 255, 0.06);
}

/* --- Header / Navigation --- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: hsl(var(--bg-base) / 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border-light));
  height: 70px;
  display: flex;
  align-items: center;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.05em;
}

.logo-symbol {
  color: hsl(var(--color-primary));
  font-family: var(--font-mono);
  font-weight: 700;
}

.logo-text .dot {
  color: hsl(var(--color-primary));
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: hsl(var(--text-secondary));
  transition: var(--transition-smooth);
}

.nav-links a:hover,
.nav-links a.active {
  color: hsl(var(--color-primary));
  text-shadow: 0 0 12px hsl(var(--color-primary-glow));
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
  text-align: center;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.btn-primary {
  background-color: hsl(var(--color-primary));
  color: hsl(var(--bg-base));
}

.btn-primary:hover {
  background-color: hsl(var(--color-primary-hover));
  box-shadow: 0 0 20px hsl(var(--color-primary-glow));
}

.btn-secondary {
  background-color: hsl(var(--bg-surface));
  color: hsl(var(--text-primary));
  border-color: hsl(var(--border-light));
}

.btn-secondary:hover {
  background-color: hsl(var(--bg-panel));
  border-color: hsl(var(--text-secondary));
}

.btn-outline {
  background-color: transparent;
  color: hsl(var(--text-primary));
  border-color: hsl(var(--border-light));
}

.btn-outline:hover {
  border-color: hsl(var(--color-primary));
  color: hsl(var(--color-primary));
  box-shadow: 0 0 15px hsl(var(--color-primary-glow));
}

.btn-danger {
  background-color: hsl(var(--color-danger) / 0.15);
  color: hsl(var(--color-danger));
  border-color: hsl(var(--color-danger) / 0.3);
}

.btn-danger:hover {
  background-color: hsl(var(--color-danger) / 0.3);
}

/* --- Hero Section --- */
.hero-section {
  position: relative;
  padding-top: 170px;
  padding-bottom: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.grid-background {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
  mask-image: radial-gradient(circle 600px at center, black, transparent);
  -webkit-mask-image: radial-gradient(circle 600px at center, black, transparent);
}

.hero-container {
  max-width: 800px;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.tagline-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: hsl(var(--bg-surface));
  border: 1px solid hsl(var(--border-light));
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: hsl(var(--text-secondary));
  margin-bottom: 1.5rem;
}

.pulse-icon {
  width: 8px;
  height: 8px;
  background-color: hsl(var(--color-primary));
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px hsl(var(--color-primary));
  animation: pulse 2s infinite;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: hsl(var(--text-primary));
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- Section Formatting --- */
.dashboard-section, .strategies-section, .infra-section {
  padding-top: 70px;
  padding-bottom: 70px;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3.5rem;
}

.section-title {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.section-description {
  font-size: 1.05rem;
}

/* --- Dashboard Grid & Cards --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
}

.stat-icon {
  font-size: 2rem;
  background-color: hsl(var(--bg-surface));
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid hsl(var(--border-light));
}

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.8rem;
  color: hsl(var(--text-muted));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.stat-delta {
  font-size: 0.8rem;
  font-weight: 500;
}

.stat-delta.positive {
  color: hsl(var(--color-success));
}

.stat-delta.stable {
  color: hsl(var(--color-primary));
}

/* --- Live Feed & Logs --- */
.chart-container-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.chart-panel {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

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

.chart-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chart-badge {
  background-color: hsl(var(--color-danger) / 0.15);
  color: hsl(var(--color-danger));
  border: 1px solid hsl(var(--color-danger) / 0.3);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.chart-stats {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.ticker-price {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
}

.ticker-change {
  font-size: 0.9rem;
  font-weight: 600;
}

.ticker-change.positive {
  color: hsl(var(--color-success));
}

.canvas-wrapper {
  flex: 1;
  min-height: 300px;
  position: relative;
  background-color: rgba(5, 5, 10, 0.4);
  border-radius: var(--radius-sm);
  border: 1px solid hsl(var(--border-light));
  overflow: hidden;
}

#live-chart {
  display: block;
  width: 100%;
  height: 100%;
}

/* Log Feed Panel */
.log-panel {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  max-height: 410px;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid hsl(var(--border-light));
  padding-bottom: 0.5rem;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-indicator.online::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: hsl(var(--color-success));
  border-radius: 50%;
  box-shadow: 0 0 6px hsl(var(--color-success));
}

.log-feed {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: hsl(var(--text-secondary));
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--border-light)) transparent;
}

.log-entry {
  line-height: 1.4;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid hsl(var(--bg-base));
}

.log-entry .time {
  color: hsl(var(--text-muted));
}

.log-entry .tag {
  color: hsl(var(--color-primary));
  font-weight: 600;
}

.log-entry .msg {
  word-break: break-all;
}

.log-entry.success .msg {
  color: hsl(var(--color-success));
}

.log-entry.warning .msg {
  color: hsl(var(--color-warning));
}

/* --- Strategies Section --- */
.strategies-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.strategy-card {
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.strategy-badge {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  background-color: hsl(var(--color-primary) / 0.1);
  color: hsl(var(--color-primary));
  border: 1px solid hsl(var(--color-primary) / 0.25);
  border-radius: 4px;
}

.strategy-badge.font-ml {
  background-color: hsl(var(--color-secondary) / 0.1);
  color: hsl(var(--color-secondary));
  border-color: hsl(var(--color-secondary) / 0.25);
}

.strategy-badge.font-macro {
  background-color: hsl(var(--color-warning) / 0.1);
  color: hsl(var(--color-warning));
  border-color: hsl(var(--color-warning) / 0.25);
}

.strategy-card h3 {
  font-size: 1.4rem;
  margin-top: 0.5rem;
}

.strategy-features {
  list-style: none;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.strategy-features li {
  font-size: 0.85rem;
  color: hsl(var(--text-secondary));
  padding-left: 1.25rem;
  position: relative;
}

.strategy-features li::before {
  content: "//";
  position: absolute;
  left: 0;
  color: hsl(var(--color-primary));
  font-family: var(--font-mono);
}

/* --- Infrastructure Section --- */
.infra-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.infra-content h2 {
  margin-bottom: 1.5rem;
}

.infra-content > p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.infra-features {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.infra-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.infra-icon {
  font-size: 1.75rem;
  background-color: hsl(var(--bg-surface));
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid hsl(var(--border-light));
  flex-shrink: 0;
}

.infra-item h4 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.infra-item p {
  font-size: 0.9rem;
}

/* Infrastructure Visual Radar */
.infra-visual {
  height: 400px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 1.5rem;
}

.radar-box {
  position: relative;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid hsl(var(--border-light));
  margin-bottom: 1.5rem;
}

.radar-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed hsl(var(--border-light));
}

.circle-1 { width: 70%; height: 70%; }
.circle-2 { width: 40%; height: 40%; }
.circle-3 { width: 15%; height: 15%; }

.radar-sweep {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: conic-gradient(from 0deg, transparent 50%, hsl(var(--color-primary) / 0.15) 100%);
  border-radius: 50%;
  animation: radar-rotate 8s linear infinite;
  pointer-events: none;
}

.node {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: hsl(var(--color-primary));
  border-radius: 50%;
  box-shadow: 0 0 10px hsl(var(--color-primary));
}

.node::after {
  content: attr(data-city);
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: hsl(var(--text-secondary));
}

.node-ny { top: 30%; left: 25%; }
.node-ld { top: 45%; left: 75%; }
.node-ch { top: 60%; left: 45%; }

.infra-status-bar {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--text-muted));
  border-top: 1px solid hsl(var(--border-light));
  padding-top: 1rem;
}

.infra-status-bar b {
  color: hsl(var(--color-primary));
}

/* --- Modals & Forms --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(5, 5, 10, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  width: 100%;
  max-width: 520px;
  padding: 2.5rem;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: hsl(var(--text-muted));
  font-size: 2rem;
  line-height: 0.5;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: hsl(var(--text-primary));
}

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

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: hsl(var(--text-secondary));
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  background-color: hsl(var(--bg-surface));
  border: 1px solid hsl(var(--border-light));
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  color: hsl(var(--text-primary));
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: hsl(var(--color-primary));
  box-shadow: 0 0 10px hsl(var(--color-primary-glow));
}

/* ============================================================ */
/* --- INVESTOR PORTAL STYLES (HTMX + SSR) --- */
/* ============================================================ */
.portal-page {
  padding-top: 100px;
  padding-bottom: 80px;
  flex: 1;
}

.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid hsl(var(--border-light));
}

.user-welcome h2 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

.user-welcome p {
  font-size: 0.9rem;
  color: hsl(var(--text-muted));
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.75rem;
}

.col-4 { grid-column: span 4; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-12 { grid-column: span 12; }

.portal-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title-bar h3 {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.badge-accredited {
  background-color: hsl(var(--color-success) / 0.15);
  color: hsl(var(--color-success));
  border: 1px solid hsl(var(--color-success) / 0.3);
}

.badge-standard {
  background-color: hsl(var(--color-warning) / 0.15);
  color: hsl(var(--color-warning));
  border: 1px solid hsl(var(--color-warning) / 0.3);
}

.profile-info-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-info-item {
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid hsl(var(--bg-surface));
  font-size: 0.9rem;
}

.profile-info-item span:first-child {
  color: hsl(var(--text-muted));
}

.profile-info-item span:last-child {
  font-weight: 600;
  color: hsl(var(--text-primary));
}

.balance-amount {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: hsl(var(--color-primary));
  text-shadow: 0 0 20px hsl(var(--color-primary-glow));
}

.balance-rate {
  font-size: 0.85rem;
  color: hsl(var(--color-success));
  font-weight: 600;
}

/* Compounding Calculator Table */
.calc-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.calc-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.calc-summary-card {
  background-color: hsl(var(--bg-surface));
  border: 1px solid hsl(var(--border-light));
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.calc-summary-card .label {
  font-size: 0.75rem;
  color: hsl(var(--text-muted));
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.calc-summary-card .value {
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--text-primary));
}

.calc-summary-card.highlight .value {
  color: hsl(var(--color-success));
}

.data-table-wrapper {
  max-height: 280px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  border: 1px solid hsl(var(--border-light));
  scrollbar-width: thin;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: right;
}

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

.data-table th {
  background-color: hsl(var(--bg-surface));
  color: hsl(var(--text-muted));
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table td:first-child, .data-table th:first-child {
  text-align: left;
}

.data-table tr:hover {
  background-color: hsl(var(--color-primary) / 0.05);
}

/* Document Viewer & List */
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.doc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: hsl(var(--bg-surface));
  border: 1px solid hsl(var(--border-light));
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.doc-item:hover {
  border-color: hsl(var(--color-primary));
  background-color: hsl(var(--bg-surface) / 0.8);
}

.doc-info h4 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.doc-info span {
  font-size: 0.75rem;
  color: hsl(var(--text-muted));
}

.markdown-content {
  font-size: 0.9rem;
  line-height: 1.7;
  color: hsl(var(--text-primary));
}

.markdown-content h1 { font-size: 1.5rem; margin-bottom: 1rem; color: hsl(var(--color-primary)); }
.markdown-content h2 { font-size: 1.25rem; margin-top: 1.25rem; margin-bottom: 0.5rem; }
.markdown-content h3 { font-size: 1.1rem; margin-top: 1rem; margin-bottom: 0.4rem; }
.markdown-content p { margin-bottom: 0.8rem; color: hsl(var(--text-secondary)); }
.markdown-content ul { padding-left: 1.5rem; margin-bottom: 0.8rem; }
.markdown-content li { margin-bottom: 0.25rem; }
.markdown-content strong { color: hsl(var(--text-primary)); }

/* Alerts & Notices */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-error {
  background-color: hsl(var(--color-danger) / 0.15);
  border: 1px solid hsl(var(--color-danger) / 0.3);
  color: hsl(var(--color-danger));
}

.alert-success {
  background-color: hsl(var(--color-success) / 0.15);
  border: 1px solid hsl(var(--color-success) / 0.3);
  color: hsl(var(--color-success));
}

/* HTMX Loading Indicator */
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator {
  display: inline-block;
}
.htmx-request.htmx-indicator {
  display: inline-block;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

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

/* Quick Fill Buttons for testing */
.quick-fill-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.chip-btn {
  background-color: hsl(var(--bg-surface));
  border: 1px solid hsl(var(--border-light));
  color: hsl(var(--text-muted));
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.chip-btn:hover {
  border-color: hsl(var(--color-primary));
  color: hsl(var(--color-primary));
}

/* --- Footer --- */
.app-footer {
  margin-top: auto;
  border-top: 1px solid hsl(var(--border-light));
  background-color: hsl(var(--bg-surface) / 0.5);
  padding-top: 50px;
  padding-bottom: 30px;
  font-size: 0.85rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-brand {
  max-width: 400px;
}

.footer-brand p {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.footer-links-group {
  display: flex;
  gap: 4rem;
}

.footer-links-group div {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links-group h4 {
  font-size: 0.85rem;
  color: hsl(var(--text-primary));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.footer-links-group a {
  color: hsl(var(--text-secondary));
  transition: var(--transition-smooth);
}

.footer-links-group a:hover {
  color: hsl(var(--color-primary));
}

.footer-bottom {
  border-top: 1px solid hsl(var(--border-light) / 0.5);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-bottom p {
  color: hsl(var(--text-muted));
}

.disclaimer {
  font-size: 0.75rem;
  line-height: 1.5;
}

/* --- Animations --- */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(0, 240, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0); }
}

@keyframes radar-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
  .chart-container-grid { grid-template-columns: 1fr; }
  .infra-grid { grid-template-columns: 1fr; gap: 2rem; }
  .strategies-grid { grid-template-columns: 1fr; }
  .col-4, .col-8, .col-6 { grid-column: span 12; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-cta-group { flex-direction: column; }
  .footer-top { flex-direction: column; gap: 2rem; }
  .calc-form-grid { grid-template-columns: 1fr; }
}

/* --- Currency Switcher --- */
.currency-switcher {
  display: inline-flex;
  background: rgba(10, 15, 25, 0.6);
  border: 1px solid hsl(var(--border-light));
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.currency-btn {
  background: transparent;
  border: none;
  color: hsl(var(--text-muted));
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.currency-btn:hover {
  color: hsl(var(--text-primary));
}

.currency-btn.active {
  background: hsl(var(--color-primary) / 0.2);
  color: hsl(var(--color-primary));
  font-weight: 600;
}

/* --- Institutional Print Statement Styles --- */
@media print {
  body {
    background: #ffffff !important;
    color: #111111 !important;
    font-size: 11pt;
  }
  
  .app-header, .app-footer, .header-actions, .calc-form-grid, button, .currency-switcher, #modal-container, .badge-accredited, form {
    display: none !important;
  }

  .portal-page {
    padding: 0 !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .portal-grid {
    display: block !important;
  }

  .portal-card, .glass-panel {
    background: #ffffff !important;
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
    margin-bottom: 1.5rem !important;
    page-break-inside: avoid;
  }

  .data-table {
    color: #111111 !important;
  }

  .data-table th {
    background: #f0f0f0 !important;
    color: #333333 !important;
    border-bottom: 2px solid #999999 !important;
  }

  .data-table td {
    border-bottom: 1px solid #e0e0e0 !important;
    color: #111111 !important;
  }

  .gradient-text {
    background: none !important;
    -webkit-text-fill-color: #008899 !important;
    color: #008899 !important;
  }
}

