:root {
  color-scheme: light dark;
  --paper: #f8f9fb;
  --surface: #fcfdfe;
  --surface-soft: #eef3f7;
  --ink: #111827;
  --text: #334155;
  --muted: #64748b;
  --line: #d5dde6;
  --accent: #006b9e;
  --accent-strong: #07557b;
  --accent-soft: #e8f4fa;
  --success-soft: #e9f7f1;
  --warning-soft: #fff7df;
  --danger-soft: #fff0f0;
  --header-height: 72px;
  --max-width: 1240px;
  --font: "Avenir Next", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent-strong);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent);
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--surface);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  min-height: var(--header-height);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 154px;
  height: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  white-space: nowrap;
}

.header-nav a {
  display: inline-flex;
  min-height: 44px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  align-items: center;
}

.header-nav a[aria-current="page"] {
  color: var(--accent-strong);
}

.header-nav .header-cta {
  min-height: 44px;
  padding: 7px 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.header-nav .header-cta:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #f8fafc;
}

.docs-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 54px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 50px 28px 96px;
}

.docs-nav {
  position: sticky;
  top: calc(var(--header-height) + 28px);
  align-self: start;
  max-height: calc(100dvh - var(--header-height) - 56px);
  overflow-y: auto;
  padding-right: 20px;
}

.docs-nav-title {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.docs-nav-group {
  margin: 24px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.docs-nav a {
  display: flex;
  min-height: 44px;
  margin-left: -12px;
  padding: 7px 12px;
  border-left: 2px solid transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  align-items: center;
}

.docs-nav a:hover,
.docs-nav a[aria-current="page"] {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.doc-main {
  min-width: 0;
  max-width: 860px;
}

.doc-hero {
  padding: 12px 0 42px;
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb a {
  color: inherit;
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.35;
  text-wrap: pretty;
}

h1 {
  max-width: 16em;
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.03em;
}

h2 {
  margin: 64px 0 18px;
  padding-top: 10px;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.02em;
  scroll-margin-top: calc(var(--header-height) + 18px);
}

h3 {
  margin: 34px 0 12px;
  font-size: 20px;
}

.hero-copy {
  max-width: 46em;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.updated {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.doc-section > p,
.doc-section > ul,
.doc-section > ol,
.doc-section > dl {
  max-width: 48em;
}

.doc-section p {
  margin: 0 0 18px;
}

.doc-section ul,
.doc-section ol {
  margin: 18px 0;
  padding-left: 1.4em;
}

.doc-section li + li {
  margin-top: 10px;
}

.doc-section strong {
  color: var(--ink);
}

.task-path {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 30px 0 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.task-link {
  display: grid;
  min-height: 136px;
  padding: 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.task-link:hover {
  background: var(--accent-soft);
  color: var(--text);
  transform: translateY(-2px);
}

.task-link strong {
  color: var(--ink);
  font-size: 18px;
}

.task-link span {
  align-self: end;
  color: var(--muted);
  font-size: 14px;
}

.guide-list {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 16px;
  margin-top: 24px;
}

.guide-link {
  display: block;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.guide-link:nth-child(3n + 1) {
  background: var(--accent-soft);
}

.guide-link strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 17px;
}

.guide-link span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.search-box {
  margin-top: 28px;
}

.search-box label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
}

.search-box input::placeholder {
  color: var(--muted);
}

.callout {
  max-width: 48em;
  margin: 28px 0;
  padding: 20px 22px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
}

.callout.warning {
  border-left-color: #a56600;
  background: var(--warning-soft);
}

.callout.danger {
  border-left-color: #a32929;
  background: var(--danger-soft);
}

.callout strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.steps {
  margin: 26px 0;
  padding: 0;
  list-style: none;
  counter-reset: guide-step;
}

.steps > li {
  position: relative;
  min-height: 88px;
  padding: 2px 0 28px 58px;
  counter-increment: guide-step;
}

.steps > li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 38px;
  height: 38px;
  border: 1px solid var(--accent);
  color: var(--accent-strong);
  content: counter(guide-step);
  place-items: center;
  font-weight: 800;
}

.steps > li::after {
  position: absolute;
  top: 46px;
  bottom: 8px;
  left: 18px;
  width: 1px;
  background: var(--line);
  content: "";
}

.steps > li:last-child::after {
  display: none;
}

.steps h3 {
  margin: 0 0 8px;
}

.steps p {
  margin: 0;
}

.figure {
  margin: 28px 0;
  border: 1px solid var(--line);
  background: var(--surface);
}

.figure img {
  width: 100%;
}

.figure figcaption {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  max-width: 48em;
  margin: 24px 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.fact {
  min-height: 120px;
  padding: 20px;
  background: var(--surface);
}

.fact strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}

.fact span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.faq-list {
  max-width: 48em;
  margin: 28px 0;
}

.faq-list details {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.faq-list details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  padding: 18px 8px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.faq-answer {
  padding: 0 8px 20px;
  color: var(--text);
}

.tab-guide {
  max-width: 48em;
  margin-top: 26px;
}

.tab-guide article {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-height) + 20px);
}

.tab-guide article:last-child {
  border-bottom: 1px solid var(--line);
}

.tab-guide h2 {
  margin: 0;
  padding: 0;
  font-size: 19px;
}

.tab-guide p {
  margin: 0 0 10px;
}

.tab-guide .next-action {
  color: var(--muted);
  font-size: 14px;
}

.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.page-links a {
  display: inline-flex;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  align-items: center;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px 28px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  display: inline-flex;
  min-height: 44px;
  padding-inline: 4px;
  color: inherit;
  align-items: center;
}

.is-hidden {
  display: none !important;
}

.legal-main {
  width: min(100% - 40px, 860px);
  margin: 0 auto;
  padding: 52px 0 88px;
}

.legal-article {
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--line);
  background: var(--surface);
}

.legal-kicker {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.legal-document {
  margin-top: 38px;
  overflow-wrap: anywhere;
}

.legal-document section + section {
  margin-top: 38px;
}

.legal-document h2 {
  margin: 0 0 12px;
  padding: 0;
  font-size: 19px;
}

.legal-document h3 {
  margin: 24px 0 10px;
  font-size: 16px;
}

.legal-document p,
.legal-document ul,
.legal-document dl {
  margin: 0 0 16px;
}

.legal-document ul {
  padding-left: 1.4em;
}

.legal-document li + li {
  margin-top: 8px;
}

.legal-rows {
  border: 1px solid var(--line);
}

.legal-row {
  display: grid;
  grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr);
  gap: 16px;
  padding: 14px 16px;
}

.legal-row + .legal-row {
  border-top: 1px solid var(--line);
}

.legal-row:nth-child(odd) {
  background: var(--surface-soft);
}

.legal-row dt {
  color: var(--ink);
  font-weight: 800;
}

.legal-row dd {
  min-width: 0;
  margin: 0;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 22px;
}

.legal-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-size: 14px;
}

.legal-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1419;
    --surface: #151c23;
    --surface-soft: #1d2831;
    --ink: #edf4f8;
    --text: #c7d3dc;
    --muted: #9dafbc;
    --line: #34444f;
    --accent: #69c8f0;
    --accent-strong: #9bdcf7;
    --accent-soft: #153546;
    --success-soft: #153a2c;
    --warning-soft: #3b3016;
    --danger-soft: #3b2020;
  }

  .header-nav .header-cta {
    color: #111827;
  }

  .brand img {
    content: url("/assets/logo-white.png");
  }
}

@media (max-width: 900px) {
  .header-inner {
    padding: 0 20px;
  }

  .header-nav a:not(.header-cta) {
    display: none;
  }

  .docs-shell {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 34px 20px 72px;
  }

  .docs-nav {
    position: static;
    display: flex;
    max-height: none;
    margin: 0 -20px;
    padding: 0 20px 12px;
    gap: 6px;
    overflow-x: auto;
  }

  .docs-nav-title,
  .docs-nav-group {
    display: none;
  }

  .docs-nav a {
    flex: 0 0 auto;
    margin: 0;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-left-width: 1px;
    background: var(--surface);
  }

  .docs-nav a:hover,
  .docs-nav a[aria-current="page"] {
    border-color: var(--accent);
  }

  .footer-inner {
    padding: 28px 20px;
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .brand img {
    width: 132px;
  }

  .header-nav .header-cta {
    padding-inline: 12px;
    font-size: 13px;
  }

  .doc-hero {
    padding-bottom: 32px;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    margin-top: 48px;
  }

  .task-path,
  .guide-list,
  .fact-grid {
    grid-template-columns: 1fr;
  }

  .tab-guide article {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .legal-main {
    width: min(100% - 28px, 860px);
    padding: 28px 0 64px;
  }

  .legal-article {
    padding: 24px 20px;
  }

  .legal-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
