/* Sameko Wiki layer
   Loaded after styles.css. Same language as the homepage: the app's Kawaii
   Light / Kawaii Dark trio (sky blue, white and butter), bold and flat, with
   thick ink outlines and hard offset shadows instead of gradients and blur. */

body.wiki-page {
    --wiki-bg: #f7fbfe;
    --wiki-surface: #ffffff;
    --wiki-surface-soft: #eef7fd;
    --wiki-surface-blue: #e3f2fb;
    --wiki-ink: #2a4a5a;
    --wiki-ink-soft: #3e5e6e;
    --wiki-muted: #4f6c7c;
    --wiki-brand: #88c9ea;
    --wiki-brand-strong: #2a7ab0;
    --wiki-accent: #f6d77f;
    --wiki-on-pastel: #10202c;
    --wiki-code: #152535;
    --wiki-code-ink: #e0f0ff;
    --wiki-nav-height: 68px;
    /* Bold flat kit, shared with homepage.css */
    --ink: #2a4a5a;
    --ink-shadow: #2a4a5a;
    --bd: 2.5px solid var(--ink);
    --pop: 0 5px 0 var(--ink-shadow);
    --pop-sm: 0 3px 0 var(--ink-shadow);
    --shape-sky: #88c9ea;
    --shape-butter: #f6d77f;
    --shape-white: #ffffff;
    --sec-sky: #e6f3fb;
    --sec-white: #ffffff;
    --sec-butter: #fdf6e1;
    --wave-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100' preserveAspectRatio='none'%3E%3Cpath d='M0 55Q180 15 360 55T720 55T1080 55T1440 55V100H0Z'/%3E%3C/svg%3E");
    background: var(--wiki-bg);
    color: var(--wiki-ink);
    font-family: var(--font-sans);
    overflow-x: hidden;
}

[data-theme="dark"] body.wiki-page {
    --wiki-bg: #0d1a25;
    /* Cards sit clearly above the page so outlines and shadows read on dark. */
    --wiki-surface: #213b53;
    --wiki-surface-soft: #11202d;
    --wiki-surface-blue: #0f1e2b;
    --wiki-ink: #e0f0ff;
    --wiki-ink-soft: #b4cddc;
    --wiki-muted: #91abbb;
    --wiki-brand-strong: #a8d8f0;
    --wiki-code: #0a1520;
    --ink: #050d14;
    --ink-shadow: #050d14;
    --shape-white: #e0f0ff;
    --sec-sky: #16324a;
    --sec-white: #172b3d;
    --sec-butter: #1c2533;
}

/* Boxes inside a card always step up to a clearly lighter fill on dark. */
[data-theme="dark"] .wiki-page .wiki-content section {
    --fill: #26435e;
}

/* On dark, the giant word and the lang pill need a lighter edge to show up. */
[data-theme="dark"] .wiki-page .wiki-hero-word {
    color: #1a3a55;
    -webkit-text-stroke-color: rgba(136, 201, 234, 0.22);
}

[data-theme="dark"] .wiki-page .lang-btn {
    color: var(--wiki-ink-soft);
}

[data-theme="dark"] .wiki-page .wiki-content th,
[data-theme="dark"] .wiki-page .wiki-content td {
    border-bottom-color: #2c4a64;
}

[data-theme="dark"] .wiki-page .wiki-content tbody tr:hover td {
    background: #2a4560;
}

.wiki-page *,
.wiki-page *::before,
.wiki-page *::after {
    box-sizing: border-box;
}

.wiki-page a {
    color: var(--wiki-brand-strong);
}

.wiki-page a:focus-visible,
.wiki-page button:focus-visible,
.wiki-page input:focus-visible {
    outline: 3px solid var(--wiki-brand-strong);
    outline-offset: 3px;
}

.wiki-page .skip-link {
    position: fixed;
    top: 10px;
    left: 16px;
    z-index: 2000;
    transform: translateY(-150%);
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--wiki-ink);
    color: var(--wiki-surface);
    font-weight: 800;
    transition: transform 180ms ease;
}

.wiki-page .skip-link:focus {
    transform: translateY(0);
}

/* ---------- Nav ---------- */
.wiki-page > nav {
    position: sticky;
    top: 14px;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(1180px, calc(100% - 32px));
    min-height: var(--wiki-nav-height);
    margin: 14px auto 0;
    padding: 8px 10px 8px 22px;
    border: var(--bd);
    border-radius: 999px;
    background: var(--wiki-surface);
    box-shadow: var(--pop);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.wiki-page .logo {
    min-width: max-content;
    font-size: 15px;
    font-weight: 700;
    color: var(--wiki-ink);
}

.wiki-page .logo a {
    color: inherit;
}

.wiki-page .logo img {
    border-radius: 12px;
}

.wiki-page .nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.wiki-page .nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 8px 14px;
    border: 2px solid transparent;
    border-radius: 30px;
    color: var(--wiki-ink-soft);
    font-size: 14px;
    font-weight: 700;
    transition: background-color 180ms ease;
}

.wiki-page .nav-links a::after {
    display: none;
}

.wiki-page .nav-links a:hover {
    color: var(--wiki-ink);
    background: var(--sec-butter);
}

.wiki-page .nav-links a[aria-current="page"] {
    color: var(--wiki-on-pastel);
    background: var(--wiki-brand);
    border-color: var(--ink);
}

/* VI / EN sits at the end of the nav as a small segmented pill. */
.wiki-page .lang-switcher {
    position: static;
    display: flex;
    flex-shrink: 0;
    gap: 2px;
    padding: 4px;
    border: 0;
    border-radius: 999px;
    background: var(--wiki-surface-blue);
    box-shadow: none;
    transform: none;
}

.wiki-page .lang-btn {
    padding: 7px 12px;
    border: 2px solid transparent;
    border-radius: 999px;
    color: var(--wiki-muted);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.wiki-page .lang-btn:hover {
    color: var(--wiki-ink);
}

.wiki-page .lang-btn.active {
    background: var(--wiki-accent);
    border-color: var(--ink);
    color: var(--wiki-on-pastel);
}

/* ---------- Hero ---------- */
.wiki-page .wiki-wrapper {
    min-height: 100vh;
    padding: 42px 0 80px;
    background: var(--wiki-bg);
}

.wiki-page .container {
    width: min(1180px, calc(100% - 32px));
    max-width: 1180px;
    padding: 0;
}

.wiki-page .wiki-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    margin: 0 auto 110px;
    padding: clamp(56px, 8vw, 104px) 0 clamp(40px, 5vw, 64px);
    text-align: center;
}

/* A full-width sky band behind the hero; it ends in the drifting wave. */
.wiki-page .wiki-hero::before {
    content: '';
    position: absolute;
    z-index: -2;
    top: -400px;
    bottom: 0;
    left: 50%;
    width: 100vw;
    margin-left: -50vw;
    background: var(--sec-sky);
}

.wiki-page .wiki-hero-wave {
    position: absolute;
    z-index: -2;
    top: 100%;
    left: 50%;
    width: 100vw;
    height: 92px;
    margin-left: -50vw;
    pointer-events: none;
    transform: scaleY(var(--wave, 1));
    transform-origin: center top;
}

.wiki-page .wiki-hero-wave::before,
.wiki-page .wiki-hero-wave::after {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 72px;
    background: var(--sec-sky);
    transform: scaleY(-1);
    -webkit-mask: var(--wave-tile) 0 100% / 1440px 100% repeat-x;
            mask: var(--wave-tile) 0 100% / 1440px 100% repeat-x;
    animation: wiki-wave 18s linear infinite;
}

.wiki-page .wiki-hero-wave::after {
    height: 92px;
    opacity: 0.45;
    animation-duration: 26s;
    animation-direction: reverse;
}

@keyframes wiki-wave {
    to {
        -webkit-mask-position: -1440px 100%;
                mask-position: -1440px 100%;
    }
}

.wiki-page .wiki-hero-copy {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    max-width: 860px;
}

/* Cute flat shapes and a giant outlined "Wiki" behind the title. */
.wiki-page .wiki-hero-art {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.wiki-page .wiki-hero-word {
    position: absolute;
    left: 50%;
    top: 48%;
    translate: -50% -50%;
    color: var(--sec-sky);
    font-size: clamp(200px, 30vw, 440px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.06em;
    white-space: nowrap;
    -webkit-text-stroke: 3px color-mix(in srgb, var(--ink) 18%, transparent);
    paint-order: stroke fill;
}

.wiki-page .shape {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--sz);
    height: var(--sz);
    rotate: var(--r, 0deg);
    animation: wiki-drift var(--d, 8s) ease-in-out infinite alternate;
}

.wiki-page .shape--circle,
.wiki-page .shape--pill,
.wiki-page .shape--ring,
.wiki-page .shape--squircle {
    border: 3px solid var(--ink);
    background: var(--c);
    box-shadow: var(--pop-sm);
}

.wiki-page .shape--circle { border-radius: 50%; }
.wiki-page .shape--pill { height: calc(var(--sz) * 0.42); border-radius: 99px; }
.wiki-page .shape--squircle { border-radius: 30%; }

.wiki-page .shape--ring {
    border-width: 8px;
    border-color: var(--c);
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 3px var(--ink);
}

.wiki-page .shape svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 3px 0 var(--ink-shadow));
}

.wiki-page .shape svg path {
    fill: var(--c);
    stroke: var(--ink);
    stroke-width: 3;
    stroke-linejoin: round;
}

@keyframes wiki-drift {
    to { translate: 6px -16px; }
}

.wiki-page .wiki-release-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
    padding: 5px 16px 5px 5px;
    border: var(--bd);
    border-radius: 999px;
    background: var(--wiki-surface);
    box-shadow: var(--pop-sm);
    color: var(--wiki-ink);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.wiki-page .wiki-release-pill b {
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--wiki-accent);
    color: var(--wiki-on-pastel);
}

.wiki-page .wiki-release-pill:hover {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--ink-shadow);
}

.wiki-page .wiki-hero h1 {
    margin: 0 0 40px;
    color: var(--wiki-ink);
    font-size: clamp(46px, 6.4vw, 88px);
    line-height: 1.08;
    letter-spacing: -0.05em;
    text-wrap: balance;
}

/* styles.css paints every span inside an h1 with a gradient; the split words are spans. */
.wiki-page .wiki-hero h1 span {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: inherit;
}

/* Highlight: the homepage's flat sky sticker, butter squiggle and shine. */
.wiki-page .hl {
    position: relative;
    display: inline-block;
    isolation: isolate;
    padding-inline: 0.06em;
    white-space: nowrap;
}

.wiki-page .wiki-hero h1 .hl::before {
    content: '';
    position: absolute;
    inset: 12% -0.16em -8% -0.14em;
    z-index: -1;
    border: 3px solid var(--ink);
    border-radius: 0.32em 0.5em 0.28em 0.46em;
    background: var(--wiki-brand);
    box-shadow: 0 6px 0 var(--ink-shadow);
    transform: rotate(-2.5deg) scaleX(var(--highlight-scale, 1));
    transform-origin: left center;
}

[data-theme="dark"] .wiki-page .wiki-hero h1 .hl {
    color: var(--wiki-on-pastel);
}

.wiki-page .hl__squiggle {
    position: absolute;
    left: -2%;
    bottom: -0.46em;
    width: 104%;
    height: 0.32em;
    overflow: visible;
}

.wiki-page .hl__squiggle path {
    fill: none;
    stroke: var(--wiki-accent);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: var(--draw, 0);
}

.wiki-page .hl__shine {
    position: absolute;
    right: -0.42em;
    top: -0.34em;
    width: 0.42em;
    height: 0.42em;
    overflow: visible;
}

.wiki-page .hl__shine path {
    fill: none;
    stroke: var(--ink);
    stroke-width: 4.5;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: var(--draw, 0);
}

/* On a two-line title the shine would land on the line above. */
.wiki-page .wiki-hero h1.is-two-line .hl__shine {
    display: none;
}

.wiki-page .wiki-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--wiki-accent);
    color: var(--wiki-on-pastel);
    font-size: 0.8em;
    font-weight: 700;
}

[data-theme="dark"] .wiki-page .hl__shine path {
    stroke: var(--wiki-accent);
}

.wiki-page .wiki-hero-copy > p {
    max-width: 52ch;
    text-wrap: balance;
    margin: 0 0 30px;
    color: var(--wiki-ink-soft);
    font-size: clamp(17px, 2vw, 20px);
    line-height: 1.65;
}

.wiki-page .wiki-hero-copy > p code {
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--wiki-surface);
    color: var(--wiki-brand-strong);
}

/* ---------- Search ---------- */
.wiki-page .wiki-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(560px, 100%);
    padding: 6px 6px 6px 18px;
    border: var(--bd);
    border-radius: 999px;
    background: var(--wiki-surface);
    box-shadow: var(--pop);
}

.wiki-page .wiki-search:focus-within {
    outline: 3px solid var(--wiki-accent);
    outline-offset: 3px;
}

.wiki-page .wiki-search svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: var(--wiki-ink);
    stroke-width: 2.5;
}

.wiki-page .wiki-search input {
    min-width: 0;
    flex: 1;
    height: 44px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--wiki-ink);
    font: inherit;
    font-size: 15px;
}

.wiki-page .wiki-search input:focus-visible {
    outline: 0;
}

.wiki-page .wiki-search input::placeholder {
    color: var(--wiki-muted);
}

.wiki-page .wiki-search button {
    min-height: 44px;
    padding: 0 20px;
    border: var(--bd);
    border-radius: 999px;
    background: var(--wiki-brand);
    color: var(--wiki-on-pastel);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    transition: background-color 150ms ease;
}

.wiki-page .wiki-search button:hover {
    background: var(--wiki-accent);
}

.wiki-page .wiki-search-results {
    min-height: 20px;
    margin-top: 12px;
    color: var(--wiki-ink-soft);
    font-size: 13px;
    font-weight: 700;
}

/* ---------- Layout and sidebar ---------- */
.wiki-page .wiki-layout {
    display: grid;
    grid-template-columns: 246px minmax(0, 1fr);
    align-items: start;
    gap: clamp(22px, 4vw, 48px);
    padding-bottom: 30px;
}

.wiki-page .wiki-sidebar {
    position: sticky;
    top: 108px;
    z-index: 5;
    max-height: calc(100vh - 130px);
    padding: 18px 12px;
    overflow-y: auto;
    border: var(--bd);
    border-radius: 24px;
    background: var(--wiki-surface);
    box-shadow: var(--pop);
    /* The rounded card has no room for a scrollbar; wiki.js keeps the active link in view instead. */
    scrollbar-width: none;
    overscroll-behavior: contain;
}

.wiki-page .wiki-sidebar::-webkit-scrollbar {
    display: none;
}

.wiki-page .wiki-sidebar-nav {
    position: relative;
}

/* wiki.js slides this pill under the active link. */
.wiki-page .wiki-nav-marker {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 0;
    border: 2px solid var(--ink);
    border-radius: 14px;
    background: var(--wiki-brand);
    box-shadow: var(--pop-sm);
    pointer-events: none;
    opacity: 0;
}

.wiki-page .wiki-sidebar-toggle {
    display: none;
}

.wiki-page .wiki-nav-group {
    margin: 0 0 12px;
}

.wiki-page .wiki-nav-group:last-child {
    margin-bottom: 4px;
}

.wiki-page .wiki-nav-title {
    margin: 0 10px 4px;
    color: var(--wiki-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.wiki-page .wiki-nav-link {
    position: relative;
    z-index: 1;
    display: block;
    margin: 1px 0;
    padding: 6px 12px;
    border: 0;
    border-radius: 14px;
    color: var(--wiki-ink-soft);
    font-size: 14px;
    font-weight: 700;
    opacity: 1;
    transition: color 180ms ease, background-color 180ms ease;
}

.wiki-page .wiki-nav-link:hover {
    color: var(--wiki-ink);
    background: var(--sec-butter);
    transform: none;
}

.wiki-page .wiki-nav-link.active {
    color: var(--wiki-on-pastel);
    background: var(--wiki-brand);
    box-shadow: none;
}

.wiki-page .has-marker .wiki-nav-link.active {
    background: transparent;
}

/* ---------- Content sections: white, sky and butter in turn ---------- */
.wiki-page .wiki-content {
    min-width: 0;
    max-width: 860px;
    counter-reset: wiki-section;
}

.wiki-page .wiki-content > div:first-child {
    display: grid;
    gap: 28px;
}

.wiki-page .wiki-content section {
    --card: var(--sec-white);
    --fill: var(--sec-sky);
    --badge: var(--wiki-accent);
    min-width: 0;
    margin: 0;
    padding: clamp(26px, 4vw, 44px);
    border: var(--bd);
    border-radius: 28px;
    background: var(--card);
    box-shadow: var(--pop);
    counter-increment: wiki-section;
    scroll-margin-top: 108px;
}

.wiki-page .wiki-content section:nth-child(3n + 2) {
    --card: var(--sec-sky);
    --fill: var(--wiki-surface);
    --badge: var(--wiki-accent);
}

.wiki-page .wiki-content section:nth-child(3n) {
    --card: var(--sec-butter);
    --fill: var(--wiki-surface);
    --badge: var(--wiki-brand);
}

.wiki-page .wiki-content section[data-search-hit="true"] {
    outline: 4px solid var(--wiki-accent);
    outline-offset: 4px;
}

.wiki-page .wiki-content h1,
.wiki-page .wiki-content h2,
.wiki-page .wiki-content h3,
.wiki-page .wiki-content h4 {
    color: var(--wiki-ink);
    letter-spacing: -0.03em;
}

.wiki-page .wiki-content h2 {
    margin: 30px 0 12px;
    font-size: clamp(24px, 3vw, 30px);
    line-height: 1.15;
}

/* The section's first heading is its title, numbered like the homepage chapters. */
.wiki-page .wiki-content section > h2:first-of-type {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 0;
    font-size: clamp(28px, 3.8vw, 40px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.wiki-page .wiki-content section > h2:first-of-type::before {
    content: counter(wiki-section, decimal-leading-zero);
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 50px;
    height: 50px;
    border: var(--bd);
    border-radius: 50%;
    background: var(--badge);
    box-shadow: var(--pop-sm);
    color: var(--wiki-on-pastel);
    font-size: 17px;
    letter-spacing: 0;
    rotate: -6deg;
}

.wiki-page .wiki-content h3 {
    margin: 24px 0 9px;
    font-size: 19px;
    line-height: 1.25;
}

.wiki-page .wiki-content p,
.wiki-page .wiki-content li {
    color: var(--wiki-ink-soft);
    font-size: 15.5px;
    line-height: 1.72;
}

.wiki-page .wiki-content p {
    margin: 0 0 15px;
}

.wiki-page .wiki-content ul,
.wiki-page .wiki-content ol {
    margin: 0 0 20px;
    padding-left: 22px;
}

.wiki-page .wiki-content li {
    margin-bottom: 7px;
}

.wiki-page .wiki-content li::marker {
    color: var(--wiki-brand-strong);
}

.wiki-page .wiki-content strong,
.wiki-page .wiki-content b {
    color: var(--wiki-ink);
}

.wiki-page .wiki-eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 18px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--wiki-accent);
    color: var(--wiki-on-pastel);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.wiki-page .wiki-subtitle {
    margin-bottom: 24px;
    color: var(--wiki-muted);
    font-size: 17px;
    font-weight: 600;
}

.wiki-page .wiki-content code {
    padding: 2px 7px;
    border: 0;
    border-radius: 7px;
    background: var(--fill, var(--wiki-surface-soft));
    color: var(--wiki-brand-strong);
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 0.88em;
    overflow-wrap: anywhere;
}

.wiki-page .wiki-content pre {
    position: relative;
    max-width: 100%;
    margin: 22px 0;
    padding: 23px 22px;
    overflow: auto;
    border: var(--bd);
    border-radius: 20px;
    background: var(--wiki-code);
    box-shadow: var(--pop);
}

.wiki-page .wiki-content pre code {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--wiki-code-ink);
    font-size: 13px;
    line-height: 1.65;
}

.wiki-page .code-wrapper .copy-btn {
    top: 12px;
    right: 12px;
    z-index: 1;
    min-height: 34px;
    padding: 6px 14px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--wiki-accent);
    color: var(--wiki-on-pastel);
    cursor: pointer;
    opacity: 1;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.wiki-page .code-wrapper .copy-btn:hover,
.wiki-page .code-wrapper .copy-btn.copied {
    background: var(--wiki-brand);
    color: var(--wiki-on-pastel);
}

.wiki-page .wiki-content kbd {
    display: inline-block;
    padding: 4px 9px;
    border: 2px solid var(--ink);
    border-radius: 9px;
    background: var(--wiki-surface);
    box-shadow: var(--pop-sm);
    color: var(--wiki-ink);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

/* ---------- Tables ---------- */
.wiki-page .wiki-content table {
    width: 100%;
    min-width: 560px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: var(--wiki-surface);
    color: var(--wiki-ink-soft);
    font-size: 14px;
}

.wiki-page .wiki-table-wrapper {
    position: relative;
    max-width: 100%;
    margin: 22px 0;
    overflow-x: auto;
    border: var(--bd);
    border-radius: 20px;
    background: var(--wiki-surface);
    box-shadow: var(--pop);
    -webkit-overflow-scrolling: touch;
}

.wiki-page .wiki-table-wrapper.has-scroll::after {
    display: none;
}

.wiki-page .wiki-content th,
.wiki-page .wiki-content td {
    min-width: 124px;
    padding: 13px 16px;
    border-bottom: 1.5px solid var(--wiki-surface-blue);
    text-align: left;
    vertical-align: top;
    line-height: 1.5;
}

.wiki-page .wiki-content th {
    border-bottom: var(--bd);
    background: var(--wiki-brand);
    color: var(--wiki-on-pastel);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wiki-page .wiki-content tr:last-child td {
    border-bottom: 0;
}

.wiki-page .wiki-content tbody tr:hover td {
    background: var(--sec-butter);
}

/* ---------- Callouts, steps and cards: flat fills, no outlines ---------- */
.wiki-page .callout {
    margin: 24px 0;
    padding: 20px 22px;
    border: 0;
    border-radius: 20px;
    background: var(--fill, var(--sec-sky));
}

.wiki-page .callout p:last-child,
.wiki-page .callout ul:last-child {
    margin-bottom: 0;
}

/* Code inside a filled box takes the section's own color so it never blends in. */
.wiki-page :is(.callout, .tutorial-step, .wiki-update-card, .wiki-note-card) code {
    background: var(--card, var(--wiki-surface));
}

.wiki-page .wiki-content .callout .callout-title {
    color: var(--wiki-on-pastel);
}

.wiki-page .callout-title {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 13px;
    border-radius: 999px;
    background: var(--wiki-brand);
    color: var(--wiki-on-pastel);
    font-size: 13px;
    font-weight: 700;
}

.wiki-page .callout.tip .callout-title {
    background: var(--wiki-accent);
}

.wiki-page .callout.warning {
    background: var(--wiki-accent);
}

.wiki-page .wiki-content .callout.warning .callout-title {
    background: #ffffff;
    color: var(--wiki-on-pastel);
}

.wiki-page .callout.warning p,
.wiki-page .callout.warning li,
.wiki-page .callout.warning strong,
.wiki-page .callout.warning b {
    color: var(--wiki-on-pastel);
}

.wiki-page .callout.warning code {
    background: rgba(255, 255, 255, 0.6);
    color: var(--wiki-on-pastel);
}

.wiki-page .tutorial-steps {
    display: grid;
    gap: 12px;
    margin: 24px 0;
}

.wiki-page .tutorial-step {
    margin: 0;
    padding: 18px 20px 18px 72px;
    border: 0;
    border-radius: 20px;
    background: var(--fill, var(--sec-sky));
}

.wiki-page .tutorial-step::before {
    top: 16px;
    left: 18px;
    width: 38px;
    height: 38px;
    border: 2.5px solid var(--ink);
    background: var(--wiki-accent);
    box-shadow: var(--pop-sm);
    color: var(--wiki-on-pastel);
    font-size: 15px;
    font-weight: 700;
}

.wiki-page .tutorial-step h3 {
    margin-top: 0;
}

.wiki-page .tutorial-step p:last-child {
    margin-bottom: 0;
}

.wiki-page .wiki-update-grid,
.wiki-page .wiki-comparison-notes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.wiki-page .wiki-update-card,
.wiki-page .wiki-note-card {
    padding: 18px 20px;
    border: 0;
    border-radius: 20px;
    background: var(--fill, var(--sec-sky));
    transition: transform 180ms ease;
}

.wiki-page .wiki-update-card:hover,
.wiki-page .wiki-note-card:hover {
    transform: translateY(-3px) rotate(-0.6deg);
}

.wiki-page .wiki-update-card strong,
.wiki-page .wiki-note-card strong {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 6px;
    color: var(--wiki-ink);
    font-size: 15.5px;
}

.wiki-page .wiki-update-card strong::before,
.wiki-page .wiki-note-card strong::before {
    content: '';
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--badge, var(--wiki-accent));
}

.wiki-page .wiki-update-card p,
.wiki-page .wiki-note-card p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
}

/* ---------- Prev / next ---------- */
.wiki-page .wiki-section-nav {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 32px;
    padding-top: 0;
    border-top: 0;
}

.wiki-page .wiki-nav-btn {
    min-width: 0;
    max-width: 48%;
    padding: 15px 20px;
    border: var(--bd);
    border-radius: 22px;
    background: var(--wiki-surface);
    box-shadow: var(--pop);
    color: var(--wiki-ink);
    transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.wiki-page .wiki-nav-btn:last-child {
    background: var(--wiki-brand);
}

.wiki-page .wiki-nav-btn:hover {
    border-color: var(--ink);
    background: var(--wiki-accent);
    box-shadow: var(--pop-sm);
    transform: translateY(2px);
}

.wiki-page .wiki-nav-btn .label {
    color: var(--wiki-muted);
    font-size: 12px;
    font-weight: 700;
}

.wiki-page .wiki-nav-btn .title {
    color: var(--wiki-ink);
    font-weight: 700;
}

.wiki-page .wiki-nav-btn:last-child .label,
.wiki-page .wiki-nav-btn:last-child .title,
.wiki-page .wiki-nav-btn:hover .label,
.wiki-page .wiki-nav-btn:hover .title {
    color: var(--wiki-on-pastel);
}

.wiki-page .wiki-nav-btn:last-child,
.wiki-page .wiki-nav-btn:hover {
    color: var(--wiki-on-pastel);
}

/* ---------- Footer and floating buttons ---------- */
.wiki-page > footer {
    margin: 0;
    padding: 28px 16px 48px;
    border-top: 0;
    background: var(--wiki-bg);
    color: var(--wiki-muted);
}

.wiki-page > footer p {
    margin: 0;
    color: inherit;
    font-size: 13px;
}

.wiki-page .theme-toggle,
.wiki-page .scroll-top {
    border: var(--bd);
    background: var(--wiki-surface);
    box-shadow: var(--pop-sm);
    color: var(--wiki-ink);
}

.wiki-page .theme-toggle {
    right: 22px;
    bottom: 22px;
    left: auto;
    width: 48px;
    height: 48px;
}

[data-theme="dark"] .wiki-page .theme-toggle {
    color: var(--wiki-accent);
}

.wiki-page .scroll-top {
    right: 22px;
    bottom: 84px;
    width: 46px;
    height: 46px;
}

.wiki-page [data-reveal] {
    opacity: 1;
    transform: none;
}

.wiki-page .js-ready [data-reveal] {
    will-change: transform, opacity;
}

.wiki-page .wiki-progress {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1200;
    height: 5px;
    pointer-events: none;
}

.wiki-page .wiki-progress span {
    display: block;
    height: 100%;
    border-bottom: 2px solid var(--ink);
    background: var(--wiki-brand);
    transform: scaleX(0);
    transform-origin: left center;
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
    .wiki-page > nav {
        width: min(940px, calc(100% - 24px));
        gap: 10px;
    }

    .wiki-page .nav-links {
        gap: 0;
    }

    .wiki-page .nav-links a {
        padding-inline: 10px;
        font-size: 13px;
    }

    .wiki-page .wiki-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }
}

@media (max-width: 800px) {
    .wiki-page > nav {
        top: 8px;
        margin-top: 8px;
        min-height: 58px;
        padding: 6px 8px 6px 14px;
        gap: 8px;
    }

    .wiki-page .logo {
        font-size: 14px;
    }

    .wiki-page .logo img {
        width: 28px;
        height: 28px;
    }

    .wiki-page .nav-links {
        width: auto;
        overflow: visible;
        padding-bottom: 0;
        justify-content: flex-end;
    }

    /* Only Download fits beside the logo and the language pill. */
    .wiki-page .nav-links a:not(:last-child) {
        display: none;
    }

    .wiki-page .nav-links a {
        min-height: 38px;
        border-color: var(--ink);
        background: var(--wiki-brand);
        color: var(--wiki-on-pastel);
    }

    .wiki-page .lang-btn {
        padding: 6px 9px;
    }

    .wiki-page .wiki-wrapper {
        padding-top: 26px;
    }

    .wiki-page .wiki-hero {
        padding: 40px 4px 32px;
        margin-bottom: 80px;
    }

    .wiki-page .wiki-hero h1 {
        margin-bottom: 34px;
        font-size: clamp(38px, 10.5vw, 58px);
    }

    .wiki-page .wiki-hero-word {
        top: 30%;
        font-size: 44vw;
    }

    .wiki-page .shape {
        scale: 0.7;
    }

    /* The ring and the small spark land on the title at phone width. */
    .wiki-page .wiki-hero-art > :nth-child(5),
    .wiki-page .wiki-hero-art > :nth-child(10) {
        display: none;
    }

    .wiki-page .wiki-layout {
        display: block;
    }

    .wiki-page .wiki-sidebar {
        position: sticky;
        top: 76px;
        max-height: none;
        margin-bottom: 22px;
        padding: 0;
        overflow: visible;
        border-radius: 22px;
    }

    .wiki-page .wiki-sidebar-toggle {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        min-height: 50px;
        padding: 0 18px;
        border: 0;
        border-radius: 22px;
        background: var(--wiki-surface);
        color: var(--wiki-ink);
        cursor: pointer;
        font: inherit;
        font-weight: 700;
    }

    .wiki-page .wiki-sidebar-toggle svg {
        width: 18px;
        height: 18px;
        transition: transform 180ms ease;
    }

    .wiki-page .wiki-sidebar.open .wiki-sidebar-toggle svg {
        transform: rotate(180deg);
    }

    .wiki-page .wiki-sidebar-nav {
        display: none;
        max-height: 60vh;
        overflow-y: auto;
        padding: 14px;
        border-top: 2px solid var(--wiki-surface-blue);
        border-radius: 0 0 22px 22px;
        background: var(--wiki-surface);
    }

    .wiki-page .wiki-sidebar.open .wiki-sidebar-nav {
        display: block;
    }

    .wiki-page .wiki-update-grid,
    .wiki-page .wiki-comparison-notes {
        grid-template-columns: 1fr;
    }

    .wiki-page .wiki-content > div:first-child {
        gap: 22px;
    }

    .wiki-page .wiki-content section {
        padding: 26px 20px;
        border-radius: 24px;
    }

    .wiki-page .wiki-content section > h2:first-of-type {
        gap: 12px;
        font-size: 28px;
    }

    .wiki-page .wiki-content section > h2:first-of-type::before {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }

    .wiki-page .tutorial-step {
        padding: 16px 16px 16px 64px;
    }

    .wiki-page .tutorial-step::before {
        left: 14px;
        width: 34px;
        height: 34px;
    }

    .wiki-page .wiki-section-nav {
        flex-direction: column;
    }

    .wiki-page .wiki-nav-btn {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .wiki-page .container {
        width: min(100% - 20px, 1180px);
    }

    .wiki-page .logo a {
        font-size: 0;
        gap: 0 !important;
    }

    .wiki-page .wiki-search {
        padding-left: 14px;
    }

    .wiki-page .wiki-search svg {
        display: none;
    }

    .wiki-page .wiki-search button {
        padding: 0 16px;
    }

    .wiki-page .theme-toggle {
        right: 14px;
        bottom: 14px;
    }

    .wiki-page .scroll-top {
        right: 14px;
        bottom: 74px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wiki-page *,
    .wiki-page *::before,
    .wiki-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
