/* Romanson Invest — shared top chrome: index strip, masthead, nav.
   Lands inside pages we do not control, so: every rule is scoped under .ri-chrome, every class is
   ri-*, custom properties are --ri-* and live on .ri-chrome (never :root), and the root resets the
   inherited typography so host body styles cannot bleed in. */

.ri-chrome {
  --ri-paper: #FFF1E5;
  --ri-wheat: #F2DFCE;
  --ri-ink: #33302E;
  --ri-muted: #66605C;
  --ri-rule: #CCC1B7;
  --ri-rule-soft: #E3D3C4;
  --ri-claret: #0F7862;
  --ri-grad: linear-gradient(100deg, #1E9E64 0%, #1C9A6A 50%, #2F8E96 75%, #4F78C4 100%);
  --ri-oxford: #0F5499;
  --ri-gain: #08704F;
  --ri-loss: #C00000;
  --ri-flat: #66605C;
  --ri-open: #08704F;
  --ri-tick-up: rgba(8, 112, 79, .16);
  --ri-tick-down: rgba(192, 0, 0, .14);
  --ri-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --ri-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ri-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ri-max: 1240px;

  display: block;
  position: relative;
  box-sizing: border-box;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--ri-rule);
  background: var(--ri-paper);
  color: var(--ri-ink);
  font-family: var(--ri-sans);
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.4;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  text-indent: 0;
  text-shadow: none;
  word-spacing: normal;
  white-space: normal;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="gray"]) .ri-chrome {
    --ri-paper: #1A1817;
    --ri-wheat: #24211F;
    --ri-ink: #F2E9E1;
    --ri-muted: #B3A79D;
    --ri-rule: #433D38;
    --ri-rule-soft: #332F2B;
    --ri-claret: #6BC9A0;
    --ri-grad: linear-gradient(100deg, #5FCF8E 0%, #5ECB8B 55%, #7CBFB8 78%, #96B3E0 100%);
    --ri-oxford: #8DB4EA;
    --ri-gain: #3FBF8C;
    --ri-loss: #FF6E61;
    --ri-flat: #B3A79D;
    --ri-open: #3FBF8C;
    --ri-tick-up: rgba(63, 191, 140, .2);
    --ri-tick-down: rgba(255, 110, 97, .18);
    color-scheme: dark;
  }
}
/* the site-wide theme (ri-theme.js, switch on the home page) sits on <html> as data-theme */
:root[data-theme="gray"] .ri-chrome {
  --ri-paper: #25272A;
  --ri-wheat: #2E3134;
  --ri-ink: #E9EAEC;
  --ri-muted: #A7ABB0;
  --ri-rule: #46494E;
  --ri-rule-soft: #3A3D41;
  --ri-claret: #7FD3A8;
  --ri-grad: linear-gradient(100deg, #5FCF8E 0%, #5ECB8B 55%, #7CBFB8 78%, #96B3E0 100%);
  --ri-oxford: #ADBAF0;
  --ri-gain: #79D39F;
  --ri-loss: #F0968C;
  --ri-flat: #A7ABB0;
  --ri-open: #79D39F;
  --ri-tick-up: rgba(121, 211, 159, .2);
  --ri-tick-down: rgba(240, 150, 140, .18);
  color-scheme: dark;
}
:root[data-theme="dark"] .ri-chrome {
  --ri-paper: #1A1817;
  --ri-wheat: #24211F;
  --ri-ink: #F2E9E1;
  --ri-muted: #B3A79D;
  --ri-rule: #433D38;
  --ri-rule-soft: #332F2B;
  --ri-claret: #6BC9A0;
  --ri-grad: linear-gradient(100deg, #5FCF8E 0%, #5ECB8B 55%, #7CBFB8 78%, #96B3E0 100%);
  --ri-oxford: #8DB4EA;
  --ri-gain: #3FBF8C;
  --ri-loss: #FF6E61;
  --ri-flat: #B3A79D;
  --ri-open: #3FBF8C;
  --ri-tick-up: rgba(63, 191, 140, .2);
  --ri-tick-down: rgba(255, 110, 97, .18);
  color-scheme: dark;
}

/* reserve room on our own pages, where an empty slot is already in the markup */
.ri-chrome:empty { min-height: 168px; }
@media (max-width: 720px) { .ri-chrome:empty { min-height: 182px; } }

.ri-chrome *,
.ri-chrome *::before,
.ri-chrome *::after {
  box-sizing: border-box;
}
.ri-chrome ul,
.ri-chrome li,
.ri-chrome p,
.ri-chrome nav,
.ri-chrome header {
  margin: 0;
  padding: 0;
  border: 0;
  list-style: none;
  font: inherit;
  color: inherit;
  background: none;
}
.ri-chrome a {
  color: inherit;
  text-decoration: none;
  background: none;
}
.ri-chrome button {
  margin: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: none;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.ri-chrome a:focus-visible,
.ri-chrome button:focus-visible {
  outline: 2px solid var(--ri-oxford);
  outline-offset: 2px;
  border-radius: 1px;
}

.ri-chrome .ri-in {
  max-width: var(--ri-max);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.ri-chrome .ri-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* skip link: invisible until focused */
.ri-chrome .ri-skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ri-ink);
  color: var(--ri-paper);
  font-size: 13px;
  font-weight: 600;
}
.ri-chrome .ri-skip:focus { top: 8px; }

/* ---------- 1. index strip ---------- */
.ri-chrome .ri-strip {
  background: var(--ri-wheat);
  border-bottom: 1px solid var(--ri-rule);
  font-size: 12px;
  line-height: 1.2;
}
.ri-chrome .ri-strip .ri-in {
  max-width: none;            /* the strip runs full-bleed, like a ticker */
  position: relative;         /* keeps the visually-hidden labels inside the scroller */
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 34px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}
.ri-chrome .ri-strip .ri-in::-webkit-scrollbar { display: none; }
.ri-chrome .ri-idx-list {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.ri-chrome .ri-idx {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 10px;
  border-left: 1px solid var(--ri-rule);
  border-radius: 1px;
  transition: background-color .9s ease;
}
.ri-chrome .ri-idx:first-child { padding-left: 0; border-left: 0; }
.ri-chrome .ri-idx-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--ri-ink);
}
.ri-chrome .ri-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--ri-muted);
  flex: 0 0 auto;
  transform: translateY(-1px);
}
.ri-chrome .ri-dot.ri-is-open {
  background: var(--ri-open);
  border-color: var(--ri-open);
}
.ri-chrome .ri-idx-val {
  font-family: var(--ri-sans);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--ri-ink);
}
.ri-chrome .ri-idx-chg {
  font-family: var(--ri-sans);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
  color: var(--ri-flat);
}
.ri-chrome .ri-idx-chg.ri-up { color: var(--ri-gain); }
.ri-chrome .ri-idx-chg.ri-down { color: var(--ri-loss); }
.ri-chrome .ri-arr { font-size: 9px; margin-right: 2px; position: relative; top: -1px; }
.ri-chrome .ri-idx.ri-flash-up { background-color: var(--ri-tick-up); transition: none; }
.ri-chrome .ri-idx.ri-flash-down { background-color: var(--ri-tick-down); transition: none; }
.ri-chrome .ri-strip-note {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--ri-muted);
  font-size: 11px;
  font-style: italic;
  padding-left: 0;
}

/* ---------- 2. masthead ---------- */
.ri-chrome .ri-mast .ri-in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "date brand lang" ". tag theme";
  align-items: center;
  column-gap: 16px;
  row-gap: 2px;
  padding-top: 18px;
  padding-bottom: 14px;
}
.ri-chrome .ri-date {
  grid-area: date;
  font-size: 12.5px;
  color: var(--ri-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ri-chrome .ri-brand {
  grid-area: brand;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: .36em;
  font-family: var(--ri-serif);
  font-optical-sizing: auto;
  font-size: clamp(22px, 3.6vw, 40px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: .075em;
  text-transform: uppercase;
  color: var(--ri-ink);
  white-space: nowrap;
  padding: 2px 0 2px .075em; /* balance the trailing letter-spacing */
}
.ri-chrome .ri-brand-b { color: var(--ri-claret); font-weight: 400; background-image: var(--ri-grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ri-chrome .ri-brand-mark {
  display: inline-block;
  width: .2em;
  height: .2em;
  background: var(--ri-grad);
  transform: rotate(45deg);
  flex: 0 0 auto;
}
.ri-chrome .ri-tag {
  grid-area: tag;
  justify-self: center;
  font-family: var(--ri-serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ri-muted);
  white-space: nowrap;
  margin-top: 6px;
}
.ri-chrome .ri-lang {
  grid-area: lang;
  justify-self: end;
  display: inline-flex;
  border: 1px solid var(--ri-rule);
  background: var(--ri-paper);
}
.ri-chrome .ri-lang button {
  min-width: 38px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ri-muted);
}
.ri-chrome .ri-lang button + button { border-left: 1px solid var(--ri-rule); }
.ri-chrome .ri-lang button:hover { color: var(--ri-ink); }
.ri-chrome .ri-lang button[aria-pressed="true"] {
  background: var(--ri-ink);
  color: var(--ri-paper);
}
/* theme switch: only on the main site's pages (the apps follow the choice, their own switches are hidden) */
.ri-chrome .ri-theme {
  grid-area: theme;
  justify-self: end;
  display: inline-flex;
  margin-top: 6px;
  border: 1px solid var(--ri-rule);
  background: var(--ri-paper);
}
.ri-chrome .ri-theme button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ri-muted);
  white-space: nowrap;
}
.ri-chrome .ri-theme button + button { border-left: 1px solid var(--ri-rule); }
.ri-chrome .ri-theme button:hover { color: var(--ri-ink); }
.ri-chrome .ri-theme button[aria-pressed="true"] { background: var(--ri-ink); color: var(--ri-paper); }
.ri-chrome .ri-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid currentColor;
  flex: 0 0 auto;
}
.ri-chrome .ri-dot-light { background: #FFF1E5; }
.ri-chrome .ri-dot-dark { background: #1A1817; }
.ri-chrome .ri-dot-gray { background: #5C6066; }

/* ---------- 3. nav ---------- */
.ri-chrome .ri-nav {
  border-top: 1px solid var(--ri-rule);
}
.ri-chrome .ri-nav ul {
  display: flex;
  justify-content: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.ri-chrome .ri-nav ul::-webkit-scrollbar { display: none; }
.ri-chrome .ri-nav li { flex: 0 0 auto; }
.ri-chrome .ri-nav a {
  position: relative;
  display: block;
  padding: 11px 14px 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ri-ink);
}
.ri-chrome .ri-nav a:hover { color: var(--ri-claret); }
.ri-chrome .ri-nav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 3px;
  background: transparent;
}
.ri-chrome .ri-nav a:hover::after { background: var(--ri-rule); }
.ri-chrome .ri-nav a[aria-current="page"] { font-weight: 600; }
.ri-chrome .ri-nav a[aria-current="page"]::after { background: var(--ri-grad); }

@media (max-width: 720px) {
  .ri-chrome .ri-mast .ri-in {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand lang" "meta meta" "theme theme";
    padding-top: 12px;
    padding-bottom: 10px;
    row-gap: 6px;
  }
  .ri-chrome .ri-brand {
    justify-self: start;
    font-size: clamp(19px, 5.6vw, 26px);
    letter-spacing: .06em;
    padding-left: 0;
  }
  .ri-chrome .ri-meta-row {
    grid-area: meta;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 10px;
    min-width: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--ri-muted);
  }
  .ri-chrome .ri-date,
  .ri-chrome .ri-tag {
    grid-area: auto;
    justify-self: start;
    display: inline;
    margin: 0;
    font-size: 12px;
  }
  .ri-chrome .ri-meta-sep { display: none; }
  .ri-chrome .ri-theme { justify-self: start; margin-top: 2px; }
  .ri-chrome .ri-tag::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin-right: 8px;
    background: var(--ri-claret);
    transform: translateY(-2px) rotate(45deg);
  }
  .ri-chrome .ri-nav ul { justify-content: flex-start; gap: 0; }
  .ri-chrome .ri-nav a { padding: 10px 10px 9px; font-size: 13.5px; }
  .ri-chrome .ri-nav a::after { left: 10px; right: 10px; }
  .ri-chrome .ri-nav li:first-child a { padding-left: 0; }
  .ri-chrome .ri-nav li:first-child a::after { left: 0; }
}
@media (min-width: 721px) {
  .ri-chrome .ri-meta-row { display: contents; }
  .ri-chrome .ri-meta-sep { display: none; }
}
@media (max-width: 340px) {
  .ri-chrome .ri-tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ri-chrome .ri-idx { transition: none; }
}
