:root {
  /* Brand palette tuned to the FlightFolk hangar logo:
     navy wordmark · amber/gold plane · wood hangar · cream banner · red chevrons */
  --sky: #9E5A2B;          /* copper brown: primary structural color */
  --sky-dark: #5E3316;     /* deep copper */
  --sky-light: #F6E6C4;    /* warm pale gold (pairs with copper text) */
  --mountain: #2E6B41;     /* forest green: kept for success semantics only */
  --mountain-light: #D7EBDA;
  --sunset: #C4830E;       /* amber/gold plane: hero accent */
  --sunset-light: #FBEACB;
  --snow: #FBF6EC;         /* warm off-white */
  --stone: #7A6A55;        /* warm stone */
  --stone-light: #E7DCC9;
  --text: #241C12;         /* warm near-black */
  --text-secondary: #6E5E4A;
  --card-bg: #FFFDF8;      /* warm white card */
  --border: #E7DBC5;
  --danger: #B4362B;       /* logo chevron red */
  --wood: #7A5230;         /* hangar wood: header warmth */
  --wood-dark: #4E3620;
  --slate: #93A3BC;        /* slate blue: complements the copper/amber palette */
  --slate-light: #C2CDDC;  /* pale slate */
  --slate-deep: #76879F;   /* deeper slate anchor */
  /* Page wallpaper. Tenant-overridable: this is a brand value, not a layout value;
     when brand.json lands it moves there. Warm greige: neutral enough that the copper
     header and cream cards both separate from it, warm enough not to read as concrete. */
  --bg: linear-gradient(160deg, #E6DFD2 0%, #D8CEBC 55%, #C7BAA4 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Segoe UI', -apple-system, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(rgba(255,255,255,0.38) 1px, transparent 1.4px) 0 0 / 22px 22px,
    radial-gradient(rgba(78,54,32,0.07) 1px, transparent 1.4px) 11px 11px / 22px 22px,
    var(--bg);
  background-attachment: fixed;
}

/* ==================== HEADER ==================== */
header {
  background:
    linear-gradient(90deg, rgba(28,16,6,0.58) 0%, rgba(58,32,14,0.30) 42%, rgba(28,16,6,0.60) 100%),
    url('assets/banner-wall.png') center/cover no-repeat;
  color: #fff;
  padding: 0;
  box-shadow: 0 4px 20px rgba(94,51,22,0.35);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 24px;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header-right { display: flex; align-items: center; gap: 12px; }
.hamburger {
  display: none;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.35);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  padding: 6px 13px;
  border-radius: 8px;
  cursor: pointer;
}
.hamburger:hover { background: rgba(255,255,255,0.28); }
.logo { display: flex; align-items: center; gap: 12px; }
.logo h1 { font-size: 1.5em; font-weight: 800; letter-spacing: 1px; }
.logo .tagline { font-size: 0.75em; opacity: 0.85; font-weight: 300; }
.logo-icon {
  width: 48px; height: 48px; background: rgba(255,255,255,0.15);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.logo-lockup {
  height: 132px; width: auto; display: block; margin-right: 6px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

.state-selector { margin-left: 0; }
.state-selector select {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95em;
  cursor: pointer;
  min-width: 200px;
  appearance: auto;
}
.state-selector select:hover { border-color: rgba(255,255,255,0.6); }
.state-selector select:focus { outline: none; border-color: rgba(255,255,255,0.7); }
.state-selector select option { background: var(--sky-dark); color: #fff; }

/* ==================== SIDEBAR NAV ====================
   Web app gets a persistent left rail; the hamburger drawer is kept for narrow
   screens only. --header-h is written by app.js from the real header height, so
   the rail sticks directly under the sticky header at any logo size. */
.layout {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.sidebar {
  flex: 0 0 232px;
  width: 232px;
  align-self: flex-start;
  position: sticky;
  top: var(--header-h, 168px);
  /* min = max so the rail always reads as a full-height rail, not a stubby block;
     matters for white-label tenants that ship fewer tabs than MPA. */
  min-height: calc(100vh - var(--header-h, 168px));
  max-height: calc(100vh - var(--header-h, 168px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 12px 24px;
  /* Opaque, not translucent: as a mobile drawer it sits directly over page
     content, and even 6% bleed leaves the welcome banner legible through it. */
  background: linear-gradient(180deg, #5E3316 0%, #4E3620 100%);
  border-right: 1px solid rgba(255,255,255,0.14);
  box-shadow: 2px 0 14px rgba(94,51,22,0.18);
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); border-radius: 4px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-group { display: flex; flex-direction: column; gap: 3px; margin-top: 14px; }
.nav-group-title {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--sunset-light);
  opacity: 0.75;
  padding: 4px 10px 5px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  color: #fff;
  padding: 9px 11px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.25;
  transition: background 0.15s, border-color 0.15s;
  /* Caps for legibility in the rail and the mobile drawer. Tracking is required
     or the letters close up at this size; the emoji icon is excluded below. */
  text-transform: uppercase;
  letter-spacing: 0.045em;
}
.nav-btn .nav-ico { flex: 0 0 auto; font-size: 15px; width: 19px; text-align: center; }
.nav-btn .nav-label { flex: 1 1 auto; }
.nav-btn:hover { background: rgba(255,255,255,0.14); }
.nav-btn.active {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.28);
  border-left-color: var(--sunset);
  font-weight: 700;
}
/* Hidden when every button inside is role-gated away, set by applyRoleUI() */
.nav-group.group-empty { display: none; }
.nav-backdrop { display: none; }

/* ==================== MAIN ==================== */
main { flex: 1 1 auto; min-width: 0; padding: 24px; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ==================== CARDS ==================== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-top: 16px; }
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(78,54,32,0.13), 0 1px 2px rgba(78,54,32,0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(78,54,32,0.18); }
.card h3 { font-size: 1em; color: var(--sky-dark); margin-bottom: 8px; }
.card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ==================== STATS ==================== */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(78,54,32,0.13), 0 1px 2px rgba(78,54,32,0.08);
}
.stat-card .stat-value { font-size: 2em; font-weight: 800; color: var(--sky-dark); }
.stat-card .stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.stat-card .stat-icon { font-size: 1.6em; margin-bottom: 8px; }

/* ==================== BADGES ==================== */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
}
.badge-sky { background: var(--sky-light); color: var(--sky-dark); }
.badge-mountain { background: var(--mountain-light); color: var(--mountain); }
.badge-sunset { background: var(--sunset-light); color: var(--sunset); }
.badge-danger { background: #FEE2E2; color: var(--danger); }
.badge-passed { background: #D1FAE5; color: #065F46; }
.badge-committee { background: #FEF3C7; color: #92400E; }

/* ==================== MAP ==================== */
#airport-map { height: 500px; border-radius: 12px; border: 1px solid var(--border); margin: 16px 0; }

/* ==================== FILTERS ==================== */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters select, .filters input {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 13px; background: var(--card-bg);
}

/* ==================== TABLES ==================== */
.data-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 12px; background: var(--sky-light); color: var(--sky-dark); font-weight: 600; border-bottom: 2px solid var(--border); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-table tr:hover { background: rgba(158,90,43,0.05); }

/* ==================== FORMS ==================== */
.form-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.btn-primary {
  background: var(--sky); color: #fff; border: none; padding: 10px 20px;
  border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--sky-dark); }
.btn-success { background: var(--mountain); }
.btn-success:hover { background: #1F4D2E; }

/* ==================== SECTION HEADERS ==================== */
.section-header { margin-bottom: 20px; }
/* Page titles are set in caps. Styling only, so the markup keeps its title-case
   text for the document outline, screen readers and any copy/paste. The extra
   letter-spacing is not optional: caps at this weight close up without it. The
   dashboard hero (.welcome-banner h2) is a sentence, not a title, and is left
   alone deliberately. */
.section-header h2 {
  font-size: 1.4em;
  color: var(--sky-dark);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}
.section-header p { color: var(--text-secondary); font-size: 14px; }

/* ==================== BOARD MEMBER CARDS ==================== */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.board-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; text-align: center;
}
.board-card .board-icon { font-size: 2.2em; margin-bottom: 8px; }
.board-card .board-name { font-weight: 700; color: var(--sky-dark); font-size: 1em; }
.board-card .board-role { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.board-card .board-loc { font-size: 11px; color: var(--stone); margin-top: 4px; }

/* ==================== CHAPTER LIST ==================== */
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 16px; }
.chapter-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; display: flex; align-items: center; gap: 12px;
}
.chapter-card .ch-icon { font-size: 1.8em; }
.chapter-card .ch-name { font-weight: 600; color: var(--sky-dark); }
.chapter-card .ch-pres { font-size: 12px; color: var(--text-secondary); }
.chapter-card .ch-region { font-size: 11px; }

/* ==================== LEGISLATIVE ==================== */
.leg-card { border-left: 4px solid var(--sky); }
.leg-card.passed { border-left-color: var(--mountain); }
.leg-card.action { border-left-color: var(--sunset); }

/* ==================== EVENT CALENDAR ==================== */
.event-card { position: relative; overflow: hidden; }
.event-type {
  position: absolute; top: 12px; right: 12px; padding: 3px 10px;
  border-radius: 12px; font-size: 11px; font-weight: 600;
}
.event-date { font-size: 0.85em; color: var(--sunset); font-weight: 600; margin-bottom: 4px; }

/* ==================== PIREP CARDS ==================== */
.pirep-card { border-left: 4px solid var(--sky); }
.pirep-urgent { border-left-color: var(--danger); }

/* ==================== RESPONSIVE ==================== */
/* Tablet: keep the rail, just narrow it before dropping to the drawer. */
@media (max-width: 1100px) {
  .sidebar { flex-basis: 196px; width: 196px; padding: 14px 9px 20px; }
  .nav-btn { font-size: 12.5px; padding: 8px 9px; gap: 7px; }
}

/* Phone/tablet portrait: sidebar becomes the hamburger drawer (iOS behaviour). */
@media (max-width: 900px) {
  .hamburger { display: block; flex-shrink: 0; }
  .header-top { align-items: center; gap: 8px; }
  .header-right { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
  .state-selector { flex: 1 1 auto; min-width: 0; }
  .state-selector select { min-width: 0; width: 100%; }
  /* Phone: logo + hamburger on row 1; association and role selectors drop
     to their own full-width row so they never sit on top of the lockup. */
  .header-top { flex-wrap: wrap; row-gap: 10px; }
  .header-right { display: contents; }
  .logo { order: 1; flex: 1 1 auto; min-width: 0; }
  .hamburger { order: 2; }
  .state-selector { order: 3; flex: 1 1 0; }
  .role-switcher { order: 4; flex: 1 1 0; min-width: 0; padding: 4px 8px; }
  .role-switcher select { width: 100%; font-size: 14px; }
  .account-chip { order: 4; flex: 1 1 100%; justify-content: space-between; }
  .layout { display: block; }
  .sidebar {
    position: fixed;
    top: var(--header-h, 168px);
    left: 0;
    bottom: 0;
    z-index: 90;
    width: 268px;
    flex-basis: auto;
    max-height: none;
    /* Must clear the desktop rule's min-height: calc(100vh - header). On iOS
       100vh is the *large* viewport (toolbars hidden), so it exceeds the real
       height of a top/bottom-anchored fixed drawer and forces ~80-100px of
       phantom scroll: the list scrolls away under the header and leaves dead
       space below Settings. The top/bottom anchors already size the drawer. */
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    padding: 16px 12px calc(32px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 4px 0 24px rgba(20,10,4,0.4);
  }
  .sidebar.open { transform: translateX(0); }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: var(--header-h, 168px) 0 0 0;
    background: rgba(20,10,4,0.45);
    z-index: 89;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  .nav-backdrop.open { opacity: 1; pointer-events: auto; }
  .nav-btn { font-size: 14px; padding: 11px 12px; }
}

@media (max-width: 768px) {
  .logo-lockup { height: 84px; }
  .form-row { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  main { padding: 16px; }
  /* Caps plus tracking costs real width; the longest titles ("Explore Montana:
     Airports, Events & Community") otherwise wrap to three lines on a phone. */
  .section-header h2 { font-size: 1.22em; letter-spacing: 0.035em; }
}

/* ==================== WELCOME BANNER ==================== */
.welcome-banner {
  background: linear-gradient(135deg, var(--sky-dark), var(--sky), var(--wood));
  color: #fff;
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.welcome-banner h2 { font-size: 1.6em; margin-bottom: 8px; }
.welcome-banner p { opacity: 0.9; font-size: 14px; line-height: 1.6; }
.welcome-banner .founded { font-size: 12px; opacity: 0.7; margin-top: 12px; }

/* ==================== SAFETY TAB ==================== */
#tab-safety .welcome-banner { margin-bottom: 20px; }
#tab-safety .form-card { border-left: 4px solid var(--mountain); }

/* ==================== DIRECTORY SUB-MENU ==================== */
.dir-submenu {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px;
  padding: 6px; background: var(--sky-light); border-radius: 12px;
}
.dir-btn {
  background: transparent; border: none; padding: 10px 16px;
  border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--sky-dark); transition: all 0.2s;
}
.dir-btn:hover { background: rgba(158,90,43,0.1); }
.dir-btn.active { background: var(--sky); color: #fff; font-weight: 700; box-shadow: 0 2px 8px rgba(158,90,43,0.28); }

.dir-section { display: none; }
.dir-section.active { display: block; }

/* Interest checkboxes */
.interest-check {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; padding: 4px 10px; background: var(--snow);
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
}
.interest-check:hover { background: var(--sky-light); }
.interest-check input { margin: 0; }

/* Member cards */
.member-card { position: relative; }
.member-card .member-aircraft { font-size: 12px; color: var(--sky); font-weight: 500; }
.member-card .member-interests { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.member-card .member-interests .badge { font-size: 10px; padding: 2px 8px; }

/* Organization badges */
.org-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; color: white; white-space: nowrap; }
.org-mpa { background: #1D6B3F; }
.org-eaa { background: #1565C0; }
.org-aopa { background: #D32F2F; }
.org-raf { background: #4E342E; }
.org-cap { background: #283593; }
.org-99s { background: #7B1FA2; }
.org-mtaero, .org-mt\ aero { background: #455A64; }

/* ==================== ROLE SWITCHER (smart permissions) ==================== */
.role-switcher { display: flex; align-items: center; gap: 4px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); border-radius: 8px; padding: 2px 6px; }
.role-switcher .role-lock { font-size: 13px; }
.role-switcher select { background: transparent; color: #fff; border: none; font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 2px; }
.role-switcher select option { color: var(--text); }
body[data-role="officer"] .role-switcher { background: rgba(196,131,14,0.28); border-color: var(--sunset); }

/* Restricted nav button + lock pip */
.nav-btn.restricted-nav { position: relative; }
.lock-pip { font-size: 0.7em; opacity: 0.75; flex: 0 0 auto; margin-left: auto; }
body[data-role="officer"] .lock-pip { display: none; }

/* Role-gated blocks: hidden by default, revealed by body[data-role] */
.officer-only, .sponsor-only { display: none; }
body[data-role="officer"] .officer-only { display: block; }
body[data-role="officer"] .stats-row.officer-only,
body[data-role="officer"] #funding-summary-wrap { display: block; }
body[data-role="sponsor"] .sponsor-only { display: block; }

/* Funding tab layout */
.funding-section { margin: 22px 0; }
.subsection-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.subsection-head h3 { color: var(--sky-dark); font-size: 1.05rem; }
.role-note { font-size: 12px; font-weight: 600; color: var(--sunset); }
.table-wrap { overflow-x: auto; }
.funding-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.funding-card .fc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.funding-card h4 { color: var(--sky-dark); font-size: 1rem; }
.funding-card .fc-meta { font-size: 12px; color: var(--text-secondary); }
.funding-card .fc-actions { display: flex; gap: 8px; margin-top: 8px; }
.tier-chip { font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 10px; color: #fff; white-space: nowrap; }
.tier-platinum { background: #6D7B8D; } .tier-gold { background: #C4830E; } .tier-silver { background: #9AA7AF; } .tier-bronze { background: #A66A3B; }
.btn-mini { font-size: 11px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--snow); cursor: pointer; color: var(--text); }
.btn-mini:hover { background: var(--sky-light); }
.btn-mini.danger { color: var(--danger); border-color: #E7C4C0; }
.prize-progress { height: 7px; background: var(--stone-light); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.prize-progress > span { display: block; height: 100%; background: var(--mountain); }

/* Modal */
.funding-modal { position: fixed; inset: 0; background: rgba(30,20,10,0.55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 1000; overflow-y: auto; }
.funding-modal-inner { max-width: 560px; width: 100%; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-secondary); }

/* ==================== CONDITIONS: Field Reports + PIREPs ==================== */
.advisory-banner {
  background: linear-gradient(135deg, #FFF7E6 0%, #FDEBC8 100%);
  border: 1px solid #E9C989; border-left: 4px solid var(--sky);
  border-radius: 12px; padding: 14px 18px; margin-bottom: 18px;
}
.advisory-banner .advisory-title { font-weight: 700; color: var(--sky-dark); margin-bottom: 6px; font-size: 14px; }
.advisory-banner p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; margin: 0; }

.cond-toggle { display: flex; gap: 8px; margin-bottom: 18px; }
.cond-seg {
  flex: 1; cursor: pointer; text-align: center;
  padding: 12px 10px; border-radius: 12px; font-weight: 700; font-size: 15px;
  border: 1px solid var(--border); background: var(--card-bg); color: var(--stone);
  display: flex; flex-direction: column; gap: 2px; transition: all .15s;
}
.cond-seg span { font-size: 11px; font-weight: 500; opacity: .8; }
.cond-seg:hover { background: var(--sky-light); }
.cond-seg.active { background: var(--sky-dark); color: #fff; border-color: var(--sky-dark); }
.cond-seg.active span { opacity: .85; }

.cond-lead { font-size: 13px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 14px; padding: 0 2px; }

/* Scope panel: who Field Reports are for (any non-towered unimproved field) */
.dirt-scope {
  background: linear-gradient(135deg, #FBF6EC 0%, #F1E7D4 100%);
  border: 1px solid var(--border); border-left: 4px solid var(--wood);
  border-radius: 12px; padding: 14px 18px; margin-bottom: 18px;
}
.dirt-scope-title { font-weight: 700; color: var(--sky-dark); font-size: 14px; margin-bottom: 6px; }
.dirt-scope p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 8px; }
.dirt-scope p:last-child { margin-bottom: 0; }
.dirt-scope strong { color: var(--sky-dark); }
.dirt-scope-note { font-style: italic; padding-top: 8px; border-top: 1px dashed var(--border); }

.dirt-ack { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--text-secondary); margin: 4px 0 14px; line-height: 1.4; cursor: pointer; }
.dirt-ack input { margin-top: 2px; }

/* Field Report cards */
.dirt-card { margin-bottom: 10px; border-left: 4px solid var(--stone); }
.dirt-card.st-good { border-left-color: #2E9E5B; }
.dirt-card.st-caution { border-left-color: #D8901E; }
.dirt-card.st-closed { border-left-color: var(--danger); }
.dirt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.dirt-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.dirt-pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: var(--sky-light); color: var(--sky-dark); }
.dirt-pill.status-good { background: #DBF3E4; color: #1E7A42; }
.dirt-pill.status-caution { background: #FBEBCB; color: #9A6410; }
.dirt-pill.status-closed { background: #FEE2E2; color: var(--danger); }
.age-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.age-fresh { background: #DBF3E4; color: #1E7A42; }
.age-aging { background: #FBEBCB; color: #9A6410; }
.age-stale { background: #EDE6DA; color: #6E5E4A; }
.dirt-advisory { font-size: 11px; color: var(--stone); font-style: italic; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.dirt-reporter { font-size: 12px; color: var(--stone); margin-top: 6px; }

/* ==================== ADVISORY BANNER (missions how-it-works) ==================== */
.advisory-banner { background: var(--sunset-light); border: 1px solid #E8C98A; border-left: 4px solid var(--sunset); border-radius: 12px; padding: 14px 18px; font-size: 12.5px; line-height: 1.55; color: var(--text); margin-bottom: 18px; }
.advisory-banner strong { color: var(--sky-dark); }
.mini-select { font-size: 12px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--snow); color: var(--text); }

/* ==================== MISSION CARDS ==================== */
.mission-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; border-left: 4px solid var(--slate-deep); }
.mission-card.st-matched { border-left-color: var(--mountain); }
.mission-card.st-completed { border-left-color: var(--stone); opacity: 0.82; }
.mission-card .mc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mission-card h4 { color: var(--sky-dark); font-size: 1.02rem; line-height: 1.3; }
.mission-card .mc-org { font-size: 12px; color: var(--sunset); font-weight: 700; }
.mission-card .mc-desc { font-size: 13px; color: var(--text); line-height: 1.5; }
.mission-card .mc-meta { font-size: 12px; color: var(--text-secondary); }
.mission-card .mc-req { font-size: 12px; color: var(--text-secondary); background: var(--sky-light); border-radius: 8px; padding: 6px 10px; }
.mission-card .mc-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mc-pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: var(--stone-light); color: var(--text-secondary); }
.mc-pill.urg-high { background: #FEE2E2; color: var(--danger); }
.mc-pill.urg-normal { background: var(--sky-light); color: var(--sky-dark); }
.mc-pill.urg-low { background: var(--mountain-light); color: var(--mountain); }
.mc-pill.cat { background: var(--slate-light); color: var(--slate-deep); }
.mc-pill.status-open { background: var(--sunset-light); color: var(--sunset); }
.mc-pill.status-matched { background: #D1FAE5; color: #065F46; }
.mc-pill.status-completed { background: var(--stone-light); color: var(--text-secondary); }
.mc-pilot { font-size: 12px; color: var(--mountain); font-weight: 600; }
.mc-offers { border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 8px; }
.mc-offer { font-size: 12px; color: var(--text-secondary); display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; }
.mc-offer .mc-offer-body strong { color: var(--sky-dark); }
.mc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.mc-advisory { font-size: 11px; color: var(--stone); font-style: italic; margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--border); }

/* ==================== STORE ==================== */
.store-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.store-card .sc-art { font-size: 3.4rem; text-align: center; padding: 26px 0 18px; background: linear-gradient(160deg, var(--sky-light), var(--sunset-light)); }
.store-card .sc-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.store-card h4 { color: var(--sky-dark); font-size: 1.02rem; }
.store-card .sc-cat { font-size: 11px; font-weight: 700; color: var(--slate-deep); text-transform: uppercase; letter-spacing: 0.04em; }
.store-card .sc-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; flex: 1; }
.store-card .sc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.store-card .sc-price { font-size: 1.2rem; font-weight: 800; color: var(--sunset); }
.store-card .sc-margin { font-size: 11px; color: var(--text-secondary); }
.store-card .featured-flag { font-size: 10px; font-weight: 700; color: var(--danger); }
.btn-buy { font-size: 13px; font-weight: 700; padding: 8px 16px; border: none; border-radius: 8px; background: var(--sky-dark); color: #fff; cursor: pointer; }
.btn-buy:hover { background: var(--sky); }
.buy-line { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.buy-total { font-weight: 800; color: var(--sunset); font-size: 1.1rem; }

/* ==================== REPORTS (picker) ==================== */
/* The report documents carry their own stylesheet (FLT_REPORT_CSS in app.js);
   these rules style only the in-app selection grid. */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.report-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--sunset);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 2px 10px rgba(78,54,32,0.13), 0 1px 2px rgba(78,54,32,0.08);
}
.report-card-icon { font-size: 1.7em; line-height: 1; }
.report-card-title { font-size: 15px; font-weight: 700; color: var(--sky-dark); }
.report-card-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; flex: 1; }
.report-card-actions { display: flex; gap: 8px; margin-top: 6px; }
.report-card-actions .btn-primary { flex: 1; padding: 9px 12px; font-size: 13px; }
.btn-report-ghost {
  flex: 1; background: transparent; color: var(--sky-dark);
  border: 1.5px solid var(--sky); border-radius: 8px; padding: 9px 12px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.btn-report-ghost:hover { background: var(--sky-light); }

/* ==================== EVENTS: toolbar, calendar, detail ==================== */
.filter-check {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; font-size: 13px; font-weight: 500; color: var(--text-secondary);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.filter-check input { accent-color: var(--sunset); }

.events-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
  padding: 10px 12px; background: var(--sky-light);
  border: 1px solid var(--border); border-radius: 10px;
}
.events-toolbar-right { display: flex; align-items: center; gap: 10px; }
.events-count { font-size: 12px; color: var(--text-secondary); }
.view-toggle { display: flex; gap: 0; }
.view-seg {
  padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--card-bg); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.view-seg:first-child { border-radius: 8px 0 0 8px; }
.view-seg:last-child { border-radius: 0 8px 8px 0; border-left: none; }
.view-seg:hover { background: var(--sunset-light); }
.view-seg.active { background: var(--sky-dark); color: #fff; border-color: var(--sky-dark); }
body[data-role="officer"] #event-add-btn { display: inline-block; }

/* Month grid */
.cal-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cal-header h3 { flex: 1; color: var(--sky-dark); font-size: 1.05rem; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.cal-dow {
  background: var(--wood); color: var(--snow);
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-align: center; padding: 7px 2px;
}
.cal-cell {
  background: var(--card-bg); min-height: 76px; padding: 5px 5px 6px;
  display: flex; flex-direction: column; gap: 3px;
}
.cal-cell.other-month { background: var(--stone-light); opacity: .55; }
.cal-cell.today { background: var(--sunset-light); box-shadow: inset 0 0 0 2px var(--sunset); }
.cal-daynum { font-size: 11px; font-weight: 700; color: var(--text-secondary); }
.cal-cell.today .cal-daynum { color: var(--sky-dark); }
.cal-chip {
  font-size: 10.5px; line-height: 1.25; text-align: left; cursor: pointer;
  padding: 3px 5px; border-radius: 5px; border: none;
  background: var(--sky); color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-chip:hover { background: var(--sky-dark); }
.cal-chip.t-flyin { background: var(--sunset); }
.cal-chip.t-flyin:hover { background: #a06a08; }
.cal-chip.t-legislative { background: var(--slate-deep); }
.cal-chip.t-meeting { background: var(--mountain); }
.cal-chip.span-mid { border-radius: 0; }
.cal-chip.past { opacity: .5; }
.cal-more { font-size: 10px; color: var(--text-secondary); text-align: left; }
.cal-tbd { margin-top: 12px; }
.cal-tbd:empty { display: none; }
.cal-hint { font-size: 11.5px; color: var(--text-secondary); margin-top: 8px; text-align: center; }

/* Clickable list cards */
.event-card { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.event-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(78,54,32,0.16); }
.event-card .fc-actions { margin-top: 10px; }

/* Detail modal */
.ed-hero { padding: 12px 14px; background: var(--sky-light); border-radius: 10px; margin-bottom: 12px; }
.ed-row { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.ed-row:last-of-type { border-bottom: none; }
.ed-row b { min-width: 96px; color: var(--text-secondary); font-weight: 600; }

/* Membership standing (officer-only, derived from dues) */
.standing-bar {
  gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
  padding: 10px 12px; background: var(--sky-light);
  border: 1px solid var(--border); border-radius: 10px; font-size: 12px;
}
body[data-role="officer"] .standing-bar { display: flex; align-items: center; }
.standing-pill { padding: 3px 9px; border-radius: 999px; font-weight: 600; font-size: 11.5px; }
.st-active { background: var(--mountain-light); color: var(--mountain); }
.st-comped { background: var(--slate-light); color: var(--slate-deep); }
.st-grace  { background: var(--sunset-light); color: var(--sunset); }
.st-due    { background: var(--sunset-light); color: #8a5c05; }
.st-lapsed { background: #F3D9D5; color: var(--danger); }
.st-none   { background: var(--stone-light); color: var(--text-secondary); }

/* ==================== PARENT SUB-TAB BAR ====================
   Six parents in the sidebar, their children here. Styled off .dir-submenu so the
   Directory's own sub-menu and this bar read as the same control at two levels. */
.subnav {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px;
  padding: 6px; background: var(--sky-light); border-radius: 12px;
}
.subnav:empty { display: none; }
.subnav-btn {
  background: transparent; border: none; padding: 10px 16px;
  border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--sky-dark); transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 7px;
  text-transform: uppercase; letter-spacing: 0.045em;
}
.subnav-btn:hover { background: rgba(158,90,43,0.1); }
.subnav-btn.active { background: var(--sky); color: #fff; font-weight: 700; box-shadow: 0 2px 8px rgba(158,90,43,0.28); }
.subnav-btn .lock-pip { font-size: 10px; opacity: 0.85; }

/* The same list as a <select> for narrow screens, where a wrapped row of pills
   pushes the panel below the fold. Only one of the two is ever displayed. */
.subnav-mobile { display: none; margin-bottom: 18px; }
.subnav-mobile.has-items { }
.subnav-mobile-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-secondary); margin-bottom: 5px;
}
.subnav-mobile select { width: 100%; text-transform: uppercase; letter-spacing: 0.04em; }
.subnav-mobile select option { text-transform: uppercase; }

@media (max-width: 900px) {
  .subnav { display: none; }
  .subnav-mobile.has-items { display: block; }
}

/* ==================== SETTINGS ==================== */
#tab-settings .form-card { margin-bottom: 18px; }
.lh-preview {
  margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--border);
  border-radius: 10px; background: var(--snow);
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.7;
}
.lh-preview strong { color: var(--sky-dark); }
.identity-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.identity-row:last-child { border-bottom: none; }
.identity-row .k { color: var(--text-secondary); }
.identity-row .v { font-weight: 600; color: var(--stone); text-align: right; }

/* Stats rows: one even row, no orphans (ported from MPA skin 2026-09-24) */
#dashboard-stats, #issues-stats { grid-template-columns: repeat(6, 1fr); gap: 12px; }
#dashboard-stats .stat-card, #issues-stats .stat-card { padding-left: 8px; padding-right: 8px; }
@media (max-width: 1100px) { #dashboard-stats, #issues-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { #dashboard-stats, #issues-stats { grid-template-columns: repeat(2, 1fr); } }
.search-btn { background: var(--sky); color:#fff; border:2px solid var(--sky); border-radius:8px; padding:8px 20px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; cursor:pointer; }
.search-btn:hover { background: var(--sky-dark); border-color: var(--sky-dark); }
/* Every stats row: one even row sized to its card count (up to 6); 7-8 cards split 4+4 */
.stats-row:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, 1fr); }
.stats-row:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
.stats-row:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, 1fr); }
.stats-row:has(> :nth-child(5):last-child) { grid-template-columns: repeat(5, 1fr); }
.stats-row:has(> :nth-child(6):last-child) { grid-template-columns: repeat(6, 1fr); }
.stats-row:has(> :nth-child(7):last-child), .stats-row:has(> :nth-child(8):last-child) { grid-template-columns: repeat(4, 1fr); }
.stats-row { gap: 12px; }
@media (max-width: 1100px) {
  .stats-row:has(> :nth-child(4):last-child), .stats-row:has(> :nth-child(7)) { grid-template-columns: repeat(2, 1fr); }
  .stats-row:has(> :nth-child(5):last-child), .stats-row:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px)  { .stats-row, .stats-row:has(> :nth-child(2)) { grid-template-columns: repeat(2, 1fr); } }
.has-tip { cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
.totals-foot td { border-top: 2px solid var(--text); background: rgba(0,0,0,0.03); }
.back-bar { position: sticky; top: calc(var(--header-h, 80px) + 8px); z-index: 20; margin-bottom: 12px; } .back-btn { background: var(--text); color: #fff; border: 0; border-radius: 8px; padding: 8px 16px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.15); } .back-btn:hover { opacity: .85; }
.check-row { display:flex; align-items:center; gap:8px; font-weight:400; font-size:13px; margin:4px 0; cursor:pointer; } .check-row input { width:auto; margin:0; }
/* Save acknowledgement */
.saved-flash { display: inline-block; margin-left: 10px; font-size: 13px; font-weight: 700; color: #1E7B3C; opacity: 0; transition: opacity .4s; vertical-align: middle; }
.saved-flash.show { opacity: 1; }
.saved-flash.fade { opacity: 0; transition: opacity 1s; }
.saved-flash.err { color: #B3261E; }
input + .saved-flash, select + .saved-flash { display: block; margin: 4px 0 0; }

/* ==================== iPhone / iOS Safari polish (2026-09-25) ==================== */
header .header-inner { padding-top: max(12px, env(safe-area-inset-top)); padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
.table-wrap { -webkit-overflow-scrolling: touch; max-width: 100%; }
.sidebar:not(.open) { box-shadow: none; }
img { max-width: 100%; }
@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  main { min-width: 0; }
  .tab-content { min-width: 0; max-width: 100%; }
  .tab-content > *, .stats-row > *, .card-grid > *, .form-row > * { min-width: 0; }
  /* Tables scroll inside themselves instead of widening the page. */
  .tab-content table.data-table, .tab-content table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* iOS zooms any focused field under 16px. */
  input, select, textarea, .role-switcher select, .state-selector select { font-size: 16px !important; }
  /* Tap targets. */
  .nav-btn, .hamburger, .dir-btn, .view-seg, .cond-seg, .btn, .btn-mini, .modal-close, #subnav button, .subnav button { min-height: 44px; }
  .hamburger { min-width: 44px; }
  .btn-mini { padding: 8px 12px; }
  .modal-close { min-width: 44px; }
  /* Modals fit the screen. */
  .funding-modal { padding: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom)); }
  .funding-modal-inner, .modal, .modal-content { max-width: 100%; max-height: none; }
  main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  header .header-inner { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); padding-bottom: 8px; }
  .header-top { gap: 8px; }
  .logo { flex: 0 1 auto; min-width: 0; }
  .header-right { gap: 6px; }
  .role-switcher { min-width: 0; flex: 0 1 auto; min-height: 44px; }
  /* Every stats row: two columns on a phone, beating the :has() column counts. */
  .stats-row, .stats-row:has(> :nth-child(2)), .stats-row:has(> :nth-child(3):last-child), .stats-row:has(> :nth-child(4):last-child),
  .stats-row:has(> :nth-child(5):last-child), .stats-row:has(> :nth-child(6):last-child), .stats-row:has(> :nth-child(7):last-child),
  .stats-row:has(> :nth-child(8):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { padding: 14px 8px; overflow-wrap: anywhere; }
  .stat-card .stat-value { font-size: 1.6em; }
  /* Inline two-column grids and card grids collapse to one column. */
  .tab-content [style*="grid-template-columns:1fr 1fr"], .tab-content [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  .card-grid, .mission-grid, .funding-grid { grid-template-columns: minmax(0, 1fr) !important; }
  /* Legislative cards: badge column drops below the text instead of squeezing it. */
  .leg-card > div:first-child { flex-wrap: wrap; }
  .leg-card > div:first-child > div:last-child { text-align: left !important; white-space: normal !important; }
  .welcome-banner { padding: 22px 18px; }
  .welcome-banner h2 { font-size: 1.35em; }
  .sponsor-strip { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .sponsor-strip img { max-width: 220px; }
  .sponsor-card img { max-width: 180px; margin: 0 auto; }
}
@media (max-width: 600px) {
  .tab-content [style*="display:grid"] > *, .form-card, .mission-card, .card { min-width: 0; max-width: 100%; }
  .mc-pill { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
}


/* ==================== iOS drawer fixes (2026-09-25, ported from 3032) ==================== */
@media (max-width: 900px) {
  /* align-self:flex-start (desktop rail) shrink-wraps a fixed box even with top+bottom set,
     so the drawer stopped mid-screen. Stretch it to the bottom edge; contain its scrolling. */
  .sidebar { align-self: stretch; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
  .nav-backdrop { touch-action: none; }
  /* iOS only lets a panel glide when its content is taller than the panel; app.js sizes this spacer. */
  .sidebar::after { content: ""; display: block; height: var(--drawer-pad, 0px); }
}

/* Phone header: logo + menu on row 1; association and role selectors share row 2 below the logo. */
@media (max-width: 600px) {
  .logo { flex: 1 0 60%; }
  .hamburger { margin-left: auto; min-width: 44px; min-height: 44px; }
  .state-selector { flex: 1 1 40%; }
  .role-switcher { flex: 1 1 40%; min-height: 44px; }
  .state-selector select, .role-switcher select { font-size: 16px; }
}

/* ==================== ACCOUNT CHIP (header) ====================
   Replaces the demo role dropdown: shows the role officers assigned, and sign-out. */
.account-chip { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); border-radius: 8px; padding: 4px 8px; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
.account-chip:empty { display: none; }
.account-chip .role-lock { font-size: 13px; }
.account-signout { background: transparent; border: 1px solid rgba(255,255,255,0.4); color: #fff; border-radius: 6px; padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer; min-height: 32px; }
.account-signout:hover { background: rgba(255,255,255,0.15); }
body[data-role="officer"] .account-chip { background: rgba(196,131,14,0.28); border-color: var(--sunset); }

/* ==================== AUTH GATE ====================
   Sign in / request membership / waiting for approval. Covers the app entirely:
   nothing behind it has been loaded yet. */
body.ff-gated { overflow: hidden; }
.ff-gate { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(rgba(255,255,255,0.38) 1px, transparent 1.4px) 0 0 / 22px 22px, var(--bg); overflow-y: auto; }
.ff-gate-card { width: 100%; max-width: 400px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 28px 24px 18px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.18); text-align: center; margin: auto; }
.ff-gate-logo { max-width: 240px; max-height: 90px; width: auto; height: auto; margin: 0 auto 14px; display: block; }
.ff-gate-card h2 { font-size: 1.25rem; color: var(--sky-dark); margin-bottom: 6px; }
.ff-gate-sub { color: var(--text-secondary); font-size: 14px; line-height: 1.5; margin-bottom: 16px; }
.ff-gate-small { color: var(--text-secondary); font-size: 12px; margin-bottom: 14px; }
.ff-gate-msg { background: var(--sunset-light); color: var(--text); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 12px; }
.ff-gate-sample { background: var(--sky-light); color: var(--sky-dark); border-radius: 6px; padding: 4px 8px; font-size: 12px; font-weight: 600; margin-bottom: 12px; display: inline-block; }
.ff-gate-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.ff-gate-form label { font-size: 13px; font-weight: 600; color: var(--text); display: flex; flex-direction: column; gap: 4px; }
/* 16px keeps iOS Safari from zooming into the field on focus */
.ff-gate-form input { font-size: 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); }
.ff-gate-form input:focus { outline: 2px solid var(--sky); outline-offset: 1px; }
.ff-gate-btn { width: 100%; min-height: 44px; font-size: 15px; margin-top: 4px; }
.ff-gate-switch { font-size: 13px; margin-top: 14px; color: var(--text-secondary); }
.ff-gate-switch a { color: var(--sky-dark); font-weight: 600; }
.ff-gate-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ff-gate-row button { min-height: 44px; }
.ff-gate-foot { font-size: 11px; color: var(--text-secondary); margin-top: 18px; }

/* ==================== TOAST ==================== */
.ff-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 1100;
  background: var(--text); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; max-width: calc(100vw - 32px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25); transition: opacity .2s, transform .2s; }
.ff-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ff-btn-secondary { background: var(--snow); color: var(--text); border: 1px solid var(--border); padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; }
.ff-btn-secondary:hover { background: var(--sky-light); }
