/* ════════════════════════════════════════════════════════════════════════
   Tranquil · Meridian for people — thin skin over the shared system
   ────────────────────────────────────────────────────────────────────────
   The REAL Meridian files (assets/meridian → /meridian/meridian.css) are
   loaded first: bundled Outfit fonts, tokens, light/dark themes and the
   mer-* component grammar — the exact bytes the Studio embeds. This file
   only overrides what makes Tranquil, Tranquil:

     1. Brand palette — Navy #26316B action, Lime #C2DB6F celebration,
        Night #101420 chrome (mapped into the same semantic slots).
     2. SOFT GEOMETRY — radius tokens go rounded (operator consoles are
        square; people-products round). One rule un-squares .mer-btn.
     3. Public-layout extensions — the LinkedIn grammar (52px global nav,
        1128px container, 225/555/300 rails, feed, posts) that no operator
        console needs. All rules compose var(--mer-*) tokens only.
   ═══════════════════════════════════════════════════════════════════════ */

:root[data-theme="light"] {
  /* ── Tranquil brand ramp (slotted into Meridian's brand vars) ── */
  --mer-c-brand-950: #101420;   /* Night — deepest ink / chrome base       */
  --mer-c-brand-900: #1C2450;   /* navy-deep                                */
  --mer-c-brand-800: #26316B;   /* Tranquil Navy — brand primary            */
  --mer-c-brand-700: #33418C;   /* hover lift                               */
  --mer-c-brand-300: #8E97C4;   /* muted on chrome                          */
  --mer-c-brand-100: #E2E5F4;   /* selected container                       */
  --mer-c-brand-50:  #EEF0F8;   /* brand tint                               */
  --mer-c-lime-brand: #C2DB6F;  /* the Tranquil mark — celebrate            */
  --mer-c-lime-300:   #D3E693;
  --mer-c-lime-100:   #EDF4D4;
  --mer-c-lime-ink:   #37410F;
  --mer-c-lime-deep:  #55631F;

  /* Action — Tranquil navy replaces console azure */
  --mer-primary:        var(--mer-c-brand-800);
  --mer-primary-hover:  var(--mer-c-brand-900);
  --mer-primary-active: var(--mer-c-brand-950);
  --mer-on-primary:     #FFFFFF;
  --mer-primary-tint:   rgba(38, 49, 107, 0.07);
  --mer-selected:       var(--mer-c-brand-100);
  --mer-on-selected:    var(--mer-c-brand-900);

  /* Chrome — night navy (covers, hero bands) replaces indigo */
  --mer-chrome:          var(--mer-c-brand-950);
  --mer-chrome-2:        var(--mer-c-brand-800);
  --mer-chrome-hover:    var(--mer-c-brand-700);
  --mer-on-chrome:       #FFFFFF;
  --mer-on-chrome-muted: var(--mer-c-brand-300);
  --mer-brand-ink:       var(--mer-c-brand-800);

  /* Execute/celebrate — lime replaces amber for the brand moments */
  --mer-execute:              var(--mer-c-lime-brand);
  --mer-execute-hover:        var(--mer-c-lime-300);
  --mer-on-execute:           var(--mer-c-lime-ink);
  --mer-execute-container:    var(--mer-c-lime-100);
  --mer-on-execute-container: var(--mer-c-lime-deep);

}

:root {
  /* ── Radius — the Tranquil deviation: soft, human geometry.
        Meridian components read these tokens, so overriding them rounds
        every input, card, menu and modal in one move. ── */
  --mer-radius-xs:   8px;
  --mer-radius-sm:   10px;   /* controls: buttons, inputs, chips           */
  --mer-radius-md:   12px;   /* grouped controls, menus, popovers          */
  --mer-radius-lg:   14px;   /* cards, panels                              */
  --mer-radius-xl:   18px;   /* modals, sheets, hero containers            */
  --mer-radius-pill: 999px;

  /* Aliases over the real Meridian tokens (loaded before this file) */
  --mer-motion-fast: var(--mer-dur-fast, 120ms) var(--mer-ease-out, ease);

  /* ── Tranquil legacy aliases (existing component rules) ── */
  --navy: var(--mer-primary);
  --navy-deep: var(--mer-primary-hover);
  --lime: var(--mer-c-lime-brand);
  --lime-ink: var(--mer-c-lime-deep);
  --night: var(--mer-c-brand-950);
  --ink: var(--mer-text);
  --ink-2: var(--mer-text-muted);
  --ink-3: var(--mer-text-faint);
  --canvas: var(--mer-bg);
  --card: var(--mer-surface);
  --line: var(--mer-border);
  --line-strong: var(--mer-border-strong);
  --hover: var(--mer-primary-tint);
  --danger: var(--mer-danger);
  --ok: var(--mer-success);
  --radius: var(--mer-radius-lg);
  --shadow: var(--mer-shadow-1);
  --font: var(--mer-font-ui, "Outfit", -apple-system, "Segoe UI", Roboto, sans-serif);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--mer-text);
  background: var(--mer-bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--mer-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 16px; color: var(--mer-text); }
:focus-visible { outline: 2px solid var(--mer-primary); outline-offset: 2px; }

/* Meridian components go soft here — .mer-btn is the one component that
   hardcodes square corners; every other mer-* rule reads the radius tokens. */
.mer-btn { border-radius: var(--mer-radius-sm); }

/* ─── Global nav (52px, sticky, white) ────────────────────────────────── */

.gnav {
  position: sticky; top: 0; z-index: 60;
  background: var(--mer-surface);
  border-bottom: 1px solid var(--mer-border);
}
.gnav-inner {
  max-width: 1128px; margin: 0 auto; padding: 0 16px;
  height: 52px; display: flex; align-items: center; gap: 8px;
}
.brand { display: flex; align-items: center; gap: 8px; margin-right: 4px; text-decoration: none; }


/* ── The Tranquil brand ────────────────────────────────────────────────
   The REAL wordmark artwork (transparent PNG at /assets/brand/) — height
   set inline by TQ_LOGO(px); the round mark for square spots. */
.tq-logo { display: inline-block; width: auto; user-select: none; }
.tq-mark { display: inline-block; border-radius: 50%; user-select: none; }

.gsearch { position: relative; flex: 0 1 280px; }
.gsearch input {
  width: 100%; height: 34px; border: 1px solid transparent; border-radius: var(--mer-radius-sm);
  background: var(--mer-surface-2); padding: 0 12px 0 34px; outline: none;
  transition: background var(--mer-motion-fast), box-shadow var(--mer-motion-fast);
}
.gsearch input:focus { background: var(--mer-surface); box-shadow: 0 0 0 1.5px var(--mer-primary) inset; }
.gsearch .icon { position: absolute; left: 10px; top: 8px; width: 18px; height: 18px; color: var(--mer-text-faint); }

.gnav-items { display: flex; align-items: center; margin-left: auto; }
.gnav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-width: 76px; height: 52px; cursor: pointer; position: relative;
  color: var(--mer-text-muted); background: none; border: none; padding: 0 6px;
}
.gnav-item .icon { width: 22px; height: 22px; }
.gnav-item .lbl { font-size: 11px; line-height: 1; }
.gnav-item:hover { color: var(--mer-text); }
.gnav-item.active { color: var(--mer-c-brand-950); }
.gnav-item.active::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 0;
  height: 2.5px; background: var(--mer-primary); border-radius: var(--mer-radius-pill);
}
.gnav-item .avatar { width: 24px; height: 24px; font-size: 11px; }
.gnav-sep { width: 1px; height: 30px; background: var(--mer-border); margin: 0 8px; }

/* ─── Page scaffold: 3 columns ────────────────────────────────────────── */

.page { max-width: 1224px; margin: 0 auto; padding: 24px 20px 48px; }
.page.wide { max-width: 1300px; }
.cols { display: grid; grid-template-columns: 222px minmax(0, 1fr) 296px; gap: 28px; align-items: start; }
.cols.two { grid-template-columns: 225px minmax(0, 1fr); align-items: start; }
.cols.tworight { grid-template-columns: minmax(0, 1fr) 312px; align-items: start; }
.cols.one { grid-template-columns: minmax(0, 1fr); }
/* The feed is the only thing that scrolls — rails hold still (sticky under
   the 52px global nav) while the posts column runs as long as it likes. */
.rail-left, .rail-right { position: sticky; top: 68px; max-height: calc(100vh - 84px); overflow-y: auto;
  overscroll-behavior: contain; scrollbar-width: none; }
.rail-left::-webkit-scrollbar, .rail-right::-webkit-scrollbar { display: none; }
@media (max-width: 1024px) { .cols, .cols.two { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; } .rail-left { display: none; } }
@media (max-width: 768px) { .cols, .cols.two { grid-template-columns: minmax(0, 1fr); } .rail-right { display: none; } }

/* Full sections (discover · communities · corner · library …): one broad
   surface, no rails — with a quiet way back to the feed. */
.page-back { margin-bottom: 14px; }
.page-back-btn { display: inline-flex; align-items: center; gap: 7px; border: none; background: none;
  cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--mer-text-muted);
  padding: 7px 12px 7px 8px; border-radius: var(--mer-radius-pill); }
.page-back-btn:hover { background: var(--mer-primary-tint); color: var(--mer-text); }
.page-back-btn svg { width: 17px; height: 17px; }

/* ─── Cards ───────────────────────────────────────────────────────────── */

.card {
  background: var(--mer-surface); border-radius: var(--mer-radius-lg);
  box-shadow: var(--mer-shadow-1); margin-bottom: 16px; overflow: hidden;
}
.card-pad { padding: 16px; }
.card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.card .sub { color: var(--mer-text-muted); font-size: 12px; }
.hairline { border: none; border-top: 1px solid var(--mer-border); margin: 0; }

/* Profile card (left rail) */
.pcard-cover { height: 58px; background: linear-gradient(100deg, var(--mer-chrome-2) 0%, var(--mer-c-brand-900) 60%, var(--mer-c-brand-700) 100%); position: relative; }
.pcard-cover::after {
  content: ""; position: absolute; right: -18px; top: -30px; width: 110px; height: 110px;
  border-radius: 50%; background: var(--lime); opacity: 0.28;
}
.pcard-avatar { margin: -34px auto 0; position: relative; z-index: 1; }
.pcard-body { padding: 8px 16px 12px; text-align: center; }
.pcard-name { font-weight: 600; font-size: 16px; }
.pcard-name:hover { text-decoration: underline; cursor: pointer; }
.pcard-headline { color: var(--mer-text-muted); font-size: 12px; margin-top: 2px; }
.pcard-stats { padding: 8px 12px; }
.pstat { display: flex; justify-content: space-between; padding: 4px 6px; font-size: 12px; border-radius: var(--mer-radius-sm); }
.pstat:hover { background: var(--mer-primary-tint); }
.pstat .k { color: var(--mer-text-muted); }
.pstat .v { color: var(--mer-primary); font-weight: 600; }

/* Avatars — deterministic hue from the name */
.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 600;
  font-size: 18px; background: var(--mer-primary); border: 2px solid var(--mer-surface);
  user-select: none;
}
.avatar.sm { width: 32px; height: 32px; font-size: 13px; border-width: 1px; }
.avatar.lg { width: 68px; height: 68px; font-size: 26px; border-width: 3px; }
.avatar.square { border-radius: var(--mer-radius-sm); }

/* ─── Buttons — Meridian grammar, soft geometry ───────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 16px; border-radius: var(--mer-radius-sm);
  border: 1px solid transparent; font-weight: 600; font-size: 14px;
  cursor: pointer; background: none; white-space: nowrap;
  transition: background var(--mer-motion-fast), border-color var(--mer-motion-fast), color var(--mer-motion-fast);
}
.btn-primary { background: var(--mer-primary); color: var(--mer-on-primary); border-color: var(--mer-primary); }
.btn-primary:hover { background: var(--mer-primary-hover); border-color: var(--mer-primary-hover); }
.btn-primary:active { background: var(--mer-primary-active); }
.btn-accent { background: var(--mer-execute); color: var(--mer-on-execute); border-color: var(--mer-execute); }
.btn-accent:hover { background: var(--mer-execute-hover); border-color: var(--mer-execute-hover); }
.btn-outline { border-color: var(--mer-primary); color: var(--mer-primary); }
.btn-outline:hover { background: var(--mer-primary-tint); box-shadow: 0 0 0 1px var(--mer-primary) inset; }
.btn-ghost { color: var(--mer-text-muted); }
.btn-ghost:hover { background: var(--mer-primary-tint); color: var(--mer-text); }
.btn-danger { background: var(--mer-danger); color: #fff; border-color: var(--mer-danger); }
.btn-sm { height: 27px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: 0.45; cursor: default; pointer-events: none; }
.btn-block { width: 100%; }
.btn-pill { border-radius: var(--mer-radius-pill); }

/* ─── Composer ────────────────────────────────────────────────────────── */

.composer { display: flex; gap: 10px; padding: 12px 16px 8px; }
.composer .start {
  flex: 1; text-align: left; border: 1px solid var(--mer-border-strong); border-radius: var(--mer-radius-pill);
  height: 44px; padding: 0 16px; background: none; color: var(--mer-text-muted);
  font-weight: 600; cursor: pointer; font-size: 14px;
  transition: background var(--mer-motion-fast);
}
.composer .start:hover { background: var(--mer-primary-tint); }
.composer-form { padding: 4px 16px 12px; display: none; }
.composer-form.open { display: block; }
.composer-form textarea {
  width: 100%; min-height: 88px; border: 1px solid var(--mer-border-strong); border-radius: var(--mer-radius-md);
  padding: 10px 12px; resize: vertical; outline: none;
  transition: border-color var(--mer-motion-fast), box-shadow var(--mer-motion-fast);
}
.composer-form textarea:focus { border-color: var(--mer-primary); box-shadow: 0 0 0 1px var(--mer-primary); }
.composer-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.composer-note { color: var(--mer-text-faint); font-size: 11px; margin-right: auto; }

/* ─── Post cards ──────────────────────────────────────────────────────── */

.post-head { display: flex; gap: 10px; padding: 11px 15px 0; }
.post-head .avatar { width: 44px; height: 44px; font-size: 16px; }
.post-who { min-width: 0; }
.post-name { font-weight: 600; font-size: 14px; }
.post-name:hover { color: var(--mer-primary); text-decoration: underline; cursor: pointer; }
.post-meta { color: var(--mer-text-muted); font-size: 12px; }
.post-meta .dot::before { content: " · "; }
.post-community { color: var(--mer-primary); font-weight: 600; cursor: pointer; }
.post-community:hover { text-decoration: underline; }
.post-body { padding: 6px 15px 4px; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.post-title-line { cursor: pointer; }
.post-title-line:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Long posts clamp in the feed and open fully on the detail page. */
.post-body.clamp { max-height: 216px; overflow: hidden; position: relative; }
.post-body.clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  background: linear-gradient(180deg, transparent, var(--mer-surface)); }
.read-more { display: block; border: none; background: none; cursor: pointer; font: inherit;
  font-weight: 700; font-size: 13px; color: var(--mer-primary); padding: 2px 15px 6px; text-align: left; }
.read-more:hover { text-decoration: underline; }
/* The detail page: a reading column — the full body, room to breathe. */
.post-detail-col { max-width: 780px; margin: 0 auto; }
.post-detail .post-body { font-size: 16px; line-height: 1.65; }
.post-detail .post-body.clamp { max-height: none; }
.post-detail .comments { display: block; }
.post-counts { display: flex; align-items: center; gap: 8px; color: var(--mer-text-muted); font-size: 12px; padding: 6px 15px; }
.post-counts .spacer { margin-left: auto; }
.post-counts [data-rsum] { display: inline-flex; align-items: center; }
.post-counts [data-csum]:empty { display: none; }

/* Colored reaction summary bubbles (overlapping, LinkedIn-grammar). */
.rsum-chips { display: inline-flex; align-items: center; }
.rchip { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; border: 1.5px solid var(--mer-surface); margin-left: -6px; }
.rchip:first-child { margin-left: 0; }
.rchip svg { width: 12px; height: 12px; }
.rchip--uplift { background: var(--mer-primary); }
.rchip--celebrate { background: #d99a1f; }
.rchip--support { background: #e0457a; }
.rchip--insight { background: #7c5cd6; }
.rsum-n { margin-left: 6px; font-weight: 600; }

.post-actions { display: flex; gap: 2px; padding: 3px 8px; }
.pact {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; border: none; background: none; color: var(--mer-text-muted);
  font-weight: 600; font-size: 13px; cursor: pointer; border-radius: var(--mer-radius-sm); position: relative;
  min-width: 0; white-space: nowrap;
  transition: background var(--mer-motion-fast), color var(--mer-motion-fast);
}
.pact:hover { background: var(--mer-primary-tint); }
.pact.reacted { color: var(--mer-primary); }
.pact-ic { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pact-ic svg { width: 19px; height: 19px; }
.pact-lb { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.react-btn.r-uplift { color: var(--mer-primary); }
.react-btn.r-celebrate { color: #c98a10; }
.react-btn.r-support { color: #d63a70; }
.react-btn.r-insight { color: #6f4fd0; }

/* Reaction picker — a clean popover of labelled, colored icons. */
.rpick {
  position: absolute; bottom: 46px; left: 0; background: var(--mer-surface);
  border: 1px solid var(--mer-border); border-radius: var(--mer-radius-pill); box-shadow: var(--mer-shadow-2);
  padding: 6px 8px; display: none; gap: 2px; z-index: 10;
}
.pact:hover .rpick, .rpick:hover, .react-btn.show .rpick { display: flex; animation: rpick-in .14s ease; }
@keyframes rpick-in { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
.rpick-btn { display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: none; background: none; cursor: pointer; padding: 5px 7px; border-radius: var(--mer-radius-sm); }
.rpick-btn:hover { background: var(--mer-surface-2); }
.rpick-ic { display: inline-flex; transition: transform 0.1s ease; }
.rpick-ic svg { width: 24px; height: 24px; }
.rpick-btn:hover .rpick-ic { transform: scale(1.18) translateY(-2px); }
.rpick-lb { font-size: 10.5px; font-weight: 600; color: var(--mer-text-muted); }
.rpick-btn:hover .rpick-lb { color: var(--mer-text); }
.rpick-btn.r-uplift .rpick-ic { color: var(--mer-primary); }
.rpick-btn.r-celebrate .rpick-ic { color: #d99a1f; }
.rpick-btn.r-support .rpick-ic { color: #e0457a; }
.rpick-btn.r-insight .rpick-ic { color: #7c5cd6; }

/* Impressions (X-style view counter). */
.post-views { display: inline-flex; align-items: center; gap: 4px; color: var(--mer-text-faint); font-variant-numeric: tabular-nums; }
.post-views svg { width: 15px; height: 15px; }

/* Post header actions: Follow + a ··· overflow menu (copy link / report). */
.post-head-acts { margin-left: auto; display: flex; align-items: center; gap: 6px; position: relative; flex: none; }
.post-x { border: none; background: none; cursor: pointer; color: var(--mer-text-muted); width: 30px; height: 30px;
  border-radius: 50%; display: inline-grid; place-items: center; }
.post-x:hover { background: var(--mer-primary-tint); color: var(--mer-text); }
.post-x svg { width: 20px; height: 20px; }
.post-menu { position: absolute; top: 34px; right: 0; z-index: 20; min-width: 172px; background: var(--mer-surface);
  border: 1px solid var(--mer-border); border-radius: var(--mer-radius-md); box-shadow: var(--mer-shadow-2); padding: 5px; }
.post-menu[hidden] { display: none; }
.post-menu-i { display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: none; cursor: pointer;
  font: inherit; font-size: 13.5px; color: var(--mer-text); padding: 8px 10px; border-radius: var(--mer-radius-sm); text-align: left; }
.post-menu-i:hover { background: var(--mer-primary-tint); }
.post-menu-i svg { width: 16px; height: 16px; flex: none; color: var(--mer-text-muted); }
.post-menu-i.danger, .post-menu-i.danger svg { color: var(--mer-danger); }

/* Right rail: trending posts + events. */
.trend-item, .event-item { align-items: flex-start; }
.trend-rank { flex: 0 0 22px; height: 22px; margin-top: 1px; border-radius: 50%;
  background: var(--mer-primary-tint); color: var(--mer-primary);
  font-size: 11.5px; font-weight: 800; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.trend-item:hover .trend-rank { background: var(--mer-primary); color: #fff; }
.trend-item .t { line-height: 1.35; }
.event-ic { flex: 0 0 34px; height: 34px; border-radius: var(--mer-radius-sm); background: var(--mer-primary-tint);
  color: var(--mer-primary); display: grid; place-items: center; }
.event-ic svg { width: 18px; height: 18px; }
.event-ic.live { background: var(--mer-execute-container); color: var(--mer-on-execute-container); }

/* Announcements banner — a branded promo card in the right rail: square
   geometry, generous height, band on top. */
.announce { overflow: hidden; border-radius: 0; }
.announce-band { display: flex; align-items: center; gap: 8px; padding: 12px 16px; color: #fff;
  background: linear-gradient(135deg, var(--mer-primary), #3c4ea0);
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.announce-band svg { width: 16px; height: 16px; }
.announce-ic { display: inline-flex; }
.announce-body { padding: 18px 16px 20px; }
.announce-title { font-weight: 700; font-size: 16.5px; line-height: 1.4; margin-bottom: 7px; }
.announce-text { color: var(--mer-text-muted); font-size: 13.5px; line-height: 1.6; margin-bottom: 16px; }

/* Comments — threaded: avatars on every row, replies nested one level. */
.comments { padding: 4px 16px 12px; }
.comment { display: flex; gap: 8px; margin-top: 10px; }
.comment-bubble { background: var(--mer-surface-2); border-radius: 4px 14px 14px 14px; padding: 7px 12px; min-width: 0; display: inline-block; max-width: 100%; }
.comment-bubble .who { font-weight: 600; font-size: 12px; }
.comment-bubble .txt { font-size: 13px; word-wrap: break-word; }
.comment-acts { display: flex; align-items: center; gap: 12px; padding: 3px 4px 0; color: var(--mer-text-faint); font-size: 11.5px; }
.comment-reply { border: none; background: none; cursor: pointer; font: inherit; font-size: 11.5px;
  font-weight: 700; color: var(--mer-text-muted); padding: 0; }
.comment-reply:hover { color: var(--mer-primary); text-decoration: underline; }
.comment-kids { border-left: 2px solid var(--mer-border); margin: 2px 0 0 14px; padding-left: 10px; }
.comment-kids:empty { display: none; }
.comment-kids .comment .avatar { width: 26px; height: 26px; font-size: 11px; }
.reply-tag { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mer-text-muted);
  padding: 0 2px 6px; }
.reply-tag button { border: none; background: none; cursor: pointer; color: var(--mer-text-faint); display: inline-grid; place-items: center; }
.reply-tag button svg { width: 13px; height: 13px; }
.reply-tag button:hover { color: var(--mer-danger); }
.comment-form { display: block; margin-top: 10px; }
.comment-form-row { display: flex; gap: 8px; }
.comment-form input {
  flex: 1; height: 34px; border: 1px solid var(--mer-border-strong); border-radius: var(--mer-radius-pill);
  padding: 0 14px; outline: none;
  transition: border-color var(--mer-motion-fast), box-shadow var(--mer-motion-fast);
}
.comment-form input:focus { border-color: var(--mer-primary); box-shadow: 0 0 0 1px var(--mer-primary); }

/* ─── Rail lists ──────────────────────────────────────────────────────── */

.rail-item { display: flex; align-items: center; gap: 10px; padding: 8px 16px; }
button.rail-item { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; }
.rail-item:hover { background: var(--mer-primary-tint); cursor: pointer; }
.rail-item .t { font-weight: 600; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-item .s { color: var(--mer-text-muted); font-size: 11.5px; }
.rail-more { display: block; text-align: center; padding: 10px; color: var(--mer-text-muted); font-weight: 600; font-size: 13px; border-top: 1px solid var(--mer-border); cursor: pointer; }
.rail-more:hover { background: var(--mer-primary-tint); text-decoration: none; }
.foot { color: var(--mer-text-faint); font-size: 11px; text-align: left; padding: 16px 6px 8px; line-height: 1.8; }
.foot a { color: var(--mer-text-faint); margin: 0 10px 0 0; }
.foot a:hover { color: var(--mer-text-muted); text-decoration: underline; }

/* ─── Directory grid (communities) ────────────────────────────────────── */

.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.dir-card { text-align: center; padding: 0 0 16px; }
.dir-cover { height: 54px; background: linear-gradient(100deg, var(--mer-chrome-2), var(--mer-c-brand-700)); }
.dir-card .avatar { margin: -26px auto 6px; }
.dir-name { font-weight: 600; font-size: 15px; padding: 0 12px; }
.dir-type { color: var(--mer-text-muted); font-size: 12px; margin: 2px 0 4px; }
.dir-purpose { color: var(--mer-text-muted); font-size: 12px; padding: 0 16px; min-height: 32px;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dir-card .btn { margin-top: 10px; }

/* Badges — Meridian chip grammar, pill silhouette */
.badge {
  display: inline-block; font-size: 11px; font-weight: 600; border-radius: var(--mer-radius-pill);
  padding: 2px 10px; background: var(--mer-surface-3); color: var(--mer-text-muted);
}
.badge.lime { background: var(--mer-execute-container); color: var(--mer-on-execute-container); }
.badge.navy { background: var(--mer-selected); color: var(--mer-on-selected); }
.badge.warn { background: var(--mer-warning-bg); color: var(--mer-warning-text); }
.badge.ok   { background: var(--mer-success-bg); color: var(--mer-c-success-strong); }
.badge.err  { background: var(--mer-danger-bg); color: var(--mer-c-danger-strong); }
.badge svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }

/* ─── Tables (business shell) ─────────────────────────────────────────── */

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--mer-text-muted); font-weight: 600; font-size: 12px; padding: 10px 16px; border-bottom: 1px solid var(--mer-border); }
.tbl td { padding: 10px 16px; border-bottom: 1px solid var(--mer-border); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--mer-primary-tint); }

/* Stat tiles (business overview) */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 16px; }
.tile { background: var(--mer-surface); border-radius: var(--mer-radius-lg); box-shadow: var(--mer-shadow-1); padding: 14px 16px; }
.tile .k { color: var(--mer-text-muted); font-size: 12px; }
.tile .v { font-size: 24px; font-weight: 700; color: var(--mer-primary); margin-top: 2px; }
.tile .v small { font-size: 12px; color: var(--mer-text-muted); font-weight: 500; }

/* Module grid */
.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 16px; }
.mod { border: 1px solid var(--mer-border); border-radius: var(--mer-radius-md); padding: 12px; }
.mod .name { font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mod .desc { color: var(--mer-text-muted); font-size: 12px; margin: 4px 0 8px; }

/* ─── Empty states, alerts, modal ─────────────────────────────────────── */

.empty { text-align: center; padding: 36px 20px; color: var(--mer-text-muted); }
.empty .big { margin-bottom: 10px; line-height: 0; color: var(--mer-text-faint); }
.empty .big svg { width: 46px; height: 46px; stroke-width: 1.5; }
.alert { border-radius: var(--mer-radius-sm); padding: 10px 14px; font-size: 13px; margin: 8px 0; }
.alert.err { background: var(--mer-danger-bg); color: var(--mer-c-danger-strong); }
.alert.ok { background: var(--mer-success-bg); color: var(--mer-c-success-strong); }
.alert.info { background: var(--mer-info-bg); color: var(--mer-info); }

.modal-back {
  position: fixed; inset: 0; background: var(--mer-overlay); z-index: 100;
  display: grid; place-items: center; padding: 16px;
}
.modal {
  background: var(--mer-surface); border-radius: var(--mer-radius-xl); width: 100%; max-width: 560px;
  max-height: 90vh; overflow: auto; box-shadow: var(--mer-shadow-3);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--mer-border); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-x { border: none; background: none; cursor: pointer; color: var(--mer-text-muted); border-radius: 50%; width: 32px; height: 32px; display: inline-grid; place-items: center; }
.modal-x svg { width: 20px; height: 20px; }
.modal-x:hover { background: var(--mer-primary-tint); }
.modal-body { padding: 16px 20px; }
.modal-foot { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 8px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--mer-text-muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; height: 40px; border: 1px solid var(--mer-border-strong); border-radius: var(--mer-radius-sm);
  padding: 0 12px; outline: none; background: var(--mer-surface);
  transition: border-color var(--mer-motion-fast), box-shadow var(--mer-motion-fast);
}
.field textarea { height: auto; min-height: 70px; padding: 9px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--mer-primary); box-shadow: 0 0 0 1px var(--mer-primary); }
.field .hint { font-size: 11px; color: var(--mer-text-faint); margin-top: 3px; }
.field.check { display: flex; align-items: center; gap: 8px; }
.field.check input { width: auto; height: auto; }
.field.check label { margin: 0; }

/* ═══ Sign-in — the Meridian platform login, adopted whole ═════════════
   Same multi-step grammar as the Syneratix Studio door (email → password
   | otp | forgot | signup, inline errors, options card, footer) — soft
   Tranquil geometry instead of the operator console's square controls. */

.login-viewport {
  min-height: 100vh; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--mer-space-4); padding: var(--mer-space-8) var(--mer-space-6);
  background: var(--mer-bg); /* flat platform canvas — no gradients */
}
.login-card {
  background: var(--mer-surface);
  border: 1px solid var(--mer-border);
  border-radius: var(--mer-radius-xl);
  box-shadow: var(--mer-shadow-3);
  overflow: hidden; width: 100%; max-width: 440px;
}
.login-card-body { padding: 40px 40px 36px; }

.login-brand-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 28px;
}
.login-brand-row .brand-mark { width: 40px; height: 40px; border-radius: 11px; }
.login-brand-row .brand-mark span { font-size: 22px; }
.login-brand-row .brand-name { font-size: 24px; }

.login-title {
  font-size: 24px; font-weight: 600; color: var(--mer-text);
  letter-spacing: -0.01em; margin: 0 0 8px; line-height: 1.25;
}
.login-subtitle { font-size: 14px; color: var(--mer-text-muted); margin: 0 0 20px; line-height: 1.45; }

.login-field { margin-bottom: 14px; }
.login-input {
  width: 100%; height: 47px; padding: 0 14px; font-size: 16px;
  background: var(--mer-surface); color: var(--mer-text);
  border: 1px solid var(--mer-border-strong);
  border-bottom: 2px solid var(--mer-text);
  border-radius: var(--mer-radius-sm);
  transition: border-color var(--mer-motion-fast), box-shadow var(--mer-motion-fast);
}
.login-input:hover { border-color: var(--mer-text-muted); }
.login-input:focus {
  outline: none;
  border-color: var(--mer-primary);
  border-bottom-color: var(--mer-primary);
  box-shadow: 0 0 0 1px var(--mer-primary);
}
.login-input::placeholder { color: var(--mer-text-faint); }

/* OTP code input */
.login-otp {
  font-family: var(--mer-font-mono); font-size: 25px; font-weight: 600;
  letter-spacing: 0.5em; text-align: center; height: 61px;
}

.login-error { color: var(--mer-danger); font-size: 12px; min-height: 16px; margin: 0 0 10px; }
.login-note  { color: var(--mer-c-success-strong); font-size: 12px; min-height: 16px; margin: 0 0 10px; }

.login-help-link { margin-bottom: 20px; }
.login-help-link a { font-size: 13px; color: var(--mer-primary); font-weight: 500; cursor: pointer; }
.login-help-link.secondary { margin-top: -12px; }

.login-btn-next {
  width: 100%; height: 47px; font-size: 16px; font-weight: 600;
  border-radius: var(--mer-radius-sm);
  background: var(--mer-primary); color: var(--mer-on-primary);
  border: 1px solid var(--mer-primary); cursor: pointer;
  transition: background var(--mer-motion-fast);
}
.login-btn-next:hover { background: var(--mer-primary-hover); border-color: var(--mer-primary-hover); }
.login-btn-next[disabled] { opacity: 0.55; cursor: default; }

.login-back-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.login-back-btn {
  background: transparent; color: var(--mer-text-muted);
  width: 28px; height: 28px; border: 0; border-radius: var(--mer-radius-sm); cursor: pointer;
  display: grid; place-items: center;
}
.login-back-btn:hover { background: var(--mer-surface-3); color: var(--mer-text); }
.login-user-chip {
  background: var(--mer-surface-3); border: 1px solid var(--mer-border);
  padding: 4px 12px; border-radius: var(--mer-radius-pill);
  font-size: 12px; color: var(--mer-text); max-width: 280px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Password field with visibility eye */
.login-pw-wrap { position: relative; }
.login-pw-wrap .login-input { padding-right: 44px; }
.login-pw-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: none; background: none; cursor: pointer; color: var(--mer-text-faint);
  width: 32px; height: 32px; border-radius: var(--mer-radius-sm);
  display: grid; place-items: center;
}
.login-pw-eye:hover { color: var(--mer-text); background: var(--mer-surface-3); }

/* Options card (passkey / email OTP) — the detached Meridian card */
.login-options-card {
  background: var(--mer-surface); border: 1px solid var(--mer-border);
  border-radius: var(--mer-radius-lg); box-shadow: var(--mer-shadow-1);
  width: 100%; max-width: 440px; overflow: hidden;
}
.login-option-row {
  background: transparent; color: var(--mer-text);
  padding: 14px 18px; gap: 14px; border: 0; width: 100%;
  display: flex; align-items: center; cursor: pointer; text-align: left;
  transition: background var(--mer-motion-fast);
}
.login-option-row:hover { background: var(--mer-surface-3); }
.login-option-icon { color: var(--mer-text-muted); flex-shrink: 0; width: 20px; height: 20px; }
.login-option-text { display: flex; flex-direction: column; gap: 1px; }
.login-option-label { color: var(--mer-text); font-weight: 500; font-size: 13px; }
.login-option-desc  { color: var(--mer-text-muted); font-size: 12px; }
.login-options-divider { background: var(--mer-border); height: 1px; }

.login-signup-row { margin-top: 18px; font-size: 13px; color: var(--mer-text-muted); }
.login-signup-row a { font-weight: 600; margin-left: 6px; cursor: pointer; }

.login-footer { margin-top: 8px; font-size: 12px; color: var(--mer-text-faint); text-align: center; }
.login-shellnote { display: flex; gap: 8px; justify-content: center; }

@media (max-width: 520px) {
  .login-card-body { padding: 28px 22px 26px; }
}

/* Section headings inside center column */
.sect-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 12px; }
.sect-head h2 { margin: 0; font-size: 18px; }
.sect-head .sub { color: var(--mer-text-muted); font-size: 12px; }

/* Workspace picker (business shell) */
.wpick { display: flex; align-items: center; gap: 8px; margin-left: 10px; }
.wpick select {
  height: 34px; border: 1px solid var(--mer-border-strong); border-radius: var(--mer-radius-sm);
  background: var(--mer-surface); padding: 0 8px; max-width: 220px; font-weight: 600;
}

/* Feed skeleton shimmer */
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skel { height: 120px; border-radius: var(--mer-radius-lg); margin-bottom: 16px;
  background: linear-gradient(90deg, var(--mer-surface-3) 25%, var(--mer-surface-2) 37%, var(--mer-surface-3) 63%);
  background-size: 800px 100%; animation: shimmer 1.3s infinite linear; }

.icon { display: inline-block; vertical-align: middle; width: 18px; height: 18px; flex: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-sm svg, .btn-ghost.btn-sm svg { width: 16px; height: 16px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }

/* ═══ Phase 0 — command centre · menus · tabs · chips (masterplan §3) ═══ */

/* Left rail: the platform command centre (profile lives under Me). */
.cmd-nav { padding: 6px; }
.cmdn-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--mer-text-muted); border-radius: var(--mer-radius-sm); cursor: pointer; text-align: left; }
.cmdn-item .icon { width: 18px; height: 18px; flex: none; }
.cmdn-item:hover { background: var(--mer-primary-tint); color: var(--mer-text); }
.cmdn-item.active { color: var(--mer-c-brand-950); background: var(--mer-selected); }

/* Header dropdowns — Create + Me. */
.gmenu { position: fixed; top: 54px; right: 18px; z-index: 120; min-width: 224px;
  background: var(--mer-surface, #fff); border: 1px solid var(--mer-border);
  border-radius: var(--mer-radius-lg); box-shadow: 0 12px 32px rgba(16, 20, 32, .16); padding: 6px; }
.gmenu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border: 0; background: none; font: inherit; font-size: 13px; font-weight: 500;
  border-radius: var(--mer-radius-sm); cursor: pointer; color: var(--mer-text); text-align: left; }
.gmenu-item .icon { width: 16px; height: 16px; color: var(--mer-text-muted); }
.gmenu-item:hover { background: var(--mer-primary-tint); }

/* Tab strips — feed lenses and community sections. Scroll on overflow. */
.tq-tabs { display: flex; gap: 2px; padding: 6px; overflow-x: auto; margin-bottom: 16px; scrollbar-width: none; }
.tq-tabs::-webkit-scrollbar { display: none; }
.tq-tabs--flush { margin-bottom: 0; border-top: 1px solid var(--mer-border);
  border-radius: 0 0 var(--mer-radius-lg) var(--mer-radius-lg); }
.tq-tab { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--mer-text-muted); padding: 8px 13px; border-radius: var(--mer-radius-sm);
  cursor: pointer; white-space: nowrap; }
.tq-tab:hover { background: var(--mer-primary-tint); color: var(--mer-text); }
.tq-tab.on { color: var(--mer-c-brand-950); box-shadow: inset 0 -2.5px 0 var(--lime, #a3cc2e); }

/* Composer content-type chips — borderless, quiet; only the active one fills. */
.chips { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 12px 10px; }
.chip { border: 0; background: none; font: inherit; font-size: 12.5px;
  font-weight: 600; color: var(--mer-text-muted); padding: 6px 12px; border-radius: var(--mer-radius-sm); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; }
.chip .icon { width: 15px; height: 15px; }
.chip:hover { background: var(--mer-primary-tint); color: var(--mer-text); }
.chip-on { color: var(--mer-primary); background: var(--mer-primary-tint); }

/* Right-rail attention rows (Today on Tranquil · Community health). */
.today-item { width: 100%; border: 0; background: none; font: inherit; text-align: left; }
.today-item .icon { width: 16px; height: 16px; flex: none; color: var(--mer-text-muted); }
.today-item .t { font-weight: 600; font-size: 12.5px; white-space: normal; }

/* Community header action cluster. */
.chead-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }

/* ═══ IA redesign — identity pages · workspace · creation flow ═════════ */

/* Identity headers (community / person / organisation). */
.id-cover { height: 148px; position: relative;
  background: linear-gradient(100deg, var(--mer-chrome-2) 0%, var(--mer-c-brand-900) 55%, var(--mer-c-brand-700) 100%); }
.id-cover::after { content: ""; position: absolute; inset: auto 0 0 0; height: 44px;
  background: linear-gradient(to top, rgba(16,20,32,.28), transparent); }
.id-head { display: flex; gap: 16px; align-items: flex-start; padding: 0 20px 4px; }
.id-head .avatar.xl { width: 92px; height: 92px; font-size: 36px; border-width: 4px; margin-top: -46px; position: relative; z-index: 1; }
.id-name { font-size: 21px; font-weight: 700; line-height: 1.2; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.id-tagline { color: var(--mer-text-muted); font-size: 13.5px; margin-top: 2px; }
.id-facts { color: var(--mer-text-muted); font-size: 12.5px; margin-top: 6px; display: flex; gap: 4px 14px; flex-wrap: wrap; }
.id-facts .fact { display: inline-flex; align-items: center; gap: 5px; }
.id-facts .icon { width: 14px; height: 14px; }

/* Quick-stats strip on identity pages. */
.stat-strip { display: flex; border-top: 1px solid var(--mer-border); margin-top: 12px; }
.stat-strip .stat { flex: 1; text-align: center; padding: 10px 4px; cursor: pointer; border-radius: 0; }
.stat-strip .stat:hover { background: var(--mer-primary-tint); }
.stat-strip .v { font-size: 17px; font-weight: 700; color: var(--mer-c-brand-950); }
.stat-strip .k { font-size: 11px; color: var(--mer-text-muted); font-weight: 600; }

/* Acting-as context bar (workspace + composer clarity). */
.ctx-bar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; margin-bottom: 16px;
  background: var(--mer-selected); color: var(--mer-on-selected);
  border-radius: var(--mer-radius-lg); font-size: 12.5px; font-weight: 600; }
.ctx-bar .icon { width: 15px; height: 15px; flex: none; }
.ctx-bar .dim { opacity: .75; font-weight: 500; }
.ctx-bar .spacer { margin-left: auto; }

/* Quick actions row (workspace dashboard). */
.qa-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.qa { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px;
  background: var(--mer-surface); border: 1px solid var(--mer-border); border-radius: var(--mer-radius-pill);
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--mer-text); cursor: pointer; }
.qa:hover { border-color: var(--mer-primary); color: var(--mer-primary); background: var(--mer-primary-tint); }
.qa .icon { width: 15px; height: 15px; }

/* Multi-step creation flow. */
.steps { display: flex; align-items: center; gap: 0; padding: 18px 20px 6px; overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.step { display: flex; align-items: center; gap: 8px; color: var(--mer-text-faint); font-size: 12px; font-weight: 600; white-space: nowrap; }
.step .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mer-surface-3); color: var(--mer-text-muted); font-size: 11.5px; font-weight: 700; }
.step.on { color: var(--mer-c-brand-950); }
.step.on .dot { background: var(--mer-primary); color: var(--mer-on-primary); }
.step.done { color: var(--mer-text-muted); }
.step.done .dot { background: var(--mer-execute-container); color: var(--mer-on-execute-container); }
.step-line { flex: 0 0 26px; height: 1.5px; background: var(--mer-border); margin: 0 8px; }

/* Creation hub (Create menu) — sectioned. */
.gmenu-sect { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--mer-text-faint); padding: 8px 10px 3px; }
.gmenu hr { border: 0; border-top: 1px solid var(--mer-border); margin: 5px 0; }

/* Checklist (post-creation setup). */
.checklist .rail-item { padding: 9px 16px; }
.checklist .icon { width: 16px; height: 16px; color: var(--mer-text-faint); }

/* Reaction picker refinement — press-and-hold feel, no boxes. */
.pact .rpick { pointer-events: none; opacity: 0; transform: translateY(4px); display: flex;
  transition: opacity .12s ease, transform .12s ease; }
.pact:hover .rpick, .rpick:hover, .react-btn.show .rpick { pointer-events: auto; opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════════════════════════════════
   Phase 4 — communities deep-build: chat, invites, governance, moderation
   ═══════════════════════════════════════════════════════════════════════ */

/* ── shared modal fields (the Phase-4 modals use .fld / .chk) ── */
.modal-sm { max-width: 420px; }
.modal-head h3 { margin: 0; font-size: 16px; }
.fld { display: block; margin-bottom: 12px; }
.fld > span { display: block; font-size: 12px; font-weight: 600; color: var(--mer-text-muted); margin-bottom: 4px; }
.fld input, .fld select, .fld textarea {
  width: 100%; height: 40px; border: 1px solid var(--mer-border-strong); border-radius: var(--mer-radius-sm);
  padding: 0 12px; outline: none; background: var(--mer-surface); color: var(--mer-text); font-size: 14px;
}
.fld textarea { height: auto; min-height: 64px; padding: 9px 12px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--mer-primary); box-shadow: 0 0 0 1px var(--mer-primary); }
.fld-row { display: flex; gap: 12px; }
.fld-row .fld { flex: 1; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mer-text-muted); margin: 4px 0 12px; }
.chk input { width: auto; }

/* ── role & reason chips (roles modal + report modal) ── */
.role-chips, .report-reasons { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.role-chip {
  border: 1px solid var(--mer-border-strong); background: var(--mer-surface); color: var(--mer-text);
  border-radius: var(--mer-radius-pill); padding: 5px 12px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; text-transform: capitalize; transition: background var(--mer-motion-fast), border-color var(--mer-motion-fast);
}
.role-chip:hover { background: var(--mer-primary-tint); }
.role-chip.on { background: var(--mer-execute-container); color: var(--mer-on-execute-container); border-color: transparent; }
.report-reasons .role-chip { text-transform: none; }

/* ── chat: rail + thread ── */
.chat { display: flex; min-height: 460px; border: 1px solid var(--mer-border); border-radius: var(--mer-radius-lg); overflow: hidden; background: var(--mer-surface); }
.chat-rail { flex: 0 0 208px; border-right: 1px solid var(--mer-border); background: var(--mer-surface-2); display: flex; flex-direction: column; }
.chat-rail-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; font-weight: 700; font-size: 13px; color: var(--mer-text-muted); }
.chat-chan { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: none; background: none;
  padding: 8px 14px; cursor: pointer; color: var(--mer-text); font-size: 13.5px; }
.chat-chan:hover { background: var(--mer-primary-tint); }
.chat-chan.on { background: var(--mer-selected); color: var(--mer-on-selected); font-weight: 600; }
.chat-chan-g { width: 18px; display: inline-flex; align-items: center; justify-content: center; color: var(--mer-text-faint); }
.chat-chan-g svg { width: 15px; height: 15px; }
.chat-chan-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-thread { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; max-height: 520px; }
.chat-pinned { background: var(--mer-warning-bg); color: var(--mer-warning-text); border-radius: var(--mer-radius-sm); padding: 7px 12px; font-size: 12.5px; }
.chat-empty { text-align: center; color: var(--mer-text-muted); padding: 42px 16px; margin: auto; }
.chat-empty .big { margin-bottom: 8px; line-height: 0; color: var(--mer-text-faint); }
.chat-empty .big svg { width: 40px; height: 40px; }
.chat-composer { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--mer-border); }
.chat-input { flex: 1; height: 40px; border: 1px solid var(--mer-border-strong); border-radius: var(--mer-radius-pill); padding: 0 16px; outline: none; background: var(--mer-surface); color: var(--mer-text); }
.chat-input:focus { border-color: var(--mer-primary); }
.chat-send { width: 44px; padding: 0; border-radius: 50%; }

/* messages */
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 82%; }
.msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msg-col { min-width: 0; }
.msg-author { font-size: 11.5px; font-weight: 700; color: var(--mer-text-muted); margin: 0 0 2px 10px; }
.msg-bubble { position: relative; background: var(--mer-surface-2); border-radius: 4px 14px 14px 14px; padding: 7px 12px 5px; }
.msg.mine .msg-bubble { background: var(--mer-selected); color: var(--mer-on-selected); border-radius: 14px 4px 14px 14px; }
.msg-body { font-size: 13.5px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.msg-gone { color: var(--mer-text-faint); font-style: italic; }
.msg-att { margin-top: 4px; font-size: 12px; color: var(--mer-text-muted); display: flex; align-items: center; gap: 6px; }
.msg-reply { border-left: 2px solid var(--mer-primary); padding: 2px 8px; margin-bottom: 4px; font-size: 12px; color: var(--mer-text-muted); border-radius: 0 6px 6px 0; background: var(--mer-primary-tint); }
.msg-reply .who { font-weight: 700; display: block; }
.msg-foot { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--mer-text-faint); margin-top: 3px; }
.msg.mine .msg-foot { color: rgba(255,255,255,.7); }
.msg-more { border: none; background: none; cursor: pointer; color: inherit; opacity: 0; line-height: 1; padding: 0 2px; display: inline-flex; align-items: center; }
.msg-more svg { width: 16px; height: 16px; }
.msg-bubble:hover .msg-more { opacity: .8; }
.msg-picker { position: absolute; top: -34px; right: 0; background: var(--mer-surface); border: 1px solid var(--mer-border); border-radius: var(--mer-radius-pill);
  box-shadow: var(--mer-shadow-2); padding: 3px 6px; display: none; gap: 3px; z-index: 5; }
.msg-picker.open { display: flex; }
.msg-picker button { border: none; background: none; cursor: pointer; padding: 3px; border-radius: 50%; display: inline-flex; }
.msg-picker button svg { width: 20px; height: 20px; }
.msg-picker button:hover { background: var(--mer-primary-tint); transform: scale(1.2); }
.msg-reacts { display: flex; gap: 4px; margin: 3px 0 0 8px; }
.msg-react { font-size: 11px; background: var(--mer-surface-2); border: 1px solid var(--mer-border); border-radius: var(--mer-radius-pill);
  padding: 1px 7px; cursor: pointer; color: var(--mer-text-muted); display: inline-flex; align-items: center; gap: 3px; }
.msg-react svg { width: 13px; height: 13px; }
.msg-react.on { background: var(--mer-execute-container); color: var(--mer-on-execute-container); border-color: transparent; }

/* ── governance: resolutions ── */
.gov-card { margin-bottom: 12px; }
.gov-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gov-ref { font-family: var(--mer-font-mono, monospace); font-size: 12px; color: var(--mer-text-muted); margin-right: 6px; }
.gov-title { margin: 6px 0 4px; font-size: 16px; }
.gov-text { font-size: 13.5px; margin: 0 0 10px; }
.gov-tally { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.gov-bar { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.gov-bar-k { flex: 0 0 58px; color: var(--mer-text-muted); }
.gov-bar-t { flex: 1; height: 8px; background: var(--mer-surface-2); border-radius: 5px; overflow: hidden; }
.gov-bar-f { display: block; height: 100%; border-radius: 5px; transition: width .3s ease; }
.gov-bar-f.for { background: var(--mer-execute); }
.gov-bar-f.against { background: var(--mer-danger); }
.gov-bar-f.abstain { background: var(--mer-text-faint); }
.gov-bar-v { flex: 0 0 24px; text-align: right; font-variant-numeric: tabular-nums; color: var(--mer-text-muted); }
.gov-meta { margin: 8px 0 10px; }
.gov-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── moderation queue ── */
.mod-card { margin-bottom: 12px; }
.mod-post { border-left: 3px solid var(--mer-warning-text); padding: 2px 0 2px 12px; margin-bottom: 12px; }
.mod-post-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.mod-post-title { font-weight: 700; font-size: 14px; }
.mod-post-snip { font-size: 13px; color: var(--mer-text-muted); }
.mod-flags-h { font-size: 12px; font-weight: 700; color: var(--mer-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.mod-flag { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.mod-flag-r { font-size: 13px; }
.mod-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ── DM inbox ── */
.dm-wrap { display: flex; min-height: 480px; overflow: hidden; }
.dm-rail { flex: 0 0 260px; border-right: 1px solid var(--mer-border); overflow-y: auto; }
.dm-lane { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: none;
  padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--mer-border); }
.dm-lane:hover { background: var(--mer-primary-tint); }
.dm-lane.on { background: var(--mer-selected); }
.dm-lane.on .t, .dm-lane.on .s, .dm-lane.on .dm-lane-t { color: var(--mer-on-selected); }
.dm-lane-txt { min-width: 0; flex: 1; }
.dm-lane-txt .t { font-weight: 600; font-size: 13.5px; }
.dm-lane-txt .s { font-size: 12px; color: var(--mer-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-lane-t { font-size: 10.5px; color: var(--mer-text-faint); align-self: flex-start; }
.dm-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dm-main .chat-thread { max-height: none; }

/* ── join landing ── */
.join-card { text-align: center; }

/* ── report action tint ── */
.pact-report:hover { color: var(--mer-danger); }

/* ══════════════════════════════════════════════════════════════════════
   Media tools — avatar/header editing + the canvas cropper & video trim
   ══════════════════════════════════════════════════════════════════════ */

/* stored-image identity surfaces */
.avatar.has-img { background-size: cover; background-position: center; color: transparent; }
.id-cover.has-img { background-size: cover; background-position: center; }

/* avatar wrapper so a camera badge can overlay the photo */
.id-avatar-wrap { position: relative; width: 92px; height: 92px; margin-top: -46px; z-index: 1; flex: none; }
.id-avatar-wrap .avatar.xl { margin-top: 0; }

/* camera affordances (LinkedIn/X-style) */
.med-cam {
  position: absolute; border: none; cursor: pointer; color: #fff;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(16, 20, 32, .58); border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: opacity var(--mer-motion-fast), background var(--mer-motion-fast);
}
.med-cam:hover { background: rgba(16, 20, 32, .78); }
.med-cam svg { display: block; }
.cover-cam { top: 12px; right: 12px; padding: 7px 12px; opacity: .92; }
.avatar-cam {
  right: -2px; bottom: -2px; width: 30px; height: 30px; padding: 0;
  justify-content: center; border: 2px solid var(--mer-surface); opacity: .96;
}

/* ── the editor modal ── */
.med { max-width: 540px; }
.med-body { padding: 14px 16px 4px; }
.med-alert:empty { display: none; }
.med-stage {
  position: relative; width: 100%; border-radius: var(--mer-radius-lg);
  overflow: hidden; background:
    linear-gradient(45deg, #1a1f2b 25%, transparent 25%) -8px 0/16px 16px,
    linear-gradient(-45deg, #1a1f2b 25%, transparent 25%) -8px 0/16px 16px,
    linear-gradient(45deg, transparent 75%, #1a1f2b 75%) 0 0/16px 16px,
    linear-gradient(-45deg, transparent 75%, #1a1f2b 75%) 0 0/16px 16px,
    #12151d;
  display: grid; place-items: center; touch-action: none; user-select: none;
}
.med-canvas { display: block; cursor: grab; }
.med-canvas:active { cursor: grabbing; }
.med-frame {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  pointer-events: none; border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 2000px rgba(13, 16, 23, .56); border-radius: 3px;
}
.med-frame.is-round { border-radius: 50%; }
.med-hint {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(16, 20, 32, .62); color: #fff; font-size: 11.5px;
  padding: 4px 10px; border-radius: 999px; pointer-events: none; white-space: nowrap;
}
.med-aspects { display: flex; gap: 6px; margin: 12px 0 2px; flex-wrap: wrap; }
.med-controls {
  display: flex; align-items: center; gap: 10px; margin: 12px 2px 4px;
}
.med-controls--wrap { flex-wrap: wrap; }
.med-zoom { flex: 1; accent-color: var(--mer-primary); }
.ico-btn {
  width: 34px; height: 34px; flex: none; border: 1px solid var(--mer-border-strong);
  background: var(--mer-surface); border-radius: 50%; cursor: pointer;
  font-size: 16px; line-height: 1; color: var(--mer-text);
  display: grid; place-items: center;
  transition: background var(--mer-motion-fast), border-color var(--mer-motion-fast);
}
.ico-btn:hover { background: var(--mer-primary-tint); border-color: var(--mer-primary); }
.ico-btn svg { width: 18px; height: 18px; }

/* ── video formatter ── */
.med-stage--video { background: #0d1017; min-height: 200px; }
.med-video { width: 100%; max-height: 46vh; display: block; }
.med-scrub { margin: 10px 2px 0; }
.med-range { width: 100%; accent-color: var(--mer-primary); }
.med-trim {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 10px;
  align-items: center; margin: 8px 2px 0;
}
.med-trimlab { font-size: 12px; color: var(--mer-text-muted); white-space: nowrap; }
.med-mute { font-size: 12.5px; color: var(--mer-text-muted); display: inline-flex; align-items: center; gap: 5px; }

/* ── composer thumbnails (crop / format per item) ── */
.composer-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.composer-thumbs:empty { display: none; }
.cthumb {
  position: relative; width: 86px; height: 86px; border-radius: var(--mer-radius-sm);
  overflow: hidden; border: 1px solid var(--mer-border-strong); background: #0d1017;
}
.cthumb-img { width: 100%; height: 100%; background-size: cover; background-position: center; }
.cthumb-img video { width: 100%; height: 100%; object-fit: cover; }
.cthumb-edit {
  position: absolute; left: 0; right: 0; bottom: 0; border: none; cursor: pointer;
  background: rgba(16, 20, 32, .66); color: #fff; font-size: 11px; font-weight: 600;
  padding: 4px 0; text-align: center;
}
.cthumb-edit:hover { background: rgba(16, 20, 32, .84); }

/* ── Composer dropzone (design-system file picker) ─────────────────────── */
.dropzone {
  display: flex; align-items: center; gap: 12px; margin-top: 8px;
  padding: 14px 16px; border: 1.5px dashed var(--mer-border-strong);
  border-radius: var(--mer-radius-md); background: var(--mer-surface-2);
  color: var(--mer-text-muted); cursor: pointer;
  transition: border-color var(--mer-motion-fast), background var(--mer-motion-fast), color var(--mer-motion-fast);
}
.dropzone:hover, .dropzone.dz-over { border-color: var(--mer-primary); background: var(--mer-primary-tint); color: var(--mer-primary); }
.dropzone .icon { width: 26px; height: 26px; flex: none; color: var(--mer-primary); }
.dz-text { display: flex; flex-direction: column; gap: 1px; line-height: 1.3; min-width: 0; }
.dz-text b { color: var(--mer-text); font-size: 15px; }
.dz-text span { font-size: 13px; }

/* ═══ Reading scale — platform typography ≈+20% ════════════════════════════
   People-products read better a touch larger. Only type grows here; the
   fixed-px rails/containers are untouched, so nothing reflows out of place.
   This block is last in source order, so it wins over the base rules. */

/* Body copy */
.post-body, .post-name, .composer .start { font-size: 15px; }
.post-body { line-height: 1.5; }

/* Primary UI text */
.comment-bubble .txt, .rail-item .t, .rail-more, .tbl,
.mod .name, .chip, .msg-body, .mod-flag-r { font-size: 15px; }
.pact { font-size: 13px; }

/* Secondary / meta text */
.post-meta, .post-counts, .card .sub, .comment-bubble .who, .dir-type,
.dir-purpose, .mod .desc, .tile .k, .field label, .tbl th, .id-facts,
.sect-head .sub, .mod-flags-h, .msg-reply { font-size: 14px; }

/* Small chrome */
.rail-item .s, .msg-author, .badge, .composer-note, .field .hint,
.gnav-item .lbl, .foot, .stat-strip .k { font-size: 13px; }

/* Buttons */
.btn { font-size: 16px; }
.btn-sm { font-size: 13px; }

/* Headings & figures */
.card h3, .dir-name, .sect-head h2 { font-size: 18px; }
.modal-head h2, .stat-strip .v { font-size: 20px; }
.id-name { font-size: 25px; }
.tile .v { font-size: 28px; }

/* ══════════════════════════════════════════════════════════════════════
   Calls, meetings & sessions — DM voice/video, community sessions, the
   full-screen call stage and the incoming-call ring. WebRTC media runs
   peer-to-peer; this is only the chrome around it.
   ══════════════════════════════════════════════════════════════════════ */

/* A small round icon button (DM call header, tile controls). */
.icon-btn { width: 36px; height: 36px; border-radius: var(--mer-radius-pill);
  border: 1px solid var(--mer-border); background: var(--mer-surface); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--mer-text);
  transition: background .12s, color .12s, border-color .12s; }
.icon-btn:hover { background: var(--mer-primary-tint); color: var(--mer-primary); border-color: var(--mer-primary); }
.icon-btn .icon { width: 18px; height: 18px; }

/* DM thread: a call header over the message thread. */
.dm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--mer-border); background: var(--mer-surface); }
.dm-head-who { display: flex; align-items: center; gap: 9px; font-weight: 650; min-width: 0; }
.dm-head-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-head-acts { display: flex; gap: 8px; flex: 0 0 auto; }
.dm-thread-box { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ── community session rows ── */
.s-row { display: flex; align-items: center; gap: 13px; padding: 13px 16px; }
.s-emoji { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--mer-radius-md); background: var(--mer-primary-tint); color: var(--mer-primary); }
.s-emoji svg { width: 22px; height: 22px; }
.s-body { flex: 1; min-width: 0; }
.s-title { font-weight: 700; font-size: 15px; }
.s-meta { margin-top: 5px; }
.s-acts { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }

/* ── session kind picker (create modal) ── */
.s-kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.s-kind { display: flex; align-items: center; gap: 7px; padding: 9px 11px; cursor: pointer;
  border: 1px solid var(--mer-border); border-radius: var(--mer-radius-md); background: var(--mer-surface);
  font-size: 13.5px; font-weight: 550; color: var(--mer-text); text-align: left; }
.s-kind:hover { border-color: var(--mer-primary); background: var(--mer-primary-tint); }
.s-kind.on { border-color: var(--mer-primary); background: var(--mer-selected); color: var(--mer-on-selected); box-shadow: 0 0 0 1px var(--mer-primary) inset; }
.s-kind-e { display: inline-flex; color: var(--mer-primary); }
.s-kind-e svg { width: 19px; height: 19px; }

/* ── the call stage ── */
.call-overlay { position: fixed; inset: 0; z-index: 300; background: #0d1017;
  display: flex; flex-direction: column; color: #eef1f7; }
.call-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; background: linear-gradient(#171c27, rgba(23,28,39,0)); }
.call-title { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; }
.call-kind { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: #aeb7cc; background: rgba(255,255,255,.08); padding: 2px 8px; border-radius: var(--mer-radius-pill); }
.call-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mer-c-lime-brand);
  box-shadow: 0 0 0 0 rgba(194,219,111,.6); animation: callpulse 1.8s infinite; }
@keyframes callpulse { 0% { box-shadow: 0 0 0 0 rgba(194,219,111,.55); } 70% { box-shadow: 0 0 0 8px rgba(194,219,111,0); } 100% { box-shadow: 0 0 0 0 rgba(194,219,111,0); } }
.call-net { font-size: 12.5px; color: #9aa4bb; }
.call-grid { flex: 1; display: grid; gap: 10px; padding: 0 20px 8px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-content: center; overflow: auto; }
.call-tile { position: relative; background: #1b212e; border-radius: var(--mer-radius-lg);
  overflow: hidden; aspect-ratio: 16 / 10; min-height: 180px; }
.call-tile video { width: 100%; height: 100%; object-fit: cover; background: #10141f; }
.call-tile.mine { outline: 2px solid var(--mer-c-lime-brand); outline-offset: -2px; }
.call-name { position: absolute; left: 10px; bottom: 9px; display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: #fff; background: rgba(13,16,23,.55);
  padding: 4px 10px 4px 6px; border-radius: var(--mer-radius-pill); backdrop-filter: blur(4px); }
.call-bar { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px; }
.call-btn { width: 54px; height: 54px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 21px; background: rgba(255,255,255,.12); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; transition: background .12s, transform .08s; }
.call-btn:hover { background: rgba(255,255,255,.22); }
.call-btn:active { transform: scale(.94); }
.call-btn svg { width: 23px; height: 23px; }
.call-btn.off { background: #fff; color: #0d1017; }
.call-hang { background: var(--mer-danger); }
.call-hang:hover { background: #d5342a; }

/* ── incoming-call ring ── */
.call-ring { position: fixed; inset: 0; z-index: 320; background: rgba(13,16,23,.5);
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.call-ring-card { background: var(--mer-surface); border-radius: var(--mer-radius-xl);
  box-shadow: var(--mer-shadow-2, 0 20px 60px rgba(16,20,32,.4)); padding: 28px 30px; text-align: center;
  width: min(340px, calc(100% - 32px)); animation: ringpop .18s ease-out; }
@keyframes ringpop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.call-ring-card .avatar { margin: 0 auto 12px; animation: ringwob 1.4s ease-in-out infinite; }
@keyframes ringwob { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.call-ring-who { font-size: 19px; font-weight: 750; }
.call-ring-sub { font-size: 13px; color: var(--mer-text-muted); margin-top: 3px; }
.call-ring-acts { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.call-answer-audio { padding: 0 14px; }

/* ── new-message compose (people-picker) ── */
.dmc-search { display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 10px;
  border: 1px solid var(--mer-border); border-radius: var(--mer-radius-sm); background: var(--mer-surface-2); }
.dmc-search .icon { width: 18px; height: 18px; color: var(--mer-text-faint); flex: 0 0 auto; }
.dmc-search input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; }
.dmc-results { max-height: 320px; overflow-y: auto; }
.dmc-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none;
  background: none; padding: 9px 8px; cursor: pointer; border-radius: var(--mer-radius-sm); }
.dmc-row:hover { background: var(--mer-primary-tint); }
.dmc-who { flex: 1; min-width: 0; }
.dmc-who .t { font-weight: 600; font-size: 14px; }
.dmc-who .s { font-size: 12.5px; color: var(--mer-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmc-row .icon { width: 17px; height: 17px; color: var(--mer-text-faint); flex: 0 0 auto; }
.dmc-row:hover .icon { color: var(--mer-primary); }

/* ══════════════════════════════════════════════════════════════════════
   Mobile app shell — a fixed bottom navigation + compact topbar, and a
   full responsive pass so every surface reflows to one column and clears
   the bottom bar. Grammar mirrors the Syneratix admin bottom nav
   (.bottomnav / __item / __ic / __lb).
   ══════════════════════════════════════════════════════════════════════ */

.bottomnav { display: none; }

@media (max-width: 768px) {
  /* Topbar → compact: brand + search + create. Routes & Me live below. */
  .gnav-inner { padding: 0 12px; gap: 8px; }
  .gnav-item[data-route], #gme, #to-social, .gnav-sep { display: none; }
  .gsearch { display: block; flex: 1 1 auto; min-width: 0; }
  .gnav-items { margin-left: auto; }
  .gnav-item .lbl { display: none; }

  /* Fixed bottom navigation (icons + labels, active = brand). */
  .bottomnav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    height: 58px; background: var(--mer-surface);
    border-top: 1px solid var(--mer-border);
    box-shadow: 0 -6px 18px rgba(16, 20, 32, .07);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .bottomnav__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 6px 2px; border: none; background: none; cursor: pointer;
    color: var(--mer-text-muted); position: relative; min-width: 0;
  }
  .bottomnav__item.active { color: var(--mer-primary); }
  .bottomnav__ic { display: inline-flex; }
  .bottomnav__ic svg { width: 22px; height: 22px; }
  .bottomnav__ic .avatar { width: 24px; height: 24px; font-size: 10px; }
  .bottomnav__lb {
    font-size: 10.5px; font-weight: 600; line-height: 1; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .bottomnav__item.active::before {
    content: ""; position: absolute; top: 0; left: 24%; right: 24%; height: 2.5px;
    background: var(--mer-primary); border-radius: var(--mer-radius-pill);
  }

  /* Clear the fixed bar on every scrollable page. */
  .page { padding: 16px 12px calc(74px + env(safe-area-inset-bottom, 0)); }
  .page.wide { padding: 16px 12px calc(74px + env(safe-area-inset-bottom, 0)); }

  /* Header menus become bottom sheets sitting above the bar. */
  .gmenu {
    top: auto; bottom: calc(66px + env(safe-area-inset-bottom, 0));
    left: 8px; right: 8px; min-width: 0; max-height: 60vh; overflow: auto;
  }

  /* Identity headers (profile / community / business) shrink. */
  .id-cover { height: 108px; }
  .id-head { padding: 0 14px 4px; gap: 12px; }
  .id-head .avatar.xl, .id-avatar-wrap { width: 74px; height: 74px; }
  .id-head .avatar.xl { margin-top: -38px; font-size: 28px; }
  .id-avatar-wrap { margin-top: -38px; }
  .id-avatar-wrap .avatar.xl { margin-top: 0; }
  .id-name { font-size: 20px; }
  .stat-strip { overflow-x: auto; }
  .stat-strip .stat { min-width: 74px; }

  /* Chat + DM stack the rail above the thread. */
  .chat { flex-direction: column; min-height: 68vh; }
  .chat-rail {
    flex: 0 0 auto; width: 100%; max-height: 126px; overflow-y: auto;
    border-right: none; border-bottom: 1px solid var(--mer-border);
  }
  .chat-thread { max-height: none; }
  .dm-wrap { flex-direction: column; min-height: 0; }
  .dm-rail {
    flex: 0 0 auto; width: 100%; max-height: 38vh;
    border-right: none; border-bottom: 1px solid var(--mer-border);
  }

  /* Call stage → single-column tiles, tighter bar. */
  .call-grid { grid-template-columns: 1fr; }
  .call-tile { min-height: 150px; }
  .call-head { padding: 12px 14px; }
  .call-bar { gap: 12px; padding: 14px; }
  .call-btn { width: 50px; height: 50px; }

  /* Modals hug the viewport. */
  .modal-back { padding: 10px; }
  .modal { max-height: 90vh; }

  /* Session rows + kind grid. */
  .s-row { gap: 10px; padding: 12px 14px; }
  .s-kind-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .bottomnav__lb { font-size: 9.5px; }
  .bottomnav__ic svg { width: 21px; height: 21px; }
  .id-name { font-size: 18px; }
  .s-kind-grid { grid-template-columns: 1fr; }
  .modal-head { padding: 12px 14px; }
  .modal-body { padding: 14px; }
}




/* ═══════════════════════════════════════════════════════════════════════
   OPPORTUNITY DESK — CGIAR-grammar hero band, tabbed body, meta rail,
   and the universal Easy Apply. One visual language for jobs,
   scholarships, grants and events.
   ═══════════════════════════════════════════════════════════════════════ */
.opp-hero { background: linear-gradient(135deg, var(--mer-c-brand-900), var(--mer-c-brand-800) 55%, #3c4ea0); color: #fff; border-radius: var(--mer-r-lg, 14px); padding: 28px 26px 26px; margin-bottom: 18px; box-shadow: var(--mer-shadow-2, 0 8px 24px rgba(16,20,32,.18)); }
.opp-hero-inner { max-width: 980px; }
.opp-hero-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--mer-c-lime-brand, #c6f432); margin-bottom: 10px; }
.opp-hero-kicker svg { width: 15px; height: 15px; }
.opp-hero h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.2; letter-spacing: -.02em; color: #fff; }
.opp-hero .sub { color: var(--mer-c-brand-300); font-size: 13.5px; max-width: 640px; }
.opp-hero-split { display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.opp-hero-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.opp-hero-badges .badge { background: rgba(255,255,255,.13); color: #fff; border: 1px solid rgba(255,255,255,.22); }
.opp-hero-badges .badge.lime { background: var(--mer-c-lime-brand); color: var(--mer-c-brand-950); border-color: transparent; }
.opp-hero-badges .badge.warn { background: #ffb54d; color: #4a2f00; border-color: transparent; }
.opp-hero-act { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.opp-hero-act .sub { font-size: 12px; }

.easy-apply { display: inline-flex; align-items: center; gap: 8px; background: var(--mer-execute); color: var(--mer-c-brand-950); border: 0; border-radius: 999px; padding: 11px 22px; font-size: 14px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 14px rgba(198,244,50,.35); transition: transform .12s ease, box-shadow .12s ease; }
.easy-apply svg { width: 16px; height: 16px; }
.easy-apply:hover { background: var(--mer-execute-hover); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(198,244,50,.45); }
.easy-apply--ink { background: var(--mer-primary); color: #fff; box-shadow: none; }
.easy-apply--ink:hover { background: var(--mer-primary-hover); box-shadow: none; }

.opp-body { max-width: 1080px; }
.opp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.opp-meta { position: sticky; top: 68px; }
.opp-meta-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--mer-line, #e7e9f0); font-size: 13px; }
.opp-meta-row:last-of-type { border-bottom: 0; }
.opp-meta-row .k { color: var(--mer-text-faint); font-weight: 600; white-space: nowrap; }
.opp-meta-row .v { text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.opp-desc { font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
.opp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.opp-list li { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; }
.opp-list li svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--mer-primary); }

.opp-form { max-width: 760px; }
.opp-form-h { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: 15px; font-weight: 800; }
.opp-form-h svg { width: 17px; height: 17px; color: var(--mer-primary); }
.opp-form-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 0 4px; }

.ea-card { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--mer-line, #e7e9f0); border-radius: 12px; background: var(--mer-surface-2, #f7f8fb); margin-bottom: 12px; }
.ea-card .bg-title { font-size: 14px; }

/* ═══════════════════════════════════════════════════════════════════════
   PROFESSIONAL BACKGROUND — LinkedIn-grammar rows + Behance-grammar
   portfolio grid. Shared by profile tabs and the Easy Apply preview.
   ═══════════════════════════════════════════════════════════════════════ */
.bg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.bg-head h3 { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.bg-head h3 svg { width: 16px; height: 16px; color: var(--mer-primary); }
.bg-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--mer-line, #e7e9f0); }
.bg-row:last-child { border-bottom: 0; }
.bg-dot { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.bg-dot svg { width: 17px; height: 17px; }
.bg-main { min-width: 0; flex: 1; }
.bg-title { font-weight: 700; font-size: 14px; line-height: 1.3; }
.bg-sub { font-size: 12.5px; color: var(--mer-text-muted); margin-top: 1px; }
.bg-note { font-size: 13px; color: var(--mer-text-muted); margin-top: 5px; line-height: 1.5; }
.bg-acts { display: inline-flex; gap: 2px; flex: none; }
.bg-empty { font-size: 13px; color: var(--mer-text-faint); padding: 6px 0; }
.bg-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.badge-tile { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border: 1px solid var(--mer-line, #e7e9f0); border-radius: 12px; background: var(--mer-surface-2, #f7f8fb); }
.badge-medal { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--mer-execute-container, #f2fbd8); color: var(--mer-c-brand-800); }
.badge-medal svg { width: 17px; height: 17px; }

.skill-row { display: flex; flex-wrap: wrap; gap: 7px; }
.skill-chip { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; background: var(--mer-c-brand-50, #eef0f8); color: var(--mer-c-brand-800); font-size: 12.5px; font-weight: 600; border: 1px solid var(--mer-c-brand-100, #e2e5f4); }

.folio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.folio-card { background: var(--mer-surface, #fff); border: 1px solid var(--mer-line, #e7e9f0); border-radius: 14px; overflow: hidden; transition: transform .14s ease, box-shadow .14s ease; }
.folio-card:hover { transform: translateY(-2px); box-shadow: var(--mer-shadow-2, 0 8px 24px rgba(16,20,32,.12)); }
.folio-cover { aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; }
.folio-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.folio-mono { font-size: 42px; font-weight: 800; color: rgba(255,255,255,.85); font-family: var(--mer-font-display, inherit); }
.folio-body { padding: 12px 13px 11px; }
.folio-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.folio-tags span { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--mer-c-brand-50, #eef0f8); color: var(--mer-c-brand-700); }
.folio-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.folio-pick { display: flex; align-items: center; gap: 10px; }
.folio-pick-prev { width: 84px; height: 63px; border-radius: 8px; border: 1px solid var(--mer-line, #e7e9f0); background: var(--mer-surface-2, #f7f8fb); display: grid; place-items: center; font-size: 11px; color: var(--mer-text-faint); overflow: hidden; }
.folio-pick-prev img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 900px) {
  .opp-grid { grid-template-columns: 1fr; }
  .opp-meta { position: static; }
  .opp-hero { padding: 22px 18px; }
  .opp-hero h1 { font-size: 21px; }
  .opp-hero-act { align-items: flex-start; }
}
@media (max-width: 560px) {
  .bg-2col { grid-template-columns: 1fr; }
  .folio-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ─── Events — deliberately spare cards ──────────────────────────────── */

.ev-list { display: flex; flex-direction: column; gap: 10px; }
.ev-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  cursor: pointer; transition: box-shadow .15s ease;
}
.ev-card:hover { box-shadow: var(--mer-shadow-2); }
.ev-cancelled { opacity: .62; }
.ev-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 52px; height: 56px; border-radius: var(--mer-radius-lg);
  background: var(--mer-primary-tint); color: var(--mer-primary); flex: none;
}
.ev-date-m { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ev-date-d { font-size: 20px; font-weight: 700; line-height: 1.1; }
.ev-body { flex: 1; min-width: 0; }
.ev-title { font-weight: 600; font-size: 14.5px; margin-bottom: 2px; }
.ev-meta { color: var(--mer-text-muted); font-size: 12.5px; display: flex; gap: 5px; flex-wrap: wrap; }
.ev-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ev-act { display: flex; flex-direction: column; gap: 6px; flex: none; }
.ev-page-head { display: flex; justify-content: space-between; gap: 12px; }
.ev-facts { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; font-size: 13.5px; }
.ev-facts > div { display: flex; align-items: center; gap: 8px; }
.ev-facts svg { width: 16px; height: 16px; color: var(--mer-text-muted); flex: none; }
.ev-page-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 560px) {
  .ev-card { flex-wrap: wrap; }
  .ev-act { flex-direction: row; width: 100%; }
  .ev-act .btn { flex: 1; }
}
