/* Figures for the Size Premia policy summary. Generated by scripts/size_premia_figures.py */
.sp-fig {
  --sp-surface: #ffffff;
  --sp-ink: #0b0b0b; --sp-ink-2: #52514e; --sp-muted: #898781;
  --sp-grid: #e1e0d9; --sp-base: #c3c2b7; --sp-track: #f3f2ee;
  --sp-hi: #2a78d6; --sp-lo: #c3c2b7;
  --sp-pos: #2a78d6; --sp-neg: #e34948; --sp-ns: #898781;
  --sp-bra: #2a78d6; --sp-usa: #eb6834; --sp-chn: #1baf7a; --sp-arg: #eda100; --sp-oth: #c3c2b7;
  margin: 2rem 0; color: var(--sp-ink); font-size: 0.9rem; max-width: 100%; min-width: 0;
}
.sp-fig figcaption { margin-bottom: .75rem; color: var(--sp-ink); font-size: inherit; text-align: left; }
.sp-title { font-weight: 600; margin: 0 0 .2rem; font-size: 1rem; color: var(--sp-ink); }
.sp-sub, .sp-src { color: var(--sp-ink-2); margin: 0; font-size: .85rem; }
.sp-src { margin-top: .75rem; }
.sp-panels { display: flex; flex-wrap: wrap; gap: 1rem 2rem; }
.sp-panel { flex: 1 1 260px; min-width: 0; }
.sp-panel.sp-full { flex-basis: 100%; }
.sp-ptitle { font-weight: 600; margin: 0 0 .35rem; font-size: .9rem; }
.sp-lab { color: var(--sp-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* figure 1: bars */
.sp-row { display: grid; grid-template-columns: 6.2em 1fr; align-items: center; height: 30px; outline-offset: 2px; }
.sp-track { position: relative; display: flex; align-items: center; height: 100%; }
.sp-bar { display: block; height: 18px; background: var(--sp-lo); border-radius: 0 4px 4px 0; }
.sp-bar.sp-hi { background: var(--sp-hi); }
.sp-val { margin-left: .4em; font-variant-numeric: tabular-nums; color: var(--sp-ink); }
.sp-row:hover .sp-bar, .sp-row:focus .sp-bar { filter: brightness(1.12); }
/* figure 2: dots and intervals */
.sp-drow { display: grid; grid-template-columns: 6.2em 1fr; align-items: stretch; height: 40px; }
.sp-drow.sp-axis { height: 22px; }
.sp-drow .sp-lab { align-self: end; padding-bottom: 3px; }
.sp-plot { position: relative; margin: 0 .6em; }
.sp-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--sp-grid); }
.sp-grid.sp-zero { background: var(--sp-muted); }
.sp-ci { position: absolute; top: 27px; height: 2px; border-radius: 1px; }
.sp-dot, .sp-ring { position: absolute; top: 28px; width: 10px; height: 10px; border-radius: 50%;
  transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--sp-surface); }
.sp-ring { background: var(--sp-surface); border: 2px solid var(--sp-muted); box-shadow: none; }
.sp-ci.sp-pos, .sp-dot.sp-pos { background: var(--sp-pos); }
.sp-ci.sp-neg, .sp-dot.sp-neg { background: var(--sp-neg); }
.sp-ci.sp-ns, .sp-dot.sp-ns { background: var(--sp-ns); }
.sp-dlab { position: absolute; top: 2px; transform: translateX(-50%); font-size: .8rem; white-space: nowrap;
  font-variant-numeric: tabular-nums; color: var(--sp-ink); background: var(--sp-surface); padding: 0 2px; }
.sp-dlab.sp-al { transform: translateX(-6px); }
.sp-dlab.sp-ar { transform: translateX(calc(-100% + 6px)); }
.sp-tick { position: absolute; top: 2px; transform: translateX(-50%); font-size: .75rem; color: var(--sp-muted);
  font-variant-numeric: tabular-nums; }
.sp-drow:hover .sp-dot, .sp-drow:focus .sp-dot { width: 12px; height: 12px; }
/* figure 3: stacked bars */
.sp-stacks { display: flex; flex-direction: column; gap: 8px; }
.sp-srow { display: grid; grid-template-columns: 4.2em 1fr; align-items: center; }
.sp-stack { display: flex; gap: 2px; height: 28px; }
.sp-seg { min-width: 0; display: flex; align-items: center; padding-left: 5px; font-size: .75rem;
  font-variant-numeric: tabular-nums; color: #ffffff; white-space: nowrap; overflow: visible; }
.sp-seg:first-child { border-radius: 4px 0 0 4px; }
.sp-seg:last-child { border-radius: 0 4px 4px 0; }
.sp-seg:hover, .sp-seg:focus { filter: brightness(1.12); }
.m-bra { background: var(--sp-bra); } .m-usa { background: var(--sp-usa); }
.m-chn { background: var(--sp-chn); } .m-arg { background: var(--sp-arg); color: #0b0b0b; }
.m-oth { background: var(--sp-oth); color: #0b0b0b; }
/* legend and data table */
.sp-legend { list-style: none; padding: 0; margin: 0 0 .75rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem;
  color: var(--sp-ink-2); font-size: .85rem; }
.sp-legend li { display: flex; align-items: center; gap: .4em; }
.sp-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.sp-key.sp-pos { background: var(--sp-pos); } .sp-key.sp-neg { background: var(--sp-neg); }
.sp-key.sp-ns { background: var(--sp-ns); }
.sp-key.sp-keyring { border: 2px solid var(--sp-muted); background: var(--sp-surface); }
.sp-key.sp-sq { border-radius: 2px; width: 12px; height: 12px; }
.sp-data { margin-top: .5rem; font-size: .85rem; max-width: 100%; overflow-x: auto; }
.sp-data summary { cursor: pointer; color: var(--sp-ink-2); }
.sp-data table { margin-top: .5rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sp-data th, .sp-data td { padding: .2rem .75rem .2rem 0; text-align: left; border-bottom: 1px solid var(--sp-grid); }

/* Trade Costs summary: stat tiles, route meters, timeline */
.tc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.tc-tile { border-top: 3px solid var(--sp-hi); padding-top: .5rem; }
.tc-hero { font-size: 1.75rem; font-weight: 600; line-height: 1.1; margin: 0 0 .35rem; color: var(--sp-ink); }
.tc-label { margin: 0; color: var(--sp-ink-2); font-size: .85rem; }
.tc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem 1.5rem; }
.tc-dim { margin: .5rem 0 .2rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--sp-muted); }
.tc-meter { margin-bottom: .45rem; outline-offset: 2px; }
.tc-mhead { display: flex; justify-content: space-between; gap: .5rem; font-size: .85rem; color: var(--sp-ink-2); }
.tc-mval { color: var(--sp-ink); font-variant-numeric: tabular-nums; }
.tc-track { display: block; height: 8px; border-radius: 4px; background: var(--sp-track); overflow: hidden; }
.tc-fill { display: block; height: 100%; border-radius: 4px; background: var(--sp-hi); }
.tc-timeline { list-style: none; margin: 0; padding: 0; }
.tc-event { display: grid; grid-template-columns: 6.5em 1fr; gap: 1rem; padding: .6rem 0;
  border-top: 1px solid var(--sp-grid); }
.tc-year { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--sp-ink); }
.tc-body p { margin: 0 0 .3rem; font-size: .88rem; color: var(--sp-ink-2); }
.tc-body .tc-name { font-weight: 600; color: var(--sp-ink); font-size: .95rem; }
.tc-line { display: grid; grid-template-columns: 7.5em 1fr; gap: .5rem; align-items: baseline; }
.tc-tag { font-size: .7rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--sp-muted); }
.tc-tag.tc-resp { color: var(--sp-ink); font-weight: 600; }
/* routes map */
.tc-map { position: relative; }
.tc-map:not(.tc-ready) { min-height: 180px; background: #eef2f6; border-radius: 4px; }
.tc-map-svg { display: block; width: 100%; height: auto; }
.tc-ocean { fill: #eef2f6; }
.tc-grat { fill: none; stroke: #dde4ea; stroke-width: .5; }
.tc-country { fill: #dedcd5; stroke: #ffffff; stroke-width: .4; }
.tc-chile { fill: #671130; stroke: #ffffff; stroke-width: .4; }
.tc-arc { fill: none; stroke-linecap: round; }
.tc-hit { fill: none; stroke: transparent; stroke-width: 10px; }
.tc-dot { stroke: #ffffff; stroke-width: .8; }
.tc-dest { outline: none; }
.tc-dest:hover .tc-arc, .tc-dest:focus .tc-arc { stroke-opacity: 1; }
.tc-origin { stroke: #ffffff; stroke-width: 2; }
.tc-mlabel { fill: #0b0b0b; stroke: #ffffff; paint-order: stroke; stroke-linejoin: round; font-weight: 500; }
.tc-mlabel-origin { fill: #671130; font-weight: 600; }
.tc-kline { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }
.tc-k-sea { background: #2a78d6; } .tc-k-air { background: #eb6834; } .tc-k-land { background: #1baf7a; }
.tc-scroll { max-height: 320px; overflow: auto; }
@media (max-width: 480px) { .tc-event { grid-template-columns: 1fr; gap: .2rem; } .tc-line { display: block; } .tc-tag { display: block; } }
