.broker-chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke2);
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.78);
  font-weight: 850;
  font-size: 11px;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

/* Subtle brand tints (keep them in-family) */
.broker-chip--fidelity{
  border-color: rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.10);
  color: rgba(255,255,255,0.86);
}

.broker-chip--robinhood{
  border-color: rgba(99, 255, 122, 0.28);
  background: rgba(99, 255, 122, 0.08);
  color: rgba(255,255,255,0.86);
}

.broker-chip--schwab{
  border-color: rgba(255, 184, 107, 0.28);
  background: rgba(255, 184, 107, 0.08);
  color: rgba(255,255,255,0.86);
}

.broker-chip--vanguard{
  border-color: rgba(45, 226, 230, 0.26);
  background: rgba(45, 226, 230, 0.07);
  color: rgba(255,255,255,0.86);
}

/* ===== Calendar: compact payout pills on mobile (stack ticker + amount) ===== */

/* Defensive: if any legacy dot elements exist in old markup, hide them */
.cal-pill .dot,
.cal-pill .sep,
.cal-pill .bullet,
.cal-pill .mid-dot,
.cal-pill-dot,
.cal-pill .cal-pill-dot,
.cal-payout-pill .cal-pill-dot,
.cal-event-pill .cal-pill-dot {
  display: none !important;
}

/* Base (desktop/tablet): keep the current single-line look */
.cal-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* Dot separator is CSS-generated on desktop so we can remove it on mobile */
.cal-pill .cal-pill-amt::before{
  content: "•";
  display: inline-block;
  margin: 0 8px 0 6px;
  color: rgba(255,255,255,0.78);
  font-weight: 900;
}

/* Mobile: tighter + stacked (no dot) */
@media (max-width: 520px){
  .chip.cal-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 16px;
    font-size: 12px;
    line-height: 1.1;
  }

  .cal-pill .cal-pill-ticker{
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.05;
  }

  .cal-pill .cal-pill-amt{
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
  }

  .cal-pill .cal-pill-amt::before{
    content: "";
    margin: 0;
  }

  .chip.cal-pill .cal-pill-ticker,
  .chip.cal-pill .cal-pill-amt{
    display: block;
  }

  .chip.cal-pill .cal-pill-amt::before{ content:""; margin:0; }
}

/* ===== Income by month chart: always-visible value labels (desktop only) ===== */
.bar-value{
  display: none; /* default off (mobile/tablet) */
}

@media (min-width: 901px){
  /* Assumes each bar is position: relative; if not, we set it defensively below */
  .income-bar,
  .month-bar,
  .bar,
  .forecast-month-amt {
    position: relative;
  }

  .bar-value{
    display: block;
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 800;
    color: rgba(255,255,255,0.86);
    white-space: nowrap;
    text-shadow: 0 10px 28px rgba(0,0,0,0.70);
    pointer-events: none;
  }
}
/* ===== Dividend Alerts: snooze duration dropdown ===== */
.snooze {
  position: relative;
  display: inline-flex;
  align-items: center;
  /* Create a local stacking context for the menu */
  z-index: 1;
}

/* When open, lift above the row so nothing in the row can overlap it */
.snooze.is-open {
  z-index: 80;
}

.snooze-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);

  /* Must sit above everything in the row + nearby rows */
  z-index: 9999;

  min-width: 140px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--stroke2);

  /* Fully opaque surface so nothing can visually "bleed" through */
  background: #0a0c16;

  /* Keep the depth */
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55);

  display: grid;
  gap: 6px;

  /* Defensive: avoid blending / compositing weirdness */
  isolation: isolate;
  transform: translateZ(0);
}

 
.snooze-item {
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.snooze-item:hover {
  border-color: var(--stroke2);
  background: rgba(255, 255, 255, 0.04);
}

.snooze.is-open .snooze-menu {
  animation: snooze-pop 140ms ease-out 1;
}

@keyframes snooze-pop {
  from { transform: translateY(-4px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
li.list-row.alert-row {
  display: grid;
  align-items: center;
}

/* ===== Dividend Alerts: clickable rows ===== */
.alert-row {
  cursor: pointer;
}

/* Only apply hover highlight when the row does NOT have an open snooze menu */
.alert-row:not(.snooze-open):hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

/* When a snooze menu is open, keep the row surface stable (no hover brightening). */
li.list-row.alert-row.snooze-open,
li.list-row.alert-row.snooze-open:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.08);
}

/* When a snooze menu is open, lift the whole row above adjacent rows */
li.list-row.alert-row.snooze-open {
  position: relative;
  z-index: 60;
}

.alert-row:focus {
  outline: none;
}

.alert-row:focus-visible {
  outline: 2px solid rgba(124, 92, 255, 0.55);
  outline-offset: 3px;
}

.alert-row .btn {
  cursor: pointer;
}


/* ===== Dividend Alerts: window select polish ===== */
#dividend-alerts-card #alerts-window {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--stroke2);
  color: var(--text);
}

#dividend-alerts-card #alerts-window:hover {
  filter: brightness(1.06);
}

#dividend-alerts-card .card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== Analytics export modal: custom checkbox ===== */
#analytics-export-modal label.export-option input[type="checkbox"]{
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

#analytics-export-modal label.export-option input[type="checkbox"]::after{
  content: "";
  width: 7px;
  height: 11px;
  border-right: 2px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 1px;
  transform: translateY(-1px) rotate(45deg) scale(0.9);
  transition: transform 120ms ease, border-color 120ms ease;
}

#analytics-export-modal label.export-option input[type="checkbox"]:checked{
  border-color: rgba(124, 92, 255, 0.55);
  background: rgba(124, 92, 255, 0.14);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.20) inset;
}

#analytics-export-modal label.export-option input[type="checkbox"]:checked::after{
  border-right-color: rgba(255, 255, 255, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px) rotate(45deg) scale(1);
}

#analytics-export-modal label.export-option input[type="checkbox"]:hover{
  filter: brightness(1.08);
}

#analytics-export-modal label.export-option input[type="checkbox"]:focus{
  outline: none;
}

#analytics-export-modal label.export-option input[type="checkbox"]:focus-visible{
  outline: 2px solid rgba(124, 92, 255, 0.55);
  outline-offset: 3px;
}

/* Disable affordance for confirm button when nothing is selected */
#analytics-export-modal #analytics-export-confirm:disabled{
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

#analytics-export-modal #analytics-export-helper{
  margin-top: 10px;
}

/* ===== Donate: tap-to-expand QR (mobile only) ===== */
#donate-qr-modal.modal{
  border: 0;
  padding: 0;
  background: transparent;
}

#donate-qr-modal::backdrop{
  background: rgba(0,0,0,0.70);
  backdrop-filter: blur(6px);
}

#donate-qr-modal .qr-modal-card{
  width: min(92vw, 420px);
  margin: auto;
}

#donate-qr-modal .qr-modal-body{
  padding: 14px;
  display: grid;
  place-items: center;
}

#donate-qr-modal .qr-zoom-img{
  width: min(78vw, 340px);
  height: auto;
  display: block;
  border-radius: 18px;
  border: 1px solid var(--stroke2);
  box-shadow: 0 22px 60px rgba(0,0,0,0.60);
  background: rgba(0,0,0,0.20);
}

/* Make the inline QR feel tappable only on mobile */
@media (max-width: 430px){
  .donate-copy-mobile .bmc-qr-inline{
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .donate-copy-mobile .bmc-qr-inline:active{
    transform: scale(0.985);
  }
}

/* ===== Forecast summary insight (replaces mini chart) ===== */
.forecast-insight {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--stroke2);
}

.forecast-insight b {
  font-weight: 850;
  color: rgba(255, 255, 255, 0.92);
}
/* ===== CSV Import Preview: row-level status badges ===== */
.csv-modal-rows {
  width: 100%;
}

.csv-preview-table-wrap {
  width: 100%;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--stroke2);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
}

.csv-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.csv-preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 10px 10px;
  background: rgba(10, 12, 22, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--stroke2);
  color: rgba(255, 255, 255, 0.86);
  font-weight: 750;
}

.csv-preview-table tbody td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.csv-preview-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.csv-cell-ticker code {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.csv-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke2);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.80);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.csv-status.is-new {
  border-color: rgba(99, 255, 122, 0.35);
  background: rgba(99, 255, 122, 0.10);
  color: rgba(99, 255, 122, 0.95);
  box-shadow: 0 0 0 1px rgba(99, 255, 122, 0.12) inset;
}

.csv-status.is-update {
  border-color: rgba(255, 184, 107, 0.40);
  background: rgba(255, 184, 107, 0.10);
  color: rgba(255, 184, 107, 0.95);
  box-shadow: 0 0 0 1px rgba(255, 184, 107, 0.12) inset;
}

.csv-status.is-same {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.70);
}

/* ===== CSV Import Preview: impact summary pills ===== */
.csv-impact-summary {
  width: 100%;
  margin: 10px 0 12px 0;
}

.csv-impact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.csv-impact-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke2);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.80);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.csv-impact-pill b {
  font-weight: 850;
}

.csv-impact-num {
  display: inline-flex;
  min-width: 22px;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.88);
}

.csv-impact-pill.is-new {
  border-color: rgba(99, 255, 122, 0.35);
  background: rgba(99, 255, 122, 0.10);
}

.csv-impact-pill.is-update {
  border-color: rgba(255, 184, 107, 0.40);
  background: rgba(255, 184, 107, 0.10);
}

.csv-impact-pill.is-same {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

.csv-impact-pill.is-removed {
  border-color: rgba(255, 92, 168, 0.45);
  background: rgba(255, 92, 168, 0.12);
}

.csv-impact-pill.is-kept {
  border-color: rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.10);
}

/* When overwrite is selected, make the summary feel a bit more "danger" */
#csv-modal.is-danger .csv-impact-pill.is-removed {
  box-shadow: 0 0 0 1px rgba(255, 92, 168, 0.18) inset;
}

/* ===== CSV Import Preview: overwrite danger banner ===== */
.csv-danger {
  width: 100%;
  margin: 8px 0 10px 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 92, 168, 0.35);
  background: rgba(255, 92, 168, 0.10);
  color: rgba(255, 255, 255, 0.88);
}

.csv-danger-title {
  font-weight: 900;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.csv-danger-sub {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  line-height: 1.35;
}

.csv-impact-pill--mode {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.72);
}


:root {
  --bg: #070a12;
  --panel: rgba(255, 255, 255, 0.06);
  --panel2: rgba(255, 255, 255, 0.035);
  --stroke: rgba(255, 255, 255, 0.1);
  --stroke2: rgba(255, 255, 255, 0.07);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --muted2: rgba(255, 255, 255, 0.45);

  --radius: 18px;
  --radius2: 22px;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
  --glow: 0 0 0 1px var(--stroke), 0 22px 60px rgba(0, 0, 0, 0.55);

  --pad: 18px;
  --gap: 14px;

  /* chart colors (not “framework colors”; just tokens) */
  --c1: #7c5cff;
  --c2: #2de2e6;
  --c3: #ffb86b;
  --c4: #63ff7a;
  --c5: #ff5ca8;

  --good: rgba(99, 255, 122, 0.95);
  --bad: rgba(255, 92, 168, 0.95);
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  overflow-x: hidden; /* Prevent any page-level horizontal scroll */
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  color: var(--text);
  background: radial-gradient(
      900px 600px at 20% 10%,
      rgba(124, 92, 255, 0.16),
      transparent 60%
    ),
    radial-gradient(
      800px 500px at 85% 25%,
      rgba(45, 226, 230, 0.1),
      transparent 55%
    ),
    radial-gradient(
      900px 650px at 50% 120%,
      rgba(255, 92, 168, 0.09),
      transparent 60%
    ),
    var(--bg);
}

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

h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.2px;
}

h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.2px;
}
p {
  margin: 0;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.right {
  margin-left: auto;
  text-align: right;
}
.num {
  text-align: right;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  padding: 18px;
  border-right: 1px solid var(--stroke2);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.015)
  );
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--stroke2);
  text-align: center;
}

.brand-mark {
  width: 150px;
  height: 150px;
  border-radius: 22px;
  background: url("assets/money-tree.webp") center / cover no-repeat;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 18px 60px rgba(124, 92, 255, 0.26);
}

/* Keep the brand mark from feeling huge on small screens */
@media (max-width: 980px) {
  .brand-mark {
    width: 200px;
    height: 200px;
    border-radius: 18px;
  }
}

.brand-name {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.05;
  width: 100%;
  text-align: center;
}

.brand-name-line {
  display: block;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  text-align: center;
}

/* ===== Portfolio switcher (sidebar) — pill dropdown ===== */
.portfolio-switch {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.portfolio-switch .label {
  font-size: 12px;
  color: var(--muted);
}

/* Wrap lets us anchor the dropdown */
.portfolio-switcher {
  position: relative;
  display: grid;
  gap: 10px;
  overflow: visible;
}

/* Keep the real <select> for accessibility + JS, but visually hide it (sr-only) */
#portfolio-select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The clickable pill */
#portfolio-toggle {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  min-height: 42px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

#portfolio-toggle:hover {
  filter: brightness(1.06);
  border-color: var(--stroke);
  background: rgba(255, 255, 255, 0.04);
}

#portfolio-toggle:active {
  transform: translateY(1px);
}

/* Focus ring (keyboard) */
#portfolio-toggle:focus {
  outline: none;
}

#portfolio-toggle:focus-visible {
  outline: 2px solid rgba(124, 92, 255, 0.55);
  outline-offset: 3px;
}

/* Text inside the pill */
#portfolio-pill-label {
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chevron (works if you used a <span class="chev">▾</span> or similar) */
#portfolio-toggle .chev {
  position: relative;
  font-size: 20px;                /* slightly larger */
  color: rgba(255,255,255,0.75);  /* brighter than muted */
  line-height: 1;
  flex: 0 0 auto;
  transition:
    transform 160ms ease,
    color 160ms ease,
    filter 160ms ease;
}

#portfolio-toggle .chev::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  background: rgba(124,92,255,0.08);
  opacity: 0;
  transition: opacity 160ms ease;
}

#portfolio-toggle:hover .chev::before,
#portfolio-toggle[aria-expanded="true"] .chev::before {
  opacity: 1;
}

#portfolio-toggle:hover .chev {
  color: rgba(255,255,255,0.9);
  filter: drop-shadow(0 0 6px rgba(124,92,255,0.35));
}

#portfolio-toggle[aria-expanded="true"] .chev {
  transform: rotate(180deg);
  color: rgba(255,255,255,0.95);
  filter: drop-shadow(0 0 8px rgba(124,92,255,0.55));
}

/* Dropdown menu – animated open  */
#portfolio-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--stroke2);
  background: rgba(10, 12, 22, 0.92);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  display: none; /* JS toggles open */
  transform-origin: top;
  transform: translateY(-6px) scale(0.98);
  opacity: 0;
  transition: opacity 140ms ease, transform 140ms ease;
}

/* When open */
#portfolio-menu.is-open {
  display: grid;
  gap: 6px;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Allow either class name from JS */
#portfolio-menu.open {
  display: grid;
  gap: 6px;
}

/* Menu items */
#portfolio-menu .port-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  user-select: none;
}

 #portfolio-menu .port-item:hover {
  border-color: var(--stroke2);
  background: rgba(255, 255, 255, 0.04);
}

#portfolio-menu .port-item.is-active {
  border-color: rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.10);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.18) inset;
}

#portfolio-menu .port-item.is-active .port-check{
  color: rgba(255,255,255,0.9);
  font-weight: 900;
}

#portfolio-menu .port-item .port-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#portfolio-menu .port-item .port-check {
  font-size: 12px;
  color: var(--muted);
  flex: 0 0 auto;
}

#portfolio-menu .port-check {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  flex: 0 0 auto;
}

#portfolio-menu,
#portfolio-menu * {
  pointer-events: auto;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px;
  margin-top: 10px;
}

.nav-item {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--stroke2);
}

.nav-item.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--stroke);
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pill {
  position: relative;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.25),
    /* thin outer stroke */ 0 6px 22px rgba(124, 92, 255, 0.18); /* soft glow */
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke2);
  color: var(--muted);
  font-size: 13px;
}

.pill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px; /* thickness of gradient border */
  background: linear-gradient(
    135deg,
    rgba(124, 92, 255, 0.4),
    rgba(45, 226, 230, 0.25)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.65; /* keep it subtle */
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(99, 255, 122, 0.9);
  box-shadow: 0 0 0 4px rgba(99, 255, 122, 0.1);
}

.main {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/*
  Content width guardrails
  On large screens some sections (Analytics/Settings/Monetization) can feel
  like they run edge-to-edge. Keep a comfortable reading width and center
  content inside the main column.
*/
.main > header,
.main > section {
  max-width: 1500px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

#analytics, #settings, #monetization, footer {
  max-width: 1650px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Slightly larger side padding on wide screens (optional, but feels nicer) */
@media (min-width: 1100px) {
  .main {
    padding-left: 32px;
    padding-right: 32px;
  }
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: radial-gradient(
      circle at 20% 10%,
      rgba(255, 255, 255, 0.12),
      transparent 60%
    ),
    rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:active {
  transform: translateY(1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--stroke2);
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
}

/* Copied state for wallet copy button */
.btn.is-copied{
  border-color: rgba(99, 255, 122, 0.35);
  background: rgba(99, 255, 122, 0.10);
  color: rgba(255, 255, 255, 0.92);
  filter: brightness(1.02);
}

/* Center the Import label text */
#btn-import {
  display: flex;
  justify-content: center;
  text-align: center;
}

/* Match dropdown styling to site theme */
#import-mode {
  width: 100%;
  padding: 10px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--stroke2);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  outline: none;
  appearance: none;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  text-align: center;
  text-align-last: center; /* centers the selected option text */
}

#import-mode:hover {
  filter: brightness(1.06);
}

#import-mode:focus {
  border-color: rgba(124, 92, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.12);
}

#btn-export,
#btn-import,
#import-mode {
  width: 100%;
}

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

.section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 26px;
  scroll-margin-top: 18px; /* nicer anchor jumps */
  padding-inline: 2px;     /* subtle inset so section heads don’t feel edge-to-edge */
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-head h2 {
  margin-bottom: 4px;
}

.section-head p {
  margin-top: 4px;
}

.section-head-actions {
  gap: 12px; 
  margin-top: 6px;
  align-items: center;
}

.dashboard-logo {
  display: block;
  margin: 0 auto 12px auto;
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(0,255,0,0.15);
  border: 1px solid rgba(255,255,255,0.08);
}

/* Holdings cards (mobile-first) */
.holdings-cards {
  display: none; /* desktop default */
  gap: 12px;
}

.holding-card {
  border-radius: var(--radius2);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--stroke2);
  padding: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.holding-card:hover {
  filter: brightness(1.04);
}
.holding-card:active {
  transform: translateY(1px);
}

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

.hc-logo {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  border: 1px solid var(--stroke2);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 800;
  flex: 0 0 auto;
}

.hc-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hc-name {
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hc-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

/* ===== Settings: toggle control (used for broker badge visibility) ===== */
.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pref-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
}

.pref-label .title {
  font-weight: 750;
}

.pref-label .desc {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

/* iOS-ish switch */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch-ui {
  width: 46px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--stroke2);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset;
  position: relative;
  transition: filter 140ms ease, background 140ms ease, border-color 140ms ease;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 22px rgba(0,0,0,0.35);
  transition: transform 160ms ease, background 140ms ease;
}

.switch input:checked + .switch-ui {
  background: rgba(99, 255, 122, 0.14);
  border-color: rgba(99, 255, 122, 0.35);
}

.switch input:checked + .switch-ui::after {
  transform: translate(18px, -50%);
}

.switch input:focus-visible + .switch-ui {
  outline: 2px solid rgba(124, 92, 255, 0.55);
  outline-offset: 3px;
}


/* ===== Broker badge (Fidelity / Robinhood) ===== */
.broker-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.78);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  user-select: none;
  white-space: nowrap;
}

/* Variant tints (subtle) */
.broker-chip--fidelity {
  border-color: rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.10) inset;
}

.broker-chip--robinhood {
  border-color: rgba(45, 226, 230, 0.35);
  background: rgba(45, 226, 230, 0.10);
  color: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 1px rgba(45, 226, 230, 0.10) inset;
}

/* Table/company cell layout helpers (safe even if unused in some views) */
.company-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.company-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.company-name {
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.company-sub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.imported-at {
  font-weight: 800;
  color: rgba(255, 255, 255, 0.78);
}

.hc-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.hc-item .label {
  font-size: 11px;
  color: var(--muted2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hc-item .value-sm {
  margin-top: 6px;
  font-weight: 750;
}

.hc-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}

.hc-actions .btn {
  flex: 1 1 auto;
}

/* Expandable details */
.hc-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke2);
  display: none;
}

.holding-card.expanded .hc-details {
  display: block;
}

/* Switch to cards on mobile */
@media (max-width: 720px) {
  .table-wrap {
    display: none;
  }
  .holdings-cards {
    display: grid;
  }
}

.card {
  border-radius: var(--radius2);
  background: radial-gradient(
      700px 350px at 20% 0%,
      rgba(124, 92, 255, 0.12),
      transparent 60%
    ),
    radial-gradient(
      600px 350px at 95% 35%,
      rgba(45, 226, 230, 0.1),
      transparent 55%
    ),
    rgba(255, 255, 255, 0.035);
  border: 1px solid var(--stroke2);
  box-shadow: var(--glow);
  padding: var(--pad);
  overflow: hidden;
}

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

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: var(--muted2);
}

.card-title {
  font-size: 16px;
  margin-top: 4px;
}

.badge {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.link {
  font-size: 13px;
  color: var(--muted);
}
.link:hover {
  color: var(--text);
}

.span-4 {
  grid-column: span 4;
}

.span-6 {
  grid-column: span 6;
}

.span-12 {
  grid-column: span 12;
}


.estimates {
  display: grid;
  /* Use minmax(0, 1fr) so grid items can actually shrink on mobile (prevents right-side cutoff) */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.estimate .value,
.estimate .sub {
  min-width: 0;
}

/* Dashboard: keep headline numbers fully visible without spilling out (supports up to ~$999,999 cleanly) */
.estimate .value{
  max-width: 100%;

  /* Default: keep on one line, but never overflow the tile */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip; /* no ellipsis */

  /* Scale with the tile width (container query units) */
  font-size: clamp(16px, 12cqi, 24px);
  line-height: 1.1;
  letter-spacing: 0.1px;
  font-variant-numeric: tabular-nums;
}

/* Ultra-narrow fallback: wrap instead of clipping */
@container (max-width: 140px){
  .estimate .value{
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Fallback for browsers without container query units */
@supports not (font-size: 1cqi){
  .estimate .value{
    font-size: clamp(16px, 2.6vw, 24px);
  }
}

/* Mobile fallback: wrap if tiles stack and get narrow */
@media (max-width: 520px){
  .estimate .value{
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Each estimate tile can size its own number (prevents spillover) */
.estimate {
  min-width: 0;
  /* lets us scale text based on the tile width */
  container-type: inline-size;
  /* keep long numbers inside the rounded tile */
  overflow: hidden;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--stroke2);
  min-height: 104px; /* tuned for value + subtext */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@keyframes value-pop {
  0%   { transform: scale(1); filter: brightness(1); }
  40%  { transform: scale(1.04); filter: brightness(1.15); }
  100% { transform: scale(1); filter: brightness(1); }
}

.estimate .value.is-updated {
  animation: value-pop 160ms ease-out;
}

.label {
  font-size: 12px;
  color: var(--muted);
}

.value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 6px;
}

.sub {
  font-size: 12px;
  margin-top: 4px;
}

.divider {
  height: 1px;
  background: var(--stroke2);
  margin: 14px 0;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== Utility helpers (replace inline styles) ===== */

.row-wrap {
  flex-wrap: wrap;
}

.gap-10 {
  gap: 10px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.align-center {
  align-items: center;
}

.align-start {
  align-items: flex-start;
}

.mt-6 {
  margin-top: 6px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-10 {
  margin-top: 10px;
}

.mt-12 {
  margin-top: 12px;
}

/* Specific one-off padding used by the holdings empty state */
.pad-10-2 {
  padding: 10px 2px;
}

/* Utility width + min-width helpers */
.w-100 {
  width: 100%;
}

.minw-220 {
  min-width: 220px;
}

/* Make a field span full width in the form grid */
.span-all {
  grid-column: 1 / -1;
}

.stat {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--stroke2);
  min-width: 200px;
}

.value-sm {
  margin-top: 6px;
  font-weight: 650;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--stroke2);
}

.ticker {
  font-weight: 750;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.92);
  min-width: 54px;
}


/* ===== Card header actions + segmented toggle (Income / Value) ===== */

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

/* A compact, Robinhood-ish segmented control */
.seg-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 5px;
  border-radius:999px;
  border:1px solid var(--stroke2);
  background: rgba(0,0,0,0.18);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset;
}

.seg-toggle .seg {
  appearance:none;
  border:0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  user-select: none;
  transition: filter 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.seg-toggle .seg:hover{
  color: rgba(255,255,255,0.86);
  filter: brightness(1.06);
}

.seg-toggle .seg.is-active{
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.06);
  box-shadow:
    0 0 0 1px rgba(124, 92, 255, 0.28),
    0 10px 36px rgba(124, 92, 255, 0.14);
}

/* Optional: reduce focus ring weirdness */
.seg-toggle .seg:focus{
  outline: none;
}

.seg-toggle .seg:focus-visible{
  outline: 2px solid rgba(124, 92, 255, 0.55);
  outline-offset: 2px;
}

/* ===== Sector Mix (Gauge list) polish ===== */

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

/* Each row is a 3-col grid: text | ring | % */
.gauge-row{
  display:grid;
  grid-template-columns: 1fr 64px 72px; /* fixed ring + % columns for alignment */
  gap:12px;
  align-items:center;
  padding:12px 12px;
  border-radius:14px;
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--stroke2);
}

.gauge-row:hover{
  border-color: rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.045);
}

/* Optional: highlight the top sector row */
.gauge-row.is-top{
  border-color: rgba(124, 92, 255, 0.32);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.12) inset;
}

.gauge-left{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0; /* required for ellipsis inside grid */
}

.gauge-left .sector-name{
  font-weight:750;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.gauge-left .sector-sub{
  color: var(--muted);
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Middle ring column: lock size and center it */
.gauge{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  justify-self:center;
}

.gauge svg{
  width:44px;
  height:44px;
  display:block;
}

/* Right percent column: consistent alignment */
.gauge-pct{
  text-align:right;
  font-weight:750;
  justify-self:end;
  font-variant-numeric: tabular-nums;
}

.gauge .bg{
  stroke: rgba(255,255,255,0.10);
}

.gauge .fg{
  stroke: var(--col, var(--c1));
  filter: drop-shadow(0 0 10px rgba(124,92,255,0.25));
}

.gauge circle{
  fill:none;
  stroke-width:8;
  stroke-linecap:round;
}

.gauge .pcttext{
  font-size:10px;
  fill: rgba(255,255,255,0.78);
  font-weight:700;
}

/* Force Upcoming payouts panel to span all columns in the dashboard grid */
#upcoming-panel {
  grid-column: 1 / -1;
  width: 100%;
}

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


@media (max-width: 900px) {
  .upcoming-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .estimates {
    grid-template-columns: 1fr;
  }
}

.upc-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  min-height: 160px; /* keeps cards visually even */
}

.upc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.upc-date {
  font-weight: 600;
}
.upc-total {
  font-weight: 600;
}

.upc-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.upc-row:first-child {
  border-top: none;
  padding-top: 0;
}
.upc-row .right {
  text-align: right;
}

.upc-empty {
  opacity: 0.55;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.1);
}

#upcoming-panel,
#upcoming-grid,
.upc-card {
  min-width: 0;
}

#upcoming-panel .card-head {
  margin-bottom: 14px;
} /* or 16px */

.calendar {
  border-radius: var(--radius);
  border: 1px solid var(--stroke2);
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.cal-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--stroke2);
  background: rgba(255, 255, 255, 0.03);
}

.cal-head > div {
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.day {
  min-height: 94px;
  padding: 10px;
  border-right: 1px solid var(--stroke2);
  border-bottom: 1px solid var(--stroke2);
  position: relative;
}

.day:nth-child(7n) {
  border-right: none;
}

.day-num {
  font-size: 12px;
  color: var(--muted);
}

.day.muted {
  color: rgba(255, 255, 255, 0.28);
}

.chip {
  margin-top: 8px;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
}

.chip-2 {
  border-color: rgba(45, 226, 230, 0.35);
  background: rgba(45, 226, 230, 0.1);
}

.chip-3 {
  border-color: rgba(255, 184, 107, 0.35);
  background: rgba(255, 184, 107, 0.1);
}

.chip-4 {
  border-color: rgba(99, 255, 122, 0.35);
  background: rgba(99, 255, 122, 0.1);
}

/* Make the months grid NOT stretch into runway pills */
.months-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(6, max-content);
  gap: 10px;
  justify-content: start;
}

/* ===== Month chips — cross-browser (no :has) ===== */
.month-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  padding-right: 26px; /* space for the check */
  border-radius: 999px;
  border: 1px solid var(--stroke2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  font-size: 12px;
}

.month-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Hover */
.month-chip:hover {
  color: var(--text);
  border-color: var(--stroke);
  background: rgba(255, 255, 255, 0.04);
}

/* Selected */
.month-chip.is-checked {
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(124, 92, 255, 0.5);
  background: rgba(124, 92, 255, 0.14);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.22),
    0 12px 45px rgba(124, 92, 255, 0.18);
}

.month-chip.is-checked::after {
  content: "✓";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  opacity: 0.9;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
  background: rgba(0, 0, 0, 0.16);
}

.table thead th {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stroke2);
  padding: 12px 10px;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
}

.table tbody td {
  border-bottom: 1px solid var(--stroke2);
  padding: 12px 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
}

.table th:nth-child(14),
.table td:nth-child(14) {
  min-width: 110px;
}

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

/* Grid/flex children MUST be allowed to shrink, or wide tables will push the whole layout */
.main,
.grid,
.card,
.table-wrap {
  min-width: 0;
}

/* Ensure the table is the only thing that can scroll horizontally */
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--stroke2);
  -webkit-overflow-scrolling: touch;
  padding-bottom: 14px;
  margin-top: 14px;
}

/* Keep the table from forcing the page wider */
.table {
  width: 100%;
  min-width: 1180px; /* keep this for desktop; it will scroll inside table-wrap */
}

.logo {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--stroke2);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 800;
}

.company .name {
  font-weight: 650;
}
.up {
  color: var(--good);
}
.down {
  color: var(--bad);
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

/* Analytics: Income Contribution widget container (JS renders into this id) */
#analytics-income-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
  min-width: 0;
}

/* Stack ticker + name nicely inside the grid */
#analytics-income-bars .left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* Prevent long names from blowing out the grid */
#analytics-income-bars .left .muted {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Analytics: Top 5 vs Rest ===== */
.top5-bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke2);
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--top, 0%) 1fr;
}

.top5-bar .seg {
  height: 100%;
}

.top5-bar .seg.top {
  background: linear-gradient(
    90deg,
    rgba(124, 92, 255, 0.9),
    rgba(45, 226, 230, 0.75)
  );
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.top5-bar .seg.rest {
  background: rgba(255, 255, 255, 0.03);
}

.bar-row {
  display: grid;
  grid-template-columns: 1.4fr 2.2fr 0.6fr;
  gap: 10px;
  align-items: center;
}

.bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke2);
  overflow: hidden;
}

.fill {
  height: 100%;
  width: calc(var(--w) * 100%);
  background: linear-gradient(
    90deg,
    rgba(124, 92, 255, 0.85),
    rgba(45, 226, 230, 0.75)
  );
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.bullets {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bullets strong {
  color: rgba(255, 255, 255, 0.9);
}

/* ===== Dividend Alerts: right-side meta + stable row grid ===== */

/* Force alert rows to use the grid layout even if .list-row is flex globally */
#dividend-alerts-list .alert-row {
  display: grid;
  grid-template-columns: 10px auto 1fr auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 6px;
}

/* Keep the main message readable and allow wrapping without pushing the button */
#dividend-alerts-list .alert-text {
  min-width: 0;
}

/* Right-side due/meta label */
#dividend-alerts-list .alert-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

/* On very small widths, let the meta drop under the message (button stays right) */
@media (max-width: 520px) {
  #dividend-alerts-list .alert-row {
    grid-template-columns: 10px auto 1fr auto;
    grid-template-areas:
      "dot ticker text btn"
      "dot ticker meta btn";
  }

  #dividend-alerts-list .alert-dot { grid-area: dot; }
  #dividend-alerts-list .alert-ticker { grid-area: ticker; }
  #dividend-alerts-list .alert-text { grid-area: text; }
  #dividend-alerts-list .alert-meta { grid-area: meta; justify-self: start; text-align: left; }
  #dividend-alerts-list .alert-row .btn { grid-area: btn; }
}


/* ===== Dividend Alerts: grouped sections ===== */
.alerts-group {
  list-style: none;
  padding: 8px 0 2px 0;
  margin: 0;
}

.alerts-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted2);
  padding: 6px 0;
  border-top: 1px solid var(--stroke2);
  margin-top: 8px;
}

.alerts-group:first-child .alerts-group-title {
  border-top: none;
  margin-top: 0;
}

.alerts-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke2);
}

/* ===== Dividend alert severity dots ===== */

.alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.9;
}

.alert-dot--info {
  background: rgba(120, 180, 255, 0.9); /* calm blue */
}

.alert-dot--warn {
  background: rgba(255, 92, 168, 0.95); /* same danger accent you already use */
}

/* ===== Dividend Alerts row alignment ===== */

.alert-row {
  /* IMPORTANT: override .list-row's flex layout */
  display: grid;
  grid-template-columns: 12px 64px 1fr auto; /* dot | ticker | text | button */
  align-items: center;
  column-gap: 14px; /* spacing between dot/ticker/text */
}

/* Ticker */
.alert-ticker {
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 0.85rem;
  opacity: 0.85;
}

/* Main text */
.alert-text {
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--text);
}

/* Ensure button never shifts vertically */
.alert-row .btn {
  align-self: center;
}

/* Default list rows are flex, but alert rows are a grid (don’t override) */
.list-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.list-row.alert-row {
  display: grid;
  align-items: center;
}

/* ===== Dividend Alerts: warning row emphasis ===== */

/* Base alert rows can stay as-is; this only adds emphasis for warn */
.alert-row.alert-warn {
  border-color: rgba(255, 92, 168, 0.28);
  background:
    radial-gradient(
      520px 220px at 18% 50%,
      rgba(255, 92, 168, 0.10),
      transparent 62%
    ),
    rgba(0, 0, 0, 0.18);
  box-shadow:
    0 0 0 1px rgba(255, 92, 168, 0.10) inset;
}

/* Optional: a tiny extra “lift” on hover for warn rows only */
.alert-row.alert-warn:hover {
  border-color: rgba(255, 92, 168, 0.40);
  filter: brightness(1.03);
}

/* ===== Analytics: Next 12 Months mini forecast card ===== */
.forecast-chart {
  display: grid;
  gap: 10px;
  width: 100%;
}

.forecast-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: 170px;
  padding: 10px 10px 8px 10px;
  border-radius: 16px;
  border: 1px solid var(--stroke2);
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.forecast-bar {
  display: grid;
  gap: 6px;
  align-items: end;
  min-width: 0;
}

.forecast-bar-pill {
  height: var(--h, 2%);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(124, 92, 255, 0.32);
  box-shadow:
    0 0 0 1px rgba(124, 92, 255, 0.10) inset,
    0 10px 30px rgba(0, 0, 0, 0.28);
  transition: height 420ms ease;
  min-height: 6px;
}

.forecast-bar.is-nonzero .forecast-bar-pill {
  background: rgba(99, 255, 122, 0.26);
  border-color: rgba(99, 255, 122, 0.18);
  box-shadow:
    0 0 0 1px rgba(99, 255, 122, 0.10) inset,
    0 12px 34px rgba(0, 0, 0, 0.26);
}

.forecast-x {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  padding: 0 10px;
}

.forecast-x .forecast-xlab {
  font-size: 11px;
  color: var(--muted2);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

/* ===== Forecast: month-by-month list (Analytics) ===== */
.forecast-months{
  width: 100%;
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.forecast-month{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke2);
  background: rgba(0,0,0,0.14);
}

.forecast-month-label{
  font-weight: 800;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,0.86);
}

.forecast-month-amt{
  font-weight: 900;
  letter-spacing: 0.01em;
}

.forecast-month-sub{
  font-size: 12px;
  color: var(--muted);
  margin-left: 8px;
  font-weight: 700;
}

/* ===== Settings: Danger zone action containers + subtle tint + reset emphasis ===== */

/* Keep your existing grid-based settings layout; just tint + emphasize reset */
#settings-danger .settings-danger-actions {
  display: grid;
  gap: 12px;
}

/* Subtle container styling (inherits your `.settings-action` grid layout) */
#settings-danger .settings-action {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

/* Slightly warmer/pinker tint for destructive action only (more visible but still subtle) */
#settings-danger .settings-action.is-danger-emphasis {
  border-color: rgba(255, 92, 168, 0.28);
  background: rgba(255, 92, 168, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 92, 168, 0.06) inset;
}

/* Pulse ONLY when JS adds `.danger-pulse` (no :has dependency) */
#settings-danger .settings-action.is-danger-emphasis.danger-pulse {
  animation: edt-danger-pulse 900ms ease-out 1;
}

@keyframes edt-danger-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 92, 168, 0.0);
    transform: translateY(0);
  }
  35% {
    box-shadow: 0 0 0 6px rgba(255, 92, 168, 0.14);
    transform: translateY(-1px);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 92, 168, 0.0);
    transform: translateY(0);
  }
}

/* ===== Settings: Danger zone action containers + subtle tint + reset emphasis ===== */

#settings-danger .settings-danger-actions {
  display: grid;
  gap: 12px;
}

/* Each action row becomes its own subtle tinted container */
#settings-danger .settings-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

/* Slightly warmer/pinker tint for destructive action only (very subtle) */
#settings-danger .settings-action.is-danger-emphasis {
  border-color: rgba(255, 92, 168, 0.18);
  background: rgba(255, 92, 168, 0.05);
}

/* Confirm-emphasis animation ONLY for “Reset everything”
   (uses :has so it only fires when that button is inside) */
#settings-danger .settings-action.is-danger-emphasis:has(#settings-reset-all) {
  animation: edt-danger-pulse 900ms ease-out 1;
}

@keyframes edt-danger-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 92, 168, 0.00); transform: translateY(0); }
  35% { box-shadow: 0 0 0 6px rgba(255, 92, 168, 0.10); transform: translateY(-1px); }
  100% { box-shadow: 0 0 0 0 rgba(255, 92, 168, 0.00); transform: translateY(0); }
}

/* ===== Monetization ===== */

/* ===== Free vs Pro comparison (inside Upgrade card) ===== */

/* Wrap: keep it compact + prevent the global .table min-width from forcing scroll */
.compare-wrap{
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--stroke2);
  background: rgba(0,0,0,0.14);
}

/* A dedicated table style so we don't touch the main Holdings table */
.compare-table{
  width: 100%;
  border-collapse: collapse;
  min-width: 0; /* overrides global .table min-width */
  table-layout: fixed;
  background: transparent;
}

.compare-table th,
.compare-table td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
  color: rgba(255,255,255,0.86);
  vertical-align: top;
  word-break: break-word;
}

.compare-table thead th{
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(10px);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-align: left;
}

.compare-table tr:last-child td{
  border-bottom: 0;
}

/* Column sizing */
.compare-table th:nth-child(1),
.compare-table td:nth-child(1){
  width: 56%;
}
.compare-table th:nth-child(2),
.compare-table td:nth-child(2),
.compare-table th:nth-child(3),
.compare-table td:nth-child(3){
  width: 22%;
  text-align: center;
}

/* Little pills for Free / Pro headers or cells */
.compare-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--stroke2);
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.78);
}

.compare-pill.is-pro{
  border-color: rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.10);
  color: rgba(255,255,255,0.9);
}

.compare-pill.is-free{
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
}

/* Check / X marks */
.compare-yes{
  color: rgba(99, 255, 122, 0.95);
  font-weight: 900;
}

.compare-no{
  color: rgba(255, 92, 168, 0.95);
  font-weight: 900;
}

/* Callout rows inside the comparison table */
.compare-callout td{
  padding: 12px;
  background: rgba(255,255,255,0.02);
}

.compare-callout + .compare-callout td{
  border-top: 1px solid rgba(255,255,255,0.06);
}

.compare-callout-inner{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.compare-callout-2 .compare-callout-inner{
  gap: 10px;
}

.compare-callout-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.85);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.12);
}

.compare-callout-sep{
  color: rgba(255,255,255,0.35);
}

/* Subtle Pro column glow when a plan is selected */
#support-upgrade.plan-selected .compare-table th:nth-child(3),
#support-upgrade.plan-selected .compare-table td:nth-child(3){
  background: rgba(124, 92, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.18);
}

#support-upgrade.plan-selected .compare-table thead th:nth-child(3){
  box-shadow:
    inset 0 0 0 1px rgba(124, 92, 255, 0.22),
    0 0 18px rgba(124, 92, 255, 0.18);
}

/* Make the Pro pill feel a touch more “alive” when selected */
#support-upgrade.plan-selected .compare-pill.is-pro{
  box-shadow:
    0 0 0 1px rgba(124, 92, 255, 0.22),
    0 10px 30px rgba(124, 92, 255, 0.12);
}

@media (max-width: 720px){
  .compare-callout-inner{
    gap: 8px;
  }
  .compare-callout-sep{
    display: none;
  }
}

/* Mobile: stack columns more nicely by shrinking text + allowing wrap */
@media (max-width: 720px){
  .compare-table th,
  .compare-table td{
    padding: 10px 10px;
    font-size: 12px;
  }

  .compare-table th:nth-child(1),
  .compare-table td:nth-child(1){
    width: 58%;
    text-align: left;
  }

  .compare-table th:nth-child(2),
  .compare-table td:nth-child(2),
  .compare-table th:nth-child(3),
  .compare-table td:nth-child(3){
    width: 21%;
  }
}

/* ===== Pro-gated UI (v0) ===== */

/* Subtle PRO tag on any element gated with data-pro */
[data-pro] {
  position: relative;
}

button[data-pro]::after,
a.btn[data-pro]::after {
  content: "PRO";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
}

button[data-pro]:hover::after,
a.btn[data-pro]:hover::after {
  color: rgba(255, 255, 255, 0.88);
  border-color: rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.10);
}

/* When Pro is enabled (demo), hide the PRO tag if you add this attribute later */
html[data-pro-enabled="true"] button[data-pro]::after,
html[data-pro-enabled="true"] a.btn[data-pro]::after {
  content: "";
  display: none;
}

/* ===== Pro gate modal (dialog) ===== */

dialog.modal {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 99999;
  pointer-events: auto;
  max-width: min(640px, calc(100vw - 28px));
  max-height: 100vh;                  /* keep dialog within viewport */
}

dialog.modal[open] {
  display: flex;
  align-items: flex-start;            /* top-align tall modals */
  justify-content: center;
  pointer-events: auto;
  overflow: auto;                     /* allow scrolling within the dialog viewport */
  padding: 18px 0;                    /* breathing room at top/bottom */
  -webkit-overflow-scrolling: touch;  /* smoother scroll on iOS/Safari */
}

dialog.modal::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
}

/* If anything else sets pointer-events: none globally, force the Pro dialog to remain clickable */
#pro-modal,
#pro-modal * {
  pointer-events: auto;
}

/* The inner card MUST receive pointer events, or clicks will "shake" the dialog */
.dialog .modal-card,
dialog.modal .modal-card,
dialog.modal .modal-card * {
  pointer-events: auto;
}

dialog.modal .modal-card {
  width: 100%;
  border-radius: var(--radius2);
  background: rgba(12, 14, 24, 0.92);
  border: 1px solid var(--stroke2);
  box-shadow: var(--shadow);
  padding: 16px;
  max-height: calc(100vh - 36px);     /* account for dialog padding */
  overflow: auto;                     /* scroll inside the card when content is tall */
  -webkit-overflow-scrolling: touch;
}

/* A slightly narrower variant used by the Pro modal */
.modal-card-sm {
  max-width: 520px;
}

/* Prevent accidental text selection when clicking around in the dialog */
dialog.modal .modal-card {
  user-select: none;
}

dialog.modal button {
  user-select: none;
}

/* Safari safety: ensure the modal content always receives pointer events */
#pro-modal .modal-card,
#pro-modal .modal-card * {
  pointer-events: auto;
}

/* ===== Analytics export modal (Pro) ===== */
/* Force a vertical, readable list even if global label styles exist */

#analytics-export-modal .export-options,
.export-options{
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

/* ===== Analytics export modal (Pro) ===== */

#analytics-export-modal .export-option,
.export-option{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;

  /* ✅ prevents hover jiggle (border space is always reserved) */
  border: 1px solid transparent;

  padding: 10px 10px;
  border-radius: 14px;

  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

#analytics-export-modal .export-option:hover{
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

#analytics-export-modal label.export-option,
label.export-option{
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

#analytics-export-modal label.export-option input[type="checkbox"]{
  margin-top: 0;
}

#analytics-export-modal label.export-option input[type="checkbox"],
label.export-option input[type="checkbox"]{
  flex: 0 0 auto;
  margin-top: 2px;
}

#analytics-export-modal label.export-option > span,
label.export-option > span{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  line-height: 1.35;
  min-width: 0;
  white-space: normal;
}

/* Optional: subtle row affordance */
#analytics-export-modal label.export-option{
  padding: 10px 10px;
  border-radius: 14px;
  align-items: center;
}

#analytics-export-modal label.export-option:hover{
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

#analytics-export-modal label.export-option .muted.small{
  opacity: 0.85;
}

#analytics-export-modal .export-actions{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}

#analytics-export-modal .export-actions-left{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 520px){
  #analytics-export-modal .export-actions{
    justify-content: flex-start;
  }
}

/* ===== Edit Holding: Non-dividend payer toggle (native checkbox) =====
   This one toggle should render a real checkbox (not the hidden pill-toggle input).
   We give its label a dedicated class in HTML: `.nondiv-toggle`.
*/
.nondiv-toggle{
  /* don’t reserve space for the generic pill-toggle indicator */
  padding-left: 14px;
  gap: 10px;
  align-items: center;
}

/* Hide it visually (sr-only), but KEEP it toggle-able via label click */
.nondiv-toggle input#isDividendPayerToggle {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  opacity: 0;

  /* IMPORTANT */
  pointer-events: auto;
}

/* Keep the helper text aligned under the label */
#nondiv-help{
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

/* ===== CSV Import preview modal ===== */
.csv-preview { min-width: 0; }

.csv-table-wrap{
  margin-top: 10px;
  border-radius: 16px;
  border: 1px solid var(--stroke2);
  background: rgba(0,0,0,0.18);
  overflow: auto;
  max-height: 320px;
}

.csv-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.csv-table th,
.csv-table td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: top;
}

.csv-table th{
  position: sticky;
  top: 0;
  background: rgba(10, 12, 22, 0.92);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.78);
  font-weight: 750;
  letter-spacing: 0.02em;
}

.csv-table td.num,
.csv-table th.num{ text-align: right; }

@media (max-width: 720px){
  .csv-table-wrap{ max-height: 260px; }
}

/* Subtle hint line in the modal header */
#csv-import-modal #csv-modal-lastmode {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

/* Broker badge styling (more legible + “premium” feel) */
#csv-import-modal #csv-modal-broker {
  border-color: rgba(45, 226, 230, 0.28);
  background: rgba(45, 226, 230, 0.10);
  color: rgba(255, 255, 255, 0.90);
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow:
    0 0 0 1px rgba(45, 226, 230, 0.10) inset,
    0 10px 30px rgba(45, 226, 230, 0.08);
}

#csv-import-modal #csv-modal-broker::before {
  content: "●";
  margin-right: 8px;
  color: rgba(45, 226, 230, 0.95);
  filter: drop-shadow(0 0 8px rgba(45, 226, 230, 0.35));
}

/* Danger banner: tiny entrance pulse when overwrite is restored */
@keyframes csvDangerPulse {
  0% { transform: translateY(-4px) scale(0.985); opacity: 0.0; }
  60% { transform: translateY(0) scale(1.01); opacity: 1.0; }
  100% { transform: translateY(0) scale(1.0); opacity: 1.0; }
}

#csv-import-modal.csv-restore-overwrite .csv-danger {
  animation: csvDangerPulse 600ms ease-out 1;
}

/* ===== CSV Import modal: impact tags + overwrite warning ===== */

#csv-import-modal.is-danger .modal-card {
  border: 1px solid rgba(255, 92, 168, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 92, 168, 0.12) inset,
    0 22px 60px rgba(0, 0, 0, 0.55);
}

.csv-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.csv-tag--new {
  color: rgba(99, 255, 122, 0.95);
  border-color: rgba(99, 255, 122, 0.25);
  background: rgba(99, 255, 122, 0.08);
}

.csv-tag--update {
  color: rgba(255, 184, 107, 0.95);
  border-color: rgba(255, 184, 107, 0.25);
  background: rgba(255, 184, 107, 0.08);
}

.csv-tag--same {
  color: rgba(255, 255, 255, 0.62);
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
}

/* ===== Donate (BMAC) ===== */
.bmac-link {
  display: inline-flex;
  align-items: center;
}

.bmac-img {
  height: 44px;
  width: auto;
  border-radius: 10px;
  filter: brightness(0.95);
}

.bmac-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.bmac-qr img {
  width: 120px;
  height: auto;
  border-radius: 12px;
  background: #fff;
  padding: 6px;
}

/* ===== Footer ===== */
.footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.footer a {
  text-decoration: underline;
}

.reddit-logo {
  height: 16px;
  width: auto;
  vertical-align: middle;
  margin: 0 4px;
  opacity: 0.85;
}

.reddit-logo:hover {
  opacity: 1;
}

/* Extra separation between Analytics -> Support section */
#monetization.section{
  margin-top: 18px;
}

.monetization-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 860px){
  .monetization-grid{ grid-template-columns: 1fr; }
}

/* ===== Monetization: One-time support (split layout) ===== */
.donate-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

/* Left side becomes a two-column composition: copy + QR */
.donate-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.donate-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.donate-copy {
  line-height: 1.45;
}

.bmc-link {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 6px;
}

.bmc-btn {
  height: 44px;
  width: auto;
  max-width: 100%;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--stroke2);
  background: rgba(0,0,0,0.12);
}

.bmc-qr-inline{
  width: 150px;
  height: 150px;
  border-radius: 16px;
  border: 1px solid var(--stroke2);
  /* background: rgba(0,0,0,0.14); */
  padding: 8px;
  display: inline-block;
  vertical-align: middle;
  margin: 0 8px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.30);
}

.donate-qr {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Sane QR size + nicer depth */
.bmc-qr {
  width: 250px;
  height: 250px;
  max-width: 100%;
  display: block;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid var(--stroke2);
  /* background: rgba(0, 0, 0, 0.14); */
  padding: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

/* Crypto panel aligns with the left composition */
.donate-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius2);
  border: 1px solid var(--stroke2);
  background: rgba(255, 255, 255, 0.02);
  min-height: 100%;
}

.donate-right-title {
  font-weight: 850;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.86);
  margin-bottom: 8px;
}

.donate-right-row{
  display:flex;
  gap: 14px;
  align-items:flex-start;
  width: 100%;
}

.wallets-details {
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 900px) {
  /* Stack the two-column donate layout on tablets + phones */
  .donate-split {
    grid-template-columns: 1fr;
  }

  /* Crypto panel spacing remains tidy when stacked */
  .donate-right {
    width: 100%;
  }

  /* If anything inside wallets is long, allow it to wrap */
  .wallet-addr{ max-width: 100%; }
}

/* ===== Donate: mobile layout fix ===== */
@media (max-width: 430px) {
  /* Ensure donate layout is fully stacked on small screens */
  .donate-split {
    grid-template-columns: 1fr;
  }

  /* Make the inline QR + button behave nicely inside the paragraph */
  .bmc-btn {
    max-width: 100%;
  }

  .donate-copy-mobile .bmc-qr-inline {
    width: 150px;
    height: 150px;
    display: block;
    margin: 10px auto 0;
  }

  .donate-meta {
    gap: 12px;
    min-width: 0;
  }

  /* QR: center and slightly smaller so it feels intentional */
  .bmc-qr {
    width: 160px;
    height: 160px;
    margin: 10px auto 0;
  }

  /* If you have a wrapper around the QR, ensure it's centered */
  .donate-qr,
  .donate-qr-wrap {
    display: flex;
    justify-content: center;
  }

  /* Crypto panel should also be full width on mobile */
  .donate-right,
  .donate-right-card {
    width: 100%;
    max-width: 100%;
  }

  /* Defensive: prevent weird word breaking */
  .donate-meta p,
  .donate-meta .muted,
  .donate-meta .donate-copy {
    word-break: normal;
    overflow-wrap: anywhere;
  }
}

/* Default: desktop copy */
.donate-copy-mobile {
  display: none;
}

/* Mobile copy */
@media (max-width: 430px) {
   .bmc-qr-inline{
    display: block !important;
    width: 160px;
    height: 160px;
    max-width: 100%;
    margin: 10px auto 0;
    flex: 0 0 auto;
    visibility: visible;
    opacity: 1;
  }

  .donate-copy-desktop {
    display: none;
  }

  .donate-copy-mobile {
    display: block;
    text-align: center;
  }

  .donate-copy-mobile .bmc-link {
    display: flex;
    justify-content: center;
    margin: 10px 0;
  }
}

.mono-card{ padding: 16px; }
.mono-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 8px;
}

/* Make the action row look consistent with the rest of the site */
.mono-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Donate: wallets panel */
.mono-crypto{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke2);
}

.mono-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.mono-row:last-child{ border-bottom: 0; }

.mono-label{
  font-weight: 750;
  color: var(--text);
  flex: 0 0 auto;
}

.mono-value{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
  max-width: 46ch;
  text-align: right;
}

/* Pricing cards */
.pricing-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 520px){
  .pricing-grid{ grid-template-columns: 1fr; }
}

.price-card{
  text-align:left;
  border: 1px solid var(--stroke2);
  background: rgba(255,255,255,0.02);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  position: relative;
}

.price-card:hover{
  filter: brightness(1.04);
  border-color: rgba(255,255,255,0.12);
}

.price-card[aria-pressed="true"]{
  border-color: rgba(124,92,255,.75);
  box-shadow: 0 0 0 3px rgba(124,92,255,.15);
}

.price-title{ font-weight: 850; color: var(--text); }
.price-amt{ font-size: 22px; font-weight: 900; margin-top: 6px; }
.price-sub{ font-size: 12px; margin-top: 2px; color: var(--muted); }

.price-badge{
  position:absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke2);
  background: rgba(124,92,255,.12);
  color: var(--text);
}

.mono-bullets{ margin: 12px 0 0; padding-left: 18px; }
.mono-bullets li{ margin: 6px 0; }

#pricing-modal{ margin-top: 14px; }

.mono-two{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}
@media (max-width: 720px){
  .mono-two{ grid-template-columns: 1fr; }
}

.plan-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.plan{
  appearance: none;
  border: 1px solid var(--stroke2);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 12px 12px 10px;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
  min-height: 64px;
}

.plan:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.045);
}

.plan:focus-visible{
  outline: 2px solid rgba(124,92,255,0.55);
  outline-offset: 2px;
}

.plan.is-active{
  border-color: rgba(124,92,255,0.75);
  background: rgba(124,92,255,0.10);
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
}

.plan-name{
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan-price{
  margin-top: 6px;
  font-weight: 900;
  font-size: 18px;
  color: var(--text);
}

.plan-sub{
  margin-top: 4px;
}

/* Donate wallet panel */
.wallets{
  display: grid;
  gap: 10px;
}

.wallet-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--stroke2);
  background: rgba(255,255,255,0.02);
  border-radius: 14px;
}

.wallet-row:hover{
  filter: brightness(1.06);
  border-color: rgba(255,255,255,0.12);
}

.wallet-left{
  display: grid;
  gap: 4px;
  min-width: 0;
}

.wallet-name{
  font-weight: 900;
  letter-spacing: .02em;
}

.wallet-addr{
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
  cursor: pointer;
}

/* Show full address on hover (more reliable than native title in some browsers) */
.wallet-addr[title]:hover::after{
  content: attr(title);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 9999;
  max-width: min(520px, 70vw);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke2);
  background: rgba(10, 12, 22, 0.96);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
}

/* Make the <summary> pill look clickable */
#wallets-details > summary{
  cursor: pointer;
  user-select: none;
}

/* Responsive: stack plan buttons on narrow screens */
@media (max-width: 720px){
  .plan-grid{
    grid-template-columns: 1fr;
  }
}


/* ===== Expected Dividends (12 mo) ===== */

/* Overall layout: plot frame, then x labels, then stats */
.income12-chart{
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

/* Rounded frame for the plot ONLY */
.income12-frame{
  position: relative;
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--stroke2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);

  /* Clip ONLY the bars/grid to the rounded frame (no scrollbars) */
  overflow: hidden;
  overflow-x: hidden;
  overflow-y: hidden;

  /* Inner padding gives breathing room so bars/tooltip aren't glued to edges */
  padding: 52px 18px 14px;  /* top padding becomes tooltip headroom */
}

/* Plot area height is controlled here */
.income12-bars{
  position: relative;
  z-index: 1;

  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
  align-items: end;

  height: 220px;

  /* headroom for tooltip bubble */
  padding-top: 0px;

  /* IMPORTANT: allow tooltip to escape bar bounds (but frame still clips bars) */
  overflow: visible;
}

/* subtle horizontal grid lines */
.income12-grid{
  position: absolute;
  /* respect the frame padding + match the plot area */
  left: 14px;
  right: 14px;
  top: 14px;
  bottom: 12px;

  background:
    linear-gradient(to bottom,
      rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 100% 22%;
  opacity: .25;
  pointer-events: none;
  z-index: 0;
}

.income12-bar{
  position: relative;
  /* Clamp bar height so negative/invalid values can’t collapse the bar */
  height: max(14px, var(--h, 0px));
  border-radius: 12px;
  background: linear-gradient(180deg,
    rgba(124,92,255,.95),
    rgba(103,216,255,.85)
  );
  box-shadow:
    0 10px 28px rgba(0,0,0,.35),
    0 0 0 1px rgba(255,255,255,.08) inset;
}

/* Months with $0: keep the grid slot but visually hide the bar */
.income12-bar.is-zero{
  height: 0;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}

.income12-bar.is-zero::after{
  content: "";
  opacity: 0;
}

/* Hover bubble */
.income12-bar::after{
  content: attr(data-amt);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  background: rgba(10, 12, 22, 0.92);
  border: 1px solid var(--stroke2);
  box-shadow: 0 14px 40px rgba(0,0,0,0.45);
  z-index: 4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

.income12-bar:hover::after,
.income12-bar:focus-visible::after{
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* Desktop: keep value bubbles always visible (no hover needed) */
@media (min-width: 901px){
  .income12-bar::after{
    opacity: 1;
    transform: translateX(-50%);
  }

  /* Keep the little “lift” animation on hover/focus (desktop only) */
  .income12-bar:hover::after,
  .income12-bar:focus-visible::after{
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
  }
}

/* X-axis month labels BELOW the frame (clean, never inside bars) */
/* X-axis month labels BELOW the frame (clean, never inside bars) */
.income12-x,
#income-12mo-x{
  width: 100%;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;

  /* align with frame inner padding */
  padding: 0 18px;

  /* breathing room between labels and the stats row */
  margin-top: 12px;
  margin-bottom: 14px;

  color: var(--muted);
  font-size: 12px;
  letter-spacing: .02em;
  pointer-events: none;
}

.income12-x span,
#income-12mo-x span{
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}

.income12-stats,
#income-12mo-stats{
  width: 100%;
  display: flex;
  justify-content: center;   /* center the row */
  align-items: center;
  gap: 34px;                 /* more spacing between items */
  flex-wrap: wrap;

  /* extra breathing room away from x-axis labels */
  margin-top: 6px;
  padding-top: 10px;

  color: var(--muted);
  text-align: center;
}

.income12-stat,
#income-12mo-stats .income12-stat{
  display: inline-flex;
  gap: 10px;
  align-items: baseline;
}

.income12-stat b,
#income-12mo-stats .income12-stat b{
  color: var(--text);
  font-weight: 850;
}

#income-12mo-x,
.income12-x{
  padding-left: 14px;
  padding-right: 14px;
}

/* Extra breathing room when jumping into Settings */
#settings.section{
  padding-top: 18px;
}

/* ===== Footer ===== */
.footer{
  margin-top: 18px;
  padding: 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}

.footer a {
  text-decoration: none;
}

.footer-reddit{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.footer-reddit:hover{
  border-color: var(--stroke2);
  background: rgba(255, 255, 255, 0.03);
}

.footer-reddit-logo{
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: inline-block;
  opacity: 0.9;
  border-radius: 10px;
}

tfoot .totals-row td {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 10px;
}

/* Responsive */
@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
  }
  .span-4,
  .span-6 {
    grid-column: span 12;
  }
}

/* Modal */
.modal {
  border: none;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(860px, calc(100vw - 24px));
  margin: 8vh auto;
  border-radius: var(--radius2);
  padding: var(--pad);
  background: radial-gradient(
      700px 350px at 20% 0%,
      rgba(124, 92, 255, 0.14),
      transparent 60%
    ),
    radial-gradient(
      600px 350px at 95% 35%,
      rgba(45, 226, 230, 0.1),
      transparent 55%
    ),
    rgba(10, 12, 22, 0.92);
  border: 1px solid var(--stroke);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
  color: var(--text);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

/* ===== Portfolio Manage modal ===== */
#portfolio-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#portfolio-action-row .port-action {
  border-color: var(--stroke2);
}

#portfolio-action-row .port-action.is-active {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(124, 92, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.22),
    0 12px 45px rgba(124, 92, 255, 0.18);
}

#portfolio-existing-wrap[hidden],
#portfolio-name-wrap[hidden] {
  display: none !important;
}

/* ===== Toasts ===== */
.toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 9999;
  max-width: min(420px, calc(100vw - 36px));
}

.toast {
  border-radius: 16px;
  padding: 12px 12px;
  border: 1px solid var(--stroke2);
  background: rgba(10, 12, 22, 0.86);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.toast-title {
  font-weight: 750;
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.2px;
}

.toast-msg {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.toast .x {
  border: 1px solid var(--stroke2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 12px;
  width: 34px;
  height: 34px;
  cursor: pointer;
}
.toast .x:hover {
  color: var(--text);
  border-color: var(--stroke);
}

/* Variants */
.toast[data-variant="success"] {
  border-color: rgba(99, 255, 122, 0.25);
}
.toast[data-variant="error"] {
  border-color: rgba(255, 92, 168, 0.3);
}
.toast[data-variant="info"] {
  border-color: rgba(124, 92, 255, 0.25);
}

/* Simple enter/exit */
.toast {
  animation: toastIn 160ms ease-out;
}
@keyframes toastIn {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ===== Smaller modal card ===== */
.modal-card-sm {
  width: min(560px, calc(100vw - 24px));
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--stroke2);
}

.field input {
  width: 100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke2);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  outline: none;
}

.field input:focus {
  border-color: rgba(124, 92, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.12);
}

/* Select styling (matches inputs) */
.field select {
  width: 100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke2);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  outline: none;
  appearance: none;
}
.field select:focus {
  border-color: rgba(124, 92, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.12);
}

/* Sector pill */
.pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}
.pill-tag .mini-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.12);
}

/* ===== Toggle pill (Custom months) — cross-browser (no :has) ===== */
.pill-toggle {
  cursor: pointer;
  user-select: none;
  color: var(--muted);
  position: relative;
  padding-left: 42px; /* room for indicator */
}

/* Portfolio dropdown pill should never reserve space for toggle indicators */
/* Removed #portfolio-toggle.pill-toggle rule per new pill-only toggle design */

.pill-toggle input {
  /* hide native checkbox but keep it accessible */
  position: absolute;
  opacity: 0;
  pointer-events: auto;
}

.pill-toggle.is-checked {
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(124, 92, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.25),
    0 10px 40px rgba(124, 92, 255, 0.18);
}

/* Default OFF state for dots inside pill toggles */
.pill-toggle .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

/* ON state when:
   - checkbox is checked (non-dividend payer)
   - details is open (crypto wallets)
   - aria-pressed/expanded used by other toggles
*/
.pill-toggle input:checked ~ .dot,
details[open] > summary.pill-toggle .dot,
.pill-toggle[aria-pressed="true"] .dot,
.pill-toggle[aria-expanded="true"] .dot {
  background: rgba(99, 255, 122, 0.92);
  box-shadow: 0 0 0 4px rgba(99, 255, 122, 0.12);
}

/* ===== Wallet pill toggle (uses aria-expanded) ===== */
/*
  IMPORTANT: This version assumes the Wallets control contains a real `.dot` element
  in the HTML (e.g. `<span class="dot" ...></span>`). We intentionally do NOT use
  `::after` so you never get a double-dot.
*/

/* Keep wallet pill as a normal pill, but style its dot as OFF by default */
#wallet-pill {
  position: relative;
}

/* Override the global `.dot` (green) ONLY inside the wallet pill */
#wallet-pill .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;

  /* OFF state: dim/gray */
  background: rgba(255, 255, 255, 0.34);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.09);
  opacity: 0.42;

  transition: opacity 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

/* ON state: support aria-expanded, aria-pressed, and common active classes */
#wallet-pill[aria-expanded="true"],
#wallet-pill[aria-pressed="true"],
#wallet-pill.is-active,
#wallet-pill.is-open,
#wallet-pill.open{
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(124, 92, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.25),
    0 10px 40px rgba(124, 92, 255, 0.18);
}

#wallet-pill[aria-expanded="true"] .dot,
#wallet-pill[aria-pressed="true"] .dot,
#wallet-pill.is-active .dot,
#wallet-pill.is-open .dot,
#wallet-pill.open .dot{
  opacity: 1;
  background: rgba(99, 255, 122, 0.9);
  box-shadow: 0 0 0 4px rgba(99, 255, 122, 0.12),
    0 0 18px rgba(99, 255, 122, 0.22);
}


.pill.pill-toggle {
  display: flex; 
  gap: 10px; 
  box-shadow: none;
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--stroke2);
  padding: 10px 14px 10px 18px; 
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}

/* Wallets pill uses a real .dot, so it should NOT reserve left padding for the pseudo indicator */
#wallet-pill.pill-toggle {
  padding-left: 14px; /* match the right-side padding */
}

/* Wallet pill uses a real .dot; disable generic pill-toggle pseudo indicators */
#wallet-pill.pill-toggle::before,
#wallet-pill.pill-toggle::after {
  display: none;
}

/* Keep the dot aligned nicely after removing the reserved indicator space */
#wallet-pill.pill-toggle .dot {
  margin-left: 0;
}

.form-error {
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 92, 168, 0.35);
  background: rgba(255, 92, 168, 0.1);
  color: rgba(255, 255, 255, 0.88);
}

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

.btn-sm {
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
}

[hidden] {
  display: none !important;
}

.onboarding-strip{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;

  padding:14px 14px;
  border-radius:16px;

  background: rgba(255,255,255,0.03);
  border: 1px solid var(--stroke2);
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
  margin-bottom: 14px;
}

.onboarding-title{
  font-weight: 800;
  color: var(--text);
  letter-spacing: .01em;
}

.onboarding-sub{
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

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

@media (max-width: 720px){
  .onboarding-strip{
    flex-direction: column;
    align-items: stretch;
  }
  .onboarding-actions{
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .months-grid {
    grid-template-columns: repeat(3, max-content);
  }
}

/* Mobile: reduce table columns */
@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  /* Make sidebar less tall/heavy on mobile */
  .sidebar {
    position: relative;
    height: auto;
  }

  /* Hide lower-priority columns in Holdings on small screens */
  .table th:nth-child(6),
  .table td:nth-child(6),  /* cost basis */
  .table th:nth-child(8),
  .table td:nth-child(8),  /* gain $ */
  .table th:nth-child(9),
  .table td:nth-child(9),  /* gain % */
  .table th:nth-child(10),
  .table td:nth-child(10), /* % of account */
  .table th:nth-child(12),
  .table td:nth-child(12), /* 52w range */
  .table th:nth-child(14),
  .table td:nth-child(14),  /* frequency */
  .table th:nth-child(15),
  .table td:nth-child(15)  /* dividend % */ {
    display: none;
  }

  /* Reduce minimum width so less scrolling is needed */
  .table {
    min-width: 820px;
  }
}

/* iPhone 15 (and similar ~393px wide) */
@media (max-width: 430px) {
  /* Give content a bit more room */
  .main {
    padding: 14px;
  }
  .card {
    padding: 14px;
  }
  .sidebar {
    padding: 14px;
  }
  .section {
    padding: 14px;
  }

   /* Prevent double-padding on Holdings cards */
  #holdings, .holdings-cards {
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Buttons wrap nicely */
  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  .topbar-actions .btn {
    flex: 1 1 auto;
  }

  /* Make the holdings table require minimal horizontal scrolling */
  .table {
    min-width: 720px;
  }

  /* Hide more columns on tiny screens (keep only essentials) */
  /* Visible: Logo, Company, Ticker, Quantity, Last Price, Current Value, Dividend Amt, Actions */
  .table th:nth-child(6),
  .table td:nth-child(6),  /* cost basis */
  .table th:nth-child(8),
  .table td:nth-child(8),  /* gain $ */
  .table th:nth-child(9),
  .table td:nth-child(9),  /* gain % */
  .table th:nth-child(10),
  .table td:nth-child(10), /* % of account */
  .table th:nth-child(11),
  .table td:nth-child(11), /* sector */
  .table th:nth-child(12),
  .table td:nth-child(12), /* 52w range */
  .table th:nth-child(14),
  .table td:nth-child(14),  /* frequency */
  .table th:nth-child(15),
  .table td:nth-child(15)  /* dividend % */ {
    display: none;
  }

  /* Reduce header stickiness “jank” on small screens */
  .table thead th {
    font-size: 11px;
  }

  /* Sidebar nav: make it two columns so it’s not super tall */
  .nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

/* Mobile overflow safety: allow grid/flex children to shrink */
@media (max-width: 520px) {
  .card, .panel, .section, .holding-card,
  .holding-card * {
    min-width: 0;
  }

   /* If your projected-income cards are in a grid */
  .kpi-grid, .stats-grid, .income-grid {
    grid-template-columns: 1fr !important;
  }

  /* If they’re flex-based */
  .kpi-grid, .stats-grid, .income-grid {
    flex-wrap: wrap;
  }
  
  .kpi-grid > *, .stats-grid > *, .income-grid > * {
    flex: 1 1 100%;
  }
  .holding-card .hc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  /* Prevent long values (like $1,803.00) from pushing layout wider */
  .holding-card .hc-item,
  .holding-card .value-sm,
  .holding-card .hc-meta {
    min-width: 0;
  }

  .holding-card .value-sm {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Meta row (ticker • sector pill • % of acct) should wrap instead of overflow */
  .holding-card .hc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
  }
}

/* CSV import validation (preview gating) */
.csv-validation {
  border: 1px solid var(--stroke2);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  padding: 12px;
}

.csv-validation.is-fatal {
  border-color: rgba(255, 92, 168, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 92, 168, 0.12) inset;
}

.csv-issues-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.csv-issues-title--fatal { color: rgba(255, 92, 168, 0.95); }
.csv-issues-title--warn  { color: rgba(255, 184, 107, 0.95); }

.csv-issues {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.csv-issues li { margin: 4px 0; }

.compare-pill.is-free {
   white-space: nowrap;
}

/* ===== Mobile mood pass: darker background ===== */
@media (max-width: 900px) {
  body {
    background:
      radial-gradient(
        700px 500px at 20% 10%,
        rgba(124, 92, 255, 0.10),
        transparent 65%
      ),
      radial-gradient(
        600px 450px at 85% 25%,
        rgba(45, 226, 230, 0.07),
        transparent 60%
      ),
      radial-gradient(
        800px 600px at 50% 120%,
        rgba(255, 92, 168, 0.06),
        transparent 65%
      ),
      var(--bg);
  }

  body::before {
      content: "";
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.26);
      pointer-events: none;
      z-index: -1;
    }
}

@media (max-width: 418px){
  .compare-callout-2 .compare-callout-inner{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .compare-callout-2 .compare-callout-sep{
    display: none;
  }

  .compare-callout-2 .compare-callout-dot{
    margin-bottom: 4px;
  }
}

@media (max-width: 418px){
  .compare-callout-2 .compare-callout-dot{
    transform: translateY(2px);
  }
}