/* ── DividendIQ — App Styles ──
   Theme: Slate/Midnight Gradient · Font: Inter · Density: Compact
   Responsive: Mobile-first, desktop-enhanced
   ────────────────────────────────────────── */

/* ── GOOGLE FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;1,14..32,400&family=Inter+Tight:wght@600;700;800&display=swap');

/* ── DESIGN TOKENS ── */
:root {
  --bg:          #080d1a;
  --surface:     #0e1628;
  --surface2:    #131e35;
  --surface3:    #1a2844;
  --surface4:    #1f3050;
  --border:      rgba(99,132,255,0.12);
  --border2:     rgba(99,132,255,0.22);
  --border3:     rgba(99,132,255,0.35);
  --accent:      #5b8def;
  --accent2:     #7c6fff;
  --accent-glow: rgba(91,141,239,0.20);
  --pos:         #22d3a0;
  --pos-bg:      rgba(34,211,160,0.10);
  --neg:         #f55a6a;
  --neg-bg:      rgba(245,90,106,0.10);
  --text:        #e8edf8;
  --text2:       #8fa3c8;
  --text3:       #4d6690;
  --text4:       #2d4266;
  --yellow:      #f5c842;
  --yellow-bg:   rgba(245,200,66,0.09);
  --yellow-border:rgba(245,200,66,0.25);
  --purple:      #a78bfa;
  --header-h:    54px;
  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   14px;
  --font:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display:'Inter Tight', 'Inter', sans-serif;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.25);
}

/* ── RESET ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }

/* ── BASE ── */
body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── ATMOSPHERE ── */
.bg-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 60% at 15% -5%,  rgba(91,141,239,0.13) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 105%,  rgba(124,111,255,0.11) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 50%  55%,  rgba(34,211,160,0.04) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 90%  10%,  rgba(245,200,66,0.03) 0%, transparent 40%);
}

.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ── LAYOUT ── */
.app { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; padding: 16px 20px 40px; max-width: 100%; margin: 0 auto; width: 100%; box-sizing: border-box; }

/* ── HEADER ── */
header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  background: rgba(8,13,26,0.88);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.025em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  box-shadow: 0 0 18px rgba(91,141,239,0.40), inset 0 1px 0 rgba(255,255,255,0.15);
}

.logo-wordmark span { color: var(--accent); }

/* Nav */
nav {
  display: flex;
  gap: 2px;
  flex: 1;
  justify-content: center;
}

.nav-link {
  padding: 5px 13px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text3);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover  { color: var(--text2); background: var(--surface2); }
.nav-link.active { color: var(--accent); background: rgba(91,141,239,0.12); }

/* Header right */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.update-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
}

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pos);
  box-shadow: 0 0 7px var(--pos);
  flex-shrink: 0;
  animation: statusPulse 2.5s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, opacity 0.15s;
  user-select: none;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

.btn-ghost {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface3);
  color: var(--text);
  border-color: var(--border2);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  box-shadow: 0 2px 14px rgba(91,141,239,0.35);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(91,141,239,0.50);
}

/* Refresh icon spin */
.spinning { animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── LOADING BAR ── */
.loading-bar {
  height: 2px;
  border-radius: 2px;
  margin-bottom: 14px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 30%, var(--accent2) 70%, transparent 100%);
  background-size: 300% 100%;
  opacity: 0;
  transition: opacity 0.25s;
}
.loading-bar.active {
  opacity: 1;
  animation: loadSlide 1.3s ease-in-out infinite;
}
@keyframes loadSlide {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
  animation: fadeSlideUp 0.5s ease both;
}

.stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px 11px;
  overflow: hidden;
  cursor: default;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* Top accent bar */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0.7;
}
.stat-card.accent::before  { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.stat-card.green::before   { background: linear-gradient(90deg, var(--pos), #18b885); }
.stat-card.yellow::before  { background: linear-gradient(90deg, var(--yellow), #d4a008); }
.stat-card.purple::before  { background: linear-gradient(90deg, var(--purple), var(--accent2)); }

.stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 5px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text3);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}
.badge.pos { background: var(--pos-bg);  color: var(--pos); }
.badge.neg { background: var(--neg-bg);  color: var(--neg); }
.badge.muted { background: var(--surface3); color: var(--text3); }

/* ── TOOLBAR ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  animation: fadeSlideUp 0.5s 0.08s ease both;
  position: relative;
  z-index: 20;
}

.toolbar-left  { display: flex; gap: 7px; flex: 1; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 7px; flex-shrink: 0; }

/* Search */
.search-wrap {
  position: relative;
  min-width: 180px;
  flex: 1;
  max-width: 240px;
}

.search-icon {
  position: absolute;
  left: 9px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text3);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 10px 6px 30px;
  font-size: 12.5px;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input::placeholder { color: var(--text4); }
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,141,239,0.12);
}

/* Select filters */
.filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 26px 6px 10px;
  font-size: 12px;
  font-family: var(--font);
  color: var(--text2);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6H0z' fill='%234d6690'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  transition: border-color 0.15s, color 0.15s;
}
.filter-select:focus  { border-color: var(--accent); color: var(--text); }
.filter-select:hover  { border-color: var(--border2); color: var(--text); }

/* ── COLUMN PICKER ── */
.col-picker-wrap {
  position: relative;
}
.col-picker {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  z-index: 120;
  padding: 6px 0;
}
.col-picker[hidden] { display: none !important; }
.col-picker-header {
  padding: 6px 12px 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.col-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--text2);
  cursor: pointer;
  transition: background 0.12s;
}
.col-picker-item:hover {
  background: var(--hover);
}
.col-picker-item input[type="checkbox"] {
  accent-color: var(--accent);
  margin: 0;
}

/* ── ROW COUNT BAR ── */
.row-count-bar {
  font-size: 11.5px;
  color: var(--text4);
  padding: 2px 2px 6px;
  letter-spacing: 0.2px;
}

/* ── TAB BAR ── */
.tab-bar {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  width: fit-content;
  margin-bottom: 10px;
  animation: fadeSlideUp 0.4s ease both;
}

.tab {
  padding: 5px 16px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.tab:hover  { color: var(--text2); }
.tab.active {
  background: var(--surface3);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* ── TABLE WRAPPER ── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: fadeSlideUp 0.5s 0.12s ease both;
  box-shadow: var(--shadow);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Scroll hint fade on mobile */
@media (max-width: 639px) {
  .table-scroll::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 32px;
    background: linear-gradient(to left, var(--surface), transparent);
    pointer-events: none;
  }
  .table-wrap { position: relative; }
}

/* ── TABLE ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

/* ── THEAD ── */
thead tr {
  background: var(--surface2);
  border-bottom: 1px solid var(--border2);
}

th {
  padding: 8px 11px;
  text-align: right;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text3);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s, background 0.15s;
  position: sticky;
  top: 0;
  background: var(--surface2);
  z-index: 10;
}

th:first-child { text-align: left; padding-left: 14px; }
th:nth-child(2) { text-align: left; }

th:hover { color: var(--text2); background: var(--surface3); }
th.sorted { color: var(--accent); }

/* Column-specific header colors */
.col-price  th, th.col-price  { color: #c084fc; }
.col-price th:hover, th.col-price:hover { color: #d8b4fe; }
th.col-mktval { color: var(--accent); }
th.col-yield  { color: var(--pos); }
th.col-cagr   { color: var(--yellow); }

.sort-arrow {
  display: inline-block;
  margin-left: 3px;
  font-size: 9px;
  opacity: 0.45;
  vertical-align: middle;
  transition: opacity 0.15s;
}
th.sorted .sort-arrow { opacity: 1; }
th:hover .sort-arrow  { opacity: 0.7; }

/* ── TBODY ── */
tbody tr {
  border-bottom: 1px solid rgba(99,132,255,0.055);
  transition: background 0.12s;
  animation: rowSlideIn 0.35s ease both;
}

@keyframes rowSlideIn {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(91,141,239,0.055); }

/* Highlighted positions */
tbody tr.highlight {
  background: var(--yellow-bg);
  border-bottom-color: rgba(245,200,66,0.08);
}
tbody tr.highlight:hover { background: rgba(245,200,66,0.13); }

td {
  padding: 6px 11px;
  text-align: right;
  color: var(--text2);
  white-space: nowrap;
  vertical-align: middle;
}

td:first-child { text-align: left; padding-left: 14px; }
td:nth-child(2) { text-align: left; }

/* ── CELL TYPES ── */
.ticker {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.01em;
}

.ticker-wrap { display: flex; align-items: center; gap: 5px; }

.watch-badge {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(91,141,239,0.15);
  color: var(--accent);
  vertical-align: middle;
}

.company-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Sector badges */
.sector-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.sector-energy    { background: rgba(251,146,60,0.14);  color: #fb923c; }
.sector-staples   { background: rgba(34,211,160,0.12);  color: var(--pos); }
.sector-disc      { background: rgba(251,191,36,0.12);  color: #fbbf24; }
.sector-health    { background: rgba(96,165,250,0.14);  color: #60a5fa; }
.sector-financial { background: rgba(167,139,250,0.14); color: var(--purple); }
.sector-tech      { background: rgba(91,141,239,0.14);  color: var(--accent); }
.sector-industrial{ background: rgba(245,200,66,0.12);  color: var(--yellow); }
.sector-utility   { background: rgba(245,90,106,0.12);  color: var(--neg); }
.sector-reit      { background: rgba(251,113,133,0.12); color: #fb7185; }
.sector-materials { background: rgba(52,211,153,0.12);  color: #34d399; }
.sector-etf       { background: rgba(99,102,241,0.14);  color: #818cf8; }

/* Price column */
.price-val { color: #c084fc; font-weight: 600; }
td.col-price.stale .price-val { opacity: 0.5; }

/* Quantity */
.qty-cell { color: var(--accent); font-weight: 500; }

/* Changes */
.pos-val { color: var(--pos); font-weight: 500; }
.neg-val { color: var(--neg); font-weight: 500; }

/* Market value */
.col-mktval { color: var(--accent); font-weight: 500; }

/* Yield */
.yield-val { color: var(--pos); font-weight: 600; }
.yield-hi  {
  background: rgba(34,211,160,0.12);
  padding: 2px 7px;
  border-radius: 4px;
}

/* CAGR */
.cagr-val { color: var(--yellow); font-weight: 600; }

/* Muted */
.text-muted { color: var(--text4); }

/* ── ACTIONS COLUMN ── */
.col-actions {
  width: 40px;
  text-align: center !important;
  padding: 4px 6px !important;
}

.diq-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: rgba(245,90,106,0.12);
  color: var(--neg);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.diq-delete-btn:hover,
.diq-delete-btn:focus-visible {
  background: rgba(245,90,106,0.28);
  color: #fff;
}

/* ── INLINE QTY EDIT ── */
.qty-editable {
  cursor: pointer;
}

.qty-editable:hover {
  background: rgba(91,141,239,0.08);
  border-radius: 4px;
}

.qty-inline-input {
  width: 80px;
  padding: 2px 6px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text1);
  font-size: 0.92rem;
  font-weight: 500;
  text-align: right;
  outline: none;
}

.qty-inline-input:focus {
  box-shadow: 0 0 0 2px rgba(91,141,239,0.3);
}

/* ── DELETE CONFIRMATION TOOLTIP ── */
.diq-confirm-tip {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--surface2, var(--surface));
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  white-space: nowrap;
  z-index: 100;
  animation: diq-fade-in 0.12s ease-out;
}

@keyframes diq-fade-in {
  from { opacity: 0; transform: translateY(-50%) scale(0.95); }
  to   { opacity: 1; transform: translateY(-50%) scale(1); }
}

.diq-confirm-msg {
  font-size: 0.82rem;
  color: var(--text2);
}

.diq-confirm-yes,
.diq-confirm-no {
  border: none;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}

.diq-confirm-yes {
  background: var(--neg);
  color: #fff;
}

.diq-confirm-yes:hover { background: #e9404f; }

.diq-confirm-no {
  background: rgba(255,255,255,0.08);
  color: var(--text3);
}

.diq-confirm-no:hover { background: rgba(255,255,255,0.15); }

/* Hide actions column on mobile */
@media (max-width: 639px) {
  .col-actions { display: none; }
}

/* ── LOGO COLUMN ── */
.col-logo { text-align: center !important; width: 56px; padding: 4px 6px !important; }

.logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--logo-bg, rgba(255,255,255,0.06));
  border: 1px solid var(--logo-border, rgba(255,255,255,0.08));
  overflow: hidden;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

tr:hover .logo-wrap {
  background: var(--logo-bg-hover, rgba(255,255,255,0.10));
  border-color: var(--logo-border-hover, rgba(255,255,255,0.14));
}

.logo-wrap img {
  width: 28px; height: 28px;
  object-fit: contain;
  display: block;
}

.logo-fallback {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--accent);
  line-height: 1;
  text-align: center;
  padding: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 34px;
}

/* ── FLASH ANIMATIONS (price refresh) ── */
@keyframes flashPos {
  0%   { background: rgba(34,211,160,0.22); }
  100% { background: transparent; }
}
@keyframes flashNeg {
  0%   { background: rgba(245,90,106,0.22); }
  100% { background: transparent; }
}
.flash-pos { animation: flashPos 1.5s ease forwards; }
.flash-neg { animation: flashNeg 1.5s ease forwards; }

/* ── TFOOT ── */
tfoot tr {
  background: var(--surface2);
  border-top: 1px solid var(--border2);
}

tfoot td {
  padding: 7px 11px;
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
}

tfoot td:first-child { padding-left: 14px; font-size: 10px; letter-spacing: 0.05em; color: var(--text3); text-transform: uppercase; }

.totals-cell strong { color: var(--text); }

/* ── DIVIQ SCORE TABLE ── */
.q-held .ticker { color: var(--pos); }

.q-high { color: var(--pos); font-weight: 600; }
.q-mid  { color: var(--yellow); font-weight: 500; }
.q-low  { color: var(--neg); font-weight: 500; }

.diviq-green { color: var(--pos);    font-weight: 700; font-size: 13px; }
.diviq-amber { color: var(--yellow); font-weight: 700; font-size: 13px; }
.diviq-red   { color: var(--neg);    font-weight: 700; font-size: 13px; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center !important;
  padding: 48px 20px !important;
  color: var(--text3);
  font-size: 13px;
}

/* ── FOOTER ── */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 10.5px;
  color: var(--text4);
  animation: fadeSlideUp 0.5s 0.3s ease both;
}

.source-pills { display: flex; gap: 5px; flex-wrap: wrap; }

.source-pill {
  padding: 2px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
}

.build-stamp {
  font-size: 9px;
  color: var(--text3);
  opacity: 0.5;
  margin-top: 6px;
  font-family: monospace;
}

/* ── PAGE LOAD ANIMATIONS ── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SCROLLBARS ── */
::-webkit-scrollbar         { width: 5px; height: 5px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: var(--surface4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }

/* ── FOCUS RINGS (accessibility) ── */
.btn:focus-visible,
.nav-link:focus-visible,
.tab:focus-visible,
.search-input:focus-visible,
.filter-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE — TABLET (640–1023px)
   ═══════════════════════════════════════════ */
@media (max-width: 1023px) {
  main { padding: 12px 14px 32px; }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  nav { display: none; } /* Use tab bar instead on tablet */

  .logo-wordmark { font-size: 14px; }

  /* Hide less-critical columns on tablet */
  th.col-company, td.col-company,
  th.col-sector,  td.col-sector  { display: none; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — MOBILE (< 640px)
   ═══════════════════════════════════════════ */
@media (max-width: 639px) {
  :root { --header-h: 50px; }
  main { padding: 10px 10px 24px; }

  header { padding: 0 12px; }

  .logo-icon { width: 24px; height: 24px; font-size: 11px; }
  .logo-wordmark { font-size: 13px; }

  .header-right { gap: 6px; }
  .update-status { display: none; }

  .btn { padding: 5px 10px; font-size: 11.5px; }
  #download-btn .btn-label { display: none; } /* icon only on mobile */
  #import-btn .btn-label { display: none; } /* icon only on mobile */

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
    margin-bottom: 10px;
  }

  .stat-card { padding: 10px 12px 9px; }
  .stat-value { font-size: 18px; }
  .stat-meta  { font-size: 10px; }

  .toolbar { gap: 6px; }
  .toolbar-left { gap: 6px; }
  .search-wrap  { max-width: 100%; min-width: 120px; }

  /* On mobile, hide some filters to save space */
  .filter-select.hide-mobile { display: none; }

  .tab-bar { overflow-x: auto; max-width: 100%; }
  .tab { padding: 5px 12px; font-size: 11.5px; }

  /* Mobile table: only key columns visible */
  table { font-size: 12px; }
  th, td { padding: 6px 8px; }
  th:first-child, td:first-child { padding-left: 10px; }

  .stat-value { font-size: 17px; }

  /* Tighter logo */
  .col-logo { width: 44px; }
  .logo-wrap { width: 30px; height: 30px; border-radius: 7px; }
  .logo-wrap img { width: 22px; height: 22px; }

  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 10px;
  }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — LARGE DESKTOP (> 1400px)
   ═══════════════════════════════════════════ */
@media (min-width: 1400px) {
  main { padding: 18px 32px 48px; }
  .stats-grid { gap: 12px; }
  .stat-value { font-size: 23px; }
}

/* ═══════════════════════════════════════════
   SENSITIVITY VIEW (DDM Analysis)
   ═══════════════════════════════════════════ */
.sensitivity-view { padding: 0; }

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

.sens-stock-select {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 14px;
  min-width: 280px;
}

.sens-current-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-display);
}

.sens-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

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

.sens-input-group label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sens-input-group input {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: var(--font);
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
}

.sens-input-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Sensitivity grid table */
.sens-grid-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.sens-grid {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.sens-grid th {
  background: var(--surface2);
  color: var(--text2);
  font-weight: 600;
  padding: 10px 14px;
  text-align: center;
  border: 1px solid var(--border);
  white-space: nowrap;
  font-size: 12px;
}

.sens-grid th.sens-corner {
  background: var(--surface);
  color: var(--text3);
  font-size: 10px;
}

.sens-grid td {
  padding: 10px 14px;
  text-align: center;
  border: 1px solid var(--border);
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s;
}

.sens-grid .sens-row-header {
  background: var(--surface2);
  color: var(--text2);
  font-weight: 600;
  text-align: right;
  font-size: 12px;
}

/* Color coding */
.sens-undervalued {
  background: var(--pos-bg);
  color: var(--pos);
}

.sens-overvalued {
  background: var(--neg-bg);
  color: var(--neg);
}

.sens-na {
  color: var(--text3);
  font-style: italic;
}

.sens-base-case {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  font-weight: 700;
}

/* Legend */
.sens-legend {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text2);
}

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

.sens-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.sens-empty {
  padding: 40px;
  text-align: center;
  color: var(--text3);
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════════
   Newbie-Friendly UX — Info Tooltips & How It Works
   Reusable across all tabs. See copilot-instructions.md § Newbie-Friendly UX
   ═══════════════════════════════════════════════════════════════════ */

/* ── Info Tooltip (ⓘ) ── */
.diq-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-alt, var(--surface));
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  transition: background 0.15s;
  line-height: 1;
}
.diq-info:hover,
.diq-info:focus {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Balloon */
.diq-info::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg, var(--surface));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  width: max-content;
  max-width: 280px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.diq-info:hover::after,
.diq-info:focus::after {
  opacity: 1;
  visibility: visible;
}

/* Arrow */
.diq-info::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 101;
}
.diq-info:hover::before,
.diq-info:focus::before {
  opacity: 1;
  visibility: visible;
}

/* ── How It Works Expandable ── */
.diq-how-it-works {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  overflow: hidden;
}
.diq-how-it-works summary {
  padding: 12px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  list-style: none;
}
.diq-how-it-works summary::-webkit-details-marker { display: none; }
.diq-how-it-works summary::before {
  content: '\25B6';
  font-size: 9px;
  transition: transform 0.2s;
}
.diq-how-it-works[open] summary::before {
  transform: rotate(90deg);
}
.diq-how-it-works .diq-hiw-body {
  padding: 0 18px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text2);
}
.diq-how-it-works .diq-hiw-body p {
  margin: 0 0 10px;
}
.diq-how-it-works .diq-hiw-body strong {
  color: var(--text);
}
.diq-how-it-works .diq-hiw-body .diq-example {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  margin: 10px 0;
  font-size: 12px;
}
.diq-how-it-works .diq-hiw-body .diq-formula {
  font-family: 'Courier New', monospace;
  background: color-mix(in srgb, var(--surface) 80%, var(--accent));
  padding: 8px 12px;
  border-radius: 6px;
  display: inline-block;
  margin: 6px 0;
  font-size: 13px;
  color: var(--text);
}

/* ═══════════════════════════════════════════
   PORTFOLIO IMPORT
   ═══════════════════════════════════════════ */
.import-overlay .settings-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

.import-file-zone {
  padding: 1.5rem;
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  text-align: center;
  margin: 16px 0;
  transition: border-color 0.2s;
}
.import-file-zone:hover {
  border-color: var(--accent);
}
.import-file-label {
  display: block;
  color: var(--text2);
  font-size: 13px;
  margin-bottom: 8px;
}
.import-file-zone input[type="file"] {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
}
.import-file-name {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text3);
}

.import-error {
  color: var(--neg);
  background: var(--neg-bg);
  border: 1px solid var(--neg);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin: 10px 0;
}

.import-warning {
  color: var(--yellow);
  background: var(--yellow-bg);
  border: 1px solid var(--yellow-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin: 10px 0;
}

.import-sheet-note {
  color: var(--text2);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  margin: 8px 0;
}

.import-mode-group {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 14px 0;
  font-size: 13px;
  color: var(--text);
}
.import-mode-label {
  color: var(--text2);
  font-weight: 500;
}
.import-radio-label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.import-radio-label input[type="radio"] {
  accent-color: var(--accent);
}

.import-preview {
  max-height: 400px;
  overflow-y: auto;
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.import-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}
.import-table th {
  background: var(--surface2);
  color: var(--text2);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.import-th-check {
  width: 36px;
}
.import-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.import-table tr:last-child td {
  border-bottom: none;
}

.import-row-valid .import-status { color: var(--pos); }
.import-row-invalid .import-status { color: var(--neg); }
.import-row-invalid { opacity: 0.6; }
.import-row-duplicate .import-status { color: var(--yellow); }
.import-row-pending .import-status { color: var(--text3); }
.import-row-validating .import-status { color: var(--text2); }

.import-ticker {
  font-weight: 600;
  font-family: var(--font);
  letter-spacing: 0.02em;
}
.import-company {
  color: var(--text2);
  font-size: 12px;
}

.import-progress-wrap {
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.import-progress {
  flex: 1;
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  overflow: hidden;
}
.import-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}
.import-progress-text {
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
}

.import-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0;
  gap: 12px;
}

.import-confirm-panel {
  background: var(--neg-bg);
  border: 1px solid var(--neg);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 13px;
  color: var(--text);
}
.import-confirm-panel p {
  margin-bottom: 12px;
}
.import-confirm-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.import-btn-destructive {
  background: var(--neg);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.import-btn-destructive:hover {
  opacity: 0.85;
}

.import-success {
  text-align: center;
  padding: 40px 20px;
}
.import-success-icon {
  font-size: 48px;
  color: var(--pos);
  margin-bottom: 16px;
}
.import-success-text {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 20px;
}

/* Mobile responsive — sensitivity */
@media (max-width: 768px) {
  .sens-header {
    flex-direction: column;
    align-items: stretch;
  }
  .sens-stock-select { min-width: 100%; }
  .sens-inputs {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .sens-inputs {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════
   ADD TICKER MODAL
   ═══════════════════════════════════════════ */

/* Lookup row */
.atm-lookup-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.atm-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-transform: uppercase;
}
.atm-input::placeholder { color: var(--text4); text-transform: none; }
.atm-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,141,239,0.12);
}

/* Number input — no text-transform, themed spinner */
.atm-input[type="number"] { text-transform: none; max-width: 200px; }

/* Hide default browser spinner arrows */
.atm-input[type="number"]::-webkit-outer-spin-button,
.atm-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.atm-input[type="number"] { -moz-appearance: textfield; }

/* Error message */
.atm-error {
  margin: 12px 0;
  padding: 10px 14px;
  background: var(--neg-bg);
  color: var(--neg);
  border: 1px solid rgba(245,90,106,0.25);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

/* Validation result */
.atm-result {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 14px 16px;
  background: var(--pos-bg);
  border: 1px solid rgba(34,211,160,0.25);
  border-radius: 10px;
}

.atm-valid-icon {
  font-size: 22px;
  color: var(--pos);
  font-weight: 700;
  flex-shrink: 0;
}

.atm-valid-info { flex: 1; }

.atm-valid-company {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.atm-valid-detail {
  font-size: 13px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Radio group */
.atm-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.atm-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.atm-radio-label:hover {
  border-color: var(--border2);
  background: var(--surface2);
}

.atm-radio-label input[type="radio"] {
  accent-color: var(--accent);
  margin: 0;
  flex-shrink: 0;
}

/* Submit button */
.atm-submit-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  margin-top: 16px;
  justify-content: center;
}

/* Add Ticker button in toolbar */
.btn-add-ticker {
  font-size: 12.5px;
}

@media (max-width: 639px) {
  .btn-add-ticker .btn-label { display: none; }
}

/* ── Monte Carlo View ── */
.montecarlo-view { padding: 0 24px 24px; }

.mc-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.mc-mode-toggle {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}

.mc-mode-btn {
  flex: 1;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  transition: all 0.2s;
}

.mc-mode-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.mc-mode-btn:hover:not(.active) {
  border-color: var(--border2);
  background: var(--surface3);
}

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

.mc-input-group label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}

.mc-input-group input,
.mc-input-group select {
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
}

.mc-input-group input:focus,
.mc-input-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.mc-checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.mc-ticker-select { grid-column: 1 / -1; }

.mc-target-group { grid-column: 1 / -1; }

.mc-run-btn { grid-column: 1 / -1; margin-top: 8px; }

.mc-cagr-hint {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
}

.mc-chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.mc-chart-container h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.mc-chart-container canvas {
  width: 100%;
  display: block;
}

.mc-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.mc-summary table {
  width: 100%;
  border-collapse: collapse;
}

.mc-summary th,
.mc-summary td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.mc-summary th { color: var(--text2); font-weight: 500; }
.mc-summary td { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.mc-progress {
  grid-column: 1 / -1;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  height: 24px;
  overflow: hidden;
  position: relative;
}

.mc-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-sm);
  transition: width 0.3s;
  width: 0%;
}

.mc-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  color: var(--text);
  font-weight: 500;
}

.mc-warning {
  padding: 12px 16px;
  background: var(--yellow-bg);
  border: 1px solid var(--yellow-border);
  border-radius: var(--radius-sm);
  color: var(--yellow);
  font-size: 12px;
  grid-column: 1 / -1;
}

.mc-error {
  padding: 12px 16px;
  background: var(--neg-bg);
  border: 1px solid var(--neg);
  border-radius: var(--radius-sm);
  color: var(--neg);
  font-size: 12px;
  grid-column: 1 / -1;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Monte Carlo — Responsive */
@media (max-width: 768px) {
  .montecarlo-view { padding: 0 12px 12px; }
  .mc-controls {
    grid-template-columns: 1fr;
    padding: 16px;
  }
}
