/* ═══════════════════════════════════════════════════════════════════════════
   KOFA X — STYLESHEET
   ───────────────────────────────────────────────────────────────────────────
   01. RESET & BASE
   02. THEME VARIABLES (dark + light)
   03. SPLASH SCREEN
   04. APP SHELL
   05. FEED HEADER
   06. STATUS BANNER
   07. SECTIONS
   08. HERO BANNER
   09. METRICS BAR
   10. CATEGORY PILLS
   11. BENTO POST SYSTEM
   12. POST HEADER
   13. POST MEDIA
   14. POST TEXT (base)
   15. POST FOOTER
   16. RESPONSIVE — BENTO GRID
   17. SKELETON / SHIMMER
   18. BOTTOM NAV
   19. MODALS & DIALOGS
   20. TOAST
   21. PULL TO REFRESH
   22. END CARD
   23. PAGE TRANSITIONS
   24. RESPONSIVE CHROME
   25. WELCOME SHEET
   26. "MORE" CHIP
   27. CATEGORIES SHEET
   28. RICH POST TEXT (markdown)
═══════════════════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════════════════════
   01. RESET & BASE
═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--theme-bg);
  color: var(--theme-text);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: background 0.25s ease, color 0.25s ease;
}

/* Selectable text — user can select these */
.post-text,
.post-user-name,
.post-name,
.hero-text h2,
.hero-text p {
  user-select: text;
  -webkit-user-select: text;
}

/* Focus states */
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--theme-primary);
  outline-offset: 2px;
  border-radius: inherit;
}


/* ═══════════════════════════════════════════════════════════════════════════
   02. THEME VARIABLES
═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Brand ── */
  --theme-primary: #ff4fb2;
  --theme-primary-hover: #e6459e;
  --theme-primary-glow: rgba(255, 79, 178, 0.35);
  --theme-primary-soft: rgba(255, 79, 178, 0.10);

  /* ── Backgrounds ── */
  --theme-bg: #0a0a0d;
  --theme-bg-hover: #131318;
  --theme-surface: #14141a;
  --theme-surface-raised: #1a1a22;
  --theme-surface-card: rgba(20, 20, 26, 0.88);
  --theme-surface-card-hover: rgba(26, 26, 34, 0.95);

  /* ── Text ── */
  --theme-text: #ffffff;
  --theme-text-secondary: rgba(255, 255, 255, 0.78);
  --theme-text-tertiary: rgba(255, 255, 255, 0.55);

  /* ── Borders & shadows ── */
  --theme-glass-border: rgba(255, 255, 255, 0.09);
  --theme-glass-shadow: rgba(0, 0, 0, 0.55);
  --theme-overlay: rgba(0, 0, 0, 0.82);
  --theme-card-border: rgba(255, 255, 255, 0.08);
  --theme-card-border-active: rgba(255, 79, 178, 0.40);
  --theme-divider: rgba(255, 255, 255, 0.08);

  /* ── Safe-area insets ── */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* ── Layout ── */
  --nav-height: 64px;
  --sidebar-width: 250px;
  --feed-max-width: 980px;
  --font-post: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* ── Feed ── */
  --feed-divider: rgba(255, 255, 255, 0.14);
  --feed-divider-hover: rgba(255, 79, 178, 0.32);

  /* ── Pills ── */
  --pill-bg: rgba(255, 255, 255, 0.05);
  --pill-bg-hover: rgba(255, 255, 255, 0.09);
  --pill-border: rgba(255, 255, 255, 0.08);
  --pill-border-hover: rgba(255, 255, 255, 0.16);
  --pill-text: rgba(255, 255, 255, 0.72);
  --pill-text-hover: rgba(255, 255, 255, 0.95);

  /* ── Bento cards ── */
  --card-bg: rgba(255, 255, 255, 0.022);
  --card-bg-hover: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-border-hover: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] {
  --theme-bg: #f0f2f7;
  --theme-bg-hover: #e8ebf2;
  --theme-surface: #ffffff;
  --theme-surface-raised: #ffffff;
  --theme-surface-card: rgba(255, 255, 255, 0.95);
  --theme-surface-card-hover: #ffffff;

  --theme-text: #0b0d17;
  --theme-text-secondary: rgba(11, 13, 23, 0.78);
  --theme-text-tertiary: rgba(11, 13, 23, 0.55);

  --theme-glass-border: rgba(0, 0, 0, 0.08);
  --theme-glass-shadow: rgba(0, 0, 0, 0.06);
  --theme-overlay: rgba(15, 23, 42, 0.45);
  --theme-card-border: rgba(0, 0, 0, 0.08);
  --theme-card-border-active: rgba(255, 79, 178, 0.45);
  --theme-divider: rgba(0, 0, 0, 0.08);

  --feed-divider: rgba(0, 0, 0, 0.12);
  --feed-divider-hover: rgba(255, 79, 178, 0.45);

  --pill-bg: rgba(0, 0, 0, 0.035);
  --pill-bg-hover: rgba(0, 0, 0, 0.06);
  --pill-border: rgba(0, 0, 0, 0.07);
  --pill-border-hover: rgba(0, 0, 0, 0.14);
  --pill-text: rgba(11, 13, 23, 0.62);
  --pill-text-hover: rgba(11, 13, 23, 0.92);

  --card-bg: rgba(0, 0, 0, 0.014);
  --card-bg-hover: rgba(0, 0, 0, 0.028);
  --card-border: rgba(0, 0, 0, 0.06);
  --card-border-hover: rgba(0, 0, 0, 0.14);
}


/* ═══════════════════════════════════════════════════════════════════════════
   03. SPLASH SCREEN
═══════════════════════════════════════════════════════════════════════════ */

#splash {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: var(--theme-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
#splash.hide {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.splash-logo-wrapper {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.splash-logo-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 79, 178, 0.2);
  animation: ringSpin 4s linear infinite;
}
.splash-logo-ring::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--theme-primary);
  transform: translateX(-50%);
  box-shadow: 0 0 14px var(--theme-primary-glow);
}
.splash-logo-ring:nth-child(2) {
  width: 130px;
  height: 130px;
  animation-duration: 6s;
  animation-direction: reverse;
  border-color: rgba(255, 79, 178, 0.12);
}

@keyframes ringSpin {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}

.splash-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--theme-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border: 1px solid var(--theme-glass-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  position: relative;
}
.splash-logo-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, var(--theme-primary), #7928ca);
  z-index: 1;
}
.splash-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  z-index: 2;
  transition: opacity 0.3s ease;
}
.splash-logo img.loaded {
  opacity: 1;
}

.splash-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 6px;
  color: var(--theme-text);
}
.splash-title .accent {
  color: var(--theme-primary);
}

.splash-tagline {
  color: var(--theme-text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.splash-progress {
  margin-top: 36px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.splash-progress .bar {
  width: 120px;
  height: 4px;
  border-radius: 4px;
  background: var(--theme-divider);
  overflow: hidden;
}
.splash-progress .bar .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--theme-primary), #ff8dd6);
  border-radius: 4px;
  transition: width 0.25s ease;
}
.splash-progress .percentage {
  color: var(--theme-text-tertiary);
  font-size: 11px;
  font-weight: 700;
  min-width: 32px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   04. APP SHELL
═══════════════════════════════════════════════════════════════════════════ */

.app-root {
  height: 100vh;
  height: 100dvh;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  background: var(--theme-bg);
}

/* ── Desktop sidebar ── */
.desktop-sidebar {
  display: none;
  width: var(--sidebar-width);
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(24px + var(--safe-top)) 18px 20px;
  border-right: 1px solid var(--theme-glass-border);
  background: var(--theme-surface);
  z-index: 90;
  flex-shrink: 0;
  overscroll-behavior: contain;
}

.desktop-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 24px;
  text-decoration: none;
  color: inherit;
}

.logo-container-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--theme-glass-border);
  background: var(--theme-surface-card);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-container-badge .fallback-kx {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--theme-primary), #7928ca);
  z-index: 1;
}
.logo-container-badge img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  z-index: 2;
  transition: opacity 0.25s ease;
}
.logo-container-badge img.loaded {
  opacity: 1;
}

.desktop-logo-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.desktop-nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
}
.desktop-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--theme-text-secondary);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  width: 100%;
  text-decoration: none;
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.desktop-nav-link svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
}
.desktop-nav-link:hover {
  background: rgba(255, 79, 178, 0.05);
  color: var(--theme-text);
  border-color: var(--theme-card-border-active);
}
.desktop-nav-link.active {
  background: rgba(255, 79, 178, 0.1);
  color: var(--theme-primary);
  border-color: var(--theme-card-border-active);
}
.desktop-nav-link:active {
  transform: scale(0.98);
  transition: transform 0.08s ease;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--theme-surface-card);
  border: 1px solid var(--theme-glass-border);
  transition: all 0.2s ease;
}
.sidebar-user-card:hover {
  border-color: var(--theme-card-border-active);
}
.sidebar-user-info h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--theme-text);
}
.sidebar-user-info p {
  font-size: 10px;
  color: var(--theme-text-tertiary);
}

/* ── Viewport ── */
.viewport {
  flex: 1;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--theme-bg);
  overscroll-behavior: contain;
}

#page-feed {
  height: 100%;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 14px calc(var(--nav-height) + 28px + var(--safe-bottom));
  scrollbar-width: thin;
  scrollbar-color: var(--theme-glass-border) transparent;
}
#page-feed::-webkit-scrollbar {
  width: 3px;
}
#page-feed::-webkit-scrollbar-thumb {
  background: var(--theme-glass-border);
  border-radius: 3px;
}

.feed-inner-layout {
  width: 100%;
  max-width: var(--feed-max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   05. FEED HEADER
═══════════════════════════════════════════════════════════════════════════ */

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 6px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--theme-text);
}
.brand-title span {
  color: var(--theme-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--theme-glass-border);
  background: var(--theme-surface-card);
  color: var(--theme-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.icon-btn:hover {
  border-color: var(--theme-card-border-active);
  background: var(--theme-surface-card-hover);
}
.icon-btn:active {
  transform: scale(0.95);
  border-color: var(--theme-primary);
  transition: transform 0.08s ease;
}
.icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.icon-btn .badge-counter {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--theme-primary);
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid var(--theme-bg);
}

/* Install button */
#btnInstallHeader.show {
  display: flex !important;
}
#btnInstallHeader .install-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--theme-bg);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.5); opacity: 0.5; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   06. STATUS BANNER
═══════════════════════════════════════════════════════════════════════════ */

.status-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--theme-primary-soft);
  border: 1px solid var(--theme-card-border-active);
  border-radius: 12px;
  margin-bottom: 8px;
  animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.status-banner.show {
  display: flex;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.banner-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: var(--theme-primary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.banner-message {
  font-size: 12.5px;
  color: var(--theme-text);
  font-weight: 600;
  line-height: 1.3;
}
.banner-time {
  font-size: 10.5px;
  color: var(--theme-text-tertiary);
  font-weight: 500;
}
.banner-dismiss {
  background: none;
  border: none;
  color: var(--theme-text-tertiary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  touch-action: manipulation;
}
.banner-dismiss:hover {
  background: var(--theme-divider);
  color: var(--theme-text-secondary);
}
.banner-dismiss svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ═══════════════════════════════════════════════════════════════════════════
   07. SECTIONS
═══════════════════════════════════════════════════════════════════════════ */

.feed-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  margin-top: 4px;
}

.section-header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 2px;
  min-height: 24px;
}

.section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--theme-text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-title svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
}

.feed-section.is-loading .section-header-wrap {
  display: none;
}

.feed-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--theme-primary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 79, 178, 0.09);
  border: 1px solid rgba(255, 79, 178, 0.2);
}


/* ═══════════════════════════════════════════════════════════════════════════
   08. HERO BANNER
═══════════════════════════════════════════════════════════════════════════ */

.hero-wrapper {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  height: 310px;
  border: 1px solid var(--theme-glass-border);
  background: var(--theme-surface);
  box-shadow: 0 10px 32px var(--theme-glass-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  touch-action: manipulation;
}
.hero-wrapper:hover {
  border-color: var(--theme-card-border-active);
}

.hero-slide-bg {
  width: 100%;
  height: 100%;
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.4s ease, background-color 0.4s ease;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.58) 50%,
    rgba(0, 0, 0, 0.22) 80%,
    rgba(0, 0, 0, 0.1) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 20px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #ffffff;
  background: rgba(255, 79, 178, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 79, 178, 0.45);
  width: fit-content;
  margin-bottom: 8px;
}
.hero-meta-badge svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

.hero-text h2 {
  font-size: clamp(20px, 4.5vw, 26px);
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: -0.4px;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
.hero-text p {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.45;
  max-width: 520px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.hero-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 12px;
  background: var(--theme-primary);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px var(--theme-primary-glow);
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.btn-hero svg {
  width: 13px;
  height: 13px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.4;
}
.btn-hero:hover {
  background: var(--theme-primary-hover);
}
.btn-hero:active {
  transform: scale(0.96);
  transition: transform 0.08s ease;
}

.hero-dots-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}
.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: all 0.25s ease;
  cursor: pointer;
  touch-action: manipulation;
}
.hero-dot.active {
  background: var(--theme-primary);
  width: 16px;
  border-radius: 3px;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(10, 10, 14, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.hero-arrow:hover {
  border-color: var(--theme-card-border-active);
  background: rgba(10, 10, 14, 0.85);
}
.hero-arrow:active {
  transform: translateY(-50%) scale(0.92);
  transition: transform 0.08s ease;
}
.hero-arrow.prev {
  left: 10px;
}
.hero-arrow.next {
  right: 10px;
}
.hero-arrow svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
}


/* ═══════════════════════════════════════════════════════════════════════════
   09. METRICS BAR
═══════════════════════════════════════════════════════════════════════════ */

.metrics-bar-container {
  width: 100%;
  background: var(--theme-surface-card);
  border: 1px solid var(--theme-glass-border);
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px var(--theme-glass-shadow);
  transition: border-color 0.2s ease;
}
.metrics-bar-container:hover {
  border-color: var(--theme-card-border-active);
}

.metric-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  padding: 2px;
}
.metric-val {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--theme-text);
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
}
.metric-val.green {
  color: #10b981;
}
.metric-sub {
  font-size: 9px;
  font-weight: 700;
  color: var(--theme-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.metric-divider-line {
  width: 1px;
  height: 20px;
  background: var(--theme-divider);
}


/* ═══════════════════════════════════════════════════════════════════════════
   10. CATEGORY PILLS
═══════════════════════════════════════════════════════════════════════════ */

.category-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.category-pills::-webkit-scrollbar {
  display: none;
}

.category-pill {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--theme-card-border);
  background: var(--theme-surface-card);
  color: var(--theme-text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  touch-action: manipulation;
}
.category-pill svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.category-pill:hover {
  border-color: var(--theme-card-border-active);
  color: var(--theme-text);
  background: var(--theme-surface-card-hover);
}
.category-pill.active {
  background: var(--theme-primary);
  color: #ffffff;
  border-color: var(--theme-primary);
  box-shadow: 0 2px 10px var(--theme-primary-glow);
}
.category-pill:active {
  transform: scale(0.96);
  transition: transform 0.08s ease;
}


/* ═══════════════════════════════════════════════════════════════════════════
   11. BENTO POST SYSTEM
   Each card finds its own height. Wide screens show a masonry-like
   bento grid — no forced row alignment, no squished media.
═══════════════════════════════════════════════════════════════════════════ */

.feed-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: feedFadeIn 0.2s ease-out;
}

@keyframes feedFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Base post (mobile-first): stacked flow layout */
.post-card {
  position: relative;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transition: background 0.2s ease;
  touch-action: manipulation;
  content-visibility: auto;
  contain-intrinsic-size: auto 460px;
}
@media (min-width: 768px) {
  .post-card {
    padding: 30px 0;
  }
}

/* Full-bleed divider between posts (mobile flow) */
.post-card:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--feed-divider);
  pointer-events: none;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
  .post-card:hover {
    background: var(--theme-bg-hover);
  }
  .post-card:hover::after,
  .post-card:has(+ .post-card:hover)::after {
    background: var(--feed-divider-hover);
    box-shadow: 0 0 16px 1px rgba(255, 79, 178, 0.10);
  }
}

.post-card:active {
  background: rgba(255, 255, 255, 0.03);
  transition: none;
}
[data-theme="light"] .post-card:active {
  background: rgba(0, 0, 0, 0.03);
}


/* ═══════════════════════════════════════════════════════════════════════════
   12. POST HEADER
═══════════════════════════════════════════════════════════════════════════ */

.post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.post-author-group {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
  flex: 1;
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13.5px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: hsl(var(--space-hue, 320) 32% 22%);
  border: 1px solid hsl(var(--space-hue, 320) 30% 32% / 0.6);
  color: hsl(var(--space-hue, 320) 40% 92%);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
[data-theme="light"] .post-avatar {
  background: hsl(var(--space-hue, 320) 55% 88%);
  border: 1px solid hsl(var(--space-hue, 320) 55% 78%);
  color: hsl(var(--space-hue, 320) 55% 28%);
}
.post-avatar .avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  opacity: 0;
  z-index: 2;
  transition: opacity 0.4s ease;
}
.post-avatar .avatar-img.loaded {
  opacity: 1;
}
.post-avatar .avatar-initials {
  position: relative;
  z-index: 1;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.post-avatar .avatar-img.loaded ~ .avatar-initials {
  opacity: 0;
}

.post-user-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 1px;
}
.post-user-name {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--theme-text);
}
.post-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  line-height: 1.3;
  min-width: 0;
  flex-wrap: wrap;
}
.post-time {
  font-weight: 500;
  color: var(--theme-text-tertiary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  display: block;
}
.post-card-tag {
  font-weight: 700;
  letter-spacing: 0.15px;
  color: hsl(var(--space-hue, 320) 82% 68%);
  white-space: nowrap;
  position: relative;
  padding-left: 10px;
  font-size: 11px;
  background: transparent;
  border: none;
}
.post-card-tag::before {
  content: '·';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--theme-text-tertiary);
  font-weight: 800;
}
[data-theme="light"] .post-card-tag {
  color: hsl(var(--space-hue, 320) 65% 42%);
}

/* ── Open pill ── */
.pill-open {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 10px;
  background: rgba(255, 79, 178, 0.10);
  border: 1px solid rgba(255, 79, 178, 0.22);
  border-radius: 999px;
  color: var(--theme-primary);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
  touch-action: manipulation;
  user-select: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.pill-open svg {
  width: 9px;
  height: 9px;
  stroke: currentColor;
  fill: none;
  stroke-width: 3;
  transition: transform 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .pill-open:hover {
    background: rgba(255, 79, 178, 0.20);
    border-color: rgba(255, 79, 178, 0.45);
    color: #ffffff;
  }
  .pill-open:hover svg {
    transform: translateX(1px);
  }
}
.pill-open:active {
  transform: scale(0.94);
  transition: transform 0.08s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
}


/* ═══════════════════════════════════════════════════════════════════════════
   13. POST MEDIA
═══════════════════════════════════════════════════════════════════════════ */

.post-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  border-radius: 14px;
  overflow: hidden;
  background: hsl(var(--space-hue, 320) 26% 14%);
  border: 1px solid hsl(var(--space-hue, 320) 26% 20% / 0.6);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}
[data-theme="light"] .post-media-wrap {
  background: hsl(var(--space-hue, 320) 40% 92%);
  border: 1px solid hsl(var(--space-hue, 320) 40% 86%);
}

/* Taller images on phones */
@media (max-width: 640px) {
  .post-media-wrap {
    aspect-ratio: 4 / 3;
  }
}
@media (min-width: 641px) and (max-width: 767px) {
  .post-media-wrap {
    aspect-ratio: 3 / 2;
  }
}

.post-media-wrap .media-placeholder-icon {
  width: 34px;
  height: 34px;
  stroke: hsl(var(--space-hue, 320) 40% 70%);
  fill: none;
  stroke-width: 1.6;
  opacity: 0.55;
  transition: opacity 0.4s ease;
}
[data-theme="light"] .post-media-wrap .media-placeholder-icon {
  stroke: hsl(var(--space-hue, 320) 55% 45%);
  opacity: 0.4;
}

.post-media-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  z-index: 2;
  transition: opacity 0.45s ease;
}
.post-media-wrap img.loaded {
  opacity: 1;
}
.post-media-wrap img.loaded ~ .media-placeholder-icon {
  opacity: 0;
}
.post-media-wrap.loaded .media-placeholder-icon {
  opacity: 0;
}

.post-media-wrap.errored {
  background: var(--theme-surface) !important;
  border-color: var(--theme-card-border);
  cursor: default;
}
.post-media-wrap.errored::after {
  content: 'Image unavailable';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--theme-text-tertiary);
  letter-spacing: 0.2px;
  z-index: 3;
}
.post-media-wrap.errored img {
  display: none;
}

.post-card:active .post-media-wrap {
  transform: scale(0.995);
}


/* ═══════════════════════════════════════════════════════════════════════════
   14. POST TEXT (base)
═══════════════════════════════════════════════════════════════════════════ */

.post-text-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.post-text {
  font-family: var(--font-post);
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.58;
  letter-spacing: -0.005em;
  color: var(--theme-text);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow: hidden;
  transition: -webkit-line-clamp 0.2s ease;
}
.post-text.is-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-text.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.post-card.has-media .post-text.is-collapsed {
  -webkit-line-clamp: 3;
}

.post-text-toggle {
  display: none;
  align-self: flex-start;
  margin: 0;
  padding: 4px 0;
  background: none;
  border: none;
  color: var(--theme-primary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: opacity 0.15s ease;
  min-height: 32px;
  touch-action: manipulation;
}
.post-text-toggle.is-visible {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.post-text-toggle:hover {
  opacity: 0.78;
}
.post-text-toggle:active {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}
.post-text-toggle:focus-visible {
  outline: 2px solid var(--theme-primary);
  outline-offset: 2px;
  border-radius: 4px;
}
.post-text-toggle svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.6;
  transition: transform 0.2s ease;
}
.post-text-toggle.is-expanded svg {
  transform: rotate(180deg);
}


/* ═══════════════════════════════════════════════════════════════════════════
   15. POST FOOTER
═══════════════════════════════════════════════════════════════════════════ */

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  flex-shrink: 0;
}
.post-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-views-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pill-text);
  letter-spacing: 0.1px;
  font-variant-numeric: tabular-nums;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.post-views-count svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  opacity: 0.9;
}

/* ── Circular action buttons ── */
.btn-post-action,
.pill-search {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 50%;
  color: var(--pill-text);
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  font-family: inherit;
  touch-action: manipulation;
  user-select: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}
.btn-post-action svg,
.pill-search svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.pill-search svg {
  stroke-width: 2.2;
  width: 14px;
  height: 14px;
}
@media (hover: hover) and (pointer: fine) {
  .btn-post-action:hover,
  .pill-search:hover {
    background: var(--pill-bg-hover);
    border-color: var(--pill-border-hover);
    color: var(--pill-text-hover);
  }
}
.btn-post-action:active,
.pill-search:active {
  transform: scale(0.92);
  transition: transform 0.08s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}
.btn-post-action:focus-visible,
.pill-search:focus-visible {
  outline: 2px solid var(--theme-primary);
  outline-offset: 2px;
}
.btn-post-action .share-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--theme-primary);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--theme-bg);
  font-variant-numeric: tabular-nums;
}

/* Larger touch targets on touch devices */
@media (hover: none) and (pointer: coarse) {
  .pill-open,
  .btn-post-action,
  .pill-search {
    position: relative;
  }
  .pill-open::before {
    content: '';
    position: absolute;
    inset: -6px;
  }
  .btn-post-action::before,
  .pill-search::before {
    content: '';
    position: absolute;
    inset: -8px;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   16. RESPONSIVE — BENTO GRID
   < 700px   → stacked flow layout (dividers, full-bleed)
   ≥ 700px   → CSS columns masonry bento
               2 cols → 3 cols → 4 cols on ultra-wide
   Every card keeps its natural height. Nothing stretches.
═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 700px) {
  .feed-container {
    /* CSS columns = masonry, each item flows to its own height */
    display: block;
    column-count: 2;
    column-gap: 16px;
    padding: 16px 0 40px;
    animation: none;
  }

  .post-card {
    /* Prevent a card from splitting across columns */
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;

    /* Cards get surfaces — bento style */
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px;
    gap: 10px;

    /* Reset any flow margins */
    margin: 0 0 16px 0;

    /* Let content decide height */
    height: auto;
    min-height: 0;

    display: flex;
    flex-direction: column;
  }

  /* Dividers off — cards have their own edges */
  .post-card:not(:last-child)::after {
    display: none;
  }

  /* Media gets a clean shape inside the card column */
  .post-media-wrap {
    aspect-ratio: 4 / 3;
    min-height: 160px;
    border-radius: 12px;
  }

  /* Text-only cards: 6-line clamp */
  .post-card:not(.has-media) .post-text.is-collapsed {
    -webkit-line-clamp: 6;
  }
  .post-card.has-media .post-text.is-collapsed {
    -webkit-line-clamp: 4;
  }

  /* Hover lift */
  @media (hover: hover) and (pointer: fine) {
    .post-card:hover {
      background: var(--card-bg-hover);
      border-color: var(--card-border-hover);
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    }
    .post-card:not(.has-media):hover::before {
      height: 60px;
      background: hsl(var(--space-hue, 320) 90% 65%);
    }
  }
  .post-card:active {
    transform: translateY(-1px);
    transition: transform 0.08s ease;
  }

  /* Text-only cards get a colored left rail */
  .post-card:not(.has-media) {
    position: relative;
  }
  .post-card:not(.has-media)::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 0;
    width: 3px;
    height: 32px;
    border-radius: 0 3px 3px 0;
    background: hsl(var(--space-hue, 320) 80% 60% / 0.55);
    pointer-events: none;
    transition: height 0.25s ease, background 0.2s ease;
  }
}

/* 3 columns on large desktop */
@media (min-width: 1100px) {
  .feed-container {
    column-count: 3;
    column-gap: 18px;
  }
}

/* 4 columns on ultra-wide */
@media (min-width: 1600px) {
  .feed-container {
    column-count: 4;
    column-gap: 20px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .post-card:hover {
    transform: none;
  }
  .post-card:active {
    transform: none;
  }
  .pill-open:hover svg {
    transform: none;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   17. SKELETON / SHIMMER
═══════════════════════════════════════════════════════════════════════════ */

.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.02) 25%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.02) 75%
  );
  background-size: 200% 100%;
  animation: shimmerAnim 1.6s infinite;
  border-radius: 8px;
}
[data-theme="light"] .shimmer {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.03) 25%,
    rgba(0, 0, 0, 0.08) 50%,
    rgba(0, 0, 0, 0.03) 75%
  );
  background-size: 200% 100%;
}

@keyframes shimmerAnim {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 30px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  break-inside: avoid;
}
.feed-container > .skeleton-card + .skeleton-card {
  margin-top: 12px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   18. BOTTOM NAV
═══════════════════════════════════════════════════════════════════════════ */

.bottom-nav {
  position: fixed;
  bottom: calc(12px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: 540px;
  width: calc(100% - 32px);
  background: var(--theme-surface-card);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--theme-glass-border);
  border-radius: 24px;
  padding: 6px 10px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 10px 40px var(--theme-glass-shadow);
  z-index: 100;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}
.bottom-nav.hiding {
  transform: translateX(-50%) translateY(130px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 12px;
  border-radius: 16px;
  border: none;
  background: transparent;
  color: var(--theme-text-tertiary);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  min-width: 58px;
  flex: 1;
  touch-action: manipulation;
}
.nav-item:active {
  transform: scale(0.92);
  transition: transform 0.08s ease;
}
.nav-item.active {
  color: var(--theme-primary);
  background: rgba(255, 79, 178, 0.09);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-icon svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1px;
  opacity: 0.8;
}
.nav-item.active .nav-label {
  opacity: 1;
  font-weight: 700;
}


/* ═══════════════════════════════════════════════════════════════════════════
   19. MODALS & DIALOGS
═══════════════════════════════════════════════════════════════════════════ */

.glass-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--theme-overlay);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.glass-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.glass-dialog,
.dialog-box {
  background: var(--theme-surface);
  border: 1px solid var(--theme-glass-border);
  border-radius: 24px;
  padding: 26px 22px 22px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 50px var(--theme-glass-shadow);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.glass-overlay.active .glass-dialog,
.glass-overlay.active .dialog-box {
  transform: scale(1) translateY(0);
}

.dialog-icon-wrapper,
.dialog-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255, 79, 178, 0.12);
  color: var(--theme-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  border: 1px solid var(--theme-card-border-active);
}
.dialog-icon-wrapper svg,
.dialog-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
}

.dialog-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--theme-text);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.dialog-message {
  font-size: 12.5px;
  color: var(--theme-text-secondary);
  line-height: 1.45;
  margin-bottom: 18px;
}

.dialog-actions {
  display: flex;
  gap: 8px;
}

.dialog-btn,
.btn-dialog {
  flex: 1;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  touch-action: manipulation;
}
.dialog-btn.sec,
.btn-dialog:not(.primary) {
  background: var(--theme-divider);
  color: var(--theme-text-secondary);
  border-color: var(--theme-glass-border);
}
.dialog-btn.sec:hover,
.btn-dialog:not(.primary):hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--theme-text);
}
.dialog-btn.pri,
.btn-dialog.primary {
  background: var(--theme-primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--theme-primary-glow);
}
.dialog-btn.pri:hover,
.btn-dialog.primary:hover {
  background: var(--theme-primary-hover);
}
.dialog-btn:active,
.btn-dialog:active {
  transform: scale(0.96);
  transition: transform 0.08s ease;
}

.dialog-status {
  text-align: center;
  margin-top: 12px;
  font-size: 11px;
  color: var(--theme-text-tertiary);
  font-weight: 500;
}


/* ═══════════════════════════════════════════════════════════════════════════
   20. TOAST
═══════════════════════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 6000;
  width: 90%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  background: var(--theme-surface-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--theme-glass-border);
  border-radius: 12px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(16px);
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: all;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast svg {
  width: 14px;
  height: 14px;
  stroke: var(--theme-primary);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}
.toast span {
  color: var(--theme-text);
  font-size: 11.5px;
  font-weight: 600;
  flex: 1;
}


/* ═══════════════════════════════════════════════════════════════════════════
   21. PULL TO REFRESH
═══════════════════════════════════════════════════════════════════════════ */

.ptr-indicator {
  position: absolute;
  top: calc(var(--safe-top) + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-50px);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--theme-surface);
  border: 1px solid var(--theme-glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
  opacity: 0;
}
.ptr-indicator.pulling {
  transform: translateX(-50%) translateY(8px);
  opacity: 1;
}
.ptr-indicator.refreshing {
  transform: translateX(-50%) translateY(8px);
  opacity: 1;
  animation: spin 0.8s linear infinite;
}
.ptr-indicator svg {
  width: 13px;
  height: 13px;
  stroke: var(--theme-primary);
  fill: none;
  stroke-width: 2;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ═══════════════════════════════════════════════════════════════════════════
   22. END CARD
═══════════════════════════════════════════════════════════════════════════ */

.feed-end-card {
  background: var(--theme-surface-card);
  border: 1px solid var(--theme-card-border);
  border-radius: 22px;
  padding: 26px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 24px 0;
  box-shadow: 0 4px 20px var(--theme-glass-shadow);
  break-inside: avoid;
}

.feed-end-icon {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: rgba(255, 79, 178, 0.12);
  color: var(--theme-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.feed-end-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
}

.feed-end-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--theme-text);
}
.feed-end-desc {
  font-size: 12px;
  color: var(--theme-text-secondary);
  max-width: 360px;
  line-height: 1.45;
}

.feed-end-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 12px;
  background: var(--theme-primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px var(--theme-primary-glow);
  transition: all 0.2s ease;
  margin-top: 4px;
  touch-action: manipulation;
}
.feed-end-btn:hover {
  background: var(--theme-primary-hover);
}
.feed-end-btn:active {
  transform: scale(0.96);
  transition: transform 0.08s ease;
}


/* ═══════════════════════════════════════════════════════════════════════════
   23. PAGE TRANSITIONS
═══════════════════════════════════════════════════════════════════════════ */

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pageFadeOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-8px) scale(0.98); }
}

.page-enter {
  animation: pageFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.page-exit {
  animation: pageFadeOut 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@view-transition {
  navigation: auto;
}
::view-transition-old(root) {
  animation: pageFadeOut 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
::view-transition-new(root) {
  animation: pageFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}


/* ═══════════════════════════════════════════════════════════════════════════
   24. RESPONSIVE CHROME
═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 768px) {
  .hero-wrapper {
    height: 350px;
  }
  .metrics-bar-container {
    padding: 14px 24px;
  }
  .metric-val {
    font-size: 16px;
  }
}

@media (min-width: 1024px) {
  .desktop-sidebar {
    display: flex;
    position: sticky;
    top: 0;
    left: 0;
  }
  .bottom-nav {
    display: none !important;
  }
  #page-feed {
    padding: 20px 32px 36px;
  }
  .feed-header {
    display: none;
  }
  .toast-container {
    left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width)) / 2);
    bottom: 24px;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   25. WELCOME SHEET
═══════════════════════════════════════════════════════════════════════════ */

#welcomeSignInOverlay .glass-dialog {
  transform: scale(0.95) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}
#welcomeSignInOverlay.active .glass-dialog {
  transform: scale(1) translateY(0);
}

@keyframes gentlePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

#welcomeSignInOverlay .dialog-icon-wrapper {
  animation: gentlePulse 3s ease-in-out infinite;
}

#welcomeSignInOverlay .sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: var(--theme-divider);
  margin: 0 auto 16px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   26. "MORE" CHIP
═══════════════════════════════════════════════════════════════════════════ */

.category-pill-more {
  background: rgba(255, 79, 178, 0.08);
  border-color: var(--theme-card-border-active);
  color: var(--theme-primary);
}
.category-pill-more:hover {
  background: rgba(255, 79, 178, 0.16);
  border-color: var(--theme-primary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   27. CATEGORIES SHEET
═══════════════════════════════════════════════════════════════════════════ */

.cat-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 5500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--theme-overlay);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.cat-sheet-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.cat-sheet {
  width: 100%;
  max-width: 540px;
  max-height: 78vh;
  background: var(--theme-surface);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border: 1px solid var(--theme-glass-border);
  border-bottom: none;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.5);
}
.cat-sheet-overlay.active .cat-sheet {
  transform: translateY(0);
}

.cat-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: var(--theme-divider);
  margin: 12px auto 6px;
  flex-shrink: 0;
}

.cat-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 12px;
  border-bottom: 1px solid var(--theme-divider);
  flex-shrink: 0;
}
.cat-sheet-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.cat-sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--theme-surface-card);
  border: 1px solid var(--theme-card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--theme-text-secondary);
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.cat-sheet-close:hover {
  color: var(--theme-text);
  border-color: var(--theme-card-border-active);
}
.cat-sheet-close:active {
  transform: scale(0.92);
  transition: transform 0.08s ease;
}
.cat-sheet-close svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
}

.cat-sheet-search-wrap {
  padding: 10px 16px;
  flex-shrink: 0;
}
.cat-sheet-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  background: var(--theme-surface-card);
  border: 1px solid var(--theme-card-border);
  border-radius: 12px;
  transition: border-color 0.2s ease;
}
.cat-sheet-search:focus-within {
  border-color: var(--theme-primary);
}
.cat-sheet-search svg {
  width: 15px;
  height: 15px;
  stroke: var(--theme-text-tertiary);
  fill: none;
  stroke-width: 2.2;
  flex-shrink: 0;
}
.cat-sheet-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--theme-text);
}
.cat-sheet-search input::placeholder {
  color: var(--theme-text-tertiary);
}

.cat-sheet-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 16px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--theme-glass-border) transparent;
}
.cat-sheet-list::-webkit-scrollbar {
  width: 3px;
}
.cat-sheet-list::-webkit-scrollbar-thumb {
  background: var(--theme-glass-border);
  border-radius: 3px;
}

.cat-sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--theme-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  touch-action: manipulation;
}
.cat-sheet-item:hover {
  background: var(--theme-surface-card);
  border-color: var(--theme-card-border);
}
.cat-sheet-item.active {
  background: rgba(255, 79, 178, 0.1);
  border-color: var(--theme-card-border-active);
  color: var(--theme-primary);
}
.cat-sheet-item:active {
  transform: scale(0.99);
  transition: transform 0.08s ease;
}

.cat-sheet-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.cat-sheet-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--theme-surface-card);
  border: 1px solid var(--theme-card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.cat-sheet-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cat-sheet-item-icon svg {
  width: 15px;
  height: 15px;
  stroke: var(--theme-primary);
  fill: none;
  stroke-width: 2.2;
}

.cat-sheet-item-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cat-sheet-item-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-sheet-item-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--theme-text-tertiary);
}

.cat-sheet-item-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--theme-primary);
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cat-sheet-item.active .cat-sheet-item-check {
  display: flex;
}
.cat-sheet-item-check svg {
  width: 10px;
  height: 10px;
  stroke: #fff;
  fill: none;
  stroke-width: 3.5;
}

.cat-sheet-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--theme-text-tertiary);
  font-size: 13px;
  font-weight: 500;
}


/* ═══════════════════════════════════════════════════════════════════════════
   28. RICH POST TEXT (markdown)
   Full markdown styling for .post-text. Renders every syntax that
   feed.js's renderInlineMarkdown() produces.
═══════════════════════════════════════════════════════════════════════════ */

/* ── Emphasis ── */
.post-text strong,
.post-text b {
  font-weight: 800;
  color: var(--theme-text);
  letter-spacing: -0.01em;
}
.post-text em,
.post-text i {
  font-style: italic;
  color: var(--theme-text);
}
.post-text strong em,
.post-text em strong,
.post-text b i,
.post-text i b {
  font-weight: 800;
  font-style: italic;
}

/* ── Strikethrough ── */
.post-text .post-strike,
.post-text del,
.post-text s {
  text-decoration: line-through;
  text-decoration-color: var(--theme-primary);
  text-decoration-thickness: 1.5px;
  opacity: 0.72;
}

/* ── Underline & insert ── */
.post-text u {
  text-decoration: underline;
  text-decoration-color: var(--theme-primary);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.post-text .post-ins,
.post-text ins {
  text-decoration: underline;
  text-decoration-color: #10b981;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  background: rgba(16, 185, 129, 0.08);
  padding: 0 3px;
  border-radius: 3px;
}

/* ── Highlight ── */
.post-text .post-mark,
.post-text mark {
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 55%,
    rgba(255, 79, 178, 0.35) 55%,
    rgba(255, 79, 178, 0.35) 100%
  );
  color: var(--theme-text);
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 500;
}

/* ── Inline code ── */
.post-text .post-code,
.post-text code {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.86em;
  background: var(--theme-divider);
  border: 1px solid var(--theme-card-border);
  color: var(--theme-primary);
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: -0.02em;
}
[data-theme="light"] .post-text .post-code,
[data-theme="light"] .post-text code {
  background: rgba(0, 0, 0, 0.05);
}

/* ── Code blocks ── */
.post-text .post-code-block,
.post-text pre {
  display: block;
  background: var(--theme-surface-raised);
  border: 1px solid var(--theme-card-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 8px 0;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.55;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.post-text pre code {
  background: none;
  border: none;
  color: var(--theme-text);
  padding: 0;
  font-weight: 500;
  white-space: pre;
}
[data-theme="light"] .post-text pre {
  background: #f6f7fb;
}

/* ── Links ── */
.post-text a {
  color: var(--theme-primary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
  word-break: break-word;
}
.post-text a:hover {
  border-bottom-color: var(--theme-primary);
}
.post-text a.post-link-external::after {
  content: '↗';
  font-size: 0.75em;
  margin-left: 2px;
  opacity: 0.7;
  display: inline-block;
  transform: translateY(-1px);
}
.post-text a.post-image-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--theme-primary-soft);
  border: 1px solid rgba(255, 79, 178, 0.2);
  font-weight: 700;
}
.post-text a.post-image-link:hover {
  background: rgba(255, 79, 178, 0.15);
  border-bottom-color: transparent;
}

/* ── Mentions ── */
.post-text .post-mention,
.post-text a.mention {
  display: inline-block;
  background: var(--theme-primary-soft);
  color: var(--theme-primary);
  padding: 1px 7px;
  border-radius: 8px;
  font-weight: 700;
  border-bottom: none;
  line-height: 1.5;
}
.post-text .post-mention:hover,
.post-text a.mention:hover {
  background: rgba(255, 79, 178, 0.18);
  border-bottom-color: transparent;
}

/* ── Hashtags ── */
.post-text .post-hashtag,
.post-text a.hashtag {
  display: inline-block;
  color: #4FC3F7;
  font-weight: 700;
  border-bottom: none;
  padding: 0 1px;
}
.post-text .post-hashtag:hover {
  color: #29B6F6;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Space pills ── */
.post-text .post-space-pill,
.post-text a.space-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: 8px;
  background: var(--theme-primary-soft);
  border: 1px solid rgba(255, 79, 178, 0.25);
  color: var(--theme-primary);
  font-weight: 700;
  font-size: 0.92em;
  line-height: 1.55;
  border-bottom: none;
}
.post-text .post-space-pill svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  flex-shrink: 0;
}
.post-text .post-space-pill:hover {
  background: rgba(255, 79, 178, 0.15);
}

/* ── Kbd ── */
.post-text .post-kbd,
.post-text kbd {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.8em;
  background: var(--theme-surface-raised);
  border: 1px solid var(--theme-card-border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--theme-text);
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
}

/* ── Spoilers ── */
.post-text .post-spoiler {
  background: var(--theme-text);
  color: var(--theme-text);
  border-radius: 4px;
  padding: 0 6px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  outline: none;
}
.post-text .post-spoiler.revealed,
.post-text .post-spoiler:hover,
.post-text .post-spoiler:focus-visible {
  background: rgba(255, 79, 178, 0.15);
  color: var(--theme-text);
}

/* ── Blockquotes ── */
.post-text .post-quote,
.post-text blockquote {
  border-left: 3px solid var(--theme-primary);
  padding: 4px 0 4px 12px;
  margin: 8px 0;
  color: var(--theme-text-secondary);
  font-style: italic;
  line-height: 1.6;
  background: linear-gradient(
    90deg,
    rgba(255, 79, 178, 0.05) 0%,
    transparent 40%
  );
  border-radius: 0 6px 6px 0;
}

/* ── Lists ── */
/* ── Lists ── */
.post-text .post-list,
.post-text ul,
.post-text ol {
  margin: 6px 0;
  padding-left: 22px;
  line-height: 1.6;
}

/* Explicit counter reset — survives -webkit-box on the parent */
.post-text ol {
  list-style-type: decimal;
  list-style-position: outside;
  counter-reset: post-list-counter;
}

.post-text ol > li {
  counter-increment: post-list-counter;
  list-style-type: none;
  position: relative;
}

/* Custom marker — always progressive */
.post-text ol > li::before {
  content: counter(post-list-counter) ".";
  position: absolute;
  left: -22px;
  width: 18px;
  text-align: right;
  color: var(--theme-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Kill the default marker so we don't double up */
.post-text ol > li::marker {
  content: '';
}
.post-text .post-list li,
.post-text ul li,
.post-text ol li {
  margin-bottom: 4px;
  line-height: 1.6;
}
.post-text ul li::marker {
  color: var(--theme-primary);
  font-size: 1.05em;
}
.post-text ol li::marker {
  color: var(--theme-primary);
  font-weight: 700;
}

/* ── Horizontal rule ── */
.post-text .post-divider,
.post-text hr {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--theme-divider) 20%,
    var(--theme-divider) 80%,
    transparent 100%
  );
  margin: 12px 0;
}

/* ── Callouts ── */
.post-text .post-callout {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 8px 0;
  border-left: 3px solid var(--theme-primary);
  background: var(--theme-surface-card);
  align-items: flex-start;
}
.post-text .post-callout-icon {
  font-size: 16px;
  line-height: 1.2;
  flex-shrink: 0;
  margin-top: 1px;
}
.post-text .post-callout-body {
  flex: 1;
  font-size: 0.96em;
  line-height: 1.55;
}

.post-text .post-callout-note {
  border-left-color: #4FC3F7;
  background: rgba(79, 195, 247, 0.08);
}
.post-text .post-callout-tip {
  border-left-color: #FFC107;
  background: rgba(255, 193, 7, 0.08);
}
.post-text .post-callout-warning {
  border-left-color: #FF9800;
  background: rgba(255, 152, 0, 0.10);
}
.post-text .post-callout-danger {
  border-left-color: #F44336;
  background: rgba(244, 67, 54, 0.10);
}
.post-text .post-callout-success {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.10);
}
.post-text .post-callout-info {
  border-left-color: var(--theme-primary);
  background: rgba(255, 79, 178, 0.10);
}
.post-text .post-callout-quote {
  border-left-color: var(--theme-text-tertiary);
  background: var(--theme-divider);
}

/* ── Line breaks ── */
.post-text br {
  display: block;
  content: '';
  margin-top: 2px;
}

/* ── Expanded post is more airy ── */
.post-text.is-expanded {
  line-height: 1.7;
}
.post-text.is-expanded .post-code-block,
.post-text.is-expanded pre {
  margin: 12px 0;
}
.post-text.is-expanded .post-callout {
  margin: 12px 0;
  padding: 14px;
}

/* ── Small screens: slightly tighter ── */
@media (max-width: 640px) {
  .post-text {
    font-size: 14.5px;
    line-height: 1.62;
  }
  .post-text .post-code-block,
  .post-text pre {
    font-size: 0.82em;
    padding: 10px 12px;
  }
  .post-text .post-callout {
    padding: 9px 11px;
    gap: 8px;
  }
}