/* Resources-owned prepared insert; reused unchanged by Admin and public News. */
.editorial-chart { --trade-export: #164a72; --trade-import: #987018; margin: 1.5rem 0; padding: 1rem; border: 1px solid #ccd4dd; border-radius: .5rem; color: #172d43; background: #f7f9fb; overflow-wrap: anywhere; }
/* Explicit roles beat the public H2/H3 scale, so a chart never outranks the body section around it. */
.public-site .editorial-chart :is(.editorial-chart__subtitle, .trade-section__nested-title) { font-size: 1.1rem; line-height: 1.3; }
.editorial-chart .editorial-chart__title { margin: 0 0 .5rem; font-size: 1.35rem; line-height: 1.35; }
.editorial-chart__legend p { margin: .5rem 0; }
.editorial-chart__key::before { content: ""; display: inline-block; width: .8rem; height: .8rem; margin-right: .5rem; }
.editorial-chart__key--1::before { background: var(--trade-export); }
.editorial-chart__key--2::before { background: var(--trade-import); }
.editorial-chart__key--trade::before { background: var(--color-text, currentColor); }
.editorial-chart__legend--lines { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.editorial-chart__legend--lines .editorial-chart__key::before { width: 1.75rem; height: 0; margin-bottom: .2rem; border-block-start: 3px solid var(--trade-export); background: transparent; }
.editorial-chart__legend--lines .editorial-chart__key--line-prior::before { border-color: var(--trade-import); border-block-start-style: dashed; }
.editorial-chart__bar--1 { fill: var(--trade-export); }
.editorial-chart__bar--2 { fill: var(--trade-import); }
.editorial-chart__plot { display: block; width: 100%; max-width: 42rem; height: auto; }
.editorial-chart__table-wrap { max-width: 100%; }
.editorial-chart table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: .95rem; }
.editorial-chart caption { text-align: left; margin: .5rem 0; }
.editorial-chart th, .editorial-chart td { padding: .6rem .4rem; border-bottom: 1px solid #ccd4dd; text-align: left; overflow-wrap: anywhere; vertical-align: top; }
.editorial-chart td { font-variant-numeric: tabular-nums; }
.editorial-chart__source { font-size: .9rem; line-height: 1.5; }
.editorial-chart a { color: #164a72; text-decoration: underline; }
.editorial-chart--series .editorial-chart__table-wrap { overflow-x: auto; margin-block: 1rem; }
.editorial-chart--series table { min-width: 42rem; table-layout: auto; }
.editorial-chart--series th { overflow-wrap: normal; }
.editorial-chart--series th[scope="row"] { white-space: nowrap; }
.editorial-chart--series td { white-space: nowrap; }
.editorial-chart--series td small { display: block; color: #405368; }
.editorial-chart--series .trade-section { margin-block: 1rem; }
.editorial-chart--series .trade-product-list { padding-inline-start: 0; }
.editorial-chart--series td.editorial-chart__product-name { min-width: 16rem; max-width: 24rem; white-space: normal; }
.editorial-chart__scroll-hint { display: none; }
@media (max-width: 40rem) {
    .editorial-chart__history:not(.editorial-chart__history--compact) .editorial-chart__plot { min-width: 50rem; max-width: none; }
    .editorial-chart__scroll-hint { display: block; font-size: .9rem; }
}

/* The same frozen SVG paths, with HTML axes that do not shrink with the plot. */
.editorial-chart__history--compact { container-type: inline-size; margin-block: 1.75rem; }
.trade-history-compact { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); grid-template-rows: 12rem auto; gap: .75rem .5rem; padding-right: 1.25rem; }
.trade-history-compact__y { display: flex; flex-direction: column; justify-content: space-between; font-size: .9rem; font-variant-numeric: tabular-nums; }
.trade-history-compact__y > span { display: flex; height: 0; align-items: center; justify-content: flex-end; white-space: nowrap; }
.editorial-chart .trade-history-compact__plot { width: 100%; max-width: none; height: 12rem; border: 0; overflow: visible; }
.trade-history-compact__plot .trade-chart__line { vector-effect: non-scaling-stroke; stroke-width: 3; }
.trade-history-compact__plot .trade-chart__grid { vector-effect: non-scaling-stroke; }
.trade-history-compact__years { grid-column: 2; display: flex; justify-content: space-between; min-height: 1.5rem; font-size: 1rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.trade-history-compact__tick { flex: 0 0 4ch; margin-inline: -2ch; text-align: center; }
.trade-history-compact__tick > span { white-space: nowrap; }
@container (max-width: 16rem) {
    .trade-history-compact__years { min-height: 3rem; }
    .trade-history-compact__tick--alternate { padding-top: 1.5rem; }
}
.editorial-chart__units { font-size: .95rem; }
.editorial-chart__exact { margin-block: 1rem; border-block-start: 1px solid #ccd4dd; }
.editorial-chart__exact > summary { padding-block: .75rem; font-weight: 600; cursor: pointer; }
.editorial-chart :is(summary, a, [tabindex]):focus-visible { outline: 2px solid #164a72; outline-offset: 3px; }
.editorial-chart__comparison { margin-block: 1.25rem; }
.editorial-chart__comparison-row { margin-block: .75rem; }
.editorial-chart__comparison-row p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; margin: 0 0 .25rem; font-variant-numeric: tabular-nums; }
.editorial-chart__comparison-row .editorial-chart__plot { height: 1.5rem; max-width: none; }
.editorial-chart__bar--export { fill: var(--trade-export); }
.editorial-chart__bar--import { fill: var(--trade-import); }
.editorial-chart__bar--prior { fill-opacity: .65; }
.editorial-chart__baseline { stroke: #405368; stroke-width: 1; vector-effect: non-scaling-stroke; }
.editorial-chart__unit { font-weight: 400; }
.editorial-chart__supplier-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-block: 1.25rem; }
.editorial-chart__supplier-panel { min-width: 0; padding: 1rem; border: 1px solid #ccd4dd; border-radius: .4rem; background: #fff; }
.editorial-chart__supplier-panel .editorial-chart__subtitle { margin: 0 0 1rem; }
.editorial-chart__supplier-row { margin-block: .75rem; }
.editorial-chart__supplier-row p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; margin: 0 0 .25rem; font-variant-numeric: tabular-nums; }
.editorial-chart__supplier-row .editorial-chart__plot { height: .75rem; max-width: none; background: #e5eaf0; }
.editorial-chart__supplier-bar { fill: #66788b; }
.editorial-chart__supplier-bar--selected { fill: var(--trade-import); }
.editorial-chart__supplier-row--selected p { font-weight: 700; }
.editorial-chart__selected-label { display: inline-block; margin-inline-start: .35rem; padding: .1rem .35rem; border: 1px solid currentColor; border-radius: 1rem; font-size: .75rem; font-weight: 600; }
.editorial-chart--hs4-suppliers table th:first-child { min-width: 16rem; white-space: normal; }
@media (max-width: 48rem) {
    .editorial-chart__supplier-grid { grid-template-columns: minmax(0, 1fr); }
}
@media print {
    .editorial-chart--hs4-suppliers .editorial-chart__supplier-panel { break-inside: avoid; }
    .editorial-chart--hs4-suppliers :is(.editorial-chart__exact, .editorial-chart__method) { border: 0; }
    .editorial-chart--hs4-suppliers :is(.editorial-chart__exact, .editorial-chart__method) > summary { display: none; }
    .editorial-chart--hs4-suppliers :is(.editorial-chart__exact, .editorial-chart__method) > * { display: block; }
    .editorial-chart--hs4-suppliers .editorial-chart__table-wrap { overflow: visible; }
    .editorial-chart--hs4-suppliers table { min-width: 0; table-layout: auto; font-size: .82rem; }
    .editorial-chart--hs4-suppliers :is(th, td) { white-space: normal; }
}
/* Optional compact use of the shared product row; explorer defaults stay intact. */
.editorial-chart .trade-product-list--editorial li { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
.editorial-chart .trade-product-list--editorial .trade-product-list__value { grid-column: 1; grid-template-columns: minmax(0, 1fr) auto; align-items: center; text-align: left; }
.editorial-chart .trade-product-list--editorial .trade-product-list__value small { font-size: .9rem; text-align: right; }
.editorial-chart .trade-product-list--editorial .trade-product-list__share { grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: none; }
.editorial-chart .trade-product-list--editorial .trade-product-list__value strong { font-size: 1rem; }
@media (max-width: 40rem) {
    .editorial-chart .trade-product-list--editorial .trade-product-list__value { grid-template-columns: minmax(0, 1fr); }
    .editorial-chart .trade-product-list--editorial .trade-product-list__value small { grid-row: 2; text-align: left; }
    .editorial-chart .trade-product-list--editorial .trade-product-list__share { grid-row: 3; }
}
/* MoTS long market/period labels use the same table, without forced nowrap. */
.editorial-chart--tourism th[scope="row"] { white-space: normal; min-width: 12rem; }
.editorial-chart--tourism td small { white-space: normal; }

.editorial-chart--tourism table { table-layout: fixed; min-width: 32rem; }
.editorial-chart--article.editorial-chart--tourism { margin-block: 2rem; padding: 1.5rem 0; border: 0; border-block: 1px solid #ccd4dd; border-radius: 0; background: transparent; }
.editorial-chart--market-history .editorial-chart__history--compact { margin-block: 1.25rem; }
.editorial-chart__gap { margin-block: 1rem; padding: .75rem 1rem; border-inline-start: .25rem solid var(--trade-import); background: color-mix(in srgb, var(--trade-import) 8%, transparent); font-size: .95rem; line-height: 1.5; }
/* Monthly labels are denser than the existing annual Trade axis. */
@container (max-width: 32rem) {
    .editorial-chart--tourism .trade-history-compact__years { min-height: 3rem; }
    .editorial-chart--tourism .trade-history-compact__tick--alternate { padding-top: 1.5rem; }
}
@container (max-width: 16rem) {
    .editorial-chart--tourism .trade-history-compact__years { font-size: .75rem; }
}

@media print {
    /* A plot label and its compact chart are one semantic panel. Each Tourism
       panel fits on a sheet, so move it intact instead of splitting the SVG
       plot across a page boundary. The enclosing figure and long exact table
       remain free to flow. */
    .editorial-chart--tourism .editorial-chart__plot-panel { break-inside: avoid; }
    /* A monthly history and its exact table can be taller than one sheet. Let
       the figure flow instead of moving it away from the section heading, but
       keep the chart's meaningful sub-blocks and table rows together. */
    .editorial-chart--market-history { break-inside: auto; overflow: visible; background: transparent; }
    .editorial-chart--market-history figcaption,
    .editorial-chart--market-history .editorial-chart__history,
    .editorial-chart--market-history tr { break-inside: avoid; }
    .editorial-chart--market-history figcaption { break-after: avoid; }
    .editorial-chart--market-history details:not([open]) > :not(summary) { display: block !important; }
    /* Chromium keeps closed disclosure content in an internal wrapper with
       content-visibility:hidden. Printing the child alone is insufficient;
       make that wrapper participate in print layout as well. */
    .editorial-chart--market-history details::details-content { content-visibility: visible; }
    .editorial-chart--market-history details > summary { list-style: none; }
    .editorial-chart--market-history details > summary::marker,
    .editorial-chart--market-history details > summary::-webkit-details-marker { display: none; }
    .editorial-chart--market-history .editorial-chart__table-wrap { overflow: visible; }
    .editorial-chart--market-history table { min-width: 0; font-size: .78rem; }
    .editorial-chart--market-history .editorial-chart__scroll-hint { display: none; }
}

/* Twelve calendar labels need a third row on the narrowest News containers.
   Only Tourism provides stack_row; the shared annual Trade axis is unchanged. */
@container (max-width: 16rem) {
    .editorial-chart--tourism .trade-history-compact__years { min-height: 4rem; }
    .editorial-chart--tourism .trade-history-compact__tick--row-1 { padding-top: 0; }
    .editorial-chart--tourism .trade-history-compact__tick--row-2 { padding-top: 1.25rem; }
    .editorial-chart--tourism .trade-history-compact__tick--row-3 { padding-top: 2.5rem; }
}
