:root {
  --ground: #ffffff;
  --ground-2: #f2f7f6;
  --ground-3: #e9f1f0;
  --ink: #0e3a3c;
  --body: #243735;
  --muted: #63807d;
  --rule: #dbe7e5;
  --accent: #1a5c5e;
  --accent-2: #2ec4b6;
  --warn: #ac4029;
  --warn-soft: #fbeee9;
  --code-ink: #16302f;
  --shadow: 0 1px 2px rgba(14, 58, 60, 0.06);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --measure: 74ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0b1817;
    --ground-2: #10201f;
    --ground-3: #162927;
    --ink: #e8f4f4;
    --body: #c6d8d6;
    --muted: #8ca6a3;
    --rule: #1f3a38;
    --accent: #2ec4b6;
    --accent-2: #6fe0d4;
    --warn: #f09a87;
    --warn-soft: #24201f;
    --code-ink: #d7e7e5;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  --ground: #0b1817;
  --ground-2: #10201f;
  --ground-3: #162927;
  --ink: #e8f4f4;
  --body: #c6d8d6;
  --muted: #8ca6a3;
  --rule: #1f3a38;
  --accent: #2ec4b6;
  --accent-2: #6fe0d4;
  --warn: #f09a87;
  --warn-soft: #24201f;
  --code-ink: #d7e7e5;
  --shadow: none;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  text-underline-offset: 0.18em;
}

a { color: var(--accent); text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 0.6rem;
  z-index: 10;
  background: var(--ground);
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--rule);
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--ground);
  border-bottom: 1px solid var(--rule);
}

.masthead-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
}

.wordmark { display: flex; gap: 0.5rem; align-items: baseline; }
.wordmark-name { color: var(--ink); font-weight: 640; letter-spacing: -0.015em; }
.wordmark-sep { color: var(--rule); }
.wordmark-part { color: var(--muted); }

.masthead-meta {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 0.76rem;
}

.stamp {
  color: var(--accent);
  border: 1px solid var(--rule);
  padding: 0.1rem 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stamp-date { color: var(--muted); }
.lang { font-family: var(--sans); font-size: 0.85rem; }

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
}

.rail {
  position: sticky;
  top: 4.5rem;
  font-size: 0.875rem;
}

.rail-title {
  margin: 0 0 0.6rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.rail-title-spaced { margin-top: 2rem; }

.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rail;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-left: 1px solid var(--rule);
}
.rail-list li { counter-increment: rail; }
.rail-list a {
  display: block;
  padding: 0.05rem 0 0.05rem 0.85rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  text-decoration: none;
  color: var(--body);
}
.rail-list a:hover { border-left-color: var(--accent-2); color: var(--ink); }

.rail-files {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  word-break: break-all;
}

.content { min-width: 0; max-width: var(--measure); }

h1, h2, h3 {
  color: var(--ink);
  text-wrap: balance;
  line-height: 1.2;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  font-weight: 650;
  letter-spacing: -0.025em;
}

h2 {
  margin: 0 0 1rem;
  padding-top: 1.5rem;
  font-size: 1.45rem;
  font-weight: 640;
  letter-spacing: -0.015em;
  border-top: 1px solid var(--rule);
}

h3 {
  margin: 2rem 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 640;
}

section { margin-bottom: 3.25rem; }
section.opener { margin-bottom: 3.75rem; }

p { margin: 0 0 1rem; }

.lead { font-size: 1.075rem; color: var(--body); }

.two-ways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem;
  margin: 2rem 0 1.5rem;
}

.way { border-top: 2px solid var(--accent); padding-top: 0.9rem; }
.way-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.way-body { font-size: 0.95rem; margin-bottom: 0.6rem; }
.way-more { margin: 0; font-size: 0.9rem; }

.note {
  border-left: 2px solid var(--warn);
  background: var(--warn-soft);
  padding: 0.85rem 1rem;
  font-size: 0.93rem;
  margin: 1.25rem 0;
}
.note-plain {
  border-left-color: var(--accent-2);
  background: var(--ground-2);
}

.scroller {
  overflow-x: auto;
  margin: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}

table.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

table.grid th {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  padding: 0 0.9rem 0.5rem 0;
  white-space: nowrap;
}

table.grid td {
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 0.9rem 0.6rem 0;
}
table.grid tr:last-child td { border-bottom: 0; }
table.grid td:first-child { color: var(--ink); }

td.yes { color: var(--accent); }
td.rec, td.opt { color: var(--muted); }
td.part { color: var(--warn); }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--code-ink);
  background: var(--ground-2);
  padding: 0.1em 0.32em;
  border-radius: 3px;
  word-break: break-word;
}

pre.code {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  background: var(--ground-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
}
pre.code code {
  background: none;
  padding: 0;
  font-size: inherit;
  white-space: pre;
  word-break: normal;
}

.spec {
  display: grid;
  gap: 0.35rem;
  margin: 1.25rem 0 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--accent-2);
  font-size: 0.9rem;
}
.spec > div { display: flex; flex-wrap: wrap; gap: 0.3rem 0.75rem; }
.spec-k {
  flex: 0 0 9.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  padding-top: 0.22rem;
}
.spec-v { flex: 1 1 12rem; color: var(--ink); }

ol.rules {
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
ol.rules li {
  counter-increment: rule;
  position: relative;
  padding-left: 2.1rem;
  font-size: 0.95rem;
}
ol.rules li::before {
  content: counter(rule);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.5rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid var(--rule);
  border-radius: 3px;
  line-height: 1.5rem;
  height: 1.5rem;
}
.rule-head {
  display: block;
  color: var(--ink);
  font-weight: 620;
}

ul.bullets {
  margin: 1.25rem 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.95rem;
}
ul.bullets::marker, ul.bullets li::marker { color: var(--accent-2); }

.links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; font-size: 0.9rem; }

.files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.file {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-decoration: none;
  background: var(--ground);
  box-shadow: var(--shadow);
}
.file:hover { border-color: var(--accent-2); }
.file-name { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); word-break: break-all; }
.file-kind { font-size: 0.8rem; color: var(--muted); }

.disclaimer {
  font-size: 0.86rem;
  color: var(--muted);
  background: var(--ground-2);
  border-left: 2px solid var(--rule);
  padding: 0.85rem 1rem;
}

.muster {
  background: var(--ground-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.1rem 1.1rem;
  margin: 0.75rem 0 1.5rem;
  font-size: 0.93rem;
}
.muster-title { color: var(--ink); font-weight: 640; }

button.copy {
  font: inherit;
  font-size: 0.85rem;
  color: var(--accent);
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}
button.copy:hover { border-color: var(--accent-2); }
button.copy[data-copied="1"] { color: var(--accent-2); }

.cta a {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 3px;
  text-decoration: none;
  color: var(--accent);
}
.cta a:hover { background: var(--accent); color: var(--ground); }

.foot {
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.foot p { margin: 0 0 0.35rem; }

@media (max-width: 960px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding-top: 1.75rem;
  }
  .rail { position: static; }
  .content { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.sitehead {
  background: #0e3a3c;
  padding: 0.6rem 1rem 0.7rem;
  display: flex;
  justify-content: center;
}

.sitehead-bar {
  width: 100%;
  max-width: 1200px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 25px;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sitehead-bar img {
  width: 100px;
  height: 20px;
  display: block;
}

.sitehead-link {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  text-decoration: none;
}
.sitehead-link:hover { color: #ffffff; }

.docbar {
  border-bottom: 1px solid var(--rule);
  background: var(--ground);
}

.docbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.7rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.85rem;
}

.crumbs { display: flex; gap: 0.5rem; align-items: baseline; }
.crumbs a { text-decoration: none; }
.crumbs-sep { color: var(--rule); }
.crumbs-here { color: var(--ink); font-weight: 620; }

.sitefoot {
  background: #0e3a3c;
  color: rgba(255, 255, 255, 0.8);
  padding: 1.5rem 1.5rem 2rem;
  font-size: 0.875rem;
}

.sitefoot-inner { max-width: 1180px; margin: 0 auto; }

.sitefoot-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.sitefoot-brandmark {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
}
.sitefoot-brandmark img { width: 32px; height: 32px; }
.sitefoot-wordmark { font-family: serif; font-size: 1.375rem; color: #ffffff; }
.sitefoot-tagline { margin: 0 0 0.25rem; max-width: 20rem; line-height: 1.45; }
.sitefoot-cta {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: #f09a87;
  font-weight: 600;
  text-decoration: none;
}
.sitefoot-cta:hover { text-decoration: underline; }

.sitefoot-heading {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
}

.sitefoot-links {
  display: flex;
  flex-direction: column;
  margin: 0;
  list-style: none;
  padding: 0;
}
.sitefoot-links li { display: flex; align-items: center; min-height: 2.75rem; }
.sitefoot-links a { color: rgba(255, 255, 255, 0.8); text-decoration: none; }
.sitefoot-links a:hover { color: #ffffff; text-decoration: underline; }

@media (max-width: 640px) {
  .sitefoot-top { grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; }
  .sitefoot-brand { grid-column: 1 / -1; }
}

.sitefoot-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin-bottom: 1rem;
}

.sitefoot-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.sitefoot-copy { font-size: 0.78rem; }

.langswitch { display: flex; gap: 0.5rem; }
.langswitch a,
.langswitch span {
  min-width: 2.75rem;
  text-align: center;
  padding: 0.3rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}
.langswitch span[aria-current="true"] {
  background: #2a7c7e;
  border-color: #2a7c7e;
  color: #ffffff;
}

.todo {
  margin: 1.5rem 0 2rem;
  padding: 1.1rem 1.25rem 1.25rem;
  background: var(--ground-2);
  border-left: 2px solid var(--accent);
}
.todo h2 {
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
  font-size: 1.05rem;
}
.todo ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: todo;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.todo li {
  counter-increment: todo;
  padding-left: 2.1rem;
  position: relative;
  font-size: 0.95rem;
}
.todo li::before {
  content: counter(todo);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1.5rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ground);
  background: var(--accent);
  border-radius: 3px;
}
.todo .done {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}
.todo .done b { color: var(--ink); font-weight: 620; }

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 2rem 0 2.5rem;
}

.step {
  display: grid;
  gap: 0.4rem;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--rule);
  border-top: 2px solid var(--accent);
  border-radius: 0 0 4px 4px;
  background: var(--ground);
  text-decoration: none;
  box-shadow: var(--shadow);
}
.step:hover { border-color: var(--accent-2); border-top-color: var(--accent-2); }

.step-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  color: var(--accent);
}
.step-title { color: var(--ink); font-weight: 640; font-size: 1.02rem; }
.step-body { color: var(--body); font-size: 0.93rem; }
.step-need { color: var(--muted); font-size: 0.87rem; }
