/* ==========================================================================
   PASCAL COMMUNITY — SIGNAL RANGE FINDER
   Near-black instrument chassis · cyan phosphor · amber alert
   Barlow Condensed instruments · Barlow body · JetBrains Mono data
   ========================================================================== */

:root {
  color-scheme: dark;
  --void: #07090b;
  --chassis: #0e1215;
  --panel: #141a1e;
  --panel-raised: #1a2228;
  --panel-soft: #1c252b;
  --line: #243038;
  --line-strong: #33424c;
  --ink: #e8eef2;
  --ink-soft: #b8c4cc;
  --muted: #7a8a94;
  --muted-strong: #9fb0ba;
  --signal: #3dd6c6;
  --signal-hot: #6aefe0;
  --signal-dim: rgba(61, 214, 198, .12);
  --signal-ink: #041412;
  --amber: #e8a84a;
  --amber-dim: rgba(232, 168, 74, .12);
  --amber-ink: #1a1206;
  --danger: #e07068;
  --danger-dim: rgba(224, 112, 104, .1);
  --green: #7ecf9a;
  --green-dim: rgba(126, 207, 154, .1);
  --focus: #3dd6c6;
  --shadow: rgba(0, 0, 0, .45);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --content-max: 1200px;
  --font-body: "Barlow", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC", sans-serif;
  --font-display: "Barlow Condensed", "Bahnschrift", "Segoe UI", "PingFang SC", sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Cascadia Mono", monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-snap: cubic-bezier(.22, .9, .28, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 300px;
  background: var(--void);
  scroll-behavior: smooth;
}

body {
  min-width: 300px;
  min-height: 100vh;
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(61, 214, 198, .28);
  color: var(--ink);
}

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

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

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

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

/* Ambient field ------------------------------------------------------------ */

.field-canvas {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(61, 214, 198, .045), transparent 60%),
    var(--void);
  pointer-events: none;
}

.field-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.field-vignette {
  position: fixed;
  z-index: 1;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgba(4, 6, 7, .55) 100%);
  pointer-events: none;
}

.site-header,
#app,
.site-footer,
.toast-region {
  position: relative;
  z-index: 2;
}

/* Utilities ---------------------------------------------------------------- */

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 12px;
  transform: translateY(-150%);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--signal);
  color: var(--signal-ink);
  font-weight: 700;
  transition: transform .18s var(--ease-out);
}

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

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

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  vertical-align: -.15em;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--signal);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "▸ ";
  color: var(--muted);
}

.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
}

.loading-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 8px rgba(61, 214, 198, .7);
  animation: loading-dot 1s ease-in-out infinite;
}

@keyframes loading-dot {
  0%, 100% { opacity: .3; transform: scale(.75); }
  50% { opacity: 1; transform: scale(1); }
}

/* Header ------------------------------------------------------------------- */

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 16, .88);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.header-scanline {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

.header-scanline::after {
  position: absolute;
  top: 0;
  left: -20%;
  width: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--signal), transparent);
  content: "";
  animation: scanline 7s linear infinite;
}

@keyframes scanline {
  0% { left: -20%; }
  100% { left: 110%; }
}

.header-inner {
  display: flex;
  width: min(100% - 40px, var(--content-max));
  min-height: 68px;
  align-items: center;
  gap: 28px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
}

.brand-ring {
  position: absolute;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: border-color .3s var(--ease-out);
}

.brand-ring-outer {
  inset: 0;
}

.brand-ring-mid {
  inset: 7px;
  border-color: var(--line);
}

.brand-core {
  position: relative;
  z-index: 1;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--signal);
  color: var(--signal-ink);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(61, 214, 198, .35);
  transition: box-shadow .3s var(--ease-out), transform .3s var(--ease-out);
}

.brand:hover .brand-ring-outer {
  border-color: var(--signal);
}

.brand:hover .brand-ring-mid {
  border-color: rgba(61, 214, 198, .4);
}

.brand:hover .brand-core {
  box-shadow: 0 0 18px rgba(61, 214, 198, .6);
  transform: scale(1.06);
}

.brand-copy {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.brand-copy strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-copy small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0;
}

.primary-nav {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 22px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  height: 100%;
  align-items: center;
  padding: 0 3px;
  color: var(--muted-strong);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  transition: color .2s var(--ease-out);
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--signal);
  box-shadow: 0 0 8px rgba(61, 214, 198, .6);
  content: "";
  opacity: 0;
  transform: scaleX(.3);
  transform-origin: left;
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
}

.nav-link.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.header-signal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding-left: 4px;
}

.header-signal + .header-actions {
  margin-left: 0;
}

.signal-pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
}

.signal-pulse::after {
  position: absolute;
  inset: -4px;
  border: 1px solid var(--signal);
  border-radius: 50%;
  content: "";
  animation: pulse-ring 2.4s var(--ease-out) infinite;
}

@keyframes pulse-ring {
  0% { opacity: .9; transform: scale(.5); }
  70%, 100% { opacity: 0; transform: scale(1.6); }
}

.signal-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-loading {
  width: 88px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--panel-raised);
  animation: pulse 1.2s ease-in-out infinite alternate;
}

.header-user {
  display: inline-flex;
  max-width: 220px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 8px 4px 4px;
  background: var(--panel);
  color: var(--ink-soft);
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}

.header-user:hover {
  border-color: var(--line-strong);
  background: var(--panel-raised);
}

.avatar {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(61, 214, 198, .35);
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--signal);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.header-user-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

.header-user-plan {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0;
  line-height: 1.2;
}

/* Buttons ------------------------------------------------------------------ */

.button {
  position: relative;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  transition: background .18s var(--ease-out), border-color .18s var(--ease-out),
    color .18s var(--ease-out), transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--signal);
  color: var(--signal-ink);
  font-weight: 700;
}

.button-primary:hover {
  background: var(--signal-hot);
  box-shadow: 0 4px 20px rgba(61, 214, 198, .3);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--panel-raised);
  color: var(--ink-soft);
}

.button-secondary:hover {
  border-color: var(--muted);
  color: var(--ink);
}

.button-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted-strong);
}

.button-quiet:hover {
  background: var(--panel-raised);
  color: var(--ink);
}

.button-danger {
  border-color: rgba(224, 112, 104, .3);
  background: var(--danger-dim);
  color: var(--danger);
}

.button-small {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 11px;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-strong);
  transition: background .18s var(--ease-out), border-color .18s var(--ease-out),
    color .18s var(--ease-out), transform .18s var(--ease-out);
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--panel-raised);
  color: var(--ink);
  transform: translateY(-1px);
}

.icon-button.is-danger {
  color: var(--danger);
}

.icon-button.is-danger.is-armed {
  border-color: rgba(224, 112, 104, .5);
  background: rgba(224, 112, 104, .14);
}

/* Footer ------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 72px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
}

.footer-inner {
  display: flex;
  width: min(100% - 40px, var(--content-max));
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin: 0 auto;
}

.footer-mark {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 6px rgba(61, 214, 198, .6);
}

.footer-separator {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

/* App & page shell ---------------------------------------------------------- */

#app {
  min-height: 600px;
}

#app:focus {
  outline: none;
}

#app.is-routing {
  animation: route-fade .32s var(--ease-out) both;
}

@keyframes route-fade {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.page-shell {
  width: min(100% - 40px, var(--content-max));
  margin: 0 auto;
  padding: 44px 0 16px;
}

.page-shell > * {
  animation: enter-rise .55s var(--ease-out) both;
}

.page-shell > *:nth-child(2) { animation-delay: .06s; }
.page-shell > *:nth-child(3) { animation-delay: .12s; }
.page-shell > *:nth-child(4) { animation-delay: .18s; }

@keyframes enter-rise {
  0% {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.page-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.page-subtitle {
  max-width: 560px;
  margin: 10px 0 0;
  color: var(--muted-strong);
  font-size: 14px;
}

/* List view — the return feed ----------------------------------------------- */

.list-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: clamp(28px, 4vw, 52px);
}

.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}

.toolbar-count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
}

.toolbar-count strong {
  color: var(--signal);
  font-weight: 500;
}

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

.search-field {
  position: relative;
  display: flex;
  min-width: 200px;
  align-items: center;
}

.search-field .icon {
  position: absolute;
  left: 10px;
  color: var(--muted);
  font-size: 15px;
  transition: color .2s var(--ease-out);
}

.search-field input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--panel);
  padding: 7px 10px 7px 33px;
  color: var(--ink);
  font-size: 13px;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out), box-shadow .2s var(--ease-out);
}

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

.search-field input:focus {
  border-color: rgba(61, 214, 198, .5);
  background: var(--panel-raised);
  box-shadow: 0 0 0 3px rgba(61, 214, 198, .08);
}

.search-field input:focus ~ .icon,
.search-field:focus-within .icon {
  color: var(--signal);
}

.sort-tabs {
  display: inline-flex;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px;
  background: var(--panel);
}

.sort-tab {
  min-height: 30px;
  border-radius: 3px;
  padding: 5px 12px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  transition: background .18s var(--ease-out), color .18s var(--ease-out);
}

.sort-tab:hover {
  color: var(--ink-soft);
}

.sort-tab.is-active {
  background: var(--panel-soft);
  color: var(--signal);
}

.topic-feed {
  border-bottom: 1px solid var(--line-strong);
}

.topic-row {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 100px;
  align-items: center;
  gap: 15px;
  min-height: 92px;
  border-bottom: 1px solid var(--line);
  padding: 15px 8px 15px 12px;
  transition: background .2s var(--ease-out), border-color .2s var(--ease-out);
}

.topic-row::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--signal);
  box-shadow: 0 0 10px rgba(61, 214, 198, .5);
  content: "";
  opacity: 0;
  transform: scaleY(0);
  transition: opacity .22s var(--ease-out), transform .22s var(--ease-out);
}

.topic-row:hover {
  background: linear-gradient(90deg, rgba(61, 214, 198, .045), transparent 45%);
}

.topic-row:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

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

.topic-feed.is-staggered .topic-row {
  animation: return-enter .5s var(--ease-out) both;
  animation-delay: calc(var(--stagger, 0) * 55ms);
}

@keyframes return-enter {
  0% {
    opacity: 0;
    transform: translateX(-14px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.topic-row-avatar {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

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

.topic-title {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .18s var(--ease-out);
}

.topic-title:hover {
  color: var(--signal-hot);
}

.topic-meta {
  display: flex;
  overflow: hidden;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  white-space: nowrap;
}

.topic-meta-dot {
  width: 3px;
  height: 3px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--line-strong);
}

.topic-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-stats {
  display: grid;
  gap: 3px;
  justify-items: end;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.3;
  text-align: right;
}

.topic-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.topic-stat .icon {
  font-size: 12px;
}

.topic-updated {
  color: var(--muted-strong);
}

.tag {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 7px;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.tag-accent {
  border-color: rgba(232, 168, 74, .4);
  background: var(--amber-dim);
  color: var(--amber);
}

.tag-green {
  border-color: rgba(126, 207, 154, .35);
  color: var(--green);
}

/* Sidebar — channel strip ---------------------------------------------------- */

.sidebar {
  display: grid;
  gap: 30px;
}

.sidebar-section {
  border-top: 1px solid var(--line-strong);
  padding-top: 14px;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-heading small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.sidebar-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.category-list,
.member-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-link {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 7px 8px;
  color: var(--muted-strong);
  font-size: 13px;
  text-align: left;
  transition: background .18s var(--ease-out), color .18s var(--ease-out);
}

.category-link:hover {
  background: var(--panel-raised);
  color: var(--ink);
}

.category-link.is-active {
  background: var(--signal-dim);
  color: var(--signal);
}

.category-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.category-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.category-dot[data-tone="coral"] { background: var(--signal); box-shadow: 0 0 6px rgba(61, 214, 198, .5); }
.category-dot[data-tone="green"] { background: var(--green); box-shadow: 0 0 6px rgba(126, 207, 154, .5); }
.category-dot[data-tone="amber"] { background: var(--amber); box-shadow: 0 0 6px rgba(232, 168, 74, .5); }

.category-count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}

.member-row .avatar {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.member-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-soft);
  font-size: 13px;
}

.member-plan {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0;
}

/* Empty / error / skeleton ---------------------------------------------------- */

.empty-state,
.error-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  border-bottom: 1px solid var(--line-strong);
  padding: 44px 24px;
  text-align: center;
}

.empty-state-content,
.error-state-content {
  max-width: 380px;
  animation: enter-rise .5s var(--ease-out) both;
}

.empty-symbol {
  position: relative;
  display: inline-grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted-strong);
  font-size: 19px;
}

.empty-symbol::after {
  position: absolute;
  inset: -7px;
  border: 1px dashed var(--line);
  border-radius: 50%;
  content: "";
  animation: slow-spin 24s linear infinite;
}

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

.empty-state h2,
.error-state h2 {
  margin: 18px 0 6px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.empty-state p,
.error-state p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.error-state .empty-symbol {
  border-color: rgba(224, 112, 104, .4);
  color: var(--danger);
}

.skeleton-feed {
  border-bottom: 1px solid var(--line-strong);
}

.skeleton-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 100px;
  gap: 15px;
  min-height: 92px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 15px 8px 15px 12px;
}

.skeleton-block {
  border-radius: 3px;
  background: linear-gradient(90deg, var(--panel-raised) 25%, var(--panel-soft) 50%, var(--panel-raised) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -80% 0; }
}

.skeleton-avatar { width: 36px; height: 36px; border-radius: 50%; }
.skeleton-title { width: min(70%, 280px); height: 15px; }
.skeleton-meta { width: min(45%, 190px); height: 10px; margin-top: 10px; }
.skeleton-stats { width: 68px; height: 28px; justify-self: end; }

@keyframes pulse {
  from { opacity: .4; }
  to { opacity: .8; }
}

/* Detail view ----------------------------------------------------------------- */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.breadcrumb a {
  transition: color .18s var(--ease-out);
}

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

.breadcrumb .icon {
  font-size: 13px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.detail-title {
  max-width: 860px;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(30px, 3.6vw, 48px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.08;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
}

.detail-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.thread {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.post {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 32px;
  border-bottom: 1px solid var(--line);
  padding: 30px 0 32px;
  animation: enter-rise .5s var(--ease-out) both;
  animation-delay: calc(var(--stagger, 0) * 70ms);
}

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

.post-author {
  min-width: 0;
}

.post-author .avatar {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  font-size: 16px;
}

.post-author-name {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-author-plan {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.post-time {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0;
}

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

.post-content p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.post-index {
  float: right;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
}

.reply-area {
  margin-top: 34px;
  border-top: 1px solid var(--line-strong);
  padding-top: 22px;
}

.section-label {
  margin: 0 0 14px;
  color: var(--muted-strong);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.reply-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.reply-compose textarea {
  min-height: 96px;
}

.reply-compose .button {
  min-height: 42px;
}

/* Forms ------------------------------------------------------------------------ */

.form-field {
  display: grid;
  gap: 7px;
}

.form-field + .form-field {
  margin-top: 16px;
}

.form-label {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.form-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--panel);
  padding: 10px 12px;
  color: var(--ink);
  font-size: 14px;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out), box-shadow .2s var(--ease-out);
}

.input {
  min-height: 44px;
}

.textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.7;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted);
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: #455863;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(61, 214, 198, .55);
  background: var(--panel-raised);
  box-shadow: 0 0 0 3px rgba(61, 214, 198, .08);
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.auth-code-input {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0;
}

.form-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid rgba(224, 112, 104, .3);
  border-radius: var(--radius-sm);
  margin: 16px 0 0;
  padding: 10px 12px;
  background: var(--danger-dim);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
  animation: enter-rise .3s var(--ease-out) both;
}

.form-error.is-visible {
  display: flex;
}

.form-error .icon {
  flex: 0 0 auto;
  margin-top: 2px;
}

.form-success {
  display: none;
  border: 1px solid rgba(126, 207, 154, .3);
  border-radius: var(--radius-sm);
  margin: 16px 0 0;
  padding: 10px 12px;
  background: var(--green-dim);
  color: var(--green);
  font-size: 13px;
}

.form-success.is-visible {
  display: block;
}

.check-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 12px;
  cursor: pointer;
}

.check-control input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--signal);
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

/* Auth --------------------------------------------------------------------------- */

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  align-items: stretch;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(20, 26, 30, .6), rgba(14, 18, 21, .6));
  overflow: hidden;
}

.auth-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  padding: 48px clamp(28px, 6vw, 88px) 48px clamp(28px, 5vw, 56px);
  overflow: hidden;
}

.auth-aside::before {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(61, 214, 198, .04) 39px, rgba(61, 214, 198, .04) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(61, 214, 198, .04) 39px, rgba(61, 214, 198, .04) 40px);
  content: "";
  mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, black 20%, transparent 75%);
  pointer-events: none;
}

.auth-aside > * {
  position: relative;
}

.auth-aside-kicker {
  color: var(--signal);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-aside h1 {
  max-width: 560px;
  margin: 26px 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(48px, 6.5vw, 88px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: .94;
  text-transform: uppercase;
}

.auth-aside h1 span {
  display: block;
  color: transparent;
  -webkit-text-stroke: 1px var(--muted);
}

.auth-aside-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.auth-aside-footer strong {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(61, 214, 198, .4);
  border-radius: 50%;
  color: var(--signal);
  font-family: var(--font-display);
  font-size: 12px;
}

.auth-form-wrap {
  display: flex;
  align-items: center;
  padding: 48px clamp(22px, 5vw, 60px);
}

.auth-form {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.auth-form-heading {
  margin-bottom: 26px;
}

.auth-form-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.auth-form-heading p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-submit {
  width: 100%;
  margin-top: 24px;
}

.auth-switch {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.auth-switch a {
  color: var(--signal);
  font-weight: 600;
}

.auth-switch a:hover {
  color: var(--signal-hot);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.auth-note .icon {
  color: var(--green);
  font-size: 14px;
}

/* Account & subscription -------------------------------------------------------- */

.account-head {
  align-items: center;
}

.subscription-state {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
}

.subscription-state > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.subscription-state.is-active {
  border-color: rgba(126, 207, 154, .4);
  background: var(--green-dim);
  color: var(--green);
}

.subscription-state.is-expired {
  border-color: rgba(232, 168, 74, .35);
  background: var(--amber-dim);
  color: var(--amber);
}

.account-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.account-summary {
  min-width: 0;
  padding: 36px clamp(24px, 5vw, 56px) 36px 0;
}

.account-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.account-summary-copy h2,
.subscription-form-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.1;
}

.account-summary-copy > p:last-child {
  max-width: 58ch;
  margin: 12px 0 0;
  color: var(--muted-strong);
  font-size: 13px;
}

.account-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 34px 0 0;
  border-top: 1px solid var(--line);
}

.account-facts > div {
  min-width: 0;
  padding: 16px 18px 0 0;
}

.account-facts dt {
  color: var(--muted);
  font-size: 10px;
}

.account-facts dd {
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subscription-redeem {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding: 36px 0 36px clamp(24px, 4vw, 44px);
}

.subscription-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.subscription-form-head > .icon {
  color: var(--signal);
  font-size: 24px;
}

.subscription-redeem > .button {
  width: 100%;
  margin-top: 20px;
}

/* New topic ----------------------------------------------------------------------- */

.new-topic-shell {
  width: min(100%, 780px);
  margin: 0 auto;
}

.new-topic-head {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 30px;
}

.new-topic-head .icon-button {
  margin-top: 4px;
}

.new-topic-form {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  padding: 26px 0 28px;
}

.new-topic-form .form-field + .form-field {
  margin-top: 20px;
}

.new-topic-form .textarea {
  min-height: 240px;
}

/* Toasts --------------------------------------------------------------------------- */

.toast-region {
  position: fixed;
  z-index: 60;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(370px, calc(100% - 40px));
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid rgba(61, 214, 198, .36);
  border-radius: var(--radius-sm);
  background: rgba(20, 26, 30, .96);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 34px var(--shadow);
  padding: 13px 14px;
  color: var(--ink-soft);
  font-size: 13px;
  pointer-events: auto;
  animation: toast-in .3s var(--ease-out) both;
}

.toast.is-success { border-color: rgba(126, 207, 154, .42); }
.toast.is-error { border-color: rgba(224, 112, 104, .42); }

.toast .icon { margin-top: 2px; color: var(--signal); }
.toast.is-success .icon { color: var(--green); }
.toast.is-error .icon { color: var(--danger); }

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

/* Admin ----------------------------------------------------------------------------- */

.admin-page {
  padding-top: 36px;
}

.admin-masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.admin-identity {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  padding: 7px 12px;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
}

.admin-identity .icon {
  color: var(--signal);
  font-size: 15px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 560px;
  border-top: 1px solid var(--line-strong);
}

.admin-rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--line);
  padding: 22px 22px 22px 0;
}

.admin-rail-link {
  position: relative;
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  transition: background .18s var(--ease-out), color .18s var(--ease-out);
}

.admin-rail-link .icon {
  width: 16px;
  height: 16px;
}

.admin-rail-link:hover {
  background: var(--panel);
  color: var(--ink-soft);
}

.admin-rail-link.is-active {
  background: var(--panel-raised);
  color: var(--ink);
}

.admin-rail-link.is-active::before {
  position: absolute;
  top: 50%;
  left: -22px;
  width: 3px;
  height: 20px;
  background: var(--signal);
  box-shadow: 0 0 8px rgba(61, 214, 198, .6);
  content: "";
  transform: translateY(-50%);
}

.admin-rail-link.is-active .icon {
  color: var(--signal);
}

.admin-workspace {
  min-width: 0;
  padding: 30px 0 24px 36px;
}

.admin-loading {
  display: grid;
  min-height: 120px;
  place-items: center;
  border-bottom: 1px solid var(--line);
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  overflow: hidden;
}

.admin-metrics > div {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 20px 22px;
}

.admin-metrics > div + div {
  border-left: 1px solid var(--line);
}

.admin-metrics span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.admin-metrics strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.admin-section {
  margin-top: 42px;
}

.admin-section-head {
  display: flex;
  min-height: 48px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 14px;
}

.admin-section-head h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.admin-section-head h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0;
}

.admin-section-head .eyebrow {
  margin-bottom: 4px;
}

.admin-toolbar {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 2px;
}

.admin-search {
  position: relative;
  width: min(100%, 320px);
}

.admin-search > .icon {
  position: absolute;
  top: 50%;
  left: 11px;
  color: var(--muted);
  font-size: 15px;
  transform: translateY(-50%);
}

.admin-search input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--panel);
  padding: 8px 11px 8px 35px;
  color: var(--ink);
  font-size: 13px;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}

.admin-search input:focus {
  border-color: rgba(61, 214, 198, .5);
  background: var(--panel-raised);
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.admin-table th {
  height: 42px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  text-align: left;
  text-transform: uppercase;
}

.admin-table td {
  height: 66px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  vertical-align: middle;
}

.admin-user-table th:first-child,
.admin-user-table td:first-child {
  width: 27%;
}

.admin-user-table th:last-child,
.admin-user-table td:last-child {
  width: 180px;
  text-align: right;
}

.admin-user-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.admin-user-cell > span:last-child {
  display: grid;
  min-width: 0;
}

.admin-user-cell strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-cell small {
  font-size: 10px;
  font-weight: 600;
}

.status-danger {
  color: var(--danger);
}

.role-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.role-badge.is-admin {
  border-color: rgba(61, 214, 198, .4);
  background: var(--signal-dim);
  color: var(--signal);
}

.admin-role-action {
  min-width: 140px;
  white-space: nowrap;
}

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

.admin-pager {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
}

.admin-pager > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.admin-error {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  min-height: 96px;
  align-items: center;
  gap: 15px;
  border-top: 1px solid rgba(224, 112, 104, .3);
  border-bottom: 1px solid rgba(224, 112, 104, .3);
  color: var(--danger);
}

.admin-error > .icon {
  font-size: 20px;
}

.admin-error strong {
  color: var(--ink);
}

.admin-error p {
  margin: 3px 0 0;
  color: var(--muted-strong);
  font-size: 12px;
}

/* Admin — configs --------------------------------------------------------------------- */

.config-admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, .88fr) minmax(390px, 1.12fr);
  align-items: start;
  gap: 36px;
}

.config-admin-layout.is-library-only {
  display: block;
}

.published-section {
  min-width: 0;
}

.published-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 80px;
  min-height: 78px;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  transition: background .18s var(--ease-out);
}

.published-row:hover {
  background: linear-gradient(90deg, rgba(61, 214, 198, .03), transparent 50%);
}

.published-main {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.published-version {
  display: grid;
  min-height: 28px;
  place-items: center;
  border: 1px solid rgba(232, 168, 74, .35);
  border-radius: var(--radius-sm);
  background: var(--amber-dim);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
}

.published-main strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.published-main p {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.published-meta {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.published-actions {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
}

/* Admin — registration codes ------------------------------------------------------------ */

.code-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 42px;
}

.code-generator-column {
  display: grid;
  min-width: 0;
  gap: 26px;
}

.code-generator {
  width: min(100%, 820px);
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 26px;
}

.code-generator > .icon {
  color: var(--signal);
  font-size: 22px;
}

.code-generator-fields {
  display: grid;
  grid-template-columns: minmax(90px, .55fr) minmax(110px, .65fr) minmax(220px, 1.4fr);
  gap: 12px;
  margin-top: 22px;
}

.code-generator-fields .form-field + .form-field {
  margin-top: 0;
}

.code-expiry-head {
  display: flex;
  min-height: 22px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.generated-codes {
  min-width: 0;
  border: 1px solid rgba(61, 214, 198, .3);
  border-radius: var(--radius-md);
  background: var(--signal-dim);
  padding: 18px;
  animation: enter-rise .45s var(--ease-out) both;
}

.generated-code-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.generated-code-warning {
  margin: 10px 0 14px;
  color: var(--muted-strong);
  font-size: 11px;
}

.generated-code-list {
  display: grid;
  max-height: 260px;
  gap: 6px;
  overflow-y: auto;
}

.generated-code-list code {
  display: block;
  border: 1px solid rgba(61, 214, 198, .25);
  border-radius: var(--radius-sm);
  background: rgba(7, 9, 11, .6);
  padding: 7px 10px;
  color: var(--signal);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0;
}

.code-status-filter .select {
  width: auto;
  min-height: 34px;
  padding: 6px 30px 6px 10px;
  font-size: 12px;
}

.registration-code-section {
  min-width: 0;
}

.registration-code-table th:first-child {
  width: 25%;
}

.registration-code-table th:nth-child(2) {
  width: 84px;
}

.registration-code-table th:nth-child(3) {
  width: 92px;
}

.registration-code-table th:nth-child(6) {
  width: 16%;
}

.registration-code-table th:last-child {
  width: 52px;
}

.registration-code-table td {
  height: 60px;
}

.registration-code-table {
  min-width: 860px;
}

.registration-code-table td:last-child {
  text-align: right;
}

.registration-code-mask {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.registration-code-id {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.registration-code-note {
  display: block;
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.registration-code-dates,
.registration-code-user {
  display: grid;
  gap: 1px;
}

.registration-code-dates span,
.registration-code-user strong {
  font-size: 11px;
  font-weight: 600;
}

.registration-code-dates small,
.registration-code-user small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.registration-code-user strong {
  color: var(--ink);
}

.code-duration {
  color: var(--ink-soft);
  font-size: 11px;
  white-space: nowrap;
}

.code-status {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
}

.code-status.is-available {
  border-color: rgba(126, 207, 154, .4);
  background: var(--green-dim);
  color: var(--green);
}

.code-status.is-used {
  border-color: rgba(61, 214, 198, .35);
  background: var(--signal-dim);
  color: var(--signal);
}

.code-status.is-expired {
  border-color: rgba(232, 168, 74, .35);
  background: var(--amber-dim);
  color: var(--amber);
}

.code-status.is-revoked {
  border-color: rgba(224, 112, 104, .35);
  background: var(--danger-dim);
  color: var(--danger);
}

/* Admin — audit --------------------------------------------------------------------------- */

.audit-list {
  border-top: 1px solid var(--line);
}

.admin-section-head + .audit-list {
  border-top: 0;
}

.audit-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 130px 100px;
  min-height: 58px;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  transition: background .18s var(--ease-out);
}

.audit-row:hover {
  background: linear-gradient(90deg, rgba(61, 214, 198, .03), transparent 50%);
}

.audit-mark {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 6px rgba(61, 214, 198, .5);
}

.audit-main {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 12px;
}

.audit-main strong {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 12px;
}

.audit-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-actor,
.audit-row time {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-row time {
  text-align: right;
}

/* Responsive -------------------------------------------------------------------------------- */

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

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

  .sidebar-section:last-child {
    grid-column: 1 / -1;
  }

  .auth-shell {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  }

  .auth-aside {
    padding-right: 36px;
  }

  .admin-layout {
    display: block;
  }

  .admin-rail {
    overflow-x: auto;
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
  }

  .admin-rail-link {
    min-width: max-content;
  }

  .admin-rail-link.is-active::before {
    top: auto;
    right: 8px;
    bottom: -1px;
    left: 8px;
    width: auto;
    height: 2px;
    transform: none;
  }

  .admin-workspace {
    padding: 26px 0 14px;
  }

  .config-admin-layout,
  .code-admin-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

}

@media (max-width: 700px) {
  .header-inner,
  .footer-inner,
  .page-shell {
    width: min(100% - 28px, var(--content-max));
  }

  .header-inner {
    min-height: 60px;
    gap: 12px;
  }

  .brand-copy small,
  .header-signal,
  .header-user-plan {
    display: none;
  }

  .header-user {
    border-color: transparent;
    background: transparent;
  }

  .header-user-name {
    max-width: 96px;
  }

  .header-actions > .button-quiet span {
    display: none;
  }

  .header-actions > .button-quiet {
    width: 36px;
    padding: 0;
  }

  .page-shell {
    padding-top: 30px;
  }

  .page-head,
  .detail-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 24px;
  }

  .page-head .button,
  .detail-actions {
    width: 100%;
  }

  .page-head .button {
    min-height: 42px;
  }

  .detail-actions .button {
    flex: 1;
  }

  .feed-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .toolbar-actions {
    width: 100%;
  }

  .search-field {
    min-width: 0;
    flex: 1;
  }

  .topic-row,
  .skeleton-row {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
    min-height: 86px;
    padding: 14px 4px 14px 10px;
  }

  .topic-stats,
  .skeleton-stats {
    display: none;
  }

  .topic-title {
    font-size: 15px;
  }

  .topic-meta {
    font-size: 9px;
  }

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

  .sidebar-section:last-child {
    grid-column: auto;
  }

  .post {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px 0 26px;
  }

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

  .post-author .avatar {
    grid-row: 1 / span 3;
    margin: 0;
  }

  .post-author-name {
    grid-column: 2;
    grid-row: 1;
  }

  .post-author-plan {
    grid-column: 2;
    grid-row: 2;
  }

  .post-time {
    grid-column: 2;
    grid-row: 3;
    margin-top: 0;
  }

  .reply-compose {
    grid-template-columns: minmax(0, 1fr);
  }

  .reply-compose .button {
    width: 100%;
  }

  .auth-shell {
    display: block;
    min-height: 0;
  }

  .auth-aside {
    min-height: 200px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 30px 24px 28px;
  }

  .auth-aside h1 {
    margin-top: 18px;
    font-size: clamp(44px, 13vw, 64px);
  }

  .auth-aside-footer {
    display: none;
  }

  .auth-form-wrap {
    padding: 30px 20px 36px;
  }

  .auth-form {
    max-width: none;
  }

  .new-topic-head {
    margin-bottom: 24px;
  }

  .primary-nav {
    flex: 0 0 auto;
    gap: 10px;
  }

  .nav-link {
    flex: 0 0 auto;
    font-size: 13px;
    white-space: nowrap;
  }

  .account-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-summary {
    padding: 28px 0;
  }

  .subscription-redeem {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding: 28px 0 32px;
  }

  .registration-code-table {
    min-width: 0;
  }

  .admin-masthead {
    align-items: flex-start;
    margin-bottom: 24px;
  }

  .admin-identity span {
    display: none;
  }

  .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-metrics > div:nth-child(3) {
    border-left: 0;
  }

  .admin-metrics > div:nth-child(n+3) {
    border-top: 1px solid var(--line);
  }

  .admin-table-wrap {
    overflow: visible;
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 14px;
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
  }

  .admin-table td,
  .admin-user-table td:first-child,
  .admin-user-table td:last-child,
  .registration-code-table td:last-child {
    width: auto;
    height: auto;
    border-bottom: 0;
    text-align: left;
  }

  .admin-table td::before {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .admin-table td:first-child,
  .admin-table td:last-child {
    grid-column: 1 / -1;
  }

  .admin-table td:first-child::before,
  .admin-table td:last-child::before {
    display: none;
  }

  .admin-role-action {
    width: 100%;
  }

  .published-row {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .published-meta {
    display: none;
  }

  .audit-row {
    grid-template-columns: 10px minmax(0, 1fr) 90px;
  }

  .audit-actor {
    display: none;
  }
}

@media (max-width: 430px) {
  .brand-copy {
    display: none;
  }

  .header-inner {
    gap: 6px;
  }

  .primary-nav {
    gap: 4px;
  }

  .nav-link {
    padding-right: 4px;
    padding-left: 4px;
    font-size: 12px;
  }

  .header-actions {
    gap: 4px;
  }

  .header-user {
    max-width: 42px;
    padding: 4px;
  }

  .header-user-copy {
    display: none;
  }

  .header-actions > .button-quiet {
    padding-right: 8px;
    padding-left: 8px;
  }

  .header-actions .button span {
    display: none;
  }

  .header-actions .button {
    width: 36px;
    padding: 0;
  }

  .sort-tab {
    padding-right: 8px;
    padding-left: 8px;
  }

  .detail-title {
    font-size: 28px;
  }

  .admin-metrics strong {
    font-size: 28px;
  }

  .code-generator-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .code-generator-fields .form-field + .form-field {
    margin-top: 14px;
  }

  .account-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-facts > div {
    padding-top: 12px;
  }

  .audit-row {
    grid-template-columns: 10px minmax(0, 1fr);
    padding: 12px 0;
  }

  .audit-row time {
    grid-column: 2;
    text-align: left;
  }
}

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

  .field-canvas,
  .header-scanline {
    display: none;
  }
}
