/* ============================================================
   style.css — the look of the whole site (colors, fonts, spacing).
   Both pages load this file, so changing a color here changes it everywhere.
   ============================================================ */

/* The color palette. Change these to restyle the site. */
:root {
  --bg: #F2F4F8;        /* page background */
  --surface: #FFFFFF;   /* cards */
  --ink: #131B2E;       /* main text */
  --muted: #5A6478;     /* secondary text */
  --line: #DCE1EA;      /* borders */
  --accent: #2F57E8;    /* brand blue */
  --accent-soft: #EAF0FD;
  --up: #11845B;        /* green for gains */
  --down: #C8323A;      /* red for losses */
  --warn: #B4540A;
  --warn-soft: #FFF4E5;
  --shadow: 0 1px 2px rgba(19,27,46,.06), 0 12px 32px rgba(19,27,46,.08);
}

/* Dark mode, used automatically if your computer is set to dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1321; --surface: #151D30; --ink: #E9EDF5; --muted: #9AA4B8;
    --line: #26304A; --accent: #7D9BFF; --accent-soft: #1A2744;
    --up: #3FCB93; --down: #FF7078;
    --warn: #FFB566; --warn-soft: #2E2210;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

/* Anything marked hidden stays hidden, even if a layout style says otherwise */
[hidden] { display: none !important; }

/* Space between the "What you actually own" and fees cards */
#insights { display: grid; gap: 16px; margin-bottom: 48px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

/* "Foliopal is launching soon" bar across the top of every page */
.launch-bar { background: var(--accent); text-align: center; padding: 9px 16px; font-size: 14px; }
.launch-bar a { color: #fff; text-decoration: none; }
.launch-bar a:hover b { text-decoration: underline; }

/* Keeps content from stretching too wide on big screens */
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

a { color: var(--accent); }

/* ---------- Top navigation bar ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 20px 0; flex-wrap: wrap;
}
.logo { font-weight: 800; font-size: 24px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 8px 20px; align-items: center; flex-wrap: wrap; }
.nav-links a { text-decoration: none; font-weight: 600; font-size: 15px; color: var(--muted); }
.nav-links a.active { color: var(--ink); }
.nav-links a.btn { color: #fff; } /* keep the top-right button's text white */

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 13px 22px; border-radius: 999px; border: 0;
  background: var(--accent); color: #fff; font-family: inherit;
  font-weight: 600; font-size: 16px; line-height: 1;
  text-decoration: none; cursor: pointer;
}
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.small { padding: 9px 14px; font-size: 14px; }

/* ---------- Homepage ---------- */
.hero { padding: 40px 0 64px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero-text { min-width: 0; }

/* The example app screen next to the headline */
.preview { background: var(--surface); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); display: grid; gap: 14px; min-width: 0; }
.preview-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.preview-title { font-weight: 700; font-size: 18px; }
.pill { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.pill.soon { background: var(--warn-soft); color: var(--warn); }
.big-number { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.preview .bubble { margin: 0; font-size: 15.5px; }
.mini-rows { display: grid; }
.mini-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 4.5em; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; font-variant-numeric: tabular-nums; }
.mini-row span:nth-child(n+2) { text-align: right; }
.mini-row small { color: var(--muted); font-size: 13px; }
.ask-teaser { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 600; font-size: 15px; color: var(--accent); }

/* Feature list under the hero buttons */
.feature-chips { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.feature-chips li { font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.feature-chips li::before { content: "✓ "; color: var(--up); }
.feature-chips li.soon::before { content: "Soon · "; color: var(--warn); }

/* "News for you" teaser */
.news-item { display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; border-left: 3px solid var(--warn); background: var(--warn-soft); }
.news-item p { margin: 0; font-size: 15px; }
.news-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.news-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); }
.summary + .news-item { margin-top: 16px; }

/* Feature cards */
.features .card { display: grid; gap: 8px; align-content: start; }
.features .pill { justify-self: start; }
.features h3 { margin: 4px 0 0; }
.features .card.highlight { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--accent-soft); }

/* "Sound familiar?" quotes */
.quotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.quote { font-size: 20px; font-weight: 600; line-height: 1.35; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); }

/* Does / never does */
.sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.sides ul { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.sides li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; color: var(--muted); }
.sides li::before { font-weight: 700; }
.sides .yes li::before { content: "✓"; color: var(--up); }
.sides .no li::before { content: "×"; color: var(--down); }
.tagline { font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.hero h1 { font-size: clamp(40px, 5.5vw, 60px); line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 20px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: 20px; color: var(--muted); margin: 0 0 28px; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; }

section { padding: 56px 0; border-top: 1px solid var(--line); }
section h2 { font-size: clamp(28px, 4.5vw, 40px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 16px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.lead { color: var(--muted); max-width: 60ch; margin: 0; }

/* Three cards side by side (stack on phones) */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.card { background: var(--surface); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin: 0 0 8px; font-size: 20px; }
.card p { margin: 0; color: var(--muted); }
.step-num { font-size: 13px; font-weight: 700; color: var(--accent); }

/* Example speech bubble */
.bubble { background: var(--accent-soft); border-radius: 16px 16px 16px 4px; padding: 16px 18px; margin-top: 24px; max-width: 620px; }

/* Waitlist section */
.join { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
form.waitlist { display: grid; gap: 14px; }
.hidden-field { display: none; }

/* ---------- Forms (shared) ---------- */
label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
label small { font-weight: 400; color: var(--muted); }
input, select {
  font-size: 16px; font-family: inherit; padding: 11px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
.hint { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.error { font-size: 14px; color: var(--warn); margin: 10px 0 0; }
.success { font-size: 15px; color: var(--up); font-weight: 600; margin: 0; }

/* ---------- Portfolio page ---------- */
.page-title { font-size: clamp(32px, 5vw, 44px); letter-spacing: -0.02em; margin: 24px 0 8px; }
.columns { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; margin: 24px 0 48px; }

/* Slim connected-accounts bar at the very top of My Portfolio */
.acct-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 8px 8px 10px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow);
  font-size: 14px; margin-top: 16px;
}
.acct-bar .from-chip { padding: 4px 10px; }
.acct-bar-text { color: var(--muted); }
.acct-bar-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
#connect-msg { margin: 8px 0 0; }

/* Small "Soon" tag in the top menu */
.soon-tag { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); vertical-align: 2px; }

/* Ask AI page */
.ask-wrap { max-width: 700px; margin-bottom: 48px; }
.ask-wrap .ai-head { margin: 24px 0 0; }
.ask-wrap .page-title { margin: 0; }
.ask-wrap .card { margin-top: 24px; }
#ai-context { margin: 0; }

/* Compact "Add a stock or fund manually" card */
#add { padding: 14px 16px; }
.add-head { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 8px; }
.add-head h3 { margin: 0; font-size: 16px; }
.add-head .hint { margin: 0; font-size: 13px; }
#add input { padding: 8px 10px; font-size: 15px; }
#add label, #add .combo-label { font-size: 13px; }
#add .combo, #add label { gap: 4px; }
#add form.add .btn { margin-top: 21px; padding: 10px 16px; font-size: 14px; }
#add .hint:last-child { margin-top: 6px; font-size: 13px; }

/* "Your portfolio" card at the top */

.pf-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.pf-label { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#pf-change { font-weight: 600; font-variant-numeric: tabular-nums; }
.portfolio-card .from { margin-top: 0; }

form.add { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 10px; align-items: start; }
form.add .btn { margin-top: 27px; } /* line up with the boxes, below their labels */
#add { margin-top: 16px; }
#add + .portfolio-card, .portfolio-card + .news-item { margin-top: 16px; }
.portfolio-card + .news-item { margin-bottom: 16px; }


/* Stock search box with suggestions underneath */
.combo { position: relative; display: grid; gap: 6px; }
.combo-label { font-weight: 600; font-size: 14px; }
.picked-name { font-size: 14px; color: var(--muted); margin: 0; }
.suggestions {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
  margin: 6px 0 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); max-height: 340px; overflow-y: auto;
}
.sug {
  display: grid; grid-template-columns: 4.5em minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 15px;
}
.sug:hover, .sug.active { background: var(--accent-soft); }
.sug-sym { font-weight: 700; }
.sug-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
}
.stock-name { display: block; font-size: 13px; color: var(--muted); font-weight: 400; max-width: 16em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* "You're looking at an example" note */
.banner {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 18px; padding: 10px 12px 10px 14px; border-radius: 12px;
  background: var(--accent-soft); font-size: 14px; font-weight: 600;
}
.empty-state { display: grid; gap: 12px; justify-items: start; padding-top: 16px; }
.empty-state p { margin: 0; color: var(--muted); }
.live-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Homepage FAQ */
.faq { display: grid; gap: 10px; margin-top: 24px; max-width: 720px; }
.faq details { background: var(--surface); border-radius: 14px; padding: 4px 18px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
.faq details p { margin: 0 0 14px; color: var(--muted); }

.live-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; font-size: 14px; color: var(--muted); }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 6px; white-space: nowrap; }
td { padding: 10px 6px; border-top: 1px solid var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ticker { font-weight: 700; }
.up { color: var(--up); }
.down { color: var(--down); }
.remove { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px; }
.remove:hover { color: var(--warn); }
.empty { color: var(--muted); padding: 16px 0 0; margin: 0; }

.summary p { margin: 0 0 12px; }
.summary p:last-child { margin: 0; }
.flag { display: block; background: var(--warn-soft); border-left: 3px solid var(--warn); padding: 10px 12px; border-radius: 0 10px 10px 0; }

/* ---------- Connected accounts (example) ---------- */
.left-col, .right-col { display: grid; gap: 16px; min-width: 0; }
#accounts { display: grid; gap: 12px; }
#accounts .btn { justify-self: start; }
#accounts .hint { margin: 0; }
.acct { display: grid; gap: 6px; padding: 14px 16px; border-radius: 14px; background: var(--bg); }
.acct-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.acct-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.connected { font-size: 13px; font-weight: 600; color: var(--up); }

/* Green "connected" light, gently pulsing */
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--up); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 25%, transparent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--up) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

/* "● Fidelity · Connected through Plaid" line above the holdings */
.from { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; font-size: 14px; color: var(--muted); }
.from-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-weight: 700; }
.acct-sub { font-size: 14px; color: var(--muted); }
.via { display: inline-flex; align-items: center; gap: 6px; justify-self: start; font-size: 13px; font-weight: 600; color: var(--up); padding: 4px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line); }
.acct-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.acct-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- "Ask Foliopal AI" (coming soon) card ---------- */
.ai-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ai-head h3 { margin: 0; }
.chat { display: grid; gap: 10px; margin: 14px 0; }
.msg { max-width: 90%; padding: 10px 14px; border-radius: 16px; font-size: 15px; }
.msg.me { justify-self: end; background: var(--accent); color: #fff; border-radius: 16px 16px 4px 16px; }
.msg.bot { justify-self: start; background: var(--bg); border-radius: 16px 16px 16px 4px; }
.msg-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; cursor: pointer; font: inherit; font-size: 14px; padding: 8px 12px; border-radius: 999px; background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); text-align: left; }
.chip:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.locked-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 14px; }
.locked-box input { opacity: .6; cursor: not-allowed; }
.soon-signup { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--accent-soft); display: grid; gap: 10px; }
.soon-signup p { margin: 0; }
.soon-signup .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.soon-signup input { background: var(--surface); }

/* ---------- Deeper look: what you own, fees, advisor questions ---------- */
.columns.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
#own { margin-top: 0; }
#own .hint:first-of-type, #each .hint:first-of-type { margin: 0 0 14px; }
.co-list { display: grid; gap: 8px; }
details.co { background: var(--bg); border-radius: 14px; }
details.co summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 14px;
  gap: 12px; align-items: center; padding: 10px 14px;
}
details.co summary::-webkit-details-marker { display: none; }
.co-logo {
  width: 36px; height: 36px; border-radius: 10px; background: var(--surface); overflow: hidden;
  display: grid; place-items: center; font-weight: 700; color: var(--accent);
}
.co-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.co-head { min-width: 0; }
.co-pct { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.chev { font-size: 22px; line-height: 1; color: var(--muted); transition: transform .15s ease; }
details.co[open] .chev { transform: rotate(90deg); }
.co-body { display: grid; gap: 12px; padding: 0 14px 14px 62px; }
.co-body p { margin: 0; }
.facts { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.fact { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 10px; font-size: 15px; }
.fact-label { color: var(--muted); }

.fee-total { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; }
#fee-ten { margin: 4px 0 12px; }
.fee-rows { display: grid; margin-bottom: 14px; }
.fee-row { display: grid; grid-template-columns: 5em minmax(0, 1fr) auto; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.fee-what { color: var(--muted); }
#fees label { margin-bottom: 4px; }

.qs { margin: 12px 0 16px; padding-left: 22px; display: grid; gap: 10px; }
.qs li { padding-left: 4px; }

@media (max-width: 760px) {
  .columns.even { grid-template-columns: 1fr; }
  details.co summary { grid-template-columns: 36px minmax(0, 1fr) 14px; }
  .co-pct { display: none; }
  .co-body { padding-left: 14px; }
  .fact { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }

/* ---------- News page ---------- */
.news-page { display: grid; gap: 16px; margin: 24px 0 48px; }
.news-page .card > .hint:first-of-type { margin: 4px 0 8px; }
.news-group { display: grid; padding-top: 14px; }
.news-group + .news-group { margin-top: 6px; border-top: 1px solid var(--line); }
.news-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 17px; margin-bottom: 4px; }
.news-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start;
  padding: 12px; margin: 0 -12px; border-radius: 12px; color: var(--ink); text-decoration: none;
}
.news-row:hover { background: var(--bg); }
.news-row:hover b { color: var(--accent); }
.news-text { display: grid; gap: 3px; min-width: 0; }
.news-text b { font-size: 16px; line-height: 1.35; }
.news-meta { font-size: 13px; color: var(--muted); }
.news-summary { font-size: 14.5px; color: var(--muted); }
.news-why { font-size: 14px; font-weight: 600; color: var(--accent); }
.news-img { width: 104px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--bg); }
.fund-note { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 15px; }
.features .card a { font-weight: 600; text-decoration: none; }
@media (max-width: 520px) { .news-img { width: 72px; height: 56px; } }

/* ---------- Your money by industry (funds opened up) ---------- */
.sub-head { margin: 20px 0 8px; font-size: 16px; }
.flags { display: grid; gap: 8px; margin-top: 4px; }
.flags:empty { display: none; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 13em) minmax(0, 1fr) 3em; gap: 12px; align-items: center; font-size: 14.5px; }
.bar-label { min-width: 0; overflow-wrap: anywhere; }
.bar-track { height: 10px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.bar-row .num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .bar-row { grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr) 2.8em; } }

/* ---------- "Details" dropdown under each investment ---------- */
tr.stock-row td { border-bottom: 0; }
.details-bar-row td { border-top: 0; padding: 0 0 10px; }
.details-bar {
  width: 100%; display: flex; justify-content: space-between; align-items: center; border: 0; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--accent);
  padding: 8px 12px; border-radius: 10px; background: var(--bg);
}
.details-bar:hover { background: var(--accent-soft); }
.details-bar .chev { color: var(--accent); transform: rotate(90deg); }
.details-bar-row.open .details-bar { border-radius: 10px 10px 0 0; background: var(--accent-soft); }
.details-bar-row.open .details-bar .chev { transform: rotate(-90deg); }
.details-bar-row.open td { padding-bottom: 0; }
.detail-row td { padding: 0 0 12px; border-top: 0; }
.detail-row .detail-panel { border-radius: 0 0 14px 14px; background: var(--accent-soft); }
.detail-note { flex-basis: 100%; margin: 0; }
.detail-panel { background: var(--bg); border-radius: 14px; padding: 16px; display: grid; gap: 14px; }
.detail-story { margin: 0; font-size: 16px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 18px; }
.detail-item { display: grid; gap: 2px; min-width: 0; }
.detail-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.detail-value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.detail-edit { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.detail-edit label { flex: 1 1 160px; }
.detail-edit input { background: var(--surface); }

/* ---------- Legal page ---------- */
.legal { max-width: 720px; margin-bottom: 48px; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 8px 0 16px; font-weight: 600; }
.draft-note { margin: 0 0 8px; padding: 10px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--ink); font-size: 14.5px; font-weight: 600; }
.legal-section { padding: 32px 0 8px; scroll-margin-top: 16px; }
.legal-section h2 { margin-bottom: 4px; }
.legal-date { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.legal-section h3 { margin: 18px 0 4px; font-size: 17px; }
.legal-section p { margin: 0; color: var(--muted); }
.footer-links a { color: var(--muted); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
footer p { margin: 0 0 6px; }

/* ---------- Phones: stack everything into one column ---------- */
@media (max-width: 760px) {
  form.add { grid-template-columns: minmax(0, 1fr) auto; }
  form.add .combo { grid-column: 1 / -1; }
  .grid3, .columns, .join, .hero, .quotes, .sides { grid-template-columns: 1fr; }
  .hero { gap: 32px; }
  .soon-signup .row, .locked-box { grid-template-columns: 1fr; }
  form.add label:first-child { grid-column: 1 / -1; }
}

/* Plaid's logo mark, shown next to the word "Plaid" */
.plaid { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.plaid-logo { width: 1.05em; height: 1.05em; fill: currentColor; color: var(--ink); flex: none; }

/* Brokerage logo and masked account number, e.g. "Fidelity ••••4821" */
.inst-logo { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.acct-mask { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* ---------- Log in / create account ---------- */
.nav-account { display: inline-flex; gap: 8px 20px; align-items: center; }
.nav-account .nav-hi { color: var(--ink); }
.auth-wrap { max-width: 440px; margin-bottom: 48px; }
.auth-wrap .card { margin-top: 24px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg); margin-bottom: 18px; }
.auth-tabs button { border: 0; cursor: pointer; font: inherit; font-size: 15px; font-weight: 600; padding: 9px 12px; border-radius: 999px; background: transparent; color: var(--muted); }
.auth-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(19,27,46,.12); }
.auth-form { display: grid; gap: 14px; }
.auth-form .error, .auth-form .success, .auth-form .hint { margin: 0; }
.auth-links { display: flex; justify-content: space-between; }
.welcome { font-size: 18px; font-weight: 600; margin: 0 0 6px; }

/* Eye button next to "Total value" that hides balances */
.pf-label { display: flex; align-items: center; gap: 10px; }
.eye-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.eye-btn:hover { color: var(--ink); }
.eye-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.eye-btn .eye-shut, .eye-btn[aria-pressed="true"] .eye-open { display: none; }
.eye-btn[aria-pressed="true"] .eye-shut { display: inline; }
#sync-status { margin: 8px 0 0; font-size: 13px; }

/* "Investing made simple:" lead-in above the homepage feature chips */
.hero .chips-intro { margin: 28px 0 0; font-weight: 700; font-size: 16px; color: var(--ink); }
.chips-intro + .feature-chips { margin-top: 10px; }

/* ---------- Settings page ---------- */
.settings-wrap { max-width: 720px; margin-bottom: 48px; }
.settings-wrap > .lead { margin-bottom: 24px; }
.set-card { margin-bottom: 16px; }
.set-card h2 { font-size: 20px; margin: 0 0 6px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.set-card h2 + .set-row, .set-card h2 + div > .set-row:first-child { border-top: 0; }
.set-row > div:first-child { min-width: 0; flex: 1 1 260px; }
.set-label { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.set-value { font-weight: 600; overflow-wrap: anywhere; }
.set-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; font-weight: 500; }
.set-sub { font-size: 14px; color: var(--muted); margin: 2px 0 0; }
.set-broker { display: flex; align-items: center; gap: 8px; }
.set-form { display: grid; gap: 12px; padding: 4px 0 16px; }
.set-form .error, .set-form .hint { margin: 0; }
.set-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.set-card .success, .set-card .error { margin: 8px 0 0; }
.set-card.danger { box-shadow: var(--shadow), inset 0 0 0 1.5px color-mix(in srgb, var(--down) 35%, transparent); }
.set-card.danger .set-form { padding-top: 14px; }
.danger-btn { background: var(--down); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* On/off switch */
.switch { position: relative; display: inline-block; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span[aria-hidden] { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; }
.switch span[aria-hidden]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch span, .switch span::after { transition: none; } }
