/* Article "The largest economies in the world" (/articles/largest-economies/):
   the treemap, the share bands, the dumbbell, width × height blocks and the
   growth bars. Countries keep the colors of the rank race (c1…c5); every other
   economy is a quiet neutral (--le-base) in each theme. */

.le { --le-base: #cfd3d9; --le-base-ink: var(--ink); }
:root[data-theme="paper"] .le { --le-base: #d8ceb6; }
:root[data-theme="dark"] .le { --le-base: #4f5660; }
:root[data-theme="black"] .le { --le-base: #3a3a3e; }

/* flags beside names (site/flags: flag-icons, MIT) */
.le-flag { display: inline-block; width: 20px; height: 15px; margin-right: 7px; vertical-align: -0.2em; border-radius: 2px;
  object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1); }
:root[data-theme="dark"] .le-flag, :root[data-theme="black"] .le-flag { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }
.le-nm { color: var(--ink); text-decoration: none; white-space: nowrap; }
.le-nm:hover { color: var(--accent-ink); }
.le-flag-o { fill: none; stroke: rgba(0, 0, 0, 0.12); stroke-width: 1; }
:root[data-theme="dark"] .le-flag-o, :root[data-theme="black"] .le-flag-o { stroke: rgba(255, 255, 255, 0.14); }

/* swatches */
.sw-sq.le-c0 { background: var(--le-base); }
.sw-sq.le-past { background: var(--ink-2); }
.sw-sq.le-fut { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.ln.le-base { stroke: var(--ink); stroke-opacity: 0.55; stroke-width: 1.4; }
.le-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--ink); margin-right: 6px; vertical-align: -1px; }
.le-dot.le-ring { background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink); }
.tip-row .le-dot { margin: 0; }
.le-dot.c1 { background: var(--s1); } .le-dot.c2 { background: var(--s2); } .le-dot.c3 { background: var(--s3); }
.le-dot.c4 { background: var(--s4); } .le-dot.c5 { background: var(--s5); }
.le-dot.le-ring.c1 { background: var(--surface); box-shadow: inset 0 0 0 2px var(--s1); }
.le-dot.le-ring.c2 { background: var(--surface); box-shadow: inset 0 0 0 2px var(--s2); }
.le-dot.le-ring.c3 { background: var(--surface); box-shadow: inset 0 0 0 2px var(--s3); }
.le-dot.le-ring.c4 { background: var(--surface); box-shadow: inset 0 0 0 2px var(--s4); }
.le-dot.le-ring.c5 { background: var(--surface); box-shadow: inset 0 0 0 2px var(--s5); }

/* tooltips */
.le .tip { min-width: 240px; }
.le-tip-h { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; }
.le-tip-h .le-flag { margin-right: 2px; }
.le-tag { font-weight: 500; font-size: 11px; color: var(--muted); }
.le-tip-note { margin: -3px 0 3px 28px; font-size: 11px; color: var(--muted); }
.le-mute { color: var(--muted); font-weight: 500; }

/* treemap */
.le-map { min-height: 420px; }
.le-map .tm-c { stroke: var(--surface); stroke-width: 1; cursor: pointer; }
.le-map .tm-c.le-c1 { fill: var(--s1); } .le-map .tm-c.le-c2 { fill: var(--s2); } .le-map .tm-c.le-c3 { fill: var(--s3); }
.le-map .tm-c.le-c4 { fill: var(--s4); } .le-map .tm-c.le-c5 { fill: var(--s5); }
.le-map .tm-c.le-c0 { fill: var(--le-base); }
.le-map .tm-c:not(.le-c0) { fill-opacity: 0.9; }
.le-map .tm-frames rect { fill: none; stroke: var(--surface); stroke-width: 3; }
.le-map .tm-frames, .le-map .tm-labels, .le-map .tm-hi { pointer-events: none; }
.le-map .tm-t, .le-map .tm-s { text-anchor: middle; fill: var(--ink); }
.le-map .tm-t { font-family: var(--font); font-weight: 700; letter-spacing: 0.005em; }
.le-map .tm-s { font-family: var(--mono); font-weight: 500; opacity: 0.85; }
.le-map .tm-t:not(.le-c0), .le-map .tm-s:not(.le-c0) { fill: #fff; }
:root[data-theme="dark"] .le-map .tm-t:not(.le-c0), :root[data-theme="dark"] .le-map .tm-s:not(.le-c0),
:root[data-theme="black"] .le-map .tm-t:not(.le-c0), :root[data-theme="black"] .le-map .tm-s:not(.le-c0) { fill: #1d1d1f; }
.le-map .tm-t.le-c4, .le-map .tm-s.le-c4 { fill: #2b2410; }
.le-map .tm-tag rect { fill: var(--surface); opacity: 0.92; }
.le-map .tm-tag text { fill: var(--ink); font-family: var(--font); font-weight: 650; }
.le-map .tm-tag:hover rect { opacity: 1; }
.le-map .tm-hi { fill: none; stroke: var(--ink); stroke-width: 2; }
.le-map .tm-tap { color: var(--accent-ink); font-weight: 600; margin-top: 6px; }

/* the table */
.le-table td.le-rk, .le-table th.le-rk { width: 2.5em; text-align: right; color: var(--muted); padding-right: 4px; }
.le-table th[scope="row"] { white-space: nowrap; }

/* shares, stacked */
.le-stack { min-height: 330px; }
.le-band { stroke: var(--surface); stroke-width: 0.8; stroke-linejoin: round; }
.le-band.c1 { fill: var(--s1); } .le-band.c2 { fill: var(--s2); } .le-band.c3 { fill: var(--s3); }
.le-band.c4 { fill: var(--s4); } .le-band.c5 { fill: var(--s5); }
.le-band:not(.le-c0) { fill-opacity: 0.88; }
.le-band.le-c0 { fill: var(--le-base); fill-opacity: 0.55; }
.le-grid { stroke: var(--surface); stroke-opacity: 0.5; stroke-width: 1; shape-rendering: crispEdges; }
.le-veil { fill: var(--surface); opacity: 0.42; }
.le-proj { stroke: var(--ink); stroke-opacity: 0.5; stroke-width: 1; stroke-dasharray: 3 3; }
.le-hover { stroke: var(--ink); stroke-width: 1.2; }
.le-end { fill: var(--ink-2); font: 600 12px var(--font); }
.le-end-v { fill: var(--muted); font: 500 11px var(--mono); }

/* China against the US: the 100% line stands out from the grid */
#le-ratio .baseline { stroke: var(--ink); stroke-opacity: 0.55; stroke-width: 1.4; }

/* dumbbell */
.le-db { min-height: 300px; }
.le-db-name { fill: var(--ink); font: 550 13px var(--font); }
.le-db-bar { stroke: var(--ink); stroke-opacity: 0.22; stroke-width: 4; stroke-linecap: round; }
.le-db-bar.c1 { stroke: var(--s1); } .le-db-bar.c2 { stroke: var(--s2); } .le-db-bar.c3 { stroke: var(--s3); }
.le-db-bar.c4 { stroke: var(--s4); } .le-db-bar.c5 { stroke: var(--s5); }
.le-db-bar[class*=" c"] { stroke-opacity: 0.35; }
.le-db-usd { fill: var(--ink); }
.le-db-ppp { fill: var(--surface); stroke: var(--ink); stroke-width: 2.2; }
.le-db-usd.c1 { fill: var(--s1); } .le-db-usd.c2 { fill: var(--s2); } .le-db-usd.c3 { fill: var(--s3); }
.le-db-usd.c4 { fill: var(--s4); } .le-db-usd.c5 { fill: var(--s5); }
.le-db-ppp.c1 { stroke: var(--s1); } .le-db-ppp.c2 { stroke: var(--s2); } .le-db-ppp.c3 { stroke: var(--s3); }
.le-db-ppp.c4 { stroke: var(--s4); } .le-db-ppp.c5 { stroke: var(--s5); }
.le-db-x { fill: var(--muted); font: 500 11px var(--mono); }
.le-xh { font-family: var(--font); }
.le-row-on { fill: var(--hover); }

/* width = people, height = GDP per person */
.le-mk { min-height: 340px; }
.le-mk-b { stroke: var(--surface); stroke-width: 1; }
.le-mk-b.c1 { fill: var(--s1); } .le-mk-b.c2 { fill: var(--s2); } .le-mk-b.c3 { fill: var(--s3); }
.le-mk-b.c4 { fill: var(--s4); } .le-mk-b.c5 { fill: var(--s5); }
.le-mk-b.le-c0 { fill: var(--le-base); }
.le-mk-b:not(.le-c0) { fill-opacity: 0.88; }
.le-mk-b.thin { stroke: none; }
.le-mk-b.on { fill-opacity: 1; stroke: var(--ink); stroke-width: 1.5; }
.le-mk-n { fill: var(--ink); font: 650 12px var(--font); }
.le-mk-v { fill: var(--ink-2); font: 500 11px var(--mono); }
.le-mk-v.in { fill: #fff; }
:root[data-theme="dark"] .le-mk-v.in, :root[data-theme="black"] .le-mk-v.in { fill: #1d1d1f; }
.le-tk { stroke: var(--axis); }
.le-axh { font-family: var(--font); font-weight: 600; }

/* growth bars (static HTML) */
.le-growfig { margin-top: 8px; padding: 18px 20px 6px; }
.le-growfig .legend { padding: 0 0 6px; }
.le-grow { list-style: none; margin: 0; padding: 0; }
.le-grow-row { display: grid; grid-template-columns: minmax(130px, 210px) 1fr; gap: 6px 14px; align-items: center; padding: 5px 0;
  border-top: 1px solid var(--border); font-size: 14px; }
.le-grow-row:first-child { border-top: 0; }
.le-grow-bars { position: relative; display: grid; gap: 3px; }
.le-grow-bars::before { content: ""; position: absolute; top: -3px; bottom: -3px; left: var(--z); border-left: 1px solid var(--axis); }
.le-gbar { position: relative; display: block; height: 9px; margin-right: 52px; }
.le-gbar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.le-gbar.past i { background: var(--ink-2); }
.le-gbar.fut i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.le-gbar b { position: absolute; top: 50%; transform: translateY(-50%); margin-left: 6px; font: 500 11px/1 var(--mono); color: var(--ink-2); white-space: nowrap; }
.le-gbar b.neg { transform: translate(calc(-100% - 12px), -50%); }
.le-gbar.fut b { color: var(--muted); }
.le-gbar.past.c1 i { background: var(--s1); } .le-gbar.past.c2 i { background: var(--s2); } .le-gbar.past.c3 i { background: var(--s3); }
.le-gbar.past.c4 i { background: var(--s4); } .le-gbar.past.c5 i { background: var(--s5); }
.le-gbar.fut.c1 i { box-shadow: inset 0 0 0 1.5px var(--s1); } .le-gbar.fut.c2 i { box-shadow: inset 0 0 0 1.5px var(--s2); }
.le-gbar.fut.c3 i { box-shadow: inset 0 0 0 1.5px var(--s3); } .le-gbar.fut.c4 i { box-shadow: inset 0 0 0 1.5px var(--s4); }
.le-gbar.fut.c5 i { box-shadow: inset 0 0 0 1.5px var(--s5); }
@media (max-width: 560px) {
  .le-grow-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .le-growfig { padding: 16px 14px 4px; }
}

