-/* ==========================================================================
   Genesys fact sheet --- /genesys

   Page-specific layout only. Every colour, radius and shadow is a token from
   styles.css, so the strategy sheet cannot drift from the rest of the product.
   ========================================================================== */

.gs {
  --gs-positive: #166534;
  --gs-rolling: #2563eb;
  padding-bottom: 3.5rem;
}

/* ------ Hero ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ */

.gs-hero {
  padding-bottom: 1.1rem;
}

.gs-hero .hero__title {
  /* The name is one word, so it carries the size the picker's two-line headline
     carries. */
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.gs-hero__lead {
  margin: 1.1rem 0 0;
  max-width: 56ch;
  font-size: clamp(0.95rem, 2.2vw, 1.03rem);
  line-height: 1.6;
  color: var(--text-muted);
}

.gs-hero__meta {
  margin: 0.9rem 0 0;
  font-size: 0.775rem;
  letter-spacing: 0.015em;
  color: var(--text-faint);
}
.gs-hero__meta strong {
  font-weight: 650;
  color: var(--accent-deep);
}

/* ------ Loading and failure --------------------------------------------------------------------------------------------------------------------------------------------------- */

.gs-loading {
  margin: 0;
  padding: 1.35rem 0;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.gs-skel {
  display: inline-block;
  height: 0.9em;
  border-radius: 5px;
  background: var(--track);
}
.gs-skel--inline { width: 16rem; max-width: 60%; }

@media (prefers-reduced-motion: no-preference) {
  .gs-kpis[aria-busy="true"] .gs-skel { animation: gs-breathe 1.6s var(--ease) infinite; }
}
@keyframes gs-breathe {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 0.85; }
}

.gs-error {
  margin: 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  background: var(--warn-bg);
  font-size: 0.85rem;
  color: var(--warn-text);
}

/* ------ Headline figures ------------------------------------------------------------------------------------------------------------------------------------------------------------ */

.gs-kpis {
  display: grid;
  /* Four across by two down: eight figures with no ragged last row, and the
     pairs a reader compares (Sharpe / Sortino, CAGR / Calmar) sit on one line. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 1.6rem 0 0;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-top), var(--surface-bottom));
  box-shadow: var(--shadow-field);
  overflow: hidden;
}

.gs-kpi {
  padding: 1.05rem 1.15rem 1.1rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.gs-kpi:nth-child(4n) { border-right: 0; }
.gs-kpi:nth-last-child(-n + 4) { border-bottom: 0; }

.gs-kpi__label {
  display: block;
  font-size: 0.665rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.gs-kpi__value {
  display: block;
  margin-top: 0.45rem;
  font-size: clamp(1.35rem, 3.6vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.gs-kpi__value[data-tone="up"] { color: var(--ok-text); }
.gs-kpi__value[data-tone="down"] { color: var(--down); }

.gs-kpi__sub {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.735rem;
  line-height: 1.4;
  color: var(--text-faint);
}

/* ------ Cards --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

.gs-card {
  margin-top: 1.5rem;
  padding: 1.35rem 1.4rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-top), var(--surface-bottom));
  box-shadow: 0 1px 2px rgba(28, 21, 18, 0.04);
}

.gs-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.gs-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}

.gs-card__sub {
  margin: 0.3rem 0 0;
  font-size: 0.775rem;
  line-height: 1.45;
  color: var(--text-faint);
}

.gs-card__note {
  margin: 1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  font-size: 0.735rem;
  line-height: 1.55;
  color: var(--text-faint);
}
.gs-card__note strong { color: var(--text-muted); font-weight: 650; }

/* Only shown on phones, where the table drops three columns. */
.gs-table-more { display: none; font-style: normal; }

.gs-card--placeholder {
  border-style: dashed;
  background: var(--surface-sunken);
  box-shadow: none;
}

.gs-placeholder {
  margin: 0;
  padding: 2.1rem 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ------ Legend chips ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ */

.gs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.gs-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.26rem 0.6rem 0.26rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.005em;
  color: var(--text-faint);
  cursor: pointer;
  transition: color var(--fast) var(--ease),
              border-color var(--fast) var(--ease),
              background var(--fast) var(--ease);
}
.gs-chip:hover { border-color: var(--border-strong); color: var(--text-muted); }
.gs-chip[aria-pressed="true"] {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.gs-chip__swatch {
  width: 9px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.45;
}
.gs-chip[aria-pressed="true"] .gs-chip__swatch { opacity: 1; }
.gs-chip--strategy .gs-chip__swatch {
  height: 4px;
  background: var(--gs-positive);
  opacity: 1;
}

/* ------ Chart --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

.gs-chart { position: relative; }

.gs-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.gs-axis-line { stroke: var(--border-strong); stroke-width: 1; }
.gs-grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; }
.gs-axis-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  fill: var(--text-faint);
}
.gs-guide { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; }

.gs-line { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.gs-line--strategy { stroke-width: 3; }
.gs-area { fill: rgba(22, 101, 52, 0.1); }
.gs-dot { stroke: var(--surface); stroke-width: 1.5; }

.gs-quarter__bar {
  opacity: 0.88;
  transition: opacity var(--fast) var(--ease);
}
.gs-quarter__bar:hover,
.gs-quarter__bar:focus { opacity: 1; }
.gs-quarter__bar:focus { outline: 2px solid var(--text); outline-offset: 2px; }
.gs-quarter-chart {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.gs-quarter-chart svg { min-width: 560px; }

/* ------ Readout under the chart --------------------------------------------------------------------------------------------------------------------------------------- */

.gs-readout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.15rem;
  margin-top: 0.55rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
  font-size: 0.735rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.gs-readout__month {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.gs-readout__item { display: inline-flex; align-items: center; gap: 0.35rem; }
.gs-readout__val { color: var(--text); font-weight: 600; }
.gs-readout__swatch {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ------ Drawdown strip ------------------------------------------------------------------------------------------------------------------------------------------------------------------ */

.gs-dd { margin-top: 1.15rem; }

.gs-dd__label {
  margin: 0 0 0.4rem;
  font-size: 0.665rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.gs-dd svg { display: block; width: 100%; height: auto; }
.gs-dd__area { fill: var(--down-soft); }
.gs-dd__line { fill: none; stroke: var(--down); stroke-width: 1.2; }

/* ------ Comparison table ------------------------------------------------------------------------------------------------------------------------------------------------------------ */

.gs-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.gs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.gs-table th,
.gs-table td {
  padding: 0.6rem 0.42rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.gs-table th:first-child,
.gs-table td:first-child { padding-left: 0.55rem; }
.gs-table th:last-child,
.gs-table td:last-child { padding-right: 0.55rem; }

.gs-table th {
  font-size: 0.635rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--text-faint);
  border-bottom-color: var(--border-strong);
}

.gs-table tbody tr:last-child td { border-bottom: 0; }

.gs-num { text-align: right; }

.gs-name-short { display: none; }

.gs-table tbody th {
  /* Row labels are data, not headers: sentence case, no tracking. */
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.gs-row--strategy td {
  font-weight: 650;
  color: var(--text);
  background: var(--accent-soft);
}
.gs-row--strategy td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
  color: var(--accent-deep);
}

.gs-cell--up { color: var(--ok-text); }
.gs-cell--down { color: var(--down); }

.gs-cellbar {
  position: relative;
}
.gs-cellbar__track {
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 0.42rem;
  height: 3px;
  border-radius: 2px;
  background: var(--track);
  overflow: hidden;
}
.gs-cellbar__fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--border-strong);
}
.gs-row--strategy .gs-cellbar__fill { background: var(--accent); }

/* ------ Monthly heat map ---------------------------------------------- */

.gs-heatwrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* A real table, so the grid is navigable: 3px spacing plus rounded cells gives
   the mosaic look without losing the semantics. */
.gs-heat {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: auto;
  font-variant-numeric: tabular-nums;
}

.gs-heat__month,
.gs-heat__year,
.gs-heat__corner {
  padding: 0 0 0.2rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: center;
  vertical-align: bottom;
}

.gs-heat__corner,
.gs-heat__year {
  width: 3.1rem;
  text-align: left;
}

.gs-heat__year {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-muted);
}

.gs-heat__month {
  width: 3.15rem;
  min-width: 3.15rem;
}

.gs-heat__cell {
  width: 3.15rem;
  min-width: 3.15rem;
  height: 3.15rem;
  padding: 0;
  border-radius: 6px;
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--surface-sunken);
  transition: box-shadow var(--base) var(--ease);
}
.gs-heat__cell[data-tone="up"] { color: #0B3B21; }
.gs-heat__cell[data-tone="down"] { color: #5C0F0F; }
.gs-heat__cell--empty { background: transparent; }

/* The cell is the target; the button inside it is what makes that target
   reachable by keyboard. It fills the cell so the hit area is the whole cell. */
.gs-heat__btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: filter var(--fast) var(--ease);
}
.gs-heat__btn:hover { filter: brightness(0.94); }
.gs-heat__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* The open month keeps a ring, so the panel below can be attributed to a cell
   without the reader having to remember which one they pressed. */
.gs-heat__cell[data-open="true"] {
  box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px var(--surface);
}
.gs-heat__cell[data-open="true"] .gs-heat__btn { font-weight: 700; }

.gs-heat__hint {
  margin: 0.85rem 0 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-faint);
}

/* ── Month drill-down ──────────────────────────────────────────────────── */
/* An always-present panel collapsed to zero height, rather than a toggled
   `hidden`: the stylesheet's global `[hidden] { display: none !important }`
   would kill the transition, and the grid-rows trick animates real content
   height without hard-coding a max-height that goes stale as rows change. */

.gs-detail {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  transition: grid-template-rows 340ms var(--ease),
              opacity 220ms var(--ease),
              margin-top 340ms var(--ease);
}
.gs-detail[data-open="true"] {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 1.1rem;
}

.gs-detail__inner {
  min-height: 0;
  overflow: hidden;
}

.gs-detail__inner > * + * { margin-top: 0.9rem; }

.gs-detail__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-strong);
}

.gs-detail__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}

.gs-detail__figures {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.05rem;
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.gs-detail__figure strong { color: var(--text); font-weight: 650; }
.gs-detail__figure strong[data-tone="up"] { color: var(--ok-text); }
.gs-detail__figure strong[data-tone="down"] { color: var(--down); }

.gs-detail__close {
  margin-left: auto;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease),
              color var(--fast) var(--ease),
              background var(--fast) var(--ease);
}
.gs-detail__close:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

/* The month ledger ---------------------------------------------------------
   A month's book is dense and numeric, so it is laid out like a ledger rather
   than a list: fixed column widths so the header, every row and the total share
   one grid whatever the numbers are; tabular figures so decimal points stack;
   and one diverging bar per row so the shape of the month is legible before any
   number is read. */

.gs-ledger__caption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.1rem;
  margin: 0;
  font-size: 0.735rem;
  line-height: 1.5;
  color: var(--text-faint);
}
.gs-ledger__period { color: var(--text-muted); font-weight: 500; }
.gs-ledger__period[data-provisional="true"] {
  color: var(--warning, #9a6700);
  font-weight: 700;
}
.gs-ledger__mix { font-variant-numeric: tabular-nums; }

.gs-detail__table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.775rem;
  font-variant-numeric: tabular-nums;
}

.gs-detail__table th,
.gs-detail__table td {
  padding: 0.48rem 0.5rem;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--border-subtle);
}

.gs-detail__table thead th {
  padding-bottom: 0.42rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border-strong);
}
/* The generic `th, td { text-align: left }` above outranks a bare `.gs-num`
   (0,1,1 vs 0,1,0), which left the numeric headers right-aligned over
   left-aligned cells. Both halves are named here so they cannot drift apart. */
.gs-detail__table th.gs-num,
.gs-detail__table td.gs-num { text-align: right; }

.gs-detail__table tbody th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

/* Zebra rows keep the eye on one line across eight columns; the hover wash
   confirms which row the bar belongs to. */
.gs-detail__table tbody tr:nth-child(even) { background: var(--surface-sunken); }
.gs-detail__table tbody tr:hover { background: var(--surface-hover); }

.gs-detail__table tbody tr:last-child th,
.gs-detail__table tbody tr:last-child td { border-bottom: 0; }

.gs-detail__table td[data-col="entry"],
.gs-detail__table td[data-col="exit"] { color: var(--text-muted); font-size: 0.745rem; }

.gs-detail__table td[data-tone="up"] { color: var(--ok-text); }
.gs-detail__table td[data-tone="down"] { color: var(--down); }
.gs-detail__table td[data-col="contrib"] { font-weight: 650; }

/* A de-risked position is carried at a reduced size; the weight alone reads as a
   small bet rather than a deliberate cut, so the cut is flagged. */
.gs-ledger__flag {
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--down-soft);
  border: 1px solid var(--down-ring);
  color: var(--down);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  cursor: help;
}

.gs-detail__table tfoot th,
.gs-detail__table tfoot td {
  padding: 0.62rem 0.5rem 0.06rem;
  border-top: 1px solid var(--border-strong);
  border-bottom: 0;
  font-size: 0.78rem;
  color: var(--text);
}
.gs-detail__table tfoot th {
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.gs-detail__total { font-weight: 700; }
.gs-ledger__muted { color: var(--text-muted); font-weight: 600; }

/* The per-name price disclosure. The ledger has no room for two more numeric
   columns, so the entry and exit prices open underneath the row they belong to. */
.gs-detail__table tbody tr[data-expanded="true"] th,
.gs-detail__table tbody tr[data-expanded="true"] td {
  border-bottom-color: transparent;
  background: var(--surface-hover);
}

.gs-ledger__toggle {
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--fast) var(--ease),
              border-color var(--fast) var(--ease),
              color var(--fast) var(--ease),
              background var(--fast) var(--ease);
}
.gs-ledger__toggle:hover,
.gs-ledger__toggle:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}
.gs-ledger__toggle[aria-expanded="true"] {
  transform: rotate(90deg);
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.gs-ledger__detail > td {
  padding: 0 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-sunken);
}

.gs-ledger__prices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.35rem 1.4rem;
  margin: 0;
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}
.gs-ledger__prices > div { display: flex; flex-direction: column; gap: 0.1rem; }
.gs-ledger__prices dt {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.gs-ledger__prices dd {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.gs-ledger__prices dd span {
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--text-faint);
}

/* The collapsed date line is gone: on a phone the dates live in the caption,
   where they are read once for the whole month. */
.gs-detail__note {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--text-faint);
}

/* ── In-page view switch and the Execute view ──────────────────────────── */
/* Execute is a sub-view, not a third top-level section: the top switch answers
   "which product am I reading?", while Execute is what you do with this one.
   The nested control reuses the top switch's recessed track and raised thumb so
   the two read as the same mechanism at two levels of importance. */

.gs-viewbar {
  display: flex;
  justify-content: center;
  margin-bottom: 1.6rem;
}

.switch--sub {
  width: min(100%, 17rem);
  padding: 3px;
}
.switch--sub .switch__thumb { top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 2); }
.switch--sub .switch__tab { padding: 0.42rem 1rem; font-size: 0.82rem; }
.switch--sub[data-active="execute"] .switch__thumb { transform: translateX(100%); }
/* The sub-switch swaps views rather than navigating, so its state is a pressed
   button, not a page. The same colour, so both levels look alike. */
.switch__tab[aria-pressed="true"] { color: var(--accent-deep); }
.switch:has(.switch__tab:is(:hover, :focus-visible)) .switch__tab[aria-pressed="true"] {
  color: var(--text-muted);
}
.switch:has(.switch__tab:is(:hover, :focus-visible)) .switch__tab:is(:hover, :focus-visible) {
  color: var(--accent-deep);
}
.switch--sub:has(#gs-tab-record:is(:hover, :focus-visible)) .switch__thumb { transform: translateX(0); }
.switch--sub:has(#gs-tab-execute:is(:hover, :focus-visible)) .switch__thumb { transform: translateX(100%); }

/* Swapping the view hides the record. Display, not `hidden`, so the one
   attribute cannot fight the stylesheet's global `[hidden]` rule. */
.gs[data-view="execute"] > section:not(#gs-execute) { display: none; }
.gs[data-view="execute"] > .gs-execute { margin-top: 0; }

.gs-exec__form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem 1.4rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.gs-exec__field { display: flex; flex-direction: column; gap: 0.3rem; }
.gs-exec__label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.gs-exec__inputwrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.7rem;
  background: var(--field-top);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-field);
}
.gs-exec__inputwrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.gs-exec__rupee { color: var(--text-muted); font-size: 0.9rem; }
.gs-exec__input {
  width: 9ch;
  border: 0;
  background: none;
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.gs-exec__input:focus { outline: none; }

.gs-exec__basis { margin: 0 0 0.15rem; font-size: 0.75rem; color: var(--text-faint); }

.gs-exec__totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 1.1rem 0 1.4rem;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.gs-exec__totals > div { padding: 0.7rem 0.8rem; background: var(--surface); }
.gs-exec__totals dt {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.gs-exec__totals dd {
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.gs-exec__section-note {
  margin: -0.55rem 0 0.8rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-faint);
}
.gs-exec__table { font-size: 0.8rem; }
.gs-exec__shares { font-weight: 700; }
.gs-exec__new {
  padding: 0.05rem 0.32rem;
  border-radius: 9999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  vertical-align: middle;
}
.gs-exec__action {
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.06em;
}
.gs-exec__action[data-action="BUY"],
.gs-exec__action[data-action="RESTORE"] { color: var(--ok-text); }
.gs-exec__action[data-action="SELL"],
.gs-exec__action[data-action="TRIM"] { color: var(--down); }
.gs-exec__action[data-action="HOLD"] { color: var(--text-faint); }
.gs-exec__buy-note { color: var(--ok-text); font-weight: 600; }
.gs-exec__sell-note { color: var(--down); font-weight: 600; }
.gs-exec__empty {
  margin: 0.5rem 0 1.1rem;
  font-size: 0.78rem;
  color: var(--text-faint);
}

@media (max-width: 34rem) {
  .gs-exec__totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gs-exec__input { width: 7ch; }
}

/* ── Members-only gate ─────────────────────────────────────────────────── */

.gs-gate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 1.6rem 1.6rem 1.5rem;
  background: linear-gradient(180deg, var(--surface-top), var(--surface-bottom));
}

.gs-gate__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--text);
}

.gs-gate__body {
  margin: 0;
  max-width: 46ch;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.gs-gate__cta {
  margin-top: 0.35rem;
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, var(--accent), var(--accent-deep));
  color: var(--on-accent);
  font-size: 0.85rem;
  font-weight: 600;
  transition: filter var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.gs-gate__cta:hover { filter: brightness(1.08); transform: translateY(-1px); }

.gs-gate__note {
  margin: 0.3rem 0 0;
  font-size: 0.72rem;
  color: var(--text-faint);
}

/* ------ Figures and lists --------------------------------------------------------------------------------------------------------------------------------------------------------- */

.gs-figures {
  display: grid;
  /* Four across by two down, matching the KPI ribbon above so the page has one
     grid rhythm rather than two. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 1.4rem;
  padding: 0;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.gs-figures > div {
  padding: 0.8rem 0.9rem;
  background: var(--surface);
}
.gs-figures dt {
  font-size: 0.655rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.gs-figures dd {
  margin: 0.3rem 0 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.gs-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
}

.gs-mini-title {
  margin: 0 0 0.6rem;
  font-size: 0.665rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.gs-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}
.gs-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.79rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.gs-list__sym {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--text);
}
.gs-list__months {
  font-size: 0.68rem;
  color: var(--text-faint);
}
.gs-list__val { font-weight: 650; }
.gs-list__val[data-tone="up"] { color: var(--ok-text); }
.gs-list__val[data-tone="down"] { color: var(--down); }

/* ------ Methodology --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

.gs-section { margin-top: 2.4rem; }

.gs-section__title {
  margin: 0 0 1.2rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.gs-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
}

.gs-step {
  position: relative;
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  column-gap: 0.35rem;
  padding: 1.15rem 0 1.25rem;
  border-top: 1px solid var(--border-strong);
}
.gs-step::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 2.4rem;
  height: 1px;
  background: var(--accent);
}

.gs-step__num {
  grid-column: 1;
  grid-row: 1 / span 2;
  padding-top: 0.1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.gs-step__title {
  grid-column: 2;
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--text);
}

.gs-step p {
  grid-column: 2;
  margin: 0;
  max-width: 62ch;
  font-size: 0.845rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.gs-step em { font-style: italic; color: var(--text); }

/* ------ Fact sheet ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ */

.gs-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.8rem;
  margin: 0;
}
.gs-facts > div {
  display: grid;
  grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.62rem 0;
  border-bottom: 1px solid var(--border);
}
.gs-facts dt {
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--text-faint);
}
.gs-facts dd {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* ------ Risks --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

.gs-risks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.gs-risk {
  position: relative;
  padding: 1.25rem 1.3rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
/* A warm left rail rather than a red alert: these are facts about the product,
   not a warning dialog. */
.gs-risk::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.3rem;
  bottom: 1.3rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--warn-border), var(--accent));
}

.gs-risk__title {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--text);
}
.gs-risk__mark {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.gs-risk p {
  margin: 0 0 0.7rem;
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.gs-risk p:last-child { margin-bottom: 0; }
.gs-risk strong { color: var(--text); font-weight: 650; }

.gs-caveat {
  margin-top: 1rem;
  padding: 1.2rem 1.35rem;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-lg);
  background: var(--warn-bg);
}

.gs-caveat__title {
  margin: 0 0 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warn-text);
}

.gs-caveat ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}
.gs-caveat li {
  position: relative;
  padding-left: 1.05rem;
  font-size: 0.8rem;
  line-height: 1.58;
  color: var(--warn-text);
}
.gs-caveat li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.5rem;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.gs-caveat strong { font-weight: 700; }

/* ------ Small screens --------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

@media (max-width: 46rem) {
  .gs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gs-kpi:nth-child(4n) { border-right: 1px solid var(--border); }
  .gs-kpi:nth-child(2n) { border-right: 0; }
  .gs-kpi:nth-last-child(-n + 4) { border-bottom: 1px solid var(--border); }
  .gs-kpi:nth-last-child(-n + 2) { border-bottom: 0; }

  .gs-risks,
  .gs-split,
  .gs-facts { grid-template-columns: 1fr; }

  .gs-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .gs-facts > div { grid-template-columns: minmax(0, 8rem) minmax(0, 1fr); }
}

@media (max-width: 34rem) {
  .gs-card { padding: 1.15rem 1.05rem 1.05rem; }
  .gs-kpi { padding: 0.9rem 0.95rem 0.95rem; }
  .gs-kpi__value { font-size: 1.32rem; }
  .gs-step { grid-template-columns: 1.9rem minmax(0, 1fr); }
  .gs-heat { border-spacing: 2px; }
  .gs-heat__cell {
    width: 2.8rem;
    min-width: 2.8rem;
    height: 2.8rem;
    font-size: 0.64rem;
    border-radius: 4px;
  }
  .gs-heat__month {
    width: 2.8rem;
    min-width: 2.8rem;
  }

  /* Eight columns cannot fit a phone. Total, CAGR and max drawdown are the
     three a reader acts on; the rest are on a wider screen, and the note below
     the table says so rather than letting the columns vanish silently. */
  .gs-table th:nth-child(4),
  .gs-table td:nth-child(4),
  .gs-table th:nth-child(5),
  .gs-table td:nth-child(5),
  .gs-table th:nth-child(7),
  .gs-table td:nth-child(7),
  .gs-table th:nth-child(8),
  .gs-table td:nth-child(8) {
    display: none;
  }
  .gs-table { font-size: 0.76rem; }
  .gs-table th,
  .gs-table td { padding-left: 0.3rem; padding-right: 0.3rem; }
  .gs-name-full { display: none; }
  .gs-name-short { display: inline; }
  .gs-table-more { display: block; }

  /* The ledger keeps every figure by folding each row into two lines: name,
     weight and the price disclosure, then return and contribution. A table that
     scrolls sideways inside an expanding panel hides the very column the reader
     just asked to see. */
  .gs-detail__table,
  .gs-detail__table tbody,
  .gs-detail__table tfoot { display: block; }

  .gs-detail__table thead,
  .gs-detail__table colgroup { display: none; }

  .gs-detail__table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 1.7rem;
    grid-template-areas:
      "name weight toggle"
      "ret contrib toggle";
    align-items: baseline;
    gap: 0.12rem 0.7rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  .gs-detail__table tbody tr:nth-child(even) { background: none; }
  .gs-detail__table tbody tr:last-child { border-bottom: 0; }

  .gs-detail__table tbody th,
  .gs-detail__table tbody td {
    padding: 0;
    border: 0;
    white-space: normal;
    overflow: visible;
  }
  .gs-detail__table tbody th { grid-area: name; font-size: 0.8rem; }
  .gs-detail__table [data-col="weight"] {
    grid-area: weight;
    text-align: right;
    font-weight: 600;
  }
  .gs-detail__table [data-col="entry"],
  .gs-detail__table [data-col="exit"] { display: none; }
  .gs-detail__table [data-col="toggle"] {
    grid-area: toggle;
    align-self: center;
  }
  .gs-detail__table [data-col="ret"] {
    grid-area: ret;
    text-align: left;
    font-size: 0.75rem;
  }
  .gs-detail__table [data-col="contrib"] {
    grid-area: contrib;
    text-align: right;
    font-size: 0.82rem;
  }
  .gs-detail__table tbody td[data-label]::before {
    content: attr(data-label) " ";
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-faint);
  }

  .gs-detail__table tfoot tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name weight"
      "ret contrib";
    align-items: baseline;
    gap: 0.12rem 0.7rem;
    padding-top: 0.62rem;
    border-top: 1px solid var(--border-strong);
  }
  .gs-detail__table tfoot th,
  .gs-detail__table tfoot td {
    padding: 0;
    border: 0;
  }
  .gs-detail__table tfoot th { grid-area: name; }
  .gs-detail__table tfoot [data-col="weight"] { grid-area: weight; text-align: right; }
  .gs-detail__table tfoot [data-col="ret"] { grid-area: ret; text-align: left; font-size: 0.75rem; }
  .gs-detail__table tfoot [data-col="contrib"] { grid-area: contrib; text-align: right; font-size: 0.9rem; }
  .gs-detail__table tfoot [data-col="entry"],
  .gs-detail__table tfoot [data-col="exit"],
  .gs-detail__table tfoot [data-col="toggle"] { display: none; }

  /* The price disclosure spans the whole width, so it has to leave the grid. */
  .gs-detail__table tbody tr.gs-ledger__detail {
    display: block;
    padding: 0;
    border-bottom: 0;
  }
  .gs-detail__table tbody tr.gs-ledger__detail > td {
    display: block;
    padding: 0 0 0.6rem;
  }
  .gs-ledger__prices { grid-template-columns: 1fr 1fr; padding: 0.55rem 0.6rem; }

  .gs-heat__month { font-size: 0.55rem; letter-spacing: 0.02em; }
}
