/* ============================================================
   Note pages: a single long article on the site's light theme.
   ============================================================ */

.note {                     /* top and bottom only: the sides keep the container's gutter */
    padding-top: 2.5rem;
    padding-bottom: 1rem;
}
.note__kicker {
    margin: 0 0 0.4rem;
    color: var(--color-faint);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}
.note__title {
    margin: 0 0 0.6rem;
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.note__dek {
    margin: 0 0 1.25rem;
    color: var(--color-muted);
    font-size: 1.1rem;
    line-height: 1.5;
}
.note__meta {
    margin: 0 0 2rem;
    color: var(--color-faint);
    font-size: 0.85rem;
}
.note h2 {
    margin: 2.75rem 0 0.75rem;
    font-size: 1.35rem;
    line-height: 1.3;
}
.note h3 {
    margin: 2rem 0 0.5rem;
    font-size: 1.05rem;
}
.note p, .note li { margin: 0 0 1rem; }
.note ul, .note ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.note code {
    font-family: var(--font-mono);
    font-size: 0.86em;
    background: var(--color-chip-bg);
    padding: 0.05em 0.3em;
    border-radius: 3px;
}


/* ---------- Figures ---------- */

.fig {
    margin: 1.5rem 0 2rem;
}
.fig__frame {
    border: 1px solid var(--color-rule);
    border-radius: var(--radius);
    background: var(--color-surface);
    padding: 0.9rem 1rem 0.75rem;
}
.fig__title {
    margin: 0 0 0.15rem;
    font-size: 0.95rem;
    font-weight: 600;
}
.fig__sub {
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    color: var(--color-muted);
}
.fig figcaption {
    margin-top: 0.55rem;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--color-muted);
}
.fig table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}
.fig th, .fig td {
    padding: 0.3rem 0.4rem;
    border-bottom: 1px solid var(--color-rule);
    text-align: right;
}
.fig th:first-child, .fig td:first-child { text-align: left; }
.fig details { margin-top: 0.6rem; font-size: 0.85rem; }
.fig summary { cursor: pointer; color: var(--color-muted); }

/* ---------- Tooltip and legend, shared by every figure ---------- */

.swatch {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 2px;
}
.viewer__tip {
    position: absolute;
    pointer-events: none;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--color-rule);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--color-text);
    white-space: nowrap;
}
.viewer__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1rem;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--color-muted);
}
.viewer__legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.key-line { display: inline-block; width: 1.1rem; height: 0; border-top: 2px solid; }
.key-dash { display: inline-block; width: 1.1rem; height: 0; border-top: 1px dashed var(--color-text); }
.key-vdash { display: inline-block; width: 0; height: 0.8rem; margin: 0 0.5rem; border-left: 1px dashed var(--color-muted); }

/* ---------- Bars (horizontal, value at the end) ---------- */

.bars { width: 100%; }
.bars svg { display: block; width: 100%; height: auto; }
.bars text { font-family: var(--font-sans); font-size: 12px; fill: var(--color-text); }
.bars .muted { fill: var(--color-muted); }

@media (max-width: 600px) {
    .note__title { font-size: 1.6rem; }
}

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

.fig .text-table th, .fig .text-table td { text-align: left; vertical-align: top; }

/* wide tables scroll inside their frame instead of widening the page */
.fig table { display: block; overflow-x: auto; }

/* ---------- Forecast plots ---------- */

.fc__bar { margin-bottom: 0.55rem; }
.fc__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    align-items: center;
}
.fc__row + .fc__row { margin-top: 0.4rem; }
.fc__group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}
.fc__foot { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: flex-start; margin-top: 0.4rem; }
.fc__foot .viewer__legend { flex: 1 1 18rem; margin-top: 0.15rem; }
.fc__group--series { margin-left: auto; }
.fc__group--series:empty { display: none; }
.fc__label { font-size: 0.78rem; color: var(--color-muted); margin-right: 0.1rem; }
.fc__task { margin: 0 !important; font-size: 0.95rem; font-weight: 600; }
.fc .chip, .fc .chip:hover { border: 0; font-family: inherit; cursor: pointer; }
.fc .chip:disabled { opacity: 0.4; cursor: default; }
.fc .chip:disabled:hover { background: var(--color-chip-bg); color: var(--color-muted); }
.fc .chip--on, .fc .chip--on:hover { background: var(--color-text); color: #fff; }
.fc__plot svg, .fc__cov svg, .mini__plot svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.fc__plot text, .fc__cov text { font-family: var(--font-sans); font-size: 12px; fill: var(--color-text); }
.fc__plot .muted, .fc__cov .muted { fill: var(--color-muted); }
.fc__cov { margin-top: 0.9rem; }
.fc__cov p { margin: 0 0 0.25rem !important; font-size: 0.8rem; color: var(--color-muted); }
.fc__sum { margin: 0.5rem 0 0; font-size: 0.82rem; line-height: 1.45; color: var(--color-muted); }
.findings li { margin-bottom: 0.55rem; }
.findings b { font-weight: 600; }
.note details.method { margin: 2.5rem 0 1rem; }
.note details.method summary { cursor: pointer; font-weight: 600; margin-bottom: 0.75rem; }
.note details.method li { font-size: 0.92rem; color: var(--color-muted); }
.fc__sum b { color: var(--color-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.key-model { position: relative; display: inline-block; width: 1.1rem; height: 0.7rem; }
.key-model::before {
    content: ''; position: absolute; inset: 0;
    background: var(--c); opacity: 0.22; border-radius: 2px;
}
.key-model::after {
    content: ''; position: absolute; left: 0; right: 0; top: 50%;
    height: 2px; margin-top: -1px; background: var(--c);
}
.viewer__tip .swatch { vertical-align: -1px; }

/* ---------- Cards: the seven findings, the oracle, every task ---------- */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 0.75rem;
    margin: 0 0 2.25rem;
}
.cards--two { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 1.25rem; }
.card, .card:hover {
    display: block;
    padding: 0.65rem 0.75rem 0.7rem;
    border: 1px solid var(--color-rule);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    text-align: left;
}
a.card:hover, button.card:hover { border-color: var(--color-accent); }
button.card { cursor: pointer; width: 100%; }
.card--on, .card--on:hover { border-color: var(--color-text); }
.card__title { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; font-weight: 600; line-height: 1.3; }
.card__text { display: block; margin-top: 0.4rem; font-size: 0.8rem; line-height: 1.45; color: var(--color-muted); }
.mini__plot { display: block; }
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0 2rem;
}
.gallery .card { padding: 0.45rem 0.5rem 0.5rem; }
.gallery .card__title { font-size: 0.78rem; font-weight: 500; margin-bottom: 0.25rem; }
.gallery__group {
    grid-column: 1 / -1;
    margin: 0.6rem 0 0 !important;
    font-size: 0.85rem;
    font-weight: 600;
}
.gallery__group:first-child { margin-top: 0 !important; }
.card__nums {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
}
.card__nums span { display: inline-flex; align-items: center; gap: 0.25rem; }
.cards__lede { margin: 0 0 0.4rem !important; font-size: 0.9rem; color: var(--color-muted); }
.cards__legend { margin: 0 0 0.75rem; }
.cards__legend + .gallery { margin-top: 0.5rem; }

@media (max-width: 600px) {
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fc .chip { font-size: 0.78rem; padding: 0.4rem 0.6rem; line-height: 1.2; min-width: 2rem; justify-content: center; }
    .fc__group { gap: 0.4rem; }
    .fig__frame { padding: 0.75rem 0.7rem 0.65rem; }
}

/* the seven cards keep their plots on one line when a title wraps */
@media (min-width: 640px) {
    .cards:not(.cards--two) .card__title { min-height: 2.6em; }
}
.fc__table { border-collapse: collapse; margin: 0.25rem 0 0.35rem; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.fc__table th { font-weight: 500; color: var(--color-muted); text-align: right; padding: 0.15rem 0.6rem; line-height: 1.25; vertical-align: bottom; }
.fc__table td { text-align: right; padding: 0.15rem 0.6rem; color: var(--color-text); border-top: 1px solid #ececea; white-space: nowrap; }
.fc__table td:first-child, .fc__table th:first-child { text-align: left; padding-left: 0; }
.fc__table .swatch { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 2px; margin-right: 0.4rem; vertical-align: baseline; }
.fc__sum { overflow-x: auto; }
.fc__note { display: block; font-size: 0.75rem; }
.fc__table .fc__group-h { text-align: center; border-bottom: 1px solid #ececea; }
@media (max-width: 560px) {
    .fc__table { font-size: 0.7rem; }
    .fc__table th, .fc__table td { padding: 0.15rem 0.25rem; }
    .fc__table td:first-child { white-space: normal; min-width: 6.5rem; }
}

/* ---------- In short: the message of the note, before the cards ---------- */

.tldr {
    margin: 0 0 2rem;
    padding: 0.85rem 1.1rem 0.35rem;
    border: 1px solid var(--color-rule);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius);
    background: var(--color-surface);
}
.note .tldr__title { margin: 0 0 0.45rem; font-weight: 600; }
.note .tldr ul { margin: 0 0 0.5rem; padding-left: 1.1rem; }
.note .tldr li { margin: 0 0 0.5rem; line-height: 1.5; }
.fig details { overflow-x: auto; }

/* ---------- fm-augmenters: additions ---------- */
.fig__frame > .fc.fc__bar { margin: 0.5rem 0 0.4rem; }   /* chip rows above a bar figure, not the series plots */
.note h2, .note h3 { scroll-margin-top: 4rem; }        /* card links land below the sticky topnav, invisible otherwise */
.fig td + td { white-space: nowrap; }                  /* a number never breaks over lines, the table scrolls instead */
.fig details td:first-child { min-width: 9rem; }       /* and a row label of a figure table keeps two lines on a phone */
.gallery .card__title { min-height: 2.6em; }           /* two title lines, so the plots of a row start level */
