/* Self-hosted Inter, variable 100–900 (SIL Open Font License, see public/fonts/Inter-OFL.txt).
   One family does everything, as in the Wise-inspired system (DESIGN.md): weight 900 for
   display headlines, 600 for headings, labels and buttons, 400 for body. Split into Latin
   (preloaded in index.html) and Latin-Extended (only fetched when a page shows e.g. ₹). */
@font-face { font-family: "Inter"; src: url("/fonts/Inter-Latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter-LatinExt.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* JG Antony family type (jgantony.com): Outfit for text and labels, Fraunces for display
   headlines. Both variable, self-hosted (SIL OFL, see Outfit-OFL.txt and Fraunces-OFL.txt). */
@font-face { font-family: "Outfit"; src: url("/fonts/Outfit-Latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Outfit"; src: url("/fonts/Outfit-LatinExt.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Bricolage Grotesque: the "Bold" headline choice in the font picker (theme.js); only fetched when chosen. */
@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/BricolageGrotesque-Latin.woff2") format("woff2"); font-weight: 200 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; src: url("/fonts/Fraunces-Latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* =====================================================================
   Design scales (audit, 19 Oct 2026). Every size, gap and corner in this
   file snaps to one of these steps; the theme blocks below only set colour.
     Type    11 · 12 · 13 · 14 · 16 · 18 · 20 · 24 · 30 · 38 · 48 px
     Space   1 · 2 · 4 · 6 · 8 · 12 · 16 · 20 · 24 · 32 · 40 · 48 · 64 px
     Radius  6 · 10 · 14 · 18 · 24 · 28 px, pill
   ===================================================================== */
:root {
  --fs-2xs: 0.6875rem;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;
  --fs-4xl: 2.375rem;
  --fs-5xl: 3rem;

  --lh-display: 1.05;
  --lh-heading: 1.15;
  --lh-snug: 1.3;
  --lh-body: 1.55;

  --tr-display: -0.03em;
  --tr-heading: -0.015em;
  --tr-label: 0.04em;
  --tr-caps: 0.08em;

  --sp-px: 1px;
  --sp-0-5: 2px;
  --sp-1: 4px;
  --sp-1-5: 6px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 28px;
  --r-pill: 999px;
}

/* Capital Commons palette: warm cream (60%), sage (30%: header, tab bar, selected states) and
   soft terracotta (10%: only things to click). Text is deep forest green.
   Contrast-checked: forest text on terracotta 4.68:1, on sage 4.51:1, on cream 11:1.
   White text is never used on terracotta or sage (both fail). Link-coloured terracotta
   text uses the deeper #A85A2A (4.76:1 on cream).
   The older token names (navy, gold, coral, …) are kept so every screen picks this up. */
:root {
  --ink: #2F3B2F;
  --cream: #FDF8EC;
  --coral: #E0915A;          /* soft terracotta: buttons, highlights */
  --coral-2: #EDB183;        /* lighter terracotta for gradients */
  --coral-text: #A85A2A;     /* terracotta for text and links */
  --coral-soft: #F8E4D3;
  --on-accent: #2F3B2F;      /* text on terracotta fills */
  --sage-fill: #93A77E;      /* header, tab bar */
  --sage-fill-2: #9DB5A0;    /* misty sage: tags, borders, hover */
  --on-sage: #2F3B2F;
  --butter: #E9C88F;
  --butter-soft: #F6EEDC;
  --sage: #4E6B41;           /* sage for text (approved, online) */
  --sage-soft: #DCE6D2;
  --lilac: #9DB5A0;
  --lilac-soft: #E3ECE3;
  --sky-soft: #E8EFE3;
  --status-pending: #F3C9A6;
  --status-pending-text: #7A3E18;
  --status-rejected: #F6DCDC;
  --status-rejected-text: #7A2E2E;
  --status-approved-text: #2F4A2F;

  --navy: var(--ink);
  --navy-2: #46553F;
  --gold: var(--coral);
  --gold-text: var(--coral-text);
  --gold-soft: var(--coral-soft);
  --green: var(--sage);
  --green-soft: var(--sage-soft);
  --red: #9E3B37;
  --red-soft: #F6DCDC;
  --bg: #FDF8EC;
  --panel: #FFFCF5;
  --sidebar: #FBF4E4;
  --hover: #F3EAD6;
  --accent: var(--coral);
  --accent-2: var(--coral);
  --accent-text: var(--on-accent);
  --text: var(--ink);
  --muted: #5E6352;
  --border: #E5DAC3;
  --mine: #F8E4D3;
  --danger: var(--red);
  --ok: var(--sage);
  --like: #C2453A;
  --chart-1: var(--ink);
  --chart-2: var(--coral);
  --chart-3: var(--sage-fill);
  --chart-4: var(--sage-fill-2);
  --radius: 20px;
  --shadow: 0 1px 2px rgba(47, 59, 47, 0.05), 0 8px 24px rgba(47, 59, 47, 0.07);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #EEF0E3;
    --coral: #E0915A;
    --coral-2: #E9A97A;
    --coral-text: #F0AE80;
    --coral-soft: #3F2B1E;
    --on-accent: #1F261E;
    --sage-fill: #3E4B36;
    --sage-fill-2: #55664C;
    --on-sage: #EEF0E3;
    --butter: #CFAE6A;
    --butter-soft: #35301F;
    --sage: #A9C394;
    --sage-soft: #253020;
    --lilac: #9DB5A0;
    --lilac-soft: #26302A;
    --sky-soft: #232C25;
    --status-pending: #4A3322;
    --status-pending-text: #F3C9A6;
    --status-rejected: #3F2424;
    --status-rejected-text: #F0BDBD;
    --status-approved-text: #C9DDB8;
    --navy: #2B3326;
    --navy-2: #3A4533;
    --red: #E59A97;
    --red-soft: #3A2020;
    --bg: #1A1D16;
    --panel: #22261D;
    --sidebar: #1E2219;
    --hover: #2C3226;
    --muted: #B3B8A4;
    --border: #353C2D;
    --mine: #3F2B1E;
    --chart-1: #E6E9DA;
    --chart-4: #5C6852;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-md); }
.strong { font-weight: 640; }
.center { text-align: center; padding: var(--sp-8) var(--sp-4); }
.push { margin-left: auto; }

.brand {
  font-weight: 800;
  font-size: var(--fs-2xl);
  letter-spacing: var(--tr-display);
  color: var(--text);
  margin: 0;
}
.brand .star { color: var(--coral); margin-right: 0.08em; font-size: 0.9em; }
.brand .dot { color: var(--coral); }

/* ---------- buttons & inputs ---------- */

.primary {
  background: var(--accent);
  color: var(--accent-text);
  border: 0;
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-4);
  font-weight: 580;
}
.primary:hover { filter: brightness(1.08); }
.primary:disabled { opacity: 0.6; cursor: default; }
.ghost {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-4);
}
.ghost:hover { background: var(--hover); }
.primary.small, .ghost.small { padding: var(--sp-1) var(--sp-3); font-size: var(--fs-md); }
.danger { color: var(--danger); }
.wide { display: block; width: 100%; margin: var(--sp-4) 0; }
.link { background: none; border: 0; padding: 0; color: var(--accent); }
.link.muted { color: var(--muted); }
.user-link { background: none; border: 0; padding: 0; color: inherit; }
.user-link:hover { text-decoration: underline; }
.icon-btn {
  background: none;
  border: 0;
  border-radius: var(--r-xs);
  width: 1.9rem;
  height: 1.9rem;
  font-size: var(--fs-lg);
  line-height: var(--lh-display);
}
.icon-btn:hover { background: var(--hover); }

input, textarea, select {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; }
label { display: grid; gap: var(--sp-1); font-weight: 580; font-size: var(--fs-md); }
label.check { display: flex; align-items: center; gap: var(--sp-2); font-weight: 400; }
label.check input { width: auto; }

.pick-btn {
  display: inline-flex;
  align-items: center;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-4);
  cursor: pointer;
  font-weight: 580;
}
.pick-btn:hover { background: var(--hover); }

.pill {
  font-size: var(--fs-xs);
  font-weight: 640;
  border-radius: var(--r-pill);
  padding: var(--sp-px) var(--sp-2);
  background: var(--hover);
  color: var(--muted);
}

/* ---------- avatars ---------- */

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  font-weight: 640;
  color: #fff;
  background: hsl(var(--h, 330) 55% 50%);
}
.avatar.xs { width: 22px; height: 22px; font-size: var(--fs-2xs); }
.avatar.sm { width: 32px; height: 32px; font-size: var(--fs-md); }
.avatar.md { width: 40px; height: 40px; }
.avatar.lg { width: 72px; height: 72px; font-size: var(--fs-2xl); }
.avatar.xl { width: 112px; height: 112px; font-size: var(--fs-4xl); box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--accent); }

.presence-wrap { position: relative; display: inline-flex; }
.presence {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok);
  border: 2px solid var(--sidebar);
}

/* ---------- auth ---------- */

.auth { min-height: 100%; display: grid; place-items: center; padding: var(--sp-4); }
.auth-card {
  width: min(400px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  box-shadow: var(--shadow);
}
.auth-card > p { margin: var(--sp-1) 0 var(--sp-6); }
.auth-form { display: grid; gap: var(--sp-3); }
.auth-form h2 { font-size: var(--fs-lg); }
.auth-form p { margin: 0; }
.auth-form .primary { margin-top: var(--sp-1-5); padding: var(--sp-3); }
.form-error { color: var(--danger); margin: var(--sp-3) 0 0; min-height: 1.2em; }

/* ---------- layout ---------- */

.app { display: grid; grid-template-columns: 270px 1fr; height: 100%; }

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--sp-4) var(--sp-3);
  overflow-y: auto;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--sp-2) var(--sp-4); }
.conn { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--muted); }
.conn.ok { background: var(--ok); }
.conn.bad { background: var(--danger); }

.main-nav { display: grid; gap: var(--sp-0-5); margin-bottom: var(--sp-2); }
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-2);
  text-align: left;
  font-weight: 580;
}
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--hover); color: var(--accent); }
.nav-icon { width: 22px; display: inline-grid; place-items: center; font-size: var(--fs-xl); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-4) var(--sp-2) var(--sp-1);
  font-size: var(--fs-xs);
  font-weight: 640;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: var(--tr-label);
}

.conv-list { list-style: none; margin: 0; padding: 0; }
.conv-list .empty { padding: var(--sp-1) var(--sp-2); font-size: var(--fs-md); }
.conv {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  padding: var(--sp-1-5) var(--sp-2);
  text-align: left;
  color: var(--muted);
}
.conv:hover { background: var(--hover); }
.conv.active { background: var(--accent); color: var(--accent-text); }
.conv.has-unread { color: var(--text); font-weight: 640; }
.conv.active.has-unread { color: var(--accent-text); }
.conv-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  padding: 0 var(--sp-2);
  font-weight: 640;
}
.conv.active .badge { background: #fff; color: var(--accent); }

.sidebar-foot { margin-top: auto; padding-top: var(--sp-4); display: grid; gap: var(--sp-0-5); }
.foot-btn {
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  text-align: left;
  padding: var(--sp-2) var(--sp-2);
  color: var(--muted);
}
.foot-btn:hover { background: var(--hover); color: var(--text); }
#invite-btn { color: var(--accent); font-weight: 580; }

.scrim { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100%; position: relative; }
.topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  min-height: 56px;
}
.topbar h2 { font-size: var(--fs-lg); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-actions { display: flex; align-items: center; gap: var(--sp-2); }
.menu-btn { display: none; }

.view { flex: 1; min-height: 0; }
.scroll { overflow-y: auto; }
.column { width: min(560px, 100%); margin: 0 auto; padding: var(--sp-5) var(--sp-4) var(--sp-8); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
}

/* ---------- feed ---------- */

.composer-card { padding: var(--sp-4); display: grid; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.composer-row { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.composer-row .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-preview { width: 100%; max-height: 420px; object-fit: contain; border-radius: var(--r-sm); background: var(--bg); }
.composer-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); }

.post-list { display: grid; gap: var(--sp-5); }
.post { overflow: hidden; }
.post-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); }
.post-media { position: relative; background: var(--bg); user-select: none; }
.post-img { display: block; width: 100%; max-height: 640px; object-fit: contain; }
.burst {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 6rem;
  color: #fff;
  text-shadow: 0 2px 18px rgba(4, 20, 12, 0.35);
  opacity: 0;
  pointer-events: none;
}
.burst.go { animation: burst 0.8s ease-out; }
@keyframes burst {
  0% { opacity: 0; transform: scale(0.4); }
  20% { opacity: 1; transform: scale(1.1); }
  40% { transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .burst.go { animation-duration: 0.01s; } }

.post-body { padding: var(--sp-2) var(--sp-4) var(--sp-3); display: grid; gap: var(--sp-1); }
.post-actions { display: flex; gap: var(--sp-1); margin-left: -0.4rem; }
.icon-action {
  background: none;
  border: 0;
  font-size: var(--fs-2xl);
  line-height: var(--lh-display);
  padding: var(--sp-1) var(--sp-1-5);
  border-radius: var(--r-sm);
}
.icon-action:hover { background: var(--hover); }
.caption { margin: 0; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-0-5); font-size: var(--fs-md); }
.comment-form { display: flex; gap: var(--sp-2); border-top: 1px solid var(--border); margin-top: var(--sp-1-5); padding-top: var(--sp-2); }
.comment-form input { border: 0; padding: var(--sp-1) 0; background: none; }
.comment-form input:focus { outline: none; }

/* ---------- profile ---------- */

.profile-head { display: flex; gap: var(--sp-6); align-items: center; padding: var(--sp-2) 0 var(--sp-6); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-4); }
.profile-info { display: grid; gap: var(--sp-1-5); min-width: 0; }
.profile-title { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.profile-title h3 { font-size: var(--fs-xl); overflow-wrap: anywhere; }
.profile-info p { margin: 0; }
.bio { white-space: pre-wrap; overflow-wrap: anywhere; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-1); }
.thumb {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: var(--hover);
  overflow: hidden;
  border-radius: var(--r-xs);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-stats {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-weight: 640;
  white-space: pre;
  opacity: 0;
  transition: opacity 0.15s;
}
.thumb:hover .thumb-stats, .thumb:focus-visible .thumb-stats { opacity: 1; }

/* ---------- chat ---------- */

.chat { display: flex; flex-direction: column; background: var(--panel); }
.messages { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: var(--sp-4) var(--sp-5); }
.empty-state { text-align: center; padding: var(--sp-12) var(--sp-4); }
.day-sep {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin: var(--sp-4) 0 var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.day-sep::before, .day-sep::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.msg { padding: var(--sp-1) var(--sp-2); border-radius: var(--r-sm); margin-top: var(--sp-2); }
.msg.grouped { margin-top: 0; }
.msg:hover { background: var(--bg); }
.msg.mine { background: var(--mine); }
.msg-head { display: flex; gap: var(--sp-2); align-items: center; }
.msg-head time { font-size: var(--fs-xs); color: var(--muted); }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; padding-left: calc(22px + 0.5rem); }
.typing { min-height: 1.4rem; padding: 0 var(--sp-5); font-size: var(--fs-sm); }
.composer { display: flex; gap: var(--sp-2); padding: 0 var(--sp-5) var(--sp-4); align-items: flex-end; }
.composer textarea { flex: 1; resize: none; max-height: 160px; }

/* ---------- dialogs & toast ---------- */

dialog {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text);
  padding: var(--sp-5);
  width: min(440px, calc(100vw - 32px));
  box-shadow: 0 20px 60px rgba(4, 20, 12, 0.25);
}
dialog::backdrop { background: rgba(3, 12, 8, 0.5); }
dialog form, dialog { display: grid; gap: var(--sp-4); }
dialog:not([open]) { display: none; }
dialog p { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); }
.post-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.post-dialog .card { box-shadow: none; }

.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); max-height: 50vh; overflow-y: auto; }
.invite { display: grid; gap: var(--sp-1-5); }
.warning {
  border: 1px solid var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
}
.invite input { font-size: var(--fs-sm); }
.row { display: flex; align-items: center; gap: var(--sp-2); }
.row .muted { flex: 1; }
.member { display: flex; align-items: center; gap: var(--sp-2); }
.avatar-edit { display: flex; align-items: center; gap: var(--sp-4); }

.toast {
  position: absolute;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--panel);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  max-width: calc(100% - 32px);
  z-index: 30;
}

/* ---------- notifications ---------- */

.bell-wrap { position: relative; }
.bell { position: relative; width: 2.3rem; height: 2.3rem; font-size: var(--fs-xl); }
.bell:hover { background: var(--hover); }
.bell-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 var(--sp-1);
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: var(--fs-2xs);
  font-weight: 720;
  line-height: 1.15rem;
  text-align: center;
  box-shadow: 0 0 0 2px var(--panel);
}
.bell.ring .bell-icon { display: inline-block; animation: ring 0.9s ease-in-out; transform-origin: 50% 0; }
@keyframes ring {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(18deg); }
  30% { transform: rotate(-16deg); }
  45% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  75% { transform: rotate(4deg); }
}

.notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(380px, calc(100vw - 32px));
  max-height: min(520px, 75vh);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 18px 50px rgba(4, 20, 12, 0.22);
  z-index: 40;
  overflow: hidden;
  transform-origin: top right;
}
.notif-panel.open { animation: panel-in 0.18s ease-out; }
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }
.notif-head, .notif-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
}
.notif-head { border-bottom: 1px solid var(--border); }
.notif-head h3 { font-size: var(--fs-base); }
.notif-foot { border-top: 1px solid var(--border); }
.notif-list { list-style: none; margin: 0; padding: var(--sp-1); overflow-y: auto; flex: 1; }
.notif-empty { padding: var(--sp-6) var(--sp-4); text-align: center; }
.notif {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-2);
  text-align: left;
  position: relative;
}
.notif:hover { background: var(--hover); }
.notif.unread { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.notif.unread::after {
  content: "";
  position: absolute;
  right: 0.55rem;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent);
}
.notif-text { flex: 1; min-width: 0; font-size: var(--fs-md); overflow-wrap: anywhere; }
.notif.unread .notif-text { padding-right: var(--sp-4); }
.notif-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: var(--r-xs); flex: none; }

/* Pop-up notification cards */
.toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  display: grid;
  gap: var(--sp-2);
  z-index: 60;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.ntoast {
  position: relative;
  display: flex;
  align-items: stretch;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: 0 12px 34px rgba(4, 20, 12, 0.2);
  overflow: hidden;
  pointer-events: auto;
  animation: toast-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.ntoast.leaving { animation: toast-out 0.25s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(110%) scale(0.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(110%); } }
.ntoast-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: none;
  border: 0;
  padding: var(--sp-3) var(--sp-1-5) var(--sp-3) var(--sp-3);
  text-align: left;
  min-width: 0;
}
.ntoast-close { background: none; border: 0; color: var(--muted); font-size: var(--fs-xl); padding: 0 var(--sp-3); }
.ntoast-close:hover { color: var(--text); }
.ntoast-timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: left;
  animation: drain var(--life, 5s) linear forwards;
}
.ntoast:hover .ntoast-timer { animation-play-state: paused; }
@keyframes drain { to { transform: scaleX(0); } }

/* ---------- reactions & mentions ---------- */

.msg { position: relative; }
.reactions { display: flex; flex-wrap: wrap; gap: var(--sp-1); padding-left: calc(22px + 0.5rem); }
.reactions:empty { display: none; }
.reactions { margin-top: var(--sp-1); }
.reaction {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: var(--hover);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: var(--sp-px) var(--sp-2);
  font-size: var(--fs-md);
}
.reaction:hover { border-color: var(--border); }
.reaction.mine { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: var(--accent); }
.reaction .count { font-size: var(--fs-xs); font-weight: 640; }
.reaction.pop { animation: pop 0.35s cubic-bezier(0.3, 1.8, 0.5, 1); }

.react-bar {
  position: absolute;
  right: 0.6rem;
  top: -1.1rem;
  display: flex;
  gap: var(--sp-0-5);
  padding: var(--sp-1);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(4px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.12s, transform 0.12s;
  z-index: 2;
}
.msg:hover .react-bar, .msg:focus-within .react-bar, .msg.show-react .react-bar {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.react-bar button {
  background: none;
  border: 0;
  border-radius: 50%;
  width: 1.9rem;
  height: 1.9rem;
  font-size: var(--fs-base);
  transition: transform 0.12s;
}
.react-bar button:hover { transform: scale(1.3) translateY(-2px); background: var(--hover); }

.mention {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border: 0;
  border-radius: var(--r-xs);
  padding: 0 var(--sp-1);
  font-weight: 580;
}
.mention:hover { text-decoration: underline; }
.mention.me { background: color-mix(in srgb, var(--accent-2) 22%, transparent); color: inherit; }
.msg.mentions-me { box-shadow: inset 3px 0 0 var(--accent-2); background: color-mix(in srgb, var(--accent-2) 7%, transparent); }

.composer { position: relative; }
.mention-pop {
  position: absolute;
  left: 1.2rem;
  bottom: calc(100% + 4px);
  list-style: none;
  margin: 0;
  padding: var(--sp-1);
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: 0 10px 30px rgba(4, 20, 12, 0.18);
  z-index: 5;
  animation: panel-in 0.12s ease-out;
}
.mention-pop li { display: flex; align-items: center; gap: var(--sp-1-5); padding: var(--sp-1-5) var(--sp-2); border-radius: var(--r-xs); cursor: pointer; }
.mention-pop li.active, .mention-pop li:hover { background: var(--hover); }

/* ---------- motion ---------- */

@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.pop { animation: pop 0.35s cubic-bezier(0.3, 1.8, 0.5, 1); }

.like { position: relative; }
.like .glyph { display: inline-block; }
.like.liked { color: var(--like); }
.like.pop .glyph { animation: like-pop 0.45s cubic-bezier(0.3, 1.8, 0.5, 1); }
@keyframes like-pop {
  0% { transform: scale(1); }
  30% { transform: scale(0.7); }
  60% { transform: scale(1.45); }
  100% { transform: scale(1); }
}
.particle {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: var(--fs-xs);
  color: var(--like);
  pointer-events: none;
  animation: particle 0.7s ease-out forwards;
}
@keyframes particle {
  from { opacity: 1; transform: translate(-50%, -50%) scale(0.6); }
  to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) scale(1.1); }
}
.likes-count { display: inline-block; }
.bump { animation: bump 0.3s ease-out; }
@keyframes bump {
  0% { transform: translateY(0); }
  40% { transform: translateY(-3px); color: var(--like); }
  100% { transform: translateY(0); }
}

.post.enter, .thumb.enter { animation: post-in 0.55s cubic-bezier(0.2, 1, 0.3, 1); }
@keyframes post-in {
  from { opacity: 0; transform: translateY(-14px) scale(0.98); box-shadow: 0 0 0 3px var(--accent); }
  60% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); }
}
.post.leaving, .thumb.leaving { animation: post-out 0.3s ease-in forwards; }
@keyframes post-out { to { opacity: 0; transform: scale(0.96); } }
.post-preview.enter { animation: fade-up 0.3s ease-out; }
.comments li.enter { animation: fade-up 0.35s ease-out; }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }

.msg.enter { animation: msg-in 0.3s cubic-bezier(0.2, 1, 0.3, 1); }
.msg.sent { animation: msg-sent 0.35s cubic-bezier(0.2, 1.3, 0.4, 1); transform-origin: bottom right; }
@keyframes msg-in { from { opacity: 0; transform: translateX(-10px); } }
@keyframes msg-sent { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
.send-btn.fly { animation: fly 0.35s ease-out; }
@keyframes fly {
  0% { transform: translateX(0); }
  40% { transform: translateX(4px) translateY(-2px); }
  100% { transform: translateX(0); }
}

.badge.pop, .bell-badge.pop { animation: pop 0.4s cubic-bezier(0.3, 1.8, 0.5, 1); }

.presence { animation: presence 2.4s ease-out infinite; }
@keyframes presence {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 6px transparent; }
}

.typing { display: flex; align-items: center; gap: var(--sp-2); }
.typing-dots, .loading-dots { display: inline-flex; gap: var(--sp-1); }
.typing-dots span, .loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: dot 1.1s infinite ease-in-out;
}
.typing-dots span:nth-child(2), .loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3), .loading-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}
.loading-dots { display: flex; justify-content: center; padding: var(--sp-8); list-style: none; }

.wave { font-size: var(--fs-4xl); display: inline-block; margin-bottom: var(--sp-2); animation: wave 1.6s ease-in-out 2; transform-origin: 70% 70%; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(16deg); }
  20%, 40% { transform: rotate(-10deg); }
}
.empty-state { display: grid; justify-items: center; }

.thumb img { transition: transform 0.25s ease; }
.thumb:hover img { transform: scale(1.06); }
.primary { transition: transform 0.1s, filter 0.15s; }
.primary:active { transform: scale(0.96); }
.icon-action { transition: transform 0.1s; }
.icon-action:active { transform: scale(0.85); }

.new-posts-pill {
  position: sticky;
  top: 0.8rem;
  display: block;
  margin: 0 auto -2.4rem;
  z-index: 5;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  border: 0;
  border-radius: var(--r-pill);
  padding: var(--sp-2) var(--sp-4);
  font-weight: 640;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--coral) 40%, transparent);
}

/* Skeleton loading */
.skeleton { pointer-events: none; }
.sk {
  display: block;
  background: linear-gradient(90deg, var(--hover) 25%, color-mix(in srgb, var(--hover) 40%, var(--panel)) 50%, var(--hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: var(--r-xs);
}
.sk-circle { width: 32px; height: 32px; border-radius: 50%; }
.sk-line { height: 0.8rem; width: 70%; }
.sk-line.short { width: 35%; }
.sk-media { aspect-ratio: 1; border-radius: 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- learning platform ---------- */

.column.wide { width: min(760px, 100%); }
.page-title { font-size: var(--fs-3xl); font-weight: 720; letter-spacing: var(--tr-heading); margin: var(--sp-1) 0 var(--sp-1-5); }
.kicker { font-size: var(--fs-sm); font-weight: 640; color: var(--gold-text); margin: 0; }
.lead { font-size: var(--fs-base); }
.grow { flex: 1; min-width: 0; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin: var(--sp-6) 0 var(--sp-3); }
.section-row h2 { font-size: var(--fs-xl); font-weight: 720; }
.row-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3); }
.row-2, .row-3 { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, 1fr); }
.row-3 { grid-template-columns: 2fr 1fr 1fr; }
.list { display: grid; gap: var(--sp-2); }
.list-item { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); text-align: left; width: 100%; }
.card.list-item:hover, .qa-item:hover, .continue:hover, .stat:hover { border-color: var(--gold); }
.info { border: 1px solid var(--border); background: var(--hover); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); margin: 0; }
.info.ok { background: var(--green-soft); border-color: var(--green); }
.ok-text { color: var(--green); font-weight: 640; }
.bad { color: var(--red); font-weight: 580; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--fs-md); }

.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--red-soft); color: var(--red); }
.pill.wait, .pill.draft { background: var(--gold-soft); color: var(--gold-text); }
.pill.mentor, .role-mentor { background: var(--gold-soft); color: var(--gold-text); }
.role-admin { background: var(--navy); color: #fff; }
.role-moderator { background: var(--green-soft); color: var(--green); }
.level-pill { background: var(--hover); color: var(--text); }
.soon-pill { margin-left: auto; font-size: var(--fs-2xs); font-weight: 720; text-transform: uppercase; letter-spacing: var(--tr-label); color: var(--gold-text); background: var(--gold-soft); border-radius: var(--r-pill); padding: var(--sp-px) var(--sp-2); }
.role-select { width: auto; padding: var(--sp-1) var(--sp-1-5); font-size: var(--fs-md); }

.chips { display: flex; gap: var(--sp-1-5); flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--panel); border-radius: var(--r-pill); padding: var(--sp-1) var(--sp-3); font-weight: 580; font-size: var(--fs-md); }
.chip.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-text); }
.filters { display: flex; gap: var(--sp-2); margin: var(--sp-3) 0 var(--sp-4); }
.filters select { width: auto; }

/* Home */
.hero {
  background: var(--navy);
  color: #fff;
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-4);
}
.hero h1 { font-size: var(--fs-2xl); font-weight: 720; margin: var(--sp-1) 0 var(--sp-3); }
.hero-kicker { margin: 0; color: var(--gold); font-weight: 640; font-size: var(--fs-md); }
.loop { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-weight: 580; font-size: var(--fs-md); }
.loop span { display: inline-flex; align-items: center; gap: var(--sp-1-5); background: var(--navy-2); border-radius: var(--r-pill); padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-1); }
.loop b { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--gold); color: #16213a; font-size: var(--fs-xs); }
.loop i { color: #8c9bb0; font-style: normal; }

.continue { display: flex; align-items: center; gap: var(--sp-4); width: 100%; padding: var(--sp-4) var(--sp-4); text-align: left; }
.continue-text { flex: 1; display: grid; gap: var(--sp-0-5); min-width: 0; }
.continue-text .kicker { color: var(--muted); }
.continue-text strong { font-size: var(--fs-lg); font-weight: 720; }
.chev { font-size: var(--fs-3xl); color: var(--muted); }
.ring-wrap { position: relative; width: 64px; height: 64px; flex: none; }
.ring { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-track { stroke: var(--hover); }
.ring-fill { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 720; font-size: var(--fs-md); }

.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-top: var(--sp-3); }
.stat { display: grid; gap: var(--sp-0-5); text-align: left; padding: var(--sp-4) var(--sp-4); }
.stat.streak { background: var(--gold-soft); border-color: transparent; }
.stat-label { font-size: var(--fs-sm); font-weight: 640; color: var(--gold-text); }
.stat:not(.streak) .stat-label { color: var(--muted); }
.stat-value { font-size: var(--fs-2xl); font-weight: 720; }
.stat-sub { font-size: var(--fs-xs); color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-2); }
.stat-grid > div { display: grid; gap: var(--sp-0-5); }
.stat-grid .stat-label { color: var(--muted); }
.stat-grid strong { font-size: var(--fs-lg); }

/* Q&A */
.qa-list { display: grid; gap: var(--sp-3); }
.qa-item { display: flex; gap: var(--sp-4); text-align: left; padding: var(--sp-4) var(--sp-4); width: 100%; align-items: flex-start; }
.qa-list.compact .qa-item { padding: var(--sp-3) var(--sp-4); }
.votes { display: grid; justify-items: center; min-width: 2.6rem; }
.votes strong { font-size: var(--fs-lg); }
.qa-main { display: grid; gap: var(--sp-1); min-width: 0; }
.qa-kicker { font-size: var(--fs-xs); font-weight: 640; color: var(--muted); }
.qa-title { font-size: var(--fs-base); overflow-wrap: anywhere; }
.qa-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1-5); }
.question-full, .answer { padding: var(--sp-4) var(--sp-4); margin-top: var(--sp-3); }
.q-head { display: flex; gap: var(--sp-4); align-items: flex-start; }
.q-title { font-size: var(--fs-xl); font-weight: 720; margin: var(--sp-1) 0; overflow-wrap: anywhere; }
.answers-title { font-size: var(--fs-base); margin: var(--sp-6) 0 0; }
.answer.reviewed { border-color: var(--green); box-shadow: inset 4px 0 0 var(--green); }
.reviewed-tag { color: var(--green); font-weight: 640; margin: var(--sp-1) 0; }
.answer-form { padding: var(--sp-4) var(--sp-4); margin-top: var(--sp-5); display: grid; gap: var(--sp-2); }
.answer-form h2 { font-size: var(--fs-base); }
.vote {
  display: grid;
  justify-items: center;
  gap: var(--sp-0-5);
  min-width: 2.8rem;
  padding: var(--sp-1-5) var(--sp-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--panel);
}
.vote.on { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-text); }
.vote:disabled { opacity: 0.55; cursor: default; }
.prose p { margin: 0 0 var(--sp-3); }
.prose ul, .prose ol { margin: 0 0 var(--sp-3); padding-left: var(--sp-5); }
.prose li { margin: var(--sp-1) 0; }
.community { margin-top: var(--sp-1-5); }

/* Learning path */
.path { list-style: none; margin: var(--sp-6) 0 0; padding: 0; position: relative; }
.level { display: flex; gap: var(--sp-4); position: relative; padding-bottom: var(--sp-6); }
.level::before { content: ""; position: absolute; left: 21px; top: 44px; bottom: 0; width: 3px; background: var(--border); }
.level.complete::before { background: var(--green); }
.level:last-child::before { display: none; }
.marker {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 720;
  font-size: var(--fs-lg);
  background: var(--hover);
  color: var(--muted);
  z-index: 1;
}
.marker.complete { background: var(--green); color: #fff; }
.marker.in-progress { background: var(--gold); color: #16213a; box-shadow: 0 0 0 5px var(--gold-soft); }
.marker.coming { background: var(--navy); color: var(--gold); }
.level-body { flex: 1; min-width: 0; padding-top: var(--sp-0-5); }
.level-body h3 { font-size: var(--fs-lg); font-weight: 720; margin: var(--sp-0-5) 0; }
.level-body > p { margin: var(--sp-0-5) 0 var(--sp-1-5); }
.level-status { font-size: var(--fs-sm); font-weight: 640; color: var(--muted); }
.level-status.complete { color: var(--green); }
.level-status.in-progress { color: var(--gold-text); }
.lesson-list { margin-top: var(--sp-2); padding: var(--sp-1) var(--sp-4); }
.lesson-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.lesson-row:last-child { border-bottom: 0; }
.lesson-row:disabled { color: var(--muted); cursor: default; }
.lesson-row.next { font-weight: 720; }
.lesson-state { font-weight: 640; font-size: var(--fs-md); color: var(--muted); white-space: nowrap; }
.lesson-row.done .lesson-state { color: var(--green); }
.lesson-row.next .lesson-state { color: var(--gold-text); }
.lesson-row .pill { margin-left: var(--sp-1-5); }
.task-row b { color: var(--gold-text); }

/* Lesson */
.lesson-top { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.lesson-progress { flex: 1; display: grid; gap: var(--sp-1); }
.bar-track { height: 6px; border-radius: var(--r-pill); background: var(--hover); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--gold); border-radius: inherit; transition: width 0.6s ease; }
.mins { font-weight: 640; color: var(--gold-text); font-size: var(--fs-md); white-space: nowrap; }
.lesson-title { font-size: var(--fs-3xl); font-weight: 720; letter-spacing: var(--tr-heading); margin: var(--sp-1) 0 var(--sp-3); line-height: var(--lh-heading); }
.prose.lead { font-size: var(--fs-base); }
.lang { margin-bottom: var(--sp-2); }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; margin: var(--sp-4) 0; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.example { padding: var(--sp-4) var(--sp-4); margin: var(--sp-5) 0; }
.example h2, .quiz h2, .practice h2, .lesson-thread h2 { font-size: var(--fs-lg); font-weight: 720; margin-bottom: var(--sp-2); }

.chart-card { margin: var(--sp-3) 0 0; background: var(--hover); border-radius: var(--r-md); padding: var(--sp-4) var(--sp-4) var(--sp-1-5); }
.chart-card figcaption { display: flex; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; font-size: var(--fs-md); margin-bottom: var(--sp-1-5); }
.legend { display: flex; gap: var(--sp-3); flex-wrap: wrap; font-size: var(--fs-sm); }
.legend span { display: inline-flex; align-items: center; gap: var(--sp-1); }
.sw { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: var(--r-xs); }
.sw.s0 { background: var(--chart-1); }
.sw.s1 { background: var(--chart-2); }
.sw.s2 { background: var(--chart-3); }
.sw.s3 { background: var(--chart-4); }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: grow 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: var(--d, 0ms); }
.chart .bar.neg { transform-origin: top; }
.chart .bar.s0 { fill: var(--chart-1); }
.chart .bar.s1 { fill: var(--chart-2); }
.chart .bar.s2 { fill: var(--chart-3); }
.chart .bar.s3 { fill: var(--chart-4); }
.chart .axis { stroke: var(--muted); stroke-width: 1; opacity: 0.5; }
.chart .tick { fill: var(--muted); font-size: var(--fs-2xs); }
.chart .val { fill: var(--text); font-size: var(--fs-2xs); font-weight: 640; }
@keyframes grow { from { transform: scaleY(0); } }

.quiz { margin-top: var(--sp-6); }
.question { padding: var(--sp-4) var(--sp-4); margin-bottom: var(--sp-3); }
.prompt { font-weight: 720; font-size: var(--fs-base); margin: 0 0 var(--sp-3); display: flex; gap: var(--sp-2); }
.qnum { flex: none; display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--navy); color: #fff; font-size: var(--fs-sm); }
.options { display: grid; gap: var(--sp-2); }
.option {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel);
  transition: border-color 0.15s, background 0.15s;
}
.option:hover:not(:disabled) { border-color: var(--gold); }
.option:disabled { cursor: default; }
.radio { flex: none; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--muted); }
.option.right { border-color: var(--green); background: var(--green-soft); }
.option.right .radio { border: 5px solid var(--green); }
.option.wrong { border-color: var(--red); background: var(--red-soft); opacity: 0.85; }
.option.wrong .radio { border-color: var(--red); }
.feedback { margin: var(--sp-3) 0 0; font-weight: 580; min-height: 0; }
.feedback:empty { display: none; }
.feedback.right { color: var(--green); }
.feedback.wrong { color: var(--red); }
.shake { animation: shake 0.35s ease-in-out; }
@keyframes shake {
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.practice { padding: var(--sp-4) var(--sp-4); margin-top: var(--sp-4); display: grid; gap: var(--sp-2); border-left: 4px solid var(--navy); }
.practice .section-row { margin: 0; }
.practice p { margin: 0; }
.complete-box {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-top: var(--sp-4);
  padding: var(--sp-4) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--green-soft);
  border: 1px solid var(--green);
}
.complete-box > div { flex: 1; min-width: 180px; }
.complete-box p { margin: var(--sp-0-5) 0 0; }
.complete-box.enter { animation: fade-up 0.45s ease-out; }
.check-badge { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--green); color: #fff; font-weight: 720; font-size: var(--fs-xl); }
.lesson-thread { margin-top: var(--sp-6); padding-bottom: var(--sp-4); }

.empty-state.card { padding: var(--sp-8) var(--sp-6); text-align: center; display: grid; gap: var(--sp-2); justify-items: center; }
.big-emoji { font-size: var(--fs-4xl); }

/* Tasks */
.task-form { padding: var(--sp-4) var(--sp-5); display: grid; gap: var(--sp-3); margin-top: var(--sp-4); }
.task-form fieldset { border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); }
.task-form legend { font-weight: 640; font-size: var(--fs-md); padding: 0 var(--sp-1); }
.radios { display: flex; gap: var(--sp-5); flex-wrap: wrap; }
.task-form textarea:disabled, .task-form input:disabled { opacity: 0.85; background: var(--hover); }
.budget-preview { padding: var(--sp-4) var(--sp-4); display: grid; gap: var(--sp-1-5); box-shadow: none; }
.budget-preview p { margin: 0; }
.split-bar { display: flex; height: 14px; border-radius: var(--r-pill); overflow: hidden; background: var(--hover); }
.split-bar span { transition: width 0.3s ease; }
.split-bar .needs, .sw.needs { background: var(--navy-2); }
.split-bar .wants, .sw.wants { background: var(--gold); }
.split-bar .savings, .sw.savings { background: var(--green); }
.split-legend { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.split-legend span { display: inline-flex; align-items: center; gap: var(--sp-1); }
.result { padding: var(--sp-4) var(--sp-5); margin-top: var(--sp-4); }
.result h2 { font-size: var(--fs-lg); margin-bottom: var(--sp-3); }
.result p { margin: var(--sp-1) 0; }

/* Profile learning */
.profile-learning { padding: var(--sp-4) var(--sp-4); margin-bottom: var(--sp-5); }
.badges { display: flex; gap: var(--sp-1-5); flex-wrap: wrap; margin: var(--sp-1-5) 0; }
.badge-chip { background: var(--gold-soft); color: var(--gold-text); border-radius: var(--r-pill); padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); font-weight: 640; }

/* Certificate */
.certificate {
  background: var(--panel);
  border: 2px solid var(--gold);
  outline: 6px solid var(--gold-soft);
  border-radius: var(--r-md);
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
  margin-top: var(--sp-4);
}
.certificate h1 { font-size: var(--fs-3xl); margin: var(--sp-2) 0 var(--sp-1); }
.certificate h2 { font-size: var(--fs-base); text-transform: uppercase; letter-spacing: var(--tr-label); color: var(--muted); margin: var(--sp-5) 0 var(--sp-1); }
.certificate ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-0-5); }
.certificate .kicker { text-transform: uppercase; letter-spacing: var(--tr-caps); margin-top: var(--sp-1-5); }

/* Coming soon */
.soon { padding: var(--sp-6); display: grid; gap: var(--sp-2); justify-items: start; }
.soon ul { margin: 0; padding-left: var(--sp-5); display: grid; gap: var(--sp-1); }

/* Lesson editor */
.editor-level { padding: var(--sp-4) var(--sp-4); margin-top: var(--sp-4); }
.editor-level h2 { font-size: var(--fs-base); margin-bottom: var(--sp-1-5); }
.editor-row { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.editor-row:last-child { border-bottom: 0; }
.wide-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.quiz-editor { display: grid; gap: var(--sp-3); }
.quiz-editor fieldset { padding: var(--sp-3); display: grid; gap: var(--sp-2); }
.opt-edit { display: grid; grid-template-columns: auto 1fr 1.6fr; gap: var(--sp-1-5); align-items: center; }
details summary { cursor: pointer; font-weight: 640; padding: var(--sp-1) 0; }
details[open] { display: grid; gap: var(--sp-2); }

/* ---------- Capital Commons ---------- */

.card { border-radius: var(--radius); }
.primary, .ghost, .chip, .pick-btn { border-radius: var(--r-pill); }
.primary { padding: var(--sp-2) var(--sp-5); font-weight: 640; }
input, textarea, select { border-radius: var(--r-md); }
dialog { border-radius: var(--r-xl); }
.page-title { font-weight: 800; letter-spacing: var(--tr-display); }

.g-kicker {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 720;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--coral-text);
}

.g-create {
  border: 0;
  border-radius: var(--r-pill);
  background: var(--coral);
  color: var(--on-accent);
  font-weight: 720;
  padding: var(--sp-2) var(--sp-4);
  white-space: nowrap;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--coral) 35%, transparent);
  transition: transform 0.12s, box-shadow 0.12s;
}
.g-create:hover { transform: translateY(-1px); box-shadow: 0 6px 18px color-mix(in srgb, var(--coral) 45%, transparent); }
.g-create:active { transform: scale(0.97); }

.g-hero {
  position: relative;
  overflow: hidden;
  background: var(--butter-soft);
  border-radius: var(--r-2xl);
  padding: var(--sp-8) var(--sp-6) var(--sp-6);
  margin-bottom: var(--sp-6);
}
.g-hero h1 {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: var(--tr-display);
  text-transform: uppercase;
  margin: var(--sp-2) 0 var(--sp-4);
}
.g-hero h1 span { color: var(--coral); }
.g-hero-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; position: relative; z-index: 1; }
.g-hero-row p { margin: 0; max-width: 28ch; font-size: var(--fs-base); }
.g-hero-me { display: flex; align-items: center; gap: var(--sp-3); }
.g-star {
  position: absolute;
  right: -0.6rem;
  top: -1.4rem;
  font-size: 9rem;
  line-height: var(--lh-display);
  color: var(--coral);
  opacity: 0.18;
  animation: spin 40s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.g-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); margin: var(--sp-8) 0 var(--sp-3); }
.g-section-head h2 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: var(--tr-heading); }

.g-empty {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  text-align: center;
  color: var(--muted);
  display: grid;
  gap: var(--sp-2);
  justify-items: center;
}
.g-empty p { margin: 0; }

.g-people {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(170px, 190px);
  gap: var(--sp-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: var(--sp-1) var(--sp-0-5) var(--sp-2);
}
.g-people.grid { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); overflow: visible; }
.g-person {
  scroll-snap-align: start;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-3) var(--sp-4);
  display: grid;
  gap: var(--sp-2);
  justify-items: center;
  text-align: center;
}
.g-person-main { display: grid; gap: var(--sp-0-5); justify-items: center; background: none; border: 0; padding: 0; min-width: 0; width: 100%; }
.g-person-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; margin-top: var(--sp-1-5); }
.g-reason { color: var(--coral-text); font-weight: 580; }

.g-trending { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-3); }
.g-trend {
  position: relative;
  display: grid;
  gap: var(--sp-1);
  text-align: left;
  border: 0;
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-4);
  background: var(--lilac-soft);
  transition: transform 0.15s;
}
.g-trend:nth-child(4n + 2) { background: var(--sky-soft); }
.g-trend:nth-child(4n + 3) { background: var(--sage-soft); }
.g-trend:nth-child(4n + 4) { background: var(--butter-soft); }
.g-trend:hover { transform: translateY(-2px); }
.g-trend strong { font-size: var(--fs-xl); font-weight: 800; letter-spacing: var(--tr-heading); overflow-wrap: anywhere; padding-right: var(--sp-6); }
.g-trend .g-kicker { color: var(--muted); }
.g-arrow {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel);
  font-weight: 720;
}

.g-circle-chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.g-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1-5);
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--r-pill);
  padding: var(--sp-1-5) var(--sp-4);
  font-weight: 640;
}
.g-chip:hover { border-color: var(--coral); }

.g-promo {
  margin-top: var(--sp-8);
  border-radius: var(--r-2xl);
  background: var(--navy);
  color: var(--cream);
  padding: var(--sp-8) var(--sp-6);
  display: grid;
  gap: var(--sp-2);
  justify-items: start;
}
.g-promo h2 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); font-weight: 800; letter-spacing: var(--tr-display); line-height: var(--lh-display); }
.g-promo p { margin: 0; }
.g-promo .g-kicker { color: var(--butter); }
.g-promo.slim { margin: 0 0 var(--sp-6); }
.g-cta {
  margin-top: var(--sp-2);
  border: 0;
  border-radius: var(--r-pill);
  background: var(--coral);
  color: var(--on-accent);
  font-weight: 720;
  padding: var(--sp-3) var(--sp-5);
}
.g-cta:hover { filter: brightness(1.05); }

.g-circles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--sp-4); }
.g-circle {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  display: grid;
  gap: var(--sp-1-5);
  align-content: start;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.g-circle:hover { transform: translateY(-2px); border-color: var(--coral); }
.g-circle h3 { font-size: var(--fs-lg); font-weight: 800; }
.g-circle p { margin: 0; color: var(--muted); }
.g-circle-emoji {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  font-size: var(--fs-2xl);
  border-radius: var(--r-lg);
  background: var(--butter-soft);
  margin-bottom: var(--sp-1);
}
.g-circle-emoji.big { width: 4.5rem; height: 4.5rem; font-size: var(--fs-4xl); border-radius: var(--r-xl); flex: none; }
.g-circle-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-top: var(--sp-1-5); }

.g-circle-head {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.g-circle-head h1 { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: var(--tr-display); margin: var(--sp-0-5) 0; }
.g-circle-head p { margin: var(--sp-1) 0 var(--sp-2); }
.g-circle-actions { display: grid; gap: var(--sp-1-5); justify-items: end; }
.g-stack { display: flex; align-items: center; }
.g-stack .avatar { margin-right: -8px; box-shadow: 0 0 0 2px var(--panel); }
.g-stack .muted { margin-left: var(--sp-4); }

.g-tag-head { display: grid; gap: var(--sp-1); justify-items: start; margin-bottom: var(--sp-5); }
.g-tag-head h1 { font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 800; letter-spacing: var(--tr-display); color: var(--coral); overflow-wrap: anywhere; }
.g-tag-head p { margin: 0 0 var(--sp-1-5); }

.g-compose {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-5);
  text-align: left;
}
.g-compose .muted { flex: 1; }
.g-compose-icon { font-size: var(--fs-xl); }

.g-settings { padding: var(--sp-5); display: grid; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.g-settings h2 { font-size: var(--fs-lg); font-weight: 800; }
.g-settings p { margin: 0; }
.row-actions.start { justify-content: flex-start; margin-top: 0; }

.g-footer { text-align: center; padding: var(--sp-10) var(--sp-4) var(--sp-6); color: var(--muted); font-size: var(--fs-md); }
.g-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--sp-1-5) var(--sp-5); margin-bottom: var(--sp-2); }
.g-footer .link { color: var(--muted); font-weight: 580; }
.g-footer .link:hover { color: var(--text); text-decoration: underline; }
.g-footer p { margin: 0; }

/* Posts, Capital Commons style */
.post-who { display: grid; line-height: var(--lh-snug); min-width: 0; }
.circle-tag { background: none; border: 0; padding: 0; color: var(--coral-text); font-weight: 640; font-size: var(--fs-md); text-transform: capitalize; }
.circle-tag:hover { text-decoration: underline; }
.hashtag { background: none; border: 0; padding: 0; color: var(--coral-text); font-weight: 640; }
.hashtag:hover { text-decoration: underline; }
.text-post {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
}
.text-post p {
  margin: 0;
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
  font-weight: 720;
  letter-spacing: var(--tr-heading);
  line-height: var(--lh-snug);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tone-0 { background: var(--butter-soft); }
.tone-1 { background: var(--lilac-soft); }
.tone-2 { background: var(--sky-soft); }
.tone-3 { background: var(--sage-soft); }
.text-post .burst { color: var(--like); text-shadow: none; }
.thumb-text {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: var(--sp-2);
  font-weight: 720;
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
  overflow: hidden;
}

/* Top bar account menu */
.account-wrap { position: relative; }
.account-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--r-pill);
  padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-1);
  font-weight: 640;
}
.account-btn:hover { border-color: var(--coral); }
.acct-name { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev-down { color: var(--muted); font-size: var(--fs-sm); }
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 18px 50px rgba(4, 20, 12, 0.18);
  padding: var(--sp-1-5);
  z-index: 40;
  display: grid;
  transform-origin: top right;
}
.account-menu.open { animation: panel-in 0.16s ease-out; }
.account-menu button { background: none; border: 0; text-align: left; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); font-weight: 580; }
.account-menu button:hover { background: var(--hover); }
.account-menu button:last-child { color: var(--red); }
.acct-head { display: grid; padding: var(--sp-2) var(--sp-3) var(--sp-2); margin: 0 0 var(--sp-1); border-bottom: 1px solid var(--border); }

/* Sign in */
.auth { display: grid; align-content: center; min-height: 100%; padding: var(--sp-6) var(--sp-4) 0; }
.auth-wrap {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--sp-10);
  align-items: center;
}
.auth-hero h1 {
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  line-height: 0.92;
  font-weight: 800;
  letter-spacing: var(--tr-display);
  text-transform: uppercase;
  margin: var(--sp-2) 0 var(--sp-4);
}
.auth-hero h1 span { color: var(--coral); }
.auth-hero .brand { font-size: var(--fs-3xl); margin-bottom: var(--sp-6); }
.auth-hero .lead { font-size: var(--fs-lg); margin: 0 0 var(--sp-1-5); max-width: 30ch; }
.auth-card { border-radius: var(--r-2xl); }
.auth-form .check { font-weight: 400; font-size: var(--fs-md); display: flex; gap: var(--sp-1-5); align-items: flex-start; flex-wrap: wrap; }
.auth-form .check input { margin-top: var(--sp-1); }

/* Create a post */
.create-dialog { width: min(520px, calc(100vw - 32px)); }
.create-form { display: grid; gap: var(--sp-3); }
.create-form textarea { font-size: var(--fs-base); resize: vertical; }
.row-emoji { display: grid; grid-template-columns: 90px 1fr; gap: var(--sp-3); }
.info-dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.info-dialog h2 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: var(--tr-heading); margin-bottom: var(--sp-3); }

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

/* ---------- Polish: type, icons, motion (UI/UX Pro Max guidance) ---------- */

:root {
  --font-body: "Outfit", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-ui: "Outfit", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Motion tokens: decelerate on enter, accelerate on exit, a soft spring for playful feedback.
     Exits run at ~65% of enter time so the app feels responsive. */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-press: 120ms;
  --dur-hover: 200ms;
  --dur-enter: 380ms;
  --dur-exit: 240ms;
}

body { font-family: var(--font-body); font-size: var(--fs-base); line-height: var(--lh-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .brand, .page-title, .g-hero h1, .auth-hero h1, .g-promo h2, .g-section-head h2, .lesson-title,
.g-tag-head h1, .g-circle-head h1, .q-title, .g-trend strong, .text-post p, .stat-value, .certificate h1 {
  font-family: var(--font-display);
}

/* Icons: one family, 2px round strokes, sized by token. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}
.nav-icon.icon { width: 1.3rem; height: 1.3rem; }
.g-create, .g-cta, .pick-btn span { display: inline-flex; align-items: center; gap: var(--sp-1-5); }
.g-arrow .icon { width: 1rem; height: 1rem; transition: transform var(--dur-hover) var(--ease-out); }
.g-trend:hover .g-arrow .icon { transform: translate(2px, -2px); }
.g-cta .icon { transition: transform var(--dur-hover) var(--ease-out); }
.g-cta:hover .icon { transform: translate(2px, -2px); }

/* Like: outline heart that fills with colour when liked. */
.like .glyph { width: 1.6rem; height: 1.6rem; transition: fill var(--dur-hover) var(--ease-out), color var(--dur-hover); }
.like.liked .glyph { fill: currentColor; }
.icon-action .icon { width: 1.6rem; height: 1.6rem; }

/* Press feedback: a quick, subtle scale (no layout shift). */
button, .pick-btn, .g-circle, .g-trend, .card.list-item, .qa-item, .continue, .stat {
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-hover), border-color var(--dur-hover), box-shadow var(--dur-hover), color var(--dur-hover);
}
button:active:not(:disabled), .pick-btn:active, .g-circle:active { transform: scale(0.97); }
.g-create:active, .g-cta:active, .primary:active { transform: scale(0.95); }
button:disabled { cursor: default; }

/* Hover lift only where a mouse can hover (not sticky on touch). */
@media (hover: hover) {
  .g-circle:hover, .g-trend:hover, .qa-item:hover, .continue:hover, .stat:hover, .g-person:hover, .card.post:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(4, 20, 12, 0.09);
  }
  .g-person, .card.post { transition: transform var(--dur-hover) var(--ease-out), box-shadow var(--dur-hover); }
}

/* Visible keyboard focus everywhere. */
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: var(--r-sm); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: -1px; }

/* Cascading entrance for freshly rendered lists (40ms apart). */
.rise { animation: rise var(--dur-enter) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* Screen changes cross-fade the content area with a slight rise (View Transitions API);
   the sidebar and the rest of the page stay put. */
.main { view-transition-name: gather-main; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(gather-main) { animation: vt-out var(--dur-exit) var(--ease-in) both; }
::view-transition-new(gather-main) { animation: vt-in var(--dur-enter) var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* Springier versions of existing feedback. */
.pop { animation: pop 0.42s var(--ease-spring); }
.wiggle { animation: wiggle 0.6s var(--ease-out); }
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-12deg) scale(1.08); }
  45% { transform: rotate(10deg) scale(1.08); }
  70% { transform: rotate(-5deg); }
}
.toasts .ntoast { animation-timing-function: var(--ease-spring); }
.option { transition: border-color var(--dur-hover), background-color var(--dur-hover), transform var(--dur-press) var(--ease-out); }
.option.right { animation: pop 0.42s var(--ease-spring); }
dialog[open] { animation: dialog-in var(--dur-enter) var(--ease-spring); }
dialog[open]::backdrop { animation: fade-in var(--dur-hover) ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes fade-in { from { opacity: 0; } }

/* Comfortable tap targets: at least 44x44. */
.icon-btn { width: 2.75rem; height: 2.75rem; display: inline-grid; place-items: center; border-radius: var(--r-pill); }
.icon-btn .icon { width: 1.35rem; height: 1.35rem; }
.icon-action { min-width: 2.75rem; min-height: 2.75rem; display: inline-grid; place-items: center; }
.account-btn { min-height: 2.75rem; }
.chip { min-height: 2.25rem; }

/* Phone tab bar (shown on small screens) */
.tabbar { display: none; }

@media print {
  .sidebar, .topbar, .tabbar, .no-print, .toasts { display: none !important; }
  .app { display: block; }
  .view { overflow: visible; }
}

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

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(290px, 85vw);
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 15; }
  .menu-btn { display: inline-block; }
  .topbar, .messages { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .composer { padding: 0 var(--sp-4) var(--sp-4); }
  .typing { padding: 0 var(--sp-4); }
  .mention-pop { left: 16px; }
  .toasts { top: auto; bottom: 16px; right: 16px; left: 16px; width: auto; }
  @keyframes toast-in { from { opacity: 0; transform: translateY(120%); } }
  @keyframes toast-out { to { opacity: 0; transform: translateY(120%); } }
  .react-bar { right: 0.2rem; }
  .column { padding-top: var(--sp-4); }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--border);
    background: var(--panel);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar button {
    display: grid;
    justify-items: center;
    gap: var(--sp-0-5);
    background: none;
    border: 0;
    border-top: 3px solid transparent;
    padding: var(--sp-2) 0 var(--sp-2);
    font-size: var(--fs-xs);
    color: var(--muted);
  }
  .tabbar button span { font-size: var(--fs-xl); line-height: var(--lh-snug); }
  .tabbar button.active { color: var(--text); font-weight: 720; border-top-color: var(--gold); }
  .tabbar button { min-height: 3.3rem; }
  .tabbar button .icon { width: 1.4rem; height: 1.4rem; transition: transform 0.35s var(--ease-spring); }
  .tabbar button.active .icon { transform: translateY(-2px) scale(1.12); }
  .tabbar .tab-create { border-top: 0; align-self: center; }
  .tabbar .tab-create .icon { width: 1.5rem; height: 1.5rem; stroke-width: 2.5; }
  .tabbar .tab-create:active .tab-create-disc { transform: scale(0.9) rotate(90deg); }
  .tabbar .tab-create .tab-create-disc { transition: transform 0.3s var(--ease-spring); }
  .tabbar .tab-create .tab-create-disc {
    display: grid;
    place-items: center;
    width: 2.9rem;
    height: 2.9rem;
    margin-top: -1.1rem;
    border-radius: 50%;
    background: var(--coral);
    color: var(--on-accent);
    font-size: var(--fs-2xl);
    font-weight: 800;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--coral) 45%, transparent);
  }
  .desktop-only, .acct-name, .chev-down { display: none; }
  .account-btn { padding: var(--sp-0-5); }
  .auth-wrap { grid-template-columns: 1fr; gap: var(--sp-5); }
  .auth-hero .brand { margin-bottom: var(--sp-3); }
  .g-hero { padding: var(--sp-6) var(--sp-5); }
  .g-circle-actions { justify-items: start; }
  .topbar { gap: var(--sp-1-5); }
  .chat .composer { padding-bottom: var(--sp-3); }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .opt-edit { grid-template-columns: 1fr; }
  .lesson-title { font-size: var(--fs-2xl); }
  .stat-value { font-size: var(--fs-xl); }
  .q-title { font-size: var(--fs-lg); }
  .card { border-radius: var(--r-sm); }
  .profile-head { gap: var(--sp-4); }
  .avatar.xl { width: 80px; height: 80px; font-size: var(--fs-3xl); }
}

/* =====================================================================
   Instagram-style layout: one centred phone-style column on every screen,
   top bar + bottom tab bar, stories row, full-bleed posts, chat bubbles.
   ===================================================================== */

.app { display: block; height: 100%; }
.main {
  max-width: 640px;
  margin: 0 auto;
  height: 100%;
  background: var(--panel);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
@media (max-width: 660px) { .main { border: 0; } }

/* Top bar */
.topbar {
  min-height: 56px;
  padding: 0 var(--sp-1-5) 0 var(--sp-3);
  gap: var(--sp-0-5);
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}
.top-brand { display: none; font-size: var(--fs-2xl); }
#view-title { font-size: var(--fs-lg); font-weight: 720; flex: 1; }
.back-btn { display: none; }
body[data-depth="sub"] .back-btn { display: inline-grid; margin-left: -6px; }
body[data-view="feed"] .top-brand { display: inline; }
body[data-view="feed"] #view-title { visibility: hidden; }
.top-actions { display: flex; align-items: center; gap: 0; margin-left: auto; }
body[data-depth="sub"] .top-actions { display: none; }
#inbox-btn, #bell { position: relative; }
.topbar .conn { width: 0.45rem; height: 0.45rem; margin-left: var(--sp-0-5); align-self: center; }
body:not([data-view="feed"]) .topbar .conn { display: none; }

/* Bottom tab bar (all screen sizes) */
.tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  border-top: 1px solid var(--border);
  background: var(--panel);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  display: grid;
  justify-items: center;
  gap: var(--sp-0-5);
  background: none;
  border: 0;
  padding: var(--sp-2) 0 var(--sp-1-5);
  min-height: 3.4rem;
  color: var(--muted);
}
.tabbar .tab-label { font-size: var(--fs-2xs); font-weight: 580; line-height: var(--lh-heading); }
.tabbar button.active { color: var(--text); }
.tabbar button.active .tab-label { font-weight: 720; }
.tabbar .icon { width: 1.55rem; height: 1.55rem; transition: transform 0.35s var(--ease-spring), stroke-width 0.2s; }
.tabbar button.active .icon { stroke-width: 2.6; transform: translateY(-1px) scale(1.1); }
.tab-avatar .avatar { width: 26px; height: 26px; font-size: var(--fs-xs); transition: box-shadow 0.2s; }
.tabbar button.active .tab-avatar .avatar { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }
.tabbar .tab-create { align-self: center; padding: 0; border-top: 0; }
.tabbar .tab-create .tab-create-disc {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 2.6rem;
  margin: 0;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--coral), var(--coral-2));
  color: var(--on-accent);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--coral) 40%, transparent);
  transition: transform 0.3s var(--ease-spring);
}
.tabbar .tab-create .icon { width: 1.4rem; height: 1.4rem; stroke-width: 2.8; transform: none; }
.tabbar .tab-create:active .tab-create-disc { transform: scale(0.88) rotate(90deg); }
.tabbar button.active { border-top-color: transparent; }

/* Columns: feed and profile grid run edge to edge */
.column { width: 100%; padding: var(--sp-4) var(--sp-4) var(--sp-6); }
.feed-column { padding: 0 0 var(--sp-6); }

/* Stories row */
.stories {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  padding: var(--sp-3) var(--sp-4) var(--sp-3);
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.stories::-webkit-scrollbar { display: none; }
.story { display: grid; justify-items: center; gap: var(--sp-1-5); width: 72px; flex: none; background: none; border: 0; padding: 0; }
.story-ring {
  position: relative;
  display: grid;
  place-items: center;
  padding: var(--sp-1);
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--coral), var(--coral-2), var(--butter), var(--lilac), var(--coral));
  transition: transform 0.3s var(--ease-spring);
}
.story-ring .avatar { width: 62px; height: 62px; font-size: var(--fs-2xl); box-shadow: 0 0 0 3px var(--panel); }
.story-ring.me, .story-ring.add { background: var(--border); }
.story-ring.circle { background: conic-gradient(from 200deg, var(--sage), var(--butter), var(--sage)); }
.story:hover .story-ring { transform: scale(1.05) rotate(-2deg); }
.story:active .story-ring { transform: scale(0.94); }
.story-plus {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--coral);
  color: var(--on-accent);
  box-shadow: 0 0 0 3px var(--panel);
}
.story-plus .icon { width: 13px; height: 13px; stroke-width: 3.2; }
.story-label { font-size: var(--fs-xs); max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.circle-av { background: var(--butter-soft); color: var(--text); }
.circle-av.explore { background: var(--hover); }
.circle-av .icon { width: 26px; height: 26px; }
.story-sk { width: 68px; height: 68px; border-radius: 50%; }

/* Learning nudge + trending chips + composer prompt */
.nudge {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: calc(100% - 28px);
  margin: var(--sp-3) var(--sp-4) 0;
  padding: var(--sp-3) var(--sp-3);
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  background: var(--butter-soft);
  text-align: left;
}
.nudge .ring-wrap, .nudge .ring { width: 44px; height: 44px; }
.nudge .ring-label { font-size: var(--fs-2xs); }
.nudge-text { flex: 1; display: grid; min-width: 0; }
.nudge-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trend-chips { display: flex; align-items: center; gap: var(--sp-2); overflow-x: auto; padding: var(--sp-3) var(--sp-4) 0; scrollbar-width: none; }
.trend-chips::-webkit-scrollbar { display: none; }
.trend-label { font-weight: 720; font-size: var(--fs-sm); white-space: nowrap; color: var(--coral-text); }
.trend-chip { white-space: nowrap; border: 1px solid var(--border); background: var(--panel); border-radius: var(--r-pill); padding: var(--sp-1-5) var(--sp-3); font-weight: 640; font-size: var(--fs-md); }
.trend-chip span { color: var(--muted); font-weight: 580; }
.g-compose {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: calc(100% - 28px);
  margin: var(--sp-3) var(--sp-4);
  padding: var(--sp-1-5) var(--sp-4) var(--sp-1-5) var(--sp-1-5);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--hover);
  text-align: left;
}
.g-compose .avatar { width: 34px; height: 34px; }

/* Posts: full-bleed, Instagram style */
.post-list { gap: 0; }
.post {
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  background: var(--panel);
}
@media (hover: hover) { .card.post:hover { transform: none; box-shadow: none; } }
.post-head { padding: var(--sp-3) var(--sp-1-5) var(--sp-3) var(--sp-3); }
.post-head .avatar.sm { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--coral); }
.post-media { background: var(--hover); }
.post-img { max-height: 680px; }
.post-body { padding: var(--sp-0-5) var(--sp-3) var(--sp-3); gap: var(--sp-1); }
.post-actions { margin-left: -10px; }
.comment-form { border-top: 0; margin-top: 0; }
.text-post { min-height: 300px; }
#circle-body .post-list, #tag-body .post-list { margin: 0 -16px; border-top: 1px solid var(--border); }

/* Suggested for you (inside the feed) */
.suggest { padding: var(--sp-4) 0 var(--sp-4); border-bottom: 1px solid var(--border); background: var(--bg); }
.suggest-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 var(--sp-4) var(--sp-3); }
.suggest .g-people { padding: 0 var(--sp-4) var(--sp-1); }
.g-person { background: var(--panel); }

/* Profile */
.profile-column { padding-top: var(--sp-4); }
.profile-head { display: block; border-bottom: 0; padding: 0; margin: 0; }
.p-top { display: flex; align-items: center; gap: var(--sp-6); }
.story-ring.big .avatar.xl { width: 86px; height: 86px; font-size: var(--fs-3xl); box-shadow: 0 0 0 3px var(--panel); }
.p-stats { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.p-stat strong { display: block; font-family: var(--font-display); font-size: var(--fs-xl); }
.p-stat span { font-size: var(--fs-sm); color: var(--muted); }
.p-about { margin-top: var(--sp-3); }
.p-about h3 { font-size: var(--fs-base); font-weight: 720; }
.p-about p { margin: var(--sp-1) 0; }
.p-pills { display: flex; gap: var(--sp-1-5); flex-wrap: wrap; margin: var(--sp-1) 0; }
.p-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--sp-2); margin: var(--sp-4) 0 var(--sp-3); }
.p-actions button { border-radius: var(--r-sm); padding: var(--sp-2); font-weight: 640; }
.p-actions .ghost { background: var(--hover); border-color: transparent; }
.profile-learning { margin-bottom: var(--sp-3); }
.grid-tabs { display: flex; justify-content: center; padding: var(--sp-3) 0; margin: var(--sp-1) -16px 0; border-top: 1px solid var(--border); color: var(--text); }
.grid { gap: var(--sp-0-5); margin: 0 -16px; }
.thumb { border-radius: 0; }

/* Messages inbox */
.conv-list .conv { padding: var(--sp-3) var(--sp-1-5); gap: var(--sp-3); border-radius: var(--r-md); color: var(--text); }
.conv-list .conv:hover { background: var(--hover); }
.conv-list .conv.active { background: var(--hover); color: var(--text); }
.conv-text { flex: 1; display: grid; min-width: 0; text-align: left; }
.conv-name { font-weight: 640; }
.conv-sub { font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.has-unread .conv-sub { color: var(--text); font-weight: 640; }
.chan-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--butter-soft); font-weight: 720; font-size: var(--fs-base); flex: none; }
#inbox-view .section-head { padding: var(--sp-4) var(--sp-1) var(--sp-1); }

/* Chat: bubbles, yours on the right */
.messages { padding: var(--sp-3) var(--sp-3) var(--sp-1); }
.msg { max-width: 80%; width: fit-content; margin-top: var(--sp-3); padding: 0; background: none; border-radius: 0; }
.msg:hover { background: none; }
.msg.mine { margin-left: auto; background: none; }
.msg.grouped { margin-top: var(--sp-1); }
.msg-head { margin: 0 0 var(--sp-1) var(--sp-0-5); font-size: var(--fs-xs); }
.msg.mine .msg-head { display: none; }
.msg-text {
  display: inline-block;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-lg);
  background: var(--hover);
  padding-left: var(--sp-4);
}
.msg.mine .msg-text { background: linear-gradient(135deg, var(--coral), var(--coral-2)); color: var(--on-accent); }
.msg.mine .msg-text .mention, .msg.mine .msg-text .hashtag { color: var(--on-accent); text-decoration: underline; background: none; }
.msg.mentions-me { box-shadow: none; background: none; }
.msg.mentions-me .msg-text { box-shadow: inset 0 0 0 2px var(--butter); }
.reactions { padding-left: var(--sp-1); }
.msg.mine .reactions { justify-content: flex-end; }
.msg:not(.mine) .react-bar { right: auto; left: 0; }
.composer { padding: var(--sp-2) var(--sp-3) var(--sp-3); align-items: center; }
.composer textarea { border-radius: var(--r-xl); padding: var(--sp-2) var(--sp-4); }
.send-btn {
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--coral);
  color: var(--on-accent);
}
.send-btn .icon { width: 1.2rem; height: 1.2rem; }

/* Activity */
.notif-list { padding: 0; }
.notif-foot { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-4) var(--sp-1) 0; border-top: 1px solid var(--border); margin-top: var(--sp-3); }

/* Learn: Path | Q&A switch */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--hover); border-radius: var(--r-md); padding: var(--sp-1); margin-bottom: var(--sp-4); }
.seg button { border: 0; background: none; padding: var(--sp-2); border-radius: var(--r-sm); font-weight: 640; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(4, 20, 12, 0.08); }

/* "More" menu and the composer: bottom sheets on phones, centred on desktop */
.sheet-grip { width: 40px; height: 4px; border-radius: var(--r-pill); background: var(--border); margin: var(--sp-0-5) auto var(--sp-1-5); }
.sheet-list { display: grid; }
.sheet-list button {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-2);
  background: none;
  border: 0;
  border-radius: var(--r-md);
  font-weight: 580;
  font-size: var(--fs-base);
  text-align: left;
}
.sheet-list button:hover { background: var(--hover); }
.sheet-list .danger { color: var(--red); }
.sheet-list .soon-pill, .sheet-list .badge { margin-left: auto; }
.g-footer.compact { padding: var(--sp-3) 0 0; font-size: var(--fs-sm); }
#more-sheet { width: min(420px, calc(100vw - 32px)); }
@media (max-width: 660px) {
  dialog.sheet {
    margin: auto auto 0;
    width: 100vw;
    max-width: 100vw;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-bottom: 0;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  }
  dialog.sheet[open] { animation: sheet-up var(--dur-enter) var(--ease-out); }
}
@keyframes sheet-up { from { transform: translateY(100%); } }

/* The old sidebar layout is gone; hide anything left over from it. */
.sidebar, .scrim, .menu-btn { display: none !important; }

/* ---------- Google sign-in ---------- */

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  min-height: 2.9rem;
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid #dadce0;
  border-radius: var(--r-pill);
  background: #ffffff;
  color: #1f1f1f;
  font-weight: 640;
  text-decoration: none;
  transition: background-color var(--dur-hover), box-shadow var(--dur-hover), transform var(--dur-press) var(--ease-out);
}
.google-btn:hover { background: #f8f9fa; box-shadow: 0 2px 8px rgba(4, 20, 12, 0.08); }
.google-btn:active { transform: scale(0.97); }
.google-g { width: 20px; height: 20px; flex: none; }
.or-line { display: flex; align-items: center; gap: var(--sp-3); color: var(--muted); font-size: var(--fs-sm); margin: var(--sp-1) 0; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* ---------- waiting for approval ---------- */

.pending { min-height: 100%; display: grid; place-items: center; padding: var(--sp-6) var(--sp-4); }
.pending-card {
  width: min(420px, 100%);
  text-align: center;
  display: grid;
  gap: var(--sp-2);
  justify-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: var(--sp-8) var(--sp-6);
}
.pending-card h1 { font-size: var(--fs-2xl); font-weight: 720; }
.pending-card p { margin: 0; }
.pending-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  margin: var(--sp-3) 0;
  border-radius: 50%;
}
.pending-orbit::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--coral), var(--coral-2), var(--butter), var(--lilac), var(--coral));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  animation: spin 3s linear infinite;
}
.pending-orbit .avatar.xl { width: 108px; height: 108px; box-shadow: none; }
.pending-live { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--sage); font-weight: 580; margin-top: var(--sp-1-5) !important; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); animation: presence 2s ease-out infinite; }

/* ---------- admin dashboard ---------- */

.a-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-4); }
.a-tile { display: grid; gap: 0; padding: var(--sp-3) var(--sp-3); border-radius: var(--r-lg); background: var(--hover); }
.a-tile strong { font-family: var(--font-display); font-size: var(--fs-2xl); line-height: var(--lh-heading); }
.a-tile span { font-size: var(--fs-xs); color: var(--muted); }
.a-tile.hot { background: var(--coral-soft); }
.a-tile.hot strong { color: var(--coral-text); }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.a-panel { display: grid; gap: var(--sp-3); }

.a-request {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--panel);
}
.a-request-actions { display: flex; gap: var(--sp-1-5); align-items: center; flex-wrap: wrap; }

.a-search { display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--panel); }
.a-search input { border: 0; background: none; padding: var(--sp-2) 0; }
.a-search input:focus { outline: none; }
.a-search:focus-within { outline: 3px solid var(--coral); outline-offset: 2px; }
.a-list { display: grid; gap: var(--sp-1); }
.a-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3) var(--sp-2);
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  text-align: left;
  border-radius: var(--r-md);
}
.a-row:hover { background: var(--hover); }
.a-row-main { display: grid; gap: var(--sp-0-5); min-width: 0; }
.a-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-row-pills { display: flex; gap: var(--sp-1-5); flex-wrap: wrap; margin-top: var(--sp-0-5); }
.a-row-meta { display: grid; justify-items: end; text-align: right; gap: var(--sp-px); }
@media (max-width: 520px) {
  .a-row { grid-template-columns: auto 1fr; }
  .a-row-meta { grid-column: 2; justify-items: start; text-align: left; }
}
.status-active { background: var(--sage-soft); color: var(--sage); }
.status-pending { background: var(--butter-soft); color: var(--coral-text); }
.status-rejected, .status-removed { background: var(--red-soft); color: var(--red); }
.method-google { background: var(--sky-soft); color: var(--text); }
.method-password { background: var(--hover); color: var(--muted); }

.a-log-head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.a-log-head select { width: auto; }
.a-log { list-style: none; margin: 0; padding: 0; display: grid; }
.a-log-row { display: flex; gap: var(--sp-3); padding: var(--sp-2) var(--sp-1); border-bottom: 1px solid var(--border); }
.a-log-row p { margin: 0; overflow-wrap: anywhere; }
.a-log-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: var(--sp-2); flex: none; background: var(--muted); }
.log-login .a-log-dot, .log-signup .a-log-dot, .log-approved .a-log-dot { background: var(--sage); }
.log-login-failed .a-log-dot, .log-rejected .a-log-dot, .log-removed .a-log-dot { background: var(--red); }
.log-access-request .a-log-dot, .log-role-change .a-log-dot { background: var(--coral); }

.admin-user h3 { font-size: var(--fs-base); font-weight: 720; margin-top: var(--sp-2); }
.a-user-head { display: flex; align-items: center; gap: var(--sp-4); }
.a-user-head h2 { font-size: var(--fs-xl); font-weight: 720; }
.a-user-head p { margin: 0 0 var(--sp-1); }
.a-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--sp-3) var(--sp-4); }
.a-field { display: grid; gap: var(--sp-px); min-width: 0; }
.a-field strong { font-weight: 580; overflow-wrap: anywhere; }
.a-posts { margin: 0; padding-left: var(--sp-4); display: grid; gap: var(--sp-1); }

/* ---------- Terracotta / cream / sage: the 30% sage ---------- */

.topbar {
  background: var(--sage-fill);
  color: var(--on-sage);
  border-bottom: 0;
  backdrop-filter: none;
}
.topbar .icon-btn { color: var(--on-sage); }
.topbar .icon-btn:hover { background: color-mix(in srgb, var(--on-sage) 12%, transparent); }
.topbar .brand { color: var(--on-sage); }
.topbar .brand .star, .topbar .brand .dot { color: var(--cream); }
.topbar .bell-badge { background: var(--coral); color: var(--on-accent); box-shadow: 0 0 0 2px var(--sage-fill); }

.tabbar { background: var(--sage-fill); border-top: 0; }
.tabbar button, .tabbar button.active { color: var(--on-sage); }
.tabbar button.active .icon {
  box-sizing: content-box;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-pill);
  background: var(--cream);
  color: var(--on-accent);
  transform: none;
}
@media (prefers-color-scheme: dark) {
  .tabbar button.active .icon { background: var(--panel); color: var(--ink); }
}
.tabbar button.active .tab-avatar .avatar { box-shadow: 0 0 0 2px var(--sage-fill), 0 0 0 4px var(--cream); }
.tabbar .tab-create .tab-create-disc { background: var(--coral); color: var(--on-accent); box-shadow: 0 4px 12px rgba(4, 20, 12, 0.18); }

/* 10% terracotta: only things to click */
.primary, .g-create, .g-cta, .send-btn { background: var(--coral); color: var(--on-accent); }
.primary:hover, .g-create:hover, .g-cta:hover { filter: none; background: var(--coral-2); }
.g-create { box-shadow: 0 4px 14px color-mix(in srgb, var(--coral) 30%, transparent); }
.link, .hashtag, .circle-tag, .mention { color: var(--coral-text); }
.chip.on, .seg button.on { border-color: var(--sage-fill-2); }
.chip.on { background: var(--sage-soft); color: var(--status-approved-text); }
.story-ring { background: conic-gradient(from 200deg, var(--coral), var(--coral-2), var(--sage-fill), var(--sage-fill-2), var(--coral)); }
.story-ring.circle { background: conic-gradient(from 200deg, var(--sage-fill), var(--sage-fill-2), var(--sage-fill)); }
.post-head .avatar.sm { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--sage-fill); }
.msg.mine .msg-text { background: var(--coral-soft); color: var(--ink); }
.msg.mine .msg-text .mention, .msg.mine .msg-text .hashtag { color: var(--coral-text); }
.nudge { background: var(--sage-soft); }
.g-compose { background: var(--panel); border-color: var(--sage-fill-2); }
.trend-label { color: var(--status-approved-text); }
.trend-chip { border-color: var(--sage-fill-2); }
.text-post.tone-0 { background: var(--coral-soft); }
.text-post.tone-1, .thumb-text.tone-1 { background: var(--sage-soft); }
.text-post.tone-2, .thumb-text.tone-2 { background: var(--butter-soft); }
.text-post.tone-3, .thumb-text.tone-3 { background: var(--lilac-soft); }

/* Status colours */
.status-active { background: var(--sage-soft); color: var(--status-approved-text); }
.status-pending { background: var(--status-pending); color: var(--status-pending-text); }
.status-rejected, .status-removed { background: var(--status-rejected); color: var(--status-rejected-text); }
.status-paused { background: var(--hover); color: var(--ink); }
.method-google { background: var(--lilac-soft); color: var(--ink); }
.role-owner { background: var(--coral); color: var(--on-accent); }
.role-admin { background: var(--navy); color: var(--cream); }
.role-viewer { background: var(--hover); color: var(--muted); }
.a-tile.hot { background: var(--status-pending); }
.a-tile.hot strong { color: var(--status-pending-text); }

/* Request notes, invite options */
.a-note {
  margin: var(--sp-1-5) 0 0;
  padding: var(--sp-2) var(--sp-3);
  border-left: 3px solid var(--sage-fill-2);
  background: var(--sage-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: var(--fs-md);
}
.invite-options { display: grid; gap: var(--sp-2); grid-template-columns: 1fr auto; align-items: end; }
@media (max-width: 520px) { .invite-options { grid-template-columns: 1fr; } }
.invite strong { color: var(--ink); }
.pending-note { display: grid; gap: var(--sp-1-5); width: 100%; text-align: left; margin-top: var(--sp-1-5); }
.pending-note label { font-size: var(--fs-md); }
.pending-note button { justify-self: end; }

/* Welcome on first entry */
.welcome-dialog { width: min(420px, calc(100vw - 32px)); text-align: center; justify-items: center; padding: var(--sp-8) var(--sp-6) var(--sp-6); }
.welcome-dialog h2 { font-size: var(--fs-2xl); font-weight: 720; }
.welcome-dialog p { margin: 0; }
.welcome-orbit { position: relative; display: grid; place-items: center; width: 124px; height: 124px; border-radius: 50%; padding: var(--sp-1); background: conic-gradient(from 200deg, var(--coral), var(--coral-2), var(--sage-fill), var(--sage-fill-2), var(--coral)); }
.welcome-orbit .avatar.xl { width: 112px; height: 112px; box-shadow: 0 0 0 4px var(--panel); font-size: var(--fs-4xl); }
.welcome-tips { list-style: none; margin: var(--sp-1-5) 0; padding: 0; display: grid; gap: var(--sp-2); text-align: left; width: 100%; }
.welcome-tips li { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--sage-soft); }
.welcome-tips .icon { margin-top: var(--sp-0-5); color: var(--status-approved-text); }

/* Read-only viewers don't see posting controls (the server refuses them anyway). */
body[data-role="viewer"] .tab-create,
body[data-role="viewer"] #topbar-create,
body[data-role="viewer"] .g-compose,
body[data-role="viewer"] .comment-form,
body[data-role="viewer"] .composer { display: none !important; }

/* ---------- Messenger: bubbles, receipts, replies, actions ---------- */

.msg { max-width: 82%; -webkit-touch-callout: none; }
.msg-bubble {
  position: relative;
  display: inline-block;
  max-width: 100%;
  padding: var(--sp-2) var(--sp-3) var(--sp-1-5);
  border-radius: var(--r-lg);
  background: var(--hover);
  text-align: left;
  transition: transform var(--dur-press) var(--ease-out);
}
.msg.mine .msg-bubble { background: var(--coral-soft); color: var(--ink); border-bottom-right-radius: var(--r-xs); }
.msg:not(.mine) .msg-bubble { border-bottom-left-radius: var(--r-xs); }
.msg.grouped.mine .msg-bubble { border-top-right-radius: var(--r-xs); }
.msg.grouped:not(.mine) .msg-bubble { border-top-left-radius: var(--r-xs); }
.msg.pressing .msg-bubble { transform: scale(0.97); }
.msg-text, .msg.mine .msg-text { display: inline; padding: 0; background: none; border-radius: 0; color: inherit; }
.msg.mentions-me .msg-text { box-shadow: none; }
.msg.mentions-me .msg-bubble { box-shadow: inset 0 0 0 2px var(--sage-fill-2); }

/* Time + ticks sit at the bottom-right of the bubble, WhatsApp style. */
.msg-meta {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  margin: var(--sp-1-5) 0 -2px var(--sp-3);
  font-size: var(--fs-2xs);
  line-height: var(--lh-display);
  color: var(--muted);
  white-space: nowrap;
}
.msg-meta .edited { font-style: italic; }
.ticks { display: inline-flex; }
.ticks .icon { width: 1.05rem; height: 1.05rem; stroke-width: 2.4; }
.ticks.sent, .ticks.delivered { color: var(--muted); }
.ticks.seen { color: var(--coral-text); }
.seen-line {
  list-style: none;
  text-align: right;
  font-size: var(--fs-xs);
  color: var(--muted);
  margin: var(--sp-0-5) var(--sp-1) 0 0;
  animation: fade-up 0.25s ease-out;
}
.seen-line.seen { color: var(--coral-text); font-weight: 580; }

.msg.deleted .msg-bubble { background: none; border: 1px dashed var(--border); }
.deleted-text { color: var(--muted); font-style: italic; display: inline-flex !important; align-items: center; gap: var(--sp-1-5); }
.deleted-text .icon { width: 0.95rem; height: 0.95rem; }

.reply-quote {
  display: grid;
  gap: var(--sp-px);
  width: 100%;
  margin: 0 0 var(--sp-1-5);
  padding: var(--sp-1-5) var(--sp-2);
  border: 0;
  border-left: 3px solid var(--sage-fill);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--panel) 65%, transparent);
  text-align: left;
  font-size: var(--fs-sm);
}
.reply-quote strong { font-size: var(--fs-xs); color: var(--status-approved-text); }
.reply-quote span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.flash { animation: flash 1.1s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 55%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.msg.leaving { animation: post-out 0.25s ease-in forwards; }

/* Hover toolbar (desktop): quick reactions + ⋯ */
.react-bar .more { width: auto; padding: 0 var(--sp-1-5); }
.react-bar .more .icon { width: 1.1rem; height: 1.1rem; }
@media (hover: none) { .react-bar { display: none; } }

/* Reply / edit bar above the message box */
.reply-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: 0 var(--sp-3);
  padding: var(--sp-1-5) var(--sp-1) var(--sp-1-5) var(--sp-3);
  border-left: 3px solid var(--coral);
  border-radius: var(--r-sm);
  background: var(--hover);
}
.reply-bar > .icon { color: var(--coral-text); }
.reply-bar-text { flex: 1; display: grid; min-width: 0; font-size: var(--fs-md); }
.reply-bar-text span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Message options sheet */
.msg-menu-preview { padding: var(--sp-1) var(--sp-1-5) var(--sp-2); }
.msg-menu-preview p { margin: 0; overflow-wrap: anywhere; }
.msg-menu-preview p:not(.muted):not(.small):not(.strong) {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--hover);
  max-height: 6.5em;
  overflow: hidden;
}
.msg-menu-reactions {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-1);
  padding: var(--sp-1-5);
  margin-bottom: var(--sp-1-5);
  border-radius: var(--r-pill);
  background: var(--hover);
}
.msg-menu-reactions button {
  width: 2.9rem;
  height: 2.9rem;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: var(--fs-2xl);
  transition: transform 0.2s var(--ease-spring), background-color 0.15s;
}
.msg-menu-reactions button:hover { transform: scale(1.18) translateY(-2px); }
.msg-menu-reactions button.on { background: var(--coral-soft); }
#msg-menu { width: min(420px, calc(100vw - 32px)); }

/* Message info */
.msg-info { width: min(420px, calc(100vw - 32px)); }
.info-quote { margin: 0; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--hover); overflow-wrap: anywhere; }
.info-row { display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.info-row.seen strong { color: var(--coral-text); }
.info-seen { display: grid; gap: var(--sp-1-5); padding-top: var(--sp-1-5); }
.info-person { display: flex; align-items: center; gap: var(--sp-2); }
.info-person span:nth-child(2) { flex: 1; }

/* =====================================================================
   Capital Commons dark forest theme (from the design mock-ups): deep green
   surfaces, cream text, orange for actions, green for growth and online.
   Declared last, so it applies in both light and dark system modes.
   ===================================================================== */
:root {
  --bg: #121A15;
  --bg-2: #17211B;
  --panel: #1B261F;
  --panel-2: #212E25;
  --sidebar: #17211B;
  --hover: #243128;
  --border: #2B3A30;
  --border-strong: #3B4D40;
  --ink: #F1ECE1;
  --text: #F1ECE1;
  --cream: #F1ECE1;
  --muted: #A9B3A5;
  --coral: #F2955A;
  --coral-2: #F6AD7C;
  --coral-text: #F5A46F;
  --coral-soft: #3A2A1E;
  --on-accent: #1A1F16;
  --accent: var(--coral);
  --accent-text: var(--on-accent);
  --sage-fill: #17211B;
  --sage-fill-2: #2E4A33;
  --on-sage: #F1ECE1;
  --sage: #8FCB86;
  --sage-soft: #22331F;
  --green-dot: #5FD068;
  --butter: #E9B25E;
  --butter-soft: #2E2A1C;
  --lilac: #A78BFA;
  --lilac-soft: #2A2540;
  --sky-soft: #1F2C2A;
  --navy: #0F1612;
  --navy-2: #1F2D23;
  --red: #F09A94;
  --red-soft: #3A2222;
  --mine: #3A2A1E;
  --like: #F2955A;
  --status-pending: #4A3322;
  --status-pending-text: #F3C9A6;
  --status-rejected: #3F2424;
  --status-rejected-text: #F0BDBD;
  --status-approved-text: #C9DDB8;
  --chart-1: #E6E9DA;
  --chart-2: var(--coral);
  --chart-3: #6FAE63;
  --chart-4: #5C6852;
  --shadow: none;
  color-scheme: dark;
}

body { background: var(--bg); color: var(--text); }
.main { background: var(--bg); border-color: var(--border); }
input, textarea, select { background: var(--panel-2); border-color: var(--border); color: var(--text); }
dialog { background: var(--panel); border-color: var(--border); }
.card { background: var(--panel); border-color: var(--border); }
.ghost { border-color: var(--border-strong); color: var(--text); }

/* Header: logo + outlined icons on deep green */
.topbar { background: var(--bg-2); border-bottom: 1px solid var(--border); min-height: 60px; }
.topbar .brand { font-size: var(--fs-3xl); }
.topbar .brand .star, .topbar .brand .dot { color: var(--cream); }
.topbar .conn.ok { background: var(--green-dot); }
.top-actions .icon { width: 1.6rem; height: 1.6rem; stroke-width: 1.9; }
body[data-depth="top"] #view-title, body[data-view="inbox"] #view-title { font-size: var(--fs-3xl); font-weight: 720; letter-spacing: var(--tr-heading); font-family: var(--font-display); }
body[data-view="profile"][data-depth="top"] .top-brand { display: inline; }
body[data-view="profile"][data-depth="top"] #view-title { visibility: hidden; }
body[data-view="profile"][data-depth="top"] .topbar .conn { display: inline-block; }

/* Bottom navigation: dark green, active pill + orange dot, orange create button */
.tabbar { background: var(--bg-2); border-top: 1px solid var(--border); padding-top: var(--sp-1); }
.tabbar button, .tabbar button.active { color: var(--text); }
.tabbar .tab-label { font-size: var(--fs-xs); font-weight: 580; color: var(--muted); }
.tabbar button.active .tab-label { color: var(--text); font-weight: 720; }
.tabbar button.active .icon {
  background: var(--panel-2);
  color: var(--text);
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--r-pill);
}
.tabbar button.active::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--coral); margin-top: var(--sp-px); }
.tabbar button.active .tab-avatar .avatar { box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--coral); }
.tabbar .tab-create .tab-create-disc {
  width: 3.9rem;
  height: 3rem;
  border-radius: var(--r-lg);
  background: var(--coral);
  color: var(--on-accent);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--sage-main) 30%, transparent);
}
.tabbar .tab-create .icon { width: 1.6rem; height: 1.6rem; stroke-width: 2.8; padding: 0; background: none; }
.tabbar .tab-create.active::after { display: none; }

/* Shared icon tones */
.tone-green { background: color-mix(in srgb, var(--sage-main) 13%, transparent); color: var(--sage-main); }
.tone-orange { background: color-mix(in srgb, var(--sage-main) 15%, transparent); color: var(--coral); }
.tone-purple { background: color-mix(in srgb, var(--lilac) 15%, transparent); color: var(--lilac); }
.ic-green { color: var(--sage-main); }
.ic-gold { color: var(--butter); }
.ic-purple { color: var(--lilac); }

/* ---------- Profile ---------- */
.profile-column { padding: var(--sp-4) var(--sp-4) var(--sp-6); }
.p-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-5) var(--sp-5) var(--sp-5) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--panel);
}
.p-photo { position: relative; flex: none; }
.p-ring { display: grid; padding: var(--sp-1); border-radius: 50%; border: 3px solid var(--coral); }
.p-ring .avatar.xl { width: 104px; height: 104px; font-size: var(--fs-4xl); box-shadow: none; }
.p-cam {
  position: absolute;
  right: -4px;
  bottom: 2px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid var(--panel);
  background: var(--coral);
  color: var(--on-accent);
}
.p-cam .icon { width: 1.15rem; height: 1.15rem; stroke-width: 2.4; }
.p-info { flex: 1; min-width: 0; display: grid; gap: var(--sp-2); padding-right: var(--sp-8); }
.p-name { font-size: var(--fs-2xl); font-weight: 720; letter-spacing: var(--tr-heading); display: flex; align-items: center; gap: var(--sp-2); overflow-wrap: anywhere; }
.p-online { width: 10px; height: 10px; border-radius: 50%; background: var(--green-dot); flex: none; }
.p-level {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  width: fit-content;
  padding: var(--sp-1-5) var(--sp-4) var(--sp-1-5) var(--sp-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--sage-fill-2);
  background: color-mix(in srgb, var(--sage-main) 8%, transparent);
  font-weight: 640;
  font-size: var(--fs-md);
}
.p-level .icon { color: var(--butter); width: 1.1rem; height: 1.1rem; }
.p-joined { display: flex; align-items: center; gap: var(--sp-2); margin: 0; color: var(--muted); font-size: var(--fs-md); }
.p-joined .icon { width: 1.1rem; height: 1.1rem; }
.p-bio { margin: 0; overflow-wrap: anywhere; }
.p-edit { position: absolute; top: 8px; right: 8px; }
.p-pills { display: flex; gap: var(--sp-1-5); }
.p-statbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: var(--sp-3);
  padding: var(--sp-4) var(--sp-1-5);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--panel);
}
.ps-item { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); min-width: 0; }
.ps-item + .ps-item { border-left: 1px solid var(--border); }
.ps-icon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 50%; }
.ps-icon .icon { width: 1.35rem; height: 1.35rem; }
.ps-text { display: grid; line-height: var(--lh-heading); min-width: 0; }
.ps-text strong { font-family: var(--font-display); font-size: var(--fs-2xl); }
.ps-text span { color: var(--muted); font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin: var(--sp-3) 0; }
.p-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 640;
  font-size: var(--fs-base);
}
.p-btn:hover { border-color: var(--border-strong); background: var(--panel-2); }
.p-btn.primary-btn { background: var(--coral); color: var(--on-accent); border-color: transparent; }
.p-buttons:not(.p-buttons-mine) { grid-template-columns: 1fr 1fr auto; }
.p-btn.p-track.is-tracked { border-color: var(--coral); color: var(--coral); }
.post.is-resurfaced { border-color: color-mix(in srgb, var(--coral) 45%, var(--border)); }
.resurfaced-note { display: flex; align-items: center; gap: 6px; margin: 0; padding: 10px 16px 0; color: var(--coral); font-size: 12px; font-weight: 600; }
.resurfaced-note .icon { width: 14px; height: 14px; }

.lj-card { padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--panel); margin-bottom: var(--sp-3); }
.lj-title { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-lg); font-weight: 720; margin-bottom: var(--sp-3); }
.lj-title .icon { color: var(--sage); }
.lj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--panel-2);
  overflow: hidden;
}
.lj-block { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-4) var(--sp-3); border: 0; background: none; color: inherit; text-align: left; min-width: 0; }
.lj-block:nth-child(odd) { border-right: 1px solid var(--border); }
.lj-block:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
button.lj-block:hover { background: var(--hover); }
.lj-icon { width: 50px; height: 50px; flex: none; display: grid; place-items: center; border-radius: 50%; }
.lj-icon .icon { width: 1.5rem; height: 1.5rem; }
.lj-text { display: grid; gap: var(--sp-px); min-width: 0; }
.lj-label { color: var(--muted); font-size: var(--fs-md); }
.lj-value { font-family: var(--font-display); font-size: var(--fs-xl); overflow-wrap: anywhere; }
.lj-sub { color: var(--muted); font-size: var(--fs-sm); }
.lj-card .badges { margin-top: var(--sp-3); }
.lj-certs { margin: var(--sp-2) 0 0; }

.empty-moments {
  display: grid;
  justify-items: center;
  gap: var(--sp-2);
  margin: var(--sp-3) 0;
  padding: var(--sp-6) var(--sp-4) var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--panel);
  text-align: center;
}
.empty-art { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); color: var(--sage); }
.empty-art .icon { width: 1.9rem; height: 1.9rem; }
.empty-moments h3 { font-size: var(--fs-lg); font-weight: 720; }
.empty-moments p { margin: 0 0 var(--sp-1-5); color: var(--muted); max-width: 34ch; }
.empty-moments .g-cta { margin-top: var(--sp-1); }
.grid-tabs { border-top-color: var(--border); margin: var(--sp-1) 0 0; }
.grid { margin: 0; border-radius: var(--r-lg); overflow: hidden; }
@media (max-width: 420px) {
  .p-card { gap: var(--sp-4); padding: var(--sp-4) var(--sp-4); }
  .p-ring .avatar.xl { width: 84px; height: 84px; }
  .p-name { font-size: var(--fs-xl); }
  .ps-item { flex-direction: column; gap: var(--sp-1-5); text-align: center; }
  .ps-text { justify-items: center; }
}

/* ---------- Circles ---------- */
.c-hero {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: end;
  overflow: hidden;
  margin-bottom: var(--sp-4);
  padding: var(--sp-6) 0 0 var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--panel), var(--panel));
}
.c-hero-text { display: grid; gap: var(--sp-3); justify-items: start; padding-bottom: var(--sp-6); }
.c-hero-text h2 { font-size: clamp(1.45rem, 5vw, 1.9rem); font-weight: 720; line-height: var(--lh-display); letter-spacing: var(--tr-heading); }
.c-hero-text p { margin: 0; color: var(--muted); }
.c-hero .g-kicker { color: var(--coral-text); }
.circles-art { width: 100%; height: auto; max-height: 190px; }
.c-filters { display: flex; gap: var(--sp-2); overflow-x: auto; margin-bottom: var(--sp-4); padding-bottom: var(--sp-0-5); scrollbar-width: none; }
.c-filters::-webkit-scrollbar { display: none; }
.c-filter {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  white-space: nowrap;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 580;
}
.c-filter .icon { width: 1.15rem; height: 1.15rem; }
.c-filter.on { background: var(--coral); color: var(--on-accent); border-color: transparent; }
.cc-list { display: grid; gap: var(--sp-3); }
.cc {
  position: relative;
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--panel);
  cursor: pointer;
  transition: border-color var(--dur-hover), transform var(--dur-press) var(--ease-out);
}
.cc:hover { border-color: var(--border-strong); }
.cc:active { transform: scale(0.99); }
.cc-tile { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: var(--r-lg); background: var(--mint); font-size: var(--fs-3xl); }
.cc-body { flex: 1; min-width: 0; display: grid; gap: var(--sp-1); padding-right: var(--sp-6); }
.cc-kicker { font-size: var(--fs-xs); font-weight: 720; letter-spacing: var(--tr-caps); text-transform: uppercase; color: var(--coral-text); }
.cc-name { font-size: var(--fs-xl); font-weight: 720; }
.cc-desc { margin: 0; color: var(--muted); font-size: var(--fs-md); }
.cc-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-2); }
.cc-people { display: flex; align-items: center; gap: var(--sp-3); }
.cc-stack { display: flex; padding-right: var(--sp-2); }
.cc-stack .avatar { margin-right: -10px; box-shadow: 0 0 0 2px var(--panel); }
.cc-join {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1-5);
  padding: var(--sp-2) var(--sp-6);
  border: 0;
  border-radius: var(--r-pill);
  background: var(--coral);
  color: var(--on-accent);
  font-weight: 720;
}
.cc-join.joined { background: none; border: 1px solid var(--border-strong); color: var(--text); }
.cc-join .icon { width: 1rem; height: 1rem; }
.cc-menu { position: absolute; top: 8px; right: 4px; }

/* ---------- Learn ---------- */
.lp-head { display: flex; align-items: flex-start; gap: var(--sp-2); }
.lp-head-text { flex: 1; min-width: 0; }
.path-art { width: 150px; flex: none; margin: -6px -4px 0 0; }
@media (max-width: 420px) { .path-art { width: 104px; } }
.lp { list-style: none; margin: var(--sp-5) 0 0; padding: 0; }
.lp-level { display: grid; grid-template-columns: 50px 1fr; gap: var(--sp-3); }
.lp-rail { display: flex; flex-direction: column; align-items: center; }
.lp-marker {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 720;
  font-size: var(--fs-xl);
}
.lp-marker.in-progress { background: var(--coral); color: var(--on-accent); border: 0; box-shadow: 0 0 0 6px color-mix(in srgb, var(--sage-main) 18%, transparent); }
.lp-marker.complete { background: var(--sage-main); color: var(--on-accent); border: 0; }
.lp-marker .icon { width: 1.4rem; height: 1.4rem; stroke-width: 3; }
.lp-line {
  position: relative;
  flex: 1;
  width: 3px;
  min-height: 28px;
  margin: var(--sp-1-5) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-xs);
  background: var(--border);
}
.lp-line.done { background: var(--coral); }
.lp-line.dashed { background: repeating-linear-gradient(to bottom, var(--border-strong) 0 6px, transparent 6px 12px); }
.lp-lock { position: absolute; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); color: var(--muted); }
.lp-lock .icon { width: 0.95rem; height: 0.95rem; }
.lp-card {
  display: grid;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--panel);
  min-width: 0;
}
.lp-card.in-progress { border-color: color-mix(in srgb, var(--sage-main) 35%, transparent); }
.lp-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); }
.lp-kicker { margin: 0 0 var(--sp-0-5); font-weight: 640; font-size: var(--fs-md); color: var(--muted); }
.lp-kicker.in-progress { color: var(--coral-text); }
.lp-kicker.complete { color: var(--sage); }
.lp-title { font-size: var(--fs-xl); font-weight: 720; letter-spacing: var(--tr-heading); }
.lp-desc { margin: 0; color: var(--muted); }
.lp-card-head .ring-wrap, .lp-card-head .ring { width: 56px; height: 56px; }
.lp-card-head .ring-track { stroke: var(--panel-2); }
.growth-art { width: 84px; flex: none; }
.leaf-art { width: 66px; flex: none; }
.lp-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.lp-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: var(--fs-md);
}
button.lp-chip:hover { border-color: var(--border-strong); }
.lp-chip .icon { width: 1.05rem; height: 1.05rem; color: var(--muted); }
.lp-chip.done .icon { color: var(--sage); }
.lp-cta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-4) var(--sp-4);
  border: 0;
  border-radius: var(--r-lg);
  background: var(--coral);
  color: var(--on-accent);
  font-weight: 720;
  font-size: var(--fs-base);
}
.lp-cta .icon { width: 1.2rem; height: 1.2rem; }
.lp-cta-chev { margin-left: auto; display: inline-flex; }
.lp-cta.quiet { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.lp-locked { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); color: var(--muted); }
.lp-locked .icon { width: 1.15rem; height: 1.15rem; }
.lp-lessons summary { cursor: pointer; color: var(--muted); font-weight: 580; padding: var(--sp-0-5) 0; }
.lp-lessons[open] summary { margin-bottom: var(--sp-2); }
.lp-lessons .lesson-list { padding: 0 var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); }
.lesson-row { border-bottom-color: var(--border); color: var(--text); }

/* Illustration colours */
.art-hill { fill: #22331F; }
.art-hill.back { fill: #1A2919; }
.art-trail { fill: none; stroke: #F6D0A8; stroke-width: 2; stroke-dasharray: 4 5; stroke-linecap: round; }
.art-dot, .art-sun { fill: var(--coral); }
.art-flag-pole { stroke: #1A1F16; stroke-width: 2; }
.art-flag { fill: #1A1F16; }
.art-bar { fill: #3E6B3A; }
.art-arrow { fill: none; stroke: var(--coral); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.art-leaf { fill: #4E8A48; }
.art-leaf.light { fill: var(--sage-main); }
.art-stem { fill: none; stroke: #3E6B3A; stroke-width: 2; }
.art-table { fill: #5A3B24; }
.art-book { fill: #2B2F2A; stroke: #3B4D40; }
.art-book-line { stroke: #A9A08F; stroke-width: 2; stroke-linecap: round; }
.art-pot { fill: #8A5A3A; }
.art-mug { fill: #CBB79C; }
.art-handle { fill: none; stroke: #CBB79C; stroke-width: 7; stroke-linecap: round; }
.art-star { stroke: #3A2A1E; stroke-width: 3; stroke-linecap: round; }
.art-steam { fill: none; stroke: rgba(241, 236, 225, 0.3); stroke-width: 2.5; stroke-linecap: round; }

/* ---------- Home ---------- */
.feed-column { padding: 0 var(--sp-3) var(--sp-6); }
.stories { border-bottom: 0; padding: var(--sp-4) var(--sp-0-5) var(--sp-3); }
.story-ring { background: conic-gradient(from 200deg, var(--coral), #F6C08F, var(--sage-main), var(--coral)); }
.story-ring.me { background: var(--coral); }
.story-ring.circle, .story-ring.add { background: var(--border-strong); }
.story-ring .avatar { box-shadow: 0 0 0 3px var(--bg); }
.circle-av { background: var(--mint); color: var(--text); }
.circle-av.explore { background: var(--panel-2); }
.story-plus { box-shadow: 0 0 0 3px var(--bg); }
.explore-label { display: inline-flex; align-items: center; gap: var(--sp-px); }
.explore-label .icon { width: 0.85rem; height: 0.85rem; }
.compose-card {
  display: grid;
  gap: var(--sp-3);
  margin: var(--sp-1) 0 var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--panel-2);
}
.compose-row { display: flex; align-items: center; gap: var(--sp-3); }
.compose-row .avatar { width: 44px; height: 44px; }
.compose-input {
  flex: 1;
  min-width: 0;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--muted);
  text-align: left;
  font-size: var(--fs-base);
}
.compose-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.compose-chips button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-1-5);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text);
  font-weight: 580;
}
.compose-chips button:hover { border-color: var(--border-strong); }
#feed-trends .trend-chips { padding: 0 0 var(--sp-3); }
.trend-label { color: var(--sage); }
.trend-chip { background: var(--panel); border-color: var(--border); color: var(--text); }
select.attention { outline: 3px solid var(--coral); outline-offset: 2px; }

.post-list { gap: 0; }
.post {
  margin-bottom: var(--sp-4);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--panel);
}
.post-head { padding: var(--sp-4) var(--sp-1-5) var(--sp-2) var(--sp-4); gap: var(--sp-3); }
.post-head .avatar.md { box-shadow: none; }
.post-who strong, .post-who .user-link { font-size: var(--fs-base); }
.circle-tag { color: var(--coral-text); text-transform: none; }
.post-text { position: relative; padding: var(--sp-0-5) var(--sp-4) var(--sp-3); }
.post-title { margin: 0; font-weight: 640; font-size: var(--fs-base); overflow-wrap: anywhere; }
.post-desc { margin: var(--sp-1) 0 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.post-text .burst { position: absolute; inset: 0; }
.post-media { margin: 0 var(--sp-4); border-radius: var(--r-lg); overflow: hidden; background: var(--panel-2); }
.post-img { max-height: 520px; object-fit: cover; }
.post-body { padding: var(--sp-2) var(--sp-4) var(--sp-3); }
.post-actions { gap: var(--sp-4); margin-left: -6px; }
.icon-action { display: inline-flex; align-items: center; gap: var(--sp-1-5); min-width: auto; padding: var(--sp-1-5); color: var(--text); font-weight: 580; font-size: var(--fs-base); }
.icon-action .icon { width: 1.55rem; height: 1.55rem; }
.like.liked { color: var(--coral); }
.like .glyph { width: 1.55rem; height: 1.55rem; }
.comments li { color: var(--text); }
.comment-form input { color: var(--text); }
.suggest { background: transparent; border-bottom: 0; padding: var(--sp-1) 0 var(--sp-5); }
.suggest-head { padding: 0 var(--sp-0-5) var(--sp-3); }
.suggest .g-people { padding: 0 var(--sp-0-5) var(--sp-1); }
.g-person { background: var(--panel); border-color: var(--border); }
.thumb-text.tone-0, .thumb-text.tone-1, .thumb-text.tone-2, .thumb-text.tone-3 { background: var(--panel-2); color: var(--text); }

/* ---------- Messages ---------- */
#inbox-view { background: radial-gradient(circle at 105% -5%, rgba(95, 140, 80, 0.2), transparent 45%); }
#inbox-view .page-title { display: none; }
#inbox-view .section-head { padding: var(--sp-4) var(--sp-1) var(--sp-3); font-size: var(--fs-sm); letter-spacing: var(--tr-caps); color: #9DB396; }
#inbox-view .section-head .icon-btn { color: var(--text); }
#inbox-view .conv-list { display: grid; gap: var(--sp-3); }
.ib-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-1) var(--sp-4) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--panel);
  cursor: pointer;
  transition: border-color var(--dur-hover), transform var(--dur-press) var(--ease-out);
}
.ib-row:hover { border-color: var(--border-strong); }
.ib-row:active { transform: scale(0.99); }
.ib-avatar .avatar.lg, .ib-avatar .chan-avatar { width: 58px; height: 58px; }
.presence-dot { position: absolute; right: 0; bottom: 2px; width: 15px; height: 15px; border-radius: 50%; border: 3px solid var(--panel); }
.presence-dot.on { background: var(--green-dot); }
.presence-dot.off { background: #7E8780; }
.ib-main { flex: 1; min-width: 0; display: grid; gap: var(--sp-0-5); }
.ib-name { font-size: var(--fs-lg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-preview { color: var(--muted); font-size: var(--fs-base); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.ib-row.unread .ib-preview { color: var(--text); }
.muted-italic { font-style: italic; }
.ib-side { display: grid; justify-items: end; gap: var(--sp-2); align-self: flex-start; padding-top: var(--sp-1); white-space: nowrap; }
.ib-time { font-size: var(--fs-sm); color: var(--muted); }
.ib-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--coral); }
.ib-count { min-width: 26px; height: 26px; padding: 0 var(--sp-2); display: grid; place-items: center; border-radius: var(--r-pill); background: var(--coral); color: var(--on-accent); font-weight: 720; font-size: var(--fs-sm); }
.ib-status { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); color: var(--muted); }
.ib-status .icon { width: 1rem; height: 1rem; }
.ib-menu { align-self: center; }
.chan-avatar { display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--text); flex: none; }
.chan-avatar .icon { width: 1.5rem; height: 1.5rem; stroke-width: 2.4; }

/* =====================================================================
   Circles page — redesign spec (Gather_Circles_.pdf, 18 Oct 2026).
   Spec tokens applied app-wide where they refine the existing ones.
   ===================================================================== */
:root {
  --bg: #151E15;
  --bg-2: #18231A;
  --panel: #1C271B;
  --panel-2: #202E20;
  --card-grad: linear-gradient(160deg, #202E20 0%, #172318 100%);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --coral: #FF985E;
  --coral-2: #FFB083;
  --coral-text: #E9AD7A;      /* category labels, hero eyebrow */
  --text: #F7F6EE;
  --ink: #F7F6EE;
  --cream: #F7F6EE;
  --muted: #BFC6B8;
}

/* Header: larger bold title on a dark gradient */
.topbar { background: linear-gradient(180deg, #1B2719 0%, #151E15 100%); border-bottom-color: var(--border); }
.top-actions { gap: var(--sp-1-5); }

#circles-view .column { padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); }

/* Hero: artwork fills the card; a dark-to-clear overlay keeps the copy readable */
.c-hero {
  position: relative;
  display: block;
  min-height: 252px;
  margin-bottom: var(--sp-4);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  background: var(--panel);
  isolation: isolate;
}
.c-hero-media { position: absolute; inset: 0 0 0 40%; z-index: -2; }
.c-hero-art, .c-hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.c-hero-media.has-photo .c-hero-art { display: none; }
.c-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, var(--panel) 0%, var(--panel) 44%, rgba(28, 39, 27, 0.78) 56%, rgba(28, 39, 27, 0.2) 78%, rgba(28, 39, 27, 0) 100%);
}
.c-hero-text {
  position: relative;
  display: grid;
  gap: var(--sp-2);
  justify-items: start;
  max-width: 56%;
  padding: var(--sp-6) 0 var(--sp-6) var(--sp-5);
}
.c-hero-text .g-kicker { color: var(--coral-text); font-size: var(--fs-2xs); }
.c-hero-text h2 { font-size: var(--fs-2xl); line-height: var(--lh-heading); font-weight: 720; letter-spacing: var(--tr-heading); color: var(--text); }
.c-hero-text p { margin: 0; color: var(--muted); font-size: var(--fs-md); line-height: var(--lh-body); }
.c-hero .g-cta { margin-top: var(--sp-1-5); padding: var(--sp-3) var(--sp-5); font-size: var(--fs-base); background: var(--coral); color: #1A1F16; box-shadow: 0 6px 18px rgba(255, 152, 94, 0.28); }
.c-hero .g-cta .icon { width: 1.05rem; height: 1.05rem; }
@media (max-width: 380px) {
  .c-hero-text { max-width: 58%; padding: var(--sp-5) 0 var(--sp-5) var(--sp-4); }
  .c-hero-text h2 { font-size: var(--fs-xl); }
  .c-hero-text p { font-size: var(--fs-md); }
  .c-hero-text .g-kicker { font-size: var(--fs-2xs); letter-spacing: var(--tr-caps); white-space: nowrap; }
  .c-hero-media { inset: 0 0 0 44%; }
}

/* Filters: compact pills; active orange, inactive translucent green */
.c-filters { gap: var(--sp-2); margin: 0 -16px var(--sp-4); padding: 0 var(--sp-4) var(--sp-0-5); scroll-padding-inline: 16px; scroll-snap-type: x proximity; }
.c-filter {
  gap: var(--sp-1-5);
  padding: var(--sp-1-5) var(--sp-3);
  min-height: 38px;
  font-size: var(--fs-sm);
  font-weight: 580;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  scroll-snap-align: start;
}
.c-filter .icon { width: 1.05rem; height: 1.05rem; }
.c-filter:hover { border-color: var(--border-strong); }
.c-filter.on { background: var(--coral); color: #1A1F16; border-color: transparent; }

/* Circle cards: icon left, text right, full-width footer */
.cc-list { gap: var(--sp-4); }
.cc {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  column-gap: var(--sp-4);
  row-gap: var(--sp-4);
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--card-grad);
  box-shadow: 0 8px 24px rgba(4, 20, 12, 0.18);
}
.cc-tile { width: 76px; height: 76px; border-radius: var(--r-lg); background: rgba(0, 0, 0, 0.22); font-size: var(--fs-4xl); }
.cc-body { gap: var(--sp-1); padding-right: var(--sp-6); align-content: start; }
.cc-kicker { font-size: var(--fs-2xs); color: var(--coral-text); }
.cc-name {
  font-size: var(--fs-lg);
  line-height: var(--lh-snug);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.cc-desc {
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cc-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin: 0; flex-wrap: nowrap; }
.cc-people { min-width: 0; gap: var(--sp-2); }
.cc-stack .avatar { width: 30px; height: 30px; font-size: var(--fs-xs); box-shadow: 0 0 0 2px var(--panel); }
.cc-meta { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-join { flex: none; padding: var(--sp-1-5) var(--sp-4); min-height: 38px; font-size: var(--fs-md); background: var(--coral); color: #1A1F16; }
.cc-join .icon { width: 0.95rem; height: 0.95rem; }
.cc-join.joined { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-strong); color: var(--text); }
.cc-join:disabled { opacity: 0.7; cursor: progress; }
.cc-menu { top: 10px; right: 6px; color: var(--text); }

/* Feed fixes: the horizontally-scrolling "Suggested for you" row must never widen the
   feed column (grid items default to min-width:auto), and author names align left. */
.post-list { grid-template-columns: minmax(0, 1fr); }
.post-list > *, .suggest, .feed-column > * { min-width: 0; max-width: 100%; }
.post-who { justify-items: start; }
.post-who .user-link { text-align: left; }

/* Loading placeholders shaped like cards */
.cc-skeleton { box-shadow: none; }
.cc-skeleton .cc-body { gap: var(--sp-2); padding-top: var(--sp-1); }
.cc-skeleton .sk-line { height: 0.75rem; }
.sk-pill { width: 84px; height: 36px; border-radius: var(--r-pill); display: block; }
.sk {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
}

/* Bottom navigation: integrated dark green, Circles active pill + orange dot */
.tabbar { background: #18231A; border-top: 1px solid var(--border); padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.tabbar .tab-create .tab-create-disc { background: var(--coral); box-shadow: 0 6px 18px rgba(255, 152, 94, 0.3); }

/* Sheets and the rest */
.sheet-title { margin: 0 0 var(--sp-1); padding: 0 var(--sp-2); font-weight: 720; color: var(--muted); font-size: var(--fs-md); }
.sheet-list button { color: var(--text); }
.sheet-list .danger { color: var(--red); }
.seg { background: var(--panel); border: 1px solid var(--border); }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: none; }
.msg-bubble { background: var(--panel-2); }
.msg.mine .msg-bubble { background: var(--coral-soft); color: var(--text); }
.reply-bar { background: var(--panel-2); }
.composer textarea { background: var(--panel-2); }
.toast { background: var(--text); color: var(--bg); }

/* =====================================================================
   Market green theme (Capital Commons, 19 Oct 2026), light and dark.
   Light is the default; theme.js sets <html data-theme="dark"> when the
   person picks Dark. All text pairs checked at 4.5:1 or better.
   How each swatch is used:
     paper     page and top bar (cool green-grey, calm for long reading)
     card      cards, bottom bar
     mint      composer, chips, unread rows, hero cards, icon tiles
     green     buttons, active tab, progress, icon fills ("growth")
     gold      recognition only: tiers, badges, top-three ranks
   The --coral* / --sage* names are kept so every component picks this
   up; they now hold market-green values.
   ===================================================================== */
:root {
  --cream-bg: #EEF3EF;   /* paper */
  --offwhite: #FBFDFB;   /* card */
  --mint: #D9EBE0;       /* highlight */
  --sage-main: #1B7A50;  /* accent: market green */
  --forest: #12241B;     /* text: deep ink green */
  --sage-deep: #146343;  /* links and labels on light colours */
  --on-deep: #FFFFFF;
  --gold-mark: #B7860B;  /* recognition */
  --gold-mark-soft: #F6EDD3;
  --duo-fill: rgba(27, 122, 80, 0.2);
  --hero-rgb: 217, 235, 224;
  --tone-green-text: #1A6B45;
  --hill-1: #BFDCCB;
  --hill-2: #D9EBE0;
  --wall-1: #E3F0E8;
  --wall-2: #C9E1D3;
  --steam: rgba(18, 36, 27, 0.25);
  --sk-1: rgba(18, 36, 27, 0.05);
  --sk-2: rgba(18, 36, 27, 0.1);
  --lift: 0 1px 2px rgba(18, 36, 27, 0.05), 0 8px 22px rgba(18, 36, 27, 0.06);

  --bg: var(--cream-bg);
  --bg-2: var(--cream-bg);
  --panel: var(--offwhite);
  --panel-2: #F4F8F5;
  --sidebar: var(--cream-bg);
  --hover: #E4ECE6;
  --border: #D8E2DB;
  --border-strong: #BFCEC4;
  --card-grad: linear-gradient(160deg, var(--offwhite) 0%, var(--panel-2) 100%);
  --ink: var(--forest);
  --text: var(--forest);
  --cream: var(--forest);
  --muted: #50605A;
  --coral: var(--sage-main);
  --coral-2: #4FA27B;
  --coral-text: var(--sage-deep);
  --coral-soft: var(--mint);
  --on-accent: #FFFFFF;
  --accent: var(--sage-main);
  --accent-text: #FFFFFF;
  --sage-fill: var(--cream-bg);
  --sage-fill-2: #9CC9B0;
  --on-sage: var(--forest);
  --sage: var(--sage-deep);
  --sage-soft: var(--mint);
  --green-dot: #23A162;
  --butter: #8A6510;
  --butter-soft: #F6EDD3;
  --lilac: #4B5BB8;
  --lilac-soft: #E6E9F7;
  --sky-soft: #E3EEF0;
  --navy: var(--forest);
  --navy-2: #2A3D33;
  --gold: var(--sage-main);
  --gold-text: var(--sage-deep);
  --gold-soft: var(--mint);
  --green: var(--sage-deep);
  --green-soft: var(--mint);
  --red: #B23A30;
  --red-soft: #F7DEDA;
  --danger: var(--red);
  --ok: var(--sage-deep);
  --mine: var(--mint);
  --like: #C2453A;
  --status-pending: #F3E2C6;
  --status-pending-text: #6E4A12;
  --status-rejected: #F6DCDC;
  --status-rejected-text: #7A2E2E;
  --status-approved-text: #1E4A33;
  --chart-1: var(--forest);
  --chart-2: var(--sage-main);
  --chart-3: #9CC9B0;
  --chart-4: #CBD8CF;
  --shadow: var(--lift);
  color-scheme: light;
}

/* Dark: a trading-terminal night mode. Deep ink-green surfaces, brighter
   green for actions (with dark labels), soft gold for recognition. */
:root[data-theme="dark"] {
  --cream-bg: #0D1612;
  --offwhite: #14201A;
  --mint: #183328;
  --sage-main: #3DBE82;
  --forest: #E8F1EB;
  --sage-deep: #7ED9AA;
  --on-deep: #0B1A12;
  --gold-mark: #E2B648;
  --gold-mark-soft: #2E2814;
  --duo-fill: rgba(61, 190, 130, 0.24);
  --hero-rgb: 24, 51, 40;
  --tone-green-text: #86D9AE;
  --hill-1: #1F3D30;
  --hill-2: #183328;
  --wall-1: #183328;
  --wall-2: #12261D;
  --steam: rgba(232, 241, 235, 0.3);
  --sk-1: rgba(255, 255, 255, 0.04);
  --sk-2: rgba(255, 255, 255, 0.09);
  --lift: none;

  --panel-2: #182620;
  --hover: #1C2B24;
  --border: #22342A;
  --border-strong: #33493D;
  --muted: #A8B9AF;
  --coral-2: #2E9566;
  --on-accent: #06140D;
  --accent-text: #06140D;
  --sage-fill-2: #2B5A43;
  --green-dot: #4CD08E;
  --butter: #E2B648;
  --butter-soft: #2E2814;
  --lilac: #A9B4F2;
  --lilac-soft: #232842;
  --sky-soft: #172628;
  --navy: #1E2E26;
  --navy-2: #2A3D33;
  --red: #F0968E;
  --red-soft: #3A2220;
  --like: #F08A80;
  --status-pending: #4A3322;
  --status-pending-text: #F3C9A6;
  --status-rejected: #3F2424;
  --status-rejected-text: #F0BDBD;
  --status-approved-text: #BFE3CD;
  --chart-1: #E2ECE5;
  --chart-3: #2E7A57;
  --chart-4: #2F4239;
  color-scheme: dark;
}

/* ---------- Icons: two-tone (outline + soft sage fill) ---------- */
.icon { --duo: var(--duo-fill); }
.d { fill: var(--duo, none); }
.tabbar button.active .icon { --duo: rgba(255, 255, 255, 0.45); }
.tab-create .icon, .primary .icon, .g-cta .icon, .lp-cta .icon, .cc-join .icon,
.c-filter.on .icon, .p-cam .icon, .p-btn.primary-btn .icon { --duo: rgba(255, 255, 255, 0.4); }
.like.liked .glyph { --duo: currentColor; }
.icon-btn:hover .icon, .icon-action:hover .icon { --duo: rgba(27, 122, 80, 0.55); }
.icon-btn .icon, .icon-action .icon, .tabbar .icon { transition: transform 0.35s var(--ease-spring), --duo 0.2s; }

/* ---------- Bars ---------- */
.topbar { background: var(--cream-bg); border-bottom-color: var(--border); }
.tabbar { background: var(--offwhite); border-top: 1px solid var(--border); }
.tabbar button.active .icon { background: var(--sage-main); color: var(--on-accent); }
.tabbar button.active .tab-label { color: var(--text); }
.tabbar button.active::after { background: var(--sage-deep); }
.tabbar button.active .tab-avatar .avatar { box-shadow: 0 0 0 2px var(--offwhite), 0 0 0 4px var(--sage-main); }
.tabbar .tab-create .tab-create-disc, .c-hero .g-cta { box-shadow: 0 6px 18px rgba(20, 99, 67, 0.25); }
.topbar .bell-badge { box-shadow: 0 0 0 2px var(--cream-bg); }
.theme-btn .sun, :root[data-theme="dark"] .theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: inline; }
.theme-btn .icon { transition: transform 0.5s var(--ease-spring); }
.theme-btn:active .icon { transform: rotate(-40deg) scale(0.85); }

/* ---------- Cards: off-white, with mint for the friendly ones ---------- */
.post, .cc, .ib-row, .p-card, .p-statbar, .lj-card, .lp-card, .empty-moments, .compose-card { box-shadow: var(--lift); }
.compose-card { background: var(--mint); border-color: transparent; }
.compose-input, .compose-chips button { background: var(--offwhite); border-color: transparent; }
.trend-chip { background: var(--mint); border-color: transparent; }
.ib-row.unread { background: var(--mint); border-color: transparent; }
.p-card { background: linear-gradient(160deg, var(--mint) 0%, var(--offwhite) 75%); }
.lp-card.in-progress { background: linear-gradient(160deg, var(--mint) 0%, var(--offwhite) 70%); border-color: var(--sage-main); }
.seg button.on { background: var(--sage-main); color: var(--on-accent); }

/* Icon tones and badges */
.tone-green { background: var(--mint); color: var(--tone-green-text); }
.tone-orange { background: var(--butter-soft); color: var(--butter); }
.tone-purple { background: var(--lilac-soft); color: var(--lilac); }
.ic-green { color: var(--tone-green-text); }
.p-level { background: var(--offwhite); border-color: var(--sage-fill-2); }

/* Circles */
.c-hero { background: var(--mint); }
.c-hero::after { background: linear-gradient(90deg, rgb(var(--hero-rgb)) 0%, rgb(var(--hero-rgb)) 44%, rgba(var(--hero-rgb), 0.8) 56%, rgba(var(--hero-rgb), 0.2) 78%, rgba(var(--hero-rgb), 0) 100%); }
.c-filter { background: var(--offwhite); }
.c-filter.on, .cc-join { color: var(--on-accent); }
.cc-tile, .circle-av, .chan-avatar { background: var(--mint); }
.cc-stack .avatar { box-shadow: 0 0 0 2px var(--offwhite); }
.cc-join.joined { background: var(--offwhite); }
.wall-1 { stop-color: var(--wall-1); }
.wall-2 { stop-color: var(--wall-2); }
.scene-steam { stroke: var(--steam); }

/* Learn */
.lp-marker.in-progress { box-shadow: 0 0 0 6px rgba(27, 122, 80, 0.3); }
.lp-marker.complete { background: var(--sage-deep); color: var(--on-deep); }
.art-hill { fill: var(--hill-1); }
.art-hill.back { fill: var(--hill-2); }
.art-trail { stroke: var(--sage-deep); }
.art-steam { stroke: var(--steam); }

/* Home, messages, misc */
.story-ring { background: conic-gradient(from 200deg, var(--sage-main), var(--mint), var(--sage-deep), var(--sage-main)); }
.like.liked { color: var(--like); }
#inbox-view { background: radial-gradient(circle at 105% -5%, rgba(27, 122, 80, 0.22), transparent 45%); }
#inbox-view .section-head { color: var(--muted); }
.sk { background: linear-gradient(90deg, var(--sk-1) 25%, var(--sk-2) 50%, var(--sk-1) 75%); background-size: 200% 100%; }
.msg.mine .msg-bubble { background: var(--mint); }

/* Letter avatars: soft pastel of each person's colour with dark letters */
.avatar { background: hsl(var(--h, 330) 34% 84%); color: hsl(var(--h, 330) 40% 22%); }
:root[data-theme="dark"] .avatar { background: hsl(var(--h, 330) 24% 30%); color: hsl(var(--h, 330) 45% 88%); }

/* Appearance picker in Settings */
.theme-pick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.theme-pick button {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--offwhite);
  color: var(--text);
  font-weight: 640;
  text-align: left;
}
.theme-pick button.on { border-color: var(--sage-main); background: var(--mint); }
.theme-strip { display: flex; height: 28px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); }
.theme-strip span { flex: 1; }
.theme-swatch { height: 44px; border-radius: var(--r-sm); }
.theme-pick .label { display: flex; align-items: center; gap: var(--sp-1-5); }
.theme-custom-btn { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); margin-top: var(--sp-3); width: 100%; }

/* ---------- Theme window ---------- */
.theme-dialog { width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: var(--sp-5); border-radius: var(--r-2xl); background: var(--panel); color: var(--text); overflow-y: auto; }
.theme-dialog::backdrop { background: rgba(3, 12, 8, 0.45); backdrop-filter: blur(3px); }
.theme-dialog[open] { animation: theme-pop 0.32s var(--ease-spring); }
@keyframes theme-pop { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
.theme-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.theme-head h2 { margin: 0; font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 720; letter-spacing: var(--tr-heading); }
.theme-modes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-1-5); padding: var(--sp-1-5); border-radius: var(--r-pill); background: var(--mint); }
.theme-modes button { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); padding: var(--sp-2); border: 0; border-radius: var(--r-pill); background: none; color: var(--text); font-weight: 640; }
.theme-modes button.on { background: var(--sage-main); color: var(--on-accent); box-shadow: 0 4px 12px rgba(4, 20, 12, 0.12); }
.theme-modes button.on .icon { --duo: rgba(255, 255, 255, 0.45); }
.theme-label { margin: var(--sp-5) var(--sp-0-5) var(--sp-2); font-size: var(--fs-sm); font-weight: 720; letter-spacing: var(--tr-caps); text-transform: uppercase; color: var(--muted); }
.theme-label .muted { letter-spacing: var(--tr-label); text-transform: none; font-weight: 580; }
.theme-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.theme-presets button { display: grid; gap: var(--sp-1-5); padding: var(--sp-2); border: 2px solid var(--border); border-radius: var(--r-lg); background: var(--offwhite); color: var(--text); font-size: var(--fs-sm); font-weight: 640; text-align: left; transition: border-color var(--dur-hover), transform var(--dur-press) var(--ease-out); }
.theme-presets button:hover { border-color: var(--border-strong); }
.theme-presets button.on { border-color: var(--sage-main); background: var(--mint); }
.theme-presets button span:last-child { line-height: var(--lh-snug); overflow-wrap: anywhere; }
.tc-list { display: grid; gap: var(--sp-1-5); }
.tc-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--offwhite); cursor: pointer; margin: 0; }
.tc-row:hover { border-color: var(--border-strong); }
.tc-row input[type="color"] { flex: none; width: 44px; height: 44px; padding: 0; border: 2px solid var(--border-strong); border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
.tc-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.tc-row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.tc-row input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }
.tc-row input[type="color"]:focus-visible { outline: 3px solid var(--sage-main); outline-offset: 2px; }
.tc-text { flex: 1; min-width: 0; display: grid; }
.tc-text strong { font-size: var(--fs-base); }
.tc-text small { color: var(--muted); font-size: var(--fs-sm); }
.tc-hex { font-size: var(--fs-sm); font-weight: 640; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: var(--tr-label); }
.theme-preview { margin-top: var(--sp-4); padding: var(--sp-4); border-radius: var(--r-lg); background: var(--cream-bg); border: 1px solid var(--border); }
.tp-card { padding: var(--sp-3); border-radius: var(--r-lg); background: var(--offwhite); border: 1px solid var(--border); display: grid; gap: var(--sp-2); }
.tp-who { display: flex; align-items: center; gap: var(--sp-3); }
.tp-who > span:last-child { display: grid; line-height: var(--lh-snug); }
.tp-who small { color: var(--muted); font-size: var(--fs-xs); }
.tp-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--text); font-weight: 720; }
.tp-text { margin: 0; font-weight: 580; }
.tp-link { color: var(--sage-deep); font-weight: 720; }
.tp-actions { display: flex; align-items: center; justify-content: space-between; }
.tp-chip { display: inline-flex; align-items: center; gap: var(--sp-1-5); padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-2); border-radius: var(--r-pill); background: var(--mint); font-weight: 640; font-size: var(--fs-md); }
.tp-chip .icon { width: 1.1rem; height: 1.1rem; }
.tp-btn { padding: var(--sp-1-5) var(--sp-5); border-radius: var(--r-pill); background: var(--sage-main); color: var(--on-accent); font-weight: 720; font-size: var(--fs-md); }
.theme-ratio { display: flex; gap: var(--sp-2); align-items: flex-start; margin: var(--sp-3) var(--sp-0-5) 0; color: var(--muted); font-size: var(--fs-sm); }
.theme-ratio .icon { flex: none; width: 1.1rem; height: 1.1rem; color: var(--sage-deep); }
.theme-dialog .dialog-actions { margin-top: var(--sp-4); }
@media (max-width: 380px) { .theme-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Color Hunt palettes */
.hunt-label { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.hunt-credit { font-size: var(--fs-xs); letter-spacing: var(--tr-label); text-transform: none; color: var(--sage-deep); font-weight: 640; }
.hunt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); }
.hunt-tile { display: grid; gap: var(--sp-1); padding: var(--sp-1) var(--sp-1) var(--sp-1-5); border: 2px solid transparent; border-radius: var(--r-md); background: var(--offwhite); color: var(--muted); transition: border-color var(--dur-hover), transform var(--dur-press) var(--ease-out); }
.hunt-tile:hover { border-color: var(--border-strong); }
.hunt-tile.on { border-color: var(--sage-main); background: var(--mint); color: var(--text); }
.hunt-bands { display: grid; grid-template-rows: 3fr 2fr 1.5fr 1fr; height: 72px; border-radius: var(--r-sm); overflow: hidden; }
.hunt-likes { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1); font-size: var(--fs-xs); font-weight: 640; font-variant-numeric: tabular-nums; }
.hunt-likes .icon { width: 0.8rem; height: 0.8rem; }
.hunt-more { display: block; margin: var(--sp-2) auto 0; }
.hunt-paste { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.hunt-paste input { flex: 1; min-width: 0; margin: 0; }

/* =====================================================================
   Cinematic layer (cinema.js + setView): screens slide in the direction
   you travel, the bars stay put, photos zoom out of their posts, cards
   rise into view, and the tab highlight glides between tabs.
   ===================================================================== */
:root { --cine-ease: cubic-bezier(0.2, 0.8, 0.2, 1); --cine-ease-in: cubic-bezier(0.4, 0, 0.2, 1); }

/* The top and bottom bars hold still while the screen between them moves. */
.topbar { view-transition-name: topbar; }
.tabbar { view-transition-name: tabbar; }
::view-transition-group(root) { animation-duration: 0.44s; }
::view-transition-old(topbar), ::view-transition-new(topbar), ::view-transition-old(tabbar), ::view-transition-new(tabbar) { animation-duration: 0.25s; }

html[data-nav="right"]::view-transition-old(root) { animation: 0.36s var(--cine-ease-in) both cine-out-left; }
html[data-nav="right"]::view-transition-new(root) { animation: 0.44s var(--cine-ease) both cine-in-right; }
html[data-nav="left"]::view-transition-old(root) { animation: 0.36s var(--cine-ease-in) both cine-out-right; }
html[data-nav="left"]::view-transition-new(root) { animation: 0.44s var(--cine-ease) both cine-in-left; }
html[data-nav="forward"]::view-transition-old(root) { animation: 0.42s var(--cine-ease-in) both cine-sink; }
html[data-nav="forward"]::view-transition-new(root) { animation: 0.46s var(--cine-ease) both cine-push; }
html[data-nav="back"]::view-transition-old(root) { animation: 0.38s var(--cine-ease-in) both cine-pop; z-index: 2; }
html[data-nav="back"]::view-transition-new(root) { animation: 0.46s var(--cine-ease) both cine-rise; }

@keyframes cine-out-left { to { transform: translateX(-14%); opacity: 0; filter: blur(2px); } }
@keyframes cine-out-right { to { transform: translateX(14%); opacity: 0; filter: blur(2px); } }
@keyframes cine-in-right { from { transform: translateX(16%); opacity: 0; } }
@keyframes cine-in-left { from { transform: translateX(-16%); opacity: 0; } }
@keyframes cine-sink { to { transform: scale(0.93); opacity: 0; filter: blur(4px) brightness(0.9); } }
@keyframes cine-push { from { transform: translateX(32%); opacity: 0; } }
@keyframes cine-pop { to { transform: translateX(32%); opacity: 0; } }
@keyframes cine-rise { from { transform: scale(0.93); opacity: 0; filter: blur(4px); } }

/* Gliding tab highlight */
.tabbar { position: relative; }
.tabbar button { position: relative; z-index: 1; }
.tabbar button.active .icon { background: transparent !important; color: var(--on-accent); }
.tab-glow {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  width: 58px;
  height: 32px;
  border-radius: var(--r-pill);
  background: var(--sage-main);
  box-shadow: 0 6px 16px rgba(4, 20, 12, 0.12);
  pointer-events: none;
  opacity: 0;
  transform: translate(calc(var(--x, 0px) - 29px), calc(var(--y, 0px) - 16px)) scale(0.6);
  transition: transform 0.55s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.25s;
}
.tab-glow.on { opacity: 1; transform: translate(calc(var(--x, 0px) - 29px), calc(var(--y, 0px) - 16px)) scale(1); }
.tab-glow.no-anim { transition: none; }

/* Top bar lifts slightly once the page scrolls under it */
.topbar { transition: box-shadow 0.3s, background-color 0.3s; }
body.is-scrolled .topbar { box-shadow: 0 1px 0 var(--border), 0 10px 24px -14px rgba(4, 20, 12, 0.28); }
body[data-depth="top"] #view-title { transition: font-size 0.3s var(--cine-ease); }
body.is-scrolled[data-depth="top"] #view-title { font-size: var(--fs-xl); }

/* Cards rise in as they scroll into view */
.reveal { opacity: 0; transform: translateY(28px) scale(0.98); }
.reveal.revealed { opacity: 1; transform: none; transition: opacity 0.6s ease-out, transform 0.7s var(--cine-ease); }

/* Photos look tappable */
.post-img { cursor: zoom-in; transition: transform 0.5s var(--cine-ease), filter 0.3s; }
@media (hover: hover) { .post-media:hover .post-img { transform: scale(1.02); } }

/* Full-screen photo viewer */
.cinema { position: fixed; inset: 0; z-index: 1000; touch-action: none; }
.cinema-backdrop { position: absolute; inset: 0; background: rgba(6, 8, 6, 0.92); backdrop-filter: blur(10px); }
.cinema-img { position: fixed; object-fit: contain; transform-origin: top left; user-select: none; cursor: grab; will-change: transform; }
.cinema-close {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  backdrop-filter: blur(8px);
}
.cinema-close:hover { background: rgba(255, 255, 255, 0.24); }
.cinema-caption {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 40px max(18px, env(safe-area-inset-right, 0px)) calc(22px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: #FFFFFF;
}
.cinema-who { display: grid; min-width: 0; }
.cinema-who span { color: rgba(255, 255, 255, 0.82); font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.cinema-on { overflow: hidden; }

/* Pull to refresh */
.ptr {
  position: fixed;
  left: 50%;
  top: calc(64px + env(safe-area-inset-top, 0px));
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(var(--pull, 0px) - 40px));
  transition: opacity 0.2s;
}
.ptr.show { opacity: 1; }
.ptr-disc {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--offwhite);
  color: var(--sage-deep);
  box-shadow: 0 6px 18px rgba(4, 20, 12, 0.16);
  transform: rotate(var(--spin, 0deg)) scale(0.85);
  transition: transform 0.2s, background-color 0.2s;
}
.ptr.ready .ptr-disc { background: var(--sage-main); color: var(--on-accent); transform: rotate(var(--spin, 0deg)) scale(1); }
.ptr.spinning .ptr-disc { animation: ptr-spin 0.8s linear infinite; background: var(--sage-main); color: var(--on-accent); }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
.main > .view { overscroll-behavior-y: contain; }

/* Opening title */
.intro {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--sp-3);
  background: var(--cream-bg);
  color: var(--text);
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.38s cubic-bezier(0.7, 0, 0.2, 1);
}
.intro.lift { clip-path: inset(0 0 100% 0); }
.intro-glow {
  position: absolute;
  width: 70vmin;
  height: 70vmin;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--hero-rgb), 1) 0%, transparent 65%);
  transform: translate(-50%, -50%) scale(0.6);
  animation: intro-glow 1.6s var(--cine-ease) forwards;
}
.intro-brand { position: relative; margin: 0; font-family: var(--font-display); font-size: clamp(3rem, 14vw, 5.5rem); font-weight: 720; letter-spacing: var(--tr-display); line-height: var(--lh-display); display: flex; align-items: baseline; }
.intro-star { color: var(--sage-deep); margin-right: 0.08em; display: inline-block; animation: intro-star 1.2s var(--cine-ease) both; }
.intro-letter { display: inline-block; animation: intro-letter 0.7s var(--cine-ease) both; animation-delay: calc(0.12s + var(--i) * 0.06s); }
.intro-dot { color: var(--sage-main); display: inline-block; animation: intro-letter 0.7s var(--cine-ease) 0.6s both; }
.intro-tag { position: relative; margin: 0; color: var(--muted); font-weight: 580; letter-spacing: var(--tr-label); animation: intro-letter 0.8s var(--cine-ease) 0.7s both; }
@keyframes intro-glow { to { transform: translate(-50%, -50%) scale(1.15); } }
@keyframes intro-star { from { transform: rotate(-180deg) scale(0); opacity: 0; } }
@keyframes intro-letter { from { transform: translateY(0.6em); opacity: 0; filter: blur(6px); } }

/* ---------- Sign-up details ---------- */
.signup-fields { display: grid; gap: var(--sp-3); }
.signup-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-3); }
@media (max-width: 400px) { .signup-row { grid-template-columns: minmax(0, 1fr); } }
.field-hint { margin-top: -0.4rem; font-size: var(--fs-xs); }
.auth-form input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.uname-field { display: grid; gap: var(--sp-1-5); }
.uname-wrap { position: relative; display: block; }
.uname-at { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 640; pointer-events: none; }
.uname-wrap input { padding-left: var(--sp-8); }
.uname-status { display: flex; align-items: flex-start; gap: var(--sp-1-5); min-height: 1.2em; margin: 0; font-size: var(--fs-md); font-weight: 580; }
.uname-status .icon { flex: none; width: 1.05rem; height: 1.05rem; margin-top: var(--sp-px); }
.uname-status.ok { color: var(--sage-deep); }
.uname-status.bad { color: var(--red); }
.uname-status.busy { color: var(--muted); }
.uname-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1-5); }
.uname-suggest:empty { display: none; }
.uname-chip { padding: var(--sp-1-5) var(--sp-3); border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--mint); color: var(--text); font-weight: 640; font-size: var(--fs-md); animation: chip-in 0.3s var(--cine-ease) both; }
.uname-chip:nth-child(3) { animation-delay: 0.05s; }
.uname-chip:nth-child(4) { animation-delay: 0.1s; }
.uname-chip:nth-child(5) { animation-delay: 0.15s; }
.uname-chip:hover { border-color: var(--sage-main); }
@keyframes chip-in { from { opacity: 0; transform: translateY(6px) scale(0.95); } }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: var(--sp-16); }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: var(--sp-1) var(--sp-3); border: 0; border-radius: var(--r-pill); background: var(--hover); color: var(--text); font-weight: 640; font-size: var(--fs-sm); }

/* =====================================================================
   Illustrations (illustrations.js): the cast, scenes and spot drawings.
   Every colour comes from the same tokens as the UI, so artwork follows
   light/dark mode and any palette from the Theme window.
   ===================================================================== */
:root {
  --il-ink: #24301F;               /* eyes and outlines: dark in every theme */
  --il-butter: #EBC77E;            /* Pip, the sun, stars */
  --il-lilac: #B9A7E6;             /* Lumi */
  --il-blush: rgba(236, 128, 128, 0.42);
  --il-paper: #FFFDF8;
  --organic: 30px 24px 32px 22px / 26px 30px 24px 28px;  /* hand-drawn feeling corners */
}
:root[data-theme="dark"] {
  --il-butter: #D9B465;
  --il-lilac: #A593DB;
  --il-blush: rgba(236, 128, 128, 0.32);
  --il-paper: #F4EFE4;
}

.il { display: block; width: 100%; height: auto; overflow: visible; }
.il .il-sage { fill: var(--sage-main); }
.il .il-sage-deep { fill: color-mix(in srgb, var(--sage-main) 72%, #1d2a18); }
.il .il-butter { fill: var(--il-butter); }
.il .il-butter-deep { fill: color-mix(in srgb, var(--il-butter) 75%, #5a3d10); }
.il .il-lilac { fill: var(--il-lilac); }
.il .il-lilac-deep { fill: color-mix(in srgb, var(--il-lilac) 72%, #2d2152); }
.il .il-arm { fill: none; stroke-width: 8.5; stroke-linecap: round; }
.il .il-s-sage { stroke: var(--sage-main); }
.il .il-s-butter { stroke: var(--il-butter); }
.il .il-s-lilac { stroke: var(--il-lilac); }
.il .il-tuft { fill: none; stroke-width: 3.2; stroke-linecap: round; }
.il .il-s-butter-deep { stroke: color-mix(in srgb, var(--il-butter) 70%, #5a3d10); }
.il .il-belly { fill: #fff; opacity: 0.3; }
.il .il-shine { fill: #fff; opacity: 0.45; }
.il .il-shadow { fill: #000; opacity: 0.1; }
.il .il-ink, .il .il-mouth { fill: var(--il-ink); }
.il .il-white { fill: #fff; }
.il .il-blush { fill: var(--il-blush); }
.il .il-line { fill: none; stroke: var(--il-ink); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.il .il-line-soft { fill: none; stroke: var(--il-ink); stroke-opacity: 0.35; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.il .il-leaf { fill: color-mix(in srgb, var(--sage-main) 70%, #1d2a18); }
.il .il-leaf-light { fill: color-mix(in srgb, var(--sage-main) 75%, #fff); }
.il .il-stem { fill: none; stroke: color-mix(in srgb, var(--sage-main) 65%, #1d2a18); stroke-width: 2.4; stroke-linecap: round; }
.il .il-star, .il .il-sun, .il .il-spark { fill: var(--il-butter); }
.il .il-heart { fill: var(--like); }
.il .il-paper { fill: var(--il-paper); stroke: var(--il-ink); stroke-opacity: 0.3; stroke-width: 1.4; stroke-linejoin: round; }
.il .il-lens { fill: var(--il-lilac); stroke: var(--il-ink); stroke-opacity: 0.35; stroke-width: 1.4; }
.il .il-pot { fill: color-mix(in srgb, var(--il-butter) 60%, #8a4a2a); }
.il .il-flame { fill: color-mix(in srgb, var(--il-butter) 55%, var(--like)); }
.il .il-flame-core { fill: var(--il-butter); }
.il .il-dot { fill: var(--sage-main); }
.il .il-steam { fill: none; stroke: var(--il-ink); stroke-opacity: 0.25; stroke-width: 1.6; stroke-linecap: round; }
.il .il-bubble, .il .il-bubble-card { fill: var(--offwhite); stroke: var(--il-ink); stroke-opacity: 0.18; stroke-width: 1.4; }
.il .il-blob-1 { fill: var(--mint); }
.il .il-blob-2 { fill: var(--il-butter); opacity: 0.4; }
.il .il-blob-3 { fill: var(--il-lilac); opacity: 0.35; }
.il .il-ground { fill: var(--sage-main); opacity: 0.28; }
.il .il-rug { fill: var(--sage-main); opacity: 0.35; }
.il .il-rug-ring { fill: none; stroke: var(--offwhite); stroke-width: 2; stroke-dasharray: 3 6; opacity: 0.8; }
.il .il-hill { fill: var(--sage-main); opacity: 0.55; }
.il .il-hill.back { fill: var(--sage-main); opacity: 0.25; }
.il .il-trail { fill: none; stroke: var(--offwhite); stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; }
.il .il-pole { stroke: var(--il-ink); stroke-width: 2; }
.il .il-flag { fill: var(--like); }
.il .il-swap-arrow { fill: none; stroke: var(--sage-deep); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 5 6; animation: il-flow 1.4s linear infinite; }
.il .il-swap-arrow.back { stroke: color-mix(in srgb, var(--il-lilac) 70%, var(--il-ink)); }
.il .il-swap-head { fill: none; stroke: var(--sage-deep); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* Life: bobbing, blinking, waving, swaying, floating */
.il .il-bob { animation: il-bob 3.4s ease-in-out infinite; }
.il .il-blink { transform-box: fill-box; transform-origin: center; animation: il-blink 5.2s infinite; }
.il .il-wave-arm { transform-box: fill-box; transform-origin: 0% 100%; animation: il-wave 1.8s ease-in-out infinite; }
.il .il-cheer-arm { transform-box: fill-box; transform-origin: 100% 100%; animation: il-cheer 1.2s ease-in-out infinite; }
.il .il-cheer-arm.right { transform-origin: 0% 100%; animation-direction: reverse; }
.il .il-sprout, .il .il-antenna { transform-box: fill-box; transform-origin: 50% 100%; animation: il-sway 3s ease-in-out infinite; }
.il .il-float { animation: il-float 4.5s ease-in-out infinite; }
.il .il-float.slow { animation-duration: 6s; }
.il .il-drift { animation: il-drift 9s ease-in-out infinite; }
.il .il-drift.slow { animation-duration: 13s; }
.il .il-spark { transform-box: fill-box; transform-origin: center; animation: il-twinkle 2.6s ease-in-out infinite; }
.il .il-rise { animation: il-rise 3.2s ease-in infinite; }
.il .il-wave-marks { animation: il-twinkle 1.8s ease-in-out infinite; }
.il .il-morph { transform-box: fill-box; transform-origin: center; animation: il-wobble 7s ease-in-out infinite; }
.il .il-confetti { transform-box: fill-box; transform-origin: center; animation: il-confetti 2.4s linear infinite; }
@keyframes il-bob { 50% { transform: translateY(-2.5px); } }
@keyframes il-blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.12); } }
@keyframes il-wave { 50% { transform: rotate(-22deg); } }
@keyframes il-cheer { 50% { transform: rotate(10deg); } }
@keyframes il-sway { 50% { transform: rotate(7deg); } }
@keyframes il-float { 50% { transform: translateY(-5px); } }
@keyframes il-drift { 50% { transform: translate(6px, -4px); } }
@keyframes il-twinkle { 50% { transform: scale(0.55); opacity: 0.55; } }
@keyframes il-rise { from { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-28px); opacity: 0; } }
@keyframes il-wobble { 50% { transform: rotate(6deg) scale(1.03); } }
@keyframes il-flow { to { stroke-dashoffset: -22; } }
@keyframes il-confetti { from { transform: translateY(0) rotate(0); } to { transform: translateY(190px) rotate(320deg); } }

/* Where the art sits */
.auth-art { max-width: 420px; margin: 0 auto var(--sp-1-5); }
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: center;
  gap: var(--sp-1);
  margin: var(--sp-3) 0 var(--sp-1-5);
  padding: var(--sp-4) var(--sp-1-5) var(--sp-1-5) var(--sp-5);
  border-radius: var(--organic);
  background: linear-gradient(140deg, var(--offwhite) 0%, var(--mint) 100%);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--lift);
}
.home-hero-text { order: -1; display: grid; gap: var(--sp-0-5); padding-bottom: var(--sp-3); }
.home-hero-text h1 { margin: 0; font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: 720; letter-spacing: var(--tr-heading); line-height: var(--lh-display); }
.home-hero-text p { margin: 0; color: var(--muted); font-size: var(--fs-md); }
.home-hero-text .g-kicker { color: var(--sage-deep); }
.home-hero-art .il { margin-right: -10px; }
.il-art { display: grid; place-items: center; background: none !important; }
.empty-art.il-art { width: 170px; height: auto; border-radius: 0; }
.ps-icon.il-art { width: 50px; height: 50px; }
.lj-icon.il-art { width: 56px; height: 56px; }
.skills-hero-art.il-art { width: 150px; height: auto; border-radius: 0; transform: none; }
.skills-prompt-art.il-art { width: 64px; height: 64px; border-radius: 0; }
.home-skills-art.il-art { width: 52px; height: 52px; border-radius: 0; }
.g-settings > h2 { display: flex; align-items: center; gap: var(--sp-2); }
.g-settings > h2 .il-spot { width: 40px; height: 40px; flex: none; margin: -6px 0 -6px -6px; }
.pending-art { width: min(260px, 80%); margin: var(--sp-1) 0; }
.gf-wave { position: relative; height: 70px; }
.gf-wave .gf-wave-svg { position: absolute; bottom: 0; left: 0; height: 46px; }
.gf-cast { position: absolute; left: 50%; bottom: 6px; width: 200px; transform: translateX(-50%); }
.c-hero-media .il-circles { width: 100%; height: 100%; }

/* Organic shapes: soft blobs behind every screen, hand-drawn corners on cards,
   and blob-shaped tiles that slowly breathe. */
.main { position: relative; isolation: isolate; overflow-x: clip; } /* the blobs below hang off the edges; never let them widen the page on phones */
.main::before, .main::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  background: var(--mint);
  opacity: 0.55;
  animation: blob-breathe 18s ease-in-out infinite;
}
.main::before { width: 340px; height: 300px; top: 110px; right: -170px; border-radius: var(--r-md); }
.main::after { width: 280px; height: 260px; bottom: 120px; left: -150px; border-radius: var(--r-md); background: color-mix(in srgb, var(--il-butter) 40%, var(--cream-bg)); opacity: 0.4; animation-delay: -7s; }
@keyframes blob-breathe {
  33% { border-radius: 45% 55% 60% 40% / 50% 60% 40% 50%; transform: translate(-10px, 14px) rotate(8deg); }
  66% { border-radius: 58% 42% 38% 62% / 42% 52% 48% 58%; transform: translate(8px, -8px) rotate(-6deg); }
}
.post, .cc, .lj-card, .lp-card, .ib-row, .match-card, .listing-card, .exchange-card, .g-settings, .compose-card,
.p-card, .p-statbar, .empty-moments, .home-skills, .skills-prompt, .skills-mine, .c-hero, .auth-card, .pending-card {
  border-radius: var(--organic);
}
.cc-tile, .chan-avatar, .tab-create-disc { border-radius: var(--r-md) !important; animation: blob-tile 10s ease-in-out infinite; }
@keyframes blob-tile { 50% { border-radius: 56% 44% 42% 58% / 45% 57% 43% 55%; } }
.tab-create-disc { animation-duration: 7s; }

@media (max-width: 380px) {
  .home-hero { grid-template-columns: minmax(0, 1fr); padding-right: var(--sp-4); }
  .home-hero-text { order: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .il *, .main::before, .main::after, .cc-tile, .chan-avatar, .tab-create-disc { animation: none !important; }
}

/* =====================================================================
   Footer: drifting wave, turning star, live pulse, link pills,
   beating heart, back to top. Pieces rise in one after another.
   ===================================================================== */
.g-footer {
  position: relative;
  margin-top: var(--sp-8);
  padding: 0;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-md);
  overflow: hidden;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  isolation: isolate;
}
.gf-wave { height: 46px; overflow: hidden; }
.gf-wave-svg { display: block; width: 200%; height: 100%; animation: gf-drift 16s linear infinite; }
.gf-wave-back { fill: var(--sage-main); opacity: 0.35; }
.gf-wave-front { fill: var(--mint); }
@keyframes gf-drift { to { transform: translateX(-50%); } }
.gf-inner {
  display: grid;
  justify-items: center;
  gap: var(--sp-3);
  padding: 6px 18px calc(22px + env(safe-area-inset-bottom, 0px));
  background: var(--mint);
}
.gf-inner { position: relative; }
.gf-inner > * { position: relative; z-index: 1; }
.gf-inner::before, .gf-inner::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  background: var(--sage-main);
  opacity: 0.18;
  animation: gf-float 9s ease-in-out infinite;
}
.gf-inner::before { width: 90px; height: 90px; left: -24px; bottom: 30px; }
.gf-inner::after { width: 56px; height: 56px; right: 18px; top: 70px; animation-delay: -4s; }
@keyframes gf-float { 50% { transform: translateY(-14px) scale(1.08); } }

.gf-brand { margin: 0; font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: 720; letter-spacing: var(--tr-display); color: var(--text); line-height: var(--lh-display); }
.gf-star { display: inline-block; margin-right: var(--sp-0-5); color: var(--sage-deep); animation: gf-spin 14s linear infinite; }
.gf-dot { color: var(--sage-main); }
@keyframes gf-spin { to { transform: rotate(360deg); } }
.gf-tag { margin: 0; color: var(--text); font-weight: 580; }
.gf-pulse { display: inline-flex; align-items: center; gap: var(--sp-2); margin: 0; padding: var(--sp-1) var(--sp-3); border-radius: var(--r-pill); background: var(--offwhite); color: var(--text); font-weight: 640; font-size: var(--fs-sm); }
.gf-pulse-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--green-dot); }
.gf-pulse-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green-dot); animation: gf-ping 1.8s ease-out infinite; }
@keyframes gf-ping { to { transform: scale(2.6); opacity: 0; } }

.gf-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); margin: var(--sp-1) 0 var(--sp-0-5); }
.gf-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1-5);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--offwhite);
  color: var(--text);
  font-weight: 640;
  font-size: var(--fs-sm);
  transition: transform 0.25s var(--ease-spring), border-color 0.2s, background-color 0.2s, box-shadow 0.25s;
}
.gf-link .icon { width: 1rem; height: 1rem; transition: transform 0.35s var(--ease-spring); }
.gf-link:hover, .gf-link:focus-visible { transform: translateY(-3px); border-color: var(--sage-main); box-shadow: 0 8px 18px -10px rgba(18, 36, 27, 0.45); }
.gf-link:hover .icon { transform: rotate(-10deg) scale(1.15); --duo: var(--sage-main); }
.gf-link:active { transform: translateY(0) scale(0.96); }

.gf-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-1); font-size: var(--fs-sm); color: var(--muted); }
.gf-bottom p { margin: 0; }
.gf-heart { display: inline-block; color: var(--like); animation: gf-beat 1.4s ease-in-out infinite; }
@keyframes gf-beat { 0%, 60%, 100% { transform: scale(1); } 15% { transform: scale(1.3); } 30% { transform: scale(1.05); } 45% { transform: scale(1.22); } }
.gf-top { display: inline-flex; align-items: center; gap: var(--sp-1); padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-1-5); border: 0; border-radius: var(--r-pill); background: var(--sage-main); color: var(--on-accent); font-weight: 720; font-size: var(--fs-xs); }
.gf-top .icon { width: 1.1rem; height: 1.1rem; --duo: rgba(255, 255, 255, 0.4); transition: transform 0.3s var(--ease-spring); }
.gf-top:hover .icon { animation: gf-hop 0.6s var(--ease-spring); }
@keyframes gf-hop { 40% { transform: translateY(-4px); } }

/* Rise in, piece by piece, when the footer scrolls into view */
.g-footer.gf-await .gf-inner > * { opacity: 0; transform: translateY(16px); }
.g-footer.gf-await.in .gf-inner > * { opacity: 1; transform: none; transition: opacity 0.5s ease-out, transform 0.6s var(--cine-ease); }
.g-footer.gf-await.in .gf-inner > :nth-child(2) { transition-delay: 0.08s; }
.g-footer.gf-await.in .gf-inner > :nth-child(3) { transition-delay: 0.16s; }
.g-footer.gf-await.in .gf-inner > :nth-child(4) { transition-delay: 0.24s; }
.g-footer.gf-await.in .gf-inner > :nth-child(5) { transition-delay: 0.32s; }
.g-footer.gf-await .gf-link { opacity: 0; transform: translateY(10px) scale(0.95); }
.g-footer.gf-await.in .gf-link { opacity: 1; transform: none; transition: opacity 0.4s ease-out, transform 0.5s var(--ease-spring); transition-delay: calc(0.3s + var(--i, 0) * 0.06s); }
.g-footer.gf-await.in .gf-link:hover { transform: translateY(-3px); transition-delay: 0s; }

/* The sign-in screen: full width, sitting at the bottom of the page */
#auth > .g-footer { margin-top: var(--sp-8); border-radius: 0; }

@media (prefers-reduced-motion: reduce) {
  .gf-wave-svg, .gf-star, .gf-heart, .gf-pulse-dot::after, .gf-inner::before, .gf-inner::after { animation: none; }
}

/* ---------- Waiting for approval: sending, connected, approved ---------- */
.pending.sending .pending-orbit::before { animation-duration: 0.9s; }
.pending.sending .pending-card > :not(.brand):not(.pending-orbit):not(h1):not(#pending-waiting):not(.pending-live) { display: none; }
.pending.approved .pending-orbit::before { animation: none; background: var(--sage-main); transition: background 0.4s; }
.pending.approved .pending-orbit { animation: approved-pop 0.6s var(--ease-spring); }
.pending.approved h1 { animation: chip-in 0.5s var(--cine-ease) both; }
@keyframes approved-pop { 40% { transform: scale(1.12); } }
.pending-check {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--panel);
  background: var(--sage-main);
  color: var(--on-accent);
  animation: chip-in 0.45s var(--ease-spring) 0.15s both;
}
.pending-check .icon { width: 1.3rem; height: 1.3rem; stroke-width: 3; }
.pending-live { display: flex; justify-content: center; text-align: left; max-width: 34ch; }
.pending-live .live-dot { flex: none; margin-top: var(--sp-0-5); align-self: flex-start; }
.pending-live.on { color: var(--sage-deep); }
.pending-live.busy .live-dot { background: var(--butter); }
.pending-live.busy { color: var(--butter); }
.pending-live.off { color: var(--muted); }
.pending-live.off .live-dot { background: var(--muted); animation: none; }
.pending-note-sent { display: grid; gap: var(--sp-1-5); width: 100%; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); background: var(--mint); text-align: left; }
.pending-note-sent .pending-note-head { display: flex; align-items: center; gap: var(--sp-1-5); font-weight: 720; color: var(--sage-deep); }
.pending-note-sent .icon { width: 1.05rem; height: 1.05rem; }
.pending-note-sent blockquote { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pending-note-sent .link { justify-self: start; }
@media (prefers-reduced-motion: reduce) {
  .pending.approved .pending-orbit, .pending.approved h1, .pending-check { animation: none; }
}

/* ---------- Account: details, email, password ---------- */
.forgot-line { margin: -0.35rem 0 0; text-align: right; }
.auth-sent { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); background: var(--mint); }
.auth-sent .icon { flex: none; color: var(--sage-deep); margin-top: var(--sp-0-5); }
.auth-sent p { margin: 0; font-size: var(--fs-md); }
.auth-sent.warn, .mail-off { background: var(--butter-soft); }
.auth-sent.warn .icon, .mail-off .icon { color: var(--butter); }
.mail-off { display: flex; gap: var(--sp-2); align-items: flex-start; margin: 0 0 var(--sp-3); padding: var(--sp-3) var(--sp-3); border-radius: var(--r-md); font-size: var(--fs-md); }
.mail-off .icon { flex: none; width: 1.1rem; height: 1.1rem; margin-top: var(--sp-0-5); }
.acc-private { display: flex; align-items: center; gap: var(--sp-1-5); margin-top: -4px; }
.acc-private .icon { width: 1rem; height: 1rem; }
.acc-form { display: grid; gap: var(--sp-3); }
.acc-form .form-error:empty { display: none; }
.acc-readonly { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); padding: var(--sp-3) var(--sp-3); border-radius: var(--r-md); background: var(--panel-2); border: 1px solid var(--border); }
.acc-label { width: 100%; font-weight: 640; font-size: var(--fs-md); color: var(--muted); }
.acc-value { font-weight: 640; overflow-wrap: anywhere; }
.acc-readonly small { width: 100%; }
.pill.acc-verified { display: inline-flex; align-items: center; gap: var(--sp-1); background: var(--mint); color: var(--sage-deep); }
.pill.acc-verified .icon { width: 0.9rem; height: 0.9rem; }
.pill.acc-unverified { background: var(--butter-soft); color: var(--butter); }
.g-settings .row-actions .icon { width: 1rem; height: 1rem; }
.g-settings .ghost.small { display: inline-flex; align-items: center; gap: var(--sp-1-5); }

.email-dialog { width: min(420px, calc(100vw - 24px)); padding: var(--sp-5); border-radius: var(--r-2xl); background: var(--panel); color: var(--text); }
.email-dialog::backdrop { background: rgba(3, 12, 8, 0.45); backdrop-filter: blur(3px); }
.email-dialog[open] { animation: theme-pop 0.32s var(--ease-spring); }
.email-progress { display: flex; align-items: center; gap: var(--sp-1-5); margin: 0 0 var(--sp-3); color: var(--muted); font-size: var(--fs-sm); font-weight: 640; }
.email-progress span { width: 22px; height: 6px; border-radius: var(--r-pill); background: var(--border-strong); }
.email-progress span.on { background: var(--sage-main); }
.email-progress span:last-of-type { margin-right: var(--sp-1); }
.email-step { display: grid; gap: var(--sp-3); }
.email-step p { margin: 0; }
.email-dialog .primary.wide { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); width: 100%; }
.code-input { text-align: center; font-size: var(--fs-3xl); font-weight: 720; letter-spacing: 0.5em; padding-left: 0.5em; font-variant-numeric: tabular-nums; }
.email-step .link { justify-self: center; }
.email-step .link:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.email-done { display: grid; justify-items: center; gap: var(--sp-3); margin: var(--sp-1-5) 0 var(--sp-4); text-align: center; }
.email-done-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--sage-main); color: var(--on-accent); animation: chip-in 0.45s var(--ease-spring) both; }
.email-done-mark .icon { width: 2rem; height: 2rem; stroke-width: 2.6; }

/* =====================================================================
   Skill exchange
   ===================================================================== */
.skills-hero { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-1) var(--sp-0-5) var(--sp-4); }
.skills-hero > div { flex: 1; min-width: 0; }
.skills-hero h1 { margin: var(--sp-0-5) 0 var(--sp-1); font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: 720; letter-spacing: var(--tr-heading); }
.skills-hero p { margin: 0; }
.skills-hero-art { flex: none; display: grid; place-items: center; width: 76px; height: 76px; border-radius: var(--r-2xl); background: var(--mint); color: var(--sage-deep); transform: rotate(-6deg); }
.skills-hero-art .icon { width: 2.4rem; height: 2.4rem; --duo: var(--sage-main); }
.skills-tabs { margin-bottom: var(--sp-4); }
.skills-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1-5); }
.skills-tabs .badge { position: static; }
.skills-content { display: grid; gap: var(--sp-4); }
.skills-list { display: grid; gap: var(--sp-3); }
.skills-section-title { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-1-5) var(--sp-0-5) 0; font-size: var(--fs-sm); font-weight: 720; letter-spacing: var(--tr-caps); text-transform: uppercase; color: var(--muted); }
.skills-section-title .count { padding: var(--sp-px) var(--sp-2); border-radius: var(--r-pill); background: var(--mint); color: var(--text); letter-spacing: 0; }

.skill-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1-5); }
.skill-chip { display: inline-flex; align-items: center; gap: var(--sp-1); padding: var(--sp-1) var(--sp-3); border-radius: var(--r-pill); background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font-size: var(--fs-md); font-weight: 640; max-width: 100%; overflow-wrap: anywhere; }
.skill-chip .icon { width: 0.95rem; height: 0.95rem; flex: none; }
.skill-chip.match { background: var(--sage-main); border-color: transparent; color: var(--on-accent); }
.skill-chip.match .icon { --duo: rgba(255, 255, 255, 0.45); }
.skill-chip.teach { background: var(--mint); border-color: transparent; }
.skill-chip.learn { background: var(--lilac-soft); border-color: transparent; }
.skill-chip.removable { padding-right: var(--sp-1); }
.skill-chip.removable button { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: var(--muted); padding: 0; }
.skill-chip.removable button:hover { background: var(--hover); color: var(--text); }

.skills-row { display: grid; gap: var(--sp-1-5); }
.skills-row-label { display: inline-flex; align-items: center; gap: var(--sp-1-5); width: fit-content; padding: var(--sp-0-5) var(--sp-3) var(--sp-0-5) var(--sp-1-5); border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 720; }
.skills-row-label .icon { width: 1rem; height: 1rem; }
.skills-mine { padding: var(--sp-4) var(--sp-4); display: grid; gap: var(--sp-3); border-radius: var(--r-xl); }
.skills-mine-head { display: flex; align-items: center; justify-content: space-between; }
.skills-mine-head h2 { margin: 0; font-size: var(--fs-base); }
.skills-mine-rows { display: grid; gap: var(--sp-3); }
.skills-card .lj-title { display: flex; }
.skills-card .lj-title .push { margin-left: auto; }
.skills-common { display: flex; align-items: center; gap: var(--sp-1-5); margin: var(--sp-3) 0 0; color: var(--muted); }
.skills-common .icon { width: 1rem; height: 1rem; color: var(--sage-deep); }

.skills-prompt { display: flex; gap: var(--sp-4); padding: var(--sp-5); border-radius: var(--r-xl); background: linear-gradient(150deg, var(--mint), var(--offwhite)); border: 1px solid var(--border); }
.skills-prompt h2 { margin: 0 0 var(--sp-1-5); font-size: var(--fs-lg); }
.skills-prompt p { margin: 0 0 var(--sp-3); color: var(--muted); }
.skills-prompt .primary { display: inline-flex; align-items: center; gap: var(--sp-1-5); }
.skills-prompt-art { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--r-lg); background: var(--sage-main); color: var(--on-accent); }

.match-card, .listing-card, .exchange-card { padding: var(--sp-4); border-radius: var(--r-xl); display: grid; gap: var(--sp-3); }
.match-head { display: flex; align-items: center; gap: var(--sp-3); }
.match-who { flex: 1; min-width: 0; display: grid; justify-items: start; gap: var(--sp-0-5); }
.match-who .user-link, .match-who strong { font-size: var(--fs-base); font-weight: 720; }
.match-strength { font-size: var(--fs-xs); font-weight: 720; letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--muted); }
.match-strength.s-great { color: var(--sage-deep); }
.match-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1-5); }
.match-reasons li { display: flex; gap: var(--sp-2); align-items: flex-start; font-size: var(--fs-md); }
.match-reasons .icon { flex: none; width: 1.1rem; height: 1.1rem; margin-top: var(--sp-0-5); color: var(--sage-deep); }
.match-reasons .reason-swap { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--mint); font-weight: 580; }
.match-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1-5); }
.match-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.match-actions button, .listing-actions button { display: inline-flex; align-items: center; gap: var(--sp-1-5); }
.match-actions .icon, .listing-actions .icon { width: 1rem; height: 1rem; }

.listing-tools { display: grid; gap: var(--sp-3); }
.listing-tools .c-filters { margin: 0; }
.listing-tools .primary.wide { display: flex; align-items: center; justify-content: center; gap: var(--sp-1-5); }
.listing-search { position: relative; }
.listing-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 1.1rem; height: 1.1rem; }
.listing-search input { padding-left: var(--sp-10); margin: 0; }
.listing-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1-5); }
.listing-kind { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-xs); font-weight: 720; letter-spacing: var(--tr-label); text-transform: uppercase; }
.listing-kind .icon { width: 1rem; height: 1rem; }
.listing-kind.offer { color: var(--sage-deep); }
.listing-kind.request { color: var(--lilac); }
.listing-card.is-offer { border-left: 4px solid var(--sage-main); }
.listing-card.is-request { border-left: 4px solid var(--lilac); }
.listing-card.is-closed { opacity: 0.7; }
.listing-title { margin: 0; font-size: var(--fs-lg); font-weight: 720; overflow-wrap: anywhere; }
.listing-details { margin: 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.listing-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.listing-owner { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1-5); min-width: 0; }
.listing-actions { display: inline-flex; align-items: center; gap: var(--sp-1-5); margin-left: auto; }

.swap-pill { display: inline-flex; align-items: center; gap: var(--sp-1); border: 0; font-weight: 720; font-size: var(--fs-xs); }
.swap-pill.pending { background: var(--butter-soft); color: var(--butter); }
.swap-pill.active { background: var(--mint); color: var(--sage-deep); }
.swap-pill.done { background: var(--sage-main); color: var(--on-accent); }
.swap-pill.closed { background: var(--hover); color: var(--muted); }
.exchange-card.st-active { border-color: var(--sage-main); }
.exchange-title { margin: 0; font-weight: 720; }
.exchange-message { margin: 0; padding: var(--sp-2) var(--sp-3); border-left: 3px solid var(--sage-fill-2); background: var(--panel-2); border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.exchange-progress { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.progress-dots { display: flex; gap: var(--sp-1); }
.progress-dots span { width: 18px; height: 8px; border-radius: var(--r-pill); background: var(--border-strong); }
.progress-dots span.on { background: var(--sage-main); }
.session-log summary { cursor: pointer; font-weight: 640; color: var(--muted); font-size: var(--fs-md); }
.session-log ol { margin: var(--sp-1-5) 0 0; padding-left: var(--sp-5); display: grid; gap: var(--sp-1); font-size: var(--fs-md); }
.session-form { display: flex; gap: var(--sp-1-5); align-items: center; }
.session-form input { flex: 1; min-width: 0; margin: 0; }
.exchange-cancel { justify-self: start; color: var(--muted); }

.home-skills {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  margin: 0 0 var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: linear-gradient(120deg, var(--sage-main) 0%, var(--mint) 55%, var(--offwhite) 100%);
  color: var(--text);
  text-align: left;
  box-shadow: var(--lift);
}
.home-skills-art { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--r-lg); background: var(--offwhite); color: var(--sage-deep); }
.home-skills-art .icon { width: 1.6rem; height: 1.6rem; }
.home-skills-text { flex: 1; min-width: 0; display: grid; gap: var(--sp-0-5); }
.home-skills-text strong { font-size: var(--fs-base); }
.home-skills-text span { font-size: var(--fs-md); color: var(--text); opacity: 0.85; }
.home-skills-faces { display: flex; }
.home-skills-faces .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--offwhite); }
.home-skills > .icon { flex: none; width: 1.1rem; height: 1.1rem; color: var(--muted); }

.skills-dialog { width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
.skills-form { display: grid; gap: var(--sp-3); }
.skills-form .form-error:empty { display: none; }
.lj-value { overflow-wrap: break-word; }
.skills-form .primary.wide { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); }
.skills-field { display: grid; gap: var(--sp-1); }
.tag-box { display: flex; flex-wrap: wrap; gap: var(--sp-1-5); align-items: center; min-height: 48px; padding: var(--sp-1-5) var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); cursor: text; }
.tag-box:focus-within { border-color: var(--sage-main); box-shadow: 0 0 0 3px rgba(27, 122, 80, 0.25); }
.tag-box input { flex: 1; min-width: 8rem; margin: 0; padding: var(--sp-1-5) var(--sp-1); border: 0; background: none; box-shadow: none; }
.tag-box input:focus { outline: none; }
.kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.kind-pick button { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3); border: 2px solid var(--border); border-radius: var(--r-lg); background: var(--offwhite); color: var(--text); text-align: left; }
.kind-pick button span { display: grid; }
.kind-pick button small { color: var(--muted); }
.kind-pick button.on { border-color: var(--sage-main); background: var(--mint); }
.swap-listing { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-3); border-radius: var(--r-lg); background: var(--panel-2); margin-bottom: var(--sp-1); }
.swap-listing > span { display: grid; min-width: 0; }

@media (prefers-reduced-motion: reduce) {
  .tab-glow, .reveal, .reveal.revealed, .intro { transition: none; }
  .reveal { opacity: 1; transform: none; }
}

/* Smooth switch between light and dark */
html.theme-switching * { transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease !important; }
@media (prefers-reduced-motion: reduce) { html.theme-switching * { transition: none !important; } }

/* =====================================================================
   Capital Commons: brand mark and the Mission hub (mission.js).
   Patterns from advocacy and volunteer networks: the shared mission is
   always visible, every campaign shows its goal and live progress, each
   action is one tap, help given is recognised openly (points rules are
   public), and peer support is a first-class path, not a buried forum.
   ===================================================================== */

/* Brand: a rising triangle instead of the old spinning star. */
.brand .star, .gf-star, .intro-star { font-size: 0.62em; vertical-align: 0.28em; margin-right: 0.18em; }
.topbar .brand .star { color: var(--sage-main); }
.gf-star { animation: gf-rise 3.6s var(--ease-out) infinite; }
@keyframes gf-rise { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* Sign-in hero bullet points */
.auth-points { list-style: none; padding: 0; margin: 0 0 var(--sp-4); display: grid; gap: var(--sp-3); }
.auth-points li { display: flex; align-items: flex-start; gap: var(--sp-3); font-size: var(--fs-base); }
.auth-points .icon { flex: none; width: 1.35rem; height: 1.35rem; color: var(--sage-deep); margin-top: var(--sp-px); }

/* Four-way segmented control */
.seg.four { grid-template-columns: repeat(4, 1fr); }
.seg.four button { padding: var(--sp-2) var(--sp-1); font-size: var(--fs-md); }

/* Shared pieces */
.m-content { display: grid; gap: var(--sp-4); }
.m-list { display: grid; gap: var(--sp-3); }
.m-note { margin: 0; }
.m-toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; justify-content: space-between; }
.m-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1-5); }
.m-chips .chip { border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: var(--r-pill); padding: var(--sp-1-5) var(--sp-4); font-weight: 580; font-size: var(--fs-md); }
.m-chips .chip.on { background: var(--sage-main); border-color: var(--sage-main); color: var(--on-accent); }
.m-bar { height: 8px; border-radius: var(--r-pill); background: var(--hover); overflow: hidden; }
.m-bar-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--coral-2), var(--sage-main)); transition: width 0.6s var(--ease-out); }
.m-faces { display: inline-flex; align-items: center; }
.m-faces .avatar { box-shadow: 0 0 0 2px var(--panel); }
.m-faces .avatar + .avatar { margin-left: -8px; }
.m-faces-more { margin-left: var(--sp-1-5); font-size: var(--fs-sm); color: var(--muted); font-weight: 580; }
.m-empty-icon { display: inline-grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: var(--r-lg); background: var(--mint); color: var(--sage-deep); }
.m-empty-icon .icon { width: 1.8rem; height: 1.8rem; }

/* Overview hero: mission statement + impact counters */
.m-hero {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: var(--sp-6) var(--sp-5) var(--sp-5);
  background: radial-gradient(120% 90% at 100% 0%, rgba(var(--hero-rgb), 1) 0%, transparent 60%), var(--panel);
  border: 1px solid var(--border);
}
.m-hero::after {
  content: ""; position: absolute; right: -10px; top: 14px; width: 150px; height: 70px; opacity: 0.18; pointer-events: none;
  background: linear-gradient(135deg, transparent 48%, var(--sage-main) 49%, var(--sage-main) 51%, transparent 52%) 0 0 / 30px 30px;
  -webkit-mask: linear-gradient(90deg, transparent, #000); mask: linear-gradient(90deg, transparent, #000);
}
.m-statement { font-family: var(--font-display); font-size: clamp(1.25rem, 4.6vw, 1.6rem); line-height: var(--lh-snug); letter-spacing: var(--tr-heading); margin: var(--sp-1) 0 var(--sp-1-5); max-width: 30ch; }
.m-edit { display: inline-flex; align-items: center; gap: var(--sp-1); }
.m-edit .icon { width: 1rem; height: 1rem; }
.m-impact { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); margin-top: var(--sp-4); }
.m-stat { display: grid; justify-items: start; gap: var(--sp-0-5); padding: var(--sp-3); border-radius: var(--r-md); background: var(--panel-2); border: 1px solid var(--border); min-width: 0; }
.m-stat .icon { width: 1.15rem; height: 1.15rem; color: var(--sage-deep); }
.m-stat strong { font-family: var(--font-display); font-size: var(--fs-xl); line-height: var(--lh-heading); font-variant-numeric: tabular-nums; }
.m-stat span { font-size: var(--fs-xs); color: var(--muted); line-height: var(--lh-snug); }

/* Your impact */
.m-me { display: grid; gap: var(--sp-3); }
.m-me-head, .m-profile-head { display: flex; align-items: center; gap: var(--sp-3); }
.m-me-head h2 { margin: 0; font-size: var(--fs-lg); }
.m-me-head p { margin: 0; }
.m-tier-mark { flex: none; display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: var(--r-lg); background: var(--gold-mark-soft); color: var(--gold-mark); }
.m-tier-mark .icon { width: 1.6rem; height: 1.6rem; --duo: color-mix(in srgb, var(--gold-mark) 30%, transparent); }
.m-badges { display: flex; flex-wrap: wrap; gap: var(--sp-1-5); }
.m-badge { display: inline-flex; align-items: center; gap: var(--sp-1); padding: var(--sp-1) var(--sp-3); border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 580; background: var(--gold-mark-soft); color: var(--butter); }
.m-badge .icon { width: 0.95rem; height: 0.95rem; }

/* Campaign cards */
.m-campaign { display: grid; gap: var(--sp-2); text-align: left; width: 100%; color: inherit; font: inherit; cursor: pointer; border-left: 4px solid var(--sage-main); }
.m-campaign.type-policy { border-left-color: var(--lilac); }
.m-campaign.type-support { border-left-color: var(--gold-mark); }
.m-campaign.type-awareness { border-left-color: var(--red); }
.m-campaign:hover { border-color: var(--border-strong); }
.m-campaign-top, .m-campaign-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.m-campaign-title { font-size: var(--fs-base); line-height: var(--lh-snug); }
.m-type { display: inline-flex; align-items: center; gap: var(--sp-1-5); font-size: var(--fs-xs); font-weight: 640; letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--sage-deep); }
.m-type .icon { width: 1rem; height: 1rem; }
.m-type.type-policy { color: var(--lilac); }
.m-type.type-support { color: var(--butter); }
.m-type.type-awareness { color: var(--red); }
.m-proposals, .home-mission-help { display: flex; align-items: center; gap: var(--sp-3); width: 100%; text-align: left; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); border: 1px dashed var(--border-strong); background: var(--panel); color: inherit; font: inherit; cursor: pointer; }
.m-proposals > span, .home-mission-help > span { flex: 1; display: grid; }
.m-proposals > .icon:first-child, .home-mission-help > .icon:first-child { color: var(--sage-deep); }

/* Campaign detail */
.m-c-head h1 { font-family: var(--font-display); font-size: clamp(1.4rem, 5vw, 1.8rem); line-height: var(--lh-snug); margin: var(--sp-1-5) 0 var(--sp-1); }
.m-c-head p { margin: 0; }
.m-progress, .m-propose { display: grid; gap: var(--sp-3); }
.m-propose h2, .m-why h2, .m-actions h2, .m-updates h2, .m-stance h2 { font-size: var(--fs-base); margin: 0 0 var(--sp-1-5); }
.m-progress-nums { display: flex; align-items: baseline; gap: var(--sp-1); }
.m-progress-nums strong { font-family: var(--font-display); font-size: var(--fs-3xl); font-variant-numeric: tabular-nums; }
.m-pct { margin-left: auto; font-weight: 720; color: var(--sage-deep); }
.m-progress .m-bar { height: 12px; }
.m-progress-foot { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.m-progress-foot > button { margin-left: auto; }
.m-why p { margin: 0; white-space: pre-line; }
.m-action-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.m-action { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--border); cursor: pointer; }
.m-action input { width: 1.3rem; height: 1.3rem; accent-color: var(--sage-main); flex: none; }
.m-action-text { flex: 1; }
.m-action.done { background: var(--mint); border-color: transparent; }
.m-action.done .m-action-text { font-weight: 580; }
.m-update-form { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.m-update-form button { justify-self: end; }
.m-update, .m-reason, .m-offer { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) 0; border-top: 1px solid var(--border); }
.m-update p, .m-reason p, .m-offer p { margin: 0; }
.m-manage { justify-content: flex-end; }

/* Policy stance */
.m-stance { display: grid; gap: var(--sp-3); }
.m-stance-bars { display: grid; gap: var(--sp-2); }
.m-stance-row { display: grid; grid-template-columns: 4.6rem 1fr 3rem; align-items: center; gap: var(--sp-3); font-size: var(--fs-md); }
.m-stance-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.m-stance-track { height: 10px; border-radius: var(--r-pill); background: var(--hover); overflow: hidden; }
.m-stance-fill { display: block; height: 100%; border-radius: inherit; background: var(--sage-main); transition: width 0.6s var(--ease-out); }
.s-oppose .m-stance-fill { background: var(--red); }
.s-unsure .m-stance-fill { background: var(--muted); }
.m-stance-form { display: grid; gap: var(--sp-2); }
.m-stance-form > button { justify-self: start; }
.m-stance-tag { display: inline-block; padding: var(--sp-px) var(--sp-2); border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 640; background: var(--mint); color: var(--sage-deep); }
.m-stance-tag.s-oppose { background: var(--red-soft); color: var(--red); }
.m-stance-tag.s-unsure { background: var(--hover); color: var(--muted); }
.m-reasons h3 { font-size: var(--fs-base); margin: var(--sp-1-5) 0 0; }

/* Peer support */
.m-support-intro p { margin: 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); background: var(--mint); }
.m-request { display: grid; gap: var(--sp-2); }
.m-request.closed { opacity: 0.78; }
.m-request-head { display: flex; align-items: center; gap: var(--sp-3); }
.m-request-head > div { flex: 1; min-width: 0; }
.m-request-head p { margin: 0; }
.m-topic { display: inline-block; font-size: var(--fs-xs); font-weight: 640; color: var(--sage-deep); text-transform: uppercase; letter-spacing: var(--tr-label); }
.m-request-title { font-size: var(--fs-base); line-height: var(--lh-snug); }
.m-request-details { margin: 0; color: var(--muted); white-space: pre-line; }
.m-offers { display: grid; }
.m-helped { display: flex; align-items: center; gap: var(--sp-1-5); margin: 0; color: var(--butter); font-weight: 580; }
.m-helped .icon { width: 1rem; height: 1rem; }

/* Recognition */
.m-leaders { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-1-5); }
.m-leader { display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: var(--sp-3) var(--sp-3); border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--border); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.m-rank { flex: none; width: 1.8rem; height: 1.8rem; display: grid; place-items: center; border-radius: 50%; font-weight: 720; font-size: var(--fs-md); background: var(--hover); color: var(--muted); }
.m-rank.top-1 { background: var(--gold-mark); color: #1E1500; }
.m-rank.top-2 { background: color-mix(in srgb, var(--gold-mark) 55%, var(--panel)); color: var(--text); }
.m-rank.top-3 { background: color-mix(in srgb, var(--gold-mark) 30%, var(--panel)); color: var(--text); }
.m-leader-name { flex: 1; display: grid; min-width: 0; }
.m-leader-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-leader-pts { font-weight: 720; font-variant-numeric: tabular-nums; }
.m-kudos { display: grid; gap: var(--sp-1-5); border-top: 3px solid var(--gold-mark); }
.m-kudos-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.m-kudos-head p { margin: 0; flex: 1; }
.m-kudos-kind { display: inline-block; padding: var(--sp-0-5) var(--sp-2); border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 640; background: var(--gold-mark-soft); color: var(--butter); }
.m-kudos-msg { margin: 0; font-size: var(--fs-base); }
.m-kudos p.muted { margin: 0; }

/* Volunteer roles */
.m-roles { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.m-role { display: grid; gap: var(--sp-3); align-content: space-between; }
.m-role p { margin: var(--sp-0-5) 0 0; }
.m-role.mine { border-color: var(--sage-main); background: var(--mint); }
.m-role-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }
.m-role-head { display: flex; align-items: flex-start; gap: var(--sp-3); }
.m-role-icon { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: var(--r-lg); background: var(--mint); color: var(--sage-deep); }
.m-role.mine .m-role-icon { background: var(--panel); }
.m-role-icon .icon { width: 1.3rem; height: 1.3rem; }
.m-role .m-role-time, .m-role-time { display: inline-flex; align-items: center; gap: var(--sp-1-5); margin: 0; color: var(--muted); font-weight: 580; }
.m-role-time .icon { width: 0.95rem; height: 0.95rem; }
.m-role-count { display: inline-flex; align-items: center; gap: var(--sp-2); }
.m-role-badges { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1-5); }
.m-role .m-role-note { margin: 0; color: var(--gold-text); }
.m-role-pending { color: var(--gold-text); border-style: dashed; }
.m-steps { display: flex; flex-wrap: wrap; gap: var(--sp-1); list-style: none; padding: 0; margin: 0; counter-reset: step; }
.m-steps li { counter-increment: step; padding: var(--sp-1) var(--sp-2); border-radius: var(--r-pill); background: var(--panel); border: 1px solid var(--border); color: var(--muted); }
.m-steps li::before { content: counter(step) ". "; }
.m-steps li.on { background: var(--mint); border-color: var(--sage-main); color: var(--sage-deep); font-weight: 600; }
.m-task, .m-feedback { display: grid; gap: var(--sp-1-5); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); background: var(--mint); }
.m-task p, .m-feedback p { margin: 0; }
.m-task-text { font-weight: 580; }
.m-task a, .m-feedback a { overflow-wrap: anywhere; }
.m-feedback { background: var(--gold-soft); }
.m-feedback .link { justify-self: start; }
.m-answer { margin: var(--sp-1) 0 0; white-space: pre-wrap; overflow-wrap: anywhere; padding: var(--sp-3); border-radius: var(--r-md, 10px); border: 1px solid var(--border); background: var(--panel); }
.m-answer-prev summary { cursor: pointer; }
.m-apps { display: grid; gap: var(--sp-3); }
.m-app { display: grid; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--radius); }
.m-app .m-request-head > div { flex: 1; }
.m-task-links { display: grid; gap: var(--sp-2); }

/* Forms in the Mission dialog */
.mission-dialog { width: min(560px, calc(100vw - 32px)); }
.mission-dialog.wide-dialog { width: min(680px, calc(100vw - 32px)); }
.m-form { display: grid; gap: var(--sp-3); }
.m-form label { display: grid; gap: var(--sp-1); }
.m-form .check { display: flex; align-items: center; gap: var(--sp-2); }
.m-field { display: grid; gap: var(--sp-1-5); border: 0; padding: 0; margin: 0; }
.m-field legend, .m-label { font-weight: 580; margin-bottom: var(--sp-1); }
.m-actions-edit { display: grid; gap: var(--sp-1-5); }
.m-action-row { display: flex; gap: var(--sp-1-5); align-items: center; }
.m-action-row input { flex: 1; }
.m-rules-list { list-style: none; padding: 0; margin: 0 0 var(--sp-2); display: grid; gap: var(--sp-1-5); }
.m-rules-list li { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.m-rules-list strong { color: var(--sage-deep); font-variant-numeric: tabular-nums; }

/* Home: mission banner */
#feed-mission:empty { display: none; }
.home-mission { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.home-mission-main, .home-mission-campaign { display: grid; gap: var(--sp-1-5); width: 100%; text-align: left; color: inherit; font: inherit; cursor: pointer; padding: var(--sp-4); border-radius: var(--radius); border: 1px solid var(--border); }
.home-mission-main { background: radial-gradient(120% 120% at 100% 0%, rgba(var(--hero-rgb), 1) 0%, transparent 65%), var(--panel); }
.home-mission-main strong { font-family: var(--font-display); font-size: var(--fs-lg); line-height: var(--lh-snug); }
.home-mission-campaign { background: var(--panel); border-left: 4px solid var(--sage-main); }
.home-mission-campaign .link { color: var(--sage-deep); font-weight: 640; }

/* Profile: contribution card */
.m-profile { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.m-profile-head > div { flex: 1; display: grid; }
.m-profile-kudos { display: grid; gap: var(--sp-1-5); }
.m-profile-kudos p { margin: 0; }

@media (max-width: 420px) {
  .m-impact { grid-template-columns: repeat(2, 1fr); }
  .seg.four button { font-size: var(--fs-xs); }
}
@media (prefers-reduced-motion: reduce) {
  .m-bar-fill, .m-stance-fill { transition: none; }
}

/* Mission cards carry their own padding (the base .card here has none). */
.m-me, .m-campaign, .m-progress, .m-propose, .m-stance, .m-request, .m-kudos, .m-role, .m-profile { padding: var(--sp-4); border-radius: var(--radius); }
#campaign-body { display: grid; gap: var(--sp-5); padding-bottom: var(--sp-6); }
.m-why, .m-actions, .m-updates { display: grid; gap: var(--sp-1); }

/* =====================================================================
   Performance (19 Oct 2026). Measured on a 4x-throttled phone: Home ran
   25 endless animations at 36 fps (24 fps scrolled). Decorations now
   play a few times and settle; nothing repaints the page forever.
   ===================================================================== */

/* The top bar used a live blur of whatever scrolled beneath it, which is
   recomposited every frame. A near-opaque solid bar looks the same. */
.topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--cream-bg); }

/* Background blobs: keep the soft shapes, drop the endless border-radius
   morph (a full repaint of two large shapes on every frame). */
.main::before, .main::after { animation: none; }
.cc-tile, .chan-avatar, .tab-create-disc { animation: none; }

/* Illustrated characters: wave, blink and bob on arrival, then rest. */
.il .il-swap-arrow, .il .il-bob, .il .il-blink, .il .il-wave-arm, .il .il-cheer-arm,
.il .il-sprout, .il .il-antenna, .il .il-float, .il .il-drift, .il .il-spark,
.il .il-rise, .il .il-wave-marks, .il .il-morph, .il .il-confetti { animation-iteration-count: 2; }

/* Footer and small loops: a short greeting, not a constant shimmer. */
.gf-wave-svg { animation-iteration-count: 1; animation-duration: 8s; animation-timing-function: var(--ease-out); }
.gf-inner::before, .gf-inner::after, .gf-star, .gf-pulse-dot::after, .gf-heart { animation-iteration-count: 2; }
.presence, .live-dot { animation-iteration-count: 3; }
.g-star { animation: none; }

/* The footer sits below long feeds: let the browser skip it until it's near. */
.g-footer { content-visibility: auto; contain-intrinsic-size: auto 260px; }

/* =====================================================================
   Markets layout (features/markets.js, public/markets.js): slow vs fast
   channels, ticker anchors, stock breakdown cards and automated feeds.
   ===================================================================== */

/* Ticker anchors: $TCS reads as a bold, monospaced, caps chip. */
.ticker {
  display: inline-block; padding: 0 var(--sp-1-5); margin: 0 var(--sp-px); border-radius: var(--r-xs);
  font: 800 0.86em/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: var(--tr-label);
  background: color-mix(in srgb, var(--sage-main) 16%, transparent); color: var(--sage-deep);
  border: 1px solid color-mix(in srgb, var(--sage-main) 35%, transparent); vertical-align: 0.05em;
}

/* Read-only (slow lane) channels */
.composer[hidden], .readonly-bar[hidden] { display: none !important; }
.readonly-bar {
  display: flex; align-items: center; gap: var(--sp-3); margin: 0 var(--sp-3) var(--sp-3); padding: var(--sp-3) var(--sp-3);
  border-radius: var(--r-md); background: var(--panel); border: 1px dashed var(--border-strong); font-size: var(--fs-md);
}
.readonly-bar > .icon { flex: none; width: 1.1rem; height: 1.1rem; color: var(--muted); }
.readonly-bar > span { flex: 1; }
.readonly-pill { background: var(--hover); color: var(--muted); font-size: var(--fs-xs); font-weight: 640; }
.chan-avatar.has-emoji { font-size: var(--fs-2xl); }
.chan-avatar.readonly { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--gold-mark) 55%, transparent); }

/* Feed (webhook) messages */
.msg.bot .msg-bubble { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--sage-main); }
.bot-avatar { display: inline-grid; place-items: center; background: var(--mint); color: var(--sage-deep); }
.bot-avatar .icon { width: 0.9rem; height: 0.9rem; }
.bot-pill { margin-left: var(--sp-1-5); padding: 0 var(--sp-1-5); border-radius: var(--r-xs); font-size: var(--fs-2xs); font-weight: 720; letter-spacing: var(--tr-label); background: var(--hover); color: var(--muted); }

/* Feed management (admins) */
.feed-list { display: grid; gap: var(--sp-2); }
.feed-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.feed-name { flex: 1; display: grid; }
.feed-new { display: flex; gap: var(--sp-2); }
.feed-new input { flex: 1; }
.feed-secret { display: grid; gap: var(--sp-2); padding: var(--sp-3); border-radius: var(--r-md); background: var(--gold-mark-soft); }
.feed-secret p { margin: 0; }
.feed-url, .feed-example { display: block; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); background: var(--panel); font: 0.78rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; white-space: pre-wrap; margin: 0; }

/* Composer: four shortcuts now */
.compose-chips { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 400px) { .compose-chips button { font-size: var(--fs-sm); padding-inline: var(--sp-1); } }

/* Stock breakdown card: ticker, bull vs bear, one key metric, date and disclosure. */
.breakdown { margin: 0 var(--sp-4) var(--sp-3); border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--panel-2); overflow: hidden; }
.breakdown-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
.breakdown-ticker { display: inline-flex; align-items: center; gap: var(--sp-1-5); font: 800 1.15rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: var(--tr-label); }
.breakdown-ticker .icon { width: 1.1rem; height: 1.1rem; color: var(--sage-main); }
.breakdown-kicker { font-size: var(--fs-2xs); font-weight: 720; letter-spacing: var(--tr-caps); text-transform: uppercase; color: var(--muted); }
.breakdown-cases { display: grid; grid-template-columns: 1fr 1fr; }
.breakdown-case { padding: var(--sp-3) var(--sp-4); }
.breakdown-case p { margin: var(--sp-1) 0 0; font-size: var(--fs-md); }
.breakdown-case.bull { border-right: 1px solid var(--border); }
.breakdown-label { font-size: var(--fs-xs); font-weight: 720; letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--muted); }
.breakdown-case.bull .breakdown-label { color: var(--sage-deep); }
.breakdown-case.bear .breakdown-label { color: var(--red); }
.breakdown-metric { display: grid; gap: var(--sp-0-5); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); background: var(--panel); }
.breakdown-metric strong { font-family: var(--font-display); font-size: var(--fs-base); font-variant-numeric: tabular-nums; }
.breakdown-foot { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--muted); }
.breakdown-holding.h-hold, .breakdown-holding.h-plan { color: var(--butter); font-weight: 640; }
.breakdown-form .bull-field { color: var(--sage-deep); }
.breakdown-form .bear-field { color: var(--red); }
.breakdown-form .bull-field textarea, .breakdown-form .bear-field textarea { color: var(--text); }
@media (max-width: 420px) {
  .breakdown-cases { grid-template-columns: 1fr; }
  .breakdown-case.bull { border-right: 0; border-bottom: 1px solid var(--border); }
}
:root .avatar.bot-avatar { background: var(--mint); color: var(--sage-deep); }

/* =====================================================================
   Design audit refinements (19 Oct 2026): typography, colour, spacing.
   ===================================================================== */

/* Legacy radius tokens now follow the scale: crisp, consistent corners
   (the hand-drawn "organic" shapes read as playful, not trustworthy). */
:root { --radius: var(--r-lg); --organic: var(--r-lg); }

/* ---- Typography ---- */
body {
  font-weight: 400;
  line-height: var(--lh-body);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}
h1, h2, h3, h4, .page-title, .m-statement, .m-c-head h1 { text-wrap: balance; letter-spacing: var(--tr-heading); }
h1, .page-title { font-weight: 760; letter-spacing: var(--tr-display); line-height: var(--lh-heading); }
h2 { font-weight: 700; line-height: var(--lh-snug); }
h3 { font-weight: 650; line-height: var(--lh-snug); }
p, li, .post-desc, .msg-text { text-wrap: pretty; }
strong, b { font-weight: 640; }
small, .small { font-size: var(--fs-sm); line-height: var(--lh-snug); }
.muted { font-weight: 400; }
button, .primary, .ghost, .g-cta, .chip, .seg button { font-weight: 600; letter-spacing: 0.005em; }
.g-kicker { font-size: var(--fs-xs); font-weight: 650; letter-spacing: var(--tr-caps); }

/* Comfortable reading width for long text. */
.prose p, .prose li, .lesson-body p, .lesson-body li, .m-why p, .post-desc, .info-dialog .prose { max-width: 65ch; }

/* Numbers line up in columns: counts, stats, points, prices, times. */
.m-stat strong, .m-progress-nums strong, .m-leader-pts, .m-pct, .p-stat strong, .a-tile strong, .stat-value,
.likes-count, .comment-count, .ib-time, .ib-count, .badge, .bell-badge, .msg-meta time, .breakdown-metric strong,
.m-campaign-foot, .m-stance-row strong, .lp-percent, .ticker, .breakdown-ticker { font-variant-numeric: tabular-nums lining-nums; }

/* ---- Colour ---- */
/* One action colour (market green) everywhere; policy campaigns keep indigo as a
   category marker and recognition keeps gold. Shadows carry the ink-green hue. */
::selection { background: color-mix(in srgb, var(--sage-main) 35%, transparent); color: var(--text); }
a { color: var(--sage-deep); text-underline-offset: 0.18em; }
:root[data-theme="dark"] { --lift: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(2, 10, 6, 0.35); }

/* ---- Interaction states ---- */
:focus-visible { outline: 2px solid var(--sage-main); outline-offset: 2px; border-radius: var(--r-xs); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 0; }
.primary, .ghost, .g-cta, .chip, .icon-btn, .seg button, .send-btn, .m-leader, .m-campaign, .m-action {
  transition: transform var(--dur-press, 120ms) var(--ease-out, ease-out), background-color 200ms, border-color 200ms, color 200ms;
}
.primary:active, .ghost:active, .g-cta:active, .chip:active, .send-btn:active, .m-leader:active, .m-campaign:active { transform: scale(0.98); }
.primary:hover:not(:disabled) { filter: brightness(1.06); }
@media (prefers-reduced-motion: reduce) {
  .primary, .ghost, .g-cta, .chip, .icon-btn, .seg button, .send-btn, .m-leader, .m-campaign, .m-action { transition: none; }
  .primary:active, .ghost:active, .g-cta:active, .chip:active, .send-btn:active, .m-leader:active, .m-campaign:active { transform: none; }
}

/* ---- Spacing rhythm ---- */
/* Screens breathe on a 4px grid: 16px gutters on phones, 24px between sections. */
.column { padding-inline: var(--sp-4); }
.g-section-head { margin-top: var(--sp-6); margin-bottom: var(--sp-3); }
.g-section-head h2 { font-size: var(--fs-lg); }
.m-content, .m-list { gap: var(--sp-3); }
.card { border-radius: var(--r-lg); }

/* Background blobs removed: a calm, flat page with one soft glow at the top reads
   cleaner for data-heavy screens. */
.main::before, .main::after { display: none; }
.main { background: radial-gradient(120% 40% at 50% 0%, rgba(var(--hero-rgb), 0.55) 0%, transparent 70%), var(--bg); }

/* =====================================================================
   Activity: clear, swipe-to-clear and undo.
   ===================================================================== */
.notif-tools { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); justify-content: flex-end; }
.notif-tools [hidden] { display: none; }
.danger-link { color: var(--red); }
.notif-hint { margin: 0 0 var(--sp-3); }

.notif-item {
  position: relative;
  list-style: none;
  overflow: hidden;
  border-radius: var(--r-md);
  touch-action: pan-y;          /* vertical scroll stays native; sideways is ours */
  transition: height 0.32s var(--ease-out, ease-out), margin 0.32s var(--ease-out, ease-out), opacity 0.32s;
  transition-delay: calc(var(--i, 0) * 30ms);
}
.notif-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: inherit;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.notif-item.dragging .notif-row { transition: none; }
.notif-row > .notif { flex: 1; min-width: 0; }
.notif-item.leaving { opacity: 0; }
.notif-item.leaving .notif-row { transition-delay: calc(var(--i, 0) * 30ms); }

/* The red "Clear" layer revealed under the row as it slides. */
.notif-swipe-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-5);
  color: #fff;
  font-weight: 640;
  font-size: var(--fs-sm);
  background: color-mix(in srgb, var(--red) calc(55% + var(--swipe, 0) * 45%), var(--bg));
  border-radius: inherit;
}
.notif-item.swipe-left .notif-swipe-bg { justify-content: flex-end; }
.notif-swipe-bg .icon { width: 1.15rem; height: 1.15rem; transform: scale(calc(0.8 + var(--swipe, 0) * 0.3)); }

/* Per-item clear button: always there for keyboard and screen readers; shown on hover
   with a mouse, and subtle on touch screens (swipe is the main gesture there). */
.notif-clear { flex: none; opacity: 0.45; transition: opacity 0.2s; }
.notif-item:hover .notif-clear, .notif-clear:focus-visible { opacity: 1; }
@media (hover: none) { .notif-clear { opacity: 0.35; } }

.notif-undo {
  position: sticky;
  bottom: var(--sp-3);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--text);
  color: var(--bg);
  font-size: var(--fs-md);
  box-shadow: var(--lift);
}
.notif-undo[hidden] { display: none; }
.notif-undo .link { color: var(--sage-main); font-weight: 700; }
:root[data-theme="dark"] .notif-undo .link { color: #0F5C3B; }
.push-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.push-tip { margin-top: var(--sp-2); }

@media (prefers-reduced-motion: reduce) {
  .notif-item, .notif-row { transition: none; }
}
.notif-list { display: grid; gap: var(--sp-2); padding: 0; }
.notif-row { background: var(--panel); border: 1px solid var(--border); }
.notif-row > .notif { background: transparent; border: 0; box-shadow: none; border-radius: inherit; }
.notif-row:has(.notif.unread) { border-color: color-mix(in srgb, var(--sage-main) 45%, var(--border)); background: color-mix(in srgb, var(--sage-main) 7%, var(--panel)); }
.notif-item.leaving { margin-bottom: calc(-1 * var(--sp-2)); }

/* =====================================================================
   Capital Commons design system, inspired by Wise (VoltAgent/awesome-design-md,
   see DESIGN.md at the project root). Our own identity: the Commons mint-lime,
   ▲commons wordmark and name; Wise's structure: one bright action colour on a
   sage canvas, white surfaces without borders, heavy 900 headlines over Inter
   600/400, and generous 24px rounded cards and pill buttons.
   ===================================================================== */
/* JG Antony family palette (from jgantony.com, the parent site): bone canvas and
   near-black ink, the logo's ember orange as the one action colour, antique gold for
   marks. Token names are historical (sage/mint/forest); the values are the brand's. */
:root {
  /* Surfaces: bone canvas, white cards. Surface contrast is the elevation. */
  --cream-bg: #EBEAE4;
  --offwhite: #FFFFFF;
  --panel-2: #F4F3EE;
  --hover: #E2E0D8;
  --border: #DAD8D0;
  --border-strong: #0A0A0A;
  --mint: #F3E9D2;              /* pale gold: soft feature cards, positive badges */
  /* One action colour: JG ember orange, always with white text on it. */
  --sage-main: #C2410C;
  --coral-2: #9A3412;           /* hover/active of the action colour */
  --on-accent: #FFFFFF;
  --accent-text: #FFFFFF;
  --brand-ember: #DE4826;       /* the logo's own orange */
  /* Ink and text */
  --forest: #0A0A0A;
  --sage-deep: #9A3412;         /* links and accent labels on light surfaces */
  --on-deep: #FFFFFF;
  --muted: #5C5B57;
  --tone-green-text: #9A3412;
  /* Semantic (never the brand colour for status) */
  --positive: #2EAD4B;
  --positive-deep: #054D28;
  --warning: #FFD11A;
  --warning-content: #4A3B1C;
  --red: #C42B32;
  --red-soft: #FBE3E2;
  --gold-mark: #9A7420;
  --gold-mark-soft: #F3E9D2;
  --duo-fill: rgba(194, 65, 12, 0.22);
  --hero-rgb: 243, 233, 210;
  --sage-fill-2: #EBB79F;
  --green-dot: #2EAD4B;
  --lift: none;
  --radius: 24px;
  --organic: 24px;
  --r-lg: 16px;
  --r-xl: 24px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --cream-bg: #0A0A0A;
  --offwhite: #161616;
  --panel-2: #111111;
  --hover: #222221;
  --border: #2A2A28;
  --border-strong: #EBEAE4;
  --mint: #2A2214;
  --sage-main: #FF6B2C;
  --coral-2: #FF8A55;
  --on-accent: #0A0A0A;
  --accent-text: #0A0A0A;
  --forest: #EBEAE4;
  --sage-deep: #FF8A55;
  --on-deep: #0A0A0A;
  --muted: #A3A29B;
  --tone-green-text: #FF8A55;
  --positive: #6BCF8E;
  --positive-deep: #8FDDA9;
  --red: #F07178;
  --red-soft: #3A1B1B;
  --gold-mark: #D4A84B;
  --gold-mark-soft: #2A2214;
  --duo-fill: rgba(255, 107, 44, 0.26);
  --hero-rgb: 42, 34, 20;
  --sage-fill-2: #5A2A14;
  --green-dot: #4CC867;
  --lift: none;
  color-scheme: dark;
}

/* ---- Type (JG Antony): Fraunces 600 for display, Outfit 600 headings/labels/buttons, 400 body ---- */
body { font-family: var(--font-body); font-weight: 400; font-feature-settings: "calt" 1; color: var(--text); background: var(--bg); }
h1, .page-title, .m-statement, .m-c-head h1, .auth-hero h1, .lesson-title, #view-title {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -0.03em; line-height: 1.06; font-optical-sizing: auto;
}
h2, h3, h4 { font-family: var(--font-ui); }
h2 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
h3, h4 { font-weight: 600; letter-spacing: -0.01em; }
strong, b, .post-title, .m-campaign-title, .m-request-title { font-weight: 600; }
.g-kicker { font-weight: 600; letter-spacing: 0.06em; }
/* Numbers stay in the UI face so tabular figures line up. */
.m-stat strong, .m-progress-nums strong, .p-stat strong, .a-tile strong, .breakdown-metric strong,
.ps-text strong, .lj-value, .lj-mini strong { font-family: var(--font-ui); }
/* Wordmark: the JG Antony elephant mark + the community name in Outfit, as on jgantony.com. */
.brand, .gf-brand, .intro-brand { font-family: var(--font-ui); font-weight: 700; letter-spacing: -0.035em; }
.brand-mark { display: inline-block; height: 0.82em; width: auto; vertical-align: -0.06em; margin-right: 0.28em; }
.intro-brand .brand-mark { align-self: center; height: 0.7em; animation: intro-letter 0.7s var(--cine-ease) both; }
.brand .dot, .gf-dot, .intro-dot { color: var(--brand-ember); }
.rail-note-mark .brand-mark { height: 22px; margin: 0; }
.avatar.brand-avatar { background: #0A0A0A; }
.avatar.brand-avatar img { width: 70%; height: auto; object-fit: contain; border-radius: 0; }
.m-stat strong, .m-progress-nums strong, .p-stat strong, .a-tile strong, .breakdown-metric strong { font-weight: 800; letter-spacing: -0.02em; }

/* ---- Surfaces: white cards on sage, no borders or shadows ---- */
.card, .post, .cc, .compose-card, .home-mission-main, .home-mission-campaign, .m-me, .m-campaign, .m-progress,
.m-propose, .m-stance, .m-request, .m-kudos, .m-role, .m-profile, .m-leader, .g-settings, .p-card, .p-statbar,
.lj-card, .lp-card, .empty-moments, .ib-row, .notif-row, .breakdown, .readonly-bar, .auth-card, .pending-card, .suggest {
  background: var(--offwhite);
  border: 0;
  box-shadow: none;
  border-radius: var(--r-xl);
}
.m-stat, .breakdown-metric, .panel-2 { background: var(--panel-2); border: 0; }
.home-mission-campaign, .m-campaign { border-left: 0; }
.m-campaign { box-shadow: inset 4px 0 0 var(--sage-main); }
.m-campaign.type-policy { box-shadow: inset 4px 0 0 var(--lilac); }
.m-campaign.type-support { box-shadow: inset 4px 0 0 var(--gold-mark); }
.m-campaign.type-awareness { box-shadow: inset 4px 0 0 var(--red); }
.notif-row:has(.notif.unread) { background: var(--mint); border: 0; }
.m-action { background: var(--offwhite); border: 0; border-radius: var(--r-lg); }
.m-action.done { background: var(--mint); }

/* Feature cards: pale mint for friendly moments, ink for the one promotional moment. */
.home-mission-main, .m-support-intro p, .compose-card { background: var(--mint); }
.m-hero { background: var(--forest); color: var(--sage-main); border: 0; }
.m-hero .g-kicker, .m-hero .m-edit { color: color-mix(in srgb, var(--sage-main) 80%, var(--cream-bg)); }
.m-hero .m-statement { color: var(--sage-main); }
/* On the ink band, the deep light-theme orange is too dim; use the bright one. */
:root:not([data-theme="dark"]) .m-hero, :root:not([data-theme="dark"]) .m-hero .m-statement, :root:not([data-theme="dark"]) .m-hero .m-stat .icon { color: #FF6B2C; }
:root:not([data-theme="dark"]) .m-hero .g-kicker, :root:not([data-theme="dark"]) .m-hero .m-edit { color: #E8C47A; }
:root:not([data-theme="dark"]) .gf-star, :root:not([data-theme="dark"]) .g-footer .gf-dot { color: #FF6B2C; }
.m-hero .m-stat { background: color-mix(in srgb, var(--cream-bg) 10%, var(--forest)); }
.m-hero .m-stat strong { color: var(--cream-bg); }
.m-hero .m-stat span { color: color-mix(in srgb, var(--cream-bg) 70%, var(--forest)); }
.m-hero .m-stat .icon { color: var(--sage-main); }
.m-hero::after { display: none; }
:root[data-theme="dark"] .m-hero { background: var(--mint); }
:root[data-theme="dark"] .m-hero .m-stat { background: var(--offwhite); }
:root[data-theme="dark"] .m-hero .m-stat strong { color: var(--text); }

/* ---- Buttons: 24px pill rectangles, 600 labels, ~48px tall ---- */
.primary, .g-cta, button.primary, .lp-cta, .cc-join {
  background: var(--sage-main); color: var(--on-accent); border: 0; border-radius: var(--r-pill);
  font-weight: 600; min-height: 48px; padding: 12px 24px;
}
.primary:hover:not(:disabled), .g-cta:hover { background: var(--coral-2); filter: none; }
.ghost, button.ghost {
  background: transparent; color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-pill);
  font-weight: 600; min-height: 48px; padding: 12px 24px;
}
.ghost:hover { background: var(--hover); }
.primary.small, .ghost.small, .g-cta.small { min-height: 36px; padding: 6px 16px; font-size: var(--fs-md); }
.link { color: var(--sage-deep); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.link.small { font-weight: 600; }
.danger, .ghost.danger, .danger-link { color: var(--red); }
.icon-btn { border-radius: var(--r-pill); }

/* Chips and segmented tabs: selected = ink (polarity flip), never the action colour. */
.seg { background: var(--offwhite); border: 0; border-radius: var(--r-pill); padding: 4px; }
.seg button { border-radius: var(--r-pill); font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--forest); color: var(--cream-bg); box-shadow: none; }
.chip, .m-chips .chip { border: 0; background: var(--offwhite); color: var(--text); border-radius: var(--r-pill); font-weight: 600; }
.chip.on, .m-chips .chip.on { background: var(--forest); color: var(--cream-bg); }

/* ---- Inputs: white, 1px ink outline, 12px corners ---- */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), textarea, select {
  background: var(--offwhite); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--forest) 55%, transparent); border-radius: 12px;
  padding: 12px 16px; font: inherit; font-weight: 400;
}
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--forest); outline-offset: 1px; border-color: var(--forest); }
:root[data-theme="dark"] input:focus-visible, :root[data-theme="dark"] textarea:focus-visible, :root[data-theme="dark"] select:focus-visible { outline-color: var(--sage-main); border-color: var(--sage-main); }
:focus-visible { outline-color: var(--forest); }
:root[data-theme="dark"] :focus-visible { outline-color: var(--sage-main); }
.composer textarea { border-radius: var(--r-pill); }

/* ---- Navigation: white bars, ink active pill, lime create button ---- */
.topbar { background: var(--offwhite); border-bottom: 1px solid var(--border); }
.tabbar { background: var(--offwhite); border-top: 1px solid var(--border); }
.tabbar button.active .icon { background: var(--forest); color: var(--cream-bg); --duo: transparent; }
.tabbar button.active::after { background: var(--forest); }
.tabbar .tab-create .tab-create-disc { background: var(--sage-main); color: var(--on-accent); box-shadow: none; border-radius: var(--r-pill) !important; }
:root[data-theme="dark"] .tabbar button.active .icon { background: var(--forest); color: var(--cream-bg); }

/* ---- Badges and status: semantic colours, pill shape ---- */
.pill, .badge-positive, .pill.ok { border-radius: var(--r-pill); font-weight: 600; }
.pill.ok { background: var(--mint); color: var(--positive-deep); }
.pill.warn { background: var(--red-soft); color: var(--red); }
.bell-badge, .badge, .ib-count { background: var(--forest); color: var(--cream-bg); font-weight: 700; }
:root[data-theme="dark"] .bell-badge, :root[data-theme="dark"] .badge, :root[data-theme="dark"] .ib-count { background: var(--sage-main); color: var(--on-accent); }
.m-bar-fill, .m-stance-fill { background: var(--positive); }
.s-oppose .m-stance-fill { background: var(--red); }
.ticker { background: var(--mint); border: 0; color: var(--sage-deep); border-radius: 6px; }

/* ---- Footer: the dark ink band ---- */
.g-footer .gf-inner, .g-footer { background: var(--forest); color: var(--cream-bg); }
.g-footer .gf-wave { display: none; }
.g-footer { border-radius: var(--r-xl) var(--r-xl) 0 0; padding-top: var(--sp-8); }
.gf-brand, .gf-tag, .g-footer p { color: var(--cream-bg); }
.gf-star, .gf-dot { color: var(--sage-main); }
.gf-link { background: color-mix(in srgb, var(--cream-bg) 10%, var(--forest)); color: var(--cream-bg); border: 0; }
.gf-top { background: var(--sage-main); color: var(--on-accent); }
.gf-inner::before, .gf-inner::after { display: none; }
:root[data-theme="dark"] .g-footer, :root[data-theme="dark"] .g-footer .gf-inner { background: var(--offwhite); }
:root[data-theme="dark"] .gf-brand, :root[data-theme="dark"] .gf-tag, :root[data-theme="dark"] .g-footer p { color: var(--text); }
:root[data-theme="dark"] .gf-link { background: var(--hover); color: var(--text); }

/* ---- Dialogs and toasts: white cards, 24px ---- */
dialog { background: var(--offwhite); border: 0; border-radius: var(--r-xl); }
.toast, .ntoast, .notif-undo { border-radius: var(--r-lg); }

/* =====================================================================
   Profile, compact: every section fits in one glance on a phone.
   ===================================================================== */
#profile-view .profile-column { display: grid; gap: var(--sp-3); }
#profile-head { display: grid; gap: var(--sp-3); }
#profile-impact:empty, #profile-skills:empty, #profile-learning:empty { display: none; }

/* Stats: one slim strip instead of three tall tiles. */
.p-statbar { display: grid; grid-template-columns: repeat(3, 1fr); padding: var(--sp-2) var(--sp-1); gap: 0; }
.p-statbar .ps-item { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-1); }
.p-statbar .ps-item + .ps-item { border-left: 1px solid var(--border); }
.p-statbar .ps-icon { width: 30px; height: 30px; flex: none; }
.p-statbar .ps-icon svg { width: 30px; height: 30px; }
.p-statbar .ps-text { display: grid; line-height: 1.1; text-align: left; }
.p-statbar .ps-text strong { font-size: var(--fs-xl); font-weight: 800; }
.p-statbar .ps-text span { font-size: var(--fs-xs); color: var(--muted); }

/* Actions: one row. */
.p-buttons-mine { display: grid; grid-template-columns: 1fr auto auto; gap: var(--sp-2); }
.p-btn-icon { width: 48px; min-width: 48px; padding: 0; justify-content: center; }
.p-btn-icon .icon { margin: 0; }

/* Contributor: slim banner. */
.m-profile.slim { padding: var(--sp-3) var(--sp-4); margin: 0; }
.m-profile.slim .m-tier-mark { width: 40px; height: 40px; border-radius: 12px; }
.m-profile-meta { flex: 1; display: grid; gap: 2px; min-width: 0; }
.m-profile-bar { display: block; height: 4px; border-radius: 999px; background: var(--hover); overflow: hidden; margin-top: 4px; max-width: 220px; }
.m-profile-bar i { display: block; height: 100%; background: var(--gold-mark); border-radius: inherit; }

/* Cards in the profile share one compact rhythm. */
.lj-card.compact { padding: var(--sp-4); display: grid; gap: var(--sp-3); }
.lj-card.compact .lj-title { margin: 0; font-size: var(--fs-lg); display: flex; align-items: center; gap: var(--sp-2); }
.lj-card.compact .lj-title .icon { width: 1.2rem; height: 1.2rem; color: var(--sage-deep); }

/* Skills: two-column grid of short groups; chips flow side by side. */
.skills-head-actions { display: inline-flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-4); }
.skills-cell { display: grid; gap: var(--sp-1-5); align-content: start; min-width: 0; }
.skills-cell-label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.skills-cell-label .icon { width: 0.95rem; height: 0.95rem; }
.tone-text-green .skills-cell-label .icon { color: var(--sage-deep); }
.tone-text-purple .skills-cell-label .icon { color: var(--lilac); }
.tone-text-orange .skills-cell-label .icon { color: var(--gold-mark); }
.skills-card.compact .skill-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.skills-card.compact .skill-chip { padding: 4px 10px; font-size: var(--fs-sm); font-weight: 600; border-radius: var(--r-pill); background: var(--panel-2); border: 0; white-space: normal; }
@media (max-width: 340px) { .skills-grid { grid-template-columns: 1fr; } }

/* Learning: a level row with a 5-step track, then three mini stats. */
.lj-level { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: var(--sp-3); width: 100%; padding: var(--sp-3); border: 0; border-radius: var(--r-lg); background: var(--mint); color: inherit; font: inherit; text-align: left; }
button.lj-level { cursor: pointer; }
.lj-level-badge { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--forest); color: var(--sage-main); font-weight: 900; font-size: var(--fs-xl); }
.lj-level-text { display: grid; min-width: 0; line-height: 1.25; }
.lj-level-text strong { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lj-level-text span { font-size: var(--fs-sm); color: var(--muted); }
.lj-track { display: inline-flex; gap: 3px; }
.lj-track i { width: 10px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--forest) 18%, transparent); }
.lj-track i.done { background: var(--positive); }
.lj-track i.now { background: var(--forest); width: 16px; }
.lj-level > .icon { width: 1rem; height: 1rem; color: var(--muted); }
.lj-minis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.lj-mini { display: grid; justify-items: start; gap: 2px; padding: var(--sp-2) var(--sp-3); border: 0; border-radius: var(--r-md); background: var(--panel-2); color: inherit; font: inherit; text-align: left; }
button.lj-mini { cursor: pointer; }
.lj-mini .icon { width: 1rem; height: 1rem; color: var(--sage-deep); }
.lj-mini strong { font-size: var(--fs-xl); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.lj-mini span { font-size: var(--fs-xs); color: var(--muted); }
.lj-nudge { margin: 0; color: var(--muted); }
.lj-card.compact .badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* Circles: privacy note, chat button, lock on circle posts. */
.circle-privacy { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-3); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--panel-2); color: var(--muted); }
.circle-privacy .icon { width: 1rem; height: 1rem; flex: none; }
.circle-locked p { max-width: 36ch; margin-inline: auto; }
.circle-tag .icon { width: 0.8rem; height: 0.8rem; margin-right: 3px; vertical-align: -0.1em; }
/* Stats strip: icon beside the number, never stacked (beats the older phone rule). */
.p-statbar .ps-item { flex-direction: row; text-align: left; }
.p-statbar .ps-text { justify-items: start; }
.p-statbar .ps-icon.il-art { width: 30px; height: 30px; }
.p-level { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* Circle header: name and description get the full width; actions sit in their own row. */
.g-circle-head { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-3) var(--sp-4); align-items: start; }
.g-circle-head .g-circle-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.g-circle-head .g-circle-actions .g-create { flex: 1 1 140px; justify-content: center; }
.g-circle-head h1 { font-size: var(--fs-2xl); margin: 2px 0 var(--sp-1); }
.g-circle-head p { margin: 0 0 var(--sp-2); max-width: 60ch; }
.lj-level-badge { background: var(--sage-main); color: var(--on-accent); }
