/* EduStats — Open Campus. Shared presentation layer over stable v2 components.
   The legacy DOM remains the contract for filters, reviews, login and Mini App. */
:root {
  --bg: #f7f8f2;
  --surface: #fff;
  --surface-alt: #f1f3eb;
  --surface-elev: #fff;
  --text: #183c32;
  --text-muted: #5b6d63;
  --text-dim: #66736b;
  --border: #dfe5da;
  --border-strong: #bccbbe;
  --accent: #23664e;
  --accent-text: #205e48;
  --accent-soft: #e7efe3;
  --accent-bg: #edf3e9;
  --success: #287653;
  --success-soft: #e6f2e7;
  --danger: #b54d3d;
  --danger-soft: #faeee9;
  --warning: #916b16;
  --warning-soft: #f6efcf;
  --lime: #e4edb7;
  --peach: #f4e5d5;
  --board: #eef0e3;
  --shadow: 0 2px 3px #193c3204;
  --shadow-lg: 0 16px 48px #163e3214;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --card-pad: 24px;
}
[data-theme="dark"] {
  --bg: #10231e;
  --surface: #192e27;
  --surface-alt: #21392f;
  --surface-elev: #264035;
  --text: #f0f3e9;
  --text-muted: #b2c1b4;
  --text-dim: #a2b5a7;
  --border: #344b3f;
  --border-strong: #52725e;
  --accent: #b8d790;
  --accent-text: #cee6ad;
  --accent-soft: #2d4635;
  --accent-bg: #253c2e;
  --success: #a9dba8;
  --success-soft: #294535;
  --danger: #f0ad98;
  --danger-soft: #49372e;
  --warning: #efd18a;
  --warning-soft: #433e27;
  --lime: #35462d;
  --peach: #453d2e;
  --board: #213a2e;
  --shadow: 0 2px 3px #0000000a;
  --shadow-lg: 0 16px 40px #0003;
}
:root, [data-theme="dark"] {
  --nc-bg: var(--bg);
  --nc-surface: var(--surface);
  --nc-card-bg: var(--surface);
  --nc-text: var(--text);
  --nc-muted: var(--text-muted);
  --nc-muted-2: var(--text-dim);
  --nc-divider: var(--border);
  --nc-fill: var(--surface-alt);
  --nc-chip-text: var(--text-muted);
  --nc-accent: var(--accent);
  --nc-accent-soft: var(--accent-text);
  --nc-accent-tint: var(--accent-soft);
  --nc-sent-pos: var(--success);
  --nc-sent-neg: var(--danger);
  --nc-sent-mid: var(--warning);
  --nc-font: var(--font);
  --nc-shadow-sm: none;
  --nc-shadow-md: var(--shadow-lg);
}
body { font-size: 14px; }
button, input, select, textarea { accent-color: var(--accent); }
::selection { background: var(--lime); color: var(--text); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
#page-content:focus { outline: none; }
.sr-only { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.container { max-width: 1328px; padding-inline: 40px; }
.page-main { padding-bottom: 64px; }
.page-main > .container { padding-inline:0; }
.header { height: 80px; background: var(--bg); backdrop-filter: none; }
.header-inner { gap: 24px; }
.brand { gap: 10px; font-size: 23px; letter-spacing: -.055em; flex-shrink:0; }
.brand-mark { position:relative; overflow:hidden; width:38px; height:38px; border-radius:12px; background:#235e49; color:#e7efbb; }
/* Frame the transparent source's padded canvas around the visible bars and cap. */
.brand-mark > .brand-mark__image { position:absolute; top:50%; left:50%; width:125%; max-width:none; height:auto; transform:translate(-51.8%, -50.7%); }
.miniapp-loader__mark.brand-mark { width:56px; height:56px; border-radius:14px; }
.nav-links { align-items:center; gap:0; }
.nav-link { padding: 10px 11px; font-size: 12px; white-space:nowrap; border-radius:8px; }
.nav-link.active { color: var(--text); background: transparent; box-shadow: inset 0 -2px var(--accent); }
.header-search { max-width:180px; min-width:100px; }
.header-search .input-wrap { background:transparent; border-color:var(--border); border-radius:10px; }
.header-search input { min-width:0; }
.header-actions { margin-left:auto; gap:8px; flex-shrink:0; }
.header-actions > a[href$="bot"], .header-actions > a[href$="Bot"] { display:none; }
.btn { min-height:44px; border-radius:10px; font-weight:650; letter-spacing: -.015em; background:var(--accent); color:#fff; box-shadow:none; }
.btn:hover { box-shadow:none; filter:brightness(.96); transform:translateY(-1px); }
.btn--ghost { background:transparent; color:var(--text); }
.btn--soft { background:var(--accent-soft); color:var(--accent-text); }
.btn--danger { background:var(--danger); color:#fff; }
.btn--sm { min-height:40px; padding:9px 14px; }
.btn--dark { background:var(--text); color:var(--bg); }
[data-theme="dark"] .btn:not(.btn--ghost):not(.btn--soft):not(.btn--dark):not(.btn--secondary) { color:#173628; }
.icon-btn { min-width:40px; min-height:40px; border-radius:10px; }
.header-cta { white-space:nowrap; }
.nav-explore { position:relative; }
.nav-explore summary { list-style:none; display:flex; gap:5px; align-items:center; cursor:pointer; }
.nav-explore summary::-webkit-details-marker { display:none; }
.nav-explore[open] summary { background:var(--accent-soft); }
.nav-explore__panel { position:absolute; top:calc(100% + 12px); left:0; padding:8px; min-width:245px; border:1px solid var(--border); border-radius:16px; background:var(--surface); box-shadow:var(--shadow-lg); }
.nav-explore__panel a { display:flex; align-items:center; gap:12px; padding:13px; color:var(--text); border-radius:9px; }
.nav-explore__panel a:hover { background:var(--accent-soft); }
.drawer-label { color:var(--text-muted); font-size:10px; letter-spacing:.1em; margin:18px 14px 4px; font-weight:700; }
.nav-drawer-panel { overflow-y:auto; max-width:380px; padding:20px 20px calc(24px + env(safe-area-inset-bottom)); }
.nav-drawer .nav-link.active { box-shadow:none; background:var(--accent-soft); }
.bottom-nav { border-top:1px solid var(--border); box-shadow:0 -8px 24px #183c3205; }
.bottom-nav__item.active { color:var(--accent-text); }
.bottom-nav__item.active::before { background:var(--lime); }
.overline, .eyebrow, .section-head__eyebrow { font-size:10px; font-weight:750; letter-spacing:.14em; color:var(--accent-text); }
.overline { display:inline-flex; align-items:center; gap:9px; }
.status-dot { display:inline-block; flex:none; width:7px; height:7px; border-radius:50%; background:var(--success); }
.status-dot--negative { background:var(--danger); }
/* Discovery: editorial typography paired with an actual, labelled aggregate. */
.discovery-hero { display:grid; grid-template-columns:1.12fr 1fr; gap:80px; align-items:center; padding:72px 0 66px; }
.discovery-hero h1 { font-size:clamp(46px,4.9vw,68px); line-height:1.06; letter-spacing:-.065em; font-weight:750; margin:22px 0; }
.discovery-hero h1 em { font-family:Georgia,'Times New Roman',serif; font-weight:400; letter-spacing:-.06em; color:var(--accent); }
.discovery-hero__copy > p { font-size:16px; line-height:1.8; max-width:440px; color:var(--text-muted); }
.discovery-search { margin-top:28px; padding:7px 7px 7px 18px; display:flex; gap:12px; align-items:center; background:var(--surface); border:1px solid var(--border-strong); border-radius:14px; box-shadow:0 5px 0 #203e3104; }
.discovery-search:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.discovery-search > svg { color:var(--accent); flex-shrink:0; }
.discovery-search input { width:100%; min-width:0; padding:12px 0; outline:none; border:0; background:transparent; font-size:13px; }
.discovery-search .btn { flex-shrink:0; padding:12px 17px; }
.discovery-trends { display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px; font-size:10px; margin-top:14px; color:var(--text-muted); }
.discovery-trends a { display:inline-flex; gap:4px; align-items:center; text-decoration:underline; text-underline-offset:3px; font-weight:650; }
.discovery-links { margin-top:26px; display:flex; gap:24px; }
.discovery-links a { display:flex; align-items:center; gap:8px; color:var(--text); font-size:12px; font-weight:650; }
.discovery-links a:hover { color:var(--accent); }
.discovery-hero__visual { position:relative; padding:0 14px 60px 0; isolation:isolate; }
.discovery-note { display:flex; align-items:center; gap:12px; position:absolute; right:-14px; bottom:2px; padding:16px 20px; background:var(--lime); color:var(--text); border:1px solid var(--border-strong); border-radius:12px; transform:rotate(-4deg); box-shadow:0 8px 16px #183c3208; font-size:11px; line-height:1.65; }
.discovery-note > svg { flex:none; }
.discovery-orbit { width:72px; height:72px; border:1px solid var(--border-strong); border-radius:50%; position:absolute; top:-22px; right:-15px; z-index:-1; }
.explore-paths { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:44px; }
.explore-path { min-width:0; display:flex; align-items:flex-start; gap:12px; padding:22px 18px; border:1px solid var(--border); border-radius:16px; color:var(--text); background:var(--surface); transition:transform .2s,border-color .2s; }
.explore-path:hover { transform:translateY(-3px); border-color:var(--accent); color:var(--text); }
.explore-path--lime { background:var(--lime); }
.explore-path--peach { background:var(--peach); }
.explore-path__icon { flex:none; color:var(--accent-text); }
.explore-path > span:nth-child(2) { flex:1; }
.explore-path > svg { flex:none; width:15px; margin-top:4px; }
.explore-path strong { display:block; font-size:12px; letter-spacing:-.02em; }
.explore-path small { display:block; font-size:10px; margin-top:6px; line-height:1.6; color:var(--text-muted); }
/* Shared information hierarchy. No global fixed heights for variable content. */
.overview-heading { display:flex; justify-content:space-between; align-items:end; gap:20px; margin:44px 0 24px; }
.overview-heading h2 { margin-top:8px; font-size:32px; line-height:1.15; letter-spacing:-.05em; }
.pill-tabs { background:var(--surface-alt); padding:5px; border:1px solid var(--border); border-radius:10px; flex-wrap:wrap; }
.pill-tab { min-height:36px; display:inline-flex; align-items:center; justify-content:center; border-radius:7px; padding:7px 18px; font-size:12px; }
.pill-tab.active { background:var(--surface); color:var(--accent-text); box-shadow:0 1px 3px #163e3210; }
.overview-stats { margin-bottom:48px; padding:22px 0; gap:0; border-block:1px solid var(--border-strong); }
.overview-stats .stat-card { background:transparent; box-shadow:none; border:0; border-radius:0; padding:6px 28px; border-right:1px solid var(--border); }
.overview-stats .stat-card:first-child { padding-left:0; }
.overview-stats .stat-card:last-child { border-right:0; }
.overview-stats .stat-card__head { margin-bottom:12px; }
.stat-card__icon-wrap, [data-theme="dark"] .stat-card__icon-wrap { background:var(--accent-soft); color:var(--accent-text); width:34px; height:34px; border-radius:10px; }
.stat-card__value { font-size:32px; font-weight:700; letter-spacing:-.05em; }
.stat-card__label { margin-top:8px; font-size:12px; }
.stat-card, .review-card, [data-theme="dark"] .stat-card, [data-theme="dark"] .review-card { background:var(--surface); box-shadow:none; border-color:var(--border); }
.section-head { margin-bottom:22px; align-items:center; }
.section-head__title { font-size:26px; letter-spacing:-.04em; }
.section-head__title--sm { font-size:19px; }
.section-head__action { gap:8px; font-size:12px; padding:8px 0; flex-shrink:0; }
.ranking-columns { gap:32px; margin-bottom:56px; }
.ranking-list { border-top:1px solid var(--border-strong); }
.ranking-list .lb-item { display:grid; grid-template-columns:26px minmax(0,1fr) 100px; gap:12px; align-items:center; padding:18px 4px; border:0; border-bottom:1px solid var(--border); border-radius:0; box-shadow:none; background:transparent; }
.ranking-list .lb-item:hover { transform:none; background:var(--accent-bg); }
.ranking-number { font-size:12px; font-variant-numeric:tabular-nums; color:var(--text-dim); }
.ranking-list .uni-card__logo, .ranking-list .staff-card__av { width:44px; height:44px; border-radius:12px; }
.ranking-list .staff-card__av { border-radius:50%; }
.ranking-list .uni-card__name, .ranking-list .staff-card__name { font-size:13px; font-weight:700; -webkit-line-clamp:2; }
.ranking-list .uni-card__meta, .ranking-list .staff-card__role, .ranking-list .staff-card__uni { font-size:10px; }
.ranking-list .nc-stats { margin:0; display:block; text-align:right; }
.ranking-list .nc-stats .sent-bar__pct { font-size:23px; font-weight:700; letter-spacing:-.04em; }
.ranking-list .nc-stats__sub { font-size:9px; }
.ranking-list .nc-stats__side { justify-content:flex-end; gap:8px; margin-top:3px; }
.ranking-list .nc-pill { background:none; padding:0; font-size:9px; }
.ranking-list .nc-bar, .ranking-list .nc-div, .ranking-list .lb-top { display:none; }
.uni-card, .staff-card { padding:22px; border:1px solid var(--border); border-radius:16px; gap:12px; box-shadow:none; }
.uni-card:hover, .staff-card:hover { border-color:var(--border-strong); box-shadow:var(--shadow-lg); }
.uni-card__logo { width:48px; height:48px; border-radius:12px; background:var(--accent-soft); color:var(--accent-text); }
.uni-card__name { font-size:17px; font-weight:700; }
.uni-card__full { font-size:12px; line-height:1.65; }
.uni-card__meta { font-size:11px; }
.nc-bar { height:3px; }
.nc-empty { min-height:56px; }
.nc-empty__wm { opacity:.04; }
.type-chip, .rank-label { font-size:9px; }
.grid-3 { gap:18px; }
.card { border:1px solid var(--border); box-shadow:none; }
.card--dark, [data-theme="dark"] .card--dark { background:#214b39; border-color:#345d44; color:#fff; }
.community-section { margin:60px 0 8px; gap:24px; }
.community-section > .card { padding:32px; border-radius:24px; }
.community-section .card--dark { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; padding:44px; }
.community-section .card--dark .btn { margin-top:16px; }
.trust-item__icon { background:var(--accent-soft); color:var(--accent-text); }
.review-card { padding:24px; border-radius:18px; }
.review-card--featured::before { color:var(--accent); opacity:.12; }
.review-card--featured.review-card--pos, .review-card--featured.review-card--neg { border-color:var(--border); }
.review-head__name { font-size:13px; }
.review-text { font-size:14px; line-height:1.8; }
.review-foot { flex-wrap:wrap; gap:4px; }
.vote-btn, .rv-act { min-height:36px; min-width:36px; }
.rv-modal__panel { border:1px solid var(--border-strong); border-radius:24px; box-shadow:var(--shadow-lg); }
.rv-textarea { background:var(--surface-alt); border:1px solid var(--border-strong); }
.input-wrap { border-radius:12px; background:var(--surface); min-height:46px; }
.input-wrap input { min-width:0; }
.filter-bar { gap:10px; }
.filter-bar .input-wrap { max-width:none !important; }
.chip { border-radius:8px; min-height:36px; padding:8px 12px; font-size:11px; }
.chip.active { background:var(--accent); color:var(--surface); border-color:var(--accent); }
[data-theme="dark"] .chip.active { color:var(--bg); }
.pagination a, .pagination button { min-width:40px; min-height:40px; border-radius:10px; }
.empty-state { padding:48px 24px; background:var(--surface); border:1px dashed var(--border-strong); border-radius:20px; }
.empty-state__title { font-size:22px; letter-spacing:-.035em; }
.state-illustration { position:relative; isolation:isolate; width:clamp(176px,22vw,220px); aspect-ratio:1; margin:-22px auto -12px; pointer-events:none; transition:transform .45s cubic-bezier(.2,.8,.2,1); }
.state-illustration__image { position:relative; z-index:2; width:100%; height:100%; object-fit:contain; filter:drop-shadow(0 16px 20px rgb(24 60 50 / .1)); animation:state-float 6s ease-in-out infinite; }
.state-illustration__orbit { position:absolute; z-index:1; inset:20%; border:1px dashed var(--border-strong); border-radius:50%; opacity:.55; animation:state-orbit 20s linear infinite; }
.state-illustration__spark { position:absolute; z-index:3; top:22%; right:13%; width:10px; height:10px; border-radius:3px; background:#e4edb7; box-shadow:-128px 74px 0 -2px #c8614a; transform:rotate(45deg); animation:state-spark 3.2s ease-in-out infinite; }
.state-illustration--compact { width:112px; margin:-16px auto -10px; }
.state-illustration--compact .state-illustration__spark { width:7px; height:7px; box-shadow:-66px 42px 0 -2px #c8614a; }
.filter-empty { padding:20px 12px 24px; text-align:center; color:var(--text-muted); }
.filter-empty p { margin:0; font-size:13px; line-height:1.55; }
.empty-state:hover .state-illustration, .school-empty:hover .state-illustration, .catalogue-section__empty:hover .state-illustration { transform:translateY(-4px) rotate(-1deg) scale(1.025); }
[data-theme="dark"] .state-illustration__image { filter:drop-shadow(0 18px 24px rgb(0 0 0 / .2)) brightness(1.04); }
.error-page__illu { object-fit:contain; filter:drop-shadow(0 18px 26px rgb(24 60 50 / .12)); animation:state-float 6s ease-in-out infinite; }
.miniapp-screen__illu img { width:100%; height:auto; object-fit:contain; filter:drop-shadow(0 14px 20px rgb(24 60 50 / .12)); animation:state-float 6s ease-in-out infinite; }
@keyframes state-float { 0%,100% { transform:translateY(0) rotate(0); } 50% { transform:translateY(-6px) rotate(.7deg); } }
@keyframes state-orbit { to { transform:rotate(360deg); } }
@keyframes state-spark { 0%,100% { opacity:.45; transform:scale(.8) rotate(45deg); } 50% { opacity:1; transform:scale(1.1) rotate(45deg); } }
@media (prefers-reduced-motion: reduce) {
  .state-illustration, .state-illustration__image, .state-illustration__orbit, .state-illustration__spark, .error-page__illu, .miniapp-screen__illu img { animation:none; transition:none; }
}
/* A single title treatment for catalogues, admission tools and reading pages. */
.page-intro { padding:44px 0 30px; border-bottom:1px solid var(--border); margin-bottom:26px; }
.page-intro h1, .page-title { font-size:clamp(28px,3.3vw,44px) !important; line-height:1.2; letter-spacing:-.05em !important; font-weight:700 !important; margin:10px 0 14px !important; }
.page-intro p { max-width:760px; line-height:1.8 !important; }
.page-intro nav { margin-top:20px !important; }
.page-intro nav a { font-size:12px; border-bottom:1px solid var(--border-strong); padding-bottom:4px; }
.page-intro__icon { display:inline-flex; padding:10px; background:var(--lime); border-radius:12px; margin-bottom:8px; }
.catalog-filters { padding:20px; border:1px solid var(--border); border-radius:18px; background:var(--surface); }
.catalog-filters .sf-panel { grid-template-rows:1fr; opacity:1; margin-top:10px; }
.catalog-filters .sf-panel .filter-bar { margin-bottom:0; }
/* Details retain the existing cover, stats, panel, tab and action contracts. */
.detail-hero { padding-bottom:28px; }
.detail-hero__row { gap:24px; }
.detail-hero__title { font-size:36px; line-height:1.2; letter-spacing:-.045em; }
.detail-hero__logo { width:100px; height:100px; border-radius:22px; border:1px solid var(--border); box-shadow:var(--shadow); }
.detail-hero__sub { font-size:14px; }
.detail-hero__badges { gap:8px; }
.detail-hero__cta { margin-top:20px; gap:10px; }
.detail-grid { gap:28px; }
.detail-sidebar .card { padding:24px; }
.stats-card { border:1px solid var(--border); box-shadow:none; border-radius:20px; }
.sticky-tabs { top:80px; background:var(--bg); border-bottom:1px solid var(--border-strong); }
.tabs .tab { min-height:46px; font-size:12px; }
.tab.active { color:var(--accent-text); }
.info-row { padding-block:12px; }
.biography { grid-column:1 / -1 !important; }
.profile-portrait { flex:none; }
.prose { font-size:15px; line-height:1.9; }
.reading-card { padding:36px !important; }
.prose h2 { letter-spacing:-.035em; }
.prose a { text-decoration:underline; text-underline-offset:3px; }
.footer { padding:48px 0 24px; border-top:1px solid var(--border-strong); background:var(--surface-alt); }
.footer-col__title { font-size:10px; letter-spacing:.13em; }
.footer-col__items { gap:10px; }
.footer-col__items a { font-size:12px; }
.footer-bot { flex-wrap:wrap; gap:12px; font-size:10px; padding-top:24px; }
.footer-attribution { font-size:9px; }
.footer-attribution a { text-decoration:underline; text-underline-offset:2px; }
.footer-cols { grid-template-columns:1.3fr 1fr 1.1fr 1fr; gap:32px; }
.footer-brand p { color:var(--text); font-size:18px; line-height:1.5; letter-spacing:-.03em; margin:18px 0 10px; }
.footer-brand__note { display:block; max-width:250px; font-size:12px; line-height:1.7; color:var(--text-muted); }
.footer-col__title { margin:0 0 12px; }
.footer-col__items { gap:0; }
.footer-col__items .footer-link { display:flex; align-items:center; gap:10px; min-height:44px; line-height:1.5; padding:6px 0; border-radius:8px; font-size:13px; }
.footer-link > span:last-child { overflow-wrap:anywhere; }
.footer-link__icon { display:flex; flex:none; align-items:center; justify-content:center; width:28px; height:28px; border-radius:8px; background:var(--accent-soft); color:var(--accent-text); }
.footer-link:hover .footer-link__icon { background:var(--accent); color:var(--bg); }
.footer-link:focus-visible { outline:2px solid var(--accent-text); outline-offset:3px; }
.header-search-link { display:none; }
@media (max-width:768px) {
  .footer { padding-bottom:calc(104px + var(--tg-safe-bottom, 0px)); }
}
@media (min-width:901px) and (max-width:1180px) {
  .header-search-link { display:inline-flex; }
}
@media (max-width:1100px) {
  .footer-cols { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .footer .footer-cols > .footer-brand { grid-column:1/-1; }
  .footer-brand p br { display:none; }
  .footer-brand__note { max-width:none; }
}
@media (max-width:700px) {
  .footer-cols { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .footer-group--platform { grid-column:1/-1; }
  .footer-group--platform .footer-col__items { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 20px; }
  .footer-col__items .footer-link { font-size:12px; gap:8px; }
  .footer-link__icon { width:24px; height:24px; }
}
/* Tablet and phone: deliberate reflow, safe-area aware and no tiny controls. */
@media (max-width:1180px) {
  .container { padding-inline:28px; }
  .header-search { display:none; }
  .header-inner { gap:16px; }
  .discovery-hero { gap:40px; padding-block:52px; }
  .explore-paths { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:900px) {
  .header { height:68px; }
  .sticky-tabs { top:68px; }
  .discovery-hero { gap:28px; }
  .discovery-hero h1 { font-size:48px; }
  .discovery-hero__visual { padding-right:0; }
  .discovery-search .btn { padding-inline:12px; }
  .discovery-search .btn > svg { display:none; }
  .discovery-trends { font-size:10px; gap:6px 10px; }
  .ranking-columns { gap:20px; }
  .ranking-list .lb-item { grid-template-columns:20px minmax(0,1fr) 88px; gap:8px; }
  .ranking-list .uni-card__logo, .ranking-list .staff-card__av { width:36px; height:36px; }
}
@media (max-width:700px) {
  .container { padding-inline:20px; }
  .page-main { padding-bottom:40px; }
  .brand { font-size:21px; }
  .brand-mark { width:34px; height:34px; }
  .header-inner { gap:8px; }
  .header-actions { gap:4px; }
  .header-actions .btn--sm { padding-inline:9px; }
  .discovery-hero { grid-template-columns:1fr; padding:36px 0 34px; gap:32px; }
  .discovery-hero .overline { font-size:8px; letter-spacing:.1em; }
  .discovery-hero h1 { font-size:clamp(42px,10.5vw,62px); margin:20px 0 16px; }
  .discovery-hero__copy > p { font-size:14px; line-height:1.8; max-width:480px; }
  .discovery-search { margin-top:22px; gap:9px; padding-left:12px; }
  .discovery-search > svg { width:20px; }
  .discovery-search input { font-size:12px; padding-block:10px; }
  .discovery-search .btn { min-height:44px; font-size:12px; }
  .discovery-links { margin-top:22px; gap:26px; }
  .discovery-links a { font-size:12px; }
  .discovery-hero__visual { padding:0 0 42px; }
  .discovery-note { right:10px; bottom:0; padding:9px 14px; font-size:9px; gap:9px; }
  .discovery-note > svg { width:20px; }
  .discovery-orbit { display:none; }
  .explore-paths { gap:10px; margin-bottom:30px; }
  .explore-path { flex-wrap:wrap; padding:18px 14px; gap:12px; border-radius:14px; }
  .explore-path > span:nth-child(2) { flex-basis:100%; order:3; }
  .explore-path > svg { margin-left:auto; }
  .explore-path strong { font-size:12px; }
  .explore-path small { font-size:10px; }
  .overview-heading { flex-direction:column; align-items:flex-start; gap:18px; margin:30px 0 20px; }
  .overview-heading h2 { font-size:28px; }
  .overview-heading .pill-tabs { width:100%; display:flex; }
  .overview-heading .pill-tab { flex:1; padding:8px; }
  .overview-stats { padding:10px 0; gap:0; margin-bottom:34px; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .overview-stats .stat-card, .overview-stats .stat-card:first-child { padding:16px; border-right:0; }
  .overview-stats .stat-card:nth-child(odd) { border-right:1px solid var(--border); padding-left:0; }
  .overview-stats .stat-card:nth-child(-n+2) { border-bottom:1px solid var(--border); }
  .overview-stats .stat-card__value { font-size:28px; }
  .overview-stats .stat-card__head { min-height:30px; }
  .stat-card__delta { font-size:9px; }
  .ranking-columns { grid-template-columns:1fr; gap:36px; margin-bottom:40px; }
  .ranking-list .lb-item { grid-template-columns:24px minmax(0,1fr) 96px; padding-block:16px; }
  .ranking-list .uni-card__logo, .ranking-list .staff-card__av { width:40px; height:40px; }
  .ranking-list .uni-card__name, .ranking-list .staff-card__name { font-size:12px; }
  .section-head__title { font-size:23px; }
  .section-head__title--sm { font-size:18px; }
  .section-head__action { font-size:11px; }
  .uni-card, .staff-card { padding:20px; }
  .community-section { margin-top:36px; grid-template-columns:1fr; }
  .community-section > .card { padding:24px; }
  .page-intro { padding:28px 0 22px; margin-bottom:22px; }
  .page-intro p { font-size:13px !important; }
  .catalog-filters { padding:14px; }
  .catalog-filters .filter-bar { gap:8px; }
  .catalog-filters .input-wrap { flex-basis:100% !important; min-width:0 !important; }
  .catalog-filters .sf-panel { max-height:196px; overflow-y:auto; }
  .catalog-filters .sf-panel .chip { min-height:38px; font-size:10px; padding:8px 10px; }
  .filter-bar .input-wrap { min-width:0 !important; }
  .detail-hero__row { gap:14px; }
  .detail-hero__logo { width:70px; height:70px; border-radius:16px; }
  .detail-hero__title { font-size:27px; }
  .detail-hero__sub { font-size:12px; }
  .detail-hero__cta { margin-top:16px; }
  .detail-hero__cta .btn { font-size:12px; min-height:44px; }
  .profile-portrait { width:80px !important; height:80px !important; }
  .review-card { padding:18px; }
  .review-text { font-size:13px; }
  .review-head { gap:8px; }
  .review-foot { gap:2px; }
  .rv-modal__panel { padding:22px; }
  .reading-card { padding:22px !important; }
  .footer { padding-top:36px; }
  .footer-cols { gap:28px 20px; }
  .footer-bot { line-height:1.8; }
}
@media (max-width:360px) {
  .container { padding-inline:16px; }
  .brand { font-size:19px; }
  .header-actions .btn { font-size:11px; padding-inline:6px; }
  .header-actions .icon-btn { width:36px; min-width:36px; }
  .discovery-hero h1 { font-size:40px; }
  .discovery-links { gap:16px; }
  .ranking-list .lb-item { grid-template-columns:18px minmax(0,1fr) 82px; gap:6px; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
  .btn:hover, .explore-path:hover { transform:none; }
}
/* Page-local components use an explicit scope so inline <style> blocks cannot
   silently revert the shared visual language. Table scrolling stays local. */
.edustats-design .kb-wrap, .edustats-design .yn-wrap, .edustats-design .kn-wrap, .edustats-design .cmp-wrap { background:var(--surface); border-radius:18px; }
.edustats-design :is(.kb-table,.yn-table,.kn-table,.cmp-table) thead th { background:var(--accent-soft); color:var(--text); font-size:10px; letter-spacing:.04em; padding:16px; }
.edustats-design :is(.kb-table,.yn-table,.kn-table,.cmp-table) td { padding:15px 16px; }
.edustats-design :is(.kb-table,.yn-table,.kn-table,.cmp-table) tbody tr:hover { background:var(--surface-alt); }
.edustats-design :is(.kb-select,.cmp-select) { height:46px; border-radius:10px; }
.edustats-design .cmp-form { padding:20px; background:var(--surface); border:1px solid var(--border); border-radius:18px; }
.edustats-design .cmp-select { max-width:100%; }
.edustats-design .yn-chip { border-radius:8px; min-height:36px; font-size:12px; }
.edustats-design .ey-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:20px; }
.edustats-design .ey-card { padding:24px; border-radius:20px; }
.edustats-design .ey-card__title a { display:flex; align-items:center; gap:10px; }
.edustats-design .ey-row { padding:14px 0; border-bottom:1px solid var(--border); border-radius:0; }
.edustats-design .ey-row__meta { font-size:10px; }
.edustats-design .ey-method { border-radius:16px; padding:20px; }
.login-layout { max-width:1020px; margin:64px auto; display:grid; grid-template-columns:1fr 440px; gap:64px; align-items:center; }
.login-story h2 { font-size:48px; line-height:1.2; letter-spacing:-.05em; margin:22px 0; }
.login-story h2 em { font-family:Georgia,serif; font-weight:400; color:var(--accent); }
.login-story > p { color:var(--text-muted); font-size:15px; line-height:1.8; margin-bottom:32px; }
.login-story__item { display:flex; align-items:flex-start; gap:16px; margin-top:24px; font-size:12px; color:var(--text-muted); }
.login-story__item > svg { flex:none; color:var(--accent); }
.login-story__item strong { display:block; color:var(--text); font-size:13px; margin-bottom:5px; }
.login-card { padding:32px; text-align:center; border-radius:24px; box-shadow:var(--shadow-lg); }
.edustats-design .lc-steps { padding:16px 0; border-block:1px solid var(--border); }
.edustats-design .lc-match { border:1px dashed var(--border-strong); padding-block:22px; background:var(--board); }
.edustats-design .lc-details { padding:14px; border:1px solid var(--border); border-radius:12px; }
.cat-card:focus-within { outline:3px solid var(--accent); outline-offset:3px; }
.cat-card input[type="radio"] { display:block; position:absolute; opacity:0; width:1px; height:1px; }
.dropzone:focus-visible { outline:3px solid var(--accent); outline-offset:4px; }
.profile-portrait > .avatar { width:100% !important; height:100% !important; }
@media (max-width:900px) {
  .login-layout { gap:32px; grid-template-columns:1fr 400px; }
  .login-story h2 { font-size:36px; }
}
@media (max-width:700px) {
  .login-layout { display:block; max-width:440px; margin:28px auto; }
  .login-story { margin-bottom:28px; }
  .login-story h2 { font-size:32px; margin:14px 0; }
  .login-story h2 br { display:none; }
  .login-story > p { font-size:13px; margin:0; }
  .login-story__item { display:none; }
  .login-card { padding:24px 20px; }
  .edustats-design :is(.kb-table,.yn-table,.kn-table,.cmp-table) td { padding:12px 9px; }
  .edustats-design :is(.kb-table,.yn-table,.kn-table,.cmp-table) thead th { padding:12px 9px; font-size:9px; }
  .edustats-design .cmp-form { padding:14px; }
  .edustats-design .cmp-select { min-width:0; flex:1 1 100%; }
  .edustats-design .ey-card { padding:18px; }
  .edustats-design .ey-row { font-size:12px; }
}
.header .nav-toggle { display:none; }
.header-actions .hide-mobile { display:inline-flex; }
.header-actions .hide-desktop { display:none; }
.header-actions > a[href$="bot"], .header-actions > a[href$="Bot"] { display:none; }
.btn--secondary { background:var(--surface); color:var(--text); border-color:var(--border); }
.btn--ghost:hover, .btn--secondary:hover { color:var(--text); }
.btn--soft:hover { color:var(--accent-text); }
@media (max-width:1100px) {
  .header .nav-links { display:none; }
  .header .header-cta { display:none; }
  .header .nav-toggle { display:inline-flex; }
}
@media (max-width:768px) {
  .header-actions .hide-mobile { display:none; }
  .header-actions .hide-desktop { display:inline-flex; }
}
.page-enter { animation:none; }
.catalog-guide { margin-top:14px; font-size:12px; }
.catalog-guide summary { color:var(--accent-text); cursor:pointer; font-weight:600; }
.catalog-guide p { margin-top:10px; font-size:13px; }
.catalog-regions { margin-top:12px; border-top:1px solid var(--border); padding-top:12px; }
.catalog-regions summary { display:flex; align-items:center; gap:8px; min-height:38px; cursor:pointer; list-style:none; color:var(--accent-text); font-size:12px; font-weight:600; }
.catalog-regions summary::-webkit-details-marker { display:none; }
.catalog-regions summary > svg:last-child { margin-left:auto; transition:transform .2s; }
.catalog-regions[open] summary > svg:last-child { transform:rotate(180deg); }

/* Aggregate metrics are quiet surfaces; chart colours carry the categories. */
.edustats-design .stat-metric { background:var(--surface); color:var(--text); border:1px solid var(--border); box-shadow:inset 0 3px var(--accent-soft); }
.edustats-design .stat-metric__label { color:var(--text-muted); }
.edustats-design .stat-metric__num { color:var(--text); }
.edustats-design .ey-row__medal { width:24px; font-size:12px; color:var(--text-muted); font-variant-numeric:tabular-nums; }
.edustats-design .ey-method__title { display:flex; align-items:center; gap:8px; }
[data-theme="dark"] .overview-stats .stat-card { background:transparent; }
.tg-webapp .sticky-tabs { top:var(--tg-safe-top, 0px); }

/* Shared institution previews: the same cards are used in both directories. */
.catalogue-section { margin-block:48px; scroll-margin-top:100px; }
.catalogue-section .section-head { align-items:end; gap:24px; }
.catalogue-section .section-head__title { margin-top:10px; }
.catalogue-section__description { margin-top:10px; max-width:600px; color:var(--text-muted); line-height:1.75; }
.catalogue-shortcuts { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:22px; }
.catalogue-shortcuts .chip span { color:var(--text-muted); font-size:10px; margin-left:4px; }
.catalogue-section__empty { display:flex; align-items:center; gap:20px; padding:28px; border:1px dashed var(--border-strong); border-radius:18px; color:var(--text-muted); }
.catalogue-section__empty > svg { flex:none; color:var(--accent); }
.catalogue-section__empty p { flex:1; }
.stat-card__link { display:inline-flex; align-items:center; gap:8px; color:var(--text-muted); }
.institution-card .uni-card__body { flex:1; }
.institution-card .uni-card__name { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; white-space:normal; overflow-wrap:anywhere; line-height:1.4; }
.institution-card .uni-card__logo { flex-shrink:0; }
.search-page { max-width:900px; margin:0 auto; padding-top:32px; }
.search-shortcuts { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:28px; }
.search-results { margin:28px 0; scroll-margin-top:100px; }
.search-results > p { font-size:13px; margin-bottom:16px; }
.search-notice { display:flex; gap:10px; padding:16px; margin-bottom:20px; border:1px solid var(--border-strong); border-radius:12px; background:var(--surface-alt); }
.input-clear { display:inline-flex; flex:none; align-items:center; justify-content:center; min-width:44px; min-height:44px; border:0; background:transparent; border-radius:8px; color:var(--text-muted); cursor:pointer; }
.input-clear:hover { color:var(--accent-text); background:var(--accent-soft); }
@media(max-width:700px) {
  .catalogue-section { margin-block:36px; scroll-margin-top:88px; }
  .catalogue-section .section-head { align-items:flex-start; flex-direction:column; gap:10px; }
  .catalogue-section__description { font-size:13px; }
  .catalogue-shortcuts { flex-wrap:nowrap; overflow-x:auto; padding-bottom:6px; }
  .catalogue-shortcuts .chip { flex:none; }
  .catalogue-section__empty { flex-wrap:wrap; gap:14px; padding:20px; }
  .catalogue-section__empty p { flex-basis:calc(100% - 126px); }
}

/* Shared, keyboard-accessible locale picker: native names remain readable. */
.language-picker{position:relative;flex:none}
.language-picker__toggle{display:flex;align-items:center;gap:5px;width:auto;min-width:58px;padding:0 9px;font:700 12px/1 var(--font);list-style:none}
.language-picker__toggle::-webkit-details-marker{display:none}
.language-picker__panel{position:absolute;right:0;top:calc(100% + 12px);z-index:100;min-width:190px;padding:8px;border:1px solid var(--border);border-radius:16px;background:var(--surface);box-shadow:0 16px 48px #10231e24}
.language-picker__label{display:block;padding:8px 12px;color:var(--text-muted);font-size:12px}
.language-picker__panel button{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;padding:12px;border:0;border-radius:10px;background:transparent;color:var(--text);text-align:left;font:600 14px/1.4 var(--font);cursor:pointer}
.language-picker__panel button:hover,.language-picker__panel button[aria-current]{background:var(--accent-soft);color:var(--accent)}
.language-picker__code{font-size:11px;opacity:.6}
@media(max-width:380px){.header-actions{gap:4px}.header-actions>.header-search-link{display:none}.language-picker__toggle{min-width:46px;padding:0 5px;gap:3px}.language-picker__toggle svg{width:15px}}

@media(max-width:360px){
  .header .brand{gap:6px}
  .header .brand-mark{width:30px;height:30px}
  .header-actions .header-login{width:32px;min-width:32px;min-height:36px;padding:0;justify-content:center}
  .header-login span{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .header-actions .language-picker__toggle{width:auto;min-width:46px}
  .language-picker__panel{right:-24px}
}
/* Mini App: header/footer are hidden, so the bottom nav carries the language picker. */
.bottom-nav .language-picker{display:none}
.tg-webapp .bottom-nav .language-picker{display:flex;align-items:center}
.bottom-nav .language-picker__toggle{min-width:44px;min-height:44px;padding:4px 6px;flex-direction:column;justify-content:center;gap:2px;font-size:10px}
.bottom-nav .language-picker__panel{top:auto;bottom:calc(100% + 14px);right:4px}
