* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-base);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 86% 16%, rgba(245, 165, 36, 0.1), transparent 28rem),
    linear-gradient(180deg, var(--bg-base), #080807 55%, var(--bg-base));
  color: var(--fg-1);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 2.6rem;
  border: 0;
  border-radius: var(--r-2);
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: var(--fg-1);
}

:focus-visible {
  outline: 0;
  box-shadow: var(--ring-focus);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  inset-block-start: var(--s-3);
  inset-inline-start: var(--s-3);
  z-index: 40;
  transform: translateY(-150%);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  background: var(--bg-elev-2);
  color: var(--fg-1);
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border-faint);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  width: min(1240px, calc(100% - 48px));
  min-height: 64px;
  margin: 0 auto;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: var(--fg-1);
  font-size: var(--fs-15);
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid var(--accent);
  border-radius: var(--r-full);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Erik's mark: black glyph (magnifier + mortarboard), inverted to white
   on the dark theme, as-drawn on light. */
.brand-logo {
  height: 26px;
  width: auto;
  flex: 0 0 auto;
  filter: invert(1);
}

:root[data-theme="light"] .brand-logo {
  filter: none;
}

.show-more {
  display: block;
  margin: var(--s-5) auto 0;
}

/* The hidden attribute must win over the display above - otherwise the
   button renders before any search has produced results. */
.show-more[hidden] {
  display: none;
}

.show-more:not([hidden]) {
  padding: var(--s-3) var(--s-6);
  font-size: var(--fs-15);
  font-weight: 600;
  color: var(--fg-1);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  cursor: pointer;
  transition:
    border-color var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out);
}

.show-more:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.show-more:disabled {
  opacity: 0.6;
  cursor: progress;
}

.brand-context {
  margin-left: var(--s-2);
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  min-width: 0;
}

.request-access {
  min-height: 30px;
  padding: 4px 12px;
  font-size: var(--fs-12);
  white-space: nowrap;
}

@keyframes request-flash {
  0%,
  100% {
    border-color: var(--border);
    color: var(--fg-2);
    box-shadow: none;
  }
  50% {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
  }
}

.request-access.is-flashing {
  animation: request-flash 700ms var(--ease-std) 4;
}

.request-modal,
.feedback-modal {
  width: min(460px, calc(100vw - 32px));
}

.request-form {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5) var(--s-5);
}

.request-form p {
  margin: 0 0 var(--s-2);
}

.request-label {
  font-size: var(--fs-13);
  color: var(--fg-2);
}

.request-label span {
  color: var(--fg-4);
  font-size: var(--fs-12);
}

.request-form input,
.request-form textarea {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  background: var(--bg-inset);
  color: var(--fg-1);
  font-size: var(--fs-14);
  resize: vertical;
}

.request-form input:focus,
.request-form textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.request-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-2);
}

#request-status,
#feedback-status {
  color: var(--fg-2);
}

.site-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--s-6);
  white-space: nowrap;
}

.site-nav a,
.site-footer a,
.profile-link,
.back-link {
  border-bottom: 1px solid var(--border-strong);
  color: var(--fg-2);
  font-size: var(--fs-14);
  text-decoration: none;
  transition:
    border-color var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out);
}

.site-nav a:hover,
.site-footer a:hover,
.profile-link:hover,
.back-link:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.deployment-note {
  max-width: 34rem;
  margin: 0;
  color: var(--fg-3);
  font-size: var(--fs-13);
  text-align: end;
}

.feedback-button,
.theme-toggle {
  min-height: 28px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: none;
  color: var(--fg-2);
  font-size: var(--fs-12);
  cursor: pointer;
}

.feedback-button:hover,
.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--fg-1);
}

.feedback-form textarea {
  min-height: 132px;
}

.feedback-form input[type="file"] {
  color: var(--fg-3);
  font-size: var(--fs-12);
}

.feedback-form input[type="file"]::file-selector-button {
  margin-right: var(--s-2);
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-1);
  background: var(--bg-elev-2);
  color: var(--fg-2);
  cursor: pointer;
}

.beta-inline {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  white-space: nowrap;
}

.beta-inline input {
  width: 9rem;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm, 6px);
  background: var(--bg-elev-2);
  color: var(--fg-2);
  font-size: var(--fs-13);
}

.beta-inline input:focus {
  border-color: var(--accent);
  outline: none;
}

.app-shell {
  display: flex;
  flex-direction: column;
  gap: var(--s-8);
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: var(--s-10) 0 var(--s-24);
}

.composer-section {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.composer-heading {
  display: grid;
  gap: var(--s-2);
  max-width: 820px;
}

.composer-heading p,
.composer-heading h1 {
  margin: 0;
}

.composer-heading h1 {
  max-width: 18ch;
  color: var(--fg-1);
  font-family: var(--font-serif);
  font-size: var(--fs-40);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.1;
}

.composer-heading > p:last-child {
  max-width: 56ch;
  color: var(--fg-2);
  font-size: var(--fs-16);
}

.search-form,
.progress-card,
.interpreted-query,
.coverage-card,
.atlas-card,
.error-card,
.match-card,
#profile-card {
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  background: var(--bg-elev-1);
}

.interpreted-query.is-pending {
  opacity: 0.72;
}

.interpreted-query.is-pending .interpreted-dot {
  animation: ph-pulse 1.4s ease-in-out infinite;
}

.search-form {
  display: grid;
  gap: var(--s-3);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.query-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-1) var(--s-3);
  align-items: stretch;
}

/* The query field wraps textarea + counter; flattening it into the grid
   lets the Search button stretch to exactly the textarea's box (the
   counter sits in its own row below), keeping their edges aligned. */
.query-field textarea {
  grid-column: 1;
  grid-row: 1;
}

.query-meta {
  grid-column: 1;
  grid-row: 2;
}

.query-row .form-actions {
  grid-column: 2;
  grid-row: 1;
}

.query-label,
.beta-panel label {
  color: var(--fg-2);
  font-size: var(--fs-14);
  font-weight: 500;
}

.query-field {
  display: contents;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--bg-inset);
  color: var(--fg-1);
}

textarea {
  min-height: 86px;
  padding: 14px 18px;
  resize: vertical;
  font-size: var(--fs-16);
  line-height: 1.5;
}

input {
  min-height: 44px;
  padding: 0 14px;
}

#query-input {
  min-height: 52px;
  max-height: 40vh;
  padding: 13px 18px;
  font-size: var(--fs-16);
  line-height: 1.5;
  font-family: var(--font-sans);
  resize: none;
  overflow-y: auto;
}

textarea::placeholder,
input::placeholder {
  color: var(--fg-3);
}

textarea:focus,
input:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.query-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 11px;
}

.form-actions {
  display: flex;
  gap: var(--s-2);
  align-items: stretch;
}

.primary-button,
.ghost-button {
  padding: 0 var(--s-5);
  font-size: var(--fs-15);
  font-weight: 600;
  transition:
    background var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out),
    transform var(--dur-quick) var(--ease-out);
}

.primary-button {
  background: var(--accent);
  color: #1a1200;
  box-shadow: var(--shadow-accent);
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-hi);
}

.primary-button:active:not(:disabled) {
  background: var(--accent-lo);
  transform: scale(0.98);
}

.ghost-button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-2);
}

.ghost-button:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--bg-elev-2);
  color: var(--fg-1);
}

.beta-panel {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
  max-width: 520px;
}

.beta-panel p {
  margin: 0;
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
}

.beta-panel label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

#beta-key {
  width: min(100%, 190px);
  min-height: 34px;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
}

.beta-panel[hidden],
.progress-card[hidden],
.error-card[hidden],
.interpreted-query[hidden],
.score-strip[hidden],
.result-summary[hidden],
.timing-summary[hidden],
#profile-card[hidden],
#removed-notice[hidden],
.profile-section[hidden],
#source-link[hidden] {
  display: none;
}

.progress-card {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
}

.stream-steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4) var(--s-5);
  align-items: center;
}

.stream-step {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--fg-4);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.stream-step i {
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  background: var(--bg-elev-3);
}

.stream-step.is-active,
.stream-step.is-done {
  color: var(--fg-2);
}

.stream-step.is-active i,
.stream-step.is-done i {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.stream-step.is-active i {
  animation: ph-pulse 1.2s ease-in-out infinite;
}

.progress-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--s-3);
  align-items: center;
  color: var(--fg-2);
  font-size: var(--fs-14);
}

.progress-pulse {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--bg-inset);
}

.progress-radar svg {
  width: 100%;
  height: 100%;
  animation: radar-spin 1.8s linear infinite;
}

.radar-ring {
  fill: none;
  stroke: var(--accent-lo);
  stroke-width: 1.5;
}

.radar-sweep {
  fill: var(--accent-faint);
}

.radar-dot {
  fill: var(--accent);
}

.progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: var(--r-full);
  background: var(--bg-inset);
}

#progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms var(--ease-out);
}

.interpreted-query {
  overflow: hidden;
}

.interpreted-bar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-6);
  border-bottom: 1px solid var(--border-faint);
  background: var(--bg-inset);
}

.interpreted-bar .interpreted-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: var(--r-full);
  background: var(--accent);
}

.interpreted-bar p {
  margin: 0;
  color: var(--fg-2);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.interpreted-body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: var(--s-10);
  padding: var(--s-5) var(--s-6);
}

.interpreted-copy {
  display: grid;
  gap: var(--s-2);
}

.interpreted-copy h2 {
  margin: 0;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border-faint);
  border-radius: var(--r-2);
  background: var(--bg-inset);
  color: var(--fg-1);
  font-size: var(--fs-16);
  font-weight: 400;
  line-height: 1.55;
}

.interpreted-query dl {
  display: grid;
  gap: var(--s-4);
  margin: 0;
}

.interpreted-query dt {
  margin: 0 0 var(--s-2);
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.interpreted-query dd {
  margin: 0;
}

.results-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: var(--s-8);
  align-items: start;
}

.filter-rail {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.coverage-card {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
}

.coverage-card p {
  margin: 0;
}

.coverage-count {
  color: var(--fg-2);
  font-size: 11px;
}

.sweden-map {
  display: block;
  width: 100%;
  height: auto;
}

.map-points circle {
  fill: var(--bg-elev-3);
  stroke: var(--accent);
  stroke-width: 1.5;
  transition:
    fill var(--dur-base) var(--ease-out),
    opacity var(--dur-base) var(--ease-out),
    stroke-width var(--dur-base) var(--ease-out);
}

.map-labels text {
  fill: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition:
    fill var(--dur-base) var(--ease-out),
    opacity var(--dur-base) var(--ease-out);
}

/* Satellite campuses: same visual language as institution dots, scaled
   down. They share the parent's data-code, so highlight/select/dim states
   arrive through the same class toggles as the parent marker. */
.map-points .campus-point {
  stroke-width: 1;
}

.map-points .is-highlighted {
  fill: var(--accent);
  stroke-width: 2;
  opacity: 1;
}

.map-points .campus-point.is-highlighted,
.map-points .campus-point.is-selected {
  stroke-width: 1.5;
}

.map-labels .is-highlighted {
  fill: var(--accent);
  opacity: 1;
}

.map-points .is-dimmed,
.map-labels .is-dimmed {
  opacity: 0.24;
}

.map-points circle,
.map-labels text {
  cursor: pointer;
}

.map-points .is-selected {
  fill: var(--accent);
  stroke: var(--fg-1);
  stroke-width: 2;
  opacity: 1;
}

.map-labels .is-selected {
  fill: var(--accent);
  font-weight: 700;
  opacity: 1;
}

.map-all-button {
  margin-top: var(--s-1);
  width: 100%;
  font-size: var(--fs-13);
}

.map-all-button.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.search-scope {
  margin: var(--s-2) 0 0;
  color: var(--fg-3);
  font-size: var(--fs-13);
}

.masked-cta {
  margin: var(--s-4) 0;
  padding: var(--s-4);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md, 10px);
  background: var(--bg-elev-2);
}

.masked-cta p {
  margin: 0 0 var(--s-2);
  color: var(--fg-2);
}

.masked-cta .masked-cta-lead {
  color: var(--fg-1);
  font-weight: 600;
}

.masked-cta-actions {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-3);
}

.auth-modal {
  width: min(600px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg, 14px);
  background: var(--bg-elev-1);
  color: var(--fg-1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.auth-modal::backdrop {
  background: rgba(8, 10, 14, 0.55);
  backdrop-filter: blur(4px);
}

.auth-modal-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border-strong);
  background: var(--bg-elev-2);
}

.auth-modal-title {
  margin: 0;
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--fg-1);
}

.auth-modal-close {
  border: none;
  background: none;
  color: var(--fg-2);
  font-size: var(--fs-16, 16px);
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: var(--r-sm, 6px);
}

.auth-modal-close:hover {
  color: var(--fg-1);
  background: var(--bg-elev-3);
}

.auth-modal-frame {
  display: block;
  width: 100%;
  height: min(600px, 80vh);
  border: none;
  /* Matches the embedded-auth skin the portal serves inside the frame,
     so the modal reads as one dark surface with no white flash. */
  background: var(--bg-elev-1);
  transition: height var(--dur-base) var(--ease-out);
}

.institution-filter {
  margin-top: var(--s-1);
  min-height: 36px;
  padding: 0 12px;
  font-size: var(--fs-13);
}

.map-hint {
  color: var(--fg-4);
  font-size: 11px;
}

.results-column,
.stream-region {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  min-width: 0;
}

.atlas-card {
  overflow: hidden;
}

.atlas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border-faint);
}

.atlas-header h2,
.atlas-header p {
  margin: 0;
}

.atlas-header h2 {
  color: var(--fg-1);
  font-size: var(--fs-16);
  font-weight: 500;
}

.atlas-header p {
  color: var(--fg-3);
  font-size: var(--fs-14);
}

.atlas-header-actions {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.atlas-toggle {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-2);
  font-size: var(--fs-12);
  font-weight: 400;
}

.atlas-toggle:hover {
  border-color: var(--border-strong);
  background: var(--bg-elev-2);
  color: var(--fg-1);
}

.atlas-plane {
  position: relative;
  min-height: 400px;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(245, 165, 36, 0.08), transparent 11rem),
    var(--bg-inset);
}

.atlas-canvas {
  display: block;
  width: 100%;
  height: 400px;
  cursor: grab;
  touch-action: pan-y;
}

.atlas-canvas:active {
  cursor: grabbing;
}

.axis {
  position: absolute;
  background: rgba(var(--canvas-fg), 0.07);
}

.axis-x {
  top: 50%;
  left: 8%;
  width: 84%;
  height: 1px;
}

.axis-y {
  top: 9%;
  left: 50%;
  width: 1px;
  height: 82%;
}

.atlas-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 190px;
  height: 190px;
  border: 1px dashed rgba(245, 165, 36, 0.22);
  border-radius: var(--r-full);
  transform: translate(-50%, -50%);
}

.atlas-dot {
  position: absolute;
  border-radius: var(--r-full);
}

.dot-query {
  top: 48%;
  left: 49%;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
  transform: rotate(45deg);
}

.dot-match {
  width: 9px;
  height: 9px;
  background: var(--accent);
}

.dot-context {
  width: 6px;
  height: 6px;
  background: var(--fg-2);
  opacity: 0.55;
}

.dot-near {
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--accent-lo);
}

.dot-a {
  top: 36%;
  left: 58%;
}

.dot-b {
  top: 62%;
  left: 43%;
}

.dot-c {
  top: 27%;
  left: 31%;
}

.dot-d {
  top: 70%;
  left: 68%;
}

.dot-e {
  top: 39%;
  left: 72%;
}

.atlas-card.is-lit .atlas-ring {
  border-color: rgba(245, 165, 36, 0.42);
  box-shadow: 0 0 32px rgba(245, 165, 36, 0.08);
}

/* Researcher chips (atlas v2): one per streamed match, rank + masked #id;
   tap toggles that researcher's skill constellation on the canvas. */
.atlas-researchers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4) 0;
  border-top: 1px solid var(--border-faint);
}

/* The hidden attribute must win over the display above - the row only
   exists once matches have streamed into a live atlas. */
.atlas-researchers[hidden] {
  display: none;
}

.atlas-researchers-label,
.atlas-researchers-hint {
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.atlas-researchers-hint {
  color: var(--fg-4);
  font-size: 10px;
  margin-left: var(--s-1);
}

.atlas-researcher-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.atlas-chip {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  padding: 4px 10px;
  cursor: pointer;
  font: 500 11px var(--font-mono);
  color: var(--fg-1);
  transition:
    opacity var(--dur-quick) var(--ease-out),
    border-color var(--dur-quick) var(--ease-out);
}

.atlas-chip:hover {
  border-color: var(--accent-lo);
}

.atlas-chip[aria-pressed="false"] {
  opacity: 0.4;
  border-color: var(--border);
  color: var(--fg-3);
}

.atlas-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-top: 1px solid var(--border-faint);
}

/* One bordered footer block when the chips row is visible above the legend. */
.atlas-researchers:not([hidden]) + .atlas-legend {
  border-top: 0;
}

/* Legend entries are layer toggles (atlas v2): aria-pressed mirrors whether
   that point set is drawn; unpressed keys dim to the mockup's 0.35. */
.legend-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  background: none;
  border: none;
  border-radius: var(--r-1);
  padding: 3px 6px;
  cursor: pointer;
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 11px;
  transition:
    opacity var(--dur-quick) var(--ease-out),
    background var(--dur-quick) var(--ease-out);
}

.legend-toggle:hover:not(:disabled) {
  background: var(--bg-elev-2);
}

.legend-toggle[aria-pressed="false"] {
  opacity: 0.35;
}

.legend-toggle:disabled {
  opacity: 0.3;
  cursor: default;
}

.atlas-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  flex-shrink: 0;
}

/* Needs to out-specify `.atlas-legend i` (0,1,1), which otherwise forces
   the full border-radius and turns the rotated square back into a circle. */
.atlas-legend i.legend-query {
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
  box-shadow: 0 0 8px var(--accent);
}

.legend-matching {
  background: var(--accent);
}

.legend-others {
  background: var(--fg-2);
}

.legend-nearby {
  background: transparent;
  border: 1.5px solid var(--accent-lo);
  box-sizing: border-box;
}

.legend-shortlist {
  background: var(--accent-lo);
  opacity: 0.55;
}

.legend-context {
  background: var(--fg-4);
}

.atlas-caption {
  margin: 0;
  padding: 0 var(--s-4) var(--s-3);
  color: var(--fg-4);
  font-size: 11px;
}

.atlas-caption p {
  margin: 0;
  line-height: 1.6;
}

/* Pre/post-search surface pair: setJourneyActive toggles body.has-searched. */
body.has-searched .pre-search-only {
  display: none;
}

body:not(.has-searched) .post-search-only {
  display: none;
}

/* Signed-in viewers don't need the create-account teaser. */
body.is-authenticated [data-auth-hide] {
  display: none;
}

body:not(.is-authenticated) [data-auth-show] {
  display: none;
}

.pre-search-hero {
  display: grid;
  justify-items: center;
  gap: var(--s-3);
  padding: var(--s-10) 0 var(--s-2);
  text-align: center;
}

.pre-search-hero h1,
.pre-search-hero p {
  margin: 0;
}

.pre-search-hero h1 {
  color: var(--fg-1);
  font-family: var(--font-serif);
  font-size: clamp(var(--fs-32), 5vw, 46px);
  font-weight: 400;
  letter-spacing: -0.022em;
  line-height: 1.15;
}

.pre-search-hero p {
  max-width: 54ch;
  color: var(--fg-2);
  font-size: var(--fs-16);
  line-height: 1.6;
}

.try-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding-top: var(--s-1);
}

.try-row .t-small {
  color: var(--fg-3);
}

.try-row button {
  min-height: 36px;
  padding: 0 var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: transparent;
  color: var(--fg-2);
  font-size: var(--fs-13);
  font-weight: 400;
}

.try-row button:hover {
  border-color: var(--accent-lo);
  background: var(--accent-faint);
  color: var(--accent);
}

.signin-teaser {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-top: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  background: var(--bg-elev-1);
}

.signin-teaser p {
  margin: 0;
}

.signin-teaser .t-small {
  color: var(--fg-2);
  line-height: 1.55;
}

.signin-teaser-cta {
  align-self: flex-start;
  border-color: var(--accent-lo);
  color: var(--accent);
  text-decoration: none;
  padding: 8px 14px;
  font-size: var(--fs-13);
}

.signin-teaser-cta:hover {
  border-color: var(--accent);
  background: var(--accent-faint);
}

.stream-panel {
  display: grid;
  gap: var(--s-4);
}

.stream-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
}

.stream-heading h2,
.result-summary,
.timing-summary {
  margin: 0;
}

.stream-heading h2 {
  color: var(--fg-1);
  font-size: var(--fs-20);
  font-weight: 500;
}

.result-summary,
.timing-summary {
  color: var(--fg-3);
  font-size: var(--fs-14);
}

.timing-summary {
  text-align: end;
}

.error-card {
  display: grid;
  gap: var(--s-3);
  justify-items: start;
  padding: var(--s-4);
  border-color: var(--status-danger);
}

.error-card p {
  margin: 0;
  color: var(--fg-1);
}

.score-strip {
  display: flex;
  align-items: flex-end;
  gap: var(--s-2);
  min-height: 54px;
  padding: var(--s-3);
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--bg-inset);
  scrollbar-width: thin;
}

.score-strip-item {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: flex-end;
  justify-content: center;
  width: 38px;
  height: var(--score-height, 16px);
  min-height: 12px;
  padding: 3px;
  border: 1px solid var(--accent-lo);
  border-radius: 6px 6px 4px 4px;
  background: var(--accent);
  color: #1a1200;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.score-strip-item.is-pending {
  border-color: var(--border-strong);
  background: var(--bg-elev-3);
  color: var(--fg-3);
}

.match-grid {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.match-card {
  display: flex;
  gap: var(--s-5);
  align-items: flex-start;
  padding: var(--s-6);
  opacity: 0;
  animation: card-in 260ms var(--ease-out) forwards;
  transition:
    background var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}

.match-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-elev-2);
}

.match-card.is-featured,
.match-card.is-on-bench {
  border-color: var(--accent-lo);
  box-shadow: var(--shadow-accent);
}

/* Once the viewer selects a card, selection is the only amber border -
   the rank-1 featured accent yields so it can't read as selected. */
.match-grid.has-selection .match-card.is-featured:not(.is-selected):not(.is-on-bench) {
  border-color: var(--border);
  box-shadow: none;
}

.match-card.is-selected {
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}

.score-dial {
  flex: 0 0 84px;
  width: 84px;
  color: var(--fg-3);
}

.score-dial svg {
  display: block;
  width: 84px;
  height: 84px;
}

.score-track,
.score-mid,
.score-inner {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
}

.score-inner {
  stroke: var(--border-strong);
}

.score-dot {
  fill: var(--accent);
}

.score-center {
  fill: var(--fg-1);
}

.score-value {
  fill: var(--fg-4);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-anchor: middle;
}

.score-dial.is-pending .score-dot {
  fill: var(--fg-4);
}

.match-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--s-4);
  min-width: 0;
}

.match-heading {
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
}

.monogram-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  background: var(--bg-elev-3);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: var(--fs-16);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
}

.person {
  flex: 1;
  min-width: 0;
}

.person h3 {
  margin: 0;
  color: var(--fg-1);
  font-family: var(--font-serif);
  font-size: var(--fs-20);
  font-weight: 400;
  line-height: 1.25;
}

.person p {
  margin: var(--s-1) 0 0;
  color: var(--fg-3);
  font-size: var(--fs-14);
}

.person .identity-note {
  color: var(--fg-3);
}

.identity-note {
  border-bottom: 1px solid var(--border-strong);
  width: fit-content;
}

.rank-band {
  display: grid;
  justify-items: end;
  gap: var(--s-1);
  flex: 0 0 auto;
  text-align: right;
}

.band-label {
  color: var(--accent);
  font-size: var(--fs-13);
  font-weight: 500;
}

.rank {
  color: var(--fg-4);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
}

.match-card.is-masked .match-avatar {
  font-size: 11px;
  letter-spacing: 0;
}

.eli-control {
  display: grid;
  justify-content: end;
  gap: var(--s-1);
}

.eli-control-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-2);
}

.eli-control span {
  color: var(--fg-4);
  font-size: var(--fs-12);
}

.eli-control svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

/* P32.A19 i5 (Erik item 5): the level name inside the phrase is a real
   button - "Explain like I'm [a kid]" - cycling the same five steps the
   slider walks. It reads as text, not as chrome. */
.eli-name {
  padding: 2px 6px;
  min-height: 0;
  border: 1px solid transparent;
  border-radius: var(--r-full, 999px);
  background: none;
  color: var(--accent);
  font-size: var(--fs-12);
  font-weight: 500;
  cursor: pointer;
}

.eli-name:hover,
.eli-name:focus-visible {
  border-color: var(--accent);
}

.eli-explainer > summary {
  color: var(--fg-4);
  font-size: var(--fs-12);
  cursor: pointer;
}

.eli-explainer-lead,
.eli-explainer-list {
  margin: var(--s-1) 0 0;
  color: var(--fg-3);
  font-size: var(--fs-12);
  text-align: left;
}

.eli-explainer-list {
  padding-left: var(--s-4);
}

.eli-explainer-name {
  color: var(--fg-2);
  font-weight: 500;
}

.eli-range {
  width: 120px;
  min-height: auto;
  padding: 0;
  accent-color: var(--accent);
}

.eli-ticks {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: 120px;
  margin-left: auto;
  justify-items: center;
}

.eli-ticks span {
  width: 6px;
  height: 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  background: transparent;
}

.eli-ticks .is-active {
  border-color: var(--accent);
  background: var(--accent);
}

.eli-ticks .is-disabled {
  opacity: 0.45;
}

.eli-lock {
  justify-self: end;
  color: var(--accent);
  font-size: var(--fs-12);
  font-weight: 500;
}

.eli-language-toggle {
  display: inline-flex;
  justify-self: end;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
}

.eli-language-toggle[hidden] {
  display: none;
}

.eli-language-option {
  min-height: auto;
  padding: 2px 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg-4);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--tracking-mono);
  line-height: 1.4;
}

.eli-language-option + .eli-language-option {
  border-left: 1px solid var(--border-strong);
}

.eli-language-option.is-selected {
  background: var(--accent);
  color: var(--bg-base);
}

.eli-gated {
  display: none !important;
}

.progress-card.is-complete .progress-radar svg {
  animation: none;
}

.progress-card.is-complete .radar-sweep,
.progress-card.is-complete .radar-dot {
  opacity: 0.3;
}

.interpreted-bar-sep {
  color: var(--fg-4);
}

.interpreted-main-inline {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: var(--tracking-mono);
  white-space: nowrap;
}

#interpreted-skills {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
}

.atlas-plane {
  position: relative;
}

.atlas-live-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.atlas-live-dot.is-query {
  width: 10px;
  height: 10px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}

.atlas-live-dot.is-match {
  background: var(--accent-lo);
  box-shadow: 0 0 8px var(--accent-faint);
}

/* P32.A19 i6 (opus 3, 7 and 14, codex 3): the profile page's reading
   control is the shared phrase picker (see `.elix-picker` below). The
   slider, its five dots and the separate caption line are gone, so the
   range/tick alignment rules that used to live here went with them -
   the search RESULT CARDS keep their own `.eli-range` / `.eli-ticks`,
   which are untouched. */
.profile-eli {
  margin: 0 0 var(--s-4);
}

/* Eli-X reading panel states (profile page, D029 ladder) */
.eli-hint {
  margin: 0;
  justify-self: end;
  color: var(--fg-4);
  font-size: var(--fs-12);
}

.eli-pending-note {
  color: var(--fg-4);
  font-style: italic;
}

.eli-locked-note {
  color: var(--fg-3);
}

.eli-locked-actions {
  display: flex;
  gap: var(--s-3);
}

.eli-locked-actions a {
  color: var(--accent);
  font-size: var(--fs-13);
  font-weight: 500;
}

.eli-copy,
.short-bio,
.motivation,
.publications {
  margin: 0;
  color: var(--fg-2);
  font-size: var(--fs-14);
  line-height: 1.6;
}

.info-row {
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
}

.info-row .section-kicker {
  flex: 0 0 76px;
}

.section-kicker,
.panel-label {
  display: block;
  margin: 0;
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.chip-list {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: transparent;
  color: var(--fg-2);
  font-size: var(--fs-12);
  line-height: 1.2;
}

.chip-matched {
  border-color: var(--accent-lo);
  background: var(--accent-faint);
  color: var(--accent);
}

.chip-matched::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-inline-end: 6px;
  border-radius: var(--r-full);
  background: var(--accent);
}

.motivation {
  padding: 2px 0 2px var(--s-4);
  border-left: 2px solid var(--accent);
}

.publications summary {
  cursor: pointer;
  color: var(--fg-2);
  font-weight: 500;
}

.publications ul {
  display: grid;
  gap: var(--s-2);
  margin: var(--s-3) 0 0;
  padding-left: var(--s-5);
  color: var(--fg-3);
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
  padding-top: var(--s-4);
  border-top: 1px solid var(--border-faint);
}

.bench-button {
  min-height: 36px;
  padding: 0 var(--s-4);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-2);
  font-size: var(--fs-13);
  font-weight: 500;
}

.bench-button:hover {
  border-color: var(--accent);
  background: var(--accent-faint);
  color: var(--accent);
}

.bench-button[aria-pressed="true"] {
  border-color: var(--accent-lo);
  background: var(--accent-faint);
  color: var(--accent);
}

.terms-note {
  margin-left: auto;
  color: var(--fg-4);
  font-family: var(--font-mono);
  font-size: 11px;
}

.profile-link {
  justify-self: start;
  font-weight: 500;
}

.site-footer {
  border-top: 1px solid var(--border-faint);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-6) var(--s-12);
  align-items: flex-start;
  justify-content: space-between;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: var(--s-10) 0 var(--s-8);
}

.footer-brand {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-2);
  max-width: 360px;
  align-items: center;
  color: var(--fg-1);
  font-weight: 600;
}

.footer-brand p {
  grid-column: 1 / -1;
  margin: var(--s-2) 0 0;
  color: var(--fg-3);
  font-size: var(--fs-14);
  font-weight: 400;
  line-height: 1.55;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-10);
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-width: 156px;
}

.footer-meta {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 var(--s-8);
  color: var(--fg-4);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* AI-provenance surfaces (Art. 50 posture): full disclosure line at page
   bottom, minimal per-card marker. */
.ai-provenance-note {
  color: var(--fg-4);
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: var(--s-4);
}

.ai-caption {
  align-self: flex-start;
  color: var(--fg-4);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.researcher-edit-caption,
.researcher-edit-note {
  align-self: flex-start;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.researcher-edit-note {
  margin-top: var(--s-4);
}

.profile-shell {
  gap: var(--s-5);
  width: min(960px, calc(100% - 48px));
}

.back-link {
  align-self: flex-start;
}

.back-link::before {
  content: "< ";
  color: var(--accent);
}

#profile-card {
  display: grid;
  gap: var(--s-6);
  padding: var(--s-6);
}

.profile-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-4);
  align-items: center;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  font-size: var(--fs-24);
}

#profile-card.is-masked .profile-avatar {
  font-size: var(--fs-13);
  letter-spacing: 0;
}

.profile-heading-copy {
  display: grid;
  gap: var(--s-2);
  min-width: 0;
}

#profile-name {
  margin: 0;
  color: var(--fg-1);
  font-family: var(--font-serif);
  font-size: var(--fs-40);
  font-weight: 400;
  line-height: 1.1;
}

#profile-role,
#profile-discipline {
  margin: 0;
}

#profile-role {
  color: var(--fg-2);
  font-size: var(--fs-16);
}

/* D055 freemium reveals: identity-area affordance + budget copy. */
.reveal-identity {
  display: grid;
  gap: var(--s-2);
  justify-items: start;
  margin-top: var(--s-2);
}

.reveal-identity[hidden] {
  display: none;
}

.reveal-name-button {
  text-align: left;
}

.reveal-status,
.reveal-remaining {
  margin: 0;
  color: var(--fg-3);
  font-size: var(--fs-13);
}

.reveal-status {
  color: var(--fg-2);
}

#removed-notice {
  margin: 0;
  padding: var(--s-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  color: var(--fg-1);
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--s-8);
  align-items: start;
}

.profile-main,
.profile-side,
.profile-section {
  display: grid;
  gap: var(--s-4);
}

.profile-section {
  padding-top: var(--s-4);
  border-top: 1px solid var(--border-faint);
}

.profile-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.profile-section h2,
.profile-section p {
  margin: 0;
}

#profile-bio,
#profile-bio p {
  color: var(--fg-2);
  font-size: var(--fs-15);
  line-height: 1.65;
}

#profile-bio {
  display: grid;
  gap: var(--s-3);
}

#profile-publications {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  padding-left: var(--s-5);
  color: var(--fg-3);
}

#profile-publications a {
  color: var(--fg-2);
}

/* P32.A19 i6 (codex 9): the decorative "Atlas view" panel is gone from
   profile.html - four dots at fixed percentages, identical on every
   profile - so its rules go with it rather than sitting here waiting to
   be re-applied to something that would still explain nothing. */

.profile-unlock {
  justify-items: start;
}

@keyframes ph-pulse {
  0% {
    opacity: 0.35;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.35;
  }
}

@keyframes radar-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes card-in {
  to {
    opacity: 1;
  }
}

@media (max-width: 920px) {
  .site-header-inner,
  .app-shell,
  .footer-inner,
  .footer-meta,
  .profile-shell {
    width: min(100% - 32px, 1240px);
  }

  .stream-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  /* Half-screen laptops: squeeze the header onto one line (smaller key
     field, drop the SEARCH·BETA context) instead of stacking it - the
     column stack only kicks in on truly narrow screens (640px). */
  .site-header-inner {
    gap: var(--s-3);
  }

  .header-left {
    gap: var(--s-3);
  }

  .brand-context {
    display: none;
  }

  .beta-inline input {
    width: 7rem;
  }

  .site-nav {
    gap: var(--s-3);
  }

  .deployment-note,
  .timing-summary {
    text-align: start;
  }

  .query-row,
  .results-layout,
  .interpreted-body,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .query-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  /* Single column so the search context and results stack cleanly instead of
     sitting side by side at mismatched heights. */
  .filter-rail {
    position: static;
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
  }

  /* After a search, make the rail's children participate in the parent grid
     so the complete result experience sits between coverage and the sign-in
     teaser. Pre-search ordering remains unchanged. */
  body.has-searched .filter-rail {
    display: contents;
  }

  body.has-searched .filter-rail > .coverage-card {
    order: 1;
  }

  body.has-searched .results-column {
    order: 2;
  }

  body.has-searched .filter-rail > .signin-teaser {
    order: 3;
    margin-top: 0;
  }

  .sweden-map {
    max-height: 280px;
  }

  .form-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding-top: var(--s-6);
  }

  .site-header-inner,
  .header-left {
    align-items: flex-start;
    flex-direction: column;
  }

  .composer-heading h1,
  #profile-name {
    font-size: var(--fs-32);
  }

  .query-row,
  .form-actions,
  .match-card,
  .match-heading,
  .info-row {
    display: flex;
    flex-direction: column;
  }

  .query-row,
  .form-actions {
    align-items: stretch;
  }

  .interpreted-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: var(--s-2) var(--s-3);
  }

  .interpreted-bar .interpreted-dot {
    grid-row: 1 / span 2;
    align-self: center;
  }

  .interpreted-bar p,
  .interpreted-main-inline {
    grid-column: 2;
    min-width: 0;
  }

  .interpreted-bar-sep {
    display: none;
  }

  .interpreted-main-inline {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .form-actions,
  .form-actions button,
  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .filter-rail {
    grid-template-columns: 1fr;
  }

  .atlas-plane {
    min-height: 300px;
  }

  .atlas-canvas {
    height: 300px;
  }

  .score-dial {
    width: 100%;
  }

  .score-dial svg {
    width: 76px;
    height: 76px;
  }

  .rank-band,
  .eli-control,
  .eli-control-row {
    justify-items: start;
    justify-content: flex-start;
    text-align: start;
  }

  .terms-note {
    margin-left: 0;
  }

  .profile-header {
    align-items: start;
  }

  .profile-avatar {
    width: 56px;
    height: 56px;
    font-size: var(--fs-18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stream-step.is-active i,
  .progress-radar svg {
    animation: none !important;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   === A19 iteration 6: the public page's obvious fixes ===
   The portal's phrase-picker component, ported here so the owner's
   preview and the live page are the same control (opus 7); the
   institution-first identity line (opus 4, codex 1); deliberate
   publication link states (opus 9, codex 13); and one plain footer
   band instead of two monospace disclaimers (opus 15, codex 11).
   ============================================================ */

/* --- Identity: the university leads, the unit follows --- */
.profile-affiliation {
  margin: 0;
  color: var(--fg-2);
  font-size: var(--fs-14);
}

.profile-affiliation[hidden] {
  display: none;
}

/* --- The phrase picker: the SAME component as the portal's ---
   Structure, glyphs, level names and descriptors match
   portal/_partials/elix_picker.html and its dc.css rules; only the
   interaction differs (this one cycles, as i5 shipped it). It sits in
   the ABOUT content column now, so its left edge is the page's. */
.elix-picker {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
  margin: 0 0 var(--s-2);
  max-width: 100%;
}

.elix-picker[hidden] {
  display: none;
}

.elix-picker-lead {
  color: var(--fg-2);
  font-size: var(--fs-14);
  font-weight: 500;
}

.elix-picker-summary {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 4px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  background: var(--bg-elev-1);
  cursor: pointer;
}

.elix-picker-summary:hover,
.elix-picker-summary:focus-visible {
  border-color: var(--accent);
}

/* All five glyphs are in the DOM; one is painted (portal parity). */
.elix-picker-glyph {
  display: none;
  align-items: center;
}

.elix-picker-glyph.is-active {
  display: inline-flex;
}

.elix-picker-glyph svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.elix-picker-name {
  color: var(--accent);
  font-size: var(--fs-14);
  font-weight: 500;
}

.elix-picker-caret {
  color: var(--fg-3);
  font-size: 11px;
}

/* AA pass (codex 6): the descriptor carries the level's meaning and the
   lock/pending state, so it is readable text, not a 12px whisper. */
.elix-picker-gloss {
  margin: 0;
  color: var(--fg-2);
  font-size: var(--fs-13);
}

.elix-explainer-disclosure > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--fg-2);
  font-size: var(--fs-13);
  cursor: pointer;
}

.elix-explainer-lead {
  margin: var(--s-1) 0 0;
  color: var(--fg-2);
  font-size: var(--fs-13);
}

.elix-styles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 4px var(--s-4);
  margin: var(--s-2) 0 0;
  padding: 0;
  list-style: none;
}

.elix-style {
  color: var(--fg-2);
  font-size: var(--fs-13);
}

.elix-style-name {
  color: var(--fg-1);
  font-weight: 500;
}

/* --- Publications: two deliberate states, never a half-broken one --- */
.publication-link {
  color: var(--fg-2);
  text-decoration: underline;
}

.publication-link::after {
  content: " ↗";
  color: var(--fg-3);
  text-decoration: none;
}

.publication-title {
  color: var(--fg-2);
  text-decoration: none;
}

.publication-note {
  margin-left: var(--s-2);
  color: var(--fg-3);
  font-size: var(--fs-12);
}

/* --- One footer band, one plain sentence, UI sans --- */
.profile-footer {
  padding-top: var(--s-4);
  border-top: 1px solid var(--border-faint);
}

.profile-footer-note {
  margin: 0;
  max-width: 68ch;
  color: var(--fg-3);
  font-family: var(--font-sans);
  font-size: var(--fs-13);
  line-height: 1.6;
}

.profile-footer-note[hidden] {
  display: none;
}
