/* =============================================================================
   A Light From Heaven — member community
   A calm, modern app look: neutral surfaces, navy for action, gold only as a
   highlight. Every class is prefixed `cm-` so nothing here can leak into the
   public site, and nothing from the older public-site rules leaks in.
   ============================================================================= */

:root {
  /* surfaces */
  --cm-bg: #f5f5f2;
  --cm-surface: #ffffff;
  --cm-sunken: #f0f1f3;
  --cm-hover: rgba(22, 35, 61, .05);
  --cm-press: rgba(22, 35, 61, .09);
  --cm-border: rgba(22, 35, 61, .09);
  --cm-border-strong: rgba(22, 35, 61, .16);

  /* text — all pass WCAG AA on white and on --cm-bg */
  --cm-text: #16233d;
  --cm-text-2: #4f5867;
  --cm-text-3: #6b7280;

  /* brand */
  --cm-navy: #16233d;
  --cm-navy-hover: #22355a;
  --cm-gold: #d8a100;           /* fills and icons only: too light for text */
  --cm-gold-soft: #fbf4dc;
  --cm-gold-ink: #7d5c00;       /* gold for text, 6:1 on white */
  --cm-focus: 0 0 0 3px rgba(216, 161, 0, .45);
  --cm-danger: #b42318;

  /* spacing (4px grid) */
  --cm-1: 4px;  --cm-2: 8px;  --cm-3: 12px; --cm-4: 16px;
  --cm-5: 20px; --cm-6: 24px; --cm-8: 32px; --cm-10: 40px; --cm-12: 48px;

  /* type */
  --cm-font: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --cm-serif: 'Cormorant Garamond', Georgia, serif;
  --cm-fs-xs: 12px; --cm-fs-sm: 13px; --cm-fs-md: 15px; --cm-fs-lg: 17px;
  --cm-fs-xl: 22px; --cm-fs-2xl: 30px; --cm-fs-3xl: 36px;

  /* shape + depth */
  --cm-r-sm: 8px; --cm-r-md: 12px; --cm-r-lg: 16px; --cm-r-xl: 20px; --cm-r-full: 999px;
  --cm-shadow-1: 0 1px 2px rgba(16, 27, 48, .04), 0 1px 3px rgba(16, 27, 48, .04);
  --cm-shadow-2: 0 2px 6px rgba(16, 27, 48, .05), 0 12px 32px rgba(16, 27, 48, .07);
  --cm-shadow-3: 0 24px 64px rgba(16, 27, 48, .22);

  /* layout */
  --cm-top: 64px;
  --cm-side: 264px;
  --cm-tabbar: 64px;
  --cm-tap: 44px;
  --cm-ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- shell ---------------------------------------------------------- */
.cm {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  grid-template-rows: var(--cm-top) minmax(0, 1fr);
  background: var(--cm-bg);
  color: var(--cm-text);
  font-family: var(--cm-font);
  font-size: var(--cm-fs-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  isolation: isolate;
}
/* :where() keeps these resets at zero specificity so component classes win. */
:where(.cm) *, :where(.cm) *::before, :where(.cm) *::after { box-sizing: border-box; }
:where(.cm, .am--app) :where(h1, h2, h3, p) { margin: 0; }
/* The public site styles bare headings in the serif; app headings opt in
   explicitly. One class of specificity: beats `h2{}`, loses to later classes. */
.cm :where(h1, h2, h3), .am--app :where(h1, h2, h3) { font-family: var(--cm-font); color: inherit; letter-spacing: normal; text-transform: none; }
:where(.cm, .am--app) button { font: inherit; color: inherit; }
.cm :focus-visible, .am--app :focus-visible { outline: none; box-shadow: var(--cm-focus); }

.cm-top {
  display: flex;
  align-items: center;
  gap: var(--cm-3);
  padding: 0 var(--cm-6);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--cm-border);
  z-index: 3;
}
.cm-top__brand {
  display: flex;
  align-items: center;
  gap: var(--cm-3);
  min-width: 0;
  margin-right: auto;
}
.cm-top__brand img { height: 36px; width: auto; }
.cm-top__brand span {
  font-family: var(--cm-serif);
  font-size: var(--cm-fs-xl);
  font-weight: 600;
  letter-spacing: -.005em;
  white-space: nowrap;
}
.cm-top .cm-top__menu, .cm-top .cm-top__me { display: none; }

.cm-body {
  display: grid;
  grid-template-columns: var(--cm-side) minmax(0, 1fr);
  min-height: 0;
}

/* sidebar */
.cm-side {
  display: flex;
  flex-direction: column;
  gap: var(--cm-4);
  padding: var(--cm-5) var(--cm-3) var(--cm-3);
  background: var(--cm-surface);
  border-right: 1px solid var(--cm-border);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cm-nav { display: flex; flex-direction: column; gap: var(--cm-5); flex: 1; }
.cm-nav__group { display: flex; flex-direction: column; gap: 2px; }
.cm-nav__label {
  padding: 0 var(--cm-3) var(--cm-1);
  font-size: var(--cm-fs-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--cm-text-3);
}
.cm-nav__item {
  display: flex;
  align-items: center;
  gap: var(--cm-3);
  width: 100%;
  min-height: var(--cm-tap);
  padding: 0 var(--cm-3);
  border: 0;
  border-radius: var(--cm-r-md);
  background: transparent;
  font-size: var(--cm-fs-md);
  font-weight: 600;
  color: var(--cm-text-2);
  text-align: left;
  cursor: pointer;
  transition: background-color .15s var(--cm-ease), color .15s var(--cm-ease);
}
.cm-nav__item:hover { background: var(--cm-hover); color: var(--cm-text); }
.cm-nav__item.is-on { background: var(--cm-gold-soft); color: var(--cm-text); font-weight: 700; }
.cm-nav__item.is-on .cm-ic { color: var(--cm-gold-ink); }
.cm-nav__item .cm-count { margin-left: auto; }

.cm-me {
  display: flex;
  align-items: center;
  gap: var(--cm-3);
  width: 100%;
  padding: var(--cm-2) var(--cm-3);
  border: 1px solid var(--cm-border);
  border-radius: var(--cm-r-lg);
  background: var(--cm-surface);
  text-align: left;
  cursor: pointer;
  transition: background-color .15s var(--cm-ease);
}
.cm-me:hover { background: var(--cm-hover); }
.cm-me__text { display: flex; flex-direction: column; min-width: 0; }
.cm-me__text b { font-size: var(--cm-fs-sm); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-me__text span { font-size: var(--cm-fs-xs); color: var(--cm-text-3); }

.cm-main {
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-top: var(--cm-6);
}
.cm-page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--cm-8) var(--cm-10) var(--cm-12);
}
.cm-page--narrow { max-width: 720px; }
/* Messages fills the screen like a native chat app. */
.cm-page--fill {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-bottom: var(--cm-6);
}

.cm-scrim { display: none; }
.cm-tabbar { display: none; }

/* ---------- type + page header -------------------------------------------- */
.cm-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--cm-4);
  margin-bottom: var(--cm-6);
}
.cm-eyebrow {
  font-size: var(--cm-fs-xs);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cm-gold-ink);
  margin-bottom: var(--cm-1);
}
.cm-title {
  font-family: var(--cm-serif);
  font-size: var(--cm-fs-3xl);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--cm-text);
}
.cm-head__actions { display: flex; gap: var(--cm-2); flex-wrap: wrap; }
.cm-h2 {
  font-size: var(--cm-fs-lg);
  font-weight: 700;
  letter-spacing: -.005em;
}
.cm-sub { font-size: var(--cm-fs-sm); color: var(--cm-text-2); margin-top: 2px; }
.cm-note { font-size: var(--cm-fs-sm); color: var(--cm-text-2); }
.cm-hint {
  display: inline-flex;
  align-items: center;
  gap: var(--cm-2);
  font-size: var(--cm-fs-sm);
  color: var(--cm-text-3);
}
.cm-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- icons + avatars ------------------------------------------------ */
.cm-ic { flex: none; display: block; }
.cm-avatar {
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  letter-spacing: .02em;
  object-fit: cover;
  user-select: none;
  box-shadow: inset 0 0 0 1px rgba(16, 27, 48, .06);
}

/* ---------- buttons -------------------------------------------------------- */
.cm-btn, .am--app .cm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--cm-2);
  min-height: var(--cm-tap);
  padding: 0 var(--cm-5);
  border: 0;
  border-radius: var(--cm-r-full);
  font-family: var(--cm-font);
  font-size: var(--cm-fs-md);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s var(--cm-ease), box-shadow .15s var(--cm-ease), transform .1s var(--cm-ease);
}
.cm-btn:active:not(:disabled) { transform: scale(.98); }
.cm-btn:disabled { opacity: .45; cursor: not-allowed; }
.cm-btn--sm { min-height: 36px; padding: 0 var(--cm-4); font-size: var(--cm-fs-sm); }
.cm-btn--block { width: 100%; }
.cm-btn--primary { background: var(--cm-navy); color: #fff; }
.cm-btn--primary:hover:not(:disabled) { background: var(--cm-navy-hover); }
.cm-btn--gold { background: var(--cm-gold); color: #2b1f00; }
.cm-btn--gold:hover:not(:disabled) { background: #e5ad00; }
.cm-btn--secondary { background: var(--cm-sunken); color: var(--cm-text); }
.cm-btn--secondary:hover:not(:disabled) { background: #e6e8eb; }
.cm-btn--quiet { background: transparent; color: var(--cm-text-2); padding: 0 var(--cm-3); }
.cm-btn--quiet:hover:not(:disabled) { background: var(--cm-hover); color: var(--cm-text); }
.cm-btn--danger { background: transparent; color: var(--cm-danger); }
.cm-btn--danger:hover:not(:disabled) { background: rgba(180, 35, 24, .07); }
/* Small buttons still get a 44px touch area. */
.cm-btn--sm { position: relative; }
.cm-btn--sm::after { content: ""; position: absolute; inset: -4px 0; }

.cm-iconbtn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--cm-tap);
  height: var(--cm-tap);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cm-text-2);
  cursor: pointer;
  transition: background-color .15s var(--cm-ease), color .15s var(--cm-ease);
}
.cm-iconbtn:hover { background: var(--cm-hover); color: var(--cm-text); }
.cm-iconbtn--danger:hover { color: var(--cm-danger); background: rgba(180, 35, 24, .07); }

/* ---------- surfaces ------------------------------------------------------- */
.cm-card {
  background: var(--cm-surface);
  border: 1px solid var(--cm-border);
  border-radius: var(--cm-r-xl);
  box-shadow: var(--cm-shadow-1);
}
.cm-card--pad { padding: var(--cm-6); }
/* Stacked page sections get breathing room; cards inside grids use the grid gap. */
.cm-page > .cm-card + .cm-card { margin-top: var(--cm-4); }
.cm-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--cm-4);
  flex-wrap: wrap;
  margin-bottom: var(--cm-4);
}
.cm-stack { display: flex; flex-direction: column; gap: var(--cm-4); }
.cm-grid { display: grid; gap: var(--cm-4); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cm-grid--wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* ---------- badges --------------------------------------------------------- */
.cm-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--cm-1);
  height: 22px;
  padding: 0 var(--cm-2);
  border-radius: var(--cm-r-full);
  font-size: var(--cm-fs-xs);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  background: var(--cm-sunken);
  color: var(--cm-text-2);
  vertical-align: middle;
}
.cm-badge--admin { background: var(--cm-navy); color: #fff; }
.cm-badge--t2, .cm-badge--gold { background: var(--cm-gold-soft); color: var(--cm-gold-ink); }
.cm-badge--t1 { background: #e8f1fa; color: #24507f; }
.cm-badge--ok { background: #e7f5ec; color: #1d6b3a; }
.cm-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--cm-r-full);
  background: var(--cm-sunken);
  font-size: var(--cm-fs-xs);
  font-weight: 700;
  color: var(--cm-text-2);
}
.cm-level {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--cm-r-full);
  background: var(--cm-gold-soft);
  color: var(--cm-gold-ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}

/* ---------- forms ---------------------------------------------------------- */
.cm-field { display: flex; flex-direction: column; gap: var(--cm-2); margin-bottom: var(--cm-4); }
.cm-field label, .cm-label {
  font-size: var(--cm-fs-sm);
  font-weight: 700;
  color: var(--cm-text);
}
.cm-field .cm-sub { margin-top: -4px; }
.cm-input {
  width: 100%;
  min-height: var(--cm-tap);
  padding: 10px 14px;
  border: 1px solid var(--cm-border-strong);
  border-radius: var(--cm-r-md);
  background: var(--cm-surface);
  font-family: var(--cm-font);
  font-size: 16px;               /* 16px stops iOS zooming into the field */
  color: var(--cm-text);
  transition: border-color .15s var(--cm-ease), box-shadow .15s var(--cm-ease);
}
.cm-input::placeholder { color: #8a919c; }
.cm-input:focus { outline: none; border-color: var(--cm-gold); box-shadow: var(--cm-focus); }
textarea.cm-input { resize: vertical; line-height: 1.55; }
.cm-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--cm-4); }
.cm-actions { display: flex; justify-content: flex-end; gap: var(--cm-2); flex-wrap: wrap; }
.cm-msgline { font-size: var(--cm-fs-sm); color: var(--cm-text-2); min-height: 1.5em; margin-bottom: var(--cm-2); }
.cm-check { display: flex; align-items: center; gap: var(--cm-3); min-height: var(--cm-tap); font-weight: 600; cursor: pointer; }
.cm-check input { width: 20px; height: 20px; accent-color: var(--cm-navy); }

/* iOS-style switch */
.cm-switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  border: 0;
  border-radius: var(--cm-r-full);
  background: #d5d8dd;
  cursor: pointer;
  transition: background-color .2s var(--cm-ease);
}
.cm-switch::before {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
  transition: transform .2s var(--cm-ease);
}
.cm-switch[aria-checked="true"] { background: var(--cm-gold); }
.cm-switch[aria-checked="true"]::before { transform: translateX(20px); }

.cm-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--cm-4);
  padding: var(--cm-4) 0;
  border-top: 1px solid var(--cm-border);
}
.cm-setting:first-of-type { border-top: 0; }
.cm-setting b { font-weight: 700; }

/* segmented control */
.cm-seg {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--cm-r-full);
  background: var(--cm-sunken);
}
.cm-seg button {
  min-height: 36px;
  padding: 0 var(--cm-4);
  border: 0;
  border-radius: var(--cm-r-full);
  background: transparent;
  font-size: var(--cm-fs-sm);
  font-weight: 700;
  color: var(--cm-text-2);
  cursor: pointer;
  transition: background-color .15s var(--cm-ease), box-shadow .15s var(--cm-ease);
}
.cm-seg button[aria-selected="true"] { background: var(--cm-surface); color: var(--cm-text); box-shadow: 0 1px 3px rgba(16, 27, 48, .12); }

/* ---------- banners + empty states ---------------------------------------- */
.cm-banner {
  display: flex;
  align-items: center;
  gap: var(--cm-4);
  padding: var(--cm-4) var(--cm-5);
  margin-bottom: var(--cm-4);
  border-radius: var(--cm-r-xl);
  background: var(--cm-surface);
  border: 1px solid var(--cm-border);
}
.cm-banner__ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cm-gold-soft);
  color: var(--cm-gold-ink);
}
.cm-banner__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cm-banner__text b { font-weight: 700; }
.cm-banner__text span { font-size: var(--cm-fs-sm); color: var(--cm-text-2); }
.cm-banner--gold { background: var(--cm-gold-soft); border-color: rgba(216, 161, 0, .25); }
.cm-banner--gold .cm-banner__ic { background: var(--cm-surface); }
.cm-banner--navy { background: var(--cm-navy); border-color: var(--cm-navy); color: #fff; }
.cm-banner--navy .cm-banner__ic { background: rgba(255, 255, 255, .1); color: var(--cm-gold); }
.cm-banner--navy .cm-banner__text span { color: #c9d3e3; }

.cm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--cm-2);
  padding: var(--cm-12) var(--cm-6);
  text-align: center;
  background: var(--cm-surface);
  border: 1px solid var(--cm-border);
  border-radius: var(--cm-r-xl);
  grid-column: 1 / -1;
}
.cm-empty__ic {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--cm-2);
  border-radius: 50%;
  background: var(--cm-gold-soft);
  color: var(--cm-gold-ink);
}
.cm-empty h3 { font-size: var(--cm-fs-lg); font-weight: 700; }
.cm-empty p { max-width: 36ch; font-size: var(--cm-fs-md); color: var(--cm-text-2); }
.cm-empty .cm-btn { margin-top: var(--cm-3); }

/* ---------- feed ----------------------------------------------------------- */
.cm-composer { display: flex; gap: var(--cm-3); padding: var(--cm-4) var(--cm-5); margin-bottom: var(--cm-6); }
.cm-composer__body { flex: 1; min-width: 0; }
.cm-composer__input {
  display: block;
  width: 100%;
  min-height: 72px;
  padding: 9px 0;
  border: 0;
  background: transparent;
  resize: none;
  font-family: var(--cm-font);
  font-size: var(--cm-fs-lg);
  line-height: 1.5;
  color: var(--cm-text);
}
.cm-composer__input::placeholder { color: #8a919c; }
.cm-composer__input:focus { outline: none; box-shadow: none; }
.cm-composer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--cm-2);
  padding-top: var(--cm-3);
  margin-top: var(--cm-2);
  border-top: 1px solid var(--cm-border);
}
.cm-composer__preview { position: relative; margin-top: var(--cm-3); }
.cm-composer__preview img { display: block; max-height: 280px; max-width: 100%; border-radius: var(--cm-r-lg); }
.cm-composer__remove {
  position: absolute;
  top: var(--cm-2);
  left: var(--cm-2);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 27, 48, .7);
  color: #fff;
  cursor: pointer;
}

.cm-post { padding: var(--cm-5); }
.cm-post__head { display: flex; align-items: center; gap: var(--cm-3); }
.cm-post__who { flex: 1; min-width: 0; }
.cm-post__name { display: flex; align-items: center; gap: var(--cm-2); flex-wrap: wrap; font-weight: 700; }
.cm-post__time { display: flex; align-items: center; gap: var(--cm-2); font-size: var(--cm-fs-sm); color: var(--cm-text-3); }
.cm-post__body {
  margin-top: var(--cm-3);
  font-size: var(--cm-fs-lg);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.cm-post__img {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  margin-top: var(--cm-4);
  border-radius: var(--cm-r-lg);
  background: var(--cm-sunken);
}
.cm-post__actions {
  display: flex;
  gap: var(--cm-1);
  margin-top: var(--cm-3);
  margin-left: -10px;
}
.cm-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--cm-r-full);
  background: transparent;
  font-size: var(--cm-fs-sm);
  font-weight: 700;
  color: var(--cm-text-2);
}
button.cm-action { cursor: pointer; transition: background-color .15s var(--cm-ease), color .15s var(--cm-ease); }
button.cm-action:hover { background: var(--cm-hover); color: var(--cm-text); }
.cm-action.is-on { color: #c2410c; }
.cm-action.is-on .cm-ic { fill: currentColor; }
.cm-post__locked { margin-top: var(--cm-3); }

.cm-comments { display: flex; flex-direction: column; gap: var(--cm-3); margin-top: var(--cm-3); padding-top: var(--cm-4); border-top: 1px solid var(--cm-border); }
.cm-comment { display: flex; gap: var(--cm-2); }
.cm-comment__bubble { min-width: 0; padding: var(--cm-2) var(--cm-3); border-radius: var(--cm-r-lg); background: var(--cm-sunken); }
.cm-comment__meta { display: flex; gap: var(--cm-2); align-items: baseline; font-size: var(--cm-fs-sm); }
.cm-comment__meta span { color: var(--cm-text-3); font-size: var(--cm-fs-xs); }
.cm-comment__bubble > p:last-child { font-size: var(--cm-fs-md); overflow-wrap: anywhere; }

.cm-reply { display: flex; align-items: center; gap: var(--cm-2); margin-top: var(--cm-3); }
.cm-reply__field { position: relative; flex: 1; min-width: 0; }
.cm-reply__input {
  width: 100%;
  min-height: 40px;
  padding: 8px 48px 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--cm-r-full);
  background: var(--cm-sunken);
  font-family: var(--cm-font);
  font-size: 16px;
  color: var(--cm-text);
}
.cm-reply__input:focus { outline: none; background: var(--cm-surface); border-color: var(--cm-gold); box-shadow: var(--cm-focus); }
.cm-reply__send {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cm-text-2);
  cursor: pointer;
}
.cm-reply__send:hover { color: var(--cm-text); background: var(--cm-hover); }

/* ---------- people --------------------------------------------------------- */
.cm-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--cm-6) var(--cm-5) var(--cm-5);
  text-align: center;
}
.cm-person h3 { margin-top: var(--cm-3); font-size: var(--cm-fs-lg); font-weight: 700; }
.cm-person__badges { display: flex; gap: var(--cm-1); justify-content: center; flex-wrap: wrap; margin-top: var(--cm-2); }
.cm-person__bio {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3em;
  margin: var(--cm-3) 0 var(--cm-4);
  font-size: var(--cm-fs-sm);
  color: var(--cm-text-2);
}
.cm-person__actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--cm-2); width: 100%; margin-top: auto; }

/* leaderboard */
.cm-rankcard { display: flex; align-items: center; gap: var(--cm-4); padding: var(--cm-5) var(--cm-6); margin-bottom: var(--cm-4); }
.cm-rankcard__info { flex: 1; min-width: 0; }
.cm-rankcard__name { font-size: var(--cm-fs-lg); font-weight: 700; }
.cm-progress { height: 8px; margin-top: var(--cm-3); border-radius: var(--cm-r-full); background: var(--cm-sunken); overflow: hidden; }
.cm-progress i { display: block; height: 100%; border-radius: inherit; background: var(--cm-gold); }
.cm-list { overflow: hidden; }
.cm-listrow {
  display: flex;
  align-items: center;
  gap: var(--cm-3);
  min-height: 64px;
  padding: var(--cm-2) var(--cm-5);
  border-top: 1px solid var(--cm-border);
}
.cm-listrow:first-child { border-top: 0; }
.cm-listrow.is-me { background: #fffcf2; }
.cm-listrow__main { flex: 1; min-width: 0; }
.cm-listrow__title { display: flex; align-items: center; gap: var(--cm-2); font-weight: 700; }
.cm-rank {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: var(--cm-fs-sm);
  font-weight: 800;
  color: var(--cm-text-3);
}
.cm-rank.is-1 { background: #f6d77a; color: #4a3600; }
.cm-rank.is-2 { background: #e3e6ea; color: #3b4452; }
.cm-rank.is-3 { background: #ecd0b4; color: #5a3714; }
.cm-points { font-size: var(--cm-fs-xl); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* articles */
.cm-article {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  transition: transform .2s var(--cm-ease), box-shadow .2s var(--cm-ease);
}
.cm-article:hover { transform: translateY(-2px); box-shadow: var(--cm-shadow-2); }
.cm-article__cover { position: relative; flex: none; aspect-ratio: 16 / 10; overflow: hidden; background: var(--cm-sunken); }
.cm-article__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-article__body { display: flex; flex-direction: column; gap: var(--cm-1); padding: var(--cm-5); }
.cm-article__body h3 { font-family: var(--cm-serif); font-size: var(--cm-fs-xl); font-weight: 600; line-height: 1.2; }
.cm-article__body p { font-size: var(--cm-fs-sm); color: var(--cm-text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* events */
.cm-event { display: flex; flex-direction: column; gap: var(--cm-3); padding: var(--cm-5); }
.cm-event__top { display: flex; align-items: flex-start; gap: var(--cm-4); }
.cm-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 60px;
  height: 64px;
  border-radius: var(--cm-r-lg);
  background: var(--cm-gold-soft);
  color: var(--cm-gold-ink);
}
.cm-date span { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cm-date b { font-size: 26px; font-weight: 800; line-height: 1; color: var(--cm-text); }
.cm-event__info { flex: 1; min-width: 0; }
.cm-event__info h3 { font-size: var(--cm-fs-lg); font-weight: 700; line-height: 1.3; }
.cm-event__when { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: var(--cm-fs-sm); color: var(--cm-text-2); }
.cm-event__desc { font-size: var(--cm-fs-md); color: var(--cm-text-2); flex: 1; }
.cm-event .cm-btn { margin-top: auto; }

/* messages */
.cm-chat {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  flex: 1;
  min-height: 420px;
  overflow: hidden;
}
.cm-chat__list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--cm-border); }
.cm-chat__search { position: relative; padding: var(--cm-3); border-bottom: 1px solid var(--cm-border); }
.cm-chat__search .cm-ic { position: absolute; top: 50%; left: 26px; transform: translateY(-50%); color: var(--cm-text-3); pointer-events: none; }
.cm-chat__search input {
  width: 100%;
  min-height: 40px;
  padding: 8px 14px 8px 40px;
  border: 1px solid transparent;
  border-radius: var(--cm-r-full);
  background: var(--cm-sunken);
  font-family: var(--cm-font);
  font-size: 16px;
  color: var(--cm-text);
}
.cm-chat__search input:focus { outline: none; background: var(--cm-surface); border-color: var(--cm-gold); box-shadow: var(--cm-focus); }
.cm-chat__people { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--cm-2); }
.cm-chat__person {
  display: flex;
  align-items: center;
  gap: var(--cm-3);
  width: 100%;
  min-height: 64px;
  padding: var(--cm-2) var(--cm-3);
  border: 0;
  border-radius: var(--cm-r-md);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.cm-chat__person:hover { background: var(--cm-hover); }
.cm-chat__person.is-on { background: var(--cm-gold-soft); }
.cm-chat__meta { flex: 1; min-width: 0; }
.cm-chat__name { display: flex; align-items: center; gap: var(--cm-2); font-weight: 700; }
.cm-chat__snip { font-size: var(--cm-fs-sm); color: var(--cm-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-chat__when { align-self: flex-start; padding-top: 4px; font-size: var(--cm-fs-xs); color: var(--cm-text-3); }
.cm-chat__none { padding: var(--cm-6) var(--cm-4); font-size: var(--cm-fs-sm); color: var(--cm-text-2); text-align: center; }

.cm-chat__pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.cm-chat__head { display: flex; align-items: center; gap: var(--cm-3); padding: var(--cm-3) var(--cm-4); border-bottom: 1px solid var(--cm-border); }
.cm-chat__head > div { flex: 1; min-width: 0; }
.cm-chat__head b { display: block; font-weight: 700; }
.cm-chat__back { display: none; }
.cm-chat__scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--cm-5); display: flex; flex-direction: column; gap: 2px; }
.cm-chat__day { align-self: center; margin: var(--cm-4) 0 var(--cm-2); font-size: var(--cm-fs-xs); font-weight: 700; color: var(--cm-text-3); }
.cm-bubble { display: flex; align-items: flex-end; gap: var(--cm-2); max-width: 78%; margin-top: var(--cm-2); }
.cm-bubble.is-run { margin-top: 0; }
.cm-bubble.is-me { align-self: flex-end; flex-direction: row-reverse; }
.cm-bubble__spacer { width: 28px; flex: none; }
.cm-bubble.is-me .cm-bubble__spacer { display: none; }
.cm-bubble__col { display: flex; flex-direction: column; min-width: 0; }
.cm-bubble.is-me .cm-bubble__col { align-items: flex-end; }
.cm-bubble__body {
  padding: 9px 14px;
  border-radius: 20px;
  background: var(--cm-sunken);
  font-size: var(--cm-fs-md);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.cm-bubble.is-me .cm-bubble__body { background: var(--cm-navy); color: #fff; }
.cm-bubble__time { margin: 2px 6px 0; font-size: 11px; color: var(--cm-text-3); }
.cm-chat__compose { display: flex; align-items: flex-end; gap: var(--cm-2); padding: var(--cm-3) var(--cm-4); border-top: 1px solid var(--cm-border); }
.cm-chat__input {
  flex: 1;
  min-height: 44px;
  max-height: 132px;
  padding: 11px 16px;
  border: 1px solid var(--cm-border-strong);
  border-radius: 22px;
  background: var(--cm-surface);
  resize: none;
  font-family: var(--cm-font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--cm-text);
}
.cm-chat__input:focus { outline: none; border-color: var(--cm-gold); box-shadow: var(--cm-focus); }
.cm-chat__send {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--cm-navy);
  color: #fff;
  cursor: pointer;
}
.cm-chat__send:hover { background: var(--cm-navy-hover); }
.cm-chat__blank { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--cm-2); padding: var(--cm-8); text-align: center; }
.cm-chat__blank b { font-size: var(--cm-fs-lg); }
.cm-chat__blank span { color: var(--cm-text-2); }

/* profile */
.cm-profile { max-width: 560px; margin: 0 auto; padding: var(--cm-8) var(--cm-6) var(--cm-6); text-align: center; }
.cm-profile__pic { position: relative; display: inline-block; }
.cm-profile__cam {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 3px solid var(--cm-surface);
  border-radius: 50%;
  background: var(--cm-navy);
  color: #fff;
  cursor: pointer;
}
.cm-profile__cam:hover { background: var(--cm-navy-hover); }
.cm-profile h1 { margin-top: var(--cm-4); font-family: var(--cm-serif); font-size: var(--cm-fs-2xl); font-weight: 600; line-height: 1.15; }
.cm-profile__meta { display: flex; justify-content: center; gap: var(--cm-2); flex-wrap: wrap; margin-top: var(--cm-2); }
.cm-profile__bio { margin: var(--cm-4) auto 0; max-width: 42ch; color: var(--cm-text-2); }
.cm-profile__edit { margin-top: var(--cm-6); text-align: left; }
.cm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--cm-3); margin-top: var(--cm-6); }
.cm-stat { padding: var(--cm-4) var(--cm-2); border-radius: var(--cm-r-lg); background: var(--cm-sunken); }
.cm-stat b { display: block; font-size: var(--cm-fs-xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.cm-stat span { font-size: var(--cm-fs-xs); font-weight: 700; color: var(--cm-text-2); text-transform: uppercase; letter-spacing: .06em; }
.cm-back { margin: 0 0 var(--cm-4) calc(-1 * var(--cm-3)); }

/* ---------- admin ---------------------------------------------------------- */
.cm-tabs {
  display: flex;
  gap: var(--cm-1);
  margin: 0 0 var(--cm-6);
  padding: 4px;
  border-radius: var(--cm-r-full);
  background: var(--cm-surface);
  border: 1px solid var(--cm-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.cm-tabs::-webkit-scrollbar { display: none; }
.cm-tabs button {
  display: inline-flex;
  align-items: center;
  gap: var(--cm-2);
  flex: none;
  min-height: 40px;
  padding: 0 var(--cm-4);
  border: 0;
  border-radius: var(--cm-r-full);
  background: transparent;
  font-size: var(--cm-fs-sm);
  font-weight: 700;
  color: var(--cm-text-2);
  cursor: pointer;
  transition: background-color .15s var(--cm-ease), color .15s var(--cm-ease);
}
.cm-tabs button:hover { background: var(--cm-hover); color: var(--cm-text); }
.cm-tabs button[aria-selected="true"] { background: var(--cm-navy); color: #fff; }
.cm-tabs button[aria-selected="true"] .cm-count { background: rgba(255, 255, 255, .16); color: #fff; }

.cm-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--cm-3); margin-bottom: var(--cm-4); }
.cm-kpi { padding: var(--cm-4) var(--cm-5); }
.cm-kpi b { display: block; font-size: var(--cm-fs-2xl); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.cm-kpi span { display: block; margin-top: var(--cm-1); font-size: var(--cm-fs-sm); color: var(--cm-text-2); }
.cm-kpi.is-gold { background: var(--cm-gold-soft); border-color: rgba(216, 161, 0, .25); }

.cm-pipe { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: var(--cm-3); }
.cm-pipe__step { padding: var(--cm-4); border-radius: var(--cm-r-lg); background: var(--cm-sunken); text-align: center; }
.cm-pipe__step b { display: block; font-size: var(--cm-fs-xl); font-weight: 800; }
.cm-pipe__step span { font-size: var(--cm-fs-sm); color: var(--cm-text-2); }
.cm-pipe__step.is-gold { background: var(--cm-gold-soft); }
.cm-pipe__step.is-warn { background: #fff4e5; }
.cm-pipe > .cm-ic { color: var(--cm-text-3); }

.cm-toolbar { display: flex; gap: var(--cm-2); flex-wrap: wrap; }

.cm-table { width: 100%; border-collapse: collapse; font-size: var(--cm-fs-md); }
.cm-table th {
  padding: var(--cm-3) var(--cm-4);
  text-align: left;
  font-size: var(--cm-fs-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--cm-text-3);
  border-bottom: 1px solid var(--cm-border);
  white-space: nowrap;
}
.cm-table td { padding: var(--cm-3) var(--cm-4); border-top: 1px solid var(--cm-border); vertical-align: middle; }
.cm-table tbody tr:first-child td { border-top: 0; }
.cm-table tbody tr:hover td { background: #fafafa; }
.cm-table__who { display: flex; align-items: center; gap: var(--cm-3); min-width: 0; }
.cm-table__who b { display: flex; align-items: center; gap: var(--cm-2); font-weight: 700; }
.cm-table__muted { font-size: var(--cm-fs-sm); color: var(--cm-text-2); white-space: nowrap; }
.cm-table__actions { display: flex; flex-wrap: wrap; gap: var(--cm-2); align-items: center; justify-content: flex-end; }
.cm-tablewrap { overflow-x: auto; }
.cm-email {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font-size: var(--cm-fs-sm);
  color: var(--cm-text-2);
  cursor: pointer;
}
.cm-email:hover { color: var(--cm-text); text-decoration: underline; }

.cm-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cm-tag { display: inline-flex; align-items: center; gap: 2px; height: 26px; padding: 0 4px 0 10px; border-radius: var(--cm-r-full); background: var(--cm-sunken); font-size: var(--cm-fs-xs); font-weight: 700; }
.cm-tag button { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--cm-text-3); cursor: pointer; }
.cm-tag button:hover { background: var(--cm-press); color: var(--cm-text); }
.cm-tag-input {
  width: 96px;
  height: 28px;
  padding: 0 10px;
  border: 1px dashed var(--cm-border-strong);
  border-radius: var(--cm-r-full);
  background: transparent;
  font-family: var(--cm-font);
  font-size: var(--cm-fs-xs);
  color: var(--cm-text);
}
.cm-tag-input:focus { outline: none; border-style: solid; border-color: var(--cm-gold); }

.cm-photo { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: var(--cm-4); align-items: center; padding: var(--cm-4) 0; border-top: 1px solid var(--cm-border); }
.cm-photo:first-of-type { border-top: 0; padding-top: 0; }
.cm-photo__thumb { width: 112px; aspect-ratio: 4 / 3; border-radius: var(--cm-r-md); overflow: hidden; background: var(--cm-sunken); }
.cm-photo__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-photo__info b { display: flex; align-items: center; gap: var(--cm-2); font-weight: 700; }
.cm-photo__info .cm-input { margin-top: var(--cm-2); font-size: var(--cm-fs-sm); min-height: 40px; }
.cm-photo__btns { display: flex; flex-direction: column; gap: var(--cm-2); }

.cm-savebar {
  position: sticky;
  top: var(--cm-3);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--cm-4);
  flex-wrap: wrap;
  margin: var(--cm-6) 0 var(--cm-4);
  padding: var(--cm-4) var(--cm-5);
  border-radius: var(--cm-r-xl);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid var(--cm-border);
  box-shadow: var(--cm-shadow-2);
}

/* ---------- modals (article editor, Tier 2 invitation) --------------------- */
.am--app { background: rgba(16, 27, 48, .45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.am--app .am__card { max-width: 640px; border-radius: 24px; box-shadow: var(--cm-shadow-3); font-family: var(--cm-font); color: var(--cm-text); }
.am--app .am__body { padding: var(--cm-8); }
.am--app .cm-title { font-size: var(--cm-fs-2xl); margin-bottom: var(--cm-6); }
.am--app .am__close { top: var(--cm-4); right: var(--cm-4); display: grid; place-items: center; width: 36px; height: 36px; background: var(--cm-sunken); box-shadow: none; color: var(--cm-text-2); }
.cm-align { text-align: center; }
.cm-align .cm-empty__ic { margin: 0 auto var(--cm-4); }
.cm-align__lead { max-width: 44ch; margin: 0 auto var(--cm-6); color: var(--cm-text-2); }
.cm-align__list { margin: 0 0 var(--cm-6); padding: var(--cm-5); list-style: none; border-radius: var(--cm-r-lg); background: var(--cm-gold-soft); text-align: left; }
.cm-align__list li { display: flex; gap: var(--cm-3); padding: var(--cm-2) 0; font-size: var(--cm-fs-md); line-height: 1.5; }
.cm-align__list .cm-ic { margin-top: 2px; color: var(--cm-gold-ink); }
.cm-align .cm-check { justify-content: center; margin-bottom: var(--cm-2); }
.cm-align .cm-actions { justify-content: center; }

/* ---------- responsive ----------------------------------------------------- */
@media (max-width: 1180px) {
  .cm-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  :root { --cm-side: 232px; }
  .cm-page { padding: var(--cm-6) var(--cm-6) var(--cm-10); }
  .cm-chat { grid-template-columns: 280px minmax(0, 1fr); }
}

/* Phones and small tablets: sidebar becomes a slide-over, a tab bar appears. */
@media (max-width: 820px) {
  .cm-top { padding: 0 var(--cm-2) 0 var(--cm-4); }
  .cm-top__brand span { font-size: var(--cm-fs-lg); }
  .cm-top__brand img { height: 32px; }
  .cm-top__site span { display: none; }
  .cm-top .cm-top__me { display: inline-grid; }
  .cm-body { grid-template-columns: minmax(0, 1fr); }

  .cm-side {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    width: min(300px, 84vw);
    padding-top: max(var(--cm-5), env(safe-area-inset-top));
    padding-bottom: max(var(--cm-3), env(safe-area-inset-bottom));
    box-shadow: var(--cm-shadow-3);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform .3s var(--cm-ease), visibility 0s linear .3s;
  }
  .cm.is-side-open .cm-side { transform: none; visibility: visible; transition: transform .3s var(--cm-ease); }
  .cm-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 19;
    border: 0;
    background: rgba(16, 27, 48, .4);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s var(--cm-ease);
  }
  .cm.is-side-open .cm-scrim { opacity: 1; pointer-events: auto; }

  .cm-main { padding-bottom: calc(var(--cm-tabbar) + env(safe-area-inset-bottom)); }
  .cm-page { padding: var(--cm-5) var(--cm-4) var(--cm-8); }
  .cm-page--fill { padding-bottom: var(--cm-3); }

  .cm-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--cm-tabbar) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--cm-border);
  }
  .cm-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    color: var(--cm-text-3);
    cursor: pointer;
  }
  .cm-tab.is-on { color: var(--cm-text); }
  .cm-tab.is-on .cm-ic { color: var(--cm-gold-ink); }

  .cm-head { margin-bottom: var(--cm-5); }
  .cm-title { font-size: var(--cm-fs-2xl); }

  .cm-chat { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .cm-chat.is-open .cm-chat__list { display: none; }
  .cm-chat:not(.is-open) .cm-chat__pane { display: none; }
  .cm-chat__list { border-right: 0; }
  .cm-chat__back { display: inline-grid; margin-left: calc(-1 * var(--cm-2)); }
  .cm-chat__scroll { padding: var(--cm-4); }
  .cm-bubble { max-width: 86%; }
  .cm-page--fill .cm-head { display: none; }
}

@media (max-width: 640px) {
  .cm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-kpi { padding: var(--cm-4); }
  .cm-card--pad { padding: var(--cm-5); }
  .cm-row { grid-template-columns: 1fr; }
  .cm-composer { padding: var(--cm-4); }
  .cm-post { padding: var(--cm-4); }
  .cm-rankcard { padding: var(--cm-4); }
  .cm-listrow { padding: var(--cm-2) var(--cm-4); }
  .cm-pipe { grid-template-columns: 1fr; }
  .cm-pipe > .cm-ic { transform: rotate(90deg); justify-self: center; }
  .cm-photo { grid-template-columns: 88px minmax(0, 1fr); }
  .cm-photo__thumb { width: 88px; }
  .cm-photo__btns { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .cm-savebar { top: 0; }
  .am--app .am__body { padding: var(--cm-6) var(--cm-5); }

  /* Member tables become stacked cards instead of scrolling sideways. */
  .cm-table--cards thead { display: none; }
  .cm-table--cards, .cm-table--cards tbody, .cm-table--cards tr, .cm-table--cards td { display: block; width: 100%; }
  .cm-table--cards tr { padding: var(--cm-4); border-top: 1px solid var(--cm-border); }
  .cm-table--cards tbody tr:first-child { border-top: 0; }
  .cm-table--cards td { padding: var(--cm-1) 0; border: 0; }
  .cm-table--cards td[data-label]::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 72px;
    font-size: var(--cm-fs-xs);
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--cm-text-3);
  }
  .cm-table--cards .cm-table__actions { justify-content: flex-start; padding-top: var(--cm-2); }
  .cm-table--cards tbody tr:hover td { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .cm *, .am--app * { transition: none !important; animation: none !important; }
}

/* ---------- New landing page: template choice ---------- */
.cm-tpls { border: 0; margin: 0 0 var(--cm-4); padding: 0; display: grid; gap: var(--cm-2); }
.cm-tpls legend { margin-bottom: var(--cm-2); }
.cm-tpl {
  display: flex; gap: var(--cm-3); align-items: flex-start;
  padding: var(--cm-3) var(--cm-4);
  border: 1px solid var(--cm-border-strong); border-radius: var(--cm-r-md);
  cursor: pointer; transition: border-color .15s var(--cm-ease), background-color .15s var(--cm-ease);
}
.cm-tpl:hover { background: var(--cm-hover); }
.cm-tpl:has(input:checked) { border-color: var(--cm-gold); background: var(--cm-gold-soft); }
.cm-tpl input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--cm-navy); flex: none; }
.cm-tpl b { display: block; font-weight: 700; }
.cm-tpl > span > span { font-size: var(--cm-fs-sm); color: var(--cm-text-2); }
