:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel-2: #1f2630;
  --border: #2a313c;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #79c0ff;
  --accent-2: #d2a8ff;
  --pos: #3fb950;
  --neg: #f85149;
  --danger: #f85149;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px rgba(0,0,0,0.25);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* The HTML `hidden` attribute applies `display: none` via the UA stylesheet,
   but any explicit `display` rule (like `.row { display: flex }`) overrides it.
   Force `hidden` to always win. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: radial-gradient(circle at 20% 0%, #1a2233 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}

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

.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(13,17,23,0.7);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.1rem;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
/* Gradient applies to the text span only, leaves the SVG mark untouched. */
.brand > span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-mark {
  width: 24px;
  height: 24px;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

/* --- Login hero (large rocket + title) --- */
.brand-hero {
  text-align: center;
  margin: 40px auto 18px;
  max-width: 460px;
}
.brand-hero-mark {
  width: 92px;
  height: 92px;
  display: inline-block;
  filter: drop-shadow(0 8px 22px rgba(255, 157, 39, 0.35));
  animation: brand-hero-float 4.5s ease-in-out infinite;
}
.brand-hero-title {
  margin: 14px 0 4px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-hero-sub { margin: 0; font-size: 0.95rem; }
@keyframes brand-hero-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-hero-mark { animation: none; }
}

.primary-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex: 1;
}
.primary-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}
.primary-nav a:hover {
  color: var(--accent);
  text-decoration: none;
  background: rgba(121,192,255,0.08);
}
.primary-nav a .icon { color: var(--muted); transition: color 0.12s; }
.primary-nav a:hover .icon { color: var(--accent); }

/* Notification bell */
.notif-menu { position: relative; }
.notif-menu summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: var(--text);
}
.notif-menu summary::-webkit-details-marker { display: none; }
.notif-menu summary:hover { background: rgba(121,192,255,0.08); color: var(--accent); }
.notif-menu[open] summary { background: rgba(121,192,255,0.12); color: var(--accent); }
.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--neg);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(13,17,23,0.9);
}
.notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 340px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 30;
  overflow: hidden;
}
.notif-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.notif-empty { padding: 16px; text-align: center; font-size: 0.88rem; }

.notif-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.notif-row { border-bottom: 1px solid var(--border); }
.notif-row:last-child { border-bottom: none; }
.notif-row.notif-unread { background: rgba(121,192,255,0.04); }
.notif-link {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
  position: relative;
}
.notif-link:hover { background: var(--panel-2); text-decoration: none; }
.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: 0.88rem; line-height: 1.4; }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 8px;
}

/* User menu (HTML <details>) */
.user-menu {
  position: relative;
}
.user-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px 3px 3px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  font-size: 0.92rem;
  user-select: none;
}
.user-menu summary .avatar { margin-right: 2px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { border-color: var(--accent); }
.user-menu[open] summary { border-color: var(--accent); }
.user-menu .caret {
  font-size: 0.7rem;
  color: var(--muted);
  margin-left: 4px;
  transition: transform 0.15s;
}
.user-menu[open] .caret { transform: rotate(180deg); }
.user-name { font-weight: 600; }

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  padding: 6px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.user-menu-panel a,
.user-menu-panel button {
  display: block;
  text-align: left;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
}
.user-menu-panel a:hover,
.user-menu-panel button:hover {
  background: var(--panel-2);
  color: var(--accent);
  text-decoration: none;
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.user-menu-name { font-weight: 600; font-size: 0.95rem; }
.user-menu-email { font-size: 0.78rem; color: var(--muted); }

.admin-pill { font-size: 0.7rem; padding: 2px 8px; }

/* Initials avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3) inset;
}
.avatar-img {
  object-fit: cover;
  text-shadow: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05) inset;
}

/* Account settings panel */
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.account-row:last-child { border-bottom: none; }
.account-row-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 130px;
}
.account-row-content { flex: 1; }

.provider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.provider-name { flex: 1; font-weight: 500; }
.provider-status.linked { color: var(--pos); font-size: 0.85rem; }
.provider-status.not-linked { color: var(--muted); font-size: 0.85rem; }

details.collapse-form {
  margin-top: 4px;
}
details.collapse-form summary {
  list-style: none;
  cursor: pointer;
  color: var(--accent);
  font-size: 0.88rem;
  user-select: none;
}
details.collapse-form summary::-webkit-details-marker { display: none; }
details.collapse-form summary:hover { text-decoration: underline; }
details.collapse-form > div {
  margin-top: 10px;
  padding: 12px;
  background: var(--panel-2);
  border-radius: 8px;
}

/* My comments */
.my-comment {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.my-comment:last-child { border-bottom: none; }
.my-comment-context { font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }
.my-comment-body {
  background: var(--panel-2);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.92rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.my-comment-meta {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Floating action button — log a trade */
.fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0f15;
  box-shadow: 0 6px 20px rgba(121,192,255,0.35), 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 100;
}
.fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(121,192,255,0.45), 0 4px 10px rgba(0,0,0,0.5);
  text-decoration: none;
  color: #0b0f15;
}
.fab:active { transform: translateY(0); }

/* --- FAB picker (details menu wrapping the .fab) --- */
.fab-picker {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 100;
}
.fab-picker > summary { list-style: none; cursor: pointer; }
.fab-picker > summary::-webkit-details-marker { display: none; }
.fab-picker > summary.fab {
  position: static;          /* wrapper holds the fixed position */
  right: auto;
  bottom: auto;
}
.fab-picker > summary.fab svg { transition: transform 0.15s; }
.fab-picker[open] > summary.fab svg { transform: rotate(45deg); }

.fab-picker-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  min-width: 240px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fab-picker-panel a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.fab-picker-panel a:hover { background: var(--panel-2); }
.fab-picker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--accent);
  flex-shrink: 0;
}
.fab-picker-title { display: block; font-weight: 600; font-size: 0.95rem; }
.fab-picker-sub { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* Nested club submenu inside the FAB picker. */
.fab-picker-sub-menu { display: block; }
.fab-picker-sub-menu > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  color: var(--text);
}
.fab-picker-sub-menu > summary::-webkit-details-marker { display: none; }
.fab-picker-sub-menu > summary:hover { background: var(--panel-2); }
.fab-picker-caret {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
  transition: transform 0.15s;
}
.fab-picker-sub-menu[open] > summary > .fab-picker-caret { transform: rotate(90deg); }
.fab-picker-clubs {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 6px 4px 50px;     /* indent matches the 32px icon tile + gaps */
}
.fab-picker-clubs a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}
.fab-picker-clubs a:hover { background: var(--panel-2); }

.container { max-width: 1100px; margin: 28px auto; padding: 0 24px; }

h1 { margin-top: 0; }
h1, h2, h3 { letter-spacing: -0.01em; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.card.narrow { max-width: 460px; margin: 40px auto; }

.card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-header h2 { margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.stat-value { font-size: 1.9rem; font-weight: 700; margin: 6px 0 2px; }
.stat-sub { font-size: 0.85rem; color: var(--muted); }

.pos { color: var(--pos); }
.neg { color: var(--neg); }
.bold { font-weight: 700; }
.muted { color: var(--muted); }
.center { text-align: center; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

label {
  display: block;
  margin: 10px 0;
  font-size: 0.9rem;
  color: var(--muted);
}

input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(121,192,255,0.18);
}

button, .btn {
  display: inline-block;
  padding: 9px 16px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
button:hover, .btn:hover { border-color: var(--accent); color: var(--accent); }

button.primary, .btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0f15;
  border-color: transparent;
  font-weight: 600;
}
button.primary:hover, .btn.primary:hover { filter: brightness(1.1); color: #0b0f15; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

.inline { display: inline; }
.row { display: flex; gap: 12px; align-items: flex-end; }
.row .grow { flex: 1; }
.row-between { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.oauth-row { display: flex; gap: 10px; justify-content: center; }

.error {
  background: rgba(248,81,73,0.1);
  border: 1px solid rgba(248,81,73,0.4);
  color: #ffb4b0;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.warn {
  background: rgba(210,168,255,0.08);
  border: 1px solid rgba(210,168,255,0.35);
  color: #e0c8ff;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.06em; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

.side-buy { color: var(--pos); font-weight: 600; }
.side-sell { color: var(--neg); font-weight: 600; }

.pill {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(121,192,255,0.15);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.warn-pill { background: rgba(248,81,73,0.15); color: var(--neg); }

.comment-form { margin-bottom: 16px; }
.comment-form textarea { margin-bottom: 8px; }

.comment-list, .comment-children {
  list-style: none;
  padding: 0;
  margin: 0;
}
.comment-children { margin-top: 6px; border-left: 2px solid var(--border); padding-left: 8px; }

.comment {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment-deleted .comment-text { color: var(--muted); font-style: italic; }

.comment-row { display: flex; gap: 12px; align-items: flex-start; }

.vote-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 0 0 28px;
}
.vote-btn {
  background: none;
  border: none;
  color: var(--muted);
  padding: 0 4px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}
.vote-btn:hover:not(:disabled) { color: var(--accent); }
.vote-btn:disabled { opacity: 0.3; cursor: default; }
.vote-btn.vote-active.up { color: var(--pos); }
.vote-btn.vote-active.down { color: var(--neg); }
.vote-form { line-height: 0; }
.vote-score { font-size: 0.85rem; font-weight: 700; }

.comment-body { flex: 1; min-width: 0; }
.comment-meta { font-size: 0.82rem; }
.comment-text {
  margin-top: 4px;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.comment-actions { margin-top: 6px; display: flex; gap: 10px; align-items: center; }

.reply-form { margin-top: 8px; }
.reply-form textarea { margin-bottom: 6px; }

.icon {
  display: inline-block;
  vertical-align: -3px;
  flex-shrink: 0;
}
.icon-comment { color: var(--accent); }

.comment-count {
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  vertical-align: middle;
  line-height: 1;
}
.comment-count .icon-comment { color: var(--accent); transition: color 0.12s; }
.comment-count:hover { color: var(--accent); text-decoration: none; }
.comment-count:hover .icon-comment { color: var(--accent-2); }

.card-summary {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}
.checkbox-label input { width: auto; margin-top: 0; }
.kind-pill { text-transform: uppercase; letter-spacing: 0.05em; }
.kind-pill.kind-option { background: rgba(210,168,255,0.18); color: var(--accent-2); }
.kind-pill.kind-future { background: rgba(63,185,80,0.18); color: var(--pos); }

.pnl-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.pnl-pos { background: rgba(63,185,80,0.18); color: var(--pos); }
.pnl-neg { background: rgba(248,81,73,0.18); color: var(--neg); }
.pnl-flat { background: rgba(139,148,158,0.18); color: var(--muted); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.06em; }

.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.challenge-card { display: block; text-decoration: none; color: inherit; transition: transform 0.12s, border-color 0.12s; }
.challenge-card:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }

.filter-fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px 12px;
  margin: 12px 0;
}
.filter-fieldset legend { padding: 0 6px; font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.progress-bar {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-top: 4px;
}
.progress-bar.small { height: 6px; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s;
}
.progress-fill.progress-done {
  background: linear-gradient(90deg, var(--pos), #79c97a);
}

.pot-card {
  background: linear-gradient(135deg, rgba(121,192,255,0.06), rgba(210,168,255,0.06));
  border-color: rgba(121,192,255,0.3);
}

.club-list { list-style: none; padding: 0; margin: 0; }
.club-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.club-list li:last-child { border-bottom: none; }

.ranked { list-style: none; padding: 0; margin: 0; counter-reset: rank; }
.ranked li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  counter-increment: rank;
}
.ranked li::before {
  content: counter(rank);
  display: inline-block;
  width: 24px;
  color: var(--muted);
  font-weight: 600;
}
.ranked li:last-child { border-bottom: none; }
.ranked li > a { flex: 1; }

.card.no-padding { padding: 0; }
.card-header.padded { padding: 16px 22px; }
.padded { padding: 16px 22px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed-item {
  display: flex;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
}
.feed-item:last-child { border-bottom: none; }
.feed-side {
  flex: 0 0 56px;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding: 4px 0;
  text-align: center;
  border-radius: 6px;
  align-self: flex-start;
  background: var(--panel-2);
}
.feed-side.side-buy { background: rgba(63,185,80,0.15); color: var(--pos); }
.feed-side.side-sell { background: rgba(248,81,73,0.15); color: var(--neg); }
.feed-side.feed-side-challenge {
  background: linear-gradient(135deg, rgba(121,192,255,0.18), rgba(210,168,255,0.18));
  color: var(--accent-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.feed-side.feed-side-join {
  background: rgba(63,185,80,0.15);
  color: var(--pos);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* (?) help icon with hover/focus popover */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 8px;
  outline: none;
}
.help-icon:hover, .help-icon:focus { color: var(--accent); border-color: var(--accent); }
.help-popover {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  right: -8px;
  width: 280px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.5;
  z-index: 50;
  text-align: left;
  font-weight: 400;
  cursor: default;
}
.help-icon:hover .help-popover,
.help-icon:focus .help-popover,
.help-icon:focus-within .help-popover { display: block; }
.help-popover .help-row { display: block; margin: 4px 0; }
.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.help-popover strong {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--panel-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.78rem;
  margin-right: 4px;
}

/* @mention links + $TICKER pills inside rendered comment bodies */
.mention {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  background: rgba(121,192,255,0.10);
  padding: 1px 4px;
  border-radius: 4px;
}
.mention:hover { background: rgba(121,192,255,0.20); text-decoration: none; }

.ticker-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  vertical-align: 1px;
  margin: 0 1px;
}
.ticker-pill .ticker-sym {
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.ticker-pill .ticker-sym:hover { text-decoration: underline; }
.ticker-pill .ticker-price { color: var(--text); }
.ticker-pill .ticker-change { font-weight: 600; }

.ticker-pill.locked {
  background: rgba(139,148,158,0.10);
  border-color: rgba(139,148,158,0.30);
}
.ticker-pill.locked .ticker-sym { color: var(--text); }
.ticker-pill .ticker-lock {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-right: -2px;
}

/* Mention autocomplete dropdown */
.mention-autocomplete {
  position: absolute;
  z-index: 50;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  min-width: 220px;
  max-width: 320px;
  padding: 4px;
  font-size: 0.9rem;
}
.mention-autocomplete-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}
.mention-autocomplete-item.active,
.mention-autocomplete-item:hover {
  background: var(--panel-2);
}
.mention-autocomplete-item .mac-name { font-weight: 600; }
.mention-autocomplete-item .mac-hint { color: var(--muted); font-size: 0.78rem; }

/* Inline comment form inside feed items */
details.inline-comment {
  margin-top: 8px;
}
details.inline-comment > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 6px;
  user-select: none;
}
details.inline-comment > summary::-webkit-details-marker { display: none; }
details.inline-comment > summary:hover { color: var(--accent); background: rgba(121,192,255,0.06); }
details.inline-comment > summary .icon-comment { color: var(--accent); }
details.inline-comment[open] > summary { color: var(--accent); }

details.inline-comment > form {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--panel-2);
  border-radius: 8px;
}
details.inline-comment > form textarea { margin-top: 0; }
.inline-comment-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

.feed-side.feed-side-post {
  background: rgba(210,168,255,0.18);
  color: var(--accent-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* Message board list */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list-item { border-bottom: 1px solid var(--border); }
.post-list-item:last-child { border-bottom: none; }
.post-list-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  color: var(--text);
  text-decoration: none;
}
.post-list-link:hover { background: var(--panel-2); text-decoration: none; }
.post-list-body { flex: 1; min-width: 0; }
.post-list-title { font-weight: 600; font-size: 1rem; margin-bottom: 2px; }
.post-list-meta { display: flex; gap: 6px; align-items: center; font-size: 0.82rem; }

.post-body { white-space: pre-wrap; word-wrap: break-word; line-height: 1.55; }

.feed-side.feed-side-newuser {
  background: rgba(255,196,87,0.15);
  color: #ffc457;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* Feed filter pills */
.feed-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}
.feed-filter-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
  transition: all 0.12s;
}
.feed-filter-pill:hover {
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}
.feed-filter-pill.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0f15;
  border-color: transparent;
  font-weight: 600;
}
.feed-filter-pill.active:hover { color: #0b0f15; }
.feed-body { flex: 1; min-width: 0; }
.feed-headline { font-size: 0.98rem; line-height: 1.5; }
.feed-headline .actor { font-weight: 600; }
.feed-meta { font-size: 0.82rem; margin-top: 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.feed-submeta { font-size: 0.72rem; margin-top: 2px; }
.feed-meta .pill { font-size: 0.72rem; padding: 1px 8px; }
.feed-note {
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--panel-2);
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.badge {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.badge-icon { font-size: 1.6rem; line-height: 1; }
.badge-body { flex: 1; min-width: 0; }
.badge-name { font-weight: 600; font-size: 0.95rem; }
.badge-count { color: var(--accent); font-weight: 700; }
.badge-sub { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.title-badge { background: linear-gradient(135deg, rgba(121,192,255,0.08), rgba(210,168,255,0.06)); border-color: rgba(121,192,255,0.3); }
.earned-badge { background: linear-gradient(135deg, rgba(86,211,100,0.10), rgba(121,192,255,0.06)); border-color: rgba(86,211,100,0.30); }
.earned-badge .badge-count { margin-left: 6px; font-size: 0.85rem; }

.titles-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.title-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(121,192,255,0.15), rgba(210,168,255,0.12));
  border: 1px solid rgba(210,168,255,0.35);
  font-size: 0.85rem;
}
.title-icon { font-size: 1rem; }
.title-name { font-weight: 600; }
.title-scope { color: var(--muted); font-size: 0.78rem; }

.invite-link {
  display: inline-block;
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  color: var(--accent);
  word-break: break-all;
  max-width: 360px;
}

/* --- Confirm modal --- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.12s ease-out;
}
.modal-overlay.open { opacity: 1; }
.modal-dialog {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px 18px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.5);
  transform: translateY(-6px);
  transition: transform 0.12s ease-out;
}
.modal-overlay.open .modal-dialog { transform: translateY(0); }
.modal-message {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.4;
}
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
}
.modal-actions .btn,
.modal-actions button {
  min-width: 88px;
}

/* --- Flash toast: visible by default; JS adds .dismissing to fade out --- */
.flash-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  z-index: 9998;
  font-size: 0.9rem;
  opacity: 1;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  pointer-events: none;
}
.flash-toast.dismissing {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}
.flash-toast.flash-success {
  border-color: rgba(86, 211, 100, 0.45);
  background: linear-gradient(135deg, rgba(86, 211, 100, 0.10), var(--panel-2));
}
.flash-toast.flash-error {
  border-color: rgba(248, 81, 73, 0.45);
  background: linear-gradient(135deg, rgba(248, 81, 73, 0.10), var(--panel-2));
}

/* --- Form busy state --- */
button.is-busy,
.primary.is-busy {
  opacity: 0.7;
  cursor: progress;
  position: relative;
}
button.is-busy::after,
.primary.is-busy::after {
  content: "";
  display: inline-block;
  width: 0.8em; height: 0.8em;
  margin-left: 0.5em;
  vertical-align: -0.1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Inline images in post/comment bodies. */
.post-image-link { display: inline-block; margin: 6px 0; }
.post-image {
  display: block;
  max-width: 100%;
  max-height: 420px;
  border-radius: 8px;
  border: 1px solid var(--border, #2a2a2a);
}
.paste-upload-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}
.paste-upload-hint.is-error { color: var(--neg, #e25b5b); }

/* Board page "+ New post" dropdown (used when no single club is selected). */
.post-picker { position: relative; display: inline-block; }
.post-picker > summary {
  list-style: none;
  cursor: pointer;
}
.post-picker > summary::-webkit-details-marker { display: none; }
.post-picker .caret {
  font-size: 0.7rem;
  margin-left: 2px;
  transition: transform 0.15s;
  display: inline-block;
}
.post-picker[open] .caret { transform: rotate(180deg); }
.post-picker-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  padding: 6px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.post-picker-panel a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}
.post-picker-panel a:hover { background: var(--panel-2); }

/* --- Image / GIF picker --- */
.image-picker-toolbar {
  display: flex; gap: 8px; align-items: center;
  margin-top: 4px;
}
.image-picker-trigger {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
}
.image-picker-trigger:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.image-picker-overlay .image-picker-dialog {
  max-width: 640px;
  width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: min(86vh, 720px);
  overflow: hidden;
}
.image-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.image-picker-tabs { display: flex; gap: 4px; }
.image-picker-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  cursor: pointer;
}
.image-picker-tab:hover { color: var(--accent); }
.image-picker-tab.is-active {
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
}

/* --- Post composer (tabbed) ---
   Looks like classic file-folder tabs: inactive tabs sit on a divider line;
   the active tab "breaks through" the divider and merges into the panel
   color of the surrounding card. */
.post-composer .composer-tabs {
  display: flex;
  gap: 2px;
  margin: 8px 0 16px;
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
  flex-wrap: wrap;
  position: relative;
}
.composer-tab {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 14px;
  margin-bottom: -1px;             /* overlap the tab-strip's bottom border */
  border-radius: 8px 8px 0 0;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.composer-tab:hover { color: var(--text); }
.composer-tab.is-active {
  color: var(--text);
  background: var(--panel);
  border-bottom-color: var(--panel); /* "open" the bottom so it merges with card */
  cursor: default;
}
.composer-tab-icon { display: inline-flex; }
.composer-tab-icon .icon { display: block; }
.composer-panel { margin: 0 0 14px; }
.composer-panel > label:first-child { margin-top: 0; }
.composer-panel .small { font-size: 0.82rem; margin-top: 4px; }
.image-picker-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}
.image-picker-close:hover { color: var(--accent); }

.image-picker-body {
  padding: 14px;
  overflow: auto;
  flex: 1;
  min-height: 320px;
}
.image-picker-pane { display: flex; flex-direction: column; gap: 10px; }
.image-picker-pane[hidden] { display: none; }

.image-picker-search {
  width: 100%;
  padding: 9px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
}
.image-picker-search:focus { border-color: var(--accent); outline: none; }

.image-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.image-picker-tile {
  position: relative;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
}
.image-picker-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-picker-tile:hover { border-color: var(--accent); }
.image-picker-loading { padding: 14px; text-align: center; }

/* Dim existing tiles while a new search is in flight — no flash, no reflow. */
.image-picker-pane.is-loading .image-picker-grid {
  opacity: 0.45;
  transition: opacity 0.1s linear;
  pointer-events: none;
}

.image-picker-status {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  padding: 6px 2px;
}
.image-picker-status.is-error { color: var(--neg, #f88); }
.image-picker-footer { font-size: 0.75rem; text-align: right; }

.image-picker-drop {
  display: block;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 30px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
}
.image-picker-drop:hover,
.image-picker-drop.is-dragging {
  border-color: var(--accent);
  background: rgba(121, 192, 255, 0.06);
}
.image-picker-drop-text strong { display: block; margin-bottom: 4px; }

/* --- Link posts --- */
.link-card,
.link-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.1s, background 0.1s;
}
.link-card:hover {
  border-color: var(--accent);
  background: rgba(121, 192, 255, 0.04);
  text-decoration: none;
}

/* --- Link post (.card wrapper around link + optional caption) --- */
.link-post { padding: 0; }
.link-post .link-row {
  padding: 14px 16px;
  border-radius: var(--radius);
}
.link-post .link-row:hover {
  background: rgba(121, 192, 255, 0.06);
  text-decoration: none;
}

/* --- Caption block under media (image / video / link) --- */
.media-caption {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  text-align: left;
  color: var(--text);
}
.image-post .media-caption,
.link-post .media-caption,
.video-embed-card .media-caption {
  /* Image card uses background:#000 — bring caption back to panel bg. */
  background: var(--panel);
}
.link-card-icon {
  font-size: 1.4rem;
  color: var(--accent);
  flex-shrink: 0;
}
.link-card-body { min-width: 0; flex: 1; }
.link-card-domain {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.link-card-url {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Post-type chip (shown in feed/board/club-posts) --- */
.kind-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.kind-chip .icon { display: block; }
.kind-text  { color: #c9d1d9; background: rgba(201,209,217,0.08); border-color: rgba(201,209,217,0.18); }
.kind-image { color: #d2a8ff; background: rgba(210,168,255,0.10); border-color: rgba(210,168,255,0.22); }
.kind-link  { color: #79c0ff; background: rgba(121,192,255,0.10); border-color: rgba(121,192,255,0.22); }
.kind-video { color: #ff7b72; background: rgba(255,123,114,0.10); border-color: rgba(255,123,114,0.22); }

/* feed-side variants pick up the same accent color as their chip. */
.feed-side-text  { color: #c9d1d9; }
.feed-side-image { color: #d2a8ff; }
.feed-side-link  { color: #79c0ff; }
.feed-side-video { color: #ff7b72; }

/* --- Video (YouTube) embed --- */
.video-embed-card { padding: 0; overflow: hidden; }
.video-embed-frame {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;            /* 16:9 */
  background: #000;
}
.video-embed-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.video-embed-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.autoplay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.autoplay-toggle input { margin: 0; }

.link-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(121, 192, 255, 0.08);
  border: 1px solid rgba(121, 192, 255, 0.25);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 8px;
  vertical-align: 2px;
}

/* --- Post voting --- */
.post-header { gap: 14px; }
.post-vote-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-top: 4px;
  flex-shrink: 0;
  min-width: 36px;
}
.post-header-body { flex: 1; min-width: 0; }
.post-vote-stack .vote-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.post-vote-stack .vote-btn:hover:not(:disabled) { color: var(--accent); }
.post-vote-stack .vote-btn:disabled { opacity: 0.3; cursor: default; }
.post-vote-stack .vote-btn.vote-active.up { color: var(--pos); }
.post-vote-stack .vote-btn.vote-active.down { color: var(--neg); }
.post-vote-stack .vote-score { font-size: 0.95rem; font-weight: 700; }

.vote-chip {
  font-size: 0.82rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.feed-vote-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.feed-vote-inline .vote-btn { font-size: 1rem; padding: 0 2px; }
.feed-vote-inline .vote-score {
  min-width: 1.2em;
  text-align: center;
  font-size: 0.85rem;
}
.feed-vote-inline .vote-score.pos { color: var(--pos); }
.feed-vote-inline .vote-score.neg { color: var(--neg); }

/* --- Image posts --- */
.image-post {
  padding: 0;
  overflow: hidden;
  text-align: center;
  background: #000;
}
.image-post a { display: block; line-height: 0; }
.image-post-img {
  max-width: 100%;
  max-height: 640px;
  display: inline-block;
  margin: 0 auto;
}

.post-list-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* 2-line body preview shown on list/feed entries — click the post to read. */
.post-snippet {
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
a.post-snippet { text-decoration: none; }
a.post-snippet:hover { color: var(--text); }
.feed-post-snippet { display: -webkit-box; }   /* anchor → block-level for line-clamp */

.feed-post-image {
  display: block;
  margin-top: 8px;
  max-width: 100%;
  line-height: 0;
}
.feed-post-image img {
  max-width: 100%;
  max-height: 360px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* --- Composer image field --- */
.image-field {
  margin-bottom: 10px;
}
.image-field-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}
.image-field-upload {
  cursor: pointer;
  display: inline-block;
}
.image-field-status {
  font-size: 0.82rem;
}
.image-field-status.is-error { color: var(--neg, #f88); }
.image-field-preview {
  margin-top: 10px;
}
.image-field-preview img {
  max-width: 100%;
  max-height: 280px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

/* ============================================================
   Mobile nav drawer + responsive breakpoint
   ============================================================ */

/* Desktop baseline: hamburger button and its backdrop are hidden;
   primary-nav renders inline in the topbar exactly as before. */
.nav-toggle { display: none; }
.nav-drawer-backdrop { display: none; }

@media (max-width: 720px) {
  /* --- Topbar tightening --- */
  .topbar {
    gap: 10px;
    padding: 10px 14px;
  }
  .brand { font-size: 1rem; }
  .brand-mark { width: 22px; height: 22px; }
  .container { padding: 0 14px; margin: 18px auto; }

  /* --- Show hamburger button at the leftmost position --- */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    order: -1;
  }
  .nav-toggle:hover { background: rgba(121,192,255,0.08); color: var(--accent); border-color: transparent; }
  body.nav-open .nav-toggle { background: rgba(121,192,255,0.12); color: var(--accent); }

  /* --- Drawer: hidden until body.nav-open --- */
  .primary-nav {
    display: none;
  }
  body.nav-open .primary-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    position: fixed;
    top: 0;
    left: 0;
    width: min(78vw, 320px);
    height: 100vh;
    padding: 64px 14px 24px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(0,0,0,0.45);
    z-index: 40;
    overflow-y: auto;
  }
  body.nav-open .primary-nav a {
    padding: 12px 14px;
    font-size: 1rem;
    border-radius: 8px;
  }
  body.nav-open .nav-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 35;
    backdrop-filter: blur(2px);
  }

  /* --- User menu: drop username text, keep avatar + caret --- */
  .user-menu summary .user-name { display: none; }
  .user-menu summary .admin-pill { display: none; }

  /* --- Notification dropdown: full-width on small screens --- */
  .notif-dropdown {
    width: calc(100vw - 28px);
    right: -7px;
    max-width: 360px;
  }

  /* --- Page header: stack title above action --- */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .page-header > * { width: 100%; }
  .page-header .btn,
  .page-header .post-picker > summary { width: 100%; text-align: center; }

  /* --- Card padding tighter --- */
  .card { padding: 14px; }
  .card-header.padded,
  .padded { padding: 14px; }

  /* --- Feed: smaller side badge, less padding, allow wrap --- */
  .feed-item { padding: 12px 14px; gap: 10px; }
  .feed-side { flex: 0 0 44px; font-size: 0.7rem; }
  .feed-headline { font-size: 0.95rem; word-break: break-word; }
  .feed-headline .actor { display: inline; }
  .feed-meta { gap: 6px; }

  /* --- Board: meta row must wrap, link padding tighter --- */
  .post-list-link { padding: 12px 14px; gap: 10px; }
  .post-list-meta { flex-wrap: wrap; row-gap: 2px; }
  .post-list-thumb { width: 56px; height: 56px; }

  /* --- Headings a touch smaller --- */
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }

  /* --- Tables: avoid horizontal overflow on narrow screens --- */
  table { font-size: 0.85rem; }

  /* --- FAB: sit above iOS home indicator --- */
  .fab { bottom: max(20px, env(safe-area-inset-bottom, 0)); }
}

/* ============================================================
   Club sub-nav tabs
   ============================================================ */
.club-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: -8px 0 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.club-tabs::-webkit-scrollbar { display: none; }
.club-tab {
  display: inline-block;
  padding: 10px 14px;
  color: var(--muted, #9aa);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-size: 0.92rem;
  transition: color 120ms, border-color 120ms;
}
.club-tab:hover { color: var(--text); }
.club-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   Overview compact widgets
   ============================================================ */
.card-header h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.card-header h2 svg { color: var(--accent); flex: 0 0 auto; }

table.leaderboard.compact th,
table.leaderboard.compact td {
  padding: 6px 8px;
  font-size: 0.9rem;
}

.members-preview .avatar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.avatar-chip {
  display: inline-flex;
  text-decoration: none;
  transition: transform 120ms;
}
.avatar-chip:hover { transform: translateY(-2px); }
.avatar-chip.dim { opacity: 0.45; }
.avatar-chip .avatar {
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px var(--border);
  border-radius: 50%;
}
.avatar-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted, #9aa);
  font-size: 0.8rem;
  text-decoration: none;
}
.avatar-more:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   Tools hub
   ============================================================ */
.tools-grid .tool-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tools-grid .tool-card h2 { margin: 0; font-size: 1.05rem; }
.tools-grid .tool-card .tool-icon { font-size: 1.6rem; line-height: 1; }
.tools-grid .tool-card.disabled { opacity: 0.7; }
.tools-grid .tool-card .pill { align-self: flex-start; margin-top: auto; }

/* ============================================================
   Sortable table headers
   ============================================================ */
table.sortable th.sort-col {
  cursor: pointer;
  user-select: none;
}
table.sortable th.sort-col:hover { color: var(--accent); }
table.sortable .sort-arrow { color: var(--accent); font-size: 0.78em; }

