@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #ECEFF3;
  --ink: #2B2F36;
  --ink-2: #6B7280;
  --ink-3: #9AA3B0;
  --accent: #5C6FA8;
  --accent-warm: #B89968;
  --shadow-dark: rgba(149, 165, 188, 0.42);
  --shadow-darker: rgba(139, 155, 178, 0.55);
  --shadow-light: rgba(255, 255, 255, 1);
  --r: 22px;
  --r-sm: 14px;
  --r-pill: 999px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- emboss recipes ---------- */
.raised {
  background: var(--bg);
  box-shadow:
    -8px -8px 16px var(--shadow-light),
    8px 8px 18px var(--shadow-dark);
}
.raised-sm {
  background: var(--bg);
  box-shadow:
    -4px -4px 10px var(--shadow-light),
    4px 4px 10px var(--shadow-dark);
}
.raised-xs {
  background: var(--bg);
  box-shadow:
    -2px -2px 6px var(--shadow-light),
    2px 2px 6px var(--shadow-dark);
}
.sunken {
  background: var(--bg);
  box-shadow:
    inset 4px 4px 10px var(--shadow-dark),
    inset -4px -4px 10px var(--shadow-light);
}
.sunken-sm {
  background: var(--bg);
  box-shadow:
    inset 2px 2px 6px var(--shadow-dark),
    inset -2px -2px 6px var(--shadow-light);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "ss01", "ss02";
  letter-spacing: -0.005em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; border: 0; background: transparent; cursor: pointer; }
input, textarea { font: inherit; color: inherit; border: 0; outline: none; background: transparent; }
textarea { resize: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; opacity: 0.8; }

/* ---------- layout shell ---------- */
.shell {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px 96px;
}
.stage {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---------- top bar ---------- */
.topbar-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.topbar-me {
  display: flex;
  justify-content: flex-end;
  padding: 8px 10px;
  border-radius: var(--r-pill);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: var(--r-pill);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 19px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { opacity: 1; }
.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--bg);
  display: inline-block;
  box-shadow:
    inset 1.5px 1.5px 3px var(--shadow-dark),
    inset -1.5px -1.5px 3px var(--shadow-light);
}
.tabs {
  display: flex;
  padding: 5px;
  border-radius: var(--r-pill);
  gap: 4px;
}
.tab {
  padding: 8px 18px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.005em;
  transition: color 140ms var(--ease), box-shadow 220ms var(--ease), background 220ms var(--ease);
  text-decoration: none;
  display: inline-block;
}
.tab.active {
  color: var(--ink);
  background: var(--bg);
  box-shadow:
    -2px -2px 6px var(--shadow-light),
    2px 2px 6px var(--shadow-dark);
}
.tab:hover:not(.active) { color: var(--ink); opacity: 1; }

/* ---------- user chip ---------- */
.me-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--r-pill);
  transition: transform 160ms var(--ease);
  text-decoration: none;
}
.me-chip:hover { transform: translateY(-1px); opacity: 1; }
.me-chip:active { transform: translateY(0); }
.me-chip .me-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.coin-chip {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  background: rgba(0, 0, 0, 0.04);
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-decoration: none;
  transition: color 140ms var(--ease), background 140ms var(--ease);
}
.coin-chip:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.07);
  opacity: 1;
}

/* ---------- coins breakdown page ---------- */
.coins-balance {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
}
.coins-balance-icon {
  font-size: 20px;
  color: var(--accent-warm);
}
.coins-balance-amount {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 32px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.coins-balance-unit {
  font-size: 14px;
  color: var(--ink-3);
}
.coins-breakdown {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.coins-breakdown-row {
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.coins-breakdown-row:last-child { border-bottom: 0; }
.coins-row-empty { opacity: 0.55; }
.coins-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.coins-row-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.coins-row-total {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.coins-row-total.negative { color: var(--accent-warm); }
.coins-row-meta {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.coins-recent {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.coins-recent-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.coins-recent-row:last-child { border-bottom: 0; }
.coins-recent-time {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--ink-3);
}
.coins-kind-pill {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--ink-2);
}
.coins-recent-amount {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 600;
  color: var(--ink);
}
.coins-recent-amount.negative { color: var(--accent-warm); }

/* ---------- topbar auth links (logged out) ---------- */
.topbar-links {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-links a {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 140ms var(--ease);
}
.topbar-links a:hover { color: var(--ink); opacity: 1; }
.topbar-links a.primary {
  color: var(--ink);
  background: var(--bg);
  box-shadow:
    -2px -2px 6px var(--shadow-light),
    2px 2px 6px var(--shadow-dark);
}

/* ---------- avatar ---------- */
.av {
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 600;
  letter-spacing: 0;
  flex: none;
}
.av-warm  { background: linear-gradient(145deg, #F4DCC0, #E8C8A4); color: #6E4E2A; }
.av-cool  { background: linear-gradient(145deg, #D6DCEC, #BFC8DC); color: #3F4F76; }
.av-sage  { background: linear-gradient(145deg, #DCE6DA, #BFCEBB); color: #4B6347; }
.av-clay  { background: linear-gradient(145deg, #EBD0CC, #D6B4AE); color: #7B423A; }
.av-mauve { background: linear-gradient(145deg, #E6DAE4, #CDBDC9); color: #5E4658; }
.av-me    { background: linear-gradient(145deg, #EDE3D2, #D9C5A6); color: #6E5A38; }

/* ---------- post bubble ---------- */
.post {
  padding: 24px 26px 22px;
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 220ms var(--ease);
}
.post:hover { transform: translateY(-1px); }
.post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.post-author {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.post-handle {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.post-handle:hover { opacity: 0.75; }
.post-time {
  font-size: 12px;
  color: var(--ink-3);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0;
}
.post-body {
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-wrap: pretty;
  word-break: break-word;
}
.post-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in oklch, var(--accent), transparent 60%);
}
.post img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-sm);
  display: block;
}

/* ---------- profile-compact post variant ---------- */
.profile-compact .post { padding: 12px 16px 10px; gap: 8px; }
.profile-compact .post-head { gap: 8px; }
.profile-compact .post-author > .av { width: 26px !important; height: 26px !important; font-size: 11px !important; }
.profile-compact .post-body { font-size: 14px; line-height: 1.45; }
.profile-compact .post-foot { gap: 6px; padding-top: 6px; }
.profile-compact .post img { max-height: 280px; object-fit: cover; }

/* ---------- friend-chat badge + accent ---------- */
.friend-chat-badge {
  background: linear-gradient(180deg, #b9a8ff, #8b73f0);
  color: #1a1238;
  border: 1px solid #6f55d8;
}
.post.friend-chat { border-left: 3px solid #8b73f0; }

/* ---------- per-author collapse icon ---------- */
.post-collapse-author,
.post-collapse-single,
.post-hide-author {
  padding: 4px 8px !important;
  margin-right: 2px;
  font-size: 13px !important;
  font-weight: 600;
}

/* feed-only buttons are hidden outside the feed page */
.feed-only { display: none !important; }
.feed-posts .feed-only { display: inline-flex !important; }

/* hide all post-author tool buttons on friends chat mode */
#friends-stage.chat-mode .post-collapse-author,
#friends-stage.chat-mode .post-collapse-single,
#friends-stage.chat-mode .post-hide-author { display: none !important; }

/* ensure avatar (user icon) is visible on friends chat — restore .post-author */
#friends-stage.chat-mode .post .post-author { display: flex !important; }
#friends-stage.chat-mode .post.mine .post-head .post-author { display: flex !important; }
#friends-stage.chat-mode .post.streak-follow .post-head { display: flex !important; }
#friends-stage.chat-mode .post.streak-follow .post-head .post-time { display: none; }

/* author-hidden state */
.post.author-hidden { display: none !important; }

/* hidden-authors strip on feed */
.hidden-authors-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 14px;
  margin: 4px 0 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--ink-2);
}
.hidden-authors-strip[hidden] { display: none; }
.hidden-authors-strip .label { color: var(--ink-3); margin-right: 4px; }
.hidden-authors-strip .hidden-author-chip {
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--bg);
  box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  cursor: pointer;
}
.hidden-authors-strip .hidden-author-chip:hover { color: var(--ink); }
.hidden-authors-strip .hidden-author-chip .x { margin-left: 4px; color: var(--ink-3); }

/* ---------- collapsed post state ---------- */
.post.collapsed > img,
.post.collapsed .post-body,
.post.collapsed .edit-form,
.post.collapsed .post-foot { display: none; }
.post.collapsed { padding-bottom: 10px; gap: 0; }

/* ---------- hide-friend-chats toggle effect ---------- */
.hide-friend-chats .post.friend-chat { display: none; }

/* ---------- profile prefs bar ---------- */
.profile-prefs {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px 14px;
  margin: 8px 0;
  border-radius: var(--r-sm);
}

/* ---------- icon button (delete, share) ---------- */
.ico-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: 0;
  transition: color 160ms var(--ease), transform 140ms var(--ease), box-shadow 220ms var(--ease);
  cursor: pointer;
}
.ico-btn:hover { color: var(--ink); }
.ico-btn:active { transform: scale(0.97); }
.ico-btn.danger:hover { color: #C04040; }
.ico-btn.reposted { color: var(--accent); cursor: default; }
.ico-btn.reposted:hover { color: var(--accent); }

.post-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.repost-info {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
  flex-wrap: wrap;
}
.repost-count {
  font-size: 11px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--ink-3);
}
.repost-who {
  font-size: 11px;
  color: var(--ink-3);
}
.repost-name {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 11px;
}
.repost-name:hover { color: var(--ink); }
.post-hash {
  font-size: 11px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--ink-3);
  letter-spacing: 0.03em;
  margin-right: 8px;
  user-select: all;
}

/* ---------- profile ---------- */
.profile-head {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 24px 26px;
  border-radius: var(--r);
}
.profile-av {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  flex: none;
}
.profile-av .glyph {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.profile-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.profile-name { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.profile-handle {
  font-size: 13.5px;
  color: var(--ink-2);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.profile-bio { font-size: 14px; color: var(--ink-2); margin-top: 6px; line-height: 1.5; }
.profile-stats {
  display: flex;
  gap: 22px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.profile-stats b { color: var(--ink); font-weight: 600; }

/* ---------- composer / forms ---------- */
.composer {
  padding: 22px 22px 18px;
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.composer-label {
  font-size: 12px;
  color: var(--ink-3);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-left: 4px;
}
.composer-field {
  padding: 18px 20px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.composer-field textarea,
.composer-field input {
  width: 100%;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  letter-spacing: -0.005em;
  min-height: unset;
}
.composer-field textarea { min-height: 100px; }
.composer-field textarea::placeholder,
.composer-field input::placeholder { color: var(--ink-3); }
.composer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

/* ---------- form rows (login / signup) ---------- */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-row label {
  font-size: 12px;
  color: var(--ink-3);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-left: 4px;
}
.form-input {
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 15px;
  color: var(--ink);
  width: 100%;
}
.form-input::placeholder { color: var(--ink-3); }
.form-input input {
  width: 100%;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
}

/* ---------- publish / submit buttons ---------- */
.publish {
  padding: 11px 22px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  transition: transform 140ms var(--ease), color 160ms var(--ease), box-shadow 220ms var(--ease);
  cursor: pointer;
}
.publish:hover { color: var(--accent-warm); }
.publish:active { transform: scale(0.97); }

/* ---------- section labels ---------- */
.section-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--ink-3);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------- empty state ---------- */
.empty {
  padding: 36px 26px;
  border-radius: var(--r);
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.6;
}
.empty .small {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

/* ---------- flash / error ---------- */
.flash {
  padding: 16px 20px;
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--ink-2);
  background: var(--bg);
  box-shadow:
    inset 4px 4px 10px var(--shadow-dark),
    inset -4px -4px 10px var(--shadow-light);
  border-left: 3px solid var(--accent-warm);
}

/* ---------- landing hero ---------- */
.hero {
  padding: 36px 30px;
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.hero-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.2;
}
.hero-sub {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.6;
}
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-2);
}
.feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: none;
  background: var(--bg);
  box-shadow:
    inset 1.5px 1.5px 3px var(--shadow-dark),
    inset -1.5px -1.5px 3px var(--shadow-light);
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}
.hero-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 10px 18px;
  border-radius: var(--r-pill);
  transition: color 140ms var(--ease);
}
.hero-link:hover { color: var(--ink); opacity: 1; }

/* ---------- footer ---------- */
.footnote {
  text-align: center;
  color: var(--ink-3);
  font-size: 11.5px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.04em;
}

/* ---------- page animation ---------- */
.page {
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: pageIn 240ms var(--ease) both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- markdown content inside posts ---------- */
.post-body code {
  background: rgba(92, 111, 168, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.9em;
}
.post-body pre {
  background: rgba(92, 111, 168, 0.06);
  padding: 16px 18px;
  border-radius: var(--r-sm);
  overflow-x: auto;
  line-height: 1.45;
}
.post-body pre code {
  background: none;
  padding: 0;
}
.post-body blockquote {
  border-left: 3px solid var(--accent-warm);
  padding-left: 14px;
  margin: 4px 0;
  color: var(--ink-2);
}
.post-body ul, .post-body ol {
  padding-left: 22px;
  margin: 4px 0;
}
.post-body li { margin: 4px 0; }
.post-body h1, .post-body h2, .post-body h3,
.post-body h4, .post-body h5, .post-body h6 {
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 14px 0 6px;
  color: var(--ink);
}
.post-body h1 { font-size: 1.35em; }
.post-body h2 { font-size: 1.2em; }
.post-body h3 { font-size: 1.08em; }
.post-body h4,
.post-body h5,
.post-body h6 { font-size: 1em; }
.post-body h1:first-child,
.post-body h2:first-child,
.post-body h3:first-child { margin-top: 0; }
.post-body hr {
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin: 14px 0;
}

/* ---------- privacy page ---------- */
.priv-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}
.priv-table th,
.priv-table td {
  padding: 12px 10px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid rgba(149, 165, 188, 0.2);
}
.priv-table th {
  font-weight: 600;
  color: var(--ink-2);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.priv-table tbody tr:last-child td {
  border-bottom: none;
}
.special-row {
  font-style: italic;
  color: var(--ink-2);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  margin: 2px 4px 2px 0;
  font-size: 12px;
  background: var(--bg);
}
.chip-remove {
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
}
.chip-remove:hover {
  color: var(--ink);
}
.inline-form {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}
.form-inline-input {
  padding: 6px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  color: var(--ink);
  max-width: 120px;
}
.create-group-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(149, 165, 188, 0.2);
}
.create-group-form input {
  flex: 1;
  max-width: 240px;
}
.bulk-form {
  margin-bottom: 20px;
}
.bulk-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: var(--r-sm);
  background: rgba(92, 111, 168, 0.03);
  flex-wrap: wrap;
}
.group-checkboxes {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.checkbox-label input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent);
}
.post-compact {
  display: grid;
  grid-template-columns: 60px 70px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  margin: 8px 0;
}
.pc-date {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}
.pc-id {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.pc-excerpt {
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-groups {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.pc-groups .checkbox-label {
  font-size: 11px;
  margin: 0;
}
.post-list {
  margin-top: 14px;
}

/* ---------- feed group filter dropdown ---------- */
.group-filter > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.35rem 0.9rem;
  border-radius: var(--r-pill);
  cursor: pointer;
  list-style: none;
  font-size: 12px;
}
.group-filter > summary::-webkit-details-marker {
  display: none;
}
.group-filter > summary::after {
  content: "▾";
  font-size: 10px;
  color: var(--ink-3);
}
.group-filter[open] > summary::after {
  content: "▴";
}

.group-filter-panel {
  margin-top: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

a.chip {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background: var(--bg);
  box-shadow:
    -4px -4px 10px var(--shadow-light),
    4px 4px 10px var(--shadow-dark);
}
a.chip:hover {
  filter: brightness(0.98);
}

.chip-selected {
  box-shadow:
    inset 2px 2px 6px var(--shadow-dark),
    inset -2px -2px 6px var(--shadow-light);
}

/* ---------- image upload input ---------- */
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  font-size: 13px;
  color: var(--ink-2);
}
.file-row label {
  font-size: 12px;
  color: var(--ink-3);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.file-row input[type="file"] {
  font-size: 13px;
  color: var(--ink-2);
  flex: 1;
  min-width: 0;
}

/* ---------- help text / small ---------- */
.hint {
  font-size: 12px;
  color: var(--ink-3);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  padding: 0 4px;
  line-height: 1.5;
}
.hint a { color: var(--accent); }

/* ---------- friends tab ---------- */
.group-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 14px;
}
.group-chip-row .chip {
  padding: 6px 14px;
  font-size: 12.5px;
  cursor: pointer;
}
.group-chip-row .chip.active {
  background: var(--accent);
  color: white;
  box-shadow:
    inset 2px 2px 6px rgba(0, 0, 0, 0.18),
    inset -2px -2px 6px rgba(255, 255, 255, 0.12);
}
.group-chip-row .chip .small {
  color: var(--ink-3);
  font-size: 11px;
}
.group-chip-row .chip.active .small {
  color: rgba(255, 255, 255, 0.7);
}
.members-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 6px 0 12px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
}
.members-strip .hint {
  margin: 0;
  padding: 0;
}
.invitation-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  font-size: 13.5px;
  color: var(--ink-2);
  flex-wrap: wrap;
}
.invitation-row + .invitation-row {
  border-top: 1px solid rgba(149, 165, 188, 0.2);
}
.friends-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  letter-spacing: 0.02em;
}
.chip.pending {
  opacity: 0.6;
  font-style: italic;
}
.chip.locked {
  background: var(--bg);
  color: var(--ink-3);
  cursor: default;
  font-size: 11px;
  box-shadow:
    inset 1.5px 1.5px 3px var(--shadow-dark),
    inset -1.5px -1.5px 3px var(--shadow-light);
}
.chip.locked .small {
  color: var(--ink-3);
  font-size: 10px;
}

/* ---------- post badges (pin, mutable, copy) ---------- */
.post-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
  margin-right: 8px;
}
.badge {
  font-size: 11px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--ink-3);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: color-mix(in oklch, var(--ink-3), transparent 88%);
}
.pin-badge { color: var(--accent); }
.mutable-badge { color: var(--accent); }
.origin-badge, .has-copy-badge { color: var(--ink-3); }
.rss-badge {
  color: #fff;
  background: var(--accent-warm, #d97742);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.ext-link-badge {
  color: var(--accent);
  text-decoration: none;
}
.ext-link-badge:hover { text-decoration: underline; }

/* ---------- mutable switch on composer ---------- */
.composer-field { position: relative; }
.mutable-switch {
  position: absolute;
  top: 10px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--ink-3);
  cursor: pointer;
  user-select: none;
  z-index: 2;
}
.mutable-switch input { display: none; }
.mutable-switch-track {
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--ink-3), transparent 70%);
  position: relative;
  transition: background 160ms var(--ease);
}
.mutable-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms var(--ease);
}
.mutable-switch input:checked + .mutable-switch-track {
  background: var(--accent);
}
.mutable-switch input:checked + .mutable-switch-track .mutable-switch-thumb {
  transform: translateX(12px);
}

/* ---------- inline edit form on mutable posts ---------- */
.edit-form {
  display: none;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  flex-direction: column;
  gap: 10px;
}
.edit-form.open { display: flex; }
.edit-form textarea {
  width: 100%;
  min-height: 80px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}

/* ---------- pinned button + pinned section ---------- */
.ico-btn.pinned { color: var(--accent); }
.pinned-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
}
.pinned-label {
  font-size: 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-left: 4px;
}

/* ---------- post / chat mode toggle ---------- */
.mode-toggle-row {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0;
}
.mode-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--r-pill);
  gap: 2px;
}
.mode-tab {
  background: transparent;
  border: none;
  font-size: 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--ink-3);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color 160ms var(--ease), background 160ms var(--ease);
}
.mode-tab.active {
  color: var(--ink);
  background: color-mix(in oklch, var(--accent), transparent 80%);
}

/* ---------- friends stage default (post mode) ---------- */
#friends-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#friends-stage .posts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- chat mode ---------- */
#friends-stage.chat-mode .composer-form {
  order: 3;
  position: sticky;
  bottom: 0;
  z-index: 2;
}
#friends-stage.chat-mode .pinned-section { order: 1; }
#friends-stage.chat-mode .posts-list {
  order: 2;
  flex-direction: column-reverse;
  gap: 4px;
}

#friends-stage.chat-mode .post {
  position: relative;
  max-width: none;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#friends-stage.chat-mode .post:hover { transform: none; }
#friends-stage.chat-mode .post .post-head { gap: 6px; }
#friends-stage.chat-mode .post .post-head .post-time { font-size: 10px; }
#friends-stage.chat-mode .post.mine .post-head .post-author { display: none; }
#friends-stage.chat-mode .post.streak-follow .post-head { display: none; }

#friends-stage.chat-mode .post .post-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 4px;
}

#friends-stage.chat-mode .composer-form textarea { min-height: 44px; }
#friends-stage.chat-mode .composer-form .mutable-switch { top: 6px; }

/* ---------- emoji picker ---------- */
.emoji-trigger {
  font-size: 16px;
  line-height: 1;
  padding: 6px 10px;
}
.emoji-picker {
  position: absolute;
  z-index: 1000;
  width: 320px;
  max-height: 280px;
  overflow-y: auto;
  padding: 10px;
  border-radius: var(--r-sm);
  background: var(--bg);
  box-shadow:
    -6px -6px 14px var(--shadow-light),
    6px 6px 14px var(--shadow-darker);
}
.emoji-picker[hidden] { display: none; }
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}
.emoji-cell {
  font-size: 20px;
  line-height: 1;
  padding: 6px 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: background 120ms var(--ease), transform 100ms var(--ease);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.emoji-cell:hover {
  background: color-mix(in oklch, var(--accent), transparent 85%);
  transform: scale(1.15);
}
