/* * Tokens: warm gray canvas, flat cards, hairline borders, scarce pastel accents. Theme via data-theme or OS. */
:root {
  --bg: #eeedea; --surface: #f9f9f8; --ink: #111111; --ink-soft: #5f5e5b; --ink-faint: #8a8985;
  --line: rgba(0, 0, 0, 0.08); --border: rgba(0, 0, 0, 0.12); --border-strong: #cfcdc8; --hover: #f0efec; --key: #f1f0ed;
  --blue-bg: #e1f3fe; --blue-fg: #1f6c9f; --green-bg: #edf3ec; --green-fg: #346538;
  --yellow-bg: #fbf3db; --yellow-fg: #956400; --red-bg: #fdebec; --red-fg: #9f2f2d;
  --sans: "Geist", "SF Pro Display", "Helvetica Neue", "Segoe UI", sans-serif;
  --serif: "Newsreader", "Lyon Text", "Instrument Serif", Georgia, serif;
  --mono: "Geist Mono", "SF Mono", "JetBrains Mono", ui-monospace, monospace;
  --wrap: 980px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413; --surface: #1c1c1b; --ink: #ecebe8; --ink-soft: #a3a29d; --ink-faint: #75746f;
    --line: rgba(255, 255, 255, 0.07); --border: rgba(255, 255, 255, 0.12); --border-strong: #3d3d3b; --hover: #242423; --key: #262625;
    --blue-bg: #1c2833; --blue-fg: #86bde3; --green-bg: #1d2a1e; --green-fg: #8cc790;
    --yellow-bg: #2e2815; --yellow-fg: #d9b25f; --red-bg: #321d1d; --red-fg: #e29b99;
  }
}
:root[data-theme="dark"] {
  --bg: #141413; --surface: #1c1c1b; --ink: #ecebe8; --ink-soft: #a3a29d; --ink-faint: #75746f;
  --line: rgba(255, 255, 255, 0.07); --border: rgba(255, 255, 255, 0.12); --border-strong: #3d3d3b; --hover: #242423; --key: #262625;
  --blue-bg: #1c2833; --blue-fg: #86bde3; --green-bg: #1d2a1e; --green-fg: #8cc790;
  --yellow-bg: #2e2815; --yellow-fg: #d9b25f; --red-bg: #321d1d; --red-fg: #e29b99;
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
main.wrap { padding-bottom: 96px; }
svg.i { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* * Header */
.nav { padding: 22px 0 10px; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; text-decoration: none; }

/* * Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 6px;
  background: var(--surface); color: var(--ink); font: 500 0.84rem var(--sans); text-decoration: none;
  border: 1px solid var(--border); cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease), border-color 0.2s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--hover); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: #111111; color: #ffffff; border-color: #111111; }
.btn-primary:hover:not(:disabled) { background: #333333; }
:root[data-theme="dark"] .btn-primary { background: #ecebe8; color: #111111; border-color: #ecebe8; }
:root[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: #cfcdc9; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary { background: #ecebe8; color: #111111; border-color: #ecebe8; }
  :root:not([data-theme="light"]) .btn-primary:hover:not(:disabled) { background: #cfcdc9; }
}
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

kbd {
  font: 500 0.72rem var(--mono); padding: 1px 6px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--key); color: var(--ink-soft);
}

/* * Theme control + mobile drawer (mirrors the owaishbhada.com header) */
.nav-inner { gap: 14px; }
.brand { margin-right: auto; }
.theme-btn { padding: 6px 11px; font-size: 0.8rem; color: var(--ink-soft); }
.theme-btn:hover:not(:disabled) { color: var(--ink); }
.theme-btn svg.i { width: 16px; height: 16px; }

.nav-toggle {
  display: none; align-items: center; justify-content: center; width: 36px; height: 36px; border: none;
  background: transparent; color: var(--ink); cursor: pointer; border-radius: 6px;
}
.nav-toggle:hover { background: var(--hover); }
.nav-toggle svg.i { width: 20px; height: 20px; }

.nav-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 199;
  opacity: 0; transition: opacity 0.25s var(--ease);
}
.nav-backdrop.open { display: block; opacity: 1; }

.nav-mobile {
  display: flex; flex-direction: column; padding: 8px 20px 24px;
  position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 84vw); background: var(--bg);
  border-left: 1px solid var(--border); box-shadow: -12px 0 32px rgba(0, 0, 0, 0.15);
  z-index: 200; overflow-y: auto; transform: translateX(100%); visibility: hidden;
  transition: transform 0.25s var(--ease), visibility 0s linear 0.25s;
}
.nav-mobile.open { transform: translateX(0); visibility: visible; transition: transform 0.25s var(--ease); }
.nav-mobile-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 2px 22px; }
.nav-mobile-title { font: 500 0.72rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.nav-mobile-close {
  display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: none;
  background: none; color: var(--ink); cursor: pointer; border-radius: 6px; transition: background 0.15s var(--ease);
}
.nav-mobile-close:hover { background: var(--hover); }
.nav-mobile-close svg.i { width: 18px; height: 18px; }
.nav-mobile-section { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.nav-mobile-label { display: block; margin-bottom: 12px; font: 500 0.68rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }

.theme-seg { display: flex; gap: 3px; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 9px; padding: 3px; }
.theme-seg-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 4px; border: none;
  border-radius: 6px; background: none; color: var(--ink-soft); font: 500 0.8rem var(--sans); cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.theme-seg-btn svg.i { width: 15px; height: 15px; }
.theme-seg-btn:hover { color: var(--ink); }
.theme-seg-btn.active { background: var(--ink); color: var(--bg); }

@media (max-width: 720px) {
  .nav-inner > .theme-btn { display: none; }
  .nav-toggle { display: flex; }
}

/* * Header email, drawer extras, footer links, static pages */
.nav-links { display: flex; gap: 22px; }
.nav-links a { font: 500 0.84rem var(--sans); color: var(--ink-soft); text-decoration: none; }
.nav-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.nav-mobile-links { display: flex; flex-direction: column; padding-top: 6px; padding-bottom: 6px; }
.nav-mobile-links a { padding: 11px 2px; text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--line); }
.nav-mobile-links a:last-child { border-bottom: none; }

.prose { max-width: 66ch; }
.prose section { padding: 22px 0; border-top: 1px solid var(--line); }
.prose section:first-child { border-top: none; padding-top: 0; }
.prose .section { margin-bottom: 8px; }
.prose p { margin: 0 0 10px; color: var(--ink-soft); }
.prose p:last-child { margin-bottom: 0; }
.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.prose a:hover { text-decoration-color: var(--ink); }
.prose ul { margin: 0; padding-left: 18px; color: var(--ink-soft); }
.prose li { margin-bottom: 8px; }
.prose li strong { color: var(--ink); font-weight: 600; }
.contact-card { max-width: 66ch; margin-bottom: 36px; }
.contact-mail { display: inline-block; font: 400 clamp(1.25rem, 4.5vw, 1.9rem)/1.2 var(--serif); letter-spacing: -0.02em; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--border-strong); word-break: break-all; }
.contact-mail:hover { text-decoration-color: var(--ink); }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
@media (max-width: 720px) { .nav-links { display: none; } }

/* * Home intro (same layout as the owaishbhada.com intro: round picture on the left, text on the right) */
.intro { display: grid; grid-template-columns: 190px 1fr; gap: 40px; align-items: start; margin: 28px 0 72px; }
.intro-photo {
  width: 190px; aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden; border: 1px solid var(--border);
  background: #ffffff; animation: intro-in 0.5s var(--ease) both;
}
.intro-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; transform: translateY(8%); }
.intro > div { animation: intro-in 0.5s var(--ease) 0.08s both; }
.intro-hello { font: 400 clamp(2rem, 5vw, 2.9rem)/1.1 var(--serif); letter-spacing: -0.03em; margin: 0 0 18px; }
.intro-bio { margin: 0 0 14px; color: var(--ink-soft); max-width: 58ch; }
.intro-bio b { color: var(--ink); font-weight: 600; }
.intro-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 22px; }
.intro-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 0.9rem; text-decoration: none; }
.intro-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.tiles { margin-bottom: 72px; }
html { scroll-behavior: smooth; }
@keyframes intro-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .intro-photo, .intro > div { animation: none; } html { scroll-behavior: auto; } }
@media (max-width: 640px) {
  .intro { grid-template-columns: 1fr; gap: 20px; margin-bottom: 56px; }
  .intro-photo { width: 120px; }
}

/* * Scholarship tiles and overview */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tile {
  display: flex; flex-direction: column; gap: 8px; padding: 28px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.tile:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); transform: translateY(-1px); }
.tile-label { font: 500 0.68rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.tile-name { font: 400 2.6rem/1 var(--serif); letter-spacing: -0.03em; }
.tile-text { color: var(--ink-soft); font-size: 0.9rem; }
.tile-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 500; font-size: 0.88rem; }
.info-row { display: grid; grid-template-columns: 130px 1fr; gap: 4px 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.card .section + .info-row { margin-top: 6px; }
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-key { color: var(--ink-faint); font: 400 0.8rem var(--mono); padding-top: 2px; }
.info-val { color: var(--ink-soft); }
.ticks { list-style: none; margin: 8px 0 0; padding: 0; }
.ticks li { position: relative; padding: 11px 0 11px 22px; border-bottom: 1px solid var(--line); font-size: 0.92rem; color: var(--ink-soft); }
.ticks li:last-child { border-bottom: none; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); }
.card-foot { margin: 14px 0 0; font-size: 0.8rem; color: var(--ink-faint); }
@media (max-width: 640px) { .info-row { grid-template-columns: 1fr; gap: 0; } .tile { padding: 22px; } }

/* * Expandable sections (accordion) */
.list-card { margin-bottom: 8px; }
.section.about-heading { margin-top: 56px; }
.acc-list { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 28px; margin-bottom: 8px; }
.acc { border-bottom: 1px solid var(--line); }
.acc:last-child { border-bottom: none; }
.acc summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; cursor: pointer;
  list-style: none; font: 500 1rem var(--sans); user-select: none;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary:hover { color: var(--ink); }
.acc-icon { position: relative; width: 12px; height: 12px; flex-shrink: 0; }
.acc-icon::before, .acc-icon::after { content: ""; position: absolute; background: var(--ink-soft); border-radius: 1px; }
.acc-icon::before { left: 0; right: 0; top: 5px; height: 2px; }
.acc-icon::after { top: 0; bottom: 0; left: 5px; width: 2px; transition: transform 0.25s var(--ease); }
.acc[open] .acc-icon::after { transform: scaleY(0); }
.acc-body { padding: 0 0 24px; color: var(--ink-soft); font-size: 0.94rem; max-width: 70ch; }
.acc-body p { margin: 0 0 12px; }
.acc-body p:last-child { margin-bottom: 0; }
.acc-body .info-row:first-child { padding-top: 0; }
.acc-body .ticks { margin-top: 0; }
.acc-body .ticks li:first-child { padding-top: 0; }
.acc-body .ticks li:first-child::before { top: 8px; }
.tracks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px; margin: 8px 0 22px; }
.track-title { margin: 0 0 18px; font: 500 0.68rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--border-strong); }
.t-item { position: relative; padding-bottom: 26px; }
.t-item:last-child { padding-bottom: 0; }
.t-item::before {
  content: ""; position: absolute; left: -26px; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--ink);
}
.t-role { font-weight: 600; font-size: 0.96rem; color: var(--ink); margin-bottom: 2px; }
.t-desc { margin: 0; font-size: 0.88rem; line-height: 1.5; color: var(--ink-soft); max-width: 56ch; }
@media (max-width: 760px) { .tracks { grid-template-columns: 1fr; gap: 32px; } }
.acc-body .acc-foot { margin-top: 14px; font-size: 0.84rem; color: var(--ink-faint); }
@media (max-width: 640px) { .acc-list { padding: 0 18px; } .acc summary { padding: 18px 0; } }

/* * Analytics consent prompt */
.consent {
  position: fixed; z-index: 90; right: 20px; bottom: 20px; width: min(300px, calc(100vw - 40px)); padding: 48px 22px 20px;
  text-align: center; animation: intro-in 0.4s var(--ease) both;
}
/* * The card itself is a layer behind the content, with a round hole cut out of its top edge for the cookie. */
.consent::before {
  content: ""; position: absolute; inset: 0; z-index: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  -webkit-mask: radial-gradient(circle 34px at 50% 0, transparent 33px, #000 34px);
  mask: radial-gradient(circle 34px at 50% 0, transparent 33px, #000 34px);
}
.consent > * { position: relative; z-index: 1; }
.consent-icon {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border); color: var(--ink);
}
.consent-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.consent-title { margin: 0 0 8px; font: 600 1.05rem var(--sans); letter-spacing: -0.01em; color: var(--ink); }
.consent-text { margin: 0 0 16px; font-size: 0.86rem; color: var(--ink-soft); }
.consent-more { color: var(--ink); text-underline-offset: 3px; white-space: nowrap; }
.consent-actions { display: flex; justify-content: center; gap: 8px; }
.consent-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 18px; }
.consent-panel .status { flex-basis: 100%; font: 400 0.8rem var(--mono); color: var(--ink-soft); }
.consent-panel .btn.on { border-color: var(--ink); }
.consent-panel [hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .consent { animation: none; } }
@media (max-width: 640px) { .consent { left: 12px; right: 12px; bottom: 12px; width: auto; } }

/* * Breadcrumb */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 500 0.78rem var(--mono); color: var(--ink-faint); margin: 36px 0 28px; }
.crumbs a { text-decoration: none; color: var(--ink-soft); }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink); }
.crumb-more { position: relative; display: inline-block; }
.crumb-more summary {
  list-style: none; cursor: pointer; padding: 0 7px; border-radius: 4px; color: var(--ink-soft); user-select: none;
  letter-spacing: 0.08em; transition: background 0.15s var(--ease);
}
.crumb-more summary::-webkit-details-marker { display: none; }
.crumb-more summary:hover, .crumb-more[open] summary { background: var(--hover); color: var(--ink); }
.crumb-menu {
  position: absolute; z-index: 60; top: calc(100% + 8px); left: -6px; min-width: 210px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  animation: pop 0.18s var(--ease);
}
.crumb-menu a {
  display: block; padding: 8px 10px 8px calc(10px + var(--depth, 0) * 14px); border-radius: 6px;
  font: 500 0.86rem var(--sans); color: var(--ink); text-decoration: none; white-space: nowrap;
}
.crumb-menu a:hover { background: var(--hover); }

/* * Headings */
.title {
  font: 400 clamp(2rem, 5vw, 2.9rem)/1.1 var(--serif); letter-spacing: -0.03em; margin: 0 0 12px;
}
.lead { color: var(--ink-soft); margin: 0 0 40px; max-width: 52ch; }
.title + .section, .title + .grid-bento { margin-top: 36px; }
.section {
  font: 500 0.72rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 12px;
}

/* * Bento grid on the hub */
.grid-bento { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 72px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px;
  transition: box-shadow 0.2s var(--ease);
}
.card:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }
.card.span-2 { grid-column: span 2; }
.card-big { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; margin-bottom: 72px; }
.sub-label { margin: 26px 0 4px; font: 500 0.68rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.stat { font: 400 3.2rem/1 var(--serif); letter-spacing: -0.04em; }
.stat small { display: block; font: 500 0.72rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-top: 8px; }

/* * Rows: every navigation item and download */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 14px 0; text-decoration: none; font-weight: 500;
  border-bottom: 1px solid var(--line); transition: padding 0.25s var(--ease);
}
.list .row:last-child, .list-card .row:last-child { border-bottom: none; }
.row:hover { padding-left: 6px; }
.row-label { flex: 1; display: inline-flex; align-items: center; gap: 12px; }
.i.brand { width: 20px; height: 20px; flex: none; fill: currentColor; stroke: none; }
.row .row-label svg.i.brand { margin: 0; }
.row-meta { color: var(--ink-faint); font: 400 0.76rem var(--mono); }
.row-arrow { color: var(--ink-faint); display: inline-flex; }
.row:hover .row-arrow { color: var(--ink); }
.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px 24px; }
.list-card .row:hover { padding-left: 6px; }

/* * Tags */
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 9999px; font: 500 0.66rem var(--mono);
  letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; vertical-align: middle;
  background: var(--key); color: var(--ink-soft); border: 1px solid var(--line);
}

/* * Filters */
.filters {
  margin: 0 0 20px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font: 500 0.66rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.field select, .field input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--ink); font: 400 0.88rem var(--sans);
}
.field select:hover, .field input:hover { border-color: var(--ink-faint); }

.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.bar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.count { color: var(--ink-soft); font-size: 0.88rem; }
.count strong { color: var(--ink); font-weight: 600; }
.status { font: 400 0.76rem var(--mono); color: var(--ink-soft); }

/* * Table */
.table-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
.grid { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.grid th {
  text-align: left; padding: 14px 16px; font: 500 0.66rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.grid td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-soft); }
.grid td:first-child { color: var(--ink); }
.grid tbody tr[data-id] { cursor: pointer; transition: background 0.15s var(--ease); }
.grid tbody tr[data-id]:hover, .grid tbody tr[data-id]:focus-visible { background: var(--hover); }
.grid tbody tr:last-child td { border-bottom: none; }
.grid tbody tr:focus-visible { outline: 1px solid var(--border); outline-offset: -1px; }
.dept-link { font-weight: 500; color: var(--ink); text-decoration: none; }
.deg { display: inline-flex; gap: 4px; }
.empty { text-align: center; color: var(--ink-soft); padding: 40px 16px !important; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 24px 0 0; }

/* * Modal (native dialog) */
dialog {
  width: min(700px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
dialog[open] { animation: pop 0.28s var(--ease); }
dialog::backdrop { background: rgba(17, 17, 17, 0.4); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-head h2 { margin: 0; font: 400 1.6rem/1.15 var(--serif); letter-spacing: -0.02em; }
.modal-sub { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.88rem; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.modal-close { display: flex; align-items: center; gap: 8px; }
.modal-body { padding: 4px 28px 28px; overflow-y: auto; }

/* * Search row and advanced filters */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search-row { display: flex; gap: 10px; align-items: stretch; }
.field.grow { flex: 1; }
.search-row input { padding: 12px 14px; font-size: 0.95rem; }
.search-row .btn { padding-left: 20px; padding-right: 20px; }
.adv { margin-top: 14px; }
.adv summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font: 500 0.74rem var(--mono); letter-spacing: 0.04em; color: var(--ink-soft); user-select: none;
}
.adv summary::-webkit-details-marker { display: none; }
.adv summary::before {
  content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform 0.2s var(--ease); margin-right: 2px;
}
.adv[open] summary::before { transform: rotate(45deg); }
.adv summary:hover { color: var(--ink); }
.adv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.adv-note { margin: 14px 0 0; font-size: 0.78rem; color: var(--ink-faint); }

/* * Multi-select dropdowns (progressive enhancement over native selects) */
.combo { position: relative; }
.combo-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 38px; padding: 4px 28px 4px 6px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg); cursor: text; position: relative;
}
.combo-box:hover { border-color: var(--ink-faint); }
.combo-box:focus-within { border-color: var(--ink); }
.combo-box::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border-right: 1.5px solid var(--ink-faint); border-bottom: 1.5px solid var(--ink-faint);
  transform: rotate(45deg); pointer-events: none;
}
.combo-chips { display: contents; }
.chip {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 2px 4px 2px 8px; border-radius: 4px;
  background: var(--key); border: 1px solid var(--line); font-size: 0.78rem; color: var(--ink);
}
.chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.chip-x { display: inline-flex; align-items: center; padding: 1px; border: none; background: none; color: var(--ink-faint); cursor: pointer; border-radius: 3px; }
.chip-x:hover { color: var(--ink); background: var(--hover); }
.chip-x svg.i { width: 12px; height: 12px; }
.field .combo-input {
  flex: 1; min-width: 70px; width: auto; border: none; background: transparent; padding: 5px 4px; outline: none; font-size: 0.86rem;
}
.field .combo-input:hover { border: none; }
.combo-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: min(400px, 86vw);
  max-height: 280px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.combo-list[hidden] { display: none; }
.combo-list li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; font-size: 0.86rem; cursor: pointer; color: var(--ink-soft); }
.combo-list li.active { background: var(--hover); color: var(--ink); }
.combo-list li.selected { color: var(--ink); }
.combo-list li.none { cursor: default; color: var(--ink-faint); }
.tick { width: 14px; height: 14px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 3px; position: relative; }
.combo-list li.selected .tick { background: var(--ink); border-color: var(--ink); }
.combo-list li.selected .tick::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border-right: 1.5px solid var(--bg); border-bottom: 1.5px solid var(--bg); transform: rotate(45deg);
}

/* * Details window: white boxes on a gray canvas, one level of boxes only (nothing nested) */
dialog, dialog:focus, dialog:focus-visible { outline: none; }
dialog { background: var(--bg); }
.modal-head { padding: 26px 28px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 1.85rem; line-height: 1.12; letter-spacing: -0.03em; }
.modal-sub { margin-top: 6px; font-size: 0.92rem; }
.modal-tags { margin-top: 14px; }
.modal-close { border-color: var(--border-strong); background: transparent; color: var(--ink-soft); padding: 6px 10px; }
.modal-close:hover:not(:disabled) { background: var(--hover); }
.modal-body { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px 24px; }
.m-block { padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.m-title { margin: 0 0 6px; font: 500 0.68rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.m-hint { margin: 0 0 6px; font-size: 0.88rem; color: var(--ink-soft); max-width: 56ch; }
.m-row { display: grid; grid-template-columns: 160px 1fr; gap: 4px 20px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.m-block > .m-row:last-child { border-bottom: none; padding-bottom: 0; }
.m-key { color: var(--ink-faint); font: 400 0.8rem var(--mono); padding-top: 2px; }
.m-val { word-break: break-word; white-space: pre-wrap; }
.m-val a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.m-val a:hover { text-decoration-color: var(--ink); }
.m-none { color: var(--ink-faint); }

.m-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.m-degree .m-row { grid-template-columns: 1fr; gap: 2px; }

.ov { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: nowrap; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ov:last-child { border-bottom: none; padding-bottom: 0; }
.ov-info { flex: 1; min-width: 0; }
.ov-name { font-weight: 500; font-size: 0.95rem; }
.ov-meta { margin-top: 2px; font: 400 0.76rem var(--mono); color: var(--ink-faint); }
.ov-actions { display: flex; flex-shrink: 0; gap: 8px; }
@media (max-width: 640px) {
  .modal-head { padding: 20px 18px 16px; }
  .modal-body { padding: 12px 12px 18px; }
  .m-block { padding: 16px; }
  .m-row { grid-template-columns: 1fr; gap: 0; }
  .ov { flex-wrap: wrap; }
  .ov-actions { width: 100%; flex-direction: column; }
  .ov-actions .btn { width: 100%; justify-content: center; }
}

/* * Phones: table becomes a list of stacked rows, details window header stacks */
@media (max-width: 640px) {
  .table-box { overflow: visible; }
  .grid, .grid tbody, .grid tr, .grid td { display: block; }
  .grid thead { display: none; }
  .grid tbody tr { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .grid tbody tr:last-child { border-bottom: none; }
  .grid td { padding: 0; border: none; }
  .grid td:nth-child(2) { order: 1; font-size: 0.95rem; }
  .grid td:nth-child(1) { order: 2; font-size: 0.82rem; color: var(--ink-soft); }
  .grid td:nth-child(3) { order: 3; margin-top: 4px; }
  .grid td.empty { padding: 32px 0 !important; }
  .grid td.hide-sm, .grid td.hide-md { display: none; }
  .bar { align-items: flex-start; }
  .bar-actions { width: 100%; }
  .modal-head { flex-direction: column-reverse; align-items: stretch; gap: 14px; }
  .modal-close { align-self: flex-end; }
  .modal-head h2 { font-size: 1.55rem; }
  dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
}


/* * Scroll entry (only when JS is on) */
.js .reveal { opacity: 0; transform: translateY(12px); }
.js .reveal.in {
  opacity: 1; transform: none; transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: calc(var(--index, 0) * 80ms);
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal.in { opacity: 1; transform: none; transition: none; }
  dialog[open] { animation: none; }
  .row, .row:hover { transition: none; }
}

@media (max-width: 860px) { .hide-md { display: none; } .adv-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .grid-bento { grid-template-columns: 1fr; }
  .card.span-2 { grid-column: auto; }
  .card { padding: 22px; }
  .filters { padding: 16px; }
  .adv-grid { grid-template-columns: 1fr; }
  .search-row .btn { padding-left: 14px; padding-right: 14px; }
  .row-meta { display: none; }
  .modal-head, .modal-body { padding-left: 20px; padding-right: 20px; }
}
