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

/* ── Shadcn-compatible design tokens ── */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --border: 240 5.9% 90%;
  --ring: 240 5.9% 10%;
  --card: 0 0% 100%;
  --destructive: 0 84.2% 60.2%;
  --warning: 38 92% 50%;
  --success: 142 76% 36%;
  --info: 221 83% 53%;

  --sidebar-width: 240px;
  --toc-width: 220px;
  --header-height: 52px;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;
}

html[data-theme="dark"] {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --border: 240 3.7% 15.9%;
  --ring: 240 4.9% 83.9%;
  --card: 240 10% 3.9%;
}

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

html {
  background: hsl(var(--background));
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Header ── */
.wiki-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: hsl(var(--background) / 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 200;
  gap: 12px;
}

@supports not (backdrop-filter: blur(20px)) {
  .wiki-header { background: hsl(var(--background)); }
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: hsl(var(--foreground));
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  transition: background .15s;
}

.mobile-menu-btn:hover { background: hsl(var(--muted)); }

.wiki-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.wiki-logo-img {
  height: 32px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
  display: block;
}

.wiki-logo-text {
  color: hsl(var(--foreground));
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

.wiki-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-wrapper { position: relative; }

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 10px;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  pointer-events: none;
}

#searchInput {
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  padding: 0 72px 0 32px;
  color: hsl(var(--foreground));
  font-size: 13px;
  height: 36px;
  width: 240px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}

#searchInput::placeholder { color: hsl(var(--muted-foreground)); }

#searchInput:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.15);
}

.search-kbd {
  position: absolute;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-xs);
  pointer-events: none;
  font-family: inherit;
  line-height: 1.4;
}

.search-kbd i { font-size: 10px; }

.main-site-link {
  color: hsl(var(--foreground));
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  padding: 0 12px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}

.main-site-link:hover { background: hsl(var(--muted)); }

.theme-toggle {
  background: none;
  border: none;
  color: hsl(var(--foreground));
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background .15s;
  flex-shrink: 0;
}

.theme-toggle:hover { background: hsl(var(--muted)); }

/* ── Search Dropdown ── */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 360px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 4px 24px hsl(240 10% 3.9% / 0.08);
  overflow: hidden;
  z-index: 300;
  display: none;
}

html[data-theme="dark"] .search-results {
  box-shadow: 0 4px 24px hsl(0 0% 0% / 0.4);
}

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

.search-result-item {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  border-bottom: 1px solid hsl(var(--border));
  transition: background .12s;
}

.search-result-item:hover { background: hsl(var(--muted)); }
.search-result-item:last-child { border-bottom: none; }

.search-result-title {
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--foreground));
  margin-bottom: 2px;
}

.search-result-path { font-size: 12px; color: hsl(var(--muted-foreground)); }

.search-no-result {
  padding: 16px;
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
}

/* ── Search Modal (Cmd+K) ── */
.search-overlay {
  position: fixed;
  inset: 0;
  background: hsl(240 10% 3.9% / 0.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 15vh 20px 20px;
}

.search-overlay.open { display: flex; }

.search-modal {
  width: 100%;
  max-width: 560px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 16px 48px hsl(240 10% 3.9% / 0.12);
  overflow: hidden;
}

.search-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid hsl(var(--border));
}

.search-modal-input-wrap i {
  color: hsl(var(--muted-foreground));
  font-size: 15px;
}

#searchModalInput {
  flex: 1;
  border: none;
  background: none;
  color: hsl(var(--foreground));
  font-size: 15px;
  outline: none;
  font-family: inherit;
}

#searchModalInput::placeholder { color: hsl(var(--muted-foreground)); }

.search-modal-results {
  max-height: 360px;
  overflow-y: auto;
}

.search-modal-hint {
  padding: 12px 16px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  border-top: 1px solid hsl(var(--border));
  display: flex;
  gap: 16px;
}

.search-modal-hint span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.search-modal-hint i {
  font-size: 11px;
  width: 14px;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

/* ── Layout ── */
.wiki-layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  padding-top: var(--header-height);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: hsl(240 10% 3.9% / 0.4);
  z-index: 140;
}

.sidebar-overlay.open { display: block; }

/* ── Sidebar ── */
.wiki-sidebar {
  width: var(--sidebar-width);
  background: hsl(var(--background));
  border-right: 1px solid hsl(var(--border));
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 12px 0 24px;
  z-index: 150;
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--border)) transparent;
}

.wiki-sidebar::-webkit-scrollbar { width: 4px; }
.wiki-sidebar::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 4px; }

.sidebar-home-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  margin: 0 8px 6px;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}

.sidebar-home-link i { font-size: 13px; width: 16px; text-align: center; }

.sidebar-home-link:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
}

.sidebar-home-link.active {
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
  font-weight: 600;
}

.sidebar-group { margin-bottom: 8px; padding: 0 8px; }

.sidebar-group-title {
  padding: 8px 12px 4px;
  color: hsl(var(--muted-foreground));
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-link {
  display: block;
  padding: 6px 12px;
  margin: 1px 0;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-size: 13px;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
  line-height: 1.45;
}

.sidebar-link:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
}

.sidebar-link.active {
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
  font-weight: 500;
}

/* ── Main Content ── */
.wiki-main {
  margin-left: var(--sidebar-width);
  padding-right: var(--toc-width);
  flex: 1;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: row;
  justify-content: center;
  background: hsl(var(--background));
  width: calc(100% - var(--sidebar-width));
}

.wiki-content {
  width: 100%;
  max-width: 720px;
  padding: 40px 40px;
  flex: 1;
  min-width: 0;
}

/* ── Right TOC Sidebar ── */
.wiki-toc {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: var(--toc-width);
  padding: 24px 16px;
  border-left: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  overflow-y: auto;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--border)) transparent;
}

.wiki-toc::-webkit-scrollbar { width: 4px; }
.wiki-toc::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 4px; }

.wiki-toc-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 12px;
}

.wiki-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wiki-toc-nav a {
  display: block;
  padding: 5px 10px 5px 14px;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-size: 12.5px;
  line-height: 1.4;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
  border-left: 2px solid transparent;
  position: relative;
}

.wiki-toc-nav a:hover { color: hsl(var(--foreground)); }

.wiki-toc-nav a.active {
  color: hsl(var(--foreground));
  font-weight: 500;
  border-left-color: hsl(var(--foreground));
}

.wiki-toc-nav a.toc-h3 {
  padding-left: 24px;
  font-size: 12px;
}

.wiki-toc-empty {
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  font-style: italic;
}

/* ── Breadcrumb ── */
.wiki-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin-bottom: 20px;
}

.wiki-breadcrumb a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color .15s;
}

.wiki-breadcrumb a:hover { color: hsl(var(--foreground)); }

.wiki-breadcrumb-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  color: hsl(var(--muted-foreground));
  font-size: 0;
  line-height: 1;
}

.wiki-breadcrumb-sep::before {
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  content: '\f054';
  font-size: 9px;
  color: hsl(var(--muted-foreground));
}

/* ── Page Title ── */
.wiki-page-title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.2;
}

.wiki-page-title i {
  font-size: 16px;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
  border: 1px solid hsl(var(--border));
}

.wiki-page-subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 15px;
  margin-bottom: 32px;
  line-height: 1.55;
}

/* ── Wiki Article Prose ── */
.wiki-article h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
  margin: 48px 0 14px;
}

.wiki-article h2:first-child { margin-top: 0; }

.wiki-article h3 {
  font-size: 16px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 28px 0 10px;
}

.wiki-article p { color: hsl(var(--foreground)); margin-bottom: 14px; }
.wiki-article p:last-child { margin-bottom: 0; }

.wiki-article ul, .wiki-article ol {
  margin: 12px 0 16px 20px;
  color: hsl(var(--foreground));
}

.wiki-article ul li, .wiki-article ol li { margin-bottom: 6px; }

.wiki-article a {
  color: hsl(var(--foreground));
  text-decoration: underline;
  text-decoration-color: hsl(var(--border));
  text-underline-offset: 2px;
}

.wiki-article a:hover { text-decoration-color: hsl(var(--foreground)); }

.wiki-article code {
  background: hsl(var(--muted));
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-family: 'SF Mono', ui-monospace, 'Cascadia Code', monospace;
  font-size: 13px;
  color: hsl(var(--foreground));
}

/* ── Rule Cards ── */
.rule-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.rule-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: hsl(var(--muted) / 0.5);
  border-bottom: 1px solid hsl(var(--border));
}

.rule-num {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-family: inherit;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.rule-title {
  color: hsl(var(--foreground));
  font-size: 14px;
  font-weight: 500;
}

.rule-card-body { padding: 16px; }

.rule-card-body p {
  color: hsl(var(--foreground));
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 10px;
}

.rule-card-body p:last-child { margin-bottom: 0; }

.rule-sub {
  background: hsl(var(--muted) / 0.5);
  border-left: 3px solid hsl(var(--foreground));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  margin: 10px 0;
}

.rule-sub strong {
  color: hsl(var(--foreground));
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.rule-sub p {
  font-size: 13.5px;
  color: hsl(var(--foreground));
  margin: 0;
}

/* ── Notice Boxes ── */
.wiki-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid hsl(var(--border));
  border-left-width: 4px;
  background: hsl(var(--muted) / 0.3);
  color: hsl(var(--foreground));
}

.wiki-notice-icon {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
  width: 18px;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

.wiki-notice.warning { border-left-color: hsl(var(--warning)); }
.wiki-notice.info    { border-left-color: hsl(var(--info)); }
.wiki-notice.danger  { border-left-color: hsl(var(--destructive)); }
.wiki-notice.success { border-left-color: hsl(var(--success)); }

.wiki-notice a { color: hsl(var(--foreground)); }

/* ── Cards Grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.wiki-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  display: block;
}

.wiki-card:hover {
  border-color: hsl(var(--foreground) / 0.2);
  box-shadow: 0 2px 8px hsl(240 10% 3.9% / 0.06);
  transform: translateY(-1px);
}

html[data-theme="dark"] .wiki-card:hover {
  box-shadow: 0 2px 8px hsl(0 0% 0% / 0.2);
}

.wiki-card-icon {
  font-size: 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  color: hsl(var(--muted-foreground));
}

.wiki-card-title {
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.wiki-card-desc {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}

/* ── Table ── */
.wiki-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0;
  font-size: 13.5px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.wiki-table thead { background: hsl(var(--muted)); }

.wiki-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
}

.wiki-table td {
  padding: 10px 14px;
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  vertical-align: top;
}

.wiki-table tr:last-child td { border-bottom: none; }

/* ── Tags & Badges ── */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

.tag-red    { background: hsl(0 84% 60% / 0.1); color: hsl(0 72% 51%); border-color: hsl(0 84% 60% / 0.2); }
.tag-green  { background: hsl(142 76% 36% / 0.1); color: hsl(142 76% 36%); border-color: hsl(142 76% 36% / 0.2); }
.tag-blue   { background: hsl(221 83% 53% / 0.1); color: hsl(221 83% 53%); border-color: hsl(221 83% 53% / 0.2); }
.tag-yellow { background: hsl(38 92% 50% / 0.1); color: hsl(32 95% 44%); border-color: hsl(38 92% 50% / 0.2); }
.tag-gray   { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }

/* ── Command Blocks ── */
.cmd-block {
  background: hsl(240 10% 3.9%);
  border: 1px solid hsl(240 3.7% 15.9%);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 14px 0;
  font-family: 'SF Mono', ui-monospace, 'Cascadia Code', monospace;
  font-size: 13px;
  color: hsl(0 0% 98%);
}

.cmd-block .cmd-name { color: hsl(0 0% 98%); font-weight: 600; }
.cmd-block .cmd-args { color: hsl(240 5% 64.9%); }
.cmd-block .cmd-opt  { color: hsl(240 3.8% 46.1%); }
.cmd-block .cmd-desc {
  color: hsl(240 5% 64.9%);
  font-size: 12px;
  margin-top: 6px;
  font-family: 'Inter', sans-serif;
}

/* ── Hero (Homepage) ── */
.wiki-hero {
  position: relative;
  padding: 48px 0 40px;
  margin: -40px -40px 36px;
  border-bottom: 1px solid hsl(var(--border));
}

.wiki-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.wiki-hero h1 {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  line-height: 1.1;
  color: hsl(var(--foreground));
}

.wiki-hero h1 span { color: hsl(var(--muted-foreground)); }

.wiki-hero p {
  color: hsl(var(--muted-foreground));
  font-size: 16px;
  max-width: 520px;
  line-height: 1.6;
  margin-bottom: 0;
}

/* ── Section List ── */
.wiki-section-list { list-style: none; }

.wiki-section-list li {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: background .15s;
}

.wiki-section-list li:hover { background: hsl(var(--muted)); }

.wiki-section-list li::before { display: none; }

.wiki-section-list a {
  color: hsl(var(--foreground));
  text-decoration: none;
  font-weight: 500;
}

.wiki-section-list a:hover { text-decoration: underline; text-underline-offset: 2px; }

.wiki-section-list .list-desc {
  color: hsl(var(--muted-foreground));
  font-size: 13px;
}

/* ── Highlight Box ── */
.highlight-box {
  border-left: 3px solid hsl(var(--foreground));
  background: hsl(var(--muted) / 0.5);
  padding: 14px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 20px 0;
}

.highlight-box p { margin: 0; color: hsl(var(--foreground)); font-size: 14px; }

/* ── Faction Card ── */
.faction-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.faction-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
}

.faction-icon i { color: hsl(var(--muted-foreground)); }

.faction-icon.blue,
.faction-icon.red,
.faction-icon.green,
.faction-icon.dark,
.faction-icon.gold {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
}

.faction-info { flex: 1; }

.faction-name {
  font-size: 15px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.faction-tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.faction-desc { font-size: 14px; color: hsl(var(--foreground)); line-height: 1.6; }

/* ── Steps ── */
.steps { counter-reset: step-counter; list-style: none; }

.steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
  counter-increment: step-counter;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content { flex: 1; padding-top: 2px; }
.step-content h4 { font-size: 14px; font-weight: 600; color: hsl(var(--foreground)); margin-bottom: 4px; }
.step-content p  { font-size: 13.5px; color: hsl(var(--muted-foreground)); margin: 0; }

/* ── Footer ── */
.wiki-footer {
  background: hsl(var(--background));
  border-top: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  padding: 20px 40px;
  padding-right: calc(40px + var(--toc-width));
  margin-left: var(--sidebar-width);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.wiki-footer a {
  color: hsl(var(--foreground));
  text-decoration: none;
}

.wiki-footer a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ── Mobile ── */
@media (max-width: 1024px) {
  .wiki-toc { display: none; }
  .wiki-main { padding-right: 0; }
  .wiki-footer { padding-right: 40px; }
}

@media (max-width: 900px) {
  .wiki-content { padding: 32px 28px; }
  .wiki-hero { margin: -32px -28px 28px; padding: 36px 0 32px; }
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: block; }

  .wiki-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: none;
  }

  .wiki-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px hsl(240 10% 3.9% / 0.1);
  }

  .wiki-main { margin-left: 0; width: 100%; }

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

  .wiki-hero {
    padding: 28px 0 24px;
    margin: -24px -20px 24px;
  }

  .wiki-hero h1 { font-size: 28px; }

  .wiki-footer {
    margin-left: 0;
    padding: 20px;
    flex-direction: column;
    text-align: center;
  }

  .search-kbd { display: none; }
  #searchInput { width: 140px; padding-right: 12px; }
  .main-site-link { display: none; }

  .search-results { width: calc(100vw - 40px); right: -60px; }

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

  .faction-card { flex-direction: column; }

  .wiki-page-title { font-size: 26px; }
}

@media (max-width: 480px) {
  .wiki-hero h1 { font-size: 24px; }
  .wiki-page-title { font-size: 22px; }
}
