/* Shared glass surfaces. Reading panels are tinted more heavily to protect
   contrast for small figures, source links and positive/negative returns. */
:root {
  --glass-dark: linear-gradient(132deg, #324a66ba, #152339bd 58%, #182b42d9);
  --glass-dark-raised: linear-gradient(132deg, #435e7fc9, #213751e8);
  --glass-light: linear-gradient(138deg, #fffdf6f7, #e9eef7ee 70%, #fff2ddf2);
  --glass-inset: linear-gradient(136deg, #ffffffad, #edf2f9a1);
  --glass-line-dark: #c9e0ff43;
  --glass-line-light: #a5b4c678;
  --glass-shadow: 0 12px 38px #040b1860, inset 0 1px 0 #ffffff32;
  --glass-shine: inset 0 1px 0 #ffffffc4;
  --glass-blur: blur(16px) saturate(135%);
  --glass-radius: .85rem;
}

body, body.seo-page {
  background: radial-gradient(ellipse at 8% 0%, #244264 0, transparent 42rem),
    radial-gradient(ellipse at 95% 17%, #3a4258 0, transparent 36rem),
    radial-gradient(ellipse at 72% 55%, #16394c 0, transparent 44rem), #0a1221;
  background-attachment: fixed;
}

body > .sidebar, body.seo-page > .sidebar,
body > .sidebar nav, body.seo-page > .sidebar nav,
.workspace :is(.topbar, .seo-topbar),
.topbar[data-reading-open="true"] .reading-controls {
  background: linear-gradient(128deg, #233850db, #0a1424da);
  border-color: var(--glass-line-dark);
  box-shadow: inset 0 1px 0 #ffffff1c;
  backdrop-filter: var(--glass-blur);
}
body > .sidebar nav, body.seo-page > .sidebar nav { box-shadow: var(--glass-shadow); }

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  html { background-color: #101e32; overflow: hidden; }
  /* Keep page content in a scrollport below the header. The native browser
     toolbar can reveal content from the root scrollport on iOS. */
  body, body.calendar-page {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    block-size: 100dvh;
    min-block-size: 0;
    overflow: clip;
  }
  body > .sidebar, body.seo-page > .sidebar {
    position: relative;
    background: linear-gradient(128deg, #1a2b43, #101e32);
    backdrop-filter: none;
  }
  body > .workspace {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-padding-block-start: .75rem;
  }
  body > .workspace :is(#directory-title, .company-profile section, .company-sources li, .quarter-table tr[id]) {
    scroll-margin-top: 0;
  }
  body.calendar-page > .workspace {
    grid-template-rows: auto minmax(15rem, 1fr) 0;
  }
}

#next-milestones, .research-hero #next-milestones,
.stats, .deadline-banner, .desk-launchpad, .desk-research-hero,
.market-hero, .investment-result-hero, dialog .detail-header {
  background: var(--glass-dark);
  border-color: var(--glass-line-dark);
  border-radius: var(--glass-radius);
  box-shadow: var(--glass-shadow);
}
.research-hero #next-milestones {
  background: var(--glass-dark);
  backdrop-filter: var(--glass-blur);
}
.research-hero .stats { background: var(--glass-line-dark); border-color: var(--glass-line-dark); }
.research-hero .stat { background: var(--glass-dark); }
.research-hero .stat:is(:hover, [aria-pressed="true"]),
.sidebar nav .nav-item:is(:hover, .active, [aria-current="page"]),
.research-hero #next-milestones .milestone:hover { background: var(--glass-dark-raised); }
.research-hero #next-milestones .milestone {
  background: transparent;
  border-color: transparent;
  border-block-start-color: var(--glass-line-dark);
  border-radius: .25rem;
}
.research-hero #next-milestones .milestone:is(:hover, :focus-visible) {
  background: var(--glass-dark-raised);
  border-color: var(--glass-line-dark);
}
.research-hero #next-milestones .milestone-date {
  background: #182a429e;
  border-color: var(--glass-line-dark);
}
@media (max-width: 480px) {
  .hero-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
}

.directory-section, .seo-panel, .seo-table-wrap, .listing-day, .study-card,
.statistics-panel, .market-panel, .desk-panel, .investment-result-panel,
.catalogue-preview-card, .quarter-controls, dialog {
  background: var(--glass-light);
  border: 1px solid var(--glass-line-light);
  border-radius: var(--glass-radius);
  box-shadow: var(--glass-shadow);
}
.directory-section, .listing-day, dialog {
  backdrop-filter: var(--glass-blur);
}

.workspace .ipo-row, .offer-snapshot, .desk-table-wrap, .analysis-table-wrap,
.filing-card, .scenario-card, .tier-plan-card, .statistics-kpi,
.company-metrics > div, .seo-panel .seo-facts > div,
.listing-day-counter, .detail-metrics > div, .detail-sections {
  background: var(--glass-inset);
  border-color: var(--glass-line-light);
  box-shadow: var(--glass-shine);
}
.workspace .ipo-row:hover { border-color: #8497b8; box-shadow: var(--glass-shine); }
:is(.seo-table-wrap, .desk-table-wrap, .directory-compact, .analysis-table-wrap) thead,
:is(.seo-table-wrap, .desk-table-wrap, .directory-compact, .analysis-table-wrap) thead th {
  background: #dfe8f4;
  color: var(--ink);
}
:is(.quarter-table, .directory-compact) tbody tr:nth-child(even) { background: #f6f8fc9c; }
:is(.quarter-table, .directory-compact) tbody tr:is(:hover, :focus-within, :target) { background: #e0eaf7; }

.month-calendar {
  color: #182a40;
  background: var(--glass-light);
  border-color: var(--glass-line-light);
  box-shadow: var(--glass-shadow);
}
.month-calendar .calendar-month-bar h2,
.calendar-grid .calendar-day:not(.calendar-today) time { color: #182a40; }
.calendar-grid {
  --calendar-divider: #9baec5;
  gap: 0;
  background: #b9c9dc;
  border-color: var(--calendar-divider);
}
/* Cell borders stay visible at fractional browser zoom levels. */
.calendar-grid > :not(:nth-child(7n)) { border-inline-end: 1px solid var(--calendar-divider); }
.calendar-grid > :not(:nth-last-child(-n + 7)) { border-block-end: 1px solid var(--calendar-divider); }
.calendar-grid .calendar-day { background: #ffffffcf; }
.calendar-grid .calendar-today { background: #fff0d4; }
.calendar-grid :is(.calendar-blank, .calendar-weekday) { background: #e4ebf5; }
.month-calendar .calendar-dot.calendar-ballot { background: #795493; }
.calendar-grid .calendar-chip.calendar-ballot { color: #603978; background: #f0e9f7; }

.sidebar .workspace-menu, body.seo-page .sidebar #seo-menu-toggle,
.topbar .reading-toggle, .topbar select,
:is(.topbar,.seo-topbar) .social-links a,
.seo-languages a, .seo-topic-links a, .company-section-nav a,
.workspace-shortcuts :is(button,a), .hero-actions a:not(:first-child) {
  background: var(--glass-dark);
  border-color: var(--glass-line-dark);
  color: var(--desk-text);
  box-shadow: inset 0 1px 0 #ffffff26;
}
.seo-languages a[aria-current="page"], .workspace-shortcuts button[aria-current="page"] {
  background: var(--desk-gold);
  border-color: var(--desk-gold);
  color: var(--desk-bg);
}
:is(.topbar,.seo-topbar) .social-links a:hover { background: var(--desk-text); color: var(--ink); }
.directory-section :is(.search-field, .filter-bar select),
.quarter-controls :is(input, select, button:not([aria-pressed="true"])), .calendar-control {
  background: var(--glass-inset);
  border-color: var(--glass-line-light);
  box-shadow: var(--glass-shine);
}
.calendar-control:hover { background: #fff0d4; }
dialog::backdrop { background: #090f1fb3; backdrop-filter: blur(7px); }
dialog.detail-dialog .detail-header { border-radius: var(--glass-radius) var(--glass-radius) 0 0; }

@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass-dark: #243953;
    --glass-dark-raised: #334b68;
    --glass-light: #f6f7fa;
    --glass-inset: #f0f4f9;
    --glass-blur: none;
  }
  body, body.seo-page { background: #0a1221; }
  body > .sidebar, body.seo-page > .sidebar,
  body > .sidebar nav, body.seo-page > .sidebar nav,
  .workspace :is(.topbar, .seo-topbar),
  .topbar[data-reading-open="true"] .reading-controls { background: #182940; }
  dialog::backdrop { background: #090f1fe6; backdrop-filter: none; }
}

/* Keep movement separate from existing layout transforms and chart signals. */
html { scroll-padding-top: var(--motion-nav-height, 4rem); }
body > .sidebar[data-scrolled] { box-shadow: 0 8px 22px #060e1d65, inset 0 1px 0 #ffffff1c; }
.back-to-top {
  position: fixed;
  z-index: 19;
  inset-inline-end: max(1rem, env(safe-area-inset-right));
  inset-block-end: calc(5rem + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #d3b77d;
  color: var(--desk-gold);
  background: #172840;
  box-shadow: 0 4px 16px #050a15a0;
  font-size: 1.35rem;
}
.cds-launcher {
  position: fixed;
  z-index: 20;
  inset-inline-end: max(1rem, calc(env(safe-area-inset-right) + .5rem));
  inset-block-end: calc(1rem + env(safe-area-inset-bottom));
}
.cds-launcher summary {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .1rem;
  width: 56px;
  height: 56px;
  list-style: none;
  cursor: pointer;
  border-radius: 50%;
  border: 1px solid var(--desk-gold);
  background: var(--desk-gold);
  color: var(--desk-bg);
  box-shadow: 0 4px 16px #050a1580;
  font-size: .69rem;
  font-weight: 750;
  line-height: 1;
}
.cds-launcher summary::-webkit-details-marker { display: none; }
.cds-launcher summary svg { width: 22px; height: 22px; }
.cds-launcher summary:focus-visible {
  outline: 2px solid var(--desk-gold);
  outline-offset: 3px;
}
.cds-launcher .cds-referral {
  position: absolute;
  inset-inline-end: 0;
  inset-block-end: calc(100% + .65rem);
  width: min(18rem, calc(100vw - 3rem));
  max-height: calc(100dvh - 6rem - env(safe-area-inset-bottom));
  overflow: auto;
  margin: 0;
  border-color: var(--desk-rule);
  background: var(--desk-surface);
  color: var(--desk-text);
  box-shadow: 0 6px 22px #050a1580;
  font-size: .9rem;
  line-height: 1.45;
}
.cds-launcher .cds-referral a {
  margin-top: .2rem;
  padding-inline: .8rem;
  border-radius: 2rem;
  background: var(--desk-gold);
  color: var(--desk-bg);
  font-weight: 700;
  text-decoration: none;
}
.cds-launcher .cds-referral a:hover { text-decoration: underline; }
body:has(.cds-launcher[open]) .back-to-top { visibility: hidden; }
body:has(.cds-launcher) .homepage-footer { padding-block-end: 5rem; }
.back-to-top[hidden], .site-cursor[hidden] { display: none; }

@media screen and (prefers-reduced-motion: no-preference) {
  html, body > .workspace { scroll-behavior: smooth; }
  body > .sidebar[data-menu-open="true"] nav { animation: glass-menu-in 150ms ease-out; }
  .research-hero .hero-copy { animation: hero-enter 320ms ease-out; }
  .research-hero #next-milestones { animation: hero-enter 380ms ease-out; }
  .research-hero :focus-within { animation: none; }
}

@keyframes glass-menu-in {
  from { opacity: 0; translate: 0 -.4rem; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes hero-enter {
  from { opacity: .75; translate: 0 .5rem; }
  to { opacity: 1; translate: 0 0; }
}

@media (hover: hover) and (pointer: fine) {
  :is(a[href], button:enabled, summary) { cursor: pointer; }
  :is(button:enabled, .hero-actions a, .ipo-row, .study-card, .listing-day-counter, .catalogue-preview-card):hover {
    box-shadow: inset 0 0 0 100vmax rgb(0 0 0 / .08), 0 7px 16px #050a153b;
  }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  :is(button:enabled, .hero-actions a, .ipo-row, .study-card, .listing-day-counter, .catalogue-preview-card) {
    transition: translate 150ms ease-out, transform 150ms ease-out, box-shadow 150ms ease-out, background-color 150ms ease-out, border-color 150ms ease-out;
  }
  :is(button:enabled, .hero-actions a, .ipo-row, .study-card, .listing-day-counter, .catalogue-preview-card):hover {
    translate: var(--magnet-x, 0px) calc(var(--magnet-y, 0px) - 2px);
  }
  :is(button:enabled, .hero-actions a):active { translate: 0 1px; }
  .research-hero .stats[data-spotlight], .research-hero .stat { position: relative; }
  .research-hero .stats[data-spotlight]::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(circle 240px at var(--spot-x) var(--spot-y), rgb(242 205 135 / .15), transparent);
  }
  .research-hero .stats[data-spotlight] .stat::after {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    pointer-events: none;
    background: radial-gradient(circle 240px at var(--spot-x) var(--spot-y), #ffe6b9a6, transparent);
    mask: linear-gradient(#fff 0 0) content-box exclude, linear-gradient(#fff 0 0);
  }
  .site-cursor {
    position: fixed;
    z-index: 100;
    inset: 0 auto auto 0;
    pointer-events: none;
  }
  .site-cursor::after {
    content: "";
    display: block;
    translate: -50% -50%;
    width: 12px;
    height: 12px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: #f2cd87;
    box-shadow: 0 0 0 1px #172840;
    transition: width 150ms ease-out, height 150ms ease-out, background-color 150ms ease-out;
  }
  .site-cursor[data-ring]::after {
    width: 48px;
    height: 48px;
    border-color: #f2cd87cf;
    background: transparent;
    box-shadow: 0 0 0 1px #17284055;
  }
  @media (forced-colors: none) {
    html[data-custom-cursor], html[data-custom-cursor] * { cursor: none !important; }
  }
}

/* Shared alignment and keyboard affordances for the research homepage. */
.research-hero .heading h1#page-title {
  letter-spacing: -.045em;
  line-height: 1.04;
}
.research-hero .heading #page-description {
  max-inline-size: 46ch;
  line-height: 1.6;
}
.research-hero .stat > span { font-size: .875rem; }
.research-hero .stat small { font-size: .8125rem; }
.research-hero :is(a, button):focus-visible {
  outline: 2px solid var(--desk-gold);
  outline-offset: 2px;
}
.research-hero .stat:focus-visible { outline-offset: -3px; }

@media (min-width: 1024px) {
  .research-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    align-content: center;
  }
}

body > .sidebar[data-menu-open="true"] nav:is(#workspace-navigation, #seo-menu) {
  align-items: start;
  gap: .8rem 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sidebar .nav-group { min-width: 0; }
.sidebar .nav-group h2 {
  margin: .45rem .65rem .25rem;
  color: var(--desk-gold);
  font-size: .78rem;
  font-weight: 650;
}
.sidebar .nav-group button { text-align: start; }

.ipo-calculator-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .35rem .6rem;
  border: 1px solid #9b7846;
  border-radius: .4rem;
  color: var(--ink);
  font-size: .85rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: .16em;
}
.ipo-row > .ipo-calculator-action { grid-column: 1 / -1; justify-self: start; }
.ipo-card-details { grid-column: 1 / -1; min-width: 0; }
.ipo-card-details > summary, .compact-extra > summary {
  width: fit-content;
  min-height: 44px;
  padding-block: .65rem;
  cursor: pointer;
  font-weight: 650;
}
#directory-layout { display: inline-flex; }
.use-compact .directory-cards { display: none; }
.use-compact .directory-compact { display: block; overflow-x: auto; }
.directory-compact table { width: 100%; border-collapse: collapse; background: #f8f6f2; color: var(--ink); font-size: .875rem; }
.directory-compact :is(td,th) { border: 1px solid var(--glass-line-light); padding: .4rem .5rem; text-align: start; vertical-align: top; }
.directory-compact tbody th button { min-height: 44px; text-align: start; text-decoration: underline; }
.directory-compact tbody small { display: block; font-weight: normal; }
.compact-extra { display: none; font-size: .8rem; }
.compact-extra .debut-cell { display: grid; gap: .15rem; border: 0; margin: .5rem 0 0; padding: 0; }
.compact-extra .debut-cell::before { display: none; }
@media (max-width: 760px) {
  .directory-compact :is(th,td):nth-child(n+4) { display: none; }
  .directory-compact .compact-extra { display: block; }
  .directory-compact tbody th button { overflow-wrap: anywhere; }
  .directory-compact .ipo-calculator-action { padding-inline: .25rem; }
}

.pipeline-stages {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 0;
  list-style-position: inside;
}
.pipeline-stages li {
  padding: .45rem .6rem;
  border: 1px solid var(--glass-line-light);
  border-radius: .35rem;
}
.pipeline-drafts { padding-inline-start: 1.2rem; }
.pipeline-drafts li { margin-block: .6rem; }
.pipeline-drafts span { display: block; }
.watchlist-transfer input {
  display: block;
  width: min(100%, 36rem);
  min-height: 44px;
  margin-block: .3rem .6rem;
  padding: .45rem;
  border: 1px solid var(--glass-line-light);
  border-radius: .35rem;
  color: var(--ink);
  background: var(--glass-inset);
}
.watchlist-transfer form { margin-block-start: .9rem; }

html[data-colour-theme="dark"] {
  color-scheme: dark;
  --ink: #f2f5fa;
  --muted: #c1cde0;
  --glass-light: linear-gradient(135deg, #20344a, #111f32);
  --glass-inset: linear-gradient(135deg, #293d54, #192b40);
  --glass-line-light: #536983;
  --glass-shine: inset 0 1px 0 #ffffff12;
}
[data-colour-theme="dark"] :is(.directory-section, .seo-panel, .seo-table-wrap, .listing-day, .study-card, .statistics-panel, .market-panel, .desk-panel, .investment-result-panel, .catalogue-preview-card, .quarter-controls, dialog, .month-calendar) {
  color: var(--ink);
}
[data-colour-theme="dark"] :is(.seo-panel, .catalogue-preview-card, .directory-section, .listing-day, .desk-panel) :is(h2,h3,h4,p,dt,dd,summary,.seo-company,.offer-fact-name,.company-cell,.price-cell,.date-cell) {
  color: var(--ink);
}
[data-colour-theme="dark"] :is(.seo-panel, .directory-section, .desk-panel, .catalogue-preview-card, .seo-table-wrap) a:not(.primary-button) { color: #f7d99b; }
[data-colour-theme="dark"] .ipo-engagement-actions a { background: #192a40; color: #f7d99b; }
[data-colour-theme="dark"] :is(.seo-table-wrap, .desk-table-wrap, .directory-compact, .analysis-table-wrap) :is(thead,thead th,tbody tr,td,tbody th),
[data-colour-theme="dark"] .directory-compact table {
  background: #17283e;
  color: var(--ink);
}
[data-colour-theme="dark"] :is(.seo-table-wrap, .desk-table-wrap, .directory-compact, .analysis-table-wrap) tbody tr:nth-child(even) :is(td,th) { background: #20344a; }
[data-colour-theme="dark"] .calendar-grid { --calendar-divider: #627895; background: #243a53; }
[data-colour-theme="dark"] .calendar-grid .calendar-day { background: #192a40; color: var(--ink); }
[data-colour-theme="dark"] .calendar-grid .calendar-today { background: #2c4260; }
[data-colour-theme="dark"] .month-calendar :is(.calendar-month-bar h2,.calendar-day:not(.calendar-today) time) { color: var(--ink); }
[data-colour-theme="dark"] :is(.ipo-row, .seo-table-wrap, .directory-compact) .ipo-return-positive { color: #8ae1b6; }
[data-colour-theme="dark"] :is(.ipo-row, .seo-table-wrap, .directory-compact) .ipo-return-negative { color: #ffabac; }

/* Compact glass theme switch shared by the directory and detail pages. */
.theme-toolbar { display: flex; align-items: center; gap: .5rem; }
.theme-switch {
  display: inline-grid;
  place-items: center;
  width: 76px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 24px;
  cursor: pointer;
  flex-shrink: 0;
}
.theme-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 72px;
  height: 34px;
  border-radius: 18px;
  border: 1px solid #ffffff51;
  background: #101d31;
  box-shadow: inset 0 2px 5px #06101fa6;
  color: #c9d8ed;
}
.theme-symbol { font: 19px/1 system-ui, sans-serif; text-align: center; }
.theme-thumb {
  position: absolute;
  inset-block-start: 2px;
  inset-inline-start: 2px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #ffe2a3;
  color: #382400;
  background: linear-gradient(145deg, #fff8e5eb, #e7af53d9);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 1px #fff9, 0 0 11px #ffbd628c;
  transition: transform 240ms cubic-bezier(.2,.75,.3,1), background 180ms, box-shadow 180ms, border-color 180ms;
}
.theme-thumb .theme-moon,
[data-colour-theme="dark"] .theme-thumb .theme-sun { display: none; }
[data-colour-theme="dark"] .theme-thumb .theme-moon { display: block; }
[data-colour-theme="dark"] .theme-thumb {
  transform: translateX(38px);
  border-color: #bcdbff;
  color: #fff;
  background: linear-gradient(145deg, #6581a7ef, #263e68e0);
  box-shadow: inset 0 1px 1px #d2e5ffb3, 0 0 11px #84baff9c;
}
.theme-preferences { position: relative; }
.theme-preferences summary {
  cursor: pointer;
  padding: .55rem .65rem;
  min-height: 44px;
  font-size: .82rem;
}
.theme-preferences > div {
  position: absolute;
  z-index: 10;
  inset-block-start: 100%;
  inset-inline-start: 0;
  min-width: 9rem;
  padding: .65rem;
  border: 1px solid var(--desk-rule);
  border-radius: .55rem;
  background: #182940;
  color: #f3e9d8;
  box-shadow: 0 10px 24px #0004;
}
.theme-options { display: grid; gap: .3rem; font-size: .85rem; }
.theme-options select { min-height: 44px; font: inherit; }
@media (prefers-reduced-motion: reduce) {
  .theme-thumb { transition: none; }
}

/* Daylight applies to the page shell and the content above the fold. */
html[data-colour-theme="light"] {
  color-scheme: light;
  background-color: #edf1f7;
  --desk-bg: #edf1f7;
  --desk-surface: #fffdf8;
  --desk-raised: #e0e9f4;
  --desk-rule: #aebed1;
  --desk-text: #172c45;
  --desk-muted: #435972;
  --desk-gold: #8a5718;
  --glass-dark: linear-gradient(138deg, #fffdfa, #eaf0f8);
  --glass-dark-raised: linear-gradient(138deg, #fff4dd, #e0eaf6);
  --glass-line-dark: #a4b6cb;
  --glass-shadow: 0 8px 24px #25476820, inset 0 1px 0 #fff;
}
[data-colour-theme="light"] :is(body, body.seo-page) {
  color: var(--desk-text);
  background: radial-gradient(ellipse at 7% 0%, #fff0d6, transparent 44rem),
    radial-gradient(ellipse at 100% 30%, #dce8f9, transparent 55rem), var(--desk-bg);
}
[data-colour-theme="light"] :is(body > .sidebar, body > .sidebar nav, .workspace :is(.topbar, .seo-topbar), .topbar[data-reading-open="true"] .reading-controls, .theme-preferences > div) {
  background: linear-gradient(128deg, #fffdf9, #e9eff8);
  border-color: var(--desk-rule);
  color: var(--desk-text);
}
[data-colour-theme="light"] :is(.brand, .brand-serif, .breadcrumb, .seo-breadcrumb, .seo-breadcrumb a, .homepage-footer, .homepage-footer a, .site-disclaimer) {
  color: var(--desk-text);
}
[data-colour-theme="light"] :is(.research-hero .stat, .research-hero #next-milestones, .deadline-banner) :is(h2, p, a, button, strong, span, small) {
  color: var(--desk-text);
}
[data-colour-theme="light"] .research-hero #next-milestones .milestone-date {
  background: #dce7f4;
}
[data-colour-theme="light"] :is(.seo-page h1, .seo-intro, .seo-page .eyebrow, .seo-disclaimer, .theme-preferences summary) {
  color: var(--desk-text);
}
[data-colour-theme="light"] .theme-track {
  background: #dbe5f2;
  color: #435972;
  border-color: #96abc4;
  box-shadow: inset 0 2px 5px #617a9d40;
}

/* Pair text and surfaces explicitly so native mobile controls follow the site theme. */
:root {
  --reading-text: #172c45;
  --reading-accent: #172c45;
  --reading-control: #f4f7fc;
  --reading-selected: #e0eaf7;
  --reading-line: #667e9b;
  --reading-focus: #294c77;
}

html[data-colour-theme="dark"] {
  --reading-text: #f8faff;
  --reading-accent: #ffde9e;
  --reading-control: #1c3047;
  --reading-selected: #30445c;
  --reading-line: #8ba0bb;
  --reading-focus: #ffde9e;
  --ink: var(--reading-text);
  --muted: var(--reading-text);
  --desk-text: var(--reading-text);
  --desk-muted: var(--reading-text);
}

html[data-colour-theme="light"] {
  --ink: var(--reading-text);
  --muted: var(--reading-text);
  --desk-muted: var(--reading-text);
}

body .directory-section :is(.search-field, .filter-bar select, .status-tabs button, #directory-layout, #week-filter),
body :is(.reading-controls, .theme-preferences, .quarter-controls, .tier-dialog) :is(input, select, textarea) {
  color: var(--reading-text);
  background: var(--reading-control);
  border-color: var(--reading-line);
  -webkit-text-fill-color: currentColor;
}

body .directory-section .status-tabs button.selected,
body .directory-section :is(#directory-layout, #week-filter)[aria-current="true"],
body .directory-section #directory-layout[aria-pressed="true"] {
  color: var(--reading-accent);
  background: var(--reading-selected);
  border-color: var(--reading-focus);
}

body :is(.directory-section, .reading-controls, .theme-preferences, .quarter-controls, .tier-dialog) select option {
  background: var(--reading-control);
  color: var(--reading-text);
}

body .directory-section .search-field input::placeholder,
body .directory-section :is(.search-field input, .search-field svg, .list-meta, #result-count, #clear-filters) {
  color: var(--reading-text);
  opacity: 1;
}

body .directory-section .search-field input,
body .directory-section .search-field input::placeholder { -webkit-text-fill-color: currentColor; }
body .directory-section .search-field:focus-within,
body .directory-section :is(select, button, a):focus-visible {
  outline: 2px solid var(--reading-focus);
  outline-offset: 2px;
}

body :is(.directory-section, .seo-panel, .listing-day, .desk-panel) :is(.company-cell strong, .company-cell small, .price-cell small, .date-cell small, .ipo-card-facts dt, .ipo-card-facts dd, .seo-facts dt, .seo-facts dd, .seo-intro, .text-button, .performance-listing, .performance-symbol) {
  color: var(--reading-text);
}

body :is(.ipo-research-details, .ipo-balloting-callout, .ipo-closing-today, .status-pill, .listing-day-badge) {
  color: var(--reading-text);
  background: var(--reading-control);
  border-color: var(--reading-line);
}

body :is(.ipo-research-details, .ipo-balloting-callout, .ipo-closing-today) :is(p, dt, dd, small, strong, summary, time, button, span) {
  color: var(--reading-text);
}

body :is(.ipo-research-details, .ipo-balloting-callout, .ipo-closing-today) a,
body .directory-section .ipo-card-facts .ipo-fact-pending,
body .performance-results .performance-dispute {
  color: var(--reading-accent);
}

body .directory-section .status-pill.status-open,
body .directory-section .status-pill.status-balloting {
  color: var(--reading-accent);
  background: var(--reading-selected);
}

/* Signed figures stay readable while chart bars retain their gain/loss colours. */
html[data-colour-theme] body :is(.directory-section, .seo-panel, .quarter-results, .performance-results) :is(.ipo-return-positive, .ipo-return-negative, .quarter-up, .quarter-down) {
  color: var(--reading-text);
}

html[data-colour-theme="light"] body :is(.directory-section, .seo-panel, .listing-day, .desk-panel) a:not(.primary-button) {
  color: var(--reading-text);
}

html[data-colour-theme="light"] body .performance-results.performance-results caption {
  background: var(--reading-selected);
  color: var(--reading-text);
}

body :is(.topbar, .seo-topbar, .homepage-footer, .seo-footer) :is(.breadcrumb, .breadcrumb strong, .top-right, .site-disclaimer, .theme-preferences summary),
body :is(.directory-section, .seo-panel, .listing-day, .desk-panel) :is(.muted, .offer-fact-name, .source-material, .performance-method) {
  color: var(--reading-text);
}

body #ipo-performance-chart,
body .performance-results {
  --chart-ink: var(--reading-text);
  --chart-muted: var(--reading-text);
  --performance-muted: var(--reading-text);
  --performance-warning: var(--reading-accent);
}
