/* ==========================================================================
   Pages
   ========================================================================== */

/* ---------------------------------------------------------------- HOME --- */
.hero { position: relative; padding: 24px 0 34px; overflow: hidden; }
.hero::before {
  content: '';
  position: absolute;
  inset: 0 0 0 40%;
  background: var(--dots);
  background-size: 22px 22px;
  mask-image: radial-gradient(70% 70% at 70% 40%, #000, transparent);
  -webkit-mask-image: radial-gradient(70% 70% at 70% 40%, #000, transparent);
  pointer-events: none;
}
.hero__grid { position: relative; display: grid; gap: 30px; align-items: center; }
@media (min-width: 1000px) {
  .hero { padding: 52px 0 70px; }
  .hero__grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 48px; }
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(42px, 7.6vw, 78px);
  line-height: 0.94;
  letter-spacing: -0.05em;
  font-weight: 800;
  margin: 16px 0 18px;
}
.hl { position: relative; display: inline-block; color: var(--brand); isolation: isolate; }
.hl::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: -3%;
  right: -3%;
  bottom: 0.04em;
  height: 0.3em;
  background: var(--sun);
  border-radius: 10px;
  transform: rotate(-1.5deg);
  animation: hl-in 0.8s 0.3s var(--ease) both;
  transform-origin: left;
}
@keyframes hl-in { from { transform: rotate(-1.5deg) scaleX(0); } }
.hero__lead { font-size: clamp(16.5px, 2vw, 19px); color: var(--ink-2); max-width: 52ch; margin: 0; }

.hero-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px;
  margin-top: 26px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-2);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.hero-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 5px rgb(43 89 255 / 0.14), var(--shadow-2); }
.hero-search > .ic { margin-left: 12px; color: var(--brand); width: 22px; height: 22px; }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; padding: 10px 4px; }
.hero-search .btn { flex: none; min-height: 50px; }
@media (max-width: 520px) { .hero-search .btn .t { display: none; } .hero-search .btn { width: 50px; padding: 0; } }
.suggest {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-3);
  display: grid;
  gap: 2px;
  animation: pop-in 0.25s var(--ease);
}
.suggest .qs-item { border-radius: 14px; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 28px; }
.hero-stats b { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.hero-stats span { font-size: 13.5px; color: var(--muted); font-weight: 600; }

/* Polaroid collage (desktop) */
.collage { position: relative; height: 540px; display: none; }
@media (min-width: 1000px) { .collage { display: block; } }
.polaroid {
  position: absolute;
  width: 56%;
  margin: 0;
  padding: 10px 10px 12px;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-3);
  transition: transform 0.6s var(--spring);
}
.polaroid__img { position: relative; aspect-ratio: 4 / 3.1; border-radius: 13px; overflow: hidden; background: var(--bg-2); }
.polaroid figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-inline: 4px; font-family: var(--font-display); font-weight: 750; font-size: 15.5px; letter-spacing: -0.02em; }
.polaroid figcaption small { font-family: var(--font-ui); font-weight: 600; font-size: 12.5px; color: var(--muted); letter-spacing: 0; }
.polaroid--1 { left: 0; top: 8%; transform: rotate(-8deg); z-index: 1; }
.polaroid--2 { right: 0; top: 0; transform: rotate(6deg); z-index: 2; }
.polaroid--3 { left: 18%; top: 36%; width: 62%; transform: rotate(-2deg); z-index: 3; }
.collage:hover .polaroid--1 { transform: rotate(-11deg) translate(-14px, -6px); }
.collage:hover .polaroid--2 { transform: rotate(9deg) translate(12px, -8px); }
.collage:hover .polaroid--3 { transform: rotate(0deg) translateY(6px); }
.widget { position: absolute; z-index: 5; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-3); padding: 14px 16px; }
.widget--chance { right: -10px; bottom: -2%; width: 260px; display: grid; gap: 10px; animation: floaty 6s ease-in-out infinite; }
.widget--chance .muted { font-size: 12.5px; font-weight: 600; }
.widget--grade { left: -18px; top: 47%; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; animation: floaty 7s ease-in-out -2.5s infinite; }
.widget--grade b { display: block; font-size: 14.5px; }
.widget--grade > span:last-child > span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.collage { height: 560px; }
.collage > .sticker { position: absolute; z-index: 6; left: 44%; top: -2%; font-size: 14px; padding: 8px 14px; }
@keyframes floaty { 50% { transform: translateY(-10px); } }

/* Marquee of university names */
.marquee { position: relative; overflow: hidden; background: var(--ink); color: #fff; padding: 16px 0; margin: 8px 0 0; transform: rotate(-1.4deg) scale(1.03); }
.marquee__track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee__track > span { display: inline-flex; align-items: center; gap: 22px; padding-right: 22px; font-family: var(--font-display); font-weight: 800; font-size: clamp(18px, 2.4vw, 24px); letter-spacing: -0.02em; white-space: nowrap; }
.marquee__track > span::after { content: ''; width: 12px; height: 12px; background: var(--sun); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; } }

/* Bento */
.bento { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bento__calc { grid-column: 1 / -1; } }
@media (min-width: 1100px) { .bento { grid-template-columns: minmax(0, 1.55fr) repeat(2, minmax(0, 1fr)); } .bento__calc { grid-column: auto; grid-row: span 2; } }
.bento-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 210px;
  padding: 24px;
  border-radius: var(--r-xl);
  transition: transform 0.35s var(--spring), box-shadow 0.3s;
}
a.bento-card:hover { transform: translateY(-5px) rotate(-0.4deg); box-shadow: var(--shadow-3); }
.bento-card h3 { font-family: var(--font-display); font-weight: 800; font-size: clamp(22px, 2.4vw, 27px); letter-spacing: -0.035em; line-height: 1.05; max-width: 16ch; }
.bento-card p { margin: 0; font-size: 15px; line-height: 1.5; opacity: 0.88; max-width: 36ch; }
.bento-card__go { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 750; font-size: 14.5px; }
.bento-card__go .ic { transition: transform 0.25s var(--spring); }
a.bento-card:hover .bento-card__go .ic { transform: translateX(5px); }
.bento-card__big { font-family: var(--font-display); font-weight: 800; font-size: clamp(54px, 7vw, 76px); letter-spacing: -0.06em; line-height: 0.85; }
.bento-card__deco { position: absolute; z-index: -1; right: -18px; bottom: -22px; width: 150px; height: 150px; opacity: 0.16; transform: rotate(-12deg); stroke-width: 1.4; }
.b-blue { background: var(--brand); color: #fff; }
.b-sun { background: var(--sun); color: var(--ink); }
.b-mint { background: var(--mint); color: #fff; }
.b-ink { background: var(--ink); color: #fff; }
.b-coral { background: var(--coral); color: #fff; }
.b-white { background: var(--surface); border: 1px solid var(--line); }
.spark { width: 100%; height: 64px; margin-top: 4px; }
.spark path { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.spark .dash { stroke-dasharray: 5 6; stroke: var(--coral); }
.spark circle { fill: var(--surface); stroke: var(--brand); stroke-width: 3; }

/* Mad-lib calculator (inside the blue bento card) */
.madlib { position: relative; }
.madlib__text { font-family: var(--font-display); font-weight: 700; font-size: clamp(21px, 2.6vw, 29px); line-height: 1.7; letter-spacing: -0.02em; margin: 6px 0 18px; }
.madlib__field {
  display: inline-block;
  max-width: 100%;
  vertical-align: baseline;
  border: 0;
  border-bottom: 3px solid var(--sun);
  border-radius: 10px 10px 4px 4px;
  background: rgb(255 255 255 / 0.16);
  color: #fff;
  font: inherit;
  padding: 0 30px 0 10px;
  line-height: 1.35;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffcb2f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
}
.madlib__field:hover { background-color: rgb(255 255 255 / 0.26); }
.madlib__field:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.madlib__field option { color: var(--ink); background: #fff; }
input.madlib__field { width: 3.6em; padding-right: 10px; background-image: none; text-align: center; cursor: text; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
input.madlib__field::-webkit-outer-spin-button, input.madlib__field::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.madlib__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.madlib__actions .link { color: #fff; }

/* Fields as pills */
.field-pills { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 759px) {
  .field-pills { display: grid; grid-auto-flow: column; grid-template-rows: repeat(3, auto); grid-auto-columns: max-content; overflow-x: auto; padding: 4px var(--gutter) 10px; margin-inline: calc(var(--gutter) * -1); scrollbar-width: none; }
  .field-pills::-webkit-scrollbar { display: none; }
}
.field-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  font-weight: 650;
  font-size: 15px;
  white-space: nowrap;
  transition: transform 0.3s var(--spring), border-color 0.2s, box-shadow 0.2s;
}
.field-pill:hover { transform: translateY(-3px) rotate(-1.5deg); border-color: var(--brand); box-shadow: var(--shadow-2); }
.field-pill__icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex: none; }
.field-pill:nth-child(4n + 2) .field-pill__icon { background: var(--mint-50); color: var(--mint-700); }
.field-pill:nth-child(4n + 3) .field-pill__icon { background: var(--sun-50); color: var(--sun-700); }
.field-pill:nth-child(4n) .field-pill__icon { background: var(--coral-50); color: var(--coral-700); }
.field-pill small { color: var(--muted); font-weight: 650; font-size: 13px; }

/* Rankings */
.rank { display: grid; gap: 18px; }
@media (min-width: 1000px) { .rank { grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; } }
.rank-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.rank-tabs::-webkit-scrollbar { display: none; }
@media (min-width: 1000px) { .rank-tabs { flex-direction: column; position: sticky; top: calc(var(--header-h) + 16px); } }
.rank-tabs button {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
  padding: 10px 14px;
  font-weight: 650;
  font-size: 14.5px;
  text-align: left;
  color: var(--ink-2);
  transition: all 0.2s var(--ease);
}
.rank-tabs button .ic { color: var(--brand); }
.rank-tabs button[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.rank-tabs button[aria-pressed='true'] .ic { color: var(--sun); }
.rank-list { display: grid; gap: 10px; }
.rank-row {
  display: grid;
  grid-template-columns: 44px 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 10px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: transform 0.3s var(--spring), border-color 0.2s, box-shadow 0.2s;
}
.rank-row:hover { transform: translateX(5px); border-color: var(--brand-100); box-shadow: var(--shadow-2); }
.rank-row__n { font-family: var(--font-display); font-weight: 800; font-size: 34px; letter-spacing: -0.06em; text-align: center; color: var(--line-2); }
.rank-row:nth-child(1) .rank-row__n { color: var(--sun); }
.rank-row:nth-child(2) .rank-row__n { color: var(--brand); }
.rank-row:nth-child(3) .rank-row__n { color: var(--mint); }
.rank-row__thumb { position: relative; width: 52px; height: 52px; border-radius: 16px; overflow: hidden; }
.rank-row__thumb .cover__mono { font-size: 12px; padding: 0; }
.rank-row__thumb .cover__arch { display: none; }
.rank-row__name { min-width: 0; }
.rank-row__name b { display: block; font-family: var(--font-display); font-weight: 750; font-size: 16.5px; line-height: 1.2; letter-spacing: -0.02em; }
.rank-row__name small { color: var(--muted); font-size: 13px; font-weight: 550; }
.rank-row__score { text-align: right; }
.rank-row__score b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.rank-row__score small { font-size: 11.5px; color: var(--muted); font-weight: 650; white-space: nowrap; }
.trend-up { color: var(--coral-700); font-weight: 750; }
.trend-down { color: var(--mint-700); font-weight: 750; }
@media (max-width: 600px) {
  .rank-row { grid-template-columns: 30px 44px minmax(0, 1fr); gap: 10px; }
  .rank-row__n { font-size: 24px; }
  .rank-row__thumb { width: 44px; height: 44px; border-radius: 13px; }
  .rank-row__score { grid-column: 3; text-align: left; display: flex; gap: 8px; align-items: baseline; }
  .rank-row__score b { font-size: 17px; }
}

/* Type cards */
.types { display: grid; gap: 14px; }
@media (min-width: 760px) { .types { grid-template-columns: repeat(3, 1fr); } }
.type-card { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: 10px; min-height: 210px; padding: 24px; border-radius: var(--r-xl); color: #fff; background: var(--brand); transition: transform 0.35s var(--spring), box-shadow 0.3s; }
.type-card:hover { transform: translateY(-5px) rotate(0.4deg); box-shadow: var(--shadow-3); }
.type-card--foreign { background: var(--mint); }
.type-card--private { background: var(--sun); color: var(--ink); }
.type-card__num { font-family: var(--font-display); font-size: 72px; line-height: 0.85; font-weight: 800; letter-spacing: -0.06em; }
.type-card h3 { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.type-card p { margin: 0; opacity: 0.88; font-size: 15px; max-width: 32ch; }
.type-card__go { position: absolute; right: 20px; top: 20px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / 0.22); transition: transform 0.35s var(--spring), background 0.2s; }
.type-card:hover .type-card__go { transform: rotate(-45deg) scale(1.08); background: #fff; color: var(--ink); }
.type-card__arch { position: absolute; z-index: -1; right: -30px; bottom: -40px; width: 170px; height: 200px; border: 2px solid rgb(255 255 255 / 0.25); border-radius: 50% 50% 0 0 / 40% 40% 0 0; }

.cards-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.featured-scroll > .uni-card { width: min(300px, 82vw); }
@media (min-width: 900px) {
  .featured-scroll { display: grid; grid-template-columns: repeat(4, 1fr); overflow: visible; margin: 0; padding: 0; }
  .featured-scroll > .uni-card { width: auto; }
}

/* News */
.news-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.news-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); transition: transform 0.3s var(--spring), box-shadow 0.25s; }
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.news-card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-weight: 650; }
.news-card h3 { font-family: var(--font-display); font-weight: 750; font-size: 18.5px; line-height: 1.22; letter-spacing: -0.02em; }
.news-card p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.news-card .link { margin-top: auto; font-size: 14px; }

/* Admission explainer (used on /qabul) */
.timeline { position: relative; display: grid; gap: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding-bottom: 22px; }
.timeline li::before { content: ''; position: absolute; left: 27px; top: 56px; bottom: 0; width: 2px; background: repeating-linear-gradient(var(--line-2) 0 6px, transparent 6px 11px); }
.timeline li:last-child::before { display: none; }
.timeline__n { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px; background: var(--brand); color: #fff; font-family: var(--font-display); font-size: 22px; font-weight: 800; box-shadow: var(--shadow-brand); }
.timeline li:nth-child(2) .timeline__n { background: var(--mint); box-shadow: none; }
.timeline li:nth-child(3) .timeline__n { background: var(--sun); color: var(--ink); box-shadow: none; }
.timeline li:nth-child(4) .timeline__n { background: var(--coral); box-shadow: none; }
.timeline__date { font-size: 13px; font-weight: 750; color: var(--brand-700); }
.timeline h3 { font-family: var(--font-display); font-size: 19px; font-weight: 750; letter-spacing: -0.02em; margin: 2px 0 4px; }
.timeline p { margin: 0; color: var(--muted); font-size: 15px; }
.scorebar { display: flex; height: 58px; border-radius: var(--r); overflow: hidden; margin: 14px 0 10px; font-size: 13px; font-weight: 800; gap: 3px; }
.scorebar span { display: flex; align-items: center; justify-content: center; color: #fff; min-width: 0; padding-inline: 4px; text-align: center; line-height: 1.15; border-radius: 10px; }
.scorebar span:nth-child(1) { flex: 33; background: var(--ink-2); }
.scorebar span:nth-child(2) { flex: 93; background: var(--brand); }
.scorebar span:nth-child(3) { flex: 63; background: var(--mint); }
.scorebar-legend { display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); }

.cta-band { position: relative; overflow: hidden; isolation: isolate; display: grid; gap: 16px; padding: 34px 24px; border-radius: var(--r-xl); background: var(--brand); color: #fff; }
.cta-band::before { content: ''; position: absolute; z-index: -1; width: 360px; height: 360px; right: -90px; top: -120px; border-radius: 50%; background: var(--sun); opacity: 0.95; }
.cta-band::after { content: ''; position: absolute; z-index: -1; width: 180px; height: 180px; right: 160px; bottom: -110px; border-radius: 50%; background: var(--mint); }
.cta-band h2 { font-family: var(--font-display); font-size: clamp(30px, 4.6vw, 50px); font-weight: 800; letter-spacing: -0.045em; line-height: 1; max-width: 16ch; }
.cta-band p { margin: 0; opacity: 0.9; max-width: 46ch; }
.cta-band .btn { justify-self: start; }
@media (min-width: 760px) { .cta-band { padding: 56px; } }
@media (max-width: 759px) { .cta-band::before { width: 220px; height: 220px; right: -90px; top: -90px; } }

/* ---------------------------------------------------------------- LIST --- */
.list-layout { display: grid; gap: 24px; padding-bottom: 32px; }
@media (min-width: 1024px) { .list-layout { grid-template-columns: 268px minmax(0, 1fr); gap: 32px; align-items: start; } }
.filters { display: none; }
@media (min-width: 1024px) {
  .filters { display: block; position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100dvh - var(--header-h) - 32px); overflow-y: auto; padding-right: 6px; scrollbar-width: thin; }
}
.filter-group { padding: 18px 0; border-bottom: 1px solid var(--line); }
.filter-group:first-child { padding-top: 0; }
.filter-group h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chips .chip { min-height: 34px; padding: 4px 12px; font-size: 13.5px; }
.check-list { display: grid; gap: 2px; }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 8px;
  margin-inline: -8px;
  border-radius: var(--r-s);
  cursor: pointer;
  font-size: 14.5px;
  transition: background 0.12s;
}
.check:hover { background: var(--paper-2); }
.check input { appearance: none; width: 20px; height: 20px; border: 1.5px solid var(--line-2); border-radius: 6px; background: var(--surface); flex: none; display: grid; place-items: center; margin: 0; transition: all 0.15s; }
.check input:checked { background: var(--lapis); border-color: var(--lapis); }
.check input:checked::after { content: ''; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check .ic { width: 17px; height: 17px; color: var(--muted); }
.check .chip-count { margin-left: auto; }

.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  background: var(--paper);
}
.toolbar .input-wrap { flex: 1 1 260px; }
.toolbar .select { width: auto; min-width: 0; flex: 0 1 auto; }
.toolbar__filters { display: inline-flex; }
@media (min-width: 1024px) { .toolbar__filters { display: none; } }
.toolbar__filters .count-pill { margin-left: 2px; }
.type-tabs { margin-bottom: 4px; display: flex; width: 100%; }
.type-tabs button { flex: 1 0 auto; padding-inline: 12px; }
@media (min-width: 640px) { .type-tabs { display: inline-flex; width: auto; } .type-tabs button { flex: none; padding-inline: 16px; } }
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 16px; }
.results-head p { margin: 0; color: var(--ink-2); font-weight: 500; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.active-filters .chip { min-height: 32px; padding: 4px 10px 4px 12px; font-size: 13px; background: var(--lapis-50); border-color: transparent; color: var(--lapis-800); }
.active-filters .chip .ic { width: 14px; height: 14px; }
.list-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 268px), 1fr)); }
.list-grid > .ad-slot { grid-column: 1 / -1; margin: 4px 0; }

/* -------------------------------------------------------------- DETAIL --- */
.d-hero { display: grid; gap: 22px; padding: 18px 0 8px; }
@media (min-width: 900px) { .d-hero { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 40px; align-items: end; padding-top: 30px; } }
.d-media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-l);
  overflow: hidden;
  background: var(--paper-2);
  box-shadow: var(--shadow-2);
}
@media (min-width: 900px) { .d-media { aspect-ratio: 5 / 4; border-radius: 999px 999px var(--r-l) var(--r-l) / 46% 46% var(--r-l) var(--r-l); } }
.d-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.d-media__credit { position: absolute; z-index: 2; right: 10px; bottom: 10px; font-size: 11px; color: #fff; background: rgb(0 0 0 / 0.45); padding: 2px 8px; border-radius: 6px; max-width: calc(100% - 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-title .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.d-title h1 { font-family: var(--font-display); font-size: clamp(30px, 4.6vw, 52px); line-height: 1.04; letter-spacing: -0.03em; font-weight: 600; }
.d-title .en { color: var(--muted); margin: 10px 0 0; font-size: 15.5px; }
.d-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 22px; color: var(--ink-2); font-size: 15px; }
.d-meta span { display: inline-flex; align-items: center; gap: 6px; }
.d-meta .ic { width: 17px; height: 17px; color: var(--muted); }
.d-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 559px) { .d-actions .btn-primary { flex: 1 1 100%; } .d-actions .btn:not(.btn-primary) { flex: 1 1 0; } }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 26px 0 8px; }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .facts { grid-template-columns: repeat(6, 1fr); } }
.fact { padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); min-width: 0; }
.fact .ic { color: var(--lapis); margin-bottom: 8px; }
.fact dt { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fact dd { margin: 2px 0 0; font-weight: 700; font-size: 15.5px; line-height: 1.3; overflow-wrap: anywhere; }

.d-tabs {
  position: sticky;
  top: var(--header-h);
  z-index: 15;
  display: flex;
  gap: 4px;
  margin: 18px calc(var(--gutter) * -1) 0;
  padding: 8px var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.d-tabs::-webkit-scrollbar { display: none; }
.d-tabs a { flex: none; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14.5px; color: var(--muted); transition: all 0.15s; }
.d-tabs a:hover { color: var(--ink); }
.d-tabs a.is-active { background: var(--ink); color: #fff; }

.d-layout { display: grid; gap: 28px; padding: 28px 0 12px; }
@media (min-width: 1024px) { .d-layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; align-items: start; } }
.d-side { display: grid; gap: 18px; }
@media (min-width: 1024px) { .d-side { position: sticky; top: calc(var(--header-h) + 70px); } }
.d-section { padding-bottom: 36px; scroll-margin-top: calc(var(--header-h) + 64px); }
.d-section + .d-section { padding-top: 32px; border-top: 1px solid var(--line); }
.d-section h2 { font-family: var(--font-display); font-size: clamp(24px, 3vw, 30px); font-weight: 600; letter-spacing: -0.02em; margin-bottom: 16px; display: flex; align-items: baseline; gap: 12px; }
.d-section h2 .num-tag { font-family: var(--font-ui); font-size: 13px; font-weight: 700; color: var(--saffron-800); letter-spacing: 0.08em; }
.d-desc { font-size: 17px; line-height: 1.7; color: var(--ink-2); }
.adm-grid { display: grid; gap: 12px; margin-bottom: 18px; }
@media (min-width: 640px) { .adm-grid { grid-template-columns: 1fr 1fr; } }
.adm-card { padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.adm-card h4 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.adm-card h4 .ic { width: 16px; height: 16px; color: var(--lapis); }
.adm-card p { margin: 0; font-weight: 550; }
.cert-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Programs table → cards on phones */
.prog-filter { margin-bottom: 14px; }
.prog-table { width: 100%; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.prog-table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 12px 14px; background: var(--paper-2); white-space: nowrap; }
.prog-table td { padding: 14px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 14.5px; }
.prog-table td.num, .prog-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.prog-name { display: flex; gap: 10px; align-items: flex-start; }
.prog-name .ic { color: var(--lapis); margin-top: 2px; }
.prog-name b { display: block; font-weight: 650; line-height: 1.3; }
.prog-name small { color: var(--muted); font-size: 12.5px; }
.chance-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chance-pill.lvl-high { background: var(--teal-50); }
.chance-pill.lvl-mid { background: var(--saffron-50); }
.chance-pill.lvl-low { background: var(--brick-50); }
.chance-pill.lvl-none { background: var(--paper-2); color: var(--muted); }
@media (max-width: 759px) {
  .prog-table, .prog-table tbody, .prog-table tr, .prog-table td { display: block; }
  .prog-table { border: 0; background: none; }
  .prog-table thead { display: none; }
  .prog-table tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .prog-table td { border: 0; padding: 0; text-align: left !important; }
  .prog-table td:first-child { grid-column: 1 / -1; }
  .prog-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  .prog-table td.td-chance { grid-column: 1 / -1; padding-top: 10px; border-top: 1px dashed var(--line-2); display: flex; align-items: center; justify-content: space-between; }
  .prog-table td.td-chance::before { margin: 0; }
}

.contact-list { display: grid; gap: 10px; }
.contact-list a, .contact-list div { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font-weight: 550; overflow-wrap: anywhere; transition: border-color 0.15s; }
.contact-list a:hover { border-color: var(--lapis); }
.contact-list .ic { color: var(--lapis); }
.sources { margin-top: 18px; font-size: 13px; color: var(--muted); }
.sources a { text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }

/* Calculator panel */
.calc { padding: 20px; }
.calc h3 { font-family: var(--font-display); font-size: 21px; font-weight: 600; margin-bottom: 4px; }
.calc__row { margin-top: 16px; }
.calc__score { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.calc__score output { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.calc__score output small { font-size: 14px; color: var(--muted); font-weight: 600; }
.calc__best { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.calc__best p { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); text-align: center; }
.calc .meter + .meter { margin-top: 10px; }

/* --------------------------------------------------------------- MATCH --- */
.wizard { max-width: 760px; margin: 0 auto; padding: 8px 0 40px; }
.wizard__progress { display: flex; gap: 6px; margin: 18px 0 20px; }
.wizard__progress span { height: 5px; flex: 1; border-radius: 99px; background: var(--paper-3); transition: background 0.3s; }
.wizard__progress span.is-done { background: var(--lapis); }
.wizard__step-label { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--saffron-800); }
.wizard h2 { font-family: var(--font-display); font-size: clamp(26px, 4vw, 38px); font-weight: 600; letter-spacing: -0.02em; margin: 6px 0 8px; }
.wizard__lead { color: var(--muted); margin-bottom: 22px; }
.wizard__nav { display: flex; gap: 10px; justify-content: space-between; margin-top: 28px; position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 12px 0; background: linear-gradient(transparent, var(--paper) 30%); }
.wizard__nav .btn-primary { flex: 1; max-width: 320px; margin-left: auto; }

/* Columns follow the space the grid actually has (wizard, sheet or narrow side panel), not the screen width:
   a card is never narrower than ~160px, so field names are not squeezed letter by letter. */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 8px; }
@media (min-width: 640px) { .pick-grid { gap: 10px; } }
.pick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  text-align: left;
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.25;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.pick:hover { border-color: var(--line-2); }
.pick:active { transform: scale(0.98); }
.pick .ic { color: var(--lapis); }
.pick[aria-pressed='true'] { border-color: var(--lapis); background: var(--lapis-50); color: var(--lapis-800); }
.pick[aria-pressed='true']::after { content: ''; position: absolute; right: 8px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--saffron); }

.score-big { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 4px; }
.score-big output { font-family: var(--font-display); font-size: 64px; line-height: 1; font-weight: 600; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.score-big span { color: var(--muted); font-weight: 600; }
.score-ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }

.form-block { padding: 18px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.form-block + .form-block { margin-top: 12px; }
.form-block h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.form-block h3 .ic { color: var(--lapis); }
.form-block > p { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.form-row { display: grid; gap: 12px; }
@media (min-width: 560px) { .form-row--2 { grid-template-columns: 1fr 1fr; } }
.nat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 10px; }
.nat-row .seg { grid-column: 1 / -1; }
@media (min-width: 640px) { .nat-row { grid-template-columns: minmax(0, 1fr) auto auto; } .nat-row .seg { grid-column: auto; } }

.match-layout { display: grid; gap: 24px; padding-bottom: 40px; }
@media (min-width: 1024px) { .match-layout { grid-template-columns: 340px minmax(0, 1fr); gap: 32px; align-items: start; } }
.profile-panel { display: none; }
@media (min-width: 1024px) {
  .profile-panel { display: block; position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100dvh - var(--header-h) - 32px); overflow-y: auto; scrollbar-width: thin; }
}
.profile-panel .form-block { padding: 16px; }
/* Side panel (340px): fields become compact pills that wrap naturally. */
.profile-panel .pick-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.profile-panel .pick { min-height: 36px; padding: 6px 12px 6px 10px; gap: 6px; border-radius: 999px; font-size: 13.5px; line-height: 1.2; }
.profile-panel .pick .ic { width: 16px; height: 16px; flex-shrink: 0; }
.profile-panel .pick[aria-pressed='true']::after { right: 2px; top: 2px; width: 7px; height: 7px; }
/* Full field names everywhere; short names ("IT", "Tibbiyot"…) in the narrow side panel. */
.pick__short { display: none; }
.profile-panel .pick__long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.profile-panel .pick__short { display: inline; white-space: nowrap; }
.profile-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 10;
  box-shadow: var(--shadow-1);
}
.profile-bar__text { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-bar__text small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; }
@media (min-width: 1024px) { .profile-bar { display: none; } }

.summary-card {
  display: grid;
  gap: 4px;
  padding: 20px 22px;
  border-radius: var(--r-l);
  background: var(--ink);
  color: #fff;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.summary-card::after { content: ''; position: absolute; right: -20px; top: -30px; width: 140px; height: 170px; border: 2px solid rgb(255 255 255 / 0.12); border-radius: 50% 50% 0 0 / 42% 42% 0 0; }
.summary-card h2 { font-family: var(--font-display); font-size: clamp(22px, 3vw, 28px); font-weight: 600; }
.summary-card p { margin: 0; color: #c9d3e6; font-size: 14.5px; max-width: 56ch; }
.summary-card .est { color: var(--saffron); font-weight: 700; }

.result-tabs { margin-bottom: 14px; }
.results { display: grid; gap: 12px; }
.result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
  animation: rise 0.4s var(--ease) both;
}
.result:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.result__rank { display: none; }
.result__thumb { position: relative; width: 64px; height: 64px; border-radius: 16px 16px 8px 8px; overflow: hidden; background: var(--paper-2); }
.result__thumb img { width: 100%; height: 100%; object-fit: cover; }
.result__thumb .cover__mono { font-size: 13px; padding: 0; }
.result__thumb .cover__arch { display: none; }
.result__main { min-width: 0; }
.result__top { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.result__name { font-family: var(--font-display); font-size: 18.5px; font-weight: 600; line-height: 1.25; }
.result__name a:hover { color: var(--lapis); }
.result__meta { font-size: 13px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.result__prog { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.result__prog b { color: var(--ink); }
.result__meters { display: grid; gap: 8px; margin-top: 12px; }
@media (min-width: 560px) { .result__meters { grid-template-columns: 1fr 1fr; gap: 16px; } }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.reason { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 4px 9px 4px 7px; border-radius: 8px; }
.reason .ic { width: 14px; height: 14px; stroke-width: 2.2; }
.reason--ok { background: var(--teal-50); color: #075a5c; }
.reason--warn { background: var(--saffron-50); color: var(--saffron-800); }
.reason--bad { background: var(--brick-50); color: #9c3725; }
.reason--info { background: var(--lapis-50); color: var(--lapis-800); }
.result__foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.result__more { margin-top: 12px; border-top: 1px dashed var(--line-2); padding-top: 10px; }
.result__more summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--lapis); list-style: none; display: inline-flex; align-items: center; gap: 4px; }
.result__more summary::-webkit-details-marker { display: none; }
.result__more[open] summary .ic { rotate: 180deg; }
.mini-progs { display: grid; gap: 6px; margin-top: 10px; }
.mini-prog { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 14px; padding: 8px 10px; background: var(--paper); border-radius: var(--r-s); }
.mini-prog span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 640px) {
  .result { grid-template-columns: 36px 72px minmax(0, 1fr); padding: 18px 20px; gap: 16px; }
  .result__rank { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--line-2); line-height: 1; padding-top: 4px; font-variant-numeric: tabular-nums; }
  .result__thumb { width: 72px; height: 72px; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ------------------------------------------------------------- COMPARE --- */
.cmp-wrap { overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 12px; scrollbar-width: thin; }
.cmp { min-width: 640px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.cmp th, .cmp td { padding: 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.cmp thead th { border-bottom: 0; padding-bottom: 6px; vertical-align: bottom; }
.cmp tbody th { width: 150px; font-size: 13px; color: var(--muted); font-weight: 600; position: sticky; left: 0; background: var(--paper); z-index: 1; }
@media (max-width: 640px) { .cmp tbody th { width: 112px; } .cmp { min-width: 560px; } }
.cmp td { background: var(--surface); }
.cmp tbody tr:first-child td:first-of-type { border-top-left-radius: var(--r); }
.cmp-head { position: relative; display: grid; gap: 10px; }
.cmp-head__media { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r); overflow: hidden; background: var(--paper-2); }
.cmp-head__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cmp-head h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.25; }
.cmp-head .icon-btn { position: absolute; top: 8px; right: 8px; z-index: 2; }
.cmp-best { color: var(--teal); font-weight: 700; }
.cmp-add { display: grid; place-items: center; gap: 10px; text-align: center; min-height: 170px; border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 16px; color: var(--muted); }

/* ------------------------------------------------------------ NOT FOUND --- */
.nf { text-align: center; padding: 60px 0 80px; display: grid; justify-items: center; gap: 14px; }
.nf__arch { width: 140px; height: 170px; border: 3px solid var(--lapis); border-bottom: 0; border-radius: 50% 50% 0 0 / 42% 42% 0 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 42px; font-weight: 600; color: var(--lapis); }
.nf h1 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); }
.nf p { color: var(--muted); max-width: 44ch; margin: 0; }

/* Grid children may never be wider than their track (long <select> options, URLs, etc.). */
.hero__grid > *, .list-layout > *, .d-hero > *, .d-layout > *, .match-layout > *, .howto > *, .types > *,
.cards-grid > *, .list-grid > *, .facts > *, .adm-grid > *, .result__main, .wizard { min-width: 0; }
.madlib__field { max-width: 100%; }
.d-side > * { min-width: 0; }

/* ---------------------------------------------------------- v2 headings --- */
.section-head h2, .page-head h1, .d-title h1, .wizard h2, .summary-card h2, .nf h1 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
}
.section-head h2 { font-size: clamp(32px, 4.8vw, 52px); }
.page-head h1 { font-size: clamp(36px, 6vw, 64px); }
.section-head h2 em, .page-head h1 em { font-style: normal; font-weight: inherit; color: var(--brand); position: relative; display: inline-block; isolation: isolate; }
.section-head h2 em::after, .page-head h1 em::after { content: ""; position: absolute; z-index: -1; left: -3%; right: -3%; bottom: 0.02em; height: 0.28em; background: var(--sun); border-radius: 8px; transform: rotate(-1.2deg); }
.d-section h2 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.04em; }
.d-section h2 .num-tag { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--brand-50); color: var(--brand-700); font-family: var(--font-display); font-size: 15px; letter-spacing: 0; }

/* ----------------------------------------------------------------- HUB --- */
.hub-tabs { margin-top: 10px; }
.hub-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.facts-strip { display: grid; gap: 12px; margin: 24px 0 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.fact-card { padding: 18px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); }
.fact-card span { display: inline-block; font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -0.02em; margin-bottom: 6px; }
.fact-card p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.fact-card--0 { background: var(--brand); color: #fff; border-color: transparent; }
.fact-card--0 p { color: rgb(255 255 255 / 0.88); }
.fact-card--1 { background: var(--sun); border-color: transparent; }
.fact-card--1 p { color: var(--ink); }
.hub-section { padding: 44px 0 8px; scroll-margin-top: calc(var(--header-h) + 60px); }
.hub-cats { margin-bottom: 16px; }
.benefits { display: grid; gap: 12px; }
@media (min-width: 1000px) { .benefits { grid-template-columns: 1fr 1fr; align-items: start; } }
.benefit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; transition: box-shadow 0.25s, border-color 0.2s; }
.benefit[open] { border-color: var(--brand-100); box-shadow: var(--shadow-2); }
.benefit summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; padding: 18px; cursor: pointer; list-style: none; }
.benefit summary::-webkit-details-marker { display: none; }
.benefit__icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.benefit[data-cat='kvota'] .benefit__icon { background: var(--mint-50); color: var(--mint-700); }
.benefit[data-cat='imtiyoz'] .benefit__icon { background: var(--sun-50); color: var(--sun-700); }
.benefit[data-cat='moliya'] .benefit__icon { background: var(--coral-50); color: var(--coral-700); }
.benefit__head b { display: block; font-family: var(--font-display); font-weight: 750; font-size: 18px; line-height: 1.22; letter-spacing: -0.02em; }
.benefit__sum { display: block; margin-top: 6px; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.benefit__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.benefit__chev { color: var(--muted); transition: transform 0.25s var(--ease); }
.benefit[open] .benefit__chev { transform: rotate(180deg); }
.benefit__body { display: grid; gap: 16px; padding: 0 18px 18px 78px; }
@media (max-width: 600px) { .benefit__body { padding-left: 18px; } .benefit summary { gap: 12px; } .benefit__icon { width: 40px; height: 40px; } }
.benefit__row h4 { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
.benefit__row p { margin: 0; font-size: 15px; line-height: 1.55; }
.benefit__row .checklist li { font-size: 14.5px; line-height: 1.5; }
.steps { list-style: none; counter-reset: st; display: grid; gap: 8px; padding: 0; margin: 0; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: 14.5px; line-height: 1.5; }
.steps li::before { content: counter(st); width: 26px; height: 26px; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.benefit__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: 13px; color: var(--muted); }
.benefit__foot > span { display: inline-flex; gap: 6px; align-items: flex-start; }
.howto { display: grid; gap: 20px; }
@media (min-width: 980px) { .howto { grid-template-columns: 1.05fr 0.95fr; gap: 28px; align-items: start; } }
.cert-rules { display: grid; gap: 10px; margin-top: 18px; }
@media (min-width: 560px) { .cert-rules { grid-template-columns: 1fr 1fr; } }
.cert-rule { padding: 14px; border-radius: var(--r); background: var(--bg); }
.cert-rule b { display: block; font-size: 15px; margin-bottom: 2px; }
.cert-rule span { font-size: 13.5px; color: var(--muted); }
.fc-grid { display: grid; gap: 16px; }
@media (min-width: 1000px) { .fc-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.fc-grid > * { min-width: 0; }
.fc-side { display: grid; gap: 16px; }
.fc-h { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; margin-bottom: 12px; }
.fc-h .ic { color: var(--brand); }
.fc-cell b { display: block; font-variant-numeric: tabular-nums; }
.fc-cell small { display: block; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.fc-cell--next { background: var(--sun-50); }
.movers { display: grid; gap: 8px; }
.mover { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px; border-radius: 14px; transition: background 0.15s; }
.mover:hover { background: var(--bg); }
.mover .rank-row__thumb { width: 44px; height: 44px; border-radius: 13px; }
.mover__t b { display: block; font-size: 14.5px; line-height: 1.25; }
.mover__t small { color: var(--muted); font-size: 12.5px; }
.mover__d { font-family: var(--font-display); font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
@media (max-width: 759px) {
  .fc-table tr { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .fc-table td.fc-cell--next { background: var(--sun-50); border-radius: 10px; padding: 6px 8px !important; }
}

/* --------------------------------------------------------- LIST anim --- */
.list-grid { transition: height 0.3s var(--ease); }
.results-count { display: inline-flex; align-items: baseline; gap: 6px; }
.results-count b { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -0.03em; color: var(--brand); font-variant-numeric: tabular-nums; }
.uni-card.is-leaving { animation: card-out 0.22s var(--ease) forwards; }
@keyframes card-out { to { opacity: 0; transform: scale(0.94); } }

/* ------------------------------------------------------ DETAIL report --- */
.report { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0 6px; }
@media (min-width: 760px) { .report { grid-template-columns: repeat(4, 1fr); } }
.report__item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.report__item > div > b { display: block; font-size: 15px; }
.report__item > div > span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.hist { display: grid; gap: 2px; }
.hist small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hist .fcst { color: var(--sun-700); font-weight: 750; }

/* ------------------------------------------------------ MATCH privileges --- */
.sat-note { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; padding: 12px 14px; border-radius: var(--r); background: var(--sun-50); color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.sat-note .ic { color: var(--sun-700); margin-top: 2px; flex: none; }
.priv-list { display: grid; gap: 8px; }
@media (min-width: 640px) { .priv-list { grid-template-columns: 1fr 1fr; } }
.priv { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); transition: border-color 0.15s, background 0.15s; }
.priv:hover { border-color: var(--line-2); }
.priv b { display: block; font-size: 14.5px; line-height: 1.3; }
.priv small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.priv__box { width: 22px; height: 22px; flex: none; border-radius: 7px; border: 1.5px solid var(--line-2); display: grid; place-items: center; color: transparent; margin-top: 1px; transition: all 0.15s; }
.priv[aria-pressed='true'] { border-color: var(--mint); background: var(--mint-50); }
.priv[aria-pressed='true'] .priv__box { background: var(--mint); border-color: var(--mint); color: #fff; }
.form-block--priv { border-color: var(--mint); }
.profile-panel .priv-list { grid-template-columns: 1fr; }
.bento-card .madlib__text { font-size: clamp(21px, 2.5vw, 30px); line-height: 1.75; opacity: 1; max-width: none; margin: 10px 0 22px; }
.bento__calc { justify-content: space-between; }

.marquee-wrap { overflow: hidden; padding: 14px 0; }

/* ------------------------------------------------------- MATCH v3 (scenarios) --- */
.seg--wide { display: flex; width: 100%; }
.seg--wide button { flex: 1; }
.have-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 12px; }
.form-row--3 { display: grid; gap: 12px; }
@media (min-width: 560px) { .form-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.profile-panel .form-row--3 { grid-template-columns: 1fr; }
.paths { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.path-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-size: 12px; font-weight: 750; }
.path-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.result.is-blocked { opacity: 0.72; background: var(--bg); }
.result.is-blocked .result__thumb { filter: grayscale(0.8); }
.bd-table { width: 100%; margin-top: 10px; font-size: 13.5px; }
.bd-table td { padding: 7px 8px; border-top: 1px solid var(--line); }
.bd-table td small { color: var(--muted); font-size: 11.5px; margin-left: 4px; }
.bd-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 650; }
.bd-total td { font-weight: 800; border-top: 2px solid var(--ink); }
.bd-src { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.bd-src.is-cert { background: var(--mint-50); color: var(--mint-700); }
.bd-src.is-assumed { background: var(--sun-50); color: var(--sun-700); }

/* 5-choice strategy */
.strategy { margin-bottom: 16px; padding: 22px; border-radius: var(--r-xl); background: var(--surface); border: 1.5px solid var(--brand-100); box-shadow: var(--shadow-2); }
.strategy__head h2 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.04em; font-size: clamp(22px, 3vw, 28px); margin: 10px 0 6px; }
.strategy__head p { margin: 0 0 14px; color: var(--ink-2); font-size: 14.5px; max-width: 64ch; }
.strategy__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.strategy__item { display: grid; grid-template-columns: 34px 92px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 16px; background: var(--bg); border-left: 5px solid var(--tc, var(--brand)); }
.strategy__n { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--tc, var(--brand)); color: #fff; font-family: var(--font-display); font-weight: 800; }
.strategy__tier b { display: block; font-size: 14px; color: var(--tc); }
.strategy__tier small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.2; }
.strategy__name { min-width: 0; }
.strategy__name b { display: block; font-family: var(--font-display); font-weight: 750; font-size: 16px; letter-spacing: -0.02em; }
.strategy__name span { display: block; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strategy__name:hover b { color: var(--brand); }
.strategy__chance { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tier-reach { --tc: var(--coral); }
.tier-target { --tc: var(--brand); }
.tier-safety { --tc: var(--mint); }
@media (max-width: 640px) {
  .strategy { padding: 16px; }
  .strategy__item { grid-template-columns: 30px minmax(0, 1fr); gap: 4px 10px; }
  .strategy__tier { grid-column: 2; display: flex; gap: 6px; align-items: baseline; }
  .strategy__name { grid-column: 2; }
  .strategy__chance { grid-column: 2; justify-content: flex-start; margin-top: 4px; }
  .strategy__n { grid-row: span 3; align-self: start; }
}
.bd-table { table-layout: fixed; }
.bd-src { white-space: normal; line-height: 1.3; }
@media (max-width: 560px) {
  .bd-table, .bd-table tbody { display: block; }
  .bd-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-top: 1px solid var(--line); padding: 6px 0; }
  .bd-table td { border: 0; padding: 2px 4px; min-width: 0; }
  .bd-table td:nth-child(3) { grid-column: 1 / -1; }
  .bd-table td:nth-child(3):empty { display: none; }
  .bd-total { border-top: 2px solid var(--ink) !important; }
}
.mini-prog { min-width: 0; }
.mini-prog span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-prog .chance-pill { flex: none; }
.result__more { min-width: 0; }

/* "More on the official site" link cards */
.more-link { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px 16px; border-radius: var(--r-l); border: 1.5px dashed var(--brand-100); background: var(--brand-50); color: var(--brand-700); transition: border-color 0.2s, background 0.2s, transform 0.25s var(--spring); }
.more-link:hover { border-style: solid; border-color: var(--brand); background: #fff; transform: translateY(-2px); }
.more-link__icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand); color: #fff; flex: none; }
.more-link__text { flex: 1; min-width: 0; }
.more-link__text b { display: block; font-size: 15.5px; color: var(--ink); }
.more-link__text small { display: block; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }

/* ---- Key dates: countdowns + calendar ------------------------------------ */
.link-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 2px; border: 0; background: none;
  color: var(--brand-700); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.btn-tg { background: #229ed9; border-color: #229ed9; color: #fff; }
.btn-tg:hover { background: #1b8bc0; border-color: #1b8bc0; color: #fff; }
.deadlines__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.timeline__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; }
.timeline__meta .badge { display: inline-flex; align-items: center; gap: 5px; }
.timeline__prev { font-size: 13px !important; margin-top: 4px !important; }
.timeline__past { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.timeline--dated li.is-past { opacity: 0.55; }
.timeline--dated li.is-past .timeline__n { background: var(--bg-2); color: var(--muted); box-shadow: none; }
.timeline--dated li.is-past h3 { font-size: 16px; }
.timeline--dated li.is-active .timeline__n, .timeline--dated li.is-deadline .timeline__n { animation: pulse-ring 2.2s var(--ease) infinite; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(43, 89, 255, 0.35); } 70% { box-shadow: 0 0 0 12px rgba(43, 89, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(43, 89, 255, 0); } }
@media (prefers-reduced-motion: reduce) { .timeline--dated li .timeline__n { animation: none !important; } }

/* Home: next key date */
.next-date {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 18px; align-items: center;
  padding: 18px 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
.next-date__count { display: grid; place-items: center; min-width: 92px; padding: 10px 12px; border-radius: 18px; background: var(--brand); color: #fff; text-align: center; }
.next-date__count b { font-family: var(--font-display); font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.next-date__count small { font-size: 12px; font-weight: 700; opacity: 0.85; }
.next-date__body { min-width: 0; }
.next-date__kicker { font-size: 12.5px; font-weight: 750; color: var(--brand-700); text-transform: uppercase; letter-spacing: 0.04em; }
.next-date__body h3 { font-family: var(--font-display); font-size: 19px; font-weight: 750; letter-spacing: -0.02em; margin: 2px 0 2px; }
.next-date__body p { margin: 0; color: var(--muted); font-size: 14px; }
.next-date__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 760px) {
  .next-date { grid-template-columns: auto minmax(0, 1fr) auto; }
  .next-date__actions { grid-column: auto; justify-content: flex-end; }
}
.next-date-wrap { margin-top: -8px; margin-bottom: 18px; }

/* ---- Share card ------------------------------------------------------------ */
.summary-card .btn-share { margin-top: 12px; background: #fff; color: var(--brand-700); border-color: transparent; }
.sheet--share .sheet__body { display: grid; justify-items: center; }
.share-preview { display: block; width: min(100%, 340px); height: auto; border-radius: 18px; box-shadow: var(--shadow-2, 0 12px 30px rgba(15, 23, 51, 0.18)); }
.share-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
.share-actions .btn { justify-content: center; }
@media (min-width: 640px) { .share-actions { grid-template-columns: repeat(4, auto); justify-content: center; } }

/* Long Russian words in compact cards */
.report__item > div { min-width: 0; }
.report__item b, .report__item span { overflow-wrap: anywhere; hyphens: auto; }
