/*
  idhaof — “signal receipt” visual system
  Warm void + chartreuse signal + editorial type. Fonts loaded in header.php.
*/

:root {
  --void: #050504;
  --void-mid: #0c0b09;
  --tape: #12100e;
  --tape-edge: #1f1c18;
  --ink: #ebe6df;
  --ink-dim: #a39e96;
  --signal: #c4ff3d;
  --signal-deep: #7fb30f;
  --hot: #ff2d6b;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Literata", "Georgia", serif;
  --font-mono: "Fragment Mono", ui-monospace, monospace;
  --shadow-brutal: 5px 5px 0 rgba(196, 255, 61, 0.35);
  --shadow-brutal-hover: 7px 7px 0 rgba(196, 255, 61, 0.5);
  --radius-tight: 2px;
  --radius-soft: 4px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

::selection {
  background: rgba(196, 255, 61, 0.22);
  color: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--void);
  background-image:
    radial-gradient(ellipse 120% 80% at 20% -10%, rgba(196, 255, 61, 0.07), transparent 50%),
    radial-gradient(ellipse 80% 60% at 100% 30%, rgba(255, 45, 107, 0.04), transparent 45%),
    linear-gradient(180deg, var(--void-mid) 0%, var(--void) 40%, #030302 100%);
  color: var(--ink);
  line-height: 1.65;
  position: relative;
}

/* Film grain */
body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.055;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

a {
  color: var(--signal);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}
a:hover {
  color: #e8ffc8;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: var(--radius-tight);
}

.btn:focus-visible,
button:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

summary:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: var(--radius-tight);
}

.wrap {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.35rem clamp(1rem, 4vw, 2rem) 4rem;
  position: relative;
  z-index: 1;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--signal);
  background: rgba(5, 5, 4, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--signal-deep), transparent);
  opacity: 0.5;
}

.site-header .inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 3vw, 1.75rem);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  display: block;
  position: relative;
}
.brand:hover {
  color: var(--signal);
  text-decoration: none;
}
.brand::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  background: var(--signal);
  margin-top: 0.45rem;
  transform: skewX(-12deg);
}
.brand span {
  display: block;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-top: 0.5rem;
}

nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  justify-content: flex-end;
}

nav a {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 0.4rem 0.2rem;
  margin: -0.4rem -0.2rem;
  border-radius: var(--radius-tight);
  transition: color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
nav a:hover {
  color: var(--signal);
  text-decoration: none;
}

nav a[aria-current="page"] {
  color: var(--signal);
  box-shadow: 0 2px 0 0 var(--signal);
}

nav a[aria-current="page"]:hover {
  color: #e8ffc8;
}

/* —— Buttons —— */
.btn {
  display: inline-block;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-tight);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.14s var(--ease-out), box-shadow 0.14s var(--ease-out), border-color 0.14s var(--ease-out), color 0.14s var(--ease-out);
}
.btn:hover {
  transform: translate(-2px, -2px);
  text-decoration: none;
}

.btn-primary {
  background: var(--signal);
  color: var(--void);
  border-color: var(--signal-deep);
  box-shadow: var(--shadow-brutal);
}
.btn-primary:hover {
  box-shadow: var(--shadow-brutal-hover);
  color: var(--void);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--tape-edge);
}
.btn-ghost:hover {
  border-color: var(--signal);
  color: var(--signal);
  box-shadow: 3px 3px 0 rgba(196, 255, 61, 0.15);
}

.btn-compact {
  padding: 0.4rem 0.85rem;
  font-size: 0.65rem;
}

/* —— Hero (home) —— */
.page-home .wrap {
  max-width: 72rem;
}

.hero {
  padding: clamp(2rem, 6vw, 4rem) 0 2rem;
  position: relative;
}

.page-home .hero::before {
  content: "01";
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--signal-deep);
  position: absolute;
  left: 0;
  top: 1.5rem;
  opacity: 0.9;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 6.5vw, 3.6rem);
  letter-spacing: -0.045em;
  line-height: 1.02;
  margin: 0 0 1.25rem;
  max-width: 14ch;
  color: var(--ink);
}

.hero h1 em {
  font-style: normal;
  color: var(--signal);
  text-shadow: 0 0 40px rgba(196, 255, 61, 0.25);
}

.lede {
  font-size: 1.08rem;
  color: var(--ink-dim);
  max-width: 36rem;
  margin: 0 0 2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--tape-edge);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

/* —— Cards —— */
.card {
  background: var(--tape);
  border: 2px solid var(--tape-edge);
  border-radius: var(--radius-soft);
  padding: 1.5rem 1.65rem;
  margin-bottom: 1.25rem;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

a.card:hover {
  border-color: rgba(196, 255, 61, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 0 1px rgba(196, 255, 61, 0.06);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4rem;
  height: 4rem;
  background: linear-gradient(135deg, transparent 50%, rgba(196, 255, 61, 0.04) 50%);
  pointer-events: none;
}

.card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: var(--ink);
}

.card ul {
  margin: 0;
  padding-left: 1.15rem;
}
.card li {
  margin-bottom: 0.5rem;
  color: var(--ink-dim);
}
.card li::marker {
  color: var(--signal-deep);
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--void);
  padding: 0.12em 0.35em;
  border: 1px solid var(--tape-edge);
  border-radius: var(--radius-tight);
  color: var(--signal);
}

/* —— Forms —— */
label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea,
select {
  width: 100%;
  max-width: 28rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-soft);
  border: 2px solid var(--tape-edge);
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--signal-deep);
  box-shadow: 0 0 0 3px rgba(196, 255, 61, 0.12);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

/* —— Flash —— */
.flash {
  padding: 0.9rem 1.15rem 0.9rem 1rem;
  border-radius: var(--radius-soft);
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.45;
  border-left-width: 4px;
  border-left-style: solid;
}
.flash-ok {
  background: rgba(196, 255, 61, 0.07);
  border: 2px solid var(--signal-deep);
  border-left-color: var(--signal);
  color: #d4f5a8;
  box-shadow: 0 4px 24px rgba(196, 255, 61, 0.06);
}
.flash-err {
  background: rgba(255, 45, 107, 0.07);
  border: 2px solid var(--hot);
  border-left-color: var(--hot);
  color: #ffb8c8;
  box-shadow: 0 4px 24px rgba(255, 45, 107, 0.06);
}

.muted {
  color: var(--ink-dim);
  font-size: 0.92rem;
}

/* —— Footer —— */
.site-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--tape-edge);
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* —— Post feed / browse —— */
.card-callout {
  border: 1px solid var(--tape-edge);
  box-shadow: 3px 3px 0 rgba(196, 255, 61, 0.12);
}

.post-feed article {
  border: 2px solid var(--tape-edge);
  border-radius: var(--radius-soft);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1rem;
  background: var(--tape);
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.post-feed article:hover {
  border-color: rgba(196, 255, 61, 0.2);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
}

@media (hover: none) {
  .post-feed article:hover {
    border-color: var(--tape-edge);
    box-shadow: none;
  }
}
.post-feed .meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 0.65rem;
}

.grid-browse {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.grid-browse .card {
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.grid-browse .card:hover {
  transform: translateY(-3px);
  border-color: rgba(196, 255, 61, 0.35);
}

.grid-browse a.card {
  color: inherit;
  text-decoration: none;
}
.grid-browse a.card strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.grid-browse a.card:hover strong {
  color: var(--signal);
}

/* —— Page titles (inner pages) —— */
main .hero h1 {
  max-width: none;
}

/* —— Motion (respect reduced motion) —— */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 640px) {
  .site-header .inner {
    align-items: flex-start;
    flex-direction: column;
  }
  nav ul {
    justify-content: flex-start;
  }
  .page-home .hero::before {
    position: static;
    display: block;
    margin-bottom: 0.5rem;
  }
}

/* —— Flow / wayfinding —— */
.flow-crumb {
  font-size: 0.88rem;
  margin: 0 0 1.15rem;
  letter-spacing: 0.02em;
  padding: 0.45rem 0.9rem;
  display: inline-block;
  background: rgba(18, 16, 14, 0.55);
  border: 1px solid rgba(31, 28, 24, 0.85);
  border-radius: var(--radius-soft);
  color: var(--ink-dim);
  border-left: 3px solid var(--signal-deep);
}
.flow-crumb a {
  color: var(--ink-dim);
  font-weight: 500;
}
.flow-crumb a:hover {
  color: var(--signal);
}
.flow-crumb .muted {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* Inner page titles (Manage, Profile, …) */
main > h1.hero {
  letter-spacing: -0.03em;
  border-bottom: 1px solid rgba(31, 28, 24, 0.9);
  padding-bottom: 0.65rem;
  margin-bottom: 0.5rem;
}

main > h1.hero + p.muted,
main > h1.hero + p.lede {
  margin-top: 0.35rem;
}

.site-footer-line {
  margin: 0 0 0.5rem;
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
}

.site-footer-nav span[aria-hidden="true"] {
  opacity: 0.45;
  user-select: none;
}

.flow-split {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-top: 1.25rem;
}

@media (min-width: 640px) {
  .flow-split {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}

.flow-steps {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.75;
}

.flow-steps li {
  margin-bottom: 0.35rem;
}

.flow-steps strong {
  color: var(--ink);
  font-weight: 600;
}

/* Skip link (visible on keyboard focus) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  z-index: 10000;
  padding: 0.5rem 1rem;
  background: var(--signal);
  color: var(--void);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius-tight);
  text-decoration: none;
}
.skip-link:focus {
  left: clamp(1rem, 3vw, 1.75rem);
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Modal (native dialog) */
.manage-page-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.modal-dialog {
  padding: 0;
  border: 1px solid var(--tape-edge);
  border-radius: var(--radius-tight);
  background: var(--tape);
  color: var(--ink);
  max-width: min(40rem, calc(100vw - 2rem));
  width: 100%;
  max-height: min(90vh, 100%);
  overflow: hidden;
  box-shadow: var(--shadow-brutal);
}

.modal-dialog::backdrop {
  background: rgba(5, 5, 4, 0.78);
  backdrop-filter: blur(3px);
}

@media (prefers-reduced-motion: reduce) {
  .modal-dialog::backdrop {
    backdrop-filter: none;
  }
}

.modal-dialog-inner {
  padding: 1.25rem 1.5rem 1.5rem;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-dialog textarea {
  min-height: 5.5rem;
}

.modal-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.modal-dialog-header .modal-dialog-close {
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.15rem 0.5rem;
  min-width: 2.25rem;
}

.modal-dialog-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* Comment / post “Edit” disclosure */
main details {
  border: 1px solid var(--tape-edge);
  border-radius: var(--radius-soft);
  padding: 0.35rem 0.65rem 0.5rem;
  background: rgba(5, 5, 4, 0.35);
}

main details summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

main details summary:hover {
  color: var(--signal);
}

main details[open] {
  padding-bottom: 0.65rem;
}

/* Pagination strips (Browse, creator feed, Manage) */
nav[aria-label*="page"] {
  padding: 0.65rem 0;
}

nav[aria-label*="page"] a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-tight);
  border: 1px solid var(--tape-edge);
  transition: border-color 0.15s var(--ease-out), color 0.15s var(--ease-out);
}

nav[aria-label*="page"] a:hover {
  border-color: rgba(196, 255, 61, 0.35);
  color: #e8ffc8;
  text-decoration: none;
}

/* Manage: action button clusters */
.manage-post-actions {
  flex-shrink: 0;
}

.manage-post-actions form button.btn-ghost:hover {
  border-color: rgba(255, 45, 107, 0.45);
  color: #ffb8c8;
}

.site-footer {
  padding-bottom: 2rem;
}

.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;
}

/* Public creator page — link row under hero */
ul.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.1rem;
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

ul.profile-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--signal-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(196, 255, 61, 0.35);
  transition: color 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}

ul.profile-links a:hover {
  color: var(--signal);
  border-bottom-color: rgba(196, 255, 61, 0.65);
}

/* Creator public page — layout variants (class on <main>) */
main.wrap.creator-page-wide {
  max-width: 64rem;
}

main.wrap.creator-page-full {
  max-width: min(92rem, calc(100vw - 2rem));
}

/* Optional font pairings (creator page + logged-in user session theme) */
#creator-site-root.creator-font--news .hero h1,
#creator-site-root.creator-font--news h2,
body.idhaof-app.idhaof-session-font--news .hero h1,
body.idhaof-app.idhaof-session-font--news h1.hero,
body.idhaof-app.idhaof-session-font--news .site-header .brand {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
}

#creator-site-root.creator-font--news,
body.idhaof-app.idhaof-session-font--news {
  font-family: "Source Sans 3", system-ui, sans-serif;
}

#creator-site-root.creator-font--news .post-body,
#creator-site-root.creator-font--news .comment-body,
body.idhaof-app.idhaof-session-font--news .post-body,
body.idhaof-app.idhaof-session-font--news .comment-body {
  font-family: "Source Sans 3", system-ui, sans-serif;
}

#creator-site-root.creator-font--geometric .hero h1,
#creator-site-root.creator-font--geometric h2,
body.idhaof-app.idhaof-session-font--geometric .hero h1,
body.idhaof-app.idhaof-session-font--geometric h1.hero,
body.idhaof-app.idhaof-session-font--geometric .site-header .brand {
  font-family: "Outfit", system-ui, sans-serif;
}

#creator-site-root.creator-font--geometric,
body.idhaof-app.idhaof-session-font--geometric {
  font-family: "DM Sans", system-ui, sans-serif;
}

#creator-site-root.creator-font--geometric .post-body,
#creator-site-root.creator-font--geometric .comment-body,
body.idhaof-app.idhaof-session-font--geometric .post-body,
body.idhaof-app.idhaof-session-font--geometric .comment-body {
  font-family: "DM Sans", system-ui, sans-serif;
}

#creator-site-root.creator-font--mono_note .hero h1,
body.idhaof-app.idhaof-session-font--mono_note .hero h1,
body.idhaof-app.idhaof-session-font--mono_note h1.hero,
body.idhaof-app.idhaof-session-font--mono_note .site-header .brand {
  font-family: "Syne", system-ui, sans-serif;
}

#creator-site-root.creator-font--mono_note,
body.idhaof-app.idhaof-session-font--mono_note {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

#creator-site-root.creator-font--mono_note .post-body,
#creator-site-root.creator-font--mono_note .comment-body,
body.idhaof-app.idhaof-session-font--mono_note .post-body,
body.idhaof-app.idhaof-session-font--mono_note .comment-body {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.creator-custom-block + .creator-custom-block {
  margin-top: 0.65rem;
}

/* Customize page — color picker + hex */
.color-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

input[type="color"].color-swatch {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--tape-edge);
  border-radius: var(--radius-tight);
  cursor: pointer;
  background: var(--void-mid);
}

input[type="color"].color-swatch::-webkit-color-swatch-wrapper {
  padding: 2px;
}

input[type="color"].color-swatch::-webkit-color-swatch {
  border: none;
  border-radius: 1px;
}

input.color-hex-input {
  flex: 1;
  min-width: 7rem;
  max-width: 11rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  letter-spacing: 0.04em;
}

/* —— Direct messages (inbox + thread) —— */
main.wrap.dm-main {
  max-width: 60rem;
}

.nav-badge {
  display: inline-block;
  min-width: 1.15rem;
  padding: 0.1em 0.4em;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  vertical-align: 0.15em;
  color: var(--void);
  background: var(--signal);
  border-radius: 999px;
}

.dm-inbox-grid {
  display: grid;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 840px) {
  .dm-inbox-grid {
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  }
}

.dm-conv-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dm-conv-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--tape-edge);
  color: inherit;
  text-decoration: none;
  transition: background 0.12s var(--ease-out);
  border-radius: var(--radius-tight);
  margin: 0 -0.35rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.dm-conv-item:hover {
  background: rgba(196, 255, 61, 0.06);
  text-decoration: none;
}

.dm-conv-title {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
}

.dm-unread-badge {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05em 0.4em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--void);
  background: var(--signal);
  border-radius: 999px;
  vertical-align: 0.12em;
}

.dm-conv-preview {
  grid-column: 1;
  grid-row: 2;
  font-size: 0.92rem;
  color: var(--ink-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-conv-time {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.78rem;
  white-space: nowrap;
}

.dm-thread-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.dm-thread-head {
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid var(--tape-edge);
}

.dm-scroll {
  max-height: min(58vh, 520px);
  overflow-y: auto;
  padding: 1rem 1.1rem;
  scroll-behavior: smooth;
}

.dm-empty {
  margin: 0;
  text-align: center;
  padding: 1.5rem 0;
}

.dm-row {
  display: flex;
  margin-bottom: 0.65rem;
}

.dm-row--me {
  justify-content: flex-end;
}

.dm-row--them {
  justify-content: flex-start;
}

.dm-bubble {
  max-width: min(100%, 26rem);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-soft);
  border: 1px solid var(--tape-edge);
  background: var(--tape);
}

.dm-row--me .dm-bubble {
  background: rgba(196, 255, 61, 0.1);
  border-color: rgba(196, 255, 61, 0.35);
}

.dm-meta {
  font-size: 0.72rem;
  color: var(--ink-dim);
  margin-bottom: 0.25rem;
}

.dm-body {
  font-size: 0.98rem;
  word-break: break-word;
}

.dm-compose {
  padding: 1rem 1.1rem 1.15rem;
  border-top: 1px solid var(--tape-edge);
  background: rgba(12, 11, 9, 0.65);
}

.dm-compose textarea {
  width: 100%;
  min-height: 5rem;
  resize: vertical;
}

/* Post engagement (reactions + comments on creator site) */
.post-engagement-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 0.45rem;
}
