/* ==========================================================================
   Dividendly — site styles.
   Clean, neutral, research-oriented. Readable tables, sticky header,
   muted palette, strong number alignment. No flourishes.
   ========================================================================== */

:root {
  --bg: #eef5fb;            /* very light baby blue */
  --surface: #ffffff;
  --border: #d6e2ec;
  --border-strong: #bccdda;
  --ink: #15303a;           /* deep teal-slate */
  --ink-soft: #45606d;
  --ink-mute: #74909e;
  --accent: #0f766e;        /* teal */
  --accent-dark: #0b5f58;
  --up: #1a7f4b;
  --down: #b22a2a;
  --warn: #b8860b;
  --row-alt: #f1f7fc;
  --row-hover: #e3eff8;
  --thead-bg: #e8f1f8;
  --sort-hover: #ddeaf4;
  --brand: #178a7a;         /* teal-green wordmark (matches the logo) */
  --brand-soft: #57b0a4;    /* lighter teal for ".com" */
  --shadow: 0 2px 10px rgba(22, 32, 48, 0.07);
  --radius: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---- Header / nav ---- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; line-height: 1.15; }
.brand:hover { text-decoration: none; }
.brand-logo { display: inline-flex; flex: 0 0 auto; }
.brand-logo svg { display: block; }
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand);
}
.brand-dot { color: var(--brand-soft); font-weight: 600; }
.brand-tag { font-size: 12px; color: var(--ink-mute); }

.topnav { display: flex; flex-wrap: wrap; gap: 6px; }
.topnav a {
  display: inline-block;
  padding: 6px 11px;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  white-space: nowrap;
}
.topnav a:hover { background: var(--row-hover); border-color: var(--border-strong, var(--border)); text-decoration: none; }
.topnav a.current { color: var(--accent-dark); background: var(--row-hover); border-color: var(--accent); }
/* Cross-site link to the sibling Preferred Stock AI site — accented so it reads as "elsewhere" */
.topnav .nav-ext-link { color: var(--accent-dark); border-color: var(--accent); }
.topnav .nav-ext-link:hover { background: var(--accent); color: #fff; }

/* ---- Layout: content + sidebar ---- */
.layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
  padding-top: 24px;
  padding-bottom: 40px;
}
.content { min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
}

/* ---- Headings ---- */
h1, h2, h3 { color: var(--ink); line-height: 1.25; }
h1 { font-size: 26px; margin: 0 0 6px; }
h2 { font-size: 20px; margin: 28px 0 10px; }
.page-lede { color: var(--ink-soft); margin: 0 0 20px; font-size: 15px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 2px solid var(--border-strong);
  padding-bottom: 6px; margin: 26px 0 12px;
}
.section-head h2 { margin: 0; }
.section-head .more { font-size: 13px; }

/* ---- Data tables ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}
.data-table thead th {
  background: var(--thead-bg);
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--border-strong);
  padding: 0;
  white-space: nowrap;
}
.data-table thead th .sort,
.data-table thead th { vertical-align: middle; }
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:nth-child(even) { background: var(--row-alt); }
.data-table tbody tr:hover { background: var(--row-hover); }
.data-table tbody tr:last-child td { border-bottom: 0; }

.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
th.num { text-align: right; }

td.empty, .empty { color: var(--ink-mute); text-align: center; font-style: italic; padding: 18px; }

/* sortable header links */
.sort {
  display: block;
  padding: 9px 12px;
  color: var(--ink-soft);
  text-transform: inherit;
  font: inherit;
  font-weight: 600;
}
.sort:hover { background: var(--sort-hover); text-decoration: none; }
.sort.active { color: var(--accent-dark); }
th.num .sort { text-align: right; }
.sort-arrow { margin-left: 4px; font-size: 10px; color: var(--accent); }
/* Client-side sortable headers (any .data-table without server sort links) */
.data-table thead th.th-sort { cursor: pointer; user-select: none; -webkit-user-select: none; }
.data-table thead th.th-sort:hover { background: var(--sort-hover); }
.data-table thead th.sort-active { color: var(--accent-dark); }
.data-table thead th.th-sort .sort-arrow { font-size: 10px; color: var(--accent); }

/* ticker + company name */
.ticker { font-weight: 600; font-family: var(--mono); }
.co-name { color: var(--ink-soft); margin-left: 8px; font-size: 13px; }

/* dividend + frequency */
.div-amt { font-family: var(--mono); }
.freq {
  display: inline-block;
  min-width: 16px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mute);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 0 3px;
  margin-left: 4px;
}

/* up/down ---- */
.up { color: var(--up); }
.down { color: var(--down); }
/* Financial value accents — used sparingly on a few key metrics (green/amber/red) */
.v-pos { color: var(--up); }
.v-warn { color: var(--warn); }
.v-neg { color: var(--down); }
.chg { font-family: var(--mono); white-space: nowrap; }

/* ---- Cards / article feed ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 16px; margin: 0 0 4px; }
.card .meta { color: var(--ink-mute); font-size: 12.5px; margin: 0 0 6px; }
.card p { margin: 0; color: var(--ink-soft); }

.feed-list { list-style: none; margin: 0; padding: 0; }
.feed-list li { padding: 9px 0; border-bottom: 1px solid var(--border); }
.feed-list li:last-child { border-bottom: 0; }
.feed-list .meta { color: var(--ink-mute); font-size: 12.5px; }

/* ---- Sidebar widgets ---- */
.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.widget-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.widget .note { font-size: 11.5px; color: var(--ink-mute); margin: 8px 0 0; }

.quotes-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.quotes-table th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  color: var(--ink-mute); padding: 2px 4px; border-bottom: 1px solid var(--border);
}
.quotes-table td { padding: 4px; border-bottom: 1px solid var(--row-alt); }
.quotes-table .num { font-family: var(--mono); }

/* email alert forms */
.alert-form { margin-bottom: 12px; }
.alert-form:last-child { margin-bottom: 0; }
.alert-form label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--ink-soft); margin-bottom: 4px;
}
.alert-form input[type="email"] {
  width: 100%; padding: 7px 8px; font-size: 13px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  margin-bottom: 6px;
}
.alert-form button, .btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.alert-form button { width: 100%; }
.alert-form button:hover, .btn:hover { background: var(--accent-dark); text-decoration: none; }

.widget-report .report-cta { font-weight: 700; font-size: 15px; margin: 0 0 4px; }
.widget-report .report-sub { font-size: 13px; color: var(--ink-soft); margin: 0 0 10px; }
.widget-covers .covers-body { font-size: 13.5px; color: var(--ink-soft); }
.widget-covers .covers-body p { margin: 0 0 8px; }

/* flash / thank-you */
.flash {
  background: #e8f3ec; border: 1px solid #b9dcc6; color: var(--up);
  padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px;
}

/* ---- Footer ---- */
.site-footer {
  background: #1c2430;
  color: #aeb6c0;
  margin-top: 40px;
  padding: 28px 0 32px;
  font-size: 13px;
}
.site-footer h4 {
  color: #fff; font-size: 13px; text-transform: uppercase;
  letter-spacing: 0.03em; margin: 0 0 10px;
}
.site-footer a { color: #cdd6e0; }
.site-footer a:hover { color: #fff; }
.footer-cols {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 28px; padding-bottom: 22px; border-bottom: 1px solid #33404f;
}
.footer-cols.footer-sitemap {
  grid-template-columns: repeat(4, 1fr);
}
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { padding: 3px 0; }
.disclaimer { margin: 18px 0 8px; color: #8a949f; line-height: 1.5; }
.attributions { margin: 0 0 8px; color: #8a949f; }
.copyright { margin: 0; color: #707b87; }

@media (max-width: 720px) {
  .footer-cols, .footer-cols.footer-sitemap { grid-template-columns: 1fr; gap: 18px; }
}

/* ---- Guide + Learning Center (educational content) ---- */
.guide-lead { margin: 8px 0 26px; }
.guide-lead h2 { margin-top: 0; }
.guide-lead .byline {
  color: var(--ink-mute); font-size: 12.5px; margin: 0 0 14px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.guide-lead p { margin: 0 0 14px; color: var(--ink-soft); line-height: 1.6; }
.guide-lead p strong { color: var(--ink); }

.takeaways {
  background: var(--row-hover); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: 16px 20px; margin: 0 0 28px;
}
.takeaways h3 {
  margin: 0 0 10px; font-size: 14px; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--accent-dark);
}
.takeaways ul { margin: 0; padding-left: 20px; }
.takeaways li { margin: 0 0 7px; color: var(--ink-soft); line-height: 1.5; }
.takeaways li:last-child { margin-bottom: 0; }

.numbered-sections { list-style: none; counter-reset: gsec; margin: 0; padding: 0; }
.numbered-section {
  counter-increment: gsec; position: relative;
  padding: 0 0 16px 44px; margin: 0 0 18px;
  border-bottom: 1px solid var(--border);
}
.numbered-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.numbered-section::before {
  content: counter(gsec); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-family: var(--mono); font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.numbered-section h3 { margin: 0 0 6px; font-size: 16px; }
.numbered-section p { margin: 0; color: var(--ink-soft); line-height: 1.6; }

.recommended-reading { margin-top: 26px; }

.crumbs { font-size: 12.5px; color: var(--ink-mute); margin: 0 0 8px; }
.learn-article { margin-bottom: 8px; }
.learn-section { margin: 0 0 18px; }
.learn-section h2 { margin: 22px 0 8px; }
.learn-section p { margin: 0 0 12px; color: var(--ink-soft); line-height: 1.6; }
.learn-section p:last-child { margin-bottom: 0; }

/* ---- DRIP Returns Calculator ---- */
.calc-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 22px;
}
.calc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.calc-row:last-child { margin-bottom: 0; }
.calc-row > label {
  flex: 0 0 180px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.calc-form input[type="text"] {
  padding: 7px 9px;
  font-size: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  min-width: 220px;
  text-transform: uppercase;
}
.calc-form select {
  padding: 7px 8px;
  font-size: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
}
.date-group { display: flex; gap: 8px; }
.calc-actions { margin-top: 4px; }
.calc-actions .btn { font-size: 14px; padding: 9px 18px; }

.calc-error {
  background: #fbecec;
  border: 1px solid #e3b9b9;
  color: var(--down);
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.calc-chart-wrap {
  position: relative;
  height: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 18px;
}
.calc-summary { margin-bottom: 14px; }
.calc-notes {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 12px;
}

@media (max-width: 720px) {
  .calc-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .calc-row > label { flex-basis: auto; }
  .calc-form input[type="text"] { min-width: 0; width: 100%; }
  .date-group { flex-wrap: wrap; }
}

/* ==========================================================================
   DESIGN THEMES — switched via the left rail (persisted in localStorage).
   Each theme changes typography, roundness and density, not just color.
   "light" is the :root default.
   ========================================================================== */

/* Dark — blue-gray, larger easy-to-read text */
[data-theme="dark"] {
  --bg:#172230; --surface:#1f2c3d; --border:#314056; --border-strong:#43566f;
  --ink:#e8eef6; --ink-soft:#b3c1d2; --ink-mute:#8597ab;
  --accent:#5ca8e8; --accent-dark:#7dbcf0; --up:#46cf95; --down:#ef7a82; --warn:#e0b341; --brand:#2dd4bf; --brand-soft:#7fe0d4;
  --row-alt:#243347; --row-hover:#2a3b52; --thead-bg:#243347; --sort-hover:#2c3e57;
  --shadow:0 2px 6px rgba(0,0,0,0.35); --radius:10px;
  --font:"Inter","Segoe UI",-apple-system,BlinkMacSystemFont,Roboto,Helvetica,Arial,sans-serif;
}
[data-theme="dark"] body { font-size:15.5px; line-height:1.62; }
[data-theme="dark"] .site-footer { background:#101924; }

/* Finance — clean institutional look: a deep-navy "trust" header, primary-blue
   links/buttons, finance green / amber / red for directional data, and a soft
   gold premium accent. Light, high-trust palette (not a dark theme). */
[data-theme="finance"] {
  --bg:#f8fafc; --surface:#ffffff; --border:#e2e8f0; --border-strong:#cbd5e1;
  --ink:#111827; --ink-soft:#334155; --ink-mute:#64748b;
  --accent:#2563eb; --accent-dark:#1d4ed8;
  --up:#15803d; --down:#b91c1c; --warn:#b45309;
  --row-alt:#f8fafc; --row-hover:#eff6ff; --thead-bg:#f1f5f9; --sort-hover:#e2e8f0;
  --brand:#ffffff; --brand-soft:#c8a24a;   /* white wordmark + soft-gold ".ai" on the navy header */
  --gold:#c8a24a;                           /* premium / luxury accent */
  --shadow:0 1px 3px rgba(15,23,42,0.10); --radius:12px;
}
/* Deep-navy header bar with light brand + nav ("deep trust" #0B1F3A). */
[data-theme="finance"] .site-header { background:#0b1f3a; border-bottom-color:#0b1f3a; }
[data-theme="finance"] .brand-tag { color:#93a3b8; }
/* Nav buttons sit on the navy header: the base rule gives them a WHITE
   (--surface) background, so they MUST get a dark/translucent box here or the
   light lettering would be invisible. Light text on a subtle translucent box
   with a light border keeps the words clearly readable inside each button. */
[data-theme="finance"] .topnav a { color:#e6edf6; background:rgba(255,255,255,0.07); border-color:rgba(255,255,255,0.22); }
[data-theme="finance"] .topnav a:hover { color:#ffffff; background:rgba(255,255,255,0.16); border-color:rgba(255,255,255,0.40); }
[data-theme="finance"] .topnav a.current { color:#ffffff; background:#2563eb; border-color:#3b76f0; }
[data-theme="finance"] .topnav .nav-ext-link { color:#ffd98a; background:rgba(200,162,74,0.12); border-color:rgba(200,162,74,0.45); }
[data-theme="finance"] .topnav .nav-ext-link:hover { background:#c8a24a; color:#0b1f3a; border-color:#c8a24a; }
[data-theme="finance"] .search-wrap input { background:#13294a; border-color:#33475f; color:#e8eef6; }
[data-theme="finance"] .search-wrap input::placeholder { color:#8aa0bd; }
[data-theme="finance"] .site-footer { background:#0b1f3a; }

/* ---- Theme rail (docked far-left, vertical) ---- */
.theme-rail {
  position:fixed; left:12px; top:50%; transform:translateY(-50%); z-index:200;
  display:flex; flex-direction:column; align-items:center; gap:9px;
  background:var(--surface); border:1px solid var(--border-strong);
  border-radius:999px; padding:11px 8px; box-shadow:0 3px 14px rgba(0,0,0,0.20);
}
.theme-rail .tr-label {
  writing-mode:vertical-rl; transform:rotate(180deg);
  font-size:9.5px; text-transform:uppercase; letter-spacing:0.12em; color:var(--ink-mute);
}
.theme-rail button {
  width:24px; height:24px; border-radius:50%; cursor:pointer; padding:0;
  border:2px solid transparent; box-shadow:inset 0 0 0 1px rgba(0,0,0,0.18); transition:transform .1s ease;
}
.theme-rail button:hover { transform:scale(1.15); }
.theme-rail button.active { border-color:var(--accent); }
.theme-rail .sw-light { background:#f7f8fa; }
.theme-rail .sw-dark  { background:#172230; box-shadow:inset 0 0 0 1px #43566f; }
.theme-rail .sw-finance { background:linear-gradient(135deg,#0b1f3a 50%,#2563eb 50%); }
@media (max-width:1260px) {
  .theme-rail { flex-direction:row; left:50%; top:auto; bottom:12px; transform:translateX(-50%); padding:8px 12px; }
  .theme-rail .tr-label { writing-mode:horizontal-tb; transform:none; margin-right:2px; }
}

/* ---- Site search (header) ---- */
.search-wrap { position:relative; flex:1 1 220px; max-width:340px; margin:0 8px; }
.search-wrap input {
  width:100%; padding:7px 14px; font-size:14px; color:var(--ink);
  background:var(--bg); border:1px solid var(--border-strong); border-radius:999px;
}
.search-wrap input:focus { outline:none; border-color:var(--accent); }
.search-results {
  display:none; position:absolute; top:calc(100% + 5px); left:0; right:0; z-index:120;
  background:var(--surface); border:1px solid var(--border-strong); border-radius:var(--radius);
  box-shadow:0 6px 20px rgba(0,0,0,0.18); overflow:hidden auto; max-height:360px;
}
.search-results.open { display:block; }
.sr-item { display:flex; align-items:baseline; gap:9px; padding:8px 12px; border-bottom:1px solid var(--border); }
.sr-item:last-child { border-bottom:0; }
.sr-item:hover { background:var(--row-hover); text-decoration:none; }
.sr-tk { font-family:var(--mono); font-weight:600; color:var(--accent-dark); }
.sr-nm { color:var(--ink-soft); font-size:13px; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sr-ty { font-size:10px; font-weight:700; color:var(--ink-mute); border:1px solid var(--border-strong); border-radius:3px; padding:0 4px; }
.sr-empty { padding:10px 12px; color:var(--ink-mute); font-size:13px; }

/* ---- Favorite star + share ---- */
.fav-star, .share-btn {
  display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; padding:0;
  border:0; background:transparent; cursor:pointer; font-size:16px; line-height:1;
  color:var(--ink-mute); vertical-align:middle; border-radius:6px;
}
.fav-star::before { content:"\2606"; }
.fav-star.on { color:#e3a924; }
.fav-star.on::before { content:"\2605"; }
.fav-star:hover, .share-btn:hover { background:var(--row-hover); color:var(--accent); }
.share-btn::before { content:"\1F517"; font-size:13px; }
.share-btn.copied { color:var(--up); }
td .fav-star, td .share-btn { width:22px; height:22px; font-size:15px; }
.item-actions { display:inline-flex; gap:2px; margin-left:8px; vertical-align:middle; }

/* ---- Favorites email modal ---- */
.modal { display:none; position:fixed; inset:0; z-index:300;
  background:rgba(10,16,24,0.55); align-items:center; justify-content:center; padding:20px; }
.modal.open { display:flex; }
.modal-card {
  background:var(--surface); border:1px solid var(--border-strong); border-radius:var(--radius);
  box-shadow:0 14px 44px rgba(0,0,0,0.32); padding:22px 24px; max-width:430px; width:100%;
}
.modal-card h3 { margin:0 0 8px; font-size:18px; }
.modal-card p { margin:0 0 14px; color:var(--ink-soft); font-size:13.5px; line-height:1.5; }
.modal-card input[type="email"] {
  width:100%; padding:9px 12px; font-size:14px; margin-bottom:12px; color:var(--ink);
  border:1px solid var(--border-strong); border-radius:var(--radius); background:var(--bg);
}
.modal-actions { display:flex; gap:8px; justify-content:flex-end; }
.modal-actions .btn-secondary {
  background:transparent; color:var(--ink-soft); border:1px solid var(--border-strong);
  border-radius:var(--radius); padding:8px 14px; font-size:13px; font-weight:600; cursor:pointer;
}
.modal-note { font-size:11.5px; color:var(--ink-mute); margin-top:10px; }

/* ---- Favorites page + nav badge ---- */
.fav-empty { text-align:center; color:var(--ink-mute); padding:40px 20px; }
.fav-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:0 0 16px; color:var(--ink-soft); font-size:13.5px; }
.nav-fav-link .fav-count {
  display:inline-block; min-width:16px; text-align:center; font-size:11px; font-weight:700;
  background:var(--accent); color:#fff; border-radius:999px; padding:0 5px; margin-left:3px;
}

/* ---- Compact stat grid (symbol-page quote box, dividend growth) ---- */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px,1fr)); gap:10px; margin:0 0 8px; }
.stat {
  background:var(--surface); border:1px solid var(--border); border-radius:10px;
  padding:10px 12px; display:flex; flex-direction:column; gap:3px; box-shadow:var(--shadow);
}
.stat .s-label { font-size:11px; text-transform:uppercase; letter-spacing:0.03em; color:var(--ink-mute); }
.stat .s-val { font-size:15px; font-weight:600; font-family:var(--mono); overflow-wrap:anywhere; }
/* Keep all symbol-page card grids a clean two-wide on phones (don't collapse to one column). */
@media (max-width: 760px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.splits-note { font-size:12.5px; color:var(--ink-mute); margin:2px 0 6px; }
.sym-logo { width:34px; height:34px; border-radius:8px; object-fit:contain; background:#fff; border:1px solid var(--border); padding:3px; align-self:center; }
.row-logo { width:18px; height:18px; border-radius:4px; object-fit:contain; background:#fff; border:1px solid var(--border); vertical-align:middle; margin:0 5px 0 1px; }

/* ---- About-the-company blurb (symbol page, expandable) ---- */
.about-company { margin:2px 0 20px; background:var(--row-alt); border:1px solid var(--border); border-left:3px solid var(--accent); border-radius:var(--radius); padding:14px 16px; }
.about-text { color:var(--ink-soft); font-size:14px; line-height:1.6; margin:0; max-height:4.8em; overflow:hidden; }
.about-text.expanded { max-height:none; }
.about-toggle { background:none; border:0; color:var(--accent); font-weight:600; font-size:13px; cursor:pointer; padding:5px 0 0; }
.about-toggle:hover { text-decoration:underline; }

/* ---- Home dashboard ---- */
.dash-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap:16px; }
.dash-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); padding:4px 14px 10px; }
.dash-head { display:flex; align-items:baseline; justify-content:space-between; border-bottom:1px solid var(--border); padding:9px 0 7px; margin-bottom:2px; }
.dash-head h2 { font-size:15px; margin:0; }
.dash-head .more { font-size:12px; }
.dash-table { width:100%; border-collapse:collapse; font-size:13px; }
.dash-table td { padding:6px 0; border-bottom:1px solid var(--row-alt); vertical-align:middle; }
.dash-table tr:last-child td { border-bottom:0; }
.dash-table .dt-name { white-space:nowrap; overflow:hidden; }
.dash-table .co-name { display:inline-block; max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; vertical-align:middle; font-size:12px; margin-left:5px; }
/* Mobile: pin the % column and let the name truncate, so a dashboard row can never
   be wider than its card (which was pushing the whole page off the right edge). */
@media (max-width: 760px) {
  .dash-table { table-layout: fixed; }
  .dash-table td.num { width: 84px; }
  .dash-table .dt-name { text-overflow: ellipsis; }
  .dash-table .co-name { max-width: none; }
}

/* ---- Top-ranked report ---- */
.report-disclaimer { margin:18px 0 0; padding:12px 14px; background:var(--row-alt); border:1px solid var(--border); border-radius:var(--radius); font-size:12.5px; color:var(--ink-soft); line-height:1.5; }
.safe-flag { display:inline-block; font-size:11px; font-weight:700; letter-spacing:0.04em; color:#fff; background:var(--up); border-radius:4px; padding:1px 6px; }

/* ---- Suggested shares sidebar widget ---- */
.suggest-list { list-style:none; margin:0; padding:0; }
.suggest-list li { display:flex; align-items:center; gap:6px; padding:6px 0; border-bottom:1px solid var(--row-alt); font-size:13px; }
.suggest-list li:last-child { border-bottom:0; }
.suggest-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink-soft); font-size:12px; }
.suggest-yield { font-family:var(--mono); font-size:12px; color:var(--up); font-weight:600; }

/* ---- Small footer signup ---- */
.footer-signup { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:16px 0 6px; font-size:12.5px; }
.footer-signup label { color:#cdd6e0; }
.footer-signup input[type="email"] { padding:6px 9px; font-size:12.5px; border:1px solid var(--border-strong); border-radius:var(--radius); min-width:200px; }
.footer-signup button { background:var(--accent); color:#fff; border:0; border-radius:var(--radius); padding:6px 14px; font-size:12.5px; font-weight:600; cursor:pointer; }

/* ---- Favorites news opt-in ---- */
.fav-optin { display:flex; align-items:flex-start; gap:7px; font-size:12.5px; color:var(--ink-soft); margin:0 0 12px; cursor:pointer; line-height:1.4; }
.fav-optin input { margin-top:2px; }

/* ---- Symbol: clamped dividend history + bottom explore grid ---- */
.history-table .hist-extra { display:none; }
.history-table.expanded .hist-extra { display:table-row; }
.hist-toggle { background:none; border:0; color:var(--accent); font-weight:600; font-size:13px; cursor:pointer; padding:9px 0 0; }
.hist-toggle:hover { text-decoration:underline; }
.suggest-more { display:inline-block; margin-top:8px; font-size:12.5px; }
.explore-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px,1fr)); gap:10px; margin:4px 0 0; }
.explore-card { display:flex; flex-direction:column; gap:3px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); padding:10px 12px; }
.explore-card:hover { border-color:var(--accent); text-decoration:none; }
.explore-card .ec-top { display:flex; align-items:center; gap:6px; }
.explore-card .ec-ticker { font-family:var(--mono); font-weight:600; color:var(--accent-dark); }
.explore-card .ec-name { font-size:11.5px; color:var(--ink-soft); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.explore-card .ec-yield { font-family:var(--mono); font-size:12px; color:var(--up); font-weight:600; }

/* ---- Mobile: header is unpinned and wraps cleanly; nav buttons wrap to rows ---- */
@media (max-width: 760px) {
  .brand-tag { display:none; }
  .header-inner { gap:6px; }
  .search-wrap { order:2; flex:1 1 100%; max-width:none; margin:4px 0 0; min-width:0; }
  .search-wrap input { width:100%; min-width:0; }
  /* Wrap the nav so every button shows; min-width:0 lets these flex children shrink so
     the header bar can never grow wider than the screen (it was clipping toggle + nav). */
  .topnav { order:3; flex:1 1 100%; flex-wrap:wrap; gap:6px; min-width:0; }
  .topnav a { padding:6px 10px; }
  .brand-name { font-size:18px; }

  /* Header is NOT pinned on mobile — it scrolls away with the page */
  .site-header { position: static; }
  /* Never let the page itself scroll sideways... */
  html, body { overflow-x: hidden; }
  /* ...instead, a wide data table scrolls inside its own box (page stays put) */
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
}

/* ---- Guided / Expert mode ------------------------------------------------ */
/* Floating "View" rail — slides between More info / Expert; docks like the theme rail */
.view-rail {
  position:fixed; left:50%; transform:translateX(-50%); bottom:16px; z-index:200;
  display:flex; align-items:center; gap:9px;
  background:var(--surface); border:1px solid var(--border-strong);
  border-radius:999px; padding:6px 10px 6px 15px; box-shadow:0 3px 14px rgba(0,0,0,0.20);
}
.view-rail .vr-label { font-size:10px; text-transform:uppercase; letter-spacing:0.1em; color:var(--ink-mute); }
/* When the theme rail drops to bottom-center (<=1260px), sit just above it */
@media (max-width:1260px) { .view-rail { bottom:62px; } }
.mt-switch {
  position:relative; display:grid; grid-template-columns:1fr 1fr; padding:3px;
  background:var(--row-alt); border:1px solid var(--border); border-radius:999px;
}
/* The pill that slides between Guided (left) and Expert (right) */
.mt-thumb {
  position:absolute; top:3px; bottom:3px; left:3px; width:calc((100% - 6px) / 2);
  border-radius:999px; background:var(--accent); box-shadow:var(--shadow);
  transition:transform .22s ease;
}
.mt-switch button {
  position:relative; z-index:1; font:inherit; font-size:12.5px; font-weight:600;
  cursor:pointer; border:0; background:none; color:var(--ink-soft);
  padding:5px 16px; border-radius:999px; white-space:nowrap; transition:color .2s ease;
}
[data-mode="expert"] .mt-thumb { transform:translateX(100%); }
[data-mode="guided"] .mt-switch button[data-mode-name="guided"],
[data-mode="expert"] .mt-switch button[data-mode-name="expert"] { color:#fff; }

/* Guided helper text: hidden in Expert, shown in Guided */
.guide-note { display:none; }
[data-mode="guided"] .guide-note {
  display:block; margin-top:7px; padding-top:7px; border-top:1px dashed var(--border);
  font-family:var(--font); font-size:12px; font-weight:400; font-style:normal;
  line-height:1.45; color:var(--ink-soft); text-transform:none; letter-spacing:0;
  overflow-wrap:anywhere;
}
[data-mode="guided"] .stat { gap:4px; }

/* ---- Homepage welcome ---------------------------------------------------- */
.welcome { margin:4px 0 22px; }
.welcome-title { margin:0 0 8px; }
.welcome-lede { color:var(--ink); font-size:16px; line-height:1.55; margin:0 0 10px; max-width:72ch; }
.welcome-lede strong { font-weight:600; }
.welcome-modes { color:var(--ink-soft); font-size:14px; line-height:1.5; margin:0; max-width:72ch; }
.link-btn {
  font:inherit; color:var(--accent-dark, var(--accent)); font-weight:600;
  background:none; border:none; padding:0; cursor:pointer;
  text-decoration:underline; text-underline-offset:2px;
}
.link-btn:hover { color:var(--accent); }

@media (max-width: 760px) {
  .mt-switch button { padding:5px 13px; font-size:12px; }
}

/* ---- Homepage: Guided/Expert mode cards + intro card ---------------------- */
.mode-cards { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:4px 0 16px; }
/* Once the visitor has picked a view, the big onboarding cards collapse to the floating toggle */
[data-mode-chosen] .mode-cards { display:none; }
@media (max-width: 680px) { .mode-cards { grid-template-columns:1fr; } }
.mode-card {
  display:flex; gap:13px; align-items:flex-start; text-align:left; width:100%;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:16px 18px; cursor:pointer; font:inherit; color:var(--ink);
}
.mode-card:hover { border-color:var(--accent); }
.mode-card .mc-icon { font-size:22px; line-height:1.1; flex:0 0 auto; }
.mode-card .mc-title { display:block; font-weight:700; font-size:15px; }
.mode-card .mc-desc { display:block; color:var(--ink-soft); font-size:13px; line-height:1.5; margin-top:5px; }
.on-badge {
  display:none; font-size:11px; font-weight:600; color:var(--up);
  border:1px solid var(--up); border-radius:999px; padding:0 7px; margin-left:7px; vertical-align:middle;
}
/* Highlight + reveal the "on" badge for whichever mode is active */
[data-mode="guided"] .mode-card.guided,
[data-mode="expert"] .mode-card.expert { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent), var(--shadow); }
[data-mode="guided"] .mode-card.guided .on-badge,
[data-mode="expert"] .mode-card.expert .on-badge { display:inline-block; }

.intro-card {
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:20px 22px; margin:0 0 18px;
}
.intro-title { font-size:13px; text-transform:uppercase; letter-spacing:0.04em; color:var(--ink-mute); font-weight:700; margin:0 0 12px; }
.intro-card p { margin:0 0 10px; line-height:1.6; color:var(--ink); max-width:none; }
.intro-card p:last-child { margin-bottom:0; }
.intro-card strong { font-weight:600; color:var(--ink); }
.intro-more { display:none; }  /* desktop shows the full intro; no toggle needed */

/* Mobile: drop the big Guided/Expert cards (the header toggle covers it) and
   collapse the intro to a short teaser + "More" so the data is right there. */
@media (max-width: 760px) {
  .mode-cards { display:none; }
  .intro-card { padding:14px 16px; margin-bottom:14px; }
  .intro-title { margin-bottom:8px; }
  .intro-body { max-height:3.2em; overflow:hidden; }
  .intro-body.expanded { max-height:1400px; }
  .intro-more { display:inline-block; }
}

/* ---- Contact form ---- */
.contact-wrap { max-width: 560px; }
.contact-form { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 28px 32px; }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-row label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.form-row input, .form-row select, .form-row textarea {
  border: 1px solid var(--border); border-radius: 6px; padding: 9px 12px;
  font-size: 14px; font-family: inherit; background: var(--bg); color: var(--ink);
  width: 100%; box-sizing: border-box;
}
.form-row textarea { resize: vertical; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--accent);
}
.form-submit { margin-top: 6px; }
.form-note { margin: 14px 0 0; font-size: 12px; color: var(--ink-mute); }

/* ---- Alert boxes ---- */
.alert { border-radius: 8px; padding: 14px 18px; margin-bottom: 22px; font-size: 14px; }
.alert-success { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; }
.alert-error   { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
[data-theme=dark] .alert-success, [data-theme=finance] .alert-success { background: #064e3b; border-color: #065f46; color: #a7f3d0; }
[data-theme=dark] .alert-error,   [data-theme=finance] .alert-error   { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
