:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --ink: #1c1c1a;
  --dim: #6e6e68;
  --border: #e5e4e0;
  --orange: #F7931D;
  --orange-light: #fef6eb;
  --green: #8CC63F;
  --green-light: #f2f9e9;
  --green-dark: #5a8a2a;
  --green-mid: #e4f2d2;
  --blue: #00ADEF;
  --blue-light: #e8f7fd;
  --link: #375163;
  --hot: #F7931D;
  --hot-light: #fef6eb;
  --sidebar-w: 220px;
}

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

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='512' height='512'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='512' height='512' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  z-index: 9999;
}

/* ─── HEADER ─── */
.site-header {
  background: var(--surface);
  border-bottom: 3px solid var(--orange);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.site-header .logo img {
  height: 40px;
  display: block;
}

.site-header .header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-header .search-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 14px;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  width: 220px;
  outline: none;
  transition: all 0.2s;
}

.site-header .search-box::placeholder { color: var(--dim); }
.site-header .search-box:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(0, 173, 239, 0.12);
  width: 280px;
}

.site-header .auth-links {
  display: flex;
  gap: 16px;
}

.site-header .auth-links a {
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--link);
  transition: color 0.15s;
}

.site-header .auth-links a:hover { color: var(--orange); }

/* ─── NAV BAR ─── */
.navbar {
  background: linear-gradient(to bottom, #f9a347, var(--orange));
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 0 32px;
  display: flex;
  gap: 0;
}

.nav-hamburger {
  display: none;
}

.nav-links {
  display: flex;
}

.nav-links a {
  display: block;
  padding: 10px 20px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}

.nav-links a:hover {
  background: rgba(0,0,0,0.1);
}

.nav-links a.active {
  background: rgba(0,0,0,0.15);
}

/* ─── LAYOUT ─── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  max-width: 1120px;
  margin: 0 auto;
  min-height: calc(100vh - 130px);
}

/* ─── SIDEBAR ─── */
.sidebar {
  padding: 28px 24px;
  background: var(--green-light);
  border-right: 1px solid #d5e8be;
  border-top: 3px solid var(--green);
  position: sticky;
  top: 0;
  min-height: calc(100vh - 130px);
  display: flex;
  flex-direction: column;
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 12px;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}

.sidebar-nav a:hover {
  background: var(--green-mid);
}

.sidebar-new-topic {
  font-weight: 600;
  background: var(--blue) !important;
  color: #fff !important;
  border-radius: 4px;
  text-align: center;
}

.sidebar-new-topic:hover {
  opacity: 0.85;
  background: var(--blue) !important;
}

.sidebar-nav a.active {
  background: var(--green-mid);
  color: var(--green-dark);
}

.sidebar-nav .icon {
  width: 18px;
  font-size: 15px;
  text-align: center;
  opacity: 0.7;
}

.sidebar-nav .badge {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--green-dark);
  background: var(--green-mid);
  padding: 1px 7px;
  border-radius: 10px;
}

.sidebar-stats {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.sidebar-stats dt {
  color: var(--dim);
  font-weight: 500;
  margin-top: 10px;
}

.sidebar-stats dt:first-child {
  margin-top: 0;
}

.sidebar-stats dd {
  margin: 0;
  font-weight: 600;
  color: var(--fg);
}

.sidebar-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.sidebar-pages a,
.sidebar-pages .current {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 3px;
  text-decoration: none;
}

.sidebar-pages a {
  background: #fff;
  color: var(--green);
  border: 1px solid #d5e8be;
}

.sidebar-pages a:hover {
  background: var(--green);
  color: #fff;
}

.sidebar-pages .current {
  background: var(--green);
  color: #fff;
  font-weight: 600;
}

.sidebar-back {
  font-size: 13px;
  color: var(--green-dark);
  text-decoration: none;
}

.sidebar-back:hover {
  text-decoration: underline;
}

.sidebar-subscribe {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #d5e8be;
}

.sidebar-subscribe a {
  display: block;
  text-align: center;
  padding: 10px;
  border: 1px solid #d5e8be;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--green-dark);
  margin-bottom: 8px;
  transition: all 0.15s;
}

.sidebar-subscribe a:hover {
  border-color: var(--green);
  background: var(--green-mid);
  color: var(--green-dark);
}

/* ─── MAIN ─── */
.main {
  padding: 28px 32px;
  min-width: 0;
  overflow-x: hidden;
}

/* ─── PINNED ─── */
.pinned {
  background: var(--green-light);
  border: 1px solid #d5e8be;
  border-left: 4px solid var(--green);
  border-radius: 4px 8px 8px 4px;
  padding: 20px 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.pinned .pin-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.pinned .pin-content h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.pinned .pin-content h3 a {
  color: var(--link);
  text-decoration: none;
}

.pinned .pin-content h3 a:hover {
  color: var(--orange);
}

.pinned .pin-content p {
  font-size: 13px;
  color: var(--dim);
}

.pinned .pin-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5a8a2a;
  background: #e4f2d2;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ─── TOPIC LIST ─── */
.topics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.topics-header h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.topics-header .sort {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--dim);
}

.topics-header .sort select {
  font-family: inherit;
  font-size: inherit;
  color: var(--ink);
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 500;
}

.topic-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.topic-row {
  display: grid;
  grid-template-columns: 1fr 100px 80px 100px;
  align-items: center;
  padding: 14px 20px 14px 17px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.2s;
  cursor: pointer;
}

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

.topic-row--new {
  border-left-color: var(--blue);
  background: var(--blue-light);
}

.topic-row:hover {
  background: var(--blue-light);
  border-left-color: var(--orange);
}

.new-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--blue);
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 4px;
}

.topic-title {
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.4;
}

.topic-title a {
  color: var(--link);
  text-decoration: none;
}

.topic-title a:hover {
  color: var(--blue);
}

.topic-author {
  font-size: 13px;
  color: var(--dim);
}

.topic-replies {
  text-align: center;
}

.topic-replies .count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 500;
}

.topic-replies .count.hot {
  color: #d47b15;
  background: var(--orange-light);
  padding: 2px 8px;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(247, 147, 29, 0.4);
}

.topic-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--dim);
  text-align: right;
}

.archive-notice {
  background: #fef9e7;
  border: 1px solid #f0d87e;
  color: #7a6312;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}

.topic-table-head {
  display: grid;
  grid-template-columns: 1fr 100px 80px 100px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafaf8;
}

.topic-table-head span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.topic-table-head span:nth-child(3) { text-align: center; }
.topic-table-head span:nth-child(4) { text-align: right; }

/* ─── LOAD MORE ─── */
.load-more {
  text-align: center;
  padding: 20px;
}

.mobile-new-topic {
  display: none;
}

.btn-new-topic {
  display: block;
  text-align: center;
  padding: 10px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border-radius: 6px;
}

.btn-new-topic:hover {
  opacity: 0.85;
}

.load-more a {
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
  padding: 8px 20px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  display: inline-block;
  transition: all 0.15s;
}

.load-more a:hover {
  background: var(--blue);
  color: #fff;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 680px) {
  .site-header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .site-header .header-right {
    width: 100%;
    gap: 12px;
  }

  .site-header .search-box {
    width: 100%;
    flex: 1;
  }

  .site-header .search-box:focus {
    width: 100%;
  }

  .navbar {
    padding: 0 16px;
    flex-direction: column;
  }

  .nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 12px 0;
    background: none;
    border: none;
    cursor: pointer;
    align-self: flex-start;
  }

  .nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.2s;
  }

  .nav-hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .nav-hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-links {
    display: none;
    flex-direction: column;
    padding-bottom: 8px;
  }

  .navbar.nav-open .nav-links {
    display: flex;
  }

  .nav-links a {
    padding: 10px 4px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #d5e8be;
    padding: 16px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }

  .sidebar-section {
    margin-bottom: 0;
    flex: 1;
    min-width: 140px;
  }

  .sidebar-subscribe {
    width: 100%;
    margin-top: 0;
    padding-top: 12px;
    border-top: 1px solid #d5e8be;
    display: flex;
    gap: 8px;
  }

  .sidebar-subscribe a {
    flex: 1;
    margin-bottom: 0;
  }

  .main {
    padding: 16px;
  }

  .topic-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 2px 12px;
    padding: 12px 16px;
  }

  .topic-title {
    grid-column: 1;
    grid-row: 1;
  }

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

  .topic-replies {
    grid-column: 2;
    grid-row: 1 / 3;
    text-align: right;
    align-self: center;
  }

  .topic-date {
    display: none;
  }

  .topic-table-head {
    display: none;
  }

  .footer-bar {
    flex-direction: column;
    gap: 6px;
    padding: 16px;
  }

  /* ── Auth links ── */
  .auth-links {
    font-size: 13px;
    gap: 8px;
  }

  /* ── Topics header ── */
  .topics-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  /* ── Topic view ── */
  .topic-view h2 {
    font-size: 18px;
  }

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

  .message {
    padding: 12px;
    margin-bottom: 8px;
  }

  .message-header {
    margin: -12px -12px 10px;
    padding: 6px 12px;
    flex-direction: column;
    gap: 2px;
    border-radius: 6px 6px 0 0;
  }

  .message-body {
    font-size: 14px;
  }

  .message-body blockquote.quote {
    padding: 8px 10px;
    font-size: 13px;
  }

  .message-actions {
    justify-content: flex-start;
  }

  .youtube-embed {
    max-width: 100%;
  }

  /* ── Reply form ── */
  .reply-form textarea {
    font-size: 14px;
  }

  /* ── Sidebar stats (topic view) ── */
  .sidebar-stats {
    font-size: 12px;
  }

  /* ── Search ── */
  .search-form {
    flex-direction: column;
  }

  .search-form button {
    align-self: flex-start;
  }

  .search-tabs a {
    padding: 8px 10px;
    font-size: 13px;
  }

  .search-result-snippet {
    font-size: 13px;
  }

  /* ── Forms ── */
  .form-page {
    max-width: 100%;
  }

  .form-page-wide {
    max-width: 100%;
  }

  /* ── User profile ── */
  .user-stats {
    padding: 14px;
  }

  .user-stats-grid {
    grid-template-columns: auto 1fr;
  }

  .user-post-header {
    flex-direction: column;
    gap: 2px;
  }

  /* ── Admin ── */
  .admin-item {
    padding: 10px;
  }

  .admin-item-header {
    flex-direction: column;
    gap: 2px;
  }

  .admin-item-preview {
    font-size: 13px;
  }

  .admin-item-actions {
    flex-wrap: wrap;
  }

  /* ── Pagination ── */
  .pagination {
    flex-wrap: wrap;
  }

  /* ── Archive notice ── */
  .archive-notice {
    font-size: 13px;
  }

  /* ── Load more ── */
  .load-more {
    padding: 12px 16px;
  }

  .sidebar {
    display: none;
  }

  .mobile-new-topic {
    display: block;
    margin-bottom: 12px;
  }
}

/* ─── TOPIC VIEW ─── */
.topic-view h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.topic-meta {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

.message-view-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}

.message-view-header a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

.message-view-header a:hover {
  text-decoration: underline;
}

.message {
  padding: 16px;
  margin-bottom: 12px;
  background: #f9fafb;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.message:nth-child(even) {
  background: #fff;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: -16px -16px 12px;
  padding: 8px 16px;
  background: #f0f1f3;
  border-bottom: 1px solid var(--rule);
  border-radius: 6px 6px 0 0;
  font-size: 13px;
}

.message-date {
  font-size: 12px;
  color: var(--dim);
}

.message-body {
  line-height: 1.6;
}

.quote-attribution {
  font-size: 13px;
  color: var(--dim);
  font-style: normal;
  display: block;
  margin: 8px 0 2px;
}

.message-body blockquote.quote {
  margin: 4px 0 12px;
  padding: 10px 14px;
  border-left: 3px solid var(--blue);
  background: #f0f4f8;
  border-radius: 0 4px 4px 0;
  font-size: 14px;
  color: #555;
}

.pagination {
  display: flex;
  gap: 6px;
  padding: 20px 0;
}

.pagination a,
.pagination .current {
  display: inline-block;
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 3px;
  text-decoration: none;
}

.pagination a {
  background: var(--green-light);
  color: var(--green);
}

.pagination a:hover {
  background: var(--green);
  color: #fff;
}

.pagination .current {
  background: var(--green);
  color: #fff;
  font-weight: 600;
}

/* ─── FORMS ─── */
.form-page {
  max-width: 380px;
}

.form-page h2 {
  margin: 0 0 20px;
}

.form-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}

.form-page label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--dim);
}

.form-page input[type="text"],
.form-page input[type="password"],
.form-page input[type="email"],
.form-page textarea {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 15px;
  margin-bottom: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.form-page textarea {
  resize: vertical;
  line-height: 1.5;
}

.form-page-wide {
  max-width: 640px;
}

.form-page input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(26, 73, 113, 0.15);
}

.form-page button {
  padding: 9px 24px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.form-page button:hover {
  opacity: 0.9;
}

.form-success {
  background: var(--green-light);
  border: 1px solid #b5d89a;
  color: #2d6a1e;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}

.form-divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 20px 0 16px;
  padding: 16px 0 0;
}

.form-divider legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--dim);
  padding: 0 8px 0 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 10px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.form-page input:disabled {
  background: #f3f4f6;
  color: var(--dim);
  cursor: not-allowed;
}

.recaptcha-wrapper {
  margin-bottom: 16px;
}

.auth-user {
  font-size: 13px;
  font-weight: 500;
}

/* ─── USER PROFILE ─── */
.user-profile h2 {
  margin: 0 0 12px;
}

.user-profile h3 {
  margin: 24px 0 12px;
  font-size: 16px;
}

.user-stats {
  background: #f9fafb;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 20px;
}

.user-stats-grid {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 6px 12px;
  margin: 0;
  font-size: 14px;
}

.user-stats-grid dt {
  color: var(--dim);
  font-weight: 500;
}

.user-stats-grid dd {
  margin: 0;
  font-weight: 600;
}

.user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 14px;
}

.user-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: help;
}

.user-badge--red {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.user-badge--gold {
  background: #fef9e7;
  color: #92650a;
  border: 1px solid #f0d87e;
}

.user-badge--purple {
  background: #f3f0ff;
  color: #6b21a8;
  border: 1px solid #c4b5fd;
}

.user-badge--blue {
  background: var(--blue-light);
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

.user-badge--green {
  background: var(--green-light);
  color: var(--green-dark);
  border: 1px solid #b5d89a;
}

.user-badge--orange {
  background: var(--orange-light);
  color: #b45309;
  border: 1px solid #fbbf24;
}

.user-post {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

.user-post:last-child {
  border-bottom: none;
}

.user-post-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.user-post-header a {
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
}

.user-post-header a:hover {
  text-decoration: underline;
}

.user-post-date {
  font-size: 12px;
  color: var(--dim);
}

.user-post-snippet {
  font-size: 14px;
  line-height: 1.5;
  color: #555;
  overflow-wrap: break-word;
}

.empty-state {
  color: var(--dim);
  font-style: italic;
}

.topic-author a {
  color: inherit;
  text-decoration: none;
}

.topic-author a:hover {
  text-decoration: underline;
}

.topic-meta a {
  color: inherit;
}

.topic-meta a:hover {
  text-decoration: underline;
}

.message-header a {
  color: inherit;
  text-decoration: none;
}

.message-header a:hover {
  text-decoration: underline;
}

/* ─── ADMIN ─── */
.admin-page h2 {
  margin: 0 0 20px;
}

.admin-page h3 {
  margin: 24px 0 12px;
  font-size: 16px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
}

.admin-page h3:first-of-type {
  margin-top: 0;
}

.admin-item {
  padding: 14px;
  margin-bottom: 10px;
  background: #f9fafb;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.admin-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.admin-item-header a {
  color: var(--blue);
  text-decoration: none;
}

.admin-item-header a:hover {
  text-decoration: underline;
}

.admin-item-meta {
  font-size: 12px;
  color: var(--dim);
}

.admin-item-preview {
  font-size: 14px;
  line-height: 1.5;
  color: #555;
  margin-bottom: 10px;
  overflow-wrap: break-word;
}

.admin-item-actions {
  display: flex;
  gap: 6px;
}

.btn-approve {
  padding: 5px 14px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
}

.btn-approve:hover {
  opacity: 0.85;
}

.btn-delete {
  padding: 5px 14px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: #fff;
  color: #b91c1c;
  cursor: pointer;
}

.btn-delete:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* ─── REPLY ─── */
.message-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
  margin-top: 10px;
}

.btn-reply {
  padding: 5px 14px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  border: 1px solid var(--blue);
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-reply:hover {
  opacity: 0.85;
}

.reply-form {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid var(--rule);
}

.reply-form h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.reply-form textarea {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.reply-form textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(26, 73, 113, 0.15);
}

.reply-form button {
  padding: 9px 24px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.reply-form button:hover {
  opacity: 0.9;
}

/* ─── EMBEDS ─── */
.message-body a {
  color: var(--blue);
  word-break: break-all;
}

.youtube-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 10px 0;
  max-width: 560px;
  border-radius: 6px;
  overflow: hidden;
}

.youtube-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ─── SEARCH ─── */
.search-page h2 {
  margin: 0 0 16px;
}

.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(26, 73, 113, 0.15);
}

.search-form button {
  padding: 8px 20px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.search-form button:hover {
  opacity: 0.9;
}

.search-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 16px;
}

.search-tabs a {
  padding: 8px 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.search-tabs a:hover {
  color: var(--fg);
}

.search-tabs a.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.search-summary {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 16px;
}

.search-result {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.search-result:last-child {
  border-bottom: none;
}

.search-result-title a {
  font-weight: 500;
  text-decoration: none;
  color: var(--blue);
}

.search-result-title a:hover {
  text-decoration: underline;
}

.search-result-meta {
  font-size: 12px;
  color: var(--dim);
  margin: 2px 0 6px;
}

.search-result-snippet {
  font-size: 14px;
  line-height: 1.5;
  color: #555;
  overflow-wrap: break-word;
  word-break: break-word;
}

.search-result-snippet mark {
  background: #fef08a;
  padding: 1px 2px;
  border-radius: 2px;
}

/* ─── FOOTER ─── */
.footer-bar {
  background: var(--blue);
  color: #fff;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.footer-bar a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
}

.footer-bar a:hover { color: #fff; }
