:root {
  color-scheme: light dark;
  --guide-bg: #f7f7f8;
  --guide-surface: #ffffff;
  --guide-fg: #18181b;
  --guide-muted: #61616b;
  --guide-line: #d8d8de;
  --guide-accent: #b43c73;
  --guide-accent-bg: #fff0f6;
  --guide-max: 760px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--guide-bg);
  color: var(--guide-fg);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  line-height: 1.75;
}
a { color: #8e2f5b; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 3px solid #94506f; outline-offset: 3px; }

.guide-skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.6rem;
  left: 0.6rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border: 2px solid var(--guide-accent);
  border-radius: 10px;
  background: var(--guide-surface);
  color: var(--guide-fg);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(calc(-100% - 1rem));
}
.guide-skip-link:focus { transform: translateY(0); }

header, main, footer { width: min(calc(100% - 2rem), var(--guide-max)); margin-inline: auto; }
header { padding: 1rem 0 0.5rem; }
.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--guide-fg);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.breadcrumbs { margin: 0.4rem 0 0; color: var(--guide-muted); font-size: 0.86rem; }
.breadcrumbs a { color: inherit; }
main { padding: 1rem 0 3rem; }
.hero, article, .guide-card, .toc {
  background: var(--guide-surface);
  border: 1px solid var(--guide-line);
  border-radius: 16px;
}
.hero { padding: clamp(1.2rem, 4vw, 2.3rem); margin-bottom: 1rem; }
.eyebrow { margin: 0 0 0.4rem; color: var(--guide-accent); font-size: 0.82rem; font-weight: 800; letter-spacing: 0.06em; }
h1 { margin: 0; font-size: clamp(1.65rem, 5vw, 2.35rem); line-height: 1.3; }
.lead { margin: 0.9rem 0 0; color: var(--guide-muted); }
h2 { margin: 2.1rem 0 0.75rem; font-size: 1.3rem; line-height: 1.45; scroll-margin-top: 1rem; }
h3 { margin: 1.5rem 0 0.5rem; font-size: 1.05rem; scroll-margin-top: 1rem; }
p, ul, ol { margin-top: 0.6rem; margin-bottom: 0.9rem; }
.guide-grid { display: grid; grid-template-columns: 1fr; gap: 0.8rem; margin-top: 1rem; }
.guide-card { display: block; min-height: 44px; padding: 1.1rem; color: var(--guide-fg); text-decoration: none; }
.guide-card:hover { border-color: var(--guide-accent); }
.guide-card strong { display: block; font-size: 1.05rem; }
.guide-card span { display: block; margin-top: 0.35rem; color: var(--guide-muted); font-size: 0.9rem; }
article { padding: clamp(1.1rem, 4vw, 2rem); }
.toc { margin: 1rem 0; padding: 0.85rem 1rem; }
.toc strong { font-size: 0.9rem; }
.toc ul { margin-bottom: 0; padding-left: 1.2rem; }
.toc a { display: inline-block; min-height: 32px; padding-block: 0.15rem; }
.note {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border-left: 4px solid var(--guide-accent);
  background: var(--guide-accent-bg);
  border-radius: 0 10px 10px 0;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin: 1.2rem 0 0; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--guide-line);
  border-radius: 999px;
  background: var(--guide-surface);
  color: var(--guide-fg);
  font-weight: 700;
  text-decoration: none;
}
.button.primary { background: var(--guide-accent); border-color: var(--guide-accent); color: #fff; }
footer { padding: 1.5rem 0 2.5rem; color: var(--guide-muted); font-size: 0.83rem; }
footer nav { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 0.6rem; }
footer a { color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }

@media (hover: none) {
  .guide-card:active, .button:active { filter: brightness(0.96); }
}

@media (min-width: 640px) {
  .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .guide-skip-link { transition: none; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --guide-bg: #111214;
    --guide-surface: #1b1d20;
    --guide-fg: #f4f4f5;
    --guide-muted: #b6b6bf;
    --guide-line: #3f4248;
    --guide-accent: #ef82b4;
    --guide-accent-bg: #321c27;
  }
  a { color: #f0a0c4; }
  .button.primary { color: #1c1016; }
}