/* Harust clickable shell.
   Calm research tool: light paper background, near-black text, one deep green accent,
   hairline borders, flat surfaces, serif headings with a plain sans for reading and UI. */
:root {
  color-scheme: light;
  --bg: #F8F7F3;
  --surface: #FFFFFF;
  --text: #1A1C1B;
  --muted: #5F6662;
  --line: #E2DFD6;
  --line-strong: #CFCBC0;
  --accent: #1F5C46;
  --accent-soft: #E9EFEB;
  --accent-2: #8FB3A2;
  --accent-3: #CDDCD4;
  --up: #2E6E52;
  --down: #9A4A3F;
  --radius: 6px;
  /* Noto Armenian faces fill in Armenian letters; Latin and Cyrillic come from the first family. */
  --serif: "Source Serif 4", "Noto Serif Armenian", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Noto Sans Armenian", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
/* Room for the fixed tab bar, only while it is shown. */
body.has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

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

h1, h2, h3 {
  /* A long single word (Russian "Экономическая аналитика") must never push the page wider than the phone,
     whatever font loads: it breaks only as a last resort (no automatic hyphenation). */
  overflow-wrap: break-word;
  text-wrap: balance;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
  margin: 0 0 10px;
}
h1 { font-size: 1.875rem; }
h2 { font-size: 1.375rem; }
h3, h2.sub { font-size: 1.0625rem; }
p { margin: 0 0 12px; }
em { font-style: normal; font-weight: 600; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.skip-link { position: absolute; left: 8px; top: -64px; z-index: 10; padding: 12px 16px; background: var(--accent); color: #fff; border-radius: var(--radius); text-decoration: none; }
.skip-link:focus { top: 8px; }
.noscript { margin: 0; padding: 16px; text-align: center; background: var(--accent-soft); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 16px;
  flex-wrap: wrap; /* very large text: the buttons drop under the logo instead of overflowing */
}
@media (min-width: 720px) { .topbar { padding: 16px 24px; } }
/* Inside the app (tab bar showing), align the header with the narrow content column. */
body.has-tabbar .topbar { max-width: 720px; padding-left: 16px; padding-right: 16px; }
.topbar-right { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; min-width: 0; max-width: 100%; align-items: center; gap: 18px; }
.site-nav { display: none; gap: 24px; }
.site-nav[hidden] { display: none !important; }
.site-nav a, .nav-login {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-size: 0.9375rem;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.site-nav a:hover, .nav-login:hover { color: var(--accent); }
/* Four section links fit on one line from 900px; below that the footer carries them. */
@media (min-width: 900px) { .site-nav { display: flex; } }
.site-nav a, .nav-login, .btn { white-space: nowrap; }
/* Phone menu: a plain button that opens the section links and language, where the
   header links are hidden (same widths as .site-nav above). */
.menu-btn {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
  width: 44px; height: 44px; padding: 0 11px; margin-right: -11px;
  border: 0; background: none; cursor: pointer;
}
.menu-btn span { display: block; height: 1.5px; background: var(--text); }
@media (min-width: 900px) { .menu-btn { display: none; } }
@media (min-width: 900px) and (max-width: 999px) { :lang(ru) .menu-btn { display: inline-flex; } }
@media (min-width: 900px) and (max-width: 1079px) { :lang(hy) .menu-btn { display: inline-flex; } }
/* In the app the menu is always there (it holds the language switch). */
body.has-tabbar .menu-btn { display: inline-flex; }
/* Phones in the app: the bar keeps only the logo and ☰; links and Log out live in the menu. */
@media (max-width: 759px) { body.has-tabbar .app-link { display: none; } }
/* Public header: where the menu shows, Log in moves into it and Sign up stays as the one action. */
@media (max-width: 899px) { .hdr-login { display: none; } }
/* On phones "Your portfolios" lives in the menu, so the header never outgrows 320px (Armenian is longest). */
@media (max-width: 559px) { .btn.hdr-app { display: none; } }
@media (min-width: 900px) and (max-width: 999px) { :lang(ru) .hdr-login { display: none; } }
@media (min-width: 900px) and (max-width: 1079px) { :lang(hy) .hdr-login { display: none; } }
.menu-sheet { border-top: 1px solid var(--line); background: var(--bg); }
.menu-sheet[hidden] { display: none; }
.menu-sheet nav, .menu-langs { max-width: 1080px; margin: 0 auto; padding: 4px 16px; }
.menu-sheet nav a, .menu-sheet nav button {
  width: 100%; padding: 0; border: 0; border-radius: 0; background: none; font: inherit; text-align: left; cursor: pointer;
  display: flex; align-items: center; min-height: 48px;
  border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 1.0625rem;
}
.menu-sheet nav a:hover { color: var(--accent); }
.menu-langs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding-bottom: 12px; }
.menu-langs .lang {
  display: flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none;
  font: inherit; font-size: 0.9375rem; color: var(--muted); cursor: pointer;
}

/* Phones: a little less space between header items so three links fit beside the logo. */
@media (max-width: 559px) { .topbar { gap: 16px; } .topbar-right { gap: 12px; } }
/* Section names are longer in Russian and Armenian; show the links only where they fit
   (measured: about 800px EN, 975px RU, 1050px HY). Below that, the footer carries them. */
@media (min-width: 900px) and (max-width: 999px) { :lang(ru) .site-nav { display: none; } }
@media (min-width: 900px) and (max-width: 1079px) { :lang(hy) .site-nav { display: none; } }

/* Official wordmark, cropped from web/assets/harust-logo.jpg with a transparent background. */
.logo { display: flex; align-items: center; flex: none; width: 92px; min-height: 44px; }
.logo img { display: block; width: 100%; height: auto; }

.demo-banner {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding: 4px 16px;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
  outline: none;
}
body.wide main { max-width: none; padding: 0; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 24px; } }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: #184B39; }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.block { width: 100%; padding: 8px 18px; text-align: center; white-space: normal; }
.btn.small-btn { min-height: 44px; padding: 0 16px; font-size: 0.9375rem; }
.link-arrow { color: var(--accent); text-decoration: none; font-weight: 500; }
.link-arrow:hover { text-decoration: underline; }
.stack > * + * { margin-top: 12px; }

/* ---------- Landing ---------- */
.intro { padding-top: 48px; padding-bottom: 28px; }
.intro h1 { font-size: clamp(30px, 5.4vw, 48px); line-height: 1.12; max-width: 17em; margin-bottom: 16px; }
.intro-kicker { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
/* Uppercasing Armenian turns «և» into the old «ԵՒ»; keep normal case there. */
:lang(hy) .intro-kicker { text-transform: none; letter-spacing: 0.02em; font-size: 0.875rem; }
.intro-lead { font-size: 1.125rem; color: var(--muted); max-width: 34em; margin: 0; }
@media (min-width: 900px) { .intro { padding-top: 88px; padding-bottom: 40px; } }

.paths { display: grid; border-top: 1px solid var(--line-strong); }
@media (min-width: 720px) { .paths { grid-template-columns: 1fr 1fr; } }
.path {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line-strong);
  color: inherit;
  text-decoration: none;
}
@media (min-width: 720px) {
  .path { padding: 28px 32px 28px 0; }
  .path + .path { padding-left: 32px; border-left: 1px solid var(--line); }
}
.path-title { font-family: var(--serif); font-size: 1.375rem; font-weight: 600; color: var(--accent); }
.path-text { grid-column: 1; color: var(--muted); max-width: 26em; }
.path-go { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 1.375rem; color: var(--accent); }
.path:hover .path-title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

.sect { padding-top: 56px; }
.sect.first { padding-top: 40px; }
@media (min-width: 900px) { .sect { padding-top: 80px; } }
.block-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 16px; border-bottom: 1px solid var(--line-strong); padding-bottom: 10px; margin-bottom: 16px; }
.block-head h2 { margin: 0; }
.block-head a { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.9375rem; text-decoration: none; }
.block-head a:hover { text-decoration: underline; }
.block-lead { color: var(--muted); max-width: 38em; }

.split { display: grid; gap: 28px; }
.split > div > p { color: var(--muted); max-width: 32em; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; } }

.sample {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.sample figcaption { font-size: 0.75rem; color: var(--muted); margin-bottom: 12px; }
.sample .legend { margin-bottom: 14px; }
.sample p { font-size: 0.9375rem; margin-bottom: 8px; }
.sample p:last-child { margin-bottom: 0; }

.rule-list { list-style: none; padding: 0; margin: 0; }
.rule-list li { border-bottom: 1px solid var(--line); }
.rule-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 14px 0; color: inherit; text-decoration: none; }
.rule-title { font-weight: 600; }
.rule-text { grid-column: 1; color: var(--muted); font-size: 0.875rem; }
.rule-count { grid-column: 2; grid-row: 1; color: var(--muted); font-size: 0.875rem; }
.rule-list a:hover .rule-title { color: var(--accent); }

.article-list { display: grid; }
@media (min-width: 900px) { .article-list { grid-template-columns: repeat(3, 1fr); gap: 0 32px; } }
.article-row { display: block; padding: 16px 0 18px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
@media (min-width: 900px) { .article-row { border-bottom: 0; padding-top: 4px; } }
.article-row h3 { margin: 6px 0 6px; font-size: 1.1875rem; }
.article-row p { color: var(--muted); font-size: 0.9375rem; margin: 0; }
.article-row:hover h3 { color: var(--accent); }
/* A report opened from Overview or the landing page is marked once on arrival. */
.article-row.is-target { border-left: 2px solid var(--accent); padding-left: 12px; margin-left: -14px; }
.article-meta { font-size: 0.8125rem; color: var(--muted); }
.article-out { display: inline-block; margin-top: 8px; font-size: 0.875rem; color: var(--accent); }
.article-row:hover .article-out { text-decoration: underline; }

.faq details { border-bottom: 1px solid var(--line); max-width: 760px; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-weight: 500; min-height: 44px; padding: 10px 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--muted); max-width: 40em; }
.faq { padding-bottom: 72px; }

.more-reading { margin-top: 16px; font-size: 0.9375rem; color: var(--muted); }
.reading-head { margin-top: 40px; }

/* Article page */
.article { max-width: 680px; padding-top: 32px; padding-bottom: 8px; }
.back { font-size: 0.875rem; text-decoration: none; }
.article .article-meta { margin: 24px 0 8px; }
.article h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.15; }
.article-dek { font-family: var(--serif); font-size: 1.3125rem; line-height: 1.45; color: var(--muted); margin: 14px 0 0; }
.article-text { overflow-wrap: break-word; margin-top: 28px; font-size: 1.125rem; line-height: 1.7; border-top: 1px solid var(--line); padding-top: 24px; }
.article-text p { margin-bottom: 20px; }
.article-text h2 { font-size: 1.4375rem; margin: 36px 0 12px; }
.article-text h3 { font-size: 1.1875rem; margin: 28px 0 8px; }
.article-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.article-text ul { padding-left: 20px; margin: 0 0 20px; }
.article-text li { margin-bottom: 8px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line-strong); padding: 36px 0 24px; }
.site-footer[hidden] { display: none; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-grid > :first-child { grid-column: 1 / -1; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } .footer-grid > :first-child { grid-column: auto; } }
.footer-grid .footer-h { margin: 0 0 8px; font-family: var(--sans); font-size: 0.8125rem; font-weight: 600; color: var(--text); }
.footer-grid a, .footer-grid .lang { overflow-wrap: break-word; display: flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: 0.875rem; }
.footer-grid .lang, .lang-row .lang {
  display: flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none;
  font: inherit; font-size: 0.875rem; color: var(--muted); cursor: pointer; text-align: left;
}
.footer-grid .lang:hover, .lang-row .lang:hover { color: var(--accent); }
.lang-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line); }
.footer-grid a:hover { color: var(--accent); }
.lang.on { color: var(--text); font-weight: 600; }
.footer-legal { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--muted); }
.footer-social {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}
.footer-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--muted);
  border-radius: var(--radius);
}
/* Placeholders only — become links when profile URLs exist. */
a.footer-social-icon:hover { color: var(--accent); }
a.footer-social-icon:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- App: shared ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card + .card { margin-top: 12px; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--line-strong); }
.card .arrow { float: right; color: var(--accent); }

.big { font-family: var(--serif); font-size: 2.125rem; font-weight: 600; line-height: 1.1; margin: 4px 0 0; font-variant-numeric: lining-nums tabular-nums; }

.bar { display: flex; height: 8px; border-radius: 2px; overflow: hidden; margin: 14px 0 8px; gap: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.8125rem; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; background: var(--c); }
.kind-Stocks { --c: var(--accent); }
.kind-Bonds { --c: var(--accent-2); }
.kind-Cash { --c: var(--accent-3); }
.bar > div { background: var(--c); }

.pill { font-size: 0.75rem; color: var(--muted); border: 1px solid var(--line); padding: 1px 7px; border-radius: 3px; white-space: nowrap; }
.pill.alt { border-style: dashed; }

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 0.75rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
th.num { white-space: normal; overflow-wrap: break-word; }
/* A table never breaks out of its card: it scrolls sideways if a language needs more room. */
.table-wrap { overflow-x: auto; }
tbody tr:last-child td { border-bottom: 0; }
.fund-table td strong { font-weight: 600; }
.table-note { margin: 10px 0 0; }
@media (max-width: 599px) { .hide-sm { display: none; } }

label { display: block; font-weight: 500; font-size: 0.875rem; margin-bottom: 6px; }
input[type="email"], input[type="text"], select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  color: var(--text);
}
/* Keyboard focus: a clear ring on anything you can tab to (mouse clicks don't show it). */
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible, input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
main:focus, main:focus-visible { outline: none; }
input:focus, select:focus { outline: 2px solid var(--accent-2); outline-offset: 0; border-color: var(--accent); }
input[type="range"] { width: 100%; height: 44px; margin: 0; accent-color: var(--accent); }

/* Simple / Detailed / Sources: underline tabs, not a pill switch */
.segmented { display: flex; flex-wrap: wrap; gap: 0 24px; border-bottom: 1px solid var(--line-strong); margin: 16px 0; }
.segmented a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.segmented a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }

.source-list { list-style: none; padding: 0; margin: 0; }
.source-list li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; }
.source-list li:last-child { border-bottom: 0; }

.filters { display: grid; gap: 12px; }
@media (min-width: 560px) { .filters { grid-template-columns: repeat(3, 1fr); } }
.compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 14px; border-top: 1px solid var(--line); }
.compare div { padding: 12px 0 0; }
.compare div + div { border-left: 1px solid var(--line); padding-left: 16px; }
.compare strong { display: block; font-family: var(--serif); font-size: 1.375rem; font-weight: 600; overflow-wrap: break-word; }
/* Two columns only where a long word (Armenian "stocks") fits at 22px; stack them on small phones. */
@media (max-width: 419px) {
  .compare { grid-template-columns: minmax(0, 1fr); }
  .compare div + div { border-left: 0; border-top: 1px solid var(--line); margin-top: 12px; padding-left: 0; }
}

/* Portfolio picker */
.picker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 2px; }
@media (max-width: 479px) { .picker select { font-size: 1.375rem; } }
/* Size the dropdown to the chosen name where the browser supports it. */
.picker select { field-sizing: content; }
.picker.compact select, .picker.compact h1 { font-family: var(--sans); font-size: 1rem; font-weight: 600; min-height: 32px; }
.picker select {
  width: auto;
  max-width: 100%;
  min-height: 40px;
  font-family: var(--serif);
  font-size: 1.625rem;
  font-weight: 600;
  border: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231F5C46' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 2px center;
  padding: 0 22px 0 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

/* Log in / sign up */
.auth { max-width: 400px; margin: 16px auto 0; }
.auth form { margin-top: 24px; }
.auth-note { font-weight: 500; color: var(--text); margin-bottom: 4px; }
.auth-switch { font-size: 0.875rem; color: var(--muted); margin-top: 16px; }
.auth-switch + .auth-switch { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Practice portfolio, logged out */
.picker h1 { margin: 0; }
.sample-note { font-size: 0.875rem; color: var(--muted); border-left: 2px solid var(--accent); padding: 2px 0 2px 12px; margin: 8px 0 0; }
.next-steps { margin-top: 28px; border-top: 1px solid var(--line-strong); padding-top: 16px; }
.next-steps ul { list-style: none; padding: 0; margin: 0 0 12px; }
.next-steps li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.next-steps li a { text-decoration: none; }
.next-steps li a:hover { text-decoration: underline; }
.next-steps p { font-size: 0.9375rem; color: var(--muted); }

/* App home */
/* One column on phones, two when each card keeps at least 16rem (so larger text or a wider font drops to one column instead of overflowing). */
.pf-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, max(16rem, 45%)), 1fr)); gap: 12px; margin-top: 16px; }
.pf-list .card + .card { margin-top: 0; }
.pf-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 8px; }
.pf-top h2 { min-width: 0; overflow-wrap: break-word; margin: 0; font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; }
.pf-card .big { font-size: 1.75rem; margin-top: 8px; }
.pf-add {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px;
  border-style: dashed; font: inherit; color: var(--accent); text-align: left; cursor: pointer; min-height: 110px;
}
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 36px 0 4px; border-bottom: 1px solid var(--line-strong); padding-bottom: 8px; }
.section-title h2 { margin: 0; font-size: 1.25rem; }
.section-title a { display: inline-flex; align-items: center; min-height: 44px; }

.list-grid { display: grid; }
.list-card { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.list-card h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin-bottom: 2px; }
.list-card p { margin: 0; }
.list-card:hover h3 { color: var(--accent); }

/* Research list switcher: squared tabs that scroll on phones */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 7px 12px;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.chip:hover { border-color: var(--accent-2); }
.chip.on { border-color: var(--accent); color: var(--accent); font-weight: 500; }
.list-chips { margin: 16px 0; }
@media (max-width: 639px) {
  .list-chips { flex-wrap: nowrap; overflow-x: auto; margin: 16px -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .list-chips .chip { flex: none; }
}

/* Ask */
.msg { padding: 12px 14px; border-radius: var(--radius); max-width: 92%; min-width: 0; font-size: 0.9375rem; overflow-wrap: break-word; }
.msg.user { background: var(--accent-soft); margin-left: auto; }
.msg.ai { background: var(--surface); border: 1px solid var(--line); }
.msg .from { font-size: 0.8125rem; color: var(--muted); margin-top: 6px; }
.thread { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.ask-row { display: flex; gap: 8px; }
.ask-row input { flex: 1; }

/* Rates strip (inside the app) */
.markets { margin-top: 36px; border-top: 1px solid var(--line-strong); }
.markets-row { display: flex; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; padding: 12px 0 8px; }
.mkt { flex: none; display: grid; grid-template-columns: auto auto; column-gap: 8px; padding: 0 14px; border-left: 1px solid var(--line); font-size: 0.8125rem; line-height: 1.4; }
.markets-row .mkt:first-child { border-left: 0; padding-left: 0; }
.mkt-name { grid-column: 1 / -1; color: var(--muted); }
.mkt-value { font-weight: 500; font-variant-numeric: tabular-nums; }
.mkt-change { font-variant-numeric: tabular-nums; }
.mkt-change.up { color: var(--up); }
.mkt-change.down { color: var(--down); }
.markets-note { font-size: 0.8125rem; color: var(--muted); margin: 0; }

/* Bottom tab bar (inside the app) */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--bg);
  border-top: 1px solid var(--line-strong);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar[hidden] { display: none; }
.tabbar a { flex: 1 1 0; min-width: 0; overflow-wrap: break-word; text-align: center; padding: 14px 4px; font-size: 0.875rem; color: var(--muted); text-decoration: none; }
.tabbar a.active { color: var(--accent); font-weight: 600; }
@media (min-width: 720px) { .tabbar { justify-content: center; } .tabbar a { flex: 0 0 140px; } }

/* Keep anchored sections clear of the header. */
section[id] { scroll-margin-top: 16px; }

/* Small spacing helpers, used instead of inline style="" so a strict Content-Security-Policy can apply. */
.mt-12 { margin-top: 12px; }
.mt-16, .card + .card.mt-16 { margin-top: 16px; }
.flush { margin: 0; }
.filters.filters-2 { grid-template-columns: 1fr 1fr; margin-top: 12px; }
#screen-count { margin-top: 0; }
.page-404 { padding: 48px 16px 64px; max-width: 560px; }
.page-404 .logo { margin-bottom: 24px; }

p, li { text-wrap: pretty; }
