.model-wiki { max-width: 960px; margin: 28px auto 72px; padding: 0 18px; color: #202226; }
.model-wiki__preview { position: sticky; top: 8px; z-index: 5; margin-bottom: 16px; padding: 11px 16px; border: 1px solid #e8b15b; border-radius: 8px; background: #fff5df; color: #6b4100; font-weight: 700; text-align: center; }
.model-wiki__back { display: inline-block; margin: 0 0 14px; color: #555a60; font-weight: 700; }
.model-wiki__hero { padding: 42px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #17191d, #343941); box-shadow: 0 18px 45px rgba(0,0,0,.16); }
.model-wiki__eyebrow { margin: 0 0 12px; color: #ffbfca; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.model-wiki__hero h1 { margin: 0; color: #fff; font-size: clamp(30px, 5vw, 48px); line-height: 1.08; }
.model-wiki__lead { max-width: 760px; margin: 18px 0; color: #e4e6e9; font-size: 19px; line-height: 1.55; }
.model-wiki__meta { display: flex; flex-wrap: wrap; gap: 8px; }
.model-wiki__meta span { padding: 6px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #f5f5f5; font-size: 13px; }
.model-wiki__toc { margin: 22px 0; padding: 18px 20px 20px; border: 1px solid #d9dcdf; border-radius: 12px; background: #fff; }
.model-wiki__toc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #e5e6e8; }
.model-wiki__toc-head strong { color: #25282c; font-size: 18px; }
.model-wiki__toc-head span { color: #73777c; font-size: 13px; }
.model-wiki__toc-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.model-wiki__toc-links a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 12px; border: 1px solid #d8dadd; border-radius: 8px; background: #f6f7f8; color: #2e3237; font-weight: 700; line-height: 1.3; text-decoration: none; }
.model-wiki__toc-links a > span { display: inline-flex; flex: 0 0 26px; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #34383d; color: #fff; font-size: 12px; }
.model-wiki__toc-links a:hover { border-color: #b88a00; background: #fff8df; color: #17191c; }
.model-wiki__toc-links a:focus-visible { outline: 3px solid rgba(184,138,0,.3); outline-offset: 2px; }
.model-wiki__evidence-note { margin: -6px 0 22px; padding: 13px 16px; border-left: 4px solid #d4a000; background: rgba(255,255,255,.92); color: #4d5156; line-height: 1.55; }
.model-wiki__section { scroll-margin-top: 24px; margin-top: 20px; padding: 30px; border: 1px solid #dedede; border-radius: 12px; background: #fff; }
.model-wiki__section h2 { margin-top: 0; font-size: 28px; }
.model-wiki__summary { color: #555b62; font-size: 17px; line-height: 1.65; }
.model-wiki__claim { margin: 20px 0; padding: 4px 0 4px 16px; border-left: 4px solid #d4a000; background: #fff; }
.model-wiki__claim > p { margin: 0 0 14px; font-size: 16px; line-height: 1.7; }
.model-wiki__support { display: block; color: #666; font-size: 13px; }
.model-wiki__sources { margin: 10px 0 0; padding: 0 0 0 24px; color: #35383c; list-style: none; }
.model-wiki__sources li { margin: 6px 0; line-height: 1.45; }
.model-wiki__sources a { color: #25282c; text-decoration: none; }
.model-wiki__sources a:hover { color: #111; text-decoration: underline; }
.model-wiki__sources span { color: #45494e; }
.model-wiki__sources small { margin-left: 6px; color: #85898e; font-size: 12px; }
.model-wiki__empty { color: #6c6f73; font-style: italic; }
.model-wiki__method { margin-top: 24px; padding: 26px 30px; border-radius: 12px; background: #eceff2; }
.model-wiki__method h2 { margin-top: 0; font-size: 21px; }
.model-wiki__method p { margin-bottom: 0; line-height: 1.65; }
.model-wiki-index__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.model-wiki-index__card { padding: 24px; border: 1px solid #dedede; border-radius: 12px; background: #fff; }
.model-wiki-index__card > p:first-child { margin: 0 0 6px; color: #777; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.model-wiki-index__card h2 { margin: 0 0 8px; font-size: 23px; }
.model-wiki-index__card h2 a { color: #22262a; }
.model-wiki-index__card > span, .model-wiki-index__card small { color: #6b6f74; }
.model-wiki-index__card > p:not(:first-child) { margin: 14px 0 0; line-height: 1.55; }

/* The Wiki has its own article surfaces, so it needs a complete dark palette
   rather than inheriting only the forum's generic card rules. */
html[data-theme="dark"] .model-wiki { color: var(--ft-dark-text-soft); }
html[data-theme="dark"] .model-wiki__preview {
  background: #261f13;
  border-color: #805e20;
  color: #f0ce86;
}
html[data-theme="dark"] .model-wiki__back { color: var(--ft-dark-text-soft) !important; }
html[data-theme="dark"] .model-wiki__back:hover,
html[data-theme="dark"] .model-wiki__back:focus { color: #ff7183 !important; }
html[data-theme="dark"] .model-wiki__hero {
  background: linear-gradient(135deg, #151617, #222426);
  box-shadow: 0 18px 45px rgba(0,0,0,.38);
}
html[data-theme="dark"] .model-wiki__hero h1 { color: var(--ft-dark-text); }
html[data-theme="dark"] .model-wiki__lead { color: var(--ft-dark-text-soft); }
html[data-theme="dark"] .model-wiki__meta span {
  border-color: #434548;
  color: var(--ft-dark-text-soft);
}
html[data-theme="dark"] .model-wiki__toc,
html[data-theme="dark"] .model-wiki__section,
html[data-theme="dark"] .model-wiki-index__card {
  background: rgb(17 18 19 / 98%);
  border-color: #303234;
  box-shadow: 0 10px 24px rgba(0,0,0,.24);
}
html[data-theme="dark"] .model-wiki__toc-head { border-color: #303234; }
html[data-theme="dark"] .model-wiki__toc-head strong,
html[data-theme="dark"] .model-wiki__section h2,
html[data-theme="dark"] .model-wiki__method h2 { color: var(--ft-dark-text); }
html[data-theme="dark"] .model-wiki__toc-head span,
html[data-theme="dark"] .model-wiki__support,
html[data-theme="dark"] .model-wiki__sources span,
html[data-theme="dark"] .model-wiki__sources small,
html[data-theme="dark"] .model-wiki__empty,
html[data-theme="dark"] .model-wiki-index__card > p:first-child,
html[data-theme="dark"] .model-wiki-index__card > span,
html[data-theme="dark"] .model-wiki-index__card small { color: var(--ft-dark-muted); }
html[data-theme="dark"] .model-wiki__toc-links a {
  background: #1d1e20;
  border-color: #393b3e;
  color: var(--ft-dark-text-soft) !important;
}
html[data-theme="dark"] .model-wiki__toc-links a > span { background: #333538; color: #fff; }
html[data-theme="dark"] .model-wiki__toc-links a:hover,
html[data-theme="dark"] .model-wiki__toc-links a:focus {
  background: #29191d;
  border-color: #cd192d;
  color: #fff !important;
}
html[data-theme="dark"] .model-wiki__toc-links a:focus-visible { outline-color: rgba(205,25,45,.38); }
html[data-theme="dark"] .model-wiki__evidence-note {
  background: #201d17;
  border-color: #c28c24;
  color: #ead7ac;
}
html[data-theme="dark"] .model-wiki__summary { color: var(--ft-dark-text-soft); }
html[data-theme="dark"] .model-wiki__claim {
  background: #1a1b1c;
  border-left-color: #d40000;
}
html[data-theme="dark"] .model-wiki__claim > p { color: var(--ft-dark-text-soft); }
html[data-theme="dark"] .model-wiki__sources { color: var(--ft-dark-text-soft); }
html[data-theme="dark"] .model-wiki__sources a { color: #f0f1f2 !important; }
html[data-theme="dark"] .model-wiki__sources a:hover,
html[data-theme="dark"] .model-wiki__sources a:focus { color: #ff7183 !important; }
html[data-theme="dark"] .model-wiki__method {
  background: #1b1d1e;
  border: 1px solid #303234;
  color: var(--ft-dark-text-soft);
}
html[data-theme="dark"] .model-wiki-index__card h2 a { color: var(--ft-dark-text) !important; }
html[data-theme="dark"] .model-wiki-index__card h2 a:hover,
html[data-theme="dark"] .model-wiki-index__card h2 a:focus { color: #ff7183 !important; }
@media (max-width: 640px) {
  .model-wiki { padding: 0 12px; }
  .model-wiki__hero { padding: 28px 22px; border-radius: 12px; }
  .model-wiki__lead { font-size: 17px; }
  .model-wiki__toc { padding: 16px; }
  .model-wiki__toc-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .model-wiki__toc-links { grid-template-columns: 1fr; }
  .model-wiki__section { padding: 23px 18px; }
  .model-wiki__section h2 { font-size: 24px; }
  .model-wiki-index__grid { grid-template-columns: 1fr; }
}
