:root {
  --bg-dark: #0a0e17;
  --bg-card: #111827;
  --bg-card-hover: #1e293b;
  --bg-input: #0f172a;
  --border-color: #1e293b;
  --border-glow: #334155;
  --border-active: #10b981;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-emerald: #10b981;
  --accent-emerald-dim: rgba(16, 185, 129, 0.15);
  --accent-gold: #f59e0b;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-danger: #ef4444;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(6, 182, 212, 0.04) 0%, transparent 45%),
    linear-gradient(to bottom, #070a10, #0a0e17);
}

/* Mandatory Standards */
input, select, textarea {
  min-width: 0;
  font-family: inherit;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.lang-switcher {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

/* Nav */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-emerald);
  background: var(--accent-emerald-dim);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

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

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn:hover {
  color: #fff;
}

.lang-btn.active {
  background: #1e293b;
  color: #fff;
}

/* Main Container */
.main-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 60px 20px;
}

/* Hero */
.hero-section {
  text-align: center;
  padding: 30px 10px 32px 10px;
  max-width: 880px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 6px 14px;
  border-radius: 30px;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #ffffff 40%, #a7f3d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Quick Banner Cross-Links */
.quick-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.quick-banner-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(30, 41, 59, 0.7));
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  border-radius: 12px;
  transition: border-color 0.2s, transform 0.2s;
}

.quick-banner-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

.quick-banner-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.quick-banner-text {
  flex: 1;
  min-width: 0;
}

.quick-banner-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.quick-banner-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.quick-banner-btn {
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-emerald);
  background: var(--accent-emerald-dim);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
}

.quick-banner-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #fff;
}

/* Section Card */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.title-with-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-heading {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.section-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-emerald);
  background: var(--accent-emerald-dim);
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.chip-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.12);
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.refresh-countdown {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  border: 1px solid var(--border-glow);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sm:hover {
  background: #334155;
  color: #fff;
}

/* 1. Live Gas Cards Grid */
.gas-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.gas-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.gas-card:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.gas-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.gas-chain-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gas-chain-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: #1e293b;
}

.gas-chain-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.congestion-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.03em;
}

.congestion-low {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.congestion-mid {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.congestion-high {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.gas-price-big {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.gas-unit {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 4px;
}

.gas-sub-stats {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}

.swap-cost-tag {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-cyan);
}

/* 2. Calculator & Optimal Clock */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 24px;
  align-items: start;
}

.calc-controls {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-group label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-select, .form-input {
  background: #1e293b;
  border: 1px solid #334155;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-select:focus, .form-input:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.form-range {
  flex: 1;
  accent-color: var(--accent-emerald);
  cursor: pointer;
}

.range-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
  min-width: 45px;
  text-align: right;
}

/* Calculator Results Card */
.calc-results-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.results-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.cost-stat-box {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.optimal-cost-box {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.stat-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 4px;
}

.text-emerald {
  color: #34d399 !important;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-dim);
}

.vs-divider {
  font-size: 20px;
  color: var(--text-dim);
  font-weight: 800;
}

/* Savings Alert Box */
.savings-alert-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.08));
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  border-radius: 12px;
  padding: 14px 18px;
}

.savings-alert-icon {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.savings-alert-content {
  flex: 1;
}

.savings-headline {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 4px;
}

.highlight-saving {
  color: #34d399;
  font-family: var(--font-mono);
  font-weight: 800;
}

.savings-timing {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.savings-timing strong {
  color: #fff;
}

.calc-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #000;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #1e293b;
  border: 1px solid #334155;
  color: #fff;
}

.btn-secondary:hover {
  background: #334155;
}

/* 24-Hour Timeline Bar */
.day-timeline-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12.5px;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-title {
  font-weight: 700;
  color: #fff;
}

.timeline-meta {
  color: var(--text-dim);
}

.timeline-bar {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  height: 38px;
  background: #0f172a;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.timeline-tick {
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  position: relative;
}

.timeline-tick:hover {
  transform: scaleY(1.15);
  z-index: 2;
}

.timeline-tick.is-now {
  box-shadow: 0 0 0 2px #fff, 0 0 8px #fff;
  z-index: 3;
}

.timeline-tick.is-best {
  box-shadow: 0 0 0 2px var(--accent-emerald), 0 0 10px var(--accent-emerald);
  z-index: 3;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  padding: 0 4px;
}

/* 3. 7x24 Heatmap Section */
.heatmap-header-flex {
  align-items: flex-start;
}

.heatmap-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.segmented-control {
  display: inline-flex;
  background: #0f172a;
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
  overflow-x: auto;
  max-width: 100%;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.seg-btn:hover {
  color: #fff;
}

.seg-btn.active {
  background: #1e293b;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-tz {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0f172a;
  border: 1px solid var(--border-glow);
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-tz:hover {
  background: #1e293b;
}

.heatmap-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 16px;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
}

.legend-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.legend-swatch {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  display: inline-block;
}

.swatch-deep-green {
  background: #064e3b;
  border: 1px solid #10b981;
}

.swatch-light-green {
  background: #065f46;
  border: 1px solid #34d399;
}

.swatch-yellow {
  background: #854d0e;
  border: 1px solid #facc15;
}

.swatch-red {
  background: #7f1d1d;
  border: 1px solid #f87171;
}

.current-hour-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-weight: 600;
}

.swatch-now-indicator {
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 3px;
  box-shadow: 0 0 8px #fff;
}

/* Heatmap Grid Wrapper */
.heatmap-wrapper {
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: 80px repeat(24, minmax(36px, 1fr));
  gap: 4px;
  min-width: 960px;
}

.heatmap-cell-header {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  padding: 6px 0;
}

.heatmap-day-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding-left: 6px;
}

.heatmap-cell {
  height: 42px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  user-select: none;
  border: 1px solid transparent;
  position: relative;
}

.heatmap-cell:hover {
  transform: scale(1.08);
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border-color: #fff !important;
}

.heatmap-cell.active-selected {
  outline: 2px solid #fff;
  outline-offset: 1px;
  z-index: 6;
}

.heatmap-cell.cell-now {
  box-shadow: 0 0 0 2px #fff, 0 0 10px rgba(255, 255, 255, 0.8);
  z-index: 4;
}

.heatmap-cell.cell-now::after {
  content: 'NOW';
  position: absolute;
  top: -7px;
  background: #fff;
  color: #000;
  font-size: 8px;
  font-weight: 900;
  font-family: var(--font-mono);
  padding: 1px 3px;
  border-radius: 3px;
  line-height: 1;
}

.cell-val {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.1;
}

.cell-sub {
  font-size: 9px;
  font-weight: 600;
  opacity: 0.8;
  line-height: 1;
  margin-top: 2px;
}

/* Color levels */
.level-deep-green {
  background: #064e3b;
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

.level-light-green {
  background: #065f46;
  color: #a7f3d0;
  border-color: rgba(52, 211, 153, 0.25);
}

.level-yellow {
  background: #78350f;
  color: #fde68a;
  border-color: rgba(250, 204, 21, 0.25);
}

.level-red {
  background: #7f1d1d;
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.3);
}

/* Detail Popover Card */
.hour-detail-card {
  background: #0f172a;
  border: 1.5px solid var(--border-glow);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.hour-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hour-detail-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hour-badge-day {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.hour-badge-time {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.congestion-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

.detail-chain-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: #1e293b;
  padding: 4px 10px;
  border-radius: 6px;
}

.hour-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.detail-stat {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.stat-caption {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.stat-data {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}

.detail-tip {
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  line-height: 1.5;
}

/* 4. Strategic Guide */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.guide-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
}

.guide-card-icon {
  font-size: 26px;
  margin-bottom: 12px;
}

.guide-card h4 {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.guide-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Portal Backlink Wrap */
.portal-backlink-wrap {
  text-align: center;
  padding: 28px 0 10px 0;
  font-size: 13px;
  color: var(--text-dim);
}

.portal-backlink {
  color: var(--accent-emerald);
  text-decoration: none;
  font-weight: 700;
  margin-right: 8px;
  transition: color 0.2s;
}

.portal-backlink:hover {
  text-decoration: underline;
  color: #34d399;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #10b981;
  color: #000;
  font-weight: 700;
  font-size: 13.5px;
  padding: 11px 22px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 9999;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .quick-banner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 24px;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .results-comparison {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .vs-divider {
    transform: rotate(90deg);
  }
  .heatmap-meta-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
