/* GBS-20: category colour, navy headings and turquoise controls on the homepage. */
.atlas-home {
  --home-navy: #103247; --home-heading: #103247; --home-accent: #8ddfd3;
  --home-tint: #edf5f7; --home-fish: #1976a9; --home-crust: #64b5da;
  --home-poultry: #e79b28; --home-mammals: #b94c32; --home-insects: #9476b8;
  --home-caught: #13786d; --home-wild: #18835d; --home-other: #98a6ae;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .atlas-home { --home-heading: #dbedf5; --home-tint: #1c3037; }
}
:root[data-theme="dark"] .atlas-home { --home-heading: #dbedf5; --home-tint: #1c3037; }
.atlas-home :is(.home-intro h1, .home-insight-takeaway, .home-about h2, .home-about h3) { color: var(--home-heading); }

.atlas-home { background: var(--surface); }
.atlas-home .wrap { max-width: 1360px; }
.atlas-home .home-intro { padding: 30px 0 0; }
.atlas-home .home-intro > .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.atlas-home .home-intro > .wrap > div { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.atlas-home .home-intro h1 { font: 650 1.3rem/1.3 var(--font-sans); letter-spacing: 0; }
.atlas-home .home-intro p { margin: 6px 0 0; font-size: .88rem; color: var(--muted); }
.atlas-home .home-primary { border-radius: 2px; min-height: 44px; padding: 9px 15px; background: var(--home-accent); color: var(--home-navy); border: 1px solid transparent; font-weight: 600; text-decoration: none; }
.atlas-home .home-primary:hover { opacity: .85; }
.atlas-home #insights { padding: 0; }
.atlas-home .home-insight-card { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); grid-template-areas: "title chart" "lead chart" "action chart" "details chart"; align-content: start; align-items: start; gap: 16px 56px; padding: 56px 0; margin: 0; border: 0; border-bottom: 1px solid var(--border-strong); border-radius: 0; background: none; }
.atlas-home .home-insight-takeaway { grid-area: title; font: 750 clamp(1.8rem, 2.8vw, 2.5rem)/1.14 var(--font-sans); letter-spacing: -.025em; margin: 0; overflow-wrap: break-word; }
.atlas-home .home-insight-takeaway::before { content: ""; display: block; width: 46px; height: 4px; background: var(--home-accent); margin-bottom: 22px; }
.atlas-home .insight-asset { grid-area: chart; padding-top: 4px; }
.atlas-home .home-insight-lead { grid-area: lead; margin: 0; font-size: 1rem; color: var(--ink-2); line-height: 1.6; }
.atlas-home .home-insight-explore { grid-area: action; margin: 3px 0 0; }
.atlas-home .home-insight-explore a { display: inline-flex; align-items: center; }
.atlas-home .home-insight-details { grid-area: details; margin: 0; min-width: 0; }
.atlas-home .home-insight-details > summary { min-height: 44px; font-size: .88rem; color: var(--ink-2); }
.atlas-home .home-insight-details .insight-text { font-size: .92rem; }
.atlas-home .insight-cap { font-size: 1rem; font-weight: 650; color: var(--ink); margin: 0 0 20px; }
.atlas-home .log-rows { font-size: .93rem; gap: 15px; }
.atlas-home .lr-row { min-height: 38px; }
.atlas-home .lr-axis { min-height: 20px; }
.atlas-home .lr-name, .atlas-home .lr-val { color: var(--ink); }
.atlas-home .lr-band { background: var(--row-colour, var(--ink-2)); opacity: 1; height: 6px; }
.atlas-home .lr-dot { background: var(--row-colour, var(--ink)); width: 12px; height: 12px; outline: 2px solid var(--surface); }
.atlas-home .lr-row.hl .lr-band { opacity: 1; }
.atlas-home .insight-key { margin-top: 20px; }
.atlas-home .home-chart-note { font-size: .85rem; color: var(--ink-2); margin: 14px 0 0; }
.atlas-home .ins-bars { gap: 12px; }
.atlas-home .ins-bars li { font-size: .95rem; }
.atlas-home .ib-name { color: var(--ink); }
.atlas-home .ib-track { height: 18px; }
.atlas-home .ib-bar { border-radius: 0; }
.atlas-home .home-about { padding: 44px 0 50px; background: var(--home-tint); }
.atlas-home .home-about h2 { font: 700 1.4rem/1.3 var(--font-sans); margin-bottom: 24px; }
.atlas-home .home-about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; }
.atlas-home .home-about h3 { margin-bottom: 8px; }
.atlas-home .home-about p { color: var(--ink-2); font-size: .93rem; margin: 0; }
@media (max-width: 950px) {
  .atlas-home .home-insight-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "chart" "lead" "action" "details"; gap: 20px; padding: 36px 0; }
  .atlas-home .home-insight-takeaway { max-width: 25ch; }
  .atlas-home .home-insight-takeaway::before { margin-bottom: 16px; }
  .atlas-home .home-insight-lead { max-width: 65ch; }
  .atlas-home .insight-cap { margin-bottom: 16px; }
}
@media (max-width: 600px) {
  .atlas-home .home-intro { padding-top: 22px; }
  .atlas-home .home-intro > .wrap { align-items: flex-start; flex-direction: column; gap: 12px; }
  .atlas-home .home-intro > .wrap > a { display: none; } /* Explorer stays in Menu and each finding. */
  .atlas-home .home-insight-takeaway { font-size: 1.9rem; }
  .atlas-home .home-about-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
@media (min-width: 951px) and (max-width: 1150px) {
  .atlas-home .home-insight-card { gap: 16px 30px; }
}
@media print {
  :root .atlas-home { --home-heading: #103247 !important; --home-tint: #edf5f7 !important; --ink-2: #52514e; }
  .atlas-home .home-insight-card { display: block; break-inside: avoid; }
  .atlas-home .home-insight-takeaway, .atlas-home .insight-asset { margin-bottom: 20px; }
}
@media (min-width: 951px) { .atlas-home .home-insight-card { grid-template-rows: auto auto auto 1fr; } }

/* GBS-19: one direct comparison leads; the wild-family detail stays close to it. */
.atlas-home .home-ratio { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 0 0 28px; }
.atlas-home .home-ratio strong { color: var(--home-heading); font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.1; letter-spacing: -.04em; overflow-wrap: anywhere; }
.atlas-home .home-ratio span { color: var(--ink-2); font-size: .9rem; }
.atlas-home .home-wild-comparison > .log-rows { gap: 24px; }
.atlas-home .home-wild-breakdown { margin: 16px 0 0; }
.atlas-home .home-wild-breakdown > summary { min-height: 44px; font-weight: 600; }
.atlas-home .home-wild-breakdown .log-rows { padding-top: 12px; }

.atlas-home .home-extra-note { font-size: .85rem; color: var(--ink-2); margin: 12px 0; }
.atlas-home .home-funding-asset { container: funding / inline-size; }
.atlas-home .home-funding-chart { --funding-columns: minmax(0, 10rem) minmax(0, 1fr) minmax(0, 5rem); }
.atlas-home .home-funding-row, .atlas-home .home-funding-axis { display: grid; align-items: center; grid-template-columns: var(--funding-columns); gap: 12px; }
.atlas-home .home-funding-row { width: 100%; min-height: 52px; padding: 7px 0; border: 0; background: transparent; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.atlas-home .home-funding-name { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.atlas-home .home-funding-name::before { content: ""; background: var(--row-colour); border-radius: 50%; width: 10px; height: 10px; flex: none; }
.atlas-home .home-funding-row[aria-pressed="true"] .home-funding-name,
.atlas-home .home-funding-row:hover .home-funding-name { text-decoration: underline; text-underline-offset: 3px; }
.atlas-home .home-funding-row[aria-pressed="true"] .home-funding-name { font-weight: 650; }
.atlas-home .home-funding-track { display: block; position: relative; height: 26px; margin-inline: 6px; }
.atlas-home .home-funding-axis .home-funding-track { grid-column: 2; }
.atlas-home .home-funding-tick { position: absolute; transform: translateX(-50%); font-size: .8rem; white-space: nowrap; color: var(--ink-2); }
.atlas-home .home-funding-tick.first { transform: none; }
.atlas-home .home-funding-tick.last { transform: translateX(-100%); }
.atlas-home .home-funding-value { font-size: .92rem; font-variant-numeric: tabular-nums; text-align: right; }
.atlas-home .home-funding-gridline { position: absolute; inset-block: 0; border-left: 1px solid var(--grid); }
.atlas-home .home-funding-dot { position: absolute; top: 7px; width: 12px; height: 12px; transform: translateX(-50%); background: var(--row-colour); border-radius: 50%; }
.atlas-home .home-funding-detail { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; padding: 12px 16px; margin-top: 12px; background: var(--home-tint); color: var(--home-heading); font-size: .92rem; }
@container funding (width < 34rem) {
  .atlas-home .home-funding-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; }
  .atlas-home .home-funding-row .home-funding-track { grid-column: 1 / -1; grid-row: 2; }
  .atlas-home .home-funding-value { grid-column: 2; grid-row: 1; }
  .atlas-home .home-funding-axis { display: block; }
  .atlas-home .home-funding-detail strong { flex-basis: 100%; }
}
@container funding (width < 15rem) {
  .atlas-home .home-funding-tick:not(.first):not(.last) { display: none; }
  .atlas-home .home-funding-name { overflow-wrap: anywhere; }
  .atlas-home .home-funding-detail { padding: 8px 0; overflow-wrap: anywhere; }
}
.atlas-home .home-growth-svg { display: block; width: 100%; height: auto; }
.atlas-home .home-growth-key { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; }
.atlas-home .home-growth-key > svg { flex: none; }
.atlas-home .home-growth-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; }


.atlas-home .home-assumption-missing { font-size: .85rem; font-weight: 600; border-left: 3px solid var(--ink); padding-left: 10px; margin: 12px 0; }

/* One full-width share bar per weighting, with named categories and scope controls. */
.atlas-home .home-stack-controls { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 20px; }
.atlas-home .home-stack-controls button { min-height: 44px; padding: 9px 16px; border: 1px solid var(--border-strong); color: var(--home-heading); background: var(--surface); font: 600 .9rem/1.3 var(--font-sans); }
.atlas-home .home-stack-controls button[aria-pressed="true"] { background: var(--home-accent); color: var(--home-navy); border-color: var(--home-accent); }
.atlas-home .home-stack-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0 0 24px; font-size: .8rem; }
.atlas-home .home-stack-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.atlas-home .home-stack-swatch { width: 12px; height: 12px; flex: none; }
.atlas-home .home-stack-row { margin: 0 0 24px; min-width: 0; }
.atlas-home .home-stack-row-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 8px; }
.atlas-home .home-stack-row-head h3 { font: 650 1rem/1.4 var(--font-sans); margin: 0; color: var(--home-heading); }
.atlas-home .home-assumption-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .82rem; }
.atlas-home .home-stack-bar { display: flex; width: 100%; height: 44px; gap: 0; min-width: 0; }
.atlas-home .home-stack-segment { display: flex; align-items: center; justify-content: center; border: 0; border-right: 1px solid var(--surface); border-radius: 0; padding: 0; min-width: 0; height: 44px; font: 650 .82rem/1 var(--font-sans); overflow: hidden; flex-shrink: 0; container: share-segment / inline-size; }
.atlas-home .home-stack-segment:last-child { border-right: 0; }
.atlas-home .home-stack-segment:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; position: relative; z-index: 1; }
.atlas-home .home-stack-segment-label { white-space: nowrap; overflow: hidden; }
.atlas-home .home-stack-empty { background: var(--home-tint); border: 1px dashed var(--border-strong); padding: 12px; font-size: .9rem; }
.atlas-home .home-stack-note { font-size: .85rem; color: var(--ink-2); margin: 8px 0 0; }
@container share-segment (width < 3.4em) {
  .atlas-home .home-stack-segment-label { visibility: hidden; }
}

.atlas-home .home-assumptions-asset { container-type: inline-size; }

/* Each ranking needs enough room for its place names and values at the reader's text size. */
.home-country-comparison { min-width: 0; overflow-wrap: anywhere; }
.home-country-rankings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1.5rem 2rem; }
.home-country-ranking h3 { margin: 0; font: 650 1.12rem/1.35 var(--font-sans); color: var(--home-heading); }
.home-country-unit { margin: .25rem 0 .75rem; font-size: .85rem; color: var(--ink-2); }
.home-country-ranking ol { margin: 0; padding-inline-start: 1.6em; font-variant-numeric: tabular-nums; }
.home-country-ranking li { padding: .6rem 0; border-top: 1px solid var(--border); }
.home-country-ranking li::marker { color: var(--ink-2); font-size: .85em; }
.home-country-row { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .15em .6em; overflow-wrap: anywhere; }
.home-country-value { font-weight: 600; }
.home-country-share { color: var(--ink-2); font-weight: 400; }
.home-country-rankings + figure { margin-top: 1.25rem; }
.home-country-table table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.home-country-table caption { padding-block: .5rem; text-align: start; font-weight: 600; }
.home-country-table :is(th, td) { border-bottom: 1px solid var(--border); padding: .5em; text-align: end; overflow-wrap: normal; }
.home-country-table th:first-child { text-align: start; }
