:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #5b5b62;
  --line: #deddd8;
  --accent: #c8102e;
  --accent-soft: #fbe9ec;
  --code-bg: #efeee9;
  --warn-bg: #fff4d6;
  --warn-line: #e5b53d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141416;
    --surface: #1d1d21;
    --text: #ececef;
    --muted: #a3a3ab;
    --line: #34343a;
    --accent: #ff5a6e;
    --accent-soft: #3a1d23;
    --code-bg: #26262b;
    --warn-bg: #3a2f12;
    --warn-line: #a88420;
  }
}
:root[data-theme="dark"] {
  --bg: #141416;
  --surface: #1d1d21;
  --text: #ececef;
  --muted: #a3a3ab;
  --line: #34343a;
  --accent: #ff5a6e;
  --accent-soft: #3a1d23;
  --code-bg: #26262b;
  --warn-bg: #3a2f12;
  --warn-line: #a88420;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; }
pre { direction: ltr; text-align: left; background: var(--code-bg); padding: 0.9rem 1rem; border-radius: 8px; overflow-x: auto; }
pre code { background: none; padding: 0; }

.wrap { max-width: 62rem; margin: 0 auto; padding-inline: 1.25rem; }

header.site { background: var(--surface); border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; padding-block: 0.7rem; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; margin-inline-end: auto; }
.brand span { color: var(--accent); }
nav.main { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; }
nav.main a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
nav.main a:hover, nav.main a[aria-current="page"] { color: var(--accent); }
details.lang { position: relative; font-size: 0.9rem; }
details.lang summary { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted); cursor: pointer; list-style: none; padding: 0.15rem 0.4rem; border: 1px solid var(--line); border-radius: 6px; }
details.lang summary::-webkit-details-marker { display: none; }
details.lang summary:hover, details.lang[open] summary { color: var(--accent); }
details.lang summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
details.lang ul { position: absolute; inset-inline-end: 0; top: calc(100% + 0.3rem); z-index: 10; margin: 0; padding: 0.35rem; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgb(0 0 0 / 0.15); display: grid; grid-template-columns: repeat(2, max-content); gap: 0 0.25rem; }
details.lang li { margin: 0; }
details.lang ul a { display: block; padding: 0.3rem 0.6rem; border-radius: 5px; color: var(--text); text-decoration: none; white-space: nowrap; }
details.lang ul a:hover { background: var(--accent-soft); color: var(--accent); }
details.lang ul a[aria-current] { color: var(--accent); font-weight: 600; }

main { padding-block: 2rem 3rem; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.2; margin: 0 0 0.6rem; }
h2 { font-size: 1.4rem; margin: 2.4rem 0 0.8rem; padding-top: 0.4rem; }
h3 { font-size: 1.1rem; margin: 1.6rem 0 0.5rem; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 46rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; display: flex; flex-direction: column; }
.card h3 { margin: 0 0 0.4rem; }
.card p { margin: 0 0 0.8rem; color: var(--muted); font-size: 0.95rem; flex: 1; }
.card a.more { font-weight: 600; text-decoration: none; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 17rem); gap: 1.5rem; align-items: start; }
.split figure { margin: 0; }
.split figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; }
.cards figure { margin: 0; }
.cards figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; padding-top: 0.3rem; }
@media (max-width: 700px) { .split { grid-template-columns: 1fr; } .split figure { max-width: 20rem; } }

.table { overflow-x: auto; margin: 0.8rem 0; }
table { border-collapse: collapse; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
th, td { text-align: start; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

.btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; padding: 0.35rem 0.75rem; border-radius: 6px; font-size: 0.92rem; white-space: nowrap; }
.btn.ghost { background: var(--accent-soft); color: var(--accent); }

.note { background: var(--warn-bg); border-inline-start: 4px solid var(--warn-line); padding: 0.7rem 1rem; border-radius: 6px; margin: 1rem 0; }
ol li, ul li { margin-bottom: 0.35rem; }

footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
footer.site .wrap { padding-block: 1.4rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }

.btn .sm { display: none; }

@media (max-width: 560px) {
  .btn .lg { display: none; }
  .btn .sm { display: inline; }
  table.dl .volume { display: none; }
  table.dl .btn { white-space: normal; overflow-wrap: anywhere; }
  table.dl.slicer .btn { white-space: nowrap; overflow-wrap: normal; }
  table.dl.slicer td, table.dl.slicer th { padding-inline: 0.45rem; }
  td a { overflow-wrap: anywhere; }
  table.stack thead { display: none; }
  table.stack td { display: block; border-bottom: 0; padding-block: 0.2rem; }
  table.stack td:first-child { padding-top: 0.6rem; }
  table.stack td:last-child { padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
}
