/* GuardianMine • Crypto & DeFi Shield — Modern UI Design System */
:root {
  color-scheme: dark;
  
  /* Color Palette */
  --bg-base: #060a14;
  --bg-gradient: radial-gradient(120% 120% at 50% -10%, #101c38 0%, #070d1c 45%, #050811 100%);
  --surface-card: rgba(14, 23, 42, 0.76);
  --surface-card-hover: rgba(20, 32, 58, 0.9);
  --surface-glass: rgba(15, 23, 42, 0.65);
  --surface-input: #091122;
  --surface-subtle: rgba(255, 255, 255, 0.03);
  
  --border-subtle: rgba(56, 85, 128, 0.32);
  --border-card: rgba(64, 98, 148, 0.38);
  --border-focus: #10b981;
  --border-highlight: rgba(16, 185, 129, 0.45);
  
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-glow: rgba(16, 185, 129, 0.28);
  
  --accent-cyan: #06b6d4;
  --accent-indigo: #6366f1;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #8fa2bd;
  
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-card: 0 12px 36px -10px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.22);
  
  /* Legacy compatibility variables */
  --bg: var(--bg-base);
  --card: var(--surface-card);
  --line: var(--border-subtle);
  --text: var(--text-primary);
  --muted: var(--text-muted);
  --green: var(--primary);
  --gold: var(--accent-amber);
}

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

body {
  margin: 0;
  background: var(--bg-base);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.yield-monitor-grid, .yield-monitor-protocols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; margin: 14px 0 24px; }
.yield-monitor-card, .yield-monitor-protocol { min-width: 0; padding: 16px; border: 1px solid var(--border-card); border-radius: var(--radius-md); background: #0b1425; overflow-wrap: anywhere; }
.yield-monitor-card h4, .yield-monitor-protocol h4 { margin: 0 0 8px; }
.yield-monitor-card p { margin: 8px 0; }
.yield-monitor-table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; margin: 10px 0; }
.yield-monitor-table th, .yield-monitor-table td { padding: 7px 9px; border-bottom: 1px solid var(--border-subtle); white-space: nowrap; text-align: left; }
.yield-monitor-candidate { display: grid; gap: 5px; padding: 10px 0; border-top: 1px solid var(--border-subtle); overflow-wrap: anywhere; }
.yield-monitor-candidate small { color: var(--text-secondary); }
.yield-monitor-card.indeterminate { border-color: rgba(245, 158, 11, .45); }
@media (max-width: 640px) { .yield-monitor-card, .yield-monitor-protocol { padding: 12px; } .yield-monitor-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Header & Brand Identity */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(56, 85, 128, 0.25);
}

.brand-wrapper {
  display: flex;
  flex-direction: column;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 6px;
}

.eyebrow span {
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 1px;
}

h1 {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin: 0 0 6px;
  color: var(--text-primary);
}

h1 span {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

/* Live Status Badge */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.read-only {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
}

/* Overview KPIs */
.overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.metric {
  background: var(--surface-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.5), transparent);
  opacity: 0.6;
}

.metric:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.65), 0 0 20px rgba(16, 185, 129, 0.15);
}

.metric small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.metric strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
  margin: 4px 0 6px;
}

.metric span {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

/* Status Notice Pill */
.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  background: rgba(14, 27, 48, 0.85);
  border-top: 1px solid rgba(56, 85, 128, 0.3);
  border-right: 1px solid rgba(56, 85, 128, 0.3);
  border-bottom: 1px solid rgba(56, 85, 128, 0.3);
  color: var(--text-secondary);
  font-size: 13.5px;
  margin: 0 0 24px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.notice.error, .error {
  color: #fca5a5;
  border-color: var(--accent-rose);
  border-left-color: var(--accent-rose);
  background: rgba(45, 16, 24, 0.85);
}

/* Tab Navigation System */
.module-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  margin-bottom: 28px;
  background: rgba(10, 18, 34, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-x: auto;
  z-index: 100;
}

.module-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.module-nav a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.module-nav a.active {
  color: #04140d;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.tab-all-link {
  margin-left: auto;
  opacity: 0.85;
}

.sr-selector-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  color: var(--text-primary);
  background: #111d32;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
}
.sr-selector-panel p { margin: 0; }
.sr-selector-panel code { overflow-wrap: anywhere; color: #a7f3d0; }
.sr-selector-panel details { margin-top: 4px; }

/* Tab Visibility Logic (when filtered) */
body[data-tab-filter="defi"] [data-tab]:not([data-tab~="defi"]),
body[data-tab-filter="simulation"] [data-tab]:not([data-tab~="simulation"]),
body[data-tab-filter="liquidity"] [data-tab]:not([data-tab~="liquidity"]),
body[data-tab-filter="favorites"] [data-tab]:not([data-tab~="favorites"]),
body[data-tab-filter="alerts"] [data-tab]:not([data-tab~="alerts"]),
body[data-tab-filter="autopilot"] [data-tab]:not([data-tab~="autopilot"]) {
  display: none !important;
}

/* Helpful Guidance Card */
.guide-banner {
  background: rgba(16, 185, 129, 0.06);
  border: 1px dashed rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin: 14px 0 20px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.guide-banner strong {
  color: var(--primary);
}

/* Card Module */
.card {
  background: var(--surface-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 30px;
  margin: 24px 0;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: rgba(64, 98, 148, 0.55);
}

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

h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 8px;
  color: var(--text-primary);
}

h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 22px 0 12px;
  color: var(--text-primary);
}

.muted {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.55;
  margin-top: 4px;
}

/* Forms, Inputs, Controls */
label {
  display: block;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 14px;
}

input, select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(56, 85, 128, 0.45);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  margin-top: 6px;
  min-width: 0;
  transition: all 0.2s ease;
}

input:hover, select:hover {
  border-color: rgba(75, 115, 172, 0.6);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: #0d1830;
}

input::placeholder {
  color: rgba(143, 162, 189, 0.55);
}

/* Buttons */
button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #041510;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover:not(:disabled) {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button.secondary {
  background: rgba(16, 185, 129, 0.08);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: none;
}

button.secondary:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.16);
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Form Grids & Layouts */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  background: rgba(10, 18, 34, 0.6);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  margin: 18px 0;
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 24px 0;
}

.columns .card {
  margin: 0;
}

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

.inline label {
  margin: 0;
}

/* Tables & Financial Grid */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: rgba(9, 15, 28, 0.85);
  margin: 18px 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(56, 85, 128, 0.25);
}

th {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: rgba(13, 22, 40, 0.95);
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Rank Results & Financial Badges */
#defi-rank-results {
  margin: 24px 0;
  padding: 24px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-xl);
  background: rgba(10, 20, 36, 0.95);
  box-shadow: 0 14px 40px -10px rgba(0, 0, 0, 0.7);
  scroll-margin-top: 16px;
}

#defi-opportunities .rank-table table {
  min-width: 950px;
  table-layout: auto;
}

#defi-rank-results .rank-loss {
  color: var(--accent-rose);
  font-weight: 700;
  background: rgba(244, 63, 94, 0.12);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

#defi-rank-results .rank-gain {
  color: var(--primary);
  font-weight: 700;
  background: rgba(16, 185, 129, 0.14);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

#defi-rank-meta {
  overflow-wrap: anywhere;
  font-size: 13px;
  margin-bottom: 16px;
}

#defi-rank-results td {
  min-width: 120px;
}

#defi-rank-results td:first-child {
  max-width: 250px;
}

#defi-rank-results .inline {
  margin-top: 16px;
}

/* DeFi Table Specifics */
#defi-opportunities .table-wrap table {
  min-width: 1500px;
  table-layout: fixed;
}

#defi-opportunities td, #defi-opportunities th {
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

#defi-opportunities td p {
  margin: 6px 0;
}

#defi-opportunities td button {
  display: block;
  font-size: 12px;
  padding: 6px 12px;
  margin: 8px 0;
}

#defi-sources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

#defi-sources .metric {
  padding: 14px;
}

#defi-sources strong {
  font-size: 16px;
}

#defi-sources p {
  font-size: 12px;
  overflow-wrap: anywhere;
}

#defi-page {
  align-self: center;
  font-weight: 600;
  color: var(--text-secondary);
}

#defi-opportunities summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  margin: 8px 0;
}

#defi-scenarios input {
  min-width: 75px;
}

#defi-opportunities td details a {
  display: block;
  margin: 6px 0;
}

/* Auto Costs Box */
#defi-auto-costs {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  margin: 22px 0;
  padding: 22px;
  background: rgba(9, 16, 30, 0.75);
}

#defi-auto-costs legend {
  color: var(--primary);
  font-weight: 700;
  font-size: 13.5px;
  padding: 0 10px;
}

#defi-auto-costs .auto-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  margin: 10px 0 16px;
}

#defi-auto-costs input[type=checkbox] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

#defi-auto-costs td {
  white-space: normal;
  vertical-align: top;
  min-width: 120px;
}

#defi-auto-costs .table-wrap {
  margin-top: 14px;
}

#defi-cost-market-result a {
  margin-right: 12px;
}

/* Proofs & Liquidity Shield */
.proof {
  border-left: 3px solid var(--accent-amber);
  background: rgba(11, 20, 36, 0.85);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 18px;
  margin: 16px 0;
  border-top: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.proof dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.proof dt {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.proof dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 13.5px;
  color: var(--text-primary);
  font-weight: 500;
}

.proof p {
  overflow-wrap: anywhere;
  margin: 6px 0;
}

.source-list {
  font-size: 12px;
  color: var(--text-muted);
}

.source-list a {
  overflow-wrap: anywhere;
}

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

.actions button {
  font-size: 12px;
  padding: 6px 12px;
}

/* Monitored Assets Grid */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.asset {
  background: rgba(10, 18, 34, 0.85);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  min-width: 0;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
}

.asset:hover {
  border-color: rgba(75, 115, 172, 0.6);
}

.asset h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.asset dl {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.asset dt {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.asset dd {
  margin: 3px 0 0;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.asset .address {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  overflow-wrap: anywhere;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  display: inline-block;
  margin: 6px 0;
}

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  margin-right: 6px;
  color: var(--primary);
}

.tag.error {
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.08);
  color: var(--accent-rose);
}

/* Links */
a {
  color: var(--primary);
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  color: #34d399;
}

/* Events & Alerts Feed */
.event {
  padding: 16px 0;
  border-bottom: 1px solid rgba(56, 85, 128, 0.25);
}

.event:last-child {
  border-bottom: none;
}

.event p {
  margin: 6px 0;
}

.event small {
  color: var(--text-muted);
  font-size: 12px;
}

/* Simulation Results */
.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.result {
  background: rgba(9, 16, 30, 0.85);
  padding: 16px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
}

.result small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.result strong {
  font-size: 21px;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

/* Chart Canvas */
canvas {
  width: 100%;
  height: 260px;
  display: block;
  margin-top: 18px;
  border-radius: var(--radius-md);
  background: rgba(7, 12, 24, 0.6);
  border: 1px solid var(--border-subtle);
}

/* Footer */
footer {
  color: var(--text-muted);
  font-size: 12.5px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid rgba(56, 85, 128, 0.25);
  text-align: center;
}

footer p {
  margin: 4px 0;
}

/* Utility */
section[id] {
  scroll-margin-top: 132px;
}

[hidden] {
  display: none !important;
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .overview {
    grid-template-columns: repeat(2, 1fr);
  }
  .columns {
    grid-template-columns: 1fr;
  }
  .asset-grid {
    grid-template-columns: 1fr;
  }
  .section-head {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 20px 14px 40px;
  }
  h1 {
    font-size: 28px;
  }
  header {
    align-items: start;
    flex-direction: column;
    gap: 14px;
  }
  .card {
    padding: 20px 16px;
  }
  .overview {
    grid-template-columns: 1fr;
  }
  .metric {
    padding: 16px;
  }
  .metric strong {
    font-size: 22px;
  }
  .module-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 6px;
    margin-bottom: 20px;
  }
  .inline {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ──────────────────────────────────────────────
   Capital Para Investir — chip selector
────────────────────────────────────────────── */
.capital-selector {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  margin: 14px 0 6px;
}
.capital-selector-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}
.capital-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.capital-chip {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s, transform 0.12s;
  white-space: nowrap;
}
.capital-chip:hover {
  background: rgba(16, 185, 129, 0.14);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.capital-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
}
.capital-chip[data-capital="all"].active {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  border-color: #06b6d4;
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.38);
}
.capital-custom-wrap input {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px dashed var(--border-card);
  background: var(--surface-input);
  color: var(--text-primary);
  font-size: 0.82rem;
  width: 130px;
  transition: border-color 0.18s;
}
.capital-custom-wrap input:focus {
  border-color: var(--primary);
  outline: none;
}
.capital-custom-wrap input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}
@media (max-width: 600px) {
  .capital-selector { padding: 10px 12px; gap: 8px; }
  .capital-chip { padding: 5px 12px; font-size: 0.78rem; }
  .capital-custom-wrap input { width: 110px; }
}

/* Full identifiers remain selectable in ranking and radar, including on mobile. */
.pool-identity { overflow-wrap: anywhere; min-width: 260px; }
.pool-identity button, .pool-identity a { margin: 4px; }

.autopilot-json { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 28rem; overflow: auto; }
#autopilot .proof { margin-block: 16px; }
#autopilot .autopilot-investigation { border-left: 4px solid #d99d45; }
#autopilot .autopilot-candidate { border-left: 4px solid #39aa7a; }
#autopilot-candidates > details { margin-block: 18px; }
#autopilot-candidates details details { margin: 10px 0 10px 14px; }

/* Paper Trading financial overview */
.paper-financial { margin: 1.25rem 0; padding: 1.25rem; border: 1px solid var(--border-card); border-radius: var(--radius-card, 16px); background: var(--surface-card); }
.paper-financial h3 { margin-top: 0; }
.paper-financial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.paper-financial-metric { padding: 14px; border: 1px solid var(--border-card); border-radius: 12px; }
.paper-financial-metric span { display: block; color: var(--text-secondary); font-size: .88rem; }
.paper-financial-metric strong { display: block; margin-top: 6px; font-size: clamp(1.2rem, 3vw, 1.8rem); overflow-wrap: anywhere; }
.paper-financial .profit { color: #138a52; } .paper-financial .loss { color: #c43d3d; } .paper-financial .unknown { color: #7c8490; }
.paper-financial-chart { width: 100%; min-height: 190px; margin-top: 12px; }
.paper-financial-chart svg { display: block; width: 100%; height: 190px; }
.paper-financial-chart text { fill: var(--text-secondary); font: 12px sans-serif; }
.paper-financial-periods { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }

/* Smart Radar */
.sr-quick-summary { margin: 14px 0 18px; padding: 16px; border: 1px solid var(--border-card, #39465a); border-radius: 14px; background: linear-gradient(135deg, #172233, #111827); }
.sr-quick-summary-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sr-quick-summary-heading .eyebrow { margin: 0 0 4px; color: #93c5fd; font-size: .7rem; letter-spacing: .08em; }
.sr-quick-summary-heading h3 { margin: 0; color: #fff; }
.sr-quick-summary-heading > p { margin: 0; color: #b9c4d2; font-size: .82rem; }
.sr-quick-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sr-quick-panel { min-width: 0; padding: 12px; border: 1px solid #344258; border-radius: 10px; background: #111a28; overflow-wrap: anywhere; }
.sr-quick-panel h4 { margin: 0 0 8px; color: #dbeafe; }
.sr-quick-panel p { margin: 7px 0; color: #c6d0de; line-height: 1.4; }
.sr-quick-panel strong { color: #f4f7fb; }
.sr-quick-panel .profit, .sr-decision-text.eligible { color: #54d18a; }
.sr-quick-panel .loss, .sr-decision-text.discarded { color: #ff8b82; }
.sr-decision-text.unknown { color: #f1c75b; }
.sr-quick-panel small { display: block; margin-top: 10px; line-height: 1.45; }
.sr-decision-badge { display: inline-block; padding: 2px 7px; border: 1px solid currentColor; border-radius: 999px; font-size: .68rem; }
.sr-decision-badge.eligible { color: #54d18a; }
.sr-decision-badge.unknown { color: #f1c75b; }
.sr-decision-badge.discarded { color: #ff8b82; }
.sr-card-metrics abbr { text-decoration: underline dotted; text-underline-offset: 2px; cursor: help; }
.sr-source-notice { margin: 10px 0 16px; padding: 11px 13px; border-left: 4px solid #f1c75b; border-radius: 7px; background: rgba(241,199,91,.08); color: #d9e2ef; line-height: 1.5; }
.sr-pool-screening { padding: 10px 12px; border: 1px solid #344258; border-radius: 8px; background: rgba(30,45,65,.55); color: #d9e2ef; line-height: 1.45; font-size: .84rem; }
.sr-pool-screening small { display: inline-block; margin-top: 5px; color: #9fb0c5; }
@media (max-width: 800px) { .sr-quick-summary-grid { grid-template-columns: 1fr; } .sr-quick-summary-heading { align-items: flex-start; flex-direction: column; } }

.smart-radar-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
.smart-radar-summary .summary-card { padding: 12px; background: var(--surface-card, #1a1e29); border: 1px solid var(--border-card, #2c3242); border-radius: 10px; text-align: center; }
.smart-radar-summary .summary-label { display: block; font-size: 0.78rem; color: var(--text-secondary, #8b949e); margin-bottom: 4px; }
.smart-radar-summary .summary-val { font-size: 1.3rem; }
.smart-radar-summary .summary-val.profit { color: #2ecc71; }
.smart-radar-summary .summary-val.highlight { color: #f1c40f; }
.smart-radar-summary .summary-val.warning { color: #e67e22; }

.backend-status-bar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 10px 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--border-card, #2c3242); border-radius: 8px; font-size: 0.85rem; margin-bottom: 16px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 20px; padding: 12px; background: var(--surface-card, #1a1e29); border-radius: 10px; border: 1px solid var(--border-card, #2c3242); }
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-label { font-size: 0.82rem; color: var(--text-secondary, #8b949e); font-weight: 600; }
.btn-chip { background: #21262d; border: 1px solid #30363d; color: #c9d1d9; border-radius: 20px; padding: 4px 12px; font-size: 0.8rem; cursor: pointer; transition: all 0.2s; }
.btn-chip:hover { border-color: #58a6ff; }
.btn-chip.active { background: #1f6feb; border-color: #58a6ff; color: #fff; font-weight: bold; }

.sr-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 20px; }
.sr-opportunity-card { padding: 16px; background: var(--surface-card, #1a1e29); border: 1px solid var(--border-card, #2c3242); border-radius: 12px; display: flex; flex-direction: column; gap: 10px; }
.sr-opportunity-card.eligible { border-left: 4px solid #2ecc71; }
.sr-opportunity-card.caution { border-left: 4px solid #f39c12; }
.sr-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sr-title-area strong { font-size: 1.05rem; color: #f0f6fc; }
.sr-badges { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.badge-proto { background: #238636; color: #fff; font-size: 0.72rem; padding: 2px 6px; border-radius: 4px; }
.badge-type { background: #388bfd33; color: #58a6ff; font-size: 0.72rem; padding: 2px 6px; border-radius: 4px; }
.badge-risk.moderate { background: #d2992233; color: #e3b341; font-size: 0.72rem; padding: 2px 6px; border-radius: 4px; }
.badge-risk.danger { background: #f8514933; color: #f85149; font-size: 0.72rem; padding: 2px 6px; border-radius: 4px; }

.sr-net-pnl { text-align: right; }
.sr-net-label { display: block; font-size: 0.72rem; color: var(--text-secondary, #8b949e); }
.sr-net-value { display: block; font-size: 1.25rem; font-weight: bold; }
.sr-net-pnl.profit .sr-net-value { color: #2ecc71; }
.sr-net-pnl.loss .sr-net-value { color: #f85149; }
.sr-net-pct { font-size: 0.8rem; color: var(--text-secondary, #8b949e); }

.sr-card-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 0.82rem; background: rgba(0,0,0,0.15); padding: 8px 10px; border-radius: 6px; }
.sr-card-metrics span { color: var(--text-secondary, #8b949e); }
.sr-card-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

.sr-category-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px; }
.sr-col { background: var(--surface-card, #1a1e29); border: 1px solid var(--border-card, #2c3242); border-radius: 12px; padding: 14px; }
.sr-col h3 { margin-top: 0; font-size: 0.95rem; border-bottom: 1px solid #30363d; padding-bottom: 8px; color: #e6edf3; }
.sr-mini-list { display: flex; flex-direction: column; gap: 10px; }

.sr-details-box { margin-top: 14px; background: var(--surface-card, #1a1e29); border: 1px solid var(--border-card, #2c3242); border-radius: 10px; padding: 12px; }
.sr-details-box summary { cursor: pointer; font-weight: 600; color: #c9d1d9; }
.sr-data-quality { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 18px; max-height: 420px; overflow: auto; }
.sr-data-quality h4 { margin: 10px 0 6px; }
.sr-data-quality p { margin: 4px 0; overflow-wrap: anywhere; }
.sr-indeterminate-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; max-height: 520px; overflow: auto; }
.sr-indeterminate-item { padding: 10px; border: 1px solid var(--border-card, #2c3242); border-radius: 8px; overflow-wrap: anywhere; }
.sr-indeterminate-item p { margin: 6px 0 0; }
.sr-detail-dialog { box-sizing: border-box; width: min(1000px, calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: min(88vh, 900px); overflow: auto; overscroll-behavior: contain; color: #eef3fa; background: #111827; opacity: 1; border: 1px solid #526071; border-radius: 14px; padding: 16px; }
.sr-detail-dialog::backdrop { background: rgb(0 0 0 / 72%); }
.sr-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; position: sticky; z-index: 2; top: -16px; padding: 8px 0; color: #fff; background: #111827; border-bottom: 1px solid #526071; }
.sr-detail-header h3 { margin: 0; color: #fff; }
.sr-detail-header #sr-detail-close { flex: 0 0 auto; min-height: 40px; }
.sr-detail-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; padding-top: 12px; }
.sr-detail-content section { padding: 12px; color: #eef3fa; background: #1b2635; border: 1px solid #526071; border-radius: 10px; overflow-wrap: anywhere; }
.sr-detail-content h4 { margin: 0 0 10px; color: #fff; font-size: 1rem; }
.sr-detail-content p { margin: 8px 0; color: #eef3fa; line-height: 1.5; }
.sr-detail-content p strong { color: #fff; }
@media (max-width: 600px) {
  .sr-detail-dialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: 92vh; padding: 12px; }
  .sr-detail-header { top: -12px; }
  .sr-detail-header h3 { font-size: 1rem; }
  .sr-detail-content { grid-template-columns: 1fr; }
}
.sr-discarded-wrap { margin-top: 10px; overflow-x: auto; }


/* 7.10.4 — readable Radar summary and actionable guidance */
.sr-data-quality { display: block; max-height: none; overflow: visible; }
.sr-quality-protocol { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--border-card, #2c3242); border-radius: 9px; background: rgba(255,255,255,.025); }
.sr-quality-protocol summary { cursor: pointer; font-weight: 700; color: #e6edf3; }
.sr-quality-protocol p { margin: 8px 0; padding-left: 10px; border-left: 2px solid #718096; line-height: 1.5; }
.sr-quality-protocol small, .sr-source-coverage { display: block; margin-top: 9px; color: var(--text-secondary, #aab7c8); line-height: 1.5; }
.sr-selector-panel ol { margin: 8px 0 12px; padding-left: 24px; }
.sr-selector-panel li { margin: 4px 0; }
.sr-auto-status { padding: 10px 12px; border-radius: 8px; font-weight: 700; }
.sr-auto-status.caution { color: #ffe5a0; background: rgba(217, 119, 6, .14); border: 1px solid rgba(217, 119, 6, .4); }
.sr-auto-status.ready { color: #a7f3d0; background: rgba(16, 185, 129, .12); border: 1px solid rgba(16, 185, 129, .4); }
.sr-quick-panel { line-height: 1.55; }
.sr-quick-return { border-color: rgba(56, 139, 253, .45); }
.pool-input-help { max-width: 900px; padding: 10px 12px; border-left: 3px solid #58a6ff; background: rgba(56,139,253,.08); line-height: 1.55; }
@media (max-width: 800px) { .sr-cards-grid { grid-template-columns: 1fr; } .sr-category-columns { grid-template-columns: 1fr; } }

/* 7.10.8 — capital alternatives by strategy with explicit wait decision */
#sr-quick-summary { border-left: 4px solid #10b981; }
#sr-quick-summary h3 { font-size: 1.18rem; }
#sr-overall-title, #sr-eligible-title { line-height: 1.35; }
.sr-opportunity-card { min-width: 0; }
.sr-opportunity-card .sr-net-value { overflow-wrap: anywhere; }
.sr-card-risks { line-height: 1.45; }
@media (min-width: 1100px) { .smart-radar-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.sr-auto-status { margin: 4px 0 8px; }
.sr-auto-safety { display: inline-block; margin: 4px 12px 4px 0; color: var(--text-secondary, #aab7c8); line-height: 1.5; }
.sr-selector-panel .btn { margin: 4px 0; }
.sr-capital-recommendation { padding: 12px; border: 1px solid #344258; border-radius: 10px; background: rgba(16, 185, 129, .055); color: #e4edf8; line-height: 1.5; }
.sr-capital-option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 9px; margin-top: 11px; }
.sr-capital-option { min-width: 0; padding: 10px; border: 1px solid #344258; border-radius: 8px; background: #111a28; overflow-wrap: anywhere; }
.sr-capital-option h4 { margin: 0 0 7px; color: #b9d5ff; }
.sr-capital-option p { margin: 5px 0; }
.sr-capital-option small { display: block; margin-top: 6px; color: #aab7c8; line-height: 1.4; }
.sr-capital-option .sr-capital-blocker { color: #ffd28a; }

.sr-origin-assumption { margin: 0 0 8px; padding: 8px 11px; border-left: 3px solid #60a5fa; color: var(--text-secondary, #aab7c8); background: rgba(56,139,253,.06); font-size: .84rem; line-height: 1.45; }
.sr-net-pnl { min-width: 132px; flex: 0 0 auto; }
.sr-net-value { white-space: nowrap; overflow-wrap: normal; word-break: keep-all; font-size: clamp(1rem, 1.1vw, 1.2rem); }
