/* DebateDaily foundation: tokens, shell, primitives, components, and responsive behavior. */

:root {
  color-scheme: dark;
  --font-sans: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --font-editorial: Georgia, "Times New Roman", serif;
  --canvas: #111214;
  --canvas-soft: #151619;
  --surface: #1a1b1f;
  --surface-raised: #202126;
  --surface-hover: #25262b;
  --surface-active: #2b2c31;
  --border: #3b3c42;
  --border-soft: #2b2c31;
  --text: #efede7;
  --text-soft: #cbc7bd;
  --muted: #99968f;
  --faint: #8f8b84;
  --brand: #dc5b3f;
  --brand-strong: #ef765b;
  --brand-button: #b8432f;
  --brand-button-hover: #a93420;
  --brand-soft: rgba(220, 91, 63, 0.14);
  --editorial: #ef765b;
  --agree: #55a779;
  --agree-soft: rgba(85, 167, 121, 0.13);
  --disagree: #cf6674;
  --disagree-soft: rgba(207, 102, 116, 0.13);
  --badge: #ad4858;
  --warning: #d2a64e;
  --warning-soft: rgba(210, 166, 78, 0.12);
  --danger: #df6b72;
  --focus: #f09a67;
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.38);
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 5px;
  --radius-xl: 7px;
  --header-height: 64px;
  --sidebar-width: 216px;
  --context-width: 292px;
  --content-max: 1440px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Deliberation tools: intentionally restrained so they feel native to the practical UI. */
.feature-section__header { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.feature-section__header h2 { margin:.15rem 0 .25rem; }
.feature-section__header p:last-child { margin:0; color:var(--muted); }
.slow-mode-note { display:flex; align-items:center; gap:.35rem; margin:.75rem 0 0; color:var(--muted); font-size:.84rem; }
.comment-badge--mind { color:#f5c46b; border-color:rgba(245,196,107,.35); background:rgba(245,196,107,.08); }
.opinion-timeline { margin-top:1rem; }
.opinion-timeline__list { list-style:none; margin:0; padding:0 0 0 .4rem; }
.opinion-timeline__list li { position:relative; display:grid; grid-template-columns:1rem 1fr; gap:.75rem; padding:0 0 1rem; }
.opinion-timeline__list li:not(:last-child)::before { content:""; position:absolute; left:.34rem; top:.8rem; bottom:0; border-left:1px solid var(--border); }
.opinion-timeline__dot { width:.7rem; height:.7rem; margin-top:.3rem; border-radius:50%; background:var(--brand); box-shadow:0 0 0 3px var(--surface); z-index:1; }
.opinion-timeline__list strong,.opinion-timeline__list time { display:block; }
.opinion-timeline__list time,.opinion-timeline__list p { color:var(--muted); font-size:.84rem; }
.opinion-timeline__list p { margin:.35rem 0 0; }
.promise-section { margin-top:1.25rem; }
.promise-grid { display:grid; gap:1rem; }
.promise-card__top,.promise-evidence__heading { display:flex; align-items:center; justify-content:space-between; gap:.75rem; }
.promise-card h3 { margin:.75rem 0 .35rem; }
.promise-card__maker { font-weight:600; }
.promise-card__source,.promise-card__top time { color:var(--muted); font-size:.84rem; }
.promise-status { display:inline-flex; padding:.2rem .5rem; border:1px solid var(--border); border-radius:999px; font-size:.75rem; font-weight:700; }
.promise-status--completed { color:#7bc99b; }.promise-status--broken { color:#ed8c8c; }.promise-status--in-progress { color:#dfb65e; }
.promise-votes { display:flex; flex-wrap:wrap; gap:.35rem; margin:1rem 0; }
.promise-evidence { border-top:1px solid var(--border); padding-top:.8rem; }
.promise-evidence ul { list-style:none; padding:0; margin:.5rem 0 0; }
.promise-evidence li { padding:.65rem 0; border-top:1px dashed var(--border); }
.promise-evidence li p { margin:0 0 .25rem; }
.promise-evidence li small { color:var(--muted); margin-left:.5rem; }
@media (max-width:640px) { .feature-section__header { flex-direction:column; }.promise-card__top { align-items:flex-start; flex-direction:column; } }

html[data-theme="light"] {
  color-scheme: light;
  --canvas: #e9e6df;
  --canvas-soft: #dfdcd4;
  --surface: #f8f6f0;
  --surface-raised: #fffdf8;
  --surface-hover: #eeeae1;
  --surface-active: #e5e0d6;
  --border: #bdb8ae;
  --border-soft: #d7d2c8;
  --text: #262421;
  --text-soft: #4e4a44;
  --muted: #5f5a53;
  --faint: #625d56;
  --brand: #c9472d;
  --brand-strong: #a93420;
  --brand-button: #a93420;
  --brand-button-hover: #8f2f20;
  --brand-soft: rgba(201, 71, 45, 0.11);
  --editorial: #a93420;
  --agree: #347a54;
  --agree-soft: rgba(52, 122, 84, 0.1);
  --disagree: #b24d5b;
  --disagree-soft: rgba(178, 77, 91, 0.1);
  --badge: #993746;
  --warning: #8c671d;
  --warning-soft: rgba(140, 103, 29, 0.1);
  --danger: #ad3f47;
  --focus: #8d2c1a;
  --shadow-sm: 0 2px 4px rgba(38, 36, 33, 0.12);
  --shadow-lg: 0 10px 24px rgba(38, 36, 33, 0.2);
}

html[data-theme="light"] .topic-card__category,
html[data-theme="light"] .topic-detail__category {
  color: color-mix(in srgb, var(--category-color) 62%, #000);
}

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

html {
  min-width: 280px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

::selection {
  background: rgba(139, 124, 246, 0.35);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 999;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand-button);
  color: #fff;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 160ms var(--ease);
}

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

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.icon--sm {
  width: 16px;
  height: 16px;
}

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

.app-header {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(240px, 560px) auto;
  align-items: center;
  gap: 24px;
  height: var(--header-height);
  padding: 0 max(20px, calc((100vw - var(--content-max)) / 2));
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--canvas) 96%, transparent);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.brand__mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--brand-strong) 70%, #fff);
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
}

.brand__mark svg {
  width: 22px;
  height: 22px;
}

.brand__lockup {
  display: grid;
  line-height: 1;
}

.brand__name {
  font-family: var(--font-editorial);
  font-size: 18px;
  font-weight: 760;
}

.brand__name span {
  color: var(--text);
}

.brand__edition {
  margin-top: 4px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.global-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

.global-search:focus-within {
  border-color: var(--brand);
  background: var(--surface-raised);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.global-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

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

.search-shortcut {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--canvas-soft);
  color: var(--faint);
  font: 600 12px/1 var(--font-sans);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.button,
.icon-button,
.profile-button,
.segmented button,
.dropdown a,
.dropdown button {
  transition: color 150ms var(--ease), background 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.button:hover {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

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

.button--primary {
  background: var(--brand-button);
  color: #fff;
}

.button--primary:hover {
  background: var(--brand-button-hover);
}

.button--secondary {
  border-color: var(--border);
  background: var(--surface);
}

.button--ghost {
  background: transparent;
  color: var(--text-soft);
}

.button--danger {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--danger);
}

.button--sm {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 13px;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.icon-button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
}

.icon-button:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
  background: var(--surface-hover);
  color: var(--text);
}

.notification-badge,
.nav-count {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--badge);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid var(--canvas);
}

.menu-wrap {
  position: relative;
}

.profile-button {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 4px 5px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.profile-button:hover,
.profile-button[aria-expanded="true"] {
  border-color: var(--border);
  background: var(--surface);
}

.profile-button__text {
  display: grid;
  line-height: 1.2;
}

.profile-button__text strong {
  font-size: 13px;
}

.profile-button__text span {
  color: var(--muted);
  font-size: 11px;
}

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.avatar--sm { width: 34px; height: 34px; font-size: 11px; }
.avatar--md { width: 42px; height: 42px; font-size: 13px; }
.avatar--lg { width: 64px; height: 64px; font-size: 18px; }
.avatar--violet { background: #6656b8; }
.avatar--blue { background: #3974a8; }
.avatar--green { background: #347d65; }
.avatar--rose { background: #a34e69; }
.avatar--amber { background: #9b6b32; }

.dropdown {
  position: absolute;
  z-index: 100;
  top: calc(100% + 9px);
  right: 0;
  width: 240px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  animation: menu-in 150ms var(--ease);
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown__profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.dropdown__profile span:last-child {
  display: grid;
}

.dropdown__profile small,
.dropdown button small {
  color: var(--muted);
}

.dropdown__divider {
  height: 1px;
  margin: 6px 0;
  background: var(--border-soft);
}

.dropdown a,
.dropdown button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}

.dropdown a:hover,
.dropdown button:hover,
.dropdown a:focus-visible,
.dropdown button:focus-visible {
  background: var(--surface-hover);
  color: var(--text);
}

.dropdown button small {
  margin-left: auto;
  text-transform: capitalize;
}

.app-body {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--context-width);
  gap: 24px;
  width: min(100%, var(--content-max));
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(var(--header-height) + 22px) 20px 48px;
}

.sidebar,
.context-panel {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  height: calc(100vh - var(--header-height) - 40px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-right: 18px;
  border-right: 1px solid var(--border-soft);
}

.sidebar__nav,
.sidebar__footer {
  display: grid;
  gap: 4px;
}

.nav-label {
  margin: 0 0 5px;
  padding: 0 12px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-label--spaced {
  margin-top: 20px;
}

.nav-link {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 11px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: color 150ms var(--ease), background 150ms var(--ease);
}

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

.nav-link[aria-current="page"] {
  box-shadow: inset 3px 0 0 var(--brand);
  background: var(--brand-soft);
  color: var(--text);
}

.nav-count {
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 5px;
}

.streak-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--warning) 22%, var(--border));
  border-radius: var(--radius-md);
  background: var(--warning-soft);
}

.streak-mini__icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--warning-soft);
  color: var(--warning);
}

.streak-mini span:last-child {
  display: grid;
  min-width: 0;
}

.streak-mini strong { font-size: 13px; }
.streak-mini small { color: var(--muted); font-size: 11px; }

.app-main {
  min-width: 0;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  outline: none;
  overflow-wrap: anywhere;
}

.app-main:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 6px;
}

.context-panel {
  overflow-y: auto;
  scrollbar-width: thin;
}

.context-card,
.card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 3%, transparent);
}

.context-card {
  padding: 18px;
}

.context-card + .context-card {
  margin-top: 14px;
}

.context-card h2 {
  margin: 0;
  font-size: 15px;
}

.context-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.context-card__header a {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
}

.mobile-nav {
  display: none;
}

.page-view {
  animation: view-in 240ms var(--ease);
}

/* A transformed ancestor changes how fixed elements are positioned. The topic
   view skips this tiny entrance animation so its mobile action bar stays fixed. */
.page-view:has(.topic-sticky-actions) {
  animation: none;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-heading h1,
.hero h1 {
  margin: 0;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.page-heading h1 {
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 650;
}

.page-heading p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.hero::after {
  display: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  max-width: 680px;
  font-size: clamp(34px, 7vw, 58px);
  font-family: var(--font-editorial);
  font-weight: 700;
}

.hero h1 span {
  color: var(--brand-strong);
}

.hero__copy {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--text-soft);
  font-size: clamp(15px, 2vw, 18px);
}

.hero__actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.lead-story {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 4%, transparent);
}

.lead-story__masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

.edition-label {
  color: var(--text);
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lead-story__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(220px, 0.75fr);
}

.lead-story__copy {
  padding: clamp(24px, 5vw, 42px);
}

.lead-story__kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--editorial);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.category-rule {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--category-color) 62%, var(--border));
  border-radius: 5px;
  color: var(--category-color);
}

.category-rule .icon {
  width: 18px;
  height: 18px;
}

.lead-story h1 {
  max-width: 720px;
  margin: 0;
  font-family: var(--font-editorial);
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 680;
  letter-spacing: -0.045em;
  line-height: 1.06;
}

.lead-story__copy > p {
  max-width: 650px;
  margin: 18px 0 0;
  color: var(--text-soft);
  font-family: var(--font-editorial);
  font-size: 15px;
  line-height: 1.6;
}

.lead-story__byline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.lead-story__byline > span:last-child {
  display: grid;
  line-height: 1.35;
}

.lead-story__byline strong {
  font-size: 12px;
}

.lead-story__byline small {
  color: var(--muted);
  font-size: 11px;
}

.lead-story__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.lead-story__snapshot {
  padding: 28px 24px;
  border-left: 1px solid var(--border);
  background: var(--surface-raised);
}

.snapshot-result + .snapshot-result {
  margin-top: 18px;
}

.snapshot-result__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 12px;
}

.snapshot-result__label span {
  color: var(--text-soft);
}

.snapshot-result__label strong {
  font-family: var(--font-editorial);
  font-size: 20px;
}

.snapshot-result__track {
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
}

.snapshot-result__fill {
  display: block;
  height: 100%;
  background: var(--agree);
}

.snapshot-result__fill--opposed {
  background: var(--disagree);
}

.snapshot-note {
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  color: var(--faint);
  font-size: 11px;
  line-height: 1.45;
}

.pill,
.tag,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  border-radius: 999px;
  font-weight: 700;
}

.pill {
  padding: 6px 10px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
}

.tag {
  padding: 5px 9px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

.tag:hover {
  border-color: var(--brand);
  color: var(--text);
}

.status-pill {
  padding: 5px 9px;
  background: var(--agree-soft);
  color: var(--agree);
  font-size: 11px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.stats-strip {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--surface);
}

.stats-strip .stat-card {
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.stats-strip .stat-card:last-child {
  border-right: 0;
}

.mission-statement {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 36px;
  margin-top: 30px;
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--brand);
}

.mission-statement__copy h2 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 670;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.mission-statement__copy > p:last-child {
  max-width: 690px;
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
}

.mission-values {
  display: grid;
  align-content: center;
}

.mission-values > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}

.mission-values > div:last-child {
  border-bottom: 0;
}

.mission-values .icon {
  margin-top: 2px;
  color: var(--brand-strong);
}

.mission-values span {
  display: grid;
}

.mission-values strong {
  font-size: 13px;
}

.mission-values small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.modal-mission {
  margin-bottom: 18px !important;
  color: var(--text);
  font-size: 16px;
  font-weight: 620;
  letter-spacing: -0.015em;
  line-height: 1.5;
}

.stat-card {
  padding: 18px;
}

.stat-card__icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.stat-card strong {
  display: block;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.section {
  margin-top: 30px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-header h2 {
  margin: 0;
  font-family: var(--font-editorial);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.section-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.foundation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.editorial-principles {
  gap: 0;
  border: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.feature-card {
  display: flex;
  min-width: 0;
  gap: 14px;
  padding: 20px 18px;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  border-radius: 0;
  background: var(--surface);
}

.editorial-principles .feature-card:nth-child(odd) {
  border-right: 1px solid var(--border-soft);
}

.feature-card__icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--brand-strong);
}

.feature-card h3 {
  margin: 1px 0 5px;
  font-family: var(--font-editorial);
  font-size: 15px;
  font-weight: 650;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.category-strip {
  display: flex;
  gap: 8px;
  padding-bottom: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.category-chip {
  display: inline-flex;
  min-height: 40px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.category-chip:hover {
  border-color: color-mix(in srgb, var(--category-color, var(--brand)) 55%, var(--border));
  background: var(--surface-hover);
  color: var(--text);
}

.category-chip__icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 4px;
  background: color-mix(in srgb, var(--category-color) 12%, var(--surface));
  color: var(--category-color);
}

.category-chip__icon .icon {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
}

.category-directory {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.category-chip--directory {
  min-width: 0;
  min-height: 76px;
  padding: 13px;
  border: 0;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  border-radius: 0;
  background: transparent;
}

.category-chip--directory:nth-child(3n) {
  border-right: 0;
}

.category-chip--directory:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.category-chip--directory .category-chip__icon {
  width: 40px;
  height: 40px;
}

.category-chip--directory .category-chip__icon .icon {
  width: 22px;
  height: 22px;
}

.category-chip__copy {
  display: grid;
  min-width: 0;
  flex: 1;
}

.category-chip__copy strong {
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-editorial);
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-chip__copy small {
  color: var(--muted);
  font-size: 10px;
}

.activity-list,
.notification-list {
  display: grid;
  gap: 2px;
}

.activity-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.activity-item strong { color: var(--text); }
.activity-item time { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; }

.pulse-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
}

.pulse-row + .pulse-row {
  border-top: 1px solid var(--border-soft);
}

.pulse-row span {
  color: var(--muted);
  font-size: 12px;
}

.pulse-row strong {
  font-size: 13px;
}

.placeholder-card,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 310px;
  padding: 42px 24px;
  text-align: center;
}

.empty-state__icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.empty-state__icon .icon {
  width: 26px;
  height: 26px;
}

.empty-state h2,
.empty-state h3 {
  margin: 0;
  font-size: 20px;
}

.empty-state p {
  max-width: 480px;
  margin: 8px 0 0;
  color: var(--muted);
}

.empty-state .action-row {
  justify-content: center;
}

.notice {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-soft);
}

.notice .icon {
  margin-top: 2px;
  color: var(--brand-strong);
}

.notice p {
  margin: 0;
  font-size: 13px;
}

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

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

.featured-topic-grid .topic-card__description {
  -webkit-line-clamp: 3;
}

.feed-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 10px;
}

.feed-search {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 4px 4px 4px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--faint);
}

.feed-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.feed-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

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

.feed-sort {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.feed-sort label {
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
}

.feed-sort select {
  min-height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.feed-sort option {
  background: var(--surface-raised);
  color: var(--text);
}

.feed-categories {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.feed-categories a {
  min-height: 30px;
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.feed-categories a:hover {
  border-color: color-mix(in srgb, var(--category-color, var(--brand)) 42%, var(--border));
  color: var(--text);
}

.feed-categories a[aria-current="page"] {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--border));
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.load-more {
  display: flex;
  justify-content: center;
  padding-top: 14px;
}

.topic-mini-list {
  padding: 0 14px;
}

.topic-mini-list--plain {
  padding: 0;
}

.popular-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.responsive-discovery {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.discovery-panel {
  min-width: 0;
  padding: 16px;
}

.discovery-panel .section-header {
  margin-bottom: 10px;
}

.discovery-panel .section-header h2 {
  font-size: 15px;
}

.discovery-panel--streak {
  display: none;
}

.streak-inline {
  display: flex;
  align-items: center;
  gap: 11px;
}

.streak-inline > span:last-child {
  display: grid;
}

.streak-inline strong {
  font-size: 13px;
}

.streak-inline small {
  color: var(--muted);
  font-size: 11px;
}

.topic-card {
  padding: 18px;
  transition: border-color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}

.topic-card:hover {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--border));
  background: color-mix(in srgb, var(--surface-raised) 62%, var(--surface));
  transform: translateY(-1px);
}

.topic-card__header,
.topic-card__footer,
.topic-card__byline,
.topic-card__metrics,
.topic-card__signals,
.topic-card__actions,
.topic-vote__label {
  display: flex;
  align-items: center;
}

.topic-card__header,
.topic-card__footer {
  justify-content: space-between;
  gap: 14px;
}

.topic-card__category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--category-color);
  font-size: 11px;
  font-weight: 750;
}

.topic-card__category:hover {
  color: color-mix(in srgb, var(--category-color) 72%, var(--text));
}

.topic-card__signals {
  gap: 8px;
}

.topic-rank,
.trending-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.trending-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--editorial);
}

.topic-card__title {
  margin: 13px 0 0;
  font-size: clamp(18px, 3vw, 21px);
  font-weight: 660;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.topic-card__title a:hover {
  color: var(--brand-strong);
}

.topic-card__description {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.topic-card__byline {
  gap: 8px;
  margin-top: 13px;
}

.topic-card__byline .avatar {
  width: 28px;
  height: 28px;
  font-size: 9px;
}

.topic-card__byline > span:last-child {
  display: grid;
  line-height: 1.25;
}

.topic-card__byline strong {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
}

.topic-card__byline time {
  color: var(--faint);
  font-size: 10px;
}

.topic-card__poll {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.topic-vote {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 48px;
  align-items: center;
  overflow: hidden;
  padding: 9px 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-soft);
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms var(--ease), background 150ms var(--ease), color 150ms var(--ease);
}

.topic-vote:hover {
  border-color: color-mix(in srgb, var(--agree) 55%, var(--border));
  background: var(--surface-hover);
  color: var(--text);
}

.topic-vote:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.topic-vote:disabled:hover {
  background: var(--surface);
  border-color: var(--border);
  transform: none;
}

.topic-vote--opposed:hover {
  border-color: color-mix(in srgb, var(--disagree) 55%, var(--border));
}

.topic-vote--opposed:disabled:hover {
  border-color: var(--border);
}

.topic-vote--selected {
  border-color: color-mix(in srgb, var(--agree) 65%, var(--border));
  background: var(--agree-soft);
  color: var(--text);
}

.topic-vote--selected.topic-vote--opposed {
  border-color: color-mix(in srgb, var(--disagree) 65%, var(--border));
  background: var(--disagree-soft);
}

.topic-vote__label {
  min-width: 0;
  justify-content: space-between;
  gap: 5px;
}

.topic-vote__label strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-vote__percent {
  font-size: 12px;
  font-weight: 750;
}

.topic-vote__track {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--border-soft);
}

.topic-vote__track > span {
  display: block;
  height: 100%;
  background: var(--agree);
  transition: width 360ms var(--ease);
}

.topic-vote--opposed .topic-vote__track > span {
  background: var(--disagree);
}

.topic-card__footer {
  align-items: flex-end;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--border-soft);
}

.topic-card__footer > div:first-child {
  min-width: 0;
}

.topic-card__metrics {
  flex-wrap: wrap;
  gap: 12px;
  color: var(--faint);
}

.topic-card__metrics span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
}

.topic-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.topic-card__tags .tag {
  padding: 3px 7px;
  font-size: 9px;
}

.topic-card__actions {
  flex: 0 0 auto;
  gap: 4px;
}

.topic-action {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.topic-action:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.topic-action--active {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.topic-action--active .icon {
  fill: currentColor;
}

.topic-mini {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}

.topic-mini:last-child {
  border-bottom: 0;
}

.topic-mini__icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--category-color) 34%, var(--border));
  border-radius: var(--radius-sm);
  color: var(--category-color);
}

.topic-mini__copy {
  display: grid;
  min-width: 0;
}

.topic-mini__copy small,
.topic-mini__copy span {
  color: var(--faint);
  font-size: 9px;
}

.topic-mini__copy strong {
  display: -webkit-box;
  overflow: hidden;
  margin: 2px 0 3px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.topic-mini:hover strong {
  color: var(--brand-strong);
}

.simple-list {
  overflow: hidden;
}

.simple-row {
  display: flex;
  min-width: 0;
  min-height: 64px;
  align-items: center;
  gap: 13px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  transition: background 150ms var(--ease);
}

.simple-row:last-child {
  border-bottom: 0;
}

a.simple-row:hover {
  background: var(--surface-hover);
}

.simple-row__icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.simple-row__copy {
  display: grid;
  min-width: 0;
  flex: 1;
}

.simple-row__copy strong,
.simple-row__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simple-row__copy strong {
  font-size: 14px;
}

.simple-row__copy small,
.simple-row__meta {
  color: var(--muted);
  font-size: 12px;
}

.topic-detail {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 4vw, 36px);
}

.topic-detail::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--category-color);
}

.topic-breadcrumb,
.topic-detail__kicker,
.topic-detail__byline,
.topic-detail__creator,
.topic-detail__metrics,
.topic-detail__footer,
.topic-detail__actions,
.topic-metric {
  display: flex;
  align-items: center;
}

.topic-breadcrumb {
  gap: 5px;
  margin-bottom: 24px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 650;
}

.topic-breadcrumb a:hover {
  color: var(--text);
}

.topic-breadcrumb .icon {
  width: 12px;
  height: 12px;
}

.topic-detail__kicker {
  justify-content: space-between;
  gap: 16px;
}

.topic-detail__category {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--category-color);
  font-size: 12px;
  font-weight: 760;
}

.topic-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topic-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.topic-status--open::before {
  background: var(--agree);
  box-shadow: 0 0 0 4px var(--agree-soft);
}

.topic-detail h1 {
  max-width: 760px;
  margin: 18px 0 0;
  font-size: clamp(30px, 5vw, 47px);
  font-weight: 680;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.topic-detail__description {
  max-width: 730px;
  margin: 18px 0 0;
  color: var(--text-soft);
  font-size: clamp(15px, 2.4vw, 18px);
  line-height: 1.65;
}

.topic-detail__byline {
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

.topic-detail__creator {
  gap: 10px;
}

.topic-detail__creator > span:last-child,
.topic-detail__time {
  display: grid;
}

.topic-detail__creator strong {
  color: var(--text-soft);
  font-size: 13px;
}

.topic-detail__creator small,
.topic-detail__time {
  color: var(--faint);
  font-size: 10px;
}

.topic-detail__time {
  justify-items: end;
  gap: 2px;
}

.topic-detail__metrics {
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 20px;
}

.topic-metric {
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.topic-metric strong {
  color: var(--text-soft);
  font-size: 12px;
}

.topic-detail__footer {
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
}

.topic-detail__actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.topic-detail__actions .button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 11px;
}

.topic-poll {
  padding: clamp(18px, 3vw, 26px);
}

.topic-poll__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.topic-poll__header .eyebrow {
  margin: 0 0 5px;
}

.topic-poll__header h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 25px);
  letter-spacing: -0.025em;
}

.topic-poll__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.detail-vote {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 116px;
  overflow: hidden;
  padding: 17px 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text-soft);
  cursor: pointer;
  text-align: left;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}

.detail-vote:hover {
  border-color: color-mix(in srgb, var(--agree) 55%, var(--border));
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.detail-vote--opposed:hover {
  border-color: color-mix(in srgb, var(--disagree) 55%, var(--border));
}

.detail-vote--selected {
  border-color: color-mix(in srgb, var(--agree) 70%, var(--border));
  background: var(--agree-soft);
}

.detail-vote--selected.detail-vote--opposed {
  border-color: color-mix(in srgb, var(--disagree) 70%, var(--border));
  background: var(--disagree-soft);
}

.detail-vote:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
}

.detail-vote__top,
.detail-vote__choice {
  display: flex;
  align-items: center;
}

.detail-vote__top {
  justify-content: space-between;
  gap: 16px;
}

.detail-vote__choice {
  min-width: 0;
  gap: 10px;
}

.detail-vote__marker {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.detail-vote--selected .detail-vote__marker {
  border-color: var(--agree);
  background: var(--agree);
  color: #fff;
}

.detail-vote--selected.detail-vote--opposed .detail-vote__marker {
  border-color: var(--disagree);
  background: var(--disagree);
}

.detail-vote__choice strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
}

.detail-vote__percent {
  color: var(--text);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.detail-vote__count {
  color: var(--faint);
  font-size: 10px;
}

.detail-vote__track {
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: var(--border-soft);
}

.detail-vote__track > span {
  display: block;
  height: 100%;
  background: var(--agree);
  transition: width 360ms var(--ease);
}

.detail-vote--opposed .detail-vote__track > span {
  background: var(--disagree);
}

.topic-poll__status {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.topic-insights {
  padding: clamp(18px, 3vw, 26px);
}

.section-header--compact {
  margin: 0;
}

.section-header--compact h2 {
  font-size: 19px;
}

.section-header--compact .eyebrow {
  margin: 0 0 5px;
}

.section-header--compact p:last-child {
  margin-top: 5px;
  font-size: 11px;
}

.demographic-list {
  display: grid;
  gap: 17px;
  margin-top: 24px;
}

.demographic-tabs {
  display: inline-flex;
  gap: 3px;
  margin-top: 20px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--canvas-soft);
}

.demographic-tabs button {
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.demographic-tabs button:hover {
  color: var(--text);
}

.demographic-tabs button[aria-selected="true"] {
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.demographic-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.demographic-row__label {
  display: grid;
}

.demographic-row__label strong {
  font-size: 12px;
}

.demographic-row__label span,
.demographic-row__numbers {
  color: var(--faint);
  font-size: 9px;
}

.demographic-row__numbers {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.demographic-row__track {
  display: flex;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--border-soft);
}

.demographic-row__first {
  background: var(--agree);
}

.demographic-row__second {
  background: var(--disagree);
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  color: var(--faint);
  font-size: 10px;
}

.topic-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
}

.creator-preview,
.conversation-preview {
  padding: 21px;
}

.creator-preview__identity {
  display: flex;
  align-items: center;
  gap: 13px;
}

.creator-preview__identity .eyebrow {
  margin: 0 0 2px;
}

.creator-preview__identity h2,
.conversation-preview h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.creator-preview__identity > div > span,
.creator-preview__details {
  color: var(--faint);
  font-size: 10px;
}

.creator-preview__bio,
.conversation-preview > p:not(.eyebrow) {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.creator-preview__details {
  margin-top: 10px;
}

.creator-preview__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
  color: var(--faint);
  font-size: 10px;
}

.creator-preview__stats strong {
  color: var(--text-soft);
}

.conversation-preview__principles {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.conversation-preview__principles span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
  font-size: 11px;
}

.discussion-section {
  margin-top: 8px;
}

.discussion-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.discussion-header .eyebrow {
  margin: 0 0 5px;
}

.discussion-header h2 {
  margin: 0;
  font-size: clamp(23px, 3vw, 29px);
  letter-spacing: -0.035em;
}

.discussion-header p:last-child {
  max-width: 560px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.discussion-sort {
  display: grid;
  flex: 0 0 auto;
  gap: 4px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.discussion-sort select {
  min-width: 156px;
  min-height: 38px;
  padding: 7px 30px 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.discussion-sort select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent);
}

.comment-composer {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.comment-composer--inline {
  margin-top: 13px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.comment-composer__header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-composer__header > div {
  display: grid;
}

.comment-composer__header strong {
  font-size: 12px;
}

.comment-composer__header > div span {
  color: var(--faint);
  font-size: 9px;
}

.comment-composer textarea {
  width: 100%;
  min-height: 112px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--canvas-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}

.comment-composer--inline textarea {
  min-height: 92px;
}

.comment-composer textarea::placeholder {
  color: var(--faint);
}

.comment-composer textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent);
}

.comment-composer__footer,
.comment-composer__buttons {
  display: flex;
  align-items: center;
}

.comment-composer__footer {
  justify-content: space-between;
  gap: 14px;
}

.comment-composer__buttons {
  gap: 6px;
}

.comment-composer__buttons .button {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 11px;
}

.comment-composer__count {
  color: var(--faint);
  font-size: 9px;
}

.comment-composer__count--near-limit {
  color: var(--warning);
}

.comment-list {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.comment {
  position: relative;
  padding: 17px 18px;
  border-bottom: 1px solid var(--border-soft);
  outline: 0;
}

.comment:last-child {
  border-bottom: 0;
}

.comment--pinned {
  box-shadow: inset 3px 0 0 var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 38%, var(--surface));
}

.comment--target {
  animation: comment-target 1.8s var(--ease);
}

@keyframes comment-target {
  0%, 45% { background: color-mix(in srgb, var(--brand-soft) 72%, var(--surface)); }
  100% { background: transparent; }
}

.comment__header,
.comment__name-row,
.comment__meta,
.comment__actions,
.comment__collapse {
  display: flex;
  align-items: center;
}

.comment__header {
  gap: 10px;
}

.comment__identity {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.comment__name-row {
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
}

.comment__name-row > a {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 720;
}

.comment__name-row > a:hover {
  color: var(--brand-strong);
}

.comment__name-row > span:not(.comment__badges),
.comment__meta {
  color: var(--faint);
  font-size: 9px;
}

.comment__badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.comment-badge {
  padding: 2px 5px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border));
  border-radius: 4px;
  color: var(--brand-strong);
  font-size: 8px;
  font-weight: 750;
}

.comment-badge--pinned {
  border-color: color-mix(in srgb, var(--warning) 40%, var(--border));
  color: var(--warning);
}

.comment-badge--moderator {
  border-color: color-mix(in srgb, var(--agree) 40%, var(--border));
  color: var(--agree);
}

.comment-badge--muted {
  border-color: var(--border);
  color: var(--faint);
}

.comment__meta {
  flex-wrap: wrap;
  gap: 0;
}

.comment__meta span::before {
  content: "·";
  margin: 0 5px;
}

.comment__body {
  min-width: 0;
  margin: 10px 0 0 38px;
}

.comment__text,
.comment__deleted-copy {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.mention {
  color: var(--brand-strong);
  font-weight: 680;
}

.comment__actions {
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 12px;
}

.comment-action,
.comment__collapse {
  gap: 5px;
  min-height: 30px;
  padding: 5px 7px;
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font-size: 9px;
  font-weight: 680;
}

.comment-action:hover,
.comment__collapse:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.comment-action--active {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.comment-action--active .icon {
  fill: currentColor;
}

.comment__collapse {
  margin: 10px 0 0 38px;
  color: var(--muted);
}

.comment__replies {
  margin: 14px 0 -17px 18px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.comment__replies > .comment {
  padding-right: 0;
  border-bottom: 0;
  border-top: 1px solid var(--border-soft);
}

/* Once the third visible level is reached, deeper logical replies keep the
   same indentation so narrow screens never become a sliver of text. */
.comment[data-depth="3"] .comment__replies {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}

.comment--deleted {
  background: color-mix(in srgb, var(--canvas-soft) 60%, var(--surface));
}

.comment__deleted-label,
.comment__deleted-copy {
  color: var(--faint);
  font-style: italic;
  font-size: 11px;
}

.related-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.related-topic-grid .topic-mini {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.related-topic-grid .topic-mini:hover {
  border-color: color-mix(in srgb, var(--brand) 50%, var(--border));
  background: var(--surface-hover);
}

.more-topic-list {
  padding: 0 16px;
}

.topic-sticky-actions {
  display: none;
}

.report-form {
  display: grid;
  gap: 9px;
}

.report-form .notice {
  margin-bottom: 10px;
}

.report-form label {
  margin-top: 7px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.report-form select,
.report-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--canvas-soft);
  color: var(--text);
}

.report-form select {
  min-height: 42px;
  padding: 8px 11px;
}

.report-form textarea {
  min-height: 106px;
  padding: 10px 11px;
  resize: vertical;
}

.report-form select:focus,
.report-form textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent);
}

.form-error {
  margin: 4px 0 0;
  color: var(--danger);
  font-size: 11px;
}

.context-empty {
  margin: 0;
  padding: 8px 0;
  color: var(--muted);
  font-size: 11px;
}

.detail-preview {
  display: grid;
  gap: 20px;
  padding: 22px;
}

.detail-preview__creator {
  display: flex;
  align-items: center;
  gap: 11px;
}

.detail-preview__creator > span:last-child {
  display: grid;
}

.detail-preview__creator small {
  color: var(--muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.detail-preview__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.detail-preview__metrics .simple-row {
  min-height: auto;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}

.profile-stats {
  margin-top: 20px;
}

@media (max-width: 639px) {
  .detail-preview__metrics {
    grid-template-columns: 1fr;
  }
  .simple-row__meta {
    display: none;
  }
}

.profile-summary {
  overflow: hidden;
}

.profile-cover {
  height: 130px;
  border-bottom: 1px solid var(--border);
  background: #2f4f8f;
}

.profile-summary__body {
  padding: 0 22px 24px;
}

.profile-summary__identity {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: -32px;
}

.profile-summary__identity .avatar {
  border: 4px solid var(--surface);
}

.profile-summary__identity div {
  padding-bottom: 3px;
}

.profile-summary__identity h2 { margin: 0; font-size: 22px; }
.profile-summary__identity p { margin: 0; color: var(--muted); font-size: 13px; }
.profile-summary__bio { margin: 18px 0 0; color: var(--text-soft); }

.notification-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 13px;
  padding: 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
}

.notification-item:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.notification-item:last-child { border-bottom: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.notification-item:only-child { border-radius: var(--radius-lg); }
.notification-item--unread {
  box-shadow: inset 3px 0 0 var(--brand);
  background: var(--surface-raised);
}
.notification-item__icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: var(--brand-soft); color: var(--brand-strong); }
.notification-item p { margin: 0; color: var(--text-soft); font-size: 14px; }
.notification-item time { color: var(--faint); font-size: 12px; }
.unread-dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--brand); }

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

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
}

.settings-row h2,
.settings-row h3 {
  margin: 0;
  font-size: 15px;
}

.settings-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--canvas-soft);
}

.segmented button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.segmented button[aria-pressed="true"] {
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.modal {
  width: min(92vw, 520px);
  max-height: min(86vh, 720px);
  padding: 0;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(2, 5, 9, 0.72);
  backdrop-filter: blur(4px);
}

.modal[open] {
  animation: dialog-in 190ms var(--ease);
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__surface {
  max-height: min(86vh, 720px);
  overflow-y: auto;
  border-radius: inherit;
  background: var(--surface-raised);
}

.modal__header,
.modal__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.modal__header {
  position: sticky;
  z-index: 3;
  top: 0;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-raised);
}

.modal__header h2 {
  margin: 0;
  font-size: 20px;
}

.modal__body {
  padding: 20px;
  color: var(--text-soft);
}

.modal__body p:first-child { margin-top: 0; }
.modal__body p:last-child { margin-bottom: 0; }

.modal__actions {
  position: sticky;
  z-index: 3;
  bottom: 0;
  justify-content: flex-end;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-raised);
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(380px, calc(100vw - 32px));
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 210ms var(--ease);
}

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

.toast--leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: 160ms var(--ease);
}

.toast__icon { color: var(--agree); }
.toast p { margin: 0; color: var(--text-soft); font-size: 13px; }
.toast strong { display: block; color: var(--text); font-size: 13px; }
.toast button { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.toast button:hover { background: var(--surface-hover); color: var(--text); }

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 120;
  bottom: calc(100% + 9px);
  left: 50%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 3px);
  transition: opacity 140ms var(--ease), transform 140ms var(--ease);
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.boot-skeleton {
  padding-top: 12px;
}

.skeleton-card {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
}

.skeleton {
  border-radius: 7px;
  background: linear-gradient(100deg, var(--surface) 25%, var(--surface-hover) 44%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer { to { background-position: -100% 0; } }
.skeleton--eyebrow { width: 90px; height: 12px; }
.skeleton--title { width: 70%; height: 46px; margin-top: 16px; }
.skeleton--text { width: 88%; height: 18px; margin-top: 18px; }
.skeleton--line { width: 100%; height: 14px; }
.skeleton--short { width: 55%; }
.skeleton--line + .skeleton--line { margin-top: 10px; }
.skeleton--block { width: 100%; height: 90px; margin-top: 18px; }

@media (max-width: 1279px) {
  .app-header { grid-template-columns: var(--sidebar-width) minmax(240px, 1fr) auto; }
  .app-body { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .context-panel { display: none; }
  .responsive-discovery { display: grid; }
}

@media (max-width: 959px) {
  :root { --header-height: 64px; }
  .app-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    padding: 0 16px;
  }
  .brand__lockup { display: none; }
  .global-search { max-width: none; }
  .header-create span,
  .profile-button__text,
  .profile-button > .icon { display: none; }
  .header-create { width: 42px; padding: 0; }
  .profile-button { padding: 4px; }
  .app-body {
    display: block;
    padding: calc(var(--header-height) + 22px) 18px 104px;
  }
  .app-body:has(.topic-sticky-actions) { padding-bottom: 164px; }
  .sidebar { display: none; }
  .app-main { max-width: 820px; }
  .lead-story__grid { grid-template-columns: 1fr; }
  .lead-story__snapshot {
    border-top: 1px solid var(--border);
    border-left: 0;
  }
  .mission-statement { grid-template-columns: 1fr; gap: 20px; }
  .category-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-chip--directory:nth-child(3n) { border-right: 1px solid var(--border-soft); }
  .category-chip--directory:nth-child(2n) { border-right: 0; }
  .category-chip--directory:nth-last-child(-n + 3) { border-bottom: 1px solid var(--border-soft); }
  .category-chip--directory:nth-last-child(-n + 2) { border-bottom: 0; }
  .discovery-panel--streak { display: block; }
  .mobile-nav {
    position: fixed;
    z-index: 60;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    min-height: 70px;
    padding: 7px max(10px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--canvas) 97%, transparent);
    backdrop-filter: blur(12px);
  }
  .mobile-nav a {
    display: grid;
    min-height: 50px;
    place-items: center;
    align-content: center;
    gap: 3px;
    border-radius: 10px;
    color: var(--faint);
    font-size: 10px;
    font-weight: 700;
  }
  .mobile-nav a[aria-current="page"] { color: var(--brand-strong); }
  .mobile-nav__create {
    width: 50px;
    height: 50px;
    min-height: 50px !important;
    justify-self: center;
    margin-bottom: 12px;
    border: 2px solid var(--canvas);
    border-radius: 8px !important;
    background: var(--brand-button);
    color: #fff !important;
  }
  .toast-region { bottom: 88px; }
  body:has(.topic-sticky-actions) .toast-region {
    bottom: calc(140px + env(safe-area-inset-bottom));
  }
  .topic-sticky-actions {
    position: fixed;
    z-index: 55;
    right: 12px;
    bottom: calc(77px + env(safe-area-inset-bottom));
    left: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    max-width: 620px;
    margin: auto;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--surface-raised) 96%, transparent);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px);
  }
  .topic-sticky-actions .button {
    justify-content: center;
    min-width: 0;
    min-height: 42px;
    padding: 7px 8px;
    font-size: 11px;
  }
}

@media (max-width: 639px) {
  .app-header { gap: 9px; padding: 0 12px; }
  .brand__mark { width: 36px; height: 36px; }
  .global-search { height: 40px; padding: 0 10px; }
  .global-search input { font-size: 13px; }
  .global-search input::placeholder { color: transparent; }
  .search-shortcut { display: none; }
  .header-create { display: none; }
  .notification-button { display: none; }
  .app-body { padding-right: 12px; padding-left: 12px; }
  .hero { padding: 24px 20px; border-radius: var(--radius-lg); }
  .hero h1 { font-size: clamp(32px, 11vw, 46px); }
  .hero__actions .button { flex: 1 1 100%; }
  .lead-story { border-radius: var(--radius-md); }
  .lead-story__masthead { padding: 9px 13px; }
  .lead-story__copy { padding: 24px 18px; }
  .lead-story h1 { font-size: clamp(34px, 12vw, 46px); }
  .lead-story__copy > p { font-size: 16px; }
  .lead-story__actions .button { width: 100%; }
  .lead-story__snapshot { padding: 22px 18px; }
  .mission-statement { margin-top: 22px; padding: 22px 18px; }
  .featured-topic-grid { grid-template-columns: 1fr; }
  .feed-toolbar { grid-template-columns: 1fr; }
  .feed-sort { justify-content: space-between; }
  .topic-card { padding: 15px; }
  .topic-card__poll { grid-template-columns: 1fr; }
  .topic-card__footer { align-items: center; }
  .topic-card__tags { display: none; }
  .topic-detail { padding: 20px 18px 24px; }
  .topic-breadcrumb { margin-bottom: 18px; }
  .topic-detail h1 { margin-top: 14px; }
  .topic-detail__byline { align-items: flex-start; }
  .topic-detail__time { justify-items: end; }
  .topic-detail__footer { display: block; }
  .topic-detail__footer .topic-detail__actions { display: none; }
  .topic-detail__footer .tag-row { margin-top: 2px; }
  .topic-poll__header .pill { display: none; }
  .topic-poll__options { grid-template-columns: 1fr; }
  .detail-vote { min-height: 102px; }
  .section-header--compact { align-items: flex-start; }
  .section-header--compact .pill { display: none; }
  .demographic-row { grid-template-columns: 60px minmax(0, 1fr); gap: 12px; }
  .demographic-row__numbers { font-size: 8px; }
  .demographic-tabs { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .demographic-tabs button { padding-right: 6px; padding-left: 6px; }
  .topic-detail-grid,
  .related-topic-grid { grid-template-columns: 1fr; }
  .discussion-header { display: grid; align-items: start; }
  .discussion-sort { width: 100%; }
  .discussion-sort select { width: 100%; }
  .comment-composer { padding: 15px; }
  .comment-composer__footer { align-items: flex-end; }
  .comment-composer__buttons { flex-wrap: wrap; justify-content: flex-end; }
  .comment { padding: 15px 13px; }
  .comment__body { margin-left: 0; }
  .comment__collapse { margin-left: 0; }
  .comment__replies { margin-right: 0; margin-left: 7px; padding-left: 8px; }
  .comment__replies > .comment { padding-right: 0; padding-left: 8px; }
  .comment-action { min-height: 32px; }
  .responsive-discovery { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; padding: 14px; }
  .stats-strip .stat-card {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .stats-strip .stat-card:last-child { border-bottom: 0; }
  .stat-card__icon { grid-row: span 2; margin: 0; }
  .stat-card strong { font-size: 20px; }
  .foundation-grid { grid-template-columns: 1fr; }
  .editorial-principles .feature-card:nth-child(odd) { border-right: 0; }
  .editorial-principles .feature-card:last-child { border-bottom: 0; }
  .category-directory { grid-template-columns: 1fr; }
  .category-chip--directory,
  .category-chip--directory:nth-child(2n),
  .category-chip--directory:nth-child(3n),
  .category-chip--directory:nth-last-child(-n + 2),
  .category-chip--directory:nth-last-child(-n + 3) {
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }
  .category-chip--directory:last-child { border-bottom: 0; }
  .page-heading { display: block; }
  .page-heading .button { margin-top: 16px; }
  .settings-row { display: grid; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; justify-content: center; }
  .modal { width: 100vw; max-width: none; max-height: calc(100vh - 24px); margin: auto 0 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .modal__surface { max-height: calc(100vh - 24px); }
  .modal__actions { flex-direction: column-reverse; align-items: stretch; }
  .modal__actions .button { width: 100%; }
  .dropdown { position: fixed; top: 58px; right: 12px; }
  [data-tooltip]::after { display: none; }
}

/* Part 6: category communities and accessible discovery */
.global-search {
  position: relative;
}

.search-suggestions {
  position: absolute;
  z-index: 120;
  top: calc(100% + 8px);
  right: -1px;
  left: -1px;
  max-height: min(480px, calc(100vh - 96px));
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.search-suggestion {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.search-suggestion:hover,
.search-suggestion[aria-selected="true"] {
  background: var(--surface-hover);
}

.search-suggestion__icon,
.search-entity__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--canvas-soft);
  color: var(--brand-strong);
}

.search-suggestion__icon .icon,
.search-entity__icon .icon { width: 17px; height: 17px; }
.search-suggestion__copy { min-width: 0; color: var(--text); font-size: 13px; font-weight: 650; }
.search-suggestion__copy > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-suggestion__copy small { display: block; overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.search-suggestion__type { color: var(--faint); font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.search-suggestion-empty { padding: 16px; color: var(--muted); font-size: 13px; text-align: center; }

.highlighted-copy mark {
  border-radius: 3px;
  background: color-mix(in srgb, var(--warning) 24%, transparent);
  color: inherit;
}

.search-layout {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.search-filter-panel {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  padding: 16px;
}

.filter-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.filter-panel-heading h2 { margin: 0; font-size: 14px; }
.filter-panel-heading .icon { color: var(--muted); }
.search-filters { display: grid; gap: 14px; }

.search-query-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--canvas-soft);
}

.search-query-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-query-field > .icon { width: 16px; color: var(--muted); }
.search-query-field input { min-width: 0; height: 40px; border: 0; outline: 0; background: transparent; }
.search-query-field .button { grid-column: 1 / -1; width: calc(100% + 20px); margin: 0 -10px -1px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.search-filter-grid { display: grid; gap: 11px; }

.filter-field { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.filter-field select {
  width: 100%;
  height: 38px;
  padding: 0 30px 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--canvas-soft);
  color: var(--text-soft);
  font-size: 12px;
}
.filter-field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-filter-actions { display: grid; gap: 8px; }
.search-filter-actions .button { width: 100%; }
.mobile-filter-trigger { display: none; }
.search-results { min-width: 0; }
.section--first { margin-top: 20px; }

.result-tabs {
  display: flex;
  gap: 3px;
  margin-bottom: 12px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.result-tabs a {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.result-tabs a:hover { color: var(--text); background: var(--surface-hover); }
.result-tabs a[aria-current="page"] { color: var(--text); background: var(--surface-active); }
.result-tabs small { color: var(--muted); font-size: 10px; }
.result-summary { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.search-result-section + .search-result-section { margin-top: 28px; }
.search-result-section > .section-header { margin-bottom: 12px; }

.search-history-list { overflow: hidden; }
.search-history-item { display: flex; align-items: center; min-height: 48px; border-bottom: 1px solid var(--border-soft); }
.search-history-item:last-child { border-bottom: 0; }
.search-history-item > a { display: flex; min-width: 0; flex: 1; align-items: center; gap: 10px; padding: 11px 14px; font-size: 13px; font-weight: 650; }
.search-history-item > a .icon { color: var(--muted); }
.search-history-item > button { display: grid; width: 34px; height: 34px; margin-right: 8px; place-items: center; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.search-history-item > button:hover { background: var(--surface-hover); color: var(--text); }
.category-directory--search { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.category-directory--search .category-chip--directory:nth-child(3n) { border-right: 1px solid var(--border-soft); }
.category-directory--search .category-chip--directory:nth-child(2n) { border-right: 0; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; }
.search-entity-list { overflow: hidden; }
.search-entity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.search-entity:last-child { border-bottom: 0; }
.search-entity:hover { background: var(--surface-hover); }
.search-entity__icon { color: var(--category-color, var(--brand-strong)); }
.search-entity__copy { display: grid; min-width: 0; gap: 2px; }
.search-entity__copy strong { font-size: 13px; }
.search-entity__copy small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.search-entity__meta { color: var(--faint); font-size: 11px; }
.search-tag-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; }
.search-tag-results a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 48px; padding: 10px 13px; border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); font-size: 12px; font-weight: 650; }
.search-tag-results a:nth-child(2n) { border-right: 0; }
.search-tag-results a:hover { background: var(--surface-hover); }
.search-tag-results small { color: var(--faint); font-size: 10px; }

.category-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 26px;
  overflow: hidden;
  border-top: 2px solid var(--category-color);
}
.category-hero__identity { display: flex; min-width: 0; align-items: flex-start; gap: 18px; }
.category-hero__icon { display: grid; width: 58px; height: 58px; flex: 0 0 auto; place-items: center; border: 1px solid color-mix(in srgb, var(--category-color) 48%, var(--border)); border-radius: var(--radius-md); background: color-mix(in srgb, var(--category-color) 12%, var(--surface)); color: var(--category-color); }
.category-hero__icon .icon { width: 28px; height: 28px; }
.category-hero h1 { margin: 0; font-size: clamp(28px, 5vw, 38px); letter-spacing: -.04em; line-height: 1.05; }
.category-hero__identity > div > p:last-child { max-width: 680px; margin: 8px 0 0; color: var(--muted); }
.category-hero__follow { display: grid; flex: 0 0 auto; justify-items: end; gap: 8px; }
.category-hero__follow > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.category-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 14px 0 28px; }
.category-content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 286px; align-items: start; gap: 20px; }
.category-sidebar { display: grid; gap: 14px; }
.category-side-card { padding: 16px; }
.category-side-card > .section-header { margin-bottom: 10px; }
.category-side-card .section-header h2 { font-size: 14px; }
.category-side-card .section-header p { font-size: 10px; }
.contributor-list { display: grid; }
.contributor-list a { display: grid; grid-template-columns: 20px auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 48px; border-bottom: 1px solid var(--border-soft); }
.contributor-list a:last-child { border-bottom: 0; }
.contributor-list a:hover strong { color: var(--brand-strong); }
.contributor-rank { color: var(--faint); font-size: 10px; font-weight: 800; text-align: center; }
.contributor-list a > span:nth-child(3) { display: grid; min-width: 0; }
.contributor-list strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.contributor-list small { color: var(--faint); font-size: 9px; }
.category-side-card > .tag-cloud { padding: 0; }
.category-activity { display: grid; }
.category-activity a { display: flex; align-items: flex-start; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.category-activity a:last-child { border-bottom: 0; }
.category-activity a > span:last-child { display: grid; min-width: 0; }
.category-activity strong { font-size: 11px; }
.category-activity small { color: var(--muted); font-size: 9px; line-height: 1.4; }

@media (max-width: 1099px) {
  .category-content-grid { grid-template-columns: 1fr; }
  .category-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 959px) {
  .search-layout { grid-template-columns: 1fr; }
  .search-filter-panel { display: none; }
  .mobile-filter-trigger { display: inline-flex; }
  .search-filters--mobile .search-query-field { grid-template-columns: auto minmax(0, 1fr); }
  .search-filters--mobile .search-query-field .button { display: none; }
  .search-filters--mobile .search-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
  .search-suggestions { position: fixed; top: var(--header-height); right: 8px; left: 8px; max-height: calc(100vh - var(--header-height) - 90px); }
  .search-suggestion__type { display: none; }
  .search-filters--mobile .search-filter-grid { grid-template-columns: 1fr; }
  .result-tabs { margin-right: -12px; margin-left: -12px; border-right: 0; border-left: 0; border-radius: 0; }
  .search-entity { grid-template-columns: auto minmax(0, 1fr); }
  .search-entity__meta, .search-entity > .icon { display: none; }
  .search-tag-results { grid-template-columns: 1fr; }
  .search-tag-results a { border-right: 0; }
  .category-hero { display: grid; padding: 20px 18px; }
  .category-hero__identity { display: grid; }
  .category-hero__follow { display: flex; align-items: center; justify-content: space-between; }
  .category-hero__follow .button { margin: 0; }
  .category-stats { grid-template-columns: 1fr; }
  .category-sidebar { grid-template-columns: 1fr; }
}

/* Garage refresh: deliberately practical, personal, and a little scrappy. */
body {
  letter-spacing: 0;
  background: var(--canvas);
}

.app-header {
  border-bottom: 2px solid var(--border);
  background: var(--canvas);
  backdrop-filter: none;
}

.brand { gap: 9px; letter-spacing: 0; }
.brand__mark {
  border: 2px solid #f3c7b8;
  border-radius: 2px;
  background: var(--brand);
  box-shadow: 2px 2px 0 #6e291b;
  transform: rotate(-1.5deg);
}
.brand__name { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.brand__name span { color: var(--brand-strong); }
.brand__edition { margin-top: 3px; font-size: 8px; font-weight: 700; letter-spacing: .08em; }

.global-search,
.icon-button,
.profile-button,
.filter-field select,
.search-query-field {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: none;
}
.global-search:focus-within,
.search-query-field:focus-within,
.filter-field select:focus {
  border-color: var(--brand-strong);
  box-shadow: 0 0 0 2px var(--brand-soft);
}
.search-shortcut { border-radius: 2px; background: var(--canvas); }

.button,
.icon-button,
.profile-button,
.segmented button,
.dropdown a,
.dropdown button,
.topic-card,
.topic-vote,
.detail-vote {
  transition-duration: 90ms;
}
.button {
  min-height: 40px;
  border-color: var(--border);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 700;
}
.button:hover { border-color: var(--text-soft); transform: none; }
.button--primary {
  border-color: #8f321f;
  background: var(--brand-button);
  box-shadow: 2px 2px 0 #682519;
}
.button--primary:hover {
  border-color: #a63c26;
  background: var(--brand-button-hover);
  box-shadow: 1px 1px 0 #682519;
  transform: translate(1px, 1px);
}
.button--ghost { border-color: transparent; }
.icon-button { border-radius: 3px; }

.avatar {
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 4px;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, .25);
}
.avatar--violet { background: #73579a; }
.avatar--blue { background: #376f94; }
.avatar--green { background: #3c785f; }
.avatar--rose { background: #9b5062; }
.avatar--amber { background: #946536; }

.dropdown,
.modal,
.modal__surface,
.search-suggestions {
  border-radius: 4px;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .28);
  animation: none;
}
.dropdown a,
.dropdown button,
.search-suggestion { border-radius: 2px; }

.sidebar { padding-right: 14px; border-right-color: var(--border); }
.nav-label { padding-left: 8px; font-size: 10px; letter-spacing: .08em; }
.nav-link { min-height: 36px; padding: 6px 8px; border-radius: 2px; font-weight: 600; }
.nav-link[aria-current="page"] {
  border: 1px solid color-mix(in srgb, var(--brand) 48%, var(--border));
  background: var(--brand-soft);
  box-shadow: none;
}
.streak-mini { border-radius: 3px; }
.streak-mini__icon { border-radius: 3px; }

.page-view { animation: final-page-fade 150ms ease-out; }
@keyframes final-page-fade {
  from { opacity: .72; }
  to { opacity: 1; }
}
.page-heading { margin-bottom: 19px; }
.page-heading h1,
.hero h1,
.lead-story h1,
.mission-statement__copy h2 {
  font-family: var(--font-editorial);
  font-weight: 700;
  letter-spacing: -.025em;
}
.page-heading h1 { font-size: clamp(28px, 5vw, 36px); }
.page-heading p { max-width: 590px; color: var(--text-soft); }
.eyebrow { color: var(--brand-strong); font-size: 10px; letter-spacing: .08em; }

.context-card,
.card,
.lead-story,
.hero,
.mission-statement,
.editorial-principles,
.stats-strip {
  border-color: var(--border);
  border-radius: 5px;
  box-shadow: none;
}
.context-card { padding: 15px; }
.context-card h2 { font-family: var(--font-editorial); font-size: 16px; }

.lead-story {
  position: relative;
  border-top: 4px solid var(--brand);
}
.lead-story__masthead {
  padding: 8px 14px;
  border-bottom-style: dashed;
  background: var(--canvas-soft);
  font-family: "Courier New", monospace;
}
.edition-label { font-weight: 700; letter-spacing: .08em; }
.lead-story__copy { padding: clamp(22px, 4vw, 34px); }
.lead-story__kicker { margin-bottom: 14px; font-size: 10px; letter-spacing: .07em; }
.lead-story h1 { font-size: clamp(35px, 5vw, 49px); line-height: 1.03; }
.lead-story__copy > p { color: var(--text-soft); font-family: Arial, "Helvetica Neue", sans-serif; line-height: 1.55; }
.lead-story__snapshot { padding: 24px 20px; background: var(--canvas-soft); }
.snapshot-result__track { height: 10px; border-radius: 0; }

.pill,
.tag,
.status-pill {
  border-radius: 2px;
  font-weight: 700;
}
.pill { border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border)); }
.tag { padding: 4px 7px; background: var(--canvas-soft); }
.tag:hover { background: var(--brand-soft); }

.stats-grid { gap: 8px; }
.stat-card { padding: 15px; }
.stat-card__icon,
.feature-card__icon,
.category-rule,
.category-chip__icon,
.search-suggestion__icon,
.search-entity__icon,
.category-hero__icon {
  border-radius: 3px;
}
.stat-card__icon { width: 34px; height: 34px; margin-bottom: 12px; border: 1px solid var(--border); background: var(--canvas-soft); }
.stat-card strong { font-family: "Courier New", monospace; font-size: 21px; letter-spacing: -.03em; }

.mission-statement {
  gap: 28px;
  border-left: 4px solid var(--brand);
  background: var(--canvas-soft);
  box-shadow: none;
}
.mission-values > div { border-bottom-style: dashed; }

.section { margin-top: 27px; }
.section-header {
  align-items: baseline;
  margin-bottom: 12px;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--border);
}
.section-header h2 { font-family: var(--font-editorial); font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.section-header p { color: var(--faint); font-size: 12px; }

.feature-card { padding: 17px 15px; }
.feature-card h3 { font-family: var(--font-editorial); font-size: 16px; font-weight: 700; }
.category-chip { border-radius: 3px; background: var(--canvas-soft); }
.category-chip--directory { border-radius: 0; }

.topic-feed { gap: 10px; }
.topic-card {
  padding: 16px;
  border-left: 3px solid var(--border);
}
.topic-card:hover {
  border-color: var(--border);
  border-left-color: var(--brand);
  background: var(--surface-raised);
  transform: none;
}
.topic-card__title {
  margin-top: 11px;
  font-family: var(--font-editorial);
  font-size: clamp(19px, 3vw, 22px);
  font-weight: 700;
  letter-spacing: -.012em;
}
.topic-card__description { color: var(--text-soft); line-height: 1.48; }
.topic-card__byline strong { font-weight: 700; }
.topic-vote {
  min-height: 46px;
  border-radius: 2px;
  background: var(--canvas-soft);
}
.topic-vote:hover { background: var(--surface-hover); }
.topic-vote__track { height: 4px; }
.topic-card__footer { border-top-style: dashed; }
.topic-action { border-radius: 2px; }

.topic-detail,
.topic-poll,
.topic-insights,
.discussion,
.comment-composer,
.comment {
  border-radius: 5px;
}
.topic-detail { border-top: 4px solid var(--category-color); }
.topic-detail h1 { font-family: var(--font-editorial); font-weight: 700; letter-spacing: -.025em; }
.detail-vote { border-radius: 3px; background: var(--canvas-soft); }
.detail-vote__marker { border-radius: 3px; }
.comment { border-left: 2px solid var(--border); }
.comment:hover { border-left-color: var(--brand); }
.comment__replies { border-left-style: dashed; }

.category-hero { border-radius: 5px; border-top-width: 4px; }
.category-hero h1 { font-family: var(--font-editorial); letter-spacing: -.02em; }
.category-side-card > .section-header h2 { font-size: 17px; }
.result-tabs { border-radius: 3px; }
.result-tabs a { border-radius: 2px; }
.search-filter-panel { border-radius: 4px; }
.search-history-list,
.search-entity-list,
.search-tag-results { border-radius: 4px; }

.mobile-nav {
  background: var(--canvas);
  backdrop-filter: none;
}
.mobile-nav a { border-radius: 2px; }
.mobile-nav__create {
  border-radius: 3px !important;
  box-shadow: 2px 2px 0 #682519;
}
.topic-sticky-actions { border-radius: 4px; background: var(--surface-raised); backdrop-filter: none; }
.toast { border-radius: 3px; box-shadow: 3px 3px 0 rgba(0, 0, 0, .25); }

@media (max-width: 639px) {
  .brand__mark { border-radius: 2px; }
  .lead-story { border-radius: 4px; }
  .lead-story__masthead { padding: 8px 11px; }
  .lead-story h1 { font-size: clamp(33px, 11vw, 43px); }
  .modal { border-radius: 6px 6px 0 0; }
}

/* Create Topic studio */
.create-topic-form {
  overflow: hidden;
  padding: 0;
  border-top: 4px solid var(--brand);
}

.create-draft-banner,
.create-draft-banner > div,
.create-draft-banner__actions,
.create-form-section > header,
.create-field__heading,
.create-tag-input,
.create-tag-list,
.create-tag-meta,
.create-toggle,
.create-demo-note,
.create-form-actions,
.create-form-actions > div,
.create-preview-actions {
  display: flex;
  align-items: center;
}

.create-draft-banner {
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px dashed var(--border);
  background: var(--warning-soft);
}

.create-draft-banner > div { gap: 10px; }
.create-draft-banner > div > .icon { color: var(--warning); }
.create-draft-banner span { display: grid; }
.create-draft-banner small { color: var(--muted); }
.create-draft-banner__actions { gap: 7px !important; }

.create-error-summary {
  display: flex;
  gap: 12px;
  margin: 18px 18px 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 70%, var(--border));
  border-left: 4px solid var(--danger);
  border-radius: 3px;
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
}

.create-error-summary > .icon { flex: 0 0 auto; margin-top: 2px; color: var(--danger); }
.create-error-summary strong { display: block; }
.create-error-summary ul { margin: 5px 0 0; padding-left: 18px; }
.create-error-summary button { padding: 1px 0; background: none; color: var(--text-soft); text-align: left; text-decoration: underline; cursor: pointer; }

.create-form-section {
  padding: 25px 24px 27px;
  border-bottom: 1px dashed var(--border);
}

.create-form-section > header {
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}

.create-form-section > header h2 {
  margin: 0;
  font-family: var(--font-editorial);
  font-size: 21px;
  letter-spacing: -.01em;
}

.create-form-section > header p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.create-step {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--brand) 55%, var(--border));
  border-radius: 3px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font: 700 13px/1 "Courier New", monospace;
}

.create-field + .create-field { margin-top: 20px; }
.create-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.create-field-grid + .create-field-grid { margin-top: 20px; }
.create-field-grid .create-field + .create-field { margin-top: 0; }
.create-field__heading { justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.create-field__heading label { font-size: 13px; font-weight: 700; }
.required-mark { margin-left: 7px; color: var(--brand-strong); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.create-field__hint { margin: -2px 0 7px; color: var(--muted); font-size: 12px; }
.create-field__count { color: var(--faint); font: 12px/1.2 "Courier New", monospace; }
.create-field__count--near-limit { color: var(--warning); font-weight: 700; }

.create-format-field { min-width: 0; margin: 20px 0 0; padding: 0; border: 0; }
.create-format-field legend { margin-bottom: 6px; color: var(--text); font-size: 13px; font-weight: 700; }
.create-format-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.create-format-choice { position: relative; display: block; min-width: 0; cursor: pointer; }
.create-format-choice__input { position: absolute; width: 1px !important; min-height: 1px !important; padding: 0 !important; opacity: 0; pointer-events: none; }
.create-format-choice__body { display: grid; min-height: 92px; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 11px; padding: 13px; border: 1px solid var(--border); border-radius: 3px; background: var(--canvas-soft); color: var(--text-soft); }
.create-format-choice:hover .create-format-choice__body { border-color: var(--text-soft); background: var(--surface-hover); }
.create-format-choice__input:checked + .create-format-choice__body { border-color: var(--brand); background: var(--brand-soft); box-shadow: 2px 2px 0 color-mix(in srgb, var(--brand) 26%, transparent); }
.create-format-choice__input:focus-visible + .create-format-choice__body { outline: 2px solid var(--focus); outline-offset: 3px; }
.create-format-choice__icon { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.create-format-choice__input:checked + .create-format-choice__body .create-format-choice__icon { border-color: var(--brand); color: var(--brand-strong); }
.create-format-choice__body > span:last-child { display: grid; gap: 4px; }
.create-format-choice__body strong { font-size: 13px; }
.create-format-choice__body small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.create-format-note { margin: 9px 0 0; padding: 8px 10px; border-left: 3px solid var(--border); background: var(--canvas-soft); color: var(--muted); font-size: 11px; }
.create-format-note--duel { border-left-color: var(--brand); background: var(--brand-soft); color: var(--text-soft); }

.create-field input,
.create-field textarea,
.create-field select {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  outline: 0;
  background: var(--canvas-soft);
  color: var(--text);
  transition: border-color 90ms ease, box-shadow 90ms ease, background 90ms ease;
}

.create-field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.create-field input::placeholder,
.create-field textarea::placeholder { color: var(--faint); }
.create-field input:focus,
.create-field textarea:focus,
.create-field select:focus {
  border-color: var(--brand-strong);
  background: var(--surface-raised);
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.create-field--invalid input,
.create-field--invalid textarea,
.create-field--invalid select { border-color: var(--danger); }
.create-field__error { margin: 6px 0 0; color: var(--danger); font-size: 12px; font-weight: 700; }

.create-tag-input { gap: 8px; }
.create-tag-input input { min-width: 0; }
.create-tag-input .button { flex: 0 0 auto; }
.create-tag-list { flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.create-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 3px 5px 3px 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface-raised);
  color: var(--text-soft);
  font: 700 12px/1.2 "Courier New", monospace;
}
.create-tag button { display: grid; width: 22px; height: 22px; padding: 0; place-items: center; border-radius: 2px; background: transparent; color: var(--muted); cursor: pointer; }
.create-tag button:hover { background: var(--surface-hover); color: var(--text); }
.create-tag-meta { justify-content: space-between; gap: 12px; margin-top: 9px; color: var(--faint); font-size: 11px; }
.create-tag-suggestions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.create-tag-suggestions button { padding: 0; background: none; color: var(--brand-strong); cursor: pointer; }
.create-tag-suggestions button:hover { text-decoration: underline; }

.create-toggle-list { display: grid; gap: 9px; margin-top: 20px; }
.create-toggle {
  align-items: flex-start;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  background: var(--canvas-soft);
  cursor: pointer;
}
.create-toggle:hover { border-color: var(--border); background: var(--surface-hover); }
.create-toggle input { flex: 0 0 auto; width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--brand); }
.create-toggle span { display: grid; }
.create-toggle strong { font-size: 13px; }
.create-toggle small { color: var(--muted); line-height: 1.45; }

.create-demo-note { align-items: flex-start; gap: 10px; padding: 14px 24px; border-bottom: 1px dashed var(--border); background: var(--canvas-soft); color: var(--muted); }
.create-demo-note .icon { flex: 0 0 auto; margin-top: 2px; color: var(--brand-strong); }
.create-demo-note p { margin: 0; font-size: 12px; }
.create-form-actions { position: sticky; z-index: 2; bottom: 0; justify-content: space-between; gap: 18px; padding: 15px 24px; background: color-mix(in srgb, var(--surface) 94%, transparent); }
.create-form-actions > div { justify-content: flex-end; gap: 8px; }
.create-save-status { margin: 0; color: var(--muted); font: 12px/1.3 "Courier New", monospace; }
.create-save-status[data-state="saving"] { color: var(--warning); }
.create-save-status[data-state="saved"] { color: var(--agree); }
.create-save-status[data-state="error"] { color: var(--danger); }

.create-preview-actions { justify-content: flex-end; gap: 8px; margin: 13px 0 18px; }
.create-preview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 330px); gap: 18px; align-items: start; }
.create-preview-label { margin: 0 0 7px; color: var(--faint); font: 700 10px/1.3 "Courier New", monospace; letter-spacing: .08em; text-transform: uppercase; }
.create-detail-preview { padding: 24px; border-top: 4px solid var(--category-color); }
.create-detail-preview > h2 { margin: 14px 0 9px; font-family: var(--font-editorial); font-size: clamp(27px, 4vw, 38px); line-height: 1.15; letter-spacing: -.02em; }
.create-detail-preview .topic-detail__byline { margin: 18px 0; }
.create-detail-preview .topic-detail__byline > span { display: grid; }
.create-detail-preview > .topic-poll { margin-top: 22px; padding: 18px; background: var(--canvas-soft); }
.phone-frame { padding: 10px; border: 1px solid var(--border); border-radius: 18px; background: var(--canvas); box-shadow: 4px 4px 0 rgba(0,0,0,.25); }
.phone-frame__bar { width: 52px; height: 4px; margin: 1px auto 10px; border-radius: 4px; background: var(--border); }
.phone-frame .topic-card { padding: 13px; }
.phone-frame .topic-card__description { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.phone-frame .topic-card__metrics { gap: 8px; font-size: 10px; }
.phone-frame .topic-card__footer { align-items: flex-start; }
.publish-review h3 { margin: 17px 0 12px; font-family: var(--font-editorial); font-size: 21px; line-height: 1.3; }
.publish-review dl { margin: 0; border-top: 1px dashed var(--border); }
.publish-review dl > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.publish-review dt { color: var(--muted); font-size: 12px; }
.publish-review dd { margin: 0; font-size: 13px; font-weight: 700; }
.publish-review__question { margin: 17px 0 0; font-weight: 700; }

@media (max-width: 959px) {
  .create-preview-grid { grid-template-columns: 1fr; }
  .create-preview-phone { max-width: 390px; }
}

@media (max-width: 639px) {
  .create-draft-banner,
  .create-form-actions { align-items: stretch; flex-direction: column; }
  .create-draft-banner__actions,
  .create-form-actions > div { display: grid !important; grid-template-columns: 1fr 1fr; }
  .create-form-actions > div .button:last-child { grid-column: 1 / -1; }
  .create-form-section { padding: 22px 16px 24px; }
  .create-field-grid { grid-template-columns: 1fr; gap: 18px; }
  .create-format-options { grid-template-columns: 1fr; }
  .create-field-grid .create-field + .create-field { margin-top: 0; }
  .create-tag-input { align-items: stretch; flex-direction: column; }
  .create-tag-meta { align-items: flex-start; flex-direction: column; }
  .create-tag-suggestions { justify-content: flex-start; }
  .create-demo-note,
  .create-form-actions { padding-right: 16px; padding-left: 16px; }
  .create-preview-actions { display: grid; grid-template-columns: 1fr; }
  .create-detail-preview { padding: 17px; }
}

/* Part 8: member profiles, reputation, and achievements */
.profile-hero { overflow: hidden; border-top: 4px solid var(--brand); }
.profile-cover { position: relative; display: flex; height: 154px; align-items: flex-start; padding: 13px 18px; border-bottom: 1px solid var(--border); background: #304462; color: rgba(255, 255, 255, .56); }
.profile-cover::after { position: absolute; right: 20px; bottom: 17px; width: 74px; height: 38px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; content: ""; opacity: .55; transform: rotate(-3deg); }
.profile-cover > span { position: relative; z-index: 1; margin-left: auto; font-family: "Courier New", monospace; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-align: right; }
.profile-cover--violet-ocean { background: #443551; }
.profile-cover--blue-night { background: #304b63; }
.profile-cover--green-forest { background: #315346; }
.profile-cover--rose-dusk { background: #633b49; }
.profile-cover--amber-sun { background: #69503a; }
.profile-hero__body { padding: 0 24px 24px; }
.profile-hero__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: -37px; }
.profile-hero__identity { position: relative; z-index: 2; display: flex; min-width: 0; align-items: flex-end; gap: 14px; }
.profile-hero__identity .avatar { width: 78px; height: 78px; border: 5px solid var(--surface); font-size: 21px; }
.profile-hero__identity > div { min-width: 0; padding: 43px 0 0; }
.profile-hero__identity h1 { margin: 0; font-family: var(--font-editorial); font-size: clamp(25px, 4vw, 34px); line-height: 1.05; }
.profile-hero__identity p { margin: 5px 0 0; color: var(--muted); font: 12px/1.2 "Courier New", monospace; }
.profile-actions { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-bottom: 5px; }
.profile-hero__bio { max-width: 680px; margin: 22px 0 15px; color: var(--text-soft); font-size: 15px; line-height: 1.65; }
.profile-metadata, .profile-hero__membership { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.profile-metadata > span, .profile-hero__membership > span, .profile-private-note { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.profile-metadata__private { padding: 4px 7px; border: 1px dashed var(--border); background: var(--canvas-soft); }
.profile-metadata__private small { color: var(--brand-strong); font: 700 9px/1 "Courier New", monospace; text-transform: uppercase; }
.profile-hero__membership { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.profile-number-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 22px; border: 1px solid var(--border); background: var(--canvas-soft); }
.profile-number-grid > div { padding: 13px 10px; border-right: 1px solid var(--border); text-align: center; }
.profile-number-grid > div:last-child { border-right: 0; }
.profile-number-grid strong { display: block; font-family: var(--font-editorial); font-size: 19px; }
.profile-number-grid span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.profile-tabs { display: flex; margin: 18px 0 22px; overflow-x: auto; border: 1px solid var(--border); background: var(--surface); scrollbar-width: thin; }
.profile-tabs a { display: inline-flex; min-height: 44px; flex: 1 0 auto; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-right: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 750; }
.profile-tabs a:last-child { border-right: 0; }
.profile-tabs a:hover { background: var(--canvas-soft); color: var(--text); }
.profile-tabs a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--brand); background: var(--brand-soft); color: var(--text); }
.profile-tabs small { min-width: 18px; padding: 2px 5px; border: 1px solid var(--border); background: var(--canvas); color: var(--faint); font-size: 9px; text-align: center; }
.profile-tab-panel { min-width: 0; outline: none; }
.profile-tab-panel:focus-visible { outline: 2px solid var(--focus); outline-offset: 5px; }
.profile-overview-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(260px, .92fr); gap: 16px; }
.reputation-card { padding: 20px; }
.reputation-card > header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.reputation-card__icon { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--border); background: var(--brand-soft); color: var(--brand-strong); }
.reputation-card h2 { margin: 1px 0 0; font-family: var(--font-editorial); font-size: 30px; }
.reputation-card .eyebrow { margin: 0; }
.reputation-level { padding: 5px 8px; border: 1px solid var(--border); background: var(--canvas-soft); color: var(--text-soft); font: 700 10px/1 "Courier New", monospace; text-transform: uppercase; }
.reputation-progress, .profile-badge__progress, .badge-detail__progress > div { overflow: hidden; height: 9px; border: 1px solid var(--border); background: var(--canvas); }
.reputation-progress { margin-top: 18px; }
.reputation-progress span, .profile-badge__progress span, .badge-detail__progress > div span { display: block; height: 100%; background: var(--brand); }
.reputation-card__next { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.reputation-breakdown { margin-top: 16px; padding-top: 13px; border-top: 1px dashed var(--border); }
.reputation-breakdown summary { color: var(--text-soft); cursor: pointer; font-size: 12px; font-weight: 700; }
.reputation-breakdown dl { display: grid; gap: 7px; margin: 12px 0 0; }
.reputation-breakdown dl div { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 11px; }
.reputation-breakdown dt, .reputation-breakdown dd { margin: 0; }
.reputation-breakdown dd { color: var(--text-soft); font-weight: 800; }
.profile-badge-preview { padding: 18px; }
.profile-badge-preview .section-header { margin-bottom: 10px; }
.profile-badge-preview__list { display: grid; gap: 6px; }
.profile-badge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-badge { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; min-height: 104px; padding: 15px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-align: left; }
.profile-badge:hover { border-color: var(--text-soft); background: var(--surface-hover); }
.profile-badge--locked { color: var(--muted); }
.profile-badge--compact { min-height: 54px; padding: 8px 10px; }
.profile-badge__icon { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--border); background: var(--canvas-soft); color: var(--faint); }
.profile-badge--earned .profile-badge__icon { border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); background: var(--brand-soft); color: var(--brand-strong); box-shadow: 2px 2px 0 color-mix(in srgb, var(--brand) 28%, transparent); }
.profile-badge__copy { display: grid; min-width: 0; gap: 3px; }
.profile-badge__copy strong { font-size: 13px; }
.profile-badge__copy small { color: var(--faint); font: 700 9px/1.2 "Courier New", monospace; letter-spacing: .04em; text-transform: uppercase; }
.profile-badge__copy > span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.profile-badge__progress { position: absolute; right: 15px; bottom: 11px; left: 69px; height: 5px; }
.profile-activity-list { overflow: hidden; }
.profile-activity-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 66px; padding: 11px 14px; border-bottom: 1px solid var(--border-soft); color: var(--text); }
.profile-activity-row:last-child { border-bottom: 0; }
a.profile-activity-row:hover { background: var(--surface-hover); }
.profile-activity-row__icon { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--border); background: var(--canvas-soft); color: var(--brand-strong); }
.profile-activity-row__copy { display: grid; min-width: 0; gap: 3px; }
.profile-activity-row__copy small { color: var(--faint); font: 700 9px/1 "Courier New", monospace; text-transform: uppercase; }
.profile-activity-row__copy strong { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.profile-activity-row time { color: var(--faint); font-size: 10px; white-space: nowrap; }
.profile-comment-list, .profile-saved-list { display: grid; gap: 10px; }
.profile-comment { padding: 16px 18px; }
.profile-comment > header, .profile-comment > header div, .profile-comment > footer { display: flex; align-items: center; gap: 8px; }
.profile-comment > header { justify-content: space-between; color: var(--muted); font-size: 11px; }
.profile-comment > header a { color: var(--brand-strong); font-weight: 700; }
.profile-comment > header time { white-space: nowrap; }
.profile-comment > p { margin: 14px 0; color: var(--text-soft); line-height: 1.55; white-space: pre-wrap; }
.profile-comment > footer { flex-wrap: wrap; padding-top: 11px; border-top: 1px dashed var(--border); }
.profile-comment > footer > span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.profile-comment > footer .button { margin-left: auto; }
.profile-saved-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 10px; }
.profile-saved-row .topic-mini { border: 0; }
.profile-edit-form { display: grid; gap: 17px; }
.profile-edit-summary { padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--danger) 50%, var(--border)); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.profile-edit-preview { position: relative; display: flex; min-height: 112px; align-items: flex-end; gap: 11px; padding: 54px 14px 12px; overflow: hidden; border: 1px solid var(--border); }
.profile-edit-cover { position: absolute; z-index: 0; inset: 0 0 48px; border-bottom: 1px solid var(--border); }
.profile-edit-preview .avatar, .profile-edit-preview > span:last-child { position: relative; z-index: 1; }
.profile-edit-preview .avatar { border: 4px solid var(--surface-raised); }
.profile-edit-preview > span:last-child { display: grid; padding-bottom: 3px; }
.profile-edit-preview strong { color: var(--text); }
.profile-edit-preview small { color: var(--muted); }
.profile-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-edit-field { display: grid; gap: 5px; }
.profile-edit-field > label, .profile-choice-fieldset legend, .profile-privacy-fieldset legend { color: var(--text); font-size: 12px; font-weight: 750; }
.profile-edit-field > small, .profile-privacy-fieldset > p { color: var(--muted); font-size: 10px; }
.profile-edit-field input, .profile-edit-field textarea, .profile-edit-field select { width: 100%; border: 1px solid var(--border); border-radius: 2px; background: var(--canvas); color: var(--text); }
.profile-edit-field input, .profile-edit-field select { min-height: 42px; padding: 8px 10px; }
.profile-edit-field textarea { padding: 10px; resize: vertical; }
.profile-edit-field [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 14%, transparent); }
.profile-edit-count { margin: -12px 0 0; color: var(--faint); font-size: 10px; text-align: right; }
.profile-choice-fieldset, .profile-privacy-fieldset { display: grid; gap: 10px; margin: 0; padding: 13px; border: 1px solid var(--border); }
.profile-choice-fieldset legend, .profile-privacy-fieldset legend { padding: 0 6px; }
.profile-avatar-options, .profile-cover-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.profile-avatar-options label, .profile-cover-options label { display: grid; min-width: 0; justify-items: center; gap: 5px; padding: 7px 3px; border: 1px solid transparent; cursor: pointer; }
.profile-avatar-options label:has(input:checked), .profile-cover-options label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.profile-avatar-options input, .profile-cover-options input { position: absolute; opacity: 0; pointer-events: none; }
.profile-avatar-options label:focus-within, .profile-cover-options label:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.profile-avatar-options small, .profile-cover-options small { overflow: hidden; width: 100%; color: var(--muted); font-size: 9px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.profile-cover-swatch { width: 100%; height: 26px; border: 1px solid rgba(255,255,255,.15); }
.profile-privacy-fieldset label { display: flex; align-items: center; gap: 9px; color: var(--text-soft); font-size: 12px; cursor: pointer; }
.profile-privacy-fieldset input { width: 17px; height: 17px; accent-color: var(--brand); }
.badge-detail { display: grid; justify-items: center; gap: 10px; text-align: center; }
.badge-detail__icon { display: grid; width: 70px; height: 70px; place-items: center; border: 2px solid var(--border); background: var(--canvas-soft); color: var(--muted); }
.badge-detail__icon .icon { width: 30px; height: 30px; }
.badge-detail__icon--earned { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); box-shadow: 3px 3px 0 color-mix(in srgb, var(--brand) 30%, transparent); }
.badge-detail .eyebrow, .badge-detail h3, .badge-detail p { margin: 0; }
.badge-detail h3 { color: var(--text); font-family: var(--font-editorial); font-size: 25px; }
.badge-detail > p:not(.eyebrow) { max-width: 390px; }
.badge-detail .notice { width: 100%; margin-top: 7px; text-align: left; }
.badge-detail__progress { display: grid; width: 100%; gap: 6px; }
.badge-detail__progress small { color: var(--muted); }

@media (max-width: 959px) {
  .profile-number-grid { grid-template-columns: repeat(3, 1fr); }
  .profile-number-grid > div:nth-child(3) { border-right: 0; }
  .profile-number-grid > div:nth-child(-n + 3) { border-bottom: 1px solid var(--border); }
  .profile-overview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 639px) {
  .profile-cover { height: 112px; padding: 9px 12px; }
  .profile-cover::after { right: 12px; bottom: 13px; width: 52px; }
  .profile-hero__body { padding: 0 14px 18px; }
  .profile-hero__top { display: grid; margin-top: -29px; }
  .profile-hero__identity .avatar { width: 64px; height: 64px; border-width: 4px; font-size: 17px; }
  .profile-hero__identity > div { padding-top: 34px; }
  .profile-hero__identity h1 { font-size: 25px; }
  .profile-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; padding: 0; }
  .profile-actions .button { min-width: 0; padding-right: 9px; padding-left: 9px; }
  .profile-actions .button:nth-child(3) { grid-column: 1 / -1; }
  .profile-hero__bio { margin-top: 17px; }
  .profile-number-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-number-grid > div:nth-child(3) { border-right: 1px solid var(--border); }
  .profile-number-grid > div:nth-child(2n) { border-right: 0; }
  .profile-number-grid > div:nth-child(-n + 4) { border-bottom: 1px solid var(--border); }
  .profile-tabs { margin-right: -12px; margin-left: -12px; border-right: 0; border-left: 0; }
  .profile-tabs a { min-width: 96px; }
  .profile-badge-grid { grid-template-columns: 1fr; }
  .profile-activity-row { grid-template-columns: auto minmax(0, 1fr); }
  .profile-activity-row time { grid-column: 2; }
  .profile-comment > header { align-items: flex-start; }
  .profile-comment > header div { display: grid; gap: 2px; }
  .profile-comment > footer .button { width: 100%; margin: 4px 0 0; }
  .profile-saved-row { grid-template-columns: 1fr; }
  .profile-saved-row .button { width: 100%; }
  .profile-edit-grid { grid-template-columns: 1fr; }
  .profile-avatar-options, .profile-cover-options { grid-template-columns: repeat(3, 1fr); }
}

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

@media (forced-colors: active) {
  .brand__mark,
  .mobile-nav__create,
  .button--primary { border: 1px solid ButtonText; }
  .category-dot,
  .unread-dot { forced-color-adjust: none; }
}

/* Part 9: notifications, safety controls, and community safeguards */
.notification-filters { display: flex; gap: 5px; margin-bottom: 18px; padding: 5px; overflow-x: auto; border: 1px solid var(--border); border-radius: 5px; background: var(--canvas-soft); scrollbar-width: thin; }
.notification-filters a { min-width: max-content; padding: 8px 11px; border: 1px solid transparent; border-radius: 3px; color: var(--muted); font-size: 11px; font-weight: 800; }
.notification-filters a:hover { color: var(--text); }
.notification-filters a[aria-current="page"] { border-color: var(--border); background: var(--surface); color: var(--text); }
.notification-groups { display: grid; gap: 22px; }
.notification-group > h2 { margin: 0 0 8px; color: var(--muted); font: 800 10px/1.2 var(--font-sans); letter-spacing: .09em; text-transform: uppercase; }
.notification-item { grid-template-columns: auto minmax(0, 1fr) 34px; align-items: center; padding: 0; }
.notification-item__icon { margin-left: 15px; border-radius: 3px; }
.notification-item__link { display: grid; gap: 3px; min-width: 0; padding: 14px 10px; }
.notification-item__type { color: var(--brand-strong); font: 800 9px/1.2 var(--font-sans); letter-spacing: .08em; text-transform: uppercase; }
.notification-item__state { display: grid; width: 30px; height: 30px; margin-right: 10px; place-items: center; border-radius: 3px; background: transparent; color: var(--muted); cursor: pointer; }
.notification-item__state:hover { background: var(--canvas-soft); color: var(--text); }
.notification-item__state .unread-dot { margin: 0; }
.content-warning { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 14px; padding: 14px; border: 1px solid color-mix(in srgb, var(--warning) 55%, var(--border)); border-left: 4px solid var(--warning); border-radius: 4px; background: color-mix(in srgb, var(--warning) 8%, var(--surface)); }
.content-warning > .icon { color: var(--warning); }
.content-warning strong { font-size: 13px; }
.content-warning p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.blocked-content { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px dashed var(--border); background: var(--canvas-soft); }
.blocked-content > .icon { color: var(--muted); }
.blocked-content strong { font-size: 12px; }
.blocked-content p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.comment--blocked { padding: 6px 0; border: 0; background: transparent; }
.moderation-list { display: grid; gap: 12px; }
.moderation-card { padding: 18px; border-left: 4px solid var(--warning); }
.moderation-card--resolved { border-left-color: var(--agree); opacity: .82; }
.moderation-card > header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.moderation-card > header time { margin-left: auto; color: var(--faint); font-size: 10px; }
.moderation-type, .moderation-status { padding: 4px 6px; border: 1px solid var(--border); border-radius: 2px; color: var(--muted); font: 800 9px/1 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; }
.moderation-status--open { border-color: color-mix(in srgb, var(--warning) 55%, var(--border)); color: var(--warning); }
.moderation-card__title { display: block; margin-bottom: 6px; color: var(--text); font: 700 18px/1.25 var(--font-editorial); }
.moderation-card__content { display: -webkit-box; margin: 0 0 14px; overflow: hidden; color: var(--text-soft); font-size: 13px; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.moderation-card dl { display: grid; gap: 6px; margin: 0; padding: 11px; border: 1px solid var(--border-soft); background: var(--canvas-soft); }
.moderation-card dl div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; font-size: 11px; }
.moderation-card dt { color: var(--muted); font-weight: 800; }
.moderation-card dd { margin: 0; color: var(--text-soft); }
.moderation-card footer { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 14px; }
.moderation-card footer > span { color: var(--muted); font-size: 11px; }
.settings-stack { padding: 18px; }
.settings-switches, .safety-list { display: grid; border-top: 1px solid var(--border-soft); }
.settings-switch { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 2px; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.settings-switch strong, .safety-row strong { display: block; font-size: 12px; }
.settings-switch small, .safety-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.settings-switch input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--brand); }
.safety-list + .safety-list { margin-top: 12px; }
.safety-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--border-soft); }
.safety-row__icon { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--border); color: var(--muted); }
.settings-empty { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.share-dialog { display: grid; gap: 14px; }
.share-dialog > p { margin: 0; color: var(--text-soft); font-size: 13px; }
.share-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.share-link { width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 3px; background: var(--canvas-soft); color: var(--text-soft); font: 11px/1.3 "Courier New", monospace; }

@media (max-width: 620px) {
  .notification-item { grid-template-columns: auto minmax(0, 1fr) 34px; }
  .notification-item__icon { width: 32px; height: 32px; margin-left: 10px; }
  .notification-item__link { padding: 12px 6px; }
  .notification-item p { font-size: 12px; }
  .content-warning, .blocked-content { grid-template-columns: auto minmax(0, 1fr); }
  .content-warning .button, .blocked-content .button { grid-column: 1 / -1; width: 100%; }
  .moderation-card { padding: 14px; }
  .moderation-card dl div { grid-template-columns: 1fr; gap: 2px; }
  .moderation-card footer .button { flex: 1 1 46%; }
  .settings-row { align-items: stretch; flex-direction: column; }
  .settings-row .segmented { align-self: flex-start; }
  .settings-stack .section-header { align-items: flex-start; flex-direction: column; }
  .safety-row { grid-template-columns: auto minmax(0, 1fr); }
  .safety-row .button { grid-column: 1 / -1; width: 100%; }
  .share-link-row { grid-template-columns: 1fr; }
}

/* Step 10: final touch, overflow, and compact-screen safeguards */
.global-search input { height: 100%; align-self: stretch; }
.dropdown {
  max-width: calc(100vw - 24px);
  overflow-wrap: anywhere;
}
.feed-search input { height: 100%; }

@media (hover: none), (max-width: 639px) {
  .brand { min-width: 40px; min-height: 40px; }
  .notification-item { grid-template-columns: auto minmax(0, 1fr) 48px; }
  .notification-item__state { width: 40px; height: 40px; margin-right: 6px; }
  .comment-action { min-width: 40px; min-height: 40px; }
  .comment__collapse { min-height: 40px; }
  .topic-action,
  .search-history-item > button,
  .create-tag button,
  .toast button { width: 40px; height: 40px; }
  .create-tag-suggestions button { min-height: 40px; padding: 8px 4px; }
  .feed-categories a,
  .feed-scope-switch a,
  .result-tabs a,
  .notification-filters a,
  .segmented button,
  .demographic-tabs button,
  .filter-field select,
  .feed-sort select,
  .discussion-sort select,
  .comment-composer__buttons .button,
  .button--sm { min-height: 40px; }
  .create-tag-suggestions button,
  .notification-filters a { min-width: 40px; }
  .topic-card__category,
  .topic-detail__category,
  .topic-breadcrumb a,
  .tag { display: inline-flex; min-width: 40px; min-height: 40px; align-items: center; }
  .comment__name-row a { display: inline-flex; min-height: 40px; align-items: center; }
}

/* New features: following feed, scarce community crowns, and structured duels */
.feed-scope-switch {
  display: inline-flex;
  gap: 3px;
  width: max-content;
  margin: 0 0 10px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--canvas-soft);
}
.feed-scope-switch a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.feed-scope-switch a:hover { color: var(--text); }
.feed-scope-switch a[aria-current="page"] { border-color: var(--border); background: var(--surface); color: var(--text); box-shadow: 1px 1px 0 var(--border-soft); }

.crown-spotlight {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding: 17px 19px;
  border: 1px solid var(--border);
  border-left: 5px solid #d9a441;
  border-radius: 4px;
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--canvas-soft);
}
.crown-spotlight__icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid color-mix(in srgb, #d9a441 55%, var(--border));
  background: color-mix(in srgb, #d9a441 11%, var(--canvas));
  color: #d9a441;
  transform: rotate(-3deg);
}
.crown-spotlight__copy { min-width: 0; }
.crown-spotlight .eyebrow, .crown-spotlight h2, .crown-spotlight p { margin: 0; }
.crown-spotlight h2 { margin-top: 3px; font: 700 21px/1.2 var(--font-editorial); }
.crown-spotlight h2 a { color: var(--text); }
.crown-spotlight h2 a:hover { color: var(--brand-strong); }
.crown-spotlight__copy > p:last-child { max-width: 760px; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.duel-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--brand) 50%, var(--border));
  border-radius: 2px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font: 800 9px/1 var(--font-sans);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.topic-card__signals { flex-wrap: wrap; }
.topic-detail__metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.duel-board { margin-top: 18px; padding: 0; overflow: hidden; }
.duel-board__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--canvas-soft);
}
.duel-board__header .eyebrow, .duel-board__header h2, .duel-board__header p { margin: 0; }
.duel-board__header h2 { margin-top: 4px; font: 700 25px/1.15 var(--font-editorial); }
.duel-board__header p:last-child { margin-top: 7px; color: var(--muted); font-size: 12px; }
.duel-board__mark { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--brand-strong); }
.duel-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.duel-side { min-width: 0; padding: 18px; }
.duel-side + .duel-side { border-left: 1px solid var(--border); }
.duel-side > header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 3px solid var(--agree); }
.duel-side--opposed > header { border-bottom-color: var(--disagree); }
.duel-side__number { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid var(--border); background: var(--canvas-soft); color: var(--muted); font: 800 12px/1 "Courier New", monospace; }
.duel-side > header .eyebrow, .duel-side > header h3 { margin: 0; }
.duel-side > header h3 { margin-top: 2px; font: 700 18px/1.2 var(--font-editorial); }
.duel-side__percent { color: var(--agree); font: 700 24px/1 var(--font-editorial); }
.duel-side--opposed .duel-side__percent { color: var(--disagree); }
.duel-argument-list { display: grid; gap: 9px; padding: 14px 0; }
.duel-argument { padding: 13px; border: 1px solid var(--border); border-radius: 3px; background: var(--canvas-soft); }
.duel-argument > p { margin: 0; color: var(--text-soft); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.duel-argument footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 9px; border-top: 1px dashed var(--border); }
.duel-argument__author { display: flex; min-width: 0; align-items: center; gap: 7px; color: var(--text); }
.duel-argument__author > span:last-child { display: grid; min-width: 0; }
.duel-argument__author strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.duel-argument__author small { color: var(--muted); font-size: 9px; }
.duel-support { display: inline-flex; min-width: 48px; min-height: 34px; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--border); border-radius: 2px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 800; }
.duel-support:hover, .duel-support--active { border-color: var(--agree); color: var(--agree); }
.duel-form { display: grid; gap: 8px; padding: 13px; border: 1px dashed var(--border); background: var(--surface); }
.duel-form h4 { margin: 0 0 3px; font: 700 15px/1.3 var(--font-editorial); }
.duel-form > label, .duel-confidence label { color: var(--text-soft); font-size: 10px; font-weight: 800; }
.duel-form textarea { width: 100%; min-height: 86px; padding: 9px; resize: vertical; border: 1px solid var(--border); border-radius: 2px; background: var(--canvas); color: var(--text); font: inherit; font-size: 12px; }
.duel-form textarea:focus { border-color: var(--focus); outline: 2px solid color-mix(in srgb, var(--focus) 25%, transparent); outline-offset: 1px; }
.duel-confidence { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; align-items: center; }
.duel-confidence input { width: 100%; accent-color: var(--brand); }
.duel-confidence output { color: var(--brand-strong); }
.duel-confidence small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.duel-form__error { margin: 0; padding: 7px 8px; border-left: 3px solid var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--canvas)); color: var(--text-soft); font-size: 10px; }
.duel-form .button { justify-self: start; }

@media (max-width: 820px) {
  .topic-detail__metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .duel-columns { grid-template-columns: 1fr; }
  .duel-side + .duel-side { border-top: 1px solid var(--border); border-left: 0; }
}

@media (max-width: 620px) {
  .crown-spotlight { grid-template-columns: auto minmax(0, 1fr); padding: 14px; }
  .crown-spotlight .button { grid-column: 1 / -1; width: 100%; }
  .crown-spotlight__icon { width: 42px; height: 42px; }
  .feed-scope-switch { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .feed-scope-switch a { justify-content: center; }
  .topic-detail__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duel-board__header { padding: 15px; }
  .duel-board__header h2 { font-size: 21px; }
  .duel-side { padding: 14px; }
}
