/* F1 pages (was MaliWikis wiki.css until 2026-11-12): the page chrome f1-tools/build.rb
   writes. Uses the space theme's tokens (space.css loads after this and only
   sets tokens + shared skins), so dark and light both follow chamali_theme. */
.wk {
  --wk-w: 1180px;
  max-width: var(--wk-w);
  margin: 0 auto;
  padding: 28px 24px 64px;
  color: var(--text);
  font-family: var(--font-body, "Inter", "SukhumvitSet", sans-serif);
}
.wk a { color: inherit; }
/* one language at a time: html[data-wl] is set before paint (see <head>) */
html[data-wl="en"] .wl-th, html:not([data-wl="en"]) .wl-en { display: none !important; }
.wk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- head ---------- */
.wk-crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 22px; padding: 0; font-size: 13px; color: var(--muted); }
.wk-crumbs li { display: flex; align-items: center; gap: 6px; }
.wk-crumbs li + li::before { content: "›"; opacity: .6; }
.wk-crumbs a { text-decoration: none; color: var(--muted); border-radius: 6px; }
.wk-crumbs a:hover { color: var(--accent); }
.wk-crumbs [aria-current] { color: var(--text); font-weight: 600; }

.wk-title { display: flex; align-items: center; gap: 18px; }
.wk-title-ic { flex: none; width: 72px; height: 72px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-soft); border: 1px solid var(--edge); }
.wk-title-ic img { width: 48px; height: 48px; }
.wk-kicker { margin: 0 0 4px; font: 600 12px/1.3 var(--sp-display, inherit); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.wk h1 { margin: 0; font: 700 clamp(30px, 4.4vw, 52px)/1.15 var(--sp-display, inherit); letter-spacing: -.01em; }
.wk-sum { max-width: 68ch; margin: 18px 0 0; font-size: 18px; line-height: 1.75; color: var(--muted); }
.wk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.wk-dot { opacity: .5; }
.wk-review { padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.wk-en-note { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--line-strong); font-size: 14px; color: var(--muted); max-width: 68ch; }

/* ---------- article layout ---------- */
.wk-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; margin-top: 36px; align-items: start; }
.wk-side { position: sticky; top: 96px; }
.wk-side-in { display: grid; gap: 18px; }
.wk-info, .wk-toc { border: 1px solid var(--edge); border-radius: var(--radius-lg, 16px); background: var(--surface); }
.wk-info { overflow: hidden; }
.wk-info-h { display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px 16px; background: var(--surface-soft); border-bottom: 1px solid var(--line); font: 700 15px/1.3 var(--sp-display, inherit); }
.wk-info-h img { width: 32px; height: 32px; }
.wk-info dl { margin: 0; padding: 4px 16px 10px; }
.wk-info dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; line-height: 1.5; }
.wk-info dl > div:last-child { border-bottom: 0; }
.wk-info dt { color: var(--muted); }
.wk-info dd { margin: 0; font-weight: 600; }
.wk-toc { padding: 4px 6px 8px; }
.wk-toc summary { list-style: none; cursor: pointer; padding: 10px 10px 6px; font: 600 12px/1.3 var(--sp-display, inherit); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wk-toc summary::-webkit-details-marker { display: none; }
.wk-toc ol { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 420px); min-height: 120px; overflow: auto; }
.wk-toc a { display: block; padding: 6px 10px; border-radius: 8px; text-decoration: none; font-size: 14px; line-height: 1.45; color: var(--muted); }
.wk-toc .l3 a { padding-left: 24px; font-size: 13px; }
.wk-toc a:hover { color: var(--text); background: var(--fill); }
.wk-toc a.is-on { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* ---------- article text ---------- */
.wk-body { max-width: 72ch; font-size: 17px; line-height: 1.85; }
.wk-body > :first-child { margin-top: 0; }
.wk-body h2 { margin: 48px 0 14px; font: 700 26px/1.3 var(--sp-display, inherit); scroll-margin-top: 20px; }
.wk-body h3 { margin: 30px 0 10px; font: 700 19px/1.4 var(--sp-display, inherit); scroll-margin-top: 20px; }
.wk-body p { margin: 0 0 16px; }
.wk-body ul, .wk-body ol { margin: 0 0 18px; padding-left: 1.4em; }
.wk-body li { margin: 6px 0; }
.wk-body li::marker { color: var(--accent); font-weight: 700; }
.wk-body strong { font-weight: 700; }
.wk-body a { color: var(--accent); text-underline-offset: 3px; }
.wk-tip { margin: 22px 0; padding: 16px 18px; border-radius: 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); font-size: 16px; line-height: 1.75; }
.wk-table { margin: 18px 0 24px; overflow-x: auto; border: 1px solid var(--edge); border-radius: 14px; background: var(--surface); }
.wk-table:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wk-table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.wk-table th, .wk-table td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.wk-table th { background: var(--surface-soft); font-weight: 700; white-space: nowrap; }
.wk-table tr:last-child td { border-bottom: 0; }

/* ---------- cards (hubs + related) ---------- */
.wk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 30px; }
.wk-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--edge); border-radius: var(--radius-lg, 16px); background: var(--surface); text-decoration: none; transition: transform .2s var(--sp-ease, ease), border-color .2s; }
a.wk-card:hover { transform: translateY(-2px); border-color: var(--accent-line); }
.wk-card-ic { flex: none; width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-soft); }
.wk-card-ic img { width: 38px; height: 38px; }
.wk-card-t { display: grid; gap: 3px; min-width: 0; }
.wk-card-t b { font: 700 16px/1.3 var(--sp-display, inherit); }
.wk-card-t small { font-size: 13px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wk-card-t em { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.wk-card > i { margin-left: auto; flex: none; font-style: normal; font-size: 20px; color: var(--muted); }
.wk-card.is-soon { opacity: .7; border-style: dashed; }
.wk-related { margin-top: 64px; }
.wk-related h2 { margin: 0; font: 700 22px/1.3 var(--sp-display, inherit); }
.wk-related .wk-cards { margin-top: 16px; }
.wk-hub-body { margin-top: 36px; }
.wk-legal { max-width: 80ch; margin: 48px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.7; color: var(--muted); }

/* ---------- light / dark details ---------- */
html[data-theme="dark"] .wk-title-ic, html[data-theme="dark"] .wk-card-ic { background: #111111 var(--sp-stars-dark) 0 0 / 160px; border-color: rgba(243, 238, 227, .12); }

/* ---------- tablet and phone ---------- */
@media (max-width: 1023px) {
  .wk-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; margin-top: 26px; }
  .wk-side { position: static; }
  .wk-side-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .wk-toc ol { max-height: none; }
}
@media (max-width: 700px) {
  .wk { padding: 16px 16px 120px; }
  .wk-crumbs ol { margin-bottom: 16px; }
  .wk-title { gap: 14px; }
  .wk-title-ic { width: 56px; height: 56px; border-radius: 14px; }
  .wk-title-ic img { width: 38px; height: 38px; }
  .wk h1 { font-size: 28px; }
  .wk-sum { font-size: 16px; margin-top: 14px; }
  .wk-side-in { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .wk-info dl > div { grid-template-columns: 92px minmax(0, 1fr); }
  .wk-toc ol { padding-bottom: 4px; }
  .wk-body { font-size: 16px; line-height: 1.8; }
  .wk-body h2 { font-size: 22px; margin-top: 38px; }
  .wk-table table { font-size: 14px; }
  .wk-table th { white-space: normal; min-width: 88px; }
  .wk-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 22px; }
}
@media (prefers-reduced-motion: reduce) { .wk-card { transition: none; } }
/* F1 is black in both themes (2026-11-28, the user: "Keep the F1 page to be black"):
   minimal.css gives cards a near-white --card-bg by day, which turned the fact box
   (.wk-info) and the contents box grey with pale text */
body[data-wsec="f1"] { --card-bg: var(--surface); }
