/* ── SHARED SIDEBAR + THREE-COLUMN LAYOUT ── */
/* Applied to all pages via <link rel="stylesheet" href="sb-layout.css"> */

/* Prevent iOS auto-zoom on input focus (triggered when font-size < 16px) */
@media (max-width: 768px) {
  input, textarea, select { font-size: 16px !important; }
}

/* Hide old top nav on desktop */
@media (min-width: 769px) {
  .hs-nav { display: none !important; }
  .mob-pill-nav { display: none !important; }
}

/* ── ROOT VARS (supplement; pages define their own) ── */
:root {
  --sb-accent: #a02828;
  --sb-dark: #0d0b08;
  --sb-ink: rgba(255,255,255,0.88);
  --sb-ink-mid: rgba(255,255,255,0.55);
  --sb-muted: rgba(255,255,255,0.3);
  --sb-border: rgba(255,255,255,0.08);
}

/* ── THREE-COLUMN LAYOUT ── */
.sb-layout {
  display: flex;
  min-height: 100vh;
}

/* ── LEFT SIDEBAR ── */
.sb-sidebar {
  width: 260px;
  min-width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem 1.5rem 1.75rem;
  overflow-y: auto;
  border-right: 1px solid var(--sb-border, rgba(255,255,255,0.08));
  background: var(--dark, #0d0b08);
}

.sb-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  text-decoration: none;
  flex-shrink: 0;
  padding-left: 0.85rem;
}
.sb-logo-icon {
  width: 34px;
  height: 34px;
  background: var(--sb-accent, #a02828);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sb-logo-icon svg { width: 18px; height: 18px; color: #fff; }
.sb-logo-text {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.88) !important;
  line-height: 1.2;
}
.sb-logo-text em { font-style: italic; font-weight: 400; color: rgba(255,255,255,0.55) !important; }

.sb-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.sb-nav-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.65rem 0.85rem;
  border-radius: 100px;
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
  font-size: 0.97rem;
  font-weight: 400;
  color: rgba(255,255,255,0.55) !important;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.sb-nav-item:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.88) !important; }
.sb-nav-item.active { font-weight: 700; color: rgba(255,255,255,0.88) !important; }
.sb-nav-item svg { width: 24px; height: 24px; flex-shrink: 0; }

/* Sub-nav group (e.g. Shakespeare → Lectures / Reading Group) */
.sb-nav-group { display: flex; flex-direction: column; }
.sb-nav-sub {
  display: flex;
  flex-direction: column;
  padding-left: 3.3rem;
  gap: 0.05rem;
  margin-top: -0.2rem;
  margin-bottom: 0.25rem;
}
.sb-nav-sub-item {
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
  font-size: 0.88rem;
  font-weight: 400;
  color: rgba(255,255,255,0.38) !important;
  text-decoration: none;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.sb-nav-sub-item:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.75) !important; }
.sb-nav-sub-item.active { font-weight: 600; color: rgba(255,255,255,0.88) !important; }

.sb-sidebar-bottom {
  margin-top: 1.5rem;
  flex-shrink: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--sb-border, rgba(255,255,255,0.08));
}
.sb-post-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem 1.25rem;
  background: var(--sb-accent, #a02828);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: opacity 0.2s;
}
.sb-post-btn:hover { opacity: 0.88; }
.sb-guest-sub {
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.28);
  text-align: center;
  margin-top: 0.6rem;
  line-height: 1.5;
}
.sb-guest-sub a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.sb-guest-sub a:hover { color: rgba(255,255,255,0.85); }
.sb-signin-btn {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(255,255,255,0.14);
  background: none;
  color: rgba(255,255,255,0.55);
  border-radius: 100px;
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.sb-signin-btn:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.88); }

.sb-acct-wrap { position: relative; }
.sb-acct-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
}
.sb-acct-item:hover { background: rgba(255,255,255,0.07); }
.sb-acct-info { min-width: 0; }
.sb-acct-name { font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.88rem; font-weight: 600; color: rgba(255,255,255,0.88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-acct-sub { font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.72rem; color: rgba(255,255,255,0.3); }
.sb-acct-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0; right: 0;
  background: #1c1309;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  z-index: 300;
  box-shadow: 0 -8px 28px rgba(0,0,0,0.4);
  overflow: hidden;
}
.sb-acct-dropdown.open { display: block; }
.sb-acct-email { display: block; font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.72rem; color: rgba(255,255,255,0.3); padding: 0.65rem 1rem 0.4rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sb-acct-dropdown a,
.sb-acct-dropdown button { display: block; width: 100%; font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.82rem; font-weight: 500; color: rgba(255,255,255,0.55); background: none; border: none; cursor: pointer; padding: 0.62rem 1rem; text-align: left; transition: background 0.15s; text-decoration: none; }
.sb-acct-dropdown a:hover,
.sb-acct-dropdown button:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.88); }

/* ── MAIN AREA ── */
.sb-main {
  flex: 1;
  min-width: 0;
  border-right: 1px solid var(--sb-border, rgba(255,255,255,0.08));
  overflow-x: hidden;
}

/* ── RIGHT SIDEBAR ── */
.sb-right {
  width: 360px;
  min-width: 360px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 1.5rem 1.75rem;
  background: var(--dark, #0d0b08);
}

/* ── SEARCH ── */
.sbr-search-wrap { position: relative; margin-bottom: 1.75rem; }
.sbr-search-wrap .sbr-search { margin-bottom: 0; }
.sbr-search-input {
  background: transparent !important; background-color: transparent !important;
  -webkit-appearance: none; appearance: none;
  border: none !important; outline: none !important; box-shadow: none !important; flex: 1;
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
  font-size: 0.88rem; color: rgba(255,255,255,0.88); width: 100%; min-width: 0;
}
.sbr-search-input:focus { outline: none !important; box-shadow: none !important; background-color: transparent !important; }
.sbr-search-input::placeholder { color: rgba(255,255,255,0.25); }

/* ── GLOBAL DARK INPUT RESET ── */
input, textarea, select {
  background-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  color: inherit;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #1c1309 inset !important;
  -webkit-text-fill-color: rgba(255,255,255,0.88) !important;
  caret-color: rgba(255,255,255,0.88);
}
.sbr-search-results {
  display: none; position: absolute; top: calc(100% + 0.4rem); left: 0; right: 0;
  background: #1c1309; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px; z-index: 200; max-height: 300px; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.sbr-search-results.open { display: block; }
.sbr-search-result {
  display: flex; flex-direction: column; padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06); cursor: pointer;
  text-decoration: none; transition: background 0.15s;
}
.sbr-search-result:last-child { border-bottom: none; }
.sbr-search-result:hover { background: rgba(255,255,255,0.06); }
.sbr-search-result-tag { font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #a02828; margin-bottom: 0.15rem; }
.sbr-search-result-title { font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.82rem; color: rgba(255,255,255,0.75); line-height: 1.35; }
.sbr-search-empty { padding: 1rem; font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.82rem; color: rgba(255,255,255,0.3); text-align: center; }

.sbr-search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 0.65rem 1.1rem;
  margin-bottom: 1.75rem;
  cursor: text;
}
.sbr-search svg { color: rgba(255,255,255,0.3); flex-shrink: 0; width: 16px; height: 16px; }
.sbr-search span { font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.88rem; color: rgba(255,255,255,0.25); }

.sbr-section { margin-bottom: 1.75rem; }
.sbr-section-title { font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.55); margin-bottom: 1rem; }

.sbr-cats { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.sbr-cat { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; cursor: pointer; text-decoration: none; transition: opacity 0.2s; }
.sbr-cat:hover { opacity: 0.75; }
.sbr-cat-circle { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; position: relative; }
.sbr-cat-circle img { width: 100%; height: 100%; object-fit: cover; }
.sbr-cat-circle svg { width: 24px; height: 24px; color: rgba(255,255,255,0.3); }
.sbr-cat-dot { position: absolute; top: 1px; right: 1px; width: 12px; height: 12px; background: var(--sb-accent, #a02828); border-radius: 50%; border: 2px solid var(--dark, #0d0b08); }
.sbr-cat-label { font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.68rem; font-weight: 500; color: rgba(255,255,255,0.55); text-align: center; white-space: nowrap; }
.sbr-cat.active .sbr-cat-circle { border-color: rgba(160,40,40,0.85); box-shadow: 0 0 0 2px rgba(160,40,40,0.2); }
.sbr-cat.active .sbr-cat-label { color: #e87070; font-weight: 600; }

.sbr-membership { background: rgba(160,40,40,0.1); border: 1px solid rgba(160,40,40,0.2); border-radius: 14px; padding: 1.25rem; margin-bottom: 1.75rem; display: none; }
.sbr-membership.visible { display: block; }
.sbr-membership h3 { font-family: var(--font-heading, 'Playfair Display', Georgia, serif); font-size: 1rem; font-weight: 400; color: rgba(255,255,255,0.88); margin-bottom: 0.35rem; }
.sbr-membership p { font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.8rem; color: rgba(255,255,255,0.55); line-height: 1.5; margin-bottom: 1rem; }
.sbr-join-btn { display: block; width: 100%; padding: 0.7rem; background: var(--sb-accent, #a02828); color: #fff; border: none; border-radius: 100px; font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.88rem; font-weight: 700; cursor: pointer; text-align: center; transition: opacity 0.2s; }
.sbr-join-btn:hover { opacity: 0.88; }
.sbr-price-note { text-align: center; font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.7rem; color: rgba(255,255,255,0.3); margin-top: 0.5rem; }

.sbr-content-item { display: flex; gap: 0.85rem; padding: 0.85rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); cursor: pointer; transition: opacity 0.15s; text-decoration: none; }
.sbr-content-item:last-child { border-bottom: none; }
.sbr-content-item:hover { opacity: 0.75; }
.sbr-content-thumb { width: 60px; height: 60px; border-radius: 8px; flex-shrink: 0; background: rgba(255,255,255,0.05); background-size: cover; background-position: center; }
.sbr-content-info { flex: 1; min-width: 0; }
.sbr-content-tag { font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sb-accent, #a02828); margin-bottom: 0.2rem; }
.sbr-content-title { font-family: var(--font-heading, 'Playfair Display', Georgia, serif); font-size: 0.85rem; font-weight: 400; color: rgba(255,255,255,0.88); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── NOTIFICATION BADGE (on avatar) ── */
.sb-avatar-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.sb-notif-count {
  position: absolute; top: -3px; right: -3px;
  background: #a02828; color: #fff;
  font-size: 0.58rem; font-weight: 700; line-height: 1;
  min-width: 16px; height: 16px;
  border-radius: 100px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #0d0b08;
  pointer-events: none;
}
.sb-notif-empty {
  padding: 2rem 1rem; text-align: center;
  color: rgba(255,255,255,0.28); font-size: 0.82rem;
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
}

/* ── NOTIFICATIONS PAGE ── */
.notif-page { padding: 2rem 1.5rem; max-width: 680px; }
.notif-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.notif-page-title { font-family: var(--font-heading, 'Playfair Display', Georgia, serif); font-size: 1.5rem; font-weight: 400; color: rgba(255,255,255,0.88); margin: 0; }
.notif-page-mark { font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.82rem; color: rgba(255,255,255,0.35); background: none; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 0.35rem 0.8rem; cursor: pointer; }
.notif-page-mark:hover { color: rgba(255,255,255,0.88); border-color: rgba(255,255,255,0.25); }
.notif-full-item { display: flex; gap: 0.75rem; padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); text-decoration: none; cursor: pointer; }
.notif-full-item.unread { background: rgba(160,40,40,0.04); margin: 0 -1.5rem; padding: 1rem 1.5rem; }
.notif-full-dot { width: 8px; height: 8px; background: #a02828; border-radius: 50%; margin-top: 0.4rem; flex-shrink: 0; }
.notif-full-dot.read { background: transparent; }
.notif-full-body { flex: 1; font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.88rem; line-height: 1.5; color: rgba(255,255,255,0.55); }
.notif-full-actor { font-weight: 600; color: rgba(255,255,255,0.85); }
.notif-full-time { font-size: 0.75rem; color: rgba(255,255,255,0.28); margin-top: 0.25rem; }
.notif-empty-state { text-align: center; padding: 4rem 2rem; font-family: var(--font-heading, 'Playfair Display', Georgia, serif); font-size: 1.1rem; font-style: italic; color: rgba(255,255,255,0.25); }
.notif-broadcast-section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.08); }
.notif-broadcast-title { font-family: var(--font-label, 'Cinzel', serif); font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(255,255,255,0.3); margin-bottom: 1rem; }
.notif-broadcast-form { display: flex; flex-direction: column; gap: 0.75rem; }
.notif-broadcast-input { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 0.65rem 0.9rem; font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.88rem; color: rgba(255,255,255,0.88); width: 100%; }
.notif-broadcast-input::placeholder { color: rgba(255,255,255,0.28); }
.notif-broadcast-row { display: flex; gap: 0.5rem; }
.notif-broadcast-select { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 0.65rem 0.9rem; font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.88rem; color: rgba(255,255,255,0.88); flex: 1; }
.notif-broadcast-btn { background: #a02828; color: #fff; border: none; border-radius: 8px; padding: 0.65rem 1.25rem; font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.85rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.notif-broadcast-btn:hover { opacity: 0.85; }
.notif-broadcast-status { font-size: 0.8rem; color: rgba(255,255,255,0.35); font-family: var(--font-body, 'Inter', -apple-system, sans-serif); }

/* ── RESPONSIVE ── */
@media (max-width: 1160px) { .sb-right { display: none; } }

/* ── MOBILE TOP BAR (always in DOM, shown only ≤768px via media query) ── */
.sb-mob-bar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: 54px; z-index: 600;
  background: #0d0b08;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  align-items: center;
  padding: 0 0.85rem 0 0.5rem;
  gap: 0.35rem;
}
.sb-mob-hamburger {
  background: none; border: none; color: rgba(255,255,255,0.7);
  cursor: pointer; padding: 0.55rem 0.6rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  border-radius: 8px; -webkit-tap-highlight-color: transparent;
}
.sb-mob-hamburger:active { background: rgba(255,255,255,0.08); }
.sb-mob-title {
  flex: 1; text-align: center;
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1rem; color: rgba(255,255,255,0.88);
  font-style: italic; text-decoration: none;
}
.sb-mob-acct-wrap { position: relative; flex-shrink: 0; }
.sb-mob-avatar-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  border: none; padding: 0; cursor: pointer; overflow: hidden; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.sb-mob-avatar-btn img { width: 36px; height: 36px; object-fit: cover; }
.sb-mob-notif-dot {
  position: absolute; top: -1px; right: -1px;
  width: 11px; height: 11px; background: #a02828; border-radius: 50%;
  border: 2px solid #0d0b08; display: none; pointer-events: none;
}
.sb-mob-notif-dot.on { display: block; }
.sb-mob-acct-drop {
  display: none; position: fixed; top: 54px; right: 0;
  width: 220px; background: #1c1309;
  border: 1px solid rgba(255,255,255,0.12);
  border-top: none;
  border-radius: 0 0 12px 12px;
  z-index: 700; box-shadow: 0 8px 32px rgba(0,0,0,0.5); overflow: hidden;
}
.sb-mob-acct-drop.open { display: block; }
.sb-mob-acct-email {
  display: block; font-size: 0.7rem; color: rgba(255,255,255,0.3);
  padding: 0.6rem 1rem 0.35rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-mob-acct-drop a,
.sb-mob-acct-drop button {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; font-size: 0.88rem; font-weight: 500;
  color: rgba(255,255,255,0.65); background: none; border: none;
  cursor: pointer; padding: 0.72rem 1rem; text-align: left;
  transition: background 0.15s; text-decoration: none;
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
  box-sizing: border-box;
}
.sb-mob-acct-drop a:hover,
.sb-mob-acct-drop button:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.88); }

/* Overlay (covers page behind drawer / mob dropdown) */
.sb-mob-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.52); z-index: 595;
  -webkit-tap-highlight-color: transparent;
}
.sb-mob-overlay.open { display: block; }

/* Floating compose FAB */
.sb-mob-fab {
  display: none; position: fixed; bottom: 1.2rem; right: 1.2rem;
  width: 52px; height: 52px; border-radius: 50%;
  background: #a02828; color: #fff; border: none;
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
  align-items: center; justify-content: center;
  font-size: 1.55rem; font-weight: 300; line-height: 1;
  cursor: pointer; z-index: 300;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
.sb-mob-fab:active { transform: scale(0.92); }

/* ── MOBILE BREAKPOINT ── */
@media (max-width: 768px) {
  /* Show top bar, hide old desktop nav */
  .sb-mob-bar { display: flex; }
  .hs-nav { display: none !important; }

  /* Layout: single column (body padding-top from sb-sidebar-init.js handles bar clearance) */
  .sb-layout { display: block !important; }

  /* Sidebar → slide-in drawer */
  .sb-sidebar {
    display: flex !important;
    position: fixed !important;
    top: 0 !important; left: 0 !important; bottom: 0 !important;
    width: 280px !important; min-width: 0 !important;
    height: 100% !important; height: 100dvh !important;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 600; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    will-change: transform;
    contain: layout style;
  }
  .sb-sidebar.mob-open {
    transform: translateX(0);
    box-shadow: 6px 0 40px rgba(0,0,0,0.6);
  }

  /* Hide logo inside drawer (top bar takes over branding) */
  .sb-sidebar .sb-logo { display: none; }

  /* Main full width */
  .sb-main { width: 100% !important; border-right: none !important; touch-action: pan-y; }

  /* Right sidebar off */
  .sb-right { display: none !important; }

  /* Nav items: bigger tap target */
  .sb-nav-item { min-height: 48px; padding-top: 0.8rem; padding-bottom: 0.8rem; }

  /* FAB hidden — bottom tabs handle navigation */
  .sb-mob-fab { display: none; }

  /* Discussion compose: stack vertically on narrow screens */
  .disc-compose-actions { flex-direction: row; align-items: center; margin-top: 0.5rem; }
  .disc-submit-btn { flex: 1; text-align: center; }

  /* Notification page: full-width padding */
  .notif-page { padding: 1.25rem 0.85rem 5rem; max-width: 100%; }

  /* Extra bottom clearance so content isn't hidden behind floating tab bar */
  .sb-main-inner { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
}

/* Tab bar CSS is self-contained in sb-sidebar-init.js (injected via <style> tag)
   so it works on pages that don't load this file. */

/* ── iOS INSTALL TIP ── */
.sb-ios-tip {
  position: fixed; bottom: calc(60px + env(safe-area-inset-bottom));
  left: 1rem; right: 1rem;
  background: #1c1309; border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px; padding: 0.9rem 1rem;
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
  font-size: 0.82rem; color: rgba(255,255,255,0.8);
  z-index: 800; box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: slideUp 0.3s ease; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sb-ios-tip button { background: none; border: none; color: rgba(255,255,255,0.45); font-size: 1.3rem; cursor: pointer; padding: 0 0 0 0.25rem; line-height: 1; flex-shrink: 0; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* iOS install guide modal */
.sb-ios-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.72); z-index: 1000;
  align-items: flex-end; justify-content: center;
  padding: 0;
}
.sb-ios-modal-overlay.open { display: flex; }
.sb-ios-modal {
  background: #1a1208; border-radius: 20px 20px 0 0;
  border: 1px solid rgba(255,255,255,0.12); border-bottom: none;
  padding: 2rem 1.5rem calc(2rem + env(safe-area-inset-bottom));
  width: 100%; max-width: 480px; position: relative;
  animation: slideUp 0.28s cubic-bezier(0.34,1.3,0.64,1);
}
.sb-ios-modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(255,255,255,0.1); border: none;
  width: 30px; height: 30px; border-radius: 50%;
  color: rgba(255,255,255,0.6); font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sb-ios-modal-icon { text-align: center; margin-bottom: 1rem; }
.sb-ios-modal-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem; font-weight: 600; color: #fff;
  text-align: center; margin-bottom: 0.4rem;
}
.sb-ios-modal-title em { font-style: italic; font-weight: 400; }
.sb-ios-modal-sub {
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
  font-size: 0.85rem; color: rgba(255,255,255,0.5);
  text-align: center; margin-bottom: 1.75rem; line-height: 1.5;
}
.sb-ios-modal-steps {
  list-style: none; display: flex; flex-direction: column; gap: 1.1rem;
  margin-bottom: 2rem;
}
.sb-ios-modal-steps li {
  display: flex; align-items: flex-start; gap: 0.9rem;
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
  font-size: 0.92rem; color: rgba(255,255,255,0.82); line-height: 1.45;
}
.sb-ios-step-num {
  width: 26px; height: 26px; border-radius: 50%; background: #a02828;
  color: #fff; font-weight: 700; font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  margin-top: 0.05rem;
}
.sb-ios-modal-steps strong { color: #fff; }
.sb-ios-share-icon {
  display: inline-flex; align-items: center; vertical-align: middle;
  margin-left: 0.3rem; color: rgba(255,255,255,0.6);
}
.sb-ios-modal-arrow {
  text-align: center; font-size: 2rem; color: #a02828;
  animation: bounce 1.2s ease-in-out infinite;
}
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ── ANDROID INSTALL BANNER ── */
.sb-install-banner {
  position: fixed; bottom: calc(60px + env(safe-area-inset-bottom));
  left: 1rem; right: 1rem;
  background: #1c1309; border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px; padding: 0.85rem 1rem;
  display: flex; align-items: center; gap: 0.75rem;
  z-index: 800; box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: slideUp 0.3s ease;
}
.sb-install-text { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.82rem; color: rgba(255,255,255,0.8); }
.sb-install-text strong { color: #fff; font-size: 0.88rem; }
.sb-install-btn { background: #a02828; color: #fff; border: none; border-radius: 100px; padding: 0.45rem 1rem; font-family: var(--font-body, 'Inter', -apple-system, sans-serif); font-size: 0.82rem; font-weight: 700; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.sb-install-close { background: none; border: none; color: rgba(255,255,255,0.4); font-size: 1.2rem; cursor: pointer; padding: 0 0.2rem; line-height: 1; flex-shrink: 0; }

/* ── DARK THEME OVERRIDES ──
   Pages define light vars on :root. Redefining on body wins because
   body is a direct match for child elements, overriding inherited :root values. */
body {
  --ink:       rgba(255,255,255,0.88);
  --ink-mid:   rgba(255,255,255,0.55);
  --muted:     rgba(255,255,255,0.3);
  --paper:     #0f0d0a;
  --off-white: #181410;
  --cream:     #0f0d0a;
  --border:    rgba(255,255,255,0.1);
  --accent:    #a02828;
  background:  #0d0b08;
  color:       rgba(255,255,255,0.88);
}

/* Content-area backgrounds */
.preview-page,
.member-page,
.rg-page,
.rg-header,
.analysis-wrap { background: #0d0b08 !important; }

/* Cards */
.blog-preview-card   { background: rgba(255,255,255,0.04) !important; border-color: rgba(255,255,255,0.08) !important; box-shadow: none !important; }
@media (max-width: 768px) {
  .blog-post-item    { background: none !important; border: none !important; border-bottom: 1px solid rgba(255,255,255,0.07) !important; box-shadow: none !important; margin-bottom: 0 !important; }
}
.forum-thread        { background: rgba(255,255,255,0.03) !important; }

/* Form controls */
.forum-compose-input,
.forum-compose-textarea,
.preview-disc-textarea,
.forum-textarea,
.forum-input { background: rgba(255,255,255,0.06) !important; border-color: rgba(255,255,255,0.1) !important; color: rgba(255,255,255,0.88) !important; }
.video-disc-textarea { background: transparent !important; border: none !important; color: rgba(255,255,255,0.88) !important; outline: none !important; box-shadow: none !important; }

/* Old account dropdown (in hidden hs-nav — also applies on mobile) */
.std-acct-dropdown   { background: #1c1309 !important; border-color: rgba(255,255,255,0.1) !important; }
.std-acct-dropdown a,
.std-acct-dropdown button { color: rgba(255,255,255,0.55) !important; }
.std-acct-dropdown a:hover,
.std-acct-dropdown button:hover { background: rgba(255,255,255,0.07) !important; color: rgba(255,255,255,0.88) !important; }

/* Gate fade gradient */
.preview-gate-fade   { background: linear-gradient(to bottom, transparent 0%, rgba(13,11,8,0.75) 40%, #0d0b08 100%) !important; }
.post-teaser-fade    { background: linear-gradient(to bottom, transparent 0%, #0d0b08 80%) !important; }

/* Auth modal (injected as JS string — override via CSS) */
.modal               { background: #1c1309 !important; border-color: rgba(255,255,255,0.12) !important; }
.auth-modal-brand,
.auth-field          { color: rgba(255,255,255,0.88) !important; }
.auth-field          { background: rgba(255,255,255,0.07) !important; border-color: rgba(255,255,255,0.15) !important; }
.auth-field::placeholder { color: rgba(255,255,255,0.3) !important; }
.modal-note          { color: rgba(255,255,255,0.45) !important; }
.modal-close         { color: rgba(255,255,255,0.35) !important; }
.auth-submit-btn     { background: #a02828 !important; }
.auth-error          { color: #e07a60 !important; }

/* Discussion compose area */
.video-disc-compose  { background: rgba(255,255,255,0.04) !important; border-color: rgba(255,255,255,0.08) !important; }

/* Primary button — was background:var(--ink) which is now white */
.btn-primary { background: #a02828 !important; color: #fff !important; border-color: #a02828 !important; }

/* Misc badges/overlays */
.cs-badge            { background: rgba(255,255,255,0.06) !important; border-color: rgba(255,255,255,0.1) !important; }
.post-teaser-join-btn { background: #a02828 !important; }

/* Member badge + post tag */
.member-badge { display: inline-block; font-size: 0.58rem; font-weight: 700; letter-spacing: 0.1em; color: #a02828; background: rgba(160,40,40,0.12); border: 1px solid rgba(160,40,40,0.22); border-radius: 4px; padding: 0.12rem 0.38rem; margin-left: 0.4rem; vertical-align: middle; }
.post-user-tag { font-size: 0.8rem; font-weight: 400; color: rgba(255,255,255,0.35); margin-left: 0.3rem; }

/* ── Unified discussion comments (disc-*) ── */
.disc-item { display: flex; gap: 0.75rem; margin-bottom: 1.4rem; }
.disc-nested { padding-left: 0.9rem; border-left: 2px solid rgba(255,255,255,0.1); margin-left: 0.5rem; margin-top: 0.85rem; margin-bottom: 0; }
.disc-body { flex: 1; min-width: 0; }
.disc-header { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.3rem; flex-wrap: wrap; }
.disc-username { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.75); }
.disc-time { font-size: 0.72rem; color: rgba(255,255,255,0.3); }
.disc-text { font-size: 0.88rem; color: rgba(255,255,255,0.65); line-height: 1.55; margin-bottom: 0.35rem; word-break: break-word; white-space: pre-wrap; }
.disc-actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.35rem; }
.disc-like-btn { display: inline-flex; align-items: center; gap: 0.3rem; background: none; border: none; font-size: 0.72rem; color: rgba(255,255,255,0.35); cursor: pointer; padding: 0; transition: color 0.15s; font-family: inherit; }
.disc-like-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.disc-like-btn:hover { color: rgba(255,255,255,0.75); }
.disc-like-btn.liked { color: #a02828; }
.disc-like-btn.liked svg { fill: currentColor; }
.disc-reply-btn, .disc-edit-btn { background: none; border: none; font-size: 0.78rem; color: rgba(255,255,255,0.35); cursor: pointer; padding: 0; transition: color 0.15s; font-family: inherit; }
.disc-reply-btn:hover, .disc-edit-btn:hover { color: rgba(255,255,255,0.75); }
.disc-delete-btn { background: none; border: none; font-size: 1.05rem; color: rgba(255,255,255,0.18); cursor: pointer; padding: 0.1rem 0.3rem; line-height: 1; margin-left: auto; transition: color 0.15s; }
.disc-delete-btn:hover { color: #a02828; }
.disc-host-badge { display: inline-block; font-size: 0.55rem; letter-spacing: 0.1em; text-transform: uppercase; background: #c9a020; color: #fff; padding: 0.13rem 0.45rem; border-radius: 3px; vertical-align: middle; margin-left: 0.4rem; }
.member-badge { display: inline-block; font-size: 0.55rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; background: #a02828; color: #fff; padding: 0.13rem 0.45rem; border-radius: 3px; vertical-align: middle; margin-left: 0.4rem; }
.sb-acct-sub.member-badge { display: inline-block; font-size: 0.6rem; margin-left: 0; margin-top: 0.2rem; }
/* Inline compose (inside reply slot) */
.disc-compose-wrap { display: flex; gap: 0.65rem; align-items: flex-start; margin-top: 0.6rem; }
.disc-input { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 0.6rem 0.85rem; font-family: inherit; font-size: 0.85rem; color: rgba(255,255,255,0.85); outline: none; resize: none; min-height: 54px; }
.disc-input::placeholder { color: rgba(255,255,255,0.22); }
.disc-input:focus { border-color: rgba(255,255,255,0.22); }
.disc-compose-actions { display: flex; flex-direction: column; gap: 0.3rem; flex-shrink: 0; margin-top: 0.3rem; }
.disc-submit-btn { font-size: 0.78rem; font-weight: 700; color: #fff; background: #a02828; border: none; padding: 0.38rem 1rem; border-radius: 100px; cursor: pointer; white-space: nowrap; transition: opacity 0.2s; font-family: inherit; }
.disc-submit-btn:hover { opacity: 0.85; }
.disc-cancel-btn { background: none; border: none; font-size: 0.75rem; color: rgba(255,255,255,0.35); cursor: pointer; padding: 0.2rem 0; text-align: center; transition: color 0.15s; font-family: inherit; }
.disc-cancel-btn:hover { color: rgba(255,255,255,0.75); }
/* Main bottom compose */
.disc-main-compose { display: flex; gap: 0.65rem; align-items: flex-start; padding-top: 0.75rem; margin-top: 0.75rem; border-top: 1px solid rgba(255,255,255,0.06); }
.disc-main-error { font-size: 0.8rem; color: #e07a60; display: block; min-height: 1rem; margin-top: 0.35rem; }
/* Edit textarea */
.disc-edit-wrap { margin: 0.25rem 0 0.5rem; }
.disc-edit-textarea { width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; padding: 0.6rem 0.8rem; font-family: inherit; font-size: 0.88rem; color: rgba(255,255,255,0.85); resize: vertical; min-height: 60px; outline: none; display: block; margin-bottom: 0.5rem; }
.disc-edit-textarea:focus { border-color: rgba(255,255,255,0.25); }
.disc-edit-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ── EMBEDDED MODE — hides all chrome when page loads inside literature iframe ── */
.sb-embedded .sb-mob-bar,
.sb-embedded .sb-bottom-tabs,
.sb-embedded .hs-nav,
.sb-embedded .mob-shk-nav-area,
.sb-embedded .mob-shk-subnav,
.sb-embedded .lit-explore-row,
.sb-embedded .lit-subnav,
.sb-embedded .shk-tab-bar { display: none !important; }
.sb-embedded body { padding-top: 0 !important; padding-bottom: 1rem !important; }
.sb-embedded .sb-main-inner,
.sb-embedded .preview-inner,
.sb-embedded .analysis-wrap,
.sb-embedded .member-page,
.sb-embedded .preview-page { padding-top: 0.75rem !important; }
