/* The /countries/ pages. Every class here starts ctp-: a cp- class once
   collided with an existing site rule and collapsed the rail. The shared
   country card (.ctp-ccard) and chart box live in topsci_rankings.css, which
   the Top 10 page loads too. */

/* overflow-x: hidden on html and body (style.css) turns body into its own
   scroll box, which silently stops position: sticky on the rail. clip hides
   the same overflow without creating one. Old browsers ignore it and keep
   hidden, exactly as before. */
html, body { overflow-x: clip; }

.ctp-layout .ts-rail-main { display: flex; flex-direction: column; gap: 18px; }
.ctp-layout .ts-rail-main > * { margin-bottom: 0; }
.ctp-layout .rankings-filter-card { margin-bottom: 0; }

/* Header card */
.ctp-head { margin-bottom: 0; }
.ctp-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--brand); text-decoration: none; margin-bottom: 10px; }
.ctp-back span { font-size: 18px; line-height: 1; }
.ctp-back:hover { text-decoration: underline; }
.ctp-head-row { display: flex; gap: 18px; align-items: center; }
.ctp-flag { width: 60px; height: 42px; object-fit: cover; border-radius: 6px; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 4px 10px rgba(20,36,60,.12); }
.ctp-head-text { min-width: 0; }
.ctp-head .ctp-version { font-size: 12.5px; color: var(--ink-soft); margin: 6px 0 0; }
.ctp-glance { margin: 14px 0 0 !important; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.7; color: var(--ink) !important; }
.ctp-glance b { font-weight: 700; color: var(--brand-700, #1f6abb); }

/* Cards and chips */
.ctp-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; box-shadow: var(--shadow-1); min-width: 0; }
.ctp-card h2 { font-size: 19px; font-weight: 700; color: var(--ink); margin: 0; letter-spacing: -.01em; }
.ctp-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.ctp-sub { font-size: 13.5px; color: var(--ink-soft); margin: 4px 0 0; }
.ctp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ctp-chip { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.ctp-seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.ctp-seg > * { padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); background: #fff; border: 0; margin: 0; cursor: pointer; text-decoration: none; white-space: nowrap; }
.ctp-seg > * + * { border-left: 1.5px solid var(--line); }
.ctp-seg > .is-on { background: var(--brand); color: #fff; }
.ctp-seg > :focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* KPIs */
.ctp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ctp-kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-1); min-width: 0; }
.ctp-kpi-label { font-size: 12.5px; color: var(--ink-soft); }
.ctp-kpi-value { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; line-height: 1.25; margin-top: 4px; }
.ctp-kpi-delta { font-size: 12px; font-weight: 600; margin-top: 4px; }
.ctp-kpi-note { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
.ctp-up { color: var(--green-dark); }
.ctp-down { color: #c0392b; }
.ctp-flat { color: var(--ink-soft); }

/* Growth chart */
.ctp-chart-box { height: 320px; }
.ctp-growth-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin: 16px 0 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.ctp-growth { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.ctp-growth-cell { background: #f5f8fc; border: 1px solid transparent; border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; min-width: 0; }
.ctp-growth-cell.is-sel { border-color: var(--brand-100); background: var(--brand-50); }
.ctp-growth-cell span { font-size: 12px; color: var(--ink-soft); }
.ctp-growth-cell b { font-size: 15px; }
.ctp-details { margin-top: 12px; font-size: 13.5px; }
.ctp-details summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.ctp-details-wrap { overflow-x: auto; margin-top: 10px; }
.ctp-mini-table { width: 100%; border-collapse: collapse; min-width: 420px; }
.ctp-mini-table th, .ctp-mini-table td { padding: 6px 10px; border-bottom: 1px solid #f0f3f7; text-align: right; }
.ctp-mini-table th:first-child, .ctp-mini-table td:first-child { text-align: left; }
.ctp-mini-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }

/* Institutes: a horizontal bar chart, the same list linked under it */
.ctp-inst-chart { position: relative; width: 100%; height: 440px; }
.ctp-inst-n1 { height: 98px; } .ctp-inst-n2 { height: 136px; } .ctp-inst-n3 { height: 174px; }
.ctp-inst-n4 { height: 212px; } .ctp-inst-n5 { height: 250px; } .ctp-inst-n6 { height: 288px; }
.ctp-inst-n7 { height: 326px; } .ctp-inst-n8 { height: 364px; } .ctp-inst-n9 { height: 402px; }

.ctp-inst { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ctp-inst li { display: grid; grid-template-columns: 26px minmax(0, 1fr) 56px; gap: 10px; align-items: baseline; font-size: 13.5px; }
.ctp-inst-rank { color: var(--ink-soft); font-weight: 600; }
.ctp-inst-name { min-width: 0; }
.ctp-inst-name a { color: var(--brand); text-decoration: none; }
.ctp-inst-name a:hover { text-decoration: underline; }
.ctp-inst-n { text-align: right; font-weight: 700; color: var(--ink); }

/* Lists */
.ctp-list { padding: 0; overflow: hidden; background:
    radial-gradient(600px 180px at 12% -20%, rgba(37, 99, 235, .06), transparent 60%),
    radial-gradient(500px 180px at 92% 0%, rgb(3 169 244 / 13%), transparent 60%), #fff; }
.ctp-list.is-loading { opacity: .6; transition: opacity .15s; }
.ctp-list-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 20px 22px 4px; }
.ctp-list-head .ctp-chips { margin-top: 0; }
.ctp-list-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 6px 22px 14px; }
.ctp-list-bar .ctp-sub { margin: 0; }
.ctp-search .tbl-search { width: 240px; }
.ctp-export-locked { color: var(--ink-soft); }
.ctp-export-locked i { color: #b88212; }
.ctp-entries { font-size: 13px; }
.ctp-list-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ctp-filter { position: relative; display: flex; align-items: center; }
.ctp-filter input { width: 280px; max-width: 100%; padding: 8px 40px 8px 12px; border: 1.5px solid var(--line); border-radius: 8px; font-size: 13.5px; color: var(--ink); background: #fff; }
.ctp-filter input:focus { border-color: var(--brand); outline: none; }
.ctp-filter button, .ctp-filter-icon { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); padding: 6px 8px; }
.ctp-filter button:hover { color: var(--brand); }
.ctp-export { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink); text-decoration: none; background: #fff; white-space: nowrap; }
.ctp-export:hover { border-color: var(--brand); color: var(--brand); }
.ctp-filter-note { padding: 0 22px 12px; font-size: 13px; color: var(--ink-soft); }
.ctp-filter-note a { color: var(--brand); }
.ctp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ctp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ctp-table thead th { background: #f5f8fc; color: var(--ink-soft); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: middle; }
.ctp-table tbody td { padding: 11px 14px; border-bottom: 1px solid #f0f3f7; color: var(--ink); vertical-align: middle; }
.ctp-table tbody tr:hover { background: #f7fafd; }
.ctp-table tr[hidden] { display: none !important; }
.ctp-table .ctp-num { text-align: right; white-space: nowrap; }
.ctp-info { color: var(--muted); cursor: help; margin-left: 3px; font-size: 12px; position: relative; }
.ctp-info::after { content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); background: rgba(0,0,0,.88); color: #fff; font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; white-space: nowrap; padding: 6px 10px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 5; }
.ctp-info:hover::after, .ctp-info:focus-visible::after { opacity: 1; }
.ctp-info:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 50%; }
.ctp-pos { width: auto; min-width: 30px; padding: 0 8px; border-radius: 999px; }
.ctp-world { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ctp-people { table-layout: fixed; font-size: 13px; }
.ctp-people tbody td, .ctp-people thead th { padding-left: 10px; padding-right: 10px; }
.ctp-people thead th { white-space: normal; line-height: 1.3; }
.ctp-w-pos { width: 10%; } .ctp-w-world { width: 11%; } .ctp-w-sci { width: 25%; }
.ctp-w-inst { width: 22%; } .ctp-w-sub { width: 17%; } .ctp-w-subrank { width: 15%; }
.ctp-people .sci-row-cell { gap: 8px; }
.ctp-people .sci-avatar, .ctp-people .sci-avatar-fallback { width: 32px; height: 32px; font-size: 11.5px; object-fit: cover; overflow: hidden; }
.sci-avatar-fallback[hidden] { display: none; }
.ctp-sci { min-width: 0; }
.ctp-sci .sci-name a { color: var(--brand); text-decoration: none; }
.ctp-sci .sci-name a:hover { text-decoration: underline; }
.ctp-sci .sci-name { white-space: normal; overflow: visible; }
.ctp-inst-col { min-width: 0; }
.ctp-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; color: var(--ink-soft); text-decoration: none; }
a.ctp-clamp:hover { color: var(--brand); text-decoration: underline; }
.ctp-sub-col { color: var(--ink-soft); overflow-wrap: anywhere; }
.ctp-people .ctp-num { white-space: normal; }
.ctp-m-only { display: none; }
/* The same table on /university_profile/: no Institute column, no colgroup,
   and the page's own sort buttons on every heading. */
/* Same column widths as the country table: the Institute column's share goes
   to Scientist and Sub-field. */
.ctp-u-pos { width: 14%; } .ctp-u-sci { width: 35%; } .ctp-u-sub { width: 25%; } .ctp-u-shift { width: 12%; }
/* style.css caps .results-section at 1100px and centres it, which left a gap
   either side of the university table; here it fills the column like the
   header card above it. Home and Advanced Search keep the cap. */
#scientistsSection.results-section { max-width: none; width: 100%; }
.ctp-uni-people thead th.sortable { cursor: pointer; white-space: normal; }
.ctp-uni-people thead th .sort-btns { display: inline-flex; vertical-align: middle; }
.ctp-uni-people thead th.sortable:hover { color: var(--brand); }
.ctp-uni-people thead th.asc .sort-btns span.up, .ctp-uni-people thead th.desc .sort-btns span.down { opacity: 1; }
.ctp-empty { text-align: center; color: var(--muted); padding: 28px !important; }
.ctp-list-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 22px; font-size: 13px; color: var(--ink-soft); }
.ctp-center { justify-content: center; }
.ctp-pages { display: flex; flex-wrap: wrap; gap: 6px; }
.ctp-page, .ctp-gap { min-width: 38px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 600; font-size: 13.5px; }
.ctp-page { border: 1.5px solid var(--line); color: var(--brand); text-decoration: none; background: #fff; }
.ctp-page:hover { border-color: var(--brand); }
.ctp-page.is-current { background: var(--brand); border-color: var(--brand); color: #fff; }
.ctp-gap { color: var(--muted); min-width: 20px; }

/* Plan gate: a blurred preview of the locked rows behind an upgrade card,
   the same design as /custom_filter/ and the lock tile from /my-certificate/. */
.ctp-locked { position: relative; display: grid; justify-items: center; margin-top: 10px; padding: 18px 22px 30px; border-top: 1px solid var(--line); }
.ctp-locked > * { grid-area: 1 / 1; }
.ctp-mock { width: 100%; pointer-events: none; user-select: none; filter: blur(5px) saturate(.85); opacity: .6;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%); }
.ctp-mock-row { display: grid; grid-template-columns: 56px 1.4fr 1.2fr 1fr; gap: 18px; align-items: center; padding: 16px 4px; border-bottom: 1px solid #eef2f6; color: var(--ink-soft); font-weight: 600; }
.ctp-mock-bar { height: 11px; border-radius: 6px; background: #dbe7f3; display: block; }
.ctp-mock-bar.w1, .ctp-mock-bar.v4, .ctp-mock-bar.u2 { width: 70%; } .ctp-mock-bar.w2, .ctp-mock-bar.v5, .ctp-mock-bar.u3 { width: 55%; }
.ctp-mock-bar.w3, .ctp-mock-bar.v1, .ctp-mock-bar.u4 { width: 82%; } .ctp-mock-bar.w4, .ctp-mock-bar.v2, .ctp-mock-bar.u5 { width: 60%; }
.ctp-mock-bar.w5, .ctp-mock-bar.v3, .ctp-mock-bar.u1 { width: 74%; }
.ctp-upgrade { position: relative; z-index: 2; margin-top: 26px; width: min(640px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; text-align: center; padding: 28px 26px 22px;
  box-shadow: 0 24px 60px -20px rgba(31, 95, 163, .35), 0 8px 24px -12px rgba(20, 36, 60, .15); align-self: start; }
.ctp-upgrade::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 12% -10%, var(--brand-50, #eef5fd) 0%, transparent 55%), radial-gradient(circle at 100% 110%, #fff5dc 0%, transparent 55%); }
.ctp-upgrade > * { position: relative; z-index: 1; }
.ctp-upgrade-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; background: linear-gradient(160deg, var(--brand) 0%, #1f5fa3 100%); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 12px 26px -12px rgba(31, 95, 163, .7); }
.ctp-upgrade-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #b88212; background: #fff5dc; border-radius: 999px; padding: 4px 12px; margin-bottom: 10px; }
.ctp-upgrade h3 { margin: 0 0 8px; font-size: 22px; font-weight: 700; color: #285a8c; }
.ctp-upgrade > p { margin: 0 0 18px; color: #5b6b7c; font-size: 14.5px; line-height: 1.6; }
.ctp-perks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; text-align: left; margin-bottom: 20px; }
.ctp-perk { display: flex; gap: 10px; align-items: flex-start; background: #fbfdff; border: 1px solid #e5edf6; border-radius: 12px; padding: 11px 12px; }
.ctp-perk-icon { width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; background: var(--brand-50, #eef5fd); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.ctp-perk.is-gold .ctp-perk-icon { background: #fff5dc; color: #b88212; }
.ctp-perk strong { display: block; font-size: 13.5px; color: #27425f; }
.ctp-perk small { display: block; font-size: 12.5px; color: #6f8092; }
.ctp-upgrade-btns { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ctp-upgrade-btn, .ctp-upgrade-ghost { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; font-size: 14px; font-weight: 700; border-radius: 11px; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.ctp-upgrade-btn { background: linear-gradient(160deg, var(--brand) 0%, #1f5fa3 100%); color: #fff; box-shadow: 0 6px 16px -6px rgba(31, 95, 163, .55); }
.ctp-upgrade-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 10px 20px -8px rgba(31, 95, 163, .65); }
.ctp-upgrade-ghost { background: #fff; color: var(--brand); border: 1.5px solid var(--brand-light, #c7dcf2); }
.ctp-upgrade-ghost:hover { border-color: var(--brand); background: var(--brand-50, #eef5fd); color: var(--brand); }
.ctp-fineprint { margin-top: 14px; font-size: 12px; color: #6f8092; }
.ctp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 700; text-decoration: none; border: 1.5px solid var(--brand); cursor: pointer; white-space: nowrap; }
.ctp-btn[hidden] { display: none; }
.ctp-btn-primary { background: var(--brand); color: #fff; }
.ctp-btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.ctp-btn-outline { background: #fff; color: var(--brand); }
.ctp-btn-outline:hover { background: var(--brand-50); color: var(--brand-700); }

/* Peers, movers */
.ctp-peers-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ctp-peers-head .ctp-chips { margin-top: 0; }
.ctp-peers-gap { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.ctp-peers-sub { margin: -6px 0 12px; }
.ctp-more-row { text-align: center; }
.ctp-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 13.5px; font-weight: 600; color: var(--brand); text-decoration: none; }
.ctp-more:hover { text-decoration: underline; }
.ctp-yoy { font-size: 12.5px; font-weight: 700; white-space: nowrap; }

/* FAQ, rail */
.ctp-faq h2 { margin-bottom: 8px; }
.ctp-faq details { border-bottom: 1px solid #eef2f6; padding: 12px 0; }
.ctp-faq details:last-child { border-bottom: 0; }
.ctp-faq summary { cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--ink); }
.ctp-faq p { margin: 10px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.ctp-rail-card p { font-size: 13.5px; }
.ctp-rail-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--brand); text-decoration: none; }
.ctp-rail-link:hover { text-decoration: underline; }

/* Map */
.ctp-map-card { padding-bottom: 16px; }
.ctp-map-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ctp-map-wrap { position: relative; }
.ctp-map { width: 100%; aspect-ratio: 960 / 500; background: #f7f9fc; border-radius: 12px; overflow: hidden; position: relative; }
.ctp-map-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.ctp-map-failed .ctp-map-loading { display: none; }
.ctp-map-failed::after { content: "The map could not be loaded. Every country is in the table below."; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--ink-soft); font-size: 13.5px; }
.ctp-map-hint { position: absolute; left: 10px; top: 10px; font-size: 11.5px; color: var(--ink-soft); background: rgba(255,255,255,.88); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; pointer-events: none; }
.ctp-map-svg { display: block; width: 100%; height: 100%; touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; }
.ctp-map.is-zoomed .ctp-map-svg { touch-action: none; cursor: grab; }
.ctp-c { stroke: #fff; stroke-width: .75; vector-effect: non-scaling-stroke; }
.ctp-dot { stroke: #fff; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.ctp-c.is-live, .ctp-dot.is-live { cursor: pointer; }
.ctp-c.is-live:hover, .ctp-c.is-live:focus, .ctp-dot.is-live:hover, .ctp-dot.is-live:focus { stroke: #0b1f3a; stroke-width: 1.6; outline: none; }
.ctp-disputed { fill: url(#ctp-hatch); stroke: #8d96a3; stroke-width: .8; stroke-dasharray: 2.5 2; vector-effect: non-scaling-stroke; }
.ctp-b0 { fill: #e4e6e9; }
.ctp-b1 { fill: #d5e3f5; }
.ctp-b2 { fill: #aac7ec; }
.ctp-b3 { fill: #7aa7df; }
.ctp-b4 { fill: #4a86d1; }
.ctp-b5 { fill: #2566bd; }
.ctp-b6 { fill: #0f3f8a; }
.ctp-map-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ctp-map-zoom button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); box-shadow: var(--shadow-1); display: flex; align-items: center; justify-content: center; }
.ctp-map-zoom button:hover { color: var(--brand); border-color: var(--brand); }
.ctp-map-tip { position: absolute; z-index: 5; min-width: 150px; background: rgba(0,0,0,.88); color: #fff; border-radius: 10px; padding: 10px 12px; font-size: 13px; box-shadow: 0 10px 24px rgba(0,0,0,.25); pointer-events: auto; }
.ctp-map-tip[hidden] { display: none; }
.ctp-map-tip b { display: block; font-size: 14px; margin-bottom: 4px; }
.ctp-tip-row { display: flex; justify-content: space-between; gap: 16px; color: #fff; }
.ctp-tip-row strong { color: #fff; }
.ctp-tip-row strong.ctp-up { color: #6be29a; }
.ctp-tip-row strong.ctp-down { color: #ff9c8f; }
.ctp-tip-link { display: block; margin-top: 6px; color: #9cc5ff; font-size: 12.5px; text-decoration: none; }
.ctp-tip-link:hover { color: #fff; text-decoration: underline; }
.ctp-legend-scale { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: center; margin-top: 12px; font-size: 12.5px; color: var(--ink-soft); }
.ctp-legend-scale span { display: inline-flex; align-items: center; gap: 7px; }
.ctp-legend-scale i { width: 22px; height: 14px; border-radius: 3px; display: inline-block; box-shadow: inset 0 0 0 1px rgba(15,34,64,.08); }
.ctp-legend-scale i.ctp-b0 { background: #e4e6e9; } .ctp-legend-scale i.ctp-b1 { background: #d5e3f5; }
.ctp-legend-scale i.ctp-b2 { background: #aac7ec; } .ctp-legend-scale i.ctp-b3 { background: #7aa7df; }
.ctp-legend-scale i.ctp-b4 { background: #4a86d1; } .ctp-legend-scale i.ctp-b5 { background: #2566bd; }
.ctp-legend-scale i.ctp-b6 { background: #0f3f8a; }
.ctp-legend-scale i.ctp-bd { background: repeating-linear-gradient(45deg, #eef0f3 0 2px, #b9c0c9 2px 3.4px); outline: 1px dashed #8d96a3; outline-offset: -1px; }
.ctp-legend-title { font-weight: 600; color: var(--ink); }
.ctp-map-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.ctp-earlier { padding: 4px 22px 18px; font-size: 13px; line-height: 1.8; color: var(--ink-soft); text-align: center; }
.ctp-earlier b { display: block; color: var(--ink); font-weight: 600; }
.ctp-earlier a { color: var(--brand); text-decoration: none; }
.ctp-earlier a:hover { text-decoration: underline; }
.ctp-world b { color: var(--ink); font-weight: 700; }
.ctp-sortable { cursor: pointer; user-select: none; }
.ctp-sortable:hover { color: var(--brand); }
.ctp-sortable[aria-sort="ascending"]::after { content: " \25B2"; font-size: 9px; }
.ctp-sortable[aria-sort="descending"]::after { content: " \25BC"; font-size: 9px; }
.ctp-country-link { display: inline-flex; align-items: center; gap: 10px; color: var(--brand); text-decoration: none; font-weight: 500; }
.ctp-country-link:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .ctp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .ctp-head-row { align-items: flex-start; }
  .ctp-flag { width: 44px; height: 31px; }
  .ctp-head h1 { font-size: 22px; }
  .ctp-kpi-value { font-size: 23px; }
  .ctp-kpis { gap: 10px; }
  .ctp-kpi { padding: 12px; }
  .ctp-card { padding: 16px; }
  .ctp-chart-box { height: 260px; }
  .ctp-filter, .ctp-filter input { width: 100%; }
  .ctp-inst li { grid-template-columns: 22px minmax(0, 1fr) 44px; }
  .ctp-countries { font-size: 12.5px; }
  .ctp-countries thead th, .ctp-countries tbody td { padding: 8px 8px; }
  .ctp-countries .ctp-country-link { gap: 6px; }
  .ctp-countries th:first-child, .ctp-countries td:first-child { display: none; }
  .ctp-countries .flag-img { width: 18px; height: 13px; }
  .ctp-countries thead th { font-size: .62rem; letter-spacing: .03em; white-space: normal; }
  .ctp-list-foot { padding: 12px 16px; }
  .ctp-locked { padding: 14px 12px 22px; }
  .ctp-upgrade { padding: 22px 16px 18px; margin-top: 16px; }
  .ctp-upgrade h3 { font-size: 19px; }
  .ctp-perks { grid-template-columns: 1fr; }
  .ctp-list-bar { padding: 4px 16px 12px; }
  .ctp-list-head { padding: 16px 16px 4px; }
  .ctp-list-tools { width: 100%; }
  .ctp-list-tools .ctp-search { flex: 1 1 auto; }
  .ctp-search .tbl-search { width: 100%; }
  .ctp-map-hint { font-size: 10.5px; left: 6px; top: 6px; }
  .ctp-layout .ts-rail-main > #all-countries { order: 3; }
  .ctp-layout .ts-rail-main > .ctp-map-card { order: 4; }
  .ctp-layout .ts-rail-main > .ctp-moves { order: 5; }

  /* One card per scientist: rank and name, then institute, then sub-field
     and the sub-field rank. */
  .ctp-people thead, .ctp-people colgroup { display: none; }
  .ctp-people, .ctp-people tbody { display: block; width: 100%; }
  .ctp-people tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "pos sci sci" "pos inst inst" "pos sub rank"; column-gap: 12px; row-gap: 4px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .ctp-people tbody td { display: block; border: 0; padding: 0; min-width: 0; }
  .ctp-people td.ctp-pos-cell { grid-area: pos; align-self: start; padding-top: 4px; }
  .ctp-people td.ctp-world { display: none; }
  .ctp-people td.ctp-sci { grid-area: sci; }
  .ctp-people td.ctp-inst-col { grid-area: inst; font-size: 12.5px; }
  .ctp-people td.ctp-sub-col { grid-area: sub; font-size: 12.5px; }
  .ctp-people td.ctp-subrank { grid-area: rank; font-size: 12.5px; text-align: right; white-space: nowrap; }
  .ctp-people .ctp-clamp { display: block; -webkit-line-clamp: unset; overflow: visible; }
  .ctp-people .ctp-m-only { display: inline; }
  .ctp-people tbody td.ctp-empty { grid-column: 1 / -1; text-align: center; }
  .ctp-people td.ctp-shift { grid-column: 2 / -1; }
}
