/* ---------------------------------------------------------------------------
   NSD home page chart bands (1 Oct 2026). Everything else on the page keeps
   the shared styles.css (section 16). No card boxes: charts sit on full-width
   background bands. Colours: blue / orange / green lead, as in the agreed
   reference, with teal, purple and pink for variety.
   --------------------------------------------------------------------------- */

.nh-numbers { margin: 0 -38px; border-bottom: 1px solid var(--nsd-border, #d9e4de); }
.nh-numbers-after { margin-top: 34px; border-top: 1px solid var(--nsd-border, #d9e4de); }
.nh-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; padding: 36px 38px; }
.nh-band-wide { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; }
.nh-band-single, .nh-band-stack { grid-template-columns: minmax(0, 1fr); gap: 0; }
.nh-band-tint { background: linear-gradient(180deg, #f3f6fb 0%, #f8fafc 100%); }
.nh-col { min-width: 0; }

.nh-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.nh-title { margin: 0 0 18px; }
.nh-chart-title { margin: 0 0 4px; font-family: Georgia, "Times New Roman", serif; font-size: 20px; color: var(--nsd-green-dark, #025f30); }
.nh-note { margin: 0 0 18px; font-size: 13px; color: #6b7a83; }
.nh-note strong { color: #111827; font-size: 15px; }
.nh-note-under { margin: 14px 0 0; }
.nh-empty { color: var(--nsd-muted, #5c6870); margin: 0; }
.nh-more { font-weight: 700; white-space: nowrap; }

/* Hatched track used by bars and pills */
.nh-bar-track, .nh-pill-track {
    background: repeating-linear-gradient(135deg, #e3e8ee 0 2.5px, #f3f5f8 2.5px 7px); }

/* Horizontal bars */
.nh-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.nh-bars li { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr) 62px; align-items: center; gap: 12px; font-size: 14px; }
.nh-bar-label { color: #273142; line-height: 1.3; overflow-wrap: anywhere; }
.nh-bar-track { height: 16px; border-radius: 999px; overflow: hidden; }
.nh-bar-track i { display: block; height: 100%; width: var(--w); border-radius: 999px; transition: width .9s cubic-bezier(.2,.7,.2,1);
                  box-shadow: inset 0 -3px 6px rgba(0,0,0,.08); }
.nh-bars.will-grow .nh-bar-track i { width: 0; }
.nh-bars.will-grow.is-in .nh-bar-track i { width: var(--w); }
.nh-bars strong { text-align: right; font-variant-numeric: tabular-nums; color: #111827; }
.nh-twocol .nh-bars { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 56px; }

/* Tick ring (overseas countries) */
.nh-tickring { display: flex; align-items: center; gap: 24px; }
.nh-tickring svg { flex: 0 0 210px; width: 210px; height: 210px; }
.nh-tickring line { transition: opacity .35s ease; transition-delay: var(--d); }
.nh-tickring.will-grow line { opacity: 0; }
.nh-tickring.will-grow.is-in line { opacity: 1; }
.nh-ticklegend { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; min-width: 0; }
.nh-ticklegend li { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nh-ticklegend strong { font-size: 20px; color: #111827; font-variant-numeric: tabular-nums; }
.nh-ticklegend span { font-size: 13px; color: #4b5563; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nh-ticklegend i { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }

.nh-svg-v { font-size: 30px; font-weight: 800; fill: #111827; font-family: inherit; }
.nh-svg-sm { font-size: 22px; }
.nh-svg-c { font-size: 12px; fill: #6b7280; font-family: inherit; }

/* At a glance: figures over one segmented line with round markers */
.nh-glance-figs { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.nh-glance-figs div { padding: 0 18px; border-left: 1px solid #dfe5ec; }
.nh-glance-figs div:first-child { padding-left: 0; border-left: 0; }
.nh-glance-figs span { display: block; font-size: 13px; color: #6b7280; margin-bottom: 6px; }
.nh-glance-figs strong { font-size: 34px; font-weight: 800; color: #111827; font-variant-numeric: tabular-nums; line-height: 1.05; }
.nh-glance-line { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); margin-top: 18px; height: 14px; }
.nh-glance-line span { position: relative; background: var(--c); height: 6px; align-self: center; transform-origin: left; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.nh-glance-line span:first-child { border-radius: 999px 0 0 999px; }
.nh-glance-line span:last-child { border-radius: 0 999px 999px 0; }
.nh-glance-line b { position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%;
                    background: #fff; border: 3px solid var(--c); box-shadow: 0 2px 6px rgba(0,0,0,.15); z-index: 1; box-sizing: border-box; }
.nh-glance-line span:last-child b { right: 0; }
.nh-glance.will-grow .nh-glance-line span { transform: scaleX(0); }
.nh-glance.will-grow.is-in .nh-glance-line span { transform: scaleX(1); }

/* Growth: pill columns in hatched tracks */
.nh-pills { display: flex; align-items: stretch; gap: 10px; height: 260px; }
.nh-pill { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.nh-pill > b { font-size: 12px; color: #111827; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nh-pill-track { flex: 1; width: 100%; max-width: 44px; border-radius: 999px; position: relative; overflow: hidden; }
.nh-pill-track i { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); border-radius: 999px; background: var(--c);
                   box-shadow: inset 0 -10px 18px rgba(0,0,0,.10); transition: height .9s cubic-bezier(.2,.7,.2,1); }
.nh-pill.is-latest .nh-pill-track { outline: 2px solid rgba(34,197,94,.35); outline-offset: 2px; }
.nh-pill small { font-size: 12px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nh-pill.is-latest small { color: #111827; font-weight: 700; }
.nh-pills.will-grow .nh-pill-track i { height: 0; }
.nh-pills.will-grow.is-in .nh-pill-track i { height: var(--h); }

.nh-pill small { line-height: 1.25; text-align: center; }
.nh-keys { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: #4b5563; }
.nh-keys li { display: flex; align-items: center; gap: 6px; }
.nh-keys i { width: 10px; height: 10px; border-radius: 50%; }

/* Donut: type of workplace */
.nh-title-align { margin-top: 10px; }
.nh-gap { margin-top: 34px; }
.nh-donut { display: flex; align-items: center; gap: 26px; }
.nh-donut svg { flex: 0 0 210px; width: 210px; height: 210px; transition: transform 1s cubic-bezier(.2,.7,.2,1), opacity 1s; }
.nh-donut.will-grow svg { transform: rotate(-90deg) scale(.88); opacity: 0; }
.nh-donut.will-grow.is-in svg { transform: none; opacity: 1; }
.nh-donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; gap: 16px; min-width: 0; }
.nh-donut-legend li { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: baseline; }
.nh-donut-legend strong { grid-row: 1 / 3; font-size: 26px; font-weight: 800; color: #111827; font-variant-numeric: tabular-nums; min-width: 62px; }
.nh-donut-legend span { font-size: 14px; color: #374151; display: flex; align-items: center; gap: 7px; }
.nh-donut-legend i { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.nh-donut-legend small { font-size: 12px; color: #6b7280; padding-left: 17px; }

.nh-donut-legend.is-long { gap: 9px; }
.nh-donut-legend.is-long strong { font-size: 18px; min-width: 46px; grid-row: auto; }
.nh-donut-legend.is-long small { display: none; }
.nh-donut-legend.is-long li { grid-template-columns: auto minmax(0, 1fr) auto; }
.nh-donut-legend.is-long li::after { content: attr(data-n); font-size: 13px; color: #6b7280; font-variant-numeric: tabular-nums; }

/* Donut view switch */
.nh-tabhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.nh-tabhead .nh-chart-title { margin-bottom: 0; }
.nh-tabs { display: inline-flex; background: #e9eef4; border-radius: 999px; padding: 4px; gap: 2px; }
.nh-tabs button { border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: #4b5563; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.nh-tabs button:hover { color: #111827; }
.nh-tabs button.is-on { background: #fff; color: #111827; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.nh-tabs button:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.nh-tabhead + .nh-note { margin-top: 6px; }
.nh-view[hidden] { display: none; }

/* Research output: concentric rings */
.nh-conc { display: flex; align-items: center; gap: 22px; }
.nh-conc svg { flex: 0 0 190px; width: 190px; height: 190px; }
.nh-conc svg { transition: transform 1s cubic-bezier(.2,.7,.2,1), opacity 1s; }
.nh-conc.will-grow svg { transform: rotate(-60deg) scale(.9); opacity: 0; }
.nh-conc.will-grow.is-in svg { transform: none; opacity: 1; }
.nh-legend-wrap { flex: 1; min-width: 0; }
.nh-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.nh-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) 38px; align-items: center; gap: 10px; font-size: 13px; color: #4b5563; }
.nh-legend li div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-width: 0; }
.nh-legend li span { line-height: 1.3; }
.nh-legend i { width: 12px; height: 12px; border-radius: 4px; }
.nh-legend strong { font-size: 18px; color: #111827; font-variant-numeric: tabular-nums; }
.nh-legend small { color: #6b7280; text-align: right; font-size: 12px; }

/* Responsive */
@media (max-width: 1060px) {
    .nh-band, .nh-band-wide { grid-template-columns: 1fr; gap: 34px; }
    .nh-band-stack, .nh-band-single { gap: 0; }
    .nh-conc, .nh-tickring, .nh-donut { flex-direction: column; align-items: flex-start; }
    .nh-legend-wrap, .nh-ticklegend, .nh-donut-legend { width: 100%; }
}
@media (max-width: 700px) {
    .nh-numbers { margin: 0 -18px; }
    .nh-band { padding: 28px 18px; }
    .nh-head { flex-direction: column; gap: 0; }
    .nh-bars li { grid-template-columns: minmax(0, 1fr) 56px; }
    .nh-bars .nh-bar-track { grid-column: 1 / -1; grid-row: 2; }
    .nh-twocol .nh-bars { grid-template-columns: 1fr; }
    .nh-glance-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
    .nh-glance-figs div:nth-child(3) { padding-left: 0; border-left: 0; }
    .nh-glance-figs strong { font-size: 26px; }
    .nh-pills { height: 210px; gap: 5px; }
    .nh-pill > b, .nh-pill small { font-size: 10px; }
    .nh-tickring svg, .nh-conc svg { flex-basis: 180px; width: 180px; height: 180px; }
}
@media (prefers-reduced-motion: reduce) {
    .nh-bar-track i, .nh-pill-track i, .nh-conc svg, .nh-tickring line, .nh-glance-line span { transition: none; }
}

/* Overseas scientists: a full-width row under the two columns, ring on the
   left and the countries spread across, so neither column is left empty. */
.nh-overseas { grid-column: 1 / -1; border-top: 1px dashed var(--nsd-border, #d9e4de); padding-top: 28px; }
.nh-overseas .nh-tickring { gap: 40px; }
.nh-overseas .nh-tickring svg { flex-basis: 190px; width: 190px; height: 190px; }
.nh-overseas .nh-ticklegend { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 28px; }
@media (max-width: 1060px) { .nh-overseas .nh-ticklegend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
