/* Prospekt Strategiczny - Style */

.icon {
  font-size: 22px;
  color: currentColor;
  vertical-align: -2px;
  margin-right: 6px;
}

/* Prevent body scroll - only content areas should scroll */
html, body {
  overflow: hidden;
  height: 100vh;
}

/* ========== HEADER & NAVIGATION ========== */

/* Topbar: always visible - MUST have sticky + top:0 */
.deck-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 1200;
  background: rgba(9, 5, 9, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(200, 169, 107, 0.08);
}

.deck-header .deck-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
}

/* Desktop: row wrappers invisible (contents), parent stays row */
.deck-nav-row-1,
.deck-nav-row-2 {
  display: contents;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-wrap: nowrap;
  overflow: visible;
}

.header-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: rgba(242, 240, 234, 0.78);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  position: relative;
}

.header-nav a:hover,
.header-nav a:focus-visible {
  color: var(--accent);
  border-color: rgba(200, 169, 107, 0.3);
  background: rgba(200, 169, 107, 0.08);
}

.header-nav a .ti {
  font-size: 18px;
  margin: 0;
}

.header-nav a span {
  line-height: 1;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

/* Header Search */
.header-search {
  position: relative;
  flex: 1;
  max-width: 500px;
}

.header-search input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: rgba(10, 5, 8, 0.7);
  border: 1px solid rgba(200, 169, 107, 0.3);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  transition: var(--transition);
}

.header-search input:focus {
  outline: none;
  border-color: rgba(200, 169, 107, 0.6);
  background: rgba(10, 5, 8, 0.9);
}

.header-search input::placeholder {
  color: rgba(242, 240, 234, 0.5);
}

.header-search > .ti {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: rgba(200, 169, 107, 0.6);
  pointer-events: none;
}

/* Search Results */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(22, 11, 16, 0.98);
  border: 1px solid rgba(200, 169, 107, 0.3);
  border-radius: 8px;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.search-results.active {
  display: block;
}

.search-results::-webkit-scrollbar {
  height: 8px;
  width: 10px;
}

.search-results::-webkit-scrollbar-track {
  background: rgba(9, 5, 9, 0.45);
  border-radius: 6px;
}

.search-results::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(200, 169, 107, 0.45), rgba(161, 18, 42, 0.35));
  border-radius: 6px;
  border: 1px solid rgba(200, 169, 107, 0.12);
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(200, 169, 107, 0.7), rgba(161, 18, 42, 0.55));
}

.search-results {
  scrollbar-color: rgba(200, 169, 107, 0.4) rgba(9, 5, 9, 0.45);
}

.search-result-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(200, 169, 107, 0.15);
  cursor: pointer;
  transition: var(--transition);
}

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

.search-result-item:hover {
  background: rgba(200, 169, 107, 0.1);
}

.search-result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.search-result-excerpt {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.search-result-excerpt mark {
  background: rgba(200, 169, 107, 0.3);
  color: var(--accent);
  padding: 2px 4px;
  border-radius: 3px;
}

.search-no-results {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1250px) {
  .header-nav {
    gap: 8px;
  }

  .header-nav a {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
    border-radius: 999px;
    border-color: rgba(200, 169, 107, 0.18);
    color: rgba(242, 240, 234, 0.7);
  }

  .header-nav a span {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translate(-50%, 6px);
    background: rgba(12, 6, 9, 0.95);
    border: 1px solid rgba(200, 169, 107, 0.35);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 11px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
    color: var(--accent);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 40;
  }

  .header-nav a:hover span,
  .header-nav a:focus-visible span {
    opacity: 1;
    transform: translate(-50%, -2px);
  }
}

/* ========== WIKI CONTAINER & GRID ========== */

.wiki-container {
  max-width: 1800px;
  margin: 0 auto;
  padding: clamp(48px, 6vw, 96px) clamp(48px, 6vw, 80px);
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wiki-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: 280px 1fr 260px;
  align-items: start;
  padding-top: 35px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ========== SIDEBAR NAVIGATION ========== */

.wiki-nav {
  position: sticky;
  top: 0;
  margin-left: 28px;
  background: radial-gradient(circle at 30% 20%, rgba(161, 18, 42, 0.2) 0%, transparent 65%),
    linear-gradient(160deg, rgba(46, 22, 28, 0.94) 0%, rgba(22, 11, 16, 0.9) 100%);
  border: 1px solid rgba(200, 169, 107, 0.28);
  border-radius: 8px;
  padding: 32px 28px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(6, 2, 8, 0.45), inset 0 1px 0 rgba(200, 169, 107, 0.12);
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 169, 107, 0.3) transparent;
}

.wiki-nav::-webkit-scrollbar {
  width: 8px;
}

.wiki-nav::-webkit-scrollbar-track {
  background: rgba(9, 5, 9, 0.5);
  border-radius: 4px;
}

.wiki-nav::-webkit-scrollbar-thumb {
  background: rgba(200, 169, 107, 0.3);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.wiki-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(200, 169, 107, 0.6);
}

.wiki-nav h2 {
  margin: 0 0 20px;
  font-size: 15px;
  color: var(--accent);
  letter-spacing: 0.7px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(200, 169, 107, 0.22);
}

.wiki-nav h2 .icon {
  font-size: 18px;
  margin: 0;
}

.wiki-nav > ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 3px;
}

.wiki-nav li {
  position: relative;
}

.wiki-nav li.chapter-item {
  margin-top: 8px;
  display: block;
}

.wiki-nav li.chapter-item:first-child {
  margin-top: 0;
}

.wiki-nav li.chapter-item.hidden {
  display: none;
}

.wiki-nav li.chapter-item > a {
  font-weight: 600;
  background: rgba(200, 169, 107, 0.06);
  border: 1px solid rgba(200, 169, 107, 0.2);
}

.wiki-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  transition: var(--transition);
  border: 1px solid transparent;
  position: relative;
}

.wiki-nav li a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: var(--transition);
}

.wiki-nav li a:hover,
.wiki-nav li a.active {
  color: var(--ink);
  background: rgba(200, 169, 107, 0.16);
  border-color: rgba(200, 169, 107, 0.4);
  box-shadow: 0 3px 10px rgba(200, 169, 107, 0.08);
}

.wiki-nav li a:hover::before,
.wiki-nav li a.active::before {
  height: 50%;
}

.wiki-nav li a .icon {
  font-size: 17px;
  margin: 0;
  opacity: 0.6;
}

.wiki-nav li a:hover .icon,
.wiki-nav li a.active .icon {
  opacity: 1;
  color: var(--accent);
}

.wiki-nav .sub-menu {
  display: none;
}

.wiki-nav-overlay {
  display: none;
}

/* ========== MAIN CONTENT AREA ========== */

.wiki-content-wrapper {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: calc(100vh - 140px);
  background: radial-gradient(ellipse at 20% 15%, rgba(161, 18, 42, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 85%, rgba(200, 169, 107, 0.1) 0%, transparent 60%),
    linear-gradient(155deg, rgba(46, 18, 20, 0.92) 0%, rgba(18, 8, 12, 0.95) 38%, rgba(9, 5, 9, 0.98) 100%);
  border: 1px solid rgba(200, 169, 107, 0.25);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(6, 2, 6, 0.5), inset 0 1px 0 rgba(200, 169, 107, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wiki-content-wrapper::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -120px;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(200, 169, 107, 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.wiki-content-wrapper::after {
  content: "";
  position: absolute;
  bottom: -140px;
  left: -100px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(161, 18, 42, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Header sits at top of wrapper - not scrolling, full width, no extra padding */
.wiki-content-header {
  position: relative;
  z-index: 10;
  background: linear-gradient(180deg, rgba(14, 9, 10, 0.98) 0%, rgba(12, 7, 8, 0.92) 100%);
  backdrop-filter: blur(8px);
  padding: 20px 36px 16px;
  border-bottom: 1px solid rgba(200, 169, 107, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  margin: 0;
  flex-shrink: 0;
}

.wiki-content-header .breadcrumbs {
  margin-bottom: 10px;
  padding: 0;
  color: rgba(242, 240, 234, 0.6);
  font-size: 13px;
}

.wiki-content-header .breadcrumbs a {
  color: rgba(200, 169, 107, 0.8);
}

.wiki-content-header .breadcrumbs a:hover {
  color: var(--accent);
}

#current-chapter-title {
  margin: 0;
  font-size: clamp(24px, 3.5vw, 32px);
  color: var(--accent-gold);
  font-weight: 600;
  line-height: 1.3;
}

/* Scrollable content area - no top padding since header is separate */
.wiki-content {
  position: relative;
  z-index: 1;
  padding: 24px 36px 40px;
  min-height: 0;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 169, 107, 0.3) transparent;
}

.wiki-content::-webkit-scrollbar {
  width: 8px;
}

.wiki-content::-webkit-scrollbar-track {
  background: rgba(9, 5, 9, 0.5);
  border-radius: 4px;
}

.wiki-content::-webkit-scrollbar-thumb {
  background: rgba(200, 169, 107, 0.3);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.wiki-content::-webkit-scrollbar-thumb:hover {
  background: rgba(200, 169, 107, 0.6);
}

/* ========== SECTION STYLES ========== */

.wiki-section {
  display: none;
  animation: fadeIn 0.35s ease;
  position: relative;
  z-index: 1;
}

.wiki-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wiki-section h2 {
  margin: 0 0 32px;
  font-size: clamp(32px, 4.2vw, 44px);
  color: var(--accent-gold);
  border-bottom: 1px solid rgba(200, 169, 107, 0.24);
  padding-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  letter-spacing: 0.2px;
  font-weight: 600;
}

.wiki-section h2 .icon {
  font-size: 38px;
  margin: 0;
  filter: drop-shadow(0 2px 8px rgba(200, 169, 107, 0.25));
}

.wiki-section h3 {
  margin: 32px 0 16px;
  font-size: clamp(22px, 3vw, 28px);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.wiki-section h3 .icon {
  font-size: 26px;
  margin: 0;
}

.wiki-section h4 {
  margin: 24px 0 12px;
  font-size: clamp(17px, 2.3vw, 20px);
  color: #e9d6ae;
  font-weight: 600;
}

.wiki-section p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 16px;
}

.wiki-section ul,
.wiki-section ol {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 16px;
  padding-left: 26px;
}

.wiki-section ul li,
.wiki-section ol li {
  margin-bottom: 8px;
}

.wiki-chart {
  width: 100%;
  max-width: 560px;
  height: 320px;
  margin: 24px 0;
  border-radius: 8px;
  border: 1px solid rgba(200, 169, 107, 0.25);
  background: radial-gradient(circle at 20% 0%, rgba(200, 169, 107, 0.12) 0%, rgba(10, 5, 8, 0.9) 60%);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(200, 169, 107, 0.18);
  overflow: hidden;
}

.wiki-section strong {
  color: var(--accent-gold);
  font-weight: 700;
}

.wiki-section .emoji-icon {
  display: inline;
  color: var(--accent-gold);
  font-size: 1.02em;
  font-weight: 600;
  margin: 0 0.15em 0 0.1em;
  vertical-align: baseline;
}

.wiki-chart--inline-right {
  float: right;
  margin: 4px 0 20px 24px;
}

.wiki-chart-caption {
  font-size: 13px;
  color: var(--muted);
  margin: -12px 0 20px;
}

@media (max-width: 900px) {
  .wiki-chart--inline-right {
    float: none;
    margin: 24px 0;
  }
}

/* Chapter badge */
.chapter-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(200, 169, 107, 0.14);
  border: 1px solid rgba(200, 169, 107, 0.3);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 14px;
}

/* ========== CARDS & COMPONENTS ========== */

.wiki-chart--inline-right {
  float: right;
  margin: 4px 0 20px 24px;
}

.wiki-chart-caption {
  font-size: 13px;
  color: var(--muted);
  margin: -12px 0 20px;
}

.wiki-card {
  background: radial-gradient(circle at 15% 20%, rgba(200, 169, 107, 0.12) 0%, transparent 60%),
    linear-gradient(160deg, rgba(52, 30, 36, 0.9) 0%, rgba(32, 16, 22, 0.86) 100%);
  border: 1px solid rgba(200, 169, 107, 0.28);
  border-radius: 6px;
  padding: 24px 28px;
  margin: 24px 0;
  box-shadow: 0 10px 28px rgba(8, 4, 8, 0.35), inset 0 1px 0 rgba(200, 169, 107, 0.08);
}

.wiki-card h4 {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.wiki-card h4 .icon {
  font-size: 20px;
  margin: 0;
}

/* Placeholder */
.wiki-placeholder {
  text-align: center;
  padding: 80px 32px;
  color: var(--muted);
}

.wiki-placeholder .icon {
  font-size: 64px;
  opacity: 0.2;
  margin: 0 0 20px;
  display: block;
  color: var(--accent);
}

.wiki-placeholder h3 {
  color: var(--accent);
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 600;
}

.wiki-placeholder p {
  font-size: 15px;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ========== IMAGES ========== */

.chapter-hero-image {
  width: 100%;
  margin: 0 0 32px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(200, 169, 107, 0.2);
  background: linear-gradient(135deg, rgba(20, 12, 14, 0.95) 0%, rgba(12, 7, 9, 0.98) 100%);
}

.chapter-hero-image img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.92;
  transition: opacity 0.3s ease, transform 0.5s ease;
}

.chapter-hero-image:hover img {
  opacity: 1;
  transform: scale(1.02);
}

.chapter-image-float {
  float: right;
  width: 48%;
  margin: 0 0 24px 32px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(200, 169, 107, 0.2);
  background: linear-gradient(135deg, rgba(20, 12, 14, 0.95) 0%, rgba(12, 7, 9, 0.98) 100%);
}

.chapter-image-float img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.92;
  transition: opacity 0.3s ease, transform 0.5s ease;
}

.chapter-image-float:hover img {
  opacity: 1;
  transform: scale(1.02);
}

/* ========== TABLES ========== */

.wiki-table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 6px;
  border: 1px solid rgba(200, 169, 107, 0.28);
}

.wiki-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(20, 12, 14, 0.6);
}

.wiki-table thead {
  background: rgba(200, 169, 107, 0.18);
  border-bottom: 2px solid rgba(200, 169, 107, 0.4);
}

.wiki-table th {
  padding: 12px 16px;
  text-align: left;
  color: var(--accent-gold);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wiki-table td {
  padding: 12px 16px;
  color: var(--muted);
  border-top: 1px solid rgba(200, 169, 107, 0.12);
  font-size: 14px;
  line-height: 1.6;
}

.wiki-table tbody tr:hover {
  background: rgba(200, 169, 107, 0.08);
}

.wiki-table strong {
  color: var(--accent-gold);
}

/* ========== BACKGROUND DECORATIONS ========== */

.symbol-grid-wiki {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center;
  pointer-events: none;
  z-index: -1;
  gap: clamp(28px, 7vw, 72px);
}

.symbol-grid-wiki img {
  width: min(18vw, 160px);
  filter: brightness(0) invert(1) drop-shadow(0 0 24px rgba(200, 169, 107, 0.16));
  opacity: 0.08;
}

.symbol-grid-wiki img.is-secondary {
  opacity: 0.05;
}

/* ========== UTILITY OVERRIDES ========== */

/* Wiki cards with light backgrounds - improve contrast */
.wiki-card[style*="background: #fff"] {
  color: #1a1a1a !important;
}

.wiki-card[style*="background: #fff"] h4 {
  color: #1a1a1a !important;
}

.wiki-card[style*="background: #fff"] h5 {
  color: #2a2a2a !important;
}

.wiki-card[style*="background: #fff"] p {
  color: #1a1a1a !important;
}

.wiki-card[style*="background: #fff"] li {
  color: #1a1a1a !important;
}

.wiki-card[style*="background: #fff"] strong {
  color: #000 !important;
}

/* Pre blocks - override light backgrounds */
.wiki-section pre {
  background: rgba(20, 12, 14, 0.8) !important;
  color: var(--muted) !important;
  border: 1px solid rgba(200, 169, 107, 0.2);
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 13px;
  line-height: 1.6;
}

/* ========== MOBILE RESPONSIVE ========== */

@media (max-width: 900px) {
  /* Header Mobile */
  .deck-header .deck-nav {
    padding: 6px 12px;
    gap: 8px;
    flex-direction: column;
  }

  .deck-nav-row-1 {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .deck-nav-row-2 {
    display: flex !important;
    width: 100%;
  }

  .brand {
    flex-shrink: 0;
    position: relative;
  }

  .brand span {
    display: none;
  }

  .brand::after {
    content: "KN";
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    white-space: nowrap;
  }

  .header-nav {
    display: flex !important;
    gap: 4px !important;
    margin-left: auto;
    flex-shrink: 0;
  }

  .header-nav a span {
    display: none;
  }

  .header-nav a .ti {
    font-size: 18px;
    margin: 0;
  }

  .mobile-menu-toggle {
    display: block;
    flex-shrink: 0;
  }

  .header-search {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }

  .header-search input {
    margin: 0 !important;
    width: 100% !important;
  }

  /* Container & Grid Mobile */
  .wiki-container {
    padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 24px);
  }

  .wiki-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 12px;
  }

  /* Sidebar Mobile */
  .wiki-nav {
    position: fixed;
    top: 0;
    left: -100%;
    bottom: 0;
    width: 280px;
    z-index: 999;
    max-height: 100vh;
    transition: left 0.3s ease;
    padding-top: 80px;
    margin-left: 0;
    border-radius: 0;
  }

  .wiki-nav.active {
    left: 0;
  }

  .wiki-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
  }

  .wiki-nav-overlay.active {
    display: block;
  }

  /* Content Mobile */
  .wiki-content-wrapper {
    align-self: stretch;
  }

  .wiki-content {
    padding: 20px 24px 32px;
  }

  .wiki-content-header {
    padding: 16px 24px 12px;
  }

  .chapter-image-float {
    float: none;
    width: 100%;
    margin: 0 0 24px;
  }
}

@media (max-width: 768px) {
  .chapter-image-float {
    float: none;
    width: 100%;
    margin: 0 0 24px;
  }
}

@media (max-width: 600px) {
  .wiki-content-header {
    padding: 16px 24px 12px;
  }
}
.wiki-toc {
  position: sticky;
  top: 0;
  margin-right: 28px;
  background: radial-gradient(circle at 70% 80%, rgba(161, 18, 42, 0.18) 0%, transparent 65%),
    linear-gradient(160deg, rgba(46, 22, 28, 0.92) 0%, rgba(22, 11, 16, 0.88) 100%);
  border: 1px solid rgba(200, 169, 107, 0.26);
  border-radius: 8px;
  padding: 28px 24px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  box-shadow: 0 18px 42px rgba(6, 2, 8, 0.4), inset 0 1px 0 rgba(200, 169, 107, 0.1);
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 169, 107, 0.3) transparent;
}

.wiki-toc::-webkit-scrollbar {
  width: 8px;
}

.wiki-toc::-webkit-scrollbar-track {
  background: rgba(9, 5, 9, 0.5);
  border-radius: 4px;
}

.wiki-toc::-webkit-scrollbar-thumb {
  background: rgba(200, 169, 107, 0.3);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.wiki-toc::-webkit-scrollbar-thumb:hover {
  background: rgba(200, 169, 107, 0.6);
}

.wiki-toc h3 {
  margin: 0 0 16px;
  font-size: 13px;
  color: rgba(242, 240, 234, 0.65);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-weight: 600;
}

.wiki-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.wiki-toc li a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 2px solid transparent;
  color: rgba(242, 240, 234, 0.8);
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 600;
  transition: var(--transition);
}

.wiki-toc li a:hover {
  color: var(--ink);
  background: rgba(200, 169, 107, 0.1);
  border-left-color: rgba(200, 169, 107, 0.4);
}

.wiki-toc li a.active {
  color: var(--accent);
  background: rgba(200, 169, 107, 0.14);
  border-left-color: var(--accent);
  font-weight: 600;
}

@media (min-width: 901px) and (max-width: 1400px) {
  .wiki-grid {
    grid-template-columns: 280px 1fr;
  }

  .wiki-toc {
    display: none;
  }
}
