/* ==========================================================================
   DocumentYourMiracle.com — design system
   Mobile-first. One layer, no stacked overrides.
   Previous stylesheet is kept in _backup_before_redesign/styles.css
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #fbf8f2;
  --bg-glow-1: rgba(244, 196, 88, 0.22);
  --bg-glow-2: rgba(120, 156, 230, 0.16);
  --surface: #ffffff;
  --surface-2: #f7f3eb;
  --surface-3: #f1ebdf;

  /* Ink */
  --ink: #14213d;
  --ink-2: #3b4763;
  --muted: #7b8498;
  --line: #ece5d8;
  --line-strong: #ddd3c2;

  /* Brand */
  --navy: #0f2453;
  --navy-2: #1d3d80;
  --navy-3: #2c58b0;
  --gold: #e3a62c;
  --gold-2: #f6cb63;
  --gold-soft: #fdf3d9;
  --gold-ink: #8a5a00;

  /* Reactions */
  --amen: #7a5af8;
  --praise: #e3a62c;
  --love: #e5486c;
  --pray: #1f9d8a;

  --glory: linear-gradient(135deg, #f8d27a 0%, #e9a93a 55%, #d98a1e 100%);
  --heaven: linear-gradient(140deg, #0c1d46 0%, #18397d 55%, #2c58b0 100%);

  /* Shape & depth */
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(20, 33, 61, 0.06);
  --shadow-sm: 0 1px 3px rgba(20, 33, 61, 0.06), 0 6px 18px rgba(20, 33, 61, 0.05);
  --shadow: 0 2px 6px rgba(20, 33, 61, 0.05), 0 16px 40px rgba(20, 33, 61, 0.08);
  --shadow-lg: 0 30px 80px rgba(12, 24, 54, 0.22);
  --ring: 0 0 0 3px rgba(227, 166, 44, 0.35);

  /* Type */
  --font-ui: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;

  /* Layout */
  --topbar-h: 64px;
  --bottom-nav-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --gutter: 16px;
}

/* ---------- Base ---------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 12px);
}

body {
  background:
    radial-gradient(60rem 40rem at -10% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(50rem 36rem at 110% -5%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

svg {
  fill: none;
  flex: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

:focus-visible {
  border-radius: 10px;
  box-shadow: var(--ring);
  outline: none;
}

[hidden],
.is-hidden {
  display: none !important;
}

.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

::selection {
  background: var(--gold-2);
  color: var(--ink);
}

/* Shared form controls */
input[type="text"],
input[type="search"],
input[type="tel"],
input[type="email"],
input[type="password"],
select,
textarea {
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 16px; /* prevents iOS zoom on focus */
  min-height: 46px;
  padding: 0.7rem 0.9rem;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  width: 100%;
}

textarea {
  line-height: 1.5;
  resize: vertical;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8498' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 0.8rem center;
  background-repeat: no-repeat;
  background-size: 18px;
  padding-right: 2.4rem;
}

input::placeholder,
textarea::placeholder {
  color: #9aa1b2;
}

input:focus,
select:focus,
textarea:focus {
  background-color: var(--surface);
  border-color: var(--gold);
  box-shadow: var(--ring);
  outline: none;
}

/* ---------- Buttons ------------------------------------------------------- */

.primary-action,
.secondary-action,
.danger-action,
.composer-inline-submit {
  align-items: center;
  border: 0;
  border-radius: var(--radius-pill);
  display: inline-flex;
  font-weight: 700;
  gap: 0.5rem;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, filter 0.2s;
  white-space: nowrap;
}

.primary-action {
  background: var(--glory);
  box-shadow: 0 8px 22px rgba(217, 138, 30, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  color: #2a1a00;
}

.primary-action svg {
  height: 18px;
  stroke-width: 2.6;
  width: 18px;
}

.primary-action:hover:not(:disabled) {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.primary-action:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.secondary-action {
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
}

.secondary-action:hover {
  background: var(--surface-2);
}

.danger-action {
  background: #fde8ec;
  color: #b4233f;
}

.danger-action:hover {
  background: #fbd3db;
}

.text-button {
  background: none;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--navy-2);
  font-weight: 700;
  padding: 0.45rem 0.8rem;
}

.text-button:hover {
  background: var(--surface-2);
}

.icon-button {
  align-items: center;
  background: var(--surface-2);
  border: 0;
  border-radius: 50%;
  color: var(--ink-2);
  display: inline-flex;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.icon-button svg {
  height: 20px;
  width: 20px;
}

.icon-button:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.eyebrow {
  align-items: center;
  color: var(--gold-ink);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  gap: 0.45rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- Top bar ------------------------------------------------------- */

.app-shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  background: rgba(251, 248, 242, 0.82);
  border-bottom: 1px solid rgba(221, 211, 194, 0.6);
  display: flex;
  gap: 0.75rem;
  height: var(--topbar-h);
  justify-content: space-between;
  padding: 0 var(--gutter);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand {
  align-items: center;
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
}

.brand-logo {
  height: 46px;
  max-width: min(220px, 52vw);
  object-fit: contain;
  object-position: left center;
}

.brand-mark {
  display: none;
}

.topnav {
  display: none;
}

.auth-actions {
  align-items: center;
  display: flex;
  gap: 0.4rem;
}

.notification-button,
.logout-action {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
  color: var(--ink-2);
  display: inline-flex;
  height: 40px;
  justify-content: center;
  position: relative;
  width: 40px;
}

.notification-button svg,
.logout-action svg {
  height: 19px;
  width: 19px;
}

.notification-button:hover,
.logout-action:hover {
  color: var(--ink);
}

.notification-count,
.message-count {
  align-items: center;
  background: var(--love);
  border: 2px solid var(--bg);
  border-radius: var(--radius-pill);
  color: #fff;
  display: inline-flex;
  font-size: 0.65rem;
  font-weight: 800;
  height: 19px;
  justify-content: center;
  min-width: 19px;
  padding: 0 4px;
  position: absolute;
  right: -4px;
  top: -4px;
}

.account-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  display: inline-flex;
  gap: 0.55rem;
  padding: 3px;
  text-align: left;
}

.account-button > span:last-child {
  display: none;
}

.account-icon {
  align-items: center;
  background: var(--heaven);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  overflow: hidden;
  width: 34px;
}

.account-icon svg {
  height: 18px;
  width: 18px;
}

.account-icon img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.account-button small {
  color: var(--muted);
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.1;
}

.account-button strong {
  display: block;
  font-size: 0.86rem;
  line-height: 1.2;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Layout -------------------------------------------------------- */

.layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  margin: 0 auto;
  max-width: 1240px;
  padding: 0.75rem var(--gutter) calc(var(--bottom-nav-h) + var(--safe-bottom) + 1.5rem);
}

.feed-column {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.right-rail {
  display: none;
}

/* Topics — horizontal chips on phones, sidebar on desktop */
.left-rail {
  margin: 0 calc(var(--gutter) * -1);
  min-width: 0;
  order: -1;
}

.rail-header {
  display: none;
}

.topic-list {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0.15rem var(--gutter) 0.35rem;
  scroll-padding-inline: var(--gutter);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.topic-list::-webkit-scrollbar {
  display: none;
}

.topic {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  color: var(--ink-2);
  flex: none;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  scroll-snap-align: start;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.topic:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.topic.is-active {
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 6px 16px rgba(15, 36, 83, 0.25);
  color: #fff;
}

/* ---------- Feed hero ----------------------------------------------------- */

.feed-intro {
  background:
    radial-gradient(22rem 16rem at 100% 0%, rgba(246, 203, 99, 0.45), transparent 65%),
    radial-gradient(18rem 14rem at 0% 120%, rgba(108, 150, 255, 0.35), transparent 70%),
    var(--heaven);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(15, 36, 83, 0.25);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  isolation: isolate;
  overflow: hidden;
  padding: 1.4rem 1.25rem 1.25rem;
  position: relative;
}

/* Soft light rays */
.feed-intro::before {
  background: repeating-conic-gradient(from 200deg at 92% -10%, rgba(255, 236, 180, 0.12) 0deg 6deg, transparent 6deg 16deg);
  content: "";
  inset: 0;
  mask-image: radial-gradient(circle at 92% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 92% 0%, #000 0%, transparent 70%);
  position: absolute;
  z-index: -1;
}

.feed-intro .eyebrow {
  color: var(--gold-2);
}

.eyebrow-dot {
  animation: pulse 2.4s ease-in-out infinite;
  background: var(--gold-2);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(246, 203, 99, 0.6);
  height: 7px;
  width: 7px;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(246, 203, 99, 0.6);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(246, 203, 99, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(246, 203, 99, 0);
  }
}

.feed-intro h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 7.2vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-top: 0.55rem;
  max-width: 16ch;
}

.feed-intro-verse {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 0.7rem;
  max-width: 40ch;
}

.feed-intro-verse span {
  color: var(--gold-2);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
  margin-left: 0.25rem;
  white-space: nowrap;
}

.feed-intro .primary-action {
  align-self: stretch;
}

/* "What has God done for you?" prompt */
.composer-prompt {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 0.7rem;
  padding: 0.45rem 0.5rem 0.45rem 0.45rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.composer-prompt:hover {
  box-shadow: var(--shadow);
}

.composer-prompt-avatar {
  align-items: center;
  background: var(--glory);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.composer-prompt-avatar svg {
  height: 20px;
  stroke-width: 2.2;
  width: 20px;
}

.composer-prompt-field {
  color: var(--muted);
  flex: 1;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-prompt-icon {
  align-items: center;
  background: var(--surface-2);
  border-radius: 50%;
  color: var(--pray);
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.composer-prompt-icon svg {
  height: 19px;
  width: 19px;
}

/* Hide the prompt once the full composer is open */
.feed-column:has(.share-box:not([hidden])) .composer-prompt {
  display: none;
}

/* ---------- Composer ------------------------------------------------------ */

.share-box {
  animation: rise 0.28s ease-out;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.composer-topline {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

.composer-avatar {
  align-items: center;
  background: var(--heaven);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: none;
  font-size: 0.85rem;
  font-weight: 800;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.composer-topline h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
}

.login-hint {
  color: var(--muted);
  font-size: 0.84rem;
}

.composer-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.share-box #miracleTitle {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.share-box #miracleText {
  min-height: 140px;
  resize: none;
}

.composer-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.evidence-attach {
  align-items: center;
  background: #e7f6f3;
  border-radius: var(--radius-pill);
  color: #127a6b;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 700;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
}

.evidence-attach:hover {
  background: #d6f0eb;
}

.evidence-attach input {
  display: none;
}

.evidence-attach svg {
  height: 17px;
  width: 17px;
}

.composer-topic-chips {
  display: flex;
  flex-basis: 100%;
  gap: 0.4rem;
  margin: 0 -1rem;
  order: -1;
  overflow-x: auto;
  padding: 0.1rem 1rem 0.2rem;
  scrollbar-width: none;
}

.composer-topic-chips::-webkit-scrollbar {
  display: none;
}

.composer-topic-chip {
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  flex: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.38rem 0.8rem;
}

.composer-topic-chip:hover {
  border-color: var(--line-strong);
}

.composer-topic-chip.is-active {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-ink);
}

.anonymous-toggle {
  align-items: center;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 700;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem 0.45rem 0.55rem;
}

.anonymous-toggle input {
  accent-color: var(--navy);
  height: 17px;
  margin: 0;
  width: 17px;
}

.selected-evidences {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.selected-evidences:empty {
  display: none;
}

.selected-evidence {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  object-fit: cover;
  width: 64px;
}

.composer-inline-submit {
  background: var(--navy);
  box-shadow: 0 8px 18px rgba(15, 36, 83, 0.25);
  color: #fff;
  margin-left: auto;
  min-width: 108px;
}

.composer-inline-submit:hover:not(:disabled) {
  background: var(--navy-2);
}

/* ---------- Feed status --------------------------------------------------- */

.status-row {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.84rem;
  font-weight: 600;
  gap: 0.5rem;
  justify-content: space-between;
  padding: 0 0.25rem;
}

.status-row .text-button {
  align-items: center;
  display: inline-flex;
  font-size: 0.84rem;
  gap: 0.35rem;
}

.status-row .text-button::before {
  content: "↻";
  font-size: 1rem;
  line-height: 1;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* ---------- Post card ----------------------------------------------------- */

.post-card {
  animation: rise 0.35s ease-out both;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.post-card:hover {
  box-shadow: var(--shadow);
}

.post-card.empty-state {
  align-items: center;
  gap: 0.4rem;
  padding: 2.5rem 1.25rem;
  text-align: center;
}

.post-card.empty-state::before {
  align-items: center;
  background: var(--gold-soft);
  border-radius: 50%;
  content: "✨";
  display: flex;
  font-size: 1.6rem;
  height: 64px;
  justify-content: center;
  margin-bottom: 0.4rem;
  width: 64px;
}

.post-card.empty-state h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.post-card.empty-state p {
  color: var(--muted);
}

.post-header {
  align-items: center;
  display: flex;
  gap: 0.7rem;
  padding: 0.95rem 1rem 0.2rem;
}

.avatar {
  align-items: center;
  background: var(--heaven) !important;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold-2);
  color: #fff;
  display: inline-flex;
  flex: none;
  font-size: 0.82rem;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  letter-spacing: 0.02em;
  margin: 2px;
  width: 42px;
}

/* Anonymous authors get a warm gold avatar (app.js sets #b9822e) */
.avatar[style*="185, 130, 46"],
.avatar[style*="b9822e"] {
  background: var(--glory) !important;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #f3dfb0;
  color: #4a2e00;
}

.post-author {
  flex: 1;
  min-width: 0;
}

.post-author h2 {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-meta-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
}

.author-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.follow-button {
  align-items: center;
  background: none;
  border: 0;
  color: var(--navy-3);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  gap: 0.3rem;
  padding: 0;
}

.follow-button::before {
  color: var(--muted);
  content: "·";
  font-weight: 700;
  margin-right: 0.15rem;
}

.follow-button:hover .follow-button-label {
  text-decoration: underline;
}

.follow-count {
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 0.7rem;
  padding: 0 0.4rem;
}

.follow-button.is-following {
  color: var(--muted);
}

.post-actions {
  flex: none;
}

.topic-pill {
  background: var(--gold-soft);
  border-radius: var(--radius-pill);
  color: var(--gold-ink);
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.65rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.post-title {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  padding: 0.55rem 1rem 0;
  word-break: break-word;
}

.post-copy {
  color: var(--ink-2);
  font-size: 0.96rem;
  padding: 0.35rem 1rem 0;
  white-space: pre-line;
  word-break: break-word;
}

.post-copy.is-collapsed {
  -webkit-box-orient: vertical;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  overflow: hidden;
}

.read-more-button {
  align-self: flex-start;
  background: none;
  border: 0;
  color: var(--navy-3);
  font-size: 0.88rem;
  font-weight: 800;
  margin: 0.2rem 0.6rem 0;
  padding: 0.25rem 0.4rem;
}

/* Evidence photos */
.evidence-preview {
  margin-top: 0.85rem;
  position: relative;
}

.evidence-label {
  align-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(12, 20, 40, 0.6);
  border-radius: var(--radius-pill);
  color: #fff;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 700;
  gap: 0.35rem;
  left: 0.75rem;
  padding: 0.3rem 0.7rem;
  pointer-events: none;
  position: absolute;
  top: 0.75rem;
  z-index: 2;
}

.evidence-label::before {
  content: "📷";
  font-size: 0.8rem;
}

.evidence-thumbs {
  background: var(--surface-3);
  display: grid;
  gap: 3px;
  grid-auto-rows: 1fr;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.evidence-thumbs[data-count="1"] {
  grid-template-columns: 1fr;
}

.evidence-thumbs[data-count="1"] .evidence-thumb-wrap {
  aspect-ratio: 4 / 3;
  max-height: 560px;
}

.evidence-thumbs[data-count="2"] .evidence-thumb-wrap {
  aspect-ratio: 4 / 5;
}

.evidence-thumbs[data-count="3"] {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.evidence-thumbs[data-count="3"] .evidence-thumb-wrap:first-child {
  grid-row: span 2;
}

.evidence-thumbs[data-count="3"] .evidence-thumb-wrap {
  aspect-ratio: auto;
  min-height: 130px;
}

.evidence-thumbs[data-count="3"] {
  aspect-ratio: 4 / 3;
}

.evidence-thumbs[data-count="4"] .evidence-thumb-wrap,
.evidence-thumbs[data-count="5"] .evidence-thumb-wrap {
  aspect-ratio: 1;
}

.evidence-thumbs[data-count="5"] .evidence-thumb-wrap:nth-child(n + 5) {
  display: none;
}

.evidence-thumb-wrap {
  overflow: hidden;
  position: relative;
}

.evidence-thumb {
  cursor: zoom-in;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  width: 100%;
}

.evidence-thumb-wrap:hover .evidence-thumb {
  transform: scale(1.03);
}

.evidence-thumb-wrap.is-sensitive .evidence-thumb {
  filter: blur(26px) saturate(0.6) brightness(0.7);
  transform: scale(1.15);
}

.sensitive-warning {
  align-items: center;
  background: linear-gradient(180deg, rgba(12, 20, 40, 0.35), rgba(12, 20, 40, 0.7));
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: absolute;
  text-align: center;
}

.sensitive-warning strong {
  font-size: 0.92rem;
}

.sensitive-warning span {
  font-size: 0.78rem;
  opacity: 0.85;
}

.sensitive-warning button {
  background: rgba(255, 255, 255, 0.95);
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
  margin-top: 0.5rem;
  padding: 0.4rem 1.1rem;
}

.evidence-view-button {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.92);
  border: 0;
  border-radius: var(--radius-pill);
  bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.38rem 0.8rem;
  position: absolute;
  right: 0.75rem;
  z-index: 2;
}

/* Reactions: clean line icons + count. The name appears as a tooltip on
   hover (mouse), pops up briefly after tapping (touch), and shows inline
   on wider screens once you've reacted. */
.reaction-row {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.25rem;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  margin-top: 0.9rem;
  padding: 0.35rem 0.5rem;
}

/* Share sits at the end of the action bar, set apart by a hairline */
.reaction-row .share-post-button {
  --rx: var(--navy-3);
  --rx-bg: #e9effb;
  margin-left: 0.15rem;
  padding-inline: 0.7rem;
}

.reaction-row .share-post-button::before {
  background: var(--line);
  content: "";
  height: 24px;
  left: -0.25rem;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
}

/* The tooltip would hang off the card edge; anchor it to the right */
.share-post-button .reaction-label {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}

.share-post-button .reaction-label::after {
  left: auto;
  right: 18px;
  transform: none;
}

@media (hover: hover) {
  .reaction-row .share-post-button:hover .reaction-label {
    transform: translate(0, 0);
  }
}

.reaction-row .share-post-button.is-popping .reaction-label {
  animation: none;
}

.reaction-row button {
  --rx: var(--ink-2);
  --rx-bg: var(--surface-2);
  align-items: center;
  background: none;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  display: flex;
  font-size: 0.84rem;
  font-weight: 700;
  gap: 0.4rem;
  justify-content: center;
  min-height: 44px;
  padding: 0.35rem 0.5rem;
  position: relative;
  transition: background 0.18s, color 0.18s;
}

.reaction-row button[data-reaction="love"] {
  --rx: #e5486c;
  --rx-bg: #fdecf0;
}

.reaction-row button[data-reaction="encouraged"] {
  --rx: #e0861a;
  --rx-bg: #fef1e0;
}

.reaction-row button[data-reaction="praying"] {
  --rx: #179483;
  --rx-bg: #e2f5f1;
}

.reaction-row button[data-reaction="praise_god"] {
  --rx: #7a5af8;
  --rx-bg: #efebfe;
}

.reaction-icon {
  height: 22px;
  stroke-width: 1.8;
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
  width: 22px;
}

.reaction-row .reaction-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* Name tooltip */
.reaction-label {
  background: var(--ink);
  border-radius: var(--radius-pill);
  bottom: calc(100% + 6px);
  box-shadow: var(--shadow-sm);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  left: 50%;
  opacity: 0;
  padding: 0.3rem 0.65rem;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, 4px);
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
  z-index: 3;
}

.reaction-label::after {
  border: 5px solid transparent;
  border-top-color: var(--ink);
  content: "";
  left: 50%;
  position: absolute;
  top: 100%;
  transform: translateX(-50%);
}

@media (hover: hover) {
  .reaction-row button:hover {
    background: var(--rx-bg);
    color: var(--rx);
  }

  .reaction-row button:hover .reaction-label {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.reaction-row button:focus-visible .reaction-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Reacted */
.reaction-row button.is-selected {
  background: var(--rx-bg);
  color: var(--rx);
}

.reaction-row button.is-selected .reaction-count {
  color: var(--rx);
}

.reaction-row button.is-selected .reaction-fill {
  fill: currentColor;
  fill-opacity: 0.22;
}

.reaction-row button[data-reaction="love"].is-selected .reaction-icon path {
  fill: currentColor;
}

/* Tap feedback (ui.js adds .is-popping for a moment after each tap) */
.reaction-row button.is-popping .reaction-icon {
  animation: reaction-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.reaction-row button.is-popping .reaction-label {
  animation: reaction-tip 1.4s ease forwards;
}

@keyframes reaction-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes reaction-tip {
  0%,
  80% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 0);
  }
}

/* Arrived via a shared link */
.post-card.is-shared-target {
  animation: shared-glow 2.6s ease-out 0.4s 1 both;
  border-color: var(--gold-2);
}

@keyframes shared-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(227, 166, 44, 0.55), var(--shadow);
  }
  60% {
    box-shadow: 0 0 0 10px rgba(227, 166, 44, 0), var(--shadow);
  }
  100% {
    box-shadow: 0 0 0 3px rgba(227, 166, 44, 0.35), var(--shadow);
  }
}

/* Share sheet */
.share-sheet {
  align-items: flex-end;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 75;
}

.share-sheet-backdrop {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(10, 18, 40, 0.5);
  inset: 0;
  position: absolute;
}

.share-sheet-panel {
  animation: sheet-up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 100%;
  padding: 1.25rem 1.25rem calc(1.25rem + var(--safe-bottom));
  position: relative;
  width: 100%;
}

.share-sheet-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.share-sheet-header h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 0.2rem;
}

.share-sheet-post {
  -webkit-box-orient: vertical;
  color: var(--muted);
  display: -webkit-box;
  font-size: 0.86rem;
  -webkit-line-clamp: 1;
  margin-top: 0.2rem;
  overflow: hidden;
}

.share-targets {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.share-target {
  align-items: center;
  border-radius: var(--radius);
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  font-size: 0.74rem;
  font-weight: 700;
  gap: 0.45rem;
  padding: 0.5rem 0.2rem;
  text-align: center;
  transition: background 0.15s;
}

.share-target:hover {
  background: var(--surface-2);
}

.share-target-icon {
  align-items: center;
  background: var(--brand);
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(20, 33, 61, 0.15);
  color: #fff;
  display: inline-flex;
  height: 52px;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1);
  width: 52px;
}

.share-target:hover .share-target-icon {
  transform: translateY(-2px) scale(1.05);
}

.share-target-icon svg {
  height: 24px;
  stroke-width: 1.9;
  width: 24px;
}

.share-copy-row {
  align-items: center;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  display: flex;
  gap: 0.4rem;
  padding: 5px 5px 5px 1rem;
}

.share-copy-row input {
  background: transparent !important;
  border: 0;
  box-shadow: none !important;
  color: var(--ink-2);
  font-size: 0.88rem;
  min-height: 40px;
  min-width: 0;
  padding: 0;
  text-overflow: ellipsis;
}

.share-copy-row .primary-action {
  flex: none;
  min-height: 42px;
  min-width: 112px;
  padding: 0 1.1rem;
}

body.share-sheet-open {
  overflow: hidden;
}

/* Comments */
.comments-panel {
  background: #fdfbf7;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.8rem 1rem 1rem;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.comment-list:empty {
  display: none;
}

.comment-item {
  display: flex;
  gap: 0.55rem;
}

.comment-avatar-small,
.comment-avatar {
  align-items: center;
  background: linear-gradient(135deg, #dce5f7, #c4d2ef);
  border-radius: 50%;
  color: var(--navy-2);
  display: inline-flex;
  flex: none;
  font-size: 0.68rem;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-content > .comment-meta,
.comment-content > p {
  background: var(--surface-2);
}

.comment-meta {
  align-items: baseline;
  border-radius: 16px 16px 0 0;
  display: flex;
  gap: 0.45rem;
  padding: 0.5rem 0.8rem 0;
  width: fit-content;
  max-width: 100%;
}

.comment-meta strong {
  font-size: 0.82rem;
  font-weight: 800;
}

.comment-meta span {
  color: var(--muted);
  font-size: 0.72rem;
}

.comment-content > p {
  border-radius: 0 16px 16px 16px;
  color: var(--ink-2);
  font-size: 0.9rem;
  padding: 0.1rem 0.8rem 0.55rem;
  width: fit-content;
  max-width: 100%;
  word-break: break-word;
}

.comment-actions {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.74rem;
  font-weight: 700;
  gap: 0.8rem;
  padding: 0.3rem 0.6rem 0;
}

.comment-actions button {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0;
}

.comment-actions button:hover {
  color: var(--ink);
}

.thread-toggle {
  color: var(--navy-3) !important;
}

.reply-form {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.reply-form input {
  border-radius: var(--radius-pill);
  min-height: 40px;
  padding: 0.5rem 0.9rem;
}

.reply-form button {
  background: var(--navy);
  border: 0;
  border-radius: var(--radius-pill);
  color: #fff;
  flex: none;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0 1rem;
}

.reply-list {
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.6rem 0 0 0.3rem;
  padding-left: 0.7rem;
}

.reply-list:empty,
.reply-list.is-collapsed {
  display: none;
}

.reply-item .comment-avatar-small {
  font-size: 0.6rem;
  height: 26px;
  width: 26px;
}

.comment-form {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  display: flex;
  gap: 0.45rem;
  padding: 4px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.comment-form:focus-within {
  border-color: var(--gold);
  box-shadow: var(--ring);
}

.comment-form input {
  background: transparent;
  border: 0;
  box-shadow: none !important;
  flex: 1;
  min-height: 36px;
  min-width: 0;
  padding: 0.3rem 0.2rem;
}

.comment-form input:focus {
  background: transparent;
}

.comment-form button {
  background: var(--navy);
  border: 0;
  border-radius: var(--radius-pill);
  color: #fff;
  flex: none;
  font-size: 0.8rem;
  font-weight: 800;
  min-height: 34px;
  padding: 0 0.95rem;
}

.comment-form button:hover {
  background: var(--navy-2);
}

/* ---------- Right rail ---------------------------------------------------- */

.quiet-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.15rem;
}

.quiet-panel h2 {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}

.quiet-panel p {
  color: var(--ink-2);
  font-size: 0.9rem;
}

.quiet-panel:first-child {
  background:
    radial-gradient(16rem 10rem at 100% 0%, rgba(246, 203, 99, 0.45), transparent 70%),
    var(--heaven);
  border: 0;
  color: #fff;
}

.quiet-panel:first-child h2 {
  color: var(--gold-2);
}

.quiet-panel:first-child p {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.4;
}

.quiet-panel:first-child span {
  color: var(--gold-2);
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 0.7rem;
}

.stats {
  display: grid;
  gap: 0.5rem;
}

.stats div {
  align-items: center;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
}

.stats dt {
  color: var(--ink-2);
  font-size: 0.86rem;
  font-weight: 600;
}

.stats dd {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

/* ---------- Floating & bottom navigation --------------------------------- */

.floating-action {
  display: none;
}

.bottom-nav {
  align-items: center;
  backdrop-filter: saturate(1.6) blur(20px);
  -webkit-backdrop-filter: saturate(1.6) blur(20px);
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(221, 211, 194, 0.7);
  bottom: 0;
  box-shadow: 0 -8px 30px rgba(20, 33, 61, 0.06);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  left: 0;
  padding: 0 0.25rem var(--safe-bottom);
  position: fixed;
  right: 0;
  z-index: 35;
}

.bottom-nav-item {
  align-items: center;
  background: none;
  border: 0;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  font-size: 0.66rem;
  font-weight: 700;
  gap: 0.2rem;
  height: 100%;
  justify-content: center;
  padding: 0;
  position: relative;
}

.bottom-nav-item svg {
  height: 23px;
  width: 23px;
}

.bottom-nav-item.is-active {
  color: var(--navy);
}

.bottom-nav-item.is-active svg {
  fill: rgba(227, 166, 44, 0.25);
  stroke-width: 2.3;
}

.bottom-nav-share {
  align-items: center;
  background: var(--glory);
  border: 4px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(217, 138, 30, 0.42);
  color: #2a1a00;
  display: flex;
  height: 58px;
  justify-content: center;
  justify-self: center;
  transform: translateY(-14px);
  transition: transform 0.2s;
  width: 58px;
}

.bottom-nav-share:active {
  transform: translateY(-14px) scale(0.94);
}

.bottom-nav-share svg {
  height: 26px;
  stroke-width: 2.8;
  width: 26px;
}

.bottom-nav-badge {
  align-items: center;
  background: var(--love);
  border: 2px solid #fff;
  border-radius: var(--radius-pill);
  color: #fff;
  display: inline-flex;
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 800;
  height: 18px;
  justify-content: center;
  left: 50%;
  min-width: 18px;
  padding: 0 4px;
  position: absolute;
  top: 8px;
  transform: translateX(4px);
}

body.profile-page-open .bottom-nav {
  display: none;
}

/* ---------- Notifications popup ------------------------------------------ */

.notification-popup {
  animation: rise 0.2s ease-out;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  left: 8px;
  max-height: min(70vh, 520px);
  overflow: hidden;
  position: fixed;
  right: 8px;
  top: calc(var(--topbar-h) + 6px);
  z-index: 60;
}

.notification-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.notification-header h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.close-popup {
  align-items: center;
  background: var(--surface-2);
  border: 0;
  border-radius: 50%;
  color: var(--ink-2);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.close-popup svg {
  height: 17px;
  width: 17px;
}

.notification-list,
#notificationsList {
  overflow-y: auto;
}

.notification-list > p,
.no-notifications {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1.5rem 1rem;
  text-align: center;
}

.notification {
  align-items: center;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  gap: 0.7rem;
  padding: 0.75rem 1rem;
  position: relative;
  transition: background 0.15s;
}

.notification:hover {
  background: var(--surface-2);
}

.notification.unread {
  background: #fffaf0;
}

.notification.unread::after {
  background: var(--gold);
  border-radius: 50%;
  content: "";
  height: 8px;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
}

.notification-avatar-container {
  flex: none;
}

.notification-avatar,
.notification-avatar-initial {
  align-items: center;
  background: var(--heaven);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  object-fit: cover;
  width: 40px;
}

.notification-content {
  color: var(--ink-2);
  font-size: 0.86rem;
  line-height: 1.4;
  padding-right: 1rem;
}

.notification-content > span:first-child {
  color: var(--ink);
  font-weight: 800;
}

.notification-time {
  color: var(--muted);
  display: block;
  font-size: 0.74rem;
  margin-top: 0.1rem;
}

.notification-footer {
  display: flex;
  justify-content: center;
  padding: 0.6rem;
}

.clear-all-notifications {
  background: var(--surface-2);
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.45rem 1rem;
}

/* ---------- Message toast ------------------------------------------------- */

.message-toast {
  align-items: flex-start;
  animation: rise 0.25s ease-out;
  background: var(--navy);
  border: 0;
  border-radius: var(--radius);
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 14px);
  box-shadow: var(--shadow-lg);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  left: 12px;
  padding: 0.8rem 1rem 0.8rem 3.2rem;
  position: fixed;
  right: 12px;
  text-align: left;
  z-index: 80;
}

.message-toast::before {
  align-items: center;
  background: var(--glory);
  border-radius: 50%;
  content: "💬";
  display: flex;
  font-size: 0.9rem;
  height: 32px;
  justify-content: center;
  left: 0.85rem;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
}

.message-toast strong {
  font-size: 0.92rem;
}

.message-toast span {
  font-size: 0.8rem;
  opacity: 0.75;
}

/* ---------- Messages ------------------------------------------------------ */

.messages-page {
  background: rgba(10, 18, 40, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  inset: 0;
  position: fixed;
  z-index: 50;
}

.messages-shell {
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.messages-close-button {
  align-items: center;
  background: var(--surface-2);
  border: 0;
  border-radius: 50%;
  color: var(--ink-2);
  display: inline-flex;
  height: 38px;
  justify-content: center;
  position: absolute;
  right: 12px;
  top: 12px;
  width: 38px;
  z-index: 3;
}

.messages-close-button svg {
  height: 18px;
  width: 18px;
}

.messages-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.messages-toolbar {
  padding: 1rem 1rem 0.5rem;
}

.messages-toolbar h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.15;
}

.messages-recipient-search {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.25rem 1rem 0.75rem;
}

.messages-recipient-search > label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.recipient-search-row {
  align-items: center;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  display: flex;
  gap: 0.4rem;
  padding: 0 0.9rem;
}

.recipient-search-row:focus-within {
  background: var(--surface);
  box-shadow: var(--ring);
}

.recipient-search-row svg {
  color: var(--muted);
  height: 18px;
  width: 18px;
}

.recipient-search-row input {
  background: transparent !important;
  border: 0;
  box-shadow: none !important;
  min-height: 44px;
  padding: 0.5rem 0;
}

.user-list {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.2rem 0 0.3rem;
  scrollbar-width: none;
}

.user-list::-webkit-scrollbar {
  display: none;
}

.user-list > p,
.conversation-list > p {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.user-item {
  align-items: center;
  background: none;
  border: 0;
  border-radius: var(--radius);
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.35rem 0.2rem;
  position: relative;
  text-align: center;
  width: 74px;
}

.user-item:hover,
.user-item.active {
  background: var(--surface-2);
}

.user-avatar {
  align-items: center;
  background: var(--heaven);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold-2);
  color: #fff;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 800;
  height: 52px;
  justify-content: center;
  margin: 2px;
  object-fit: cover;
  width: 52px;
}

.user-info {
  min-width: 0;
  width: 100%;
}

.user-info strong {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-info small {
  display: none;
}

.user-start-icon {
  align-items: center;
  background: var(--gold);
  border: 2px solid var(--surface);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 800;
  height: 20px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 10px;
  top: 40px;
  width: 20px;
}

.messages-list-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 0.5rem 1rem 0.3rem;
  text-transform: uppercase;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  padding: 0 0.5rem 1rem;
}

.conversation-list > p {
  padding: 0.5rem;
}

.conversation-item {
  align-items: center;
  background: none;
  border: 0;
  border-radius: var(--radius);
  display: flex;
  gap: 0.75rem;
  padding: 0.65rem 0.6rem;
  text-align: left;
  width: 100%;
}

.conversation-item:hover {
  background: var(--surface-2);
}

.conversation-item.active {
  background: var(--gold-soft);
}

.conversation-avatar {
  align-items: center;
  background: var(--heaven);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: none;
  font-size: 0.8rem;
  font-weight: 800;
  height: 50px;
  justify-content: center;
  object-fit: cover;
  width: 50px;
}

.conversation-info {
  flex: 1;
  min-width: 0;
}

.conversation-header {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.conversation-header strong {
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-header small {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  flex: none;
  font-size: 0.72rem;
  gap: 0.3rem;
}

.badge {
  align-items: center;
  background: var(--love);
  border-radius: var(--radius-pill);
  color: #fff;
  display: inline-flex;
  font-size: 0.66rem;
  font-weight: 800;
  height: 18px;
  justify-content: center;
  min-width: 18px;
  padding: 0 5px;
}

.conversation-preview {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-empty-card {
  background: var(--surface-2);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0.5rem;
  padding: 1rem;
}

.messages-empty-card span {
  color: var(--muted);
  font-size: 0.85rem;
}

.chat-view {
  background:
    radial-gradient(30rem 20rem at 100% 0%, rgba(246, 203, 99, 0.12), transparent 70%),
    var(--bg);
  display: none;
  flex-direction: column;
  min-height: 0;
}

/* Phones: inbox first, thread once a conversation opens */
.messages-page.is-compose-mode .messages-sidebar {
  display: none;
}

.messages-page.is-compose-mode .chat-view {
  display: flex;
}

.messages-page.is-compose-mode .messages-close-button {
  display: none;
}

.chat-header {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
}

.chat-header h3 {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.chat-header .eyebrow {
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

.messages-back-button {
  background: var(--surface-2);
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--ink);
  flex: none;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.45rem 0.8rem;
}

.chat-partner-avatar {
  align-items: center;
  background-color: var(--navy);
  background-image: var(--heaven);
  background-position: center;
  background-size: cover;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: none;
  font-size: 0.75rem;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  padding: 1rem;
}

.chat-empty-state {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  justify-content: center;
  margin: auto;
  max-width: 300px;
  padding: 2rem 1rem;
  text-align: center;
}

.chat-empty-state::before {
  align-items: center;
  background: var(--gold-soft);
  border-radius: 50%;
  content: "🕊️";
  display: flex;
  font-size: 1.6rem;
  height: 64px;
  justify-content: center;
  margin-bottom: 0.5rem;
  width: 64px;
}

.chat-empty-state h3 {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.chat-message {
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  font-size: 0.92rem;
  gap: 0.15rem;
  max-width: min(78%, 520px);
  padding: 0.55rem 0.85rem;
  word-break: break-word;
}

.chat-message small {
  font-size: 0.66rem;
  opacity: 0.65;
}

.chat-message.incoming {
  align-self: flex-start;
  background: var(--surface);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-xs);
}

.chat-message.outgoing {
  align-self: flex-end;
  background: var(--heaven);
  border-bottom-right-radius: 6px;
  color: #fff;
}

.chat-message.outgoing small {
  text-align: right;
}

.chat-compose {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 0.6rem 0.75rem calc(0.6rem + var(--safe-bottom));
}

.chat-input-row {
  align-items: flex-end;
  display: flex;
  gap: 0.5rem;
}

.chat-input-row textarea {
  border-radius: 22px;
  height: 46px;
  max-height: 140px;
  min-height: 44px;
  padding: 0.6rem 1rem;
  resize: none;
}

.chat-input-row .primary-action {
  flex: none;
  min-height: 44px;
  padding: 0 1.1rem;
}

.message-status {
  font-size: 0.8rem;
  padding-top: 0.3rem;
}

.message-status:empty {
  display: none;
}

.message-status[data-tone="error"] {
  color: #b4233f;
}

.message-status[data-tone="success"] {
  color: var(--pray);
}

/* ---------- Auth & profile ------------------------------------------------ */

.auth-page {
  width: 100%;
}

body.profile-page-open .layout,
body.profile-page-open .topbar {
  display: none;
}

body.profile-page-open .app-shell {
  min-height: 0;
}

/* Popup (login / sign up) */
.auth-page.auth-popup {
  align-items: flex-end;
  background: rgba(10, 18, 40, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  inset: 0;
  justify-content: center;
  overflow-y: auto;
  position: fixed;
  z-index: 70;
}

.auth-page.auth-popup .settings-shell {
  animation: sheet-up 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  box-shadow: var(--shadow-lg);
  display: grid;
  max-height: 94dvh;
  overflow-y: auto;
  width: 100%;
}

@keyframes sheet-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.auth-visual {
  display: none;
}

.auth-page.auth-popup .settings-main {
  gap: 0;
  max-width: none;
  padding: 0;
}

.auth-page.auth-popup .auth-card {
  padding: 1.4rem 1.25rem calc(1.4rem + var(--safe-bottom));
}

.auth-page.auth-popup .auth-card::before {
  background: var(--line-strong);
  border-radius: var(--radius-pill);
  content: "";
  height: 5px;
  margin: -0.6rem auto 0.4rem;
  width: 44px;
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-card-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.auth-card-header h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-top: 0.25rem;
}

.auth-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.3rem;
}

.auth-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(0, 1fr);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-field label {
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 700;
}

.auth-field label span {
  color: var(--muted);
  font-weight: 500;
}

.form-message {
  color: #b4233f;
  font-size: 0.86rem;
  font-weight: 600;
}

.form-message:empty {
  display: none;
}

.auth-card > .primary-action {
  min-height: 50px;
  width: 100%;
}

.auth-card > .text-button {
  align-self: center;
}

/* Profile photo */
.profile-photo-field {
  align-items: center;
  background: var(--surface-2);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem;
}

.profile-photo-picker {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 0.85rem;
  position: relative;
}

.profile-photo-picker input {
  display: none;
}

.profile-photo-preview {
  align-items: center;
  background: var(--heaven);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--gold-2);
  color: #fff;
  display: inline-flex;
  flex: none;
  font-size: 1.3rem;
  font-weight: 800;
  height: 76px;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  width: 76px;
}

.profile-photo-preview img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.profile-photo-change-icon {
  align-items: center;
  background: var(--gold);
  border: 2px solid var(--surface);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  left: 54px;
  position: absolute;
  top: 52px;
  width: 28px;
}

.profile-photo-change-icon svg {
  height: 14px;
  width: 14px;
}

.profile-photo-copy strong {
  display: block;
  font-size: 0.92rem;
}

.profile-photo-copy small {
  color: var(--muted);
  font-size: 0.8rem;
}

.photo-adjust-controls {
  flex-basis: 100%;
}

.photo-adjust-controls p {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}

.photo-adjust-controls input {
  accent-color: var(--gold);
  width: 100%;
}

/* Profile page */
.auth-page.profile-page {
  background: var(--bg);
  min-height: 100vh;
}

.auth-page.profile-page .settings-shell {
  display: block;
  min-height: 100vh;
}

.settings-sidebar {
  display: none;
}

.settings-main {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 0 auto;
  max-width: 860px;
  padding: 0.75rem var(--gutter) calc(2rem + var(--safe-bottom));
  width: 100%;
}

.settings-mobile-top {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.settings-back {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink);
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 700;
  gap: 0.3rem;
  padding: 0.5rem 0.9rem 0.5rem 0.6rem;
}

.settings-back svg {
  height: 18px;
  width: 18px;
}

.settings-mobile-top .secondary-action {
  font-size: 0.84rem;
  min-height: 38px;
  padding: 0.4rem 1rem;
}

.settings-mobile-tabs {
  display: flex;
  gap: 0.45rem;
  margin: 0 calc(var(--gutter) * -1);
  overflow-x: auto;
  padding: 0.1rem var(--gutter) 0.3rem;
  scrollbar-width: none;
}

.settings-mobile-tabs::-webkit-scrollbar {
  display: none;
}

.settings-mobile-tabs button,
.settings-tabs button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  flex: none;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.5rem 0.95rem;
  white-space: nowrap;
}

.settings-mobile-tabs button.is-active,
.settings-tabs button.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.auth-page.profile-page .auth-card,
.settings-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

.auth-page.profile-page .auth-close-button {
  display: none;
}

.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.settings-panel h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}

.settings-panel > p {
  color: var(--ink-2);
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.settings-list label {
  align-items: center;
  background: var(--surface-2);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.settings-list strong {
  display: block;
  font-size: 0.92rem;
}

.settings-list small {
  color: var(--muted);
  display: block;
  font-size: 0.8rem;
}

/* iOS-style switch */
.settings-list input[type="checkbox"] {
  appearance: none;
  background: var(--line-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  flex: none;
  height: 28px;
  margin: 0;
  position: relative;
  transition: background 0.2s;
  width: 48px;
}

.settings-list input[type="checkbox"]::after {
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  content: "";
  height: 22px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition: transform 0.2s;
  width: 22px;
}

.settings-list input[type="checkbox"]:checked {
  background: var(--pray);
}

.settings-list input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

.account-details {
  display: grid;
  gap: 0.5rem;
}

.account-details div {
  align-items: center;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}

.account-details dt {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.account-details dd {
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

/* Admin */
.admin-panel-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.admin-panel-copy {
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-post-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.admin-post-item {
  align-items: flex-start;
  background: var(--surface-2);
  border-radius: var(--radius);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.9rem 1rem;
}

.admin-post-item > div {
  min-width: 0;
}

.admin-post-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.74rem;
  font-weight: 600;
  gap: 0.2rem 0.6rem;
}

.admin-post-item h3 {
  font-size: 0.96rem;
  margin-top: 0.2rem;
}

.admin-post-item p {
  color: var(--ink-2);
  font-size: 0.86rem;
}

.admin-post-item .danger-action {
  flex: none;
  min-height: 36px;
  padding: 0.4rem 0.9rem;
}

/* ---------- Evidence viewer ---------------------------------------------- */

.evidence-dialog {
  background: transparent;
  border: 0;
  color: #fff;
  height: 100%;
  max-height: none;
  max-width: none;
  padding: 0;
  width: 100%;
}

.evidence-dialog::backdrop {
  background: rgba(6, 10, 22, 0.92);
  backdrop-filter: blur(6px);
}

.evidence-modal {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.evidence-modal-header {
  align-items: center;
  display: flex;
  font-size: 0.86rem;
  font-weight: 700;
  justify-content: space-between;
  padding: 0.8rem 1rem;
}

.evidence-modal-header .icon-button {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.evidence-stage {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 0.5rem;
  justify-content: center;
  min-height: 0;
  padding: 0 0.5rem 1rem;
  position: relative;
}

.evidence-image-frame {
  align-items: center;
  display: flex;
  flex: 1;
  height: 100%;
  justify-content: center;
  min-width: 0;
  position: relative;
}

#evidenceImage {
  border-radius: var(--radius);
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

#evidenceImage.is-sensitive {
  filter: blur(30px);
}

.evidence-modal-warning {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  inset: 0;
  justify-content: center;
  position: absolute;
  text-align: center;
}

.evidence-modal-warning button {
  background: #fff;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-weight: 800;
  margin-top: 0.4rem;
  padding: 0.5rem 1.3rem;
}

.evidence-nav {
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 0;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: none;
  height: 44px;
  justify-content: center;
  position: absolute;
  width: 44px;
  z-index: 2;
}

.evidence-nav:first-child {
  left: 0.75rem;
}

.evidence-nav:last-child {
  right: 0.75rem;
}

.evidence-nav:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* ==========================================================================
   Tablet & up
   ========================================================================== */

@media (min-width: 600px) {
  :root {
    --gutter: 24px;
  }

  /* Keep the single-column feed at a comfortable reading width on tablets */
  .layout {
    max-width: 720px;
  }

  .feed-intro {
    align-items: flex-end;
    flex-direction: row;
    justify-content: space-between;
    padding: 1.8rem 1.75rem;
  }

  .feed-intro .primary-action {
    align-self: flex-end;
  }

  .post-header,
  .post-title,
  .post-copy {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .comments-panel {
    padding: 0.9rem 1.25rem 1.1rem;
  }

  .reaction-row {
    padding: 0.4rem 0.75rem;
  }

  /* Room to show the name inline once you've reacted */
  .reaction-row button.is-selected .reaction-label {
    animation: none;
    background: none;
    box-shadow: none;
    color: inherit;
    font-size: 0.84rem;
    opacity: 1;
    padding: 0;
    position: static;
    transform: none;
  }

  .reaction-row button.is-selected .reaction-label::after {
    display: none;
  }

  .share-box {
    padding: 1.25rem;
  }

  .composer-topic-chips {
    margin: 0 -1.25rem;
    padding: 0.1rem 1.25rem 0.2rem;
  }

  .auth-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-field-wide {
    grid-column: 1 / -1;
  }

  .message-toast {
    left: auto;
    max-width: 360px;
    right: 24px;
  }

  .notification-popup {
    left: auto;
    right: 16px;
    width: 380px;
  }

  .share-sheet {
    align-items: center;
    padding: 1.5rem;
  }

  .share-sheet-panel {
    animation: rise 0.22s ease-out;
    border-radius: 28px;
    max-width: 480px;
    padding: 1.5rem;
  }

  /* Auth becomes a centered modal */
  .auth-page.auth-popup {
    align-items: center;
    padding: 1.5rem;
  }

  .auth-page.auth-popup .settings-shell {
    animation: rise 0.25s ease-out;
    border-radius: 28px;
    max-height: calc(100dvh - 3rem);
    max-width: 560px;
  }

  .auth-page.auth-popup .auth-card {
    padding: 2rem;
  }

  .auth-page.auth-popup .auth-card::before {
    display: none;
  }
}

/* ==========================================================================
   Desktop navigation (≥ 900px)
   ========================================================================== */

@media (min-width: 900px) {
  :root {
    --topbar-h: 72px;
  }

  .topbar {
    padding: 0 max(var(--gutter), calc((100vw - 1240px) / 2 + var(--gutter)));
  }

  .brand-logo {
    height: 54px;
    max-width: 260px;
  }

  .topnav {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-xs);
    display: flex;
    gap: 0.15rem;
    padding: 4px;
  }

  .topnav a {
    align-items: center;
    border-radius: var(--radius-pill);
    color: var(--ink-2);
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 700;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    position: relative;
    transition: background 0.15s, color 0.15s;
  }

  .topnav a:hover {
    background: var(--surface-2);
    color: var(--ink);
  }

  .topnav a:first-child {
    background: var(--navy);
    color: #fff;
  }

  .topnav a svg {
    height: 18px;
    width: 18px;
  }

  .topnav .message-count {
    position: static;
    border: 0;
  }

  .account-button {
    padding: 4px 1rem 4px 4px;
  }

  .account-button > span:last-child {
    display: block;
  }

  .bottom-nav {
    display: none;
  }

  .floating-action {
    align-items: center;
    background: var(--glory);
    border-radius: 50%;
    bottom: 1.5rem;
    box-shadow: 0 14px 30px rgba(217, 138, 30, 0.42);
    color: #2a1a00;
    display: flex;
    height: 60px;
    justify-content: center;
    position: fixed;
    right: 1.5rem;
    transition: transform 0.2s;
    width: 60px;
    z-index: 25;
  }

  .floating-action:hover {
    transform: translateY(-2px) scale(1.04);
  }

  .floating-action svg {
    height: 26px;
    stroke-width: 2.8;
    width: 26px;
  }

  .message-toast {
    bottom: 1.5rem;
    left: 1.5rem;
    right: auto;
  }

  .layout {
    align-items: start;
    gap: 1.5rem;
    grid-template-columns: 230px minmax(0, 1fr);
    max-width: 1240px;
    padding: 1.5rem var(--gutter) 3rem;
  }

  /* Topics become a sticky sidebar */
  .left-rail {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 0;
    order: 0;
    padding: 1rem 0.6rem 0.6rem;
    position: sticky;
    top: calc(var(--topbar-h) + 1.5rem);
  }

  .rail-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 0 0.5rem 0.6rem;
  }

  .rail-header h2 {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .rail-header span {
    background: var(--gold-soft);
    border-radius: var(--radius-pill);
    color: var(--gold-ink);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.1rem 0.55rem;
  }

  .topic-list {
    flex-direction: column;
    gap: 2px;
    max-height: calc(100vh - var(--topbar-h) - 8rem);
    overflow-x: visible;
    overflow-y: auto;
    padding: 0;
  }

  .topic {
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: none;
    padding: 0.6rem 0.75rem;
    text-align: left;
    white-space: normal;
  }

  .topic:hover {
    background: var(--surface-2);
  }

  .topic.is-active {
    background: var(--gold-soft);
    box-shadow: inset 3px 0 0 var(--gold);
    color: var(--gold-ink);
  }

  .feed-column {
    gap: 1rem;
  }

  /* Messages becomes a floating two-pane window */
  .messages-page {
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
  }

  .messages-shell {
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    grid-template-columns: 340px minmax(0, 1fr);
    height: min(820px, calc(100dvh - 3rem));
    max-width: 1100px;
  }

  .messages-sidebar {
    border-right: 1px solid var(--line);
  }

  .chat-view,
  .messages-page.is-compose-mode .chat-view {
    display: flex;
  }

  .messages-page.is-compose-mode .messages-sidebar {
    display: flex;
  }

  .messages-page.is-compose-mode .messages-close-button {
    display: inline-flex;
  }

  .messages-back-button {
    display: none;
  }

  .chat-header {
    padding-right: 4rem;
  }

  /* Auth popup gets the inspirational side panel */
  .auth-page.auth-popup .settings-shell {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    max-width: 980px;
  }

  .auth-page.auth-popup .auth-visual {
    background:
      radial-gradient(24rem 18rem at 100% 0%, rgba(246, 203, 99, 0.45), transparent 65%),
      radial-gradient(20rem 16rem at 0% 100%, rgba(108, 150, 255, 0.35), transparent 70%),
      var(--heaven);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: space-between;
    padding: 2.25rem;
  }

  .auth-visual-logo {
    filter: brightness(0) invert(1);
    max-width: 200px;
    opacity: 0.95;
  }

  .auth-visual .eyebrow {
    color: var(--gold-2);
  }

  .auth-visual-copy h1 {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 600;
    line-height: 1.15;
    margin: 0.6rem 0 0.8rem;
  }

  .auth-visual-copy p {
    color: rgba(255, 255, 255, 0.78);
  }

  .auth-visual-footnote {
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.86rem;
    font-style: italic;
    padding-top: 1rem;
  }

  .auth-page.auth-popup .auth-card {
    padding: 2.25rem;
  }

  /* Profile page: sidebar + content */
  .auth-page.profile-page .settings-shell {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 280px minmax(0, 1fr);
    margin: 0 auto;
    max-width: 1180px;
    padding: 1.5rem var(--gutter);
  }

  .settings-sidebar {
    align-self: start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem;
    position: sticky;
    top: 1.5rem;
  }

  .settings-back {
    align-self: flex-start;
  }

  .settings-profile-block {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .settings-profile-mark {
    align-items: center;
    background: var(--heaven);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--gold-2);
    color: #fff;
    display: flex;
    font-size: 1.6rem;
    font-weight: 800;
    height: 92px;
    justify-content: center;
    overflow: hidden;
    width: 92px;
  }

  .settings-profile-mark img {
    height: 100%;
    object-fit: cover;
    width: 100%;
  }

  .settings-profile-block > div > p:first-child {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .settings-profile-block h1 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .settings-follow-summary {
    color: var(--ink-2);
    display: flex;
    font-size: 0.84rem;
    font-weight: 700;
    gap: 0.8rem;
    justify-content: center;
    margin-top: 0.35rem;
  }

  .settings-tabs {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .settings-tabs button {
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    text-align: left;
  }

  .settings-tabs button:hover {
    background: var(--surface-2);
  }

  .settings-tabs button.is-active {
    background: var(--gold-soft);
    box-shadow: inset 3px 0 0 var(--gold);
    color: var(--gold-ink);
  }

  .settings-main {
    padding: 0;
  }

  .settings-mobile-top,
  .settings-mobile-tabs {
    display: none !important;
  }

  .auth-page.profile-page .auth-card,
  .settings-panel {
    padding: 1.75rem;
  }
}

/* ==========================================================================
   Wide desktop (≥ 1180px): three columns
   ========================================================================== */

@media (min-width: 1180px) {
  .layout {
    grid-template-columns: 230px minmax(0, 1fr) 290px;
  }

  .right-rail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: calc(var(--topbar-h) + 1.5rem);
  }
}

/* ==========================================================================
   Very small phones
   ========================================================================== */

@media (max-width: 360px) {
  :root {
    --gutter: 12px;
  }

  .brand-logo {
    height: 40px;
    max-width: 44vw;
  }

  .reaction-row {
    padding: 0.3rem 0.25rem;
  }

  .composer-inline-submit {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
