:root {
  --kitsune-dark: #142019;
  --kitsune-green: #b8ed43;
  --pico-primary: #527a20;
  --pico-primary-background: #527a20;
  --pico-primary-border: #527a20;
  --pico-primary-hover: #3d6015;
  --pico-primary-hover-background: #3d6015;
  --pico-primary-hover-border: #3d6015;
  --pico-border-radius: .7rem;
  --pico-font-size: 100%;
}

html { scroll-behavior: smooth; }
body { margin: 0; line-height: 1.65; }
.container { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
a { text-underline-offset: .2em; }
code, pre { font-size: .88em; }

.docs-navbar { position: sticky; z-index: 10; top: 0; padding: .7rem 0; color: #edf5ea; background: var(--kitsune-dark); }
.docs-navbar .container, .navbar-nav { display: flex; align-items: center; }
.docs-navbar .container { justify-content: space-between; gap: 1rem; }
.navbar-brand { color: #fff; font-weight: 750; text-decoration: none; white-space: nowrap; }
.brand-mark { display: inline-grid; width: 2rem; height: 2rem; place-items: center; margin-right: .35rem; color: var(--kitsune-dark); background: var(--kitsune-green); border-radius: .55rem; }
.navbar-nav { flex-wrap: wrap; justify-content: flex-end; gap: .2rem; font-size: .85rem; line-height: 1.4; }
.nav-link { display: block; padding: .35rem .55rem; color: #c3cfc5; text-decoration: none; border-radius: .4rem; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,.1); }
.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 50; padding: .6rem 1rem; color: var(--kitsune-dark); background: var(--kitsune-green); border-radius: .4rem; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }

.docs-page { padding-block: 3rem; min-height: 75vh; }
.section-heading { margin-bottom: 2.5rem; }
.section-heading > span { color: #527a20; font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.section-heading h1 { margin: .4rem 0 1rem; font-size: clamp(2.3rem, 5vw, 3.8rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.lead { max-width: 70ch; margin-bottom: 0; color: var(--pico-muted-color); font-size: 1.15rem; }
.docs-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 3rem; }
.docs-sidebar { position: sticky; top: 6rem; align-self: start; max-height: calc(100vh - 7rem); overflow-y: auto; font-size: .9rem; }
.docs-sidebar nav { display: grid; }
.docs-sidebar .nav-link { color: var(--pico-muted-color); border-left: 2px solid var(--pico-muted-border-color); border-radius: 0; }
.docs-sidebar .nav-link:hover, .docs-sidebar .nav-link:focus-visible { color: var(--pico-color); background: transparent; border-color: var(--kitsune-green); }
.docs-content { min-width: 0; }
.docs-content section { padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--pico-muted-border-color); }
.docs-content section:last-child { margin-bottom: 0; border: 0; }
.docs-content :is(h2, h3, h4), .docs-content section { scroll-margin-top: 7rem; }
.docs-content > section > :is(p, ul, ol) { max-width: 74ch; }
.docs-content li + li { margin-top: .5rem; }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.card { margin: 0; padding: 1.25rem; border: 1px solid var(--pico-card-border-color); border-radius: var(--pico-border-radius); }
.card h3 { margin-top: 0; font-size: 1.1rem; }
.card p { margin-bottom: 0; color: var(--pico-muted-color); }

.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: .5rem; }
.btn { display: inline-block; width: auto; padding: .65rem 1rem; border: 1px solid var(--pico-muted-border-color); border-radius: .5rem; text-decoration: none; }
.btn-zesty { color: var(--kitsune-dark); background: var(--kitsune-green); border-color: var(--kitsune-green); font-weight: 750; }
.btn-zesty:hover { color: var(--kitsune-dark); background: #a4da35; }
.btn-outline-secondary { color: var(--pico-color); background: transparent; }
.code-block { overflow: hidden; margin: 1.25rem 0; color: #dff5df; background: #0c120e; border: 1px solid #2a362d; border-radius: .8rem; }
.code-block header { padding: .55rem 1rem; color: #b4c2b8; background: #172019; font-size: .8rem; }
.code-block pre { overflow-x: auto; max-width: 100%; margin: 0; padding: 1.15rem; color: inherit; background: transparent; }
.code-block code { color: inherit; background: transparent; }
.table-responsive { overflow-x: auto; }
.docs-content td { vertical-align: top; }
.docs-content td code { overflow-wrap: anywhere; }
.plugin-table { width: 100%; min-width: 650px; }
.plugin-table td:first-child { width: 13rem; white-space: nowrap; }
.plugin-table td:nth-child(2) { width: 8rem; }
.plugin-table small { display: block; color: var(--pico-muted-color); }
.permission { display: inline-block; padding: .2rem .5rem; border-radius: 99px; font-size: .75rem; font-weight: 700; }
.permission.read { color: #135c63; background: #d7f3f3; }
.permission.write { color: #6c4616; background: #ffe9b8; }
.notice { padding: 1rem; border-radius: .6rem; }
.notice.warning { background: #fff1c1; border-color: #d8b62e; color: #544715; }
details { padding-block: .4rem; }
details summary { font-weight: 700; }
.docs-footer { padding: 2rem 0; color: #c3cfc5; background: var(--kitsune-dark); }
.docs-footer .container { display: flex; justify-content: space-between; gap: 1rem; }
.docs-footer a { color: var(--kitsune-green); }

@media (prefers-color-scheme: dark) {
  :root { --pico-primary: #a9dc52; }
  .section-heading > span { color: #a9dc52; }
  .permission.read { color: #a7e9ec; background: #194449; }
  .permission.write { color: #ffe1a1; background: #4c371c; }
  .notice.warning { color: #f3e4a3; background: #403a1d; }
}
@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 1fr; gap: 1.5rem; }
  .docs-sidebar { position: static; max-height: none; overflow: visible; }
  .docs-sidebar nav { display: flex; flex-wrap: wrap; }
  .docs-sidebar .nav-link { border-left: 0; border-bottom: 2px solid var(--pico-muted-border-color); }
}
@media (max-width: 640px) {
  .docs-navbar .container, .docs-footer .container { align-items: flex-start; flex-direction: column; }
  .navbar-nav { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; }
  .docs-page { padding-block: 2rem; }
  .section-heading h1 { font-size: 2.2rem; }
  .topic-grid { grid-template-columns: 1fr; }
  .docs-content :is(h2, h3, h4), .docs-content section { scroll-margin-top: 13rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  .docs-navbar, .docs-sidebar, .docs-footer, .skip-link { display: none !important; }
  .docs-shell { display: block; }
  .card, .code-block { break-inside: avoid; box-shadow: none; }
}
