:root {
  --bg: #ffffff;
  --fg: #0f172a;
  --muted: #475569;
  --link: #0ea5e9;
  --card: #f8fafc;
  --border: #e2e8f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --fg: #e5e7eb;
    --muted: #9ca3af;
    --link: #38bdf8;
    --card: #0f172a;
    --border: #1f2937;
  }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 28px);
}

header h1 {
  font-size: clamp(1.25rem, 3.5vw, 1.75rem);
  margin: 0 0 0.25rem 0;
  letter-spacing: 0.2px;
}

header p.sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.notice {
  margin-top: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
}

.notice h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.05rem;
}

ul {
  padding-left: 1.25rem;
  margin-top: 0.25rem;
}

section {
  margin-top: 1rem;
}

details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 1rem;
}

details + details {
  margin-top: 0.75rem;
}

summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  outline: none;
  list-style: none;
}

summary::-webkit-details-marker { display: none; }
summary:after {
  content: "▾";
  float: right;
  transition: transform 0.2s ease;
}
details[open] summary:after { transform: rotate(180deg); }

.section-body {
  margin-top: 0.5rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.75rem;
  font-size: 0.98rem;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid #94a3b8;
  outline-offset: 2px;
  border-radius: 8px;
}

.fineprint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.top-link {
  position: fixed;
  right: 12px;
  bottom: 12px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 0.9rem;
  text-decoration: none;
}

@media print {
  details { border: none; padding: 0; }
  summary:after { display: none; }
  .top-link { display: none; }
  .notice, details, .container { break-inside: avoid; }
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-text {
  flex: 1;
}

.back-button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}