:root {
  color-scheme: dark;

  --bg: #0a0b18;
  --bg-2: #0e1024;

  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-3: rgba(255, 255, 255, 0.11);
  --surface-solid: #15172e;
  --hover: rgba(255, 255, 255, 0.06);

  --field-bg: rgba(255, 255, 255, 0.04);
  --field-bg-focus: rgba(255, 255, 255, 0.06);
  --seg-bg: rgba(255, 255, 255, 0.05);

  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.17);

  --text: #eef0fc;
  --muted: #a4a9d4;
  --faint: #6f739c;

  --primary: #9a8bff;
  --primary-2: #c06bff;
  --primary-deep: #b6acff;
  --primary-weak: rgba(154, 139, 255, 0.18);
  --primary-tint: rgba(154, 139, 255, 0.13);
  --grad-primary: linear-gradient(135deg, #8b80ff 0%, #c06bff 100%);
  --accent: #ff7a9c;
  --accent-2: #ff9d6b;
  --on-primary: #ffffff;
  --danger: #ff7a7a;

  --glow-primary: 0 10px 32px -10px rgba(140, 110, 255, 0.75);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px -10px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, 0.8);
  --ring: 0 0 0 3px var(--primary-weak);

  --r-sm: 12px;
  --r: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --font: 'Inter', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  --font-display: 'Sora', 'IBM Plex Sans Arabic', var(--font);
  --maxw: 1080px;
  --rail-w: 320px;
  --bar-h: 80px;

  --ease: cubic-bezier(0.2, 0.85, 0.3, 1);
}

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

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: var(--bg);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(48% 38% at 82% -4%, rgba(192, 107, 255, 0.28), transparent 70%),
    radial-gradient(46% 40% at 8% 4%, rgba(94, 209, 181, 0.18), transparent 68%),
    radial-gradient(60% 50% at 50% 108%, rgba(255, 122, 156, 0.16), transparent 72%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}

#root {
  min-height: 100dvh;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--primary-deep);
  text-decoration: none;
}

input,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  width: 100%;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:focus,
textarea:focus {
  background: var(--field-bg-focus);
  border-color: var(--primary);
  box-shadow: var(--ring);
}

textarea {
  resize: vertical;
  min-height: 156px;
  line-height: 1.7;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

:focus:not(:focus-visible) {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

.ms {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  direction: ltr;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  user-select: none;
}

.bar {
  position: sticky;
  top: 0;
  z-index: 30;

  /* Always a subtle glass bar so it reads as a defined navbar even at the top;
     the scrolled state just deepens it (smooth refinement, not an on/off jump). */
  background: color-mix(in srgb, var(--surface-solid) 60%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.bar.is-scrolled {
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
  border-bottom-color: var(--border-strong);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

/* When the drawer is open, lift the whole bar above the backdrop so the drawer
   (nested inside .bar) paints over it instead of being dimmed by it. */
.bar.nav-open { z-index: 90; }

.bar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: var(--bar-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}

/* Hamburger toggle: hidden on desktop, shown on mobile (see media query). */
.bar .nav-toggle { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  flex-shrink: 0;
}

/* Page links inside the bar menu. */
.bar-link {
  padding: 8px 13px;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.18s, background 0.18s;
}

.bar-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--on-primary);
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(154, 139, 255, 0.3), 0 2px 10px rgba(154, 139, 255, 0.25);
}

.mark .ms {
  font-size: 20px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
}

.bar-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
  flex-shrink: 0;
}

.bar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Drawer header (close button) — only shown inside the mobile drawer. */
.bar-menu-head { display: none; }

/* Dimmed backdrop behind the mobile drawer. */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(6, 7, 18, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.26s var(--ease), visibility 0.26s;
}
.nav-backdrop[hidden] { display: block; }
.nav-backdrop.is-open { opacity: 1; visibility: visible; }
body.nav-lock { overflow: hidden; }

/* Safety: never leave the drawer/backdrop/lock active on desktop (e.g. resize). */
@media (min-width: 720px) {
  .nav-backdrop { display: none !important; }
  body.nav-lock { overflow: visible !important; }
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 3px;
  gap: 2px;
}

.lang-toggle a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transition: color 0.18s, background 0.2s, box-shadow 0.2s;
}

.lang-toggle a:hover {
  color: var(--text);
  text-decoration: none;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  color: var(--muted);
  transition: background 0.18s, color 0.18s;
  flex-shrink: 0;
}

.icon-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn:disabled {
  color: var(--faint);
  cursor: default;
}

/* Navbar controls: give the theme + hamburger buttons the same bordered-pill
   look as the language toggle and match its height, so they feel unified. */
.bar-menu .icon-btn,
.bar .nav-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}
.bar-menu .icon-btn:hover:not(:disabled),
.bar .nav-toggle:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: var(--text);
}

.page {
  flex: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  padding: 22px 18px 48px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'composer'
    'filters'
    'feed';
  gap: 24px;
  align-items: start;
}

.composer {
  grid-area: composer;
  min-width: 0;
}

.filters {
  grid-area: filters;
}

.feed {
  grid-area: feed;
  min-width: 0;
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    grid-template-areas:
      'filters composer'
      'filters feed';
    gap: 40px;
  }

  .filters {
    position: sticky;
    top: calc(var(--bar-h) + 28px);
    align-self: start;
  }
}

/* ---------------------------------------------------------------------------
   Call-to-action (CTA) — one unified button/link used across every page:
   the composer, the contact form, the "start venting" sections on the
   doc/help/contact pages, the post-detail footer, and the 403/404/500 pages.
   The visual design (gradient pill, lift-on-hover, 20px leading icon) is
   defined once here and never varies; individual placements only adjust
   layout — full-width by default, or content-width via .cta-inline. Works
   identically for <button> and <a>.
--------------------------------------------------------------------------- */
.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 14px 28px;
  border-radius: var(--r-pill);
  background: var(--grad-primary);
  color: var(--on-primary);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: var(--glow-primary);
  transition: transform 0.14s, box-shadow 0.18s;
}

.cta .ms {
  font-size: 20px;
}

/* Keep anchor CTAs white and underline-free even inside prose (.wrap a { … }). */
a.cta:link,
a.cta:visited {
  color: var(--on-primary);
  text-decoration: none;
}

.cta:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px -10px rgba(140, 110, 255, 0.95);
  color: var(--on-primary);
  text-decoration: none;
}

.cta:active {
  transform: translateY(0);
}

.cta:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

/* Layout modifier: hug the content instead of filling the row. */
.cta-inline {
  width: auto;
}

.filters {
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.filter-groups {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.filters-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 700;
}

.filters-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.filters-toggle-label .ms {
  font-size: 20px;
  color: var(--primary-deep);
}

.filters-toggle-chevron {
  color: var(--muted);
  font-size: 22px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.sorts {
  display: flex;
  width: 100%;
  gap: 4px;
  padding: 4px;
  background: var(--seg-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
}

.sort {
  flex: 1 1 0;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.sort:hover {
  color: var(--text);
}

.sort.active {
  background: var(--grad-primary);
  color: var(--on-primary);
  box-shadow: 0 6px 18px -6px rgba(140, 110, 255, 0.8);
}

.moods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 959px) {
  .filters-toggle {
    display: flex;
  }

  .filter-groups {
    display: none;
  }

  .filters.is-open .filter-groups {
    display: flex;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }

  .moods {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px;
    margin: 0 -2px;
  }

  .moods::-webkit-scrollbar {
    display: none;
  }
}

.mood-chip {
  --mood-color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.18s, color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.12s;
}

.mood-chip-icon {
  font-size: 17px;
  color: var(--mood-color);
}

.mood-chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.mood-chip.active {
  background: color-mix(in srgb, var(--mood-color) 20%, transparent);
  border-color: color-mix(in srgb, var(--mood-color) 55%, transparent);
  color: #fff;
  box-shadow: 0 6px 20px -8px color-mix(in srgb, var(--mood-color) 90%, transparent);
}

.mood-chip.active .mood-chip-icon {
  color: color-mix(in srgb, var(--mood-color) 70%, #fff);
}

.feed {
  display: block;
}

.board {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.board-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.board-col-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 4px;
}

.board-col-head::before,
.board-col-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.board-day {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 5px 16px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.board-col-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.board-col {
  scroll-margin-top: 150px;
}

.composer {
  position: relative;
  overflow: hidden;
  padding: 20px 22px 18px;
  border-radius: var(--r-lg);
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s, box-shadow 0.2s;
  scroll-margin-top: 90px;
}

.composer:not(.is-open) {
  box-shadow: var(--shadow-sm);
  padding: 0;
}

.composer-prompt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  text-align: start;
  padding: 20px 22px;
  cursor: pointer;
}

.composer-prompt-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.composer-prompt .composer-title {
  margin-bottom: 0;
}

.composer-prompt-sub {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.composer-prompt-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  background: var(--grad-primary);
  color: var(--on-primary);
  box-shadow: var(--glow-primary);
  transition: transform 0.16s;
}

.composer-prompt-icon .ms {
  font-size: 23px;
}

.composer:not(.is-open):hover .composer-prompt-icon {
  transform: translateY(-2px) scale(1.04);
}

.composer-rest {
  animation: slide-down 0.26s var(--ease);
}

.composer::before {
  content: '';
  position: absolute;
  top: -80px;
  inset-inline-end: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(192, 107, 255, 0.3), transparent 65%);
  filter: blur(28px);
  pointer-events: none;
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
}

.composer-title {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  margin-bottom: 14px;
}

.composer-foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.day-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.day-btn {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.18s, border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.day-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-3);
}

.day-btn.active {
  background: var(--grad-primary);
  border-color: transparent;
  color: var(--on-primary);
  box-shadow: 0 6px 18px -6px rgba(140, 110, 255, 0.8);
}

.load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  min-width: 180px;
  margin: 30px auto 0;
  padding: 12px 26px;
  border-radius: var(--r-pill);
  background: var(--primary-weak);
  border: 1px solid transparent;
  color: var(--primary-deep);
  font-size: 14px;
  font-weight: 700;
  transition: filter 0.18s, transform 0.14s, opacity 0.18s;
}

.load-more .ms {
  font-size: 19px;
}

.load-more:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.load-more.is-loading { opacity: 0.6; pointer-events: none; }

.load-more:disabled {
  opacity: 0.6;
  cursor: default;
}

.status {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  padding: 60px 16px;
}

.site-foot {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

.foot-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}

.foot-top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px 24px;
  text-align: start;
  padding: 48px 24px 36px;
}

.foot-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.foot-mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--primary);
  color: var(--on-primary);
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(154, 139, 255, 0.25), 0 4px 14px rgba(154, 139, 255, 0.2);
}

.foot-mark .ms {
  font-size: 32px;
}

/* brand name + tagline stacked beside the logo */
.foot-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.foot-word {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
}

.foot-tagline {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 360px;
  margin: 0;
}

.foot-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.foot-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}

.foot-nav a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  transition: color 0.18s, background 0.18s;
}

.foot-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.foot-copy {
  margin-inline-start: auto;
  color: var(--faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .foot-top {
    padding: 36px 20px 28px;
    gap: 18px;
    align-items: flex-start;
  }

  .foot-bottom {
    padding: 14px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
    flex-direction: column;
    align-items: center;
  }

  .foot-nav {
    justify-content: center;
  }

  .foot-copy {
    margin-inline-start: 0;
    width: 100%;
    text-align: center;
  }
}

.post-card {
  --mood-color: var(--primary);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 24px 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: rise 0.4s var(--ease) backwards;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.post-top {
  display: flex;
  align-items: center;
  gap: 13px;
}

.post-top-end {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  user-select: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 0 12px rgba(255, 255, 255, 0.06);
}

.avatar-anon {
  background: var(--surface-3);
  color: var(--muted);
}

.avatar .ms {
  font-size: 23px;
}

.post-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.post-name {
  font-size: 14.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-time {
  font-size: 12.5px;
  color: var(--faint);
  white-space: nowrap;
}

.mood-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--mood-color) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--mood-color) 40%, transparent);
  color: color-mix(in srgb, var(--mood-color) 60%, #fff);
  white-space: nowrap;
  flex-shrink: 0;
}

.mood-tag-icon {
  font-size: 17px;
  color: var(--mood-color);
}

.post-card .icon-btn {
  width: 36px;
  height: 36px;
  color: var(--faint);
}

.post-card .icon-btn .ms {
  font-size: 18px;
}

.post-card .icon-btn:hover:not(:disabled) {
  color: var(--danger);
  background: rgba(255, 122, 122, 0.13);
}

.post-text {
  margin: 16px 0 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.74;
  color: var(--text);
}
/* On the feed the text is a link to the post page; keep it looking like text. */
a.post-text-link { display: block; text-decoration: none; color: var(--text); }
a.post-text-link:hover { color: var(--text); text-decoration: none; }

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  margin: 2px 0 14px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--primary-deep);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
}

.read-more:hover {
  text-decoration: underline;
}

/* Truncated feed text: show the 200-char clip until the card is expanded. */
.pt-full { display: none; }
.post-card.is-expanded .pt-short { display: none; }
.post-card.is-expanded .pt-full { display: inline; }
.read-more .rm-less { display: none; }
.post-card.is-expanded .read-more .rm-more { display: none; }
.post-card.is-expanded .read-more .rm-less { display: inline; }

.post-datetime {
  display: block;
  margin: 0 0 14px;
  text-align: end;
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.post-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.react-pills {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.react-pills::-webkit-scrollbar {
  display: none;
}

.pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border-radius: var(--r-pill);
  color: var(--faint);
  font-size: 12.5px;
  font-weight: 700;
  transition: color 0.18s, background 0.18s, transform 0.12s, box-shadow 0.18s;
}

.pill .ms {
  font-size: 19px;
}

.pill.has-count {
  color: var(--muted);
}

.pill:hover:not(:disabled) {
  background: var(--primary-weak);
  color: var(--primary-deep);
  transform: translateY(-1px);
}

.pill.active {
  background: var(--primary-weak);
  color: var(--primary-deep);
  box-shadow: inset 0 0 0 1px var(--primary-weak), 0 4px 14px -6px rgba(140, 110, 255, 0.8);
  cursor: pointer;
}

.react-pills.locked .pill:not(.active) {
  opacity: 0.38;
  cursor: default;
}

.pill:disabled {
  cursor: default;
}

.pill-count {
  font-variant-numeric: tabular-nums;
}

.post-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.act-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--faint);
  transition: background 0.18s, color 0.18s;
}

.act-btn .ms {
  font-size: 19px;
}

.act-btn:hover:not(:disabled) {
  background: var(--primary-weak);
  color: var(--primary-deep);
}

.act-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.field {
  display: block;
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 9px;
}

.mood-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.char-count {
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (min-width: 640px) {
  body {
    font-size: 15.5px;
  }
}

@media (max-width: 719px) {
  /* Solid bar on mobile: a translucent backdrop-filter bar bleeds content
     through (looks unclear) and judders against sticky on many phones. */
  .bar,
  .bar.is-scrolled {
    background: var(--surface-solid);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .bar-inner {
    height: var(--bar-h);
    padding: 0 16px;
    gap: 10px;
  }

  /* Everything (links, language, theme) collapses into a full-height side
     drawer that slides in from the inline-end edge. */
  .bar .nav-toggle { display: grid; }
  .nav-toggle { margin-inline-start: auto; }

  .bar-menu {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-end: 0;
    width: min(84vw, 300px);
    height: 100dvh;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 14px 14px calc(20px + env(safe-area-inset-bottom, 0px));
    background: var(--surface-solid);
    border-inline-start: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.28s var(--ease);
    z-index: 80;
  }
  html[dir='rtl'] .bar-menu { transform: translateX(-100%); }
  .bar.nav-open .bar-menu { transform: translateX(0); }

  .bar-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
  }
  .bar-menu-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--muted);
    padding-inline-start: 4px;
  }

  .bar-link {
    padding: 13px 14px;
    font-size: 15px;
    border-radius: var(--r-sm);
  }

  /* Language + theme pinned to the bottom of the drawer, above a divider. */
  .bar-controls {
    width: 100%;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
  }

  .icon-btn {
    width: 40px;
    height: 40px;
  }

  .mark {
    width: 35px;
    height: 35px;
  }

  .mark .ms {
    font-size: 20px;
  }

  .wordmark {
    font-size: 19px;
  }

  .page {
    padding: 16px 14px 32px;
  }

  .layout {
    gap: 18px;
  }

  .filters {
    padding: 16px;
  }

  .composer {
    padding: 16px 16px 14px;
  }

  .post-card {
    padding: 18px 16px 14px;
    border-radius: var(--r);
  }

  .post-text {
    font-size: 15.5px;
  }

  .board {
    gap: 28px;
  }
}

@media (max-width: 400px) {
  .bar-inner {
    gap: 6px;
    padding: 0 12px;
  }

  .lang-toggle {
    padding: 2px;
    gap: 1px;
  }

  .lang-toggle a {
    padding: 4px 8px;
    font-size: 11px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .wordmark {
    font-size: 17px;
  }

  .post-card {
    padding: 16px 14px 12px;
  }

  .avatar {
    width: 42px;
    height: 42px;
  }
}

[data-theme='light'] {
  color-scheme: light;

  --bg: #f4f3fb;
  --bg-2: #ffffff;

  --surface: rgba(255, 255, 255, 0.72);
  --surface-2: rgba(22, 19, 48, 0.05);
  --surface-3: rgba(22, 19, 48, 0.09);
  --surface-solid: #ffffff;
  --hover: rgba(22, 19, 48, 0.05);

  --field-bg: rgba(22, 19, 48, 0.04);
  --field-bg-focus: #ffffff;
  --seg-bg: rgba(22, 19, 48, 0.05);

  --border: rgba(22, 19, 48, 0.1);
  --border-strong: rgba(22, 19, 48, 0.2);

  --text: #1b1830;
  --muted: #5c5874;
  --faint: #8d8aa6;

  --primary-deep: #6a4de6;
  --primary-weak: rgba(124, 92, 246, 0.14);
  --primary-tint: rgba(124, 92, 246, 0.1);

  --glow-primary: 0 10px 28px -12px rgba(124, 92, 246, 0.5);
  --shadow-sm: 0 1px 2px rgba(22, 19, 48, 0.06);
  --shadow-md: 0 12px 30px -14px rgba(22, 19, 48, 0.22);
  --shadow-lg: 0 30px 70px -28px rgba(22, 19, 48, 0.3);
  --ring: 0 0 0 3px var(--primary-weak);
}

[data-theme='light'] body::before {
  background:
    radial-gradient(48% 38% at 82% -4%, rgba(168, 130, 255, 0.22), transparent 70%),
    radial-gradient(46% 40% at 8% 4%, rgba(94, 209, 181, 0.14), transparent 68%),
    radial-gradient(60% 50% at 50% 108%, rgba(255, 122, 156, 0.12), transparent 72%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}

[data-theme='light'] .mood-tag {
  color: color-mix(in srgb, var(--mood-color) 58%, #1b1830);
  background: color-mix(in srgb, var(--mood-color) 16%, transparent);
  border-color: color-mix(in srgb, var(--mood-color) 45%, transparent);
}

[data-theme='light'] .mood-chip.active {
  color: color-mix(in srgb, var(--mood-color) 42%, #1b1830);
}

[data-theme='light'] .mood-chip.active .mood-chip-icon {
  color: color-mix(in srgb, var(--mood-color) 70%, #1b1830);
}

html[data-lang='ar'] .lang-toggle [data-lang-set='ar'],
html[data-lang='en'] .lang-toggle [data-lang-set='en'] {
  color: var(--on-primary);
  background: var(--primary);
  box-shadow: var(--shadow-sm);
}

.wrap { flex: 1; max-width: 760px; margin: 0 auto; padding: 28px 20px 48px; width: 100%; }
.wrap h1 { font-family: var(--font-display); font-size: clamp(24px, 4vw, 30px); line-height: 1.2; margin: 8px 0 6px; letter-spacing: 0; }
.contact-page .lead { margin-bottom: 4px; }
.contact-form { max-width: 540px; margin: 22px auto 0; }
.contact-form .cta { width: fit-content; margin: 12px auto 0; }
.wrap h2 { font-size: 19px; margin: 30px 0 8px; }
.wrap p, .wrap li { color: var(--text); line-height: 1.85; }
.wrap .muted { color: var(--muted); font-size: 14px; }
.wrap ul { padding-inline-start: 22px; }
.wrap li { margin: 4px 0; }
.wrap a { color: var(--primary-deep); }
.wrap a:hover { text-decoration: underline; }
.note {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 18px; margin: 18px 0;
}

/* End-of-page call-to-action — one unified "start venting" panel shared by the
   about/privacy/terms/cookies/help pages and the contact page. A bordered,
   softly tinted card: the message sits at the inline-start and the CTA button
   at the inline-end, and the two stack on narrow screens. Layout follows the
   article's direction (RTL/LTR) automatically via flexbox. */
.doc-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding: 22px 26px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background:
    linear-gradient(135deg, var(--primary-tint), transparent 62%),
    var(--surface);
}

.doc-cta-copy {
  flex: 1 1 300px;
  min-width: 0;
}

.doc-cta-kicker {
  color: var(--primary-deep) !important;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.doc-cta-title {
  color: var(--text) !important;
  font-family: var(--font-display);
  font-size: clamp(20px, 3.4vw, 25px);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 6px;
}

.doc-cta p:not(.doc-cta-kicker):not(.doc-cta-title) {
  color: var(--muted);
  margin: 0;
  max-width: 58ch;
}

/* Layout only — the unified .cta rules above own the button's design. */
.doc-cta .doc-cta-link {
  flex: 0 0 auto;
  width: auto;
}

/* Unified header for the footer content pages (about/privacy/terms/cookies/help).
   Title sits at the inline start, the muted "last updated" date at the opposite
   end — left/right automatically follow the page direction (RTL vs LTR). */
.doc-head {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 20px;
  margin: 0 0 26px; padding-bottom: 18px; border-bottom: 1px solid var(--border);
}
.doc-head h1 { margin: 0; }
.doc-updated {
  margin: 0; margin-inline-start: auto;       /* push to the opposite side */
  color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.doc-updated time { color: inherit; }

.post-page { max-width: 600px; margin: 0 auto; width: 100%; }
.pv-head { text-align: center; margin: 4px 0 22px; }
.pv-head h1 { font-family: var(--font-display); font-size: clamp(20px, 3.4vw, 26px); margin: 0 0 4px; letter-spacing: 0; }
.pv-head p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* Under the detail card: CTA in one corner, the tagline in the opposite one. */
.pv-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px 18px; flex-wrap: wrap; margin-top: 20px;
}
.pv-note { color: var(--muted); font-size: 14px; margin: 0; }

.pv-missing { text-align: center; padding: 40px 0; max-width: 600px; margin: 0 auto; }
.pv-missing > .ms { font-size: 52px; color: var(--faint); }
.pv-missing .cta { margin-top: 18px; }

/* Flash/toast messages: stacked at the top of the page, closeable. */
.flash-stack {
  position: fixed; top: calc(var(--bar-h) + 12px); inset-inline: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 0 16px; pointer-events: none;
}
.flash {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  max-width: min(440px, 100%); background: var(--surface-solid);
  border: 1px solid var(--border-strong); color: var(--text);
  font-size: 14px; font-weight: 600;
  padding-block: 12px; padding-inline: 20px 12px; border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(140, 110, 255, 0.2);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: toast-in 0.28s var(--ease); transition: opacity 0.25s var(--ease);
}
.flash.flash-error { box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 122, 122, 0.35); }
.flash-text { flex: 1; min-width: 0; }
.flash-close {
  flex-shrink: 0; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 19px; line-height: 1; color: var(--muted);
  background: none; border: none; cursor: pointer;
  transition: color 0.18s, background 0.18s;
}
.flash-close:hover { color: var(--text); background: var(--surface-2); }

.pv-toast {
  position: fixed; left: 50%; top: calc(var(--bar-h) + 12px); bottom: auto;
  transform: translateX(-50%) translateY(-20px);
  background: var(--surface-solid); color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 11px 18px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; z-index: 50;
  transition: opacity 0.2s, transform 0.2s;
}
.pv-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

a.sort, a.day-btn, a.mood-chip { text-decoration: none; }
.sort, .day-btn { display: inline-flex; align-items: center; justify-content: center; }
.mood-chip { cursor: pointer; }

.composer .mood-chip:has(input:checked) {
  background: color-mix(in srgb, var(--mood-color) 20%, transparent);
  border-color: color-mix(in srgb, var(--mood-color) 55%, transparent);
  color: #fff;
  box-shadow: 0 6px 20px -8px color-mix(in srgb, var(--mood-color) 90%, transparent);
}
.composer .mood-chip:has(input:checked) .mood-chip-icon {
  color: color-mix(in srgb, var(--mood-color) 70%, #fff);
}
[data-theme='light'] .composer .mood-chip:has(input:checked) {
  color: color-mix(in srgb, var(--mood-color) 42%, #1b1830);
}

.composer .composer-form { display: none; }
.composer.is-open .composer-form { display: block; }
.composer.is-open .composer-prompt { display: none; }

.wrap h3 { font-size: 16px; margin: 20px 0 6px; }
.wrap .lead { color: var(--muted); font-size: 14.5px; margin: 6px 0 8px; }
.wrap ol { padding-inline-start: 22px; }
.wrap ol > li { margin: 6px 0; }

.foot-link-btn {
  color: var(--muted); font-size: 13px; font-weight: 500;
  padding: 5px 10px; border-radius: var(--r-sm);
  background: none; border: none; cursor: pointer;
  font-family: inherit; transition: color 0.18s, background 0.18s;
}
.foot-link-btn:hover { color: var(--text); background: var(--surface-2); }

.cookie-banner {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 70;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -8px 30px -12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: toast-in 0.3s var(--ease);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.cookie-text { color: var(--muted); font-size: 13.5px; line-height: 1.6; flex: 1; min-width: 240px; }
.cookie-text a { color: var(--primary-deep); font-weight: 600; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-btn {
  padding: 10px 22px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 700;
  cursor: pointer; border: 1px solid transparent; transition: filter 0.18s, background 0.18s, color 0.18s;
}
.cookie-accept { background: var(--grad-primary); color: var(--on-primary); box-shadow: var(--glow-primary); }
.cookie-accept:hover { filter: brightness(1.06); }
.cookie-decline { background: var(--surface-2); border-color: var(--border); color: var(--muted); }
.cookie-decline:hover { color: var(--text); border-color: var(--border-strong); }

@media (max-width: 600px) {
  .cookie-banner-inner { justify-content: stretch; }
  .cookie-actions { width: 100%; }
  .cookie-btn { flex: 1; }
}

.report-modal {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(5, 6, 16, 0.62);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fade-in 0.18s var(--ease);
}
.report-modal[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } }
.report-card {
  width: 100%; max-width: 360px;
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); padding: 22px;
  box-shadow: var(--shadow-lg); animation: toast-in 0.24s var(--ease);
}
.report-title {
  font-family: var(--font-display); font-size: 17px; font-weight: 700;
  margin: 0 0 14px; color: var(--text);
}
.report-reasons { display: flex; flex-direction: column; gap: 8px; }
.report-reason {
  text-align: start; padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}
.report-reason:hover {
  background: var(--primary-weak); border-color: transparent; color: var(--primary-deep);
}
.report-cancel {
  width: 100%; margin-top: 14px; padding: 11px; border-radius: var(--r-pill);
  background: none; border: 1px solid var(--border); color: var(--muted);
  font-size: 13.5px; font-weight: 700; cursor: pointer;
  transition: color 0.16s, border-color 0.16s;
}
.report-cancel:hover { color: var(--text); border-color: var(--border-strong); }

.hp-field {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.foot-social {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.foot-social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: color 0.18s, background 0.18s, border-color 0.18s, transform 0.14s;
}
.foot-social a:hover {
  color: var(--text);
  background: var(--surface-3);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.foot-social svg { width: 18px; height: 18px; }
.foot-social .ms { font-size: 20px; line-height: 1; }
