    :root {
      --bg: #f8fafc;
      --surface: #ffffff;
      --surface-muted: #f1f5f9;
      --primary: #1e3a8a;
      --primary-bright: #2563eb;
      --primary-light: #eff6ff;
      --secondary: #0f766e;
      --secondary-light: #f0fdfa;
      --accent: #b45309;
      --accent-light: #fffbeb;
      --border: #cbd5e1;
      --border-soft: #e2e8f0;
      --text-main: #0f172a;
      --text-muted: #475569;
      --text-soft: #64748b;
      --danger-bg: #fef2f2;
      --danger-border: #fca5a5;
      --danger-text: #991b1b;
      --warning-bg: #fffbeb;
      --warning-border: #fcd34d;
      --warning-text: #92400e;
      --success-bg: #ecfdf5;
      --success-border: #6ee7b7;
      --success-text: #065f46;
      --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
      --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07);
      --shadow-lg: 0 14px 32px rgba(15, 23, 42, 0.14);
      --radius-sm: 6px;
      --radius-md: 10px;
      --radius-lg: 14px;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      background: var(--bg);
      color: var(--text-main);
      line-height: 1.45;
      -webkit-font-smoothing: antialiased;
    }

    .app-shell {
      max-width: 1360px;
      margin: 0 auto;
      padding: 1.25rem 1.25rem 3.5rem;
    }

    /* Header & Brand */
    .top-header {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      margin-bottom: 1.15rem;
      padding-bottom: 1rem;
      border-bottom: 1px solid var(--border-soft);
    }
    .brand-block {
      display: flex;
      align-items: center;
      gap: 0.85rem;
    }
    .brand-logo {
      width: 46px;
      height: 46px;
      flex-shrink: 0;
      filter: drop-shadow(0 2px 4px rgba(30, 58, 138, 0.15));
    }
    .brand-title {
      font-size: 1.4rem;
      font-weight: 800;
      color: var(--primary);
      letter-spacing: -0.02em;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      flex-wrap: wrap;
    }
    .verified-pill {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      font-size: 0.7rem;
      font-weight: 700;
      padding: 0.18rem 0.55rem;
      border-radius: 999px;
      background: var(--success-bg);
      color: var(--success-text);
      border: 1px solid var(--success-border);
      letter-spacing: 0.01em;
    }
    .brand-subtitle {
      font-size: 0.84rem;
      color: var(--text-muted);
      margin-top: 0.15rem;
      max-width: 720px;
    }

    .header-actions {
      display: flex;
      align-items: center;
      gap: 0.55rem;
      flex-wrap: wrap;
    }
    .cockpit-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      padding: 0.5rem 0.85rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text-main);
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
      box-shadow: var(--shadow-sm);
      transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    }
    .cockpit-btn:hover {
      border-color: var(--primary-bright);
      background: var(--primary-light);
      transform: translateY(-1px);
    }
    .cockpit-btn.primary {
      background: var(--primary);
      color: #fff;
      border-color: var(--primary);
    }
    .cockpit-btn.primary:hover {
      background: #172e6e;
    }
    .count-pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 20px;
      height: 20px;
      padding: 0 5px;
      border-radius: 999px;
      font-size: 0.7rem;
      font-weight: 800;
      background: rgba(255, 255, 255, 0.22);
      color: inherit;
    }
    .cockpit-btn:not(.primary) .count-pill {
      background: var(--primary-light);
      color: var(--primary);
    }

    /* Personal Stats Fit Checker Bar */
    .fit-cockpit {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 0.85rem 1.05rem;
      margin-bottom: 1.15rem;
      box-shadow: var(--shadow-sm);
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 0.85rem;
    }
    .fit-inputs {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.85rem;
    }
    .fit-title {
      font-size: 0.76rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--primary);
      display: flex;
      align-items: center;
      gap: 0.35rem;
    }
    .stat-field {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--text-muted);
    }
    .stat-field input, .stat-field select {
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.32rem 0.55rem;
      font-size: 0.82rem;
      font-weight: 600;
      color: var(--text-main);
      background: var(--bg);
      outline: none;
      width: 78px;
      transition: border-color 0.15s, box-shadow 0.15s;
    }
    .stat-field select { width: 122px; }
    .stat-field input:focus, .stat-field select:focus {
      border-color: var(--primary-bright);
      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
      background: #fff;
    }
    .fit-summary {
      display: flex;
      align-items: center;
      gap: 0.55rem;
      flex-wrap: wrap;
      font-size: 0.78rem;
    }
    .fit-chip {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      padding: 0.22rem 0.6rem;
      border-radius: 999px;
      font-weight: 700;
      font-size: 0.73rem;
    }
    .fit-target { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
    .fit-reach { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
    .fit-ineligible { background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-border); }
    .fit-neutral { background: var(--surface-muted); color: var(--text-muted); border: 1px solid var(--border); }

    /* Spotlight Card */
    .spotlight-card {
      background: #eff6ff;
      border: 1.5px solid #60a5fa;
      border-radius: var(--radius-lg);
      padding: 1.15rem 1.25rem;
      margin-bottom: 1.25rem;
      box-shadow: var(--shadow-md);
      position: relative;
      overflow: hidden;
      animation: fadeSlideUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .spotlight-header {
      display: flex;
      flex-wrap: wrap;
      align-items: flex-start;
      justify-content: space-between;
      gap: 0.75rem;
    }
    .badge-top {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      background: var(--primary-bright);
      color: #fff;
      font-size: 0.7rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      padding: 0.22rem 0.6rem;
      border-radius: 999px;
      margin-bottom: 0.45rem;
    }
    .spotlight-title {
      font-size: 1.15rem;
      color: #1e3a8a;
      font-weight: 800;
      margin-bottom: 0.2rem;
    }
    .spotlight-sub {
      font-size: 0.83rem;
      color: #1e40af;
    }
    .grid-details {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
      gap: 0.65rem;
      margin-top: 0.75rem;
      background: rgba(255, 255, 255, 0.92);
      padding: 0.8rem;
      border-radius: var(--radius-md);
      border: 1px solid #bfdbfe;
    }
    .grid-item { font-size: 0.82rem; }
    .grid-label {
      font-weight: 700;
      color: var(--text-soft);
      display: block;
      font-size: 0.68rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      margin-bottom: 0.15rem;
    }
    .grid-value { font-weight: 700; color: var(--text-main); }
    .guarantee-box {
      margin-top: 0.7rem;
      font-size: 0.82rem;
      line-height: 1.45;
      color: #1e3a8a;
    }

    /* Interactive Analytics Strip */
    .viz-section {
      margin-bottom: 1.25rem;
    }
    .viz-toggle-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 0.6rem;
    }
    .viz-grid {
      display: grid;
      grid-template-columns: 1.45fr 1fr;
      gap: 1rem;
    }
    @media (max-width: 920px) {
      .viz-grid { grid-template-columns: 1fr; }
    }
    .viz-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 0.95rem 1.05rem;
      box-shadow: var(--shadow-sm);
    }
    .viz-card-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      margin-bottom: 0.65rem;
    }
    .viz-card-title {
      font-size: 0.88rem;
      font-weight: 800;
      color: var(--text-main);
    }
    .viz-card-sub {
      font-size: 0.74rem;
      color: var(--text-soft);
    }
    .chart-wrap {
      position: relative;
      width: 100%;
    }
    .chart-tooltip {
      position: absolute;
      pointer-events: none;
      background: rgba(15, 23, 42, 0.95);
      color: #fff;
      padding: 0.45rem 0.65rem;
      border-radius: 6px;
      font-size: 0.74rem;
      line-height: 1.35;
      box-shadow: var(--shadow-md);
      opacity: 0;
      transition: opacity 0.12s ease;
      z-index: 20;
      max-width: 240px;
    }
    .dist-bars {
      display: flex;
      flex-direction: column;
      gap: 0.7rem;
      margin-top: 0.35rem;
    }
    .dist-row-label {
      display: flex;
      justify-content: space-between;
      font-size: 0.76rem;
      font-weight: 700;
      color: var(--text-muted);
      margin-bottom: 0.25rem;
    }
    .dist-track {
      height: 12px;
      border-radius: 999px;
      background: var(--surface-muted);
      overflow: hidden;
      display: flex;
    }
    .dist-seg {
      height: 100%;
      transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .legend-row {
      display: flex;
      flex-wrap: wrap;
      gap: 0.65rem;
      margin-top: 0.55rem;
      font-size: 0.72rem;
      color: var(--text-muted);
    }
    .legend-dot {
      display: inline-block;
      width: 9px;
      height: 9px;
      border-radius: 50%;
      margin-right: 4px;
    }

    /* Animated Navigation Tabs */
    .tab-nav-wrap {
      position: relative;
      border-bottom: 2px solid var(--border-soft);
      margin-bottom: 1rem;
      overflow-x: auto;
      scrollbar-width: none;
    }
    .tab-nav-wrap::-webkit-scrollbar { display: none; }
    .tab-nav {
      display: flex;
      flex-wrap: wrap;
      gap: 0.15rem;
      position: relative;
    }
    .tab-btn {
      background: none;
      border: none;
      border-bottom: 2.5px solid transparent;
      padding: 0.58rem 0.65rem;
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--text-muted);
      cursor: pointer;
      border-radius: 8px 8px 0 0;
      transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      white-space: nowrap;
    }
    .tab-btn:hover { color: var(--primary); background: rgba(239, 246, 255, 0.6); }
    .tab-btn.active { color: var(--primary); border-bottom-color: var(--primary-bright); background: rgba(239, 246, 255, 0.7); }
    .tab-count {
      font-size: 0.68rem;
      font-weight: 800;
      padding: 0.1rem 0.42rem;
      border-radius: 999px;
      background: var(--surface-muted);
      color: var(--text-muted);
    }
    .tab-btn.active .tab-count {
      background: var(--primary-light);
      color: var(--primary);
    }
    .tab-indicator {
      position: absolute;
      bottom: 0;
      left: 0;
      height: 3px;
      background: var(--primary-bright);
      border-radius: 3px 3px 0 0;
      transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
      pointer-events: none;
    }

    .tab-content { display: none; }
    .tab-content.active {
      display: block;
      animation: fadeSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    /* Controls Panel */
    .controls-panel {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 0.75rem 1rem;
      margin-bottom: 1rem;
      box-shadow: var(--shadow-sm);
    }
    .filter-group {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.45rem;
    }
    .filter-label {
      font-size: 0.72rem;
      font-weight: 800;
      color: var(--text-soft);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-right: 0.15rem;
    }
    .filter-btn {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.35rem 0.7rem;
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .filter-btn:hover { background: var(--surface-muted); color: var(--text-main); }
    .filter-btn.active {
      background: var(--primary);
      border-color: var(--primary);
      color: #fff;
    }
    .search-box {
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.38rem 0.7rem;
      font-size: 0.8rem;
      outline: none;
      min-width: 200px;
      background: var(--bg);
      transition: border-color 0.15s, background 0.15s;
    }
    .search-box:focus { border-color: var(--primary-bright); background: #fff; }

    .right-controls {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.85rem;
    }

    /* Toggle Switch */
    .toggle-wrapper {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      font-size: 0.79rem;
      font-weight: 700;
      color: var(--text-main);
      cursor: pointer;
      user-select: none;
    }
    .toggle-switch {
      position: relative;
      display: inline-block;
      width: 42px;
      height: 22px;
    }
    .toggle-switch input { opacity: 0; width: 0; height: 0; }
    .slider {
      position: absolute;
      cursor: pointer;
      inset: 0;
      background: #cbd5e1;
      transition: 0.25s;
      border-radius: 22px;
    }
    .slider:before {
      position: absolute;
      content: "";
      height: 16px;
      width: 16px;
      left: 3px;
      bottom: 3px;
      background: #fff;
      transition: 0.25s;
      border-radius: 50%;
    }
    input:checked + .slider { background: var(--secondary); }
    input:checked + .slider:before { transform: translateX(20px); }

    .view-segmented {
      display: inline-flex;
      background: var(--surface-muted);
      border-radius: var(--radius-sm);
      padding: 2px;
      border: 1px solid var(--border-soft);
    }
    .view-seg-btn {
      border: none;
      background: transparent;
      padding: 0.28rem 0.6rem;
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--text-muted);
      border-radius: 4px;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .view-seg-btn.active {
      background: var(--surface);
      color: var(--primary);
      box-shadow: var(--shadow-sm);
    }

    /* Tables */
    .table-container {
      overflow-x: auto;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      box-shadow: var(--shadow-sm);
    }
    table {
      width: 100%;
      border-collapse: collapse;
      text-align: left;
      font-size: 0.82rem;
    }
    thead {
      background: var(--surface-muted);
      color: var(--text-muted);
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    th, td {
      padding: 0.75rem 0.85rem;
      border-bottom: 1px solid var(--border-soft);
      vertical-align: top;
      line-height: 1.38;
    }
    tbody tr {
      transition: background-color 0.14s ease;
    }
    tbody tr.anim-row {
      animation: fadeSlideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    tbody tr:last-child td { border-bottom: none; }
    tbody tr:hover td { background: #f8fafc; }
    tbody tr.row-pinned td:first-child {
      border-left: 3px solid var(--primary-bright);
    }
    .route-pill {
      display: inline-block;
      padding: 0.14rem 0.45rem;
      border-radius: 4px;
      font-size: 0.68rem;
      font-weight: 800;
      margin-top: 3px;
      white-space: nowrap;
    }
    .route-pill-direct { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
    .route-pill-bridge { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
    .route-pill-cond { background: #f3e8ff; color: #6b21a8; border: 1px solid #d8b4fe; }
    .route-pill-guar { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
    tr.ml-row-bridge td { background: rgba(236, 253, 245, 0.38); }
    tr.ml-row-bridge td:first-child { border-left: 4px solid #059669; }
    tr.ml-row-cond td { background: rgba(243, 232, 255, 0.35); }
    tr.ml-row-cond td:first-child { border-left: 4px solid #7c3aed; }
    tr.ml-row-guar td { background: rgba(255, 251, 235, 0.42); }
    tr.ml-row-guar td:first-child { border-left: 4px solid #d97706; }

    .info-tip-wrap {
      position: relative;
      display: inline-flex;
      align-items: center;
      margin-left: 4px;
      vertical-align: middle;
    }
    .info-icon-btn {
      width: 17px;
      height: 17px;
      border-radius: 50%;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--primary);
      font-size: 0.66rem;
      font-weight: 800;
      font-style: italic;
      font-family: Georgia, serif;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.14s ease;
    }
    .info-icon-btn:hover, .info-tip-wrap.open .info-icon-btn {
      background: var(--primary);
      border-color: var(--primary);
      color: #ffffff;
    }
    .info-popover {
      display: none;
      position: absolute;
      bottom: calc(100% + 6px);
      left: 50%;
      transform: translateX(-50%);
      width: 230px;
      background: #0f172a;
      color: #ffffff;
      font-size: 0.72rem;
      font-weight: 500;
      line-height: 1.38;
      padding: 0.5rem 0.65rem;
      border-radius: 6px;
      box-shadow: var(--shadow-lg);
      z-index: 40;
      pointer-events: none;
    }
    .info-tip-wrap:hover .info-popover,
    .info-tip-wrap.open .info-popover {
      display: block;
    }

    /* Card Grid View */
    .cards-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
      gap: 0.9rem;
    }
    .nav-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 0.95rem 1rem;
      box-shadow: var(--shadow-sm);
      display: flex;
      flex-direction: column;
      gap: 0.6rem;
      transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
      animation: fadeSlideUp 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .nav-card:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-md);
      border-color: #94a3b8;
    }
    .nav-card.is-pinned {
      border-color: var(--primary-bright);
      box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2), var(--shadow-sm);
    }
    .card-top {
      display: flex;
      align-items: flex-start;
      gap: 0.65rem;
    }
    .crest-badge {
      width: 38px;
      height: 38px;
      flex-shrink: 0;
    }
    .logo-badge-wrap {
      width: 40px;
      height: 40px;
      flex-shrink: 0;
      border-radius: 8px;
      background: #ffffff;
      border: 1px solid var(--border-soft);
      padding: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: var(--shadow-sm);
      overflow: hidden;
    }
    .logo-img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
    }
    .strategy-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
      gap: 1rem;
    }
    .strategy-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 1rem 1.1rem;
      box-shadow: var(--shadow-sm);
      animation: fadeSlideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .strategy-card h3 {
      font-size: 0.94rem;
      font-weight: 800;
      color: var(--primary);
      margin-bottom: 0.65rem;
      padding-bottom: 0.45rem;
      border-bottom: 1px solid var(--border-soft);
    }
    .strategy-list {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 0.45rem;
      font-size: 0.81rem;
      color: var(--text-muted);
    }
    .strategy-list li strong { color: var(--text-main); }
    .gpa-split-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.7rem;
      margin-bottom: 0.7rem;
    }
    .gpa-split-box {
      background: var(--bg);
      border: 1px solid var(--border-soft);
      border-radius: var(--radius-sm);
      padding: 0.65rem 0.75rem;
      font-size: 0.79rem;
    }
    .gpa-split-box.do-adv {
      border-color: #99f6e4;
      background: #f0fdfa;
    }
    .card-title-wrap { flex: 1; min-width: 0; }
    .card-meta-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.35rem;
      margin-top: 0.25rem;
    }
    .card-body {
      font-size: 0.8rem;
      color: var(--text-muted);
      line-height: 1.42;
    }
    .card-metrics {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
      background: var(--bg);
      padding: 0.55rem 0.65rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border-soft);
      font-size: 0.77rem;
    }
    .card-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.45rem;
      padding-top: 0.45rem;
      border-top: 1px solid var(--border-soft);
      margin-top: auto;
    }

    /* Entity & Crest Inline Layout */
    .entity-cell {
      display: flex;
      align-items: flex-start;
      gap: 0.6rem;
    }
    .entity-program { font-size: 0.87rem; font-weight: 800; color: var(--primary); display: block; }
    .entity-school { font-size: 0.87rem; font-weight: 800; color: var(--secondary); display: block; }
    .entity-sub { font-size: 0.75rem; color: var(--text-muted); display: block; margin-top: 1px; }
    .entity-location { font-size: 0.72rem; color: var(--text-soft); display: block; margin-top: 1px; font-style: italic; }

    /* Tags & Badges */
    .tag {
      display: inline-block;
      padding: 0.14rem 0.45rem;
      border-radius: 4px;
      font-size: 0.69rem;
      font-weight: 800;
      white-space: nowrap;
    }
    .tag-md { background: #e0e7ff; color: #3730a3; }
    .tag-do { background: #ccfbf1; color: #0f766e; }
    .tag-waived { background: #dcfce7; color: #166534; }
    .tag-accredited { background: #dcfce7; color: #166534; }
    .tag-candidate { background: #fef3c7; color: #92400e; }
    .tag-proposed { background: #f1f5f9; color: #475569; }
    .tag-public { background: #e0f2fe; color: #0369a1; }
    .tag-private { background: #f3e8ff; color: #6b21a8; }

    .cost-col { font-weight: 800; color: #047857; white-space: nowrap; }
    .cost-medschool { font-weight: 800; color: #b45309; white-space: nowrap; }
    .cost-label-sub { font-size: 0.7rem; font-weight: 500; color: var(--text-soft); display: block; margin-top: 1px; }
    .date-badge { display: inline-block; background: #fef3c7; color: #92400e; font-weight: 700; font-size: 0.72rem; padding: 0.15rem 0.45rem; border-radius: 4px; }
    .matric-badge { display: inline-block; background: #dcfce7; color: #166534; font-weight: 700; font-size: 0.72rem; padding: 0.15rem 0.45rem; border-radius: 4px; }

    .risk-badge {
      display: inline-block;
      padding: 0.18rem 0.45rem;
      border-radius: 4px;
      font-size: 0.69rem;
      font-weight: 800;
      text-transform: uppercase;
      margin-bottom: 0.28rem;
    }
    .risk-high { background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-border); }
    .risk-med { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
    .risk-low { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
    .catch-title { font-weight: 800; color: #991b1b; display: block; margin-bottom: 0.2rem; }
    .caveat-text { font-size: 0.78rem; color: #334155; }
    .warning-text { color: #b45309; font-weight: 700; }

    /* Action Buttons inside rows/cards */
    .mini-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      padding: 0.24rem 0.5rem;
      border-radius: 5px;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text-muted);
      font-size: 0.72rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.14s ease;
    }
    .mini-btn:hover { border-color: var(--primary-bright); color: var(--primary); background: var(--primary-light); }
    .mini-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
    .mini-btn.compare-active { background: var(--secondary); border-color: var(--secondary); color: #fff; }
    .action-stack {
      display: flex;
      flex-wrap: wrap;
      gap: 0.32rem;
      margin-top: 0.35rem;
    }

    /* Interactive Timeline Stepper */
    .timeline-viz-box {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 1rem;
      margin-bottom: 1.15rem;
      box-shadow: var(--shadow-sm);
    }
    .stepper-container {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
      gap: 0.75rem;
      margin-top: 0.85rem;
    }
    .stepper-card {
      background: var(--bg);
      border: 1px solid var(--border);
      border-top: 4px solid var(--primary);
      border-radius: var(--radius-sm);
      padding: 0.85rem;
      cursor: pointer;
      transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    }
    .stepper-card:hover, .stepper-card.active {
      transform: translateY(-2px);
      box-shadow: var(--shadow-md);
      border-top-color: var(--primary-bright);
      background: var(--primary-light);
    }
    .stepper-phase { font-size: 0.7rem; text-transform: uppercase; font-weight: 800; color: var(--primary); }
    .stepper-title { font-size: 0.9rem; font-weight: 800; color: var(--text-main); margin: 0.2rem 0; }
    .stepper-desc { font-size: 0.77rem; color: var(--text-muted); line-height: 1.38; }

    /* Callouts */
    .callout {
      margin-top: 1rem;
      padding: 0.85rem 1rem;
      border-radius: var(--radius-sm);
      font-size: 0.82rem;
      line-height: 1.45;
    }
    .callout-blue { background: #eff6ff; border-left: 4px solid #3b82f6; color: #1e40af; }
    .callout-amber { background: #fffbeb; border-left: 4px solid #f59e0b; color: #92400e; }
    .callout-red { background: #fef2f2; border-left: 4px solid #ef4444; color: #991b1b; }

    /* Slide-over Drawers & Modal */
    .drawer-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
      backdrop-filter: blur(2px);
      z-index: 90;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.24s ease;
    }
    .drawer-backdrop.open { opacity: 1; pointer-events: auto; }

    .drawer {
      position: fixed;
      top: 0;
      right: 0;
      height: 100vh;
      width: min(540px, 95vw);
      background: var(--surface);
      box-shadow: var(--shadow-lg);
      z-index: 100;
      transform: translateX(102%);
      transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
      display: flex;
      flex-direction: column;
    }
    .drawer.wide { width: min(860px, 96vw); }
    .drawer.open { transform: translateX(0); }
    .drawer-head {
      padding: 1rem 1.2rem;
      border-bottom: 1px solid var(--border-soft);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
    }
    .drawer-title { font-size: 1.05rem; font-weight: 800; color: var(--primary); }
    .drawer-body {
      padding: 1rem 1.2rem;
      overflow-y: auto;
      flex: 1;
    }
    .close-btn {
      border: 1px solid var(--border);
      background: var(--bg);
      border-radius: 6px;
      padding: 0.28rem 0.6rem;
      font-size: 0.82rem;
      font-weight: 700;
      cursor: pointer;
      color: var(--text-muted);
    }
    .close-btn:hover { background: var(--surface-muted); color: var(--text-main); }

    .note-textarea {
      width: 100%;
      min-height: 82px;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.55rem 0.7rem;
      font-family: inherit;
      font-size: 0.81rem;
      resize: vertical;
      margin-top: 0.35rem;
    }
    .checklist-item {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.38rem 0;
      font-size: 0.81rem;
      border-bottom: 1px dashed var(--border-soft);
      cursor: pointer;
    }
    .checklist-item:last-child { border-bottom: none; }

    .compare-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 0.85rem;
    }
    .compare-col {
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 0.85rem;
      background: var(--bg);
    }
    .compare-row {
      padding: 0.42rem 0;
      border-bottom: 1px solid var(--border-soft);
      font-size: 0.78rem;
    }
    .compare-row:last-child { border-bottom: none; }
    .compare-label { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; color: var(--text-soft); display: block; }

    .empty-state {
      text-align: center;
      padding: 2.2rem 1rem;
      color: var(--text-soft);
      font-size: 0.86rem;
    }

    .footer-sources {
      margin-top: 2rem;
      padding-top: 1rem;
      border-top: 1px solid var(--border-soft);
      font-size: 0.75rem;
      color: var(--text-soft);
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      gap: 0.75rem;
    }

    @keyframes fadeSlideUp {
      from { opacity: 0; transform: translateY(8px); }
      to { opacity: 1; transform: translateY(0); }
    }

    @media (max-width: 640px) {
      .app-shell { padding: 0.85rem 0.75rem 3rem; }
      .brand-title { font-size: 1.15rem; }
      .search-box { min-width: 100%; }
    }

/* Dark Mode */
[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-muted: #334155;
  --primary: #60a5fa;
  --primary-bright: #3b82f6;
  --primary-light: #1e3a8a;
  --secondary: #2dd4bf;
  --secondary-light: #134e4a;
  --accent: #fbbf24;
  --accent-light: #451a03;
  --border: #475569;
  --border-soft: #334155;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-soft: #94a3b8;
  --danger-bg: #450a0a;
  --danger-border: #991b1b;
  --danger-text: #fecaca;
  --warning-bg: #451a03;
  --warning-border: #92400e;
  --warning-text: #fde68a;
  --success-bg: #064e3b;
  --success-border: #065f46;
  --success-text: #a7f3d0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 32px rgba(0, 0, 0, 0.5);
}

/* Sticky table headers & responsive pinned first column */
.table-container {
  max-height: 72vh;
  overflow: auto;
}
.table-container thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-muted);
}
@media (max-width: 900px) {
  .table-container th:first-child,
  .table-container td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--surface);
    box-shadow: 2px 0 6px rgba(15, 23, 42, 0.08);
  }
  .table-container thead th:first-child {
    z-index: 4;
    background: var(--surface-muted);
  }
}

/* Header Controls & Model Freshness Badge */
.header-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.freshness-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Setting Badge Hover Popup */
.setting-tip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
}

.setting-tip-popup {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 240px;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.72rem;
  line-height: 1.35;
  font-weight: 500;
  white-space: normal;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 60;
}

.setting-tip-wrap:hover .setting-tip-popup,
.setting-tip-wrap:focus-within .setting-tip-popup {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.freshness-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}
.freshness-dot.stale {
  background: #f59e0b;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  cursor: pointer;
}
.btn-icon:hover {
  background: var(--surface-muted);
}

/* School Comparison Drawer */
.compare-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--surface);
  border-top: 2px solid var(--primary-bright);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem 1.25rem;
  transform: translateY(100%);
  transition: transform 0.2s ease;
}
.compare-drawer.open {
  transform: translateY(0);
}
.compare-drawer-inner {
  max-width: 1360px;
  margin: 0 auto;
}
.compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.compare-card {
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
}
.compare-card-title {
  font-weight: 700;
  margin-bottom: 0.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sparkline-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Setting Badge Hover Popup */
.setting-tip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
}

.setting-tip-popup {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 240px;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.72rem;
  line-height: 1.35;
  font-weight: 500;
  white-space: normal;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 60;
}

.setting-tip-wrap:hover .setting-tip-popup,
.setting-tip-wrap:focus-within .setting-tip-popup {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}


/* =========================================================================
   WHAT-IF ADMISSIONS EXPLORER & METHODOLOGY TAB
   ========================================================================= */
.whatif-card {
  margin-bottom: 0.75rem;
  padding: 0.9rem 1.05rem;
  background: rgba(239, 246, 255, 0.78);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.whatif-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.whatif-grid {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #dbeafe;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
  align-items: start;
}
.whatif-control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
}
.whatif-seg-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.whatif-result-box {
  margin-top: 0.8rem;
  padding: 0.8rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(240px, 1.4fr);
  gap: 0.9rem;
  align-items: center;
}
@media (max-width: 760px) {
  .whatif-result-box {
    grid-template-columns: 1fr;
  }
}
.whatif-headline {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}
.whatif-plain-odds {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.whatif-ci-bar-wrap {
  position: relative;
  height: 14px;
  background: var(--surface-muted);
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  margin: 0.5rem 0 0.3rem;
  overflow: hidden;
}
.whatif-ci-band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(37, 99, 235, 0.24);
  border-radius: 999px;
}
.whatif-ci-marker {
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 4px;
  background: var(--primary);
  border-radius: 2px;
  transform: translateX(-50%);
}
.whatif-takeaways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.55rem;
}
.whatif-takeaway-item {
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  font-size: 0.75rem;
  line-height: 1.38;
}

/* Methodology & Data Tab */
.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 0.9rem;
  margin-top: 0.75rem;
}
.method-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.method-card h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.method-card p, .method-card li {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.method-card ul {
  padding-left: 1.1rem;
  margin-top: 0.35rem;
}
.method-card li {
  margin-bottom: 0.3rem;
}
.method-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.method-kpi {
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.38rem 0.6rem;
  font-size: 0.75rem;
}
.method-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  background: var(--surface-muted);
  padding: 0.1rem 0.32rem;
  border-radius: 4px;
  border: 1px solid var(--border-soft);
  color: var(--text-main);
}
