:root {
  --bg: #fffaf0;
  --surface: #ffffff;
  --ink: #3f3422;
  --muted: #7a6a52;
  --accent: #8a6013;
  --border: #efe2c4;
  color-scheme: light;
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
    "Hiragino Sans", "Yu Gothic", "YuGothic", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #211c13;
    --surface: #2b251a;
    --ink: #f4ead8;
    --muted: #c8b899;
    --accent: #f6d985;
    --border: #4a3b25;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.9; }
a { color: var(--accent); text-underline-offset: .2em; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }
.skip { position: absolute; top: -6rem; padding: 12px; background: var(--surface); z-index: 2; }
.skip:focus { top: 8px; left: 8px; }
.site-header, .site-footer { padding: 24px max(24px, calc((100% - 1160px) / 2)); }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--border); }
.brand { color: var(--ink); font-size: 1.25rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
nav { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.legal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 64px; max-width: 1160px; margin: auto; padding: 48px 24px 80px; }
article { min-width: 0; max-width: 760px; }
.breadcrumb { margin: 0 0 16px; color: var(--muted); font-size: .875rem; }
h1 { margin: 0 0 20px; font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1.5; letter-spacing: .015em; overflow-wrap: anywhere; }
article > nav + p { color: var(--muted); font-size: .875rem; }
.mobile-contents { display: none; }
article h2 { margin: 48px 0 16px; padding-top: 8px; font-size: 1.2rem; line-height: 1.6; scroll-margin-top: 24px; }
p { margin: 0 0 20px; }
ul { margin: 0 0 24px; padding-left: 1.4em; }
li { margin-bottom: 10px; }
code { font-size: .94em; overflow-wrap: anywhere; }
.contents { min-width: 0; }
.contents nav { position: sticky; top: 24px; display: block; padding-left: 20px; border-left: 1px solid var(--border); }
.contents h2 { margin: 0 0 16px; font-size: .875rem; color: var(--muted); }
.contents ol { list-style: none; margin: 0; padding: 0; font-size: .875rem; line-height: 1.7; }
.contents a { text-decoration: none; }
.contents a:hover { text-decoration: underline; }
.site-footer { border-top: 1px solid var(--border); font-size: .875rem; }
.site-footer > a { display: inline-block; color: var(--ink); margin-bottom: 16px; font-weight: 700; }
.site-footer p { margin: 16px 0 0; color: var(--muted); }
@media (max-width: 900px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 32px; }
  .contents { display: none; }
  .mobile-contents { display: block; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); font-size: .875rem; }
  .mobile-contents summary { color: var(--accent); cursor: pointer; }
  .mobile-contents summary:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
  .mobile-contents ol { list-style: none; padding: 0; margin-bottom: 0; }
}
@media (max-width: 520px) {
  .site-header { padding: 16px; gap: 16px; }
  .site-header nav { gap: 12px; font-size: .875rem; }
  .legal-layout { padding: 24px 16px 48px; }
  .site-footer { padding: 24px 16px; }
}
@media print {
  :root { --bg: #fff; --ink: #000; --muted: #333; --accent: #000; --border: #ddd; color-scheme: light; }
  .site-header, .contents, .mobile-contents, .site-footer, .skip, .breadcrumb { display: none; }
  .legal-layout { display: block; padding: 0; }
  article { max-width: none; }
  h2 { break-after: avoid; }
}
