.gbi-country .gbi-country__table-wrap { overflow-x: auto; border: 1px solid #dbe3ee; border-radius: 8px; }
.gbi-country .gbi-country__table { width: 100%; border-collapse: collapse; margin: 0; font-size: .875rem; }
.gbi-country .gbi-country__table th, .gbi-country .gbi-country__table td { padding: .65rem .75rem; text-align: left; border: 0; border-bottom: 1px solid #e5eaf0; }
.gbi-country .gbi-country__table thead { background: #edf2f7; }
.gbi-country .gbi-country__table th button { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.gbi-country .gbi-country__table th[aria-sort="descending"] button::after { content: " \2193"; }
.gbi-country .gbi-country__table th[aria-sort="ascending"] button::after { content: " \2191"; }
.gbi-country .gbi-country__table .gbi-country__number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gbi-country .gbi-country__table tr.is-even { background: #f7f9fc; }
.gbi-country .gbi-country__table tbody tr:hover { background: #eef4fb; }
.gbi-country .gbi-country__tools { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.gbi-country .gbi-country__tools input, .gbi-country .gbi-country__tools select { display: block; width: 100%; }
.gbi-country .gbi-country__search { flex: 1 1 16rem; max-width: 28rem; }
.gbi-country .gbi-country__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.gbi-country .gbi-country__stat { padding: 1rem; border: 1px solid #dbe3ee; border-radius: 8px; background: #f7f9fc; }
.gbi-country .gbi-country__stat strong, .gbi-country .gbi-country__stat span { display: block; }
.gbi-country .gbi-country__stat strong { font-size: 1.5rem; color: #0f2d57; }
.gbi-country .gbi-country__pagination { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: flex-end; margin-top: 1rem; }
.gbi-country .gbi-country__pagination button { padding: .5rem .75rem; }
.gbi-country .gbi-style__header { display: block; }
.gbi-country .gbi-match .gbi-match__portfolio-beers ul { padding-left: 0; list-style: none; }
.gbi-country .gbi-match .gbi-match__portfolio-beers .gbi-match__country-beer { padding: .65rem 0; border-bottom: 1px solid #e5eaf0; }
.gbi-country .gbi-match .gbi-match__portfolio-beers li .gbi-match__beer-name { display: block; font-size: .9rem; font-weight: 600; white-space: normal; }
.gbi-country .gbi-match .gbi-match__portfolio-beers li .gbi-match__beer-brewery { display: block; margin: .2rem 0; color: #4b5563; white-space: normal; }
.gbi-country .gbi-match .gbi-match__portfolio-beers li .gbi-match__beer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; white-space: normal; }
.gbi-country .gbi-match .gbi-match__portfolio-beers li .gbi-match__beer-medals { margin-left: 0; }
@media (max-width: 640px) {
  .gbi-country .gbi-country__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .gbi-country .gbi-country__stat { padding: .75rem; }
  .gbi-country .gbi-country__pagination { justify-content: flex-start; }
}

.gbi-discovery__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1rem; margin: 1.25rem 0; }
.gbi-discovery__card { padding: 1.25rem; border: 1px solid #dbe3ee; border-top: 4px solid #0f2d57; border-radius: 10px; background: #fff; box-shadow: 0 3px 12px #0f2d5708; overflow-wrap: anywhere; }
.gbi-discovery__card h3 { margin: .4rem 0; font-size: 1.2rem; }
.gbi-discovery__card p { margin-bottom: .65rem; }
.gbi-discovery__family { color: #0f2d57; font-size: .8rem; font-weight: 700; }
.gbi-discovery__brewery { font-weight: 600; }
.gbi-discovery__award { display: block; font-size: .85rem; }
.gbi-discovery__award > .gbi-medal { display: inline-block; margin-right: .45rem; }
.gbi-discovery__award-info { display: inline; }
.gbi-discovery__award-year { white-space: nowrap; }
.gbi-discovery [data-discovery-status] { min-height: 1.5em; font-size: .9rem; margin-top: .5rem; }
.gbi-discovery a:focus-visible, .gbi-discovery button:focus-visible { outline: 3px solid #0f2d57; outline-offset: 4px; }

.gbi-discovery [data-discovery-refresh] { padding: .7rem 1.1rem; border: 1px solid #0f2d57; border-radius: 6px; background: #0f2d57; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.gbi-discovery [data-discovery-refresh]:disabled { opacity: .6; cursor: default; }

.gbi-discovery__card a { color: #0f2d57; text-decoration: none; text-underline-offset: .15em; }
.gbi-discovery__card a:hover, .gbi-discovery__card a:focus-visible { color: #215b88; text-decoration: underline; text-decoration-thickness: 1px; }
.gbi-discovery__family a { color: inherit; }
.gbi-discovery__awards { margin-top: .6rem; font-size: .85rem; }
.gbi-discovery__awards summary { display: flex; align-items: baseline; gap: .5rem; color: #0f2d57; cursor: pointer; font-weight: 600; list-style: none; text-underline-offset: .15em; }
.gbi-discovery__awards summary::-webkit-details-marker { display: none; }
.gbi-discovery__awards summary::before { content: ""; flex: none; width: .4em; height: .4em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.gbi-discovery__awards[open] summary::before { transform: rotate(45deg); }
.gbi-discovery__awards summary:hover, .gbi-discovery__awards summary:focus-visible { text-decoration: underline; }
.gbi-discovery__awards[open] summary { margin-bottom: .45rem; }
.gbi-discovery__awards > .gbi-discovery__award { margin: 0; padding: .4rem 0; border-top: 1px solid #e5eaf0; }
.gbi-discovery__awards > .gbi-discovery__award:last-child { padding-bottom: 0; }
.gbi-discovery summary:focus-visible { outline: 3px solid #0f2d57; outline-offset: 4px; }
.gbi-discovery [data-discovery-status].gbi-discovery__announcement { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Country Discovery plot only. */
.gbi-discovery-plot { min-width: 0; }
.gbi-discovery-plot__layout { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; margin: 1.25rem 0 .75rem; }
.gbi-discovery-plot__view { min-width: 0; padding: .75rem; border: 1px solid #dbe3ee; border-radius: 10px; background: #fff; }
.gbi-discovery-plot__axis { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; font-size: .85rem; margin: 0; }
.gbi-discovery-plot select { width: auto; max-width: 100%; min-height: 44px; padding: .4rem 1.6rem .4rem .6rem; border: 1px solid #a8b6c8; border-radius: 5px; color: #0f2d57; background-color: #fff; font: inherit; }
.gbi-discovery-plot__chart { width: 100%; }
.gbi-discovery-plot svg { display: block; max-width: 100%; overflow: visible; }
.gbi-discovery-plot svg text { font: 14px Arial, sans-serif; fill: #243b53; }
.gbi-discovery-plot [data-plot-id] { cursor: pointer; }
.gbi-discovery-plot__bubble, .gbi-discovery-plot__ring { pointer-events: none; }
.gbi-discovery-plot__ring { display: none; }
.gbi-discovery-plot g.is-selected .gbi-discovery-plot__ring { display: inline; }
.gbi-discovery-plot g:hover .gbi-discovery-plot__bubble,
.gbi-discovery-plot g:focus-visible .gbi-discovery-plot__bubble,
.gbi-discovery-plot g.is-selected .gbi-discovery-plot__bubble { stroke: #0f2d57; stroke-width: 3; }
.gbi-discovery-plot [data-plot-id]:focus { outline: none; }
.gbi-discovery-plot g:focus-visible .gbi-discovery-plot__hit { stroke: #0f2d57; stroke-width: 2; stroke-dasharray: 3 3; }
.gbi-discovery-plot__legends { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1.5rem; max-width: 760px; font-size: .8rem; margin-top: 1.25rem; }
.gbi-discovery-plot__legends p { margin: .4rem 0 0; color: #52647a; }
.gbi-discovery-plot__legend-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.gbi-discovery-plot__mode { display: flex; align-items: center; gap: .4rem; margin: 0; }
.gbi-discovery-plot__colorbar { width: 100%; height: 16px; margin-top: .75rem; border: 1px solid #9aa9b9; border-radius: 4px; }
.gbi-discovery-plot__color-labels { display: flex; justify-content: space-between; gap: .2rem; margin-top: .25rem; font-size: .75rem; }
.gbi-discovery-plot__list { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; font-size: .85rem; }
.gbi-discovery-plot__list select { max-width: min(100%, 24rem); }
.gbi-discovery-plot__detail { min-width: 0; padding: 1rem; border: 1px solid #dbe3ee; border-radius: 10px; background: #f5f8fc; overflow-wrap: anywhere; font-size: .9rem; }
.gbi-discovery-plot__info > strong { display: block; font-size: 1.05rem; color: #0f2d57; }
.gbi-discovery-plot__detail a { color: inherit; font: inherit; text-decoration: none; }
.gbi-discovery-plot__detail a:hover, .gbi-discovery-plot__detail a:focus-visible { color: #315b85; text-decoration: underline; }
.gbi-discovery-plot__detail p { margin: .3rem 0; }
.gbi-discovery-plot__detail dl { margin: .9rem 0; font-size: .85rem; }
.gbi-discovery-plot__detail dt { font-weight: 600; color: #243b53; }
.gbi-discovery-plot__detail dd { margin: .15rem 0 .65rem; color: #52647a; }
.gbi-discovery-plot a:focus-visible, .gbi-discovery-plot select:focus-visible { outline: 3px solid #0f2d57; outline-offset: 3px; }
.gbi-discovery-plot__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 800px) {
  .gbi-discovery-plot__layout { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .gbi-discovery-plot__detail { padding: .75rem; }
  .gbi-discovery-plot__detail dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem .75rem; margin: .65rem 0; }
  .gbi-discovery-plot__detail dd { margin: 0; }
  .gbi-discovery-plot__legends { grid-template-columns: minmax(0, 1fr); gap: 1rem; max-width: 420px; }
}

/* A faint edge keeps pale EBC accents visible; the existing 4px border supplies the colour. */
.gbi-discovery__card[data-ebc-accent] { position: relative; }
.gbi-discovery__card[data-ebc-accent]::before { content: ""; position: absolute; top: -4px; left: -1px; right: -1px; height: 4px; border: 1px solid #0f2d5726; border-bottom: 0; border-radius: 10px 10px 0 0; pointer-events: none; }

.gbi-discovery-plot__sidebar .gbi-discovery-plot__list { display: block; margin: 0 0 .85rem; }
.gbi-discovery-plot__sidebar .gbi-discovery-plot__list select { display: block; width: 100%; max-width: 100%; margin-top: .35rem; }
.gbi-discovery-plot__reference { display: block; margin-top: .2rem; font-size: .85em; color: #52647a; }

.gbi-discovery-plot__sidebar { min-width: 0; }
.gbi-discovery-plot [data-plot-overlay] { pointer-events: none; }
.gbi-discovery-plot .is-focus-preview .gbi-discovery-plot__hit { stroke: #0f2d57; stroke-width: 2; stroke-dasharray: 3 3; }

.gbi-discovery-plot [data-layer-selected] .gbi-discovery-plot__ring { display: inline; }
.gbi-discovery-plot [data-layer-selected] .gbi-discovery-plot__bubble { stroke: #0f2d57; stroke-width: 3; }

/* Full selected-beer history, using the same compact medal rows as Discovery cards. */
.gbi-discovery-plot__awards h4 { margin: .7rem 0 .3rem; font-size: .9rem; color: #243b53; }
.gbi-discovery-plot__awards ul { margin: 0; padding: 0; list-style: none; }
.gbi-discovery-plot__awards li { margin: 0; padding: 0; }

.gbi-discovery .gbi-discovery__card { cursor: pointer; }
.gbi-discovery .gbi-discovery__card:focus-visible { outline: 3px solid #0f2d57; outline-offset: 3px; }
.gbi-discovery .gbi-discovery__card.is-plot-selected { box-shadow: 0 0 0 2px #0f2d57; }

/* Page-local comparison controls; weekly cards remain independent of plot mode. */
.gbi-discovery__compare {font:inherit;font-size:.85rem;padding:.3rem .6rem;cursor:pointer;}
.gbi-discovery .gbi-discovery__compare {margin-top:.6rem;}
.gbi-discovery-plot__modes,.gbi-discovery-plot__filters {display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin:0 0 .8rem;}
.gbi-discovery-plot__modes button,.gbi-discovery-plot__filters button {font:inherit;font-size:.9rem;padding:.4rem .65rem;}
.gbi-discovery-plot__modes button[aria-pressed="true"],.gbi-discovery__compare[aria-pressed="true"] {background:#0f2d57;color:#fff;}
.gbi-discovery-plot__modes [data-comparison-count] {font-size:.85rem;}
.gbi-discovery-plot__filters label {display:flex;align-items:center;gap:.3rem;}
.gbi-discovery-plot__filters select,.gbi-discovery-plot__overlap select {max-width:100%;}
.gbi-discovery-plot__overlap {display:block;margin-bottom:.5rem;font-size:.9rem;}
.gbi-discovery-plot__filters[hidden],.gbi-discovery-plot__overlap[hidden] {display:none;}
.gbi-discovery__compare:focus-visible,.gbi-discovery-plot__modes button:focus-visible,.gbi-discovery-plot__filters button:focus-visible {outline:3px solid #32689b;outline-offset:3px;}

.gbi-discovery-plot__selection {display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:.8rem;}
.gbi-discovery-plot__selection[hidden] {display:none;}

/* Compact hierarchy for exploration modes and optional filters. */
.gbi-discovery-plot__control-heading {font-size:1rem;margin:.6rem 0 .4rem;}
.gbi-discovery-plot__modes {display:inline-flex;gap:0;border:1px solid #0f2d57;border-radius:5px;overflow:visible;max-width:100%;}
.gbi-discovery-plot__modes button {border:0;border-radius:0;background:#fff;color:#0f2d57;margin:0;min-height:40px;flex:1 1 auto;}
.gbi-discovery-plot__modes button+button {border-left:1px solid #0f2d57;}
.gbi-discovery-plot__modes button[aria-pressed="true"] {background:#0f2d57;color:#fff;font-weight:700;box-shadow:inset 0 -3px 0 #729cc2;}
.gbi-discovery-plot__filter-group {border-left:2px solid #d7e1ec;padding-left:.7rem;margin:.3rem 0 .8rem;}
.gbi-discovery-plot__filter-group p,.gbi-discovery-plot__counts,.gbi-discovery__hint {font-size:.85rem;margin:.3rem 0 .5rem;color:#44566c;}
.gbi-discovery-plot__filter-group[hidden],.gbi-discovery-plot__counts[hidden],.gbi-discovery__hint[hidden] {display:none;}
.gbi-discovery .gbi-discovery__compare {max-width:100%;white-space:normal;overflow-wrap:anywhere;line-height:1.3;}

.gbi-discovery-plot__modes {flex-wrap:nowrap;}
.gbi-discovery-plot__modes button {min-width:0;line-height:1.3;}
.gbi-discovery-plot__modes button:first-child {border-radius:4px 0 0 4px;}
.gbi-discovery-plot__modes button:last-child {border-radius:0 4px 4px 0;}

.gbi-discovery-plot__filters label {min-width:0;max-width:100%;}
.gbi-discovery-plot__filters select {min-width:0;flex:1;}

.gbi-discovery-plot__overlap {margin:.5rem 0 0;padding:.5rem .6rem;background:#f4f7fb;border-radius:4px;}
.gbi-discovery-plot__overlap strong,.gbi-discovery-plot__overlap span {display:block;margin-bottom:.25rem;}
.gbi-discovery-plot__overlap select {width:100%;}

/* Shared Discovery: flavour comparison is subordinate to the card introduction. */
.gbi-discovery > .gbi-discovery-plot { margin-top: 2rem; }
.gbi-discovery > .gbi-discovery-plot > h3.gbi-section-title { font-size: 1.4rem; }

/* Honor unavailable/redundant controls even where component styles set display. */
.gbi-country__tools [hidden], .gbi-country__pagination[hidden], .gbi-discovery-plot__view[hidden], .gbi-discovery-plot__legends[hidden] { display: none; }
