/* ==========================================================================
   Retrouvaille of Arizona - Leadership Comms
   Warm editorial calm. Ink on paper, gold as the single accent.
   Type: Fraunces (display serif) + Karla (body grotesque)
   ========================================================================== */

:root {
  --ink:        #17222c;
  --ink-soft:   #3d4c58;
  --ink-faint:  #6b7883;

  --paper:      #fdfaf5;
  --paper-warm: #f6f0e6;
  --paper-deep: #efe7da;
  --paper-sand: #e9dfcd;

  --blue-deep:  #16354f;
  --blue:       #235273;
  --blue-mist:  #dceaf1;

  --gold:        #b3862f;
  --gold-deep:   #7a5a1c;
  --gold-bright: #d8a949;
  --gold-pale:   #f0dcae;

  --white: #ffffff;
  --rose:  #a0342c;

  --rule:      rgba(23, 34, 44, 0.12);
  --rule-soft: rgba(23, 34, 44, 0.07);
  --rule-gold: rgba(179, 134, 47, 0.38);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body:    "Karla", "Avenir Next", "Segoe UI", sans-serif;

  --shadow-sm: 0 1px 2px rgba(14, 34, 51, 0.05), 0 2px 8px rgba(14, 34, 51, 0.045);
  --shadow-md: 0 2px 4px rgba(14, 34, 51, 0.05), 0 12px 32px -8px rgba(14, 34, 51, 0.14);
  --shadow-lg: 0 4px 8px rgba(14, 34, 51, 0.06), 0 28px 64px -16px rgba(14, 34, 51, 0.22);

  --radius-sm: 3px;
  --radius:    6px;
  --radius-lg: 14px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --topbar-h: 62px;
  --sidebar-w: 268px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 1rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--gold-deep); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.012em;
}

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

/* --------------------------------------------------------------------------
   Buttons and form controls
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.6rem 1.15rem;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease),
              border-color 0.18s var(--ease), transform 0.12s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn--gold {
  background: var(--gold);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn--gold:hover { background: var(--gold-deep); color: var(--white); }

.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--rule);
}
.btn--ghost:hover {
  background: var(--paper-warm);
  border-color: var(--rule-gold);
  color: var(--ink);
}

.btn--sm { padding: 0.36rem 0.7rem; font-size: 0.8rem; }
.btn--block { width: 100%; }

.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.78rem;
  color: var(--ink-faint);
  cursor: pointer;
}
.linkbtn:hover { color: var(--rose); text-decoration: underline; }

.input,
.textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.65rem 0.8rem;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.textarea {
  resize: vertical;
  line-height: 1.55;
  field-sizing: content;   /* grows with the text where supported */
  min-height: 4.6rem;
  max-height: 21rem;
}
.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(179, 134, 47, 0.15);
}
.input::placeholder,
.textarea::placeholder { color: #9aa5ae; }

.field { display: block; margin-bottom: 1.1rem; }
.field__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}
.field__opt {
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #9aa5ae;
}
.field__hint {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-top: 0.35rem;
}

/* --------------------------------------------------------------------------
   Auth pages
   -------------------------------------------------------------------------- */

body.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(1100px 520px at 50% -18%, var(--paper-warm), transparent 70%),
    var(--paper);
}

.auth__panel { width: 100%; max-width: 430px; }

.auth__card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2.25rem 2rem;
  text-align: left;
}

.auth__mark { display: block; margin-bottom: 1.1rem; }

.auth__eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.auth__title {
  font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.2rem);
  margin-bottom: 1.4rem;
}

.auth__lede {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: -0.6rem 0 1.5rem;
}

/* "Keep me signed in" on the login form */
.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--gold);
  cursor: pointer;
}
.check__hint {
  margin: 0.35rem 0 1.2rem 1.6rem;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.auth__alt {
  margin: 1.4rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.auth__foot {
  margin: 1.4rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0 clamp(0.9rem, 2vw, 1.6rem);
  background: rgba(253, 250, 245, 0.94);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.topbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;   /* buttons default to center, which pinches the bars */
  gap: 4px;
  flex: none;
  width: 38px;
  height: 34px;
  padding: 0 7px;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
}
.topbar__toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__text strong {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand__text em {
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.topbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.topbar__who {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 0.3rem 0.1rem;
  border-bottom: 1px solid transparent;
}
.topbar__who:hover { color: var(--gold-deep); border-bottom-color: var(--rule-gold); }

.body { flex: 1; display: flex; align-items: stretch; min-height: 0; }

/* Sidebar --------------------------------------------------------------- */

.sidebar {
  flex: none;
  width: var(--sidebar-w);
  background: var(--paper-warm);
  border-right: 1px solid var(--rule);
  padding: 1.6rem 0 3rem;
  position: sticky;
  top: var(--topbar-h);
  align-self: flex-start;
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}

.nav { padding: 0 0.85rem; }

.nav__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.5rem;
  padding: 0 0.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.nav__label--spaced { margin-top: 1.9rem; }

.nav__add {
  font-size: 1.1rem;
  line-height: 1;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--gold-deep);
}
.nav__add:hover { background: var(--gold-pale); }

.nav__list { list-style: none; margin: 0; padding: 0; }

.nav__item {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.44rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.925rem;
  color: var(--ink-soft);
  border-left: 2px solid transparent;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.nav__item:hover { background: rgba(255, 255, 255, 0.75); color: var(--ink); }
.nav__item.is-active {
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--gold);
  box-shadow: var(--shadow-sm);
}
.nav__hash {
  display: inline-block;
  width: 1.15rem;
  color: var(--gold);
  font-weight: 600;
  flex: none;
}
.nav__empty {
  margin: 0;
  padding: 0.2rem 0.6rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.badge {
  margin-left: auto;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  display: inline-grid;
  place-items: center;
  background: var(--gold);
  color: var(--white);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* Main ------------------------------------------------------------------ */

.main {
  flex: 1;
  min-width: 0;
  padding: clamp(1.4rem, 3vw, 2.6rem) clamp(1.1rem, 3.5vw, 3rem) 5rem;
  max-width: 880px;
}

.page-head { margin-bottom: 1.6rem; }
.page-head__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.page-head__title { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem); }
.page-head__hash { color: var(--gold); font-weight: 400; }
.page-head__desc {
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 60ch;
}

.crumb { margin: 0 0 1.2rem; font-size: 0.86rem; }
.crumb a { color: var(--ink-faint); }
.crumb a:hover { color: var(--gold-deep); }

.flashes { margin-bottom: 1.3rem; }
.flash {
  margin: 0 0 0.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  border-left: 3px solid;
  font-size: 0.9rem;
}
.flash--error  { background: #fbeeec; border-color: var(--rose); color: #6f231d; }
.flash--notice { background: var(--blue-mist); border-color: var(--blue); color: var(--blue-deep); }
.flash--message { background: var(--paper-deep); border-color: var(--gold); color: var(--ink); }

/* Notification invitation. Quiet by design: it sits above the page, waits, and
   goes away for a month if it is waved off. */
.push-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1rem;
  margin-bottom: 1.4rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--rule-gold);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--paper-warm), var(--paper-deep));
  animation: push-banner-in 0.45s var(--ease) both;
}
.push-banner[hidden] { display: none; }

.push-banner__text {
  flex: 1 1 16rem;
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.push-banner__actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

@keyframes push-banner-in {
  from { opacity: 0; transform: translateY(-0.4rem); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .push-banner { animation: none; }
}

/* --------------------------------------------------------------------------
   Install card

   Floats bottom right, built by install.js only when the browser or the
   platform can actually do something with it.
   -------------------------------------------------------------------------- */

.install-card {
  position: fixed;
  z-index: 60;
  left: 1rem;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.6rem 0.9rem;
  padding: 0.95rem 1.05rem;
  background: var(--white);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}
.install-card.is-open { opacity: 1; transform: none; }

.install-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 9px;
}

.install-card__title {
  margin: 0 0 0.15rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.install-card__body {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.install-card__actions { grid-column: 2; }
.install-card__actions:empty { display: none; }

.install-card__close {
  position: absolute;
  top: 0.3rem;
  right: 0.45rem;
  border: 0;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  color: var(--ink-faint);
  cursor: pointer;
}
.install-card__close:hover { color: var(--ink); }

@media (min-width: 640px) {
  .install-card {
    left: auto;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 23rem;
  }
}

/* iOS has no install API, so the sheet dims the page and points an arrow at
   the Safari Share control: bottom centre on iPhone, top right on iPad. */
.install-veil {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 0.85rem;
  padding: 1.25rem 1rem calc(0.4rem + env(safe-area-inset-bottom));
  background: rgba(14, 34, 51, 0.62);
  opacity: 0;
  transition: opacity 0.24s var(--ease);
}
.install-veil.is-open { opacity: 1; }

.install-veil--top {
  flex-direction: column-reverse;
  padding: calc(0.4rem + env(safe-area-inset-top)) 1rem 1.25rem;
}

.install-sheet {
  position: relative;
  width: min(25rem, 100%);
  padding: 1.4rem 1.35rem 1.3rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  border-top: 3px solid var(--gold);
  box-shadow: var(--shadow-lg);
  transform: translateY(16px);
  transition: transform 0.28s var(--ease);
}
.install-veil.is-open .install-sheet { transform: none; }

.install-sheet__title {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}
.install-sheet__body {
  margin: 0 0 1.05rem;
  font-size: 0.87rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.install-sheet__close {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  border: 0;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.15rem 0.4rem;
  color: var(--ink-faint);
  cursor: pointer;
}

.install-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
}
.install-steps li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.92rem;
  color: var(--ink);
}
.install-steps__n {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #1a1204;
  font-size: 0.76rem;
  font-weight: 700;
}
.install-glyph {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.25em;
  color: var(--blue-deep);
}

.install-arrow {
  width: 26px;
  color: var(--gold);
}
.install-veil--top .install-arrow {
  transform: rotate(180deg);
  align-self: flex-end;
  margin-right: 1.6rem;
}
.install-arrow svg {
  display: block;
  width: 100%;
  height: auto;
  animation: install-nudge 1.5s ease-in-out infinite;
}
@keyframes install-nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(7px); }
}

/* --------------------------------------------------------------------------
   Composer
   -------------------------------------------------------------------------- */

.composer {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 0.85rem;
  margin-bottom: 2rem;
}
.composer .textarea {
  border: 0;
  padding: 0.3rem 0.35rem;
  background: transparent;
  min-height: 4.2rem;
}
.composer--sticky .textarea { min-height: 3rem; }
.composer .textarea:focus { box-shadow: none; }
.composer__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule-soft);
}
.composer__hint { font-size: 0.78rem; color: var(--ink-faint); }
.composer--sticky { margin: 1.8rem 0 0; }

/* --------------------------------------------------------------------------
   Avatars, meta, posts
   -------------------------------------------------------------------------- */

.avatar {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-deep);
  border: 1px solid var(--rule-gold);
  color: var(--gold-deep);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.avatar--lg { width: 46px; height: 46px; font-size: 0.95rem; }
.avatar--sm { width: 30px; height: 30px; font-size: 0.7rem; }

.meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 0.35rem;
}
.meta__name { font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.meta__time { font-size: 0.76rem; color: var(--ink-faint); }
.meta__delete { margin-left: auto; }

.post__content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 0.975rem;
  line-height: 1.65;
}

.post { display: flex; gap: 0.9rem; }
.post--root {
  background: var(--white);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.post--root .post__content { color: var(--ink); font-size: 1.05rem; }
.post__body { min-width: 0; flex: 1; }

.section-rule {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 2rem 0 1.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.section-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.replies { list-style: none; margin: 0; padding: 0; }
.post--reply {
  padding: 1rem 0.25rem 1rem 0.35rem;
  border-bottom: 1px solid var(--rule-soft);
}
.post--reply:last-child { border-bottom: 0; }

/* Thread list ----------------------------------------------------------- */

.threads { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }

.thread-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease),
              transform 0.2s var(--ease);
}
.thread-card:hover {
  border-color: var(--rule-gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.thread-card__link {
  display: flex;
  gap: 0.9rem;
  padding: 1.1rem 1.25rem;
  color: inherit;
}
.thread-card__link:hover { color: inherit; }
.thread-card__body { min-width: 0; flex: 1; }

.thread-card__excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.thread-card__foot {
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
  color: var(--gold-deep);
  font-weight: 600;
}
.dot { color: var(--ink-faint); margin: 0 0.3rem; font-weight: 400; }

/* Chat ------------------------------------------------------------------ */

.chat { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.chat__row { display: flex; gap: 0.8rem; align-items: flex-start; }

.bubble {
  min-width: 0;
  max-width: 42rem;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  border-top-left-radius: var(--radius-sm);
  padding: 0.75rem 1rem 0.85rem;
  box-shadow: var(--shadow-sm);
}

.chat__row.is-mine { flex-direction: row-reverse; }
.chat__row.is-mine .bubble {
  background: var(--paper-warm);
  border-color: var(--rule-gold);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-sm);
}
.chat__row.is-mine .meta { flex-direction: row-reverse; }
.chat__row.is-mine .post__content { text-align: right; }
.chat__row.is-mine .avatar { background: var(--gold-pale); }

/* Panels, people, tags -------------------------------------------------- */

.panel {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow-sm);
}
.panel__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule-soft);
}
.panel__title .badge { margin-left: 0; }
.panel__empty { margin: 0; color: var(--ink-faint); font-size: 0.92rem; }

.people { list-style: none; margin: 0; padding: 0; }
.person {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule-soft);
  flex-wrap: wrap;
}
.person:last-child { border-bottom: 0; }
.person__id { display: flex; flex-direction: column; min-width: 0; }
.person__id strong { font-size: 0.95rem; }
.person__id em { font-style: normal; font-size: 0.78rem; color: var(--ink-faint); }
.person__actions { margin-left: auto; display: flex; gap: 0.45rem; flex-wrap: wrap; }

.tags { display: flex; gap: 0.35rem; }
.tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink-faint);
  background: var(--paper-warm);
}
.tag--admin    { background: var(--gold-pale); border-color: var(--rule-gold); color: var(--gold-deep); }
.tag--approved { background: var(--blue-mist); border-color: rgba(35, 82, 115, 0.3); color: var(--blue-deep); }
.tag--rejected { background: #fbeeec; border-color: rgba(160, 52, 44, 0.3); color: #6f231d; }

/* Contact form messages on the inquiries page ---------------------------- */

.inquiries { list-style: none; margin: 0; padding: 0; }
.inquiry {
  padding: 1rem 0 1.1rem;
  border-bottom: 1px solid var(--rule-soft);
}
.inquiry:last-child { border-bottom: 0; padding-bottom: 0; }
.inquiry.is-done { opacity: 0.66; }
.inquiry.is-done:hover { opacity: 1; }
.inquiry__head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.inquiry__who { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; }
.inquiry__who strong { font-size: 0.98rem; }
.inquiry__who em { font-style: normal; font-size: 0.78rem; color: var(--ink-faint); }
.inquiry__head .tags { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.inquiry__message {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.9rem;
  background: var(--paper-warm);
  border-left: 3px solid var(--rule-gold);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.94rem;
  line-height: 1.6;
}
.inquiry__actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }

/* Access toggles on the members page */
.perm-form {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.28rem 0.3rem 0.28rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-warm);
}
.perms { display: flex; gap: 0.6rem; }
.perm {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s ease;
}
.perm input {
  width: 0.95rem;
  height: 0.95rem;
  accent-color: var(--gold);
  cursor: pointer;
}
.perm:has(input:checked) { color: var(--blue-deep); }
.perm-note { align-self: center; font-size: 0.78rem; color: var(--ink-faint); }

/* Picker ---------------------------------------------------------------- */

.form--card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.picker { border: 0; margin: 0 0 1.3rem; padding: 0; }
.picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.5rem;
}
.pick { display: block; cursor: pointer; }
/* Hidden from sight but still focusable and readable by assistive tech. */
.pick input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.pick__face {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.pick:hover .pick__face { border-color: var(--rule-gold); background: var(--paper-warm); }
.pick input:checked + .pick__face {
  border-color: var(--gold);
  background: var(--gold-pale);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.pick input:focus-visible + .pick__face { outline: 2px solid var(--gold); outline-offset: 2px; }
.pick__name { display: flex; flex-direction: column; min-width: 0; font-size: 0.9rem; font-weight: 600; }
.pick__name em { font-style: normal; font-size: 0.75rem; font-weight: 400; color: var(--ink-faint); }

/* Empty state ----------------------------------------------------------- */

.empty {
  border: 1px dashed var(--rule-gold);
  border-radius: var(--radius-lg);
  background: var(--paper-warm);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--ink-soft);
}
.empty__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.3rem;
}
.empty p:last-child { margin: 0; font-size: 0.92rem; }

/* Scrim ----------------------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(14, 34, 51, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease);
  z-index: 45;
}
body.nav-open .scrim { opacity: 1; pointer-events: auto; }

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
  .topbar__toggle { display: flex; }

  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: min(84vw, 300px);
    max-height: none;
    z-index: 50;
    transform: translateX(-102%);
    transition: transform 0.26s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: translateX(0); }

  .main { max-width: none; padding-bottom: 4rem; }

  .topbar { gap: 0.55rem; }
  .topbar__right { gap: 0.5rem; }
  .topbar__who {
    max-width: 6.5rem;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .composer__actions { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .composer__actions .btn { width: 100%; }
  .composer__hint { text-align: center; }

  .person__actions { margin-left: 0; width: 100%; }
}

@media (max-width: 560px) {
  /* The mark carries the brand once the bar gets tight. */
  .brand__text { display: none; }
  .topbar__who { max-width: 9rem; }
}

@media (max-width: 420px) {
  .chat__row.is-mine .post__content { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
