:root {
  --bg: #efede8;
  --paper: rgba(248, 245, 240, 0.88);
  --card: rgba(252, 250, 246, 0.96);
  --ink: #141412;
  --muted: #64605a;
  --line: rgba(20, 20, 18, 0.1);
  --line-strong: rgba(20, 20, 18, 0.18);
  --accent: #a68356;
  --accent-soft: rgba(166, 131, 86, 0.12);
  --shadow-soft: 0 24px 60px rgba(20, 20, 18, 0.06);
  --shadow-card: 0 18px 38px rgba(20, 20, 18, 0.05);
  --font-display: "Forum", "Times New Roman", serif;
  --font-ui: "Onest", "Helvetica Neue", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 0%, rgba(166, 131, 86, 0.14), transparent 24%),
    radial-gradient(circle at 84% 12%, rgba(20, 20, 18, 0.05), transparent 26%),
    linear-gradient(180deg, #f5f2eb 0%, var(--bg) 100%);
}

body.max-booting .max-app {
  opacity: 0;
  pointer-events: none;
}

a {
  color: inherit;
}

button,
textarea {
  font: inherit;
}

.max-app {
  width: min(1280px, calc(100% - 1.4rem));
  margin: 0 auto;
  padding: 0.8rem 0 2.2rem;
}

.max-hero,
.max-comments-shell,
.max-post-card {
  background: var(--paper);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

.max-hero {
  padding: 1.2rem;
  border-radius: 28px;
  position: relative;
  overflow: hidden;
}

.max-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(166, 131, 86, 0.08), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent 55%);
  pointer-events: none;
}

.max-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 1rem;
}

.max-hero-main {
  min-width: 0;
}

.max-hero-note {
  align-self: stretch;
  border-radius: 24px;
  border: 1px solid rgba(25, 23, 20, 0.09);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.64), rgba(248, 243, 236, 0.84));
  padding: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.max-hero-note h2 {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.05;
}

.max-note-list {
  margin: 0.95rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

.max-note-list li {
  position: relative;
  padding-left: 1rem;
  color: var(--muted);
  line-height: 1.55;
}

.max-note-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 999px;
  background: var(--accent);
}

.max-note-footer {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(25, 23, 20, 0.08);
}

.max-note-footer span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.max-note-footer strong {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2rem;
}

.max-brandline {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.max-brandmark {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #141412 0%, #5f4b36 100%);
  color: #fbf8f3;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.84rem;
  flex-shrink: 0;
}

.max-brandcopy {
  min-width: 0;
}

.max-brandsub {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.max-live-pill {
  margin-left: auto;
  flex-shrink: 0;
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(166, 131, 86, 0.22);
  background: rgba(166, 131, 86, 0.08);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.66rem;
}

.max-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.max-hero h1,
.max-section-head h2,
.max-post-card h3,
.max-comment-card h4 {
  font-family: var(--font-display);
  font-weight: 400;
}

.max-hero h1 {
  margin: 0.85rem 0 0;
  font-size: clamp(2.1rem, 6vw, 4.1rem);
  line-height: 0.95;
  max-width: 11ch;
  text-wrap: balance;
}

.max-lead {
  margin: 0.9rem 0 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 1rem;
}

.max-hero-actions,
.max-comment-actions,
.max-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.max-hero-actions {
  margin-top: 1rem;
}

.max-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.max-stat-card {
  padding: 0.75rem 0.85rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--line);
}

.max-stat-card strong,
.max-thread-banner strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.05rem, 3vw, 1.5rem);
}

.max-stat-card span {
  display: block;
  margin-top: 0.16rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.max-btn,
.max-inline-action {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.max-btn:hover,
.max-inline-action:hover {
  transform: translateY(-1px);
}

.max-btn {
  min-height: 44px;
  padding: 0.6rem 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  border-radius: 0;
}

.max-btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #f8f5ef;
}

.max-btn-secondary {
  background: rgba(255, 255, 255, 0.38);
}

.max-inline-action {
  border-radius: 0;
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
}

.max-inline-action-danger {
  border-color: rgba(148, 44, 44, 0.42);
  color: #7a2424;
  background: rgba(202, 88, 88, 0.08);
}

.max-inline-action-danger:hover {
  border-color: rgba(148, 44, 44, 0.58);
  background: rgba(202, 88, 88, 0.14);
}

.max-inline-action-danger.is-confirm {
  border-color: rgba(148, 44, 44, 0.8);
  background: rgba(202, 88, 88, 0.2);
  color: #611a1a;
}

.max-btn:disabled,
.max-inline-action:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.max-meta,
.max-comments-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.max-meta {
  margin-top: 1rem;
}

.max-meta span,
.max-comments-meta {
  border: 1px solid rgba(20, 20, 18, 0.06);
  border-radius: 999px;
  padding: 0.28rem 0.52rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.max-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.thread-focused .max-hero {
  display: none;
}

.thread-focused .max-layout {
  grid-template-columns: 1fr;
  margin-top: 0.7rem;
}

.thread-focused .max-app {
  width: min(880px, calc(100% - 1rem));
  padding-top: 0.25rem;
}

.thread-focused .max-layout > div:first-child {
  display: none;
}

.thread-focused .max-comments-shell {
  max-width: 820px;
  margin: 0 auto;
  position: static;
  padding: 1.15rem;
  border-color: rgba(166, 131, 86, 0.14);
  box-shadow: 0 30px 74px rgba(20, 20, 18, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(249, 244, 237, 0.97));
}

.thread-focused .max-comments-shell > .max-section-head,
.thread-focused .max-comments-lead,
.thread-focused .max-comments-rail {
  display: none;
}

.max-section-head h2 {
  margin: 0.4rem 0 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1;
}

.max-section-head-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
}

.max-posts {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.9rem;
}

.max-post-card {
  border-radius: 24px;
  padding: 1rem;
  transition: transform 180ms ease, border-color 180ms ease, opacity 180ms ease, box-shadow 180ms ease, filter 180ms ease;
  box-shadow: var(--shadow-card);
}

.max-post-card:hover {
  transform: translateY(-2px);
}

.max-post-card.is-active {
  border-color: rgba(166, 131, 86, 0.26);
  box-shadow: 0 22px 44px rgba(20, 20, 18, 0.08);
  transform: translateY(-2px);
}

.max-post-card--strength {
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.97), rgba(248, 243, 236, 0.95));
}

.max-post-card--premium {
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.98), rgba(246, 239, 230, 0.96));
}

.max-post-card--home,
.max-post-card--lifestyle {
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(248, 243, 237, 0.96));
}

.max-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  gap: 1rem;
  align-items: start;
}

.max-post-card.is-gallery .max-post-layout,
.max-post-card.is-portrait .max-post-layout {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.max-post-copy {
  min-width: 0;
}

.max-post-card.is-gallery .max-post-media,
.max-post-card.is-portrait .max-post-media {
  order: -1;
  width: 100%;
}

.thread-open .max-post-card:not(.is-active) {
  opacity: 0.58;
  filter: saturate(0.92);
  transform: scale(0.992);
}

.thread-open .max-post-card:not(.is-active):hover {
  opacity: 0.92;
  filter: none;
  transform: translateY(-2px);
}

.thread-open .max-post-card.is-active {
  box-shadow: 0 26px 52px rgba(20, 20, 18, 0.09);
}

.max-post-media {
  position: relative;
  min-height: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(166, 131, 86, 0.08), rgba(20, 20, 18, 0.08));
  min-height: 210px;
}

.max-post-card.is-gallery .max-post-media {
  min-height: 0;
  background: transparent;
}

.max-post-card.is-portrait .max-post-media {
  min-height: 0;
  aspect-ratio: 4 / 5;
  background: transparent;
}

.max-post-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.max-post-card.is-portrait .max-post-cover {
  object-fit: cover;
  object-position: center;
  background: transparent;
}

.max-post-media-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.max-post-media-gallery[data-photo-count="3"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.max-post-media-gallery[data-photo-count="3"] .max-post-gallery-tile:last-child {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}

.max-post-gallery-tile {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, rgba(166, 131, 86, 0.08), rgba(20, 20, 18, 0.08));
}

.max-post-gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.max-post-gallery-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(20, 20, 18, 0.46);
  color: #f8f5ef;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  letter-spacing: 0.04em;
}

.max-post-media-fallback {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  color: var(--accent);
}

.max-post-media-fallback strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 0.9;
}

.max-post-thread-chip,
.max-thread-banner,
.max-thread-focus-head {
  display: none !important;
}

.max-post-media-label {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.max-post-thread-chip {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  border-radius: 999px;
  padding: 0.42rem 0.7rem;
  background: rgba(20, 18, 16, 0.58);
  color: #f8f3ec;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.max-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.max-post-meta span {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.max-post-count {
  background: var(--accent-soft);
  color: var(--accent) !important;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
}

.max-post-card h3 {
  margin: 0.55rem 0 0;
  font-size: clamp(1.25rem, 3vw, 2rem);
  line-height: 1.02;
}

.max-post-card p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.max-post-actions {
  margin-top: 1rem;
}

.max-comments-shell {
  border-radius: 24px;
  padding: 1rem;
  position: sticky;
  top: 0.8rem;
  align-self: start;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(249, 244, 237, 0.92));
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.max-thread-focus-head {
  display: none;
  margin-bottom: 0.95rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(25, 23, 20, 0.08);
}

.thread-focused .max-thread-focus-head {
  display: block;
}

.max-thread-focus-kicker {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}

.max-thread-focus-head h3 {
  margin: 0.45rem 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  line-height: 0.95;
}

.max-thread-focus-lead {
  margin: 0.65rem 0 0;
  color: var(--muted);
  line-height: 1.58;
}

.thread-focused .max-comments-panel {
  margin-top: 0.5rem;
}

.thread-focused .max-comments-list {
  gap: 0;
}

.thread-focused .max-comment-card {
  padding: 0.38rem 0.5rem;
  border-radius: 0;
  background: transparent;
}

.max-comments-lead,
.max-comments-empty {
  color: var(--muted);
  line-height: 1.6;
}

.max-comments-rail {
  margin-top: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(25, 23, 20, 0.05);
  background: rgba(255, 255, 255, 0.35);
  padding: 0.35rem 0.6rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.max-comments-rail-dot {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(166, 131, 86, 0.08);
  opacity: 0.7;
}

.max-empty-card {
  margin-top: 0.7rem;
  padding: 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(25, 23, 20, 0.05);
  background: rgba(255, 255, 255, 0.3);
}

.max-empty-label {
  display: inline-block;
  border-radius: 999px;
  padding: 0.26rem 0.5rem;
  background: rgba(166, 131, 86, 0.07);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.6rem;
}

.max-empty-card p {
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
}

.max-empty-actions {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.max-comments-panel {
  margin-top: 0.6rem;
  animation: panelIn 180ms ease;
}

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

.max-thread-banner {
  margin-bottom: 0.8rem;
  padding: 0.78rem 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(166, 131, 86, 0.12);
  background: linear-gradient(135deg, rgba(166, 131, 86, 0.08) 0%, rgba(20, 20, 18, 0.04) 100%);
}

.max-thread-label {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.max-comments-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0.45rem;
}

.max-comment-card {
  padding: 0.42rem 0.55rem;
  border: none;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  transition: background-color 100ms ease;
  animation: commentSlideIn 220ms ease both;
}

@keyframes commentSlideIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.max-comment-card:nth-child(1) { animation-delay: 0ms; }
.max-comment-card:nth-child(2) { animation-delay: 30ms; }
.max-comment-card:nth-child(3) { animation-delay: 55ms; }
.max-comment-card:nth-child(4) { animation-delay: 75ms; }
.max-comment-card:nth-child(5) { animation-delay: 90ms; }
.max-comment-card:nth-child(n+6) { animation-delay: 100ms; }

.max-comment-card:hover {
  background: rgba(20, 20, 18, 0.018);
}

.max-comment-card + .max-comment-card {
  border-top: 1px solid rgba(20, 20, 18, 0.035);
}

.max-comment-card.is-bookmarked {
  background: rgba(166, 131, 86, 0.035);
}

.max-comment-card.is-bookmarked:hover {
  background: rgba(166, 131, 86, 0.055);
}

.max-comment-card.is-error {
  border: 1px solid rgba(126, 60, 52, 0.16);
  background: rgba(255, 248, 245, 0.7);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
}

.max-comment-card.is-loading {
  border: 1px dashed rgba(20, 20, 18, 0.07);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
}

.max-comment-card.is-status {
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(20, 20, 18, 0.06);
  background: rgba(255, 255, 255, 0.3);
}

.max-comment-card h4 {
  margin: 0;
  font-size: 0.8rem;
  font-family: var(--font-ui);
  font-weight: 500;
}

.max-comment-note {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
  opacity: 0.65;
}

.max-comment-form[data-readonly="true"] textarea {
  background: rgba(255, 255, 255, 0.55);
}

.max-comment-form[data-readonly="true"] input {
  background: rgba(255, 255, 255, 0.55);
}

.max-btn:disabled,
textarea:disabled {
  opacity: 0.7;
  cursor: progress;
}

.max-comment-card p {
  margin: 0.12rem 0 0;
  color: #4e4842;
  font-size: 0.86rem;
  line-height: 1.48;
}

.max-comment-row {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  align-items: center;
}

.max-comment-row span {
  color: var(--muted);
  font-size: 0.62rem;
}

.max-comment-author {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  min-width: 0;
}

.max-comment-avatar {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(20, 20, 18, 0.72), rgba(166, 131, 86, 0.5));
  color: rgba(250, 246, 240, 0.9);
  font-size: 0.44rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.max-comment-author-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.max-comment-author-copy h4 {
  font-size: 0.78rem;
  font-weight: 500;
}

.max-comment-author-copy span {
  display: inline;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: none;
  opacity: 0.55;
}

/* ---- Comment footer: reactions + bookmark ---- */

.max-comment-footer {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  margin-top: 0.18rem;
  padding-left: 1.73rem;
  flex-wrap: wrap;
}

.max-reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.12rem 0.32rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(20, 20, 18, 0.025);
  color: var(--muted);
  font-size: 0.64rem;
  cursor: pointer;
  transition: background-color 80ms ease, border-color 80ms ease, transform 80ms ease;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
}

.max-reaction-btn:hover {
  background: rgba(166, 131, 86, 0.08);
  border-color: rgba(166, 131, 86, 0.1);
}

.max-reaction-btn:active {
  transform: scale(0.9);
}

.max-reaction-btn.has-count {
  border-color: rgba(166, 131, 86, 0.12);
  background: rgba(166, 131, 86, 0.045);
}

.max-reaction-btn .max-reaction-emoji {
  font-size: 0.7rem;
  line-height: 1;
}

.max-reaction-btn .max-reaction-count {
  font-size: 0.58rem;
  font-weight: 500;
  color: var(--accent);
  min-width: 0.5em;
  text-align: center;
  opacity: 0.8;
}

.max-reaction-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border: 1px dashed rgba(20, 20, 18, 0.07);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.6rem;
  cursor: pointer;
  transition: background-color 80ms ease, border-color 80ms ease, opacity 80ms ease;
  opacity: 0;
  line-height: 1;
}

.max-comment-card:hover .max-reaction-add,
.max-comment-footer:focus-within .max-reaction-add {
  opacity: 0.7;
}

.max-reaction-add:hover {
  opacity: 1 !important;
  background: rgba(166, 131, 86, 0.06);
  border-color: rgba(166, 131, 86, 0.14);
}

.max-reaction-picker {
  display: none;
  align-items: center;
  gap: 0.1rem;
  padding: 0.18rem 0.28rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid rgba(20, 20, 18, 0.06);
  box-shadow: 0 4px 16px rgba(20, 20, 18, 0.08);
  position: absolute;
  bottom: 100%;
  left: 1.73rem;
  z-index: 10;
  animation: reactionPickerIn 100ms ease;
}

@keyframes reactionPickerIn {
  from { opacity: 0; transform: translateY(3px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.max-reaction-picker.is-open {
  display: inline-flex;
}

.max-reaction-picker button {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background-color 80ms ease, transform 80ms ease;
  line-height: 1;
}

.max-reaction-picker button:hover {
  background: rgba(166, 131, 86, 0.09);
  transform: scale(1.12);
}

.max-reaction-picker button:active {
  transform: scale(0.88);
}

.max-bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.14rem;
  margin-left: auto;
  padding: 0.12rem 0.3rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.58rem;
  cursor: pointer;
  transition: color 80ms ease, opacity 80ms ease;
  opacity: 0;
  line-height: 1;
}

.max-comment-card:hover .max-bookmark-btn,
.max-bookmark-btn.is-active {
  opacity: 0.7;
}

.max-bookmark-btn:hover {
  color: var(--accent);
  opacity: 1 !important;
}

.max-bookmark-btn.is-active {
  color: var(--accent);
  opacity: 1;
}

.max-bookmark-btn .max-bookmark-icon {
  font-size: 0.68rem;
  line-height: 1;
}

/* ---- Reply button ---- */

.max-reply-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.3rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.58rem;
  cursor: pointer;
  transition: color 80ms ease, opacity 80ms ease;
  opacity: 0;
  line-height: 1;
}

.max-comment-card:hover .max-reply-btn {
  opacity: 0.6;
}

.max-reply-btn:hover {
  color: var(--accent);
  opacity: 1 !important;
}

/* ---- Replies group ---- */

.max-replies-group {
  padding-left: 1.73rem;
  border-left: 2px solid rgba(166, 131, 86, 0.1);
  margin-left: 0.67rem;
}

.max-replies-group .max-comment-card {
  padding: 0.32rem 0.45rem;
}

.max-replies-group .max-comment-avatar {
  width: 1.1rem;
  height: 1.1rem;
  font-size: 0.38rem;
}

.max-replies-group .max-comment-author-copy h4 {
  font-size: 0.72rem;
}

.max-replies-group .max-comment-card p {
  font-size: 0.82rem;
  line-height: 1.44;
}

.max-replies-group .max-comment-footer {
  padding-left: 1.48rem;
}

.max-reply-hint {
  display: inline;
  color: var(--accent);
  font-size: 0.58rem;
  opacity: 0.7;
  font-weight: 400;
  font-family: var(--font-ui);
}

/* ---- Reply bar ---- */

.max-reply-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.6rem;
  margin-bottom: 0.3rem;
  border-radius: 10px;
  background: rgba(166, 131, 86, 0.06);
  border-left: 3px solid var(--accent);
  font-size: 0.72rem;
  color: var(--muted);
  animation: replyBarIn 120ms ease;
}

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

.max-reply-bar-label {
  opacity: 0.7;
}

.max-reply-bar-name {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.72rem;
}

.max-reply-bar-cancel {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background-color 80ms ease, color 80ms ease;
  line-height: 1;
}

.max-reply-bar-cancel:hover {
  background: rgba(20, 20, 18, 0.06);
  color: var(--ink);
}

/* ---- Compact comment form ---- */

.max-comment-form {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(20, 20, 18, 0.04);
}

.max-comment-author-group {
  margin-bottom: 0.45rem;
}

.max-comment-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.7;
}

.max-comment-form input,
.max-comment-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(20, 20, 18, 0.06);
  background: rgba(255, 255, 255, 0.45);
  padding: 0.48rem 0.65rem;
  color: var(--ink);
  font-size: 0.84rem;
  box-shadow: none;
  transition: border-color 100ms ease, background-color 100ms ease;
}

.max-comment-form input:focus,
.max-comment-form textarea:focus {
  outline: none;
  border-color: rgba(166, 131, 86, 0.28);
  background: rgba(255, 255, 255, 0.65);
}

.max-btn:focus-visible,
.max-inline-action:focus-visible {
  outline: 2px solid rgba(166, 131, 86, 0.35);
  outline-offset: 2px;
}

.max-comment-form textarea {
  resize: vertical;
  min-height: 56px;
}

.max-comment-actions {
  margin-top: 0.4rem;
}

/* ---- Admin zone (hidden by default, subtle) ---- */

.max-admin-zone {
  margin-top: 1.2rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(20, 20, 18, 0.03);
  text-align: right;
}

.max-admin-action {
  display: inline;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.58rem;
  opacity: 0.35;
  cursor: pointer;
  transition: opacity 120ms ease, color 120ms ease;
  padding: 0;
  text-decoration: none;
}

.max-admin-action:hover {
  opacity: 0.7;
  color: #7a2424;
}

.max-admin-action.is-confirm {
  opacity: 0.9;
  color: #7a2424;
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 980px) {
  .max-hero-grid,
  .max-post-layout,
  .max-layout {
    grid-template-columns: 1fr;
  }

  .max-comments-shell {
    position: static;
    order: -1;
  }

  .max-hero-stats {
    grid-template-columns: 1fr;
  }

  .max-post-media {
    min-height: 180px;
  }

  .thread-focused .max-comments-shell {
    max-width: none;
    box-shadow: var(--shadow-soft);
  }
}

@media (max-width: 720px) {
  .max-app {
    width: min(100%, calc(100% - 1rem));
    padding-top: 0.55rem;
  }

  .max-hero,
  .max-comments-shell,
  .max-post-card {
    border-radius: 24px;
  }

  .max-brandline {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .max-live-pill {
    margin-left: 0;
  }

  .max-btn {
    flex: 1 1 100%;
    text-align: center;
  }

  .max-hero-note {
    padding: 0.9rem;
  }

  .max-hero h1 {
    max-width: 10ch;
  }

  .max-comment-row {
    flex-direction: row;
    align-items: center;
  }

  .max-comment-author {
    width: auto;
  }

  .max-comment-actions .max-btn {
    flex: 1 1 100%;
  }

  .max-reaction-add,
  .max-bookmark-btn,
  .max-reply-btn {
    opacity: 0.6;
  }

  .max-replies-group {
    padding-left: 1rem;
    margin-left: 0.4rem;
  }

  .max-replies-group .max-comment-footer {
    padding-left: 0;
  }

  .max-comment-footer {
    padding-left: 0;
  }

  .thread-focused .max-comments-shell {
    padding: 0.65rem;
  }

  .thread-focused .max-comments-list {
    gap: 0;
  }

  .thread-focused .max-comments-panel {
    margin-top: 0.35rem;
  }
}
