/* Estudara homepage — design tokens and component classes, adapted from the
   Broadsheet design system used in the homepage design canvas. */
/* Local font fallbacks avoid a blocking third-party font request. */
/* While Source Serif 4 downloads the page is drawn in a local font stretched to the
   same width (measured against the real font), so the header and headings do not
   re-wrap and push the page down when the web font arrives (layout shift).
   Georgia where it exists; Times New Roman as the second choice. */
@font-face { font-family: "Source Serif 4 Fallback"; src: local("Georgia"); font-weight: 400; size-adjust: 107.3%; ascent-override: 96.9%; descent-override: 31.7%; line-gap-override: 0%; }
@font-face { font-family: "Source Serif 4 Fallback"; src: local("Georgia Bold"); font-weight: 600; size-adjust: 93.7%; ascent-override: 111%; descent-override: 36.3%; line-gap-override: 0%; }
@font-face { font-family: "Source Serif 4 Fallback Times"; src: local("Times New Roman"); font-weight: 400; size-adjust: 118.3%; ascent-override: 87.9%; descent-override: 28.7%; line-gap-override: 0%; }
@font-face { font-family: "Source Serif 4 Fallback Times"; src: local("Times New Roman Bold"), local("Times New Roman"); font-weight: 600; size-adjust: 112.2%; ascent-override: 92.7%; descent-override: 30.3%; line-gap-override: 0%; }

:root {
  --color-bg: #ffffff;
  --color-surface: #f3f5f9;
  --color-text: #0d1b2a;
  --color-accent: #2459d6;
  --color-accent-2: #b45309;
  --color-divider: #dfe3ea;
  --color-control-border: #6b7385; /* 4.8:1 on white, 4.4:1 on --color-surface (WCAG 1.4.11 needs 3:1) */
  --studio-copper: #1b3fa8;
  --studio-lime: #d5e3ff;

  /* Neutral ramp: ink navy tints. --color-neutral-600 and darker are real text (4.5:1 on white and on --color-surface). */
  --color-neutral-100: #f6f7fa;
  --color-neutral-200: #eceef3;
  --color-neutral-300: #d9dde6;
  --color-neutral-400: #b3bac8;
  --color-neutral-500: #8a93a5;
  --color-neutral-600: #5b6578;
  --color-neutral-700: #465066;
  --color-neutral-800: #2c3648;
  --color-neutral-900: #1a2333;

  /* Cobalt ramp. 600 is the brand cobalt (links 6.0:1 on white). 800 fills primary buttons (white text 9:1). */
  --color-accent-100: #eaf1ff;
  --color-accent-200: #d5e3ff;
  --color-accent-300: #a9c5ff;
  --color-accent-400: #6f9dff;
  --color-accent-500: #3f78f0;
  --color-accent-600: #2459d6;
  --color-accent-700: #1d47b8;
  --color-accent-800: #1b3fa8;
  --color-accent-900: #0d1b2a;

  /* Amber, the one warm second accent. 700 and darker are text (5:1 on white). */
  --color-accent-2-100: #fff7e6;
  --color-accent-2-200: #fde9bf;
  --color-accent-2-300: #fbd38d;
  --color-accent-2-400: #f6ad55;
  --color-accent-2-500: #dd8a1c;
  --color-accent-2-600: #c26a0c;
  --color-accent-2-700: #92400e;
  --color-accent-2-800: #78350f;
  --color-accent-2-900: #451a03;

  --font-heading: "Source Serif 4", "Source Serif 4 Fallback", "Source Serif 4 Fallback Times", system-ui, sans-serif;
  --font-heading-weight: 600;
  --font-body: "Source Serif 4", "Source Serif 4 Fallback", "Source Serif 4 Fallback Times", system-ui, sans-serif;

  --space-1: 5px;
  --space-2: 10px;
  --space-3: 15px;
  --space-4: 20px;
  --space-6: 30px;
  --space-8: 40px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  text-wrap: pretty;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
/* #39: the default, un-styled link color used the old light-teal --color-accent,
   which only reaches 4.08:1 on white and 3.65:1 on --color-bg - both
   fail WCAG AA's 4.5:1 for normal text. --color-accent-700 clears both
   with margin (6.39:1 / 5.72:1); the hover state moves one shade
   darker still, preserving the original "darkens on hover" feel. */
a { color: var(--color-accent-700); text-underline-offset: 3px; }
a:hover { color: var(--color-accent-800); }
img { display: block; max-width: 100%; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* — skip link — */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--color-accent-900); color: var(--color-bg);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 14px;
  text-decoration: none; transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* #39: same contrast issue as the base link color above - white/near-white
   text on the plain --color-accent background was only 3.65-4.08:1.
   Shifted the whole hover/active progression one to two shades darker so
   every real state (default, hover, active) clears 4.5:1. */
.btn-primary { background: var(--color-accent-700); color: #ffffff; }
.btn-primary:hover { background: var(--color-accent-800); }
.btn-primary:active { background: var(--color-accent-900); }
.btn-secondary { border-color: var(--color-control-border); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent-700); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }

/* — forms — */
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-control-border); border-radius: var(--radius-md);
}
.input::placeholder { color: color-mix(in srgb, var(--color-text) 65%, transparent); opacity: 1; }
.input:hover { border-color: var(--color-text); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface);
}

/* — tags — */
.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  /* 60% only reached 4.23:1 on the grey staff tables; 70% clears 4.5:1 on every background. */
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
  padding: var(--space-2); border-bottom: 1px solid var(--color-divider);
}
.table td {
  padding: var(--space-2); vertical-align: top;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* — navigation — */
.nav {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
}
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; margin-right: auto;
}
.nav a { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-accent-700); }

/* — FAQ disclosure — */
summary::-webkit-details-marker { display: none; }
summary { list-style: none; }
details[open] .sx-plus { display: none; }
details:not([open]) .sx-minus { display: none; }
details summary:hover { color: var(--color-accent-700); }

/* — dialog — */
.dialog-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent);
}
.dialog {
  width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: #ffffff; box-shadow: 0 24px 60px rgba(13,27,42,.25);
  /* On a short phone viewport the apply dialog's content (commission
     disclosure, optional warnings, checkbox, submit button) can exceed
     the available height. Without this, the dialog rendered at its full
     natural height, centered by the backdrop, pushing the submit button
     off both the top and bottom of the screen with no way to scroll to
     it — a real, live-tested block on submitting an application at all
     on mobile. max-height plus its own scroll region keeps every
     control reachable regardless of viewport size. */
  max-height: min(680px, 90vh); overflow-y: auto;
}
.dialog-title { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 20px; margin: 0; }
.dialog-body { font-size: 14px; margin: 0; color: var(--color-neutral-700); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* — misc — */
@keyframes sx-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* A listing with no real campus photo gets an honest monogram tile - never
   a stock photo, and never the destination banner standing in for it. */
.uni-photo-placeholder {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 100%;
  background: radial-gradient(120% 120% at 0% 0%, var(--color-accent-700) 0%, var(--color-accent-900) 72%);
  color: #ffffff;
}
.uni-photo-placeholder::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.16) 1px, transparent 1px);
  background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(135deg, transparent 25%, #000 100%);
  mask-image: linear-gradient(135deg, transparent 25%, #000 100%);
}
.uni-monogram {
  position: relative; z-index: 1;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 44px; line-height: 1; letter-spacing: 0.02em;
}
.uni-photo-city {
  position: relative; z-index: 1;
  font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.78;
}

.form-note { font-size: 12.5px; margin-top: 8px; }

/* The HTML hidden attribute must always win. Many panels set their own inline display
   (grid, flex), which would otherwise quietly override it and show them early. */
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* — homepage: instant search — */
.hero-search { position: relative; margin-top: 32px; max-width: 580px; }
.hero-search-field {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 16px;
  background: #ffffff; border: 1px solid var(--color-control-border); border-radius: 14px;
  box-shadow: 0 1px 0 rgba(13,27,42,.04), 0 14px 36px rgba(13,27,42,.09);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.hero-search-field:focus-within {
  border-color: var(--color-accent-600);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 18%, transparent), 0 14px 36px rgba(13,27,42,.12);
}
.hero-search-icon { flex: none; color: var(--color-neutral-600); }
.hero-search input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  font: inherit; font-size: 16px; padding: 10px 0; color: var(--color-text);
}
.hero-search input:focus-visible { outline: none; }
.hero-search input::placeholder { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.hero-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.hero-search-kbd {
  flex: none; font: 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--color-neutral-600); background: var(--color-neutral-100);
  border: 1px solid var(--color-neutral-300); border-bottom-width: 2px; border-radius: 5px; padding: 3px 7px;
}
.hero-search-field:focus-within .hero-search-kbd,
.hero-search.is-loading .hero-search-kbd { display: none; }
.hero-search-submit { flex: none; border-radius: 10px; padding: 11px 18px; }
.hero-search-spinner {
  display: none; flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--color-neutral-300); border-top-color: var(--color-accent-700);
  animation: hs-spin .7s linear infinite;
}
.hero-search.is-loading .hero-search-spinner { display: block; }
@keyframes hs-spin { to { transform: rotate(360deg); } }
.hero-search-results {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 8px);
  max-height: min(460px, 70vh); overflow-y: auto; padding: 6px;
  background: #ffffff; border: 1px solid var(--color-divider); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(13,27,42,.18);
  animation: hs-in .14s ease-out;
}
@keyframes hs-in { from { opacity: 0; transform: translateY(-4px); } }
.hs-group + .hs-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent); }
.hs-group-label { padding: 8px 12px 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-600); }
.hs-option { display: grid; gap: 2px; padding: 9px 12px; border-radius: 9px; color: var(--color-text); text-decoration: none; }
.hs-option:hover, .hs-option[aria-selected="true"] { background: var(--color-accent-100); color: var(--color-text); }
.hs-option-name { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 15px; line-height: 1.3; }
.hs-option-detail { font-size: 12.5px; line-height: 1.4; color: var(--color-neutral-600); }
.hs-option mark { background: color-mix(in srgb, var(--color-accent) 22%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.hs-verified {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; vertical-align: 2px;
  font-family: var(--font-body); font-weight: 400; font-size: 11px;
  color: var(--color-accent-800); background: var(--color-accent-100);
}
.hs-option[aria-selected="true"] .hs-verified, .hs-option:hover .hs-verified { background: #ffffff; }
.hs-see-all { margin-top: 4px; font-size: 13.5px; color: var(--color-accent-700); border-top: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent); border-radius: 0 0 9px 9px; }
.hs-empty { padding: 14px 12px 8px; font-size: 14px; color: var(--color-neutral-700); }

/* — homepage: live verification ledger — */
.ledger {
  background: #ffffff; border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(13,27,42,.16);
  padding: clamp(18px, 2cqw, 26px);
}
.ledger-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px 16px; flex-wrap: wrap; padding-bottom: 14px; }
.ledger-live { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-accent-700); }
.ledger-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent-600); animation: ledger-ping 2.2s ease-out infinite; }
@keyframes ledger-ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-accent-600) 45%, transparent); }
  70% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--color-accent-600) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.ledger-title { margin: 6px 0 0; font-size: 19px; }
.ledger-count { font-size: 12px; color: var(--color-neutral-600); }
.ledger-list { list-style: none; margin: 0; padding: 0; }
.ledger-row {
  border-top: 1px solid var(--color-divider);
  animation: ledger-row-in .45s ease-out backwards;
  animation-delay: calc(var(--i, 0) * 70ms + 120ms);
}
@keyframes ledger-row-in { from { opacity: 0; transform: translateY(6px); } }
.ledger-link {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 11px 6px; margin: 0 -6px; border-radius: 8px; color: inherit; text-decoration: none;
}
.ledger-link:hover { background: color-mix(in srgb, var(--color-accent) 6%, transparent); color: inherit; }
.ledger-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--color-accent-100); color: var(--color-accent-800); font-size: 14px; }
.ledger-mark--stale { background: var(--color-accent-2-100); color: var(--color-accent-2-700); }
.ledger-mark--unverified, .ledger-mark--claimed { background: var(--color-neutral-100); color: var(--color-neutral-600); }
.ledger-main { min-width: 0; }
.ledger-name, .ledger-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-name { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 15px; line-height: 1.3; }
.ledger-meta { font-size: 12.5px; color: var(--color-neutral-600); }
.ledger-when { text-align: right; font-size: 12.5px; line-height: 1.35; white-space: nowrap; }
.ledger-age { display: block; color: var(--color-text); }
.ledger-date { display: block; font-size: 11.5px; color: var(--color-neutral-600); }
.ledger-when--stale .ledger-age { color: var(--color-accent-2-700); }
.ledger-foot { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--color-divider); font-size: 12.5px; line-height: 1.55; color: var(--color-neutral-600); }

@media (prefers-reduced-motion: reduce) {
  .ledger-row, .ledger-dot, .hero-search-results { animation: none; }
  .hero-search-spinner { animation-duration: 2s; }
}

/* Phones: navigation links must be big enough to tap with a thumb (at least 44px tall) */
@media (max-width: 720px) {
  .nav a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 8px; }
  /* One swipeable row instead of five stacked rows eating the screen */
  .nav { flex-wrap: nowrap !important; overflow-x: auto; row-gap: 0 !important; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .nav > a, .nav > span { flex: 0 0 auto; white-space: nowrap; }
  .nav > a:nth-of-type(2) { margin-left: 0 !important; }
}
/* Compact navigation collapses behind a real button. public/app.js adds .nav--collapsible (so without
   scripting the swipeable row above stays) and toggles .is-open. The brand and the one primary action (.btn) stay in
   the top row; every other link and the language switch sit in the panel. */
.nav-toggle { display: none; }
.nav-logout {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.nav-logout:hover { color: var(--color-accent-700); }
@media (max-width: 1100px) {
  .studio-home .nav:not(.nav--collapsible) { flex-wrap: wrap !important; overflow: visible; }
  .nav.nav--collapsible { flex-wrap: wrap !important; overflow: visible; row-gap: 0 !important; gap: 8px; }
  .nav.nav--collapsible > .nav-brand { order: 0; }
  .nav.nav--collapsible > .btn { order: 1; flex: 0 1 104px; padding: 6px 10px; font-size: 13px; line-height: 1.2; text-align: center; white-space: normal !important; }
  .nav.nav--collapsible > .nav-toggle {
    order: 2; flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
    font: inherit; font-size: 14px; color: inherit; background: transparent; cursor: pointer;
    border: 1px solid var(--color-control-border); border-radius: var(--radius-sm);
  }
  .nav.nav--collapsible > .nav-toggle[aria-expanded='true'] { background: color-mix(in srgb, var(--color-text) 6%, transparent); }
  .nav-toggle-bars { width: 16px; height: 2px; margin-right: 8px; background: currentColor; box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor; }
  .nav.nav--collapsible > a:not(.btn):not(.nav-brand), .nav.nav--collapsible > span:not(.nav-brand) { display: none !important; order: 3; }
  .nav.nav--collapsible.is-open > a:not(.btn):not(.nav-brand), .nav.nav--collapsible.is-open > span:not(.nav-brand) {
    display: flex !important; flex: 1 0 100%; align-items: center; border-top: 1px solid var(--color-divider);
  }
  .nav.nav--collapsible.is-open > span:not(.nav-brand) { min-height: 44px; }
  .nav.nav--collapsible > .nav-logout { display: none; order: 3; }
  .nav.nav--collapsible.is-open > .nav-logout {
    display: inline-flex;
    align-items: center;
    flex: 1 0 100%;
    min-height: 44px;
    border-top: 1px solid var(--color-divider);
  }
}
.tap-link { display: inline-block; padding-block: 10px; }

/* A long unbroken line (a code sample, a web address) scrolls inside its own box and never widens the page: a grid
   child otherwise refuses to be narrower than its content. Found by walking the site at phone width in WebKit. */
pre, code { max-width: 100%; }
[style*="display:grid"] > * { min-width: 0; }
/* On a phone a wide table scrolls sideways inside itself instead of dragging the whole page with it. */
@media (max-width: 720px) { .table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; } }
/* Inside a wrapper that already scrolls (and has tabindex=0), the table stays a table: one scroll box, reachable by keyboard. */
@media (max-width: 720px) { [style*="overflow-x:auto"] > .table { display: table; overflow: visible; } }
/* On a touch screen every button is at least thumb-sized (the small shortlist and copy buttons measured 27-30px). */
@media (pointer: coarse) { .btn { min-height: 44px; } }
/* A scroll box must also clip the invisible screen-reader labels inside it, or one in a far-right cell widens the page. */
.table, [style*="overflow-x:auto"] { position: relative; }
code { overflow-wrap: anywhere; }
/* iPhone Safari zooms the whole page when a text box with text under 16px is tapped, and often does not zoom back. On a
   touch screen every text box is at least 16px (inline sizes included). */
@media (pointer: coarse) { input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=file]):not([type=range]), select, textarea { font-size: 16px !important; } }
/* Touch targets (QA Q-02). WCAG 2.2 AA (2.5.8) wants at least 24 x 24 CSS px everywhere; on a touch screen or a narrow
   window the main controls are thumb-sized (about 44px). Checkboxes and radio buttons stay visually small, but the whole
   padded label is the tap area. Fine-pointer desktops are untouched. */
@media (pointer: coarse), (max-width: 720px) {
  input[type=checkbox], input[type=radio] { width: 24px; height: 24px; flex: none; }
  label:has(input[type=checkbox]), label:has(input[type=radio]) { box-sizing: border-box; min-height: 44px; padding-block: 10px; }
  label:has(input[type=checkbox]):not([style*="display"]), label:has(input[type=radio]):not([style*="display"]) { display: inline-block; }
  label:has(.uni-level-filter, .compare-checkbox) { min-width: 44px; min-height: 44px; padding-inline: 6px; cursor: pointer; }
  input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=range]), select, textarea, .input { min-height: 44px; }
  summary { box-sizing: border-box; min-height: 44px; padding-block: 12px; cursor: pointer; }
  .skip-link { display: inline-flex; align-items: center; min-height: 44px; }
  .nav a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  a.tag { min-height: 44px; }
  /* Stand-alone links (footer columns, card and list links), not links that sit inside a sentence */
  :is(footer, main, [role=main], .container) :is(div, li, td, nav, section, article) > a:not(.btn):not(.tag):not(.nav-brand),
  :is(footer, main, [role=main], .container) :is(h2, h3, h4, p) > a:only-child:not(.btn):not(.tag),
  #more-note + a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
}

/* Audience switch above the home hero. On a phone the four choices sit in a compact 2 x 2 grid (28 Nov 2026): all four are
   visible at once, which the earlier one-row sideways scroll did not do, for about 40px more height above the headline. */
.persona-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 24px 0 0; }
@media (max-width: 720px) {
  .persona-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px 0 0; }
  .persona-tabs > a { min-width: 0; min-height: 40px; display: flex; align-items: center; padding: 8px !important; font-size: 12.5px !important; line-height: 1.25; text-align: center; justify-content: center; white-space: normal; }
  .persona-tabs > a[aria-current="page"] { order: -1; }
}
/* Narrow phones: the brand, the sign-up button and the Menu button were 2px too wide for one row at 375px, so Menu
   dropped to a second row and the header took 123px. Slightly tighter spacing keeps all three on one row down to 360px. */
@media (max-width: 420px) {
  .nav.nav--collapsible { gap: 6px; }
  .nav.nav--collapsible > .btn { flex-basis: 92px; }
  .nav.nav--collapsible > .nav-toggle { padding: 0 10px; }
}
@media (max-width: 370px) { .nav.nav--collapsible > .btn { flex-basis: 80px; font-size: 12px; padding-inline: 6px; } .nav-toggle-bars { margin-right: 6px; } }

/* Collapsed from the first paint. The rules above wait for app.js to add .nav--collapsible at the end of the page, so the header
   first rendered fully open (255px) and snapped to one row (79px): a layout shift of 0.201 on the home page (Lighthouse, 360px).
   With scripting on, the same layout is keyed on the menu button's presence instead. With scripting off nothing here applies and
   the swipeable row stays. (test/nav-no-layout-shift.test.js keeps the two copies identical.) */
@media (scripting: enabled) {
  @media (max-width: 1100px) {
    .nav:has(> .nav-toggle) { flex-wrap: wrap !important; overflow: visible; row-gap: 0 !important; gap: 8px; }
    .nav:has(> .nav-toggle) > .nav-brand { order: 0; }
    .nav:has(> .nav-toggle) > .btn { order: 1; flex: 0 1 104px; padding: 6px 10px; font-size: 13px; line-height: 1.2; text-align: center; white-space: normal !important; }
    .nav:has(> .nav-toggle) > .nav-toggle {
      order: 2; flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
      font: inherit; font-size: 14px; color: inherit; background: transparent; cursor: pointer;
      border: 1px solid var(--color-control-border); border-radius: var(--radius-sm);
    }
    .nav:has(> .nav-toggle) > .nav-toggle[aria-expanded='true'] { background: color-mix(in srgb, var(--color-text) 6%, transparent); }
    .nav-toggle-bars { width: 16px; height: 2px; margin-right: 8px; background: currentColor; box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor; }
    .nav:has(> .nav-toggle) > a:not(.btn):not(.nav-brand), .nav:has(> .nav-toggle) > span:not(.nav-brand) { display: none !important; order: 3; }
    .nav:has(> .nav-toggle).is-open > a:not(.btn):not(.nav-brand), .nav:has(> .nav-toggle).is-open > span:not(.nav-brand) {
      display: flex !important; flex: 1 0 100%; align-items: center; border-top: 1px solid var(--color-divider);
    }
    .nav:has(> .nav-toggle).is-open > span:not(.nav-brand) { min-height: 44px; }
    .nav:has(> .nav-toggle) > .nav-logout { display: none; order: 3; }
    .nav:has(> .nav-toggle).is-open > .nav-logout {
      display: inline-flex;
      align-items: center;
      flex: 1 0 100%;
      min-height: 44px;
      border-top: 1px solid var(--color-divider);
    }
  }
  @media (max-width: 420px) {
    .nav:has(> .nav-toggle) { gap: 6px; }
    .nav:has(> .nav-toggle) > .btn { flex-basis: 92px; }
    .nav:has(> .nav-toggle) > .nav-toggle { padding: 0 10px; }
  }
  @media (max-width: 370px) { .nav:has(> .nav-toggle) > .btn { flex-basis: 80px; font-size: 12px; padding-inline: 6px; } .nav-toggle-bars { margin-right: 6px; } }
}

/* Sign-up cards for other audiences (home, #start). The heading is the <summary>; on wide screens it is not a control. */
.start-more { display: flex; flex-direction: column; flex: 1; }
.start-more > summary { list-style: none; display: grid; gap: 16px; }
.start-more > summary::-webkit-details-marker { display: none; }
.start-more-body { display: flex; flex-direction: column; gap: 16px; flex: 1; margin-top: 16px; }
@media (min-width: 721px) { .start-more > summary { pointer-events: none; } }
@media (max-width: 720px) {
  .start-more > summary { cursor: pointer; position: relative; padding-right: 36px; min-height: 44px; }
  .start-more > summary::after { content: ''; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s ease; }
  .start-more[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
  .start-more > summary h3 { font-size: 22px !important; }
  /* University cards: a shorter photo and a two-line description, so more than one card fits on a screen. */
  .uni-card-photo { aspect-ratio: auto !important; height: 140px; }
  .uni-card .institution-logo-panel { height: 64px; padding-block: 10px; }
  .uni-card-blurb { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .start-more > summary::after { transition: none; } }

/* Home page on a phone: fewer repeats. Desktop keeps every section. */
@media (max-width: 720px) {
  /* 'One place for every application' and the four promises repeat the three steps further down. */
  #product, .home-promises { display: none !important; }
  /* 'What you can check': keep the four headings and the link; the detail lives on the verification page. */
  #verified { padding-block: 40px !important; gap: 28px !important; }
  #verified ol li { padding-bottom: 14px !important; }
  #verified ol li p, #verified ol li > span[aria-hidden='true'] { display: none !important; }
  /* A country's list starts with two cards. */
  .uni-cards--preview > :nth-child(n+3) { display: none !important; }
  #uni-show-all { margin-top: 20px; width: 100%; white-space: normal; }
  /* The hero photo collage at about three quarters of its size. */
  .studio-home-hero .studio-portrait { zoom: 0.74; margin-inline: auto; }
  /* Footer links in two columns. */
  .site-footer > div { gap: 28px !important; padding-block: 40px !important; }
  .site-footer .footer-links { grid-template-columns: 1fr 1fr; gap: 0 16px !important; }
}
#uni-show-all[hidden] { display: none; }

/* Proof hero. Under the search: how many listings are verified right now, and the latest check, both from the records.
   In the search results: each university shows its accreditor and check date, or says plainly that it is not yet verified. */
.hero-proof { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 12px 0 0; font-size: 13.5px; line-height: 20px; }
.hero-proof a { color: var(--color-neutral-700); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 28px; }
.hero-proof a:hover, .hero-proof a:focus-visible { color: var(--color-accent-800); text-decoration: underline; }
.hero-proof-count { font-weight: 600; color: var(--color-accent-800) !important; align-items: flex-start !important; }
/* The trust line can wrap on a phone: keep its dot beside the first line (centre of a 20px line). */
.hero-proof-count .ledger-dot { flex: none; margin-top: 6px; }
.hero-proof a.hero-proof-latest { display: inline; }
.hero-proof-latest::before { content: ''; display: inline-block; vertical-align: middle; margin-right: 6px; width: 14px; height: 8px; margin-top: -6px; border-left: 2px solid var(--color-accent); border-bottom: 2px solid var(--color-accent); transform: rotate(-45deg) scale(.7); }
.hs-evidence { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--color-accent-800); }
.hs-evidence-mark { flex: none; width: 10px; height: 6px; margin-top: -3px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }
.hs-evidence--unverified, .hs-evidence--stale { color: var(--color-neutral-700); }
.hs-evidence--unverified .hs-evidence-mark, .hs-evidence--stale .hs-evidence-mark { width: 9px; height: 9px; margin: 0; border: 1.5px dashed currentColor; border-radius: 50%; transform: none; }
@media (max-width: 720px) {
  /* On a phone the records come straight after the search, before the photo. */
  .studio-home-hero > .studio-ledger { order: 2; }
  .studio-home-hero > .studio-portrait, .studio-home-hero > .studio-audience-photo { order: 3; }
  .studio-home-hero { gap: 36px !important; }
  .hero-proof-latest { flex-basis: 100%; }
}
/* A search result is always a stack (name, place, proof). The touch-target rule for links was turning it into one cramped row. */
.hero-search-results .hs-option { display: grid !important; align-content: center; justify-items: start; }

/* Home page details. The palette itself is the :root tokens, shared by every page. */
.studio-home .studio-home-hero .hero-search-field { border-color: #b3bac8; background: #ffffff; box-shadow: 0 5px 20px #0d1b2a0a; }
.studio-home .studio-home-hero .studio-ledger > div { background: #f3f5f9 !important; }
.studio-home .studio-destination-card { border-color: #ffffff; background: #0d1b2a; box-shadow: 4px 13px 24px #0d1b2a22; }
.studio-home .studio-destination-card:after { background: linear-gradient(180deg, #0d1b2a10 20%, #0d1b2a20 40%, #0d1b2aed 100%); }
.studio-home .studio-destination-arrow { color: #0d1b2a; }
.studio-home .studio-portrait-back { background: #d5e3ff; border-color: #a9c5ff; }
.studio-home .studio-portrait-orbit { border-color: #c9d3e3; }
html.studio-page.studio-home .tag.tag-neutral { background: #eceef3; color: #2c3648; }
html.studio-page.studio-home .ledger { background: #ffffff; }
.studio-home .studio-portrait:before { color: #2459d6; }
.studio-home .studio-portrait .studio-portrait-orbit { border-color: #c9d3e3; }
.studio-home .studio-portrait .studio-portrait-back { border-color: #ffffff; box-shadow: 15px 26px 38px #0d1b2a1f; }
.studio-home .studio-audience-photo { --photo-mat: #d5e3ff; }

/* A record row must never be wider than the screen: a long status ("Not yet verified", "Due for re-check") wraps beside the name
   instead of pushing the whole page sideways. Found when the unchecked states were joined onto the phone layout. */
.ledger-link { min-width: 0; max-width: 100%; }
@media (max-width: 720px) {
  .ledger-when { white-space: normal; max-width: 38%; overflow-wrap: anywhere; }
}

/* Selected state by shape, not tint (WCAG 1.4.1, 1.4.11): the chosen audience is a filled dark pill with a check
   mark, the others are outlined; the current nav link is underlined. Kept last so it wins over the home overrides. */
.persona-tabs > a[aria-current="page"] { background: var(--color-accent-800); color: #ffffff; border: 1px solid var(--color-accent-800); font-weight: 600; }
.persona-tabs > a[aria-current="page"]::before { content: "✓"; margin-inline-end: 6px; }
.persona-tabs > a.tag.tag-neutral:not([aria-current]) { background: transparent; border: 1px solid var(--color-control-border); color: var(--color-text); }
.nav a[aria-current='page'] { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }

.field-label { display: block; font-size: 13.5px; font-weight: 600; margin: 0 0 4px; }
.field-hint { margin: 4px 0 0; font-size: 13px; opacity: 0.85; }

[data-rc="continue"][aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

/* Reflow at phone width (WCAG 1.4.10): many buttons carry an inline white-space:nowrap, which pushed long French,
   Spanish and Portuguese labels past a 360px screen, and a long signed-in email in a heading did not wrap. */
@media (max-width: 600px) {
  .btn { white-space: normal !important; max-width: 100%; text-align: center; }
}
h1, h2, h3 { overflow-wrap: break-word; }

/* The key hint is for keyboards; hide it where there is no hover (phones, tablets). */
@media (hover: none) {
  .hero-search-kbd { display: none; }
}
/* Every disclosure shows that it opens (WCAG 1.3.1, 4.1.2). The default marker is switched off above, and only the
   FAQ (+/−), the sign-up cards and the programme filters drew their own, so the rest showed nothing at all. */
details:not(.start-more):not(.programme-extra-filters) > summary:not(:has(.sx-plus))::after {
  content: ''; display: inline-block; width: 8px; height: 8px; margin-inline-start: 10px; vertical-align: middle;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg);
}
details[open]:not(.start-more):not(.programme-extra-filters) > summary:not(:has(.sx-plus))::after { transform: translateY(1px) rotate(-135deg); }
/* The skip link focuses #main; it takes focus without drawing a box around the whole page. */
#main:focus, #main:focus-visible { outline: none; }
/* A long source address has no spaces to break at; let any external link break so it cannot widen the page (320 px reflow). */
a[href^="http"] { overflow-wrap: anywhere; }

/* Shared header and footer (restyle 2b). The same look the home page had inline, written once. */
.site-header { flex-wrap: wrap; row-gap: 10px; column-gap: 12px; padding-inline: max(clamp(20px,5cqw,72px), calc((100% - 1240px)/2 + clamp(20px,5cqw,72px))); }
.site-header .nav-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.nav-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; background: var(--color-accent-800); color: var(--color-bg); font-family: var(--font-heading); font-weight: 600; font-size: 17px; border-radius: var(--radius-sm); }
.site-header .nowrap { white-space: nowrap; }
.site-header .nav-count { font-size: 10px; }
.nav-langs { display: inline-flex; gap: 8px; font-size: 13px; letter-spacing: 0.06em; color: var(--color-neutral-600); }
.site-footer { background: var(--color-accent-900); color: var(--color-bg); }
.sf-grid { max-width: 1240px; margin: 0 auto; padding: clamp(48px,5cqw,72px) clamp(20px,5cqw,72px); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 40px clamp(28px,4cqw,64px); }
.sf-brand { display: inline-flex; align-items: center; gap: 10px; font: 600 22px var(--font-heading); }
.sf-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; background: var(--color-bg); color: var(--color-accent-900); font-size: 17px; border-radius: var(--radius-sm); }
.sf-tag { margin: 16px 0 0; font-size: 14.5px; line-height: 24px; opacity: 0.75; max-width: 36ch; }
.sf-h { margin: 0 0 12px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer .footer-links { display: grid; gap: 8px; font-size: 15px; }
.sf-base { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 24px; border-top: 1px solid color-mix(in srgb, var(--color-bg) 18%, transparent); font-size: 13px; opacity: 0.7; }

/* University page key facts (sprint item 5, 28 Nov 2026): the four facts a student decides on, two per row on wide screens. */
.key-facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px 24px; margin: 0; }
.key-facts-grid dt { font-size: 13px; color: var(--color-neutral-600); }
.key-facts-grid dd { margin: 4px 0 0; font-family: var(--font-heading); font-weight: 600; font-size: 17px; line-height: 1.3; color: var(--color-text); }
.key-facts-grid dd a { color: var(--color-accent-700); }
