:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #17181a;
  --muted: #5f6570;
  --border: #e2e0d9;
  --accent: #0a8f63;
  --accent-soft: #e6f5ee;
  --ink: #0c0d0e;
  --warn: #b4530a;
  --warn-soft: #fff4e5;
  --danger: #b3261e;
  --danger-soft: #fdeceb;
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1012;
    --surface: #17191c;
    --text: #ecedee;
    --muted: #a0a6b0;
    --border: #2a2d32;
    --accent: #34d399;
    --accent-soft: #10291f;
    --ink: #050506;
    --warn: #fbbf6b;
    --warn-soft: #2b2010;
    --danger: #ff8a80;
    --danger-soft: #2d1513;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 10; background: var(--ink); color: #fff; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { color: #fff; font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: -0.02em; }
.brand span { color: #34d399; }
.top nav { display: flex; gap: 8px; align-items: center; }
.top nav a { color: #d6d8dc; text-decoration: none; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 999px; }
.top nav a:hover { color: #fff; }
.top nav a.btn { background: #34d399; color: #04130d; }

/* hero */
.hero { background: var(--ink); color: #fff; padding: 36px 0 44px; }
.badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.12; letter-spacing: -0.03em; margin: 14px 0 10px; }
.hero p { color: #b9bdc5; margin: 0; max-width: 62ch; }
.hero .meta { margin-top: 14px; font-size: 14px; color: #8f95a0; }
.hero .meta a { color: #8f95a0; }

/* agreement banner */
.agree { margin: -22px 0 0; background: var(--danger-soft); border: 1px solid var(--danger); border-left-width: 6px; border-radius: var(--r); padding: 16px 20px; position: relative; }
.agree strong { color: var(--danger); }
.agree p { margin: 0; }

/* key rules */
.keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin: 22px 0 8px; padding: 0; list-style: none; }
.keys li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; }
.keys h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.35; }
.keys p { margin: 0; font-size: 14.5px; color: var(--muted); }
.keys a { font-size: 13px; font-weight: 700; text-decoration: none; display: inline-block; margin-top: 8px; }
.keys-note { font-size: 13.5px; color: var(--muted); margin: 0 0 8px; }

/* layout */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; align-items: start; padding-top: 20px; padding-bottom: 60px; }
.toc { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; font-size: 14.5px; }
.toc summary { font-weight: 800; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); cursor: pointer; padding: 6px 0; }
.toc ol { list-style: none; margin: 6px 0 0; padding: 0; border-left: 2px solid var(--border); }
.toc a { display: block; padding: 5px 12px; color: var(--muted); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--text); border-left-color: var(--accent); }

/* sections */
main section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 26px 28px; margin-bottom: 16px; scroll-margin-top: 72px; }
main h2 { font-size: 23px; line-height: 1.25; letter-spacing: -0.02em; margin: 0 0 4px; }
main h2 .num { color: var(--accent); margin-right: 6px; }
main .sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
main h3 { font-size: 17px; margin: 24px 0 8px; }
main p { margin: 10px 0; }
main ul, main ol { margin: 8px 0; padding-left: 22px; }
main li { margin: 4px 0; }
.cl { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 4px; padding: 8px 10px; margin: 2px -10px; border-radius: 8px; scroll-margin-top: 76px; }
.cl > a { font-weight: 800; font-size: 14px; color: var(--accent); text-decoration: none; padding-top: 2px; font-variant-numeric: tabular-nums; }
.cl > div > :first-child { margin-top: 0; }
.cl > div > :last-child { margin-bottom: 0; }
.cl:target, section:target { outline: 2px solid var(--accent); outline-offset: 2px; background: var(--accent-soft); }
section:target { background: var(--surface); }

.note, .warn, .danger { border-radius: 10px; padding: 12px 16px; margin: 14px 0; border-left: 4px solid var(--accent); background: var(--accent-soft); }
.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.danger { border-left-color: var(--danger); background: var(--danger-soft); }
.note > :first-child, .warn > :first-child, .danger > :first-child { margin-top: 0; }
.note > :last-child, .warn > :last-child, .danger > :last-child { margin-bottom: 0; }

.tw { overflow-x: auto; margin: 12px 0; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
th { font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: var(--bg); }
tr:last-child td { border-bottom: 0; }
td.no { color: var(--danger); font-weight: 700; white-space: nowrap; }
td.yes { color: var(--accent); font-weight: 700; white-space: nowrap; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 12px 0; }
.cards > div { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.cards b { display: block; }
.cards small { color: var(--muted); font-size: 13.5px; }
.steps { counter-reset: s; list-style: none; padding: 0 !important; }
.steps li { counter-increment: s; position: relative; padding: 6px 0 6px 40px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 5px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.contact { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.contact li { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 0; }
.contact small { display: block; color: var(--muted); font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 700; }
.contact a { font-weight: 700; text-decoration: none; }

footer { border-top: 1px solid var(--border); padding: 22px 0 40px; color: var(--muted); font-size: 14px; }
footer a { color: var(--muted); }

.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 20; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 22px; font-weight: 800; text-decoration: none; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
.to-top:hover { filter: brightness(1.1); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 12px; }
  .toc { position: static; max-height: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 16px; }
  main section { padding: 20px 18px; }
  .cl { grid-template-columns: 40px minmax(0, 1fr); }
}
@media print {
  .top, .toc, .top nav, .to-top { display: none; }
  .layout { display: block; }
  .hero { background: none; color: #000; padding: 0 0 12px; }
  .hero p, .hero .meta { color: #333; }
  main section { border: 0; padding: 0; break-inside: auto; }
  body { background: #fff; font-size: 11pt; }
}
