.wka-grid {
    display: grid; grid-template-columns: 240px 1fr;
    gap: 1rem;
}
@media (max-width: 960px) { .wka-grid { grid-template-columns: 1fr; } }

.wka-side {
    background: var(--card); border-radius: 0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    padding: 0.85rem 0.5rem;
    align-self: start; position: sticky; top: 78px;
    max-height: calc(100vh - 100px); overflow-y: auto;
}
.wka-side-h {
    font-size: 0.6rem; font-weight: 700; color: var(--ink-faint);
    text-transform: uppercase; letter-spacing: 0.14em;
    padding: 0.2rem 0.6rem 0.45rem;
}
.wka-side-row {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0.6rem; border-radius: 0;
    color: var(--ink-dim); font-size: 0.78rem; cursor: pointer;
    transition: background 0.12s, color 0.12s;
    text-decoration: none;
}
.wka-side-row:hover { background: var(--hover); color: var(--ink); }
.wka-side-row.is-active {
    background: rgba(255,153,0,0.1);
    color: var(--accent);
}
.wka-side-row i { font-size: 0.68rem; opacity: 0.6; }
.wka-side-empty { padding: 0.5rem 0.6rem; color: var(--ink-faint); font-size: 0.78rem; }
/* Narrow screens: "In this category" moves below the article as a full-width list
   (grid order), instead of disappearing - it was the only way to the siblings. */
@media (max-width: 960px) {
    .wka-grid > .wka-main { order: 1; }
    .wka-grid > .wka-side { order: 2; position: static; max-height: none; overflow: visible; }
    .wka-grid > .wka-side .wka-side-row { min-height: 44px; font-size: 0.86rem; padding: 0.5rem 0.75rem; }
    .wka-grid > .wka-side .wka-side-row i { font-size: 0.78rem; }
    .wka-side-stack .wka-side.is-group .wka-side-row { min-height: 44px; }
}
/* Touch at tablet widths, where the side column is still beside the article. */
@media (any-pointer: coarse) {
    .wka-side-row { min-height: 44px; }
}

/* A built-in group's sidebar (Light Transport): one standard panel per part (Road Trip
   Ranking, Coach Ranking), stacked; the stack is what sticks, not each panel. Rows a little
   larger than the category list, as the approved mock-up has them. On narrow screens the
   panels stay, above the article, because they are the only way between its articles:
   side by side where they fit, stacked on a phone. */
.wka-side-stack {
    display: flex; flex-direction: column; gap: 0.85rem; min-width: 0;
    align-self: start; position: sticky; top: 78px;
}
.wka-side-stack .wka-side { position: static; max-height: none; overflow: visible; align-self: stretch; }   /* .wka-side carries align-self: start for the grid; in this column it would shrink the panel */
.wka-side.is-group .wka-side-row { font-size: 0.86rem; padding: 0.5rem 0.6rem; }
.wka-side.is-group .wka-side-row i { font-size: 0.78rem; opacity: 0.75; }
.wka-side.is-group .wka-side-row.is-active i { opacity: 1; }
@media (max-width: 960px) {
    .wka-side-stack { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wka-side-stack .wka-side.is-group { display: block; }
}
@media (max-width: 560px) { .wka-side-stack { grid-template-columns: 1fr; } }

.wka-main {
    background: var(--card); border-radius: 0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    overflow: hidden;
}
.wka-meta {
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px dashed var(--line-soft);
}
.wka-meta-row {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    font-size: 0.7rem; color: var(--ink-faint);
    text-transform: uppercase; letter-spacing: 0.08em;
}
.wka-meta .ca {
    font-size: 0.62rem; font-weight: 700;
    padding: 2px 8px; border-radius: 999px;
    text-transform: uppercase; letter-spacing: 0.06em;
}
.wka-meta h1 {
    margin: 0.5rem 0 0.4rem;
    font-size: 1.4rem; font-weight: 600; color: var(--ink);
    display: flex; align-items: center; gap: 0.6rem;
}
.wka-meta h1 i { color: var(--accent); font-size: 1.05rem; }
.wka-meta .summary {
    font-size: 0.88rem; color: var(--ink-dim); line-height: 1.5;
    margin: 0.3rem 0 0;
}
.wka-meta .stats {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    font-size: 0.7rem; color: var(--ink-faint);
    margin-top: 0.65rem; font-variant-numeric: tabular-nums;
}
.wka-meta .stats i { color: var(--ink-faint); font-size: 0.66rem; margin-right: 3px; }

.wka-body {
    padding: 1.25rem 1.5rem 1.5rem;
    font-size: 0.9rem; color: var(--ink); line-height: 1.65;
}
.wka-body p { margin: 0 0 0.85rem; }
.wka-body strong { color: var(--ink); font-weight: 600; }
.wka-body em { color: var(--ink-dim); }
.wka-body a { color: var(--accent); text-decoration: none; }
.wka-body a:hover { text-decoration: underline; }
.wka-body h1, .wka-body h2, .wka-body h3, .wka-body h4 {
    color: var(--ink); margin: 1.4rem 0 0.7rem; font-weight: 600;
    scroll-margin-top: 80px;
}
.wka-body h1 { font-size: 1.2rem; }
.wka-body h2 { font-size: 1.05rem; padding-bottom: 0.35rem; border-bottom: 1px dashed var(--line-soft); }
.wka-body h3 { font-size: 0.95rem; color: var(--accent); }
.wka-body h4 { font-size: 0.85rem; }
.wka-body ul, .wka-body ol { margin: 0 0 0.95rem 1.25rem; padding: 0; color: var(--ink-dim); }
.wka-body li { margin-bottom: 0.3rem; }
.wka-body blockquote {
    margin: 0 0 0.95rem; padding: 0.6rem 0.9rem;
    background: var(--bg); border-left: 2px solid var(--accent);
    border-radius: 0; color: var(--ink-dim); font-size: 0.86rem;
}
.wka-body code {
    background: var(--bg); border: 1px solid var(--line-soft);
    padding: 1px 6px; border-radius: 0; font-size: 0.82em;
    color: var(--accent); font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.wka-body pre {
    background: var(--bg); border: 1px solid var(--line-soft);
    border-radius: 0; padding: 0.8rem 1rem; margin: 0 0 0.95rem;
    overflow-x: auto; font-size: 0.82rem;
}
.wka-body pre code { background: none; border: 0; padding: 0; color: var(--ink); }
.wka-body table {
    width: 100%; border-collapse: collapse; margin: 0 0 1rem;
    font-size: 0.84rem; background: var(--bg); border-radius: 0; overflow: hidden;
}
.wka-body table th, .wka-body table td {
    padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line-soft);
    text-align: left; color: var(--ink-dim);
}
.wka-body table th { background: var(--card); color: var(--ink); font-weight: 600; }
.wka-body img { max-width: 100%; height: auto; border-radius: 0; }
.wka-body hr { border: 0; border-top: 1px dashed var(--line-soft); margin: 1.5rem 0; }

/* ---- {{ranking_modes}} embedded layout ----------------------------- */
.wkx-rank-grid {
    display: grid; gap: 0.85rem; margin: 0.5rem 0 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 960px) { .wkx-rank-grid { grid-template-columns: 1fr; } }

/* Light Transport mode cards (Road Trip / Coach Ranking Modes): the same three cards as the
   truck article, with Masterclass in #E6B34A. The truck article is untouched. */
.wkx-rank-grid.is-lt .wkx-rank-card.is-gold { border-top-color: #E6B34A; }
.wkx-rank-grid.is-lt .wkx-rank-card.is-gold .wkx-rank-head i { color: #E6B34A; }

.wkx-rank-card {
    background: var(--bg); border-radius: 0; overflow: hidden;
    border: 1px solid var(--line-soft);
    border-top: 3px solid var(--line);
    display: flex; flex-direction: column;
}
.wkx-rank-card.is-gold  { border-top-color: var(--gold); }
.wkx-rank-card.is-green { border-top-color: var(--green); }
.wkx-rank-card.is-red   { border-top-color: var(--red); }

.wkx-rank-head {
    padding: 0.75rem 1rem;
    display: flex; align-items: center; gap: 0.5rem;
    border-bottom: 1px dashed var(--line-soft);
    font-size: 0.92rem; font-weight: 600; color: var(--ink);
}
.wkx-rank-card.is-gold  .wkx-rank-head i { color: var(--gold); }
.wkx-rank-card.is-green .wkx-rank-head i { color: var(--green); }
.wkx-rank-card.is-red   .wkx-rank-head i { color: var(--red); }

.wkx-rank-section { padding: 0.75rem 1rem; border-top: 1px dashed var(--line-soft); }
.wkx-rank-section:first-of-type { border-top: 0; }
.wkx-rank-section-h {
    font-size: 0.6rem; font-weight: 700; color: var(--ink-faint);
    text-transform: uppercase; letter-spacing: 0.14em;
    display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.55rem;
}
.wkx-rank-section-h i { color: var(--accent); font-size: 0.7rem; }

.wkx-rank-speeds { display: flex; flex-direction: column; gap: 0.45rem; }
.wkx-rank-speed-row { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.8rem; }
.wkx-rank-speed-label { font-size: 0.64rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.wkx-rank-speed-val { color: var(--ink); font-variant-numeric: tabular-nums; }
.wkx-rank-speed-val .alt { color: var(--ink-dim); font-size: 0.74rem; margin-left: 4px; }

.wkx-rank-settings { display: flex; flex-direction: column; gap: 0.3rem; }
.wkx-rank-setting { display: flex; align-items: center; gap: 0.5rem; font-size: 0.76rem; color: var(--ink-dim); }
.wkx-rank-setting i { width: 14px; text-align: center; font-size: 0.74rem; flex-shrink: 0; }
.wkx-rank-setting.ok i { color: var(--green); }
.wkx-rank-setting.no i { color: var(--red); }
.wkx-rank-setting.ok span { color: var(--ink); }

/* ---- {{exp_table}} embedded layout --------------------------------- */
.wkx-exp-grid {
    display: grid; gap: 0.65rem; margin: 0.5rem 0 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1100px) { .wkx-exp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .wkx-exp-grid { grid-template-columns: 1fr; } }
.wkx-exp-card { background: var(--bg); border: 1px solid var(--line-soft); border-radius: 0; overflow: hidden; }
.wkx-exp-h {
    display: grid; grid-template-columns: 50px 1fr;
    padding: 0.45rem 0.7rem; gap: 0.6rem;
    font-size: 0.58rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--ink-faint);
    border-bottom: 1px dashed var(--line-soft);
}
.wkx-exp-h .ta-r { text-align: right; }
.wkx-exp-list { display: flex; flex-direction: column; padding: 0.25rem; gap: 0.12rem; max-height: 360px; overflow-y: auto; }
.wkx-exp-row {
    display: grid; grid-template-columns: 50px 1fr;
    gap: 0.6rem; padding: 0.32rem 0.5rem;
    background: var(--card); border-radius: 0;
    font-size: 0.76rem; font-variant-numeric: tabular-nums;
    color: var(--ink-dim);
}
.wkx-exp-row .lvl { color: var(--ink); font-weight: 600; }
.wkx-exp-row .xp { text-align: right; }
.wkx-exp-row.is-self { border-left: 2px solid var(--accent); background: rgba(255,153,0,0.08); }
.wkx-exp-row.is-self .lvl, .wkx-exp-row.is-self .xp { color: var(--accent); }

/* ---- Below desktop ------------------------------------------------------
   11px floor for the small uppercase labels; the sticky sidebar clears the
   shell's sticky topbar; tables scroll inside themselves instead of being
   clipped by the article card. */
@media (max-width: 1199.98px) {
    .wka-side,
    .wka-side-stack { top: calc(var(--vt-sticky-top, 0px) + 14px); }
    .wka-side-h,
    .wkx-rank-section-h,
    .wkx-exp-h { font-size: max(11px, 0.6rem); letter-spacing: 0.1em; }
    .wka-meta .ca { font-size: max(11px, 0.62rem); }
    .wkx-rank-speed-label { font-size: max(11px, 0.64rem); }
    .wka-meta .stats { font-size: max(11px, 0.7rem); }
    .wka-main { overflow: clip visible; }
    .wka-body table { display: block; overflow-x: auto; max-width: 100%; overscroll-behavior-x: contain; }
    .wka-body h1, .wka-body h2, .wka-body h3, .wka-body h4 { scroll-margin-top: calc(var(--vt-sticky-top, 0px) + 16px); }
}
@media (max-width: 575.98px) {
    .wka-meta { padding: 0.9rem 1rem 0.7rem; }
    .wka-body { padding: 1rem 1rem 1.25rem; }
    .wka-meta h1 { font-size: 1.25rem; }
}
/* The experience table's four columns stack on phones; four 360px inner scroll boxes
   in a row of the page scroll were one scroll too many. */
@media (max-width: 560px) {
    .wkx-exp-list { max-height: none; overflow: visible; }
}
