@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700&family=Raleway:wght@400;500;600;700;800&family=Montserrat:wght@500;600;700&display=swap');

:root {
  --bg: #eae5ff;
  --bg-soft: #e3daf8;
  --card: #fdfbff;
  --ink: #1f1a2b;
  --muted: #5f5578;
  --line: #d9cee8;
  --accent: #c93a3a;
  --accent-soft: #f7e3e3;
  --green: #3e9a66;
  --shadow: 0 14px 36px rgba(39, 17, 71, 0.16);
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: 'Raleway', sans-serif;
  background:
    radial-gradient(circle at 15% 18%, rgba(194, 64, 104, 0.16), transparent 32%),
    radial-gradient(circle at 82% 12%, rgba(118, 97, 255, 0.18), transparent 34%),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
}

:root[data-theme='dark'] {
  --bg: #0f0c1a;
  --bg-soft: #151126;
  --card: #1f1a33;
  --ink: #f0eaff;
  --muted: #a8a0c5;
  --line: #2f2943;
  --accent: #e25555;
  --accent-soft: #2f1a1a;
  --green: #58d19c;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .topbar .inner {
  background: rgba(20, 16, 32, 0.92);
}

:root[data-theme='dark'] .brand-logo {
  background: linear-gradient(135deg, #2c2640, #221d32);
  border: 1px solid #4a4166;
  filter: grayscale(0.2) brightness(0.82) contrast(1.15);
}

:root[data-theme='dark'] .nav a {
  color: #b8b0d4;
}

:root[data-theme='dark'] .nav a.active,
:root[data-theme='dark'] .nav a:hover,
:root[data-theme='dark'] .nav a:focus-visible {
  color: #f2eaff;
  border-color: #3b3453;
  background: #26203a;
}

:root[data-theme='dark'] .profile-chip {
  border-color: #3a3352;
  color: #d4cdea;
  background: #231d36;
}

:root[data-theme='dark'] .btn.ghost {
  background: #2a223d;
  border-color: #44385f;
  color: #e4dbff;
}

:root[data-theme='dark'] .btn.primary {
  background: #b04444;
  border-color: #cf6e6e;
  color: #fff;
}

:root[data-theme='dark'] .card .hd {
  background: linear-gradient(180deg, #2a2340, #231d36);
  border-bottom-color: #3b3453;
}

:root[data-theme='dark'] .forum-table thead th {
  background: #261f39;
  border-bottom-color: #3a3352;
  color: #b7afcf;
}

:root[data-theme='dark'] .forum-table tbody td {
  border-bottom-color: #352e4d;
}

:root[data-theme='dark'] .forum-table tbody tr:hover {
  background: #272039;
}

:root[data-theme='dark'] .login-overlay {
  background: rgba(10, 8, 18, 0.72);
}

:root[data-theme='dark'] .login-box {
  border-color: #3e3658;
  background: #1f1a31;
}

:root[data-theme='dark'] .login-box .hd {
  border-bottom-color: #3e3658;
  background: linear-gradient(180deg, #26203a, #201a32);
}

:root[data-theme='dark'] .login-title {
  color: #f0e9ff;
}

:root[data-theme='dark'] .login-sub,
:root[data-theme='dark'] .login-box label,
:root[data-theme='dark'] .login-msg {
  color: #c5bbdf;
}

:root[data-theme='dark'] .login-msg.err {
  color: #ff8f8f;
}

:root[data-theme='dark'] .login-box input {
  border-color: #463d62;
  background: #241e38;
  color: #eee6ff;
}

:root[data-theme='dark'] .login-box input::placeholder {
  color: #9f93c0;
}

:root[data-theme='dark'] .login-box input:focus {
  border-color: #e07171;
  box-shadow: 0 0 0 2px rgba(224, 113, 113, 0.22);
}

:root[data-theme='dark'] .pw-eye {
  border-color: #4a4068;
  background: #2a2340;
  color: #e5dcff;
}

:root[data-theme='dark'] .pw-eye:hover,
:root[data-theme='dark'] .pw-eye:focus-visible {
  background: #342a4d;
  border-color: #5b4f7a;
}

:root[data-theme='dark'] .topic-link,
:root[data-theme='dark'] .category-title,
:root[data-theme='dark'] .category-last-title,
:root[data-theme='dark'] .forum-info-link {
  color: #f0e9ff;
}

:root[data-theme='dark'] .topic-link:hover,
:root[data-theme='dark'] .category-title:hover,
:root[data-theme='dark'] .category-last-title:hover,
:root[data-theme='dark'] .forum-info-link:hover {
  color: #ff8e8e;
}

:root[data-theme='dark'] input,
:root[data-theme='dark'] textarea,
:root[data-theme='dark'] select {
  background: #201a31;
  border-color: #3a3352;
  color: #efe8ff;
}

:root[data-theme='dark'] .meta,
:root[data-theme='dark'] .metric-label,
:root[data-theme='dark'] .section-type-link,
:root[data-theme='dark'] .section-flag {
  color: #b8b0cf;
}

:root[data-theme='dark'] .forum-hero {
  background: linear-gradient(135deg, #231d36 0%, #1e1830 45%, #1b1a2f 100%);
  border-color: #3a3352;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

:root[data-theme='dark'] .forum-category-card,
:root[data-theme='dark'] .section-subforum-card,
:root[data-theme='dark'] .idea-item,
:root[data-theme='dark'] .forbidden-item {
  background: #221c35;
  border-color: #3a3352;
  color: #ece5ff;
}

:root[data-theme='dark'] .forum-category-card:hover,
:root[data-theme='dark'] .section-subforum-card:hover,
:root[data-theme='dark'] .section-subforum-card:focus-within,
:root[data-theme='dark'] .idea-item:hover {
  background: #28213d;
  border-color: #4b4269;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25);
}

:root[data-theme='dark'] .section-drag-handle {
  border-color: #ffffff !important;
  background: #ffffff !important;
  color: #1f1831 !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
}

:root[data-theme='dark'] .section-drag-handle:hover,
:root[data-theme='dark'] .section-drag-handle:focus-visible {
  border-color: #ffffff !important;
  background: #ffffff !important;
  color: #1a142a !important;
  box-shadow: 0 8px 18px rgba(255, 255, 255, 0.25) !important;
  outline: none;
}

:root[data-theme='dark'] .section-drag-handle:active {
  background: #f2f4ff !important;
  color: #1f1831 !important;
}

:root[data-theme='dark'] .section-type-link,
:root[data-theme='dark'] .section-flag,
:root[data-theme='dark'] .topic-tag-pill,
:root[data-theme='dark'] .idea-tag,
:root[data-theme='dark'] .admin-shortcut-link {
  background: #2a233f !important;
  border-color: #5b4f7a !important;
  color: #ece4ff !important;
}

:root[data-theme='dark'] .section-type-link:hover,
:root[data-theme='dark'] .section-type-link:focus-visible,
:root[data-theme='dark'] .topic-tag-pill:hover,
:root[data-theme='dark'] .idea-tag:hover,
:root[data-theme='dark'] .admin-shortcut-link:hover,
:root[data-theme='dark'] .admin-shortcut-link:focus-visible {
  background: #352b4f !important;
  border-color: #72619a !important;
  color: #ffffff !important;
}

:root[data-theme='dark'] .category-badge,
:root[data-theme='dark'] .section-subforum-badge,
:root[data-theme='dark'] .section-head-icon,
:root[data-theme='dark'] .category-node-icon,
:root[data-theme='dark'] .section-order-icon,
:root[data-theme='dark'] .subforum-topic-icon {
  background: #2b2440;
  border-color: #4a4067;
}

:root[data-theme='dark'] .category-title,
:root[data-theme='dark'] .category-last-title,
:root[data-theme='dark'] .section-subforum-title,
:root[data-theme='dark'] .idea-title,
:root[data-theme='dark'] .forum-info-link {
  color: #f2eaff;
}

:root[data-theme='dark'] .category-subtitle,
:root[data-theme='dark'] .section-subforum-desc,
:root[data-theme='dark'] .section-subforum-meta,
:root[data-theme='dark'] .idea-meta,
:root[data-theme='dark'] .idea-section,
:root[data-theme='dark'] .forbidden-header,
:root[data-theme='dark'] .forbidden-severity {
  color: #c4bbdd;
}

:root[data-theme='dark'] .section-type-link,
:root[data-theme='dark'] .section-flag,
:root[data-theme='dark'] .admin-shortcut-link,
:root[data-theme='dark'] .topic-tag-pill,
:root[data-theme='dark'] .idea-replies {
  background: #2a233f;
  border-color: #4a4067;
  color: #ddd3fa;
}

:root[data-theme='dark'] .forum-category-card-admin,
:root[data-theme='dark'] .section-subforum-card-admin,
:root[data-theme='dark'] .idea-item-admin {
  border-color: #714646;
  background: linear-gradient(135deg, #2c1f2f, #241d32);
}

:root[data-theme='dark'] .forum-category-card-admin:hover,
:root[data-theme='dark'] .section-subforum-card-admin:hover,
:root[data-theme='dark'] .idea-item-admin:hover {
  border-color: #8d5656;
  background: linear-gradient(135deg, #352336, #2b223c);
}

:root[data-theme='dark'] .section-type-link.tone-admin,
:root[data-theme='dark'] .idea-tag.tone-admin {
  background: #462a3b;
  border-color: #82556c;
  color: #ffe2ef;
}

:root[data-theme='dark'] .main-admin-area .page-head,
:root[data-theme='dark'] .admin-hub-item,
:root[data-theme='dark'] .admin-hub-card .hd {
  background: #231d36;
  border-color: #3f3659;
  color: #f0e9ff;
}

:root[data-theme='dark'] .admin-hub-key,
:root[data-theme='dark'] .admin-hub-value,
:root[data-theme='dark'] .section-order-copy,
:root[data-theme='dark'] .metric-inline strong {
  color: #ece5ff;
}

:root[data-theme='dark'] .ctx-menu {
  background: #1f1a32;
  border-color: #3f3658;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .ctx-menu button {
  background: #2a2340;
  border-color: #433a5e;
  color: #e9e1ff;
}

:root[data-theme='dark'] .ctx-menu button:hover,
:root[data-theme='dark'] .ctx-menu button:focus-visible {
  background: #332a4b;
  border-color: #544a73;
}

:root[data-theme='dark'] .metric-icon {
  border-color: #bf7b7b;
}

:root[data-theme='dark'] .metric-icon::after {
  border-color: #bf7b7b transparent transparent transparent;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0;
}

.topbar .inner {
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0;
  padding: 14px 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: contain;
  background: linear-gradient(135deg, #f7e9ff, #e2d8ff);
  border: 1px solid #d4caea;
  padding: 4px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  font-weight: 600;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--accent);
  border-color: #e7d7f7;
  background: #f6f1ff;
}

.nav a.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 7px 16px rgba(188, 74, 74, 0.2);
}

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

.logout-form { margin: 0; }

.btn {
  border: 1px solid #9e2a2a;
  border-radius: 8px;
  background: linear-gradient(180deg, #c93a3a, #ad2f2f);
  color: #fff;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s ease, filter 0.15s ease;
}

.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: linear-gradient(180deg, #d54343, #b43030);
  border-color: #992929;
  color: #fff;
  box-shadow: 0 8px 18px rgba(188, 52, 52, 0.35);
}

.btn.primary:hover { filter: brightness(1.03); }

.btn.ghost {
  background: #f9dede;
  border-color: #cc7d7d;
  color: #7e2222;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid #ded2c2;
  color: #5a5046;
  background: #faf7f2;
  font-size: 12px;
  font-weight: 600;
}

.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #d7c6e9;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(231, 222, 211, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.login-overlay.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.login-overlay[hidden] {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

.login-box {
  width: min(460px, 100%);
  border: 1px solid #dcd0c1;
  border-radius: 20px;
  background: #fbf8f4;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-box .hd {
  padding: 16px 18px;
  border-bottom: 1px solid #e0d5c7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, #f9f5f0, #f3ede5);
}

.login-title {
  font-size: 16px;
  font-weight: 700;
}

.login-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.login-box .bd {
  padding: 18px;
}

.login-box label {
  display: block;
  font-size: 12px;
  color: #766b60;
  margin: 12px 0 6px;
  font-weight: 600;
}

.login-box input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #d6c7b7;
  background: #fdf9f4;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-box input:focus {
  border-color: #e18585;
  box-shadow: 0 0 0 2px rgba(210, 75, 75, 0.14);
}

.field-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pw-eye {
  white-space: nowrap;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d6c7b7;
  background: #f7f1e9;
  color: #5b5046;
  cursor: pointer;
}

.login-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  align-items: center;
  justify-content: flex-end;
}

.login-msg {
  min-height: 18px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.login-msg.err {
  color: #b24545;
}

.close-x {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.hcap-wrap {
  margin: 14px 0 10px;
}

.hcap-wrap .h-captcha {
  transform: scale(0.95);
  transform-origin: left top;
}

.otp-row {
  margin-top: 4px;
}

.main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 42px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.section-head-icon {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid #dfcfc0;
  background: #efe5da;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #c24040;
}

.section-head-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.section-head-icon i {
  font-size: 18px;
  color: #c24040;
}
.section-icon-text,
.category-icon-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #c24040;
  letter-spacing: 0.2px;
}

.page-title {
  margin: 0 0 4px;
  font-family: 'Montserrat', sans-serif;
  font-size: 29px;
  font-weight: 700;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card .hd {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  background: linear-gradient(180deg, #f6f1ff, #f0e7ff);
  border-radius: var(--radius) var(--radius) 0 0;
}

.card .bd {
  padding: 14px;
}

.forum-table {
  width: 100%;
  border-collapse: collapse;
}

.forum-table thead th {
  text-align: left;
  font-size: 11px;
  color: #7d7166;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  background: #f2ebe2;
  border-bottom: 1px solid #ebe1d5;
  padding: 11px 12px;
}

.forum-table tbody td {
  padding: 12px;
  border-bottom: 1px solid #efe6dc;
  vertical-align: middle;
  position: relative;
  overflow: visible;
}

.forum-table tbody tr:hover {
  background: #f6f0e7;
}

.topic-link {
  color: #41372f;
  font-weight: 700;
}

.topic-link:hover,
.topic-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.label-tag {
  display: inline-block;
  border: 1px solid #e8cfcf;
  color: #8a3f3f;
  background: #f8ece7;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
}

.author-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.author-mini-copy {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.author-mini-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid #dacbbd;
  background: #f7f0e7;
  font-size: 11px;
}

.author-mini-avatar {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid #d7c6e9;
}

.role-icon-img {
  width: 12px;
  height: 12px;
  object-fit: contain;
}

.empty-state {
  padding: 16px;
  color: var(--muted);
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.hr {
  height: 1px;
  background: #efe6dc;
  margin: 14px 0;
}

.form-row {
  margin-bottom: 12px;
}

.form-row label {
  display: block;
  color: #796d61;
  font-size: 12px;
  margin-bottom: 6px;
  font-weight: 600;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #5f554b;
  font-weight: 600;
}

.checkbox-row input[type='checkbox'] {
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
}

input,
textarea,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #ddcfbf;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #e18585;
  box-shadow: 0 0 0 2px rgba(210, 75, 75, 0.14);
}

textarea {
  min-height: 130px;
  resize: vertical;
}

.footer {
  margin-top: 20px;
  color: #7e7369;
  font-size: 12px;
  text-align: center;
  padding: 14px 0;
}

.msg-error { color: #b24545; font-size: 13px; }
.msg-ok { color: #2f8d5b; font-size: 13px; }

code {
  background: #efe7dd;
  border: 1px solid #dcccbb;
  border-radius: 6px;
  padding: 1px 6px;
}

.forum-home {
  padding-top: 18px;
}

.forum-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #f5e9ff 0%, #efe8ff 45%, #e6f0ff 100%);
  border: 1px solid #e0d7f5;
  box-shadow: 0 18px 48px rgba(61, 36, 102, 0.16);
}

.forum-hero .page-title {
  margin: 0 0 6px;
  font-size: 31px;
}

.forum-hero-copy {
  position: relative;
  z-index: 1;
}

.forum-hero-kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
  margin-bottom: 6px;
  font-weight: 700;
}

.forum-hero-glow {
  position: absolute;
  right: -45px;
  top: -45px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(188, 74, 74, 0.12), rgba(188, 74, 74, 0));
  pointer-events: none;
}

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

.forum-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.section-order-toolbar {
  margin-bottom: 10px;
}

.section-order-toolbar .bd {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.section-order-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6f6459;
  font-size: 13px;
  font-weight: 600;
}

.section-order-icon {
  width: 22px;
  min-width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1px solid #dbcbbc;
  background: #f4ece3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7c6656;
}

.section-order-form {
  margin: 0;
}

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

.forum-category-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 210px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid #d9cee8;
  border-left: 3px solid #c24068;
  border-radius: 16px;
  padding: 12px;
  background: #fbf8ff;
  position: relative;
  overflow: visible;
}

.forum-category-card-admin {
  border-left-color: #cb5454;
  box-shadow: 0 12px 24px rgba(132, 43, 43, 0.12);
}

.forum-category-card-has-subforums {
  grid-template-columns: 1fr;
  align-items: start;
}

.forum-category-card-has-subforums .category-main {
  align-items: flex-start;
}

.forum-category-card-has-subforums .category-title-wrap {
  flex: 1 1 auto;
  width: 100%;
}

.forum-category-card-has-subforums .section-subforum-cards {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.forum-category-card-has-subforums .category-metrics {
  margin-top: 2px;
}

.forum-category-card:hover {
  border-color: #cdbced;
  box-shadow: 0 14px 28px rgba(57, 33, 97, 0.16);
}

.forum-category-card::before {
  content: '';
  position: absolute;
  inset: 0 58% 0 0;
  border-radius: 16px;
  background: radial-gradient(circle, rgba(194,64,104,0.09), transparent 60%);
  pointer-events: none;
}

.forum-category-card::after {
  content: '';
  position: absolute;
  inset: 0 0 0 58%;
  border-radius: 16px;
  background: radial-gradient(circle, rgba(118,97,255,0.08), transparent 65%);
  pointer-events: none;
}

.forum-category-card.is-dragging {
  opacity: 0.72;
  box-shadow: 0 14px 24px rgba(41, 27, 17, 0.18);
}

.category-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.section-drag-handle {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid #dccdbd;
  background: #f8f2ea;
  color: #8b7766;
  cursor: grab;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.section-drag-handle:active {
  cursor: grabbing;
}

.category-badge {
  width: 46px;
  min-width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #c24040;
  border: 1px solid #dfc2b5;
  background: #efe1d7;
}

.category-badge i {
  font-size: 22px;
  color: #c24040;
}

.category-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.category-title-wrap {
  min-width: 0;
}

.category-title-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-node-icon {
  width: 18px;
  min-width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid #dfcfc0;
  background: #f4ece2;
  color: #8a4f4f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.category-title {
  display: inline-block;
  font-size: 18px;
  color: #3e332b;
  font-weight: 700;
}

.category-title:hover,
.category-title:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.category-subtitle {
  margin-top: 3px;
  color: #7d7165;
  font-size: 13px;
}

.category-links {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.section-type-link,
.section-flag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #dbcfbe;
  background: #f5eee5;
  color: #6b5e52;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
}

.section-type-link:hover,
.section-type-link:focus-visible {
  background: #f1e8de;
  border-color: #d3c3b2;
}

.section-type-link.tone-appeal {
  border-color: #dbc8d8;
  background: #f2ebf3;
  color: #6e4d78;
}

.section-type-link.tone-support {
  border-color: #c8d5e4;
  background: #edf3f9;
  color: #3d5f84;
}

.section-type-link.tone-link {
  border-color: #d4d4d4;
  background: #f1f1f1;
  color: #5f5f5f;
}

.section-type-link.tone-admin {
  border-color: #e3c3ce;
  background: #f8ebf0;
  color: #8b3c5b;
}

.section-subforums-inline {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.section-subforums-inline-block {
  display: flex;
}

.section-subforum-cards {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.section-subforum-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #d9ceb9;
  border-left: 3px solid #c34848;
  border-radius: 12px;
  background: #f7efe6;
  padding: 8px 10px;
}

.section-subforum-card .section-subforum-title,
.section-subforum-card .section-subforum-desc {
  word-break: normal;
  overflow-wrap: break-word;
}

.section-subforum-card-admin {
  border-left-color: #cb5656;
  background: linear-gradient(135deg, #f8ecef, #f5e9f4);
}

.section-subforum-main {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: inherit;
}

.section-subforum-badge {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfcfbf;
  background: #efe2d7;
}

.section-subforum-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.section-subforum-title {
  color: #45382f;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.section-subforum-desc {
  color: #7d6f62;
  font-size: 12px;
  line-height: 1.25;
}

.section-subforum-meta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  color: #6f6054;
  font-size: 12px;
}

.section-subforum-meta i {
  color: #bf4d4d;
  margin-right: 2px;
}

.section-subforum-meta b {
  color: #43362e;
}

.subforum-topic-table td {
  vertical-align: top;
}

.subforum-topic-table thead i {
  color: #bf4d4d;
  margin-right: 4px;
}

.subforum-topic-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subforum-topic-icon {
  width: 24px;
  min-width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid #dccdbc;
  background: #f1e4d9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.subforum-topic-icon i {
  color: #be4b4b;
  font-size: 12px;
}

.subforum-stat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #5f4f43;
}

.subforum-stat i {
  color: #bf4d4d;
}

.subforum-last-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.subforum-last-avatar {
  width: 24px;
  min-width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid #d9cbbe;
}

.admin-area-flag {
  gap: 5px;
  border-color: #e0c9c9;
  background: #faecec;
  color: #8c3434;
}

.admin-hub-card {
  border-color: #e1cfcf;
  box-shadow: 0 14px 26px rgba(97, 39, 39, 0.1);
}

.admin-hub-card .hd {
  background: linear-gradient(180deg, #f7e9e9, #f3dfdf);
  border-bottom-color: #e8d2d2;
}

.admin-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.section-subforums-as-sections {
  gap: 10px;
}

.section-subforums-as-sections .forum-category-card {
  border-left-color: #c24a4a;
}

.admin-hub-item {
  border: 1px solid #e0d0c2;
  border-radius: 11px;
  background: #fcf6ef;
  padding: 10px 12px;
}

.admin-hub-key {
  color: #866e5d;
  font-size: 12px;
  margin-bottom: 3px;
}

.admin-hub-value {
  color: #3f3229;
  font-size: 18px;
  font-weight: 700;
}

.admin-hub-shortcuts {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-shortcut-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #decebe;
  background: #f7eee4;
  color: #4f4035;
  border-radius: 999px;
  padding: 5px 11px;
  font-weight: 700;
  font-size: 12px;
}

.admin-shortcut-link:hover,
.admin-shortcut-link:focus-visible {
  border-color: #cfbba8;
  background: #f1e4d6;
}

.admin-shortcut-link i {
  color: #c04d4d;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.admin-dashboard-card {
  border: 1px solid #e0d0c2;
  border-radius: 12px;
  background: #fcf6ef;
  padding: 10px 12px;
}

.admin-dashboard-key {
  color: #846f5d;
  font-size: 12px;
  margin-bottom: 4px;
}

.admin-dashboard-value {
  color: #3f3229;
  font-size: 22px;
  font-weight: 700;
}

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

.admin-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  border: 1px solid #decebe;
  background: #f7eee4;
  color: #4f4035;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 12px;
}

.admin-tab:hover,
.admin-tab:focus-visible {
  border-color: #cfbba8;
  background: #f1e4d6;
}

.admin-tab.active {
  border-color: #9e2a2a;
  background: linear-gradient(180deg, #c93a3a, #ad2f2f);
  color: #fff;
}

.admin-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.admin-log-list li {
  border: 1px solid #e0d3c5;
  border-radius: 11px;
  background: #fbf5ed;
  padding: 10px;
}

.admin-log-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.mode-row-card {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #d8cbbb;
  border-radius: 12px;
  background: #faf5ee;
}

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

.builder-field-card {
  border: 1px solid #decfbe;
  border-radius: 10px;
  background: #fffaf4;
  padding: 8px 10px;
  display: grid;
  gap: 6px;
}

.builder-field-card .builder-options {
  min-height: 34px;
}

.builder-custom-list {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.builder-custom-row {
  border: 1px solid #decfbe;
  border-radius: 10px;
  background: #fffaf4;
  padding: 8px 10px;
  display: grid;
  gap: 8px;
}

#builder-json-wrap > summary {
  cursor: pointer;
  font-weight: 700;
}

.main-admin-area .page-head {
  border: 1px solid #e3d0d0;
  border-radius: 14px;
  background: linear-gradient(135deg, #fcf4f4, #f9f1f1);
  padding: 14px;
  margin-bottom: 12px;
}

.main-admin-area .forum-table thead th {
  background: #f4ecec;
  border-bottom-color: #e7d8d8;
}

.main-admin-area .forum-table tbody tr:hover {
  background: #f8efef;
}

.main-admin-area .subforum-topic-icon {
  background: #efe3e3;
  border-color: #dcc8c8;
}

.main-admin-area .topic-link {
  color: #3f2f2f;
}

.main-admin-area .topic-link:hover,
.main-admin-area .topic-link:focus-visible {
  color: #9c3b3b;
}

:root[data-theme='dark'] .admin-dashboard-card {
  background: #231d36;
  border-color: #3f3659;
}

:root[data-theme='dark'] .admin-dashboard-key {
  color: #c2b8dd;
}

:root[data-theme='dark'] .admin-dashboard-value {
  color: #f1eaff;
}

:root[data-theme='dark'] .admin-log-list li {
  background: #26203a;
  border-color: #433a5f;
}

:root[data-theme='dark'] .admin-tab {
  background: #2a233f;
  border-color: #4a4067;
  color: #ddd3fa;
}

:root[data-theme='dark'] .admin-tab:hover,
:root[data-theme='dark'] .admin-tab:focus-visible {
  background: #342a4d;
  border-color: #5b4f7a;
}

:root[data-theme='dark'] .admin-tab.active {
  border-color: #c36060;
  background: linear-gradient(180deg, #c84f4f, #a43838);
  color: #fff;
}

:root[data-theme='dark'] .mode-row-card {
  background: #26203a;
  border-color: #433a5f;
}

:root[data-theme='dark'] .builder-field-card,
:root[data-theme='dark'] .builder-custom-row {
  background: #241e38;
  border-color: #4a4067;
}

.section-subforum-card:hover,
.section-subforum-card:focus-within {
  border-color: #d0c2ad;
  background: #f2e7db;
  box-shadow: 0 6px 16px rgba(58, 42, 30, 0.08);
}

.section-subforum-badge i {
  color: #be4b4b;
  font-size: 14px;
}

.section-subforum-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.section-subforum-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #be4b4b;
  box-shadow: 0 0 0 2px rgba(190, 75, 75, 0.2);
}

.category-metrics {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #7a6e62;
  font-size: 13px;
}

.metric-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.metric-label {
  color: #7f7368;
}

.metric-inline strong {
  font-size: 14px;
  color: #433932;
}

.metric-sep {
  color: #b39d85;
}

.metric-inline-message {
  color: #6d5f53;
}

.metric-icon {
  width: 12px;
  height: 9px;
  border: 1.6px solid #bc8a61;
  border-radius: 4px;
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

.metric-icon::after {
  content: '';
  position: absolute;
  left: 2px;
  bottom: -5px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 4px 0 0;
  border-color: #bc8a61 transparent transparent transparent;
}

.category-last {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.category-last-avatar {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #d7c6e9;
}

.category-last-title {
  font-size: 14px;
  color: #40362e;
}

.category-last-title:hover,
.category-last-title:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.forum-info-card {
  margin-top: 14px;
}

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

.forum-info-item p {
  margin: 5px 0 0 20px;
}

.forum-info-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #3f342d;
}

.forum-info-link:hover,
.forum-info-link:focus-visible {
  color: var(--accent);
}

.info-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(210, 75, 75, 0.35);
}

.ideas-card .hd {
  border-bottom: 1px solid #eadfce;
}

.forbidden-header {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  gap: 16px;
  padding: 6px 0;
  font-size: 12px;
  color: #6f665d;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.forbidden-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.forbidden-item {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  gap: 16px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #dcd0c4;
  background: #fcf7f3;
  font-size: 13px;
  color: #3b3029;
}

.forbidden-severity {
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid #c8b7a7;
  background: #f5eee5;
  font-weight: 700;
  display: inline-flex;
  justify-content: center;
}

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

.idea-item {
  padding: 11px;
  border-radius: 12px;
  border: 1px solid #ddd2c4;
  background: #fcf8f3;
  display: grid;
  gap: 6px;
}

.idea-item-admin {
  border-color: #e1bac8;
  background: linear-gradient(135deg, #fff2f7, #f9edf8);
}

.idea-item:hover {
  border-color: #d1c5b8;
  background: #f8f1e8;
}

.idea-item-admin:hover {
  border-color: #d6acbc;
  background: linear-gradient(135deg, #fbe9f1, #f5e6f5);
}

.idea-tag {
  display: inline-flex;
  width: fit-content;
  font-size: 10px;
  font-weight: 700;
  color: #8e4545;
  border: 1px solid #e6cece;
  background: #f6ebe7;
  border-radius: 999px;
  padding: 3px 8px;
  letter-spacing: 0.45px;
}

.idea-tag.tone-admin {
  color: #8d3d5a;
  border-color: #e3bfcc;
  background: #faedf2;
}

.idea-title {
  font-weight: 700;
  color: #3f342c;
}

.idea-title:hover,
.idea-title:focus-visible {
  color: var(--accent);
}

.idea-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #766b5f;
  font-size: 12px;
  flex-wrap: wrap;
}

.idea-avatar {
  width: 26px;
  min-width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid #d6c8e3;
}

.idea-replies {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #d9cbbd;
  background: #f2e9df;
  color: #5b4e40;
}

.idea-section {
  font-size: 12px;
  color: #8b6254;
  font-weight: 600;
}

.idea-section:hover,
.idea-section:focus-visible {
  color: var(--accent);
}

.ctx-menu {
  position: fixed;
  z-index: 9999;
  display: none;
  background: #fdfaf6;
  border: 1px solid #d9cbbd;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(32, 22, 14, 0.2);
  padding: 6px;
  min-width: 170px;
}

.ctx-menu button {
  width: 100%;
  border: 1px solid #e0d3c4;
  background: #f8f1e8;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
  color: #4a3d34;
  font-weight: 700;
  cursor: pointer;
}

.ctx-menu button + button {
  margin-top: 6px;
}

.ctx-menu button:hover,
.ctx-menu button:focus-visible {
  background: #f3e7db;
  border-color: #d5c5b5;
}

.editor-fallback {
  min-height: 220px;
  border: 1px solid #ddcfbf;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  outline: none;
  white-space: pre-wrap;
}
.editor-fallback:focus {
  border-color: #e18585;
  box-shadow: 0 0 0 2px rgba(210, 75, 75, 0.14);
}

.topic-tag-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d8cbbe;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  background: #f3ece3;
  color: #604b3f;
}

.topic-tag-pill:hover {
  border-color: #d0c0af;
}

@media (max-width: 1024px) {
  .topbar .inner {
    padding: 12px 14px;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

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

  .forum-sidebar {
    order: 2;
  }

  .forum-category-card {
    grid-template-columns: 1fr;
  }

  .section-subforum-card {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .admin-hub-grid {
    grid-template-columns: 1fr;
  }

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

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

  .admin-dashboard-columns {
    grid-template-columns: 1fr;
  }

  .category-metrics {
    margin-top: 4px;
  }

  .forum-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .forum-hero-actions {
    width: 100%;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .forum-table thead {
    display: none;
  }

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

  .forum-table tr {
    border-bottom: 1px solid #efe4d8;
  }

  .forum-table td {
    border: none;
    padding: 8px 12px;
  }
}

/* Final dark-theme overrides for section reorder controls and tag badges. */
:root[data-theme='dark'] #sections-order-save.btn.ghost,
:root[data-theme='dark'] .section-drag-handle {
  background: #2c2441 !important;
  border-color: #605181 !important;
  color: #efe7ff !important;
}

:root[data-theme='dark'] #sections-order-save.btn.ghost:hover,
:root[data-theme='dark'] #sections-order-save.btn.ghost:focus-visible,
:root[data-theme='dark'] .section-drag-handle:hover,
:root[data-theme='dark'] .section-drag-handle:focus-visible {
  background: #372b52 !important;
  border-color: #7a68a2 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 16px rgba(59, 38, 96, 0.34) !important;
}

:root[data-theme='dark'] .forum-home .section-type-link,
:root[data-theme='dark'] .forum-home .section-flag,
:root[data-theme='dark'] .forum-home .topic-tag-pill,
:root[data-theme='dark'] .forum-home .idea-tag,
:root[data-theme='dark'] .forum-home .idea-tag.tone-admin {
  background: #2a233f !important;
  border-color: #5b4f7a !important;
  color: #ece4ff !important;
}

:root[data-theme='dark'] .forum-home .section-type-link:hover,
:root[data-theme='dark'] .forum-home .section-type-link:focus-visible,
:root[data-theme='dark'] .forum-home .topic-tag-pill:hover,
:root[data-theme='dark'] .forum-home .idea-tag:hover,
:root[data-theme='dark'] .forum-home .idea-tag:focus-visible {
  background: #352b4f !important;
  border-color: #72619a !important;
  color: #ffffff !important;
}
