/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Loom Lens design tokens */
  --bg:              #F7F8FA;
  --surface:         #FFFFFF;
  --surface-hover:   #F4F5F7;
  --border:          #DFE1E6;
  --border-focus:    #1868DB;

  --primary:         #1868DB;
  --primary-hover:   #1558BC;
  --primary-active:  #123263;
  --primary-text:    #FFFFFF;

  --text-primary:    #1D1E26;
  --text-secondary:  #6B6F80;
  --text-muted:      #A0A4B5;

  --good-bg:         #E3FCEF;
  --good-fg:         #006644;
  --ok-bg:           #FFFAE6;
  --ok-fg:           #7A5800;
  --bad-bg:          #FFEBE6;
  --bad-fg:          #BF2600;

  --selected-bg:     #DEEBFF;
  --selected-fg:     #0052CC;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 10px rgba(0,0,0,.08);

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  10px;
  --radius-xl:  14px;
  --radius-full: 999px;

  /* Spacing (8px base unit) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
}

html, body {
  font-family: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont,
               'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header & Nav ────────────────────────────────────────────────────────── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.header-icon { font-size: 24px; line-height: 1; }

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
}
.nav-link {
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover      { background: var(--surface-hover); color: var(--text-primary); }
.nav-link-active     { color: var(--primary); background: var(--selected-bg); }

.header-right { flex-shrink: 0; }

.last-updated {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.last-updated-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.last-updated-time {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Main layout ─────────────────────────────────────────────────────────── */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ── Filter card ─────────────────────────────────────────────────────────── */
.filter-card {
  padding: var(--space-4) var(--space-5);
}

.filter-row {
  display: flex;
  align-items: stretch;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.filter-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.1px;
}

.filter-actions {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}

/* ── Form controls ───────────────────────────────────────────────────────── */
.select,
.input {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);   /* 14px — Loom form field radius */
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  padding: 0 var(--space-3);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236B6F80' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  min-width: 90px;
}

.select:focus,
.input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(24, 104, 219, 0.15);
}

.input-prefix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 12px;
  color: var(--text-secondary);
  font-size: 15px;
  pointer-events: none;
}

.input-prefix-wrap .input {
  padding-left: 24px;
  width: 120px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  height: 38px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);   /* 8px — Loom button radius */
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
}
.btn-primary:hover  { background: var(--primary-hover); }
.btn-primary:active { background: var(--primary-active); }

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover  { background: var(--surface-hover); }
.btn-secondary:active { background: var(--border); }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Table card ──────────────────────────────────────────────────────────── */
.table-card {
  overflow: hidden;
  padding: 0;
}
.table-header-row {
  padding: 12px 20px 0;
}
.game-count {
  font-size: 12px;
  color: var(--text-muted);
}

.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
}

/* Custom scrollbar (Loom-style slim) */
.table-wrap::-webkit-scrollbar       { width: 6px; height: 6px; }
.table-wrap::-webkit-scrollbar-track { background: var(--bg); }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Table ───────────────────────────────────────────────────────────────── */
#main-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

#main-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

#main-table th {
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
  line-height: 1.4;
}

#main-table th.col-center { text-align: center; }
#main-table th.col-rank   { text-align: center; width: 64px; }

#main-table th .col-sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Sortable heading */
#main-table th.sortable {
  cursor: pointer;
}
#main-table th.sortable:hover {
  background: var(--surface-hover);
  color: var(--primary);
}
#main-table th.sortable::after {
  content: '';
  display: inline-block;
  margin-left: 4px;
  opacity: 0;
  transition: opacity 0.1s;
}
#main-table th.sortable:hover::after { content: ' ↕'; opacity: 0.5; }
#main-table th.active.asc::after     { content: ' ↑'; opacity: 1; color: var(--primary); }
#main-table th.active.desc::after    { content: ' ↓'; opacity: 1; color: var(--primary); }
#main-table th.active { color: var(--primary); background: var(--selected-bg); }

/* Table rows */
#main-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
}

#main-table tbody tr:last-child td { border-bottom: none; }

#main-table tbody tr:hover td { background: var(--surface-hover); }

#main-table td.col-center { text-align: center; }
#main-table td.col-rank   { text-align: center; color: var(--text-muted); font-weight: 600; }

/* EV semantic row colours */
#main-table tbody tr.row-good td { background: var(--good-bg); color: var(--good-fg); }
#main-table tbody tr.row-ok   td { background: var(--ok-bg);   color: var(--ok-fg);   }
#main-table tbody tr.row-bad  td { background: var(--bad-bg);  color: var(--bad-fg);  }

#main-table tbody tr.row-good:hover td { filter: brightness(0.97); }
#main-table tbody tr.row-ok:hover   td { filter: brightness(0.97); }
#main-table tbody tr.row-bad:hover  td { filter: brightness(0.97); }

/* Game name cell */
.game-name {
  font-weight: 500;
  color: var(--text-primary);
}

.game-num {
  font-size: 13px;
  color: var(--text-muted);
  display: block;
  margin-top: 1px;
}

/* Price badge */
.price-badge {
  display: inline-block;
  border-radius: var(--radius-full);
  padding: 3px 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1px;
}

/* $1–$2  — green */
.price-tier-low  { background: #E3FCEF; color: #006644; }
/* $3–$10 — blue */
.price-tier-mid  { background: #DEEBFF; color: #0052CC; }
/* $20+   — purple */
.price-tier-high { background: #EAE6FF; color: #403294; }

/* ── States ───────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

.loading-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-8);
  color: var(--text-secondary);
  font-size: 16px;
  min-height: 200px;
}

/* Loom-style spinner */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.error-state { color: var(--bad-fg); }
.error-icon  { font-size: 34px; }

/* ── Bottom bar ───────────────────────────────────────────────────────────── */
.bottom-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
}

.legend {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.legend-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.legend-chip {
  display: inline-block;
  border-radius: var(--radius-full);
  padding: 4px 13px;
  font-size: 13px;
  font-weight: 500;
}
.chip-good { background: var(--good-bg); color: var(--good-fg); }
.chip-ok   { background: var(--ok-bg);   color: var(--ok-fg);   }
.chip-bad  { background: var(--bad-bg);  color: var(--bad-fg);  }

.footnote {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── How to use tip ──────────────────────────────────────────────────────── */
.how-to-tip {
  background: var(--selected-bg);
  border: 1px solid #BDD3FF;
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  flex: 7;
  min-width: 220px;
}
.how-to-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-3);
}
.how-to-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-left: var(--space-4);
  margin: 0;
}
.how-to-list li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.how-to-list li strong { color: var(--text-primary); }
.how-to-note {
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ── Price histogram + dual range slider (Zillow style) ──────────────────── */
.range-group {
  flex: 5;
  min-width: 260px;
  max-width: 420px;
}

/* Histogram */
.histogram {
  display: flex;
  align-items: flex-end;
  height: 72px;
  gap: 3px;
  padding: 0 9px;        /* 9px = half thumb width — aligns bars with thumb centres */
  margin-bottom: 0;
}

.hist-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-height: 4px;
  transition: background 0.2s;
}
.hist-bar.in-range  { background: var(--primary); }
.hist-bar.out-range { background: #C8D4EA; }
.hist-bar:hover     { filter: brightness(1.15); cursor: default; }

/* Histogram tooltip */
.hist-tooltip {
  position: fixed;
  background: var(--text-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  pointer-events: none;
  white-space: nowrap;
  z-index: 999;
  transform: translateX(-50%) translateY(-100%);
  margin-top: -8px;
  box-shadow: var(--shadow-md);
}
/* Little arrow pointing down */
.hist-tooltip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: var(--text-primary) transparent transparent;
}
.hist-tooltip.hidden { display: none !important; }

/* Slider sits flush against the bottom of the histogram */
.dual-range {
  position: relative;
  height: 20px;
  margin: 0;
}

.dual-range-track {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  pointer-events: none;
}

.dual-range-fill {
  position: absolute;
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: left 0.04s, width 0.04s;
}

.range-thumb {
  position: absolute;
  width: 100%;
  height: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  outline: none;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
}

.range-thumb::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--surface);
  box-shadow: 0 1px 6px rgba(0,0,0,0.25);
  cursor: grab;
  pointer-events: all;
  transition: transform 0.12s, box-shadow 0.12s;
  z-index: 2;
}
.range-thumb::-webkit-slider-thumb:hover  { transform: scale(1.15); box-shadow: 0 0 0 5px rgba(24,104,219,0.15); }
.range-thumb::-webkit-slider-thumb:active { cursor: grabbing; box-shadow: 0 0 0 7px rgba(24,104,219,0.2); }
.range-thumb::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); border: 3px solid var(--surface);
  box-shadow: 0 1px 6px rgba(0,0,0,0.25); cursor: grab; pointer-events: all;
}

/* Tick labels — padded to match histogram/thumb alignment */
.range-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 9px;
  margin-top: 6px;
  margin-bottom: 16px;
}
.range-ticks span {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  width: 0;
  overflow: visible;
  white-space: nowrap;
}

/* Combined pill input */
.range-pill {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.range-pill:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(24, 104, 219, 0.15);
}

.range-pill-half {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 8px 14px 8px 14px;
  gap: 2px;
}

.range-pill-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.range-pill-input-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
}

.range-pill-prefix {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

.range-pill-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  width: 100%;
  padding: 0;
  -moz-appearance: textfield;
}
.range-pill-input::-webkit-inner-spin-button,
.range-pill-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.range-pill-divider {
  width: 1.5px;
  background: var(--border);
  flex-shrink: 0;
  margin: 6px 0;
}

/* ── Ticket thumbnail ────────────────────────────────────────────────────── */
.ticket-thumb {
  width: 52px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: zoom-in;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
  display: block;
}
.ticket-thumb:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-md);
}
.ticket-thumb-placeholder {
  width: 52px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-hover);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox.hidden { display: none !important; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.lightbox-box {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  padding: 24px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: lb-in 0.18s ease;
}

@keyframes lb-in {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.lightbox-close:hover {
  background: var(--bad-bg);
  color: var(--bad-fg);
  border-color: var(--bad-fg);
}

.lightbox-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  padding-right: 24px;
}

.lightbox-img {
  max-width: min(560px, 85vw);
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  display: block;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .main { padding: var(--space-3); }
  .header-inner { padding: 0 var(--space-3); gap: var(--space-2); height: 56px; }
  .nav-logo-text { font-size: 16px; }
  .nav-links { gap: var(--space-1); }
  .nav-link { font-size: 12px; padding: 6px 8px; }
  .last-updated { display: none; }

  .princeton-banner { padding: 12px 14px; gap: var(--space-2); }
  .princeton-banner-text { font-size: 13px; }
  .princeton-banner-link { font-size: 12px; }
  .princeton-banner-emoji { font-size: 18px; }

  .filter-card { padding: var(--space-3); }
  .filter-row { flex-direction: column; gap: var(--space-3); }
  .range-group { min-width: unset; max-width: 100%; width: 100%; }
  .how-to-tip { min-width: unset; max-width: 100%; width: 100%; }

  .filter-actions { margin-left: 0; width: 100%; }
  .btn { flex: 1; justify-content: center; }
  .form-row { flex-direction: column; }
  .page-hero-title { font-size: 24px; }
  .page-hero-subtitle { font-size: 14px; }

  .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 12px; min-width: 700px; }

  .footer-inner { flex-direction: column; text-align: center; gap: var(--space-2); }

  .card { border-radius: var(--radius-md); }
  .section-card { padding: var(--space-4); }
}

@media (max-width: 480px) {
  .main { padding: var(--space-2); }
  .header-inner { padding: 0 var(--space-2); }
  .header-icon { font-size: 20px; }
  .nav-logo-text { font-size: 15px; }
  .princeton-banner-text { font-size: 12px; }
  .filter-card { padding: var(--space-2); }
  .how-to-list { font-size: 12px; }
  .how-to-note { font-size: 10px; }
  table { font-size: 11px; }
}

/* ── State tabs ─────────────────────────────────────────────────────────── */
.state-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.state-tab {
  padding: 8px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.state-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #EFF4FF;
}
.state-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ── Princeton banner (home page) ───────────────────────────────────────── */
.princeton-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: linear-gradient(135deg, #1a1f6e 0%, #2a3eb1 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  text-decoration: none;
  transition: filter 0.15s;
  flex-wrap: wrap;
}
.princeton-banner:hover { filter: brightness(1.08); }
.princeton-banner-emoji { font-size: 22px; flex-shrink: 0; }
.princeton-banner-text  {
  flex: 1;
  font-size: 15px;
  color: rgba(255,255,255,0.92);
  line-height: 1.5;
}
.princeton-banner-text strong { color: #fff; font-weight: 700; }
.princeton-banner-link {
  font-size: 14px;
  font-weight: 600;
  color: #93C5FD;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Princeton section (about page) ─────────────────────────────────────── */
.princeton-card {
  border-color: #C7D2FE;
  background: linear-gradient(160deg, #EEF2FF 0%, #fff 60%);
}
.princeton-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.princeton-tag {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #4F46E5;
  background: #E0E7FF;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}
.princeton-quote {
  border-left: 3px solid #4F46E5;
  margin: 4px 0;
  padding: 12px 20px;
  background: #EEF2FF;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 16px;
  font-style: italic;
  color: #3730A3;
  line-height: 1.7;
}
.princeton-quote cite {
  display: block;
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  color: #6366F1;
  margin-top: 8px;
}
.princeton-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #4F46E5;
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid #C7D2FE;
  border-radius: var(--radius-md);
  background: #fff;
  transition: background 0.15s;
}
.princeton-source:hover { background: #EEF2FF; }

/* ── Inner pages (About / Contact) ──────────────────────────────────────── */
.page-main {
  max-width: 780px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.page-hero {
  text-align: center;
  padding: var(--space-6) 0 var(--space-2);
}
.page-hero-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}
.page-hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 400;
}

.page-section {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.page-section-icon { font-size: 28px; line-height: 1; }
.page-section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.page-section-body {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.75;
}
.page-section-body strong { color: var(--text-primary); }

/* Steps */
.page-steps { display: flex; flex-direction: column; gap: var(--space-5); }
.page-step {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.step-body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* About chips */
.about-chips { display: flex; flex-direction: column; gap: var(--space-3); }
.about-chip {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 1.6;
}
.about-chip strong { display: block; font-size: 15px; margin-bottom: 4px; }
.about-chip p { margin: 0; }
.about-chip.chip-good { background: var(--good-bg);  color: var(--good-fg); }
.about-chip.chip-ok   { background: var(--ok-bg);   color: var(--ok-fg);  }
.about-chip.chip-bad  { background: var(--bad-bg);  color: var(--bad-fg); }

/* ── Contact form ─────────────────────────────────────────────────────────── */
.contact-card { max-width: 100%; }
.contact-form { display: flex; flex-direction: column; gap: var(--space-5); }

.form-row {
  display: flex;
  gap: var(--space-4);
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}
.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.form-input {
  width: 100%;
  height: 44px;
  font-size: 15px;
}
.form-textarea {
  height: 130px !important;
  resize: vertical;
  padding-top: 10px !important;
}
.btn-full { width: 100%; justify-content: center; height: 46px; font-size: 16px; }

.contact-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--text-primary);
}
.contact-success-icon { font-size: 40px; }
.contact-success h3   { font-size: 22px; font-weight: 700; }
.contact-success p    { font-size: 16px; color: var(--text-secondary); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: var(--space-8);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}
.footer-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.footer-tagline {
  font-size: 14px;
  color: var(--text-secondary);
}
.footer-links {
  display: flex;
  gap: var(--space-5);
}
.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}
.footer-links a:hover { color: var(--primary); }
.footer-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.6;
}
