/* Dino Research: self-contained, responsive visual system, no external libraries. */
body.research-page {
  --r-surface: #fff;
  --r-subtle: #f5f8f5;
  --r-ink: #172e20;
  --r-muted: #647568;
  --r-border: #dde7de;
  --r-accent: #127a43;
  --r-teal: #1a9d6c;
  --r-shadow: 0 15px 40px rgba(29,58,35,.065);
}
html[data-theme="dark"] body.research-page {
  --r-surface: #17241b;
  --r-subtle: #1c3023;
  --r-ink: #eaf7ed;
  --r-muted: #b4c9b8;
  --r-border: #34483a;
  --r-accent: #87e7a3;
  --r-teal: #65ce98;
  --r-shadow: 0 15px 40px rgba(0,0,0,.12);
}
/* Follow exactly the same outer content shell as the rest of run-dino.run. */
body.research-page #site-main.research-main {
  box-sizing: border-box;
  width: min(var(--site-content-max, 1080px), calc(100% - var(--site-desktop-gutter, 40px)));
  max-width: var(--site-content-max, 1080px);
  min-width: 0;
  margin: 0 auto;
  padding: 0 0 3rem;
  color: var(--r-ink);
}
.research-main :is(h1,h2,h3,p) { max-width: none; }
/* Text fills its immediate content column; only the site's outer shell is capped. */
.research-main :is(.research-scope > div, .research-section-head > div, .research-method-item p) {
  min-width: 0;
  max-width: none;
}
.research-main :is(.research-scope > div, .research-section-head > div) { width: 100%; }
.research-main :is(.research-hero-copy, .research-section-head, .research-scope, .research-method, .research-card) {
  max-width: 100%;
}

.research-main :is(button,a) { -webkit-tap-highlight-color: transparent; }
.research-main button:focus-visible, .research-main a:focus-visible,
.research-main .map-country:focus-visible {
  outline: 3px solid var(--r-teal); outline-offset: 3px;
}
.research-breadcrumb {
  display: flex; align-items: center; gap: .6rem;
  color: var(--r-muted); font-size: .8rem; padding: 1.2rem 0 .6rem;
}
.research-breadcrumb a { color: inherit; text-decoration: none; }
.research-breadcrumb a:hover { color: var(--r-accent); }
.research-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 238px; border-radius: 24px;
  padding: clamp(1.35rem, 4vw, 3.2rem);
  background: radial-gradient(circle at 88% 32%, rgba(110,220,143,.4), transparent 33%),
              linear-gradient(115deg, #142d20 1%, #245a38 60%, #246a48 100%);
  color: #f0fff4;
}
.research-hero-copy { position: relative; z-index: 1; width: 100%; min-width: 0; max-width: none; }
.research-eyebrow { margin: 0 0 .7rem; font-size: .73rem; letter-spacing: .16em; font-weight: 800; color: #a2ebbd; }
.research-hero h1 { margin: 0; color: #f1fff4; font-size: clamp(2.2rem, 6vw, 4.6rem); line-height: 1.04; letter-spacing: -.055em; }
.research-hero p:not(.research-eyebrow) { margin: 1rem 0 0; width: 100%; max-width: none; color: #d5ecdc; font-size: clamp(.9rem, 1.6vw, 1.12rem); line-height: 1.65; }
.research-hero-art { pointer-events: none; position: absolute; right: 0; top: 0; width: 38%; height: 100%; opacity: .8; }
.research-dino { position: absolute; right: 24%; top: 35%; color: #b3e9a2; font-size: 60px; transform: rotate(45deg); opacity: .7; }
.research-orbit { position: absolute; border: 1px solid rgba(200,255,204,.28); border-radius: 50%; right: 13%; top: 50%; transform: translateY(-50%) rotate(-22deg); }
.orbit-one { width: 180px; height: 180px; }
.orbit-two { width: 260px; height: 260px; }
.orbit-three { width: 350px; height: 350px; }
.research-scope { display: flex; gap: .7rem; padding: 1rem 1.25rem; border: 1px solid var(--r-border); background: var(--r-surface); border-radius: 14px; margin: 1.15rem 0 1.6rem; }
.research-scope strong { display: block; color: var(--r-ink); font-size: .92rem; }
.research-scope p { margin: .22rem 0 0; color: var(--r-muted); font-size: .85rem; line-height: 1.5; }
.research-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1rem; margin: 0 0 1rem; }
.research-toolbar-label { font-size: .86rem; color: var(--r-muted); font-weight: 650; }
.research-periods, .research-trend-switch { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; padding: .3rem; border: 1px solid var(--r-border); border-radius: 12px; background: var(--r-surface); }
.research-main :is(.research-periods,.research-trend-switch) button { border: 0; border-radius: 9px; padding: .55rem .95rem; color: var(--r-muted); background: transparent; cursor: pointer; font: inherit; font-size: .83rem; font-weight: 700; transition: background .2s, color .2s; min-height: 40px; }
.research-main :is(.research-periods,.research-trend-switch) button.is-current { background: var(--r-ink); color: var(--r-surface); box-shadow: 0 3px 9px rgba(0,0,0,.08); }
.research-main :is(.research-periods,.research-trend-switch) button:disabled { opacity: .55; cursor: progress; }
.research-updated { margin-left: auto; color: var(--r-muted); font-size: .74rem; }
.research-feedback { margin: .75rem 0 1rem; border-radius: 12px; border: 1px solid var(--r-border); background: var(--r-subtle); color: var(--r-muted); padding: .8rem 1rem; font-size: .88rem; }
.research-dashboard-data[hidden] { display: none; }
.research-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr)); gap: 1rem; margin-bottom: 1.3rem; }
.research-kpi { position: relative; display: grid; gap: 1rem; min-width: 0; padding: clamp(1rem, 2vw, 1.5rem); border: 1px solid var(--r-border); border-radius: 17px; background: var(--r-surface); box-shadow: var(--r-shadow); overflow: hidden; }
.research-kpi span { position: relative; z-index: 1; color: var(--r-muted); font-size: .85rem; font-weight: 700; }
.research-kpi strong { position: relative; z-index: 1; color: var(--r-ink); font-size: clamp(1.4rem, 3vw, 2.6rem); letter-spacing: -.045em; font-weight: 850; font-variant-numeric: tabular-nums; }
.research-kpi i { position: absolute; right: -30px; bottom: -65px; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, rgba(32,157,91,.075), transparent 70%); }
.research-card { border: 1px solid var(--r-border); border-radius: 18px; padding: clamp(1rem,2.4vw,1.65rem); background: var(--r-surface); box-shadow: var(--r-shadow); min-width: 0; }
.research-section-head { margin: 0 0 1.3rem; }
.research-kicker { margin: 0 0 .35rem; font-size: .68rem; font-weight: 850; letter-spacing: .12em; color: var(--r-accent); }
.research-section-head h2 { font-size: clamp(1.35rem, 2vw, 1.8rem); margin: 0; color: var(--r-ink); letter-spacing: -.03em; line-height: 1.2; }
.research-section-head p:not(.research-kicker) { margin: .45rem 0 0; color: var(--r-muted); font-size: .87rem; line-height: 1.5; }
.research-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(218px, 290px); align-items: stretch; gap: 1rem; }
.research-map-panel { min-width: 0; padding: .7rem; display: flex; align-items: center; justify-content: center; flex-direction: column; background: var(--r-subtle); border: 1px solid var(--r-border); border-radius: 14px; }
.research-map-viewport { width: 100%; max-width: 100%; min-height: 245px; display: flex; align-items: center; justify-content: center; }
.research-world { display: block; width: 100%; max-height: 435px; height: auto; overflow: visible; }
.map-country { fill: var(--map-fill, #d9e3da); stroke: var(--r-surface); stroke-width: 1.15; stroke-linejoin: round; transition: fill .35s, stroke .2s, filter .2s; }
.map-country.has-data { cursor: pointer; }
.map-country.has-data:hover, .map-country.is-selected { fill: #24b16c; stroke: #145433; stroke-width: 1.8; filter: drop-shadow(0 2px 2px rgba(12,62,28,.3)); }
.research-map-empty { margin: 0 0 .3rem; color: var(--r-muted); text-align: center; font-size: .85rem; }
.research-country-detail { border: 1px solid var(--r-border); border-radius: 14px; padding: clamp(.9rem,1.5vw,1.3rem); min-width: 0; background: var(--r-subtle); }
.detail-eyebrow { display: block; margin-bottom: .9rem; color: var(--r-accent); font-weight: 850; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.country-detail-head { display: flex; align-items: center; gap: .75rem; }
.country-detail-head img { border-radius: 4px; border: 1px solid var(--r-border); object-fit: cover; flex: none; }
.country-detail-head h3 { margin: 0; color: var(--r-ink); font-size: clamp(1.05rem,1.5vw,1.3rem); overflow-wrap: anywhere; }
.research-country-detail > p { color: var(--r-muted); font-size: .82rem; line-height: 1.5; margin: 1rem 0 0; }
.research-country-numbers { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; margin: 1rem 0 0; }
.research-country-numbers > div { padding: .65rem; border-radius: 9px; background: var(--r-surface); border: 1px solid var(--r-border); min-width: 0; }
.research-country-numbers dt { font-size: .74rem; color: var(--r-muted); line-height: 1.3; }
.research-country-numbers dd { margin: .3rem 0 0; font-variant-numeric: tabular-nums; color: var(--r-ink); font-size: 1.05rem; font-weight: 800; overflow-wrap: anywhere; }
.research-list-head { display: flex; justify-content: space-between; align-items: center; margin: 1.25rem 0 .55rem; }
.research-list-head h3 { margin: 0; color: var(--r-ink); font-size: 1rem; }
.research-country-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: .5rem; list-style: none; padding: 0; margin: 0; }
.research-country-list > li { min-width: 0; margin: 0; padding: 0; }
.research-country-list button {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  display: grid;
  grid-template-columns: 1.6rem 25px minmax(0, 1fr) max-content;
  column-gap: .55rem;
  align-items: center;
  border: 1px solid var(--r-border);
  border-radius: 10px;
  background: var(--r-subtle);
  color: var(--r-ink);
  font: inherit;
  padding: .5rem .65rem;
  cursor: pointer;
  text-align: left;
  transition: border-color .2s, background .2s;
}
.research-country-list button:hover, .research-country-list button[aria-pressed="true"] { background: var(--r-surface); border-color: var(--r-teal); }
.research-rank { grid-column: 1; width: 100%; text-align: center; font-size: .74rem; color: var(--r-muted); font-variant-numeric: tabular-nums; }
.research-country-list img { grid-column: 2; display: block; width: 25px; height: 19px; border: 1px solid var(--r-border); border-radius: 3px; object-fit: cover; }
.research-country-title { grid-column: 3; min-width: 0; width: 100%; font-size: .8rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.research-country-list button > strong { grid-column: 4; justify-self: end; text-align: right; font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.research-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.25rem 0 0; }
.research-buckets { display: grid; gap: 1.05rem; margin-top: 1.8rem; }
.research-bucket { display: grid; grid-template-columns: 104px minmax(0, 1fr) 54px; align-items: center; gap: .7rem; }
.research-bucket > span { font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--r-muted); }
.research-bucket strong { color: var(--r-ink); text-align: right; font-size: .83rem; font-variant-numeric: tabular-nums; }
.research-bar-track { height: 13px; border-radius: 99px; background: var(--r-subtle); overflow: hidden; }
.research-bar-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg,#3bc78b,#107b50); transition: width .8s cubic-bezier(.2,.7,.1,1); }
.research-bucket:nth-child(2) .research-bar-fill { background: linear-gradient(90deg,#4dceac,#0e927e); }
.research-bucket:nth-child(3) .research-bar-fill { background: linear-gradient(90deg,#6fbfbc,#15888b); }
.research-bucket:nth-child(4) .research-bar-fill { background: linear-gradient(90deg,#8dc2bb,#318a83); }
.research-bucket:nth-child(5) .research-bar-fill { background: linear-gradient(90deg,#a5cf9a,#4c8d5f); }
.research-bucket:nth-child(6) .research-bar-fill { background: linear-gradient(90deg,#b2d89e,#739d40); }
.research-trend-switch { width: max-content; max-width: 100%; margin: .5rem 0 1rem; }
.research-line-frame { padding: .3rem 0 0; }
.research-line { width: 100%; height: 220px; display: block; overflow: visible; }
.research-grid-lines path { fill: none; stroke: var(--r-border); stroke-width: 1; stroke-dasharray: 3 5; }
.research-trend-area { fill: rgba(30,170,106,.12); }
.research-trend-path { fill: none; stroke: var(--r-teal); stroke-width: 3.3; stroke-linecap: round; stroke-linejoin: round; transition: stroke-dashoffset 1.2s ease; }
.research-dot { fill: var(--r-accent); stroke: var(--r-surface); stroke-width: 1.2; }
.research-trend-axis { display: flex; justify-content: space-between; gap: .7rem; padding: 0 .35rem; font-size: .72rem; color: var(--r-muted); }
.research-trend-details { margin: 1rem 0 0; font-size: .81rem; }
.research-trend-details summary { cursor: pointer; color: var(--r-accent); font-weight: 750; padding: .25rem 0; }
.research-trend-details table { margin: .5rem 0 0; width: 100%; border-collapse: collapse; }
.research-trend-details :is(th,td) { padding: .45rem .65rem; text-align: left; border-bottom: 1px solid var(--r-border); }
.research-trend-details :is(th,td):last-child { text-align: right; font-variant-numeric: tabular-nums; }
.research-method { margin: 1.3rem 0 0; padding: clamp(1rem,2.4vw,1.7rem); border: 1px solid var(--r-border); border-radius: 18px; background: var(--r-surface); }
.research-method h2 { margin: 0 0 1.2rem; font-size: clamp(1.3rem,2.4vw,1.75rem); color: var(--r-ink); }
.research-method-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem 1.8rem; }
.research-method-item { display: flex; gap: .75rem; align-items: start; }
.research-method-item span { flex: none; border-radius: 8px; background: var(--r-subtle); border: 1px solid var(--r-border); color: var(--r-accent); font-size: .75rem; padding: .4rem; font-weight: 800; }
.research-method-item p { margin: 0; color: var(--r-muted); font-size: .88rem; line-height: 1.55; }
.research-disclaimer { margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--r-border); color: var(--r-muted); font-size: .81rem; }
.research-related { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; margin-top: 1.25rem; padding: 1rem 0; }
.research-related strong { margin-right: auto; color: var(--r-ink); }
.research-related a { display: inline-flex; min-height: 40px; align-items: center; color: var(--r-accent); font-size: .85rem; font-weight: 750; border: 1px solid var(--r-border); border-radius: 9px; background: var(--r-surface); padding: .45rem .8rem; text-decoration: none; }
.research-related a:hover { border-color: var(--r-teal); }
@media (max-width: 1080px) {
  .research-map-layout { grid-template-columns: minmax(0,1fr) minmax(210px,240px); }
}
@media (max-width: 820px) {
  .research-chart-grid { grid-template-columns: minmax(0,1fr); }
  .research-map-layout { grid-template-columns: minmax(0,1fr); }
  .research-map-viewport { min-height: 0; }
  .research-country-detail { display: block; }
  .research-method-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 520px) {
  /* The shared #site-main shell already supplies 10px gutters on phones. */
  .research-hero { border-radius: 16px; padding: 1.35rem 1rem; min-height: 200px; }
  .research-hero-art { opacity: .32; }
  .research-breadcrumb { padding-top: .65rem; }
  .research-scope { padding: .85rem; }
  .research-toolbar { gap: .5rem; }
  .research-periods { width: 100%; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .research-main .research-periods button { font-size: .72rem; padding: .45rem .3rem; min-height: 44px; }
  .research-updated { margin-left: 0; width: 100%; }
  .research-kpis { gap: .6rem; }
  .research-kpi { border-radius: 13px; min-height: 110px; }
  .research-kpi span { font-size: .75rem; }
  .research-kpi strong { font-size: clamp(1.25rem, 5vw, 1.8rem); }
  .research-card { border-radius: 14px; padding: .8rem; }
  .research-country-list button { column-gap: .45rem; padding-inline: .55rem; }
  .research-map-panel { padding: .4rem; }
  .research-map-viewport { min-height: 0; }
  .research-bucket { grid-template-columns: 92px minmax(0,1fr) 38px; gap: .38rem; }
  .research-bucket > span, .research-bucket strong { font-size: .72rem; }
  .research-line { height: 170px; }
  .research-trend-axis { font-size: .65rem; }
  .research-related strong { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .research-main *, .research-main *::before, .research-main *::after { animation: none !important; transition: none !important; }
}
