/* Colors are tokens on :root. Dark values apply by system preference, or when data-theme="dark" is set. */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f0f3f9;
  --text: #141a26;
  --muted: #5b6577;
  --border: #e1e6ef;
  --accent: #2456d6;
  --accent-contrast: #ffffff;
  --current: #0d7a52;
  --upcoming: #a15c00;
  --listed: #4648b8;
  --mainboard: #0b5cad;
  --sme: #7a2fd1;
  --danger: #b42318;
  --hero-from: #e9f0ff;
  --hero-to: #f1e9ff;
  --hero-text: #141a26;
  --hero-muted: #4b5568;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 14px rgba(16, 24, 40, 0.06);
  --shadow-hover: 0 10px 28px rgba(16, 24, 40, 0.14);
}

:root[data-theme="dark"] {
  --bg: #0b0f16;
  --surface: #141a24;
  --surface-2: #1c2430;
  --text: #e8ecf3;
  --muted: #98a2b3;
  --border: #263041;
  --accent: #7aa2ff;
  --accent-contrast: #0b1220;
  --current: #4cd39a;
  --upcoming: #f5b65c;
  --listed: #aab0ff;
  --mainboard: #7fb6ff;
  --sme: #d0a6ff;
  --danger: #ff8a80;
  --hero-from: #0f1a33;
  --hero-to: #1a1435;
  --hero-text: #e8ecf3;
  --hero-muted: #98a2b3;
  --shadow: none;
  --shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(1100px 480px at 12% -12%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Top bar: brand, menu and theme toggle. Shared by every page. */
.topbar {
  position: sticky;
  top: 0;
  /* Above the sticky page navigation (company-nav, z-index 25), so the menus open over it. */
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.topbar-row { display: flex; align-items: center; gap: 12px; min-height: 60px; }

.brand {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-logo { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px; }
.brand-accent { color: var(--accent); }

.topnav { margin-left: auto; }
.topnav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.topnav a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.topnav a:hover { color: var(--text); background: var(--surface-2); }
.topnav a[aria-current="page"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.menu-toggle {
  display: none;
  appearance: none;
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

/* Stock search in the top bar (site-header.js). Shared by every page. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.header-search {
  position: relative;
  flex: 1 1 260px;
  max-width: 360px;
  margin: 0 0 0 8px;
}

.header-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.header-search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  max-height: 340px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
}

.suggest:empty {
  display: none;
}

.suggest li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text);
}

.suggest li[aria-selected="true"],
.suggest li:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.suggest li.empty,
.suggest li.empty:hover {
  cursor: default;
  display: block;
  color: var(--muted);
  background: none;
}

.suggest .sym {
  font-weight: 700;
}

.suggest .nm {
  text-align: right;
  color: var(--muted);
  font-size: 0.92em;
}

@media (max-width: 760px) {
  .topbar-row { flex-wrap: wrap; }
  .header-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    margin: 0 0 10px;
  }
}

/* Hero band under the top bar */
.hero {
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
  color: var(--hero-text);
  padding: 30px 0 26px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero h1 {
  color: var(--hero-text);
  font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2.1rem);
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}

.hero .eyebrow { color: var(--hero-muted); }
.hero .muted { color: var(--hero-muted); font-size: 0.95rem; }

h1 { font-size: 1.5rem; margin: 0 0 4px; line-height: 1.2; }
h2 { font-size: 1.2rem; margin: 0; }
h3 { font-size: 1.05rem; margin: 2px 0 0; line-height: 1.3; font-weight: 700; overflow-wrap: anywhere; }

.muted { color: var(--muted); margin: 0; }
.small { font-size: 0.85rem; }
.footer { padding: 28px 0 36px; font-size: 0.85rem; text-align: center; }

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

/* Filter bar: status, search, segment and view controls in one card */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 18px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* One row when everything fits: status tabs, search, segment, view, in that order. The group has no box of
   its own here, so its controls are laid out as direct items of the filter bar. */
.filter-selects { display: contents; }
.search { order: 1; }
#segment-group { order: 2; }
.view-toggle { order: 3; }

/* Not everything fits one row. app.js sets is-wrapped: the search box takes the first line and the status,
   segment and view controls share the second, scrolling sideways on narrow screens. */
.filter-bar.is-wrapped .search { order: -1; flex: 0 0 100%; }
.filter-bar.is-wrapped .filter-selects {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-bar.is-wrapped .filter-selects > * { flex: 0 0 auto; }
.filter-bar.is-wrapped .tabs { width: auto; max-width: none; }

.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--surface-2);
  border-radius: 10px;
}

.tabs button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tabs button:hover { color: var(--text); }

.tabs button[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-contrast);
}

.tabs .count {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.tabs button[aria-selected="true"] .count {
  background: color-mix(in srgb, var(--accent-contrast) 22%, transparent);
  color: var(--accent-contrast);
}

.search { position: relative; flex: 1 1 220px; min-width: 0; }

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.search input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 10px;
}

.search input::placeholder { color: var(--muted); }

.search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  background: var(--surface);
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.segmented button {
  appearance: none;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.segmented button:hover { color: var(--text); }

.segmented button + button { border-left: 1px solid var(--border); }

.segmented button[aria-checked="true"] {
  background: var(--accent);
  color: var(--accent-contrast);
}

.segmented .icon-btn { display: grid; place-items: center; padding: 8px 11px; }

.segmented .icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.message.error { color: var(--danger); }

/* Results: grid (default) and list */
.results { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.results[aria-busy="true"] { opacity: 0.6; transition: opacity 0.15s; }

.card {
  --status: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--status);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:has(.s-current) { --status: var(--current); }
.card:has(.s-upcoming) { --status: var(--upcoming); }
.card:has(.s-listed) { --status: var(--listed); }

.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.card-top { display: flex; gap: 6px; flex-wrap: wrap; }

.card .meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  white-space: nowrap;
}

.seg-main { color: var(--mainboard); }
.seg-sme { color: var(--sme); }
.s-current { color: var(--current); }
.s-upcoming { color: var(--upcoming); }
.s-listed { color: var(--listed); }
.s-closed { color: #b45309; }
.card:has(.s-closed) { --status: #b45309; }

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 6px 0 0;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: 10px;
}

.facts dt { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* List view: one row per IPO, wraps to stacked lines on narrow screens */
.results.list { grid-template-columns: 1fr; gap: 10px; }

.results.list .card {
  display: grid;
  grid-template-columns: minmax(200px, 2.2fr) minmax(0, 1.4fr) minmax(0, 3fr);
  align-items: center;
  gap: 12px 20px;
  padding: 14px 18px;
}

.results.list .card-top { grid-column: 2; grid-row: 1; }
.results.list .card h3 { grid-column: 1; grid-row: 1; margin: 0; }
.results.list .card .meta { grid-column: 1; grid-row: 2; margin: 0; }
.results.list .facts { grid-column: 3; grid-row: 1 / span 2; margin: 0; padding: 0; background: none; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }

@media (max-width: 760px) {
  .results.list .card { grid-template-columns: 1fr; }
  .results.list .card-top,
  .results.list .card h3,
  .results.list .card .meta,
  .results.list .facts { grid-column: 1; grid-row: auto; }
}

/* Pager: page size, range summary and page buttons, below the results */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 22px 0 8px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.pager-left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }

.pager-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.pager-size select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.pager-info { margin: 0; color: var(--muted); font-size: 0.92rem; }
.pager-info strong { color: var(--text); font-weight: 700; }

.pager-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.page-numbers { display: flex; flex-wrap: wrap; gap: 6px; }

.page-btn {
  appearance: none;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.page-btn[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.page-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.page-nav { padding: 0 12px; }
.page-gap { color: var(--muted); align-self: center; padding: 0 4px; }

/* Buttons and dialog */
.btn {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  font: inherit;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }

.btn.ghost { background: none; color: var(--accent); box-shadow: none; }
.btn.ghost:hover { transform: none; box-shadow: none; }

dialog {
  width: min(640px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 22px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

dialog::backdrop { background: rgba(0, 0, 0, 0.5); }

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

.detail-section { margin-top: 18px; }
.detail-section h4 { margin: 0 0 6px; font-size: 0.95rem; }

pre.raw {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px;
  overflow: auto;
  max-height: 320px;
  font-size: 0.8rem;
  margin: 0;
}

details summary { cursor: pointer; color: var(--accent); font-weight: 600; }

/* SEO guide section and header eyebrow */
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.seo-guide {
  margin: 44px 0 28px;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.seo-guide h2 { margin-bottom: 8px; font-size: 1.25rem; }
.seo-guide h3 { margin: 18px 0 4px; font-size: 1rem; }
.seo-guide p { margin: 0 0 8px; color: var(--muted); }
.seo-guide dl { margin: 8px 0 0; }
.seo-guide dt { font-weight: 700; margin-top: 12px; }
.seo-guide dd { margin: 2px 0 0; color: var(--muted); }

/* Theme toggle */
.theme-toggle {
  appearance: none;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle[data-mode="dark"] .icon-sun { display: block; }
.theme-toggle[data-mode="dark"] .icon-moon { display: none; }

/* Responsive grid: 3 columns on wide screens, 2 on tablets, 1 on phones */
@media (max-width: 900px) {
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .menu-toggle { display: inline-block; }
  .topnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 14px;
    box-shadow: var(--shadow-hover);
  }
  .topbar[data-open="true"] .topnav { display: block; }
  .topnav ul { flex-direction: column; }
  .filter-bar { padding: 8px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero { padding: 24px 0 22px; }
  .results { grid-template-columns: 1fr; }
  .segmented button { padding: 8px 11px; }
  .view-toggle { margin-left: auto; }
  .seo-guide { padding: 20px 18px; }
  .pager { justify-content: center; }
  .pager-buttons { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Page layout and side ad rails: the same as the 2All sites (common.css). The 84px top offset clears this
   site's sticky top bar. */
[hidden] { display: none !important; }

.page-layout { display: grid; grid-template-columns: 280px 1fr 280px; gap: 12px; align-items: start; max-width: 100%; margin: 0 auto; padding: 0 16px; }
.page-main { min-width: 0; }
.page-layout > * { min-width: 0; }

/* Bounded sticky box: its stacked units scroll slowly inside it (shared-ads.js). */
.page-ad-rail { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: hidden; display: flex; flex-direction: column; gap: 20px; scroll-behavior: auto; }
.page-ad-rail .ad-slot { margin: 0; flex-shrink: 0; }

.ad-slot { margin: 26px 0; text-align: center; }

@media (max-width: 1500px) {
  .page-layout { grid-template-columns: 200px 1fr 200px; gap: 12px; }
}

@media (max-width: 1200px) {
  .page-layout { grid-template-columns: 1fr; }
  .page-ad-rail { display: none; }
}

/* Footer links and legal pages */
.footer-links { margin-top: 10px; }
.footer-links a { color: var(--accent); text-decoration: none; font-weight: 600; }
.footer-links a:hover { text-decoration: underline; }

.legal { max-width: 860px; margin: 0 auto; padding: 36px 16px 56px; }
.legal h1 { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem); margin-bottom: 6px; }
.legal .updated { color: var(--muted); margin-bottom: 24px; }
.legal h2 { font-size: 1.2rem; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal .box { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; margin: 18px 0; }

/* Mobile touch targets (44px minimum) and small-screen layout */
@media (max-width: 760px) {
  .theme-toggle { width: 42px; height: 42px; }
  .menu-toggle { min-height: 42px; }
  .brand { white-space: normal; line-height: 1.2; }
  .topnav a { min-height: 44px; display: flex; align-items: center; }
  .footer-links a { display: inline-block; padding: 10px 6px; }
  .page-btn { min-width: 42px; height: 42px; }
  .pager-size select { min-height: 42px; }
  .tabs button { min-height: 42px; }
  .segmented button { min-height: 42px; }
  .search input { min-height: 44px; font-size: 16px; }
  .legal { padding: 24px 16px 40px; }
  .legal h1 { font-size: 1.6rem; }
  .ad-row { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 1.35rem; }
  .pager-buttons { gap: 4px; }
  .page-nav { padding: 0 8px; }
  .facts { grid-template-columns: 1fr; }
}

/* Full IPO detail pages (server-rendered by the Worker) */
.detail-link { margin-top: 14px; }
.detail-link a { color: var(--accent); font-weight: 700; }
.ipo-hero h1 { margin-bottom: 4px; }
.ipo-hero .summary { color: var(--hero-muted); margin: 0; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin: 18px 0; }
.section h2 { font-size: 1.15rem; margin-bottom: 12px; }
.section .note { color: var(--muted); font-size: 0.9rem; margin: 10px 0 0; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px; margin: 0; }
.kv div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.kv dt { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.kv dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
table.data td.num { text-align: right; white-space: nowrap; }
/* A numeric column's heading lines up with its numbers. */
table.data th.num { text-align: right; white-space: nowrap; }
table.data tr.total td { font-weight: 800; }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 0; margin: 0; list-style: none; }
.docs a { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; color: var(--accent); text-decoration: none; font-weight: 600; background: var(--surface); }
.docs a:hover { border-color: var(--accent); }
.faq details { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq summary { font-weight: 700; cursor: pointer; color: var(--text); }
.faq details p { color: var(--muted); margin: 8px 0 0; }
.legal-note { color: var(--muted); font-size: 0.85rem; }
.calc-note { color: var(--muted); font-size: 0.9rem; }
@media (max-width: 760px) {
  .section { padding: 16px; }
  table.data th, table.data td { padding: 8px 6px; font-size: 0.85rem; }
}

/* Key facts on the IPO detail page: highlight tiles and a compact fact grid */
.hl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.hl { position: relative; overflow: hidden; border-radius: 14px; padding: 16px 18px; color: #ffffff; background: linear-gradient(135deg, #1d4ed8, #5b21b6); box-shadow: 0 6px 18px rgba(16, 24, 40, 0.18); }
.hl::after { content: ''; position: absolute; right: -28px; top: -28px; width: 96px; height: 96px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); pointer-events: none; }
.hl-label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.85; }
.hl-value { display: block; font-size: 1.2rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv-compact { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 10px; }
.kv-compact div { border: 1px solid var(--border); background: var(--surface-2); }
.kv-compact dd { font-size: 0.95rem; }

/* Footer: centred column on every page */
.footer { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; margin-left: auto; margin-right: auto; }
.footer-links { display: block; text-align: center; }

/* ---------- thin scrollbars in the theme colour (light and dark follow --accent) ---------- */
/* Firefox: the standard properties. Chromium and Safari use the webkit rules below, because current Chrome lets
   scrollbar-color override the webkit pseudo-elements. */
@supports (-moz-appearance: none) {
  html,
  body,
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
  }
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 70%, transparent);
  border: 2px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
  background-clip: content-box;
}

/* Header menu: the Calculators submenu (a drop-down on wide screens, listed under the item on phones). */
.topnav li.has-sub {
  position: relative;
}

.topnav li.has-sub > ul.sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 60;
  min-width: 200px;
  margin: 6px 0 0;
  padding: 6px;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
}

.topnav li.has-sub:hover > ul.sub,
.topnav li.has-sub:focus-within > ul.sub {
  display: flex;
}

.topnav li.has-sub > ul.sub a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .topnav li.has-sub > ul.sub {
    display: flex;
    position: static;
    min-width: 0;
    margin: 0;
    padding: 0 0 0 14px;
    background: none;
    border: 0;
    box-shadow: none;
  }
}

/* IPO detail header: name, status, key facts, dates, and the GMP estimate label */
.ipo-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ipo-facts, .ipo-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; margin: 16px 0; }
.ipo-dates { border-top: 1px solid var(--line, #e5e7eb); padding-top: 12px; }
.ipo-facts dt, .ipo-dates dt { font-size: 0.8rem; color: var(--muted, #6b7280); }
.ipo-facts dd, .ipo-dates dd { margin: 2px 0 0; font-weight: 600; }
.gmp-value { font-weight: 700; }
.gmp-pos { color: #15803d; }
.gmp-neg { color: #b91c1c; }
.gmp-flat { color: var(--muted, #6b7280); }
.gmp-caption { display: block; font-size: 0.72rem; font-weight: 400; color: var(--muted, #6b7280); }
.gmp-disclaimer { font-size: 0.85rem; background: #fff7ed; border-left: 3px solid #f59e0b; padding: 8px 12px; border-radius: 4px; }
.gmp-trend { margin: 8px 0 0; }
.gmp-trend svg { width: 100%; height: auto; color: #15803d; }
.schedule { width: 100%; border-collapse: collapse; }
.schedule th, .schedule td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line, #e5e7eb); }
.bullets { padding-left: 1.2em; }
.gmp-line { font-size: 0.85rem; color: #92400e; margin: 6px 0 0; }

/* IPO detail header, as on the reference layout: card, status pill, facts grid, dates with dividers, tabs */
.ipo-head { border: 1px solid var(--line, #e5e7eb); border-radius: 12px; padding: 0; overflow: hidden; background: var(--card, #fff); }
.ipo-head > * { padding-left: 20px; padding-right: 20px; }
.ipo-head .ipo-title { padding-top: 20px; align-items: center; }
.ipo-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; background: #eef4ff; color: #1d4ed8; }
.ipo-status-current { background: #ecfdf3; color: #15803d; }
.ipo-status-closed, .ipo-status-listed { background: #f3f4f6; color: #4b5563; }
.ipo-head .ipo-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 24px; margin: 0; padding: 18px 20px; border-top: 1px solid var(--line, #e5e7eb); border-bottom: 1px solid var(--line, #e5e7eb); }
.ipo-head .ipo-facts dt { font-size: 0.85rem; color: var(--muted, #6b7280); font-weight: 400; }
.ipo-head .ipo-facts dd { margin: 2px 0 0; font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ipo-head .ipo-dates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; border-bottom: 1px solid var(--line, #e5e7eb); }
.ipo-head .ipo-dates > div { padding: 14px 20px; }
.ipo-head .ipo-dates > div + div { border-left: 1px solid var(--line, #e5e7eb); }
.ipo-head .ipo-dates dt { font-size: 0.85rem; color: var(--muted, #6b7280); font-weight: 400; }
.ipo-head .ipo-dates dd { margin: 2px 0 0; font-size: 1.05rem; font-weight: 600; }
.ipo-head .ipo-opens dd { color: #c2410c; }
.ipo-head .ipo-gmp dd { font-weight: 700; }
.ipo-head .gmp-disclaimer { margin: 12px 20px; }
.ipo-head .tabset { margin: 0; }
.ipo-head .tablist { padding: 0 20px; }
.ipo-head .tab-panel { padding: 16px 20px 20px; line-height: 1.6; }
@media (max-width: 640px) {
  .ipo-head .ipo-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 14px 16px; }
  .ipo-head .ipo-dates > div { padding: 12px 10px; }
  .ipo-head .ipo-dates dd { font-size: 0.95rem; }
}

/* IPO detail: one responsive layout (independent of the company page's grid) */
.ipo-head { display: block; width: 100%; box-sizing: border-box; }
.ipo-head .ipo-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding-top: 20px; }
.ipo-head .ipo-title .stock-name { font-size: clamp(1.15rem, 2.4vw, 1.6rem); line-height: 1.25; margin: 0; }
.ipo-head .ipo-title .muted { margin: 4px 0 0; }
.ipo-head .ipo-facts { display: grid; width: 100%; box-sizing: border-box; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ipo-head .ipo-dates { display: grid; width: 100%; box-sizing: border-box; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ipo-head .gmp-disclaimer { margin: 12px 20px; }
.ipo-head .tabset { width: 100%; }
.ipo-head .tablist { display: flex; gap: 4px; overflow-x: auto; white-space: nowrap; padding: 0 16px; }
.ipo-head .tablist button { flex: 0 0 auto; }
.ipo-head .tab-panel { padding: 16px 20px 20px; line-height: 1.6; max-width: 80ch; }
.ipo-head .tab-panel .bullets { padding-left: 1.2em; }
.ipo-chart { width: 100%; box-sizing: border-box; margin: 16px 0; }
.ipo-chart .co-section { width: 100%; box-sizing: border-box; }
@media (max-width: 720px) {
  .ipo-head > * { padding-left: 16px; padding-right: 16px; }
  .ipo-head .ipo-title { padding-top: 16px; }
  .ipo-head .ipo-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 14px 16px; }
  .ipo-head .ipo-dates > div { padding: 12px 10px; }
  .ipo-head .ipo-dates dd { font-size: 0.95rem; }
  .ipo-head .gmp-disclaimer { margin: 12px 16px; }
  .ipo-head .tab-panel { padding: 14px 16px 18px; }
}
@media (max-width: 420px) {
  .ipo-head .ipo-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ipo-head .ipo-dates dt { font-size: 0.78rem; }
}

/* IPO list view: one row per IPO; GMP is its own column */
.results.list .card {
  grid-template-columns: minmax(200px, 2.4fr) minmax(110px, 1.2fr) repeat(4, minmax(90px, 1fr)) minmax(130px, 1.3fr);
  align-items: center;
  gap: 8px 16px;
}
.results.list .facts { display: contents; }
.results.list .facts > div { grid-row: 1 / span 2; min-width: 0; }
.results.list .card-top { grid-column: 2; grid-row: 1 / span 2; }
.results.list .card h3 { grid-column: 1; grid-row: 1; }
.results.list .card .meta { grid-column: 1; grid-row: 2; }
.results.list .ipo-gmp dd { white-space: nowrap; }
@media (max-width: 1100px) {
  .results.list .card { grid-template-columns: minmax(0, 1fr) auto; }
  .results.list .facts { display: grid; grid-column: 1 / -1; grid-row: auto; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px 16px; }
  .results.list .facts > div { grid-row: auto; }
  .results.list .card-top { grid-column: 2; grid-row: 1; }
  .results.list .card h3 { grid-column: 1; grid-row: 1; }
  .results.list .card .meta { grid-column: 1; grid-row: 2; }
}
@media (max-width: 760px) {
  .results.list .card { grid-template-columns: 1fr; }
  .results.list .card-top, .results.list .card h3, .results.list .card .meta, .results.list .facts { grid-column: 1; grid-row: auto; }
  .results.list .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* GMP direction icon: a drawn triangle or bar, aligned with the figure */
.gmp-icon { display: inline-block; width: 10px; height: 10px; margin-right: 4px; vertical-align: 0.05em; }
/* About text uses the full width of the header card */
.ipo-head .tab-panel { max-width: none; }
.gmp-value .gmp-icon { width: 0.7em; height: 0.7em; margin-right: 0.3em; vertical-align: 0.02em; }

/* GMP trend: arrow colour follows the day's change (green up, red down); the icon opens the trend chart on the detail page */
.gmp-icon-up { color: #15803d; }
.gmp-icon-down { color: #b91c1c; }
.gmp-icon-flat { color: var(--muted, #6b7280); }
.gmp-trend-btn { display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; padding: 2px; margin: 0 0.3em 0 0; border-radius: 4px; cursor: pointer; color: inherit; line-height: 0; }
.gmp-trend-btn:hover { background: rgba(0, 0, 0, 0.06); }
.gmp-trend-btn:focus-visible { outline: 2px solid var(--accent, #2456d6); outline-offset: 2px; }
.gmp-trend-btn .gmp-icon { margin-right: 0; width: 0.75em; height: 0.75em; }

/* IPO detail: segment badge and status pill together, at the top right of the header */
.ipo-head .ipo-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* GMP trigger: the arrow and the amount together; same font as the figure */
.gmp-trend-btn { font: inherit; padding: 2px 4px; margin: 0; gap: 0.3em; }
.gmp-trend-btn .gmp-icon { margin-right: 0; }
.gmp-trend-btn .gmp-amount { white-space: nowrap; }

/* GMP arrow: sized to the figure next to it (the list card and the detail value) */
.gmp-value .gmp-icon { width: 0.95em; height: 0.95em; margin-right: 0.35em; vertical-align: -0.12em; }
