/* ============================================================
   PORTAL.CSS — Coalition for Cyclist Safety Member Portal
   Derived from the public site design system (reference-site.css)
   Brand Guidelines: February 2026

   TABLE OF CONTENTS
   -----------------
   01. Font Loading (Metropolis, self-hosted)
   02. Design Tokens (identical to public site)
   03. Base + Reset
   04. Icons
   05. Buttons (public-site button system)
   06. Forms (public-site form system)
   07. App Navigation (persistent left sidebar)
   08. App Shell + Page Layout
   09. Month Ledger Markers (feed structure)
   10. Post Cards
   11. Composer
   12. Rail Cards (open calls, initiatives)
   13. Directory
   14. Library
   15. Org Profile + Account
   16. Auth (login split screen)
   17. Avatars, Toasts, Modals, Dropdowns, Empty States
   18. Animations + Reduced Motion
   19. Responsive
   ============================================================ */


/* ============================================================
   01. FONT LOADING
   ============================================================ */

@font-face {
  font-family: 'Metropolis';
  src: url('../assets/fonts/Metropolis-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Metropolis';
  src: url('../assets/fonts/Metropolis-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Metropolis';
  src: url('../assets/fonts/Metropolis-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Metropolis';
  src: url('../assets/fonts/Metropolis-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Metropolis';
  src: url('../assets/fonts/Metropolis-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Metropolis';
  src: url('../assets/fonts/Metropolis-ExtraBold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}


/* ============================================================
   02. DESIGN TOKENS — identical values to the public site
   ============================================================ */

:root {

  /* --- Brand Colors --- */
  --color-orange:         #fea44b;
  --color-orange-hover:   #f09030;
  --color-orange-light:   rgba(254, 164, 75, 0.12);
  --color-orange-mid:     rgba(254, 164, 75, 0.35);

  --color-grey-dark:      #545454;
  --color-grey-mid:       #7a7a7a;
  --color-grey-light:     #b0b0b0;
  --color-grey-border:    #e0e0e0;

  --color-off-white:      #f5f6f7;
  --color-white:          #ffffff;
  --color-black:          #1a1a1a;

  /* --- Typography --- */
  --font-primary:         'Metropolis', 'Inter', sans-serif;

  --text-body:            1rem;
  --text-title:           1.3125rem;
  --text-sm:              0.875rem;
  --text-xs:              0.75rem;
  --text-lg:              1.125rem;
  --text-xl:              1.375rem;
  --text-2xl:             1.75rem;
  --text-3xl:             2.25rem;
  --text-display-sm:      3rem;
  --text-display-md:      3.75rem;
  --text-display-lg:      4.5rem;

  --weight-light:         300;
  --weight-regular:       400;
  --weight-medium:        500;
  --weight-semibold:      600;
  --weight-bold:          700;
  --weight-extrabold:     800;

  /* --- Spacing Scale --- */
  --space-1:    0.25rem;
  --space-2:    0.5rem;
  --space-3:    0.75rem;
  --space-4:    1rem;
  --space-5:    1.25rem;
  --space-6:    1.5rem;
  --space-8:    2rem;
  --space-10:   2.5rem;
  --space-12:   3rem;
  --space-16:   4rem;
  --space-20:   5rem;
  --space-24:   6rem;

  /* --- Layout --- */
  --container-max:        1280px;
  --container-narrow:     900px;
  --container-padding:    var(--space-8);

  --nav-height:           72px;

  /* --- Border Radius --- */
  --radius-pill:          999px;
  --radius-sm:            6px;
  --radius-md:            12px;
  --radius-lg:            20px;
  --radius-xl:            28px;

  /* --- Shadows --- */
  --shadow-nav:           0 1px 0 rgba(0, 0, 0, 0.06),
                          0 4px 24px rgba(0, 0, 0, 0.04);
  --shadow-card:          0 2px 8px rgba(0, 0, 0, 0.06),
                          0 8px 32px rgba(0, 0, 0, 0.04);
  --shadow-card-hover:    0 4px 16px rgba(0, 0, 0, 0.10),
                          0 16px 48px rgba(0, 0, 0, 0.08);
  --shadow-btn:           0 2px 8px rgba(254, 164, 75, 0.30);
  --shadow-btn-hover:     0 4px 20px rgba(254, 164, 75, 0.45);

  /* --- Transitions --- */
  --transition-fast:      150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base:      250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:      400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* --- Liquid glass (floating chrome ONLY: nav, docks) --- */
  --glass-blur:           blur(12px);

  /* --- Surfaces (approved direction: hairline, near-flat) --- */
  --surface-border:       rgba(26, 26, 26, 0.08);
  --hairline:             rgba(26, 26, 26, 0.06);
  --shadow-surface:       0 1px 2px rgba(0, 0, 0, 0.03);
}


/* ============================================================
   03. BASE + RESET
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-weight: var(--weight-regular);
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--color-black);
  background-color: var(--color-off-white);
  font-style: normal; /* Brand rule: never italic */
  min-height: 100vh;
}

img { max-width: 100%; display: block; }

/* The hidden attribute always wins, even over display rules */
[hidden] { display: none !important; }

a { color: inherit; }

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background: var(--color-orange-mid);
}

/* Titles: UPPERCASE + weight 300 (brand rule) */
.t-title {
  font-family: var(--font-primary);
  font-weight: var(--weight-light);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--color-black);
  font-style: normal;
}

/* Headlines: weight 700, never 900 (brand rule) */
.t-headline {
  font-weight: var(--weight-bold);
  line-height: 1.2;
  color: var(--color-black);
  font-style: normal;
}

.t-muted { color: var(--color-grey-mid); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.divider {
  width: 48px;
  height: 3px;
  background-color: var(--color-orange);
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}


/* ============================================================
   04. ICONS — Phosphor, self-hosted sprite
   ============================================================ */

.icon {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  fill: currentColor;
  vertical-align: -0.2em;
}

.icon--lg { width: 1.5em; height: 1.5em; }


/* ============================================================
   05. BUTTONS — public-site button system
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.6rem 1.4rem;
  border-radius: 100px;
  font-family: var(--font-primary);
  font-weight: var(--weight-medium);
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  transition: background-color var(--transition-fast),
              border-color var(--transition-fast),
              color var(--transition-fast);
  font-style: normal;
  text-decoration: none;
}

.btn:active { opacity: 0.85; }

.btn:disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.btn--primary {
  background: var(--color-orange);
  color: var(--color-white);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--color-orange-hover);
}

.btn--secondary {
  background: var(--color-white);
  color: var(--color-black);
  border: 1px solid var(--color-grey-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
  background: var(--color-off-white);
  border-color: var(--color-grey-light);
}

.btn--ghost-orange {
  background: transparent;
  color: var(--color-black);
  border: 1px solid var(--color-orange);
}

.btn--ghost-orange:hover,
.btn--ghost-orange:focus-visible {
  background: var(--color-orange);
  border-color: var(--color-orange);
  color: var(--color-white);
}

/* Quiet text button: no chrome, used for tertiary actions */
.btn--quiet {
  background: none;
  color: var(--color-grey-mid);
  padding: 0.5rem 0.75rem;
  font-size: var(--text-sm);
}

.btn--quiet:hover,
.btn--quiet:focus-visible {
  color: var(--color-black);
}

.btn--sm {
  padding: 0.5rem 1.25rem;
  font-size: var(--text-sm);
}

.btn--lg {
  padding: 1rem 2.5rem;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.btn--block {
  width: 100%;
}

/* Spinner state inside buttons */
.btn .icon--spin { display: none; }
.btn.is-busy .icon--spin { display: inline-block; }
.btn.is-busy { pointer-events: none; opacity: 0.75; }

.icon--spin {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ============================================================
   06. FORMS — public-site form system
   ============================================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.form-label {
  font-family: var(--font-primary);
  font-weight: var(--weight-medium);
  font-size: 0.8125rem;
  color: var(--color-black);
  letter-spacing: 0.03em;
  font-style: normal;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-grey-mid);
  line-height: 1.5;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.6rem 0.9rem;
  background-color: var(--color-white);
  border: 1.5px solid var(--color-grey-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-weight: var(--weight-regular);
  font-size: 0.9375rem;
  color: var(--color-black);
  font-style: normal;
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-grey-light);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px rgba(254, 164, 75, 0.12);
}

.form-textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%237a7a7a'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 14px;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-error {
  font-size: var(--text-sm);
  color: #c0392b;
  line-height: 1.5;
}

.form-success {
  font-size: var(--text-sm);
  color: #2e7d4f;
  line-height: 1.5;
}


/* ============================================================
   07. APP NAVIGATION — persistent left sidebar
   The portal is an app: a fixed 240px sidebar carries the logo,
   the four sections, and the signed-in person. The active item
   gets the same orange tick as the feed's ledger markers.
   On small screens the sidebar becomes a slide-in drawer behind
   a slim top bar.
   ============================================================ */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--color-off-white);
  padding: var(--space-6) var(--space-4) var(--space-4);
}

.sidebar__logo {
  display: block;
  margin: var(--space-1) var(--space-3) var(--space-8);
  flex-shrink: 0;
}

.sidebar__logo img {
  height: 32px;
  width: auto;
}

.sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}

.sidebar__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.45rem var(--space-2) 0.45rem var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: var(--weight-medium);
  color: var(--color-grey-dark);
  text-decoration: none;
  font-style: normal;
  /* also used on <button> items (Coalition Assistant) */
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: color var(--transition-fast);
}

.sidebar__link .icon {
  width: 16px;
  height: 16px;
  color: var(--color-grey-mid);
  transition: color var(--transition-fast);
}

.sidebar__link:hover {
  color: var(--color-black);
}

.sidebar__link:hover .icon {
  color: var(--color-grey-dark);
}

/* Active: small orange dot + bold (approved 1b treatment) */
.sidebar__link.is-active {
  color: var(--color-black);
  font-weight: var(--weight-bold);
}

.sidebar__link.is-active::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-orange);
}

.sidebar__link.is-active .icon {
  color: var(--color-orange-hover);
}

/* Signed-in person, pinned to the bottom */
.sidebar__user {
  flex-shrink: 0;
  border-top: 1px solid var(--hairline);
  padding-top: var(--space-3);
  margin-top: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-left: var(--space-2);
  padding-right: var(--space-1);
}

.sidebar__user-info {
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}

.sidebar__user-name {
  font-size: 0.8125rem;
  font-weight: var(--weight-semibold);
  color: var(--color-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__user-org {
  font-size: var(--text-xs);
  color: var(--color-grey-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__signout {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-grey-light);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  display: inline-flex;
  flex-shrink: 0;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.sidebar__signout:hover {
  color: var(--color-black);
  background: rgba(26, 26, 26, 0.05);
}

.sidebar__signout .icon { width: 17px; height: 17px; }

/* --- Mobile top bar + drawer --- */

.topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 190;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-grey-border);
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
}

.topbar__logo img { height: 28px; width: auto; }

.topbar__burger {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-black);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  display: inline-flex;
}

.topbar__burger:hover { background: var(--color-off-white); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 195;
  background: rgba(26, 26, 26, 0.35);
}

@media (max-width: 1100px) {
  .topbar { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    box-shadow: none;
    z-index: 210;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  }

  .sidebar-backdrop.is-open { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}


/* ============================================================
   08. APP SHELL + PAGE LAYOUT
   ============================================================ */

.shell {
  margin-left: 240px;
  max-width: 1140px;
  padding: var(--space-8) var(--space-10) var(--space-16);
}

.shell--narrow {
  max-width: 880px;
}

/* Page header (approved 1b/2a): sentence-case bold heading with
   the one-line subtext beside it, optional action on the right */
.page-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.page-head__title {
  font-weight: var(--weight-bold);
  font-size: 1.0625rem;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--color-black);
  font-style: normal;
}

.page-head__lead {
  font-size: 0.8125rem;
  color: var(--color-grey-mid);
  line-height: 1.6;
  min-width: 0;
}

.page-head__actions {
  margin-left: auto;
  flex-shrink: 0;
}

/* Two-column: main + rail */
.feed-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: var(--space-8);
  align-items: start;
}

.feed-main { min-width: 0; }

.feed-rail {
  position: sticky;
  top: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}


/* ============================================================
   09. LEDGER (approved 1b)
   One continuous white surface per month: hairline border,
   near-flat, rows divided by hairlines. The month label sits
   quietly above each surface.
   ============================================================ */

.ledger-label {
  font-size: 0.6875rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-grey-mid);
  margin: var(--space-6) 0 var(--space-2) 2px;
}

.ledger-label:first-child { margin-top: var(--space-1); }

.ledger-surface {
  background: var(--color-white);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-surface);
  overflow: hidden;
}


/* ============================================================
   10. POST CARDS
   Each post is its own discrete white card on the off-white
   page, separated by a 12px gap instead of hairline dividers.
   Inside: person avatar + full name, org and title on a quiet
   second line, timestamp right-aligned with the type icon small
   beside it. Bold title, body, optional full-width image, then
   the quiet action row behind an inside-card hairline.
   ============================================================ */

.post-row {
  background: var(--color-white);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-surface);
  padding: var(--space-5);
  margin-bottom: 12px;
}

.post-row:target {
  background: linear-gradient(rgba(254, 164, 75, 0.05), rgba(254, 164, 75, 0.05)) var(--color-white);
}

.post-row__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.post-row__head .avatar {
  width: 43px;
  height: 43px;
  font-size: 0.8125rem;
}

.post-row__id {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.post-row__author {
  font-size: 1rem;
  font-weight: var(--weight-bold);
  color: var(--color-black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-row__sub {
  font-size: 0.75rem;
  color: var(--color-grey-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Timestamp with the small, secondary type icon beside it,
   vertically centered against the avatar like the name block */
.post-row__end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-shrink: 0;
  flex-wrap: wrap;
  margin-left: var(--space-3);
}

.post-row__date {
  font-size: 0.75rem;
  color: var(--color-grey-light);
  white-space: nowrap;
}

.post-row__type {
  display: inline-flex;
  color: var(--color-grey-light);
}

.post-row__type .icon { width: 14px; height: 14px; }

.post-row--call .post-row__type { color: var(--color-orange-hover); }

.post-row__title {
  font-size: 0.875rem;
  font-weight: var(--weight-bold);
  color: var(--color-black);
  line-height: 1.4;
  overflow-wrap: break-word;
  margin-top: var(--space-3);
}

.post-row__rest {
  margin-top: 0;
}

/* Attached image: full width of the post, subtle rounding */
.post-row__image {
  margin-top: var(--space-3);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.post-row__image img {
  width: 100%;
  display: block;
  max-height: 420px;
  object-fit: cover;
}

.post-row__body {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--color-grey-dark);
  margin-top: var(--space-2);
  white-space: pre-line;
  overflow-wrap: break-word;
}

/* Who a call is calling on: plain text, no badges */
.post-row__calling {
  font-size: 0.75rem;
  color: var(--color-grey-mid);
  margin-top: var(--space-2);
  line-height: 1.6;
}

.post-row__calling strong {
  font-weight: var(--weight-medium);
  color: var(--color-grey-dark);
}

.mention,
.tag-link {
  color: var(--color-orange-hover);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.mention:hover,
.tag-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-row__attachment {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: var(--weight-medium);
  color: var(--color-grey-dark);
  text-decoration: none;
  max-width: 100%;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.post-row__attachment:hover {
  border-color: var(--color-orange-mid);
  color: var(--color-black);
}

.post-row__attachment .icon { color: var(--color-orange); width: 14px; height: 14px; }

.post-row__attachment span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Interest: plain text action, count follows */
.interest-line {
  margin-top: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.interest-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: var(--weight-semibold);
  color: var(--color-orange-hover);
}

.interest-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.interest-btn.is-on {
  color: var(--color-grey-mid);
  cursor: default;
  text-decoration: none;
}

.interest-btn .icon { width: 13px; height: 13px; }

/* Quiet action row behind an inside-card hairline */
.post-actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-4);
  border-top: 1px solid var(--hairline);
  padding-top: var(--space-3);
}

.post-actions .interest-line { margin-top: 0; }

/* ---- Comments: single-level replies under a post ---- */

.comments-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.8125rem;
  font-weight: var(--weight-medium);
  color: var(--color-grey-mid);
  transition: color var(--transition-fast);
}

.comments-toggle:hover { color: var(--color-black); }

.comments-toggle .icon { width: 14px; height: 14px; }

.comments {
  margin-top: var(--space-4);
}

.comments__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.comment {
  display: flex;
  gap: var(--space-3);
}

.comment .avatar {
  width: 26px;
  height: 26px;
  font-size: 0.5625rem;
  margin-top: 2px;
}

.comment__bubble {
  flex: 1;
  min-width: 0;
  background: var(--color-off-white);
  border-radius: 10px;
  padding: var(--space-2) var(--space-3);
}

.comment__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  line-height: 1.4;
}

.comment__name {
  font-size: 0.75rem;
  font-weight: var(--weight-semibold);
  color: var(--color-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comment__org {
  font-size: 0.6875rem;
  color: var(--color-grey-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comment__time {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--color-grey-light);
  white-space: nowrap;
  flex-shrink: 0;
}

.comment__body {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--color-grey-dark);
  overflow-wrap: break-word;
  white-space: pre-line;
}

.comment-form {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.comments__list + .comment-form { margin-top: var(--space-3); }

.comment-form .avatar {
  width: 26px;
  height: 26px;
  font-size: 0.5625rem;
}

.comment-form input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.8rem;
  background: var(--color-white);
  border: 1px solid var(--surface-border);
  border-radius: 100px;
  font-family: var(--font-primary);
  font-size: 0.8125rem;
  color: var(--color-black);
  outline: none;
  transition: border-color var(--transition-fast);
}

.comment-form input::placeholder { color: var(--color-grey-light); }

.comment-form input:focus { border-color: var(--color-orange); }

.comment-form button {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: var(--weight-semibold);
  color: var(--color-orange-hover);
}

.comment-form button:disabled {
  color: var(--color-grey-light);
  cursor: default;
}


/* ============================================================
   11. COMPOSER
   Collapsed: a slim surface row, avatar + prompt + pencil.
   Expanded: the full form on the same quiet surface.
   ============================================================ */

.composer-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  background: var(--color-white);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-surface);
  padding: var(--space-3) var(--space-5);
  margin-bottom: var(--space-6);
  cursor: pointer;
  text-align: left;
  font-size: 0.8125rem;
  color: var(--color-grey-light);
  transition: border-color var(--transition-fast);
}

.composer-trigger:hover {
  border-color: rgba(26, 26, 26, 0.16);
}

.composer-trigger .avatar {
  width: 31px;
  height: 31px;
  font-size: 0.6875rem;
}

.composer-trigger .icon--plus {
  margin-left: auto;
  color: var(--color-grey-light);
  width: 15px;
  height: 15px;
  transition: color var(--transition-fast);
}

.composer-trigger:hover .icon--plus {
  color: var(--color-orange-hover);
}

.composer {
  background: var(--color-white);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-surface);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
}

.composer__intro {
  font-size: 0.75rem;
  color: var(--color-grey-mid);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.composer__types {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.composer__type {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-white);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition-fast),
              background-color var(--transition-fast);
}

.composer__type .icon {
  width: 15px;
  height: 15px;
  color: var(--color-grey-mid);
  transition: color var(--transition-fast);
}

.composer__type-label {
  font-size: 0.75rem;
  font-weight: var(--weight-medium);
  color: var(--color-grey-dark);
  line-height: 1.3;
}

.composer__type:hover {
  border-color: var(--color-orange-mid);
}

.composer__type.is-active {
  border-color: var(--color-orange-mid);
  background: var(--color-orange-light);
}

.composer__type.is-active .icon { color: var(--color-orange-hover); }
.composer__type.is-active .composer__type-label { color: var(--color-black); }

.composer__field { position: relative; }

/* One image per post: quiet attach control + inline preview */
.composer__attach { margin-bottom: var(--space-4); }

.composer__img-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  font-weight: var(--weight-medium);
  color: var(--color-grey-mid);
  transition: color var(--transition-fast);
}

.composer__img-btn:hover { color: var(--color-black); }

.composer__img-btn .icon { width: 15px; height: 15px; }

.composer__img-preview {
  position: relative;
  display: inline-block;
  margin-bottom: var(--space-4);
  max-width: 100%;
}

.composer__img-preview img {
  display: block;
  max-height: 220px;
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
}

.composer__img-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(26, 26, 26, 0.55);
  color: var(--color-white);
  border-radius: 50%;
}

.composer__img-remove:hover {
  background: rgba(26, 26, 26, 0.75);
  color: var(--color-white);
}

.composer__img-remove .icon { width: 13px; height: 13px; }

.composer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

.composer__footer-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.composer__syntax {
  font-size: var(--text-xs);
  color: var(--color-grey-light);
  line-height: 1.5;
}

.composer__syntax code {
  font-family: inherit;
  color: var(--color-grey-mid);
  font-weight: var(--weight-medium);
}

/* Autocomplete dropdown for @org */
.autocomplete {
  position: absolute;
  z-index: 40;
  min-width: 260px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--color-white);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
  padding: var(--space-2);
  display: none;
}

.autocomplete.is-open { display: block; }

.autocomplete__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-size: 0.8125rem;
  color: var(--color-black);
}

.autocomplete__item:hover,
.autocomplete__item.is-selected {
  background: var(--color-off-white);
}

.autocomplete__item small {
  color: var(--color-grey-mid);
  font-size: var(--text-xs);
}

/* "Who are you calling on?" picker (calls for participation).
   Selected entries are quiet hairline rows, not badges. */
.target-list {
  list-style: none;
  margin-top: var(--space-1);
}

.target-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--hairline);
}

.target-list__item:first-child { border-top: none; }

.target-list__item .avatar {
  width: 24px;
  height: 24px;
  font-size: 0.5625rem;
}

.target-list__info {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.target-list__name {
  font-size: 0.8125rem;
  font-weight: var(--weight-semibold);
  color: var(--color-black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-list__sub {
  font-size: var(--text-xs);
  color: var(--color-grey-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* The confidential checkbox: quiet, above the footer, behind the
   same hairline the rest of the composer uses */
.composer__confidential {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--hairline);
}

.composer__confidential .check-row { font-size: 0.8125rem; }

.composer__confidential .form-hint {
  margin-top: var(--space-2);
  padding-left: 28px;
}


/* ============================================================
   12. RAIL (approved 1b: flat, no boxes)
   Small uppercase labels, hairline-separated items.
   ============================================================ */

.rail-section__title {
  font-size: 0.6875rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-grey-mid);
  margin-bottom: var(--space-1);
}

.rail-section__list {
  list-style: none;
}

.rail-section__item {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--hairline);
}

.rail-section__item:last-child { border-bottom: none; padding-bottom: 0; }

.rail-section__link {
  text-decoration: none;
  display: block;
}

.rail-section__item-title {
  font-size: 0.8125rem;
  font-weight: var(--weight-semibold);
  color: var(--color-black);
  line-height: 1.45;
  transition: color var(--transition-fast);
}

.rail-section__link:hover .rail-section__item-title {
  color: var(--color-orange-hover);
}

.rail-section__item-meta {
  font-size: 0.75rem;
  color: var(--color-grey-mid);
  margin-top: 1px;
}

.rail-section__empty {
  font-size: 0.75rem;
  color: var(--color-grey-mid);
  line-height: 1.6;
  padding: var(--space-2) 0;
}

/* The reminder that the portal is an archive, not a destination */
.rail-note {
  border-top: 1px solid var(--hairline);
  padding-top: var(--space-4);
  font-size: 0.75rem;
  color: var(--color-grey-mid);
  line-height: 1.65;
}

.rail-note strong {
  color: var(--color-grey-dark);
  font-weight: var(--weight-semibold);
}


/* ============================================================
   13. DIRECTORY
   ============================================================ */

/* Sector filter: quiet text controls with an orange underline,
   not pills (brand rule: no pill badges or tags) */
.filter-row {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-grey-border);
}

/* Two groups in one row: sector on the left, coalition role
   pushed to the right, sharing the same underline treatment */
.filter-row__group {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.filter-row__group + .filter-row__group { margin-left: auto; }

.filter-row__btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1) 0 var(--space-2);
  font-size: 0.8125rem;
  font-weight: var(--weight-medium);
  color: var(--color-grey-mid);
  position: relative;
  transition: color var(--transition-fast);
}

.filter-row__btn::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
  transition: background var(--transition-fast);
}

.filter-row__btn:hover { color: var(--color-black); }

.filter-row__btn.is-active {
  color: var(--color-black);
  font-weight: var(--weight-semibold);
}

.filter-row__btn.is-active::after {
  background: var(--color-orange);
}

.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

.org-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-surface);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition-base);
}

.org-card:hover { border-color: rgba(26, 26, 26, 0.16); }

.org-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.org-card__logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.org-card__logo img {
  max-width: 38px;
  max-height: 34px;
  object-fit: contain;
}

.org-card__name {
  font-weight: var(--weight-bold);
  font-size: var(--text-body);
  line-height: 1.25;
  color: var(--color-black);
}

.org-card__sector {
  font-size: 0.8125rem;
  color: var(--color-grey-mid);
  margin-top: 1px;
}

.org-card__desc {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--color-grey-dark);
  margin-bottom: var(--space-4);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.org-card__people {
  border-top: 1px solid var(--hairline);
  padding-top: var(--space-3);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.person-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.person-row__info {
  min-width: 0;
  line-height: 1.35;
}

.person-row__name {
  font-size: 0.8125rem;
  font-weight: var(--weight-semibold);
  color: var(--color-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-row__title {
  font-size: var(--text-xs);
  color: var(--color-grey-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Person rows in the directory open the detail view */
.person-row--click {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.person-row--click:hover .person-row__name {
  color: var(--color-orange-hover);
}

/* Person detail: a considered card, not a data dump */
.person-detail__head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.person-detail__name {
  font-size: 1rem;
  font-weight: var(--weight-bold);
  color: var(--color-black);
  line-height: 1.3;
}

.person-detail__sub {
  font-size: 0.8125rem;
  color: var(--color-grey-mid);
  line-height: 1.5;
}

.person-detail__label {
  font-size: 0.6875rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-grey-mid);
  border-top: 1px solid var(--hairline);
  padding-top: var(--space-4);
  margin-bottom: var(--space-1);
}

.contact-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: 0.8125rem;
}

.contact-row .icon {
  width: 15px;
  height: 15px;
  color: var(--color-grey-mid);
  flex-shrink: 0;
}

.contact-row a {
  color: var(--color-black);
  font-weight: var(--weight-medium);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-row a:hover {
  color: var(--color-orange-hover);
}

.person-detail__note {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--hairline);
  font-size: var(--text-xs);
  color: var(--color-grey-light);
  line-height: 1.6;
}

/* Hidden address: the relay note in place of the email row */
.msg-private {
  font-size: 0.8125rem;
  color: var(--color-grey-mid);
  line-height: 1.6;
  padding: var(--space-2) 0;
}

/* Inline compose inside the person detail */
.msg-compose {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--hairline);
}

.msg-compose__to {
  font-size: 0.8125rem;
  font-weight: var(--weight-semibold);
  color: var(--color-black);
  margin-bottom: var(--space-3);
}

.msg-compose .form-input { margin-bottom: var(--space-3); }

.msg-compose .form-textarea { min-height: 110px; }

.msg-compose__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* Calm one-line success state */
.msg-sent {
  margin-top: var(--space-4);
  font-size: 0.8125rem;
  color: var(--color-grey-dark);
  line-height: 1.6;
}

/* Checkbox row (profile: email visibility) */
.check-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.875rem;
  color: var(--color-black);
  cursor: pointer;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-orange);
  cursor: pointer;
}

.org-card__site {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-grey-mid);
  text-decoration: none;
  margin-top: var(--space-3);
  transition: color var(--transition-fast);
}

.org-card__site:hover { color: var(--color-orange-hover); }


/* ============================================================
   14. LIBRARY
   Filter bar on top (search as you type, category, organization,
   file type), a "Recently added" row, then a dense filterable
   grid of resource cards with a visual per file type.
   ============================================================ */

.lib-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.lib-search {
  position: relative;
  width: 260px;
  max-width: 100%;
}

.lib-search .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--color-grey-light);
  pointer-events: none;
}

.lib-search input {
  width: 100%;
  padding: 0.5rem 0.9rem 0.5rem 2.1rem;
  background: var(--color-white);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: 0.8125rem;
  color: var(--color-black);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.lib-search input::placeholder { color: var(--color-grey-light); }

.lib-search input:focus {
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px rgba(254, 164, 75, 0.10);
}

/* Quiet select controls beside the search field */
.lib-select {
  padding: 0.5rem 1.9rem 0.5rem 0.8rem;
  background-color: var(--color-white);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: 0.8125rem;
  color: var(--color-grey-dark);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%237a7a7a'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 12px;
  transition: border-color var(--transition-fast);
}

.lib-select:focus { border-color: var(--color-orange); }

.lib-select.is-set { color: var(--color-black); font-weight: var(--weight-medium); }

/* Dense grid, hairline borders */
.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: var(--space-3);
  align-items: stretch;
}

.res-grid--row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: var(--space-2);
}

.res-card {
  background: var(--color-white);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: border-color var(--transition-fast);
}

.res-card:hover { border-color: rgba(26, 26, 26, 0.16); }

/* The visual: thumbnail, PDF cover, or a file-type icon on an
   off-white panel */
.res-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--color-off-white);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-grey-mid);
  overflow: hidden;
}

.res-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.res-card__media .icon { width: 26px; height: 26px; }

.res-card__body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.res-card__title {
  font-size: 0.8125rem;
  font-weight: var(--weight-semibold);
  color: var(--color-black);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.res-card__meta {
  font-size: 0.75rem;
  color: var(--color-grey-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.res-card__foot {
  margin-top: auto;
  padding-top: var(--space-2);
}

.res-card__dl {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.75rem;
  font-weight: var(--weight-medium);
  color: var(--color-grey-mid);
  transition: color var(--transition-fast);
}

.res-card__dl:hover { color: var(--color-orange-hover); }

.res-card__dl .icon { width: 14px; height: 14px; }

/* Upload drop area inside modal */
.dropzone {
  border: 1.5px dashed var(--color-grey-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  color: var(--color-grey-mid);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.dropzone:hover,
.dropzone.is-drag {
  border-color: var(--color-orange);
  background: var(--color-orange-light);
}

.dropzone .icon {
  width: 24px;
  height: 24px;
  color: var(--color-orange);
  margin: 0 auto var(--space-2);
  display: block;
}

.dropzone__file {
  font-weight: var(--weight-semibold);
  color: var(--color-black);
  word-break: break-all;
}


/* ============================================================
   15. ORG PROFILE + ACCOUNT
   ============================================================ */

.panel {
  background: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-surface);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-4);
}

/* Panel titles use the same quiet label voice as the library
   category headers and the rail sections */
.panel__title {
  font-weight: var(--weight-semibold);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-grey-mid);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.panel__title .icon { display: none; }

.panel__note {
  font-size: 0.8125rem;
  color: var(--color-grey-mid);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.panel .form-group:last-child { margin-bottom: 0; }

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--space-6);
}

/* Logo editor */
.logo-editor {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.logo-editor__preview {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-grey-border);
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-editor__preview img {
  max-width: 56px;
  max-height: 48px;
  object-fit: contain;
}

/* The personal photo is a circle, not a logo panel */
.logo-editor__preview--round {
  border-radius: 50%;
  overflow: hidden;
  padding: 0;
}

.logo-editor__preview--round img {
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-editor__preview--round .avatar {
  width: 100%;
  height: 100%;
  font-size: var(--text-body);
}

/* Resizing a large photo takes a visible moment, so the control
   that started it says so rather than sitting there looking idle */
.is-preparing {
  opacity: 0.65;
  pointer-events: none;
}

/* News items list */
.news-list {
  display: flex;
  flex-direction: column;
}

.news-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--hairline);
}

.news-item:first-child { border-top: none; padding-top: 0; }

.news-item__body {
  flex: 1;
  min-width: 0;
  line-height: 1.5;
}

.news-item__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-black);
}

.news-item__date {
  font-size: var(--text-xs);
  color: var(--color-grey-mid);
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-grey-light);
  padding: var(--space-2);
  border-radius: 50%;
  display: inline-flex;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.icon-btn:hover {
  color: var(--color-black);
  background: var(--color-off-white);
}

/* Teammates list */
.team-list {
  display: flex;
  flex-direction: column;
}

.team-list .person-row {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--hairline);
}

.team-list .person-row:first-child { border-top: none; }


/* ============================================================
   15b. EVENTS — one chronological schedule, the overlapping
   attendance cluster, and the feed's upcoming events strip.
   Coalition and industry events share the surface; the kind is
   a quiet type treatment (small orange dot for coalition), no
   badges.
   ============================================================ */

/* --- Attendance cluster: org logos first, then people --- */

.att-cluster {
  display: inline-flex;
  align-items: center;
}

.att-cluster__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--color-white);
  box-shadow: 0 0 0 1px rgba(26, 26, 26, 0.07);
  margin-left: -8px;
  flex-shrink: 0;
  overflow: hidden;
  user-select: none;
}

.att-cluster__item:first-child { margin-left: 0; }

.att-cluster__item--org { background: var(--color-white); }

.att-cluster__item--org img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.att-cluster__item--person {
  background: #fff4e9;   /* solid equivalent of the orange tint, so overlaps stay clean */
  color: var(--color-orange-hover);
  font-size: 0.5625rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.att-cluster__more {
  margin-left: var(--space-2);
  font-size: 0.75rem;
  color: var(--color-grey-mid);
  white-space: nowrap;
}

.att-cluster--empty {
  font-size: 0.75rem;
  color: var(--color-grey-light);
}

/* Small variant for the feed strip */
.att-cluster--sm .att-cluster__item {
  width: 22px;
  height: 22px;
  margin-left: -7px;
  border-width: 1.5px;
}

.att-cluster--sm .att-cluster__item:first-child { margin-left: 0; }

.att-cluster--sm .att-cluster__item--org img { width: 14px; height: 14px; }

.att-cluster--sm .att-cluster__item--person { font-size: 0.4375rem; }

/* The cluster is a button: hover or tap opens the full list */
.att-cluster-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
}

/* --- Quiet links on event cards (event site, admin edit) --- */

.event-row__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.75rem;
  font-weight: var(--weight-medium);
  color: var(--color-grey-mid);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.event-row__link:hover { color: var(--color-orange-hover); }

.event-row__link .icon { width: 13px; height: 13px; }

.event-row__edit {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: var(--weight-medium);
  color: var(--color-grey-light);
  transition: color var(--transition-fast);
}

.event-row__edit:hover { color: var(--color-black); }

/* Attending: plain text toggle, same voice as "I'm interested" */
.attend-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: var(--weight-semibold);
  color: var(--color-orange-hover);
  white-space: nowrap;
}

.attend-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.attend-btn.is-on { color: var(--color-grey-mid); }

.attend-btn .icon { width: 13px; height: 13px; }

/* --- Expanded attendee list --- */

.event-attendees {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3) var(--space-6);
}

.event-attendees__org {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
}

.event-attendees__logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.event-attendees__logo img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.event-attendees__logo--blank {
  font-size: 0.5625rem;
  font-weight: var(--weight-bold);
  color: var(--color-grey-mid);
  text-transform: uppercase;
}

.event-attendees__info {
  min-width: 0;
  line-height: 1.4;
}

.event-attendees__name {
  font-size: 0.8125rem;
  font-weight: var(--weight-semibold);
  color: var(--color-black);
}

.event-attendees__people {
  font-size: 0.75rem;
  color: var(--color-grey-mid);
  line-height: 1.55;
}

.event-attendees__empty {
  font-size: 0.75rem;
  color: var(--color-grey-mid);
  line-height: 1.6;
}

/* --- Event media: photo or the coalition fallback panel.
   Fallback: solid dark grey with the coalition symbol bleeding
   off the left edge at low opacity (brand rule: watermarks are
   never fully visible). --- */

.event-card__media.ev-media--blank { background: #545454; }

.ev-media__symbol {
  position: absolute;
  left: -14%;
  top: 50%;
  transform: translateY(-50%);
  height: 145%;
  width: auto;
  max-width: none;
  opacity: 0.14;
  filter: brightness(0) invert(1);
  pointer-events: none;
}

/* Quiet "kind" treatment: small orange dot for coalition events */
.ev-kind {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-medium);
  color: var(--color-grey-dark);
}

.calup__item--coalition .ev-kind::before,
.event-card--coalition .ev-kind::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-orange);
  flex-shrink: 0;
}

/* --- Calendar widget on the feed home: one slim bar that
   expands in place into a month grid + upcoming list --- */

.calwidget {
  background: var(--color-white);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-surface);
  margin-bottom: var(--space-6);
}

/* Collapsed bar: icon, "Next: ..." line, mini cluster, toggle */
.calbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 52px;
  padding: var(--space-3) var(--space-5);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.calbar__icon {
  display: inline-flex;
  color: var(--color-grey-mid);
  flex-shrink: 0;
}

.calbar__icon .icon { width: 16px; height: 16px; }

.calbar__next {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  color: var(--color-grey-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calbar__next strong {
  color: var(--color-black);
  font-weight: var(--weight-semibold);
}

.calbar .att-cluster { flex-shrink: 0; }

.calbar__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-2);
  font-size: 0.8125rem;
  font-weight: var(--weight-medium);
  color: var(--color-grey-mid);
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.calbar:hover .calbar__toggle { color: var(--color-black); }

.calbar__toggle .icon {
  width: 13px;
  height: 13px;
  transition: transform var(--transition-fast);
}

.calwidget.is-open .calbar__toggle .icon { transform: rotate(180deg); }

/* Expanded: two zones, month grid left, upcoming list right */
.calwidget__panel {
  border-top: 1px solid var(--hairline);
  padding: var(--space-5);
}

.calwidget__grid {
  display: grid;
  grid-template-columns: minmax(0, 9fr) minmax(0, 11fr);
  gap: var(--space-8);
  align-items: start;
}

/* Month grid */
.cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.cal__title {
  font-size: 0.8125rem;
  font-weight: var(--weight-bold);
  color: var(--color-black);
}

.cal__nav { display: flex; gap: var(--space-1); }

.cal__arrow {
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-grey-light);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.cal__arrow:hover {
  color: var(--color-black);
  background: rgba(26, 26, 26, 0.05);
}

.cal__arrow .icon { width: 12px; height: 12px; }

.cal__week,
.cal__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal__wd {
  text-align: center;
  font-size: 0.625rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-grey-light);
  padding: 2px 0 6px;
}

.cal__day,
.cal__blank {
  position: relative;
  aspect-ratio: 1;
  min-height: 30px;
}

.cal__day {
  background: none;
  border: none;
  border-radius: 50%;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--color-grey-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  padding: 0;
}

.cal__day--event {
  cursor: pointer;
  font-weight: var(--weight-medium);
  color: var(--color-black);
}

.cal__day--today { box-shadow: inset 0 0 0 1px var(--color-grey-light); }

.cal__day.is-selected {
  background: var(--color-orange-light);
  box-shadow: inset 0 0 0 1px var(--color-orange-mid);
}

.cal__day-dots {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  display: flex;
  gap: 3px;
  justify-content: center;
  pointer-events: none;
}

.cal__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.cal__dot--coalition { background: var(--color-orange); }

.cal__dot--industry { background: #545454; }

/* Upcoming list */
.calup__label {
  font-size: 0.6875rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-grey-mid);
  margin-bottom: var(--space-1);
}

.calup {
  max-height: 330px;
  overflow-y: auto;
}

.calup__item {
  position: relative;
  padding: var(--space-3) var(--space-2) var(--space-3) var(--space-4);
  border-top: 1px solid var(--hairline);
}

.calup__item:first-child { border-top: none; }

/* Subtle orange left marker when a day click points here */
.calup__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 2px;
  background: transparent;
}

.calup__item.is-hit::before { background: var(--color-orange); }

.calup__name {
  font-size: 0.8125rem;
  font-weight: var(--weight-bold);
  color: var(--color-black);
  line-height: 1.4;
}

.calup__meta {
  font-size: 0.75rem;
  color: var(--color-grey-mid);
  line-height: 1.5;
}

.calup__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-2);
  min-height: 22px;
}

/* Inside the scrollable list the menu flips downward when the
   item sits in the upper half, so it never clips */
.cal-menu--down .cal-menu__pop {
  bottom: auto;
  top: calc(100% + 6px);
}

/* --- Add to calendar: quiet trigger, two-option menu --- */

.cal-menu {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.cal-menu__btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.75rem;
  font-weight: var(--weight-medium);
  color: var(--color-grey-mid);
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.cal-menu__btn:hover { color: var(--color-black); }

.cal-menu__btn .icon { width: 14px; height: 14px; }

.cal-menu__pop {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  min-width: 185px;
  background: var(--color-white);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
  padding: var(--space-1);
  display: none;
  z-index: 60;
}

.cal-menu.is-open .cal-menu__pop { display: block; }

.cal-menu__item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: var(--weight-medium);
  color: var(--color-grey-dark);
  white-space: nowrap;
}

.cal-menu__item:hover {
  background: var(--color-off-white);
  color: var(--color-black);
}

/* --- Events page: filter bar (quiet text controls with the
   sidebar's orange dot as the active marker) --- */

.filters {
  display: flex;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.filters__group {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.filters__sep {
  width: 1px;
  height: 16px;
  background: var(--color-grey-border);
  flex-shrink: 0;
}

.filter-dot-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1) 0 var(--space-1) 13px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: var(--weight-medium);
  color: var(--color-grey-mid);
  transition: color var(--transition-fast);
}

.filter-dot-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  transition: background var(--transition-fast);
}

.filter-dot-btn:hover { color: var(--color-black); }

.filter-dot-btn.is-active {
  color: var(--color-black);
  font-weight: var(--weight-semibold);
}

.filter-dot-btn.is-active::before { background: var(--color-orange); }

/* --- Events page: image-led horizontal cards --- */

.event-card {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  background: var(--color-white);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.event-card__media {
  position: relative;
  overflow: hidden;
  border-radius: 11px 0 0 11px;
  background: var(--color-off-white);
  min-height: 176px;
}

.event-card__media img:not(.ev-media__symbol) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-card__body {
  padding: var(--space-4) var(--space-5);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.event-card__name {
  font-size: 0.9375rem;
  font-weight: var(--weight-bold);
  color: var(--color-black);
  line-height: 1.35;
  overflow-wrap: break-word;
}

.event-card__meta {
  font-size: 0.75rem;
  color: var(--color-grey-mid);
  margin-top: 2px;
  line-height: 1.6;
}

.event-card__desc {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--color-grey-dark);
  margin-top: var(--space-2);
}

.event-card__links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-2);
}

.event-card__foot {
  margin-top: auto;
  padding-top: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  flex-wrap: wrap;
}

.event-card__foot-actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-shrink: 0;
}

.event-card__attendees {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-off-white);
  border-radius: var(--radius-sm);
}

/* Featured: the next coalition event, slightly larger */
.event-card--featured .event-card__media { min-height: 216px; }

.event-card--featured .event-card__name { font-size: 1.0625rem; }

.event-card--featured .event-card__desc { font-size: 0.875rem; }


/* ============================================================
   16. AUTH — centered liquid glass card
   Matches the Coalition Assistant: full-bleed darkened photo,
   one floating dark glass card, logo + quiet MEMBERS label,
   the email field, the orange action. Nothing else.
   ============================================================ */

.auth-scene {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  color: var(--color-white);
  background-image:
    linear-gradient(
      180deg,
      rgba(15, 15, 18, 0.72) 0%,
      rgba(15, 15, 18, 0.56) 50%,
      rgba(15, 15, 18, 0.86) 100%
    ),
    url('../assets/images/hero/dan-carlson-EXSh-k3wjds-unsplash.jpg');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: var(--space-12) var(--space-10);
  text-align: center;
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 8px 32px rgba(0, 0, 0, 0.2);
}

.auth-card__brand {
  display: block;
  text-decoration: none;
}

.auth-card__logo {
  height: 44px;
  width: auto;
  margin: 0 auto;
  /* Tint the whole logo white, same as the Assistant */
  filter: brightness(0) invert(1);
}

.auth-card__label {
  display: block;
  margin-top: var(--space-3);
  font-size: 0.75rem;
  font-weight: var(--weight-medium);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.auth-form {
  margin-top: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.auth-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.auth-input::placeholder { color: rgba(255, 255, 255, 0.45); }

.auth-input:focus { border-color: rgba(254, 164, 75, 0.6); }

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  margin-top: var(--space-2);
  padding: 0.875rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: var(--weight-semibold);
  color: var(--color-white);
  background: var(--color-orange);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.auth-btn:hover,
.auth-btn:focus-visible { background: var(--color-orange-hover); }

.auth-btn:disabled { opacity: 0.7; cursor: default; }

.auth-btn .icon--spin { display: none; }
.auth-btn.is-busy .icon--spin { display: inline-block; }
.auth-btn.is-busy { pointer-events: none; opacity: 0.75; }

/* Secondary views inside the same card */
.auth-title {
  margin-top: var(--space-8);
  font-size: 1.125rem;
  font-weight: var(--weight-bold);
  line-height: 1.3;
  color: var(--color-white);
}

.auth-lead {
  margin-top: var(--space-2);
  font-size: 0.8125rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.7);
}

#viewSignup .auth-form,
#viewSent .auth-switch { margin-top: var(--space-5); }

.auth-hint {
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.55);
}

.auth-error {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #ffb4a8;
  text-align: left;
}

.auth-switch {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.7);
}

.auth-switch button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: var(--weight-semibold);
  color: var(--color-orange);
}

.auth-switch button:hover { text-decoration: underline; text-underline-offset: 3px; }

.auth-sent-chip {
  width: 52px;
  height: 52px;
  margin: var(--space-8) auto 0;
  border-radius: 50%;
  background: rgba(254, 164, 75, 0.18);
  border: 1px solid rgba(254, 164, 75, 0.35);
  color: var(--color-orange);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-sent-chip .icon { width: 24px; height: 24px; }

.auth-footnote {
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.5);
}

/* Pending-review notice, restyled for glass */
.auth-notice {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  text-align: left;
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: rgba(254, 164, 75, 0.14);
  border: 1px solid rgba(254, 164, 75, 0.35);
  border-radius: 12px;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.auth-notice .icon {
  color: var(--color-orange);
  margin-top: 2px;
  flex-shrink: 0;
}

/* Magic-link callback shares the scene */
.auth-card__spinner {
  width: 36px;
  height: 36px;
  margin: var(--space-8) auto var(--space-5);
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--color-orange);
  animation: spin 0.8s linear infinite;
}


/* ============================================================
   17. AVATARS, TOASTS, MODALS, DROPDOWNS, EMPTY STATES
   ============================================================ */

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-orange-light);
  color: var(--color-orange-hover);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
  text-transform: uppercase;
}

.avatar--dark {
  background: var(--color-grey-dark);
  color: var(--color-white);
}

/* A member's own photo, once its signed URL has resolved. Until
   then, and whenever nobody has set one, the initials stand. */
.avatar.is-photo {
  background: var(--color-off-white);
  overflow: hidden;
}

.avatar.is-photo img,
.att-cluster__item.is-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.att-cluster__item.is-photo {
  background: var(--color-off-white);
  padding: 0;
}

.avatar--lg {
  width: 44px;
  height: 44px;
  font-size: var(--text-sm);
}

/* User dropdown menu */
.menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 230px;
  background: var(--color-white);
  border: 1px solid var(--color-grey-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card-hover);
  padding: var(--space-2);
  display: none;
  z-index: 60;
}

.menu.is-open { display: block; }

.menu__head {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-off-white);
  margin-bottom: var(--space-2);
  line-height: 1.4;
}

.menu__name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-black);
}

.menu__org {
  font-size: var(--text-xs);
  color: var(--color-grey-mid);
}

.menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-grey-dark);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.menu__item:hover {
  background: var(--color-off-white);
  color: var(--color-black);
}

/* Toasts */
.toast-region {
  position: fixed;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-black);
  color: var(--color-white);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  padding: var(--space-3) var(--space-6);
  border-radius: 100px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
  max-width: min(90vw, 480px);
}

.toast .icon { color: var(--color-orange); }

.toast--error .icon { color: #ff8a7a; }

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

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1500;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  overflow-y: auto;
}

.modal-backdrop.is-open { display: flex; }

.modal {
  background: var(--color-white);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  width: 100%;
  max-width: 520px;
  padding: var(--space-8);
  margin-top: 6vh;
  animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.modal__title {
  font-weight: var(--weight-bold);
  font-size: var(--text-xl);
  color: var(--color-black);
}

/* Empty states: an invitation to act */
.empty {
  text-align: center;
  padding: var(--space-10) var(--space-6);
  color: var(--color-grey-mid);
}

.empty__chip {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-white);
  border: 1px solid var(--surface-border);
  color: var(--color-grey-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
}

.empty__chip .icon { width: 24px; height: 24px; }

.empty__title {
  font-weight: var(--weight-semibold);
  font-size: var(--text-body);
  color: var(--color-grey-dark);
  margin-bottom: var(--space-2);
}

.empty__text {
  font-size: var(--text-sm);
  line-height: 1.65;
  max-width: 400px;
  margin: 0 auto;
}

/* Skeleton shimmer while loading */
.skeleton {
  border-radius: var(--radius-lg);
  background: linear-gradient(
    100deg,
    rgba(0, 0, 0, 0.045) 40%,
    rgba(0, 0, 0, 0.02) 50%,
    rgba(0, 0, 0, 0.045) 60%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* Announcement banner (pending approval etc.) */
.notice {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  background: var(--color-orange-light);
  border: 1px solid var(--color-orange-mid);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-grey-dark);
  margin-bottom: var(--space-8);
}

.notice .icon {
  color: var(--color-orange-hover);
  margin-top: 2px;
}


/* ============================================================
   17b. CONFIDENTIAL MARKER
   A lock, the word, and an info control that reveals the wording
   on hover, focus or tap. Quiet grey throughout: no badge, no
   pill, no colour fill. The marker is a request to the
   membership, and it should read like one.
   ============================================================ */

.conf-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--color-grey-mid);
  white-space: nowrap;
}

.conf-mark__lock { width: 13px; height: 13px; }

.conf-mark__word { line-height: 1; }

.conf-mark__info {
  background: none;
  border: none;
  padding: 2px;
  margin: -2px 0 -2px -1px;
  cursor: pointer;
  color: var(--color-grey-light);
  display: inline-flex;
  border-radius: 50%;
  transition: color var(--transition-fast);
}

.conf-mark__info .icon { width: 13px; height: 13px; }

.conf-mark__info:hover { color: var(--color-grey-dark); }

/* The wording itself: revealed above the marker, never clipped */
.conf-mark__note {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 268px;
  max-width: 72vw;
  padding: var(--space-3) var(--space-4);
  background: var(--color-white);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  font-size: var(--text-xs);
  line-height: 1.6;
  color: var(--color-grey-dark);
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  /* transform is reserved for the placement nudge applied in
     portal.js, so the reveal animates opacity alone */
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.conf-mark:hover .conf-mark__note,
.conf-mark__info:focus-visible ~ .conf-mark__note,
.conf-mark.is-open .conf-mark__note {
  opacity: 1;
  visibility: visible;
}

/* The poster's own toggle, in the quiet action row */
.conf-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  font-family: inherit;
  font-size: var(--text-xs);
  color: var(--color-grey-light);
  transition: color var(--transition-fast);
}

.conf-toggle:hover { color: var(--color-grey-dark); }

.conf-toggle:disabled { opacity: 0.5; cursor: default; }

/* Library: the marker an attachment inherits from its post */
.res-card__conf { margin-top: var(--space-2); }

/* Governance standing, wherever a person is named. Small, grey,
   its own line under the org and title. */
.post-row__gov,
.person-row__gov,
.person-detail__gov,
.board-person__gov {
  font-size: var(--text-xs);
  color: var(--color-grey-light);
  line-height: 1.4;
}

.person-detail__gov { margin-top: 2px; }

.comment__gov {
  font-size: var(--text-xs);
  color: var(--color-grey-light);
}


/* ============================================================
   17c. STEERING BOARD
   The board, the submission form, and the proposals themselves.
   Nothing competitive: no votes, no counts, no deadlines.
   ============================================================ */

.board-actions { margin-top: var(--space-5); }

.board-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}

.board-person {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  min-width: 0;
  transition: border-color var(--transition-base);
}

.board-person:hover { border-color: rgba(26, 26, 26, 0.16); }

.board-person:hover .board-person__name { color: var(--color-orange-hover); }

.board-person__info { min-width: 0; line-height: 1.35; }

.board-person__name {
  font-size: 0.875rem;
  font-weight: var(--weight-semibold);
  color: var(--color-black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.board-person__sub {
  font-size: var(--text-xs);
  color: var(--color-grey-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* One proposal */
.prop {
  border-top: 1px solid var(--hairline);
  padding: var(--space-4) 0;
}

.prop:first-child { border-top: none; padding-top: 0; }

.prop:last-child { padding-bottom: 0; }

.prop__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
}

.prop__title {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: var(--weight-bold);
  color: var(--color-black);
  line-height: 1.4;
}

/* Status is a word, not a badge: colour lives in the small dot */
.prop__status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-grey-mid);
  white-space: nowrap;
}

.prop__status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-grey-light);
}

.prop__status--under_review::before { background: var(--color-orange); }

.prop__status--answered::before { background: var(--color-grey-dark); }

.prop__meta {
  font-size: var(--text-xs);
  color: var(--color-grey-light);
  margin-top: 2px;
}

.prop__body {
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--color-grey-dark);
  margin-top: var(--space-3);
  white-space: pre-line;
  overflow-wrap: break-word;
}

.prop__ask {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--color-grey-dark);
  margin-top: var(--space-3);
}

.prop__ask-label {
  font-size: 0.6875rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-grey-mid);
}

.prop__response {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--color-off-white);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--color-grey-dark);
  white-space: pre-line;
}

.prop__response-label {
  font-size: 0.6875rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-grey-mid);
  margin-bottom: var(--space-2);
}

.prop__review {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--hairline);
}

.prop__review .form-label { display: block; margin-bottom: var(--space-2); }

.prop__review .lib-select,
.prop__review .form-select { margin-bottom: var(--space-4); }

.prop__review-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-3);
}

.form-label__optional {
  font-weight: var(--weight-regular);
  color: var(--color-grey-light);
  text-transform: none;
  letter-spacing: 0;
}


/* ============================================================
   17d. COALITION ASSISTANT PAGE
   An explanation, the shared credentials with a copy control,
   and one way in.
   ============================================================ */

.assistant-copy {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--color-grey-dark);
  margin-bottom: var(--space-4);
}

.assistant-copy:last-of-type { margin-bottom: 0; }

.cred-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.cred {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
}

.cred__label {
  font-size: 0.6875rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-grey-mid);
  width: 84px;
  flex-shrink: 0;
}

.cred__value {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: var(--weight-medium);
  color: var(--color-black);
  overflow-wrap: break-word;
  user-select: all;
}

.cred__copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1) 0;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-grey-mid);
  transition: color var(--transition-fast);
}

.cred__copy .icon { width: 14px; height: 14px; }

.cred__copy:hover { color: var(--color-black); }

/* Confirmation on copy: the control says so itself */
.cred__copy.is-copied { color: var(--color-orange-hover); }

.cred-note {
  font-size: var(--text-xs);
  line-height: 1.6;
  color: var(--color-grey-mid);
  margin-bottom: var(--space-5);
}


/* ============================================================
   17e. ADMIN PANEL
   A member list with the two governance controls side by side,
   and the record of what changed.
   ============================================================ */

.admin-search { width: 100%; margin-bottom: var(--space-4); }

.adm-head,
.adm-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 150px 170px;
  align-items: center;
  gap: var(--space-4);
}

.adm-head {
  font-size: 0.6875rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-grey-mid);
  padding-bottom: var(--space-2);
}

.adm-row {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--hairline);
}

.adm-row.is-inactive .adm-row__who { opacity: 0.55; }

.adm-row__who {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.adm-row__info { min-width: 0; line-height: 1.35; }

.adm-row__name {
  font-size: 0.8125rem;
  font-weight: var(--weight-semibold);
  color: var(--color-black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-row__org {
  font-size: var(--text-xs);
  color: var(--color-grey-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-row__control { min-width: 0; }

.adm-row__control .lib-select { width: 100%; }

.adm-row__control .check-row { font-size: var(--text-xs); }

.adm-row__control--end {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.adm-row__state {
  font-size: var(--text-xs);
  color: var(--color-grey-mid);
}

.adm-row__act {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: var(--text-xs);
  color: var(--color-grey-light);
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.adm-row__act:hover { color: var(--color-orange-hover); }

.adm-row__act:disabled { opacity: 0.5; cursor: default; }

/* Confidential posts and the audit log: the same quiet list */
.adm-item {
  display: block;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--hairline);
  text-decoration: none;
}

.adm-item:first-child { border-top: none; padding-top: 0; }

.adm-item__main {
  font-size: 0.8125rem;
  font-weight: var(--weight-medium);
  color: var(--color-black);
  line-height: 1.5;
}

a.adm-item:hover .adm-item__main { color: var(--color-orange-hover); }

.adm-item__meta {
  font-size: var(--text-xs);
  color: var(--color-grey-mid);
  margin-top: 1px;
}


/* ============================================================
   18. ANIMATIONS + REDUCED MOTION
   ============================================================ */

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

.anim-fade-up {
  animation: fadeUp 0.55s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.anim-stagger > *:nth-child(1) { animation-delay: 0ms; }
.anim-stagger > *:nth-child(2) { animation-delay: 60ms; }
.anim-stagger > *:nth-child(3) { animation-delay: 120ms; }
.anim-stagger > *:nth-child(4) { animation-delay: 180ms; }
.anim-stagger > *:nth-child(5) { animation-delay: 240ms; }
.anim-stagger > *:nth-child(6) { animation-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ============================================================
   19. RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {
  :root {
    --container-padding: var(--space-6);
  }

  .shell {
    margin-left: 0;
    padding: calc(56px + var(--space-6)) var(--space-6) var(--space-16);
  }

  .feed-grid {
    grid-template-columns: 1fr;
  }

  .feed-rail {
    position: static;
    order: -1;
  }

  /* On small screens only open calls matter in the rail */
  .rail-note { display: none; }
}

@media (max-width: 900px) {
  /* iOS ignores background-attachment: fixed; let it scroll */
  .auth-scene { background-attachment: scroll; }
}

@media (max-width: 480px) {
  .auth-scene { padding: var(--space-4); }

  .auth-card { padding: var(--space-10) var(--space-6); }
}

@media (max-width: 900px) {
  /* Admin rows stop being a table and become stacked controls */
  .adm-head { display: none; }

  .adm-row {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: var(--space-4) 0;
  }

  .adm-row__control--end { justify-content: flex-start; gap: var(--space-4); }

  .adm-row__control .lib-select { max-width: 100%; }
}

@media (max-width: 768px) {
  :root {
    --container-padding: var(--space-5);
  }

  /* Narrower than a phone, then nudged inside the viewport by the
     placement pass in portal.js */
  .conf-mark__note {
    width: min(268px, calc(100vw - var(--space-10)));
  }

  .post-row__end {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    margin-top: var(--space-2);
  }

  .post-row__head { flex-wrap: wrap; }

  .board-people { grid-template-columns: 1fr; }

  .filter-row { gap: var(--space-4); }

  .filter-row__group + .filter-row__group {
    margin-left: 0;
    width: 100%;
    padding-top: var(--space-1);
  }

  .prop__head { flex-wrap: wrap; gap: var(--space-2); }

  .cred { flex-wrap: wrap; gap: var(--space-2) var(--space-3); }

  .cred__label { width: auto; }

  .cred__value { flex-basis: 100%; order: 3; }

  .shell {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .composer,
  .panel {
    padding: var(--space-4);
  }

  .post-row {
    padding: var(--space-4);
  }

  .composer__types {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .org-grid {
    grid-template-columns: 1fr;
  }

  /* Calendar widget stacks: month grid on top, list below */
  .calwidget__grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .calup { max-height: none; }

  /* Events page cards stack: image on top, content below */
  .event-card {
    grid-template-columns: 1fr;
  }

  .event-card__media,
  .event-card--featured .event-card__media {
    min-height: 0;
    aspect-ratio: 16 / 9;
    border-radius: 11px 11px 0 0;
  }

  .event-card__media img:not(.ev-media__symbol) { position: static; }

  .event-card__body { padding: var(--space-4); }

  .res-grid--row { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .lib-search { width: 100%; }
}

@media (max-width: 480px) {
  :root {
    --container-padding: var(--space-4);
  }

  .composer__types {
    grid-template-columns: 1fr 1fr;
  }

}
