:root {
  --bg: #F1ECE0;
  --paper: #FBF7EE;
  --paper-2: #F7F2E6;
  --ink: #1B1F1C;
  --ink-2: #3A3F38;
  --ink-3: #6C6F66;
  --ink-4: #9A9B92;
  --rule: #D9D1BE;
  --rule-2: #E6E0CF;
  --forest: #1F3D2E;
  --forest-2: #2E5944;
  --sand: #B68552;
  --clay: #B66A4A;
  --tag-sage-bg: #DDE3CF;   --tag-sage-ink:  #4B5A3D;
  --tag-rose-bg: #E8D3CC;   --tag-rose-ink:  #7A4A40;
  --tag-sand-bg: #E8D8B7;   --tag-sand-ink:  #6E5429;
  --tag-slate-bg:#D2D8DC;   --tag-slate-ink: #3F4A52;
  --tag-moss-bg: #CCD7C6;   --tag-moss-ink:  #3D5340;
  --tag-clay-bg: #E5C9B8;   --tag-clay-ink:  #6A4632;
  --whatsapp: #2E7D5B;
  --linkedin: #2A4D6E;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--paper, #FBF7EE);
  width: 100%;
}
body {
  font-family: 'Figtree', system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
}

/* --- App Container Wrapper --- */
.app-container {
  background: var(--paper, #FBF7EE);
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Removed fixed container margins to allow full-width bleeding on all screen sizes */.page-wrap {
  max-width: 1480px;
  margin: 0 auto;
  padding: 56px 20px 80px;
}

.doc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  padding: 0 8px;
}
.doc-head .t {
  font-family: 'Lora', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.doc-head .s {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.screen-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 56px 8px 18px;
}
.screen-label:first-of-type { margin-top: 8px; }
.screen-label .num {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--forest);
  letter-spacing: 0.04em;
}
.screen-label .t {
  font-family: 'Lora', serif;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.screen-label .rule {
  flex: 1; height: 1px;
  background: linear-gradient(to right, var(--rule), transparent);
}
.screen-label .meta {
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- The "browser" frame for each screen ---------- */
.screen {
  background: var(--bg);
}

/* ---------- Top Nav ---------- */
.nav {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1200;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 18px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: padding, background, box-shadow;
}
.nav.scrolled {
  background: rgba(251, 247, 238, 0.84);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  padding: 13px 36px;
  border-bottom-color: rgba(217, 209, 190, 0.85);
  box-shadow: 0 6px 24px -4px rgba(27, 31, 28, 0.07);
}
.wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.wordmark .yis {
  font-family: 'Lora', serif;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.wordmark .yis em {
  font-style: italic;
  font-weight: 500;
  color: var(--forest);
}
.wordmark .sub {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-4);
  border-left: 1px solid var(--rule);
  padding-left: 10px;
}
.nav-links {
  display: flex;
  gap: 36px;
}
.nav-links a {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  letter-spacing: 0.02em;
  padding: 4px 0;
  position: relative;
}
.nav-links a.active {
  color: var(--forest);
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px;
  background: var(--forest);
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-user .nm {
  font-size: 13px;
  color: var(--ink-2);
}
.nav-user .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #B68552, #8a6238);
  color: #FBF7EE;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ---------- Screen 1: Directory ---------- */
/* ---------- Screen 1: Directory ---------- */
.dir-hero {
  position: relative;
  min-height: 380px;
  padding: 80px 36px 64px;
  background-color: #122119;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.dir-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/images/scholars_group.png');
  background-size: cover;
  background-position: center 30%;
  transform: scale(1);
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  .dir-hero:hover::before {
    transform: scale(1.035);
  }
  .dir-hero:hover .dir-hero-overlay {
    opacity: 0.88;
  }
}
.dir-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(18, 33, 25, 0.82) 0%, rgba(18, 33, 25, 0.65) 45%, rgba(25, 45, 34, 0.28) 80%, rgba(25, 45, 34, 0.08) 100%);
  z-index: 1;
  transition: opacity 0.8s ease;
}
.dir-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 820px;
}
.dir-hero h1 {
  font-family: 'Lora', serif;
  font-weight: 400;
  font-size: 52px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: #ffffff;
}
.dir-hero h1 em {
  font-style: italic;
  color: #8CCC9D;
  font-weight: 400;
}
.dir-hero .lede {
  font-family: 'Figtree', sans-serif;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
  color: #E6E0CF;
  max-width: 640px;
  margin-bottom: 32px;
}

/* Stats Glassmorphic Card */
.hero-stats-card {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  margin-top: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}
.stat-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}
.stat-item .val {
  font-family: 'Lora', serif;
  font-size: 28px;
  font-weight: 400;
  color: #ffffff;
  line-height: 1;
  white-space: nowrap;
}
.stat-item:last-child .val {
  font-size: 23px;
  letter-spacing: -0.01em;
}
.stat-item .lbl {
  font-family: 'Figtree', sans-serif;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.6);
}
.stat-dot {
  color: rgba(255, 255, 255, 0.3);
  font-size: 16px;
  font-weight: 300;
  line-height: 1;
}

.dir-body {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
}
.dir-main {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  overflow: hidden;
}

/* ----- Sidebar ----- */
.sidebar {
  padding: 28px 28px 28px 36px;
  border-right: 1px solid var(--rule);
  background: var(--paper);
}
/* The column stretches the full page height so its background and border never end
   early; only the filter block inside it sticks below the navbar while the cards scroll. */
.sidebar-inner {
  position: -webkit-sticky;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;          /* hide the scrollbar (Firefox); panel still scrolls */
  -ms-overflow-style: none;
}
.sidebar-inner::-webkit-scrollbar { display: none; } /* Chrome, Edge, Safari */
.search {
  position: relative;
  margin-bottom: 28px;
}
.search input {
  width: 100%;
  border: 1px solid var(--rule);
  background: #FBF7EE;
  border-radius: 3px;
  padding: 10px 12px 10px 34px;
  font-size: 13px;
  color: var(--ink-2);
  font-family: inherit;
  letter-spacing: 0.01em;
}
.search svg {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-4);
}
.filter-group {
  border-top: 1px solid var(--rule-2);
  padding: 18px 0 14px;
}
.filter-group:last-child { border-bottom: 1px solid var(--rule-2); }
.filter-group .h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.filter-group .h .chev {
  color: var(--ink-4);
  font-size: 9px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
  padding: 5px 0;
  cursor: pointer;
}
.check .box {
  width: 14px; height: 14px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: #FBF7EE;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.check.on .box {
  background: var(--forest);
  border-color: var(--forest);
}
.check.on .box::after {
  content: '';
  width: 4px; height: 7px;
  border: solid #FBF7EE;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
.check .ct {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.check .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check.on .lbl { color: var(--ink); font-weight: 500; }

.clear-btn {
  margin-top: 16px;
  font-size: 12px;
  color: var(--forest);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--forest);
  padding-bottom: 1px;
}

/* ----- Main grid ----- */
.dir-main {
  padding: 28px 36px 40px;
}
.dir-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.dir-toolbar .l {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Roster Eyebrow & Live Presence Indicator */
.roster-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  padding: 6px 14px;
  border-radius: 20px;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.roster-eyebrow.mode-switching {
  opacity: 0.35;
  transform: translateY(-2px);
}
.live-pulse-dot {
  width: 7px;
  height: 7px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-presence 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
  flex-shrink: 0;
}
@keyframes pulse-presence {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}
.eyebrow-tag {
  font-family: 'Figtree', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
}
.eyebrow-sep {
  color: var(--ink-4);
  font-size: 11px;
}
.dir-toolbar .res {
  font-size: 12.5px;
  color: var(--ink-2);
}
.dir-toolbar .res strong {
  color: var(--ink);
  font-weight: 600;
}
.chip-row {
  display: flex;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 4px 8px 4px 10px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-2);
}
.chip .x {
  color: var(--ink-4);
  font-size: 13px;
  line-height: 1;
}
.sort {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 22px 20px 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease;
  will-change: transform, box-shadow;
}

/* Staggered cascading entrance */
.card:not(.skeleton-card) {
  animation: cardEntrance 0.35s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.card:not(.skeleton-card):nth-child(1) { animation-delay: 20ms; }
.card:not(.skeleton-card):nth-child(2) { animation-delay: 40ms; }
.card:not(.skeleton-card):nth-child(3) { animation-delay: 60ms; }
.card:not(.skeleton-card):nth-child(4) { animation-delay: 80ms; }
.card:not(.skeleton-card):nth-child(5) { animation-delay: 100ms; }
.card:not(.skeleton-card):nth-child(6) { animation-delay: 120ms; }
.card:not(.skeleton-card):nth-child(7) { animation-delay: 140ms; }
.card:not(.skeleton-card):nth-child(8) { animation-delay: 160ms; }
.card:not(.skeleton-card):nth-child(9) { animation-delay: 180ms; }
.card:not(.skeleton-card):nth-child(10) { animation-delay: 200ms; }
.card:not(.skeleton-card):nth-child(11) { animation-delay: 220ms; }
.card:not(.skeleton-card):nth-child(12) { animation-delay: 240ms; }

/* Desktop Hover: Spring lift & forest-tinted ambient shadow */
@media (hover: hover) and (pointer: fine) {
  .card:not(.skeleton-card):hover {
    transform: translateY(-5px);
    border-color: var(--forest);
    box-shadow: 0 14px 28px -8px rgba(31, 61, 46, 0.12),
                0 4px 10px -2px rgba(27, 31, 28, 0.04);
  }
  .card:not(.skeleton-card):hover .avatar-photo.has-img img {
    transform: scale(1.06);
  }
  .card:not(.skeleton-card):hover .avatar-photo:not(.has-img) {
    transform: scale(1.04);
    box-shadow: 0 0 0 2px rgba(31, 61, 46, 0.2);
  }
}

/* Mobile Touch: Crisp tactile press-down without sticky hover */
@media (hover: none) {
  .card:not(.skeleton-card):active {
    transform: scale(0.985);
    border-color: var(--forest);
  }
}

/* --- Skeleton Loaders (Warm Editorial Parchment Shimmer) --- */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  pointer-events: none;
  background: var(--paper-2);
  border-color: var(--rule-2);
}
.skeleton {
  background: linear-gradient(90deg, #EFE9DC 20%, #FDFBF6 50%, #EFE9DC 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
  border-radius: 4px;
}
.sk-avatar { width: 56px; height: 56px; border-radius: 50%; margin-bottom: 16px; }
.sk-title { width: 60%; height: 20px; margin-bottom: 8px; }
.sk-text { width: 85%; height: 14px; margin-bottom: 6px; }
.sk-text-short { width: 45%; height: 14px; margin-bottom: 24px; }
.sk-tags { display: flex; gap: 6px; margin-bottom: 24px; }
.sk-tag { width: 50px; height: 22px; border-radius: 2px; }
.sk-foot { width: 40px; height: 14px; margin-top: auto; }

.card .cohort {
  position: absolute;
  top: 16px; right: 16px;
  font-family: 'Figtree', sans-serif;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-3);
  text-align: right;
}

.avatar-photo {
  width: 64px; height: 64px;
  border-radius: 50%;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Lora', serif;
  font-size: 22px;
  color: var(--paper);
  letter-spacing: 0.02em;
  background: var(--ink-2);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}
.avatar-photo.a1 { background: linear-gradient(135deg, #4B5A3D, #2E3D24); }
.avatar-photo.a2 { background: linear-gradient(135deg, #7A4A40, #5A2E25); }
.avatar-photo.a3 { background: linear-gradient(135deg, #6E5429, #4A3815); }
.avatar-photo.a4 { background: linear-gradient(135deg, #3F4A52, #1F2A34); }
.avatar-photo.a5 { background: linear-gradient(135deg, #3D5340, #1F3D2E); }
.avatar-photo.a6 { background: linear-gradient(135deg, #6A4632, #3E2818); }
.avatar-photo.a7 { background: linear-gradient(135deg, #56607a, #2F3A52); }
.avatar-photo.a8 { background: linear-gradient(135deg, #8a6238, #5A3F1F); }

/* Photo avatar — show actual headshot */
.avatar-photo.has-img {
  padding: 0;
  overflow: hidden;
  font-size: 0;
  color: transparent;
}
.avatar-photo.has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card .nm {
  font-family: 'Lora', serif;
  font-size: 18px;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.005em;
  margin: 0 0 4px;
}
.card .role {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.45;
  margin-bottom: 14px;
  min-height: 36px;
}
.card .role .org {
  color: var(--ink-2);
  font-weight: 500;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 18px;
}
.tag {
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 2px;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.tag.sage  { background: var(--tag-sage-bg);  color: var(--tag-sage-ink); }
.tag.rose  { background: var(--tag-rose-bg);  color: var(--tag-rose-ink); }
.tag.sand  { background: var(--tag-sand-bg);  color: var(--tag-sand-ink); }
.tag.slate { background: var(--tag-slate-bg); color: var(--tag-slate-ink); }
.tag.moss  { background: var(--tag-moss-bg);  color: var(--tag-moss-ink); }
.tag.clay  { background: var(--tag-clay-bg);  color: var(--tag-clay-ink); }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--rule-2);
  margin-top: auto;
}
.card-foot .loc {
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 5px;
}
.icon-btns {
  display: flex;
  gap: 6px;
}
.icon-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-2);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.icon-btn:hover { 
  background: var(--rule); 
}
.icon-btn.wa:hover { 
  color: white; 
  background: var(--whatsapp); 
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(46, 125, 91, 0.3);
}
.icon-btn.li:hover { 
  color: white; 
  background: #0A66C2; /* Authentic LinkedIn Blue */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 102, 194, 0.35);
}/* ---------- View Toggle (Archival Perspective Switcher) ---------- */
.dir-toolbar {
  position: relative;
  z-index: 20;
}
.dir-toolbar .r {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 21;
}
.view-toggle {
  display: inline-flex;
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  border-radius: 26px;
  padding: 3px;
  gap: 2px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  position: relative;
  overflow: visible;
  z-index: 22;
}

/* Kinetic Sliding Highlight Pill (Magnetic Indicator) */
.view-slider-pill {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 0;
  background: var(--forest);
  border-radius: 22px;
  box-shadow: 0 2px 8px rgba(31, 61, 46, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  will-change: transform, width;
}
.view-toggle.has-slider .view-slider-pill {
  opacity: 1;
}

.view-toggle button {
  position: relative;
  z-index: 2;
  font-family: 'Figtree', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  background: transparent;
  border: none;
  padding: 7px 15px;
  border-radius: 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: color 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
}
.view-toggle button:hover:not(.on) {
  color: var(--forest);
}
.view-toggle button:active {
  transform: scale(0.97);
}

/* Fallback static background if JS has not attached slider */
.view-toggle:not(.has-slider) button.on {
  background: var(--forest);
  box-shadow: 0 2px 8px rgba(31, 61, 46, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.view-toggle button.on {
  color: var(--paper);
  font-weight: 600;
}
.view-toggle button .view-ic {
  display: inline-block;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.view-toggle button:hover .view-ic,
.view-toggle button.on .view-ic {
  opacity: 1;
}
.view-toggle button.on:hover .view-ic {
  transform: scale(1.08);
}
.view-toggle button .view-label {
  display: inline-block;
  white-space: nowrap;
}

/* Buttery Instant Perspective Cross-Fade */
@keyframes perspectiveDissolve {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.view-animate-enter {
  animation: perspectiveDissolve 0.16s ease-out forwards;
}

/* Perspective Summary Popover Card */
.view-popover {
  position: absolute;
  top: calc(100% + 8px);
  width: 250px;
  background: rgba(27, 31, 28, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 14px 34px -4px rgba(0, 0, 0, 0.4), 0 4px 10px rgba(0, 0, 0, 0.2);
  color: #FAF8F5;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 100 !important;
  white-space: normal;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.18s;
}

/* Perspective Views - strictly lower stacking level */
.dir-main .grid,
.dir-main .map-view,
.dir-main .graph-view,
.map-frame {
  position: relative;
  z-index: 1;
}

/* Micro directional arrow on popover */
.view-popover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid rgba(27, 31, 28, 0.96);
}

/* Precise popover alignment for each view button */
.view-toggle button[data-view="cards"] .view-popover {
  left: 0;
  transform: translateY(6px);
}
.view-toggle button[data-view="cards"] .view-popover::before {
  left: 26px;
}

.view-toggle button[data-view="map"] .view-popover {
  left: 50%;
  transform: translateX(-50%) translateY(6px);
}
.view-toggle button[data-view="map"] .view-popover::before {
  left: 50%;
  transform: translateX(-50%);
}

.view-toggle button[data-view="graph"] .view-popover {
  right: 0;
  left: auto;
  transform: translateY(6px);
}
.view-toggle button[data-view="graph"] .view-popover::before {
  right: 28px;
  left: auto;
}

/* Hover reveal on desktop */
@media (hover: hover) and (pointer: fine) {
  .view-toggle button:hover .view-popover {
    opacity: 1;
    visibility: visible;
  }
  .view-toggle button[data-view="cards"]:hover .view-popover {
    transform: translateY(0);
  }
  .view-toggle button[data-view="map"]:hover .view-popover {
    transform: translateX(-50%) translateY(0);
  }
  .view-toggle button[data-view="graph"]:hover .view-popover {
    transform: translateY(0);
  }
}

/* Popover Internal Typography */
.vp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.vp-badge {
  font-family: 'Figtree', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #34D399;
}
.vp-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #34D399;
  opacity: 0.8;
}
.vp-title {
  display: block;
  font-family: 'Lora', Georgia, serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #FAF8F5;
  margin-bottom: 3px;
  line-height: 1.25;
}
.vp-desc {
  display: block;
  font-family: 'Figtree', sans-serif;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(250, 248, 245, 0.72);
  font-weight: 400;
}

/* Ensure mobile touches never trigger sticky popovers */
@media (hover: none) or (max-width: 768px) {
  .view-popover {
    display: none !important;
  }
}

/* Map view container — sibling of .grid inside .dir-main */
.dir-main .map-view { display: none; }
.dir-main.is-map .grid { display: none; }
.dir-main.is-map .map-view { display: block; }

.map-frame {
  position: relative;
  background: #0E1110;
  border: 1px solid #1F2220;
  border-radius: 6px;
  overflow: hidden;
  height: 620px;
}

/* View indicator (top-left) */
.map-indicator {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(241, 236, 224, 0.95);
  backdrop-filter: blur(6px);
  padding: 6px 14px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-family: 'Figtree', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #555;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
}
.map-indicator.active { color: var(--forest); }
.map-indicator .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #999;
}
.map-indicator.active .dot {
  background: var(--forest);
  box-shadow: 0 0 6px rgba(60,80,50,0.4);
}

/* Reset button */
.map-reset {
  position: absolute;
  top: 12px; right: 60px;
  background: rgba(241, 236, 224, 0.95);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0,0,0,0.08);
  color: var(--ink-2);
  font-family: 'Figtree', sans-serif;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.02em;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all .2s;
}
.map-reset:hover { background: var(--paper); border-color: var(--forest); color: var(--forest); }

/* Map legend */
.map-legend {
  position: absolute;
  bottom: 12px; left: 12px;
  background: rgba(241, 236, 224, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0,0,0,0.06);
  color: var(--ink-3);
  font-family: 'Figtree', sans-serif;
  font-size: 10.5px;
  padding: 10px 14px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.map-legend .row { display: flex; align-items: center; gap: 8px; }
.map-legend .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.map-legend .dot.cluster {
  width: 14px; height: 14px;
  background: #3C5032;
  border: 2px solid rgba(90, 122, 74, 0.5);
}
.map-legend .dot.single {
  background: #B8860B;
  box-shadow: 0 0 6px rgba(184, 134, 11, 0.4);
}

/* Loading */
.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  color: rgba(220, 210, 185, 0.5);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: #0E1110;
  z-index: 30;
  transition: opacity .4s;
}
.map-loading.hide { opacity: 0; pointer-events: none; }
.map-loading .spinner {
  width: 24px; height: 24px;
  border: 1.5px solid rgba(139, 204, 168, 0.2);
  border-top-color: #8BCCA8;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Mapbox popup styling */
.scholar-popup .mapboxgl-popup-content {
  background: var(--paper);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 12px 40px -8px rgba(0,0,0,0.4);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.scholar-popup .mapboxgl-popup-close-button {
  font-size: 18px;
  color: var(--ink-4);
  padding: 4px 10px;
  right: 2px;
  top: 2px;
}
.scholar-popup .mapboxgl-popup-close-button:hover {
  color: var(--ink);
  background: transparent;
}
.scholar-popup .mapboxgl-popup-tip {
  border-top-color: var(--paper);
}
.scholar-popup-inner {
  padding: 16px 18px 14px;
  font-family: 'Figtree', sans-serif;
}

/* Leaflet popup styling (identical to Mapbox) */
.scholar-popup.leaflet-popup-custom .leaflet-popup-content-wrapper {
  background: var(--paper);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 0;
}
.scholar-popup.leaflet-popup-custom .leaflet-popup-content {
  margin: 0;
}
.scholar-popup.leaflet-popup-custom .leaflet-popup-tip {
  background: var(--paper);
}
.scholar-popup.leaflet-popup-custom .leaflet-popup-close-button {
  color: #888;
  font-size: 16px;
  padding: 8px 12px;
  font-family: Arial, sans-serif;
}
.scholar-popup.leaflet-popup-custom .leaflet-popup-close-button:hover {
  color: var(--ink);
  background: transparent;
}

/* Stat bar under map */
.map-stats {
  margin-top: 14px;
  padding: 13px 22px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 22px;
}
.map-stats .it {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.map-stats .n {
  font-family: 'Lora', serif;
  font-size: 17px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--forest);
  line-height: 1;
}
.map-stats .sep {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--rule);
}

/* ---------- Screen 2: Asks & Offers Board ---------- */
.board-hero {
  padding: 36px 36px 28px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.board-hero h1 {
  font-family: 'Lora', serif;
  font-weight: 500;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--ink);
}
.board-hero h1 em {
  font-style: italic;
  color: var(--forest);
  font-weight: 500;
}
.board-hero .lede {
  font-size: 14px;
  color: var(--ink-3);
  max-width: 580px;
  line-height: 1.55;
}
.board-hero .tabs {
  display: flex;
  gap: 6px;
}
.board-hero .tab {
  font-size: 12px;
  padding: 7px 14px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.board-hero .tab.on {
  background: var(--forest);
  color: var(--paper);
  border-color: var(--forest);
}

.board-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg);
}
.board-col {
  padding: 28px 36px 56px;
}
.board-col + .board-col {
  border-left: 1px solid var(--rule);
}
.col-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-2);
}
.col-head .t {
  font-family: 'Lora', serif;
  font-size: 22px;
  font-style: italic;
  color: var(--ink);
}
.col-head .ct {
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.col-head.asks .t::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--clay);
  margin-right: 10px;
  transform: translateY(-3px);
}
.col-head.offers .t::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--forest);
  margin-right: 10px;
  transform: translateY(-3px);
}

.post {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 20px 22px;
  margin-bottom: 14px;
}
.post-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.post-head .avatar-photo {
  width: 40px; height: 40px;
  margin-bottom: 0;
  font-size: 14px;
}
.post-head .info {
  flex: 1;
  line-height: 1.3;
}
.post-head .nm {
  font-family: 'Lora', serif;
  font-size: 15px;
  color: var(--ink);
}
.post-head .sub {
  font-size: 12px;
  color: var(--ink-3);
}
.post-head .ts {
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
}
.post-type {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px 2px;
  border-radius: 2px;
  margin-bottom: 10px;
}
.post-type.intro    { background: var(--tag-slate-bg); color: var(--tag-slate-ink); }
.post-type.advice   { background: var(--tag-sand-bg);  color: var(--tag-sand-ink); }
.post-type.hiring   { background: var(--tag-moss-bg);  color: var(--tag-moss-ink); }
.post-type.funding  { background: var(--tag-clay-bg);  color: var(--tag-clay-ink); }
.post-type.mentor   { background: var(--tag-rose-bg);  color: var(--tag-rose-ink); }
.post-type.partner  { background: var(--tag-sage-bg);  color: var(--tag-sage-ink); }
.post-body {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0 0 16px;
}
.post-body .hl { color: var(--ink); font-weight: 500; }
.post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--rule-2);
}
.respond {
  font-family: inherit;
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--forest);
  color: var(--forest);
  padding: 6px 14px;
  border-radius: 2px;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.respond:hover { background: var(--forest); color: var(--paper); }
.post-foot .meta {
  font-size: 11.5px;
  color: var(--ink-4);
  display: flex;
  align-items: center;
  gap: 12px;
}
.post-foot .meta span { display: inline-flex; align-items: center; gap: 4px; }

/* New Post Button */
.btn-post {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--forest);
  color: var(--paper);
  border: none;
  padding: 10px 22px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  margin-top: 14px;
  transition: all 0.2s;
}
.btn-post:hover { background: var(--forest-2); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(31,61,46,0.25); }

/* Post Modal */
.post-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(27,31,28,0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.post-modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}
.post-modal {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  width: 480px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px -15px rgba(0,0,0,0.3);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}
.post-modal-overlay.show .post-modal {
  transform: translateY(0);
}

.pm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--rule-2);
}
.pm-head h2 {
  font-family: 'Lora', serif;
  font-size: 20px;
  font-weight: 500;
  margin: 0;
}
.pm-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.pm-close:hover { color: var(--ink); }

.pm-form {
  padding: 20px 24px 24px;
}

/* Type Toggle */
.pm-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.pm-toggle-opt {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper-2);
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-3);
  transition: all 0.2s;
}
.pm-toggle-opt.active {
  border-color: var(--forest);
  background: rgba(31,89,68,0.06);
  color: var(--ink);
}
.pm-toggle-opt em { font-style: italic; color: var(--ink-4); font-size: 12px; }
.pm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pm-dot.ask { background: var(--clay); }
.pm-dot.offer { background: var(--forest); }

/* Form Fields */
.pm-field {
  margin-bottom: 16px;
}
.pm-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.pm-hint {
  font-weight: 400;
  text-transform: none;
  color: var(--ink-4);
  letter-spacing: 0;
}
.pm-field select,
.pm-field textarea,
.pm-field input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  transition: border-color 0.2s;
}
.pm-field select:focus,
.pm-field textarea:focus,
.pm-field input:focus {
  outline: none;
  border-color: var(--forest);
}
.pm-field textarea {
  resize: vertical;
  min-height: 80px;
}
.pm-charcount {
  text-align: right;
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 4px;
}

.pm-submit {
  width: 100%;
  padding: 12px;
  background: var(--forest);
  color: var(--paper);
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.02em;
  margin-top: 8px;
  transition: background 0.2s;
}
.pm-submit:hover { background: var(--forest-2); }

/* Locked Name (logged-in user) */
.pm-locked-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(74,93,65,0.06);
  border: 1.5px solid var(--forest);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.pm-locked-name svg { color: var(--forest); opacity: 0.5; }
.pm-locked-name.visitor {
  border-color: var(--rule);
  background: var(--paper-2);
}
.pm-locked-name small {
  font-size: 10px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* Board Card Actions */
.bc-top { position: relative; }
.bc-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s;
}
.board-card:hover .bc-actions { opacity: 1; }
.bc-act-btn {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: all 0.15s;
}
.bc-act-btn:hover { background: var(--paper-2); }
.bc-act-btn.del:hover { border-color: #c44; }
.bc-edit-ta {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--forest);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: var(--paper-2);
  resize: vertical;
  outline: none;
  margin: 8px 0;
  box-sizing: border-box;
}

/* Empty Board State */
.board-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-4);
}
.be-icon { font-size: 36px; margin-bottom: 12px; }
.board-empty p {
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* Success Toast */
.toast-success {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--forest);
  color: var(--paper);
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(31,61,46,0.3);
  z-index: 3000;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(-50%) translateY(20px); } }

/* Confirm Modal (replaces browser confirm()) */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(27,31,28,0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.confirm-overlay.show {
  opacity: 1;
  pointer-events: all;
}
.confirm-box {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  width: 380px;
  max-width: 90vw;
  box-shadow: 0 20px 60px -15px rgba(0,0,0,0.35);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.2s ease;
  overflow: hidden;
}
.confirm-overlay.show .confirm-box {
  transform: translateY(0) scale(1);
}
.confirm-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 0;
}
.confirm-icon span {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(196, 68, 68, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.confirm-body {
  padding: 16px 24px 4px;
  text-align: center;
}
.confirm-body h3 {
  font-family: 'Lora', serif;
  font-weight: 500;
  font-size: 18px;
  margin: 0 0 6px;
  color: var(--ink);
}
.confirm-body p {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.5;
  margin: 0;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  padding: 20px 24px 24px;
}
.confirm-actions button {
  flex: 1;
  padding: 10px 16px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.15s;
}
.confirm-cancel {
  background: var(--paper-2);
  color: var(--ink-2);
  border: 1px solid var(--rule);
}
.confirm-cancel:hover {
  background: var(--paper);
  border-color: var(--ink-3);
  color: var(--ink);
}
.confirm-danger {
  background: #c44;
  color: #fff;
  border: 1px solid #c44;
}
.confirm-danger:hover {
  background: #a33;
  border-color: #a33;
}

/* ---------- Screen 3: Profile v2 ---------- */
.prof-crumb {
  padding: 12px 44px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule-2);
  font-size: 12.5px;
  color: var(--ink-4);
}
.prof-crumb a { color: var(--forest); text-decoration: none; }
.prof-crumb a:hover { text-decoration: underline; }
.prof-crumb .sep { margin: 0 6px; color: var(--ink-4); }

.prof-hero-v2 {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 32px;
  padding: 36px 44px 32px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  align-items: flex-start;
}
.prof-hero-avatar .prof-av {
  width: 110px; height: 110px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Lora', serif;
  font-size: 2.4rem;
  color: var(--paper);
}
.prof-hero-avatar .prof-av.has-img { overflow: hidden; }
.prof-hero-avatar .prof-av.has-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.prof-cohort-badge {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.prof-name-v2 {
  font-family: 'Lora', serif;
  font-weight: 500;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--ink);
}
.prof-title-v2 { font-size: 15px; color: var(--ink-2); margin-bottom: 4px; }
.prof-title-v2 strong { color: var(--forest); font-weight: 500; }
.prof-loc-v2 {
  font-size: 13px; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 5px;
  margin-bottom: 16px;
}
.prof-tagline {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
  padding: 12px 0 12px 16px;
  border-left: 2.5px solid var(--forest);
  max-width: 560px;
}

.prof-hero-actions {
  display: flex; flex-direction: column;
  gap: 8px; min-width: 210px; padding-top: 8px;
}
.prof-action-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--rule); border-radius: 4px;
  background: transparent; text-decoration: none; color: var(--ink);
  transition: all 0.15s;
}
.prof-action-btn:hover { border-color: var(--ink-3); background: var(--paper-2); }
.prof-action-btn svg { flex-shrink: 0; }
.prof-action-btn.linkedin svg { color: var(--linkedin); }
/* Secondary profile action, sits under "Reach out" and matches its size */
.prof-action-btn.prof-linkedin-btn {
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--paper);
}
.prof-action-btn.prof-linkedin-btn .ext { display: inline; font-size: 12px; color: var(--ink-4); max-width: none; }
.prof-action-btn strong { font-size: 13px; display: block; line-height: 1.2; }
.prof-action-btn span {
  font-size: 11px; color: var(--ink-4); display: block;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prof-action-btn.reach-out {
  background: var(--forest, #2E3D24);
  color: #fff;
  border-color: var(--forest, #2E3D24);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 4px;
  justify-content: center;
}
.prof-action-btn.reach-out svg {
  color: #fff;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.prof-action-btn.reach-out:hover {
  background: #1f2e18;
  border-color: #1f2e18;
  color: #fff;
}

.prof-body-v2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.prof-left { padding: 32px 44px 56px; }
.prof-right { padding: 32px 44px 56px; border-left: 1px solid var(--rule); }

.prof-section-v2 { margin-bottom: 32px; }
.prof-section-v2:last-child { margin-bottom: 0; }
.prof-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-2);
  font-weight: 600;
}

.prof-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.prof-tags .tag { font-size: 12px; padding: 5px 10px; }

.prof-bio-text { font-size: 14.5px; color: var(--ink-2); line-height: 1.7; max-width: 540px; }
.prof-bio-text p { margin: 0 0 14px; }
.prof-bio-text p:last-child { margin-bottom: 0; }

/* Career Timeline */
.career-timeline { position: relative; padding-left: 24px; }
.career-item { position: relative; padding-bottom: 24px; }
.career-item:last-child { padding-bottom: 0; }
.career-item:last-child .career-line { display: none; }
.career-dot {
  position: absolute; left: -24px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--forest); background: var(--paper); z-index: 1;
}
.career-item.current .career-dot { background: var(--forest); }
.career-line {
  position: absolute; left: -20px; top: 16px; bottom: 0;
  width: 1px; background: var(--rule);
}
.career-years {
  font-family: 'Lora', serif; font-size: 12px;
  color: var(--ink-4); letter-spacing: 0.03em; margin-bottom: 2px;
}
.career-role { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.career-org { font-size: 13px; color: var(--ink-3); margin-top: 1px; }

/* Stats */
.prof-stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--rule); border-radius: 4px;
  background: var(--paper-2); margin-bottom: 28px;
}
.prof-stat { padding: 16px 14px; text-align: left; }
.prof-stat + .prof-stat { border-left: 1px solid var(--rule); }
.stat-num { font-family: 'Lora', serif; font-size: 22px; color: var(--forest); line-height: 1; }
.stat-label { font-size: 10px; color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 6px; }

/* Board Posts on Profile */
.prof-board-posts { display: flex; flex-direction: column; gap: 10px; }
.prof-board-card {
  border: 1px solid var(--rule); background: var(--paper-2);
  border-radius: 4px; padding: 14px 16px;
}
.pbc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.pbc-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.pbc-dot.ask { background: var(--clay); }
.pbc-dot.offer { background: var(--forest); }
.pbc-type { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.pbc-sep { color: var(--ink-4); font-size: 10px; }
.pbc-time { font-size: 10px; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.08em; }
.pbc-body { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; margin: 0; }

/* Cohort Avatars */
.prof-cohort-avatars { display: flex; flex-wrap: wrap; gap: 6px; }
.prof-cm-av { text-decoration: none; transition: transform 0.15s; }
.prof-cm-av:hover { transform: translateY(-2px); }

/* ═══════ Reach-Out Modal ═══════ */
.ro-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.ro-overlay.open { opacity: 1; pointer-events: all; }

.ro-modal {
  background: var(--paper, #f5f0e8);
  border-radius: 10px;
  width: 480px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 28px 20px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s;
}
.ro-overlay.open .ro-modal { transform: translateY(0) scale(1); }

.ro-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none;
  font-size: 22px; color: var(--ink-3);
  cursor: pointer; line-height: 1;
  padding: 4px 8px; border-radius: 4px;
  transition: background 0.15s;
}
.ro-close:hover { background: rgba(0,0,0,0.06); }

/* Scholar header */
.ro-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule, #ddd);
}
.ro-av {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Lora', serif;
  font-size: 1rem;
  color: var(--paper, #fff);
  flex-shrink: 0;
}
.ro-av.has-img { overflow: hidden; }
.ro-av.has-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ro-name { font-weight: 600; font-size: 15px; color: var(--ink); line-height: 1.3; }
.ro-title { font-size: 12.5px; color: var(--ink-3); }
.ro-title strong { color: var(--forest, #2E3D24); font-weight: 500; }

/* Context input */
.ro-section { margin-bottom: 16px; }
.ro-label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}
.ro-hint {
  font-size: 12.5px; color: var(--ink-4);
  margin: 0 0 10px; line-height: 1.4;
}
.ro-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule, #d5d0c4);
  border-radius: 6px;
  background: var(--paper-2, #ece7dc);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.ro-textarea:focus {
  outline: none;
  border-color: var(--forest, #2E3D24);
}
.ro-textarea::placeholder { color: var(--ink-4); }

/* Generate button */
.ro-generate {
  width: 100%;
  padding: 12px 20px;
  background: var(--forest, #2E3D24);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.15s;
  margin-bottom: 16px;
}
.ro-generate:hover { background: #1f2e18; }
.ro-generate:disabled { opacity: 0.7; cursor: wait; }
.ro-gen-icon { font-size: 15px; }

/* Spinner */
.ro-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ro-spin 0.6s linear infinite;
}
@keyframes ro-spin { to { transform: rotate(360deg); } }

/* Generated message */
.ro-result { margin-bottom: 16px; }
.ro-message-box {
  position: relative;
  background: var(--paper-2, #ece7dc);
  border: 1px solid var(--rule, #d5d0c4);
  border-radius: 6px;
  padding: 16px 40px 16px 16px;
}
.ro-message-text {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.65;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ro-copy {
  position: absolute; top: 10px; right: 10px;
  background: none; border: 1px solid var(--rule, #d5d0c4);
  border-radius: 4px;
  padding: 5px 6px;
  cursor: pointer;
  color: var(--ink-3);
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.ro-copy:hover { background: rgba(0,0,0,0.05); border-color: var(--ink-3); }

/* Share buttons */
.ro-share {
  display: flex; gap: 10px;
  border-top: 1px solid var(--rule, #d5d0c4);
  padding-top: 16px;
}
.ro-share-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid var(--rule, #d5d0c4);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper-2, #ece7dc);
  transition: all 0.15s;
}
.ro-share-btn:hover { border-color: var(--ink-3); }
.ro-share-btn.whatsapp svg { color: #25D366; }
.ro-share-btn.linkedin svg { color: #0A66C2; }

/* Inline SVGs sized */
svg { display: block; }

/* ---------- Filter chips ---------- */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 4px 10px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-2);
  cursor: pointer;
  letter-spacing: 0.02em;
}
.filter-chip:hover { border-color: var(--clay); color: var(--clay); }
.filter-chip::after {
  content: '×';
  font-size: 13px;
  color: var(--ink-4);
}

/* ---------- Card cursor ---------- */
.card { cursor: pointer; }

/* ---------- Board card styles ---------- */
.board-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg);
}
.board-col {
  padding: 28px 36px 56px;
}
.board-col + .board-col {
  border-left: 1px solid var(--rule);
}
.col-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-2);
  font-family: 'Lora', serif;
  font-size: 22px;
  font-style: italic;
  color: var(--ink);
}
.col-head .ct {
  font-family: 'Figtree', sans-serif;
  font-style: normal;
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.col-head .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.col-head.ask .dot { background: var(--clay); }
.col-head.offer .dot { background: var(--forest); }

.board-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 20px 22px;
  margin-bottom: 14px;
}
.bc-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.bc-top strong {
  font-family: 'Lora', serif;
  font-size: 15px;
  color: var(--ink);
  display: block;
}
.bc-meta {
  font-size: 12px;
  color: var(--ink-3);
}
.bc-meta em { font-style: normal; color: var(--ink-4); }
.bc-body {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0 0 16px;
}
.bc-tags {
  display: flex;
  gap: 5px;
  margin-bottom: 14px;
}
.bc-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-2);
}
.bc-action {
  font-family: inherit;
  font-size: 12px;
  background: transparent;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  letter-spacing: 0.02em;
}
.bc-action:hover { color: var(--forest); }

/* ---------- Profile page ---------- */
.profile-screen {
  min-height: 100vh;
}
.back-link {
  display: inline-block;
  font-size: 12px;
  color: var(--forest);
  text-decoration: none;
  margin-bottom: 24px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid transparent;
}
.back-link:hover { border-bottom-color: var(--forest); }

.prof-hero {
  padding: 36px 56px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.prof-hero-l {
  max-width: 680px;
}
.prof-avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Lora', serif;
  color: var(--paper);
  margin-bottom: 20px;
}
.prof-avatar.a1 { background: linear-gradient(135deg, #4B5A3D, #2E3D24); }
.prof-avatar.a2 { background: linear-gradient(135deg, #7A4A40, #5A2E25); }
.prof-avatar.a3 { background: linear-gradient(135deg, #6E5429, #4A3815); }
.prof-avatar.a4 { background: linear-gradient(135deg, #3F4A52, #1F2A34); }
.prof-avatar.a5 { background: linear-gradient(135deg, #3D5340, #1F3D2E); }
.prof-avatar.a6 { background: linear-gradient(135deg, #6A4632, #3E2818); }
.prof-avatar.a7 { background: linear-gradient(135deg, #56607a, #2F3A52); }
.prof-avatar.a8 { background: linear-gradient(135deg, #8a6238, #5A3F1F); }
.prof-name {
  font-family: 'Lora', serif;
  font-weight: 500;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--ink);
}
.prof-role {
  font-size: 16px;
  color: var(--ink-2);
  margin-bottom: 6px;
  line-height: 1.4;
}
.prof-org { color: var(--forest); font-weight: 500; }
.prof-loc {
  font-size: 13px;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.prof-cohort {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 20px;
}
.prof-actions {
  display: flex;
  gap: 10px;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13px;
  background: var(--forest);
  color: var(--paper);
  border: 1px solid var(--forest);
  padding: 10px 18px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: all .15s;
}
.btn-primary:hover { background: var(--forest-2); }
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13px;
  background: transparent;
  color: var(--forest);
  border: 1px solid var(--rule);
  padding: 10px 18px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all .15s;
}
.btn-outline:hover { border-color: var(--forest); background: var(--paper-2); }

.prof-body {
  padding: 36px 56px 60px;
}
.prof-section {
  margin-bottom: 36px;
}
.prof-section h2 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-2);
  font-weight: 400;
  font-family: 'Figtree', sans-serif;
}
.prof-section p {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.65;
  margin: 0;
  max-width: 640px;
}
.cohort-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.cohort-mate {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  transition: border-color .15s;
}
.cohort-mate:hover { border-color: var(--forest); }
.cm-info strong {
  font-family: 'Lora', serif;
  font-size: 13px;
  color: var(--ink);
  display: block;
}
.cm-info span {
  font-size: 11px;
  color: var(--ink-3);
}

/* ---------- Responsive ---------- */

/* -- Card height uniformity + tag overflow fixes -- */
.card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
}
.card .tags {
  flex-shrink: 0;
}
.tag {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .role {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Search input fix */
.search input {
  min-width: 0;
  width: 100%;
}

/* Filter toggle button - hidden on desktop */
.filter-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all .2s;
  margin-bottom: 4px;
}
.filter-toggle:hover { border-color: var(--forest); color: var(--forest); }
.filter-toggle.open { background: var(--forest); color: var(--paper); border-color: var(--forest); }
.filter-toggle-chev {
  transition: transform .2s;
  margin-left: auto;
}
.filter-toggle.open .filter-toggle-chev {
  transform: rotate(180deg);
}

/* Filter groups wrapper */
.filter-groups {
  /* visible by default on desktop */
}

/* -- Large Desktop (≤1280px) -- */
@media (max-width: 1280px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .dir-body { grid-template-columns: 240px 1fr; }
}

/* -- Small Desktop / Tablet Landscape (≤1024px) -- */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .dir-body { grid-template-columns: 220px 1fr; }
  .sidebar { padding: 20px 18px 20px 22px; }
  .dir-main { padding: 22px 24px 32px; }
  .nav { padding: 14px 20px; }
  .nav-links { gap: 20px; }
  .dir-hero { min-height: 300px; padding: 48px 24px 40px; }
  .dir-hero h1 { font-size: 36px; }
  .dir-hero .lede { font-size: 14px; max-width: 520px; margin-bottom: 24px; }
  .hero-stats-card { padding: 12px 20px; gap: 14px; }
  .stat-item .val { font-size: 24px; }
  .stat-item .lbl { font-size: 10px; letter-spacing: 0.1em; }
  .page-wrap { padding: 36px 14px 60px; }
  .profile-head { grid-template-columns: 120px 1fr auto; gap: 24px; padding: 32px 28px; }
  .profile-head .avatar-photo { width: 110px; height: 110px; font-size: 36px; }
  .ph-id h1 { font-size: 34px; }
  .profile-body { grid-template-columns: 1fr; }
  .profile-col + .profile-col { border-left: none; border-top: 1px solid var(--rule); }
  .profile-col { padding: 28px 28px; }
  .board-cols { grid-template-columns: 1fr; }
  .board-col + .board-col { border-left: none; border-top: 1px solid var(--rule); }
  .prof-hero { padding: 28px 28px; }
  .prof-body { padding: 28px 28px 40px; }
  .prof-name { font-size: 32px; }
}

/* ======== Site Footer ======== */
.site-footer {
  background: #111;
  color: #a0aec0;
  padding: 60px 0 0;
  font-family: 'Figtree', sans-serif;
}
.sf-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
}
.sf-brand-col {
  flex: 1 1 300px;
}
.sf-wordmark {
  margin-bottom: 16px;
}
.sf-desc {
  font-size: 14px;
  line-height: 1.6;
  max-width: 280px;
}
.sf-links-grid {
  display: flex;
  flex: 2 1 600px;
  gap: 40px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.sf-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sf-col h4 {
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 8px;
}
.sf-col a {
  color: #a0aec0;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.sf-col a:hover {
  color: #fff;
}
.sf-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 60px;
  padding: 24px 0;
}
.sf-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.sf-copy {
  font-size: 13px;
}
.sf-legal {
  display: flex;
  gap: 24px;
}
.sf-legal a {
  color: #a0aec0;
  text-decoration: none;
  font-size: 13px;
}
.sf-legal a:hover {
  color: #fff;
}

/* -- Tablet Portrait (≤768px) -- */
@media (max-width: 768px) {
  .app-container { padding-bottom: 100px; }
  .dir-body { grid-template-columns: 1fr; }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 16px 20px;
  }
  /* Full-width bar on mobile — don't pin the filters or cap their height. */
  .sidebar-inner {
    position: static;
    max-height: none;
    overflow: visible;
  }
  /* Show filter toggle, hide filter groups by default */
  .filter-toggle { display: flex; }
  .filter-groups {
    display: none;
    padding-top: 8px;
  }
  .filter-groups.open {
    display: block;
  }
  .clear-btn { display: none; }
  .filter-groups.open + .clear-btn { display: inline-block; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .dir-hero {
    padding: 48px 24px 280px;
  }
  .dir-hero::before {
    background-size: 100% auto;
    background-position: center bottom;
    background-repeat: no-repeat;
  }
  .dir-hero-overlay {
    background: linear-gradient(180deg, rgba(18, 33, 25, 0.96) 0%, rgba(18, 33, 25, 0.7) 45%, rgba(18, 33, 25, 0.2) 100%);
  }
  .hero-stats-card {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    width: 100%;
    box-sizing: border-box;
  }
  .stat-dot { display: none; }
  .stat-item { flex: 1 1 40%; min-width: 120px; }
  .dir-main { padding: 18px 20px 28px; }
  .nav { padding: 12px 16px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 13px; }
  .wordmark .yis { font-size: 18px; }
  .wordmark .sub { display: none; }
  .nav-user .nm { display: none; }
  .sf-container { flex-direction: column; gap: 32px; }
  .sf-links-grid { gap: 32px; flex-direction: column; }
  .sf-bottom-inner { flex-direction: column; align-items: flex-start; }
  .dir-toolbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dir-toolbar .r { width: 100%; display: flex; justify-content: flex-start; }
  .map-frame { height: 440px; }
  .map-stats { flex-wrap: wrap; gap: 12px 18px; }
  .profile-head { grid-template-columns: 1fr; gap: 18px; padding: 24px 20px; }
  .cta-stack { flex-direction: row; flex-wrap: wrap; min-width: auto; }
  .prof-hero { padding: 24px 20px; }
  .prof-body { padding: 24px 20px 40px; }
  .prof-name { font-size: 28px; }
  .prof-avatar { width: 80px !important; height: 80px !important; font-size: 28px !important; }

  /* Profile V2 Responsive Overrides */
  .prof-crumb {
    padding: 10px 20px;
    font-size: 11.5px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .prof-hero-v2 {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 20px;
    text-align: center;
  }
  .prof-hero-avatar {
    display: flex;
    justify-content: center;
  }
  .prof-hero-info {
    text-align: center;
  }
  .prof-loc-v2 {
    justify-content: center;
  }
  .prof-tagline {
    border-left: none;
    border-top: 2.5px solid var(--forest);
    padding: 12px 16px 0;
    margin: 12px auto 0;
    text-align: center;
  }
  .prof-hero-actions {
    width: 100%;
    min-width: auto;
    padding-top: 0;
    align-items: center;
  }
  .prof-action-btn {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }
  .prof-body-v2 {
    grid-template-columns: 1fr;
  }
  .prof-left {
    padding: 24px 20px 0;
  }
  .prof-right {
    padding: 24px 20px 40px;
    border-left: none;
    border-top: 1px solid var(--rule);
  }
  .prof-stats-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .prof-stat {
    padding: 12px 8px;
    text-align: center;
  }
  .stat-num {
    font-size: 18px;
  }
  .stat-label {
    font-size: 8.5px;
    letter-spacing: 0.05em;
  }
}

/* -- Mobile (≤480px) -- */
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .card { min-height: auto; }
  .sidebar { padding: 12px 14px; }
  .dir-hero {
    padding: 36px 16px 180px;
    min-height: auto;
  }
  .dir-hero::before {
    background-size: 100% auto;
    background-position: center bottom;
    background-repeat: no-repeat;
  }
  .dir-hero-overlay {
    background: linear-gradient(180deg, rgba(18, 33, 25, 0.96) 0%, rgba(18, 33, 25, 0.6) 40%, rgba(18, 33, 25, 0.1) 100%);
  }
  .dir-hero h1 { font-size: 32px; }
  .dir-hero .lede { font-size: 13.5px; line-height: 1.5; margin-bottom: 20px; }
  .hero-stats-card { padding: 12px 16px; gap: 10px 12px; }
  .stat-item .val { font-size: 22px; }
  .stat-item { flex: 1 1 45%; min-width: 100px; }
  .dir-main { padding: 14px; }
  .nav { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 12px 0; padding: 10px 12px; }
  .nav.scrolled { padding: 8px 12px; }
  .wordmark { grid-column: 1; grid-row: 1; min-width: 0; }
  .nav-user { grid-column: 2; grid-row: 1; display: flex; align-items: center; }
  .nav-links { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 12px; flex-wrap: wrap; }
  .nav-links a { font-size: 12px; }
  .nav-links a.active::after { bottom: -14px; }
  .wordmark .yis { font-size: 16px; }
  .view-toggle button { padding: 6px 10px; font-size: 11px; }
  .sort .v { font-size: 11px; }
  .dir-toolbar .res { font-size: 12px; }
  .filter-group .h { font-size: 10px; }
  .check { font-size: 12px; gap: 8px; }
  .check .box { width: 12px; height: 12px; }
  .check .ct { font-size: 10px; }
  .card .nm { font-size: 16px; }
  .card .role { font-size: 12px; }
  .tag { font-size: 10px; padding: 2px 6px; max-width: 130px; }
  .card-foot .loc { font-size: 10px; }
  .map-frame { height: 320px; }
  .map-legend { font-size: 9.5px; padding: 8px 10px; }
  .map-stats { font-size: 10px; gap: 8px 14px; padding: 10px 14px; }
  .map-stats .n { font-size: 14px; }
  .board-hero { flex-direction: column; gap: 14px; padding: 24px 16px 20px; }
  .board-hero h1 { font-size: 28px; }
  .board-col { padding: 16px; }
  .profile-head { padding: 20px 16px; }
  .ph-id h1 { font-size: 28px; }
  .mission { font-size: 15px; padding-left: 12px; }
  .cta-stack { flex-direction: column; }
  .profile-col { padding: 20px 16px; }
  .prof-hero { padding: 20px 16px; }
  .prof-body { padding: 20px 16px 32px; }
  .prof-name { font-size: 24px; }
  .prof-actions { flex-direction: column; }
  .btn-primary, .btn-outline { width: 100%; justify-content: center; }

  /* Profile V2 Smartphone Specific overrides */
  .prof-name-v2 { font-size: 26px; }
  .prof-title-v2 { font-size: 13.5px; }
  .prof-tagline { font-size: 14px; padding: 12px 0 0; }
  .prof-bio-text { font-size: 13.5px; }
  .prof-left { padding: 20px 16px 0; }
  .prof-right { padding: 20px 16px 32px; }
}

/* -- Small Mobile (≤360px) -- */
@media (max-width: 360px) {
  .dir-hero h1 { font-size: 26px; }
  .stat-item .val { font-size: 18px; }
  .stat-item .lbl { font-size: 9px; }
  .nav-links a { font-size: 11px; }
  .card .nm { font-size: 15px; }
  .tag { max-width: 110px; }
  .prof-name { font-size: 22px; }
  .page-wrap { padding: 20px 8px 40px; }

  /* Profile V2 Tiny Mobile Specific overrides */
  .prof-name-v2 { font-size: 22px; }
  .prof-title-v2 { font-size: 12.5px; }
}


/* ============================================
   AI CHAT — PREMIUM UI
   ============================================ */

/* -- Custom scrollbar (thin, invisible until hover) -- */
.ai-msgs::-webkit-scrollbar { width: 4px; }
.ai-msgs::-webkit-scrollbar-track { background: transparent; }
.ai-msgs::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
.ai-msgs:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }
.ai-msgs { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.ai-msgs:hover { scrollbar-color: rgba(0,0,0,0.12) transparent; }

/* -- Appear animation -- */
@keyframes aiSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.ai-appear { animation: aiSlideUp .35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* -- FAB with label -- */
.ai-fab-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  transition: opacity .2s;
}
.ai-fab-label {
  background: var(--ink, #1a1a1a);
  color: var(--paper, #f5f0e8);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  white-space: nowrap;
  pointer-events: none;
}
.ai-fab {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(30,50,30,0.35);
  transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity .2s;
  flex-shrink: 0;
}
.ai-fab:hover { transform: scale(1.1); }
.ai-fab.hide { opacity: 0; pointer-events: none; transform: scale(0.6); }
.ai-fab.hide ~ .ai-fab-label { opacity: 0; }

/* ======== Sliding Side Panel (Desktop) / Bottom Sheet (Mobile) ======== */
.ai-panel {
  position: fixed;
  top: 0;
  right: -450px; /* Hidden by default */
  width: 400px;
  height: 100vh;
  background: var(--paper);
  border-left: 1px solid rgba(0,0,0,0.08);
  box-shadow: -10px 0 40px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  z-index: 2000;
  visibility: hidden;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
}

.ai-panel.open {
  right: 0;
  visibility: visible;
}

.ai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  flex-shrink: 0;
}
.ai-panel-title {
  display: flex;
  align-items: center;
}

.ai-panel-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.ai-msgs {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-panel-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--rule);
  background: var(--paper);
}

/* -- Welcome screen -- */
.ai-welcome-screen {
  text-align: center;
  padding: 40px 10px 20px;
  animation: aiSlideUp .5s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-welcome-icon {
  font-size: 38px;
  color: var(--clay);
  margin-bottom: 12px;
}
.ai-welcome-screen h2 {
  font-family: 'Lora', serif;
  font-weight: 500;
  font-size: 22px;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.ai-welcome-screen p {
  font-size: 14px;
  color: var(--ink-3);
  max-width: 90%;
  margin: 0 auto 20px;
  line-height: 1.5;
}
.ai-welcome-chips {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.ai-chip {
  font-family: inherit;
  font-size: 12.5px;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.ai-chip:hover {
  border-color: var(--forest);
  color: var(--forest);
  background: var(--paper);
  box-shadow: 0 2px 8px rgba(60,80,50,0.1);
  transform: translateY(-1px);
}

/* -- Message row -- */
.ai-msg {
  display: flex;
  gap: 10px;
  max-width: 100%;
}
.ai-msg.user {
  flex-direction: row-reverse;
}

/* -- Avatar -- */
.ai-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}
.bot-av {
  background: linear-gradient(135deg, var(--forest), #3A5030);
  color: var(--paper);
  font-size: 13px;
}
.user-av {
  background: var(--ink);
  color: var(--paper);
  font-size: 9px;
  letter-spacing: 0.02em;
}

/* -- Bubble -- */
.ai-bubble {
  font-size: 13.5px;
  line-height: 1.6;
  padding: 12px 16px;
  border-radius: 14px;
  max-width: 85%;
  word-wrap: break-word;
}
.bot-bub {
  background: var(--bg);
  color: var(--ink);
  border-top-left-radius: 4px;
}
.user-bub {
  background: var(--forest);
  color: var(--paper);
  border-top-right-radius: 4px;
}
.ai-bubble h3, .ai-bubble h4 {
  font-family: 'Lora', serif;
  color: var(--ink);
  margin: 10px 0 4px;
  font-size: 14px;
  font-weight: 600;
}
.ai-bubble h4 { font-size: 13px; }
.ai-bubble strong { color: var(--forest); font-weight: 600; }
.user-bub strong { color: #B8D4AA; }

.ai-list-item {
  padding: 4px 0 4px 14px;
  border-left: 2px solid var(--rule-2);
  margin: 5px 0;
  font-size: 13px;
  line-height: 1.55;
}
.ai-list-item.ai-num { border-left-color: var(--forest); }
.ai-card-sep { height: 0; border: none; border-top: 1px solid var(--rule); margin: 14px 0; }
.ai-h { font-family: 'Lora', serif; color: var(--ink); margin: 10px 0 4px; font-weight: 600; }
h3.ai-h { font-size: 15px; }
h4.ai-h { font-size: 13.5px; }
h5.ai-h { font-size: 12.5px; }

.ai-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--forest);
  background: rgba(31,61,46,0.08);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12.5px;
  text-decoration: none;
  font-weight: 500;
  border: 1px solid rgba(31,61,46,0.15);
  transition: all .15s;
  word-break: break-all;
  margin: 2px 0;
}
.ai-link:hover {
  background: var(--forest);
  color: var(--paper);
  border-color: var(--forest);
}

/* -- Typing dots -- */
.ai-typing { display: flex; gap: 5px; padding: 4px 0; }
.ai-typing span {
  width: 6px; height: 6px;
  background: var(--ink-3);
  border-radius: 50%;
  animation: aiBounce 1.2s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: .15s; }
.ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes aiBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* -- Input bar -- */
.ai-input-bar {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  background: var(--paper);
}
.ai-input-bar input {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 18px;
  border: 1px solid var(--rule);
  border-radius: 24px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.ai-input-bar input:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(60,80,50,0.08);
}
.ai-input-bar input::placeholder { color: var(--ink-4); }

.ai-send-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--paper);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, transform .15s;
}
.ai-send-btn:hover { background: var(--forest-2); transform: scale(1.05); }
.ai-send-btn:active { transform: scale(0.95); }

/* ======== Responsive / Mobile Bottom Sheet ======== */
@media (max-width: 768px) {
  .ai-fab { bottom: 16px; right: 16px; width: 48px; height: 48px; }
  
  .ai-panel {
    top: auto;
    bottom: -100%;
    right: 0;
    width: 100%;
    height: 85vh; /* Cover 85% of screen on mobile */
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
    border-left: none;
    border-top: 1px solid rgba(0,0,0,0.08);
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
  }
  
  .ai-panel.open {
    bottom: 0;
    right: 0;
  }
  
  .ai-panel-header { padding: 16px 20px; }
  .ai-msgs { padding: 20px 16px; }
  .ai-input-bar { padding: 12px 16px; }
}


/* ---------- Auth: Nav elements ---------- */
.nav-av-img {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--rule);
}
.nav-logout {
  color: var(--ink-4);
  margin-left: 6px;
  transition: color 0.15s;
}
.nav-logout:hover { color: var(--clay); }
.nav-login-btn {
  font-size: 13px;
  padding: 6px 16px;
  background: var(--forest);
  color: var(--paper);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s;
}
.nav-login-btn:hover { background: var(--forest-2); }

/* ---------- Login Page ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 48px 44px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.login-brand .yis {
  font-family: 'Lora', serif;
  font-size: 20px;
  color: var(--ink);
}
.login-brand .yis em { color: var(--forest); font-style: italic; }
.login-sub {
  display: block;
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}
.login-title {
  font-family: 'Lora', serif;
  font-size: 28px;
  color: var(--ink);
  margin: 28px 0 10px;
}
.login-desc {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.6;
  margin: 0 0 28px;
}
.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.google-btn:hover {
  border-color: var(--ink-3);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.google-btn svg { flex-shrink: 0; }
.login-note {
  font-size: 12px;
  color: var(--ink-4);
  margin-top: 20px;
}

/* ---------- Onboarding Page ---------- */
.onboarding-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 40px 20px;
}
.ob-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 40px 44px;
  max-width: 560px;
  width: 100%;
}
.ob-greeting {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.ob-google-av {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--rule);
}
.ob-hello {
  font-family: 'Lora', serif;
  font-size: 22px;
  color: var(--ink);
  margin: 0;
}
.ob-email {
  font-size: 13px;
  color: var(--ink-4);
  margin: 2px 0 0;
}
.ob-prompt {
  font-size: 15px;
  color: var(--ink-2);
  margin: 0 0 20px;
}

/* Role Cards */
.ob-roles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.ob-role-card {
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--paper-2);
}
.ob-role-card:hover {
  border-color: var(--forest);
  background: var(--paper);
}
.ob-role-card.active {
  border-color: var(--forest);
  background: var(--paper);
  box-shadow: 0 0 0 2px rgba(74,93,65,0.15);
}
.ob-role-icon { font-size: 28px; margin-bottom: 8px; }
.ob-role-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
}
.ob-role-card p {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.4;
  margin: 0;
}

/* Scholar Search */
.ob-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}
.ob-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper-2);
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}
.ob-input:focus { border-color: var(--forest); }

.ob-results {
  margin-top: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.ob-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.ob-result:hover {
  background: var(--paper-2);
  border-color: var(--rule);
}
.ob-r-av {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.ob-r-av-init {
  background: var(--forest);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.ob-result strong {
  font-size: 14px;
  color: var(--ink);
  display: block;
  line-height: 1.2;
}
.ob-result span {
  font-size: 12px;
  color: var(--ink-3);
  display: block;
}
.ob-no-result {
  padding: 14px;
  text-align: center;
  color: var(--ink-4);
  font-size: 13px;
}

/* Selected Scholar */
.ob-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1.5px solid var(--forest);
  border-radius: 6px;
  background: rgba(74,93,65,0.06);
  margin-top: 10px;
}
.ob-sel-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ob-sel-av {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}
.ob-sel-av.has-photo { background: transparent; }
.ob-sel-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ob-sel-info strong { font-size: 14px; color: var(--ink); display: block; }
.ob-sel-info span { font-size: 12px; color: var(--ink-3); display: block; }
.ob-sel-change {
  font-size: 12px;
  color: var(--forest);
  background: none;
  border: 1px solid var(--forest);
  border-radius: 4px;
  padding: 4px 12px;
  cursor: pointer;
  font-family: inherit;
}
.ob-sel-change:hover { background: rgba(74,93,65,0.1); }

/* Submit */
.ob-submit {
  width: 100%;
  padding: 12px;
  background: var(--forest);
  color: var(--paper);
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-top: 16px;
  transition: background 0.15s;
}
.ob-submit:hover { background: var(--forest-2); }

/* --- Empty State --- */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.empty-state .empty-msg {
  font-size: 24px;
  font-weight: 500;
  color: var(--ink-2);
  margin-top: 16px;
  margin-bottom: 8px;
}

.empty-state .empty-sub {
  font-size: 16px;
  color: var(--ink-3);
  margin: 0 0 24px 0;
  max-width: 400px;
}

.empty-reset-btn {
  background: transparent;
  border: 1px solid var(--forest);
  color: var(--forest);
  padding: 10px 24px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.empty-reset-btn:hover {
  background: var(--forest);
  color: var(--paper);
}

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

/* --- Image Modal --- */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.image-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.image-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
}

.image-modal img {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 2;
  cursor: zoom-out;
}

.image-modal.active img {
  transform: scale(1);
}

.image-modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.image-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
/* ======== Tesla-Style Bottom Bar ======== */
.ai-tesla-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 24px;
  z-index: 1000;
  display: flex;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-tesla-inner {
  width: 100%;
  max-width: 700px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 8px 8px 16px;
  cursor: text;
  transition: box-shadow 0.4s ease;
  position: relative;
  z-index: 1;
}
/* The Living Border — a rotating gradient shimmer masked as a thin border */
.ai-tesla-inner::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: 999px;
  background: conic-gradient(
    from var(--shimmer-angle, 0deg),
    #c9b896 0%,
    #2b4522 25%,
    #c9b896 50%,
    #2b4522 75%,
    #c9b896 100%
  );
  z-index: -1;
  animation: shimmer-rotate 8s linear infinite;
}
/* Inner mask to reveal only the border edge */
.ai-tesla-inner::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px; right: 2px; bottom: 2px;
  border-radius: 999px;
  background: #fff;
  z-index: -1;
}
@property --shimmer-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes shimmer-rotate {
  0%   { --shimmer-angle: 0deg; }
  100% { --shimmer-angle: 360deg; }
}
/* On hover: deepen the outer glow */
.ai-tesla-inner:hover {
  box-shadow: 0 4px 20px rgba(43, 69, 34, 0.15);
}
/* On focus: freeze shimmer, solid green border, green glow */
.ai-tesla-inner:focus-within::before {
  background: #2b4522;
  animation: none;
}
.ai-tesla-inner:focus-within {
  box-shadow: 0 0 0 3px rgba(43, 69, 34, 0.12), 0 4px 20px rgba(43, 69, 34, 0.15);
}
.ai-tesla-placeholder {
  flex: 1;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink-3, #767676);
  cursor: text;
}
.ai-tesla-spark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--forest, #2b4522);
  color: var(--paper, #f5f0e8);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-tesla-input {
  flex: 1;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink, #1a1a1a);
  outline: none;
}
.ai-tesla-input::placeholder {
  font-family: 'Lora', serif;
  font-style: italic;
  color: #9a9385;
  transition: color 0.3s;
}
.ai-tesla-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--forest, #2b4522);
  color: var(--paper, #f5f0e8);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.ai-tesla-send:hover {
  background: var(--forest-2, #3c5032);
  transform: scale(1.05);
}
.ai-speak-btn {
  background: rgba(18, 33, 25, 0.05);
  color: #475569;
  border: 1px solid rgba(18, 33, 25, 0.1);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none;
  flex-shrink: 0;
  outline: none;
}
.ai-speak-btn:hover {
  background: #122119;
  color: #ffffff;
  border-color: #122119;
  transform: scale(1.08);
}
.ai-speak-btn svg {
  width: 13px;
  height: 13px;
}

/* --- Site Footer Premium Styling --- */
.site-footer {
  background: var(--forest, #2b4522);
  color: var(--paper, #f5f0e8);
  padding: 60px 0 0;
  margin-top: 60px;
  border-top: 4px solid var(--moss, #7c8a71);
}
/* Pages built on a full-bleed .screen (directory, board, profile, onboarding) end on their
   own tinted background; the 60px margin there showed as a pale band above the footer.
   Pages without one (jobs, events) keep the breathing room. */
body:has(.screen) .site-footer {
  margin-top: 0;
}
.sf-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 120px;
  justify-content: flex-start;
}
.sf-brand-col {
  flex: 0 0 320px;
  max-width: 320px;
}
.sf-wordmark {
  margin-bottom: 16px;
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
}
.sf-wordmark .yis {
  font-family: 'Lora', serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.sf-wordmark .sub {
  font-family: 'Figtree', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .15em;
  padding-left: 12px;
  border-left: 1px solid rgba(245, 240, 232, 0.2);
}
.sf-desc {
  font-family: 'Figtree', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(245, 240, 232, 0.8);
  margin: 0;
}
.sf-links-grid {
  display: flex;
  gap: 80px;
}
.sf-col h4 {
  font-family: 'Figtree', sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--moss, #7c8a71);
  margin: 0 0 20px 0;
  font-weight: 600;
}
.sf-col a {
  display: block;
  color: rgba(245, 240, 232, 0.9);
  text-decoration: none;
  font-family: 'Figtree', sans-serif;
  font-size: 14.5px;
  margin-bottom: 14px;
  transition: color 0.2s;
}
.sf-col a:hover {
  color: #fff;
  text-decoration: underline;
}
.sf-bottom {
  margin-top: 60px;
  border-top: 1px solid rgba(245, 240, 232, 0.1);
  padding: 24px 0;
  background: rgba(0, 0, 0, 0.15);
}
.sf-bottom-inner {
  align-items: center;
  font-family: 'Figtree', sans-serif;
  font-size: 13px;
  color: rgba(245, 240, 232, 0.6);
}
.sf-legal {
  display: flex;
  gap: 24px;
}
.sf-legal a {
  color: rgba(245, 240, 232, 0.6);
  text-decoration: none;
  transition: color 0.2s;
}
.sf-legal a:hover {
  color: #fff;
}
/* The Youn AI bar is fixed to the bottom of the screen (76px tall). Reserve that space under the
   footer's last row so, when scrolled to the very end, the row sits above the bar instead of under it. */
body:has(#ai-tesla-bar) .sf-bottom {
  padding-bottom: calc(24px + 76px + env(safe-area-inset-bottom, 0px));
}
/* the bottom bar already ends the footer; no lighter strip underneath it */
body:has(#ai-tesla-bar) .site-footer { padding-bottom: 0 !important; }
/* Bottom bar: copyright on the left, legal links + credit on the right edge */
.sf-container.sf-bottom-inner { justify-content: space-between; gap: 24px; }
/* "Powered by Actuate Labs": same size as the legal links, quieter label, name a touch stronger */
.sf-legal { align-items: center; }
.sf-divider {
  width: 1px;
  height: 14px;
  background: rgba(245, 240, 232, 0.18);
}
.sf-legal a.sf-credit { color: rgba(245, 240, 232, 0.5); display: inline-flex; align-items: center; gap: 7px; }
.sf-credit-logo {
  height: 15px;            /* optically matches the 13px link text */
  width: auto;
  display: block;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.sf-legal a.sf-credit:hover { color: rgba(245, 240, 232, 0.75); }
.sf-legal a.sf-credit:hover .sf-credit-logo { opacity: 1; }
@media (max-width: 768px) {
  .sf-legal { flex-wrap: wrap; row-gap: 12px; }
  /* the desktop 320px flex-basis became a 320px HEIGHT in the stacked layout (empty gap) */
  .sf-brand-col { flex: none; max-width: none; }
  .sf-divider { display: none; }
  .sf-legal a.sf-credit { flex-basis: 100%; }
}
@media (max-width: 768px) {
  .site-footer { padding: 48px 0 0; margin-top: 0; }
  .sf-container { flex-direction: column; gap: 40px; }
  .sf-wordmark { flex-direction: column; align-items: flex-start; gap: 4px; }
  .sf-wordmark .sub { border-left: none; padding-left: 0; display: block !important; }
  .sf-links-grid { flex-direction: column; gap: 40px; }
  .sf-bottom { margin-top: 40px; }
  .sf-bottom-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}


/* --- 3D Graph Styles --- */
.graph-dark-container { background: #0a0f0d; position: relative; width: 100%; height: 100%; overflow: hidden; }
.graph-tooltip { position: absolute; background: rgba(10, 15, 13, 0.9); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; padding: 12px; color: #fff; font-family: 'Figtree', sans-serif; pointer-events: none; z-index: 10; display: none; box-shadow: 0 4px 20px rgba(0,0,0,0.5); backdrop-filter: blur(4px); transform: translate(-50%, -100%); margin-top: -15px; }
.graph-tooltip h4 { margin: 0 0 4px 0; font-size: 15px; font-weight: 600; }
.graph-tooltip p { margin: 0; font-size: 12px; color: #a1a1aa; }
.graph-profile-panel { position: absolute; top: 20px; right: 20px; width: 320px; background: rgba(15, 23, 20, 0.85); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 20px; color: #fff; z-index: 20; transform: translateX(120%); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 0 10px 40px rgba(0,0,0,0.5); display: flex; flex-direction: column; gap: 12px; }
.graph-profile-panel.open { transform: translateX(0); }
.graph-profile-panel .close-btn { position: absolute; top: 12px; right: 12px; background: none; border: none; color: #a1a1aa; cursor: pointer; font-size: 20px; }
.graph-profile-panel .close-btn:hover { color: #fff; }
.graph-profile-panel img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid #10b981; margin-bottom: 8px; }
.graph-profile-panel h3 { margin: 0; font-size: 18px; font-weight: 600; }
.graph-profile-panel p { margin: 0; font-size: 13px; color: #d4d4d8; line-height: 1.4; }
.graph-profile-panel .tag { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: rgba(255,255,255,0.1); color: #e4e4e7; margin: 2px 2px 2px 0; }
.graph-profile-panel .actions { display: flex; gap: 8px; margin-top: 8px; }
.graph-profile-panel .actions a { flex: 1; text-align: center; padding: 8px; border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none; color: #fff; transition: background 0.2s; }
.graph-profile-panel .actions .btn-primary { background: #10b981; }
.graph-profile-panel .actions .btn-primary:hover { background: #059669; }
.graph-profile-panel .actions .btn-secondary { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); }
.graph-profile-panel .actions .btn-secondary:hover { background: rgba(255,255,255,0.2); }
.graph-legend { position: absolute; top: 20px; left: 20px; background: rgba(15, 23, 20, 0.85); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 16px; color: #fff; z-index: 10; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.graph-legend h4 { margin: 0; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #a1a1aa; }
.graph-legend label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; user-select: none; }
.graph-legend input { cursor: pointer; }
.graph-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.graph-legend .dot.focus { background: #10b981; box-shadow: 0 0 8px #10b981; }
.graph-legend .dot.cohort { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.graph-legend .dot.topic { background: #06b6d4; box-shadow: 0 0 8px #06b6d4; }
.ai-spotlight-bar.graph-mode { background: rgba(15, 23, 20, 0.85); border: 1px solid rgba(255,255,255,0.1); color: #fff; }
.ai-spotlight-bar.graph-mode input { color: #fff; }
.ai-spotlight-bar.graph-mode input::placeholder { color: #a1a1aa; }
.ai-spotlight-bar.graph-mode .ai-icon { color: #10b981; }
.ai-spotlight-bar.graph-mode button { background: #10b981; color: #000; }
.ai-spotlight-bar.graph-mode button:hover { background: #34d399; }
#graph-clear-spotlight { position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%); background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(239, 68, 68, 0.5); color: #fca5a5; padding: 6px 16px; border-radius: 20px; font-size: 13px; cursor: pointer; display: none; z-index: 10; transition: all 0.2s; }
#graph-clear-spotlight:hover { background: rgba(239, 68, 68, 0.4); color: #fff; }
@media (max-width: 768px) { .graph-profile-panel { width: calc(100% - 24px); left: 12px; right: 12px; bottom: 12px; top: auto; } }

/* --- Graph Fullscreen & Mobile Optimization --- */
.graph-view:not(.is-fullscreen) {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  position: relative;
  overflow: hidden;
}
.graph-dark-container {
  background: #0a0f0d;
  position: relative;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100%;
  overflow: hidden;
}
.graph-dark-container canvas {
  max-width: 100% !important;
  display: block;
}

.graph-fullscreen-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(18, 33, 25, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  border-radius: 24px;
  padding: 8px 16px;
  color: #ffffff;
  font-family: 'Figtree', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 12px rgba(16, 185, 129, 0.2);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.graph-fullscreen-btn:hover {
  background: #10b981;
  color: #062415;
  border-color: #10b981;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.45);
}
.graph-fullscreen-btn:active {
  transform: translateY(0);
}

.graph-view.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-width: 100vw !important;
  max-height: 100dvh !important;
  border-radius: 0 !important;
  z-index: 999999 !important;
  margin: 0 !important;
}
.graph-view.is-fullscreen #graph-container {
  width: 100vw !important;
  height: 100dvh !important;
  touch-action: none !important;
}
.graph-view.is-fullscreen .graph-fullscreen-btn {
  top: 20px;
  right: 24px;
  background: #122119;
  border: 1.5px solid #10b981;
  color: #ffffff;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 20px rgba(16, 185, 129, 0.4);
}
.graph-view.is-fullscreen .graph-fullscreen-btn:hover {
  background: #10b981;
  color: #062415;
  transform: translateY(-2px);
  box-shadow: 0 10px 36px rgba(16, 185, 129, 0.6);
}

.graph-mobile-touch-hint {
  display: none;
}

@media (max-width: 768px) {
  .graph-view:not(.is-fullscreen) {
    height: 480px !important;
    max-height: 65vh !important;
  }
  .graph-view:not(.is-fullscreen) .graph-dark-container {
    touch-action: pan-y !important;
  }
  .graph-legend {
    top: 12px;
    left: 12px;
    padding: 8px 12px;
    font-size: 11px;
    gap: 6px;
  }
  .graph-fullscreen-btn {
    top: 12px;
    right: 12px;
    padding: 6px 11px;
    font-size: 11px;
  }
  .graph-mobile-touch-hint {
    display: flex;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 10.5px;
    padding: 3px 10px;
    border-radius: 12px;
    pointer-events: none;
    z-index: 9;
    white-space: nowrap;
  }
  .ai-spotlight-bar.graph-mode {
    bottom: 34px !important;
    width: 92% !important;
    padding: 6px 12px !important;
  }
}

/* ==========================================================================
   MOBILE-ONLY ENGINE OPTIMIZATIONS (iOS & Android) — STRICTLY SCOPED <=768px
   ========================================================================== */
@media (max-width: 768px) {

  /* 1. Prevent iOS Auto-Zoom: Enforce min 16px on all touch inputs */
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="password"],
  select,
  textarea,
  .search input,
  .ai-input-bar input,
  .ai-tesla-input,
  #inbox-search-input,
  #inbox-reply-input,
  .ro-textarea {
    font-size: 16px !important;
  }

  /* 2. Dynamic Viewport Unit Fix (iOS dynamic address bar) */
  .login-body,
  .image-modal {
    min-height: 100dvh !important;
    height: 100dvh !important;
  }

  .ai-panel {
    height: min(88dvh, 88vh) !important;
  }

  .graph-view:not(.is-fullscreen) {
    height: calc(100dvh - 150px) !important;
  }

  /* 3. Safe Area Insets (iPhone Notch, Dynamic Island, Home Indicator) */
  .nav {
    padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
  }

  .nav.scrolled {
    padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important;
  }

  .site-footer {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .ai-fab-wrap {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    right: calc(16px + env(safe-area-inset-right, 0px)) !important;
  }

  .ai-fab {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    right: calc(16px + env(safe-area-inset-right, 0px)) !important;
  }

  .ai-panel {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #inbox-drawer {
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }

  /* 4. Touch Responsiveness & Elimination of 300ms Tap Delay */
  button,
  a,
  .card,
  .chip,
  .ai-chip,
  .filter-toggle,
  .view-toggle button {
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  /* 5. Prevent Scroll Bleed & Background Chaining */
  .ai-msgs,
  .sidebar,
  .inbox-modal,
  .image-modal,
  #inbox-list {
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* 6. WebKit Sticky Overflow Fix */
  .dir-main {
    overflow: visible !important;
  }

  /* 7. Zero Horizontal Leak Guarantee */
  html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
}

/* 8. Sticky Hover Bug Suppression (Disable sticky hover on touchscreens) */
@media (hover: none) and (pointer: coarse) {
  .card:hover,
  .chip:hover,
  .ai-chip:hover,
  .btn-magic:hover {
    transform: none !important;
    box-shadow: none !important;
  }
}


