:root {
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --bg: #0b0b0d;
  --bg-elevated: #101013;
  --surface: #131316;
  --surface-2: #17171b;
  --surface-hover: #1b1b20;
  --border: #222226;
  --border-strong: #2c2c32;
  --border-faint: #1a1a1e;

  --text: #ededf0;
  --text-2: #a0a0aa;
  --text-3: #666670;
  --text-invert: #0b0b0d;

  --accent: #e5484d;
  --accent-hover: #f2555a;
  --accent-soft: rgba(229, 72, 77, 0.12);
  --accent-soft-border: rgba(229, 72, 77, 0.28);
  --success: #3fb950;
  --warning: #d29922;
  --info: #4493f8;

  --header-height: 56px;
  --footer-height: 44px;
  --sidebar-width: 248px;
  --sidebar-collapsed: 68px;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --ring: 0 0 0 3px rgba(229, 72, 77, 0.35);

  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-layout: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scrollbar-color: var(--border-strong) transparent;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-track {
  background: transparent;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

a {
  color: var(--text);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* TOPBAR */
.topbar {
  height: var(--header-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 40;
}

.topbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.topbar-group:last-child {
  justify-content: flex-end;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  margin-right: 8px;
}
.brand-logo {
  width: 26px;
  height: 26px;
  color: var(--accent);
  flex-shrink: 0;
}
.brand .brand-bracket {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-weight: 400;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 auto;
}
.topnav a {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--transition), background var(--transition);
}
.topnav a:hover {
  color: var(--text);
  background: var(--surface-2);
}
.topnav a.active {
  color: var(--text);
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  transition: color var(--transition), background var(--transition);
}
.icon-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}
.icon-btn i {
  font-size: 20px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition),
    color var(--transition), transform var(--transition);
}
.btn:active {
  transform: translateY(1px);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-ghost {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.btn-ghost-red {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}
.btn-ghost-red:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
}

/* LAYOUT */
.app-container {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* LEFT SIDEBAR */
.sidebar-left {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 16px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: width var(--transition-layout), margin-left var(--transition-layout),
    padding var(--transition-layout), opacity var(--transition);
}
.sidebar-left.collapsed {
  width: var(--sidebar-collapsed);
  padding: 16px 8px;
}
.sidebar-left.hidden {
  margin-left: calc(-1 * var(--sidebar-width));
  opacity: 0;
  pointer-events: none;
}
.sidebar-left.collapsed.hidden {
  margin-left: calc(-1 * var(--sidebar-collapsed));
}

.side-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 10px;
  margin-bottom: 6px;
  white-space: nowrap;
}

.side-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-nav-group.hidden-group .side-label,
.side-nav-group.hidden-group .nav-link {
  visibility: hidden;
  opacity: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}
.nav-link i {
  font-size: 18px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}
.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}
.nav-link.active {
  color: var(--text);
  background: var(--surface-2);
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.nav-link .nav-label {
  overflow: hidden;
}

.sidebar-left.collapsed .side-nav-group .side-label {
  display: none;
}
.sidebar-left.collapsed .nav-link {
  justify-content: center;
  padding: 8px;
}
.sidebar-left.collapsed .nav-link .nav-label {
  display: none;
}

/* RIGHT SIDEBAR */
.sidebar-right {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
  transition: width var(--transition-layout), margin-right var(--transition-layout),
    opacity var(--transition), padding var(--transition-layout);
}
.sidebar-right.hidden {
  margin-right: calc(-1 * var(--sidebar-width));
  opacity: 0;
  pointer-events: none;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.signal-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}
.signal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.signal-card-header i {
  color: var(--text-3);
  font-size: 16px;
}
.signal-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}
.signal-label {
  font-size: 12px;
  color: var(--text-3);
}

.signal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.signal-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.signal-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.dot-live {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}
.dot-info {
  background: var(--info);
}
.dot-ok {
  background: var(--success);
}
.signal-item-text {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.4;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px 64px;
  background: var(--bg);
}

/* FLASH / TOAST */
.flashes {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.flash-success {
  border-left: 3px solid var(--success);
}
.flash-danger {
  border-left: 3px solid var(--accent);
}
.flash-info {
  border-left: 3px solid var(--info);
}

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

/* HERO */
.hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 64px 0 48px;
  max-width: 900px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--accent);
}
.hero-title {
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.98;
  color: var(--text);
}
.hero-title .accent {
  color: var(--accent);
}
.hero-sub {
  font-size: 18px;
  color: var(--text-2);
  max-width: 640px;
  line-height: 1.6;
}
.hero-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.hero-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  margin-top: 8px;
}

/* STATS */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 48px 0;
}
.stat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color var(--transition), background var(--transition);
}
.stat:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.stat-label {
  font-size: 13px;
  color: var(--text-3);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* FEATURE GRID */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 48px 0;
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition), transform var(--transition),
    background var(--transition);
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  background: var(--surface-2);
}
.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-border);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.card-icon.card-icon-blue {
  background: rgba(68, 147, 248, 0.1);
  border-color: rgba(68, 147, 248, 0.25);
  color: var(--info);
}
.card-icon.card-icon-green {
  background: rgba(63, 185, 80, 0.1);
  border-color: rgba(63, 185, 80, 0.25);
  color: var(--success);
}
.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.card-text {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.55;
}
.card-link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}
.card-link:hover {
  color: var(--accent-hover);
}

/* MANIFESTO */
.manifesto {
  margin: 48px 0;
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface);
}
.manifesto blockquote {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}
.manifesto footer {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* AUTH */
.auth-wrap {
  max-width: 420px;
  margin: 48px auto 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.auth-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.auth-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control::placeholder {
  color: var(--text-3);
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.error-text {
  font-size: 12.5px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
}
.error-text::before {
  content: "!";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-border);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.auth-switch {
  text-align: center;
  font-size: 14px;
  color: var(--text-2);
}
.auth-switch a {
  color: var(--accent);
  font-weight: 500;
}
.auth-switch a:hover {
  text-decoration: underline;
}
.btn-block {
  width: 100%;
  margin-top: 4px;
}

/* FOOTER */
.footer {
  height: var(--footer-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}
.footer .footer-brand {
  color: var(--text-2);
}
.footer a {
  color: var(--text-3);
}
.footer a:hover {
  color: var(--text);
}
.footer .footer-watch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer .footer-watch i {
  color: var(--accent);
  font-size: 14px;
}

/* PAGE HEAD */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 8px 0 6px;
}
.page-sub {
  color: var(--text-2);
  font-size: 15px;
}
.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* SECTION */
.section-block {
  margin: 40px 0;
}
.section-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* CATEGORY LIST */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
}
.category-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--transition), background var(--transition),
    transform var(--transition);
}
.category-row:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.category-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.category-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}
.category-desc {
  font-size: 13.5px;
  color: var(--text-3);
}
.category-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.category-last {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-2);
}
.category-chevron {
  color: var(--text-3);
  font-size: 16px;
}

/* THREAD LIST */
.thread-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.thread-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--transition), background var(--transition);
}
.thread-row:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.thread-badge {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border-faint);
  color: var(--text-3);
  font-size: 16px;
}
.thread-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.thread-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thread-excerpt {
  font-size: 13px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thread-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.thread-stats i {
  margin-right: 4px;
}
.thread-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 12.5px;
  white-space: nowrap;
  min-width: 80px;
}
.thread-author {
  color: var(--text-2);
}
.thread-time {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

/* POSTS */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.post {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 20px;
}
.post-op {
  border-left: 3px solid var(--accent);
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.post-author {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text);
}
.post-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  margin-left: auto;
}
.post-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  overflow-wrap: break-word;
}
.post-edited {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
}
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-border);
}
.role-badge-accent {
  color: var(--info);
  background: rgba(68, 147, 248, 0.1);
  border-color: rgba(68, 147, 248, 0.25);
}
.role-badge-writer {
  color: var(--success);
  background: rgba(63, 185, 80, 0.1);
  border-color: rgba(63, 185, 80, 0.25);
}

/* MOD TOOLBAR */
.mod-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-faint);
  flex-wrap: wrap;
}
.inline-form {
  display: inline-flex;
  margin-left: auto;
}
.icon-btn-danger:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.post-author {
  color: var(--text-2);
}
.post-author:hover {
  color: var(--text);
}

/* PROFILE */
.profile-head {
  margin-bottom: 32px;
}
.profile-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-border);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-info {
  flex: 1;
  min-width: 0;
}
.profile-name {
  display: flex;
  align-items: center;
  gap: 10px;
}
.profile-username {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.profile-joined {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 4px;
}
.profile-bio {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 14.5px;
  max-width: 640px;
}
.profile-stats {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}
.stat-pill i {
  font-size: 14px;
  color: var(--text-3);
}
.profile-edit {
  flex-shrink: 0;
}

/* THREAD HEAD */
.thread-head {
  margin-bottom: 24px;
}
.thread-head-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.thread-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-3);
  margin-top: 10px;
}
.thread-head-meta strong {
  color: var(--text-2);
}

/* REPLY SECTION */
.reply-section {
  margin-top: 32px;
}

/* COMPOSE CARD */
.compose-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.form-check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.form-check-input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* MARKDOWN EDITOR */
.editor {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
}
.editor:focus-within {
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.editor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
  transition: background var(--transition), color var(--transition);
}
.editor-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.editor-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.editor-btn i {
  font-size: 16px;
}
.editor-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}
.editor-spacer {
  flex: 1;
}
.editor-btn-preview {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}
.editor-btn-preview:hover {
  color: var(--accent);
}
.editor-textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.6;
  resize: vertical;
}
.editor-textarea:focus {
  outline: none;
}
.editor-textarea::placeholder {
  color: var(--text-3);
}
.editor-preview {
  padding: 14px 16px;
  min-height: 120px;
  max-height: 480px;
  overflow-y: auto;
}
.editor-hint {
  padding: 8px 16px;
  border-top: 1px solid var(--border-faint);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
}
.editor-hint a {
  color: var(--text-2);
}
.editor-hint a:hover {
  color: var(--accent);
}

/* RENDERED CONTENT TYPOGRAPHY */
.content {
  font-size: 15px;
  line-height: 1.68;
}
.content > *:first-child {
  margin-top: 0;
}
.content > *:last-child {
  margin-bottom: 0;
}
.content p {
  margin: 0.8em 0;
}
.content h1, .content h2, .content h3, .content h4 {
  margin: 1.3em 0 0.5em;
  font-weight: 600;
  color: var(--text);
}
.content h1 { font-size: 1.7em; }
.content h2 { font-size: 1.4em; }
.content h3 { font-size: 1.15em; }
.content h4 { font-size: 1em; }
.content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.content a:hover {
  color: var(--accent-hover);
}
.content ul, .content ol {
  margin: 0.8em 0;
  padding-left: 1.6em;
}
.content ul { list-style: disc; }
.content ol { list-style: decimal; }
.content li {
  margin: 0.3em 0;
}
.content blockquote {
  margin: 1em 0;
  padding: 4px 16px;
  border-left: 3px solid var(--accent);
  color: var(--text-2);
  font-style: italic;
}
.content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
.content pre {
  margin: 1em 0;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  line-height: 1.5;
}
.content pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.85em;
  color: var(--text-2);
}
.content table {
  margin: 1em 0;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}
.content th, .content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.content th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}
.content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.6em 0;
}
.content img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.page-body {
  max-width: 760px;
}

/* PAGINATION */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin: 24px 0 8px;
}
.page-btn {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition);
}
.page-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}
.page-btn.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.page-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}
.page-gap {
  color: var(--text-3);
  padding: 0 2px;
}

/* EMPTY STATE */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 48px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-3);
  font-size: 14px;
}
.empty-state i {
  font-size: 28px;
  color: var(--text-3);
}
.empty-state-lg {
  padding: 80px 20px;
  margin-top: 24px;
}
.empty-state a {
  color: var(--accent);
}
.empty-state a:hover {
  text-decoration: underline;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .topnav {
    display: none;
  }
  .sidebar-right {
    display: none;
  }
  .main-content {
    padding: 24px 20px 48px;
  }
}

@media (max-width: 768px) {
  .sidebar-left {
    position: absolute;
    left: 0;
    top: var(--header-height);
    bottom: var(--footer-height);
    z-index: 30;
    box-shadow: var(--shadow-lg);
  }
  .sidebar-left.hidden {
    margin-left: calc(-1 * var(--sidebar-width));
  }
  .sidebar-left.collapsed {
    width: var(--sidebar-width);
    padding: 16px 10px;
  }
  .sidebar-left.collapsed .side-label,
  .sidebar-left.collapsed .nav-label {
    display: initial;
    visibility: visible;
    opacity: 1;
  }
  .sidebar-left.collapsed .nav-link {
    justify-content: flex-start;
    padding: 8px 10px;
  }
  .hero {
    padding-top: 40px;
  }
  .hero-title {
    font-size: clamp(38px, 12vw, 60px);
  }
  .footer {
    font-size: 11px;
  }
  .footer .footer-brand span {
    display: none;
  }
  .category-meta {
    display: none;
  }
  .thread-stats {
    display: none;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* FORM ROW (two-up fields) */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

/* POST ACTIONS (edit/delete) */
.post-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
}

/* FILTER BAR */
.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.filter-pill {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface);
  transition: border-color var(--transition), color var(--transition),
    background var(--transition);
}
.filter-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.filter-pill-active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* BILL LIST */
.bill-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--transition), background var(--transition),
    transform var(--transition);
}
.bill-row:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.bill-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bill-number {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.bill-sub {
  font-size: 13px;
  color: var(--text-3);
}
.bill-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
  flex-shrink: 0;
}
.bill-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface-2);
}
.bill-status-introduced {
  color: var(--info);
  background: rgba(68, 147, 248, 0.1);
  border-color: rgba(68, 147, 248, 0.28);
}
.bill-status-in-committee {
  color: var(--warning);
  background: rgba(210, 153, 34, 0.1);
  border-color: rgba(210, 153, 34, 0.3);
}
.bill-status-passed {
  color: var(--success);
  background: rgba(63, 185, 80, 0.1);
  border-color: rgba(63, 185, 80, 0.28);
}
.bill-status-effective {
  color: var(--success);
  background: rgba(63, 185, 80, 0.1);
  border-color: rgba(63, 185, 80, 0.28);
}
.bill-status-defeated {
  color: var(--text-3);
  background: rgba(102, 102, 112, 0.12);
  border-color: rgba(102, 102, 112, 0.28);
}
.bill-deadline {
  font-size: 12.5px;
  color: var(--text-2);
  font-family: var(--font-mono);
}
.bill-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.bill-date {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.bill-date-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.bill-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ADMIN TABLE */
.admin-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th,
.admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-faint);
}
.admin-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  background: var(--bg-elevated);
}
.admin-table tbody tr:last-child td {
  border-bottom: none;
}
.admin-table tbody tr:hover {
  background: var(--surface-hover);
}
.admin-counts {
  display: flex;
  gap: 12px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 13px;
}
.admin-counts span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.admin-role-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.form-control-sm {
  padding: 5px 8px;
  font-size: 13px;
}

/* WRITERS ROOM */
.write-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--transition), background var(--transition);
}
.write-row:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.write-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: var(--text);
}
.write-title {
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.write-sub {
  font-size: 13px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.write-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
