:root {
  --ink: #f8f7ff;
  --ink-soft: #d8d3ee;
  --stroke: #05050b;
  --paper: #0a0912;
  --paper-2: #151321;
  --surface: #1d1a2b;
  --surface-2: #262238;
  --muted: #a9a3bb;
  --line: #38324b;
  --violet: #7a55ff;
  --violet-dark: #b7a6ff;
  --violet-light: #c7bbff;
  --mint: #49c6a4;
  --coral: #ff755d;
  --red: #ff4f68;
  --gold: #f5b84b;
  --blue: #43a5ff;
  --cyan-text: #22d3ee;
  --mint-text: var(--mint);
  --gold-text: var(--gold);
  --coral-text: var(--coral);
  --focus-ring: #ffffff;
  --scrollbar-thumb: #81779d;
  --scrollbar-track: transparent;
  --on-accent: #090910;
  --on-primary: #ffffff;
  --message-reaction-chip-ink: #ffffff;
  --placeholder: #8f89a4;
  --field-bg: #080711;
  --field-bg-2: #100e19;
  --chrome-bg: rgba(10, 9, 18, 0.9);
  --sidebar-bg: rgba(18, 16, 29, 0.92);
  --sidebar-shadow: 8px 8px 0 rgba(5, 5, 11, 0.52);
  --scrim: rgba(5, 5, 11, 0.58);
  --modal-backdrop: rgba(9, 9, 16, 0.58);
  --media-scrim-start: rgba(5, 5, 11, 0.2);
  --media-scrim-end: rgba(5, 5, 11, 0.74);
  --grid-line: rgba(255, 255, 255, 0.035);
  --page-bg:
    radial-gradient(circle at 16% 10%, rgba(122, 85, 255, 0.22), transparent 28%),
    radial-gradient(circle at 86% 0%, rgba(73, 198, 164, 0.12), transparent 24%),
    linear-gradient(180deg, #0a0912, #12101d 44%, #0a0912),
    repeating-linear-gradient(0deg, var(--grid-line) 0 1px, transparent 1px 34px);
  --hero-bg:
    linear-gradient(135deg, rgba(122, 85, 255, 0.22), transparent 48%),
    linear-gradient(120deg, var(--surface), #111723);
  --settings-panel-bg:
    linear-gradient(135deg, rgba(122, 85, 255, 0.16), rgba(29, 26, 43, 0.96)),
    var(--surface);
  --explore-stage-bg:
    linear-gradient(115deg, rgba(122, 85, 255, 0.22), rgba(73, 198, 164, 0.1) 46%, rgba(5, 5, 11, 0.92) 46%),
    var(--surface);
  --room-edit-hero-bg:
    linear-gradient(135deg, rgba(122, 85, 255, 0.42), rgba(81, 205, 171, 0.22) 52%, rgba(5, 5, 11, 0.86));
  --lift-shadow-sm: 4px 4px 0 rgba(5, 5, 11, 0.42);
  --lift-shadow-lg: 7px 7px 0 rgba(5, 5, 11, 0.5);
  --search-overlay-bg:
    linear-gradient(120deg, rgba(35, 24, 68, 0.96), rgba(7, 13, 18, 0.98)),
    var(--paper);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
  --radius: 8px;
}

/* Unified progress, rewards, and streak experience */
.progress-nav-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(245, 184, 75, 0.2), rgba(122, 85, 255, 0.18)), var(--surface);
  border: 2px solid var(--stroke);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--stroke);
  font: 800 0.82rem/1 "Nunito Sans", system-ui, sans-serif;
  cursor: pointer;
}

.progress-nav-button:hover,
.progress-nav-button.is-active {
  color: var(--on-accent);
  background: var(--gold);
  transform: translate(-1px, -1px);
}

.progress-nav-button .material-symbols-rounded {
  color: var(--coral-text);
  font-size: 1.25rem;
}

.progress-page {
  display: grid;
  gap: 22px;
  width: min(1180px, 100%);
  margin: 0 auto;
  container-name: progress-page;
  container-type: inline-size;
}

.progress-page-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 190px;
  padding: clamp(24px, 5vw, 48px);
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 20%, rgba(245, 184, 75, 0.28), transparent 24%),
    radial-gradient(circle at 70% 100%, rgba(73, 198, 164, 0.18), transparent 30%),
    linear-gradient(130deg, rgba(122, 85, 255, 0.34), rgba(122, 85, 255, 0.06) 55%),
    var(--surface);
  border: 3px solid var(--stroke);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: 7px 7px 0 var(--stroke);
}

.progress-page-header > div:first-child {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.progress-page-header h1 {
  margin: 4px 0 10px;
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  line-height: 0.95;
}

.progress-page-header p:last-child {
  max-width: 650px;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.55;
}

.progress-header-mark {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: clamp(100px, 16vw, 160px);
  aspect-ratio: 1;
  place-items: center;
  color: var(--on-accent);
  background: var(--gold);
  border: 3px solid var(--stroke);
  border-radius: 48% 52% 42% 58%;
  box-shadow: 8px 8px 0 var(--stroke);
  transform: rotate(6deg);
}

.progress-header-mark::after {
  content: "";
  position: absolute;
  inset: 13px;
  border: 3px dashed rgba(5, 5, 11, 0.45);
  border-radius: inherit;
}

.progress-header-mark .material-symbols-rounded {
  font-size: clamp(3.8rem, 9vw, 6.5rem);
  font-variation-settings: "FILL" 1;
}

.progress-loading,
.progress-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 42px;
  text-align: center;
}

.progress-loading .material-symbols-rounded {
  color: var(--violet-light);
  font-size: 2.4rem;
  animation: progress-spin 1.1s linear infinite;
}

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

.progress-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(210px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.progress-level-card,
.progress-stat-card {
  min-width: 0;
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 5px 5px 0 var(--stroke);
}

.progress-level-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 24px;
}

.progress-level-ring {
  --progress-value: 0;
  display: grid;
  width: 142px;
  aspect-ratio: 1;
  place-items: center;
  background: conic-gradient(var(--mint) calc(var(--progress-value) * 1%), var(--surface-2) 0);
  border: 3px solid var(--stroke);
  border-radius: 50%;
  box-shadow: inset 0 0 0 8px var(--surface), 4px 4px 0 var(--stroke);
}

.progress-level-ring > span {
  display: grid;
  width: 94px;
  aspect-ratio: 1;
  place-content: center;
  text-align: center;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: 50%;
}

.progress-level-ring small,
.progress-level-copy small,
.progress-stat-card small {
  color: var(--muted);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.progress-level-ring strong {
  font-family: "Lexend", sans-serif;
  font-size: 2.4rem;
  line-height: 1;
}

.progress-level-copy {
  display: grid;
  align-content: center;
  min-width: 0;
}

.progress-level-copy > strong {
  font-family: "Lexend", sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.progress-level-meter,
.progress-quest-meter {
  height: 12px;
  margin: 14px 0 8px;
  overflow: hidden;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: 999px;
}

.progress-level-meter span,
.progress-quest-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--mint));
  border-right: 2px solid var(--stroke);
  transition: width 320ms ease;
}

.progress-level-copy p {
  color: var(--muted);
  font-size: 0.86rem;
}

.progress-stat-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: flex-start;
  align-content: start;
  gap: 16px;
  height: 100%;
  padding: 22px;
  overflow: hidden;
}

.progress-stat-card > .material-symbols-rounded,
.progress-orb-icon {
  width: 48px;
  height: 48px;
  padding: 8px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: 50%;
  font-size: 1.8rem;
  object-fit: contain;
}

.progress-stat-card > div {
  display: grid;
  grid-template-rows: minmax(2.6em, auto) auto 1fr;
  align-content: start;
  height: 100%;
  min-width: 0;
}

.progress-stat-card small,
.progress-stat-card p {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.progress-stat-card small {
  display: block;
  line-height: 1.3;
}

.progress-stat-card strong {
  margin: 7px 0 5px;
  font-family: "Lexend", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  line-height: 1.08;
}

.progress-stat-card p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.progress-orb-card {
  background: linear-gradient(145deg, rgba(122, 85, 255, 0.16), transparent 64%), var(--surface);
}

.progress-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.progress-quests-panel,
.progress-activity-panel,
.progress-side-column {
  min-width: 0;
}

.progress-side-column {
  display: grid;
  gap: 18px;
}

.progress-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.progress-section-heading > div {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.progress-section-heading > div > .material-symbols-rounded {
  color: var(--violet-light);
  font-size: 1.45rem;
}

.progress-section-heading h2 {
  font-size: 1.15rem;
}

.progress-section-heading p,
.progress-section-heading > span {
  color: var(--muted);
  font-size: 0.84rem;
}

.progress-section-heading > span {
  padding: 5px 8px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
  white-space: nowrap;
}

.progress-quest-list {
  display: grid;
  gap: 12px;
}

.progress-quest {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  padding: 15px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 160ms ease, transform 160ms ease;
}

.progress-quest.is-complete {
  border-color: var(--mint);
}

.progress-quest.is-claimed {
  opacity: 0.78;
}

.progress-quest-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--violet-light);
  background: var(--surface);
  border: 2px solid var(--stroke);
  border-radius: 12px;
}

.progress-quest-copy {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-width: 0;
}

.progress-quest.is-complete .progress-quest-icon {
  color: var(--on-accent);
  background: var(--mint);
}

.progress-quest-heading,
.progress-quest-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.progress-quest-heading > div {
  min-width: 0;
}

.progress-quest-heading h3 {
  font-size: 0.98rem;
}

.progress-quest-heading p,
.progress-quest-footer > span {
  color: var(--muted);
  font-size: 0.82rem;
}

.progress-quest-reward {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

.progress-quest-reward .orb-icon {
  width: 17px;
  height: 17px;
}

.progress-quest-footer button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.progress-quest-footer {
  align-self: end;
}

.progress-all-done {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.progress-all-done .material-symbols-rounded {
  font-size: 2rem;
}

.progress-all-done p {
  font-size: 0.82rem;
}

.progress-week-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  height: 180px;
  padding-top: 10px;
}

.progress-week-day {
  display: grid;
  grid-template-rows: minmax(90px, 1fr) auto auto;
  gap: 4px;
  min-width: 0;
  text-align: center;
}

.progress-week-bar-track {
  display: flex;
  align-items: flex-end;
  min-height: 90px;
  overflow: hidden;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 8px 8px 3px 3px;
}

.progress-week-bar-track span {
  width: 100%;
  min-height: 5px;
  background: linear-gradient(180deg, var(--mint), var(--violet));
  border-top: 2px solid var(--stroke);
}

.progress-week-day strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.7rem;
  text-overflow: ellipsis;
}

.progress-week-day small {
  color: var(--muted);
  font-size: 0.66rem;
}

.progress-breakdown {
  display: grid;
  gap: 13px;
}

.progress-breakdown-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.progress-breakdown-row > .material-symbols-rounded {
  color: var(--violet-light);
  font-size: 1.2rem;
}

.progress-breakdown-row > div > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.progress-breakdown-row > div > div {
  height: 7px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.progress-breakdown-row i {
  display: block;
  height: 100%;
  background: var(--violet);
}

.progress-activity-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.progress-activity-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.progress-activity-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--on-accent);
  background: var(--violet);
  border: 2px solid var(--stroke);
  border-radius: 50%;
  font-size: 1.15rem;
}

.progress-activity-item > div,
.progress-activity-points {
  display: grid;
  min-width: 0;
}

.progress-activity-item > div strong {
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-activity-item small {
  color: var(--muted);
  font-size: 0.74rem;
}

.progress-activity-points {
  justify-items: end;
  color: var(--mint-text);
}

.progress-activity-points > strong {
  font-family: "Lexend", sans-serif;
}

.progress-activity-points .orb-icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

@container progress-page (max-width: 1050px) {
  .progress-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-level-card {
    grid-column: 1 / -1;
  }

  .progress-content-grid {
    grid-template-columns: 1fr;
  }

  .progress-side-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container progress-page (max-width: 820px) {
  .progress-quest-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .progress-quest-reward {
    justify-content: flex-start;
  }
}

@container progress-page (max-width: 680px) {
  .progress-overview-grid,
  .progress-side-column,
  .progress-activity-list {
    grid-template-columns: 1fr;
  }

  .progress-stat-card {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .progress-nav-button {
    width: 42px;
    padding: 0;
    justify-content: center;
    border-radius: 10px;
  }

  .progress-nav-button > span:last-child {
    display: none;
  }

  .progress-page {
    gap: 16px;
  }

  .progress-page-header {
    min-height: 155px;
    padding: 22px;
  }

  .progress-header-mark {
    width: 76px;
  }

  .progress-overview-grid,
  .progress-side-column,
  .progress-activity-list {
    grid-template-columns: 1fr;
  }

  .progress-level-card {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 15px;
    padding: 18px;
  }

  .progress-level-ring {
    width: 100px;
  }

  .progress-level-ring > span {
    width: 68px;
  }

  .progress-level-ring strong {
    font-size: 1.7rem;
  }

  .progress-quest {
    grid-template-columns: 1fr;
  }

  .progress-quest-heading,
  .progress-quest-footer {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .progress-header-mark {
    display: none;
  }

  .progress-level-card {
    grid-template-columns: 1fr;
  }

  .progress-level-ring {
    margin: 0 auto;
  }

  .progress-quest-heading,
  .progress-quest-footer {
    flex-direction: column;
  }

  .progress-quest-footer button {
    width: 100%;
  }
}

html[data-theme="light"] {
  --ink: #15121f;
  --ink-soft: #433d57;
  --stroke: #111018;
  --paper: #f8f7ff;
  --paper-2: #edeaf7;
  --surface: #ffffff;
  --surface-2: #f0edf8;
  --muted: #665f78;
  --line: #cfc8dd;
  --violet: #6542e5;
  --violet-dark: #5032c4;
  --violet-light: #5032c4;
  --mint: #28b58f;
  --coral: #f06a52;
  --red: #b9233d;
  --gold: #e7ad35;
  --blue: #1268ad;
  --cyan-text: #087383;
  --mint-text: #166c55;
  --gold-text: #765000;
  --coral-text: #ae3423;
  --focus-ring: #111018;
  --scrollbar-thumb: #665f78;
  --scrollbar-track: transparent;
  --on-accent: #111018;
  --on-primary: #ffffff;
  --message-reaction-chip-ink: #15121f;
  --placeholder: #756f83;
  --field-bg: #ffffff;
  --field-bg-2: #f0edf8;
  --chrome-bg: rgba(255, 255, 255, 0.9);
  --sidebar-bg: rgba(255, 255, 255, 0.92);
  --sidebar-shadow: 8px 8px 0 rgba(17, 16, 24, 0.16);
  --scrim: rgba(17, 16, 24, 0.36);
  --modal-backdrop: rgba(17, 16, 24, 0.34);
  --media-scrim-start: rgba(17, 16, 24, 0.08);
  --media-scrim-end: rgba(17, 16, 24, 0.42);
  --grid-line: rgba(17, 16, 24, 0.055);
  --page-bg:
    radial-gradient(circle at 14% 8%, rgba(111, 76, 255, 0.16), transparent 27%),
    radial-gradient(circle at 88% 0%, rgba(40, 181, 143, 0.13), transparent 25%),
    linear-gradient(180deg, #fbfaff, #f1eef8 46%, #fbfaff),
    repeating-linear-gradient(0deg, var(--grid-line) 0 1px, transparent 1px 34px);
  --hero-bg:
    linear-gradient(135deg, rgba(111, 76, 255, 0.13), transparent 48%),
    linear-gradient(120deg, #ffffff, #ece8f7);
  --settings-panel-bg:
    linear-gradient(135deg, rgba(111, 76, 255, 0.09), rgba(255, 255, 255, 0.96)),
    var(--surface);
  --explore-stage-bg:
    linear-gradient(115deg, rgba(111, 76, 255, 0.12), rgba(40, 181, 143, 0.1) 46%, rgba(255, 255, 255, 0.92) 46%),
    var(--surface);
  --room-edit-hero-bg:
    linear-gradient(135deg, rgba(111, 76, 255, 0.18), rgba(40, 181, 143, 0.12) 52%, rgba(255, 255, 255, 0.9));
  --lift-shadow-sm: 4px 4px 0 rgba(17, 16, 24, 0.16);
  --lift-shadow-lg: 7px 7px 0 rgba(17, 16, 24, 0.2);
  --search-overlay-bg:
    linear-gradient(120deg, rgba(246, 243, 255, 0.98), rgba(232, 247, 241, 0.98)),
    var(--paper);
  --shadow: 0 18px 45px rgba(42, 36, 58, 0.16);
}

html[data-theme="ocean"] {
  --ink: #effcff;
  --ink-soft: #c5e5eb;
  --paper: #06141c;
  --paper-2: #0b202b;
  --surface: #102d3a;
  --surface-2: #173b49;
  --muted: #8eb8c2;
  --line: #285264;
  --violet: #2fc7d8;
  --violet-dark: #7de7ef;
  --violet-light: #a6f3f5;
  --mint: #59dda9;
  --focus-ring: #effcff;
  --scrollbar-thumb: #527f8c;
  --placeholder: #719ba5;
  --field-bg: #041017;
  --field-bg-2: #091b24;
  --chrome-bg: rgba(6, 20, 28, 0.9);
  --sidebar-bg: rgba(9, 28, 38, 0.93);
  --page-bg:
    radial-gradient(circle at 15% 8%, rgba(47, 199, 216, 0.2), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(89, 221, 169, 0.12), transparent 25%),
    linear-gradient(180deg, #06141c, #0a2430 46%, #06141c),
    repeating-linear-gradient(0deg, var(--grid-line) 0 1px, transparent 1px 34px);
  --hero-bg: linear-gradient(135deg, rgba(47, 199, 216, 0.18), transparent 48%), linear-gradient(120deg, #102d3a, #071a24);
  --settings-panel-bg: linear-gradient(135deg, rgba(47, 199, 216, 0.14), rgba(16, 45, 58, 0.96)), var(--surface);
}

html[data-theme="sunset"] {
  --ink: #fff6f2;
  --ink-soft: #f0d3cb;
  --paper: #1b0c18;
  --paper-2: #291222;
  --surface: #3a1b30;
  --surface-2: #4a243b;
  --muted: #c59cab;
  --line: #684052;
  --violet: #ff6f91;
  --violet-dark: #ffafbd;
  --violet-light: #ffd0d7;
  --mint: #f6bd54;
  --gold: #f6bd54;
  --focus-ring: #fff6f2;
  --scrollbar-thumb: #916276;
  --placeholder: #a97989;
  --field-bg: #150812;
  --field-bg-2: #24101e;
  --chrome-bg: rgba(27, 12, 24, 0.9);
  --sidebar-bg: rgba(38, 16, 31, 0.93);
  --page-bg:
    radial-gradient(circle at 14% 8%, rgba(255, 111, 145, 0.21), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(246, 189, 84, 0.12), transparent 25%),
    linear-gradient(180deg, #1b0c18, #2b1224 46%, #1b0c18),
    repeating-linear-gradient(0deg, var(--grid-line) 0 1px, transparent 1px 34px);
  --hero-bg: linear-gradient(135deg, rgba(255, 111, 145, 0.2), transparent 48%), linear-gradient(120deg, #3a1b30, #21101d);
  --settings-panel-bg: linear-gradient(135deg, rgba(255, 111, 145, 0.15), rgba(58, 27, 48, 0.96)), var(--surface);
}

html[data-theme="forest"],
html[data-theme="royal"],
html[data-theme="rose"],
html[data-theme="ember"],
html[data-theme="crimson"],
html[data-theme="lime"],
html[data-theme="mono"] {
  --page-bg:
    radial-gradient(circle at 15% 8%, rgba(var(--preset-accent-rgb), 0.21), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(var(--preset-highlight-rgb), 0.12), transparent 25%),
    linear-gradient(180deg, var(--paper), var(--paper-2) 46%, var(--paper)),
    repeating-linear-gradient(0deg, var(--grid-line) 0 1px, transparent 1px 34px);
  --hero-bg: linear-gradient(135deg, rgba(var(--preset-accent-rgb), 0.19), transparent 48%), linear-gradient(120deg, var(--surface), var(--paper));
  --settings-panel-bg: linear-gradient(135deg, rgba(var(--preset-accent-rgb), 0.14), rgba(var(--preset-surface-rgb), 0.96)), var(--surface);
}

html[data-theme="forest"] {
  --ink: #f1fff5; --ink-soft: #ccebd5; --paper: #07150d; --paper-2: #0d2114; --surface: #142b1d; --surface-2: #1d3a28;
  --muted: #94bda0; --line: #315c3e; --violet: #44d17a; --violet-dark: #8aebad; --violet-light: #b8f4cc; --mint: #b8e85c;
  --focus-ring: #f1fff5; --scrollbar-thumb: #568064; --placeholder: #739b7e; --field-bg: #041008; --field-bg-2: #0b1d11;
  --chrome-bg: rgba(7, 21, 13, 0.9); --sidebar-bg: rgba(12, 31, 18, 0.93); --on-accent: #07150d;
  --preset-accent-rgb: 68, 209, 122; --preset-highlight-rgb: 184, 232, 92; --preset-surface-rgb: 20, 43, 29;
}

html[data-theme="royal"] {
  --ink: #f3f6ff; --ink-soft: #d2daf5; --paper: #080d20; --paper-2: #101832; --surface: #172343; --surface-2: #213057;
  --muted: #9ba9d0; --line: #354a79; --violet: #668cff; --violet-dark: #a8bbff; --violet-light: #ced8ff; --mint: #55d6ff;
  --focus-ring: #f3f6ff; --scrollbar-thumb: #60709e; --placeholder: #7e8db4; --field-bg: #050919; --field-bg-2: #0d152c;
  --chrome-bg: rgba(8, 13, 32, 0.9); --sidebar-bg: rgba(14, 21, 47, 0.93); --on-accent: #080d20;
  --preset-accent-rgb: 102, 140, 255; --preset-highlight-rgb: 85, 214, 255; --preset-surface-rgb: 23, 35, 67;
}

html[data-theme="rose"] {
  --ink: #fff5fc; --ink-soft: #f2d2e8; --paper: #190c18; --paper-2: #281226; --surface: #351a31; --surface-2: #482341;
  --muted: #c397b7; --line: #67405f; --violet: #f067c8; --violet-dark: #f7a6df; --violet-light: #ffd0ef; --mint: #ff9f87;
  --focus-ring: #fff5fc; --scrollbar-thumb: #8e5e82; --placeholder: #a9789b; --field-bg: #130812; --field-bg-2: #231020;
  --chrome-bg: rgba(25, 12, 24, 0.9); --sidebar-bg: rgba(38, 17, 35, 0.93); --on-accent: #190c18;
  --preset-accent-rgb: 240, 103, 200; --preset-highlight-rgb: 255, 159, 135; --preset-surface-rgb: 53, 26, 49;
}

html[data-theme="ember"] {
  --ink: #fff8f1; --ink-soft: #f1d7c3; --paper: #190e08; --paper-2: #28170d; --surface: #352012; --surface-2: #492d19;
  --muted: #c3a087; --line: #684a32; --violet: #ff8a3d; --violet-dark: #ffb77f; --violet-light: #ffd4b1; --mint: #ffd166; --gold: #ffd166;
  --focus-ring: #fff8f1; --scrollbar-thumb: #8d684c; --placeholder: #a57e62; --field-bg: #120904; --field-bg-2: #231309;
  --chrome-bg: rgba(25, 14, 8, 0.9); --sidebar-bg: rgba(38, 21, 11, 0.93); --on-accent: #190e08;
  --preset-accent-rgb: 255, 138, 61; --preset-highlight-rgb: 255, 209, 102; --preset-surface-rgb: 53, 32, 18;
}

html[data-theme="crimson"] {
  --ink: #fff5f6; --ink-soft: #f2d1d5; --paper: #19090d; --paper-2: #280f15; --surface: #35141b; --surface-2: #491d26;
  --muted: #c4979e; --line: #69404a; --violet: #ff5267; --violet-dark: #ff98a5; --violet-light: #ffc5cc; --mint: #ff9d58;
  --focus-ring: #fff5f6; --scrollbar-thumb: #90606a; --placeholder: #a87881; --field-bg: #130609; --field-bg-2: #230c11;
  --chrome-bg: rgba(25, 9, 13, 0.9); --sidebar-bg: rgba(38, 14, 19, 0.93); --on-accent: #19090d;
  --preset-accent-rgb: 255, 82, 103; --preset-highlight-rgb: 255, 157, 88; --preset-surface-rgb: 53, 20, 27;
}

html[data-theme="lime"] {
  --ink: #f9ffef; --ink-soft: #dcebc2; --paper: #101507; --paper-2: #19210c; --surface: #242f13; --surface-2: #32401b;
  --muted: #abbc8d; --line: #506332; --violet: #a4dc42; --violet-dark: #caf07f; --violet-light: #e1f8ad; --mint: #50dbc8;
  --focus-ring: #f9ffef; --scrollbar-thumb: #718454; --placeholder: #8c9e6e; --field-bg: #0b0f04; --field-bg-2: #161d09;
  --chrome-bg: rgba(16, 21, 7, 0.9); --sidebar-bg: rgba(24, 31, 11, 0.93); --on-accent: #101507;
  --preset-accent-rgb: 164, 220, 66; --preset-highlight-rgb: 80, 219, 200; --preset-surface-rgb: 36, 47, 19;
}

html[data-theme="mono"] {
  --ink: #f4f5f7; --ink-soft: #d4d6db; --paper: #0e0f12; --paper-2: #17181c; --surface: #22242a; --surface-2: #2d3037;
  --muted: #a4a8b0; --line: #454952; --violet: #d5d7dd; --violet-dark: #eef0f4; --violet-light: #ffffff; --mint: #8e96a8;
  --focus-ring: #ffffff; --scrollbar-thumb: #6d727d; --placeholder: #858a94; --field-bg: #090a0c; --field-bg-2: #141519;
  --chrome-bg: rgba(14, 15, 18, 0.9); --sidebar-bg: rgba(22, 23, 27, 0.93); --on-accent: #0e0f12;
  --preset-accent-rgb: 213, 215, 221; --preset-highlight-rgb: 142, 150, 168; --preset-surface-rgb: 34, 36, 42;
}

* {
  box-sizing: border-box;
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

[hidden] {
  display: none !important;
}

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

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Nunito Sans", system-ui, sans-serif;
  scrollbar-gutter: stable;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.app-sidebar::-webkit-scrollbar,
.modal-backdrop::-webkit-scrollbar,
.auth-modal::-webkit-scrollbar,
.markdown-preview::-webkit-scrollbar,
.topic-strip::-webkit-scrollbar,
.explore-filters::-webkit-scrollbar,
.saved-filters::-webkit-scrollbar {
  display: none;
}

body,
.app-sidebar,
.modal-backdrop,
.auth-modal,
.markdown-preview,
.topic-strip,
.explore-filters,
.saved-filters {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
}

.skip-link {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  z-index: 120;
  padding: 10px 14px;
  color: var(--on-primary);
  background: var(--violet);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--stroke);
  font-weight: 900;
  text-decoration: none;
  transform: translateY(calc(-100% - 24px));
  transition: transform 160ms ease;
}

.skip-link:focus {
  outline: 0;
  transform: translateY(0);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--page-bg);
  pointer-events: none;
}

body.is-booting main,
body.is-booting .mobile-nav,
body.is-booting .app-sidebar {
  opacity: 0;
  pointer-events: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px clamp(18px, 2.6vw, 56px);
  background: var(--chrome-bg);
  border-bottom: 3px solid var(--stroke);
  backdrop-filter: blur(18px);
}

.desktop-nav {
  display: none;
}

.topbar-actions {
  margin-left: auto;
}

.app-sidebar {
  position: fixed;
  top: 100px;
  bottom: 18px;
  left: 18px;
  z-index: 18;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  width: 214px;
  padding: 12px;
  background: var(--sidebar-bg);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--sidebar-shadow), var(--shadow);
  backdrop-filter: blur(18px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-nav,
.sidebar-tools {
  display: grid;
  align-content: start;
  gap: 8px;
}

.sidebar-tools {
  padding-top: 12px;
  border-top: 2px solid var(--line);
}

.app-sidebar .nav-item {
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
}

.sidebar-account-media {
  display: inline-grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
}

.sidebar-account-media img {
  display: block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--stroke);
  border-radius: 50%;
  object-fit: cover;
}

.sidebar-account-button [data-auth-label] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand {
  position: absolute;
  left: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 214px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
  border: 3px solid var(--stroke);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 2px 2px 0 var(--violet);
}

.brand span {
  white-space: nowrap;
}

.search {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(680px, calc(100vw - 520px));
  max-width: 680px;
  min-width: 0;
  padding: 10px 14px;
  background: var(--surface);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search input:focus,
.search input:focus-visible {
  outline: 0;
  box-shadow: none;
}

.search input::placeholder {
  color: var(--placeholder);
}

body.search-open {
  overflow: hidden;
}

body.modal-open {
  overflow: hidden;
}

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  padding: 92px clamp(14px, 3vw, 34px) 24px;
  background: var(--search-overlay-bg);
}

.search-overlay.is-open {
  display: block;
}

.search-overlay-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  width: min(1180px, 100%);
  max-height: 100%;
  margin: 0 auto;
}

.search-overlay-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.search-overlay-head h2 {
  margin-top: 4px;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.98;
}

.search-overlay-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
}

.search-overlay-form:focus-within {
  border-color: var(--violet);
  box-shadow: none;
}

.search-overlay-form > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
}

.search-overlay-form input {
  width: 100%;
  min-width: 0;
  height: 48px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.search-overlay-form input::placeholder {
  color: var(--placeholder);
}

.search-overlay-form input:focus,
.search-overlay-form input:focus-visible {
  outline: 0;
  box-shadow: none;
}

.search-overlay-form input::-webkit-search-decoration,
.search-overlay-form input::-webkit-search-cancel-button {
  appearance: none;
}

.search-overlay-body {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: none;
}

.search-overlay-body::-webkit-scrollbar {
  display: none;
}

.search-overlay-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 14px;
}

.search-overlay-panel,
.search-overlay-empty {
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
}

.search-overlay-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.search-overlay-empty {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: clamp(18px, 3vw, 28px);
}

.search-overlay-empty > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: var(--on-accent);
  background: var(--gold);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
}

.search-overlay-empty h3,
.search-result-overview h3,
.search-primary-result h4,
.search-list h4 {
  margin: 0;
}

.search-overlay-empty p,
.search-primary-result p,
.search-list p {
  color: var(--muted);
  line-height: 1.5;
}

.search-overlay-hero {
  min-height: 220px;
}

.search-result-overview {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 18px;
  background: linear-gradient(120deg, rgba(122, 85, 255, 0.2), rgba(78, 201, 176, 0.12));
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
}

.search-result-overview h3 {
  font-size: clamp(1.8rem, 3vw, 3.1rem);
  line-height: 1;
}

.search-count-row,
.search-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-count-row span,
.search-chip-list button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
}

.search-chip-list button {
  cursor: pointer;
}

.search-chip-list button:hover,
.search-list article:hover,
.search-primary-result:hover,
.search-writer-row:hover {
  border-color: var(--violet);
}

.search-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.search-section-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.search-section-head span,
.search-list small,
.search-writer-row small,
.search-empty-card span {
  color: var(--muted);
  font-weight: 900;
}

.search-list,
.search-people-list {
  display: grid;
  gap: 10px;
}

.search-list article,
.search-primary-result,
.search-writer-row,
.search-empty-card {
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.search-list article,
.search-primary-result {
  display: grid;
  gap: 8px;
  padding: 14px;
  cursor: pointer;
}

.search-writer-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.search-writer-row .avatar {
  width: 42px;
  height: 42px;
}

.search-writer-row span {
  display: grid;
  gap: 2px;
}

.search-empty-card {
  display: grid;
  gap: 4px;
  padding: 14px;
}

.desktop-nav,
.topbar-actions,
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-nav {
  display: none;
}

.nav-item,
.ghost-button,
.primary-button,
.secondary-button,
.text-command,
.icon-button,
.topic,
.follow-list button {
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.nav-item:hover,
.ghost-button:hover,
.primary-button:hover,
.secondary-button:hover,
.text-command:hover,
.icon-button:hover,
.topic:hover,
.follow-list button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--stroke);
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
}

.nav-item.is-active,
.primary-button,
.icon-button.is-active,
.icon-button.is-saved {
  background: var(--violet);
  color: var(--on-primary);
  border-color: var(--stroke);
}

.primary-button,
.ghost-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
}

.primary-button {
  box-shadow: 4px 4px 0 var(--stroke);
}

.secondary-button {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--stroke);
}

.ghost-button {
  background: var(--blue);
  color: var(--on-primary);
}

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
}

.icon-button > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 1em;
  height: 1em;
  overflow: hidden;
  line-height: 1;
  font-size: 24px;
  white-space: nowrap;
  transform: translateY(0);
}

.topbar-actions .icon-button {
  display: none;
}

.topbar-actions .ghost-button {
  display: none;
}

.mobile-menu-button,
.mobile-search-button,
.mobile-sidebar-backdrop,
.mobile-sidebar-header,
.mobile-sidebar-section-label {
  display: none;
}

.nav-item.has-unread::after,
.icon-button.has-unread::after {
  content: attr(data-unread-count);
  position: absolute;
  top: -7px;
  right: -7px;
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 1000;
  line-height: 1;
}

.icon-button.small {
  width: 34px;
  height: 34px;
}

.icon-button.small > .material-symbols-rounded {
  font-size: 19px;
}

.floating-panel {
  position: fixed;
  top: 88px;
  right: clamp(18px, 2.6vw, 56px);
  z-index: 50;
  display: none;
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding: 14px;
  background: var(--paper-2);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 8px 8px 0 var(--stroke), var(--shadow);
}

.floating-panel.is-open {
  display: grid;
  gap: 12px;
}

.floating-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.floating-header strong,
.floating-label {
  font-weight: 900;
}

.floating-header button,
.floating-section button,
.reply-composer button {
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
}

.floating-section {
  display: grid;
  gap: 8px;
}

.floating-section button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  text-align: left;
}

.floating-section small,
.floating-section p {
  color: var(--muted);
}

.floating-section .is-unread {
  background: rgba(122, 85, 255, 0.22);
}

.reply-panel {
  display: grid;
  align-content: start;
  gap: clamp(12px, 1.6vw, 18px);
  width: 100%;
  max-width: 940px;
  margin-top: clamp(24px, 4vw, 42px);
  padding: clamp(14px, 2vw, 22px);
  background: rgba(255, 255, 255, 0.035);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.reply-panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding-bottom: clamp(12px, 1.8vw, 16px);
  border-bottom: 2px solid var(--line);
}

.reply-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.reply-heading > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: clamp(34px, 4vw, 38px);
  height: clamp(34px, 4vw, 38px);
  color: var(--gold);
  background: rgba(255, 196, 69, 0.12);
  border: 2px solid var(--line);
  border-radius: 8px;
  flex: 0 0 auto;
}

.reply-panel .reply-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.85rem, 4.4vw, 2.65rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.reply-panel .reply-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: clamp(0.86rem, 1.8vw, 0.94rem);
  font-weight: 800;
  line-height: 1.3;
}

.reply-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.reply-list {
  display: grid;
  gap: 12px;
}

.reply-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.reply-item.is-pending {
  border-color: rgba(255, 196, 69, 0.52);
  background: rgba(255, 196, 69, 0.08);
}

.reply-content {
  min-width: 0;
}

.reply-meta,
.reply-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reply-meta strong {
  color: var(--ink);
  line-height: 1.2;
}

.reply-author-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.reply-meta span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.reply-panel .reply-item p {
  margin: 8px 0 14px;
  color: var(--ink-soft);
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.reply-review-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 30px;
  margin: -2px 0 14px;
  padding: 0 10px;
  color: var(--gold);
  background: rgba(255, 196, 69, 0.12);
  border: 2px solid rgba(255, 196, 69, 0.42);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 1000;
}

.reply-review-state .material-symbols-rounded {
  font-size: 1rem;
}

.reply-item small {
  color: var(--mint);
  font-weight: 900;
}

.reply-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.reply-actions button,
.reply-edit-form button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--stroke);
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.reply-actions button:hover,
.reply-edit-form button:hover {
  background: var(--violet);
  color: var(--on-primary);
}

.reply-edit-form {
  display: grid;
  gap: 10px;
}

.reply-edit-form[hidden] {
  display: none;
}

.reply-edit-form textarea,
.reply-composer textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font: inherit;
}

.reply-edit-form textarea {
  resize: vertical;
  min-height: 92px;
}

.reply-composer textarea {
  resize: none;
  min-height: 54px;
  max-height: 76px;
  line-height: 1.45;
  overflow-y: auto;
  scrollbar-width: none;
}

.reply-composer textarea::-webkit-scrollbar {
  display: none;
}

.reply-edit-form > div {
  display: flex;
  gap: 8px;
}

.reply-item.is-editing .reply-body,
.reply-item.is-editing .reply-actions {
  display: none;
}

.reply-empty {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: clamp(14px, 2vw, 18px);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
}

.reply-panel .reply-empty p {
  margin: 0;
  min-width: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.reply-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(104px, 14vw, 128px);
  gap: 12px;
  align-items: end;
  padding-top: 2px;
}

.reply-composer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  background: var(--gold);
  color: var(--on-accent);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font-weight: 1000;
  cursor: pointer;
}

@media (max-width: 680px) {
  .reply-panel-header,
  .reply-footer {
    align-items: start;
  }

  .reply-panel-header {
    grid-template-columns: 1fr;
  }

  .reply-count-pill {
    align-self: flex-start;
    justify-self: start;
  }

  .reply-item {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .reply-footer {
    flex-direction: column;
  }

  .reply-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .reply-actions button {
    flex: 1 1 98px;
    justify-content: center;
  }

  .reply-composer {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .reply-composer button {
    min-height: 48px;
  }
}

.material-symbols-rounded {
  font-size: 21px;
  line-height: 1;
}

main {
  margin-left: 244px;
  padding: 34px clamp(18px, 2.6vw, 56px) 96px;
}

.view {
  display: none;
  scroll-margin-top: 108px;
}

.view.is-active {
  display: block;
}

.view.is-active.is-view-entering {
  animation: view-enter-forward 180ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.view.is-active.is-view-entering-back {
  animation: view-enter-back 180ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

@keyframes view-enter-forward {
  from {
    opacity: 0.78;
  }
  to {
    opacity: 1;
  }
}

@keyframes view-enter-back {
  from {
    opacity: 0.78;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .view.is-active.is-view-entering,
  .view.is-active.is-view-entering-back {
    animation: none;
  }
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: clamp(24px, 3vw, 48px);
  min-width: 0;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
}

#pulse .layout {
  grid-template-columns: minmax(0, 1fr);
  max-width: min(1140px, 100%);
}

.feed-column {
  min-width: 0;
}

.section-heading,
.writer-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

#pulse .section-heading {
  position: relative;
  justify-content: center;
  align-items: center;
  min-height: 86px;
  padding-inline: 0;
  text-align: center;
}

#pulse .section-heading h1 {
  max-width: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--violet-dark);
  font-size: 0.77rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1,
.feature-story h2 {
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-weight: 900;
}

h1 {
  max-width: 920px;
  font-size: clamp(2rem, 4.1vw, 4.2rem);
  line-height: 1.04;
}

.text-command {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 12px;
  background: var(--gold);
  color: var(--on-accent);
}

.pulse-browse-command {
  flex: 0 0 auto;
  min-height: 52px;
  font-weight: 900;
}

.topic-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 8px 0 22px;
  max-width: 100%;
  overflow-x: visible;
  scrollbar-width: none;
}

@media (min-width: 781px) {
  .topic-strip {
    justify-content: center;
  }
}

.pulse-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 1 auto;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  min-height: 52px;
  padding: 6px;
  background: rgba(122, 85, 255, 0.12);
  border: 2px solid rgba(122, 85, 255, 0.28);
  border-radius: 10px;
  scrollbar-width: none;
}

.pulse-filter-group::-webkit-scrollbar {
  display: none;
}

.pulse-source-filter {
  background: rgba(255, 203, 71, 0.14);
  border-color: rgba(255, 203, 71, 0.38);
}

.pulse-source-filter .topic.is-active {
  background: var(--gold);
  color: var(--on-accent);
}

.topic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 1 auto;
  min-height: 38px;
  padding: 9px 13px;
}

.topic small {
  display: inline-grid;
  place-items: center;
  min-width: 1.7em;
  min-height: 1.7em;
  padding: 0 6px;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1;
}

.topic span {
  min-width: 0;
  max-width: min(18rem, 56vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic.is-active {
  background: var(--ink);
  color: var(--paper);
}

.topic:not(.is-active) {
  background: var(--surface);
  border-color: var(--stroke);
  color: var(--ink);
}

.feature-story,
.story-card,
.panel,
.space-card,
.explore-hero,
.editor-shell,
.auth-modal {
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.feature-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 38%);
  gap: 22px;
  margin-bottom: 18px;
  overflow: hidden;
}

.story-copy {
  padding: clamp(22px, 4vw, 38px);
}

.writer-row,
.story-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.author-link {
  cursor: pointer;
}

button.author-link {
  width: fit-content;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  text-align: left;
}

.author-link:focus-visible {
  outline: 4px solid var(--focus-ring);
  outline-offset: 4px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  position: relative;
  width: 30px;
  height: 30px;
  border: 2px solid var(--stroke);
  border-radius: 50%;
  color: var(--entity-accent-ink, var(--on-accent));
  font-weight: 900;
  flex: 0 0 auto;
}

.image-avatar {
  overflow: visible;
  background: var(--paper-2);
}

.image-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.online-status-dot {
  position: absolute;
  z-index: 2;
  right: -2px;
  bottom: -2px;
  width: 24%;
  min-width: 10px;
  max-width: 22px;
  aspect-ratio: 1;
  border: 3px solid var(--paper-2);
  border-radius: 50%;
  background: #23a559;
  box-shadow: 0 0 0 1px rgba(4, 9, 22, 0.22);
  pointer-events: none;
}

.minecraft-status-badge {
  position: absolute;
  z-index: 2;
  right: -4px;
  bottom: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border: 2px solid var(--paper-2);
  border-radius: 50%;
  color: var(--cyan-text);
  font-size: 17px;
  font-variation-settings: "FILL" 0, "wght" 700, "GRAD" 0, "opsz" 20;
  line-height: 1;
  background: var(--paper-2);
  box-shadow: 0 0 0 1px rgba(4, 9, 22, 0.22);
  pointer-events: none;
}

.profile-avatar .minecraft-status-badge {
  right: -2px;
  bottom: -3px;
  width: 25px;
  height: 25px;
  font-size: 22px;
}

.image-thumb {
  overflow: hidden;
  background: var(--field-bg);
}

.image-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.avatar-coral {
  background: var(--coral);
}

.avatar-mint {
  background: var(--mint);
}

.avatar-gold {
  background: var(--gold);
}

.avatar-violet {
  background: #a996ff;
}

.suspended-avatar {
  background: color-mix(in srgb, var(--ink-muted, #777) 18%, var(--paper-2, #fff));
  color: var(--ink-muted, #777);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 24%, transparent);
}

.suspended-avatar .material-symbols-rounded {
  font-size: 0.95em;
}

.suspended-account-label {
  color: var(--ink-muted, #777);
  font-style: italic;
}

.custom-accent-avatar {
  background: var(--entity-accent, var(--violet));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--entity-accent, var(--violet)) 42%, transparent);
}

.image-avatar.custom-accent-avatar {
  background: var(--paper-2);
  box-shadow: 0 0 0 2px var(--entity-accent, var(--violet));
}

a[href]:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:not([tabindex="-1"]):not(input):not(textarea):not(select):not([contenteditable="true"]):focus-visible {
  outline: 4px solid var(--focus-ring);
  outline-offset: 3px;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.feature-story h2 {
  margin-top: 16px;
  font-size: clamp(1.9rem, 3.6vw, 3.55rem);
  line-height: 1.04;
}

.feature-story p,
.story-card p,
.space-card p,
.panel p {
  color: var(--muted);
  line-height: 1.65;
}

.story-meta {
  margin-top: 18px;
}

.story-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.story-meta button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 9px;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.orb-icon {
  display: inline-block;
  width: 1.08em;
  height: 1.08em;
  flex: 0 0 auto;
  object-fit: contain;
  vertical-align: -0.16em;
}

.panel-title .orb-icon {
  width: 1.25em;
  height: 1.25em;
}

.profile-post-card .story-meta .profile-list-orb-icon {
  width: 22px;
  height: 22px;
  margin-right: 2px;
  vertical-align: middle;
}

.rating-widget {
  display: none;
}

.orb-signal {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: var(--ink);
}

.orb-signal > strong,
.orb-signal > span,
.orb-signal > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 900;
}

.orb-signal > strong {
  background: var(--gold);
  color: var(--on-accent);
}

.orb-signal-icon-box,
.orb-signal > span > .material-symbols-rounded {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 2px solid var(--stroke);
  border-radius: calc(var(--radius) - 2px);
  background: var(--paper-2);
  color: var(--ink);
  line-height: 1;
}

.orb-signal-icon-box .orb-signal-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
}

.orb-signal > button {
  cursor: pointer;
}

.orb-signal > button:hover,
.orb-signal > button:focus-visible {
  background: var(--violet);
  color: var(--on-primary);
  outline: 0;
}

.compact-rating,
.rating-label {
  display: none;
}

.star-row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.star-row button {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.star-row button.is-active {
  color: var(--gold);
}

.star-row .material-symbols-rounded {
  font-size: 20px;
  font-variation-settings: "FILL" 1;
}

.star-row button:hover,
.star-row button:focus-visible {
  color: var(--gold);
  outline: 0;
}

.story-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
  background:
    linear-gradient(135deg, #05050b 0 58%, #2a263a 58%),
    #05050b;
  border-left: 3px solid var(--stroke);
}

.mascot-mark {
  display: grid;
  place-items: center;
  width: min(68%, 230px);
  aspect-ratio: 1;
  background: #fff;
  border: 5px solid var(--stroke);
  border-radius: 24px 48px 24px 48px;
  color: var(--violet);
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: 7rem;
  font-weight: 900;
  box-shadow: 7px 7px 0 var(--violet);
}

.orb-score {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 10px 12px;
  background: var(--gold);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--stroke);
  color: var(--on-accent);
}

.orb-score span,
.orb-score strong {
  display: block;
}

.orb-score span {
  font-size: 0.77rem;
  font-weight: 900;
}

.orb-score strong {
  font-size: 1.8rem;
  line-height: 1;
}

.story-list {
  display: grid;
  gap: 14px;
}

.list-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.list-pager span {
  min-width: 0;
  color: var(--muted);
  font-weight: 900;
}

.list-pager button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: 8px;
  font-weight: 1000;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--stroke);
}

.list-pager button .material-symbols-rounded {
  color: var(--on-accent);
}

.list-pager button:hover,
.list-pager button:focus-visible {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--stroke);
}

.story-list > .list-pager,
.room-browser-grid > .list-pager,
.saved-grid > .list-pager,
.profile-posts > .list-pager,
.admin-list > .list-pager,
.notification-feed > .list-pager,
.owned-room-list > .list-pager {
  grid-column: 1 / -1;
}

.pulse-feed-card {
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 18px;
  align-items: start;
  padding: 16px;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.pulse-feed-card.no-media {
  grid-template-columns: minmax(0, 1fr);
}

.pulse-feed-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.pulse-feed-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pulse-feed-kicker > span,
.pulse-feed-kicker > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
}

.pulse-feed-kicker > span {
  background: var(--mint);
  color: var(--on-accent);
  border-color: var(--stroke);
}

.pulse-feed-kicker .material-symbols-rounded {
  display: inline-block;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: currentColor;
  font-size: 18px;
}

.pulse-feed-kicker button {
  cursor: pointer;
}

.pulse-feed-card h3 {
  margin-top: 0;
  font-size: clamp(1.2rem, 2vw, 1.62rem);
  line-height: 1.12;
}

.pulse-feed-card p {
  margin: 0;
}

.pulse-feed-thumb {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 118px;
  aspect-ratio: 1;
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  color: var(--on-accent);
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: 2.4rem;
  font-weight: 900;
}

.pulse-post-body {
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.55;
}

.pulse-post-body.social-post-markdown {
  margin: 0;
}

.pulse-feed-card .story-meta {
  margin-top: 0;
}

.pulse-feed-card .story-meta .icon-button.small {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  line-height: 0;
}

.pulse-feed-card .story-meta .icon-button.small > .material-symbols-rounded {
  display: block;
  width: auto;
  height: auto;
  font-size: 20px;
  line-height: 1;
  transform: translateY(-1px);
}

.pulse-feed-empty {
  align-items: start;
}

.pulse-feed-empty .primary-button {
  margin-top: 12px;
}

.story-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 152px;
  gap: 24px;
  align-items: center;
  padding: 18px;
}

.story-card h3 {
  margin-top: 10px;
  font-size: clamp(1.25rem, 2.4vw, 1.85rem);
  line-height: 1.08;
}

.clickable-story {
  cursor: pointer;
}

.clickable-story:hover,
.clickable-story:focus-visible {
  background:
    linear-gradient(90deg, rgba(122, 85, 255, 0.1), transparent 42%),
    var(--surface-2);
  border-color: var(--stroke);
  box-shadow: var(--lift-shadow-sm);
}

.clickable-story:focus-visible {
  outline: 4px solid rgba(122, 85, 255, 0.55);
  outline-offset: 4px;
}

.thumbnail {
  display: grid;
  place-items: center;
  width: 152px;
  aspect-ratio: 1;
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  color: var(--on-accent);
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-weight: 900;
  text-align: center;
}

.thumb-ink {
  background: var(--field-bg);
  color: var(--on-primary);
  box-shadow: 3px 3px 0 var(--violet);
}

.thumb-mint {
  background: var(--mint);
  box-shadow: 6px 6px 0 var(--gold);
}

.thumb-coral {
  background: var(--coral);
  box-shadow: 6px 6px 0 var(--blue);
}

.side-rail {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  position: sticky;
  top: 104px;
}

@media (max-width: 1500px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .side-rail {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  }
}

.panel {
  min-width: 0;
  max-width: 100%;
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.panel-title h2 {
  font-size: 1rem;
}

.room-rail-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.room-rail-group {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.room-rail-group + .room-rail-group {
  padding-top: 14px;
  border-top: 2px solid var(--line);
}

.room-rail-heading {
  margin-bottom: 0;
}

.orb-balance-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.orb-balance-icon {
  width: 2.85rem;
  height: 2.85rem;
  object-fit: contain;
  transform: translateY(1px);
}

.orb-panel strong {
  display: inline-block;
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: 3rem;
  line-height: 0.9;
  transform: translateY(-1px);
}

.profile-rating-panel > strong {
  display: block;
  margin-bottom: 8px;
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: 2.45rem;
  line-height: 1;
}

.profile-rating-panel small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.rank-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trend-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-list li,
.trend-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.rank-list span,
.trend-list span {
  color: var(--violet);
  font-weight: 900;
}

.trend-list li > div,
.rank-list li > div {
  min-width: 0;
}

.trend-list strong,
.rank-list strong {
  display: block;
}

.rank-list small,
.trend-list small,
.follow-list small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: normal;
}

.rail-empty {
  width: 100%;
  padding: 12px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.trend-list .rail-empty,
.writer-stack .rail-empty {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.rail-empty > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--violet-dark);
}

.rail-empty strong {
  display: block;
  margin-bottom: 3px;
}

.follow-list {
  display: grid;
  gap: 14px;
}

.follow-list > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.follow-list p {
  margin: 0;
  line-height: 1.2;
}

.follow-list button {
  padding: 7px 10px;
  background: var(--mint);
  color: var(--on-accent);
  border-color: var(--stroke);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: clamp(24px, 3vw, 48px);
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
  container-type: inline-size;
}

.social-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: min(940px, calc(100vw - 48px));
  width: 100%;
  margin: 0 auto;
}

.social-main {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.social-header,
.social-composer,
.social-post,
.social-empty {
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
}

.social-header {
  padding: clamp(20px, 3vw, 32px);
}

.social-header h1 {
  max-width: 760px;
  font-size: clamp(2.2rem, 4vw, 4.25rem);
  line-height: 1.02;
}

.social-header p:not(.eyebrow) {
  max-width: 620px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.65;
}

.social-composer {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.social-composer.is-disabled {
  opacity: 0.82;
}

.social-composer button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.social-composer-user {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.social-composer-user .avatar {
  width: 34px;
  height: 34px;
  align-self: start;
}

.social-composer-user strong,
.social-composer-user small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-composer-user strong {
  color: var(--ink);
  font-weight: 1000;
}

.social-composer-user small {
  color: var(--violet-dark);
  font-weight: 900;
}

.social-room-picker,
.social-topic-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-room-picker[hidden] {
  display: none;
}

.social-room-picker button,
.social-post-room {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.social-room-picker button.is-selected,
.social-topic-bar button.is-selected,
.social-room-select-button.is-selected {
  color: var(--on-primary);
  background: var(--violet);
  border-color: var(--stroke);
}

.social-topic-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: stretch;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.social-room-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.social-saved-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 58px;
  padding: 10px 16px;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.social-room-select-button:hover,
.social-saved-filter:hover {
  border-color: var(--stroke);
  transform: translateY(-1px);
}

.social-topic-bar > button {
  min-width: 0;
}

.social-room-select-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  text-align: left;
}

.social-room-select-main > span:last-child {
  min-width: 0;
}

.social-room-select-main strong,
.social-room-select-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-room-select-main strong {
  font-weight: 1000;
}

.social-room-select-main small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 900;
}

.social-room-select-button.is-selected .social-room-select-main small {
  color: var(--on-primary);
}

.social-composer-row {
  display: block;
}

.social-composer textarea {
  width: 100%;
  min-height: 118px;
  resize: none;
  padding: 12px 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 1.02rem;
  line-height: 1.55;
  scrollbar-width: none;
}

.social-composer textarea::-webkit-scrollbar {
  display: none;
}

.social-composer textarea::placeholder {
  color: var(--muted);
}

.social-composer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 2px solid var(--line);
}

.social-image-button,
.social-poll-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font-weight: 900;
  cursor: pointer;
}

.social-poll-toggle.is-selected {
  color: var(--on-primary);
  background: var(--violet);
  border-color: var(--stroke);
}

.social-poll-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.social-poll-editor[hidden] {
  display: none;
}

.social-poll-editor label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.social-poll-editor input {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: none;
}

.social-poll-mode-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 2px 0 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-transform: none;
  cursor: pointer;
}

.social-poll-mode-toggle input {
  position: absolute;
  inset: 0 auto auto 0;
  width: 42px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.social-poll-switch {
  position: relative;
  width: 42px;
  height: 24px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.social-poll-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: var(--muted);
  border-radius: 999px;
  transition: transform 0.18s ease, background 0.18s ease;
}

.social-poll-mode-toggle input:checked + .social-poll-switch {
  background: rgba(122, 85, 255, 0.22);
  border-color: var(--violet);
}

.social-poll-mode-toggle input:checked + .social-poll-switch::after {
  transform: translateX(18px);
  background: var(--violet);
}

.social-poll-mode-toggle input:focus-visible + .social-poll-switch {
  outline: 3px solid rgba(122, 85, 255, 0.28);
  outline-offset: 2px;
}

.social-poll-mode-copy {
  display: grid;
  gap: 2px;
}

.social-poll-mode-copy strong {
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.social-poll-mode-copy small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
}

.social-poll-option-list {
  display: grid;
  gap: 8px;
}

.social-poll-option-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
}

.social-poll-option-input button,
.social-poll-editor-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.social-poll-option-input button:disabled,
.social-poll-editor-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.social-poll-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-image-preview {
  display: grid;
  gap: 8px;
  width: min(100%, 420px);
}

.social-image-preview[hidden] {
  display: none;
}

.social-image-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  overflow: hidden;
  background: var(--stroke);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.social-image-preview-1 {
  grid-template-columns: minmax(0, 1fr);
}

.social-image-preview figure {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  margin: 0;
  background: var(--field-bg);
}

.social-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-image-preview button {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #fff;
  background: rgba(15, 15, 22, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.social-image-preview small {
  color: var(--muted);
  font-weight: 900;
}

.social-composer-actions > span {
  color: var(--muted);
  font-weight: 900;
}

.social-composer-actions > span.is-near-limit {
  color: var(--gold);
}

.social-feed {
  display: grid;
  gap: 10px;
}

.social-post {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  cursor: pointer;
}

.social-post-body {
  min-width: 0;
}

.social-inline-edit {
  display: grid;
  gap: 8px;
  min-width: 0;
  width: 100%;
  margin: 6px 0;
}

.social-inline-edit textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--field-bg);
  border: 2px solid var(--stroke);
  border-radius: 10px;
  font: inherit;
  line-height: 1.45;
}

.social-inline-edit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.social-inline-edit-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.social-inline-edit-actions > span.is-near-limit {
  color: var(--gold);
}

.social-inline-edit-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
}

.social-inline-edit-actions button[type="submit"] {
  color: var(--on-primary);
  background: var(--violet);
  border-color: var(--stroke);
}

.social-post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.social-post-meta strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-post-meta span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.social-post-room {
  margin-top: 8px;
  min-height: 30px;
  padding: 5px 9px;
  color: var(--mint);
}

.social-post-room .material-symbols-rounded {
  font-size: 1.05rem;
}

.social-post-body .social-post-markdown {
  margin: 8px 0 12px;
  color: var(--ink-soft);
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.social-post-markdown p,
.social-post-markdown ul,
.social-post-markdown ol,
.social-post-markdown blockquote {
  margin: 0 0 0.65em;
}

.social-post-markdown > :last-child {
  margin-bottom: 0;
}

.social-post-markdown ul,
.social-post-markdown ol {
  padding-left: 1.35em;
}

.social-post-markdown li + li {
  margin-top: 0.25em;
}

.social-post-markdown blockquote {
  padding-left: 0.85em;
  color: var(--muted);
  border-left: 3px solid var(--line);
}

.social-post-markdown code {
  padding: 0.12em 0.32em;
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.92em;
}

.social-post-markdown a {
  color: var(--mint);
  font-weight: 900;
}

.profile-mention {
  display: inline;
  padding: 0;
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 1000;
  cursor: pointer;
}

.profile-mention {
  color: var(--violet-light);
}

.profile-mention:hover,
.profile-mention:focus-visible {
  color: var(--gold);
}

.social-post-gallery {
  position: relative;
  display: grid;
  width: min(100%, 520px);
  max-height: 520px;
  aspect-ratio: 16 / 11;
  gap: 3px;
  overflow: hidden;
  margin: 10px 0 12px;
  background: var(--stroke);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.social-post-gallery-detail {
  width: min(100%, 720px);
  max-height: 720px;
}

.social-post-gallery-1 {
  display: block;
  width: fit-content;
  max-width: min(100%, 520px);
  aspect-ratio: auto;
  max-height: none;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.social-post-gallery-1 .social-gallery-tile {
  display: block;
  max-width: 100%;
  aspect-ratio: auto;
  background: transparent;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.social-post-gallery-1 .social-gallery-tile img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
}

.social-post-gallery-1.social-post-gallery-detail {
  max-width: min(100%, 720px);
}

.social-post-gallery-1.social-post-gallery-detail .social-gallery-tile img {
  max-height: min(72vh, 820px);
}

.social-post-gallery-2,
.social-post-gallery-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.social-post-gallery-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.social-post-gallery-3 .social-gallery-tile:first-child {
  grid-row: span 2;
}

.social-gallery-tile {
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: var(--field-bg);
  border: 0;
  cursor: pointer;
}

.social-gallery-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.16s ease;
}

.social-gallery-tile:hover img,
.social-gallery-tile:focus-visible img {
  transform: scale(1.025);
}

.social-gallery-tile:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -4px;
}

.social-gallery-count,
.pulse-image-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  color: #fff;
  background: rgba(15, 15, 22, 0.76);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 1000;
}

.social-poll {
  display: grid;
  gap: 10px;
  margin: 10px 0 12px;
  padding: 12px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.social-poll-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.social-poll-header > strong {
  color: var(--ink);
  font-weight: 1000;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.social-poll-header > small {
  flex: 0 0 auto;
  padding: 4px 7px;
  color: var(--muted);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 1000;
  white-space: nowrap;
}

.social-poll-options {
  display: grid;
  gap: 8px;
}

.social-poll-options button {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.social-poll-options button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--poll-percent, 0%);
  background: rgba(73, 213, 178, 0.18);
  pointer-events: none;
}

.social-poll-options button.is-selected {
  border-color: var(--mint);
}

.social-poll-options span,
.social-poll-options small {
  position: relative;
  min-width: 0;
}

.social-poll-options span {
  overflow-wrap: anywhere;
  text-align: left;
  font-weight: 1000;
}

.social-poll-options small {
  justify-self: end;
  color: var(--muted);
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.social-poll-options small em {
  display: inline-block;
  margin-right: 6px;
  color: var(--mint);
  font-style: normal;
}

.social-poll-footer {
  display: flex;
  justify-content: flex-end;
}

.social-poll-results-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.social-poll-results-button .material-symbols-rounded {
  font-size: 18px;
}

.social-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-post-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.social-post-actions button.is-active {
  color: var(--on-primary);
  background: var(--red);
  border-color: var(--stroke);
}

.social-post-actions [data-social-delete] {
  border-radius: 999px;
}

.room-short-post-section {
  display: grid;
  gap: 10px;
}

.room-short-post-section .social-post {
  box-shadow: none;
}

.social-empty {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px;
}

.social-empty > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: 10px;
}

.social-empty p {
  margin-top: 4px;
  color: var(--muted);
}

.social-detail-layout {
  display: grid;
  gap: 14px;
  width: min(920px, 100%);
  margin: 0 auto;
}

.social-detail-back {
  justify-self: start;
}

.social-detail-post {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 34px);
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.social-detail-author {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.social-detail-author .avatar {
  width: 58px;
  height: 58px;
  font-size: 1.6rem;
  line-height: 1;
}

.social-detail-author h1 {
  font-size: clamp(1.55rem, 3vw, 2.7rem);
  line-height: 1.05;
}

.social-detail-author > div > span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 900;
}

.social-detail-body {
  color: var(--ink);
  font-size: clamp(1.15rem, 2.3vw, 1.65rem);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.social-detail-body.social-post-markdown {
  margin: 0;
}

.social-detail-image {
  width: 100%;
  max-height: min(72vh, 820px);
  object-fit: contain;
  background: var(--field-bg);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
}

.social-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
  border-top: 2px solid var(--line);
}

.social-detail-actions button,
.social-detail-actions > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
}

.social-detail-actions .material-symbols-rounded {
  padding: 0;
  background: transparent;
  border: 0;
}

.social-detail-actions button.is-active {
  color: var(--on-primary);
  background: var(--red);
  border-color: var(--stroke);
}

.social-comments {
  display: grid;
  gap: 12px;
}

.social-comments h2 {
  font-size: 1.2rem;
}

.social-comment-form {
  display: grid;
  gap: 10px;
}

.social-comment-reply-context {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--violet) 12%, var(--paper-2));
  border: 2px solid var(--line);
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 900;
}

.social-comment-reply-context[hidden] {
  display: none;
}

.social-comment-reply-context > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-comment-form .social-comment-reply-context button {
  flex: 0 0 auto;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  margin-left: auto;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 50%;
}

.social-comment-input {
  display: grid;
  gap: 6px;
}

.social-comment-form textarea {
  width: 100%;
  min-height: 82px;
  resize: none;
  padding: 12px;
  color: var(--ink);
  background: var(--field-bg);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font: inherit;
  scrollbar-width: none;
}

.social-comment-form textarea::-webkit-scrollbar {
  display: none;
}

.social-comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.social-comment-actions span {
  color: var(--muted);
  font-weight: 900;
  font-size: 0.88rem;
}

.social-comment-actions span.is-near-limit {
  color: var(--gold);
}

.social-comment-form button,
.social-comment-image-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  min-height: 46px;
  padding: 9px 12px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font-weight: 900;
}

.social-comment-image-button {
  width: 46px;
  padding: 9px;
  cursor: pointer;
}

.social-comment-image-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.social-comment-form button .material-symbols-rounded,
.social-comment-image-button .material-symbols-rounded {
  display: inline-grid;
  place-items: center;
  width: 20px;
  min-width: 20px;
  height: 20px;
  color: currentColor;
  font-size: 19px;
  line-height: 1;
}

.social-comment-image-preview {
  position: relative;
  width: fit-content;
  max-width: 100%;
}

.social-comment-image-preview img,
.social-comment-image img {
  width: 180px;
  max-width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  background: var(--field-bg);
  border: 2px solid var(--stroke);
  border-radius: 8px;
}

.social-comment-image-preview button[data-social-comment-image-remove] {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  color: var(--ink);
  background: rgba(21, 19, 33, 0.72);
  border: 2px solid var(--stroke);
  border-radius: 50%;
  backdrop-filter: blur(8px);
}

.social-comment-image {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 6px 0 8px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.social-comment-list {
  display: grid;
  gap: 10px;
}

.social-comment-thread {
  display: grid;
  min-width: 0;
}

.social-comment-replies {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 8px 0 0 22px;
  padding-left: 14px;
  border-left: 2px solid var(--line);
}

.social-comment-thread.is-depth-capped > .social-comment-replies {
  margin-left: 0;
}

.social-comment-thread.is-reply > .social-comment {
  background: color-mix(in srgb, var(--paper-2) 82%, var(--violet) 18%);
}

@media (max-width: 600px) {
  .social-comment-replies {
    margin-left: 10px;
    padding-left: 8px;
  }
}

.social-comment {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.social-comment .avatar {
  width: 38px;
  height: 38px;
}

.social-comment-body {
  margin: 6px 0 8px;
  color: var(--ink-soft);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.social-comment .profile-mention {
  display: inline;
  min-height: 0;
  padding: 0;
  color: var(--violet-light);
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 1000;
}

.social-comment button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 8px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
}

.social-comment button.is-active {
  color: var(--on-primary);
  background: var(--red);
  border-color: var(--stroke);
}

.social-comment-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.social-comment .social-comment-toolbar button {
  justify-content: center;
  min-width: 34px;
  padding-inline: 6px;
}

.social-comment-toolbar .material-symbols-rounded {
  font-size: 18px;
}

.social-comment button.social-comment-author {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-comment button.social-comment-author:hover,
.social-comment button.social-comment-author:focus-visible {
  color: var(--mint);
}

button.social-post-author {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.social-post-author:hover,
button.social-post-author:focus-visible {
  color: var(--mint);
}

.social-layout {
  max-width: min(760px, calc(100vw - 48px));
}

.social-main {
  gap: 12px;
}

.social-composer {
  position: relative;
  gap: 10px;
  padding: 14px 16px 12px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(122, 85, 255, 0.08), transparent 170px),
    var(--surface);
  border-radius: 8px;
  box-shadow: var(--lift-shadow-sm);
}

.social-composer-user {
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
}

.social-composer-user .avatar {
  width: 48px;
  height: 48px;
  font-size: 1.05rem;
}

.social-room-picker,
.social-composer-row,
.social-image-preview,
.social-poll-editor,
.social-composer-actions {
  margin-left: 60px;
}

.social-composer textarea {
  min-height: 76px;
  padding: 2px 0 8px;
  font-size: 1.12rem;
  line-height: 1.45;
}

.social-composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
}

.social-composer-actions > span {
  margin-left: auto;
  font-size: 0.82rem;
}

.social-image-button,
.social-poll-toggle {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  color: var(--violet-light);
  background: transparent;
  border-color: transparent;
  border-radius: 50%;
  box-shadow: none;
}

.social-image-button:hover,
.social-image-button:focus-within,
.social-poll-toggle:hover,
.social-poll-toggle:focus-visible {
  color: var(--on-accent);
  background: var(--mint);
  border-color: var(--stroke);
  box-shadow: 3px 3px 0 var(--stroke);
}

.social-poll-toggle.is-selected {
  color: var(--on-primary);
  background: var(--violet);
}

.social-composer .primary-button {
  min-height: 40px;
  margin-left: 2px;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--stroke);
}

.social-room-picker button,
.social-post-room {
  min-height: 30px;
  padding: 5px 10px;
  border-color: var(--stroke);
  border-radius: 999px;
}

.social-feed {
  gap: 12px;
}

.social-topic-bar {
  margin-bottom: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.social-topic-bar button,
.social-room-picker button {
  border-radius: 999px;
}

.social-topic-bar .social-room-select-button {
  border-radius: 8px;
}

.social-topic-bar .social-saved-filter {
  border-radius: 8px;
}

.social-post {
  position: relative;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: 8px;
  box-shadow: var(--lift-shadow-sm);
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.social-post:hover,
.social-post:focus-visible {
  background:
    linear-gradient(90deg, rgba(122, 85, 255, 0.1), transparent 40%),
    var(--surface-2);
}

.social-post > .avatar {
  width: 48px;
  height: 48px;
  font-size: 1.05rem;
}

.social-post-body {
  display: grid;
  gap: 8px;
}

.social-post-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.social-post-meta {
  flex-wrap: wrap;
  gap: 5px 8px;
  line-height: 1.2;
}

.social-post-meta strong {
  max-width: 100%;
}

.social-post-meta .user-handle,
.social-post-meta .social-post-time {
  color: var(--muted);
  font-size: 0.9rem;
}

.social-post-meta .social-post-time::before {
  content: "\00B7";
  margin-right: 8px;
  color: var(--muted);
}

.social-post-room {
  flex: 0 1 auto;
  max-width: min(220px, 42%);
  margin-top: 0;
  color: var(--mint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-post-body .social-post-markdown {
  margin: 0;
  color: var(--ink);
  font-size: 1.03rem;
  line-height: 1.5;
}

.social-post-gallery {
  width: min(100%, 560px);
  margin: 4px 0 2px;
  border: 3px solid var(--stroke);
  border-radius: 8px;
}

.social-post-gallery.social-post-gallery-1 {
  width: fit-content;
  max-width: 100%;
  aspect-ratio: auto;
  max-height: none;
  overflow: visible;
  background: transparent;
  border: 0;
}

.social-post-gallery-1 .social-gallery-tile {
  border: 3px solid var(--stroke);
  border-radius: 8px;
}

.social-post-gallery-1 .social-gallery-tile img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(520px, 72vh);
  object-fit: contain;
}

.social-poll {
  margin: 4px 0 2px;
  background: var(--paper);
  border-color: var(--stroke);
  border-radius: 8px;
}

.social-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  max-width: 520px;
  margin-top: 2px;
}

.social-post-actions button {
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 36px;
  padding: 4px 8px;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  border-radius: 999px;
  box-shadow: none;
}

.social-post-actions .social-action-like,
.social-post-actions .social-action-comment,
.social-post-actions .social-action-save {
  min-width: 62px;
  justify-content: center;
}

.social-post-actions .social-action-share,
.social-post-actions .social-action-save,
.social-post-actions .social-action-like-results,
.social-post-actions .social-action-report,
.social-post-actions .social-action-delete {
  width: 40px;
  padding-inline: 4px;
}

.social-post-actions button .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 19px;
}

.social-post-actions button > span:not(.material-symbols-rounded) {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  line-height: 1;
}

.social-post-actions button:hover,
.social-post-actions button:focus-visible {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.social-post-actions .social-action-comment:hover,
.social-post-actions .social-action-comment:focus-visible,
.social-post-actions .social-action-share:hover,
.social-post-actions .social-action-share:focus-visible {
  color: var(--blue);
}

.social-post-actions .social-action-like:hover,
.social-post-actions .social-action-like:focus-visible {
  color: var(--red);
  background: rgba(255, 79, 104, 0.14);
  border-color: transparent;
}

.social-post-actions button.is-active {
  color: var(--red);
  background: transparent;
  border-color: transparent;
}

.social-post-actions .social-action-save.is-active,
.social-detail-actions [data-social-save].is-active {
  color: var(--violet);
  background: rgba(122, 85, 255, 0.14);
}

.social-post-actions .social-action-save:hover,
.social-post-actions .social-action-save:focus-visible {
  color: var(--violet);
  background: rgba(122, 85, 255, 0.14);
}

.social-post-actions button.is-active:hover,
.social-post-actions button.is-active:focus-visible {
  background: rgba(255, 79, 104, 0.14);
}

.social-post-actions .social-action-report:hover,
.social-post-actions .social-action-delete:hover,
.social-post-actions .social-action-report:focus-visible,
.social-post-actions .social-action-delete:focus-visible {
  color: var(--gold);
}

.social-post-actions button[data-share-social-post],
.social-post-actions button[data-social-save],
.social-post-actions .social-action-like-results,
.social-post-actions .social-action-report,
.social-post-actions .social-action-delete {
  justify-content: center;
}

.social-post-actions button[data-share-social-post] .material-symbols-rounded,
.social-post-actions button[data-social-save] .material-symbols-rounded,
.social-post-actions .social-action-like-results .material-symbols-rounded,
.social-post-actions .social-action-report .material-symbols-rounded,
.social-post-actions .social-action-delete .material-symbols-rounded {
  width: 32px;
}

.social-empty {
  border-radius: 8px;
  box-shadow: var(--lift-shadow-sm);
}

.social-detail-layout {
  width: min(760px, 100%);
}

.social-detail-post {
  gap: 14px;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--lift-shadow-sm);
}

.social-detail-author,
.social-detail-body,
.social-detail-post > .social-post-gallery,
.social-detail-post > .social-poll,
.social-detail-actions,
.social-comments {
  margin-right: 18px;
  margin-left: 18px;
}

.social-detail-body {
  margin-top: 2px;
}

.social-detail-post > .social-detail-body {
  margin-right: 24px;
  margin-left: 24px;
}

.social-detail-post > .social-post-gallery {
  width: auto;
  max-width: none;
}

.social-detail-post > .social-post-gallery.social-post-gallery-1 {
  max-width: calc(100% - 36px);
}

.social-detail-author {
  grid-template-columns: 54px minmax(0, 1fr);
  padding-top: 18px;
}

.social-detail-author .avatar {
  width: 54px;
  height: 54px;
}

.social-detail-author h1 {
  font-size: clamp(1.32rem, 2.4vw, 1.8rem);
}

.social-detail-body {
  font-size: clamp(1.12rem, 2vw, 1.35rem);
}

.social-detail-actions {
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 0;
}

.social-detail-actions button,
.social-detail-actions > span {
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
}

.social-detail-actions button {
  padding-inline: 14px;
}

.social-comments {
  margin-bottom: 18px;
  padding-top: 12px;
  border-top: 2px solid var(--line);
}

.social-comments h2 {
  margin: 0;
}

.social-comment-form {
  gap: 8px;
}

.social-comment-actions {
  justify-content: flex-start;
  gap: 10px;
}

.social-comment-actions span {
  min-width: 56px;
}

.social-comment-form button {
  min-height: 42px;
  margin-left: 0;
  padding-inline: 14px;
}

@media (max-width: 620px) {
  .social-layout {
    max-width: 100%;
  }

  .social-room-picker,
  .social-composer-row,
  .social-image-preview,
  .social-poll-editor,
  .social-composer-actions {
    margin-left: 0;
  }

  .social-composer-actions {
    flex-wrap: wrap;
  }

  .social-composer-actions > span {
    width: 100%;
    margin-left: 0;
  }

  .social-post {
    grid-template-columns: 42px minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    padding: 12px;
    overflow: hidden;
  }

  .social-post > .avatar {
    width: 42px;
    height: 42px;
  }

  .social-post-head {
    display: grid;
  }

  .social-post-room {
    max-width: 100%;
    justify-self: start;
  }

  .social-post-actions,
  .social-detail-actions,
  .social-comment-actions {
    max-width: 100%;
  }

  .social-post-gallery,
  .social-post-gallery.social-post-gallery-1,
  .social-detail-post > .social-post-gallery,
  .social-detail-post > .social-post-gallery.social-post-gallery-1 {
    width: 100%;
    max-width: 100%;
  }

  .social-gallery-tile,
  .social-gallery-tile img,
  .social-post-gallery-1 .social-gallery-tile img {
    max-width: 100%;
  }

  .social-detail-author,
  .social-detail-body,
  .social-detail-post > .social-post-gallery,
  .social-detail-post > .social-poll,
  .social-detail-actions,
  .social-comments {
    margin-right: 12px;
    margin-left: 12px;
  }

  .social-detail-post > .social-post-gallery.social-post-gallery-1 {
    max-width: calc(100% - 24px);
  }

  .social-detail-post > .social-detail-body {
    margin-right: 16px;
    margin-left: 16px;
  }

}

.article-reader {
  min-width: 0;
  container-type: inline-size;
}

.article-back {
  margin-bottom: 20px;
}

.article-header,
.article-cover,
.article-body {
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.article-header {
  padding: clamp(24px, 4vw, 56px);
}

.article-header h1 {
  max-width: 1180px;
  margin-top: 18px;
  font-size: clamp(2.35rem, 8cqw, 5.15rem);
  line-height: 1.02;
}

.article-header > p {
  max-width: 820px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.72;
}

.article-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 10px;
  margin-top: 26px;
}

.article-actions button,
.author-card button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.article-actions .article-orb-action,
.author-card button {
  background: var(--gold);
  color: var(--on-accent);
}

.article-actions .article-action-orb-icon,
.article-actions button:first-child > img.orb-icon {
  display: block;
  width: 26px;
  min-width: 26px;
  height: 26px;
  margin-left: -1px;
  object-fit: contain;
  vertical-align: middle;
}

.article-actions button.is-saved {
  background: var(--violet);
  color: var(--on-primary);
}

.article-upload-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px 12px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.article-upload-action input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.article-cover {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(280px, 52cqw, 460px);
  margin-top: 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg, #05050b 0 56%, #2a263a 56%),
    #05050b;
}

.article-cover-mark {
  display: grid;
  place-items: center;
  width: min(34vw, 280px);
  aspect-ratio: 1;
  background: #fff;
  border: 6px solid var(--stroke);
  border-radius: 34px 70px 34px 70px;
  color: var(--violet);
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: clamp(5rem, 12vw, 10rem);
  font-weight: 900;
  box-shadow: 9px 9px 0 var(--violet);
}

.article-cover-mark.has-image {
  width: min(100%, 1040px);
  max-width: calc(100% - 44px);
  aspect-ratio: auto;
  overflow: hidden;
  background: var(--field-bg);
  border-radius: var(--radius);
  color: transparent;
  box-shadow: 6px 6px 0 var(--violet);
}

.article-cover-mark.has-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(72vh, 720px);
  object-fit: contain;
}

.article-cover-note {
  position: absolute;
  right: 22px;
  bottom: 22px;
  padding: 12px 14px;
  background: var(--gold);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--stroke);
  color: var(--on-accent);
  font-weight: 900;
}

.article-cover-note span,
.article-cover-note strong {
  display: block;
}

.article-cover-note strong {
  font-size: 2.4rem;
  line-height: 1;
}

.article-body {
  margin-top: 18px;
  padding: clamp(24px, 5vw, 72px);
}

.article-body p,
.article-body blockquote,
.article-body ul,
.article-body ol {
  max-width: 920px;
  color: var(--ink-soft);
  font-size: clamp(1.12rem, 1.02rem + 0.35cqw, 1.28rem);
  line-height: 1.78;
}

.article-body h2,
.article-body h3 {
  max-width: 920px;
  margin: 1.25em 0 0.45em;
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: clamp(1.8rem, 1.35rem + 2.2cqw, 3rem);
  line-height: 1.1;
}

.article-body h3 {
  max-width: 860px;
  font-size: clamp(1.4rem, 1.15rem + 1.25cqw, 2.15rem);
}

.article-body ul,
.article-body ol {
  padding-left: 1.4em;
}

.article-body li {
  margin: 0.45em 0;
}

.article-body a,
.smart-composer a {
  color: var(--violet-light);
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.article-body code {
  padding: 0.08em 0.34em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
  font-size: 0.92em;
}

.article-body blockquote {
  margin: 1.2em 0;
  padding: 18px 22px;
  background: var(--paper-2);
  border-left: 7px solid var(--violet);
  border-radius: var(--radius);
  font-weight: 900;
}

.article-body figure,
.smart-composer figure {
  max-width: 100%;
  margin: 24px 0;
}

.article-body figure img,
.smart-composer figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.28);
}

.article-body figcaption,
.smart-composer figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.article-rail {
  display: grid;
  align-content: start;
  gap: 14px;
  position: sticky;
  top: 104px;
}

@media (max-width: 1500px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .article-rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-rail .panel:last-child {
    grid-column: 1 / -1;
  }
}

/* Global search: focused command surface with readable result groups. */
.topbar > .search {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
}

.topbar > .search:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--violet) 18%, transparent);
}

.topbar > .search > .material-symbols-rounded {
  color: var(--muted);
  font-size: 22px;
}

.topbar > .search input {
  min-height: 28px;
  font-size: 0.94rem;
  font-weight: 750;
}

.search-overlay {
  padding: 76px 22px 22px;
  background: rgba(7, 6, 15, 0.78);
  backdrop-filter: blur(16px);
}

.search-overlay-shell {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  width: min(1180px, 100%);
  height: min(820px, calc(100dvh - 98px));
  max-height: none;
  padding: 20px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--violet) 11%, transparent), transparent 32%),
    var(--paper);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.search-overlay-head {
  align-items: center;
  min-height: 50px;
}

.search-overlay-head h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.05;
}

.search-overlay-head .icon-button {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper-2);
  box-shadow: none;
}

.search-overlay-form {
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 62px;
  padding: 7px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  box-shadow: none;
}

.search-overlay-form:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 16%, transparent);
}

.search-overlay-form > .material-symbols-rounded {
  width: 46px;
  height: 46px;
  color: var(--muted);
  font-size: 25px;
}

.search-overlay-form input {
  height: 46px;
  font-size: 1.05rem;
  font-weight: 750;
}

.search-overlay-form .primary-button {
  min-width: 112px;
  min-height: 46px;
  border-radius: 9px;
  box-shadow: none;
}

.search-overlay-body {
  min-height: 0;
  padding: 2px 3px 4px 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.search-overlay-body::-webkit-scrollbar {
  display: block;
  width: 7px;
}

.search-overlay-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line);
}

.search-overlay-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.search-overlay-panel,
.search-overlay-empty {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
}

.search-overlay-panel {
  gap: 11px;
  padding: 17px;
}

.search-overlay-hero {
  min-height: 190px;
  background:
    linear-gradient(125deg, color-mix(in srgb, var(--violet) 18%, transparent), transparent 68%),
    var(--surface);
}

.search-overlay-empty {
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 15px;
  padding: clamp(20px, 3vw, 30px);
}

.search-overlay-empty > .material-symbols-rounded {
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #09080f;
  background: var(--gold);
  font-size: 26px;
}

.search-overlay-empty h3 {
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.2;
}

.search-overlay-empty p {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.search-result-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 10px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--violet) 17%, transparent), color-mix(in srgb, var(--mint) 8%, transparent)),
    var(--surface);
}

.search-result-overview h3 {
  max-width: 680px;
  overflow-wrap: anywhere;
  font-size: clamp(1.65rem, 3vw, 2.7rem);
}

.search-count-row {
  justify-content: flex-end;
  gap: 6px;
}

.search-count-row span,
.search-chip-list button {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  font-size: 0.86rem;
}

.search-chip-list button:hover,
.search-chip-list button:focus-visible {
  color: #fff;
  border-color: var(--violet);
  background: var(--violet);
  transform: translateY(-1px);
}

.search-section-head {
  min-height: 30px;
}

.search-section-head h3 {
  font-size: 1.08rem;
}

.search-section-head > span {
  min-width: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  text-align: center;
  font-size: 0.78rem;
}

.search-top-panel {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.search-top-panel > .search-section-head {
  grid-column: 1 / -1;
}

.search-list,
.search-people-list {
  gap: 7px;
}

.search-list article,
.search-primary-result,
.search-writer-row,
.search-empty-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-2);
  box-shadow: none;
}

.search-list article,
.search-primary-result {
  gap: 8px;
  padding: 14px;
}

.search-list article:hover,
.search-list article:focus-visible,
.search-primary-result:hover,
.search-primary-result:focus-visible,
.search-writer-row:hover,
.search-writer-row:focus-visible {
  border-color: color-mix(in srgb, var(--violet) 70%, var(--line));
  background: var(--surface-2);
  transform: translateY(-1px);
}

.search-primary-result h4,
.search-list h4 {
  margin-top: 5px;
  font-size: 1.04rem;
  line-height: 1.3;
}

.search-primary-result p,
.search-list p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

.search-writer-row {
  grid-template-columns: 46px minmax(0, 1fr);
  min-height: 66px;
  padding: 9px 11px;
}

.search-writer-row .avatar {
  width: 46px;
  height: 46px;
}

@media (max-width: 900px) {
  .search-overlay-grid,
  .search-top-panel {
    grid-template-columns: 1fr;
  }

  .search-top-panel > .search-section-head {
    grid-column: 1;
  }

  .search-result-overview {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .search-count-row {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .search-overlay {
    padding: 0;
    background: var(--paper);
    backdrop-filter: none;
  }

  .search-overlay-shell {
    width: 100%;
    height: 100dvh;
    padding: 14px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .search-overlay-head {
    min-height: 46px;
  }

  .search-overlay-head h2 {
    font-size: clamp(1.45rem, 7vw, 2rem);
  }

  .search-overlay-form {
    grid-template-columns: 40px minmax(0, 1fr);
    min-height: 54px;
    padding: 6px;
  }

  .search-overlay-form > .material-symbols-rounded {
    width: 40px;
    height: 40px;
  }

  .search-overlay-form input {
    height: 40px;
    font-size: 1rem;
  }

  .search-overlay-form .primary-button {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 42px;
  }

  .search-overlay-empty {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 16px;
  }

  .search-overlay-empty > .material-symbols-rounded {
    width: 44px;
    height: 44px;
  }

  .search-overlay-panel { padding: 14px; }
  .search-result-overview { padding: 15px; }
  .search-count-row span { flex: 1 1 calc(50% - 6px); justify-content: center; }
}

@container (max-width: 760px) {
  .article-header {
    padding: clamp(20px, 5cqw, 34px);
  }

  .article-header h1 {
    font-size: clamp(2.15rem, 11cqw, 3.8rem);
  }

  .article-actions button {
    min-height: 44px;
  }

  .article-cover {
    min-height: 280px;
  }

  .article-body {
    padding: clamp(22px, 6cqw, 42px);
  }
}

@media (max-width: 1200px) {
  .article-rail {
    grid-template-columns: 1fr;
  }

  .article-rail .panel:last-child {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .article-rail {
    grid-template-columns: 1fr;
  }

  .article-rail .panel:last-child {
    grid-column: auto;
  }
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: clamp(24px, 3vw, 48px);
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
  container-type: inline-size;
}

.profile-main {
  min-width: 0;
}

.profile-hero,
.profile-post-card {
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.profile-hero {
  overflow: hidden;
}

.profile-banner {
  display: flex;
  align-items: end;
  justify-content: space-between;
  min-height: 210px;
  padding: clamp(18px, 3vw, 34px);
  background:
    linear-gradient(135deg, var(--entity-accent, var(--violet)), rgba(73, 198, 164, 0.28) 48%, #05050b 48%),
    #05050b;
  border-bottom: 3px solid var(--stroke);
  background-size: cover;
  background-position: center;
}

.profile-banner.has-image {
  color: var(--on-primary);
}

.profile-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: clamp(20px, 3vw, 34px);
}

.profile-identity > div:not(.profile-actions) {
  min-width: 0;
}

.profile-avatar {
  width: 92px;
  height: 92px;
  font-size: 2.2rem;
  margin-top: 0;
  box-shadow: 3.5px 3.5px 0 var(--entity-accent, var(--violet));
}

.profile-identity h1 {
  font-size: clamp(2.05rem, 4vw, 4.5rem);
  line-height: 1.02;
  overflow-wrap: break-word;
  word-break: normal;
}

.profile-summary {
  display: grid;
  gap: 12px;
  max-width: 780px;
  margin-top: 12px;
}

.profile-presence {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 900;
}

.pulse-presence,
.minecraft-presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pulse-presence + .minecraft-presence {
  margin-top: 4px;
}

.pulse-presence .material-symbols-rounded,
.minecraft-presence .material-symbols-rounded {
  font-size: 1.15rem;
}

.pulse-presence .material-symbols-rounded {
  color: var(--muted);
}

.pulse-presence.is-online .material-symbols-rounded {
  color: #23a559;
}

.minecraft-presence .material-symbols-rounded {
  color: var(--cyan-text);
}

.pulse-presence.is-online,
.minecraft-presence.is-online {
  color: var(--ink);
}

.profile-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.profile-summary-item {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
  color: var(--ink-soft);
  font-weight: 900;
}

.profile-summary-item > span {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.profile-summary-item > strong {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

.profile-summary-item a {
  color: var(--violet-dark);
  text-decoration: none;
}

.profile-summary-bio {
  margin: 0;
  max-width: 680px;
  color: var(--ink-soft);
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.profile-expandable {
  display: grid;
  justify-items: start;
  gap: 5px;
  min-width: 0;
}

.profile-expandable-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-expandable:not(.is-expanded) > .profile-expandable-copy {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.profile-expandable-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 30px;
  padding: 2px 4px;
  color: var(--violet-light);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 950;
  cursor: pointer;
}

.profile-expandable-toggle:hover {
  color: var(--gold);
}

.profile-expandable-toggle:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

.profile-expandable-toggle .material-symbols-rounded {
  font-size: 1.15rem;
}

.profile-status,
.profile-card-status {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: normal;
}

.profile-status {
  width: fit-content;
  padding: 8px 11px;
  background: var(--field-bg-2);
  border: 2px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.35;
}

.profile-status .material-symbols-rounded,
.profile-card-status .material-symbols-rounded {
  flex: 0 0 auto;
  color: var(--violet-light);
  font-size: 1.1em;
}

.profile-info-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  max-width: 760px;
  margin-top: 14px;
}

.profile-info-item {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 12px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.profile-info-item.is-wide {
  grid-column: 1 / -1;
}

.profile-info-item > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}

.profile-info-value {
  min-width: 0;
  color: var(--ink-soft);
  font-weight: 900;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.profile-info-item a {
  color: var(--violet-dark);
  text-decoration: none;
}

.profile-info-item a:hover {
  color: var(--gold);
}

.profile-link-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.profile-link-item,
.linked-account-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.profile-link-item img,
.profile-link-item > .material-symbols-rounded,
.linked-account-icon {
  width: 42px;
  height: 42px;
  border: 2px solid var(--stroke);
  border-radius: 50%;
  background: #5865f2;
  color: #fff;
  object-fit: cover;
}

.minecraft-account-icon {
  background: #3c8527;
}

.music-account-icon {
  background: #e73d6b;
}

.minecraft-skin-avatar {
  background-color: #3c8527;
  image-rendering: pixelated;
}

.profile-link-item > .material-symbols-rounded,
.linked-account-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-link-item div,
.linked-account-card div {
  min-width: 0;
}

.profile-link-item span,
.linked-account-card p {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.profile-link-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profile-link-item strong,
.linked-account-card strong {
  display: block;
  color: var(--ink);
  font-weight: 1000;
  overflow-wrap: anywhere;
}

.minecraft-link-code-panel {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.minecraft-link-code-panel[hidden] {
  display: none;
}

.minecraft-link-code-panel span,
.minecraft-link-code-panel code {
  width: fit-content;
  max-width: 100%;
  padding: 6px 8px;
  border: 2px solid var(--stroke);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace);
  font-size: 0.85rem;
  font-weight: 1000;
  overflow-wrap: anywhere;
}

.minecraft-link-code-panel small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.35;
}

.profile-link-item small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.profile-handle,
.user-handle {
  color: var(--violet-dark);
  font-weight: 900;
}

.profile-handle {
  margin: 6px 0 12px;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}

.room-handle {
  color: var(--violet-dark);
  font-weight: 1000;
  overflow-wrap: anywhere;
}

.user-handle {
  font-size: 0.82rem;
}

.verified-name {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  min-width: 0;
  vertical-align: baseline;
}

.verified-name > span:first-child {
  min-width: 0;
}

.verified-name .name-gradient-text {
  /* Keep glyph descenders inside the gradient paint box at large heading sizes. */
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
  color: transparent;
  background: linear-gradient(90deg, var(--name-gradient-start, var(--violet)), var(--name-gradient-end, var(--mint)));
  -webkit-background-clip: text;
  background-clip: text;
}

.verified-badge,
.material-symbols-rounded.verified-badge {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 1em;
  line-height: 1;
  font-variation-settings: "FILL" 1, "wght" 600, "GRAD" 0, "opsz" 20;
}

.verified-badge-company,
.material-symbols-rounded.verified-badge-company {
  color: var(--gold-text);
}

.profile-identity h1 .verified-badge,
.social-detail-author h1 .verified-badge {
  font-size: 0.72em;
}

.profile-meta span {
  padding: 6px 10px;
  border: 2px solid var(--stroke);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.profile-identity p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.profile-identity .profile-handle {
  color: var(--violet-dark);
}

.profile-email,
.profile-identity .profile-email {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 10px;
  color: var(--ink-soft);
  font-weight: 900;
  line-height: 1.2;
}

.profile-email .material-symbols-rounded {
  font-size: 1.1rem;
}

.profile-email a {
  color: inherit;
  text-decoration: none;
}

.profile-email a:hover {
  color: var(--violet-dark);
}

.profile-actions {
  display: flex;
  grid-column: 2;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 3px solid var(--stroke);
}

.profile-stats div {
  padding: 18px;
  border-right: 3px solid var(--stroke);
}

.profile-stats div:last-child {
  border-right: 0;
}

.profile-stats strong,
.profile-stats span {
  display: block;
}

.profile-stats strong {
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
}

.profile-stats span {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 900;
}

.profile-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 16px 0;
  scrollbar-width: none;
}

.profile-tabs::-webkit-scrollbar {
  display: none;
}

.profile-tabs button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 14px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
}

.profile-tabs button.is-selected {
  background: var(--ink);
  color: var(--paper);
}

.profile-posts {
  display: grid;
  gap: 14px;
}

.profile-post-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(172px, 240px);
  gap: 22px;
  align-items: center;
  padding: 20px;
}

.profile-post-card > div:first-child {
  min-width: 0;
}

.profile-post-card.no-media {
  grid-template-columns: minmax(0, 1fr);
}

.profile-post-card h2 {
  margin-top: 8px;
  font-size: clamp(1.55rem, 3vw, 3rem);
  line-height: 1.05;
}

.profile-post-card p {
  color: var(--muted);
  line-height: 1.65;
}

.post-type {
  color: var(--violet-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-rail {
  display: grid;
  align-content: start;
  gap: 14px;
  position: sticky;
  top: 104px;
  margin-top: 62px;
}

@media (max-width: 1500px) {
  .profile-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .profile-rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
  }

  .profile-info-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-info-item.is-wide {
    grid-column: 1 / -1;
  }
}

@container (max-width: 760px) {
  .profile-banner {
    min-height: 170px;
  }

  .profile-identity {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .profile-avatar {
    width: 82px;
    height: 82px;
    font-size: 2rem;
  }

  .profile-identity h1 {
    font-size: clamp(2rem, 9cqw, 3.25rem);
  }

  .profile-actions {
    grid-column: 1;
  }
}

@media (max-width: 760px) {
  .profile-rail,
  .profile-info-list {
    grid-template-columns: 1fr;
  }

  .profile-post-card {
    grid-template-columns: 1fr;
  }

  .profile-post-card .thumbnail {
    width: min(100%, 260px);
    justify-self: start;
  }
}

.saved-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 16px;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
  container-type: inline-size;
}

.saved-main {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.saved-hero,
.saved-card {
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.saved-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  min-height: 180px;
  padding: clamp(22px, 3vw, 36px);
  background: var(--hero-bg);
}

.saved-hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.5rem, 4.6vw, 4.35rem);
  line-height: 1.02;
  overflow-wrap: break-word;
}

.saved-hero > div:first-child {
  min-width: 0;
}

.saved-hero p {
  max-width: 680px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.saved-filters {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0;
}

.saved-filters[hidden] {
  display: none;
}

.saved-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.saved-card {
  display: grid;
  align-content: start;
  min-height: 0;
  padding: 16px;
}

.saved-card-feature {
  grid-column: auto;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
}

.saved-card h2 {
  margin: 5px 0 0;
  font-size: clamp(1.12rem, 1.7vw, 1.55rem);
  line-height: 1.14;
}

.saved-card p {
  color: var(--muted);
  line-height: 1.45;
}

.saved-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 900;
  font-size: 0.92rem;
}

.saved-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.saved-art {
  display: none;
  place-items: center;
  width: 180px;
  aspect-ratio: 1;
  background: #fff;
  border: 4px solid var(--stroke);
  border-radius: 24px 46px 24px 46px;
  color: var(--violet);
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: 5rem;
  font-weight: 900;
  box-shadow: 5px 5px 0 var(--violet);
}

.saved-rail {
  display: grid;
  align-content: start;
  gap: 10px;
  position: sticky;
  top: 104px;
}

.saved-rail .panel {
  padding: 14px;
}

.collection-list {
  display: grid;
  gap: 8px;
}

.collection-create-link {
  width: 100%;
  justify-content: center;
  margin-bottom: 10px;
  background: var(--paper-2);
  color: var(--ink);
}

.collection-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.collection-row.has-actions {
  grid-template-columns: minmax(0, 1fr) 40px;
}

.collection-list > button,
.collection-filter-button,
.collection-delete-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 8px 10px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 900;
}

.collection-filter-button {
  min-width: 0;
  width: 100%;
}

.collection-filter-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-delete-button {
  width: 40px;
  justify-content: center;
  padding: 8px;
  color: var(--red);
}

.collection-delete-button .material-symbols-rounded {
  font-size: 1.2rem;
}

.collection-list > button.is-selected,
.collection-row.is-selected .collection-filter-button {
  background: var(--gold);
  color: var(--on-accent);
}

@container (max-width: 980px) {
  .saved-hero {
    min-height: 150px;
    padding: clamp(18px, 3vw, 28px);
  }

  .saved-hero h1 {
    font-size: clamp(2.35rem, 7cqw, 3.65rem);
    line-height: 1.04;
  }
}

.messages-layout {
  display: grid;
  grid-template-columns: minmax(288px, 370px) minmax(0, 1fr);
  max-width: 1720px;
  width: 100%;
  height: calc(100vh - 132px);
  min-height: 590px;
  margin: 0 auto;
  overflow: hidden;
  background: transparent;
}

#messages {
  container-type: inline-size;
}

.inbox-panel,
.chat-panel {
  min-width: 0;
}

.inbox-panel,
.chat-panel {
  min-height: 0;
  background: var(--surface);
}

.inbox-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
  padding: 18px 14px 12px;
  background:
    linear-gradient(180deg, rgba(255, 196, 87, 0.08), transparent 180px),
    var(--surface);
  border-right: 3px solid var(--stroke);
}

.messages-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 4px;
}

.messages-heading h1 {
  font-size: clamp(1.7rem, 2.2vw, 2.35rem);
  line-height: 1;
}

.messages-heading .icon-button {
  width: 42px;
  height: 42px;
  border: 2px solid var(--stroke);
  border-radius: 50%;
  background: var(--violet);
  color: var(--on-primary);
  box-shadow: 3px 3px 0 var(--stroke);
}

.message-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 7px 12px 7px 8px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--stroke);
  border-radius: 999px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.24);
  transition:
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.message-search:focus-within {
  border-color: var(--violet);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.24);
}

.message-search > .material-symbols-rounded {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 21px;
}

.message-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}

.message-search input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.conversation-list {
  display: grid;
  align-content: start;
  gap: 2px;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 0 8px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.conversation-list::-webkit-scrollbar {
  display: none;
}

.conversation-row {
  position: relative;
  min-width: 0;
}

.conversation-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 10px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.conversation-row .conversation-item {
  width: 100%;
}

.conversation-row .conversation-topline {
  padding-right: 32px;
}

.conversation-close {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: var(--paper-2);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 120ms ease, transform 120ms ease, color 120ms ease, background 120ms ease;
}

.conversation-close .material-symbols-rounded {
  font-size: 18px;
}

.conversation-row:hover .conversation-close,
.conversation-row:focus-within .conversation-close,
.conversation-close:focus-visible {
  opacity: 1;
  transform: scale(1);
}

.conversation-close:hover,
.conversation-close:focus-visible {
  color: var(--ink);
  background: var(--surface-2);
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.conversation-item.is-active + .conversation-close {
  color: var(--ink);
  background: color-mix(in srgb, var(--violet) 20%, var(--paper-2));
}

.conversation-item:hover,
.conversation-item:focus-visible {
  background: var(--paper-2);
  border-color: var(--stroke);
}

.conversation-item.is-active {
  background: var(--violet);
  border-color: var(--stroke);
  color: var(--on-primary);
  box-shadow: 3px 3px 0 var(--stroke);
}

.conversation-item .avatar {
  width: 48px;
  height: 48px;
  font-size: 1rem;
}

.conversation-copy,
.conversation-topline,
.conversation-preview {
  min-width: 0;
}

.conversation-copy {
  display: grid;
  gap: 5px;
}

.conversation-topline,
.conversation-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.conversation-item strong,
.conversation-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item strong {
  display: block;
  flex: 1 1 auto;
  font-size: 0.96rem;
}

.conversation-item strong > .verified-name {
  display: flex;
  width: 100%;
}

.conversation-item strong > .verified-name > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.conversation-item small {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.conversation-item.has-unread strong,
.conversation-item.has-unread small {
  color: var(--ink);
}

.conversation-item.is-active small,
.conversation-item.is-active time,
.conversation-item.is-active .verified-name {
  color: var(--on-primary);
}

.conversation-item em {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  background: var(--mint);
  border-radius: 999px;
  color: #09231e;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 1000;
}

@media (hover: none), (pointer: coarse) {
  .conversation-close {
    opacity: 1;
    transform: none;
  }
}

.empty-copy,
.empty-thread {
  color: var(--muted);
  line-height: 1.6;
}

.conversation-list > .empty-copy {
  padding: 16px 10px;
}

.empty-thread {
  align-self: center;
  justify-self: center;
  max-width: 390px;
  padding: 18px 22px;
  color: var(--muted);
  background: var(--surface);
  border: 2px solid var(--stroke);
  border-radius: 8px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.24);
  text-align: center;
}

.empty-thread h2 {
  color: var(--ink);
  font-size: 1.35rem;
}

.empty-thread p {
  margin-top: 8px;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--paper);
}

.chat-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 12px 18px;
  background: var(--paper-2);
  border-bottom: 3px solid var(--stroke);
}

.chat-mobile-back {
  display: none;
}

.chat-person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-person .avatar {
  width: 44px;
  height: 44px;
}

.chat-person h2 {
  font-size: 1.08rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.chat-profile-link {
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.chat-profile-link:hover {
  text-decoration: underline;
}

.chat-profile-link:focus-visible {
  border-radius: 4px;
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.chat-person > div > span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.chat-person .chat-typing-status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--mint);
}

.chat-typing-status i {
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
  animation: chat-typing-dot 1.1s infinite ease-in-out;
}

.chat-typing-status i:nth-of-type(2) {
  animation-delay: 140ms;
}

.chat-typing-status i:nth-of-type(3) {
  animation-delay: 280ms;
}

@keyframes chat-typing-dot {
  0%, 60%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-typing-status i {
    animation: none;
    opacity: 0.8;
  }
}

.message-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding: clamp(18px, 2.8vw, 34px);
  background:
    linear-gradient(135deg, rgba(122, 85, 255, 0.12), transparent 45%),
    #100f1a;
  background-size: auto, auto;
}

.message-thread::-webkit-scrollbar {
  display: none;
}

.message-thread::before {
  content: "";
  margin-top: auto;
}

.message-date-separator {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.message-date-separator::before,
.message-date-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.message-date-separator span {
  flex: 0 0 auto;
}

.message-bubble {
  position: relative;
  max-width: min(72%, 620px);
  padding: 8px 10px 7px;
  border: 2px solid var(--stroke);
  border-radius: 8px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.28);
  transform: translateX(var(--reply-swipe-x, 0));
  transition: transform 160ms ease;
  touch-action: pan-y;
}

.message-bubble p {
  margin: 0;
  line-height: 1.48;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-bubble.is-swipe-replying {
  transition: none;
}

.message-bubble.is-swipe-replying::after {
  content: "reply";
  position: absolute;
  top: 50%;
  left: -38px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--on-primary);
  background: var(--violet);
  border: 2px solid var(--stroke);
  border-radius: 50%;
  font-family: "Material Symbols Rounded";
  font-size: 18px;
  transform: translateY(-50%);
}

.message-reply-preview {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 7px 9px;
  color: inherit;
  text-align: left;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-left: 3px solid currentColor;
  border-radius: 6px;
}

button.message-reply-preview {
  cursor: pointer;
}

.message-reply-preview span,
.message-reply-preview small {
  display: block;
  min-width: 0;
}

.message-reply-preview span {
  font-size: 0.72rem;
  font-weight: 1000;
}

.message-reply-preview small {
  margin-top: 2px;
  overflow: hidden;
  font-size: 0.76rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-bubble.incoming .message-reply-preview {
  background: rgba(21, 19, 33, 0.08);
}

.message-bubble.incoming .message-reply-preview small {
  color: var(--muted);
}

.message-bubble.outgoing .message-reply-preview {
  background: rgba(255, 255, 255, 0.14);
}

.message-bubble.outgoing .message-reply-preview small {
  color: var(--on-primary);
}

.message-reactions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  margin-top: 7px;
}

.message-bubble.outgoing .message-reactions {
  justify-content: flex-end;
}

.message-reaction-chip,
.message-reaction-picker button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  color: inherit;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid currentColor;
  border-radius: 999px;
  font-weight: 1000;
  line-height: 1;
  cursor: pointer;
}

.message-bubble.incoming .message-reaction-chip {
  background: rgba(21, 19, 33, 0.06);
}

.message-reaction-chip {
  gap: 5px;
  color: var(--message-reaction-chip-ink);
}

.message-bubble.outgoing .message-reaction-chip {
  color: var(--on-primary);
}

.message-reaction-picker button[aria-pressed="true"] {
  background: var(--violet);
  color: var(--on-primary);
  border-color: var(--stroke);
}

.message-reaction-chip em {
  font-size: 0.72rem;
  font-style: normal;
}

.message-reaction-picker {
  display: grid;
  grid-template-columns: repeat(6, 36px);
  gap: 8px;
  width: 100%;
  max-width: 256px;
  padding: 0;
}

.message-reaction-picker button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  color: var(--ink);
  background: var(--surface-2);
  border-color: var(--line);
}

.message-reaction-picker button:hover:not(:disabled),
.message-reaction-picker button:focus-visible {
  background: var(--surface);
  border-color: var(--violet-light);
  outline: 0;
}

.message-reaction-more .material-symbols-rounded {
  font-size: 18px;
}

.message-reaction-extra {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, 36px);
  gap: 8px;
  padding-top: 8px;
  border-top: 2px solid var(--line);
}

.message-reaction-chip:disabled,
.message-reaction-picker button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.message-reaction-modal {
  width: min(100%, 344px);
  padding: 20px;
}

.message-reaction-modal h2 {
  margin: 2px 42px 14px 0;
  font-size: 1.35rem;
  line-height: 1.08;
}

.message-reaction-modal-body {
  display: flex;
  justify-content: center;
}

.message-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  min-height: 18px;
  margin-top: 4px;
  overflow: hidden;
}

.message-bubble.incoming .message-footer {
  justify-content: flex-end;
}

.message-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.message-touch-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
  padding: 7px;
  background: var(--paper);
  border: 2px solid var(--stroke);
  border-radius: 8px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.24);
}

.message-touch-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 8px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--stroke);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 1000;
}

.message-touch-actions .material-symbols-rounded {
  font-size: 17px;
}

.message-bubble .message-inline-actions {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateX(6px);
  transition:
    max-width 180ms ease,
    margin-left 180ms ease,
    opacity 140ms ease,
    transform 180ms ease;
}

.message-bubble:hover .message-inline-actions,
.message-bubble:focus-within .message-inline-actions {
  max-width: 116px;
  margin-left: 5px;
  opacity: 1;
  transform: translateX(0);
}

.message-inline-actions button,
.message-report-button,
.message-more-button {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 2px solid currentColor;
  border-radius: 50%;
  cursor: pointer;
}

.message-more-button {
  display: none;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin-left: 6px;
}

.message-bubble .message-report-button {
  flex: 0 0 auto;
  width: 0;
  border-width: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateX(6px);
  transition:
    width 180ms ease,
    border-width 180ms ease,
    margin-left 180ms ease,
    opacity 140ms ease,
    transform 180ms ease;
}

.message-bubble:hover .message-report-button,
.message-bubble:focus-within .message-report-button {
  width: 26px;
  margin-left: 5px;
  border-width: 2px;
  opacity: 0.82;
  transform: translateX(0);
}

.message-inline-actions button:hover,
.message-report-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.message-inline-actions .material-symbols-rounded {
  font-size: 17px;
}

@media (hover: hover) and (pointer: fine) {
  .message-touch-actions {
    display: none;
  }
}

@media (hover: none), (pointer: coarse) {
  .message-bubble .message-inline-actions,
  .message-bubble .message-report-button {
    display: none;
  }

  .message-more-button {
    display: inline-grid;
  }

  .message-bubble,
  .message-bubble button,
  .message-footer,
  .message-footer *,
  .message-reactions,
  .message-reactions *,
  .message-touch-actions,
  .message-touch-actions *,
  .message-bubble > p,
  .message-reply-preview,
  .message-attachment,
  .message-read-receipt,
  .message-time {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  .message-edit-form textarea {
    -webkit-touch-callout: default;
    -webkit-user-select: text;
    user-select: text;
  }

  .message-reaction-picker {
    grid-template-columns: repeat(5, 38px);
    max-width: min(222px, calc(100vw - 24px));
  }

  .message-reaction-extra {
    grid-template-columns: repeat(5, 38px);
  }

  .message-reaction-picker button {
    width: 38px;
    min-width: 38px;
    height: 38px;
  }
}

.message-time {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.message-read-receipt {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 5px;
  color: var(--muted);
}

.message-read-receipt .material-symbols-rounded {
  font-size: 16px;
}

.message-read-receipt.is-read {
  color: var(--blue);
}

.message-bubble.incoming {
  align-self: flex-start;
  background: var(--surface);
  color: var(--ink);
  border-top-left-radius: 3px;
}

.message-bubble.outgoing {
  align-self: flex-end;
  background: var(--violet);
  color: var(--on-primary);
  border-top-right-radius: 3px;
}

.message-bubble.outgoing .message-time,
.message-bubble.outgoing .message-read-receipt {
  color: var(--on-primary);
}

.message-bubble.outgoing .message-inline-actions button {
  color: var(--on-primary);
}

.message-bubble.is-target {
  outline: 3px solid rgba(255, 196, 87, 0.7);
  outline-offset: 3px;
}

.message-edit-form {
  display: grid;
  gap: 8px;
}

.message-edit-form textarea {
  width: 100%;
  min-height: 88px;
  resize: none;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--stroke);
  border-radius: 8px;
}

.message-edit-form > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.message-edited-indicator {
  font-size: 0.78rem;
  font-weight: 900;
}

.message-attachment {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  max-width: 100%;
  margin-top: 8px;
  padding: 9px 10px;
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: 8px;
  color: var(--on-accent);
  font-weight: 900;
}

.message-attachment small {
  display: block;
  margin-top: 3px;
  color: #3a3045;
}

.message-composer {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 46px;
  gap: 10px;
  align-items: end;
  padding: 12px 16px 14px;
  background: var(--surface);
  border-top: 3px solid var(--stroke);
}

.message-image-preview {
  grid-column: 1 / -1;
  position: relative;
  display: inline-block;
  width: fit-content;
  max-width: 100%;
}

.message-reply-composer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  background: color-mix(in srgb, var(--violet) 13%, var(--field-bg));
  border: 2px solid var(--stroke);
  border-left-width: 5px;
  border-radius: 8px;
}

.message-reply-composer[hidden] {
  display: none;
}

.message-reply-composer > div {
  min-width: 0;
}

.message-reply-composer span,
.message-reply-composer small {
  display: block;
}

.message-reply-composer span {
  font-size: 0.78rem;
  font-weight: 1000;
}

.message-reply-composer small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-composer .message-reply-composer button {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  background: var(--paper-2);
}

.message-composer .message-reply-composer button .material-symbols-rounded {
  font-size: 18px;
}

.message-image-preview img {
  width: 180px;
  max-width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  background: var(--field-bg);
  border: 2px solid var(--stroke);
  border-radius: 8px;
}

.message-composer .message-image-preview button[data-message-image-remove] {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--ink);
  background: rgba(21, 19, 33, 0.72);
  border: 2px solid var(--stroke);
  border-radius: 50%;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.message-composer .message-image-preview button[data-message-image-remove]:hover {
  background: rgba(122, 85, 255, 0.76);
}

.message-composer .message-image-preview button[data-message-image-remove] .material-symbols-rounded {
  font-size: 18px;
}

.message-input-shell {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  background: var(--field-bg);
  border: 2px solid var(--stroke);
  border-radius: 999px;
}

.message-input-shell:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(122, 85, 255, 0.24);
}

.message-composer textarea {
  display: block;
  appearance: none;
  width: 100%;
  min-width: 0;
  max-height: 118px;
  padding: 11px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  resize: none;
  overflow-y: hidden;
  line-height: 1.35;
}

.message-composer textarea:focus,
.message-composer textarea:focus-visible {
  outline: 0;
  box-shadow: none;
}

.message-image-button,
.message-composer button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--stroke);
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
}

.message-image-button:hover,
.message-composer button:hover {
  background: var(--gold);
  color: var(--on-accent);
}

.message-image-button.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.message-composer button:last-child {
  background: var(--violet);
  color: var(--on-primary);
}

.message-image-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.message-image {
  display: block;
  width: auto;
  max-width: min(100%, 320px);
  height: auto;
  max-height: 260px;
  object-fit: contain;
  margin-top: 8px;
  background: var(--field-bg);
  border: 2px solid var(--stroke);
  border-radius: 8px;
}

@container (max-width: 1120px) {
  .messages-layout {
    grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
  }

  .message-bubble {
    max-width: min(82%, 620px);
  }

  .message-attachment {
    max-width: min(82%, 620px);
  }
}

@container (max-width: 840px) {
  .messages-layout {
    grid-template-columns: minmax(232px, 310px) minmax(0, 1fr);
    height: calc(100vh - 124px);
    min-height: 520px;
  }

  .inbox-panel {
    padding: 14px 10px 10px;
  }

  .messages-heading h1 {
    font-size: clamp(1.55rem, 5vw, 2rem);
  }

  .conversation-item {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 66px;
    padding: 9px;
  }

  .conversation-item .avatar {
    width: 42px;
    height: 42px;
  }

  .chat-header,
  .message-composer {
    padding-inline: 12px;
  }

  .message-thread {
    padding: 16px;
  }

  .message-bubble {
    max-width: 88%;
  }

  .message-attachment {
    max-width: 88%;
  }
}

.notifications-page,
.settings-page {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
}

.notifications-page {
  container-type: inline-size;
}

.notifications-hero,
.settings-hero,
.notification-feed-panel,
.notification-rail .panel {
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.notifications-hero,
.settings-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  min-height: 220px;
  padding: clamp(22px, 4vw, 44px);
  background: var(--hero-bg);
}

.notifications-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.notifications-hero > div:first-child {
  min-width: 0;
}

.notification-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.notifications-hero h1,
.settings-hero h1 {
  margin: 0;
  font-size: clamp(2.9rem, 7vw, 5.4rem);
  line-height: 0.96;
}

.notifications-hero h1 {
  font-size: clamp(2.65rem, 5.1vw, 4.45rem);
  line-height: 1.02;
  overflow-wrap: normal;
  word-break: keep-all;
}

.notifications-hero .text-command {
  flex: 0 1 auto;
  justify-content: center;
  max-width: 220px;
  text-align: center;
  white-space: normal;
}

.notifications-hero p:not(.eyebrow) {
  max-width: 680px;
  color: var(--ink-soft);
}

.notifications-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 18px;
  align-items: start;
}

.notification-feed-panel,
.notification-rail .panel {
  padding: clamp(16px, 2vw, 22px);
}

.notification-feed,
.notification-type-list {
  display: grid;
  gap: 10px;
}

.notification-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.notification-card.is-unread {
  background: linear-gradient(90deg, rgba(122, 85, 255, 0.28), var(--paper-2));
  box-shadow: inset 4px 0 0 var(--violet);
}

.notification-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--stroke);
  border-radius: 50%;
  color: var(--on-accent);
}

.notification-icon-violet {
  color: var(--on-primary);
  background: var(--violet);
}

.notification-icon-mint {
  background: var(--mint);
}

.notification-icon-gold {
  background: var(--gold);
}

.notification-icon-blue {
  color: var(--on-primary);
  background: var(--blue);
}

.notification-card-body,
.notification-card-top {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.notification-card-top {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.notification-card strong,
.notification-card span {
  min-width: 0;
}

.notification-card-body > span:not(.notification-card-top),
.notification-card small {
  color: var(--muted);
}

.notification-card-body > small:not(.notification-card-meta) {
  display: none;
}

.notification-card-meta {
  display: block;
}

.notification-card-action {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: 50%;
  box-shadow: 4px 4px 0 var(--stroke);
}

.notification-type-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.notification-type-row span:last-child {
  color: var(--mint);
  font-weight: 1000;
}

.notification-empty {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px;
  color: var(--muted);
  background: var(--paper-2);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
}

.notification-empty .material-symbols-rounded {
  color: var(--violet-dark);
}

@container (max-width: 1120px) {
  .notifications-hero {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: 170px;
  }

  .notifications-hero h1 {
    font-size: clamp(2.55rem, 8cqw, 3.8rem);
  }

  .notifications-hero .text-command {
    max-width: none;
  }

  .notification-actions {
    justify-content: flex-start;
  }
}

@container (max-width: 560px) {
  .notifications-hero h1 {
    font-size: clamp(1.55rem, 6.3cqw, 2.4rem);
  }

  .notification-actions {
    width: 100%;
  }

  .notification-actions .text-command {
    flex: 1 1 150px;
  }
}

.account-modal {
  width: min(100%, 620px);
}

.account-page {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
}

.account-page-hero,
.account-settings-panel {
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.account-page-hero {
  overflow: hidden;
}

.account-banner-preview {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  min-height: clamp(220px, 28vw, 360px);
  padding: clamp(18px, 3vw, 34px);
  background:
    linear-gradient(135deg, var(--entity-accent, var(--violet)), rgba(73, 198, 164, 0.28) 48%, #05050b 48%),
    #05050b;
  background-size: cover;
  background-position: center;
  border-bottom: 3px solid var(--stroke);
}

.account-banner-preview.has-image {
  background-size: cover;
  background-position: center;
}

.account-banner-preview > span {
  color: var(--ink);
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: clamp(2rem, 4vw, 4.2rem);
  font-weight: 900;
  line-height: 1;
}

.account-banner-upload {
  background: var(--gold);
  color: var(--on-accent);
}

.account-page-identity {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: clamp(20px, 3vw, 34px);
}

.account-page-identity .profile-avatar {
  margin-top: 0;
}

.account-page-identity h1 {
  font-size: clamp(2.2rem, 4vw, 4.4rem);
}

.account-page-identity p:not(.eyebrow) {
  max-width: 720px;
  color: var(--muted);
}

.account-page-identity .account-profile-handle {
  margin: 8px 0 0;
  color: var(--violet-dark);
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  font-weight: 900;
  line-height: 1.15;
}

.account-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 18px;
  align-items: start;
}

.account-settings-side {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.linked-account-card {
  margin-top: 16px;
}

.linked-account-card p {
  margin: 3px 0 0;
  line-height: 1.45;
}

.linked-account-actions {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 8px;
}

.linked-account-actions .primary-button,
.linked-account-actions .ghost-button {
  width: 100%;
  justify-content: center;
}

.account-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  min-width: 0;
}

.account-form input:not([type="checkbox"]),
.account-form textarea {
  min-width: 0;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--ink);
  font: inherit;
}

.username-input {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 50px;
  margin-top: 6px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--ink);
}

.username-input > span {
  padding-left: 12px;
  color: var(--violet-dark);
  font-weight: 900;
}

.username-input input,
.auth-form .username-input input {
  min-height: 46px;
  margin-top: 0;
  padding-left: 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.username-input:focus-within {
  border-color: var(--violet);
  box-shadow: 4px 4px 0 var(--stroke);
}

.account-form input:not([type="checkbox"]):focus,
.account-form textarea:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 4px 4px 0 var(--stroke);
}

.username-input input:focus,
.auth-form .username-input input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}

.account-form textarea {
  resize: none;
  scrollbar-width: none;
}

.account-form textarea::-webkit-scrollbar {
  display: none;
}

.color-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.color-field input[type="color"] {
  width: 72px;
  height: 44px;
  min-width: 72px;
  padding: 4px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--field-bg);
  cursor: pointer;
}

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

.color-field input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 4px;
}

.color-field small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.name-gradient-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--paper-2);
}

.name-gradient-fields.is-disabled {
  opacity: 0.55;
}

.name-gradient-fields.is-disabled input {
  cursor: not-allowed;
}

.account-limited-field,
.account-textarea-field {
  display: grid;
  gap: 6px;
  position: relative;
  min-width: 0;
}

.field-counter {
  justify-self: end;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.field-counter.is-near-limit {
  color: var(--gold);
}

.field-counter.is-over-limit {
  color: var(--coral);
}

.field-hint {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.account-field {
  display: grid;
  gap: 6px;
}

.field-label {
  font-weight: 800;
}

.account-custom-select {
  position: relative;
  z-index: 3;
}

.account-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 12px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

.account-select-button:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 4px 4px 0 var(--stroke);
}

.account-select-button .material-symbols-rounded {
  color: var(--gold);
  transition: transform 0.16s ease;
}

.account-custom-select.is-open .account-select-button .material-symbols-rounded {
  transform: rotate(180deg);
}

.account-select-menu {
  position: absolute;
  inset: calc(100% + 8px) 0 auto 0;
  display: none;
  padding: 8px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--stroke);
  z-index: 20;
}

.account-custom-select.is-open .account-select-menu {
  display: grid;
  gap: 6px;
}

.account-select-menu button {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

.account-select-menu button:hover,
.account-select-menu button:focus,
.account-select-menu button.is-selected {
  outline: none;
  border-color: var(--stroke);
  background: var(--gold);
  color: var(--on-accent);
}

.compact-account-form {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px solid var(--stroke);
}

.account-avatar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  min-width: 0;
}

.upload-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.danger-command {
  background: var(--coral);
  color: var(--on-accent);
}

.auth-modal .text-command.danger-command {
  background: var(--coral);
  color: var(--on-accent);
}

.blue-command {
  background: var(--gold);
  color: var(--on-accent);
}

.session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 1500px) {
  .account-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-settings-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-settings-side .account-settings-panel {
    min-width: 0;
  }

  .compact-account-form {
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 760px) {
  .account-settings-side {
    grid-template-columns: 1fr;
  }
}

.delete-account-modal p:not(.eyebrow),
.delete-room-modal p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

.delete-room-confirm-copy strong {
  color: var(--ink);
}

.confirm-modal p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

.confirm-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.auth-modal .confirm-actions .text-command {
  width: auto;
  margin-top: 0;
}

.confirm-modal .confirm-actions > button {
  flex: 0 1 auto;
  width: auto;
  min-width: 86px;
  margin-top: 0;
  white-space: nowrap;
}

.confirm-modal .confirm-actions .text-command {
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
}

.author-card {
  background:
    linear-gradient(135deg, rgba(122, 85, 255, 0.22), rgba(29, 26, 43, 0.96)),
    var(--surface);
}

.author-card .avatar {
  width: 52px;
  height: 52px;
  font-size: 1.12rem;
}

.author-card h2 {
  margin-top: 0;
  font-size: 1.2rem;
  line-height: 1.15;
}

.author-card .profile-presence {
  margin-top: 8px;
  margin-bottom: 14px;
}


.signal-list,
.forecast-list {
  display: grid;
  gap: 10px;
}

.forecast-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font-weight: 900;
}

.forecast-list span {
  color: var(--muted);
}

.forecast-list strong {
  color: var(--mint);
}

.wide-layout,
.writer-layout {
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
}

.explore-wide {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
}

.explore-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: clamp(18px, 3vw, 42px);
  align-items: stretch;
  min-height: 330px;
  padding: clamp(20px, 3vw, 40px);
  background: var(--explore-stage-bg);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.explore-copy {
  display: grid;
  align-content: space-between;
  gap: 24px;
  min-width: 0;
}

.explore-copy h1 {
  max-width: 980px;
  font-size: clamp(2.35rem, 4.8vw, 5.2rem);
  line-height: 1.02;
}

.explore-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  max-width: 760px;
  min-height: 56px;
  padding: 8px 8px 8px 16px;
  background: var(--field-bg);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--violet);
  color: var(--muted);
  font-weight: 900;
}

.explore-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.explore-search input::placeholder {
  color: var(--muted);
}

.explore-search button,
.creator-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 12px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--on-accent);
  font-weight: 900;
}

.discover-workspace {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
}

.discover-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(20px, 3vw, 34px);
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.discover-header h1 {
  max-width: 820px;
  font-size: clamp(2.2rem, 4vw, 4.1rem);
  line-height: 1.02;
}

.discover-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  background: var(--field-bg);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.discover-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.discover-tabs button.is-active {
  color: var(--on-accent);
  background: var(--gold);
}

.discover-pane {
  display: none;
}

.discover-pane.is-active {
  display: grid;
  gap: 16px;
}

.rooms-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr) minmax(280px, 0.45fr);
  gap: 14px;
}

.room-spotlight,
.room-brief,
.discover-empty,
.room-browser-card,
.search-workbench,
.search-result-group {
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
}

.room-spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  min-height: 210px;
  padding: clamp(18px, 3vw, 30px);
  cursor: pointer;
}

.room-spotlight h2 {
  margin: 8px 0;
  font-size: clamp(1.85rem, 3vw, 3.15rem);
  line-height: 1.04;
}

.room-spotlight p,
.room-browser-card p,
.search-result-group p {
  color: var(--muted);
  line-height: 1.6;
}

.room-score {
  display: grid;
  place-items: center;
  min-width: 118px;
  min-height: 118px;
  padding: 14px;
  color: var(--on-accent);
  background: var(--mint);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--blue);
  text-align: center;
}

.room-score strong {
  font-size: 1.85rem;
  line-height: 1;
}

.room-score span {
  font-size: 0.76rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.discover-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.discover-metrics div {
  display: grid;
  align-content: space-between;
  min-height: 100px;
  padding: 14px;
  background: var(--paper-2);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
}

.discover-metrics span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.discover-metrics strong {
  color: var(--ink);
  font-size: 1.75rem;
}

.room-brief {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px;
  cursor: pointer;
}

.room-brief > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: 8px;
}

.room-brief small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.room-browser-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.room-browser-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
  container-type: inline-size;
}

.room-browser-card:hover,
.profile-browser-card:hover,
.room-spotlight:hover,
.room-brief:hover,
.search-result-group article:hover,
.compact-results button:hover,
.search-suggestions button:hover {
  border-color: var(--violet);
}

.room-browser-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  flex: 1 1 auto;
  align-content: start;
}

.room-browser-card h3,
.search-result-group h3 {
  font-size: 1.08rem;
  line-height: 1.2;
}

.room-browser-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.room-card-meta-block {
  display: grid;
  gap: 7px;
  align-content: start;
}

.room-browser-stats span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 30px;
  padding: 6px 8px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.room-browser-card small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.4;
}

.room-management {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.35fr);
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
}

.room-management-header {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.room-management-header h2 {
  font-size: clamp(1.45rem, 2.2vw, 2.2rem);
  line-height: 1.05;
}

.room-management-header p {
  color: var(--muted);
  line-height: 1.6;
}

.room-management-header strong {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  color: var(--on-accent);
  background: var(--gold);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  font-size: 1.55rem;
}

.room-management > .primary-button {
  justify-self: start;
  align-self: start;
  width: auto;
  min-height: 44px;
}

.owned-room-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.owned-room-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.owned-room-card h3 {
  font-size: 1rem;
}

.owned-room-card p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.owned-room-card small {
  display: block;
  margin-top: 6px;
  color: var(--mint);
  font-weight: 900;
}

.room-owner-actions,
.room-card-actions,
.room-edit-form > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.room-owner-actions {
  justify-content: flex-end;
}

.room-owner-actions button,
.room-card-actions button,
.room-edit-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--stroke);
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.room-owner-actions [data-write-room],
.room-card-actions [data-write-room],
.room-edit-form .blue-command {
  color: var(--on-primary);
  background: var(--blue);
}

.room-owner-actions [data-room-delete] {
  color: var(--on-primary);
  background: var(--red);
}

.room-card-actions button {
  flex: 1 1 140px;
}

.room-edit-form {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.room-edit-form[hidden] {
  display: none;
}

.room-edit-form input,
.room-edit-form textarea {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--field-bg);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font: inherit;
}

.owned-room-card.is-editing > div:first-child,
.owned-room-card.is-editing > .room-owner-actions {
  display: none;
}

.search-workbench {
  display: grid;
  gap: 12px;
  padding: clamp(16px, 2.5vw, 24px);
}

.search-workbench .explore-search {
  max-width: none;
  box-shadow: none;
}

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

.search-suggestions button,
.search-suggestions span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 6px 9px;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
}

.search-result-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
  color: var(--muted);
  font-weight: 900;
}

.search-result-summary strong {
  color: var(--ink);
}

.search-result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
}

.search-result-group {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
}

.search-result-group h2 {
  font-size: 1rem;
}

.search-result-group article,
.compact-results button {
  display: grid;
  gap: 6px;
  padding: 12px;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
}

.search-result-group small,
.compact-results small {
  color: var(--muted);
  font-weight: 800;
}

.compact-results button {
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
}

.compact-results button .avatar {
  width: 38px;
  height: 38px;
}

.compact-results button span {
  min-width: 0;
}

.discover-empty {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px;
}

.discover-empty > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: 10px;
}

.discover-empty h2 {
  font-size: 1.25rem;
}

.discover-empty p {
  margin-top: 4px;
  color: var(--muted);
}

.discover-workspace {
  max-width: 1220px;
  gap: 20px;
}

.discover-header {
  align-items: center;
  padding: clamp(22px, 3vw, 38px);
}

.discover-header > div {
  min-width: 0;
}

.discover-header h1 {
  max-width: 720px;
  font-size: clamp(2.35rem, 4.4vw, 4.4rem);
}

.discover-header p:not(.eyebrow) {
  max-width: 680px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.discover-pane.is-active {
  gap: 18px;
}

.rooms-overview {
  display: block;
}

.room-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.room-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 16px 18px;
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
}

.room-summary strong {
  font-size: 2rem;
  line-height: 1;
}

.room-summary span {
  color: var(--muted);
  font-weight: 900;
}

.room-management {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.room-management-header h2 {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
}

.room-create-form {
  align-content: start;
}

.owned-room-list {
  align-content: start;
}

.owned-room-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: var(--surface-2);
}

.owned-room-card p {
  display: none;
}

.room-search-form {
  width: 100%;
  max-width: none;
  box-shadow: none;
}

.room-browser-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.room-browser-card {
  gap: 16px;
  padding: 18px;
  background: var(--surface);
}

.room-browser-head {
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
}

.room-badge {
  width: 44px;
  height: 44px;
  background: var(--entity-accent, var(--field-bg));
  color: var(--entity-accent-ink, var(--on-accent));
}

.room-browser-card h3 {
  font-size: 1.25rem;
}

.room-browser-card p {
  margin-top: 4px;
}

.room-browser-stats {
  gap: 6px;
}

.room-browser-stats span {
  min-height: 28px;
  background: var(--field-bg-2);
  border-color: var(--line);
}

.room-card-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  width: 100%;
}

.room-card-actions button {
  flex: 0 1 auto;
}

.room-card-actions [data-write-room] {
  background: var(--violet);
}

.creator-row .room-badge {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
}

.creator-row button .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 1em;
  height: 1em;
  font-size: 20px;
  line-height: 1;
}

.room-management {
  align-items: start;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
}

.room-management-header {
  gap: 14px;
}

.room-management-header .eyebrow {
  margin: 0 0 6px;
}

.room-management-header .primary-button {
  justify-self: stretch;
  width: 100%;
}

.room-management-header .primary-button:disabled,
.discover-header .primary-button:disabled,
.room-create-hero .primary-button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.owned-room-toolbar span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.owned-room-toolbar {
  display: grid;
  gap: 3px;
  min-height: 0;
}

.owned-room-toolbar strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.owned-room-card {
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.owned-room-title {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.owned-room-title .room-badge {
  width: 38px;
  height: 38px;
  font-size: 1rem;
}

.owned-room-card p {
  display: block;
  margin-top: 8px;
  line-height: 1.45;
}

.owned-room-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.owned-room-meta span,
.room-card-kicker span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 7px;
  color: var(--muted);
  background: var(--field-bg);
  border: 2px solid var(--line);
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 900;
}

.owned-room-meta .needs-review {
  color: var(--on-accent);
  background: var(--gold);
  border-color: var(--stroke);
}

.room-owner-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  min-width: 196px;
}

.room-owner-actions button {
  min-height: 36px;
}

.room-owner-actions button span:last-child {
  min-width: 0;
}

.room-empty-state {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  color: var(--ink);
  background: var(--field-bg-2);
  border: 2px solid var(--line);
  border-radius: 8px;
}

.room-empty-state > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: 8px;
}

.room-empty-state h3 {
  font-size: 1rem;
}

.room-empty-state p {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.45;
}

.room-browser-toolbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px 16px;
  align-items: start;
  padding: 13px 16px;
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
}

.room-browser-toolbar.is-owned {
  gap: 8px 16px;
  grid-template-areas:
    "title"
    "switch"
    "tools";
}

.room-browser-toolbar > div:first-child {
  min-width: 0;
}

.room-browser-toolbar.is-owned > div:first-child {
  grid-area: title;
}

.room-browser-toolbar.is-owned .room-filter-switch {
  grid-area: switch;
}

.room-browser-toolbar h2 {
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.room-browser-toolbar p {
  color: var(--muted);
  margin-top: 8px;
  max-width: 760px;
  line-height: 1.45;
}

.room-filter-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(104px, 1fr));
  gap: 8px;
}

.room-filter-switch {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.room-filter-strip button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 38px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--field-bg-2);
  border: 2px solid var(--stroke);
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.room-filter-strip button span:not(.material-symbols-rounded) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-filter-strip button strong {
  color: var(--muted);
  font-size: 0.8rem;
}

.room-filter-strip button.is-selected {
  color: var(--on-primary);
  background: var(--violet);
}

.room-filter-strip button.is-selected strong {
  color: var(--on-primary);
}

.room-owned-tools {
  grid-area: tools;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto;
  gap: 12px 14px;
  align-items: center;
  padding-top: 8px;
  border-top: 2px solid var(--line);
}

.room-owned-tools .primary-button {
  min-height: 42px;
  padding-inline: 18px;
  white-space: nowrap;
}

.room-owned-browser-card {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  background: var(--surface);
  min-height: 112px;
}

.room-owned-browser-card .room-review-queue {
  grid-column: 1 / -1;
}

.room-card-kicker {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 6px;
}

.room-card-kicker span {
  gap: 4px;
}

.room-card-kicker .material-symbols-rounded {
  font-size: 0.95rem;
  line-height: 1;
  padding: 0;
  background: transparent;
  border: 0;
}

.room-browser-card {
  min-height: 260px;
}

.room-browser-card small {
  min-height: 20px;
}

@container (max-width: 330px) {
  .room-browser-head {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .room-browser-head .room-badge {
    width: 40px;
    height: 40px;
  }

  .room-browser-card h3 {
    font-size: 1.12rem;
  }

  .room-browser-card p {
    line-height: 1.45;
  }
}

.profiles-explorer-page {
  display: grid;
  gap: 18px;
  width: min(1220px, 100%);
  margin: 0 auto;
}

.profile-explorer-root,
.profile-explorer-grid {
  display: grid;
  gap: 16px;
}

.profile-explorer-grid {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.profile-explorer-toolbar {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
}

.profile-sort-toggle {
  display: none;
}

.profile-filter-row {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 2px solid var(--line);
}

.profile-filter-switch {
  grid-template-columns: repeat(5, minmax(112px, 1fr));
}

.profile-clear-filters {
  justify-self: start;
}

.profile-browser-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.profile-browser-grid > .list-pager,
.profile-browser-grid > .discover-empty {
  grid-column: 1 / -1;
}

.profile-browser-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(44px, 1fr) auto auto;
  gap: 13px;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--lift-shadow-sm);
  cursor: pointer;
}

.profile-browser-card.has-status {
  grid-template-rows: auto auto minmax(44px, 1fr) auto auto;
}

.profile-rank-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 34px;
  padding: 0 8px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: 8px;
  font-weight: 950;
}

.profile-browser-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-right: 52px;
}

.profile-browser-head .profile-avatar {
  width: 56px;
  height: 56px;
  font-size: 1.45rem;
}

.profile-browser-card h3 {
  overflow: hidden;
  font-size: 1.25rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-browser-card > p {
  min-height: 44px;
  color: var(--muted);
  line-height: 1.45;
  align-self: start;
}

.profile-browser-card > .profile-card-bio {
  display: -webkit-box;
  min-height: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.profile-browser-card .profile-card-status {
  color: var(--ink-soft);
  font-weight: 900;
  line-height: 1.35;
}

.profile-browser-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.profile-browser-stats span {
  min-width: 0;
  padding: 8px;
  color: var(--muted);
  background: var(--field-bg-2);
  border: 2px solid var(--line);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

.profile-browser-stats strong {
  color: var(--ink);
}

.profile-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 8px;
  align-self: end;
}

.profile-card-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 0 10px;
  color: var(--on-accent);
  background: var(--mint);
  border: 2px solid var(--stroke);
  border-radius: 8px;
  font-weight: 900;
}

.profile-card-actions button:last-child {
  background: var(--violet);
  color: var(--on-primary);
}

.room-create-limit {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: #21111b;
  border: 3px solid var(--red);
  border-radius: var(--radius);
}

.room-create-limit[hidden] {
  display: none;
}

.room-create-limit > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--on-primary);
  background: var(--red);
  border: 2px solid var(--stroke);
  border-radius: 8px;
}

.room-create-limit strong {
  display: block;
  color: var(--ink);
}

.room-create-limit p {
  margin-top: 3px;
  color: var(--muted);
}

.discover-empty button {
  width: fit-content;
  margin-top: 12px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font-weight: 900;
}

.trend-console {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  min-height: 100%;
  padding: 18px;
  background: var(--field-bg);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 8px 8px 0 rgba(122, 85, 255, 0.58);
}

.console-header,
.hot-kicker,
.hot-metrics,
.lane-heading,
.creator-row {
  display: flex;
  align-items: center;
}

.console-header {
  justify-content: space-between;
  font-weight: 900;
}

.console-header strong {
  color: var(--mint);
}

.trend-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(20px, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 180px;
  padding: 14px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 34px),
    var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.trend-bars span {
  height: var(--level);
  min-height: 28px;
  background: var(--violet);
  border: 2px solid var(--stroke);
  border-radius: 7px 7px 3px 3px;
}

.trend-bars span:nth-child(2n) {
  background: var(--mint);
}

.trend-bars span:nth-child(3n) {
  background: var(--gold);
}

.hot-filters {
  padding-bottom: 2px;
}

.hot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr) minmax(220px, 0.42fr) minmax(220px, 0.42fr);
  gap: 14px;
}

.hot-card,
.lane-panel {
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hot-card {
  min-height: 290px;
  padding: 20px;
}

.hot-card-main {
  display: grid;
  align-content: end;
  background:
    linear-gradient(135deg, rgba(122, 85, 255, 0.35), rgba(29, 26, 43, 0.96) 52%),
    var(--surface);
}

.hot-kicker {
  gap: 7px;
  color: var(--gold);
  font-weight: 900;
}

.hot-card-main h2 {
  margin-top: 16px;
  font-size: clamp(2rem, 3.5vw, 3.9rem);
  line-height: 1.04;
}

.hot-card-main p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.65;
}

.hot-metrics {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.hot-metrics span {
  padding: 8px 10px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 900;
}

.hot-metrics strong {
  color: var(--ink);
}

.hot-card-radar {
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, #05050b 0 52%, #2a263a 52%),
    #05050b;
}

.radar-board {
  position: relative;
  min-height: 100%;
}

.radar-board::before,
.radar-board::after {
  content: "";
  position: absolute;
  inset: 17%;
  border: 3px solid rgba(122, 85, 255, 0.72);
  border-radius: 50%;
}

.radar-board::after {
  inset: 30% 18% 18% 30%;
  border-color: rgba(73, 198, 164, 0.58);
}

.radar-chip {
  position: absolute;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border: 3px solid var(--stroke);
  border-radius: 24px;
  background: var(--ink);
  color: var(--paper);
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--violet);
}

.chip-one {
  top: 18%;
  left: 17%;
}

.chip-two {
  top: 24%;
  right: 17%;
  background: var(--mint);
}

.chip-three {
  left: 25%;
  bottom: 16%;
  background: var(--coral);
}

.chip-four {
  right: 12%;
  bottom: 13%;
  background: var(--gold);
}

.vertical-card {
  display: grid;
  align-content: space-between;
  gap: 12px;
  background: var(--gold);
  color: var(--on-accent);
}

.vertical-card > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--ink);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  color: var(--violet);
}

.vertical-card h3 {
  font-size: 1rem;
}

.vertical-card strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.1;
}

.vertical-card p {
  margin: 0;
  color: #2b2540;
  font-weight: 900;
}

.accent-mint {
  background: var(--mint);
}

.explore-lanes {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.25fr) minmax(0, 0.9fr);
  gap: 14px;
}

.lane-panel {
  padding: 18px;
}

.lane-heading {
  gap: 8px;
  margin-bottom: 14px;
}

.lane-heading h2 {
  font-size: 1.15rem;
}

.lane-item,
.creator-row {
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  padding: 12px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.lane-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
}

.lane-item + .lane-item,
.creator-row + .creator-row {
  margin-top: 10px;
}

.lane-item span {
  color: var(--violet-dark);
  font-weight: 900;
}

.lane-item small,
.creator-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 800;
}

.lane-item em {
  color: var(--mint);
  font-style: normal;
  font-weight: 900;
}

.lane-posts {
  display: grid;
  gap: 12px;
}

.poster-story {
  min-height: 210px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(255, 117, 93, 0.92), rgba(245, 184, 75, 0.92)),
    var(--coral);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  color: var(--on-accent);
}

.poster-story span {
  font-weight: 900;
  text-transform: uppercase;
}

.poster-story h3 {
  margin: 24px 0 10px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
}

.poster-story p {
  max-width: 620px;
  color: #231928;
  font-weight: 800;
}

.creator-row {
  justify-content: space-between;
}

.creator-row > div {
  min-width: 0;
  flex: 1;
}

.creator-row strong,
.creator-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.side-rail .creator-row {
  flex-wrap: wrap;
}

.side-rail .creator-row > button {
  flex: 0 1 auto;
  max-width: 100%;
  white-space: nowrap;
}

.side-rail .creator-row > div {
  flex-basis: 0;
}

.side-rail .creator-row strong,
.side-rail .creator-row small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-rail .creator-row strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.side-rail .creator-row small {
  white-space: nowrap;
}

.discover-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.explore-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: clamp(24px, 3vw, 48px);
}

.explore-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.explore-filters {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.explore-filters::-webkit-scrollbar {
  display: none;
}

.explore-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.75fr);
  min-height: 420px;
  overflow: hidden;
}

.explore-hero > div:first-child {
  display: grid;
  align-content: center;
  padding: clamp(24px, 4vw, 54px);
}

.explore-hero h2 {
  margin-top: 14px;
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: clamp(2.4rem, 4.8vw, 5.6rem);
  line-height: 0.98;
}

.explore-hero p {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.orb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.orb-row strong,
.orb-row span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font-weight: 900;
}

.orb-row strong {
  background: var(--gold);
  color: var(--on-accent);
}

.orb-row span {
  background: var(--paper-2);
  color: var(--ink);
}

.pulse-map {
  position: relative;
  min-height: 100%;
  background:
    linear-gradient(135deg, #05050b 0 52%, #2a263a 52%),
    #05050b;
  border-left: 3px solid var(--stroke);
}

.pulse-map::before,
.pulse-map::after {
  content: "";
  position: absolute;
  inset: 22%;
  border: 3px solid rgba(122, 85, 255, 0.72);
  border-radius: 50%;
}

.pulse-map::after {
  inset: 34% 18% 18% 36%;
  border-color: rgba(73, 198, 164, 0.58);
}

.map-node {
  position: absolute;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border: 3px solid var(--stroke);
  border-radius: 28px;
  background: var(--ink);
  color: var(--paper);
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--violet);
}

.node-a {
  top: 18%;
  left: 20%;
}

.node-b {
  top: 28%;
  right: 18%;
  background: var(--mint);
  box-shadow-color: var(--gold);
}

.node-c {
  bottom: 18%;
  left: 28%;
  background: var(--coral);
  box-shadow-color: var(--blue);
}

.node-d {
  right: 12%;
  bottom: 14%;
  background: var(--gold);
  box-shadow-color: var(--violet);
}

.explore-section {
  padding: 20px;
}

.room-list {
  display: grid;
  gap: 12px;
}

.room-list article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.room-badge {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--entity-accent, var(--violet));
  color: var(--entity-accent-ink, var(--on-accent));
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font-weight: 900;
}

.room-list h3,
.mini-story-list h3 {
  font-size: 1rem;
}

.room-list p {
  margin: 5px 0 0;
  color: var(--muted);
}

.room-list strong {
  color: var(--mint);
  white-space: nowrap;
}

.explore-rail {
  display: grid;
  align-content: start;
  gap: 14px;
  position: sticky;
  top: 104px;
}

.leaderboard-list {
  gap: 14px;
}

.mini-story-list {
  display: grid;
  gap: 10px;
}

.mini-story-list article {
  padding: 12px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.mini-story-list span {
  display: inline-block;
  margin-top: 8px;
  color: var(--violet-dark);
  font-weight: 900;
}

.creator-panel {
  overflow: hidden;
}

.cluster-stack {
  display: flex;
  margin: 8px 0 14px;
}

.cluster-stack .avatar {
  width: 48px;
  height: 48px;
  margin-right: -10px;
  font-size: 1.1rem;
}

.space-card {
  min-height: 260px;
  padding: 20px;
}

.space-card > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 26px;
  background: var(--gold);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--stroke);
  color: var(--on-accent);
}

.space-card:nth-child(2) > .material-symbols-rounded {
  background: var(--mint);
}

.space-card:nth-child(3) > .material-symbols-rounded {
  background: var(--coral);
}

.space-card:nth-child(4) > .material-symbols-rounded {
  background: #a996ff;
}

.space-card h2 {
  font-size: 1.55rem;
}

.space-card strong {
  display: inline-block;
  margin-top: 12px;
  color: var(--violet-dark);
}

.writer-layout {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.writing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
  min-width: 0;
}

.editor-shell {
  display: grid;
  gap: 14px;
  width: 100%;
  min-width: 0;
  container-type: inline-size;
  min-height: 720px;
  padding: clamp(16px, 2.6vw, 28px);
  overflow: hidden;
}

.writing-rail {
  display: grid;
  align-content: start;
  gap: 14px;
  position: sticky;
  top: 104px;
  min-width: 0;
}

@media (max-width: 1500px) {
  .writer-toolbar {
    align-items: start;
  }

  .writer-toolbar > div:first-child {
    min-width: 0;
  }

  .writing-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .writing-rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .writing-rail .panel:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .writing-rail {
    grid-template-columns: 1fr;
  }

  .writing-rail .panel:last-child {
    grid-column: auto;
  }
}

.compose-status,
.compose-meta,
.compose-toolbar,
.compose-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.compose-status {
  justify-content: flex-end;
  padding: 10px 12px;
  background: var(--field-bg);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 900;
}

.compose-status span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.compose-meta span {
  min-height: 34px;
  padding: 7px 10px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--violet-dark);
  font-size: 0.86rem;
  font-weight: 900;
}

.title-field {
  display: grid;
  gap: 8px;
}

.title-field span,
.excerpt-field span {
  color: var(--violet-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.title-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 1.08em;
  resize: none;
  overflow: hidden;
  padding: 8px 0 14px;
  border: 0;
  border-bottom: 3px solid var(--stroke);
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: clamp(2rem, 8cqw, 4.6rem);
  font-weight: 900;
  line-height: 1.04;
}

.title-field textarea:focus {
  border-bottom-color: var(--violet);
}

.excerpt-field {
  display: grid;
  gap: 8px;
  max-width: 920px;
}

.excerpt-field textarea {
  width: 100%;
  min-height: 92px;
  resize: none;
  overflow-y: auto;
  padding: 12px 14px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  outline: 0;
  background: var(--field-bg);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.excerpt-field textarea::-webkit-scrollbar {
  display: none;
}

.excerpt-field textarea:focus {
  border-color: var(--violet);
}

.compose-toolbar {
  position: sticky;
  top: 91px;
  z-index: 10;
  width: max-content;
  max-width: 100%;
  padding: 8px;
  background: rgba(8, 7, 17, 0.92);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--violet);
  backdrop-filter: blur(14px);
}

.compose-toolbar button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
}

.compose-toolbar button:hover {
  color: var(--on-primary);
  background: var(--violet);
}

.smart-composer {
  display: block;
  position: relative;
  width: 100%;
  min-width: 0;
  min-inline-size: 0;
  min-height: 410px;
  padding: clamp(10px, 2vw, 18px) 0 28px;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.78;
}

.smart-composer.is-empty::before {
  content: attr(data-placeholder);
  position: absolute;
  inset: clamp(10px, 2vw, 18px) 0 auto;
  color: var(--muted);
  pointer-events: none;
}

.smart-composer p,
.smart-composer div,
.smart-composer ul,
.smart-composer blockquote {
  width: 100%;
  max-width: 920px;
  min-width: 0;
}

.smart-composer h2 {
  width: 100%;
  max-width: 980px;
  min-width: 0;
  margin: 1.2em 0 0.35em;
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: clamp(1.65rem, 2.4vw, 2.55rem);
  line-height: 1.12;
}

.smart-composer p {
  margin: 0.85em 0;
}

.smart-composer ul {
  margin: 0.85em 0;
  padding-left: 1.4em;
}

.smart-composer li {
  margin: 0.35em 0;
}

.smart-composer blockquote {
  margin: 1em 0;
  padding: 14px 18px;
  background: var(--paper-2);
  border-left: 6px solid var(--violet);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 800;
}

.smart-composer a {
  color: var(--violet-light);
  font-weight: 900;
}

.smart-composer code {
  padding: 2px 7px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--gold);
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-weight: 900;
}

.smart-composer strong {
  color: var(--ink);
}

.post-image-block {
  position: relative;
  padding: 10px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  touch-action: pan-y;
}

.post-image-block img {
  -webkit-user-drag: none;
  user-select: none;
}

.post-image-block.is-selected {
  border-color: var(--violet);
  background: rgba(122, 85, 255, 0.12);
}

.post-image-block.is-dragging {
  opacity: 0.58;
  cursor: grabbing;
}

.image-editor-controls {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 8px;
  background: var(--field-bg);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.post-image-block.is-selected .image-editor-controls {
  display: flex;
}

.image-editor-controls button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.image-editor-controls button:hover,
.image-editor-controls button.is-active {
  background: var(--violet);
  color: var(--on-primary);
}

.image-editor-controls [data-image-drag-handle] {
  cursor: grab;
  touch-action: none;
}

.post-image-block.is-dragging .image-editor-controls [data-image-drag-handle] {
  cursor: grabbing;
}

.image-editor-controls label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.image-editor-controls output {
  min-width: 38px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.image-editor-controls input[type="range"] {
  width: 128px;
  accent-color: var(--violet);
}

.compose-footer {
  justify-content: space-between;
  padding-top: 14px;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-weight: 900;
}

.settings-panel {
  background: var(--settings-panel-bg);
}

.drafts-panel {
  display: grid;
  gap: 12px;
}

.drafts-list {
  display: grid;
  gap: 10px;
}

.draft-empty {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.draft-empty .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--violet-dark);
}

.draft-empty strong,
.draft-empty p {
  grid-column: 2;
  margin: 0;
}

.draft-empty p {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.4;
}

.draft-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: stretch;
  padding: 8px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.draft-card.is-active {
  border-color: var(--violet);
  box-shadow: 3px 3px 0 rgba(122, 85, 255, 0.24);
}

.draft-open-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.draft-card-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--violet-dark);
}

.draft-card-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.draft-card-body strong,
.draft-card-body small,
.draft-card-body > span,
.draft-card-body em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-card-body small,
.draft-card-body > span,
.draft-card-body em {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.draft-card-body em {
  color: var(--red);
  font-style: normal;
}

.draft-card .icon-button.small {
  align-self: start;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.app-settings-panel {
  display: grid;
  gap: 18px;
  padding: clamp(16px, 2.4vw, 24px);
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px;
}

.settings-description {
  margin: -6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.theme-option {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 112px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font-weight: 900;
}

.theme-option:hover,
.theme-option:focus-visible {
  border-color: var(--violet);
  box-shadow: 4px 4px 0 var(--stroke);
  outline: 0;
}

.theme-option.is-selected {
  background: var(--surface);
  box-shadow: inset 0 0 0 3px var(--violet);
}

.theme-option small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.theme-preset-options {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: 9px;
}

.theme-preset-options .theme-option {
  position: relative;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 9px;
  min-height: 66px;
  padding: 8px;
  box-shadow: none;
}

.theme-preset-options .theme-option:hover,
.theme-preset-options .theme-option:focus-visible {
  box-shadow: 3px 3px 0 var(--stroke);
}

.theme-preset-options .theme-option.is-selected {
  box-shadow: inset 0 0 0 2px var(--violet);
}

.theme-preset-options .theme-option.is-selected::after {
  content: "✓";
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  color: var(--on-primary);
  background: var(--violet);
  border: 2px solid var(--stroke);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 1000;
  line-height: 1;
}

.theme-preset-options .theme-option strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.84rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.language-options .theme-option {
  grid-template-columns: 64px minmax(0, 1fr);
}

.messenger-privacy-options {
  grid-template-columns: 1fr;
}

.messenger-privacy-options .theme-option {
  grid-template-columns: 46px minmax(0, 1fr);
  min-height: 0;
}

.messenger-privacy-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--on-primary);
  background: var(--violet);
  border: 2px solid var(--stroke);
  border-radius: var(--radius-small);
  box-shadow: 3px 3px 0 var(--stroke);
}

.language-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  color: var(--on-primary);
  overflow: hidden;
  position: relative;
  background: var(--violet);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--stroke);
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-weight: 1000;
}

.language-flag {
  isolation: isolate;
}

.language-flag::before,
.language-flag::after,
.language-flag > span {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 5px;
}

.language-flag-en {
  background:
    linear-gradient(135deg, rgba(73, 198, 164, 0.34), rgba(122, 85, 255, 0.3)),
    #171126;
}

.language-flag-en::before {
  background:
    linear-gradient(35deg, transparent 39%, #ffffff 40% 48%, #f35a6d 49% 54%, #ffffff 55% 63%, transparent 64%),
    linear-gradient(145deg, transparent 39%, #ffffff 40% 48%, #f35a6d 49% 54%, #ffffff 55% 63%, transparent 64%),
    #253f91;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.language-flag-en::after {
  inset: 8px;
  background:
    linear-gradient(90deg, transparent 0 38%, #ffffff 39% 45%, #f35a6d 46% 54%, #ffffff 55% 61%, transparent 62%),
    linear-gradient(0deg, transparent 0 35%, #ffffff 36% 43%, #f35a6d 44% 56%, #ffffff 57% 64%, transparent 65%);
}

.language-flag-en > span {
  inset: 6px;
  border: 2px solid var(--stroke);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.language-flag-de {
  background:
    linear-gradient(135deg, rgba(73, 198, 164, 0.34), rgba(122, 85, 255, 0.3)),
    #171126;
}

.language-flag-de::before {
  background:
    linear-gradient(180deg, #111018 0 33.33%, #e4474f 33.33% 66.66%, #f4bd4d 66.66% 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.14);
}

.language-flag-de::after {
  inset: 6px;
  border: 2px solid var(--stroke);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.theme-preview {
  display: grid;
  grid-template-rows: 18px 1fr 16px;
  gap: 6px;
  width: 86px;
  height: 68px;
  padding: 7px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--stroke);
}

.theme-preview span {
  border-radius: 4px;
}

.theme-preview span:nth-child(2) {
  width: 72%;
}

.theme-preset-options .theme-preview {
  grid-template-rows: 9px 1fr 8px;
  gap: 3px;
  width: 48px;
  height: 44px;
  padding: 4px;
  box-shadow: 2px 2px 0 var(--stroke);
}

.theme-preview-default {
  background: #0a0912;
}

.theme-preview-default span:nth-child(1) {
  background: #1d1a2b;
}

.theme-preview-default span:nth-child(2) {
  background: #7a55ff;
}

.theme-preview-default span:nth-child(3) {
  background: #151321;
}

.theme-preview-light {
  background: #f8f7ff;
}

.theme-preview-light span:nth-child(1) {
  background: #ffffff;
}

.theme-preview-light span:nth-child(2) {
  background: #6f4cff;
}

.theme-preview-light span:nth-child(3) {
  background: #edeaf7;
}

.theme-preview-ocean {
  background: #06141c;
}

.theme-preview-ocean span:nth-child(1) { background: #102d3a; }
.theme-preview-ocean span:nth-child(2) { background: #2fc7d8; }
.theme-preview-ocean span:nth-child(3) { background: #0b202b; }

.theme-preview-sunset {
  background: #1b0c18;
}

.theme-preview-sunset span:nth-child(1) { background: #3a1b30; }
.theme-preview-sunset span:nth-child(2) { background: #ff6f91; }
.theme-preview-sunset span:nth-child(3) { background: #291222; }

.theme-preview-forest { background: #07150d; }
.theme-preview-forest span:nth-child(1) { background: #142b1d; }
.theme-preview-forest span:nth-child(2) { background: #44d17a; }
.theme-preview-forest span:nth-child(3) { background: #b8e85c; }

.theme-preview-royal { background: #080d20; }
.theme-preview-royal span:nth-child(1) { background: #172343; }
.theme-preview-royal span:nth-child(2) { background: #668cff; }
.theme-preview-royal span:nth-child(3) { background: #55d6ff; }

.theme-preview-rose { background: #190c18; }
.theme-preview-rose span:nth-child(1) { background: #351a31; }
.theme-preview-rose span:nth-child(2) { background: #f067c8; }
.theme-preview-rose span:nth-child(3) { background: #ff9f87; }

.theme-preview-ember { background: #190e08; }
.theme-preview-ember span:nth-child(1) { background: #352012; }
.theme-preview-ember span:nth-child(2) { background: #ff8a3d; }
.theme-preview-ember span:nth-child(3) { background: #ffd166; }

.theme-preview-crimson { background: #19090d; }
.theme-preview-crimson span:nth-child(1) { background: #35141b; }
.theme-preview-crimson span:nth-child(2) { background: #ff5267; }
.theme-preview-crimson span:nth-child(3) { background: #ff9d58; }

.theme-preview-lime { background: #101507; }
.theme-preview-lime span:nth-child(1) { background: #242f13; }
.theme-preview-lime span:nth-child(2) { background: #a4dc42; }
.theme-preview-lime span:nth-child(3) { background: #50dbc8; }

.theme-preview-mono { background: #0e0f12; }
.theme-preview-mono span:nth-child(1) { background: #22242a; }
.theme-preview-mono span:nth-child(2) { background: #d5d7dd; }
.theme-preview-mono span:nth-child(3) { background: #8e96a8; }

.theme-preview-custom {
  background: var(--custom-preview-background, #0a0912);
}

.theme-preview-custom span:nth-child(1) { background: var(--custom-preview-surface, #1d1a2b); }
.theme-preview-custom span:nth-child(2) { background: var(--custom-preview-accent, #7a55ff); }
.theme-preview-custom span:nth-child(3) { background: var(--custom-preview-highlight, #49c6a4); }

.custom-theme-editor {
  display: grid;
  gap: 16px;
  padding: clamp(14px, 2vw, 20px);
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.custom-theme-heading h3,
.custom-theme-heading p {
  margin: 0;
}

.custom-theme-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.custom-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 10px;
}

.custom-color-field {
  display: grid;
  gap: 8px;
  padding: 11px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 900;
}

.custom-color-field > span:last-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-color-field input[type="color"] {
  width: 46px;
  height: 38px;
  padding: 3px;
  cursor: pointer;
  background: var(--paper);
  border: 2px solid var(--stroke);
  border-radius: 6px;
}

.custom-color-field output {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem;
}

.custom-theme-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.custom-theme-actions > button {
  flex: 1 1 230px;
  width: auto;
  min-width: 0;
  max-width: 330px;
  min-height: 46px;
  padding-inline: 14px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .custom-theme-actions > button {
    flex-basis: 100%;
    width: 100%;
    max-width: none;
  }
}

.setting-group {
  display: grid;
  gap: 9px;
}

.setting-group + .setting-group {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--line);
}

.setting-label {
  color: var(--violet-dark);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.setting-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr));
  gap: 8px;
}

.setting-options button,
.select-row {
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 900;
}

.setting-options button {
  min-width: 0;
  min-height: 40px;
  padding: 8px 6px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  white-space: normal;
}

.setting-options button.is-selected {
  background: var(--ink);
  color: var(--paper);
}

.select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px;
  text-align: left;
}

.select-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.room-create-form {
  display: grid;
  gap: 8px;
}

.room-create-form {
  padding: 12px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.room-create-form input,
.room-create-form textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.room-create-form textarea {
  resize: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.room-create-form textarea::-webkit-scrollbar {
  display: none;
}

.room-create-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--mint);
  color: var(--on-accent);
  font-weight: 900;
}

.room-create-page {
  width: min(1220px, 100%);
  margin: 0 auto;
}

.room-create-full {
  gap: 18px;
  padding: 0;
  background: transparent;
  border: 0;
}

.room-create-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(22px, 3vw, 38px);
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.room-create-hero h1 {
  max-width: 780px;
  font-size: clamp(2.15rem, 4vw, 4rem);
  line-height: 1.03;
}

.room-create-hero p:not(.eyebrow) {
  max-width: 680px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.room-create-full .primary-button {
  background: var(--violet);
  color: var(--on-primary);
}

.room-create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 18px;
}

.room-create-main,
.room-create-side,
.room-option-group,
.room-member-picker {
  min-width: 0;
}

.room-create-main,
.room-create-side {
  display: grid;
  align-content: start;
  gap: 14px;
}

.room-create-main {
  padding: 18px;
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
}

.room-create-main label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.room-create-main input,
.room-create-main textarea {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  color: var(--ink);
  background: var(--field-bg);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 800;
}

.room-create-main textarea {
  min-height: 220px;
  resize: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.room-create-main textarea::-webkit-scrollbar {
  display: none;
}

.room-create-main .color-field input[type="color"] {
  width: 72px;
  min-width: 72px;
  height: 44px;
  padding: 4px;
}

.room-option-group,
.room-member-picker {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
}

.room-option-group {
  margin: 0;
}

.room-option-group legend,
.room-member-picker h2 {
  margin-bottom: 2px;
  font-size: 1rem;
  font-weight: 900;
}

.room-option-card,
.room-member-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  background: var(--field-bg-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.room-option-card.is-selected {
  border-color: var(--violet);
  background: rgba(122, 85, 255, 0.16);
}

.room-option-card.is-disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.room-option-card input,
.room-member-row input {
  margin-top: 4px;
  accent-color: var(--violet);
}

.room-option-card small,
.room-member-picker p,
.room-member-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.room-member-picker {
  display: none;
}

.room-member-picker.is-active {
  display: grid;
}

.room-member-list {
  display: grid;
  gap: 8px;
}

.room-member-row {
  grid-template-columns: auto 38px minmax(0, 1fr);
  align-items: center;
}

.room-member-row .avatar {
  width: 38px;
  height: 38px;
}

.room-image-badge {
  overflow: hidden;
  background: var(--entity-accent, var(--field-bg));
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--entity-accent, var(--violet)) 62%, var(--stroke));
}

.room-image-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.room-edit-page {
  width: min(1220px, 100%);
  margin: 0 auto;
}

.room-edit-full {
  gap: 18px;
  padding: 0;
  background: transparent;
  border: 0;
}

.room-edit-hero {
  display: grid;
  gap: 18px;
  min-height: 280px;
  padding: clamp(20px, 3vw, 34px);
  background:
    linear-gradient(135deg, var(--entity-accent, var(--violet)), rgba(81, 205, 171, 0.22) 52%, rgba(5, 5, 11, 0.86)),
    var(--room-edit-hero-bg);
  background-size: cover;
  background-position: center;
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.room-edit-hero.has-image {
  background-size: cover;
  background-position: center;
}

.room-edit-hero-overlay {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  align-self: end;
}

.room-edit-icon {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  color: var(--entity-accent-ink, var(--on-accent));
  background: var(--entity-accent, var(--mint));
  border: 3px solid var(--stroke);
  border-radius: 50%;
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--entity-accent, var(--violet)) 62%, var(--stroke));
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: 2.35rem;
  font-weight: 1000;
}

.room-edit-hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 0.98;
}

.room-edit-hero p {
  margin-top: 8px;
  color: var(--ink-soft);
  font-weight: 900;
}

.room-edit-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-self: start;
}

.room-edit-upload-row .upload-button {
  width: auto;
  min-height: 42px;
  padding: 9px 12px;
  background: var(--paper-2);
}

.room-edit-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px;
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.room-edit-footer .danger-command {
  margin-right: auto;
}

@media (max-width: 1500px) {
  .room-create-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .room-create-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-member-picker {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .room-create-side {
    grid-template-columns: 1fr;
  }

  .room-member-picker {
    grid-column: auto;
  }
}

.switch-list {
  display: grid;
  gap: 10px;
}

.switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.switch-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.switch-row input {
  appearance: none;
  position: relative;
  width: 48px;
  height: 28px;
  border: 2px solid var(--stroke);
  border-radius: 999px;
  background: var(--field-bg);
  cursor: pointer;
}

.switch-row input::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 3px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--stroke);
  border-radius: 50%;
  background: var(--muted);
  transition:
    left 160ms ease,
    background 160ms ease;
}

.switch-row input:checked {
  background: var(--violet);
}

.switch-row input:checked::after {
  left: 21px;
  background: var(--mint);
}

.mobile-nav {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--modal-backdrop);
}

.modal-backdrop.is-open {
  display: grid;
}

.social-gallery-backdrop {
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: rgba(7, 7, 12, 0.92);
}

.social-gallery-viewer {
  --gallery-swipe-x: 0px;
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding:
    calc(58px + env(safe-area-inset-top))
    calc(78px + env(safe-area-inset-right))
    calc(58px + env(safe-area-inset-bottom))
    calc(78px + env(safe-area-inset-left));
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.social-gallery-image-frame {
  position: relative;
  display: inline-grid;
  place-items: center;
  max-width: 100%;
  max-height: calc(100vh - 116px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  max-height: calc(100dvh - 116px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

.social-gallery-viewer img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 116px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  max-height: calc(100dvh - 116px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  object-fit: contain;
  border-radius: 4px;
  transform: translate3d(var(--gallery-swipe-x), 0, 0);
  transition: transform 180ms ease;
  -webkit-user-drag: none;
  user-select: none;
}

.social-gallery-viewer.is-swipe-active img {
  transition: none;
}

.social-gallery-close {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  right: calc(10px + env(safe-area-inset-right));
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #fff;
  background: rgba(21, 19, 33, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  backdrop-filter: blur(8px);
}

.social-gallery-close:hover {
  background: rgba(122, 85, 255, 0.76);
}

.social-gallery-close:active,
.social-gallery-nav:active {
  background: rgba(122, 85, 255, 0.9);
}

.social-gallery-close .material-symbols-rounded {
  font-size: 22px;
}

.social-gallery-nav {
  position: fixed;
  top: 50%;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  color: #fff;
  background: rgba(20, 20, 28, 0.74);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  transform: translateY(-50%);
  cursor: pointer;
}

.social-gallery-nav[hidden] {
  display: none;
}

.social-gallery-nav-previous {
  left: calc(18px + env(safe-area-inset-left));
}

.social-gallery-nav-next {
  right: calc(18px + env(safe-area-inset-right));
}

.social-gallery-viewer-counter {
  position: fixed;
  top: calc(20px + env(safe-area-inset-top));
  left: 50%;
  z-index: 2;
  padding: 5px 12px;
  color: #fff;
  background: rgba(20, 20, 28, 0.74);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  font-weight: 1000;
  transform: translateX(-50%);
}

.auth-modal {
  position: relative;
  width: min(100%, 430px);
  max-width: calc(100vw - 24px);
  max-height: calc(
    100dvh - max(18px, env(safe-area-inset-top)) - max(18px, env(safe-area-inset-bottom))
  );
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 24px;
}

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

.auth-modal img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: 3px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 2px 2px 0 var(--violet);
}

.modal-backdrop .auth-modal > img,
.modal-backdrop .auth-modal > .eyebrow {
  display: none;
}

.auth-modal .room-image-badge img {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.auth-modal h2 {
  margin: 8px 0 18px;
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: 2.1rem;
  line-height: 1;
}

.language-modal {
  width: min(100%, 560px);
}

.language-modal p:not(.eyebrow) {
  color: var(--ink-soft);
  line-height: 1.5;
  font-weight: 800;
}

.language-choice-grid {
  margin-top: 18px;
}

.language-choice-grid button {
  align-items: center;
}

.close-modal {
  position: absolute;
  top: 14px;
  right: 14px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  font-weight: 900;
}

.auth-form input {
  min-height: 46px;
  padding: 10px 12px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  outline: 0;
  background: var(--surface-2);
  color: var(--ink);
}

.auth-form .legal-check {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px;
  background: var(--surface-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font-size: 0.92rem;
  line-height: 1.35;
}

.auth-form .legal-check input {
  appearance: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--stroke);
  border-radius: 6px;
  background: var(--field-bg);
  cursor: pointer;
}

.auth-form .legal-check input:checked {
  background: var(--violet);
}

.auth-form .legal-check input:checked::after {
  content: "check";
  color: var(--on-primary);
  font-family: "Material Symbols Rounded";
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.auth-form .legal-check a {
  color: var(--gold);
  text-decoration: none;
}

.auth-form .legal-check a:hover {
  text-decoration: underline;
}

.auth-form .username-input {
  margin-top: 0;
  background: var(--surface-2);
}

.auth-form .username-input input {
  color: var(--ink);
}

.auth-form input::placeholder {
  color: var(--placeholder);
}

.auth-form input:focus,
textarea:focus {
  box-shadow: 0 0 0 4px rgba(109, 72, 255, 0.2);
}

.report-reason-field {
  display: grid;
  gap: 8px;
  font-weight: 900;
}

.report-reason-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.report-reason-grid button {
  min-height: 40px;
  padding: 8px 10px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 900;
}

.report-reason-grid button.is-selected {
  background: var(--ink);
  color: var(--paper);
}

.report-modal textarea {
  width: 100%;
  min-height: 110px;
  padding: 10px 12px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  outline: 0;
  resize: none;
  scrollbar-width: none;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
}

.report-modal textarea::-webkit-scrollbar {
  display: none;
}

.search:focus-within {
  border-color: var(--violet);
  box-shadow: 3px 3px 0 rgba(122, 85, 255, 0.55);
}

.auth-modal .text-command {
  width: 100%;
  justify-content: center;
  margin-top: 12px;
  background: var(--surface-2);
  color: var(--ink);
}

.verify-email-modal {
  width: min(520px, calc(100vw - 24px));
  overflow: hidden;
}

.password-reset-modal {
  width: min(520px, calc(100vw - 24px));
}

.password-reset-modal > p:not(.eyebrow),
.password-reset-modal .field-hint {
  color: var(--muted);
  line-height: 1.55;
}

.password-reset-confirm-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid var(--line);
}

.verify-email-modal > p:not(.eyebrow),
.verify-email-modal .field-hint {
  color: var(--muted);
  line-height: 1.55;
}

.verify-email-modal strong {
  color: var(--ink);
}

.verify-code-form input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 58px;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 1000;
  letter-spacing: clamp(0.12em, 2.8vw, 0.28em);
}

.verify-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.verify-actions .text-command {
  margin-top: 0;
}

.verify-actions .blue-command {
  width: auto;
}

.verify-change-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid var(--line);
}

.verify-change-form input,
.verify-change-form button,
.verify-code-form button {
  width: 100%;
  min-width: 0;
}

.room-picker-modal,
.room-write-modal,
.bookmark-collections-modal,
.poll-results-modal {
  width: min(560px, calc(100vw - 24px));
}

.room-picker-modal > p,
.room-write-modal > p,
.bookmark-collections-modal > p:not(.eyebrow),
.poll-results-modal > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

.bookmark-collections-modal .confirm-actions {
  margin-top: 16px;
}

.bookmark-collections-modal [data-bookmark-remove][hidden] {
  display: none;
}

.modal-search-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding: 0 12px;
  background: var(--field-bg);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.modal-search-field input {
  min-width: 0;
  min-height: 44px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--ink);
  border: 0;
  outline: 0;
}

.modal-search-field:focus-within {
  border-color: var(--violet);
}

.modal-option-list {
  display: grid;
  gap: 8px;
  max-height: min(380px, 46vh);
  margin-top: 14px;
  overflow: auto;
  scrollbar-width: none;
}

.modal-option-list::-webkit-scrollbar {
  display: none;
}

.modal-option-list button,
.modal-empty-state,
.modal-choice-grid button {
  display: grid;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  color: var(--ink);
  background: var(--surface-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  text-align: left;
}

.modal-option-list button {
  grid-template-columns: auto minmax(0, 1fr);
  cursor: pointer;
}

.modal-option-list button.is-selected {
  border-color: var(--violet);
  box-shadow: 3px 3px 0 rgba(122, 85, 255, 0.55);
}

.room-picker-modal .modal-option-list button.is-selected {
  box-shadow: none;
}

.modal-option-list strong,
.modal-option-list small,
.modal-choice-grid strong,
.modal-choice-grid small {
  display: block;
}

.modal-option-list small,
.modal-choice-grid small,
.modal-empty-state small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 800;
}

.modal-empty-state {
  grid-template-columns: auto minmax(0, 1fr);
}

.poll-results-summary {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 900;
}

.poll-results-list {
  display: grid;
  gap: 12px;
  max-height: min(480px, 52vh);
  margin-top: 14px;
  overflow: auto;
  scrollbar-width: none;
}

.poll-results-list::-webkit-scrollbar {
  display: none;
}

.poll-result-option {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--surface-2);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.poll-result-option header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.poll-result-option strong {
  overflow-wrap: anywhere;
}

.poll-result-option header small {
  color: var(--muted);
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.poll-voter-list {
  display: grid;
  gap: 6px;
}

.poll-voter-list button,
.poll-voter-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 8px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.poll-voter-list button {
  cursor: pointer;
}

.poll-voter-list .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1;
}

.poll-voter-list .image-avatar {
  background: var(--paper-2);
}

.poll-voter-list .image-avatar img {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
  object-fit: cover;
}

.poll-voter-list button span:not(.avatar),
.poll-voter-empty small {
  min-width: 0;
}

.poll-voter-list small,
.poll-voter-empty small {
  color: var(--muted);
  font-weight: 800;
}

.modal-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.modal-choice-grid button {
  cursor: pointer;
}

.modal-choice-grid .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

@media (max-width: 560px) {
  .modal-backdrop {
    padding:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .auth-modal {
    max-height: calc(
      100dvh - max(10px, env(safe-area-inset-top)) - max(10px, env(safe-area-inset-bottom))
    );
    padding: 18px;
  }

  .auth-modal h2 {
    font-size: clamp(1.75rem, 8vw, 2.1rem);
  }

  .verify-actions {
    grid-template-columns: 1fr;
  }

  .verify-actions .blue-command {
    width: 100%;
  }

  .confirm-modal .confirm-actions {
    display: grid;
    grid-template-columns: minmax(86px, max-content) minmax(0, 1fr);
  }

  .confirm-modal .confirm-actions > button {
    width: 100%;
    min-width: 0;
  }

  .modal-choice-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .confirm-modal .confirm-actions {
    grid-template-columns: 1fr;
  }
}

.legal-modal p:not(.eyebrow) {
  color: var(--muted);
}

.platform-intro-modal {
  max-width: 500px;
}

.platform-intro-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 22px;
}

.platform-intro-list p {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.platform-intro-list .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

.platform-intro-list strong {
  display: inline;
  color: var(--ink);
}

.legal-link-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.legal-link-list a {
  justify-content: flex-start;
  min-height: 48px;
  text-decoration: none;
}

.legal-link-list a:hover {
  color: var(--on-primary);
}

.toast {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 90;
  max-width: 320px;
  padding: 12px 14px;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--violet);
  font-weight: 900;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1060px) {
  #pulse .section-heading {
    display: grid;
    justify-items: center;
    min-height: 0;
    padding-inline: 0;
    text-align: center;
  }

  .app-sidebar {
    top: 88px;
    bottom: 14px;
    left: 12px;
    display: grid;
    width: 194px;
    padding: 10px;
    z-index: 25;
  }

  main {
    margin-left: 218px;
    padding-bottom: 76px;
  }

  .topbar {
    display: grid;
    grid-template-columns: max-content minmax(180px, 1fr) max-content;
  }

  .brand {
    position: static;
    width: 194px;
  }

  .search {
    position: static;
    width: auto;
    transform: none;
  }

  .topbar-actions .ghost-button {
    display: inline-flex;
  }

  .mobile-nav {
    display: none;
  }

  .toast {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: auto;
    max-width: min(320px, calc(100vw - 248px));
  }

  .layout,
  .article-layout,
  .social-layout,
  .profile-layout,
  .saved-layout,
  .messages-layout,
  .notifications-layout,
  .explore-shell,
  .profile-explorer-grid,
  .writing-grid {
    grid-template-columns: 1fr;
  }

  .side-rail,
  .article-rail,
  .profile-rail,
  .saved-rail,
  .notification-rail,
  .explore-rail,
  .writing-rail {
    position: static;
    margin-top: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .discover-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .explore-stage,
  .hot-grid,
  .explore-lanes,
  .rooms-overview,
  .room-management,
  .search-overlay-grid,
  .search-result-grid {
    grid-template-columns: 1fr;
  }

  .room-browser-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-explorer-toolbar {
    grid-template-columns: 1fr;
  }

  .room-management {
    grid-template-columns: 1fr;
  }

  .room-create-grid {
    grid-template-columns: 1fr;
  }

  .trend-console {
    min-height: 280px;
  }

  .hot-card,
  .radar-board {
    min-height: 280px;
  }

  .messages-layout {
    grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
    height: calc(100vh - 130px);
    min-height: 520px;
  }

  .conversation-item {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 66px;
  }

  .conversation-item .avatar {
    width: 42px;
    height: 42px;
  }

  .message-bubble {
    max-width: 90%;
  }

  .message-attachment {
    max-width: 90%;
  }
}

@media (min-width: 781px) {
  body:has(#messages.view.is-active) {
    height: 100dvh;
    overflow: hidden;
  }

  body:has(#messages.view.is-active) main {
    height: calc(100dvh - 76px);
    padding-top: 18px;
    padding-bottom: 18px;
    overflow: hidden;
  }

  #messages.view.is-active {
    height: 100%;
    overflow: hidden;
    scroll-margin-top: 0;
  }

  #messages.view.is-active .messages-layout {
    height: 100%;
    min-height: 0;
  }
}

@media (max-width: 780px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  main,
  .view,
  .layout,
  .feed-column,
  .story-list,
  .social-layout,
  .social-main,
  .social-feed,
  .pulse-feed-card,
  .pulse-feed-main,
  .social-post,
  .social-post-body {
    min-width: 0;
    max-width: 100%;
  }

  #pulse .section-heading {
    display: flex;
    align-items: start;
    flex-direction: column;
    min-height: 0;
    padding-inline: 0;
    text-align: left;
  }

  #pulse .layout,
  #pulse .feed-column,
  #pulse .topic-strip,
  #pulse .story-list {
    width: min(100%, calc(100vw - 36px));
    max-width: calc(100vw - 36px);
  }

  .topic-strip {
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 100%;
  }

  .pulse-browse-command {
    width: 100%;
    justify-content: center;
  }

  .pulse-filter-group {
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .list-pager {
    align-items: stretch;
    flex-direction: column;
  }

  .list-pager button {
    width: 100%;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 48;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .topbar {
    padding: 10px 10px;
  }

  .search {
    display: none;
  }

  .topbar-actions {
    gap: 6px;
    grid-column: 3;
    justify-content: flex-end;
    justify-self: end;
  }

  .topbar-actions .icon-button {
    display: none;
  }

  .topbar-actions .ghost-button {
    display: none;
  }

  .topbar-actions .mobile-search-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
  }

  .search-overlay {
    padding: 76px 10px 12px;
  }

  .search-overlay-shell {
    gap: 12px;
  }

  .search-overlay-head {
    align-items: center;
  }

  .search-overlay-head h2 {
    font-size: clamp(1.65rem, 8vw, 2.65rem);
  }

  .search-overlay-form {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
  }

  .search-overlay-form .primary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .search-result-overview {
    display: grid;
    align-items: start;
  }

  .search-overlay-empty {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 16px;
  }

  .search-overlay-empty > .material-symbols-rounded {
    width: 44px;
    height: 44px;
  }

  .verify-actions {
    grid-template-columns: 1fr;
  }

  .verify-actions .blue-command {
    width: 100%;
  }

  main {
    margin-left: 0;
    padding: 100px 14px calc(104px + env(safe-area-inset-bottom));
  }

  body:has(#messages.view.is-active) main {
    padding: 0;
  }

  #messages.view.is-active {
    position: fixed;
    top: 76px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 16;
    display: block;
    overflow: hidden;
    background: var(--paper);
    scroll-margin-top: 0;
  }

  .app-sidebar {
    top: auto;
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    z-index: 55;
    display: grid;
    grid-template-rows: auto auto auto;
    width: auto;
    max-height: min(82vh, 680px);
    max-height: min(82dvh, 680px);
    padding: 10px 12px 12px;
    border-radius: calc(var(--radius) + 6px);
    overflow: auto;
    overscroll-behavior: contain;
    transform: translateY(calc(100% + 24px));
    transition:
      transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
      visibility 220ms step-end;
    visibility: hidden;
  }

  body.sidebar-open .app-sidebar {
    transform: translateY(0);
    transition:
      transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
      visibility 0ms;
    visibility: visible;
  }

  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: var(--scrim);
    border: 0;
    backdrop-filter: blur(3px);
  }

  body.sidebar-open .mobile-sidebar-backdrop {
    display: block;
  }

  .mobile-nav {
    position: fixed;
    right: calc(8px + env(safe-area-inset-right));
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: calc(8px + env(safe-area-inset-left));
    z-index: 36;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    min-height: 64px;
    padding: 6px;
    background: var(--chrome-bg);
    border: 3px solid var(--stroke);
    border-radius: calc(var(--radius) + 2px);
    box-shadow: 5px 5px 0 var(--stroke), var(--shadow);
    backdrop-filter: blur(18px);
  }

  .mobile-nav .nav-item {
    display: grid;
    grid-template-rows: 24px auto;
    gap: 2px;
    place-items: center;
    min-width: 0;
    min-height: 50px;
    padding: 5px 2px;
    border-color: transparent;
    border-radius: 10px;
    box-shadow: none;
    font-size: clamp(0.66rem, 2.8vw, 0.76rem);
    line-height: 1;
  }

  .mobile-nav .nav-item:hover {
    box-shadow: none;
    transform: none;
  }

  .mobile-nav .nav-item.is-active {
    border-color: var(--stroke);
  }

  .mobile-nav .mobile-compose-nav {
    box-shadow: none;
    transform: none;
  }

  .mobile-nav .mobile-compose-nav.is-active {
    color: var(--on-primary);
    background: var(--violet);
    border-color: var(--stroke);
    box-shadow: none;
    transform: none;
  }

  .mobile-nav .mobile-more-button.is-active {
    color: var(--on-primary);
    background: var(--violet);
    border-color: var(--stroke);
  }

  .mobile-nav .nav-item > span:last-child {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav .nav-item.has-unread::after {
    top: 1px;
    right: max(2px, calc(50% - 22px));
    min-width: 18px;
    height: 18px;
    padding-inline: 4px;
  }

  body:has(#messages.view.is-active .messages-layout.is-chat-open) .mobile-nav,
  body.search-open .mobile-nav,
  body.sidebar-open .mobile-nav,
  body:has(.modal-backdrop.is-open) .mobile-nav {
    display: none;
  }

  #messages.view.is-active:has(.messages-layout:not(.is-chat-open)) {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }

  body.search-open .toast,
  body.sidebar-open .toast,
  body:has(.modal-backdrop.is-open) .toast,
  body:has(#messages.view.is-active .messages-layout.is-chat-open) .toast {
    bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .sidebar-nav,
  .sidebar-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .sidebar-tools {
    padding-top: 12px;
  }

  .mobile-sidebar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 2px 2px 12px;
    border-bottom: 2px solid var(--line);
  }

  .mobile-sidebar-header > div {
    display: grid;
    gap: 3px;
  }

  .mobile-sidebar-header p {
    margin: 0;
  }

  .mobile-sidebar-header .eyebrow {
    color: var(--ink);
    font-size: 1.25rem;
  }

  .mobile-sidebar-header p:last-child {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 750;
  }

  .mobile-sidebar-handle {
    display: block;
    width: 42px;
    height: 4px;
    margin: 0 0 7px;
    background: var(--line);
    border-radius: 999px;
  }

  .mobile-sidebar-section-label {
    display: block;
    grid-column: 1 / -1;
    margin: 4px 2px 0;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  .app-sidebar .mobile-sidebar-duplicate {
    display: none;
  }

  .app-sidebar .nav-item {
    justify-content: flex-start;
    min-height: 48px;
    padding: 10px 12px;
  }

  .app-sidebar .sidebar-account-button {
    grid-column: 1 / -1;
  }

  .sidebar-account-media {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
  }

  .sidebar-account-media img {
    width: 28px;
    height: 28px;
  }

  .brand {
    position: static;
    width: auto;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
  }

  .brand span {
    display: inline;
    font-size: 0.95rem;
  }

  .section-heading,
  .writer-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .feature-story,
  .explore-hero,
  .story-card,
  .editor-shell {
    grid-template-columns: 1fr;
  }

  .pulse-feed-card {
    grid-template-columns: 1fr;
  }

  .story-art {
    min-height: 250px;
    border-top: 3px solid var(--stroke);
    border-left: 0;
  }

  .story-card {
    align-items: start;
  }

  .thumbnail {
    width: 100%;
    min-height: 116px;
    aspect-ratio: auto;
  }

  .pulse-feed-thumb {
    width: 100%;
    max-width: 100%;
    min-height: 116px;
    aspect-ratio: auto;
    font-size: 2rem;
  }

  .side-rail,
  .article-rail,
  .profile-rail,
  .saved-rail,
  .notification-rail,
  .explore-rail,
  .writing-rail,
  .discover-grid {
    margin-top: 0;
    grid-template-columns: 1fr;
  }

  .notifications-hero,
  .settings-hero {
    align-items: start;
    flex-direction: column;
    min-height: 0;
  }

  .settings-hero h1 {
    font-size: clamp(2.6rem, 10.5vw, 3.1rem);
    line-height: 1.02;
  }

  .notifications-hero h1 {
    font-size: clamp(1.55rem, 6.3vw, 2.4rem);
    line-height: 1.04;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .theme-options,
  .theme-option {
    grid-template-columns: 1fr;
  }

  .theme-preview {
    width: 100%;
    max-width: 180px;
  }

  .theme-preset-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .theme-preset-options .theme-option {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .theme-preset-options .theme-preview {
    width: 42px;
    max-width: none;
  }

  .notification-card {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: start;
  }

  .notification-icon {
    width: 38px;
    height: 38px;
  }

  .notification-card-action {
    grid-column: auto;
    justify-self: end;
  }

  .article-header h1 {
    font-size: clamp(2.1rem, 10vw, 2.35rem);
    line-height: 1.06;
  }

  .article-cover {
    min-height: 300px;
  }

  .article-cover-mark {
    width: min(58vw, 210px);
  }

  .article-body {
    padding: 24px;
  }

  .profile-identity {
    grid-template-columns: 1fr;
  }

  .account-settings-grid,
  .account-page-identity {
    grid-template-columns: 1fr;
  }

  .account-banner-preview {
    align-items: start;
    flex-direction: column;
    min-height: 240px;
  }

  .account-page-identity .profile-avatar {
    margin-top: 0;
  }

  .profile-banner {
    align-items: start;
    flex-direction: column;
    gap: 12px;
    min-height: 178px;
  }

  .profile-actions {
    grid-column: 1;
    flex-wrap: wrap;
  }

  .profile-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-stats div {
    border-right: 0;
  }

  .profile-stats div:not(:last-child) {
    border-bottom: 3px solid var(--stroke);
  }

  .profile-post-card {
    grid-template-columns: 1fr;
  }

  .saved-hero,
  .saved-card-feature {
    grid-template-columns: 1fr;
  }

  .saved-hero {
    align-items: center;
    flex-direction: row;
    padding: 16px;
  }

  .saved-hero h1 {
    font-size: clamp(1.65rem, 8vw, 2.1rem);
    line-height: 1.04;
  }

  .saved-hero p {
    margin: 8px 0 0;
    font-size: 0.95rem;
    line-height: 1.42;
  }

  .saved-grid {
    grid-template-columns: 1fr;
  }

  .saved-card-feature {
    grid-column: auto;
  }

  .saved-art {
    width: 100%;
    min-height: 160px;
    aspect-ratio: auto;
  }

  .messages-layout {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .messages-layout:not(.is-chat-open) .chat-panel,
  .messages-layout.is-chat-open .inbox-panel {
    display: none;
  }

  .inbox-panel,
  .chat-panel {
    width: 100%;
    min-height: auto;
    border: 0;
    border-radius: 0;
  }

  .messages-layout:not(.is-chat-open) .inbox-panel {
    height: 100%;
    min-height: 0;
  }

  .conversation-list {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 0;
  }

  .conversation-item {
    grid-template-columns: 46px minmax(0, 1fr);
    min-height: 70px;
  }

  .conversation-item .avatar {
    width: 46px;
    height: 46px;
  }

  .messages-layout.is-chat-open .chat-panel {
    display: grid;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .chat-mobile-back {
    display: grid;
  }

  .chat-header {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    min-height: 68px;
  }

  .message-thread {
    min-height: 0;
    overflow-y: auto;
  }

  .message-bubble {
    max-width: 92%;
  }

  .message-attachment {
    max-width: 92%;
  }

  .message-image {
    max-width: min(100%, 260px);
    max-height: 220px;
  }

  .message-image-preview {
    width: fit-content;
  }

  .message-image-preview img {
    width: min(100%, 260px);
  }

  .explore-hero {
    min-height: auto;
  }

  .explore-hero > div:first-child {
    padding: 24px;
  }

  .explore-hero h2 {
    font-size: 2.35rem;
  }

  .pulse-map {
    min-height: 300px;
    border-top: 3px solid var(--stroke);
    border-left: 0;
  }

  .map-node {
    width: 72px;
    height: 72px;
    border-radius: 22px;
  }

  .room-list article {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .room-list strong {
    grid-column: 2;
  }

  .editor-shell {
    min-height: auto;
  }

  .social-post {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .social-composer-actions,
  .social-comment-form {
    grid-template-columns: 1fr;
  }

  .social-composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .social-image-button,
  .social-poll-toggle,
  .social-comment-form button {
    justify-content: center;
    width: 100%;
  }

  .social-image-preview,
  .social-post-gallery {
    width: 100%;
  }

  .social-post-gallery {
    aspect-ratio: 1;
  }

  .social-post-gallery-1 {
    aspect-ratio: auto;
  }

  .social-gallery-viewer {
    padding:
      calc(64px + env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      calc(82px + env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .social-gallery-image-frame {
    width: 100%;
    max-height: calc(100vh - 146px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 146px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .social-gallery-viewer img {
    max-height: calc(100vh - 146px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 146px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .social-gallery-viewer.has-single-image {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .social-gallery-viewer.has-single-image .social-gallery-image-frame,
  .social-gallery-viewer.has-single-image img {
    max-height: calc(100vh - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .social-gallery-close {
    top: calc(8px + env(safe-area-inset-top));
    right: calc(8px + env(safe-area-inset-right));
    width: 48px;
    height: 48px;
  }

  .social-gallery-nav {
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
    transform: none;
  }

  .social-gallery-nav-previous {
    left: calc(50% - 62px);
  }

  .social-gallery-nav-next {
    right: calc(50% - 62px);
  }

  .social-gallery-viewer-counter {
    top: calc(14px + env(safe-area-inset-top));
    max-width: calc(100% - 136px - env(safe-area-inset-left) - env(safe-area-inset-right));
  }

  .social-detail-author {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .social-detail-author .avatar {
    width: 48px;
    height: 48px;
    font-size: 1.35rem;
  }

  .explore-stage {
    min-height: auto;
    padding: 20px;
  }

  .explore-copy h1 {
    font-size: clamp(2.15rem, 10vw, 2.45rem);
    line-height: 1.05;
  }

  .explore-search {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .explore-search button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .discover-header {
    align-items: stretch;
    flex-direction: column;
  }

  .discover-header .primary-button {
    width: 100%;
  }

  .room-create-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .room-create-hero .primary-button {
    width: 100%;
  }

  .room-summary {
    grid-template-columns: 1fr;
  }

  .room-browser-grid {
    grid-template-columns: 1fr;
  }

  .profile-browser-grid,
  .profile-browser-stats,
  .profile-card-actions,
  .profile-filter-switch {
    grid-template-columns: 1fr;
  }

  .profile-sort-toggle {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 24px;
    gap: 8px;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    color: var(--on-primary);
    background: var(--violet);
    border: 2px solid var(--stroke);
    border-radius: 8px;
    font-weight: 950;
  }

  .profile-sort-toggle span:nth-child(2) {
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profile-explorer-toolbar:not(.is-expanded) .profile-filter-switch {
    display: none;
  }

  .profile-explorer-toolbar.is-expanded .profile-filter-switch {
    display: grid;
  }

  .room-spotlight {
    grid-template-columns: 1fr;
  }

  .owned-room-card {
    grid-template-columns: 1fr;
  }

  .room-card-actions {
    grid-template-columns: 1fr;
  }

  .room-owner-actions {
    justify-content: flex-start;
  }

  .trend-console {
    min-height: 250px;
  }

  .hot-grid {
    grid-template-columns: 1fr;
  }

  .hot-card {
    min-height: 240px;
  }

  .hot-card-main h2 {
    font-size: 2.3rem;
    line-height: 1.06;
  }

  .radar-board {
    min-height: 320px;
  }

  .radar-chip {
    width: 72px;
    height: 72px;
    border-radius: 22px;
  }

  .explore-lanes {
    grid-template-columns: 1fr;
  }

  .lane-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .lane-item em {
    grid-column: 2;
  }
}

@media (max-width: 780px) and (prefers-reduced-motion: reduce) {
  .app-sidebar {
    transition: none;
  }
}

@media (max-width: 440px) {
  .topbar {
    padding: 10px 12px;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .primary-button,
  .ghost-button,
  .text-command {
    width: 100%;
  }

  .topbar-actions .primary-button {
    width: 44px;
    padding: 0;
  }

  .topbar-actions .ghost-button {
    width: 42px;
    min-width: 42px;
    padding: 0;
  }

  .toast {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(88px + env(safe-area-inset-bottom));
    left: max(14px, env(safe-area-inset-left));
    max-width: none;
  }

  .topbar-actions .primary-button span + span,
  .topbar-actions .primary-button {
    font-size: 0;
  }

  .topbar-actions .primary-button .material-symbols-rounded {
    font-size: 22px;
  }

  h1 {
    font-size: 2.05rem;
    line-height: 1.08;
  }
}

.home-hero-card,
.room-type-card,
.home-stat-grid span {
  border: 2px solid var(--stroke);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-hero-card {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding: 24px;
  border-radius: 8px;
}

.home-hero-card h2 {
  max-width: 760px;
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 0.95;
}

.home-hero-card p:not(.eyebrow) {
  max-width: 720px;
  color: var(--ink-soft);
}

.home-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.home-actions button,
.room-type-card button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid var(--stroke);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 5px 5px 0 var(--stroke);
}

.home-stat-grid,
.room-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-stat-grid span {
  display: flex;
  align-items: end;
  justify-content: space-between;
  min-height: 82px;
  padding: 16px;
  border-radius: 8px;
}

.home-stat-grid strong {
  font-size: 2.25rem;
  line-height: 1;
}

.home-stat-grid small,
.room-type-card small {
  color: var(--ink-soft);
  font-weight: 900;
}

.room-type-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.room-type-card {
  display: grid;
  align-content: space-between;
  gap: 14px;
  min-height: 190px;
  padding: 18px;
  border-radius: 8px;
}

.room-type-card strong {
  font-size: 1.1rem;
}

.room-type-card p {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.room-rules-field {
  display: none;
}

.room-rules-field.is-active {
  display: grid;
}

.room-community-options[hidden] {
  display: none;
}

.room-review-queue {
  display: grid;
  gap: 10px;
  width: 100%;
}

.room-review-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 2px solid var(--stroke);
  border-radius: 8px;
  background: var(--paper-2);
}

.room-review-item strong,
.room-review-item small {
  display: block;
}

.room-review-item small {
  color: var(--ink-soft);
}

.room-review-item button {
  border-radius: 8px;
}

.room-detail-page {
  width: min(100%, 1720px);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 36px);
}

.room-detail-shell {
  display: grid;
  gap: 18px;
}

.room-detail-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  padding: clamp(20px, 3vw, 34px);
  background:
    linear-gradient(135deg, var(--entity-accent, var(--violet)), transparent 58%),
    var(--surface);
  background-size: cover;
  background-position: center;
  border: 3px solid var(--stroke);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.room-detail-hero > div:not(.room-detail-actions) {
  min-width: 0;
}

.room-detail-hero.has-image {
  min-height: 270px;
  align-items: center;
}

.room-detail-badge {
  display: grid;
  place-items: center;
  align-self: center;
  width: 92px;
  height: 92px;
  color: var(--entity-accent-ink, var(--on-accent));
  background: var(--entity-accent, var(--mint));
  border: 3px solid var(--stroke);
  border-radius: 50%;
  box-shadow: 3.5px 3.5px 0 color-mix(in srgb, var(--entity-accent, var(--violet)) 62%, var(--stroke));
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: 2.2rem;
  font-weight: 1000;
  overflow: hidden;
}

.room-detail-hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 5rem);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.room-detail-hero p {
  max-width: 860px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.5;
}

.room-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.room-detail-meta span {
  padding: 7px 10px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 900;
}

.room-detail-meta .room-handle {
  color: var(--violet-dark);
  background: var(--field-bg-2);
}

.room-detail-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: end;
  gap: 10px;
  flex-wrap: wrap;
}

.room-detail-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border: 2px solid var(--stroke);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--stroke);
}

.room-detail-actions .primary-button {
  background: var(--violet);
  color: var(--on-primary);
}

.room-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 18px;
  align-items: start;
}

.room-detail-main {
  min-width: 0;
  padding: clamp(16px, 2vw, 24px);
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.room-detail-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--line);
}

.room-detail-section-head h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.room-detail-section-head span {
  color: var(--muted);
  font-weight: 900;
}

.room-detail-posts {
  display: grid;
  gap: 12px;
}

.room-detail-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 6px;
  margin-bottom: 6px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: 8px;
}

.room-detail-tabs button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 9px 10px;
  color: var(--ink);
  background: transparent;
  border: 2px solid transparent;
  border-radius: 6px;
  font-weight: 1000;
  text-align: left;
}

.room-detail-tabs button.is-selected {
  background: var(--surface);
  border-color: var(--stroke);
  box-shadow: 3px 3px 0 var(--stroke);
}

.room-detail-tabs strong {
  color: var(--muted);
}

.room-detail-tabs button > span:not(.material-symbols-rounded) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-pinned-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(255, 188, 66, 0.16), rgba(122, 85, 255, 0.08));
  border: 2px solid var(--line);
  border-radius: 8px;
}

.room-pinned-head,
.pinned-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-weight: 1000;
}

.room-pinned-head {
  justify-content: space-between;
  color: var(--ink);
}

.room-pinned-head .material-symbols-rounded {
  color: var(--gold);
}

.room-pinned-head small {
  margin-left: auto;
  color: var(--ink-soft);
  font-weight: 900;
}

.room-chat-sidebar .room-chat-settings-button {
  width: 34px;
  height: 34px;
  margin-left: 4px;
  box-shadow: none;
}

.pinned-label {
  margin-top: 8px;
  font-size: 0.82rem;
}

.room-detail-post-card,
.room-detail-empty {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
}

.room-detail-post-card {
  cursor: pointer;
}

.room-detail-post-card.no-media {
  grid-template-columns: minmax(0, 1fr);
}

.room-detail-post-card.is-pinned {
  border-color: rgba(255, 188, 66, 0.74);
}

.room-detail-post-card h3,
.room-detail-empty h3 {
  margin: 10px 0 6px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.08;
}

.room-detail-post-card h3 a {
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.room-detail-post-card h3 a:hover {
  color: var(--violet-light);
}

.room-detail-post-card p,
.room-detail-empty p {
  color: var(--ink-soft);
}

.room-detail-post-thumb {
  width: 138px;
  min-height: 112px;
  border-radius: 8px;
}

.room-detail-empty {
  grid-template-columns: auto minmax(0, 1fr);
}

.room-detail-empty > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid var(--stroke);
  border-radius: 50%;
  background: var(--gold);
  color: var(--on-accent);
}

.room-detail-rail {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 104px;
}

.room-detail-about {
  display: grid;
  gap: 10px;
}

.room-detail-about div {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: 8px;
}

.room-detail-about span {
  color: var(--muted);
  font-weight: 900;
}

.room-detail-about strong {
  color: var(--ink);
  line-height: 1.25;
}

.room-chat-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.room-chat-sidebar,
.room-chat-panel,
.room-channel-manager {
  min-width: 0;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: 8px;
}

.room-chat-sidebar {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.room-chat-channel-list {
  display: grid;
  gap: 8px;
}

.room-chat-channel-list button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.room-chat-channel-list button.is-selected {
  border-color: var(--stroke);
  box-shadow: 3px 3px 0 var(--stroke);
}

.room-chat-channel-list strong,
.room-chat-channel-list small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-chat-channel-list small,
.room-chat-channel-list em,
.room-chat-panel-head p,
.room-chat-panel-head small,
.room-chat-message span,
.room-chat-message time,
.room-chat-locked p,
.room-chat-empty p {
  color: var(--muted);
}

.room-chat-channel-list em {
  font-style: normal;
  font-weight: 1000;
}

.room-chat-panel {
  display: grid;
  overflow: hidden;
}

.room-chat-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 2px solid var(--line);
}

.room-chat-panel-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.room-chat-panel-head > div > div {
  min-width: 0;
}

.room-chat-panel-head h3 {
  margin: 0;
  font-size: 1.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-chat-panel-head p {
  margin: 3px 0 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.room-chat-panel-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
}

.room-chat-panel-head small {
  flex: 0 1 260px;
  min-width: 0;
  font-weight: 900;
  text-align: right;
  overflow-wrap: anywhere;
}

.room-chat-settings-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--stroke);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--stroke);
}

.room-chat-settings-button .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 1em;
  height: 1em;
  overflow: hidden;
  font-size: 21px;
  line-height: 1;
}

.room-chat-settings-button.is-selected {
  background: var(--gold);
}

.room-chat-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: min(58vh, 620px);
  min-height: 280px;
  overflow: auto;
  padding: 14px;
  background: var(--surface);
}

.room-chat-message {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.room-chat-message header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.room-chat-message header .message-inline-actions {
  margin-left: auto;
}

.room-chat-message p {
  margin: 3px 0 0;
  padding: 10px 12px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 8px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.room-chat-message.is-own p {
  background: var(--field-bg);
}

.room-chat-message .message-edit-form {
  margin-top: 6px;
}

.room-chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-top: 2px solid var(--line);
}

.room-chat-composer textarea,
.room-channel-create input,
.room-channel-row input,
.room-channel-select-button {
  width: 100%;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--stroke);
  border-radius: 8px;
}

.room-chat-composer textarea {
  height: 66px;
  min-height: 66px;
  max-height: 66px;
  resize: none;
  overflow: hidden;
  padding: 10px 12px;
  scrollbar-width: none;
}

.room-chat-composer textarea::-webkit-scrollbar {
  display: none;
}

.room-chat-composer button,
.room-channel-create > button,
.room-channel-row > button,
.room-chat-locked button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--ink);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: 8px;
  font-weight: 1000;
  box-shadow: 3px 3px 0 var(--stroke);
}

.room-chat-locked,
.room-chat-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  padding: 22px;
  text-align: center;
}

.room-channel-manager {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: 8px;
  overflow: visible;
}

.room-channel-create,
.room-channel-row {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.room-channel-create {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.room-channel-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 8px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
}

.room-channel-create input,
.room-channel-row input,
.room-channel-create > button {
  grid-column: 1 / -1;
}

.room-channel-create input,
.room-channel-row input,
.room-channel-select-button {
  min-width: 0;
  min-height: 42px;
  padding: 0 9px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-channel-custom-select {
  position: relative;
  min-width: 0;
  z-index: 1;
}

.room-channel-custom-select.is-open {
  z-index: 30;
}

.room-channel-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.room-channel-select-button:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 3px 3px 0 var(--stroke);
}

.room-channel-select-button [data-custom-select-label] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-channel-select-button .material-symbols-rounded {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 20px;
  transition: transform 160ms ease;
}

.room-channel-custom-select.is-open .room-channel-select-button .material-symbols-rounded {
  transform: rotate(180deg);
}

.room-channel-select-menu {
  position: absolute;
  inset: calc(100% + 6px) 0 auto 0;
  display: none;
  gap: 6px;
  max-height: 210px;
  overflow: auto;
  padding: 8px;
  background: var(--surface);
  border: 2px solid var(--stroke);
  border-radius: 8px;
  box-shadow: 5px 5px 0 var(--stroke);
}

.room-channel-custom-select.is-open .room-channel-select-menu {
  display: grid;
}

.room-channel-select-menu button {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid transparent;
  border-radius: 7px;
  font-weight: 900;
  text-align: left;
}

.room-channel-select-menu button:hover,
.room-channel-select-menu button:focus,
.room-channel-select-menu button.is-selected {
  outline: none;
  color: var(--on-accent);
  background: var(--gold);
  border-color: var(--stroke);
}

.room-channel-row > button {
  width: 100%;
  padding: 0;
  background: var(--surface);
}

.room-channel-row > button:disabled {
  opacity: 0.45;
  box-shadow: none;
  cursor: not-allowed;
}

.room-channel-rows {
  display: grid;
  gap: 8px;
}

.room-channel-settings-modal {
  width: min(720px, calc(100vw - 28px));
}

.room-channel-settings-modal [data-room-channel-settings-body] {
  margin-top: 14px;
}

@media (max-width: 1320px) {
  .room-detail-page {
    padding: clamp(14px, 2vw, 24px);
  }

  .room-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .room-detail-rail {
    position: static;
  }

  .room-chat-panel-head {
    align-items: flex-start;
  }

  .room-chat-panel-tools {
    justify-content: space-between;
    width: 100%;
  }

  .room-chat-panel-head small {
    flex: 1 1 auto;
    text-align: left;
  }
}

@media (max-width: 980px) {
  .room-chat-workspace,
  .room-channel-create,
  .room-channel-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .room-chat-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .room-chat-panel-tools {
    justify-content: space-between;
    width: 100%;
    max-width: none;
  }

  .room-chat-panel-head small {
    flex: none;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .room-detail-tabs {
    grid-template-columns: minmax(0, 1fr);
  }

  .room-chat-composer {
    grid-template-columns: minmax(0, 1fr);
  }

  .room-chat-messages {
    max-height: 60vh;
  }
}

.admin-page {
  display: grid;
  gap: 18px;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 2.5vw, 28px);
}

.admin-hero,
.admin-nav,
.admin-column,
.admin-context section,
.admin-stats article {
  background: var(--surface);
  border: 3px solid var(--stroke);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(18px, 2.6vw, 28px);
}

.admin-hero h1 {
  font-size: clamp(2rem, 3.6vw, 3.75rem);
  line-height: 1.02;
}

.admin-hero p {
  margin-top: 8px;
  color: var(--ink-soft);
}

.admin-hero-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.admin-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(360px, 100%);
  padding: 0 12px;
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: 8px;
}

.admin-search input {
  width: 100%;
  min-height: 42px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.admin-grid {
  display: grid;
  gap: 16px;
}

.admin-workspace {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) minmax(260px, 0.34fr);
  gap: 16px;
  align-items: start;
}

.admin-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-stats article {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.admin-stats span,
.admin-stats small,
.admin-section-head p,
.admin-context p,
.admin-lane-list span,
.admin-item small,
.admin-item p {
  color: var(--ink-soft);
}

.admin-stats span,
.admin-stats small {
  font-weight: 900;
}

.admin-stats strong {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1;
}

.admin-nav {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.admin-nav button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 10px;
  color: var(--ink);
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
  font-weight: 900;
  text-align: left;
}

.admin-nav button.is-selected {
  background: var(--violet);
  border-color: var(--stroke);
  color: var(--on-primary);
}

.admin-nav strong {
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 0.78rem;
}

.admin-column {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px;
}

.admin-section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.admin-section-head h2,
.admin-context h2,
.admin-access-grid h3,
.admin-empty-state h3,
.admin-item h3 {
  margin: 0;
}

.admin-section-head h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.admin-filter-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.admin-filter-strip button,
.admin-item-actions button,
.admin-actions button,
.admin-empty-state button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--stroke);
  border-radius: 999px;
  font-weight: 900;
}

.admin-filter-strip button.is-selected,
.admin-item-actions .admin-primary-action {
  background: var(--mint);
  color: #07110f;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 8px;
}

.admin-item h3 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-top: 6px;
  line-height: 1.25;
}

.admin-item h3 span {
  color: var(--muted);
  font-size: 0.95rem;
}

.admin-item p {
  margin: 6px 0 0;
  line-height: 1.55;
}

.admin-item-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  color: var(--paper);
  background: var(--ink-soft);
  border: 2px solid var(--stroke);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 1000;
}

.admin-badge-attention {
  background: var(--gold);
}

.admin-badge-danger {
  background: var(--red);
  color: var(--on-primary);
}

.admin-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 230px;
}

.admin-item-details {
  grid-column: 1 / -1;
  padding-top: 10px;
  border-top: 2px solid var(--line);
}

.admin-item-details summary {
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.admin-data-counts {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-weight: 900;
}

.admin-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.admin-result-meta span {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
  max-width: 100%;
  padding: 5px 8px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-result-meta strong {
  color: var(--ink);
}

.admin-record-raw {
  max-height: 260px;
  margin: 10px 0 0;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  font: 0.88rem/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.admin-context {
  display: grid;
  gap: 12px;
}

.admin-context section {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.admin-lane-list {
  display: grid;
  gap: 8px;
}

.admin-lane-list div {
  display: grid;
  gap: 2px;
  padding: 10px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 8px;
}

.admin-empty-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 8px;
}

.admin-empty-state > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--mint);
  color: #07110f;
  border: 2px solid var(--stroke);
  border-radius: 50%;
}

.admin-access-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-access-grid article {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 8px;
}

.admin-access-grid .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--on-primary);
  background: var(--blue);
  border: 2px solid var(--stroke);
  border-radius: 8px;
}

.admin-invite-card {
  display: grid;
  gap: 12px;
}

.admin-invite-form,
.admin-invite-link {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-invite-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-invite-form select,
.admin-invite-link input {
  width: 100%;
  min-height: 42px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.admin-invite-form button,
.admin-invite-link input {
  grid-column: 1 / -1;
}

.admin-invite-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.admin-invite-list li {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-invite-list span,
.admin-invite-list strong {
  font-weight: 900;
}

.admin-invite-list small {
  color: var(--muted);
}

.admin-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-capabilities span {
  padding: 5px 8px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 900;
}

.message-report-button {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  min-height: 0;
  color: inherit;
  background: transparent;
  border: 0;
  opacity: 0;
}

.message-report-button .material-symbols-rounded {
  font-size: 17px;
}

.message-bubble:hover .message-report-button,
.message-bubble:focus-within .message-report-button {
  opacity: 0.82;
}

.message-bubble .message-inline-actions button,
.message-bubble .message-report-button {
  background: var(--surface);
  border-color: currentColor;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.24);
}

.message-bubble.outgoing .message-inline-actions button {
  color: var(--ink);
}

@media (max-width: 900px) {
  .home-hero-card {
    display: grid;
  }

  .home-stat-grid,
  .room-type-grid {
    grid-template-columns: 1fr 1fr;
  }

  .room-detail-hero,
  .room-detail-grid,
  .admin-grid,
  .admin-workspace,
  .room-edit-hero-overlay,
  .room-create-grid {
    grid-template-columns: 1fr;
  }

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

  .admin-nav {
    position: static;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }

  .admin-nav button {
    grid-template-columns: 24px minmax(80px, 1fr);
  }

  .admin-nav strong {
    display: none;
  }

  .admin-context {
    grid-template-columns: 1fr 1fr;
  }

  .admin-access-grid {
    grid-template-columns: 1fr;
  }

  .room-detail-actions {
    justify-content: start;
  }

  .room-edit-upload-row,
  .room-edit-footer {
    justify-content: stretch;
  }

  .room-edit-upload-row .upload-button,
  .room-edit-footer .primary-button,
  .room-edit-footer .danger-command {
    flex: 1 1 180px;
  }

  .room-detail-rail {
    position: static;
  }
}

@media (max-width: 620px) {
  .home-hero-card {
    padding: 18px;
  }

  .home-stat-grid,
  .room-type-grid,
  .room-review-item {
    grid-template-columns: 1fr;
  }

  .admin-hero,
  .admin-section-head,
  .admin-item {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-hero-tools,
  .admin-filter-strip,
  .admin-item-actions {
    justify-content: stretch;
  }

  .admin-search,
  .admin-hero-tools .primary-button,
  .admin-filter-strip button,
  .admin-item-actions button {
    width: 100%;
  }

  .admin-stats,
  .admin-context {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-detail-page {
    padding: 14px;
  }

  .room-detail-hero {
    gap: 14px;
  }

  .room-detail-badge {
    width: 64px;
    height: 64px;
    font-size: 1.6rem;
  }

  .room-edit-hero {
    min-height: 240px;
  }

  .room-edit-icon {
    width: 70px;
    height: 70px;
    font-size: 1.75rem;
  }

  .room-detail-post-card,
  .room-detail-empty {
    grid-template-columns: 1fr;
  }

  .room-detail-post-thumb {
    width: 100%;
  }
}

.admin-page {
  --admin-panel: color-mix(in srgb, var(--surface) 92%, var(--paper-2));
  --admin-panel-strong: var(--paper-2);
  --admin-border: var(--stroke);
  --admin-muted: var(--ink-soft);
  --admin-good: var(--mint);
  --admin-warn: var(--gold);
  --admin-bad: var(--red);
  gap: 14px;
  width: min(1680px, 100%);
  padding: clamp(12px, 2vw, 24px);
}

.admin-page .admin-hero,
.admin-page .admin-nav,
.admin-page .admin-column,
.admin-page .admin-context section,
.admin-page .admin-stats button,
.admin-page .admin-access-grid article {
  background: var(--admin-panel);
  border: 2px solid var(--admin-border);
  border-radius: 8px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.16);
}

.admin-page .admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  align-items: end;
  padding: clamp(16px, 2vw, 24px);
}

.admin-page .admin-hero h1 {
  max-width: 14ch;
  font-size: clamp(2rem, 4vw, 4.2rem);
}

.admin-page .admin-hero-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.admin-page .admin-search {
  min-width: 0;
  min-height: 48px;
  background: var(--surface);
  border-width: 2px;
}

.admin-page .admin-search input {
  min-height: 46px;
  font-weight: 800;
}

.admin-page .admin-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-page .admin-stats button {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 14px;
  color: var(--ink);
  text-align: left;
}

.admin-page .admin-stats button:hover,
.admin-page .admin-stats button:focus-visible,
.admin-page .admin-item:hover,
.admin-page .admin-item:focus-visible,
.admin-page .admin-item.is-selected {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.2);
}

.admin-page .admin-stats button:focus-visible,
.admin-page .admin-nav button:focus-visible,
.admin-page .admin-filter-strip button:focus-visible,
.admin-page .admin-type-strip button:focus-visible,
.admin-page .admin-action-button:focus-visible,
.admin-page .admin-item:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.admin-page .admin-workspace {
  grid-template-columns: 220px minmax(0, 1fr) minmax(300px, 0.38fr);
  gap: 14px;
}

.admin-page .admin-nav {
  top: 92px;
  gap: 6px;
}

.admin-page .admin-nav button {
  min-height: 48px;
  border-radius: 8px;
}

.admin-page .admin-nav button.is-selected {
  background: var(--ink);
  color: var(--paper);
}

.admin-page .admin-column {
  gap: 12px;
  padding: 14px;
}

.admin-page .admin-section-head {
  gap: 12px;
}

.admin-page .admin-filter-strip,
.admin-page .admin-type-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-page .admin-filter-strip {
  justify-content: flex-end;
}

.admin-page .admin-type-strip {
  padding: 10px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
}

.admin-page .admin-filter-strip button,
.admin-page .admin-type-strip button,
.admin-page .admin-action-button,
.admin-page .admin-empty-state button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 11px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--stroke);
  border-radius: 8px;
  font-weight: 950;
}

.admin-page .admin-filter-strip button.is-selected,
.admin-page .admin-type-strip button.is-selected {
  background: var(--blue);
  color: var(--on-primary);
}

.admin-page .admin-list {
  gap: 9px;
}

.admin-page .admin-item {
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  padding: 13px;
  background: var(--admin-panel-strong);
  border: 2px solid var(--line);
  border-left: 7px solid var(--line);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.admin-page .admin-item.is-selected {
  border-color: var(--stroke);
  border-left-color: var(--blue);
}

.admin-page .admin-item-kicker {
  gap: 6px;
}

.admin-page .admin-badge,
.admin-page .admin-priority {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border: 2px solid var(--stroke);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 1000;
  line-height: 1;
}

.admin-page .admin-priority {
  background: var(--surface);
  color: var(--ink);
}

.admin-page .admin-priority-attention,
.admin-page .admin-badge-attention {
  background: var(--admin-warn);
  color: #1d1400;
}

.admin-page .admin-priority-danger,
.admin-page .admin-badge-danger {
  background: var(--admin-bad);
  color: var(--on-primary);
}

.admin-page .admin-item h3 {
  margin-top: 7px;
}

.admin-page .admin-item-actions,
.admin-page .admin-actions,
.admin-page .admin-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
  max-width: none;
}

.admin-page .admin-action-button .material-symbols-rounded {
  font-size: 18px;
}

.admin-page .admin-action-primary {
  background: var(--admin-good);
  color: #07110f;
}

.admin-page .admin-action-danger {
  background: var(--admin-bad);
  color: var(--on-primary);
}

.admin-page .admin-action-compact {
  min-height: 34px;
  padding: 6px 9px;
}

.admin-page .admin-context {
  position: sticky;
  top: 92px;
  align-self: start;
}

.admin-page .admin-review-panel {
  gap: 12px;
}

.admin-page .admin-review-panel-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.admin-page .admin-review-panel-head > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--blue);
  color: var(--on-primary);
  border: 2px solid var(--stroke);
  border-radius: 8px;
}

.admin-page .admin-review-meta {
  display: grid;
  gap: 7px;
}

.admin-page .admin-review-meta div,
.admin-page .admin-review-excerpt,
.admin-page .admin-lane-list div {
  display: grid;
  gap: 3px;
  padding: 10px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
}

.admin-page .admin-review-meta span,
.admin-page .admin-review-excerpt span {
  color: var(--admin-muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.admin-page .admin-review-excerpt p {
  max-height: 220px;
  overflow: auto;
}

.admin-page .admin-result-meta span {
  border-radius: 8px;
}

@media (max-width: 1180px) {
  .admin-page .admin-workspace {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .admin-page .admin-context {
    position: static;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.44fr);
  }
}

@media (max-width: 900px) {
  .admin-page .admin-hero,
  .admin-page .admin-workspace,
  .admin-page .admin-context {
    grid-template-columns: 1fr;
  }

  .admin-page .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-page .admin-nav {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    overflow-x: auto;
  }
}

@media (max-width: 620px) {
  .admin-page {
    padding: 10px;
  }

  .admin-page .admin-hero-tools,
  .admin-page .admin-section-head,
  .admin-page .admin-item {
    grid-template-columns: 1fr;
  }

  .admin-page .admin-stats,
  .admin-page .admin-nav {
    grid-template-columns: 1fr;
  }

  .admin-page .admin-hero-tools .primary-button,
  .admin-page .admin-search,
  .admin-page .admin-filter-strip button,
  .admin-page .admin-type-strip button,
  .admin-page .admin-action-button {
    width: 100%;
  }

  .admin-page .admin-filter-strip,
  .admin-page .admin-item-actions,
  .admin-page .admin-actions,
  .admin-page .admin-review-actions {
    justify-content: stretch;
  }
}

@media (max-width: 980px) {
  .room-browser-toolbar,
  .profile-explorer-toolbar {
    grid-template-columns: 1fr;
  }

  .room-browser-toolbar.is-owned {
    grid-template-areas:
      "title"
      "switch"
      "tools";
  }

  .room-filter-strip,
  .profile-filter-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-owned-tools {
    grid-template-columns: 1fr;
  }

  .room-owner-actions {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .room-management-header .primary-button,
  .room-filter-strip button {
    width: 100%;
  }

  .owned-room-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .owned-room-card {
    grid-template-columns: 1fr;
  }

  .owned-room-title,
  .room-empty-state,
  .room-create-limit {
    grid-template-columns: 1fr;
  }

  .room-owner-actions,
  .room-filter-strip {
    grid-template-columns: 1fr;
  }

  .room-filter-switch,
  .room-owned-browser-card .room-owner-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-owned-tools .primary-button {
    width: 100%;
  }

  .room-browser-toolbar {
    padding: 14px;
  }
}

@media (max-width: 780px) {
  .social-composer .social-composer-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .social-composer .social-image-button,
  .social-composer .social-poll-toggle {
    justify-content: center;
    width: 42px;
    min-width: 42px;
  }

  .social-composer .primary-button {
    width: auto;
    margin-left: auto;
  }

  .social-post-actions {
    display: flex;
    flex-wrap: wrap;
    max-width: 100%;
  }

  .social-post-gallery.social-post-gallery-1 {
    width: 100%;
    max-width: 100%;
    aspect-ratio: auto;
  }

  .social-comment-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .social-comment-form .social-comment-actions button {
    width: fit-content;
  }
}

/* Keep native file inputs keyboard-reachable while the styled labels remain the visible controls. */
.social-image-button,
.message-image-button,
.social-comment-image-button,
.upload-button,
.article-upload-action {
  position: relative;
}

.visually-hidden-file-input,
.social-comment-image-button input[type="file"],
.upload-button input[type="file"],
.article-upload-action input[type="file"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}

.social-image-button:focus-within,
.message-image-button:focus-within,
.social-comment-image-button:focus-within,
.upload-button:focus-within,
.article-upload-action:focus-within {
  outline: 4px solid var(--focus-ring);
  outline-offset: 3px;
}

/* This final rule also covers components that previously suppressed their native outline. */
html :is(a[href], button, summary, [tabindex]:not([tabindex="-1"]):not(input):not(textarea):not(select):not([contenteditable="true"])):focus-visible {
  outline: 4px solid var(--focus-ring);
  outline-offset: 3px;
}

/* Keep focus states free of the browser-style outer ring across all controls. */
html *:focus,
html *:focus-visible,
html *:focus-within {
  outline: 0 !important;
}

/* Form fields use their component border or caret instead of a second white outer ring. */
html :is(input:not([type="file"]), textarea, select, [contenteditable="true"]):focus-visible {
  outline: 0 !important;
  outline-offset: 0 !important;
}

/* Navigation focuses the new view heading for assistive tech; static headings need no visual focus ring. */
[data-navigation-focus-target]:focus {
  outline: 0;
}

/* Accent fills stay bright; these semantic foreground tokens keep small text readable in the light theme. */
html[data-theme="light"] :is(
  .reply-item small,
  .social-post-room,
  .social-post-markdown a,
  .social-poll-options button.is-selected,
  .social-poll-options small em,
  .social-comment button.social-comment-author:hover,
  .social-comment button.social-comment-author:focus-visible,
  button.social-post-author:hover,
  button.social-post-author:focus-visible,
  .chat-person .chat-typing-status,
  .notification-type-row span:last-child,
  .forecast-list strong,
  .owned-room-card small,
  .console-header strong,
  .lane-item em,
  .room-list strong
) {
  color: var(--mint-text);
}

html[data-theme="light"] :is(
  .reply-heading > .material-symbols-rounded,
  .reply-review-state,
  .star-row button.is-active,
  .star-row button:hover,
  .star-row button:focus-visible,
  .social-composer-actions > span.is-near-limit,
  .social-inline-edit-actions > span.is-near-limit,
  .profile-mention:hover,
  .profile-mention:focus-visible,
  .social-comment-actions span.is-near-limit,
  .social-post-actions .social-action-report:hover,
  .social-post-actions .social-action-delete:hover,
  .social-post-actions .social-action-report:focus-visible,
  .social-post-actions .social-action-delete:focus-visible,
  .article-body code,
  .profile-info-item a:hover,
  .field-counter.is-near-limit,
  .account-select-button .material-symbols-rounded,
  .hot-kicker,
  .node-b,
  .smart-composer code,
  .auth-form .legal-check a,
  .room-pinned-head,
  .pinned-label,
  .room-pinned-head .material-symbols-rounded
) {
  color: var(--gold-text);
}

html[data-theme="light"] .field-counter.is-over-limit {
  color: var(--coral-text);
}

/* Preserve scroll affordance without bringing back full-width platform scrollbars. */
html,
body,
.app-sidebar,
.search-overlay-body,
.floating-panel,
.modal-backdrop,
.auth-modal,
.markdown-preview,
.topic-strip,
.pulse-filter-group,
.reply-composer textarea,
.social-composer textarea,
.social-comment-form textarea,
.profile-tabs,
.saved-filters,
.conversation-list,
.message-thread,
.account-form textarea,
.explore-filters,
.excerpt-field textarea,
.room-create-form textarea,
.room-create-main textarea,
.report-modal textarea,
.modal-option-list,
.poll-results-list,
.room-chat-messages,
.room-chat-composer textarea,
.room-channel-select-menu,
.admin-record-raw,
.admin-nav,
.admin-page .admin-review-excerpt p {
  -ms-overflow-style: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.app-sidebar::-webkit-scrollbar,
.search-overlay-body::-webkit-scrollbar,
.floating-panel::-webkit-scrollbar,
.modal-backdrop::-webkit-scrollbar,
.auth-modal::-webkit-scrollbar,
.markdown-preview::-webkit-scrollbar,
.topic-strip::-webkit-scrollbar,
.pulse-filter-group::-webkit-scrollbar,
.reply-composer textarea::-webkit-scrollbar,
.social-composer textarea::-webkit-scrollbar,
.social-comment-form textarea::-webkit-scrollbar,
.profile-tabs::-webkit-scrollbar,
.saved-filters::-webkit-scrollbar,
.conversation-list::-webkit-scrollbar,
.message-thread::-webkit-scrollbar,
.account-form textarea::-webkit-scrollbar,
.explore-filters::-webkit-scrollbar,
.excerpt-field textarea::-webkit-scrollbar,
.room-create-form textarea::-webkit-scrollbar,
.room-create-main textarea::-webkit-scrollbar,
.report-modal textarea::-webkit-scrollbar,
.modal-option-list::-webkit-scrollbar,
.poll-results-list::-webkit-scrollbar,
.room-chat-messages::-webkit-scrollbar,
.room-chat-composer textarea::-webkit-scrollbar,
.room-channel-select-menu::-webkit-scrollbar,
.admin-record-raw::-webkit-scrollbar,
.admin-nav::-webkit-scrollbar,
.admin-page .admin-review-excerpt p::-webkit-scrollbar {
  display: block;
  width: 8px;
  height: 8px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.app-sidebar::-webkit-scrollbar-thumb,
.search-overlay-body::-webkit-scrollbar-thumb,
.floating-panel::-webkit-scrollbar-thumb,
.modal-backdrop::-webkit-scrollbar-thumb,
.auth-modal::-webkit-scrollbar-thumb,
.markdown-preview::-webkit-scrollbar-thumb,
.topic-strip::-webkit-scrollbar-thumb,
.pulse-filter-group::-webkit-scrollbar-thumb,
.reply-composer textarea::-webkit-scrollbar-thumb,
.social-composer textarea::-webkit-scrollbar-thumb,
.social-comment-form textarea::-webkit-scrollbar-thumb,
.profile-tabs::-webkit-scrollbar-thumb,
.saved-filters::-webkit-scrollbar-thumb,
.conversation-list::-webkit-scrollbar-thumb,
.message-thread::-webkit-scrollbar-thumb,
.account-form textarea::-webkit-scrollbar-thumb,
.explore-filters::-webkit-scrollbar-thumb,
.excerpt-field textarea::-webkit-scrollbar-thumb,
.room-create-form textarea::-webkit-scrollbar-thumb,
.room-create-main textarea::-webkit-scrollbar-thumb,
.report-modal textarea::-webkit-scrollbar-thumb,
.modal-option-list::-webkit-scrollbar-thumb,
.poll-results-list::-webkit-scrollbar-thumb,
.room-chat-messages::-webkit-scrollbar-thumb,
.room-chat-composer textarea::-webkit-scrollbar-thumb,
.room-channel-select-menu::-webkit-scrollbar-thumb,
.admin-record-raw::-webkit-scrollbar-thumb,
.admin-nav::-webkit-scrollbar-thumb,
.admin-page .admin-review-excerpt p::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.app-sidebar::-webkit-scrollbar-track,
.search-overlay-body::-webkit-scrollbar-track,
.floating-panel::-webkit-scrollbar-track,
.modal-backdrop::-webkit-scrollbar-track,
.auth-modal::-webkit-scrollbar-track,
.markdown-preview::-webkit-scrollbar-track,
.topic-strip::-webkit-scrollbar-track,
.pulse-filter-group::-webkit-scrollbar-track,
.reply-composer textarea::-webkit-scrollbar-track,
.social-composer textarea::-webkit-scrollbar-track,
.social-comment-form textarea::-webkit-scrollbar-track,
.profile-tabs::-webkit-scrollbar-track,
.saved-filters::-webkit-scrollbar-track,
.conversation-list::-webkit-scrollbar-track,
.message-thread::-webkit-scrollbar-track,
.account-form textarea::-webkit-scrollbar-track,
.explore-filters::-webkit-scrollbar-track,
.excerpt-field textarea::-webkit-scrollbar-track,
.room-create-form textarea::-webkit-scrollbar-track,
.room-create-main textarea::-webkit-scrollbar-track,
.report-modal textarea::-webkit-scrollbar-track,
.modal-option-list::-webkit-scrollbar-track,
.poll-results-list::-webkit-scrollbar-track,
.room-chat-messages::-webkit-scrollbar-track,
.room-chat-composer textarea::-webkit-scrollbar-track,
.room-channel-select-menu::-webkit-scrollbar-track,
.admin-record-raw::-webkit-scrollbar-track,
.admin-nav::-webkit-scrollbar-track,
.admin-page .admin-review-excerpt p::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

@media (max-height: 560px) and (pointer: coarse) {
  .social-gallery-viewer {
    padding:
      max(8px, env(safe-area-inset-top))
      calc(64px + env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      calc(64px + env(safe-area-inset-left));
  }

  .social-gallery-image-frame,
  .social-gallery-viewer img {
    max-height: calc(100vh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .social-gallery-nav {
    top: 50%;
    bottom: auto;
    width: 48px;
    height: 48px;
    transform: translateY(-50%);
  }

  .social-gallery-nav-previous {
    left: calc(8px + env(safe-area-inset-left));
  }

  .social-gallery-nav-next {
    right: calc(8px + env(safe-area-inset-right));
  }

  .social-gallery-close {
    width: 48px;
    height: 48px;
  }
}

/* Pulse home: focused feed hierarchy for wide and compact screens. */
#pulse .layout {
  max-width: min(1180px, 100%);
}

#pulse .feed-column {
  container-type: inline-size;
}

.pulse-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: clamp(22px, 4vw, 54px);
  min-height: 218px;
  margin-bottom: 16px;
  padding: clamp(24px, 4vw, 44px);
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 10%, rgba(73, 198, 164, 0.28), transparent 26%),
    linear-gradient(125deg, rgba(122, 85, 255, 0.36), rgba(122, 85, 255, 0.08) 48%, transparent 72%),
    var(--surface);
  border: 3px solid var(--stroke);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--lift-shadow-lg);
}

.pulse-hero::before,
.pulse-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 2px solid rgba(199, 187, 255, 0.24);
  border-radius: 50%;
  pointer-events: none;
}

.pulse-hero::before {
  top: -104px;
  right: -72px;
  width: 300px;
  height: 300px;
}

.pulse-hero::after {
  top: -42px;
  right: -10px;
  width: 176px;
  height: 176px;
  box-shadow: 0 0 0 28px rgba(73, 198, 164, 0.045);
}

.pulse-hero-copy {
  min-width: 0;
  max-width: 690px;
}

.pulse-hero h1 {
  max-width: none;
  font-size: clamp(2.65rem, 5vw, 4.65rem);
  line-height: 0.95;
}

.pulse-hero p {
  max-width: 650px;
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 700;
  line-height: 1.5;
}

.pulse-hero-command {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  justify-content: center;
  min-height: 52px;
  padding-inline: 18px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--stroke);
  font-weight: 1000;
  cursor: pointer;
}

#pulse .topic-strip {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: end;
  justify-content: stretch;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
}

.pulse-filter-block {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.pulse-format-filter {
  justify-self: end;
}

.pulse-filter-label {
  padding-inline: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

#pulse .pulse-filter-group {
  flex-wrap: nowrap;
  min-height: 46px;
  padding: 4px;
  gap: 4px;
  background: var(--paper-2);
  border: 0;
  border-radius: var(--radius);
}

#pulse .pulse-filter-group .topic {
  min-height: 38px;
  padding: 7px 12px;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  box-shadow: none;
  white-space: nowrap;
}

#pulse .pulse-filter-group .topic:not(.is-active) {
  background: transparent;
  color: var(--muted);
}

#pulse .pulse-filter-group .topic:not(.is-active):hover {
  color: var(--ink);
  background: var(--surface-2);
}

#pulse .pulse-filter-group .topic small {
  min-width: 1.8em;
  min-height: 1.8em;
  padding: 0 5px;
  border-width: 1px;
  font-size: 0.72rem;
}

#pulse .pulse-source-filter .topic.is-active {
  background: var(--gold);
  color: var(--on-accent);
}

#pulse .pulse-filter-group:not(.pulse-source-filter) .topic.is-active {
  background: var(--violet);
  color: var(--on-primary);
}

#pulse .story-list {
  gap: 12px;
}

#pulse .pulse-feed-card {
  position: relative;
  grid-template-columns: minmax(0, 1fr) clamp(146px, 18vw, 196px);
  gap: clamp(18px, 2.5vw, 30px);
  align-items: stretch;
  min-height: 176px;
  padding: clamp(18px, 2.4vw, 26px);
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: none;
}

#pulse .pulse-feed-card.no-media {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}

#pulse .pulse-feed-card:hover,
#pulse .pulse-feed-card:focus-visible {
  border-color: var(--stroke);
  box-shadow: 5px 5px 0 var(--stroke);
  transform: translate(-1px, -1px);
}

.pulse-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

#pulse .pulse-feed-main {
  align-content: start;
  gap: 12px;
}

#pulse .pulse-feed-kicker {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 6px;
}

#pulse .pulse-feed-kicker > span,
#pulse .pulse-feed-kicker > button {
  min-height: 26px;
  padding: 4px 8px;
  border-width: 1px;
  font-size: 0.72rem;
}

#pulse .pulse-feed-kicker > span {
  border-color: transparent;
}

#pulse .pulse-article-card .pulse-feed-kicker > span {
  background: color-mix(in srgb, var(--violet) 82%, white 18%);
  color: var(--on-primary);
}

#pulse .pulse-feed-card .writer-row {
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
  font-size: 0.84rem;
}

#pulse .pulse-feed-card .writer-row > span:not(.avatar):not(.dot) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#pulse .pulse-feed-card h3 {
  margin: 0;
  max-width: 800px;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1.14;
}

#pulse .pulse-feed-card h3 a {
  color: inherit;
  text-decoration: none;
}

#pulse .pulse-feed-card p,
#pulse .pulse-post-body {
  display: -webkit-box;
  max-width: 820px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#pulse .pulse-feed-thumb {
  align-self: stretch;
  width: 100%;
  min-height: 126px;
  aspect-ratio: auto;
  border: 0;
  border-radius: var(--radius);
  background: var(--paper-2);
}

#pulse .pulse-feed-thumb img {
  object-fit: cover;
}

#pulse .pulse-feed-card .story-meta {
  gap: 12px;
  padding-top: 2px;
  font-size: 0.8rem;
}

#pulse .pulse-feed-card .story-meta .icon-button.small {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  margin-left: -4px;
  border-width: 1px;
}

@container (min-width: 880px) {
  #pulse .story-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  #pulse .pulse-feed-card,
  #pulse .pulse-feed-card.no-media {
    grid-template-columns: minmax(0, 1fr) 154px;
    gap: 18px;
    width: 100%;
    height: 224px;
    min-height: 224px;
    padding: 18px;
  }

  #pulse .pulse-feed-card.no-media {
    grid-template-columns: minmax(0, 1fr);
  }

  #pulse .pulse-card-header {
    align-items: flex-start;
    flex-direction: column-reverse;
    gap: 11px;
  }

  #pulse .pulse-feed-kicker {
    max-width: 100%;
    flex-wrap: wrap;
  }

  #pulse .pulse-feed-card h3 {
    font-size: clamp(1.28rem, 1.8vw, 1.58rem);
  }

  #pulse .pulse-feed-card p,
  #pulse .pulse-post-body {
    font-size: 1rem;
    line-height: 1.5;
  }

  #pulse .pulse-article-card .pulse-feed-main > p {
    display: none;
  }

  #pulse .pulse-feed-thumb {
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  #pulse .pulse-feed-card .story-meta {
    gap: 11px;
    margin-top: auto;
    font-size: 0.88rem;
  }

  #pulse .pulse-feed-card .writer-row {
    font-size: 0.92rem;
  }

  #pulse .pulse-feed-kicker > span,
  #pulse .pulse-feed-kicker > button {
    min-height: 29px;
    padding: 5px 9px;
    font-size: 0.8rem;
  }

  #pulse .pulse-feed-kicker .material-symbols-rounded {
    font-size: 17px;
  }

  #pulse .pulse-feed-card .story-meta .icon-button.small {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
  }
}

@media (max-width: 900px) {
  #pulse .topic-strip {
    grid-template-columns: 1fr;
  }

  .pulse-format-filter {
    justify-self: stretch;
  }

  #pulse .pulse-filter-group {
    width: fit-content;
    max-width: 100%;
  }
}

@media (max-width: 780px) {
  #pulse .layout,
  #pulse .feed-column,
  #pulse .topic-strip,
  #pulse .story-list {
    width: 100%;
    max-width: 100%;
  }

  .pulse-hero {
    align-items: stretch;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 12px;
    padding: 22px 20px;
  }

  .pulse-hero::before {
    top: -116px;
    right: -126px;
  }

  .pulse-hero::after {
    display: none;
  }

  .pulse-hero h1 {
    font-size: clamp(2.35rem, 12vw, 3.35rem);
  }

  .pulse-hero p {
    margin-top: 12px;
    font-size: 0.98rem;
  }

  .pulse-hero-command {
    align-self: flex-start;
    width: auto;
    min-height: 46px;
  }

  #pulse .topic-strip {
    gap: 13px;
    margin-bottom: 12px;
    padding: 12px;
    overflow: visible;
  }

  #pulse .pulse-filter-group {
    width: 100%;
    overflow-x: auto;
  }

  #pulse .pulse-filter-group .topic {
    flex: 1 0 auto;
  }

  #pulse .pulse-feed-card,
  #pulse .pulse-feed-card.no-media {
    grid-template-columns: 1fr;
    gap: 14px;
    min-height: 0;
    padding: 16px;
  }

  .pulse-card-header {
    align-items: flex-start;
    flex-direction: column-reverse;
    gap: 10px;
  }

  #pulse .pulse-feed-kicker {
    max-width: 100%;
    flex-wrap: wrap;
  }

  #pulse .pulse-feed-card p,
  #pulse .pulse-post-body {
    -webkit-line-clamp: 3;
  }

  #pulse .pulse-feed-thumb {
    grid-row: 1;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  #pulse .pulse-feed-card.has-media .pulse-feed-main {
    grid-row: 2;
  }

  #pulse .pulse-feed-card.no-media .pulse-feed-main {
    grid-row: 1;
  }

  #pulse .pulse-feed-card .story-meta {
    gap: 10px;
  }
}

@media (max-width: 430px) {
  #pulse .pulse-filter-group .topic {
    padding-inline: 9px;
  }

  #pulse .pulse-filter-group .topic small {
    display: none;
  }

  #pulse .pulse-feed-card .story-meta {
    row-gap: 8px;
  }
}

/* Notifications home: readable activity stream with a compact overview rail. */
#notifications .notifications-page {
  gap: 14px;
  width: min(1180px, 100%);
  max-width: none;
}

#notifications .notifications-hero {
  position: relative;
  isolation: isolate;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(24px, 4vw, 54px);
  min-height: 210px;
  padding: clamp(26px, 4vw, 44px);
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 8%, rgba(73, 198, 164, 0.18), transparent 26%),
    linear-gradient(125deg, rgba(122, 85, 255, 0.34), rgba(122, 85, 255, 0.06) 52%, transparent 76%),
    var(--surface);
  border: 3px solid var(--stroke);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--lift-shadow-lg);
}

#notifications .notifications-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -170px;
  right: -88px;
  width: 380px;
  height: 380px;
  border: 2px solid rgba(73, 198, 164, 0.2);
  border-radius: 50%;
  box-shadow:
    0 0 0 42px rgba(73, 198, 164, 0.03),
    0 0 0 84px rgba(122, 85, 255, 0.025);
}

.notifications-hero-copy {
  min-width: 0;
  max-width: 720px;
}

#notifications .notifications-hero h1 {
  max-width: none;
  font-size: clamp(2.65rem, 4.8vw, 4.45rem);
  line-height: 0.98;
}

#notifications .notifications-hero p {
  max-width: 680px;
  margin: 15px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.65vw, 1.16rem);
  font-weight: 700;
  line-height: 1.5;
}

#notifications .notification-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  min-width: 310px;
}

#notifications .notification-actions .text-command {
  justify-content: center;
  min-height: 48px;
  max-width: none;
  padding-inline: 14px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--stroke);
  font-size: 0.9rem;
}

#notifications .notifications-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
}

#notifications .notification-feed-panel,
#notifications .notification-rail .panel {
  padding: 20px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: none;
}

#notifications .notification-feed-panel > .panel-title,
#notifications .notification-rail .panel > .panel-title {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin-bottom: 16px;
}

#notifications .notification-feed-panel > .panel-title > .material-symbols-rounded,
#notifications .notification-rail .panel > .panel-title > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font-size: 22px;
}

#notifications .notification-rail .panel > .panel-title > .material-symbols-rounded {
  background: var(--mint);
}

#notifications .notification-feed-panel > .panel-title h2,
#notifications .notification-rail .panel > .panel-title h2 {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
}

#notifications .notification-feed {
  gap: 8px;
}

#notifications .notification-card {
  position: relative;
  grid-template-columns: 52px minmax(0, 1fr) 38px;
  gap: 14px;
  min-height: 94px;
  padding: 15px 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

#notifications .notification-card:hover,
#notifications .notification-card:focus-visible {
  background: var(--surface-2);
  border-color: var(--stroke);
  box-shadow: 4px 4px 0 var(--stroke);
  transform: translate(-1px, -1px);
}

#notifications .notification-card.is-unread {
  background:
    linear-gradient(100deg, rgba(122, 85, 255, 0.18), transparent 56%),
    var(--paper-2);
  box-shadow: none;
}

#notifications .notification-card.is-unread::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 9px;
  height: 9px;
  background: var(--violet-light);
  border: 2px solid var(--stroke);
  border-radius: 50%;
}

#notifications .notification-icon {
  width: 48px;
  height: 48px;
  border-width: 2px;
  font-size: 22px;
}

#notifications .notification-card-body {
  gap: 5px;
}

#notifications .notification-card strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

#notifications .notification-card-body > span:not(.notification-card-top) {
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.42;
}

#notifications .notification-card-meta {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

#notifications .notification-card-action {
  width: 36px;
  height: 36px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
}

#notifications .notification-card:hover .notification-card-action,
#notifications .notification-card:focus-visible .notification-card-action {
  color: var(--on-accent);
  background: var(--gold);
  border-color: var(--stroke);
}

#notifications .notification-rail {
  position: sticky;
  top: 104px;
}

#notifications .notification-type-list {
  gap: 7px;
}

.notification-overview-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 5px;
}

.notification-overview-summary > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px;
  color: var(--muted);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 900;
}

.notification-overview-summary strong {
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
}

#notifications .notification-type-row {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 9px;
  min-height: 48px;
  padding: 7px 9px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.notification-type-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--on-accent);
  border: 1px solid var(--stroke);
  border-radius: 50%;
}

.notification-type-icon.notification-icon-violet,
.notification-type-icon.notification-icon-blue {
  color: var(--on-primary);
}

.notification-type-icon .material-symbols-rounded {
  font-size: 18px;
}

#notifications .notification-type-row strong {
  font-size: 0.9rem;
}

#notifications .notification-type-row > span:last-child {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding-inline: 7px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
}

#notifications .notification-empty {
  min-height: 150px;
  padding: 22px;
  background: var(--paper-2);
  border: 1px dashed var(--line);
}

#notifications .notification-empty > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
}

@media (max-width: 960px) {
  #notifications .notifications-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  #notifications .notification-actions {
    min-width: 0;
    width: min(100%, 420px);
  }

  #notifications .notifications-layout {
    grid-template-columns: 1fr;
  }

  #notifications .notification-rail {
    position: static;
  }

  #notifications .notification-type-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #notifications .notification-overview-summary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  #notifications .notifications-hero {
    min-height: 0;
    padding: 22px 20px;
  }

  #notifications .notifications-hero::after {
    top: -225px;
    right: -225px;
  }

  #notifications .notifications-hero h1 {
    font-size: clamp(2.25rem, 10.5vw, 3.2rem);
  }

  #notifications .notifications-hero p {
    margin-top: 11px;
    font-size: 0.96rem;
  }

  #notifications .notification-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  #notifications .notification-feed-panel,
  #notifications .notification-rail .panel {
    padding: 14px;
  }

  #notifications .notification-card {
    grid-template-columns: 42px minmax(0, 1fr) 32px;
    gap: 10px;
    min-height: 84px;
    padding: 12px;
  }

  #notifications .notification-icon {
    width: 40px;
    height: 40px;
  }

  #notifications .notification-card-action {
    width: 32px;
    height: 32px;
  }

  #notifications .notification-type-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  #notifications .notification-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  #notifications .notification-icon {
    width: 36px;
    height: 36px;
  }

  #notifications .notification-card-action {
    display: none;
  }
}

/* Bookmarks home: full-width library header, readable cards, focused collections. */
#saved .saved-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  width: min(1180px, 100%);
  max-width: none;
  container-type: normal;
}

#saved .saved-hero {
  position: relative;
  isolation: isolate;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(28px, 5vw, 72px);
  min-height: 210px;
  padding: clamp(26px, 4vw, 44px);
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 8%, rgba(245, 184, 75, 0.19), transparent 26%),
    linear-gradient(125deg, rgba(122, 85, 255, 0.34), rgba(122, 85, 255, 0.06) 52%, transparent 76%),
    var(--surface);
  border: 3px solid var(--stroke);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--lift-shadow-lg);
}

#saved .saved-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -170px;
  right: -88px;
  width: 380px;
  height: 380px;
  border: 2px solid rgba(245, 184, 75, 0.2);
  border-radius: 50%;
  box-shadow:
    0 0 0 42px rgba(245, 184, 75, 0.03),
    0 0 0 84px rgba(122, 85, 255, 0.025);
}

.saved-hero-copy {
  min-width: 0;
  max-width: 730px;
}

#saved .saved-hero h1 {
  max-width: none;
  font-size: clamp(2.75rem, 5vw, 4.65rem);
  line-height: 0.96;
}

#saved .saved-hero p {
  max-width: 690px;
  margin: 15px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  font-weight: 700;
  line-height: 1.5;
}

.saved-hero-mark {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  flex: 0 0 auto;
  gap: 8px;
}

.saved-hero-mark .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--on-accent);
  background: var(--mint);
  border: 2px solid var(--stroke);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--stroke);
  font-size: 23px;
}

.saved-hero-mark .material-symbols-rounded:nth-child(2) {
  width: 56px;
  height: 56px;
  background: var(--gold);
  font-size: 27px;
}

.saved-hero-mark .material-symbols-rounded:nth-child(3) {
  color: var(--on-primary);
  background: var(--violet);
}

#saved .saved-main {
  gap: 10px;
}

#saved .saved-filters {
  gap: 6px;
  padding: 8px;
  overflow-x: auto;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
}

#saved .saved-filters .topic {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  box-shadow: none;
  white-space: nowrap;
}

#saved .saved-filters .topic:hover,
#saved .saved-filters .topic:focus-visible {
  color: var(--ink);
  background: var(--surface-2);
}

#saved .saved-filters .topic.is-active {
  color: var(--on-primary);
  background: var(--violet);
}

#saved .saved-filters .topic > span:last-child {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding-inline: 6px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.76rem;
}

#saved .saved-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

#saved .saved-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 260px;
  padding: 20px;
  background:
    linear-gradient(145deg, rgba(122, 85, 255, 0.07), transparent 42%),
    var(--surface);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

#saved .saved-card.clickable-story:hover,
#saved .saved-card.clickable-story:focus-visible {
  border-color: var(--stroke);
  box-shadow: 5px 5px 0 var(--stroke);
  transform: translate(-1px, -1px);
}

#saved .saved-card > div:first-child {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

#saved .saved-card-feature {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 190px;
}

.saved-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

#saved .saved-card .post-type {
  max-width: 62%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 8px;
  color: var(--violet-light);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.saved-state .material-symbols-rounded {
  font-size: 17px;
}

#saved .saved-card h2 {
  margin-top: 14px;
  font-size: clamp(1.3rem, 2vw, 1.58rem);
  line-height: 1.18;
}

#saved .saved-card p {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.52;
}

#saved .saved-meta {
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  color: var(--muted);
  font-size: 0.86rem;
}

#saved .saved-meta > span {
  min-height: 30px;
  padding: 5px 8px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

#saved .saved-meta .material-symbols-rounded {
  font-size: 18px;
}

#saved .saved-meta .orb-icon {
  width: 18px;
  height: 18px;
}

#saved .saved-art {
  display: none;
}

#saved .saved-rail {
  gap: 10px;
  top: 104px;
}

#saved .saved-rail .panel {
  padding: 18px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: none;
}

#saved .saved-rail .panel-title {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin-bottom: 14px;
}

#saved .saved-rail .panel-title > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font-size: 22px;
}

#saved .saved-rail .panel-title h2 {
  font-size: 1.45rem;
}

#saved .collection-create-link {
  min-height: 44px;
  margin-bottom: 12px;
  color: var(--on-primary);
  background: var(--violet);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--stroke);
}

#saved .collection-list {
  gap: 6px;
}

#saved .collection-row {
  gap: 6px;
}

#saved .collection-row.has-actions {
  grid-template-columns: minmax(0, 1fr) 42px;
}

#saved .collection-filter-button,
#saved .collection-delete-button {
  min-height: 42px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

#saved .collection-row.is-selected .collection-filter-button {
  color: var(--on-primary);
  background: var(--violet);
  border-color: var(--stroke);
}

#saved .collection-filter-button strong {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding-inline: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
}

#saved .collection-row.is-selected .collection-filter-button strong {
  color: var(--ink);
}

#saved .saved-grid > .list-pager,
#saved .saved-grid > .saved-cursor-pager {
  grid-column: 1 / -1;
}

@media (max-width: 940px) {
  #saved .saved-layout {
    grid-template-columns: 1fr;
  }

  #saved .saved-hero {
    grid-column: 1;
    grid-row: 1;
  }

  #saved .saved-rail {
    position: static;
    grid-row: 2;
  }

  #saved .saved-main {
    grid-row: 3;
  }

  #saved .saved-rail .panel {
    display: grid;
    grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1.55fr);
    gap: 10px 14px;
  }

  #saved .saved-rail .panel-title {
    grid-column: 1;
    margin: 0;
  }

  #saved .collection-create-link {
    grid-column: 1;
    margin: 0;
  }

  #saved .collection-list {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 700px) {
  #saved .saved-hero {
    min-height: 0;
    padding: 22px 20px;
  }

  #saved .saved-hero::after {
    top: -225px;
    right: -225px;
  }

  #saved .saved-hero h1 {
    font-size: clamp(2.5rem, 12vw, 3.45rem);
  }

  #saved .saved-hero p {
    margin-top: 11px;
    font-size: 0.96rem;
  }

  .saved-hero-mark {
    display: none;
  }

  #saved .saved-grid {
    grid-template-columns: 1fr;
  }

  #saved .saved-card {
    min-height: 0;
  }

  #saved .saved-rail .panel {
    grid-template-columns: 1fr;
  }

  #saved .saved-rail .panel-title,
  #saved .collection-create-link,
  #saved .collection-list {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 420px) {
  #saved .saved-card,
  #saved .saved-rail .panel {
    padding: 15px;
  }

  .saved-card-top {
    align-items: flex-start;
    flex-direction: column;
  }

  #saved .saved-card .post-type {
    max-width: 100%;
  }
}

/* Posts home: wide feed with a dedicated writing rail and a compact mobile flow. */
#social .social-layout {
  max-width: min(1180px, 100%);
}

#social .social-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.social-page-header {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 190px;
  padding: clamp(24px, 3.5vw, 40px);
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 117, 93, 0.2), transparent 27%),
    linear-gradient(125deg, rgba(73, 198, 164, 0.22), rgba(73, 198, 164, 0.04) 52%, transparent 75%),
    var(--surface);
  border: 3px solid var(--stroke);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--lift-shadow-lg);
}

.social-page-header::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -118px;
  right: -82px;
  width: 330px;
  height: 330px;
  border: 2px solid rgba(73, 198, 164, 0.2);
  border-radius: 50%;
  box-shadow:
    0 0 0 36px rgba(73, 198, 164, 0.035),
    0 0 0 72px rgba(122, 85, 255, 0.025);
}

.social-page-header-copy {
  min-width: 0;
  max-width: 710px;
}

.social-page-header h1 {
  max-width: none;
  font-size: clamp(2.7rem, 5vw, 4.5rem);
  line-height: 0.96;
}

.social-page-header p {
  max-width: 650px;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.6vw, 1.16rem);
  font-weight: 700;
  line-height: 1.5;
}

.social-page-mark {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 48px);
  grid-template-rows: repeat(2, 48px);
  flex: 0 0 auto;
  gap: 8px;
  padding: 16px;
  transform: rotate(4deg);
}

.social-page-mark .material-symbols-rounded {
  display: grid;
  place-items: center;
  color: var(--on-accent);
  background: var(--mint);
  border: 2px solid var(--stroke);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--stroke);
  font-size: 24px;
}

.social-page-mark .material-symbols-rounded:nth-child(2) {
  background: var(--coral);
}

.social-page-mark .material-symbols-rounded:nth-child(3) {
  grid-column: 1 / -1;
  width: 60px;
  justify-self: center;
  background: var(--gold);
}

#social .social-composer {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(122, 85, 255, 0.1), transparent 180px),
    var(--surface);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: none;
}

.social-composer-title {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.social-composer-title > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font-size: 20px;
}

.social-composer-title strong,
.social-composer-title small {
  display: block;
}

.social-composer-title strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 1000;
}

.social-composer-title small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

#social .social-composer-user {
  grid-template-columns: 42px minmax(0, 1fr);
}

#social .social-composer-user .avatar {
  width: 42px;
  height: 42px;
}

#social .social-room-picker,
#social .social-composer-row,
#social .social-image-preview,
#social .social-poll-editor,
#social .social-composer-actions {
  margin-left: 0;
}

#social .social-composer textarea {
  min-height: 108px;
  padding: 13px 14px;
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 1rem;
}

#social .social-composer textarea:focus {
  border-color: var(--violet);
}

#social .social-composer-actions {
  display: grid;
  grid-template-columns: auto auto minmax(48px, 1fr) auto;
  gap: 7px;
  padding-top: 12px;
}

#social .social-composer-actions > span {
  justify-self: end;
  margin: 0;
}

#social .social-image-button,
#social .social-poll-toggle {
  color: var(--ink-soft);
  background: var(--paper-2);
  border: 1px solid var(--line);
}

#social .social-composer .primary-button {
  border-radius: var(--radius);
}

#social .social-feed {
  gap: 12px;
  min-width: 0;
}

#social .social-topic-bar {
  gap: 8px;
  margin: 0 0 2px;
  padding: 10px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
}

#social .social-room-select-button,
#social .social-saved-filter {
  min-height: 52px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: none;
}

#social .social-post {
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 14px;
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

#social .social-post:hover,
#social .social-post:focus-visible {
  border-color: var(--stroke);
  box-shadow: 5px 5px 0 var(--stroke);
  transform: translate(-1px, -1px);
}

#social .social-post > .avatar {
  width: 50px;
  height: 50px;
}

#social .social-post-body {
  gap: 11px;
}

#social .social-post-head {
  align-items: center;
}

#social .social-post-meta {
  gap: 4px 7px;
}

#social button.social-post-author {
  font-size: 0.98rem;
  font-weight: 1000;
}

#social .social-post-meta .user-handle,
#social .social-post-meta .social-post-time {
  font-size: 0.82rem;
}

#social .social-post-room {
  min-height: 27px;
  padding: 4px 8px;
  background: color-mix(in srgb, var(--mint) 12%, var(--paper-2));
  border: 1px solid color-mix(in srgb, var(--mint) 45%, var(--line));
  font-size: 0.76rem;
}

#social .social-post-body .social-post-markdown {
  font-size: 1.02rem;
  line-height: 1.58;
}

#social .social-post-gallery {
  width: min(100%, 640px);
  max-height: 620px;
  margin-block: 2px 4px;
  border-width: 2px;
}

#social .social-post-gallery-1 .social-gallery-tile {
  border-width: 2px;
}

#social .social-post-actions {
  max-width: none;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

#social .social-post-actions button {
  min-height: 34px;
}

#social .social-empty {
  border: 2px solid var(--line);
  box-shadow: none;
}

@media (min-width: 1200px) {
  #social .social-main {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 360px);
    gap: 16px;
  }

  #social .social-page-header {
    grid-column: 1 / -1;
  }

  #social .social-feed {
    grid-column: 1;
    grid-row: 2;
  }

  #social .social-composer {
    position: sticky;
    top: 104px;
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 1199px) {
  #social .social-layout {
    max-width: min(820px, 100%);
  }

  #social .social-page-header {
    grid-row: 1;
  }

  #social .social-composer {
    grid-row: 2;
  }

  #social .social-feed {
    grid-row: 3;
  }
}

@media (max-width: 620px) {
  .social-page-header {
    align-items: flex-start;
    min-height: 0;
    padding: 22px 20px;
  }

  .social-page-header::after {
    top: -170px;
    right: -170px;
  }

  .social-page-header h1 {
    font-size: clamp(2.45rem, 13vw, 3.4rem);
  }

  .social-page-header p {
    margin-top: 10px;
    font-size: 0.96rem;
  }

  .social-page-mark {
    display: none;
  }

  #social .social-composer {
    padding: 14px;
  }

  #social .social-composer-title {
    padding-bottom: 12px;
  }

  #social .social-composer-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
  }

  #social .social-composer-actions > span {
    width: auto;
    margin-left: auto;
    font-size: 0.74rem;
    white-space: nowrap;
  }

  #social .social-composer .primary-button {
    flex-shrink: 0;
  }

  #social .social-post {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    padding: 14px 12px;
  }

  #social .social-post > .avatar {
    width: 40px;
    height: 40px;
  }

  #social .social-post-head {
    align-items: flex-start;
    gap: 8px;
  }

  #social .social-post-room {
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    text-align: left;
  }

  #social .social-post-room > span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  #social .social-post-meta .social-post-time {
    flex-basis: auto;
  }

  #social .social-post-actions {
    flex-wrap: nowrap;
    gap: 2px;
    overflow-x: auto;
  }

  #social .social-post-actions button {
    flex: 0 0 auto;
  }
}

@media (max-width: 430px) {
  #social .social-topic-bar {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  #social .social-saved-filter {
    width: 48px;
    padding: 0;
  }

  #social .social-saved-filter span:last-child {
    display: none;
  }

  #social .social-post {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  #social .social-post > .avatar {
    width: 34px;
    height: 34px;
  }

  #social .social-post-meta .social-post-time {
    flex-basis: 100%;
  }

  #social .social-post-meta .social-post-time::before {
    display: none;
  }

}

/* Rooms home: community discovery with responsive cards and a unified toolbar. */
#discover .discover-workspace {
  width: min(1180px, 100%);
  max-width: none;
  gap: 14px;
}

.rooms-page-header {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(28px, 5vw, 72px);
  min-height: 210px;
  padding: clamp(26px, 4vw, 44px);
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 10%, rgba(245, 184, 75, 0.19), transparent 25%),
    linear-gradient(125deg, rgba(122, 85, 255, 0.34), rgba(122, 85, 255, 0.07) 50%, transparent 76%),
    var(--surface);
  border: 3px solid var(--stroke);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--lift-shadow-lg);
}

.rooms-page-header::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -154px;
  right: -78px;
  width: 360px;
  height: 360px;
  border: 2px solid rgba(199, 187, 255, 0.2);
  border-radius: 50%;
  box-shadow:
    0 0 0 40px rgba(122, 85, 255, 0.035),
    0 0 0 80px rgba(245, 184, 75, 0.025);
}

.rooms-page-header-copy {
  min-width: 0;
  max-width: 720px;
}

.rooms-page-header h1 {
  max-width: none;
  font-size: clamp(2.8rem, 5vw, 4.7rem);
  line-height: 0.96;
}

.rooms-page-header p {
  max-width: 690px;
  margin: 15px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  font-weight: 700;
  line-height: 1.5;
}

.rooms-page-header-actions {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 0 0 auto;
  gap: 14px;
  justify-items: center;
}

.rooms-page-header-actions > .primary-button {
  min-height: 48px;
  padding-inline: 18px;
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--stroke);
}

.rooms-page-mark {
  display: flex;
  align-items: end;
  gap: 7px;
}

.rooms-page-mark .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--on-accent);
  background: var(--mint);
  border: 2px solid var(--stroke);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--stroke);
  font-size: 21px;
}

.rooms-page-mark .material-symbols-rounded:nth-child(2) {
  width: 48px;
  height: 48px;
  background: var(--gold);
}

.rooms-page-mark .material-symbols-rounded:nth-child(3) {
  background: var(--coral);
}

#discover .discover-pane.is-active {
  display: grid;
  gap: 12px;
  container: rooms-pane / inline-size;
}

#discover .room-search-form {
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 8px 8px 8px 16px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: none;
}

#discover .room-search-form:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(122, 85, 255, 0.18);
}

#discover .room-search-form button {
  min-height: 40px;
  padding-inline: 17px;
  border-radius: var(--radius);
}

#discover .room-search-form input {
  font-size: 1rem;
}

#discover .room-search-form > .material-symbols-rounded {
  font-size: 23px;
}

#discover .room-browser-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

#discover .room-browser-toolbar {
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
}

#discover .room-browser-toolbar h2 {
  font-size: clamp(1.55rem, 2.2vw, 2rem);
}

#discover .room-browser-toolbar p {
  margin-top: 7px;
  font-size: 1rem;
  line-height: 1.5;
}

#discover .room-filter-switch {
  gap: 6px;
  padding: 4px;
  background: var(--paper-2);
  border-radius: var(--radius);
}

#discover .room-filter-strip button {
  min-height: 50px;
  padding: 9px 11px;
  background: transparent;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  box-shadow: none;
  font-size: 0.94rem;
}

#discover .room-filter-strip button:not(.is-selected) {
  color: var(--muted);
}

#discover .room-filter-strip button:not(.is-selected):hover {
  color: var(--ink);
  background: var(--surface-2);
}

#discover .room-filter-strip button .material-symbols-rounded {
  font-size: 21px;
}

#discover .room-filter-strip button strong {
  font-size: 0.86rem;
}

#discover .room-filter-strip button.is-selected {
  background: var(--violet);
  color: var(--on-primary);
}

#discover .room-browser-toolbar.is-owned {
  grid-template-areas:
    "title switch"
    "tools tools";
}

#discover .room-owned-tools {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

#discover .room-browser-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: auto;
  min-height: 0;
  padding: 20px;
  overflow: visible;
  background:
    linear-gradient(145deg, rgba(122, 85, 255, 0.07), transparent 42%),
    var(--surface);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

#discover .room-browser-card:hover,
#discover .room-browser-card:focus-visible {
  border-color: var(--stroke);
  box-shadow: 5px 5px 0 var(--stroke);
  transform: translate(-1px, -1px);
}

#discover .room-browser-head {
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  flex: 1 1 auto;
}

#discover .room-browser-head .room-badge {
  width: 60px;
  height: 60px;
  font-size: 1.35rem;
}

#discover .room-browser-card h3 {
  font-size: clamp(1.32rem, 2vw, 1.55rem);
  line-height: 1.15;
}

#discover .room-browser-card .room-handle {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
}

#discover .room-browser-card .room-browser-head p {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.5;
}

#discover .room-card-meta-block {
  align-content: start;
  gap: 8px;
}

#discover .room-browser-facts {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

#discover .room-browser-facts > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 31px;
  padding: 6px 9px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.86rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#discover .room-browser-facts .material-symbols-rounded {
  flex: 0 0 auto;
  font-size: 17px;
}

#discover .room-browser-facts .orb-icon {
  width: 17px;
  height: 17px;
}

#discover .room-card-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px;
  margin-top: auto;
}

#discover .room-card-actions button {
  min-height: 44px;
  padding: 9px 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.92rem;
}

#discover .room-card-actions button:hover,
#discover .room-card-actions button:focus-visible {
  border-color: var(--stroke);
}

#discover .room-card-actions [data-write-room] {
  color: var(--on-primary);
  background: var(--violet);
  border-color: var(--stroke);
}

#discover .room-owned-browser-card {
  height: auto;
  min-height: 122px;
  padding: 16px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: none;
}

#discover .discover-empty {
  grid-column: 1 / -1;
  border: 2px solid var(--line);
  box-shadow: none;
}

@container rooms-pane (min-width: 1040px) {
  #discover .room-browser-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #discover .room-card-meta-block {
    flex: 0 0 33px;
    min-height: 33px;
  }

  #discover .room-card-actions {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    flex: 0 0 44px;
    min-height: 44px;
    margin-top: 0;
  }
}

@media (max-width: 980px) {
  #discover .room-browser-toolbar,
  #discover .room-browser-toolbar.is-owned {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "switch"
      "tools";
    align-items: stretch;
  }
}

@media (max-width: 620px) {
  .rooms-page-header {
    align-items: stretch;
    flex-direction: column;
    min-height: 0;
    padding: 22px 20px;
  }

  .rooms-page-header::after {
    top: -210px;
    right: -210px;
  }

  .rooms-page-header h1 {
    font-size: clamp(2.55rem, 13vw, 3.5rem);
  }

  .rooms-page-header p {
    margin-top: 11px;
    font-size: 0.96rem;
  }

  .rooms-page-header-actions {
    justify-items: stretch;
  }

  .rooms-page-header-actions > .primary-button {
    width: 100%;
  }

  .rooms-page-mark {
    display: none;
  }

  #discover .room-search-form,
  #discover .explore-search {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  #discover .room-search-form button,
  #discover .explore-search button {
    grid-column: auto;
    width: auto;
    padding-inline: 12px;
  }

  #discover .room-browser-toolbar {
    padding: 14px;
  }

  #discover .room-filter-switch {
    grid-template-columns: 1fr;
  }

  #discover .room-browser-card {
    height: auto;
    min-height: 0;
  }

  #discover .room-browser-facts {
    flex-wrap: wrap;
  }

  #discover .room-browser-facts > span {
    flex: 1 1 118px;
  }
}

@media (max-width: 390px) {
  #discover .room-search-form button {
    width: 42px;
    padding: 0;
    overflow: hidden;
    color: transparent;
  }

  #discover .room-search-form button::before {
    content: "arrow_forward";
    color: var(--on-accent);
    font-family: "Material Symbols Rounded";
    font-size: 20px;
  }

  #discover .room-browser-facts > span {
    flex-basis: 100px;
  }
}

/* Profiles discovery: readable identity cards and a calm sorting workspace. */
#profiles .profiles-explorer-page {
  width: min(1180px, 100%);
  gap: 14px;
}

.profiles-page-header {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(28px, 5vw, 70px);
  min-height: 210px;
  padding: clamp(26px, 4vw, 44px);
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 8%, rgba(73, 198, 164, 0.2), transparent 26%),
    linear-gradient(125deg, rgba(122, 85, 255, 0.32), rgba(122, 85, 255, 0.06) 52%, transparent 76%),
    var(--surface);
  border: 3px solid var(--stroke);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--lift-shadow-lg);
}

.profiles-page-header::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -165px;
  right: -82px;
  width: 370px;
  height: 370px;
  border: 2px solid rgba(73, 198, 164, 0.2);
  border-radius: 50%;
  box-shadow:
    0 0 0 42px rgba(73, 198, 164, 0.035),
    0 0 0 84px rgba(122, 85, 255, 0.025);
}

.profiles-page-header-copy {
  min-width: 0;
  max-width: 730px;
}

.profiles-page-header h1 {
  max-width: none;
  font-size: clamp(2.75rem, 5vw, 4.65rem);
  line-height: 0.96;
}

.profiles-page-header p {
  max-width: 690px;
  margin: 15px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  font-weight: 700;
  line-height: 1.5;
}

.profiles-page-mark {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  flex: 0 0 auto;
  gap: 8px;
}

.profiles-page-mark .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--on-accent);
  background: var(--mint);
  border: 2px solid var(--stroke);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--stroke);
  font-size: 23px;
}

.profiles-page-mark .material-symbols-rounded:nth-child(2) {
  width: 56px;
  height: 56px;
  background: var(--gold);
  font-size: 27px;
}

.profiles-page-mark .material-symbols-rounded:nth-child(3) {
  background: var(--coral);
}

#profiles .profile-explorer-search {
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: 100%;
  max-width: none;
  min-height: 58px;
  padding: 8px 8px 8px 16px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: none;
}

#profiles .profile-explorer-search:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(122, 85, 255, 0.18);
}

#profiles .profile-explorer-search input {
  font-size: 1rem;
}

#profiles .profile-explorer-search > .material-symbols-rounded {
  font-size: 23px;
}

#profiles .profile-explorer-search button {
  min-height: 40px;
  padding-inline: 17px;
}

#profiles .profile-explorer-root,
#profiles .profile-explorer-grid {
  gap: 12px;
}

#profiles .profile-explorer-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
}

.profile-toolbar-copy h2 {
  font-size: clamp(1.3rem, 2vw, 1.7rem);
}

.profile-toolbar-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

#profiles .profile-filter-switch {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  background: var(--paper-2);
  border-radius: var(--radius);
}

#profiles .profile-filter-switch button {
  grid-template-columns: 21px minmax(0, 1fr);
  min-height: 46px;
  padding: 8px 7px;
  background: transparent;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted);
  font-size: 0.86rem;
  box-shadow: none;
}

#profiles .profile-filter-switch button:hover,
#profiles .profile-filter-switch button:focus-visible {
  color: var(--ink);
  background: var(--surface-2);
}

#profiles .profile-filter-switch button.is-selected {
  color: var(--on-primary);
  background: var(--violet);
}

#profiles .profile-filter-switch button .material-symbols-rounded {
  font-size: 20px;
}

#profiles .profile-filter-row {
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

#profiles .profile-clear-filters {
  min-height: 42px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--stroke);
}

#profiles .profile-browser-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

#profiles .profile-browser-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 340px;
  padding: 20px;
  background:
    linear-gradient(145deg, rgba(73, 198, 164, 0.07), transparent 40%),
    var(--surface);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: none;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

#profiles .profile-browser-card:hover,
#profiles .profile-browser-card:focus-visible {
  border-color: var(--stroke);
  box-shadow: 5px 5px 0 var(--stroke);
  transform: translate(-1px, -1px);
}

#profiles .profile-rank-badge {
  top: 18px;
  right: 18px;
  min-width: 48px;
  height: 36px;
  background: var(--gold);
  border-width: 2px;
  border-radius: var(--radius);
  font-size: 0.92rem;
}

#profiles .profile-browser-head {
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 15px;
  min-height: 78px;
  padding-right: 58px;
}

#profiles .profile-browser-head .profile-avatar {
  width: 74px;
  height: 74px;
  font-size: 1.75rem;
}

#profiles .profile-browser-card h3 {
  overflow: visible;
  font-size: clamp(1.35rem, 2vw, 1.62rem);
  line-height: 1.15;
  text-overflow: clip;
  white-space: normal;
}

#profiles .profile-browser-card .profile-handle {
  min-height: 0;
  margin: 5px 0 0;
  color: var(--violet-light);
  font-size: 0.9rem;
  font-weight: 900;
}

#profiles .profile-browser-card > p {
  min-height: 0;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.52;
}

#profiles .profile-browser-card > .profile-card-bio {
  display: block;
  min-height: 0;
  overflow: visible;
  -webkit-line-clamp: unset;
}

#profiles .profile-browser-card .profile-card-status {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.92rem;
}

#profiles .profile-card-status .material-symbols-rounded {
  color: var(--mint-text);
  font-size: 20px;
}

#profiles .profile-browser-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

#profiles .profile-browser-stats span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1 1 116px;
  min-height: 34px;
  padding: 6px 8px;
  color: var(--muted);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.84rem;
  text-align: center;
}

#profiles .profile-browser-stats .material-symbols-rounded {
  font-size: 18px;
}

#profiles .profile-browser-stats .orb-icon {
  width: 18px;
  height: 18px;
}

#profiles .profile-browser-stats strong {
  color: var(--ink);
}

#profiles .profile-card-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

#profiles .profile-card-actions button {
  height: 46px;
  min-height: 46px;
  max-height: none;
  border-width: 2px;
  border-radius: var(--radius);
  font-size: 0.94rem;
}

#profiles .profile-sort-toggle {
  display: none;
}

@media (max-width: 980px) {
  #profiles .profile-explorer-toolbar {
    grid-template-columns: 1fr;
  }

  #profiles .profile-filter-switch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .profiles-page-header {
    min-height: 0;
    padding: 22px 20px;
  }

  .profiles-page-header::after {
    top: -220px;
    right: -220px;
  }

  .profiles-page-header h1 {
    font-size: clamp(2.45rem, 12vw, 3.45rem);
  }

  .profiles-page-header p {
    margin-top: 11px;
    font-size: 0.96rem;
  }

  .profiles-page-mark {
    display: none;
  }

  #profiles .profile-browser-grid {
    grid-template-columns: 1fr;
  }

  #profiles .profile-browser-card {
    min-height: 0;
  }

  #profiles .profile-sort-toggle {
    display: grid;
  }

  #profiles .profile-explorer-toolbar:not(.is-expanded) .profile-filter-switch {
    display: none;
  }

  #profiles .profile-explorer-toolbar.is-expanded .profile-filter-switch {
    display: grid;
  }
}

@media (max-width: 520px) {
  #profiles .profile-explorer-search {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  #profiles .profile-explorer-search button {
    grid-column: auto;
    width: auto;
    padding-inline: 12px;
  }

  #profiles .profile-explorer-toolbar {
    padding: 14px;
  }

  #profiles .profile-filter-switch {
    grid-template-columns: 1fr;
  }

  #profiles .profile-browser-card {
    padding: 16px;
  }

  #profiles .profile-browser-head {
    grid-template-columns: 62px minmax(0, 1fr);
    min-height: 62px;
    padding-right: 48px;
  }

  #profiles .profile-browser-head .profile-avatar {
    width: 60px;
    height: 60px;
    font-size: 1.45rem;
  }

  #profiles .profile-rank-badge {
    top: 14px;
    right: 14px;
    min-width: 42px;
    height: 32px;
  }

  #profiles .profile-browser-stats span {
    flex-basis: calc(50% - 6px);
  }
}

@media (max-width: 380px) {
  #profiles .profile-explorer-search button {
    width: 42px;
    padding: 0;
    overflow: hidden;
    color: transparent;
  }

  #profiles .profile-explorer-search button::before {
    content: "arrow_forward";
    color: var(--on-accent);
    font-family: "Material Symbols Rounded";
    font-size: 20px;
  }

  #profiles .profile-card-actions {
    grid-template-columns: 1fr;
  }
}

/* Settings home: one visual workspace with compact preference cards. */
#settings .settings-page {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: min(1180px, 100%);
  max-width: none;
}

#settings .settings-hero {
  position: relative;
  isolation: isolate;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(28px, 5vw, 72px);
  min-height: 210px;
  padding: clamp(26px, 4vw, 44px);
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 8%, rgba(245, 184, 75, 0.18), transparent 26%),
    linear-gradient(125deg, rgba(122, 85, 255, 0.34), rgba(122, 85, 255, 0.06) 52%, transparent 76%),
    var(--surface);
  border: 3px solid var(--stroke);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--lift-shadow-lg);
}

#settings .settings-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -165px;
  right: -82px;
  width: 370px;
  height: 370px;
  border: 2px solid rgba(245, 184, 75, 0.2);
  border-radius: 50%;
  box-shadow:
    0 0 0 42px rgba(245, 184, 75, 0.03),
    0 0 0 84px rgba(122, 85, 255, 0.025);
}

.settings-hero-copy {
  min-width: 0;
  max-width: 730px;
}

#settings .settings-hero h1 {
  max-width: none;
  font-size: clamp(2.75rem, 5vw, 4.65rem);
  line-height: 0.96;
}

#settings .settings-hero p {
  max-width: 690px;
  margin: 15px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  font-weight: 700;
  line-height: 1.5;
}

.settings-hero-mark {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  flex: 0 0 auto;
  gap: 8px;
}

.settings-hero-mark .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--on-accent);
  background: var(--mint);
  border: 2px solid var(--stroke);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--stroke);
  font-size: 23px;
}

.settings-hero-mark .material-symbols-rounded:nth-child(2) {
  width: 56px;
  height: 56px;
  background: var(--gold);
  font-size: 28px;
}

.settings-hero-mark .material-symbols-rounded:nth-child(3) {
  background: var(--coral);
}

#settings .settings-theme-panel {
  grid-column: 1 / -1;
}

#settings .app-settings-panel {
  align-content: start;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: none;
}

#settings .app-settings-panel > .panel-title {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

#settings .app-settings-panel > .panel-title > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font-size: 23px;
}

#settings .settings-language-panel > .panel-title > .material-symbols-rounded {
  background: var(--mint);
}

#settings .settings-notification-panel > .panel-title > .material-symbols-rounded {
  background: var(--coral);
}

#settings .settings-sync-panel > .panel-title > .material-symbols-rounded {
  color: var(--on-primary);
  background: var(--violet);
}

#settings .app-settings-panel > .panel-title h2 {
  font-size: clamp(1.35rem, 2vw, 1.72rem);
}

#settings .settings-description {
  margin: -4px 0 0 58px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

#settings .theme-preset-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

#settings .theme-preset-options .theme-option {
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 11px;
  min-height: 78px;
  padding: 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

#settings .theme-preset-options .theme-option:hover,
#settings .theme-preset-options .theme-option:focus-visible {
  border-color: var(--stroke);
  box-shadow: 3px 3px 0 var(--stroke);
}

#settings .theme-preset-options .theme-option.is-selected {
  background: var(--surface-2);
  border-color: var(--violet);
  box-shadow: inset 0 0 0 2px var(--violet);
}

#settings .theme-preset-options .theme-preview {
  grid-template-rows: 11px 1fr 9px;
  width: 56px;
  height: 52px;
  padding: 5px;
}

#settings .theme-preset-options .theme-option strong {
  display: block;
  overflow: visible;
  font-size: 0.94rem;
  line-height: 1.25;
  -webkit-line-clamp: unset;
}

#settings .custom-theme-editor {
  padding: 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

#settings .settings-language-panel,
#settings .settings-notification-panel,
#settings .settings-sync-panel {
  min-height: 245px;
}

#settings .language-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: auto;
}

#settings .language-options .theme-option {
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 88px;
  padding: 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

#settings .language-options .theme-option.is-selected {
  border-color: var(--violet);
  box-shadow: inset 0 0 0 2px var(--violet);
}

#settings .language-preview {
  width: 54px;
  height: 54px;
}

#settings .preference-sync-list {
  margin-top: auto;
}

#settings .preference-sync-row {
  min-height: 132px;
  padding: 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

#settings .preference-sync-row strong {
  color: var(--ink);
  font-size: 1rem;
}

#settings .preference-sync-row small {
  margin-top: 7px;
  font-size: 0.9rem;
  line-height: 1.45;
}

@media (max-width: 1040px) {
  #settings .settings-page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #settings .settings-sync-panel {
    grid-column: 1 / -1;
    min-height: 0;
  }

  #settings .settings-sync-panel .preference-sync-row {
    min-height: 100px;
  }

  #settings .theme-preset-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #settings .settings-page {
    grid-template-columns: 1fr;
  }

  #settings .settings-hero,
  #settings .settings-theme-panel,
  #settings .settings-language-panel,
  #settings .settings-notification-panel,
  #settings .settings-sync-panel {
    grid-column: 1;
  }

  #settings .settings-hero {
    min-height: 0;
    padding: 22px 20px;
  }

  #settings .settings-hero::after {
    top: -220px;
    right: -220px;
  }

  #settings .settings-hero h1 {
    font-size: clamp(2.5rem, 12vw, 3.45rem);
  }

  #settings .settings-hero p {
    margin-top: 11px;
    font-size: 0.96rem;
  }

  .settings-hero-mark {
    display: none;
  }

  #settings .settings-language-panel,
  #settings .settings-notification-panel,
  #settings .settings-sync-panel {
    min-height: 0;
  }

  #settings .theme-preset-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #settings .settings-description {
    margin-left: 0;
  }
}

@media (max-width: 430px) {
  #settings .app-settings-panel {
    padding: 16px;
  }

  #settings .theme-preset-options,
  #settings .language-options {
    grid-template-columns: 1fr;
  }

  #settings .theme-preset-options .theme-option {
    min-height: 72px;
  }

  #settings .preference-sync-row {
    grid-template-columns: minmax(0, 1fr) 48px;
    min-height: 0;
    padding: 14px;
  }
}
/* Profile stories */
.avatar.has-profile-story {
  --profile-story-ring: #8b5cf6;
  cursor: pointer;
}

.avatar.has-profile-story::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border: 2px solid var(--profile-story-ring);
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px var(--paper-2, #fff);
  pointer-events: none;
}

.avatar.has-profile-story.is-viewed {
  --profile-story-ring: color-mix(in srgb, var(--muted, #8d8a98) 72%, transparent);
}

.profile-story-rail {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--border, rgba(127, 127, 127, 0.2));
  border-radius: 22px;
  background: var(--surface, #fff);
  overflow: hidden;
}

.profile-story-rail-head,
.profile-story-viewer-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-story-rail-head {
  justify-content: space-between;
  margin-bottom: 15px;
}

.profile-story-rail-head > div,
.profile-story-item-copy,
.profile-story-viewer-head > div:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.profile-story-rail-head small,
.profile-story-item small,
.profile-story-viewer-head small,
.profile-story-empty small {
  color: var(--muted, #85818f);
}

.profile-story-add-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  font-weight: 750;
  cursor: pointer;
}

.profile-story-add-button .material-symbols-rounded {
  font-size: 19px;
}

.profile-story-rail.is-guest .profile-story-add-button {
  opacity: 0.55;
}

.profile-story-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 5px 5px 8px;
  scrollbar-width: thin;
}

.profile-story-item {
  display: flex;
  flex: 0 0 clamp(220px, 30%, 280px);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border, rgba(127, 127, 127, 0.2));
  border-radius: 16px;
  color: inherit;
  text-align: left;
  background: color-mix(in srgb, var(--surface, #fff) 88%, #8b5cf6 12%);
  cursor: pointer;
}

.profile-story-item:hover,
.profile-story-item:focus-visible {
  border-color: #8b5cf6;
  transform: translateY(-1px);
}

.profile-story-item.is-viewed {
  background: var(--surface, #fff);
}

.profile-story-item-avatar {
  display: grid;
  place-items: center;
  padding: 4px;
}

.profile-story-item .avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.profile-story-item-copy strong,
.profile-story-item-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-story-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  color: var(--muted, #85818f);
}

.profile-story-empty > span:last-child {
  display: grid;
  gap: 2px;
}

.profile-story-backdrop {
  padding: 18px;
  background: rgba(6, 5, 10, 0.92);
}

.profile-story-viewer {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  height: min(820px, calc(100dvh - 36px));
  margin: auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  color: #fff;
  background: #0d0b12;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

.profile-story-progress {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 14px;
  right: 14px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.profile-story-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left;
  background: #fff;
}

@keyframes profile-story-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.profile-story-viewer-head {
  position: absolute;
  z-index: 3;
  top: 23px;
  left: 16px;
  right: 12px;
  padding: 8px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.12));
}

.profile-story-viewer-head .avatar {
  width: 40px;
  height: 40px;
}

.profile-story-viewer-head > div:nth-child(2) {
  flex: 1;
}

.profile-story-viewer-head small {
  color: rgba(255, 255, 255, 0.74);
}

.profile-story-delete {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.42);
  cursor: pointer;
}

.profile-story-delete[hidden] {
  display: none;
}

.profile-story-delete .material-symbols-rounded {
  font-size: 18px;
}

.story-composer-modal {
  width: min(520px, calc(100% - 28px));
  max-height: min(760px, calc(100dvh - 28px));
  overflow-y: auto;
}

.story-composer-form,
.story-composer-text-field {
  display: grid;
  gap: 10px;
}

.story-composer-form {
  margin-top: 18px;
}

.story-composer-preview {
  position: relative;
  display: grid;
  min-height: 300px;
  overflow: hidden;
  place-items: center;
  padding: 32px;
  border: 1px solid color-mix(in srgb, var(--violet) 45%, var(--line));
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(145deg, #5b21b6, #7c3aed 48%, #2563eb);
}

.story-composer-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-composer-preview p {
  position: relative;
  z-index: 1;
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: pre-wrap;
}

.story-composer-preview.has-image {
  align-items: end;
  padding: 90px 24px 24px;
}

.story-composer-preview.has-image::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 35% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
}

.story-composer-preview.has-image p {
  font-size: clamp(1rem, 3vw, 1.35rem);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}

.story-composer-text-field textarea {
  width: 100%;
  min-height: 104px;
  padding: 13px 14px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  outline: 0;
  resize: none;
  scrollbar-width: thin;
  color: var(--ink);
  background: var(--surface-2);
  line-height: 1.45;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.story-composer-text-field textarea::placeholder {
  color: var(--placeholder);
}

.story-composer-text-field textarea:hover {
  border-color: color-mix(in srgb, var(--violet) 65%, var(--stroke));
}

.story-composer-text-field textarea:focus,
.story-composer-text-field textarea:focus-visible {
  border-color: var(--violet);
  box-shadow: 4px 4px 0 var(--stroke);
  transform: translate(-1px, -1px);
}

.story-composer-text-field small,
.story-composer-media-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.story-composer-text-field small {
  justify-content: space-between;
  color: var(--muted);
}

.story-composer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.story-composer-media-actions {
  min-width: 0;
}

.story-composer-image-button {
  min-width: 0;
  cursor: pointer;
}

.story-composer-image-button [data-story-image-action-label] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-composer-remove-image {
  flex: 0 0 42px;
  width: 42px;
  min-width: 42px;
  height: 42px;
  color: var(--on-accent);
  background: var(--coral);
}

.story-composer-remove-image[hidden] {
  display: none;
}

.story-composer-actions .primary-button {
  margin-left: 0;
  white-space: nowrap;
}

.profile-story-close {
  position: static;
  flex: 0 0 42px;
  color: #fff;
  background: rgba(0, 0, 0, 0.42);
}

.profile-story-media-frame {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  overflow: hidden;
  place-items: center;
  background: #09080c;
}

.profile-story-media-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-story-media-frame img[hidden] {
  display: none;
}

.profile-story-media-frame.is-text-only {
  padding: 112px 38px 48px;
  background: linear-gradient(145deg, #5b21b6, #7c3aed 48%, #2563eb);
}

.profile-story-media-frame p {
  z-index: 1;
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  color: #fff;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  white-space: pre-wrap;
}

.profile-story-media-frame.is-text-only p {
  max-height: 100%;
  overflow-y: auto;
  font-size: clamp(1.65rem, 6vw, 2.75rem);
}

.profile-story-media-frame.has-image p {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 90px 30px 34px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  font-size: clamp(1.05rem, 3.5vw, 1.5rem);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

.profile-story-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: 42px;
  height: 54px;
  place-items: center;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: rgba(0, 0, 0, 0.38);
  transform: translateY(-50%);
  cursor: pointer;
}

.profile-story-nav-previous { left: 10px; }
.profile-story-nav-next { right: 10px; }
.profile-story-nav[hidden] { display: none; }

@media (max-width: 620px) {
  .profile-story-rail { padding: 14px; border-radius: 18px; }
  .profile-story-rail-head small { display: none; }
  .profile-story-add-button {
    position: relative;
    justify-content: center;
    width: 54px;
    gap: 0;
    padding: 0 11px;
    font-size: 0;
  }
  .profile-story-add-button .material-symbols-rounded {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 21px;
    transform: translate(-50%, -50%);
  }
  .profile-story-item { flex-basis: 78px; display: grid; justify-items: center; padding: 9px 6px; }
  .profile-story-item-copy { width: 100%; text-align: center; }
  .profile-story-item-copy small { display: none; }
  .profile-story-backdrop { padding: 0; }
  .profile-story-viewer { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .profile-story-delete { font-size: 0; }
  .profile-story-delete .material-symbols-rounded { font-size: 20px; }
  .story-composer-modal { width: 100%; max-height: 100dvh; border-radius: 0; }
  .story-composer-preview { min-height: 260px; }
  .story-composer-actions { grid-template-columns: 1fr; }
  .story-composer-actions .primary-button { width: 100%; }
}

/* Detail pages: profile, room and article */
#profile .profile-layout,
#room-detail .room-detail-page,
#article .article-layout {
  width: min(100%, 1180px);
  max-width: 1180px;
  margin-inline: auto;
}

#profile .article-back,
#room-detail .article-back,
#article .article-back {
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--paper);
  font-size: 0.92rem;
  font-weight: 800;
}

#profile .article-back:hover,
#room-detail .article-back:hover,
#article .article-back:hover {
  border-color: var(--violet);
  color: var(--ink);
  background: var(--paper-2);
  transform: translateY(-1px);
}

#profile .article-back,
#room-detail .article-back,
#article .article-back {
  width: max-content;
  margin-bottom: 0;
}

/* Profile detail */
#profile .profile-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

#profile .profile-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

#profile .profile-hero {
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: none;
}

#profile .profile-banner {
  min-height: 230px;
  border-bottom: 1px solid var(--line);
}

#profile .profile-identity {
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 18px;
  padding: 20px 22px 18px;
}

#profile .profile-avatar {
  width: 108px;
  height: 108px;
  margin-top: -60px;
  border-width: 5px;
  border-color: var(--paper);
  box-shadow: 0 0 0 2px var(--line);
}

#profile .profile-title-row {
  gap: 8px;
}

#profile .profile-title-row h1 {
  font-size: clamp(1.75rem, 3vw, 2.6rem);
  line-height: 1.05;
}

#profile .profile-handle,
#profile .profile-presence {
  font-size: 0.94rem;
}

#profile .profile-summary {
  max-width: 700px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.55;
}

#profile .profile-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

#profile .profile-actions button {
  min-height: 42px;
  border-radius: 9px;
}

#profile .profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 22px 20px;
  border-top: 0;
  background: var(--paper);
}

#profile .profile-stats > div {
  min-width: 0;
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-2);
  text-align: left;
}

#profile .profile-stats > div + div {
  border-left: 1px solid var(--line);
}

#profile .profile-stats strong {
  font-size: 1.18rem;
}

#profile .profile-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

#profile .profile-tabs button {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  font-size: 0.95rem;
}

#profile .profile-tabs button.is-selected {
  color: #fff;
  background: var(--violet);
}

#profile .profile-posts {
  display: grid;
  gap: 10px;
}

#profile .profile-post-card,
#profile .profile-empty {
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: none;
}

#profile .profile-post-card {
  min-height: 176px;
  padding: 18px;
  overflow: hidden;
}

#profile .profile-post-card:hover {
  border-color: color-mix(in srgb, var(--violet) 60%, var(--line));
  transform: translateY(-1px);
}

#profile .profile-post-card h3 {
  font-size: 1.2rem;
  line-height: 1.25;
}

#profile .profile-post-card p {
  font-size: 0.98rem;
  line-height: 1.55;
}

#profile .profile-post-card .thumbnail {
  width: 168px;
  max-width: 100%;
  min-height: 138px;
  border-radius: 9px;
}

#profile .profile-post-card .thumbnail img {
  max-width: 100%;
}

#profile .profile-rail {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 10px;
  margin-top: 58px;
}

#profile .profile-rail > .panel {
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: none;
}

#profile .profile-rail > .panel h2 {
  margin-bottom: 12px;
  font-size: 1.08rem;
}

#profile .profile-rail > .panel p,
#profile .profile-rail > .panel li {
  font-size: 0.94rem;
  line-height: 1.5;
}

/* Room detail */
#room-detail .room-detail-page {
  display: grid;
  gap: 14px;
  padding: 0;
}

#room-detail .room-detail-shell {
  gap: 14px;
}

#room-detail .room-detail-hero {
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 20px;
  min-height: 0;
  padding: 26px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 94% 10%, color-mix(in srgb, var(--violet) 20%, transparent), transparent 34%),
    var(--paper);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  box-shadow: none;
}

#room-detail .room-detail-badge {
  width: 104px;
  height: 104px;
  border-radius: 18px;
  box-shadow: 0 0 0 2px var(--line);
}

#room-detail .room-detail-hero > div:nth-child(2) h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.02;
}

#room-detail .room-detail-hero > div:nth-child(2) > p {
  max-width: 740px;
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 1.04rem;
  line-height: 1.55;
}

#room-detail .room-detail-meta {
  gap: 7px;
  margin-top: 15px;
}

#room-detail .room-detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  font-size: 0.88rem;
}

#room-detail .room-detail-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

#room-detail .room-detail-actions button {
  min-height: 44px;
  border-radius: 9px;
}

#room-detail .room-detail-grid {
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 14px;
  align-items: start;
}

#room-detail .room-detail-main {
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: none;
}

#room-detail .room-detail-section-head h2 {
  font-size: clamp(1.45rem, 2.5vw, 2rem);
}

#room-detail .room-detail-section-head p {
  max-width: 680px;
  font-size: 0.98rem;
  line-height: 1.5;
}

#room-detail .room-detail-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 17px 0 12px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
}

#room-detail .room-detail-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  font-size: 0.94rem;
}

#room-detail .room-detail-tabs button.is-selected {
  color: #fff;
  background: var(--violet);
}

#room-detail .room-detail-posts {
  gap: 9px;
}

#room-detail .room-detail-post-card {
  min-height: 144px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  box-shadow: none;
}

#room-detail .room-detail-post-card:hover {
  border-color: color-mix(in srgb, var(--violet) 60%, var(--line));
  background: var(--paper);
  transform: translateY(-1px);
}

#room-detail .room-detail-post-card h3 {
  font-size: 1.15rem;
  line-height: 1.25;
}

#room-detail .room-detail-post-card p {
  font-size: 0.96rem;
  line-height: 1.5;
}

#room-detail .room-detail-post-thumb {
  width: 150px;
  min-height: 116px;
  border-radius: 8px;
}

#room-detail .room-detail-rail {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 10px;
}

#room-detail .room-detail-rail > .panel {
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: none;
}

#room-detail .room-detail-rail > .panel h2 {
  margin-bottom: 12px;
  font-size: 1.08rem;
}

#room-detail .room-detail-about {
  gap: 6px;
}

#room-detail .room-detail-about > div {
  grid-template-columns: minmax(80px, 0.75fr) minmax(0, 1.25fr);
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
}

#room-detail .room-detail-about > div strong {
  overflow-wrap: anywhere;
  text-align: right;
}

/* Article detail */
#article .article-layout {
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 14px;
  align-items: start;
}

#article .article-reader {
  display: grid;
  gap: 14px;
  min-width: 0;
}

#article .article-header,
#article .article-cover,
#article .article-body {
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: none;
}

#article .article-header {
  padding: clamp(26px, 5vw, 50px);
}

#article .writer-row {
  margin-bottom: 22px;
}

#article .writer-row .avatar {
  width: 50px;
  height: 50px;
}

#article .article-header h1 {
  max-width: 900px;
  margin-top: 18px;
  font-size: clamp(2.35rem, 6vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

#article .article-header > p,
#article .article-header .article-lead {
  max-width: 780px;
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  line-height: 1.55;
}

#article .article-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 7px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

#article .article-actions button {
  min-height: 44px;
  border-width: 1px;
  border-radius: 9px;
}

#article .article-cover {
  overflow: hidden;
  min-height: 280px;
  padding: 0;
}

#article .article-cover-mark,
#article .article-cover-mark.has-image {
  width: 100%;
  max-width: none;
  min-height: 280px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#article .article-cover-mark img {
  width: 100%;
  max-height: 650px;
  object-fit: cover;
}

#article .article-body {
  padding: clamp(28px, 6vw, 64px);
}

#article .article-body > :is(p, h2, h3, h4, ul, ol, blockquote) {
  max-width: 780px;
  margin-inline: auto;
}

#article .article-body p,
#article .article-body li {
  font-size: clamp(1.03rem, 1.6vw, 1.16rem);
  line-height: 1.75;
}

#article .article-body h2 {
  margin-top: 2em;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.15;
}

#article .article-body h3 {
  margin-top: 1.7em;
  font-size: clamp(1.3rem, 2vw, 1.65rem);
}

#article .article-rail {
  position: sticky;
  top: 86px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

#article .article-rail > .panel {
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: none;
}

#article .article-rail h2 {
  margin-bottom: 12px;
  font-size: 1.08rem;
}

#article .article-rail > .panel p {
  font-size: 0.92rem;
  line-height: 1.5;
}

@media (max-width: 1080px) {
  #profile .profile-layout,
  #room-detail .room-detail-grid,
  #article .article-layout {
    grid-template-columns: 1fr;
  }

  #profile .profile-rail,
  #room-detail .room-detail-rail,
  #article .article-rail {
    position: static;
    margin-top: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #profile .profile-banner { min-height: 170px; }

  #profile .profile-identity {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 18px;
  }

  #profile .profile-avatar {
    width: 92px;
    height: 92px;
    margin-top: -56px;
  }

  #profile .profile-actions { grid-column: 1; }
  #profile .profile-stats { padding: 0 18px 18px; }
  #profile .profile-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  #profile .profile-post-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  #profile .profile-post-card .thumbnail {
    width: 100%;
    min-height: 210px;
  }

  #profile .profile-rail,
  #room-detail .room-detail-rail,
  #article .article-rail {
    grid-template-columns: 1fr;
  }

  #room-detail .room-detail-hero {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  #room-detail .room-detail-badge {
    width: 86px;
    height: 86px;
  }

  #room-detail .room-detail-actions { grid-column: 1; }
  #room-detail .room-detail-main { padding: 15px; }

  #room-detail .room-detail-post-card {
    grid-template-columns: 1fr;
  }

  #room-detail .room-detail-post-thumb {
    width: 100%;
    min-height: 200px;
  }

  #article .article-header { padding: 24px 20px; }

  #article .article-header h1 {
    font-size: clamp(2.15rem, 12vw, 3.4rem);
  }

  #article .article-body { padding: 30px 20px; }
  #article .article-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 460px) {
  #profile .profile-stats { grid-template-columns: 1fr; }
  #room-detail .room-detail-tabs { grid-template-columns: 1fr; }
  #room-detail .room-detail-about > div { grid-template-columns: 1fr; }
  #room-detail .room-detail-about > div strong { text-align: left; }
  #article .article-actions { grid-template-columns: 1fr; }
}

/* Remaining app views: messages, editor, forms, account and administration */
#messages .messages-layout,
#social-detail .social-detail-layout,
#write .writer-layout,
#account .account-page,
#admin .admin-page,
#room-create .room-create-page,
#room-edit .room-edit-page,
#bookmark-collection-create .room-create-page {
  width: min(100%, 1180px);
  max-width: 1180px;
  margin-inline: auto;
}

/* Post detail */
#social-detail .social-detail-layout {
  display: grid;
  gap: 12px;
  max-width: 880px;
}

#social-detail .social-detail-back {
  width: max-content;
  min-height: 44px;
  margin: 0;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--paper);
  font-size: 0.92rem;
  font-weight: 800;
}

#social-detail .social-detail-post {
  overflow: hidden;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: none;
}

#social-detail .social-detail-author,
#social-detail .social-detail-body,
#social-detail .social-detail-post > .social-post-gallery,
#social-detail .social-detail-post > .social-poll,
#social-detail .social-detail-actions {
  width: auto;
  margin-inline: clamp(18px, 5vw, 46px);
}

#social-detail .social-detail-author {
  padding-top: clamp(22px, 4vw, 38px);
}

#social-detail .social-detail-author .avatar {
  width: 52px;
  height: 52px;
}

#social-detail .social-detail-author h1 {
  font-size: 1.1rem;
}

#social-detail .social-detail-body {
  padding-block: 24px;
  color: var(--ink-soft);
  font-size: clamp(1.08rem, 2vw, 1.22rem);
  line-height: 1.7;
}

#social-detail .social-detail-image,
#social-detail .social-post-gallery img {
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: none;
}

#social-detail .social-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 16px 0 clamp(22px, 4vw, 38px);
  border-top: 1px solid var(--line);
}

#social-detail .social-detail-actions button,
#social-detail .social-detail-actions > span {
  justify-content: center;
  min-width: 44px;
  min-height: 42px;
  padding: 7px 9px;
  border-width: 1px;
  border-radius: 9px;
  background: var(--paper-2);
}

#social-detail .social-detail-actions .material-symbols-rounded {
  font-size: 21px;
}

#social-detail .social-detail-actions [data-social-like].is-active {
  color: var(--on-primary);
  background: var(--red);
  border-color: var(--stroke);
}

/* Messenger */
#messages .messages-layout {
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 12px;
  height: min(780px, calc(100dvh - 124px));
  min-height: 590px;
}

#messages .inbox-panel,
#messages .chat-panel {
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: none;
}

#messages .inbox-panel {
  padding: 0;
}

#messages .messages-heading {
  min-height: 72px;
  padding: 16px 18px 10px;
}

#messages .messages-heading h1 {
  font-size: 1.75rem;
  line-height: 1;
}

#messages .messages-heading .icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
}

#messages .message-search {
  min-height: 46px;
  margin: 0 12px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
}

#messages .message-search:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--violet) 18%, transparent);
}

#messages .conversation-list {
  gap: 4px;
  padding: 4px 8px 12px;
}

#messages .conversation-item {
  min-height: 70px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
}

#messages .conversation-item:hover,
#messages .conversation-item:focus-visible {
  border-color: var(--line);
  background: var(--paper-2);
}

#messages .conversation-item.is-active {
  border-color: color-mix(in srgb, var(--violet) 55%, var(--line));
  color: var(--ink);
  background: color-mix(in srgb, var(--violet) 14%, var(--paper-2));
}

#messages .conversation-item .avatar {
  width: 46px;
  height: 46px;
}

#messages .chat-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

#messages .chat-header {
  min-height: 72px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

#messages .chat-person .avatar {
  width: 46px;
  height: 46px;
}

#messages .chat-person h2 {
  font-size: 1.12rem;
}

#messages .message-thread {
  padding: 20px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--violet) 8%, transparent), transparent 34%),
    var(--paper-2);
}

#messages .message-composer {
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

#messages .message-input-shell {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper-2);
}

#messages .message-composer textarea {
  min-height: 44px;
  font-size: 1rem;
}

#messages .message-composer > button,
#messages .message-image-button {
  width: 46px;
  height: 46px;
  border-width: 1px;
  border-radius: 11px;
  box-shadow: none;
}

/* Writer */
#write .writer-layout {
  gap: 12px;
}

#write .writer-toolbar {
  min-height: 76px;
  padding: 14px 18px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: none;
}

#write .writer-toolbar h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

#write .toolbar-actions {
  gap: 8px;
}

#write .toolbar-actions button {
  min-height: 44px;
  border-radius: 9px;
}

#write .writing-grid {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
}

#write .editor-shell {
  min-height: 720px;
  padding: clamp(20px, 4vw, 42px);
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

#write .compose-status {
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.88rem;
}

#write .article-room-select-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
}

#write .article-room-select-button:hover,
#write .article-room-select-button:focus-visible {
  border-color: var(--stroke);
}

#write .article-room-select-button.is-selected {
  border-color: var(--violet);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--violet) 45%, transparent);
}

#write .article-room-select-button > .material-symbols-rounded:first-child {
  color: var(--violet);
}

#write .article-room-select-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

#write .article-room-select-copy small,
#write .article-room-select-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#write .article-room-select-copy small {
  color: var(--muted);
  font-weight: 800;
}

#write .article-room-select-copy strong {
  font-weight: 1000;
}

#write .title-field textarea {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(2.2rem, 7vw, 4.5rem);
}

#write .excerpt-field textarea {
  min-height: 100px;
  border-width: 1px;
  border-radius: 10px;
  background: var(--paper-2);
}

#write .compose-meta span {
  border-width: 1px;
  border-radius: 8px;
}

#write .compose-toolbar {
  top: 80px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  box-shadow: none;
}

#write .compose-toolbar button {
  border: 0;
  border-radius: 7px;
  background: var(--paper-2);
}

#write .smart-composer {
  min-height: 390px;
  padding-top: 16px;
  font-size: 1.08rem;
  line-height: 1.75;
}

#write .writing-rail {
  top: 86px;
  gap: 10px;
}

#write .writing-rail > .panel {
  padding: 17px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: none;
}

#write .setting-options {
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-2);
}

#write .setting-options button,
#write .select-row {
  min-height: 40px;
  border-width: 1px;
  border-radius: 7px;
}

/* Room, collection and management forms */
#room-create .room-create-page,
#room-edit .room-edit-page,
#bookmark-collection-create .room-create-page {
  display: grid;
  gap: 12px;
}

#room-create .article-back,
#room-edit .article-back,
#bookmark-collection-create .article-back {
  width: max-content;
  min-height: 44px;
  margin: 0;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}

#room-create .room-create-full,
#room-edit .room-edit-full,
#bookmark-collection-create .room-create-full {
  gap: 12px;
}

#room-create .room-create-hero,
#bookmark-collection-create .room-create-hero,
#room-edit .room-edit-hero {
  padding: clamp(24px, 4vw, 42px);
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: none;
}

#room-create .room-create-hero,
#bookmark-collection-create .room-create-hero {
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--violet) 17%, transparent), transparent 38%),
    var(--paper);
}

#room-create .room-create-hero h1,
#bookmark-collection-create .room-create-hero h1 {
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.02;
}

#room-create .room-create-hero .primary-button,
#bookmark-collection-create .room-create-hero .primary-button {
  flex: 0 0 auto;
  min-height: 46px;
  border-radius: 10px;
}

#room-create .room-create-grid,
#room-edit .room-create-grid,
#bookmark-collection-create .room-create-grid {
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 12px;
}

#room-create .room-create-main,
#room-edit .room-create-main,
#bookmark-collection-create .room-create-main,
#room-create .room-option-group,
#room-edit .room-option-group,
#room-create .room-member-picker,
#room-edit .room-member-picker,
#bookmark-collection-create .room-create-side > .panel {
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: none;
}

#room-create .room-create-main input,
#room-create .room-create-main textarea,
#room-edit .room-create-main input,
#room-edit .room-create-main textarea,
#bookmark-collection-create .room-create-main input,
#bookmark-collection-create .room-create-main textarea {
  min-height: 46px;
  border-width: 1px;
  border-radius: 9px;
  background: var(--paper-2);
  font-size: 1rem;
}

#room-create .room-create-main textarea,
#room-edit .room-create-main textarea,
#bookmark-collection-create .room-create-main textarea {
  min-height: 150px;
  resize: vertical;
}

#room-create .room-option-card,
#room-edit .room-option-card,
#room-create .room-member-row,
#room-edit .room-member-row {
  padding: 12px;
  border-width: 1px;
  border-radius: 9px;
  background: var(--paper-2);
}

#room-create .room-option-card.is-selected,
#room-edit .room-option-card.is-selected {
  border-color: var(--violet);
  background: color-mix(in srgb, var(--violet) 13%, var(--paper-2));
}

#room-edit .room-edit-hero {
  min-height: 240px;
}

#room-edit .room-edit-icon {
  width: 100px;
  height: 100px;
  border-width: 2px;
  border-radius: 18px;
  box-shadow: none;
}

#room-edit .room-edit-upload-row .upload-button {
  min-height: 44px;
  border-width: 1px;
  border-radius: 9px;
}

#room-edit .room-edit-footer {
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: none;
}

/* Account */
#account .account-page {
  display: grid;
  gap: 12px;
  container-name: account-page;
  container-type: inline-size;
}

#account .account-page-hero {
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: none;
}

#account .account-banner-preview {
  min-height: 220px;
  border-bottom: 1px solid var(--line);
}

#account .account-page-identity {
  padding: 18px 22px 22px;
}

#account .account-page-identity .profile-avatar {
  width: 100px;
  height: 100px;
  margin-top: -58px;
  border: 5px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--line);
}

#account .account-page-identity h1 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

#account .account-settings-grid {
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
}

#account .account-settings-side {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

#account .account-settings-panel {
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: none;
}

#account .account-form {
  gap: 15px;
}

#account .account-form input:not([type="checkbox"]),
#account .account-form textarea,
#account .account-select-button {
  min-height: 46px;
  border-width: 1px;
  border-radius: 9px;
  background: var(--paper-2);
  font-size: 1rem;
}

#account .account-form .username-input {
  min-height: 46px;
  border-width: 1px;
  border-radius: 9px;
  background: var(--paper-2);
}

#account .account-form .username-input input {
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#account .account-form textarea {
  min-height: 132px;
  resize: vertical;
}

#account .account-avatar-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

#account .account-avatar-row .upload-button {
  width: 100%;
  min-height: 44px;
  border-width: 1px;
  border-radius: 9px;
}

#account .theme-option,
#account .linked-account-card,
#account .switch-row {
  border-width: 1px;
  border-radius: 9px;
  background: var(--paper-2);
}

#account .linked-account-card {
  padding: 13px;
}

#account .linked-account-actions button,
#account .linked-account-actions a,
#account .session-actions button {
  min-height: 42px;
  border-radius: 8px;
}

/* Administration */
#admin .admin-page {
  gap: 12px;
}

#admin .admin-hero {
  padding: clamp(24px, 4vw, 38px);
  border: 2px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--coral) 16%, transparent), transparent 38%),
    var(--paper);
  box-shadow: none;
}

#admin .admin-hero h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.02;
}

#admin .admin-hero p {
  max-width: 720px;
  font-size: 1rem;
  line-height: 1.55;
}

#admin .admin-search {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
}

#admin .admin-grid,
#admin .admin-workspace {
  gap: 12px;
}

#admin .admin-stats article,
#admin .admin-nav,
#admin .admin-column,
#admin .admin-context section,
#admin .admin-grid > .panel {
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: none;
}

#admin .admin-nav {
  padding: 6px;
}

#admin .admin-nav button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
}

#admin .admin-nav button.is-selected {
  color: #fff;
  background: var(--violet);
}

@media (max-width: 1080px) {
  #write .writing-grid,
  #account .account-settings-grid,
  #room-create .room-create-grid,
  #room-edit .room-create-grid,
  #bookmark-collection-create .room-create-grid {
    grid-template-columns: 1fr;
  }

  #write .writing-rail,
  #room-create .room-create-side,
  #room-edit .room-create-side {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #write .writing-rail > .panel:last-child {
    grid-column: 1 / -1;
  }

  #account .account-settings-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  #messages .messages-layout {
    grid-template-columns: 1fr;
    height: 100%;
    min-height: 0;
  }

  #messages .inbox-panel,
  #messages .chat-panel {
    grid-column: 1;
    grid-row: 1;
  }

  #messages .messages-layout:not(.is-chat-open) .chat-panel,
  #messages .messages-layout.is-chat-open .inbox-panel {
    display: none;
  }

  #social-detail .social-detail-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 6px;
  }

  #social-detail .social-detail-actions button,
  #social-detail .social-detail-actions > span {
    width: 100%;
    min-width: 0;
    padding-inline: 4px;
  }

  #write .writer-toolbar,
  #room-create .room-create-hero,
  #bookmark-collection-create .room-create-hero {
    align-items: stretch;
    flex-direction: column;
  }

  #write .toolbar-actions,
  #write .toolbar-actions button,
  #room-create .room-create-hero .primary-button,
  #bookmark-collection-create .room-create-hero .primary-button {
    width: 100%;
  }

  #write .toolbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #write .editor-shell { min-height: 620px; padding: 20px 16px; }
  #write .compose-toolbar { position: static; width: 100%; justify-content: center; }

  #write .writing-rail,
  #room-create .room-create-side,
  #room-edit .room-create-side,
  #account .account-settings-side {
    grid-template-columns: 1fr;
  }

  #write .writing-rail > .panel:last-child { grid-column: auto; }

  #room-edit .room-edit-hero-overlay {
    grid-template-columns: 1fr;
    align-items: start;
  }

  #room-edit .room-edit-upload-row { justify-content: stretch; }
  #room-edit .room-edit-upload-row .upload-button { flex: 1 1 150px; }

  #account .account-banner-preview { min-height: 170px; }
  #account .account-page-identity { padding-inline: 18px; }
  #account .account-avatar-row { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  #messages .message-thread { padding: 14px 10px; }
  #write .toolbar-actions { grid-template-columns: 1fr; }
  #room-create .room-create-hero,
  #bookmark-collection-create .room-create-hero,
  #admin .admin-hero { padding: 22px 18px; }
}

/* Keep the account layout responsive to its actual content width. The fixed
   desktop sidebar can make this area narrow while the viewport is still wide. */
@container account-page (max-width: 1040px) {
  #account .account-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #account .account-settings-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container account-page (max-width: 760px) {
  #account .account-settings-side {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container account-page (max-width: 620px) {
  #account .account-avatar-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Notifications: collision-free hero actions and high-contrast category glyphs. */
#notifications .notifications-hero {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

#notifications .notifications-hero-copy {
  width: 100%;
  max-width: 900px;
}

#notifications .notifications-hero h1 {
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
}

#notifications .notification-actions {
  width: min(100%, 540px);
  min-width: 0;
  justify-self: start;
}

#notifications .notification-actions .text-command {
  min-width: 0;
  white-space: normal;
}

#notifications .notification-type-icon,
#notifications .notification-icon,
#notifications .notification-feed-panel > .panel-title > .material-symbols-rounded,
#notifications .notification-rail .panel > .panel-title > .material-symbols-rounded,
#notifications .notification-empty > .material-symbols-rounded {
  color: #09080f !important;
}

#notifications .notification-type-icon > .material-symbols-rounded,
#notifications .notification-icon > .material-symbols-rounded {
  display: block;
  color: inherit !important;
  font-variation-settings: "FILL" 0, "wght" 700, "GRAD" 0, "opsz" 24;
}

@media (max-width: 620px) {
  #notifications .notifications-hero h1 {
    overflow-wrap: break-word;
    word-break: normal;
  }

  #notifications .notification-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

/* Keep the redesigned search above legacy responsive overrides. */
.search-overlay-body::-webkit-scrollbar {
  display: block;
  width: 7px;
}

@media (max-width: 780px) {
  .search-overlay {
    padding: 0;
    background: var(--paper);
    backdrop-filter: none;
  }

  .search-overlay-shell {
    width: 100%;
    height: 100dvh;
    gap: 12px;
    padding: 14px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .search-overlay-head {
    align-items: center;
    min-height: 46px;
  }

  .search-overlay-head h2 {
    font-size: clamp(1.45rem, 7vw, 2rem);
  }

  .search-overlay-form {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 6px;
    min-height: 54px;
    padding: 6px;
  }

  .search-overlay-form .primary-button {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 42px;
  }

  .search-overlay-grid,
  .search-top-panel {
    grid-template-columns: 1fr;
  }

  .search-top-panel > .search-section-head {
    grid-column: 1;
  }

  .search-result-overview {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .search-count-row {
    justify-content: flex-start;
  }
}

/* Cartoon surface restoration
   Keep the dense layouts from the view redesigns, but bring every major surface
   back into Boocord's drawn, inked visual language. */
:root {
  --toon-shadow-xs: 2px 2px 0 var(--stroke);
  --toon-shadow-sm: 4px 4px 0 var(--stroke);
  --toon-shadow-md: 6px 6px 0 var(--stroke);
  --toon-shadow-lg: 8px 8px 0 var(--stroke);
  --toon-corner: 14px 9px 13px 8px;
  --toon-corner-reverse: 9px 14px 8px 13px;
  --toon-paper-mark: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 7%, transparent) 0 1px, transparent 1.2px);
}

body::before {
  background:
    repeating-linear-gradient(102deg, transparent 0 48px, color-mix(in srgb, var(--ink) 2.5%, transparent) 49px 50px, transparent 51px 96px),
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 5%, transparent) 0 1px, transparent 1.2px),
    var(--page-bg);
  background-size: auto, 22px 22px, auto;
}

.topbar {
  border-bottom-width: 4px;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--stroke) 42%, transparent);
  backdrop-filter: none;
}

.app-sidebar {
  border-width: 3px;
  border-radius: 16px 9px 14px 8px;
  box-shadow: var(--toon-shadow-md);
  backdrop-filter: none;
}

.app-sidebar .nav-item,
.mobile-nav .nav-item {
  border-radius: 10px 6px 9px 7px;
}

.app-sidebar .nav-item.is-active,
.mobile-nav .nav-item.is-active {
  border-color: var(--stroke);
  box-shadow: var(--toon-shadow-xs);
  transform: translate(-1px, -1px);
}

/* Big page headers read as illustrated title cards, not glass panels. */
main :is(#pulse, #social, #saved, #discover, #profiles, #notifications, #settings, #progress, #admin, #room-create, #room-edit, #bookmark-collection-create, #room-detail) :is(
  .pulse-hero,
  .social-page-header,
  .saved-hero,
  .rooms-page-header,
  .profiles-page-header,
  .notifications-hero,
  .settings-hero,
  .progress-page-header,
  .admin-hero,
  .room-create-hero,
  .room-edit-hero,
  .room-detail-hero
) {
  border: 3px solid var(--stroke);
  border-radius: 20px 11px 18px 9px;
  box-shadow: var(--toon-shadow-lg);
}

main :is(#pulse, #social, #saved, #discover, #profiles, #notifications, #settings, #progress, #admin, #room-create, #room-edit, #bookmark-collection-create, #room-detail) :is(
  .pulse-hero,
  .social-page-header,
  .saved-hero,
  .rooms-page-header,
  .profiles-page-header,
  .notifications-hero,
  .settings-hero,
  .progress-page-header,
  .admin-hero,
  .room-create-hero,
  .room-edit-hero,
  .room-detail-hero
) h1 {
  letter-spacing: -0.035em;
  text-shadow: 2px 2px 0 color-mix(in srgb, var(--violet) 34%, transparent);
}

/* Primary content surfaces use a heavy ink contour and a physical offset. */
main :is(#pulse, #social, #saved, #discover, #profiles, #notifications, #settings, #progress, #profile, #room-detail, #article, #social-detail, #messages, #write, #room-create, #room-edit, #bookmark-collection-create, #account, #admin) :is(
  .panel,
  .pulse-feed-card,
  .social-composer,
  .social-post,
  .saved-card,
  .room-browser-card,
  .room-owned-browser-card,
  .profile-browser-card,
  .notification-feed-panel,
  .profile-hero,
  .profile-post-card,
  .profile-empty,
  .room-detail-main,
  .article-header,
  .article-cover,
  .article-body,
  .social-detail-post,
  .inbox-panel,
  .chat-panel,
  .writer-toolbar,
  .editor-shell,
  .room-create-main,
  .room-option-group,
  .room-member-picker,
  .room-edit-footer,
  .account-page-hero,
  .account-settings-panel,
  .admin-column,
  .admin-nav,
  .admin-context section,
  .admin-grid > .panel,
  .admin-stats article
) {
  border: 3px solid var(--stroke);
  border-radius: var(--toon-corner);
  box-shadow: var(--toon-shadow-md);
}

main :is(#pulse, #social, #saved, #discover, #profiles, #notifications, #settings, #progress, #profile, #room-detail, #article, #social-detail, #messages, #write, #room-create, #room-edit, #bookmark-collection-create, #account, #admin) :is(
  .pulse-feed-card,
  .social-post,
  .saved-card,
  .room-browser-card,
  .profile-browser-card,
  .notification-card,
  .profile-post-card,
  .room-detail-post-card,
  .theme-option,
  .room-option-card,
  .linked-account-card
) {
  background-image: var(--toon-paper-mark);
  background-size: 18px 18px;
}

main :is(#pulse, #social, #saved, #discover, #profiles, #notifications, #profile, #room-detail) :is(
  .pulse-feed-card,
  .social-post,
  .saved-card,
  .room-browser-card,
  .profile-browser-card,
  .notification-card,
  .profile-post-card,
  .room-detail-post-card
):nth-child(even) {
  border-radius: var(--toon-corner-reverse);
}

main :is(#pulse, #social, #saved, #discover, #profiles, #notifications, #profile, #room-detail) :is(
  .pulse-feed-card,
  .social-post,
  .saved-card,
  .room-browser-card,
  .profile-browser-card,
  .notification-card,
  .profile-post-card,
  .room-detail-post-card
):hover,
main :is(#pulse, #social, #saved, #discover, #profiles, #notifications, #profile, #room-detail) :is(
  .pulse-feed-card,
  .social-post,
  .saved-card,
  .room-browser-card,
  .profile-browser-card,
  .notification-card,
  .profile-post-card,
  .room-detail-post-card
):focus-visible {
  border-color: var(--stroke);
  box-shadow: var(--toon-shadow-lg);
  transform: translate(-2px, -2px);
}

/* Toolbars and secondary cards get a smaller, still visibly hand-inked lift. */
main :is(#pulse, #social, #saved, #discover, #profiles, #notifications, #settings, #profile, #room-detail, #article, #social-detail, #messages, #write, #room-create, #room-edit, #bookmark-collection-create, #account, #admin) :is(
  .topic-strip,
  .social-topic-bar,
  .saved-filters,
  .room-search-form,
  .room-browser-toolbar,
  .profile-explorer-toolbar,
  .profile-tabs,
  .room-detail-tabs,
  .notification-card,
  .notification-type-row,
  .notification-overview-summary > span,
  .profile-stats > div,
  .room-detail-post-card,
  .room-detail-about > div,
  .conversation-item,
  .message-search,
  .message-input-shell,
  .setting-options,
  .theme-option,
  .preference-sync-row,
  .room-option-card,
  .room-member-row,
  .linked-account-card,
  .switch-row,
  .draft-card,
  .modal-option-list button
) {
  border: 2px solid var(--stroke);
  border-radius: 11px 7px 10px 6px;
  box-shadow: var(--toon-shadow-xs);
}

main :is(#pulse, #social, #saved, #discover, #profiles, #notifications, #settings, #profile, #room-detail, #article, #social-detail, #messages, #write, #room-create, #room-edit, #bookmark-collection-create, #account, #admin) :is(
  .topic-strip,
  .social-topic-bar,
  .saved-filters,
  .room-search-form,
  .room-browser-toolbar,
  .profile-explorer-toolbar,
  .profile-tabs,
  .room-detail-tabs
) {
  background-color: var(--surface);
}

/* Sticker-like pictograms are one of the original visual anchors. */
main .panel-title > .material-symbols-rounded,
main :is(.social-composer-title, .room-detail-section-head) > .material-symbols-rounded,
main :is(.notification-icon, .notification-type-icon),
main :is(.room-badge, .profile-rank-badge),
.floating-header > .material-symbols-rounded {
  border: 2px solid var(--stroke);
  border-radius: 12px 7px 11px 6px;
  box-shadow: var(--toon-shadow-xs);
  transform: rotate(-2deg);
}

main :is(.panel-title, .social-composer-title) > .material-symbols-rounded:nth-child(even),
main :is(.notification-icon, .notification-type-icon):nth-child(even) {
  transform: rotate(2deg);
}

main .panel-title > .material-symbols-rounded {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  color: var(--on-accent);
  background: var(--gold);
  font-size: 22px;
}

main .panel:nth-child(3n + 2) > .panel-title > .material-symbols-rounded {
  background: var(--mint);
  transform: rotate(2deg);
}

main .panel:nth-child(3n) > .panel-title > .material-symbols-rounded {
  background: var(--coral);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
}

/* Controls should feel pressed and drawn instead of injection-moulded. */
:is(.primary-button, .secondary-button, .ghost-button, .text-command, .upload-button, .article-back, .collection-create-link, .progress-nav-button),
main :is(.topic, .profile-actions button, .room-detail-actions button, .article-actions button, .toolbar-actions button, .room-card-actions button, .profile-card-actions button, .notification-actions button, .admin-nav button) {
  border: 2px solid var(--stroke);
  border-radius: 10px 6px 9px 7px;
  box-shadow: var(--toon-shadow-sm);
}

:is(.primary-button, .secondary-button, .ghost-button, .text-command, .upload-button, .article-back, .collection-create-link, .progress-nav-button):hover,
main :is(.topic, .profile-actions button, .room-detail-actions button, .article-actions button, .toolbar-actions button, .room-card-actions button, .profile-card-actions button, .notification-actions button, .admin-nav button):hover {
  box-shadow: var(--toon-shadow-md);
  transform: translate(-2px, -2px);
}

:is(.primary-button, .secondary-button, .ghost-button, .text-command, .upload-button, .article-back, .collection-create-link, .progress-nav-button):active,
main :is(.topic, .profile-actions button, .room-detail-actions button, .article-actions button, .toolbar-actions button, .room-card-actions button, .profile-card-actions button, .notification-actions button, .admin-nav button):active {
  box-shadow: 1px 1px 0 var(--stroke);
  transform: translate(2px, 2px);
}

main :is(#social, #discover, #profiles, #settings, #messages, #write, #room-create, #room-edit, #bookmark-collection-create, #account, #admin) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
  textarea,
  select,
  .account-select-button,
  .username-input
) {
  border: 2px solid var(--stroke);
  border-radius: 10px 6px 9px 7px;
  background-color: var(--field-bg);
  box-shadow: inset 2px 2px 0 color-mix(in srgb, var(--stroke) 28%, transparent);
}

main :is(#social, #discover, #profiles, #settings, #messages, #write, #room-create, #room-edit, #bookmark-collection-create, #account, #admin) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
  textarea,
  select,
  .account-select-button,
  .username-input
):focus,
main :is(#social, #discover, #profiles, #settings, #messages, #write, #room-create, #room-edit, #bookmark-collection-create, #account, #admin) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
  textarea,
  select,
  .account-select-button,
  .username-input
):focus-within {
  border-color: var(--violet);
  box-shadow: 3px 3px 0 var(--stroke);
}

/* Media and chat retain their function while gaining a drawn frame. */
main :is(.pulse-feed-thumb, .thumbnail, .saved-art, .social-post-gallery, .room-detail-post-thumb, .article-cover, .room-edit-icon) {
  border: 3px solid var(--stroke);
  border-radius: 13px 8px 12px 7px;
  box-shadow: var(--toon-shadow-sm);
}

/* A single-image gallery is only a responsive layout wrapper. Its tile already
   follows the image's rendered dimensions and owns the visible frame. Framing
   the wrapper as well creates a second outline around unused horizontal space. */
main .social-post-gallery.social-post-gallery-1 {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#messages .message-bubble {
  border: 2px solid var(--stroke);
  border-radius: 12px 8px 11px 7px;
  box-shadow: var(--toon-shadow-sm);
}

#messages .message-bubble.incoming {
  border-top-left-radius: 2px;
}

#messages .message-bubble.outgoing {
  border-top-right-radius: 2px;
}

/* Floating UI uses the same inked material instead of glossy overlays. */
:is(.floating-panel, .search-overlay-shell, .auth-modal, .profile-story-rail, .profile-story-viewer, .story-composer-modal, .toast) {
  border: 3px solid var(--stroke);
  border-radius: 16px 9px 14px 8px;
  box-shadow: var(--toon-shadow-lg);
}

:is(.modal-option-list button, .modal-choice-grid button, .search-result-card, .search-empty-card, .floating-section button) {
  border: 2px solid var(--stroke);
  border-radius: 10px 6px 9px 7px;
  box-shadow: var(--toon-shadow-xs);
}

.profile-story-add-button,
.profile-story-delete,
.profile-story-nav,
.profile-story-close {
  border: 2px solid var(--stroke);
  box-shadow: var(--toon-shadow-sm);
}

/* Composite fields are one control. Only the outer shell carries ink and depth;
   the nested input/textarea must never render a second frame. */
:is(
  .search,
  .search-overlay-form,
  .message-search,
  .explore-search,
  .admin-search,
  .modal-search-field,
  .username-input,
  .message-input-shell
) {
  border: 2px solid var(--stroke);
  border-radius: 12px 8px 11px 7px;
  background: var(--field-bg);
  box-shadow: 3px 3px 0 var(--stroke);
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

:is(
  .search,
  .search-overlay-form,
  .message-search,
  .explore-search,
  .admin-search,
  .modal-search-field,
  .username-input,
  .message-input-shell
):focus-within {
  border-color: var(--violet);
  background: color-mix(in srgb, var(--field-bg) 92%, var(--violet) 8%);
  box-shadow: 4px 4px 0 var(--stroke);
}

:is(
  .search,
  .search-overlay-form,
  .message-search,
  .explore-search,
  .admin-search,
  .modal-search-field,
  .username-input,
  .message-input-shell
) :is(input, textarea) {
  width: 100%;
  min-width: 0;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

:is(
  .search,
  .search-overlay-form,
  .message-search,
  .explore-search,
  .admin-search,
  .modal-search-field,
  .username-input,
  .message-input-shell
) :is(input, textarea):is(:focus, :focus-visible) {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

:is(
  .search,
  .search-overlay-form,
  .message-search,
  .explore-search,
  .admin-search,
  .modal-search-field
) > .material-symbols-rounded {
  flex: 0 0 auto;
  color: var(--violet-light);
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* Segmented selectors are inked trays with sticker-like choices. */
:is(
  .pulse-filter-group,
  .saved-filters,
  .room-filter-switch,
  .profile-filter-switch,
  .profile-tabs,
  .room-detail-tabs,
  .setting-options,
  .report-reason-grid,
  .social-topic-bar,
  .admin-nav
) {
  gap: 7px;
  padding: 7px;
  overflow: visible;
  background-color: var(--paper-2);
  background-image: var(--toon-paper-mark);
  background-size: 18px 18px;
  border: 3px solid var(--stroke);
  border-radius: 14px 8px 13px 7px;
  box-shadow: var(--toon-shadow-sm);
}

:is(
  .pulse-filter-group,
  .saved-filters,
  .room-filter-switch,
  .profile-filter-switch,
  .profile-tabs,
  .room-detail-tabs,
  .setting-options,
  .report-reason-grid,
  .social-topic-bar,
  .admin-nav
) > button {
  min-height: 44px;
  color: var(--ink-soft);
  background: transparent;
  border: 2px solid transparent;
  border-radius: 10px 6px 9px 7px;
  box-shadow: none;
  font-weight: 900;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

:is(
  .pulse-filter-group,
  .saved-filters,
  .room-filter-switch,
  .profile-filter-switch,
  .profile-tabs,
  .room-detail-tabs,
  .setting-options,
  .report-reason-grid,
  .social-topic-bar,
  .admin-nav
) > button:nth-child(even) {
  border-radius: 7px 11px 6px 10px;
}

:is(
  .pulse-filter-group,
  .saved-filters,
  .room-filter-switch,
  .profile-filter-switch,
  .profile-tabs,
  .room-detail-tabs,
  .setting-options,
  .report-reason-grid,
  .social-topic-bar,
  .admin-nav
) > button:not(.is-active):not(.is-selected):hover,
:is(
  .pulse-filter-group,
  .saved-filters,
  .room-filter-switch,
  .profile-filter-switch,
  .profile-tabs,
  .room-detail-tabs,
  .setting-options,
  .report-reason-grid,
  .social-topic-bar,
  .admin-nav
) > button:not(.is-active):not(.is-selected):focus-visible {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--stroke);
  box-shadow: var(--toon-shadow-xs);
  transform: translate(-1px, -1px);
}

:is(
  .pulse-filter-group,
  .saved-filters,
  .room-filter-switch,
  .profile-filter-switch,
  .profile-tabs,
  .room-detail-tabs,
  .setting-options,
  .report-reason-grid,
  .social-topic-bar,
  .admin-nav
) > button:is(.is-active, .is-selected) {
  color: var(--on-primary);
  background: var(--violet);
  border-color: var(--stroke);
  box-shadow: 3px 3px 0 var(--stroke);
  transform: translate(-1px, -1px) rotate(-0.35deg);
}

:is(
  .pulse-filter-group,
  .saved-filters,
  .room-filter-switch,
  .profile-filter-switch,
  .profile-tabs,
  .room-detail-tabs,
  .setting-options,
  .report-reason-grid,
  .social-topic-bar,
  .admin-nav
) > button:nth-child(even):is(.is-active, .is-selected) {
  transform: translate(-1px, -1px) rotate(0.35deg);
}

:is(
  .pulse-filter-group,
  .saved-filters,
  .room-filter-switch,
  .profile-filter-switch,
  .profile-tabs,
  .room-detail-tabs,
  .setting-options,
  .report-reason-grid,
  .social-topic-bar,
  .admin-nav
) > button:is(.is-active, .is-selected):active {
  box-shadow: 1px 1px 0 var(--stroke);
  transform: translate(1px, 1px) rotate(0);
}

:is(.room-filter-switch, .profile-filter-switch, .admin-nav) > button > .material-symbols-rounded {
  color: currentColor;
  font-variation-settings: "FILL" 0, "wght" 700, "GRAD" 0, "opsz" 24;
  transform: rotate(-3deg);
}

:is(.room-filter-switch, .profile-filter-switch, .admin-nav) > button:nth-child(even) > .material-symbols-rounded {
  transform: rotate(3deg);
}

:is(.room-filter-switch, .profile-filter-switch, .admin-nav) > button > strong,
.pulse-filter-group > button > small,
.saved-filters > button > :is(small, strong, span:last-child) {
  display: inline-grid;
  min-width: 27px;
  min-height: 27px;
  padding: 3px 6px;
  place-items: center;
  color: currentColor;
  background: color-mix(in srgb, currentColor 10%, transparent);
  border: 2px solid currentColor;
  border-radius: 48% 52% 44% 56%;
  font-size: 0.76rem;
  line-height: 1;
}

/* View-specific redesign rules above use IDs; this final scoped layer keeps the
   illustrated selector treatment authoritative in every rendered view. */
main :is(#pulse, #saved, #discover, #profiles, #profile, #room-detail, #write, #social, #admin) :is(
  .pulse-filter-group,
  .saved-filters,
  .room-filter-switch,
  .profile-filter-switch,
  .profile-tabs,
  .room-detail-tabs,
  .setting-options,
  .social-topic-bar,
  .admin-nav
) {
  gap: 7px;
  padding: 7px;
  background-color: var(--paper-2);
  background-image: var(--toon-paper-mark);
  background-size: 18px 18px;
  border: 3px solid var(--stroke);
  border-radius: 14px 8px 13px 7px;
  box-shadow: var(--toon-shadow-sm);
}

main :is(#pulse, #saved, #discover, #profiles, #profile, #room-detail, #write, #social, #admin) :is(
  .pulse-filter-group,
  .saved-filters,
  .room-filter-switch,
  .profile-filter-switch,
  .profile-tabs,
  .room-detail-tabs,
  .setting-options,
  .social-topic-bar,
  .admin-nav
) > button:not([data-cartoon-selector-never]) {
  min-height: 44px;
  color: var(--ink-soft);
  background: transparent;
  border: 2px solid transparent;
  border-radius: 10px 6px 9px 7px;
  box-shadow: none;
  transform: none;
}

main :is(#pulse, #saved, #discover, #profiles, #profile, #room-detail, #write, #social, #admin) :is(
  .pulse-filter-group,
  .saved-filters,
  .room-filter-switch,
  .profile-filter-switch,
  .profile-tabs,
  .room-detail-tabs,
  .setting-options,
  .social-topic-bar,
  .admin-nav
) > button:not([data-cartoon-selector-never]):is(.is-active, .is-selected) {
  color: var(--on-primary);
  background: var(--violet);
  border-color: var(--stroke);
  box-shadow: 3px 3px 0 var(--stroke);
  transform: translate(-1px, -1px) rotate(-0.35deg);
}

main :is(#pulse, #saved, #discover, #profiles, #profile, #room-detail, #write, #social, #admin) :is(
  .room-filter-switch,
  .profile-filter-switch,
  .admin-nav
) > button:not([data-cartoon-selector-never]) > strong,
main #pulse .pulse-filter-group > button.topic > small,
main #saved .saved-filters > button.topic > :is(small, strong, span:last-child) {
  display: inline-grid;
  min-width: 27px;
  min-height: 27px;
  padding: 3px 6px;
  place-items: center;
  color: currentColor;
  background: color-mix(in srgb, currentColor 10%, transparent);
  border: 2px solid currentColor;
  border-radius: 48% 52% 44% 56%;
  font-size: 0.76rem;
  line-height: 1;
}

/* Metric groups are illustrated info cards, not rows of glossy pills. */
:is(
  #profiles .profile-browser-stats,
  #discover .room-browser-facts,
  #profile .profile-stats,
  .room-summary,
  .notification-overview-summary,
  #admin .admin-stats
) {
  gap: 10px;
  padding: 1px 4px 4px 1px;
  overflow: clip;
}

#profiles .profile-browser-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

:is(
  #profiles .profile-browser-stats > span,
  #discover .room-browser-facts > span,
  #profile .profile-stats > div,
  .room-summary > div,
  .notification-overview-summary > span,
  #admin .admin-stats > article
) {
  position: relative;
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  color: var(--ink-soft);
  background-color: var(--surface);
  background-image: var(--toon-paper-mark);
  background-size: 16px 16px;
  border: 2px solid var(--stroke);
  border-radius: 13px 7px 11px 6px;
  box-shadow: 3px 3px 0 var(--stroke);
  font-weight: 900;
}

:is(
  #profiles .profile-browser-stats > span,
  #discover .room-browser-facts > span
) {
  display: grid;
  grid-template-columns: 34px minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: 5px;
  overflow: visible;
  white-space: normal;
  text-align: left;
}

:is(
  #profiles .profile-browser-stats > span,
  #discover .room-browser-facts > span,
  #profile .profile-stats > div,
  .room-summary > div,
  .notification-overview-summary > span,
  #admin .admin-stats > article
):nth-child(even) {
  border-radius: 7px 13px 6px 11px;
}

:is(
  #profiles .profile-browser-stats > span,
  #discover .room-browser-facts > span,
  #profile .profile-stats > div,
  .room-summary > div,
  .notification-overview-summary > span,
  #admin .admin-stats > article
):nth-child(3n) {
  border-radius: 10px 6px 14px 8px;
}

:is(
  #profiles .profile-browser-stats > span,
  #discover .room-browser-facts > span
) > :is(.material-symbols-rounded, .orb-icon) {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 5px;
  place-items: center;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: 10px 5px 9px 6px;
  box-shadow: 2px 2px 0 var(--stroke);
  font-size: 19px;
  object-fit: contain;
  transform: rotate(-4deg);
}

:is(
  #profiles .profile-browser-stats > span,
  #discover .room-browser-facts > span
):nth-child(2) > :is(.material-symbols-rounded, .orb-icon) {
  color: var(--on-primary);
  background: var(--violet);
  transform: rotate(4deg);
}

:is(
  #profiles .profile-browser-stats > span,
  #discover .room-browser-facts > span
):nth-child(3) > :is(.material-symbols-rounded, .orb-icon) {
  background: var(--mint);
  transform: rotate(-2deg);
}

:is(
  #profiles .profile-browser-stats > span,
  #discover .room-browser-facts > span
):nth-child(4) > :is(.material-symbols-rounded, .orb-icon) {
  background: var(--coral);
  transform: rotate(3deg);
}

:is(
  #profiles .profile-browser-stats > span,
  #discover .room-browser-facts > span
) > strong {
  color: var(--ink);
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: 0.98rem;
  line-height: 1;
}

#profile .profile-stats > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
  text-align: left;
}

#profile .profile-stats > div + div {
  border-left: 2px solid var(--stroke);
}

#profile .profile-stats > div > strong {
  color: var(--ink);
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: 1.35rem;
}

#profile .profile-stats > div > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 1000;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  #profiles .profile-browser-stats,
  #discover .room-browser-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  :is(
    #profiles .profile-browser-stats > span,
    #discover .room-browser-facts > span
  ) {
    min-height: 54px;
  }
}

@media (max-width: 380px) {
  #profiles .profile-browser-stats,
  #discover .room-browser-facts {
    grid-template-columns: 1fr;
  }
}

/* The former compact room-card lane was fixed to 33px. Illustrated facts need
   their natural height so actions always begin below them. */
#discover .room-card-meta-block {
  flex: 0 0 auto;
  min-height: 0;
}

#discover .room-browser-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  flex-wrap: initial;
}

#discover .room-browser-facts > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  overflow: visible;
  white-space: nowrap;
}

#discover .room-browser-facts > span > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1;
  text-overflow: ellipsis;
}

#discover .room-card-actions {
  flex: 0 0 auto;
  min-height: 0;
  margin-top: 0;
}

/* Profile-card metrics keep their illustrated cards; only redundant labels hide. */
#profiles .profile-browser-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 1px 4px 4px 1px;
  overflow: clip;
}

#profiles .profile-browser-stats > span {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  overflow: visible;
  color: transparent;
  background-color: var(--surface);
  background-image: var(--toon-paper-mark);
  background-size: 16px 16px;
  border: 2px solid var(--stroke);
  border-radius: 13px 7px 11px 6px;
  box-shadow: 3px 3px 0 var(--stroke);
  font-size: 0;
  white-space: nowrap;
}

#profiles .profile-browser-stats > span:nth-child(even) {
  border-radius: 7px 13px 6px 11px;
}

#profiles .profile-browser-stats > span:nth-child(3n) {
  border-radius: 10px 6px 14px 8px;
}

#profiles .profile-browser-stats > span > :is(.material-symbols-rounded, .orb-icon) {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 5px;
  place-items: center;
  color: var(--on-accent);
  background: var(--gold);
  border: 2px solid var(--stroke);
  border-radius: 10px 5px 9px 6px;
  box-shadow: 2px 2px 0 var(--stroke);
  font-size: 19px;
  object-fit: contain;
  transform: rotate(-4deg);
}

#profiles .profile-browser-stats > span:nth-child(1) > .material-symbols-rounded {
  color: var(--on-accent);
}

#profiles .profile-browser-stats > span:nth-child(2) > :is(.material-symbols-rounded, .orb-icon) {
  color: var(--on-primary);
  background: var(--violet);
  transform: rotate(4deg);
}

#profiles .profile-browser-stats > span:nth-child(3) > :is(.material-symbols-rounded, .orb-icon) {
  background: var(--mint);
  transform: rotate(-2deg);
}

#profiles .profile-browser-stats > span:nth-child(4) > :is(.material-symbols-rounded, .orb-icon) {
  background: var(--coral);
  transform: rotate(3deg);
}

#profiles .profile-browser-stats > span > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: "Lexend", "Nunito Sans", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1;
  text-overflow: ellipsis;
}

/* React to the card's real width, not the viewport. Two narrow cards can sit
   beside each other even on a wide screen. */
#profiles .profile-browser-card {
  container: profile-browser-card / inline-size;
}

@container profile-browser-card (max-width: 420px) {
  #profiles .profile-browser-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #profiles .profile-card-actions button {
    height: auto;
    min-height: 56px;
  }
}

@container profile-browser-card (max-width: 220px) {
  #profiles .profile-browser-stats,
  #profiles .profile-card-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  #discover .room-browser-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  #discover .room-browser-facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  :is(
    .pulse-filter-group,
    .saved-filters,
    .room-filter-switch,
    .profile-filter-switch,
    .profile-tabs,
    .room-detail-tabs,
    .setting-options,
    .report-reason-grid,
    .social-topic-bar,
    .admin-nav
  ) {
    gap: 5px;
    padding: 5px;
    box-shadow: 3px 3px 0 var(--stroke);
  }

  :is(.room-filter-switch, .profile-filter-switch) {
    overflow-x: auto;
  }
}

@media (max-width: 780px) {
  :root {
    --toon-shadow-sm: 3px 3px 0 var(--stroke);
    --toon-shadow-md: 4px 4px 0 var(--stroke);
    --toon-shadow-lg: 5px 5px 0 var(--stroke);
  }

  .topbar {
    box-shadow: 0 3px 0 color-mix(in srgb, var(--stroke) 42%, transparent);
  }

  .mobile-nav {
    border-top: 3px solid var(--stroke);
    box-shadow: 0 -3px 0 color-mix(in srgb, var(--stroke) 35%, transparent);
    backdrop-filter: none;
  }

  .search-overlay-shell,
  .story-composer-modal {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}
