/* ==========================================================================
   Allegheny Eclipse - Member Portal
   Design tokens mirror the mobile app's theme (src/theme/index.ts) exactly,
   so the portal reads as the same product on a bigger screen - not a
   from-scratch look, and not matched to the dark mystic-stage website either.
   ========================================================================== */

:root {
  --purple: #85598E;
  --purple-dark: #220F28;
  --purple-light: #F1EAF3;
  --gold: #C08E2D;
  --gold-dark: #8C651F;
  --black: #231F20;
  --white: #FFFFFF;
  --background: #FAF7FB;
  --surface: #FFFFFF;
  --border: #E4DCE6;
  --text-primary: #231F20;
  --text-secondary: #6B5A70;
  --danger: #B3413B;
  --danger-light: #FBEAE8;
  --success: #3E7A4C;
  --success-light: #EAF4EC;
  --info: #2A6FA3;
  --info-light: #E8F1F9;
  /* Deliberately distinct from --gold (which already means "approved/
     featured" via .badge--gold elsewhere) - this is specifically the
     Action Items due-soon warning color, not a brand accent. */
  --warning: #B8750C;
  --warning-light: #FBEEDD;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(34, 15, 40, 0.06), 0 1px 3px rgba(34, 15, 40, 0.08);
  --shadow-md: 0 4px 12px rgba(34, 15, 40, 0.10), 0 2px 4px rgba(34, 15, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(34, 15, 40, 0.16);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--background);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-dark); }
h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  color: var(--purple-dark);
  text-wrap: balance;
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 var(--space-md); }
p:last-child { margin-bottom: 0; }
button { font-family: inherit; }

.label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.caption { font-size: 13px; color: var(--text-secondary); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- Layout shell ---- */
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 14px var(--space-lg);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  color: var(--purple-dark);
  font-size: 16px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.app-nav__brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--gold));
  flex-shrink: 0;
}
.app-nav__brand-logo {
  width: auto; height: 28px; max-height: 28px;
  display: block;
}
.app-nav__panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 6px;
}
.app-nav__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1 1 auto;
  margin-left: var(--space-lg);
}
.app-nav__link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}
.app-nav__link:hover { background: var(--purple-light); color: var(--purple-dark); }
.app-nav__link.is-active { background: var(--purple); color: var(--white); }
.app-nav__right { display: flex; align-items: center; gap: var(--space-md); flex-shrink: 0; }
.app-nav__user { display: flex; align-items: center; gap: var(--space-sm); font-size: 14px; color: var(--text-secondary); }

/* ---- Presence stack (who else is on the portal right now) ----
   Capped + overlapping, like Google Docs' viewer-avatars - deliberately
   NOT wrap-on-desktop, since the cap already bounds its width to
   something that fits next to the user's own avatar in the nav bar; the
   overflow count (+N) is what "a ton of users" turns into instead of a
   second row. Empty state renders nothing (no placeholder), same spot
   just takes no space. */
.presence-stack { display: flex; align-items: center; }
.presence-stack__avatar,
.presence-stack__more {
  width: 24px; height: 24px; min-width: 24px;
  max-width: none; max-height: none;
  border-radius: 50%;
  border: 2px solid var(--white);
  margin-left: -8px;
  object-fit: cover;
  background: var(--purple-light);
  flex-shrink: 0;
}
.presence-stack__avatar:first-child,
.presence-stack__more:first-child { margin-left: 0; }
.presence-stack__more {
  background: var(--border);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.presence-stack__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
}

.app-nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}
.app-nav__toggle:hover { background: var(--purple-light); }
.app-nav__toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--purple-dark);
  border-radius: 1px;
}

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) var(--space-2xl);
}
.page--narrow { max-width: 480px; }
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.page-header p { color: var(--text-secondary); margin-top: 4px; }

/* ---- Card ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
}
.card + .card { margin-top: var(--space-lg); }
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

/* ---- Auth shell (login/forgot/reset pages) ---- */
.auth-shell {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: radial-gradient(ellipse 900px 500px at 50% -10%, var(--purple-light), var(--background) 65%);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xl);
}
.auth-card__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: var(--space-lg);
}
.auth-card__dot {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-md);
}
.auth-card__logo {
  max-width: 200px; max-height: 200px;
  margin-bottom: var(--space-md);
}
.auth-card__brand h1 { font-size: 20px; }
.auth-card__brand .caption { margin-top: 2px; }

/* ---- Forms ---- */
.field { margin-bottom: var(--space-md); }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(133, 89, 142, 0.15);
}
.field textarea { resize: vertical; min-height: 90px; }
.field .hint { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ---- Searchable select (js/searchable-select.js) ---- */
.searchable-select { position: relative; }
.searchable-select__native {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.searchable-select__input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.searchable-select__input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(133, 89, 142, 0.15);
}
.searchable-select__panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 600;
  max-height: 220px;
  overflow-y: auto;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.searchable-select__option { padding: 9px 12px; font-size: 14px; cursor: pointer; }
.searchable-select__option:hover { background: var(--purple-light); }
.searchable-select__option.is-selected { background: var(--purple-light); font-weight: 600; }
.searchable-select__empty { padding: 9px 12px; font-size: 13px; color: var(--text-secondary); }

.field-row { display: flex; gap: var(--space-md); }
.field-row .field { flex: 1; }
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-sm);
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.checkbox-item:has(input:checked) {
  border-color: var(--purple);
  background: var(--purple-light);
}
.checkbox-item input { width: auto; margin: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
/* Author rules always beat the browser's built-in [hidden]{display:none}
   for the same (non-!important) priority tier, regardless of specificity -
   so .btn's own display:inline-flex was silently winning over `hidden`
   whenever both were set on the same button. This re-asserts it with a
   more specific selector so toggling .hidden on a .btn actually hides it. */
.btn[hidden] { display: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--purple); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--purple-dark); }
.btn-gold { background: var(--gold); color: var(--purple-dark); box-shadow: var(--shadow-sm); }
.btn-gold:hover:not(:disabled) { background: var(--gold-dark); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--purple-dark); border: 1.5px solid var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--purple); background: var(--purple-light); }
.btn-danger { background: var(--white); color: var(--danger); border: 1.5px solid var(--danger-light); }
.btn-danger:hover:not(:disabled) { background: var(--danger-light); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border-radius: var(--radius-sm);
  background: transparent; border: 1.5px solid var(--border); color: var(--text-secondary);
}
.btn-icon:hover:not(:disabled) { border-color: var(--purple); color: var(--purple); }

.btn .spinner { display: none; }
.btn.is-loading .btn-label { visibility: hidden; }
.btn.is-loading .spinner {
  display: block; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: currentColor;
  animation: spin 0.6s linear infinite;
}
.btn { position: relative; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Badges (mirrors mobile ProfileScreen's role pills exactly) ---- */
.badges { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.badge {
  display: inline-flex; align-items: center;
  background: var(--purple);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
}
.badge--outline { background: var(--white); color: var(--purple); border: 1.5px solid var(--purple); }
.badge--gold { background: var(--gold); color: var(--purple-dark); }
.badge--muted { background: var(--border); color: var(--text-secondary); }
.badge--danger { background: var(--danger); color: var(--white); }
.badge--warning { background: var(--warning-light); color: var(--warning); }
.badge--success { background: var(--success-light); color: var(--success); }
.badge--info { background: var(--info-light); color: var(--info); }

/* ---- Tag (small inline flag next to a name, e.g. "Guest") ----
   Deliberately smaller/quieter than .badge, which is sized for a wrapped
   row of role pills, not for sitting inline next to a name in a table
   cell - same compact-pill treatment as .board-card__founder-badge. */
.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  vertical-align: middle;
}
/* Same compact pill as .tag, gold instead of muted - the "approved/
   featured" meaning .badge--gold already carries elsewhere, scaled down
   for sitting inline next to a season/tier name instead of a status row. */
.tag--gold { color: var(--purple-dark); background: var(--gold); }

/* ---- Person link (Auth.personLink()) ----
   Subtle, not a loud pill badge - a name should still read as a name, just
   with a quiet signal that it's clickable. */
.person-link {
  color: var(--purple);
  font-weight: 600;
  text-decoration: none;
}
.person-link:hover { text-decoration: underline; }

/* ---- Avatar ----
   max-width/max-height: none overrides the global `img { max-width: 100% }`
   reset - without it, a fixed width can get capped below its set value by a
   narrow table column while height stays untouched, squishing the circle
   into an oval. */
.avatar {
  width: 40px; height: 40px; min-width: 40px;
  max-width: none; max-height: none;
  border-radius: 50%;
  object-fit: cover; border: 2px solid var(--border); flex-shrink: 0;
  background: var(--purple-light);
}
.avatar--lg { width: 88px; height: 88px; min-width: 88px; border-width: 3px; border-color: var(--gold); }
.avatar--md { width: 56px; height: 56px; min-width: 56px; border-width: 3px; border-color: var(--gold); }
.avatar--sm { width: 32px; height: 32px; min-width: 32px; }
.avatar--nav { width: 28px; height: 28px; min-width: 28px; }
.avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--purple); color: var(--white); font-weight: 700;
}

/* ---- Alerts / toasts ---- */
.alert {
  display: flex; align-items: flex-start; gap: var(--space-sm);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: var(--space-md);
}
.alert--error { background: var(--danger-light); color: var(--danger); }
.alert--info { background: var(--info-light); color: var(--info); }
.alert--warning { background: var(--warning-light); color: var(--warning); }
.alert--lg {
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  font-size: 14px;
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}
.alert--lg .alert__icon { font-size: 20px; flex: none; }
.alert--lg .alert__body { flex: 1; min-width: 200px; }
.alert--lg .alert__actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.alert--success { background: var(--success-light); color: var(--success); }
.toast-stack {
  position: fixed; top: var(--space-lg); right: var(--space-lg); z-index: 1000;
  display: flex; flex-direction: column; gap: var(--space-sm);
}
.toast {
  min-width: 260px; max-width: 360px;
  background: var(--purple-dark); color: var(--white);
  padding: 12px 16px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  animation: toast-in 0.2s ease;
}
.toast--error { background: var(--danger); }
.toast--success { background: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Table / list ---- */
.list-row {
  display: flex; align-items: center; gap: var(--space-md);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row__main { flex: 1; min-width: 0; }
.list-row__title { font-weight: 700; color: var(--text-primary); }
.list-row__sub { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.list-row__actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-secondary); font-weight: 600; padding: 8px 10px; border-bottom: 2px solid var(--border);
}
.data-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }

.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-secondary);
}
.empty-state h3 { color: var(--text-secondary); margin-bottom: 6px; }

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, #f0eaf2 37%, var(--border) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(34, 15, 40, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-lg);
  z-index: 500;
  animation: fade-in 0.15s ease;
}
.modal-overlay[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 560px; max-height: 88vh;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: modal-in 0.18s cubic-bezier(.2,.8,.2,1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-lg); border-bottom: 1px solid var(--border);
}
.modal__body { padding: var(--space-lg); overflow-y: auto; }
.modal__footer {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--space-sm);
  padding: var(--space-lg); border-top: 1px solid var(--border);
}

/* ---- Pagination ---- */
.pagination { display: flex; align-items: center; justify-content: center; gap: var(--space-sm); margin-top: var(--space-lg); }
.pagination .caption { margin: 0 var(--space-sm); }

/* ---- Misc ---- */
.divider { height: 1px; background: var(--border); margin: var(--space-lg) 0; }

/* ---- Collapsible section toggle (History, etc.) ---- */
.collapsible-toggle {
  display: flex; align-items: center; gap: 6px;
  width: 100%; background: none; border: none; padding: 4px 0;
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  cursor: pointer; text-align: left;
}
.collapsible-toggle__chevron { transition: transform 0.15s ease; font-size: 11px; }
.collapsible-toggle.is-open .collapsible-toggle__chevron { transform: rotate(180deg); }
.collapsible-body { margin-top: var(--space-sm); }
.stack { display: flex; flex-direction: column; gap: var(--space-md); }
.row { display: flex; align-items: center; gap: var(--space-md); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; row-gap: var(--space-xs); }
.full-center { min-height: 50vh; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); }

.btn-add {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1.5px dashed var(--purple);
  color: var(--purple); font-weight: 600; font-size: 13px;
  padding: 6px 14px 6px 10px; border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-add:hover { background: var(--purple-light); border-color: var(--purple-dark); color: var(--purple-dark); }
.btn-add__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--purple); color: var(--white);
  font-size: 12px; font-weight: 700; line-height: 1;
  flex-shrink: 0;
}
.btn-add:hover .btn-add__icon { background: var(--purple-dark); }

/* ---- Agenda items / motions (meeting.html) ----
   Agenda items used to reuse the heavy top-level `.card` (border + shadow +
   full padding) at every nesting depth, so a deeply-nested item sat inside
   several stacked boxes-in-boxes. These are flatter list rows instead -
   a left accent bar plus a bottom rule - so depth reads from indentation,
   not from compounding shadows. */
.agenda-item {
  border-left: 3px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) 0 var(--space-md) var(--space-md);
}
.agenda-item:last-child { border-bottom: none; }
.agenda-item--category { border-left-color: var(--gold); }
/* The tint belongs to the Category's own header row only - not its
   sub-items, which are siblings of `.agenda-item__body` rendered after it
   inside the same `.agenda-item`, so they're outside this selector and
   stay plain. The left border above still runs the full height of the
   outer `.agenda-item`, so it keeps visually "containing" the sub-items. */
.agenda-item--category > .agenda-item__body {
  background: var(--purple-light);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin: calc(-1 * var(--space-sm)) 0 var(--space-xs) calc(-1 * var(--space-md));
}
.item-number {
  display: inline-block;
  font-weight: 700;
  color: var(--text-secondary);
  margin-right: 6px;
}
.agenda-item--category .item-number { color: var(--gold-dark); }
.item-number-title { font-size: 16px; color: var(--purple-dark); }
.item-type-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 3px;
}

.motion-card {
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-sm);
  background: var(--purple-light);
  padding: var(--space-md);
  margin-top: var(--space-md);
}
.motion-card + .motion-card { margin-top: var(--space-sm); }

.app-footer {
  display: flex; align-items: center; justify-content: center; gap: var(--space-sm);
  padding: var(--space-lg); margin-top: var(--space-xl);
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-secondary);
}
.app-footer a { color: var(--text-secondary); text-decoration: underline; }
.app-footer a:hover { color: var(--purple); }

/* ---- Board roster (about.html) ---- */
.board-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}
.board-card {
  position: relative; /* anchor for a .card-link-overlay child, if any */
  display: flex; align-items: center; gap: var(--space-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
/* Only cards that actually link somewhere (have a .card-link-overlay
   child) get the "this is clickable" affordance - e.g. about.html's
   "Vacant" seat card has nothing to click through to. */
.board-card:has(.card-link-overlay):hover {
  box-shadow: var(--shadow-md);
  border-color: var(--purple);
}
.board-card__name { font-size: 15px; font-weight: 700; color: var(--purple-dark); margin-top: 2px; }
.board-card__founder-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--purple-dark);
  background: var(--gold);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  margin-top: 4px;
}
.board-card__email { font-size: 12px; margin-top: 2px; }

/* ---- Card-wide click-through link ----
   Lets an entire card (.board-card today - leadership/BOD roster - and
   any future member-card surface) link out to that member's profile
   without making the card itself a literal <a> (an anchor can't usefully
   contain further interactive sub-links like a mailto: or LinkedIn icon -
   browsers either disallow the nesting or make the inner link
   unreachable). Instead this is an empty, label-only anchor placed as a
   SIBLING that absolutely fills the card and sits BELOW every other
   sub-link in stacking order, so it only catches clicks that don't land
   on something more specific. Any sub-link that must stay independently
   clickable (email, LinkedIn, etc.) needs `.card-link-overlay__exempt`
   added to IT directly, which lifts it back above the overlay. Pairs with
   Auth.personCardOverlay(userId, displayName) in js/auth.js, which builds
   the overlay tag itself (escaped + correctly href'd) so call sites don't
   hand-roll it. Requires the containing card to be `position: relative`
   (e.g. .board-card already is) for `inset: 0` to size against it. */
.card-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.card-link-overlay__exempt {
  position: relative;
  z-index: 2;
}

/* ---- Badge icon (profile trophy case + admin catalog) - square/shield
   art, deliberately NOT .avatar's circle, but echoing its gold-border
   treatment for an "important" image so the two idioms visually rhyme. ---- */
.badge-icon {
  width: 56px; height: 56px; min-width: 56px;
  max-width: none; max-height: none;
  border-radius: var(--radius-sm);
  object-fit: cover; border: 2px solid var(--gold);
  background: var(--purple-light);
  flex-shrink: 0;
}
.badge-icon--lg { width: 200px; height: 200px; min-width: 200px; border-width: 3px; margin: 0 auto; display: block; }
/* Bigger than the base 56px specifically for profile.html's trophy case -
   earned badges are meant to be showcased/distinguishable at a glance,
   not just a small inventory-list icon like the admin catalog row uses. */
.badge-icon--trophy { width: 84px; height: 84px; min-width: 84px; border-width: 3px; }

/* ---- Trophy case (profile.html's Badges card) - auto-fill/minmax
   instead of .board-grid's fixed 2-column layout, since this holds
   anywhere from a couple badges to a dozen+ and should wrap naturally at
   any width without its own breakpoint override. Column minimum bumped
   alongside .badge-icon--trophy's larger size so tiles don't feel cramped. */
.trophy-case {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: var(--space-md);
}
.trophy-case__item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; padding: var(--space-xs);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}
.trophy-case__item:hover { background: var(--purple-light); }
.trophy-case__name { text-align: center; }

/* ---- Sponsor wall (sponsors.html) - same auto-fill/minmax reasoning as
   .trophy-case above: an unpredictable, growing number of sponsors
   should wrap naturally rather than need its own breakpoint tuning. */
.sponsor-wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-lg);
}
.sponsor-wall-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md);
}
.sponsor-wall-card img { width: 100%; max-width: 140px; height: 100px; object-fit: contain; margin-bottom: var(--space-sm); }
.sponsor-wall-card__tier {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--purple-dark);
}
.sponsor-wall-card__name { font-size: 14px; font-weight: 600; margin-top: 2px; }

/* ---- Lightbox modal variant (badge detail) - narrower + centered than
   the default form-shaped .modal, since this is one image + three lines
   of read-only text, not a form. Reuses .modal-overlay/.modal__header/
   .modal__body/.modal__footer and the existing fade/scale-in animation
   as-is. ---- */
.modal--lightbox { max-width: 360px; }
.modal--lightbox .modal__body { text-align: center; }

/* ---- Admin nav dropdown ("Admin ▾") - first dropdown pattern in this
   codebase. Desktop: absolutely-positioned panel under the trigger,
   shown/hidden via .is-open exactly like the mobile hamburger drawer
   already does. Mobile behavior is defined inside the 1024px media query
   below, where the same .is-open toggle instead expands an indented
   sub-list inline in the drawer. ---- */
.app-nav__dropdown { position: relative; }
.app-nav__dropdown-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  font-family: inherit;
}
.app-nav__dropdown-caret { transition: transform 0.15s ease; font-size: 11px; }
.app-nav__dropdown-trigger.is-open .app-nav__dropdown-caret { transform: rotate(180deg); }
.app-nav__dropdown-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  margin-top: 4px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 110;
}
.app-nav__dropdown-panel.is-open { display: flex; flex-direction: column; }
.app-nav__dropdown-item {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}
.app-nav__dropdown-item:hover { background: var(--purple-light); color: var(--purple-dark); }
.app-nav__dropdown-item.is-active { background: var(--purple); color: var(--white); }

/* 1024px, not 680px -- .app-nav__links now wraps onto a second line on
   desktop/laptop widths when a user holds enough roles to fill the row
   (was a fixed "never wraps, budgeted for ~8 links" assumption, which
   broke the day a 9th item - the Giving dropdown - got added; wrapping
   is the correct fix since there's no real upper bound on how many
   role-gated nav items a single user might eventually hold at once).
   Below 1024px there's no useful width left to wrap INTO even with that
   fix (a board member's full link row still doesn't fit any iPad width,
   portrait or landscape), so the hamburger drawer takes over instead. */
@media (max-width: 1024px) {
  .app-nav__toggle { display: flex; }
  .app-nav__panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: var(--space-md) var(--space-lg);
  }
  .app-nav__panel.is-open { display: flex; }
  .app-nav__links { flex-direction: column; align-items: stretch; gap: 4px; margin-left: 0; }
  .app-nav__link { padding: 10px 14px; }
  .app-nav__right { justify-content: space-between; flex-wrap: wrap; }
  /* Inside the hamburger drawer there's room to breathe, so the cap goes
     away and overlap turns into normal wrapped spacing - a grid of small
     avatars reads better there than a second overlapping row would. */
  .presence-stack {
    flex-wrap: wrap;
    row-gap: var(--space-xs);
    width: 100%;
    order: 3;
  }
  .presence-stack__avatar,
  .presence-stack__more {
    margin-left: 0;
    margin-right: 6px;
  }
  .page { padding: var(--space-lg) var(--space-md) var(--space-xl); }
  .field-row { flex-direction: column; gap: 0; }
  .board-grid { grid-template-columns: 1fr; }

  /* Inside the drawer, the dropdown is just another stacked link that
     expands an indented sub-list in place on tap - a disclosure nested
     inside a disclosure would be one interaction too many on a small
     screen, so this reuses the exact same .is-open toggle the JS already
     fires on click, only the CSS positioning/display differs. */
  .app-nav__dropdown { position: static; }
  .app-nav__dropdown-trigger { width: 100%; padding: 10px 14px; justify-content: space-between; }
  .app-nav__dropdown-panel {
    position: static;
    box-shadow: none;
    border: none;
    margin-top: 0;
    padding-left: var(--space-md);
  }
}
