/* CD-012 only: production ranking that switches between statistics. The answer stays in HTML. */
.coffee-production-ranking { --pr-ink:#f1eee2; --pr-muted:#bacbb0; --pr-line:#8ca47b55; --pr-tasted:#b98935; --pr-other:#158e77; --pr-value-space:8.5em; position:relative; margin:28px 0 32px; padding:24px; border:1px solid var(--pr-line); }
.coffee-production-ranking .pr-heading p { font-family:var(--article-heading-font); font-size:1.5rem; line-height:1.7; margin:4px 0 12px; }
.coffee-production-ranking .pr-intro { font-size:1rem; line-height:1.9; margin:0 0 18px; }
.coffee-production-ranking .pr-controls { display:grid; gap:10px; margin:0 0 18px; }
.coffee-production-ranking .pr-controls[hidden] { display:none; }
.coffee-production-ranking .pr-control { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; }
.coffee-production-ranking .pr-control > p { flex:0 0 3em; margin:0; font-size:.875rem; line-height:1.8; color:var(--pr-muted); }
.coffee-production-ranking .pr-buttons { display:flex; flex-wrap:wrap; gap:6px; }
.coffee-production-ranking button { border:1px solid #bacbb0; border-radius:4px; min-height:44px; min-width:44px; padding:6px 12px; background:#142b21; color:var(--pr-ink); font-size:.9375rem; line-height:1.5; cursor:pointer; }
.coffee-production-ranking button[aria-pressed="true"] { color:#142b21; background:#efdfc8; border-color:#efdfc8; }
.coffee-production-ranking button:hover { border-color:#dfc28f; }
.coffee-production-ranking button:focus-visible { outline:3px solid #dfc28f; outline-offset:3px; }
.coffee-production-ranking button small { display:block; font-size:.75rem; line-height:1.4; opacity:.85; }
.coffee-production-ranking .pr-caption { font-size:.875rem; line-height:1.8; color:var(--pr-muted); margin:0 0 8px; }
.coffee-production-ranking .pr-list { list-style:none; margin:0; padding:0; }
.coffee-production-ranking .pr-row { margin:0 0 4px; font-size:1rem; line-height:1.5; display:grid; grid-template-columns:2em 7.5em minmax(0,1fr); align-items:center; column-gap:8px; min-height:40px; padding:2px 6px; border-radius:4px; transition:transform .55s cubic-bezier(.3,0,.3,1), opacity .35s; }
.coffee-production-ranking .pr-row:is(:hover, :focus-visible) { background:#ffffff0d; }
.coffee-production-ranking .pr-row:focus-visible { outline:2px solid #d4dfb8; outline-offset:1px; }
.coffee-production-ranking .pr-row.is-entering { opacity:0; }
.coffee-production-ranking .pr-rank { font-size:.875rem; color:var(--pr-muted); text-align:right; font-variant-numeric:tabular-nums; }
.coffee-production-ranking .pr-name { font-size:1rem; line-height:1.5; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.coffee-production-ranking .pr-mark { display:inline-block; width:.62em; height:.86em; margin-left:.4em; vertical-align:-.08em; }
.coffee-production-ranking .pr-mark ellipse { fill:#efdfc8; }
.coffee-production-ranking .pr-mark path { fill:none; stroke:#081b14; stroke-width:1.3; stroke-linecap:round; }
.coffee-production-ranking .pr-track { display:flex; align-items:center; gap:8px; min-width:0; }
.coffee-production-ranking .pr-bar { flex:none; display:block; height:18px; width:calc((100% - var(--pr-value-space)) * var(--p, 0)); min-width:2px; background:var(--pr-other); border-radius:0 4px 4px 0; transition:width .55s cubic-bezier(.3,0,.3,1), background-color .2s; }
.coffee-production-ranking .is-tasted .pr-bar { background:var(--pr-tasted); }
.coffee-production-ranking .pr-row:is(:hover, :focus-visible) .pr-bar { filter:brightness(1.15); }
.coffee-production-ranking .pr-value { flex:none; font-size:1rem; line-height:1.4; font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap; }
.coffee-production-ranking .pr-value small { margin-left:.25em; font-size:.8125rem; font-weight:400; color:var(--pr-muted); }
.coffee-production-ranking .pr-flag { margin-left:.35em; font-size:.75rem; font-weight:400; color:#efdfc8; border-bottom:1px dotted currentColor; }
.coffee-production-ranking .pr-legend { display:flex; flex-wrap:wrap; gap:4px 18px; margin:12px 0 0; font-size:.8125rem; line-height:1.8; color:var(--pr-muted); }
.coffee-production-ranking .pr-key::before { content:""; display:inline-block; width:14px; height:10px; margin-right:6px; border-radius:0 3px 3px 0; background:var(--pr-other); vertical-align:0; }
.coffee-production-ranking .pr-key.is-tasted::before { background:var(--pr-tasted); }
.coffee-production-ranking .pr-key-flag { color:#efdfc8; }
.coffee-production-ranking figcaption { margin-top:16px; }
.coffee-production-ranking .pr-status { font-size:1.0625rem; line-height:1.9; margin:0 0 10px; }
.coffee-production-ranking .pr-note { font-size:.875rem; line-height:1.9; color:var(--pr-muted); margin:0 0 14px; }
.coffee-production-ranking .pr-tasted > p { font-size:1rem; line-height:1.8; margin:0 0 6px; }
.coffee-production-ranking .pr-tasted li { margin:0; font-size:inherit; line-height:inherit; }
.coffee-production-ranking .pr-tasted ul { display:flex; flex-wrap:wrap; gap:6px 8px; list-style:none; margin:0 0 14px; padding:0; }
.coffee-production-ranking .pr-tasted a { display:inline-flex; align-items:baseline; gap:.4em; min-height:44px; padding:8px 10px; border:1px solid #ead5a466; border-radius:4px; color:#ead5a4; font-size:.9375rem; line-height:1.6; text-decoration:none; }
.coffee-production-ranking .pr-tasted a:is(:hover, :focus-visible) { color:#fff3d1; border-color:currentColor; }
.coffee-production-ranking .pr-tasted a span { color:var(--pr-ink); font-variant-numeric:tabular-nums; }
.coffee-production-ranking .pr-source { font-size:.8125rem; line-height:1.9; color:var(--pr-muted); margin:0; }
.coffee-production-ranking .pr-source a { color:#ead5a4; }
.coffee-production-ranking .pr-tooltip { position:absolute; z-index:3; max-width:min(320px, calc(100% - 24px)); padding:10px 12px; background:#f1eee2; color:#10241b; border-radius:4px; box-shadow:0 6px 18px #0007; font-size:.8125rem; line-height:1.7; pointer-events:none; }
/* The article stylesheet colours strong text and enlarges list items; reset them inside the tooltip. */
.coffee-production-ranking .pr-tooltip strong { display:block; font-size:1rem; font-weight:700; color:#10241b; }
.coffee-production-ranking .pr-tooltip > span { display:block; }
.coffee-production-ranking .pr-tooltip p { margin:6px 0 0; font-size:.75rem; line-height:1.6; color:#3d5446; }
.coffee-production-ranking .pr-tooltip ul { margin:0; padding:0; list-style:none; }
.coffee-production-ranking .pr-tooltip li { margin:0; font-size:.8125rem; line-height:1.7; }
.coffee-production-ranking .pr-table { margin-top:6px; }
.coffee-production-ranking .pr-table summary { min-height:44px; display:flex; align-items:center; font-size:.9375rem; color:#ead5a4; cursor:pointer; }
.coffee-production-ranking .pr-table table { width:100%; border-collapse:collapse; font-size:.875rem; line-height:1.7; font-variant-numeric:tabular-nums; }
.coffee-production-ranking .pr-table :is(th, td) { padding:4px 6px; border-bottom:1px solid var(--pr-line); text-align:right; }
.coffee-production-ranking .pr-table :is(th, td):nth-child(2) { text-align:left; }
@media (max-width:560px) {
  .coffee-production-ranking { padding:18px 12px; }
  .coffee-production-ranking .pr-control > p { flex-basis:100%; }
  /* Narrow screens: the value moves beside the name so the bar can use the full width. */
  .coffee-production-ranking .pr-row { grid-template-columns:1.6em minmax(0,1fr) auto; grid-template-areas:"rank name value" ". bar bar"; row-gap:3px; padding-block:5px; }
  .coffee-production-ranking .pr-rank { grid-area:rank; }
  .coffee-production-ranking .pr-name { grid-area:name; }
  .coffee-production-ranking .pr-track { display:contents; }
  .coffee-production-ranking .pr-bar { grid-area:bar; height:14px; width:calc(100% * var(--p, 0)); }
  .coffee-production-ranking .pr-value { grid-area:value; text-align:right; }
}
@media (prefers-reduced-motion:reduce) { .coffee-production-ranking :is(.pr-row, .pr-bar) { transition:none; } }
/* Figure 2: static Arabica/Robusta split (USDA). */
.coffee-production-species { --sp-arabica:#c36953; --sp-robusta:#4984bf; margin:28px 0 32px; padding:24px; border:1px solid #8ca47b55; }
.coffee-production-species .pr-heading p { font-family:var(--article-heading-font); font-size:1.5rem; line-height:1.7; margin:4px 0 12px; }
.coffee-production-species .sp-legend { display:flex; gap:4px 18px; flex-wrap:wrap; margin:0 0 12px; font-size:.875rem; line-height:1.8; color:#bacbb0; }
.coffee-production-species .sp-key::before { content:""; display:inline-block; width:14px; height:10px; margin-right:6px; border-radius:2px; }
.coffee-production-species .sp-key.sp-arabica::before { background:var(--sp-arabica); }
.coffee-production-species .sp-key.sp-robusta::before { background:var(--sp-robusta); }
.coffee-production-species .sp-list { list-style:none; margin:0; padding:0; }
.coffee-production-species .sp-row { display:grid; grid-template-columns:7.5em minmax(0,1fr); grid-template-areas:"name bar" ". label"; column-gap:8px; margin:0 0 8px; font-size:1rem; line-height:1.5; }
.coffee-production-species .sp-name { grid-area:name; white-space:nowrap; }
.coffee-production-species .sp-bar { grid-area:bar; display:flex; gap:2px; align-items:center; min-width:0; }
.coffee-production-species .sp-seg { display:block; height:16px; width:calc(100% * var(--p)); min-width:2px; }
.coffee-production-species .sp-seg:last-child { border-radius:0 4px 4px 0; }
.coffee-production-species .sp-arabica.sp-seg { background:var(--sp-arabica); }
.coffee-production-species .sp-robusta.sp-seg { background:var(--sp-robusta); }
.coffee-production-species .sp-label { grid-area:label; font-size:.8125rem; color:#bacbb0; }
.coffee-production-species .sp-note { font-size:.875rem; line-height:1.9; color:#bacbb0; margin:12px 0 6px; }
.coffee-production-species :is(.pr-table summary) { min-height:44px; display:flex; align-items:center; font-size:.9375rem; color:#ead5a4; cursor:pointer; }
.coffee-production-species .pr-table table { width:100%; border-collapse:collapse; font-size:.875rem; line-height:1.7; font-variant-numeric:tabular-nums; }
.coffee-production-species .pr-table :is(th, td) { padding:4px 6px; border-bottom:1px solid #8ca47b55; text-align:right; }
.coffee-production-species .pr-table :is(th, td):first-child { text-align:left; }
.coffee-production-species .pr-source { font-size:.8125rem; line-height:1.9; color:#bacbb0; margin:0; }
.coffee-production-species .pr-source a { color:#ead5a4; }
@media (max-width:560px) {
  .coffee-production-species { padding:18px 12px; }
  .coffee-production-species .sp-row { grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"name label" "bar bar"; row-gap:3px; }
  .coffee-production-species .sp-label { text-align:right; }
}
