
* {
  box-sizing: border-box;
}

:root {
  /* neutrals */
  --color-surface: #fff;
  --color-surface-subtle: #f8fafc;
  --color-surface-alt: #f1f5f9;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;
  --color-ink: #0f172a;
  --color-ink-soft: #1e293b;
  --color-text: #334155;
  --color-text-muted: #475569;
  --color-text-subtle: #64748b;
  --color-text-faint: #94a3b8;

  /* brand + primary */
  --color-brand: #0f3c78;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #3b82f6;
  --color-primary-bg: #eff6ff;

  /* accent */
  --color-accent: #4f46e5;
  --color-accent-light: #6366f1;

  /* semantic */
  --color-success: #10b981;
  --color-success-ink: #166534;
  --color-danger: #dc2626;
  --color-danger-bg: #fee2e2;

  /* radius scale */
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 16px;
  --radius-2xl: 18px;
  --radius-3xl: 20px;
  --radius-4xl: 24px;
  --radius-pill: 999px;
}


html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #eef2f7;
  color: #1f2937;
}

.header {
  background: var(--color-brand);
  color: var(--color-surface);
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
}

.header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 2.8vw, 3rem);
  letter-spacing: -0.03em;
}

.header p {
  margin: 10px auto 0;
  max-width: 720px;
  font-size: 1rem;
  opacity: 0.84;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.site-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-pill);
  color: var(--color-surface);
  text-decoration: none;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
}

.site-nav-link:hover,
.site-nav-link:focus-visible,
.site-nav-link[aria-current='page'] {
  background: var(--color-surface);
  color: var(--color-brand);
  outline: none;
}

.site-nav-auth {
  margin-left: 6px;
  gap: 8px;
}

span.site-nav-auth {
  cursor: default;
}

.site-nav-logout {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.site-nav-profile-link {
  color: inherit;
  cursor: pointer;
}

.site-nav-profile-link:hover,
.site-nav-profile-link:focus-visible {
  text-decoration: underline;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  padding: 22px;
  max-width: 1500px;
  margin: 0 auto;
}

.sidebar,
.viewer {
  background: var(--color-surface);
  padding: 26px;
  border-radius: var(--radius-4xl);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.sidebar {
  min-width: 240px;
}

.school-row {
  position: relative;
  margin: 0 0 14px;
}

.school {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  margin: 0;
  padding: 14px 40px 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.profile-card-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--color-text-faint);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-pill);
}

.profile-card-remove:hover,
.profile-card-remove:focus-visible {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  outline: none;
}

.sidebar-empty-state {
  color: var(--color-text-subtle);
  font-size: 0.9rem;
  line-height: 1.5;
}

.school:hover {
  transform: translateY(-1px);
  border-color: var(--color-border-strong);
  background: var(--color-surface-subtle);
}

.school.active,
.school:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
  outline: none;
}

.profile-card-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.profile-card-tier {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.viewer {
  position: relative;
  overflow: visible;
}

.viewer-header {
  position: sticky;
  top: 4px;
  z-index: 3;
  background: var(--color-surface);
  padding: 12px 26px 0;
  margin: -26px -26px 22px;
  border-bottom: 1px solid var(--color-border);
}

/* ── Compact header top row ──────────────────────────────────────────────── */
.vh-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
}

.vh-identity-row {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.vh-id-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.vh-logo {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  padding: 4px;
}

.vh-id-text { min-width: 0; }

.vh-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vh-school-name {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-ink);
}

.vh-school-meta {
  margin: 3px 0 0;
  font-size: 0.78rem;
  color: var(--color-text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vh-id-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Compact My Schools button */
.vh-ms-btn {
  padding: 5px 11px;
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  background: var(--color-surface);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.vh-ms-btn:hover { background: var(--color-primary-bg); border-color: #93c5fd; }
.vh-ms-btn.ms-toolbar-in { color: var(--color-success-ink); border-color: #86efac; background: #f0fdf4; }

/* ── Top controls: school selector + overflow ─────────────────────────────── */
.vh-top-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.vh-selector {
  padding: 5px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  font: inherit;
  font-size: 0.78rem;
  color: var(--color-text);
  max-width: 170px;
  cursor: pointer;
}
.vh-selector:focus { outline: 2px solid var(--color-primary-light); border-color: transparent; }

/* Overflow ••• button and dropdown */
.vh-overflow-wrap { position: relative; }

.vh-overflow-btn {
  padding: 5px 9px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-subtle);
  line-height: 1;
  letter-spacing: 0.05em;
}
.vh-overflow-btn:hover { background: var(--color-surface-subtle); color: var(--color-text); }

.vh-overflow-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.1);
  min-width: 178px;
  z-index: 100;
  overflow: hidden;
}

.vh-overflow-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  font-size: 0.84rem;
  color: var(--color-text);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.vh-overflow-item:hover { background: var(--color-surface-subtle); }
.vh-overflow-danger { color: var(--color-danger); }
.vh-overflow-divider { margin: 3px 0; border: none; border-top: 1px solid var(--color-surface-alt); }

.vh-placeholder {
  margin: 0;
  padding: 12px 0;
  color: var(--color-text-faint);
  font-style: italic;
  font-size: 0.88rem;
}

/* ── Compact section navigation ───────────────────────────────────────────── */
.vh-nav-shell {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--color-surface-alt);
  overflow: hidden;
}

.section-nav {
  flex: 1;
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0;
}
.section-nav::-webkit-scrollbar { display: none; }

.section-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 9px 11px;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.section-nav-link:hover {
  color: var(--color-ink-soft);
  background: transparent;
  box-shadow: none;
  border-bottom-color: var(--color-border-strong);
}
.section-nav-link.active {
  color: var(--color-primary);
  background: transparent;
  box-shadow: none;
  font-weight: 600;
  border-bottom-color: var(--color-primary);
}

.section-nav-icon { display: none; }

/* More ▾ nav overflow */
.vh-nav-more {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  border-left: 1px solid var(--color-surface-alt);
}

.vh-more-btn {
  padding: 9px 12px;
  background: none;
  border: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-subtle);
  cursor: pointer;
  white-space: nowrap;
}
.vh-more-btn:hover { color: var(--color-ink-soft); background: var(--color-surface-subtle); }

.vh-more-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.1);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
}

.vh-more-item {
  display: block;
  padding: 9px 14px;
  font-size: 0.84rem;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}
.vh-more-item:hover { background: var(--color-surface-subtle); color: var(--color-ink-soft); }
.vh-more-item.active { color: var(--color-primary); font-weight: 600; }

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(15, 23, 42, 0.08);
  z-index: 12;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transition: width 0.2s ease;
}

.viewer-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 12px;
}

.viewer-title-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.viewer-title-row h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  letter-spacing: -0.04em;
}

.viewer-subtitle {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1rem;
  max-width: 68ch;
}

.profile-selector-block {
  display: flex;
  align-items: center;
}

.profile-selector {
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
}

.profile-selector:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

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

.section-nav-shell {
  padding: 0 0 4px;
}

.profile-content {
  padding: 0;
}

.profile-placeholder {
  margin: 0;
  padding: 20px 0;
  color: var(--color-text-subtle);
  font-style: italic;
}

/* ── Business Program structured section ─────────────────────────────────── */
.biz-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Identity */
.biz-identity {
  padding: 16px 20px;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.biz-school-name {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-ink);
}
.biz-identity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.biz-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.78rem;
  font-weight: 600;
}
.biz-badge-accred {
  background: #dcfce7;
  color: var(--color-success-ink);
}
.biz-identity-enroll {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--color-text-subtle);
}

/* Sub-blocks */
.biz-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.biz-subhead {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-surface-alt);
}

/* Stat table */
.biz-stat-table {
  display: grid;
  grid-template-columns: minmax(140px, 180px) 1fr;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.84rem;
}
.biz-stat-row {
  display: contents;
}
.biz-stat-row:not(:first-child) .biz-stat-label,
.biz-stat-row:not(:first-child) .biz-stat-value {
  border-top: 1px solid var(--color-surface-alt);
}
.biz-stat-label {
  padding: 8px 12px;
  background: var(--color-surface-subtle);
  color: var(--color-text-muted);
  font-weight: 500;
}
.biz-stat-value {
  padding: 8px 12px;
  background: var(--color-surface);
  color: var(--color-ink);
}

/* Field labels above pills */
.biz-field-label {
  margin: 4px 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-subtle);
}

/* Pill lists */
.biz-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.biz-pill {
  display: inline-block;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-alt);
  color: var(--color-text);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Curriculum text */
.biz-curriculum-text {
  margin: 0;
  font-size: 0.84rem;
  color: var(--color-text);
  line-height: 1.55;
}

/* Ranking */
.biz-ranking-line {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text);
}
.biz-rank-num {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-right: 4px;
}

/* Sources */
.biz-sources-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.biz-sources-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.biz-source-link {
  font-size: 0.78rem;
  color: var(--color-primary);
  text-decoration: none;
}
.biz-source-link:hover { text-decoration: underline; }

/* Empty state */
.biz-empty {
  margin: 0;
  color: var(--color-text-faint);
  font-size: 0.84rem;
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: var(--color-surface);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.24);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 11;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.28);
  outline: none;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: var(--color-surface);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.24);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 11;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.28);
  outline: none;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.profile-header {
  padding: 0 0 18px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 24px;
}

.profile-title {
  margin: 0 0 10px;
  font-size: clamp(2rem, 3vw, 2.4rem);
}

.profile-subtitle {
  margin: 0;
  max-width: 780px;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.85;
}

.profile-section {
  padding: 22px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3xl);
  margin-bottom: 20px;
  background: var(--color-surface);
  transition: box-shadow 0.2s ease;
  scroll-margin-top: 180px;
}

.profile-section:hover {
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.section-header {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 14px;
  margin-bottom: 18px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
}

.section-header h3 {
  margin: 0;
  font-size: 1.08rem;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.section-body {
  line-height: 1.78;
  color: var(--color-text);
}

.snapshot-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}

.snapshot-table th,
.snapshot-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
}

.snapshot-table th {
  width: 40%;
  color: var(--color-ink);
  font-weight: 700;
  background: var(--color-surface-subtle);
}

.snapshot-table td {
  color: var(--color-text-muted);
}

.narrative p,
.consultant-insight p,
.callout p,
.bottom-line p {
  margin: 0 0 16px;
}

.consultant-insight,
.callout,
.bottom-line {
  padding: 18px 20px;
  border-radius: var(--radius-xl);
  background: var(--color-surface-subtle);
}

.consultant-insight h4 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.consultant-insight p,
.callout p,
.bottom-line p {
  color: var(--color-text);
}

.callout {
  border-left: 4px solid var(--color-primary);
  background: #eef2ff;
}

.bottom-line {
  background: var(--color-surface-alt);
}

.source-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.source-list li {
  margin: 0 0 10px;
  color: var(--color-text-muted);
  line-height: 1.75;
}

.fit-score-container {
  margin-bottom: 22px;
}

.shortlist-control {
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3xl);
  margin-bottom: 22px;
  background: var(--color-surface);
}

.shortlist-heading {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.shortlist-status {
  margin: 0 0 12px;
  color: var(--color-text-muted);
}

.shortlist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.shortlist-select {
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  font: inherit;
}

.shortlist-button {
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: var(--color-surface);
  cursor: pointer;
  font: inherit;
}

.shortlist-button.secondary {
  background: var(--color-surface-alt);
  color: var(--color-ink);
}

.collection-control {
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3xl);
  margin-bottom: 22px;
  background: var(--color-surface);
}

.collection-heading {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.collection-intro {
  margin: 0 0 12px;
  color: var(--color-text-muted);
}

.collection-create-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.collection-input {
  min-width: 220px;
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  font: inherit;
}

.collection-membership,
.collection-status {
  margin: 10px 0 0;
  color: var(--color-text-muted);
}

.visit-tracker-card {
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3xl);
  margin-bottom: 22px;
  background: var(--color-surface);
}

.visit-tracker-heading {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.visit-tracker-intro {
  margin: 0 0 12px;
  color: var(--color-text-muted);
}

.visit-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.visit-field {
  display: grid;
  gap: 6px;
}

.visit-field span {
  color: var(--color-text);
  font-weight: 700;
  font-size: 0.9rem;
}

.visit-field-full {
  grid-column: 1 / -1;
}

.visit-input,
.visit-textarea {
  width: 100%;
  font: inherit;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--color-ink);
  background: var(--color-surface);
}

.visit-textarea {
  resize: vertical;
  line-height: 1.5;
  min-height: 100px;
}

.visit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.visit-helper-text {
  margin: 0;
  color: var(--color-text);
  font-size: 0.92rem;
}

.visit-history-heading {
  margin: 16px 0 10px;
  font-size: 0.98rem;
  color: var(--color-ink);
}

.visit-history-list {
  display: grid;
  gap: 10px;
}

.visit-history-card {
  border: 1px solid #dbe5f0;
  border-radius: var(--radius-lg);
  padding: 12px;
  background: var(--color-surface-subtle);
  display: grid;
  gap: 8px;
}

.visit-history-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.visit-history-meta {
  margin: 0;
  color: var(--color-ink);
  font-weight: 700;
}

.visit-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.visit-history-notes {
  margin: 0;
  color: var(--color-text);
  line-height: 1.6;
  white-space: pre-wrap;
}

.visit-photos-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.visit-photos-link:hover,
.visit-photos-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.personal-notes-card {
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3xl);
  margin-bottom: 22px;
  background: var(--color-surface);
}

.personal-notes-heading {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.personal-notes-intro {
  margin: 0 0 12px;
  color: var(--color-text-muted);
}

.personal-notes-input {
  width: 100%;
  font: inherit;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--color-ink);
  background: var(--color-surface);
  resize: vertical;
  line-height: 1.5;
  min-height: 100px;
}

.personal-notes-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.personal-notes-status {
  margin: 0;
  color: var(--color-text);
  font-size: 0.92rem;
}

.personal-notes-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.personal-note-item {
  border: 1px solid #dbe5f0;
  border-radius: var(--radius-lg);
  padding: 12px;
  background: var(--color-surface-subtle);
  display: grid;
  gap: 8px;
}

.personal-note-text {
  margin: 0;
  color: var(--color-text);
  line-height: 1.6;
  white-space: pre-wrap;
}

.personal-note-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.personal-note-timestamp {
  margin: 0;
  color: var(--color-text-subtle);
  font-size: 0.85rem;
}

.personal-note-controls {
  display: flex;
  gap: 8px;
}

/* ── Application Timeline ── */
.at-container {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
  margin-bottom: 0;
}

.at-section-label {
  margin: 0 0 2px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-faint);
}

.at-intro {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--color-text-faint);
}

.at-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.at-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 19px 18px 16px;
  overflow: hidden;
}

.at-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-sm) 10px 0 0;
}

.at-card--ed::before {
  background: linear-gradient(90deg, var(--color-primary-light), #60a5fa);
}

.at-card--rd::before {
  background: linear-gradient(90deg, var(--color-success), #34d399);
}

.at-card-label {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
}

.at-card-date {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-ink);
  line-height: 1.2;
}

.at-card-tag {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-subtle);
}

.at-ed-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.at-ed-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.at-ed-sublabel {
  min-width: 36px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
}

.at-ed-date {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-ink);
}

@media (max-width: 640px) {
  .at-cards {
    grid-template-columns: 1fr;
  }
}

/* ── Legacy Decision Timeline (kept for historical CSS only) ── */
.decision-timeline-card {
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3xl);
  margin-bottom: 22px;
  background: var(--color-surface);
}

.decision-timeline-heading {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.decision-timeline-intro {
  margin: 0 0 12px;
  color: var(--color-text-muted);
}

.timeline-milestone-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.timeline-milestone-status {
  margin: 10px 0 0;
  color: var(--color-text);
}

.decision-timeline-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.decision-timeline-chip {
  border: 1px solid #dbe5f0;
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
  padding: 10px;
}

.decision-timeline-chip-label {
  margin: 0;
  color: var(--color-text-subtle);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.decision-timeline-chip-value {
  margin: 4px 0 0;
  color: var(--color-ink);
  font-size: 1.2rem;
  font-weight: 700;
}

.decision-timeline-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.decision-timeline-item {
  border: 1px solid var(--color-border);
  border-left-width: 5px;
  border-radius: var(--radius-lg);
  padding: 12px;
  background: var(--color-surface);
  display: grid;
  gap: 8px;
}

.decision-timeline-item-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.decision-timeline-item-title {
  margin: 0;
  font-size: 0.98rem;
  color: var(--color-ink);
}

.decision-timeline-type {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  background: var(--color-primary-bg);
  color: var(--color-primary-hover);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 8px;
}

.decision-timeline-item-meta {
  margin: 0;
  color: var(--color-text);
  font-size: 0.9rem;
}

.decision-timeline-item-details {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

.decision-timeline-overdue {
  border-left-color: var(--color-danger);
  background: #fef2f2;
}

.decision-timeline-upcoming {
  border-left-color: #d97706;
  background: #fffbeb;
}

.decision-timeline-later {
  border-left-color: var(--color-primary);
}

.decision-timeline-complete,
.decision-timeline-logged {
  border-left-color: #0f766e;
  background: #f0fdfa;
}

.decision-timeline-missing {
  border-left-color: var(--color-text-subtle);
  background: var(--color-surface-subtle);
}

.collections-manage-panel {
  background: var(--color-surface);
  border-radius: var(--radius-4xl);
  padding: 20px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  margin-bottom: 16px;
}

.collections-manage-panel h3 {
  margin: 0;
}

.collections-manage-intro {
  margin: 8px 0 12px;
  color: var(--color-text-muted);
}

.collections-manage-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.collections-input {
  min-width: 220px;
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font: inherit;
}

.collections-status {
  margin: 10px 0 0;
  color: var(--color-text);
}

.collections-list {
  display: grid;
  gap: 14px;
}

.collections-card {
  background: var(--color-surface);
  border-radius: var(--radius-3xl);
  padding: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 12px;
}

.collections-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.collections-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.collections-school-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.collections-school-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.collections-school-row a {
  color: var(--color-ink);
  text-decoration: none;
  font-weight: 600;
}

.collections-school-row a:hover,
.collections-school-row a:focus-visible {
  color: var(--color-primary);
  text-decoration: underline;
  outline: none;
}

.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 16px;
}

.regeneration-banner {
  margin: 0;
  align-self: center;
  color: #145f36;
  font-weight: 600;
}

.regeneration-banner.error {
  color: #8a1e1e;
}

.section-refresh-control {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0 0 0.7rem;
}

.section-refresh-button {
  align-self: flex-start;
  border: 1px solid #99aec5;
  background: #f2f7fc;
  color: #143f6e;
  border-radius: var(--radius-pill);
  font: inherit;
  padding: 0.28rem 0.72rem;
  cursor: pointer;
}

.section-refresh-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.section-regeneration-status {
  border: 1px solid #d8e4f0;
  border-radius: var(--radius-sm);
  background: #f9fcff;
  padding: 0.55rem 0.7rem;
}

.section-regeneration-title {
  margin: 0;
  color: #0f2f55;
  font-weight: 700;
}

.section-regeneration-steps {
  margin: 0.4rem 0 0;
  padding-left: 1rem;
}

.section-regeneration-steps .done {
  color: #0b7740;
}

.section-regeneration-steps .pending {
  color: #4f647e;
}

.ai-quality-report {
  border: 1px solid #d9e3f0;
  border-radius: var(--radius-lg);
  padding: 14px;
  background: #f8fbff;
  margin-top: 12px;
}

.ai-quality-title {
  margin: 0;
  color: #143f6e;
}

.ai-quality-overall {
  margin: 8px 0 10px;
  font-weight: 700;
  color: #0f2f55;
}

.ai-quality-categories h4,
.ai-quality-report h4 {
  margin: 10px 0 6px;
  color: #214668;
}

.ai-quality-score-list,
.ai-quality-warning-list,
.ai-quality-recommendation-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--color-text);
}

.ai-quality-none,
.ai-quality-pending {
  margin: 0;
  color: #556b83;
}

.ai-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 1000;
}

.ai-modal-overlay[hidden] {
  display: none;
}

.ai-modal {
  width: min(980px, 100%);
  max-height: min(95vh, 900px);
  background: #ffffff;
  border-radius: var(--radius-4xl);
  box-shadow: 0 40px 120px rgba(15, 23, 42, 0.2);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.ai-modal.add-school-modal {
  max-width: 1120px;
  height: min(95vh, 860px);
}

.ai-modal-header {
  padding: 24px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
}

.ai-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.ai-modal-close {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-surface-alt);
  color: var(--color-ink);
  font-size: 1.5rem;
  cursor: pointer;
}

.ai-modal-body {
  padding: 24px 26px;
  overflow-y: auto;
  display: grid;
  gap: 22px;
  min-height: 0;
}

.ai-modal-footer {
  padding: 18px 26px 24px;
  background: var(--color-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--color-border);
}

.ai-modal-status-line {
  margin: 0;
  color: var(--color-text);
  font-size: 0.95rem;
}

.ai-modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-school-search-panel {
  display: grid;
  gap: 18px;
}

.ai-school-search-input-shell {
  display: grid;
  gap: 10px;
}

.ai-school-search-label {
  margin: 0;
  font-weight: 700;
  color: var(--color-ink);
}

.ai-school-search-input {
  width: 100%;
  min-height: 48px;
  padding: 14px 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
}

.ai-school-search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.ai-school-search-helper,
.ai-school-search-empty,
.ai-school-search-loading {
  margin: 0;
  color: var(--color-text-subtle);
  font-size: 0.94rem;
}

.ai-school-search-quick-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.ai-school-search-quick-panels[hidden] {
  display: none;
}

.ai-school-search-panel-block {
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  background: var(--color-surface-subtle);
}

.ai-school-search-panel-title {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--color-ink);
}

.ai-school-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-school-chip {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  padding: 10px 14px;
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
  font: inherit;
}

.ai-school-chip:hover,
.ai-school-chip:focus-visible {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.ai-school-search-results {
  display: grid;
  gap: 12px;
}

.ai-school-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: 18px;
  background: var(--color-surface);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ai-school-card-instant {
  border-left: 3px solid #16a34a;
}

.ai-school-card-generate {
  border-left: 3px solid #d97706;
}

.ai-school-card-title-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
}

.ai-school-card-icon {
  margin-right: 6px;
  font-size: 0.95rem;
}

.ai-school-card-hint {
  margin: 4px 0 0;
  font-size: 0.8rem;
}

.ai-school-card-hint-instant {
  color: #166534;
}

.ai-school-card-hint-generate {
  color: #92400e;
}

.ai-school-card.selected,
.ai-school-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.ai-school-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-school-card-title {
  margin: 0;
  font-size: 1rem;
}

.ai-school-card-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  white-space: nowrap;
}

.ai-pill-added {
  background: #ede9fe;
  color: #5b21b6;
}

.ai-pill-generate {
  background: #fef3c7;
  color: #92400e;
}

.ai-school-card-meta,
.ai-school-card-subtitle {
  margin: 8px 0 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.ai-school-selected-summary {
  padding: 18px;
  border-radius: var(--radius-2xl);
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
}

.ai-school-selected-title {
  margin: 0 0 6px;
  font-size: 1rem;
}

.ai-school-selected-meta {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.ai-action-button {
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
}

.ai-action-button.ai-action-primary {
  background: var(--color-primary);
  color: var(--color-surface);
}

.ai-action-button.ai-action-secondary {
  background: var(--color-primary-bg);
  color: var(--color-primary-hover);
}

.ai-action-button.ai-action-ghost {
  background: transparent;
  color: var(--color-text);
}

.ai-action-button:disabled {
  background: var(--color-text-faint);
  color: var(--color-surface);
  cursor: not-allowed;
}

.ai-action-button.ai-action-danger {
  background: var(--color-danger);
  color: var(--color-surface);
}

.confirm-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 1100;
}

.confirm-dialog-overlay[hidden] {
  display: none;
}

.confirm-dialog {
  width: min(420px, 100%);
  background: var(--color-surface);
  border-radius: var(--radius-4xl);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: 26px;
}

.confirm-dialog-title {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: var(--color-ink);
}

.confirm-dialog-message {
  margin: 0 0 24px;
  color: var(--color-text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.reco-dialog {
  width: min(480px, 100%);
}

.reco-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 4px 0 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.reco-card {
  position: relative;
  text-align: left;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: 14px;
  cursor: pointer;
  font: inherit;
}

.reco-card-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--color-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-surface);
  font-size: 12px;
  line-height: 1;
}

.reco-card-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-surface);
  font-weight: 700;
  margin-bottom: 8px;
}

.reco-card-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--color-surface);
}

.reco-card-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-ink);
}

.reco-card-location {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--color-text-subtle);
}

.reco-card-pill {
  display: inline-block;
  margin-top: 6px;
}

.generation-queue-spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
  flex-shrink: 0;
}

.school-placeholder {
  cursor: default;
  border-style: dashed;
  background: var(--color-surface-subtle);
}

.school-placeholder:hover {
  transform: none;
  background: var(--color-surface-subtle);
  border-color: var(--color-border);
}

.school-placeholder-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.school-placeholder-failed {
  border-style: solid;
  border-color: var(--color-danger);
  background: var(--color-danger-bg);
}

.school-placeholder-failed:hover {
  border-color: var(--color-danger);
  background: var(--color-danger-bg);
}

.school-placeholder-failed .school-placeholder-status {
  color: var(--color-danger);
}

.school-placeholder-retry {
  display: inline-block;
  margin-top: 8px;
  border: none;
  background: transparent;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}

.school-placeholder-retry:hover {
  text-decoration: underline;
}

.ai-generation-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 20px;
  text-align: center;
}

.ai-generation-status-label {
  margin: 0;
  font-weight: 600;
  color: var(--color-ink);
}

.ai-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-pill);
  animation: ai-spin 0.8s linear infinite;
}

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

.ai-generation-success-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--color-success);
  color: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

@media (max-width: 860px) {
  .ai-modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .ai-school-search-quick-panels {
    grid-template-columns: 1fr;
  }
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.secondary-link:hover,
.secondary-link:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
  outline: none;
}

.my-schools-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.my-schools-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.back-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.saved-schools {
  display: grid;
  gap: 18px;
}

.saved-schools-category {
  background: var(--color-surface);
  border-radius: var(--radius-4xl);
  padding: 20px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.saved-schools-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.saved-schools-list a {
  color: var(--color-ink);
  text-decoration: none;
  font-weight: 600;
}

/* ── Cost & Value Dashboard (PR-012.16) ── */
.cv-dashboard {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cv-snapshot {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.cv-metric-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px 14px 13px;
  overflow: hidden;
}

.cv-metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-sm) 10px 0 0;
}

.cv-metric--blue::before    { background: linear-gradient(90deg, var(--color-primary-light), #60a5fa); }
.cv-metric--indigo::before  { background: linear-gradient(90deg, var(--color-accent-light), #818cf8); }
.cv-metric--purple::before  { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.cv-metric--emerald::before { background: linear-gradient(90deg, var(--color-success), #34d399); }

.cv-metric-label {
  margin: 0 0 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
}

.cv-metric-value {
  margin: 0 0 4px;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--color-ink);
  line-height: 1.2;
}

.cv-metric-sub {
  margin: 0;
  font-size: 0.73rem;
  color: var(--color-text-subtle);
}

.cv-middle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cv-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.cv-panel--assessment {
  grid-column: 1 / -1;
}

.cv-panel-label {
  margin: 0 0 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
}

.cv-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--color-surface-alt);
  font-size: 0.88rem;
  color: var(--color-text);
}

.cv-row:last-child {
  border-bottom: none;
}

.cv-row--total {
  padding-top: 9px;
  margin-top: 3px;
  border-top: 1px solid var(--color-border-strong);
  border-bottom: none;
  font-weight: 700;
  color: var(--color-ink);
}

.cv-row--total .cv-row-label,
.cv-row--total .cv-row-value {
  font-weight: 700;
  color: var(--color-ink);
}

.cv-row-label {
  color: var(--color-text-muted);
}

.cv-row-value {
  font-weight: 600;
  color: var(--color-ink);
}

.cv-assessment-text {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.65;
}

.cv-consider-label {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
}

.cv-consider-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cv-consider-pill {
  display: inline-block;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text);
}

@media (max-width: 800px) {
  .cv-snapshot {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .cv-snapshot {
    grid-template-columns: 1fr;
  }
  .cv-middle-row {
    grid-template-columns: 1fr;
  }
}

/* ── Academics Dashboard (PR-012.18) ── */
.ac-dashboard {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Snapshot grid */
.ac-snapshot {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 800px) {
  .ac-snapshot { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .ac-snapshot { grid-template-columns: 1fr; }
}

.ac-metric-card {
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  position: relative;
  overflow: hidden;
}
.ac-metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  border-radius: var(--radius-sm) 0 0 10px;
}
.ac-metric--blue::before    { background: var(--color-primary-light); }
.ac-metric--indigo::before  { background: var(--color-accent-light); }
.ac-metric--purple::before  { background: #a855f7; }
.ac-metric--emerald::before { background: var(--color-success); }

.ac-metric-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.ac-metric-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-ink-soft);
  line-height: 1.35;
}

/* Panels */
.ac-panel {
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ac-panel--full {
  width: 100%;
}
.ac-panel--assessment {
  background: var(--color-surface-subtle);
}
.ac-panel-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-subtle);
  margin-bottom: 10px;
}

/* Two-col layout */
.ac-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 640px) {
  .ac-two-col { grid-template-columns: 1fr; }
}

/* Rows */
.ac-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-surface-alt);
}
.ac-row:last-child { border-bottom: none; }
.ac-row-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ac-row-value {
  font-size: 0.85rem;
  color: var(--color-text);
  line-height: 1.45;
}

/* Sub blocks (schools list, interdisciplinary) */
.ac-sub-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--color-surface-alt);
}
.ac-sub-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.ac-sub-item {
  font-size: 0.83rem;
  color: var(--color-text-muted);
  padding: 2px 0;
  line-height: 1.4;
}

/* Pills */
.ac-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.ac-pills--sm .ac-pill {
  font-size: 0.72rem;
  padding: 3px 9px;
}
.ac-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: var(--radius-3xl);
  line-height: 1.3;
}
.ac-pill--strength {
  background: #d1fae5;
  color: #065f46;
}
.ac-pill--consider {
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
}
.ac-pill--neutral {
  background: #e0e7ff;
  color: #3730a3;
}

/* Assessment text */
.ac-assessment-text {
  font-size: 0.875rem;
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 12px;
}
.ac-consider-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-subtle);
  margin-top: 10px;
  margin-bottom: 6px;
}

/* ── Soccer Profile Dashboard (PR-012.17) ── */
.sp-dashboard {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sp-snapshot {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.sp-metric-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px 14px 13px;
  overflow: hidden;
}

.sp-metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-sm) 10px 0 0;
}

.sp-metric--blue::before    { background: linear-gradient(90deg, var(--color-primary-light), #60a5fa); }
.sp-metric--indigo::before  { background: linear-gradient(90deg, var(--color-accent-light), #818cf8); }
.sp-metric--purple::before  { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.sp-metric--green::before   { background: linear-gradient(90deg, #16a34a, #4ade80); }

.sp-metric-label {
  margin: 0 0 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
}

.sp-metric-value {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.3;
}

.sp-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sp-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.sp-panel--full {
  grid-column: 1 / -1;
}

.sp-panel--assessment {
  background: var(--color-surface);
}

.sp-panel-label {
  margin: 0 0 12px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
}

.sp-sub-block {
  margin-bottom: 12px;
}

.sp-sub-block:last-child {
  margin-bottom: 0;
}

.sp-sub-label {
  margin: 0 0 3px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
}

.sp-sub-value {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-text);
  line-height: 1.55;
}

.sp-sub-meta {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--color-text-faint);
}

.sp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-surface-alt);
  font-size: 0.86rem;
}

.sp-row:last-child {
  border-bottom: none;
}

.sp-row-label {
  color: var(--color-text-muted);
}

.sp-row-value {
  font-weight: 600;
  color: var(--color-ink);
  text-align: right;
}

.sp-season-block {
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--color-surface-alt);
}

.sp-season-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.sp-season-label {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sp-contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.sp-contact-col {
  min-width: 160px;
}

.sp-link {
  font-size: 0.82rem;
  color: var(--color-primary-light);
  text-decoration: none;
}

.sp-link:hover {
  text-decoration: underline;
}

.sp-site-link {
  font-weight: 600;
}

.sp-assessment-text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-text);
  line-height: 1.65;
}

.sp-ca-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-surface-alt);
}

.sp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.sp-pill {
  display: inline-block;
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  font-size: 0.78rem;
  font-weight: 500;
}

.sp-pill--strength {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.sp-pill--consider {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.sp-placeholder {
  margin: 0;
  font-size: 0.86rem;
  color: var(--color-text-faint);
}

@media (max-width: 800px) {
  .sp-snapshot {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .sp-snapshot,
  .sp-two-col,
  .sp-ca-bottom {
    grid-template-columns: 1fr;
  }
}

.key-facts-dashboard {
  margin-bottom: 20px;
}

.key-facts-heading {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-faint);
}

.key-facts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* ── My Schools Grid (PR-012.4) ─────────────────────────────────────────── */

.ms-shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

.ms-page-header {
  margin-bottom: 20px;
}

.ms-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.ms-heading {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-ink);
}

/* Stats bar */
.ms-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ms-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 18px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  min-width: 64px;
}

.ms-stat-num {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-ink);
}

.ms-stat-label {
  font-size: 0.7rem;
  color: var(--color-text-subtle);
  font-weight: 500;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ms-stat-reach  .ms-stat-num { color: var(--color-danger); }
.ms-stat-target .ms-stat-num { color: #16a34a; }
.ms-stat-safety .ms-stat-num { color: var(--color-primary); }

/* Toolbar */
.ms-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ms-filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ms-filter-btn {
  padding: 6px 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-subtle);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ms-filter-btn:hover {
  background: var(--color-border);
  color: var(--color-ink);
}

.ms-filter-btn.ms-filter-active {
  background: var(--color-brand);
  color: var(--color-surface);
  border-color: var(--color-brand);
}

.ms-toolbar-actions {
  display: flex;
  gap: 8px;
}

.ms-action-btn {
  display: inline-block;
  padding: 8px 20px;
  background: var(--color-brand);
  color: var(--color-surface);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}

.ms-action-btn:disabled {
  background: var(--color-text-faint);
  cursor: not-allowed;
}

.ms-action-btn:not(:disabled):hover {
  background: #1e4d94;
}

/* Loading */
.ms-loading {
  text-align: center;
  padding: 40px;
  color: var(--color-text-subtle);
  font-size: 0.95rem;
}

/* Grid wrapper — horizontal scroll container */
.ms-grid-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.1);
  background: var(--color-surface);
  -webkit-overflow-scrolling: touch;
}

/* Grid table */
.ms-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--color-surface);
}

/* Head */
.ms-grid-head {
  background: var(--color-surface-subtle);
}

.ms-grid-th {
  padding: 11px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-subtle);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
  user-select: none;
  background: var(--color-surface-subtle);
}

.ms-grid-th[tabindex] {
  cursor: pointer;
}

.ms-grid-th[tabindex]:hover {
  color: var(--color-ink);
  background: var(--color-surface-alt);
}

.ms-grid-th.ms-sort-active {
  color: var(--color-brand);
}

/* Body cells */
.ms-grid-td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--color-surface-alt);
  vertical-align: middle;
  white-space: nowrap;
  color: #374151;
  background: var(--color-surface);
}

.ms-grid-row:last-child .ms-grid-td,
.ms-grid-row:last-child .ms-col-sticky,
.ms-grid-row:last-child .ms-col-checkbox {
  border-bottom: none;
}

.ms-grid-row:hover .ms-grid-td,
.ms-grid-row:hover .ms-col-sticky,
.ms-grid-row:hover .ms-col-checkbox {
  background: #f0f6ff;
}

/* Sticky checkbox column */
.ms-col-checkbox {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--color-surface);
  width: 44px;
  min-width: 44px;
  text-align: center;
  border-bottom: 1px solid var(--color-surface-alt);
  padding: 11px 8px;
}

.ms-grid-head .ms-col-checkbox {
  background: var(--color-surface-subtle);
  border-bottom: 2px solid var(--color-border);
  z-index: 4;
}

/* Sticky school column */
.ms-col-sticky {
  position: sticky;
  z-index: 2;
  background: var(--color-surface);
}

.ms-grid-head .ms-col-sticky {
  background: var(--color-surface-subtle);
  z-index: 3;
}

.ms-col-school {
  left: 44px;
  min-width: 210px;
  max-width: 260px;
  border-right: 1px solid var(--color-border);
  /* Category left-border is applied per row below */
}

/* Category row accent on sticky column */
.ms-row-reach   .ms-col-school { border-left: 3px solid var(--color-danger); }
.ms-row-target  .ms-col-school { border-left: 3px solid #16a34a; }
.ms-row-safety  .ms-col-school { border-left: 3px solid var(--color-primary); }
.ms-row-favorite .ms-col-school { border-left: 3px solid #ca8a04; }

/* Remove column */
.ms-col-remove {
  width: 40px;
  min-width: 40px;
  text-align: center;
}

.ms-remove-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-border-strong);
  font-size: 1.1rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.ms-remove-btn:hover {
  background: #fee2e2;
  color: var(--color-danger);
}

/* School link */
.ms-school-link {
  color: var(--color-brand);
  font-weight: 600;
  text-decoration: none;
  display: block;
  line-height: 1.3;
}

.ms-school-link:hover {
  text-decoration: underline;
}

/* Category badges */
.ms-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.ms-badge-reach    { background: #fee2e2; color: #991b1b; }
.ms-badge-target   { background: #dcfce7; color: var(--color-success-ink); }
.ms-badge-safety   { background: #dbeafe; color: #1e40af; }
.ms-badge-favorite { background: #fef3c7; color: #92400e; }

/* Competitive level badges */
.ms-level-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.ms-level-elite       { background: #7c3aed; color: var(--color-surface); }
.ms-level-high        { background: var(--color-danger); color: var(--color-surface); }
.ms-level-competitive { background: #ea580c; color: var(--color-surface); }
.ms-level-moderate    { background: #ca8a04; color: #1a1a1a; }
.ms-level-less        { background: #16a34a; color: var(--color-surface); }

/* Matthew Fit score */
.ms-fit-score {
  font-weight: 700;
}

.ms-fit-excellent { color: #16a34a; }
.ms-fit-good      { color: var(--color-primary); }
.ms-fit-ok        { color: #ca8a04; }
.ms-fit-low       { color: var(--color-danger); }

/* Soccer division badge */
.ms-div-badge {
  display: inline-block;
  padding: 1px 6px;
  background: var(--color-brand);
  color: var(--color-surface);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* Supporting text */
.ms-score-num {
  color: var(--color-text-faint);
  font-size: 0.8rem;
}

.ms-private-label {
  color: var(--color-text-faint);
  font-style: italic;
  font-size: 0.8rem;
}

.ms-footnote-ref {
  font-size: 0.65rem;
  color: var(--color-text-faint);
  vertical-align: super;
  margin-left: 1px;
}

/* Application status dropdown */
.ms-col-status {
  min-width: 150px;
}

.ms-status-select {
  width: 100%;
  min-width: 130px;
  padding: 4px 6px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.8rem;
  color: #374151;
  background: var(--color-surface);
  cursor: pointer;
}

.ms-status-select:focus {
  outline: 2px solid var(--color-brand);
  outline-offset: 1px;
}

/* Grid footnote */
.ms-grid-footnote {
  padding: 10px 14px;
  font-size: 0.75rem;
  color: var(--color-text-faint);
  border-top: 1px solid var(--color-surface-alt);
  margin: 0;
}

/* ── PR-012.8: School logo + name identity row ────────────────────────────── */
.profile-header-identity {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
}

.profile-logo {
  flex-shrink: 0;
  max-height: 72px;
  max-width: 96px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

.profile-header-text {
  min-width: 0; /* allow text to truncate/wrap rather than overflow */
}

@media (max-width: 480px) {
  .profile-header-identity {
    gap: 12px;
  }
  .profile-logo {
    max-height: 52px;
    max-width: 72px;
  }
}

/* ── My Schools grid: school cell with logo ───────────────────────────────── */
.ms-school-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ms-school-logo-wrap {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ms-school-logo {
  max-width: 36px;
  max-height: 36px;
  object-fit: contain;
}

.ms-school-cell-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ms-school-cell-badge {
  line-height: 1;
}

.ms-col-category {
  white-space: nowrap;
  min-width: 90px;
}

/* ── PR-012.6: Needs Review badge ────────────────────────────────────────── */
.ms-badge-needs-review { background: #f3f4f6; color: #6b7280; }

/* ── PR-012.6: Toolbar "In My Schools" state ─────────────────────────────── */
#profileAddToMySchoolsBtn.ms-toolbar-in {
  color: var(--color-success-ink);
  font-weight: 600;
}

/* ── PR-012.6: Needs Review stat ─────────────────────────────────────────── */
.ms-stat-review .ms-stat-num { color: #6b7280; }

/* ── PR-012.6: Matthew's Profile widget ──────────────────────────────────── */
.ms-student-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0 2px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.ms-sp-label { font-weight: 600; color: var(--color-text); }
.ms-sp-field { display: flex; align-items: center; gap: 4px; }
.ms-sp-input {
  width: 68px;
  padding: 3px 6px;
  border: 1px solid var(--color-border-strong);
  border-radius: 5px;
  font-size: 0.82rem;
  color: var(--color-ink-soft);
}
.ms-sp-input:focus { outline: 2px solid var(--color-primary-light); border-color: transparent; }

/* ── PR-012.6: Profile header star ───────────────────────────────────────── */
.profile-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.profile-title-row .profile-title { margin: 0; }

.profile-star-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: #d4a017;
  padding: 0;
  transition: color 0.15s, transform 0.1s;
}
.profile-star-btn:hover  { color: #f59e0b; transform: scale(1.15); }
.profile-star-btn.is-favorite { color: #f59e0b; }

/* ── PR-012.6: "Add to My Schools" button & in-schools badge ─────────────── */
.shortlist-button.ms-add-btn {
  background: var(--color-primary-hover);
  color: var(--color-surface);
  border: none;
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.shortlist-button.ms-add-btn:hover:not(:disabled) { background: #1e40af; }
.shortlist-button.ms-add-btn:disabled { opacity: 0.6; cursor: default; }

.ms-in-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}
.ms-in-badge-reach        { background: #fee2e2; color: #991b1b; }
.ms-in-badge-target       { background: #fef9c3; color: #854d0e; }
.ms-in-badge-safety       { background: #dcfce7; color: var(--color-success-ink); }
.ms-in-badge-needs-review { background: #f3f4f6; color: #374151; }
.ms-in-badge-favorite     { background: #ede9fe; color: #5b21b6; }

.shortlist-reasoning {
  font-size: 0.78rem;
  color: var(--color-text-subtle);
  margin: 6px 0 10px;
  font-style: italic;
}


/* ── My Schools Grid: responsive ─────────────────────────────────────────── */

@media (max-width: 768px) {
  .ms-shell {
    padding: 14px;
  }

  .ms-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .ms-stats {
    gap: 8px;
  }

  .ms-stat {
    padding: 6px 12px;
    min-width: 52px;
  }

  .ms-stat-num {
    font-size: 1.2rem;
  }

  .ms-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .ms-action-btn {
    width: 100%;
    text-align: center;
  }

  .ms-grid-th,
  .ms-grid-td {
    padding: 9px 10px;
    font-size: 0.8rem;
  }

  .ms-col-school {
    min-width: 160px;
    max-width: 200px;
  }
}

.key-facts-cell {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 9px;
  padding: 12px 14px;
  padding-top: 15px;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

/* 2px gradient accent bar at top */
.key-facts-cell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 9px 9px 0 0;
}
.kf-cell--amber::before   { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.kf-cell--emerald::before { background: linear-gradient(90deg, var(--color-success), #34d399); }
.kf-cell--indigo::before  { background: linear-gradient(90deg, var(--color-accent-light), #818cf8); }
.kf-cell--rose::before    { background: linear-gradient(90deg, #f43f5e, #fb7185); }

.key-facts-label {
  margin: 0 0 5px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
}

.key-facts-value {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.3;
  word-break: break-word;
}

/* ── Admissions Profile (PR-012.12) ─────────────────────────────────────── */
.admissions-dashboard {
  margin-bottom: 20px;
}

.admissions-heading {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-faint);
}

.adm-panels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.adm-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  padding-top: 17px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.adm-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-sm) 10px 0 0;
}
.adm-panel--overview::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.adm-panel--academic::before { background: linear-gradient(90deg, var(--color-success), #34d399); }
.adm-panel--testing::before  { background: linear-gradient(90deg, var(--color-accent-light), #818cf8); }

.adm-panel-title {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-faint);
}

.adm-level-badge {
  display: block;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}
.adm-level-high     { background: #fee2e2; color: #991b1b; }
.adm-level-medium   { background: #fef3c7; color: #92400e; }
.adm-level-balanced { background: #dbeafe; color: var(--color-primary-hover); }
.adm-level-low      { background: #dcfce7; color: var(--color-success-ink); }
.adm-level-neutral  { background: var(--color-surface-alt); color: var(--color-text-muted); }

.adm-stat-list {
  display: flex;
  flex-direction: column;
}

.adm-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--color-surface-subtle);
}
.adm-stat-row:last-child { border-bottom: none; }

.adm-stat-label {
  font-size: 0.82rem;
  color: var(--color-text-subtle);
  font-weight: 500;
}

.adm-stat-value {
  font-size: 0.92rem;
  color: var(--color-ink);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.adm-test-policy {
  display: block;
  padding: 6px 10px;
  border-radius: 7px;
  background: #ede9fe;
  color: #4c1d95;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}

.adm-deadlines {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 14px 16px;
  padding-top: 17px;
  position: relative;
}

.adm-deadlines::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-text-faint), var(--color-border-strong));
  border-radius: var(--radius-sm) 10px 0 0;
}

.adm-deadline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  margin-top: 8px;
}

.adm-deadline-row td {
  padding: 6px 0;
  vertical-align: middle;
}
.adm-deadline-row + .adm-deadline-row td {
  border-top: 1px solid var(--color-surface-subtle);
}

.adm-dl-plan {
  width: 48%;
  padding-right: 12px;
  font-weight: 600;
  color: var(--color-ink-soft);
}

.adm-dl-date {
  width: 28%;
  padding-right: 12px;
  color: var(--color-text);
  font-weight: 500;
}

.adm-dl-notes {
  color: var(--color-text-faint);
  font-size: 0.78rem;
  font-style: italic;
}

/* Shared tag list (career & campus sections) */
.program-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.program-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-bg);
  color: var(--color-primary-hover);
  font-size: 0.85rem;
  font-weight: 600;
}

.program-empty-state {
  color: var(--color-text-subtle);
  font-size: 0.9rem;
}

/* ── Career Outcomes Dashboard (PR-012.13) ─────────────────────────────── */
.co-dashboard {
  margin-bottom: 20px;
}

.co-section-label {
  margin: 0 0 2px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-faint);
}

/* Panel base */
.co-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  padding-top: 17px;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.co-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-sm) 10px 0 0;
}
.co-panel--employment::before   { background: linear-gradient(90deg, var(--color-success), #34d399); }
.co-panel--compensation::before { background: linear-gradient(90deg, var(--color-accent-light), #818cf8); }
.co-panel--gradschool::before   { background: linear-gradient(90deg, var(--color-text-subtle), var(--color-text-faint)); }
.co-panel--fields::before       { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.co-panel--employers::before    { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.co-panel--resources::before    { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.co-panel--pathways::before     { background: linear-gradient(90deg, var(--color-text-subtle), var(--color-text-faint)); }
.co-panel--assessment::before   { background: linear-gradient(90deg, var(--color-text), var(--color-text-subtle)); }
.co-panel--full { width: 100%; }

.co-panel-title {
  margin: 0 0 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
}

/* Row layouts */
.co-top-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 10px;
  align-items: start;
}
.co-mid-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 10px;
  align-items: start;
}
.co-mid-row--single { grid-template-columns: 1fr; }

@media (max-width: 800px) {
  .co-top-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .co-top-row, .co-mid-row { grid-template-columns: 1fr; }
}

/* Big metric */
.co-big-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}
.co-big-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--color-ink);
  line-height: 1.1;
}
.co-big-label {
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

/* Year + population meta */
.co-year {
  display: block;
  margin-top: 5px;
  font-size: 0.72rem;
  color: var(--color-text-faint);
  font-weight: 500;
}
.co-population {
  display: block;
  margin-top: 3px;
  font-size: 0.70rem;
  color: var(--color-text-faint);
  font-weight: 400;
  line-height: 1.4;
}

/* Stat rows */
.co-stat-list { display: flex; flex-direction: column; }
.co-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--color-surface-subtle);
}
.co-stat-row:last-child { border-bottom: none; }
.co-stat-label { font-size: 0.82rem; color: var(--color-text-subtle); font-weight: 500; }
.co-stat-value { font-size: 0.92rem; color: var(--color-ink); font-weight: 700; white-space: nowrap; }

/* Pills */
.co-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.co-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-alt);
  color: var(--color-text);
  font-size: 0.78rem;
  font-weight: 600;
}
.co-pill--strength { background: #d1fae5; color: #065f46; }
.co-pill--consider { background: var(--color-surface-alt); color: var(--color-text-muted); }

/* Career Resources rows */
.co-res-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 0;
  border-bottom: 1px solid var(--color-surface-alt);
}
.co-res-row:last-child { border-bottom: none; }
.co-res-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
}
.co-res-value {
  font-size: 0.83rem;
  color: var(--color-text);
  line-height: 1.45;
}

/* Career Assessment */
.co-outlook-text {
  font-size: 0.875rem;
  color: var(--color-text);
  line-height: 1.6;
  margin: 0 0 14px;
}
.co-ca-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .co-ca-bottom { grid-template-columns: 1fr; }
}
.co-ca-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-subtle);
  margin: 0 0 6px;
}

/* Placeholder / not-reported */
.co-not-reported {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--color-text-faint);
  font-weight: 400;
}

/* ── School Overview Section (PR-012.14) ─────────────────────────────────── */
.so-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Each sub-section (At a Glance / About the School / Consultant Analysis) */
.so-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

/* Section-level labels */
.so-section-label {
  margin: 0 0 12px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-faint);
}

/* ── At a Glance grid ─────────────────────────────────────────────────────── */
.so-glance-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 20px;
}

/* Cell that spans both columns */
.so-glance-full {
  grid-column: 1 / -1;
}

.so-glance-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.so-glance-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
}

.so-value {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-ink);
}

/* Pills (Core Strengths, Application Focus) */
.so-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.so-pill {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-alt);
  color: var(--color-text);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Bullet list (Distinctive Features) */
.so-bullet-list {
  margin: 4px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.so-bullet-list li {
  font-size: 0.88rem;
  color: var(--color-text);
  line-height: 1.5;
}

/* ── Narrative ────────────────────────────────────────────────────────────── */
.so-narrative {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.so-para {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--color-text);
}

/* ── Consultant Analysis ─────────────────────────────────────────────────── */
.so-assessment {
  margin-bottom: 14px;
}

.so-assessment-text {
  margin: 4px 0 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--color-text);
  font-style: italic;
}

.so-sub-label {
  margin: 0 0 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-subtle);
}

.so-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 14px;
}

.so-analysis-col {
  min-width: 0;
}

.so-bottom-line {
  padding-top: 12px;
  border-top: 1px solid var(--color-surface-alt);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .so-glance-grid,
  .so-analysis-grid {
    grid-template-columns: 1fr;
  }

  .so-glance-full {
    grid-column: 1;
  }
}

.campus-life-dashboard {
  margin-bottom: 24px;
  padding: 22px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3xl);
  background: linear-gradient(135deg, var(--color-surface-subtle), #fff7ed);
}

.campus-life-heading {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.campus-life-intro {
  margin: 0 0 16px;
  color: var(--color-text-muted);
}

.campus-life-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.campus-card {
  padding: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  display: grid;
  gap: 12px;
  min-width: 0;
}

.campus-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.campus-card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffedd5;
  color: #9a3412;
  font-size: 1rem;
  flex: 0 0 auto;
}

.campus-card-title {
  margin: 0;
  font-size: 0.98rem;
}

.campus-card-value {
  margin: 0;
  color: var(--color-ink);
  font-weight: 600;
  line-height: 1.45;
}

.experiential-learning-dashboard {
  margin-bottom: 24px;
  padding: 22px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3xl);
  background: linear-gradient(135deg, var(--color-surface-subtle), #f5f3ff);
}

.experiential-learning-heading {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.experiential-learning-intro {
  margin: 0 0 16px;
  color: var(--color-text-muted);
}

.experiential-learning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.experiential-card {
  padding: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  display: grid;
  gap: 12px;
  min-width: 0;
}

.experiential-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.experiential-card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 1rem;
  flex: 0 0 auto;
}

.experiential-card-title {
  margin: 0;
  font-size: 0.98rem;
}

.fit-score-dashboard {
  padding: 22px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3xl);
  background: linear-gradient(135deg, var(--color-surface-subtle), #eef2ff);
}

.fit-score-heading {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.fit-score-intro {
  margin: 0 0 16px;
  color: var(--color-text-muted);
}

.fit-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.fit-score-card {
  padding: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

.fit-score-title {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.fit-score-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.fit-score-bar {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-border);
  overflow: hidden;
  margin-bottom: 8px;
}

.financial-planning-card {
  padding: 22px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3xl);
  background: linear-gradient(135deg, var(--color-surface-subtle), #eef2ff);
  margin-bottom: 24px;
}

.financial-planning-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.financial-planning-field {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--color-text);
}

.financial-planning-input {
  padding: 10px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  font: inherit;
}

.financial-planning-summary {
  display: grid;
  gap: 12px;
}

.financial-planning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.financial-planning-metric {
  padding: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

.financial-planning-metric-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.financial-planning-metric-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.financial-planning-metric-caption,
.financial-planning-note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.compare-financial-card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3xl);
  background: var(--color-surface-subtle);
}

.compare-highlight {
  font-weight: 700;
  color: var(--color-ink);
}

.compare-highlight-high {
  background: #fef3c7;
}

.compare-highlight-low {
  background: #dbeafe;
}

.fit-score-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

.fit-score-explanation {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.compare-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.compare-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: end;
  background: var(--color-surface);
  padding: 24px;
  border-radius: var(--radius-4xl);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  margin-bottom: 20px;
}

.compare-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare-control label {
  font-weight: 700;
  color: var(--color-ink);
}

.compare-options {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-subtle);
}

.compare-options legend {
  padding: 0 6px;
  font-weight: 700;
  color: var(--color-text);
}

.compare-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
  font-size: 0.95rem;
}

.compare-actions button {
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: var(--color-surface);
  font: inherit;
  cursor: pointer;
}

.compare-results {
  background: var(--color-surface);
  border-radius: var(--radius-4xl);
  padding: 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.compare-charts-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.compare-charts-heading {
  margin: 0;
  font-size: 1.25rem;
  color: var(--color-ink);
}

.compare-charts-intro {
  margin: 0;
  color: var(--color-text-muted);
}

.compare-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.compare-chart-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 14px;
  background: linear-gradient(180deg, var(--color-surface-subtle) 0%, #ffffff 100%);
  display: grid;
  gap: 10px;
}

.compare-chart-title {
  margin: 0;
  font-size: 1rem;
  color: var(--color-ink);
}

.compare-chart-row {
  display: grid;
  gap: 6px;
}

.compare-chart-school {
  margin: 0;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 700;
}

.compare-chart-track {
  height: 10px;
  background: var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.compare-chart-fill {
  height: 100%;
  border-radius: inherit;
}

.compare-chart-fill-a {
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
}

.compare-chart-fill-b {
  background: linear-gradient(90deg, #0f766e, #14b8a6);
}

.compare-chart-fill-missing {
  background: var(--color-border-strong);
}

.compare-chart-value {
  margin: 0;
  color: var(--color-ink);
  font-size: 0.92rem;
  font-weight: 600;
}

.compare-chart-note {
  margin: 0;
  color: var(--color-text-subtle);
  font-size: 0.9rem;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
}

.compare-table th,
.compare-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.compare-table th {
  background: var(--color-surface-subtle);
  font-weight: 700;
}

.search-shell {
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px;
}

.search-panel {
  background: var(--color-surface);
  border-radius: var(--radius-4xl);
  padding: 22px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  margin-bottom: 18px;
  display: grid;
  gap: 14px;
}

.search-keyword-row {
  display: grid;
  gap: 8px;
  position: relative;
}

.search-autocomplete {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  max-height: 280px;
  overflow-y: auto;
}

.search-autocomplete[hidden] {
  display: none;
}

.search-autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
  color: var(--color-ink);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.search-autocomplete-item:hover,
.search-autocomplete-item[aria-selected='true'] {
  background: #dbeafe;
}

.search-autocomplete-label {
  font-weight: 600;
}

.search-autocomplete-type {
  color: var(--color-text-subtle);
  font-size: 0.85rem;
  text-transform: capitalize;
}

.search-keyword-row label,
.search-filter-field span {
  font-weight: 700;
  color: var(--color-ink);
}

.search-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.search-advanced-filters {
  display: grid;
  gap: 12px;
}

.search-filter-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  background: var(--color-surface-subtle);
  padding: 0 14px 14px;
}

.search-filter-group summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  color: var(--color-ink);
  padding: 14px 0;
}

.search-filter-group summary::-webkit-details-marker {
  display: none;
}

.search-filter-group summary::after {
  content: '▾';
  float: right;
  color: var(--color-text-subtle);
}

.search-filter-group[open] summary::after {
  content: '▴';
}

.search-filter-group-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.search-filter-field {
  display: grid;
  gap: 6px;
}

.search-input,
.search-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong);
  font: inherit;
  color: var(--color-ink);
  background: var(--color-surface);
}

.search-input:focus-visible,
.search-select:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.search-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.search-sort-field {
  display: inline-grid;
  gap: 4px;
  min-width: 230px;
}

.search-sort-field span {
  font-weight: 700;
  color: var(--color-text);
  font-size: 0.9rem;
}

.search-clear-button {
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-border);
  color: var(--color-ink);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.search-results-summary {
  margin: 0;
  color: var(--color-text);
  font-weight: 600;
  margin-left: auto;
}

.saved-searches-panel {
  background: var(--color-surface);
  border-radius: var(--radius-4xl);
  padding: 22px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  margin-bottom: 18px;
  display: grid;
  gap: 12px;
}

.search-analytics-panel {
  background: var(--color-surface);
  border-radius: var(--radius-4xl);
  padding: 22px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  margin-bottom: 18px;
  display: grid;
  gap: 12px;
}

.search-analytics-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
}

.search-analytics-header h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.search-analytics-description {
  margin: 0;
  color: var(--color-text-muted);
}

.search-analytics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.search-analytics-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  background: linear-gradient(180deg, var(--color-surface-subtle) 0%, #ffffff 100%);
  padding: 16px;
  min-width: 0;
}

.search-analytics-card h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

.search-analytics-value {
  margin: 8px 0 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-ink);
}

.search-analytics-detail {
  margin: 8px 0 0;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.saved-searches-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
}

.saved-searches-header h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.saved-searches-description {
  margin: 0;
  color: var(--color-text-muted);
}

.saved-searches-create {
  display: grid;
  gap: 8px;
  min-width: min(100%, 360px);
}

.saved-searches-create label {
  font-weight: 700;
  color: var(--color-ink);
}

.saved-search-button {
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: var(--color-surface);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  width: fit-content;
}

.saved-search-button.secondary {
  background: var(--color-border);
  color: var(--color-ink);
}

.saved-search-button.danger {
  background: #fee2e2;
  color: #991b1b;
}

.saved-search-status {
  margin: 0;
  color: var(--color-text);
  font-weight: 600;
}

.saved-search-list {
  display: grid;
  gap: 12px;
}

.saved-search-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  background: var(--color-surface-subtle);
  padding: 16px;
}

.saved-search-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.saved-search-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.saved-search-meta,
.saved-search-summary {
  margin: 6px 0 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.saved-search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-results {
  display: grid;
  gap: 12px;
}

.search-result-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3xl);
  padding: 18px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.search-result-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.search-result-card h3 a {
  color: var(--color-brand);
  text-decoration: none;
}

.search-result-card h3 a:hover,
.search-result-card h3 a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.search-result-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 12px;
  margin: 0;
}

.search-result-facts dt {
  font-weight: 700;
  color: var(--color-text);
}

.search-result-facts dd {
  margin: 0;
  color: var(--color-text-muted);
}

.search-result-keywords {
  margin: 10px 0 0;
  color: var(--color-text-subtle);
  font-size: 0.92rem;
}

.application-tracker {
  display: grid;
  gap: 14px;
}

.application-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.application-summary-card {
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-subtle);
}

.application-summary-title {
  margin: 0 0 6px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-subtle);
}

.application-summary-value {
  margin: 0;
  color: var(--color-ink);
  font-weight: 600;
}

.application-progress {
  display: grid;
  gap: 8px;
}

.application-progress-label {
  margin: 0;
  color: var(--color-text);
  font-weight: 600;
}

.application-progress-bar {
  width: 100%;
  height: 10px;
  border-radius: var(--radius-pill);
  background: #dbeafe;
  overflow: hidden;
}

.application-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transition: width 0.2s ease;
}

.application-subheading {
  margin: 4px 0 0;
  color: var(--color-ink);
  font-size: 1rem;
}

.application-checklist,
.application-deadline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.application-task {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.application-task-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
}

.application-task-label input {
  margin-top: 3px;
}

.application-task-text {
  display: grid;
  gap: 2px;
}

.application-task-title {
  color: var(--color-ink);
  font-weight: 600;
}

.application-task-meta {
  color: var(--color-text-subtle);
  font-size: 0.9rem;
}

.application-deadline {
  display: grid;
  grid-template-columns: 1.2fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.application-deadline-title {
  color: var(--color-ink);
  font-weight: 600;
}

.application-deadline-date,
.application-deadline-status {
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.application-deadline-overdue {
  border-color: #fecaca;
  background: #fef2f2;
}

.application-deadline-upcoming {
  border-color: #fde68a;
  background: #fffbeb;
}

.application-deadline-missing {
  border-style: dashed;
  color: var(--color-text-subtle);
}

.map-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 18px;
}

.map-controls {
  background: var(--color-surface);
  border-radius: var(--radius-4xl);
  padding: 22px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 12px;
}

.map-controls h2 {
  margin: 0;
}

.map-controls-intro,
.map-status,
.map-selection-summary,
.map-school-meta {
  margin: 0;
  color: var(--color-text-muted);
}

.map-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.map-filter-field {
  display: grid;
  gap: 6px;
}

.map-filter-field span {
  font-weight: 700;
  color: var(--color-text);
  font-size: 0.92rem;
}

.map-filter-field .profile-selector {
  min-width: 220px;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 16px;
}

.map-school-panel,
.map-canvas-card {
  background: var(--color-surface);
  border-radius: var(--radius-4xl);
  padding: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.map-school-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.map-school-panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.map-school-panel-header h3,
.map-missing-heading {
  margin: 0;
}

.map-school-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-school-checklist {
  max-height: 320px;
  overflow: auto;
}

.map-school-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.map-school-option {
  display: flex;
  gap: 8px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
  color: var(--color-ink);
}

.map-school-option input {
  margin-top: 3px;
}

.map-missing-list {
  margin: 0;
  padding-left: 18px;
  color: var(--color-text-subtle);
  display: grid;
  gap: 4px;
}

.map-canvas-card {
  display: grid;
  gap: 12px;
}

.geo-map-svg {
  width: 100%;
  height: auto;
  min-height: 420px;
  display: block;
  border-radius: var(--radius-xl);
  border: 1px solid #dbe5f0;
  background: linear-gradient(180deg, #eef6ff 0%, #f8fbff 45%, #edf5ff 100%);
}

.geo-map-background {
  fill: transparent;
}

.geo-map-grid-line {
  stroke: #d9e7fb;
  stroke-width: 1;
}

.geo-map-empty {
  fill: var(--color-text-subtle);
  text-anchor: middle;
  font-size: 16px;
}

.geo-map-marker {
  fill: var(--color-primary);
  stroke: var(--color-surface);
  stroke-width: 2;
  cursor: pointer;
}

.geo-map-marker:hover {
  fill: var(--color-primary-hover);
}

.geo-map-marker:focus-visible,
.geo-map-label:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 4px rgba(37, 99, 235, 0.6));
}

.geo-map-label {
  fill: var(--color-ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.map-school-detail {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: var(--color-surface-subtle);
}

.map-school-card h3 {
  margin: 0 0 8px;
}

.map-school-card p {
  margin: 0 0 6px;
}

.map-status {
  min-height: 1.25rem;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .viewer-header {
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .sidebar {
    order: 2;
  }

  .viewer {
    order: 1;
  }

  .application-deadline {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .map-shell {
    padding: 16px;
  }

  .map-controls,
  .map-school-panel,
  .map-canvas-card {
    border-radius: var(--radius-2xl);
    padding: 16px;
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-controls-row,
  .map-school-panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .map-school-checklist {
    max-height: 240px;
  }

  .geo-map-svg {
    min-height: 300px;
  }

  .search-shell {
    padding: 16px;
  }

  .search-panel {
    padding: 16px;
    border-radius: var(--radius-2xl);
  }

  .search-autocomplete {
    max-height: 240px;
  }

  .search-filter-group {
    padding-left: 12px;
    padding-right: 12px;
  }

  .search-filter-group-body {
    grid-template-columns: 1fr;
  }

  .search-result-facts {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .search-result-facts dt {
    margin-top: 6px;
  }

  .key-facts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .adm-panels {
    grid-template-columns: 1fr;
  }

  .co-top-row {
    grid-template-columns: 1fr;
  }

  .co-mid-row {
    grid-template-columns: 1fr;
  }

  .campus-life-dashboard {
    padding: 18px;
    border-radius: var(--radius-2xl);
  }

  .campus-life-grid {
    grid-template-columns: 1fr;
  }

  .experiential-learning-dashboard {
    padding: 18px;
    border-radius: var(--radius-2xl);
  }

  .experiential-learning-grid {
    grid-template-columns: 1fr;
  }

  .visit-form-grid {
    grid-template-columns: 1fr;
  }

  .collection-create-row {
    flex-direction: column;
    align-items: stretch;
  }

  .visit-history-header {
    flex-direction: column;
    align-items: stretch;
  }

  .personal-note-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .timeline-milestone-form {
    grid-template-columns: 1fr;
  }

  .decision-timeline-summary {
    grid-template-columns: 1fr;
  }

  .decision-timeline-item-header {
    flex-direction: column;
    align-items: stretch;
  }

  .collections-manage-row,
  .collections-card-header,
  .collections-school-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-sort-field {
    min-width: 100%;
  }

  .compare-results {
    padding: 16px;
    border-radius: var(--radius-2xl);
  }

  .compare-charts-grid {
    grid-template-columns: 1fr;
  }

  .search-results-summary {
    margin-left: 0;
    width: 100%;
  }

  .saved-searches-panel {
    padding: 16px;
    border-radius: var(--radius-2xl);
  }

  .search-analytics-panel {
    padding: 16px;
    border-radius: var(--radius-2xl);
  }

  .saved-searches-create {
    min-width: 100%;
  }

  .saved-search-button {
    width: 100%;
  }

  .saved-search-card-header {
    align-items: stretch;
  }

  .saved-search-actions {
    width: 100%;
  }

  .saved-search-actions .saved-search-button {
    width: auto;
  }

  .search-analytics-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   PR-012.1 — RESPONSIVE MOBILE EXPERIENCE
   Breakpoints:
     Desktop   : 1200px+   (existing styles apply)
     Laptop    : 992–1199px
     Tablet    : 768–991px
     LG Phone  : 480–767px
     SM Phone  : 320–479px
============================================================================= */

/* ── Hamburger / Mobile Nav Drawer ──────────────────────────────────────── */

.hamburger-btn {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  z-index: 101;
  transition: background 0.2s ease;
}

.hamburger-btn:hover,
.hamburger-btn:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-surface);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger-btn.is-active .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.is-active .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.is-active .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 200;
  backdrop-filter: blur(2px);
  transition: opacity 0.25s ease;
}

.mobile-nav-overlay.is-visible {
  display: block;
  animation: fadeIn 0.2s ease;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--color-surface);
  box-shadow: -10px 0 50px rgba(15, 23, 42, 0.18);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mobile-nav-drawer.is-open {
  transform: translateX(0);
}

.mobile-nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--color-brand);
  color: var(--color-surface);
  flex-shrink: 0;
}

.mobile-nav-drawer-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-surface);
}

.mobile-nav-close {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-surface);
  font-size: 1.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.mobile-nav-close:hover,
.mobile-nav-close:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  overflow-y: auto;
  flex: 1;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  color: var(--color-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  min-height: 56px;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus-visible {
  background: var(--color-primary-bg);
  border-left-color: var(--color-primary);
  color: var(--color-primary);
  outline: none;
}

.mobile-nav-link[aria-current='page'] {
  background: var(--color-primary-bg);
  border-left-color: var(--color-primary);
  color: var(--color-primary);
}

body.nav-drawer-open {
  overflow: hidden;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Header: make room for hamburger on mobile ──────────────────────────── */

.header {
  position: relative;
}

/* ── Laptop (992–1199px) ────────────────────────────────────────────────── */

@media (max-width: 1199px) {
  .layout {
    gap: 18px;
    padding: 18px;
  }

  .sidebar {
    min-width: 220px;
  }

  .search-analytics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .compare-controls {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* ── Tablet (768–991px) ─────────────────────────────────────────────────── */

@media (max-width: 991px) {
  /* Show hamburger */
  .hamburger-btn {
    display: flex;
  }

  /* Shrink header, pad for hamburger button */
  .header {
    padding: 16px 60px 16px 16px;
  }

  .header h1 {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
  }

  .header p {
    font-size: 0.9rem;
    margin-top: 6px;
  }

  /* Hide desktop nav on tablet — use drawer instead */
  .site-nav {
    display: none;
  }

  /* Layout: single column.
     min-width: 0 on grid items is REQUIRED — prevents 1fr from expanding
     to fit content width, which would cause horizontal overflow. */
  .layout {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px;
  }

  .sidebar {
    order: 2;
    min-width: 0;
  }

  .viewer {
    order: 1;
    min-width: 0;
    padding: 20px;
  }

  /* Section nav: horizontal scroll */
  .section-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .section-nav-link {
    scroll-snap-align: start;
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  /* Viewer actions: 2-column grid on tablet/phone */
  .viewer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* "Add School" spans full width as the primary CTA */
  .viewer-actions > *:first-child {
    grid-column: 1 / -1;
  }

  /* Analytics grid */
  .search-analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Compare */
  .compare-shell {
    padding: 14px;
  }

  /* My schools */
  .my-schools-shell {
    padding: 14px;
  }

  /* Collections */
  .collections-manage-panel {
    padding: 16px;
  }

  /* Map */
  .map-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Large Phone (480–767px) ────────────────────────────────────────────── */

@media (max-width: 767px) {
  /* Header */
  .header {
    padding: 14px 58px 14px 14px;
    text-align: left;
  }

  .header h1 {
    font-size: clamp(1.1rem, 5vw, 1.5rem);
  }

  .header p {
    font-size: 0.85rem;
    max-width: 100%;
  }

  /* Layout */
  .layout {
    padding: 10px;
    gap: 10px;
  }

  .sidebar,
  .viewer {
    border-radius: var(--radius-xl);
    padding: 16px;
  }

  /* Profile selector */
  .profile-selector {
    width: 100%;
    min-width: unset;
    font-size: 1rem;
  }

  .viewer-title-row {
    flex-direction: column;
    gap: 10px;
  }

  /* Viewer actions: full-width stacked on phones */
  .viewer-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* All action items full width */
  .viewer-actions > *:first-child {
    grid-column: 1;
  }

  .secondary-link,
  .secondary-link-button {
    width: 100%;
    text-align: center;
    min-height: 44px;
    justify-content: center;
  }

  /* Section nav pills */
  .section-nav-link {
    padding: 9px 12px;
    font-size: 0.85rem;
    gap: 5px;
  }

  /* Profile sections */
  .profile-section {
    padding: 14px 16px;
    border-radius: var(--radius-xl);
    margin-bottom: 12px;
  }

  .profile-header {
    padding-bottom: 12px;
    margin-bottom: 14px;
  }

  .profile-title {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
  }

  /* Key facts: 2 columns on phones */
  .key-facts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .key-facts-cell {
    padding: 10px 12px;
    padding-top: 13px;
  }

  /* Snapshot table → card layout on phones */
  .snapshot-table {
    display: block;
  }

  .snapshot-table thead {
    display: none;
  }

  .snapshot-table tbody {
    display: grid;
    gap: 8px;
  }

  .snapshot-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .snapshot-table th,
  .snapshot-table td {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border-bottom: none;
  }

  .snapshot-table th {
    background: var(--color-surface-alt);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
  }

  .snapshot-table td {
    font-weight: 600;
    color: var(--color-ink);
  }

  /* Consultant insight / callout / bottom line */
  .consultant-insight,
  .callout,
  .bottom-line {
    padding: 14px 16px;
    border-radius: var(--radius-md);
  }

  /* AI modal: full screen on phones */
  .ai-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .ai-modal {
    width: 100%;
    max-height: 95dvh;
    border-radius: var(--radius-4xl) 24px 0 0;
  }

  .ai-modal-header {
    padding: 18px 18px 16px;
  }

  .ai-modal-header h2 {
    font-size: 1.15rem;
  }

  .ai-modal-body {
    padding: 16px 18px;
    gap: 14px;
  }

  .ai-modal-footer {
    padding: 14px 18px;
    flex-direction: column;
    gap: 12px;
  }

  .ai-modal-actions {
    width: 100%;
    flex-direction: column;
  }

  .ai-action-button {
    width: 100%;
    min-height: 44px;
  }

  .ai-school-search-quick-panels {
    grid-template-columns: 1fr;
  }

  .ai-school-search-input {
    min-height: 52px;
    font-size: 1rem;
  }

  .ai-school-chip {
    min-height: 44px;
  }

  .ai-school-card {
    padding: 14px;
  }

  /* Touch targets: all interactive elements ≥ 44px */
  .section-header {
    /* no min-height needed; not interactive */
  }

  .school {
    padding: 14px;
    min-height: 56px;
  }

  .shortlist-button,
  .shortlist-select {
    min-height: 44px;
    font-size: 1rem;
  }

  .section-refresh-button {
    min-height: 44px;
    padding: 0 16px;
  }

  /* Back to top */
  .back-to-top {
    right: 14px;
    bottom: 80px; /* above mobile browser chrome */
  }

  /* Search page */
  .search-shell {
    padding: 10px;
  }

  .search-panel {
    padding: 14px;
    border-radius: var(--radius-xl);
  }

  .search-input,
  .search-select {
    min-height: 44px;
    font-size: 1rem;
  }

  .search-filters-grid {
    grid-template-columns: 1fr;
  }

  .search-actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-clear-button {
    width: 100%;
    min-height: 44px;
    font-size: 1rem;
  }

  .search-results-summary {
    margin-left: 0;
  }

  .search-result-card {
    padding: 14px;
    border-radius: var(--radius-xl);
  }

  /* Compare page */
  .compare-shell {
    padding: 10px;
  }

  .compare-controls {
    padding: 16px;
    border-radius: var(--radius-xl);
    grid-template-columns: 1fr;
  }

  .compare-results {
    padding: 14px;
    border-radius: var(--radius-xl);
  }

  .compare-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* My Schools */
  .my-schools-shell {
    padding: 10px;
  }

  .my-schools-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Application tracker */
  .application-deadline {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  /* Timeline form */
  .timeline-milestone-form {
    grid-template-columns: 1fr;
  }

  /* Financial planning */
  .financial-planning-card {
    padding: 16px;
    border-radius: var(--radius-xl);
  }

  .financial-planning-form {
    grid-template-columns: 1fr;
  }

  /* Visit tracker */
  .visit-form-grid {
    grid-template-columns: 1fr;
  }

  /* Map */
  .map-shell {
    padding: 10px;
  }

  .map-controls {
    padding: 14px;
    border-radius: var(--radius-xl);
  }

  .map-controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  .geo-map-svg {
    min-height: 260px;
  }

  /* Admissions panels mobile */
  .adm-panels {
    grid-template-columns: 1fr;
  }

  /* Career */
  .co-top-row,
  .co-mid-row {
    grid-template-columns: 1fr;
  }

  /* Recruiting */
  .recruiting-shell {
    padding: 10px;
  }

  /* Progress bar anchor */
  .progress-bar {
    position: sticky;
    top: 0;
    z-index: 99;
  }
}

/* ── Small Phone (320–479px) ────────────────────────────────────────────── */

@media (max-width: 479px) {
  .header h1 {
    font-size: 1.1rem;
  }

  .layout {
    padding: 8px;
    gap: 8px;
  }

  .sidebar,
  .viewer {
    padding: 12px;
    border-radius: var(--radius-lg);
  }

  .profile-section {
    padding: 12px;
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
  }

  .key-facts-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .key-facts-cell {
    padding: 9px 11px;
    padding-top: 12px;
  }

  .key-facts-value {
    font-size: 0.88rem;
  }

  .key-facts-label {
    font-size: 0.68rem;
  }

  /* Section nav: even more compact */
  .section-nav-link {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .section-nav-icon {
    font-size: 0.9rem;
  }

  /* Viewer actions: compact */
  .secondary-link,
  .secondary-link-button {
    font-size: 0.9rem;
    padding: 10px 12px;
  }

  /* Typography */
  .profile-title {
    font-size: 1.4rem;
  }

  .section-header h3 {
    font-size: 1rem;
  }

  /* AI modal */
  .ai-modal {
    max-height: 100dvh;
    border-radius: var(--radius-3xl) 20px 0 0;
  }

  .ai-modal-header {
    padding: 14px 14px 12px;
  }

  .ai-modal-body {
    padding: 12px 14px;
  }

  .ai-modal-footer {
    padding: 12px 14px;
  }

  /* Search analytics: single column */
  .search-analytics-grid {
    grid-template-columns: 1fr;
  }

  /* Fit score grid: 2 cols on small phones */
  .fit-score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Financial planning grid */
  .financial-planning-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Decision timeline summary */
  .decision-timeline-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* Collections */
  .collections-input {
    min-width: unset;
  }

  /* Back to top: smaller on tiny screens */
  .back-to-top {
    width: 42px;
    height: 42px;
    font-size: 1rem;
    right: 10px;
    bottom: 70px;
  }
}

/* ── Orientation: landscape phone ───────────────────────────────────────── */

@media (max-width: 767px) and (orientation: landscape) {
  .header {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .header h1 {
    font-size: 1.1rem;
  }

  .header p {
    display: none; /* Hide tagline in landscape to save height */
  }

  .ai-modal {
    max-height: 98dvh;
    border-radius: var(--radius-xl);
  }

  .ai-modal-overlay {
    padding: 4px;
    align-items: center;
  }

  .mobile-nav-drawer {
    width: 75vw;
  }
}

/* ── Touch target baseline: any interactive element ─────────────────────── */

@media (pointer: coarse) {
  .site-nav-link,
  .section-nav-link,
  .school,
  .shortlist-button,
  .shortlist-select,
  .ai-action-button,
  .ai-school-chip,
  .ai-school-card,
  .back-to-top,
  .search-clear-button,
  .saved-search-button,
  .compare-actions button,
  .visit-input,
  .visit-textarea,
  .search-input,
  .search-select,
  .profile-selector,
  .collection-input,
  .financial-planning-input,
  .personal-notes-input {
    min-height: 44px;
  }

  /* Inputs should be large enough for comfortable typing */
  .search-input,
  .search-select,
  .visit-input,
  .visit-textarea,
  .profile-selector,
  .collection-input,
  .financial-planning-input,
  .personal-notes-input {
    font-size: max(16px, 1rem); /* prevents iOS zoom on focus */
  }
}

/* ── Prevent content overflow globally ──────────────────────────────────── */

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

pre,
code {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Overflow-safe tables on all sizes */
.compare-table,
.snapshot-table {
  max-width: 100%;
}

/* Prevent long words from breaking layouts */
.profile-title,
.key-facts-value,
.co-big-value,
.co-stat-value,
.fit-score-value,
.financial-planning-metric-value,
.search-analytics-value {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Auth pages (register/login) */
.auth-shell {
  display: flex;
  justify-content: center;
  padding: 48px 22px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--color-surface);
  border-radius: var(--radius-4xl);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  padding: 32px;
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  color: var(--color-ink);
}

.auth-card p.auth-subtitle {
  margin: 0 0 24px;
  color: var(--color-text-subtle);
  font-size: 0.95rem;
}

.auth-card-wide {
  max-width: 460px;
}

.auth-field-row {
  display: flex;
  gap: 12px;
}

.auth-field-row .auth-field {
  flex: 1;
  min-width: 0;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.auth-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}

.auth-field input,
.auth-field select {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-ink);
  background: var(--color-surface);
}

.auth-field input:focus-visible,
.auth-field select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.auth-skip-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--color-text-subtle);
  text-decoration: none;
}

.auth-skip-link:hover {
  text-decoration: underline;
}

.auth-hint {
  font-size: 0.8rem;
  color: var(--color-text-faint);
}

.auth-error {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.auth-error:empty {
  display: none;
}

.auth-success {
  background: #f0fdf4;
  color: var(--color-success-ink);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.auth-success:empty {
  display: none;
}

.profile-section-title {
  margin: 24px 0 12px;
  font-size: 1rem;
  color: var(--color-ink);
}

.profile-section-title:first-of-type {
  margin-top: 0;
}

.auth-submit {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-surface);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-submit:hover {
  background: var(--color-primary-hover);
}

.auth-submit:disabled {
  background: var(--color-text-faint);
  cursor: not-allowed;
}

.auth-switch {
  margin-top: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-subtle);
}

.auth-switch a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

