:root {
  color-scheme: light;
  --navy: #17324d;
  --teal: #0f766e;
  --green: #287a3e;
  --amber: #b85f0d;
  --red: #b42318;
  --blue: #2563a8;
  --ink: #17212b;
  --muted: #5d6b78;
  --line: #d9e1e8;
  --line-strong: #bdc9d3;
  --surface: #ffffff;
  --surface-soft: #f4f6f8;
  --teal-soft: #e6f4f1;
  --blue-soft: #eaf2f8;
  --green-soft: #eaf5ec;
  --amber-soft: #fff3e2;
  --red-soft: #fdecec;
  --shadow: 0 10px 30px rgba(23, 50, 77, 0.14);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 14px;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, select, input[type="range"], input[type="checkbox"] { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 168, 0.24);
  outline-offset: 1px;
}

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.app-header {
  min-height: 54px;
  padding: 7px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  background: var(--navy);
  border-bottom: 1px solid #284761;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.38);
  border-radius: 6px;
  color: #fff;
  background: var(--teal);
  font-weight: 800;
}
.brand-copy { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.brand h1 { margin: 0; font-size: 18px; line-height: 1.2; }
.brand p { margin: 0; color: #c8d5df; font-size: 11px; }
.header-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.sync-status { max-width: 132px; display: inline-flex; align-items: center; color: #c8d5df; font-size: 10px; line-height: 1.25; white-space: nowrap; }
.sync-status-connected { color: #9de0d9; }
.sync-status-connecting { color: #f3d39e; }
.sync-status-offline { color: #c8d5df; }

.button, .icon-button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 650;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
.button { padding: 0 12px; }
.icon-button { width: 36px; padding: 0; background: var(--surface); color: var(--ink); border-color: var(--line); }
.button.secondary { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.34); color: #fff; }
.main-content .button.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.button.secondary:hover { background: rgba(255,255,255,0.16); }
.main-content .button.secondary:hover, .icon-button:hover { background: var(--blue-soft); border-color: #aabfce; }
.button.subtle { background: var(--surface); border-color: var(--line); color: var(--muted); }
.button.subtle:hover { color: var(--navy); border-color: var(--line-strong); }
.button.primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.button.primary:hover { background: #0b625c; }
.button.full-width { width: 100%; }

.primary-tabs {
  height: 40px;
  padding: 0 20px;
  display: flex;
  align-items: stretch;
  gap: 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.primary-tab {
  padding: 0 2px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}
.primary-tab:hover { color: var(--ink); }
.primary-tab.active { color: var(--navy); border-bottom-color: var(--teal); }
.tab-count {
  min-width: 24px;
  height: 19px;
  margin-left: 5px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
}
.primary-tab.active .tab-count { background: var(--teal-soft); color: var(--teal); }

.workspace { min-height: calc(100vh - 94px); display: grid; grid-template-columns: 252px minmax(0, 1fr); transition: grid-template-columns 180ms ease; }
.workspace.filters-collapsed { grid-template-columns: 56px minmax(0, 1fr); }
.filter-panel {
  padding: 20px 18px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.filter-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.filter-panel h2 { margin: 0; font-size: 15px; color: var(--navy); }
.desktop-only { display: inline-flex; }

@media (min-width: 761px) {
  .filter-panel.collapsed { padding: 12px 9px; overflow: hidden; }
  .filter-panel.collapsed .filter-panel-header { justify-content: center; margin-bottom: 0; }
  .filter-panel.collapsed .filter-panel-header h2,
  .filter-panel.collapsed > :not(.filter-panel-header) { display: none; }
}
.filter-group { margin-bottom: 15px; }
.filter-group label, .range-label label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.filter-group select, .sort-select, .page-size-control select {
  width: 100%;
  min-height: 36px;
  padding: 0 30px 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}
.advanced-filters {
  margin: 0 0 15px;
  padding: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.advanced-filters summary {
  min-height: 39px;
  display: flex;
  align-items: center;
  color: var(--navy);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.advanced-filters[open] { padding-bottom: 3px; }
.advanced-filters .filter-group:last-child { margin-bottom: 12px; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filter-grid .filter-group { margin-bottom: 0; }
.range-label { display: flex; justify-content: space-between; align-items: center; }
.range-label output { color: var(--navy); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 800; }
.range-group input { width: 100%; accent-color: var(--teal); }
.check-row { min-height: 36px; margin: 2px 0 14px; display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 650; }
.check-row input { width: 16px; height: 16px; accent-color: var(--teal); }

.main-content { min-width: 0; padding: 12px 16px 10px; }
.overview-panel {
  margin-bottom: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.overview-toggle {
  min-height: 34px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.overview-toggle::-webkit-details-marker { display: none; }
.overview-toggle:hover { background: #f8fafb; }
.overview-title { flex: 0 0 auto; color: var(--navy); font-size: 13px; font-weight: 800; }
.overview-compact { min-width: 0; display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; }
.overview-compact span { overflow: hidden; text-overflow: ellipsis; }
.overview-compact b { color: var(--ink); font-weight: 700; }
.overview-state { margin-left: auto; color: var(--muted); font-size: 11px; }
.overview-state-close { display: none; }
.overview-chevron { width: 15px; height: 15px; color: var(--muted); transform: rotate(90deg); transition: transform 160ms ease; }
.overview-panel[open] .overview-toggle { border-bottom: 1px solid var(--line); }
.overview-panel[open] .overview-compact { display: none; }
.overview-panel[open] .overview-state-open { display: none; }
.overview-panel[open] .overview-state-close { display: inline; }
.overview-panel[open] .overview-chevron { transform: rotate(-90deg); }
.summary-strip {
  min-height: 68px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.summary-item { padding: 10px 14px; border-right: 1px solid var(--line); min-width: 0; }
.summary-item:last-child { border-right: 0; }
.summary-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.summary-value { display: flex; align-items: baseline; gap: 7px; color: var(--navy); font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.summary-detail { color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.scope-notice {
  margin: 0;
  padding: 9px 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-left: 4px solid var(--amber);
  background: #fff8ed;
  color: #4d4132;
  line-height: 1.5;
}
.scope-notice strong { flex: 0 0 auto; color: #73440e; font-size: 12px; }
.scope-notice span { font-size: 12px; }

.toolbar {
  min-height: 36px;
  margin-bottom: 5px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.segmented-control { height: 34px; display: inline-grid; grid-auto-flow: column; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; background: var(--surface); }
.segmented-control button { min-width: 84px; padding: 0 12px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 700; }
.segmented-control button:last-child { border-right: 0; }
.segmented-control button.active { color: #fff; background: var(--teal); }
.search-box { height: 34px; min-width: 260px; padding: 0 10px; display: flex; flex: 1 1 320px; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--muted); }
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,168,0.13); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-box input::placeholder { color: #8a98a5; }
.sort-select { width: 190px; }
.toolbar .sort-select, .toolbar .button { min-height: 34px; }
.quick-reset, .favorite-filter-button { white-space: nowrap; }
.favorite-filter-count { min-width: 21px; height: 21px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 11px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.main-content .favorite-filter-button.active { border-color: #e1ae69; background: var(--amber-soft); color: var(--amber); }
.favorite-filter-button.active .icon { fill: currentColor; }
.favorite-filter-button.active .favorite-filter-count { background: #fff; color: var(--amber); }

.active-filter-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; margin-bottom: 5px; }
.active-filter-row:empty { display: none; }
.filter-chip { min-height: 24px; padding: 2px 8px; border: 1px solid #b7cfd0; border-radius: 12px; background: var(--teal-soft); color: #0b625c; font-size: 11px; }
.filter-chip button { margin-left: 4px; padding: 0; border: 0; background: transparent; color: inherit; font-weight: 900; }
.archive-category-strip { margin: 4px 0 8px; padding: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.archive-category-title { margin: 0 4px 0 2px; color: var(--navy); font-size: 12px; font-weight: 800; }
.archive-category-tab { min-height: 30px; padding: 0 8px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 750; }
.archive-category-tab:hover { border-color: var(--line-strong); background: var(--surface-soft); color: var(--ink); }
.archive-category-tab .tab-count { min-width: 20px; height: 19px; margin-left: 0; }
.archive-category-tab.active { border-color: var(--teal); background: var(--teal); color: #fff; }
.archive-category-tab.active .tab-count { background: rgba(255,255,255,0.18); color: #fff; }
.archive-category-tab.archive-category-system-compute.active { border-color: var(--blue); background: var(--blue); }
.archive-category-tab.archive-category-system-wet.active { border-color: #a6532b; background: #a6532b; }
.archive-category-tab.archive-category-system-other.active { border-color: var(--muted); background: var(--muted); }

.results-region { min-height: 320px; }
.results-table-wrap {
  max-height: calc(100vh - 245px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.results-table { width: 100%; min-width: 1390px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.results-table.schools-table { min-width: 1120px; }
.results-table.programs-table { min-width: 1320px; }
.results-table.saved-table { min-width: 1270px; }
.results-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 9px;
  border-bottom: 1px solid #0b625c;
  background: var(--teal);
  color: #fff;
  text-align: left;
  font-size: 11px;
  font-weight: 750;
}
.results-table td { padding: 10px 9px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.results-table tbody tr { background: var(--surface); transition: background-color 110ms ease; }
.results-table tbody tr:nth-child(even) { background: #f8fafb; }
.results-table tbody tr:hover { background: var(--blue-soft); }
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table .star-cell { width: 40px; text-align: center; padding-left: 4px; padding-right: 4px; }
.favorite-star-button { width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center; border: 0; background: transparent; color: #8593a0; }
.favorite-star-button .icon { width: 18px; height: 18px; }
.favorite-star-button.active { color: var(--amber); }
.favorite-star-button.active .icon { fill: currentColor; }
.identity-cell { width: 205px; }
.research-cell { width: 205px; }
.methods-cell { width: 205px; }
.structure-cell { width: 150px; }
.small-cell { width: 68px; }
.score-cell { width: 100px; }
.tier-cell { width: 88px; }
.status-cell { width: 128px; }
.link-cell { width: 240px; }
.verification-cell { width: 135px; }
.program-name-cell { width: 235px; }
.program-direction-cell { width: 180px; }
.program-time-cell { width: 160px; }
.program-requirement-cell { width: 250px; }
.school-name-cell { width: 250px; }
.school-count-cell { width: 150px; }
.school-route-cell { width: 255px; }
.school-method-cell { width: 185px; }
.school-action-cell { width: 175px; }
.name-primary { display: block; color: var(--navy); font-weight: 800; line-height: 1.35; }
.name-primary-link { width: fit-content; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; text-decoration: underline; text-decoration-color: #9bb8cc; text-underline-offset: 3px; }
.name-primary-link:hover { color: var(--blue); text-decoration-color: currentColor; }
.name-link-icon { width: 13px; height: 13px; }
.program-badges { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.name-secondary { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.unit-line {
  margin-top: 5px;
  display: -webkit-box;
  overflow: hidden;
  color: #74818d;
  font-size: 10px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.research-cell .name-secondary,
.methods-cell .cell-text,
.program-direction-cell .cell-text,
.program-requirement-cell .cell-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.cell-text { color: #344553; font-size: 12px; line-height: 1.45; }
.cell-muted { color: var(--muted); font-size: 11px; line-height: 1.4; }
.score-pair { display: grid; gap: 3px; font-variant-numeric: tabular-nums; }
.score-pair strong { color: var(--navy); }
.score-pair span { color: var(--muted); font-size: 10px; }
.badge { min-height: 23px; max-width: 100%; padding: 3px 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; font-size: 11px; font-weight: 750; line-height: 1.2; }
.route-badge { background: var(--blue-soft); color: var(--blue); }
.website-status-badge { margin-top: 6px; }
.website-status-direct { background: var(--green-soft); color: var(--green); }
.website-status-lab { background: var(--blue-soft); color: var(--blue); }
.website-status-directory { background: var(--amber-soft); color: var(--amber); }
.website-status-pending { background: var(--surface-soft); color: var(--muted); }
.tier-main { background: var(--green-soft); color: var(--green); }
.tier-match { background: var(--blue-soft); color: var(--blue); }
.tier-reach { background: var(--amber-soft); color: var(--amber); }
.tier-low { background: var(--surface-soft); color: var(--muted); }
.mouse-none { background: var(--surface-soft); color: var(--muted); }
.mouse-low { background: var(--blue-soft); color: var(--blue); }
.mouse-medium { background: var(--amber-soft); color: var(--amber); }
.mouse-high { background: var(--red-soft); color: var(--red); }
.verify-detailed { background: var(--green-soft); color: var(--green); }
.verify-directory { background: var(--blue-soft); color: var(--blue); }
.verify-pending { background: var(--surface-soft); color: var(--muted); }
.compute-high { background: var(--teal-soft); color: var(--teal); }
.compute-medium { background: var(--blue-soft); color: var(--blue); }
.compute-low { background: var(--surface-soft); color: var(--muted); }
.timing-open { background: var(--green-soft); color: var(--green); }
.timing-watch { background: var(--amber-soft); color: var(--amber); }
.timing-direct { background: var(--blue-soft); color: var(--blue); }
.timing-risk { background: var(--red-soft); color: var(--red); }
.structure-list {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 5px 6px;
  font-size: 10px;
}
.structure-list > span { padding-top: 3px; color: var(--muted); font-weight: 700; }
.structure-list > strong {
  min-width: 0;
  padding: 3px 5px;
  border-radius: 4px;
  color: #344553;
  font-size: 10px;
  line-height: 1.25;
}
.structure-list > strong.compute-high { color: var(--teal); }
.structure-list > strong.compute-medium { color: var(--blue); }
.structure-list > strong.mouse-high { color: var(--red); }
.verification-date, .verification-note { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.verification-note {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.route-stack { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.count-emphasis { color: var(--navy); font-size: 23px; line-height: 1; font-variant-numeric: tabular-nums; }
.table-status { width: 100%; min-height: 32px; padding: 0 24px 0 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 11px; }
.external-link { min-height: 31px; padding: 0 8px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid #a9c4d8; border-radius: 5px; color: var(--blue); background: var(--surface); text-decoration: none; font-size: 11px; font-weight: 750; }
.external-link:hover { background: var(--blue-soft); }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.row-action-note { min-height: 31px; padding: 0 7px; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 750; white-space: nowrap; }
.row-action-button { min-height: 31px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--navy); background: var(--surface); font-size: 11px; font-weight: 750; white-space: nowrap; }
.row-action-button:hover { background: var(--surface-soft); border-color: #9eafbc; }
.link-feedback-button.active, .link-feedback-detail.active { color: var(--amber); border-color: #e1ae69; background: var(--amber-soft); }
.link-feedback-button.active .icon, .link-feedback-detail.active .icon { fill: currentColor; }
.favorite-button.active { border-color: #e1ae69; background: var(--amber-soft); color: var(--amber); }
.favorite-button.active .icon { fill: currentColor; }
.archive-button { color: var(--muted); }
.archive-button:hover { color: var(--navy); background: var(--surface-soft); }
.restore-button { color: var(--green); border-color: #a9cfb0; background: var(--green-soft); }
.restore-button:hover { color: #1f6732; border-color: #8fbd98; background: #dff0e3; }
.archive-badge { background: var(--surface-soft); color: var(--muted); }
.archive-category-manual { background: var(--amber-soft); color: var(--amber); }
.archive-category-system-compute { background: var(--blue-soft); color: var(--blue); }
.archive-category-system-wet { background: #fcefe8; color: #a6532b; }
.archive-category-system-other { background: var(--surface-soft); color: var(--muted); }
.results-table th.star-cell { left: 0; z-index: 4; }
.results-table td.star-cell { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.results-table tbody tr:nth-child(even) td.star-cell { background: #f8fafb; }
.results-table tbody tr:hover td.star-cell { background: var(--blue-soft); }
.results-table th.link-cell { right: 0; z-index: 4; box-shadow: -1px 0 0 rgba(255,255,255,0.24); }
.results-table td.link-cell { position: sticky; right: 0; z-index: 1; background: var(--surface); box-shadow: -1px 0 0 var(--line); }
.results-table tbody tr:nth-child(even) td.link-cell { background: #f8fafb; }
.results-table tbody tr:hover td.link-cell { background: var(--blue-soft); }
.results-table th.school-action-cell { right: 0; z-index: 4; box-shadow: -1px 0 0 rgba(255,255,255,0.24); }
.results-table td.school-action-cell { position: sticky; right: 0; z-index: 1; background: var(--surface); box-shadow: -1px 0 0 var(--line); }
.results-table tbody tr:nth-child(even) td.school-action-cell { background: #f8fafb; }
.results-table tbody tr:hover td.school-action-cell { background: var(--blue-soft); }
.school-mentor-button { color: #fff; border-color: var(--teal); background: var(--teal); }
.school-mentor-button:hover { color: #fff; border-color: #0b625c; background: #0b625c; }

@media (max-width: 1180px) and (min-width: 761px) {
  .segmented-control { width: 100%; }
}

.empty-state { min-height: 310px; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.list-footer { min-height: 52px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.page-size-control { display: flex; align-items: center; gap: 7px; }
.page-size-control select { width: 70px; min-height: 32px; }
.pagination { display: flex; align-items: center; gap: 9px; }
.pagination .icon-button { width: 32px; min-height: 32px; height: 32px; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.data-date { justify-self: end; }

.panel-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(15, 31, 45, 0.34); }
.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(560px, 96vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 180ms ease;
}
.detail-panel.open { transform: translateX(0); }
.detail-header { min-height: 112px; padding: 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; color: #fff; background: var(--navy); }
.detail-header h2 { margin: 5px 0 4px; font-size: 19px; line-height: 1.3; }
.detail-header p { margin: 0; color: #cad7e1; font-size: 12px; }
.detail-header .icon-button { flex: 0 0 auto; color: #fff; background: transparent; border-color: rgba(255,255,255,0.34); }
.eyebrow { color: #9de0d9; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.detail-content { flex: 1; padding: 20px; overflow-y: auto; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.detail-section { padding: 0 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.detail-section:last-child { border-bottom: 0; }
.detail-section h3 { margin: 0 0 12px; color: var(--navy); font-size: 13px; }
.detail-list { margin: 0; display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 9px 12px; }
.detail-list dt { color: var(--muted); font-size: 11px; font-weight: 750; }
.detail-list dd { margin: 0; color: #344553; line-height: 1.5; overflow-wrap: anywhere; }
.compact-detail-list { margin-top: 13px; grid-template-columns: 84px minmax(0, 1fr); }
.evidence-summary-line { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; margin-bottom: 10px; color: var(--muted); font-size: 11px; }
.evidence-note, .evidence-empty { margin: 11px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.evidence-note { padding: 8px 10px; border-left: 3px solid var(--blue); background: #f3f7fa; color: #435564; }
.evidence-list { margin: 13px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.evidence-source { padding: 11px 0; border-bottom: 1px solid var(--line); }
.evidence-source:last-child { border-bottom: 0; padding-bottom: 0; }
.evidence-source-head { display: grid; gap: 4px; }
.evidence-source-head > span { color: var(--muted); font-size: 10px; }
.evidence-source-link { width: fit-content; max-width: 100%; display: inline-flex; align-items: flex-start; gap: 5px; color: var(--blue); font-size: 12px; font-weight: 750; line-height: 1.4; text-decoration: none; overflow-wrap: anywhere; }
.evidence-source-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.evidence-source-link .icon { width: 13px; height: 13px; margin-top: 2px; }
.evidence-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.model-badge { background: var(--blue-soft); color: var(--blue); }
.qualification-badge { background: var(--surface-soft); color: #435564; }
.evidence-excerpt { margin-top: 7px; color: var(--muted); font-size: 10px; }
.evidence-excerpt summary { width: fit-content; color: var(--blue); cursor: pointer; font-weight: 700; }
.evidence-excerpt p { margin: 6px 0 0; line-height: 1.5; overflow-wrap: anywhere; }
.recruitment-source { margin-top: 13px; padding: 10px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.recruitment-source > div { min-width: 0; display: grid; gap: 4px; }
.recruitment-source strong { color: #344553; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.recruitment-source span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.recruitment-source .external-link { flex: 0 0 auto; }
.skill-list { margin-top: 10px; border-top: 1px solid var(--line); }
.skill-evidence { border-bottom: 1px solid var(--line); }
.skill-evidence summary { min-height: 38px; display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.skill-evidence summary::-webkit-details-marker { display: none; }
.skill-evidence summary::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 800; }
.skill-evidence[open] summary::after { content: "−"; }
.skill-badge { background: var(--teal-soft); color: var(--teal); }
.skill-level { color: var(--muted); font-size: 10px; }
.skill-evidence p { margin: 0 0 10px; color: #435564; font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.qualification-row { margin-top: 12px; }
.qualification-row > strong { color: var(--muted); font-size: 11px; }
.organize-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 11px; font-weight: 750; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); }
.field input, .field select { min-height: 38px; padding: 0 9px; }
.field textarea { min-height: 118px; padding: 9px; resize: vertical; line-height: 1.5; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-actions .button.secondary { color: var(--navy); border-color: var(--line-strong); background: var(--surface); }
.favorite-detail.active { color: var(--amber); border-color: #e9bd7d; background: var(--amber-soft); }
.archive-detail.restore-button { color: var(--green); border-color: #a9cfb0; background: var(--green-soft); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 120;
  max-width: min(420px, 90vw);
  padding: 10px 14px;
  border-radius: 6px;
  color: #fff;
  background: #1f3c51;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-only { display: none; }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 220px minmax(0, 1fr); }
  .main-content { padding-left: 14px; padding-right: 14px; }
  .sort-select { width: 170px; }
}

@media (max-width: 760px) {
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none; }
  .app-header { min-height: 0; padding: 12px; align-items: flex-start; flex-wrap: wrap; }
  .brand { width: 100%; }
  .brand-copy { display: block; }
  .brand h1 { font-size: 18px; }
  .brand p { margin-top: 3px; white-space: normal; }
  .header-actions { width: 100%; }
  .header-actions { flex-wrap: wrap; }
  .header-actions .button { flex: 1; }
  .sync-status { width: 100%; max-width: none; justify-content: center; }
  .primary-tabs { height: 46px; padding: 0 12px; gap: 20px; overflow-x: auto; }
  .primary-tab { flex: 0 0 auto; }
  .workspace { display: block; min-height: 0; }
  .filter-panel {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    width: min(340px, 88vw);
    padding: 18px;
    border-right: 0;
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }
  .filter-panel.open { transform: translateX(0); }
  .main-content { padding: 12px; }
  .overview-toggle { gap: 8px; }
  .overview-compact { gap: 9px; }
  .overview-compact span:nth-child(n + 3) { display: none; }
  .overview-state { display: none; }
  .overview-panel[open] .overview-state-close { display: none; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-item { border-bottom: 1px solid var(--line); }
  .summary-item:nth-child(2n) { border-right: 0; }
  .summary-item:nth-last-child(-n + 2) { border-bottom: 0; }
  .toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .segmented-control { grid-column: 1 / -1; width: 100%; }
  .segmented-control button { min-width: 0; }
  #programScope { height: auto; grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  #programScope button { min-height: 38px; padding: 0 6px; font-size: 12px; white-space: nowrap; }
  #programScope button:nth-child(2) { border-right: 0; }
  #programScope button:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .scope-notice { align-items: flex-start; flex-direction: column; gap: 3px; }
  .search-box { grid-column: 1 / -1; }
  .sort-select { grid-column: 1 / -1; width: 100%; }
  .favorite-filter-button { grid-column: 1 / -1; width: 100%; }
  .quick-reset, #openFiltersButton { width: 100%; }
  .results-table-wrap { max-height: none; overflow: visible; border: 0; background: transparent; }
  .results-table, .results-table.mentors-table, .results-table.schools-table, .results-table.programs-table, .results-table.saved-table { min-width: 0; border-collapse: separate; display: block; }
  .results-table thead { display: none; }
  .results-table tbody { display: grid; gap: 10px; }
  .results-table tr { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface) !important; }
  .results-table td { width: auto !important; min-width: 0; padding: 6px 4px; border-bottom: 0; }
  .results-table td::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 750; }
  .results-table .star-cell { position: absolute; top: 7px; right: 7px; left: auto; z-index: 1; background: transparent !important; }
  .results-table .star-cell::before { display: none; }
  .results-table .identity-cell, .results-table .program-name-cell, .results-table .school-name-cell { grid-column: 1 / -1; padding-right: 40px; }
  .results-table .research-cell, .results-table .methods-cell, .results-table .program-direction-cell, .results-table .program-requirement-cell, .results-table .program-time-cell, .results-table .school-route-cell, .results-table .school-method-cell, .results-table .verification-cell { grid-column: 1 / -1; }
  .results-table .status-cell { grid-column: 1 / 2; }
  .results-table .link-cell { position: static; grid-column: 1 / -1; display: block; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); background: transparent !important; box-shadow: none; }
  .results-table .school-action-cell { position: static; grid-column: 1 / -1; display: block; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); background: transparent !important; box-shadow: none; }
  .results-table .link-cell::before { margin-bottom: 6px; }
  .row-actions { width: 100%; }
  .row-actions .row-action-button, .row-actions .external-link { flex: 1; min-height: 38px; }
  .external-link { min-height: 34px; }
  .list-footer { grid-template-columns: 1fr auto; }
  .data-date { grid-column: 1 / -1; justify-self: start; }
  .detail-panel { width: 100%; }
  .detail-header { min-height: 104px; padding: 16px; }
  .detail-content { padding: 16px; }
  .recruitment-source { flex-direction: column; }
  .recruitment-source .external-link { width: 100%; }
  .organize-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
