:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1c1e;
  --text-muted: #5b5b60;
  --border: #e5e5e3;
  --accent: #b5482a;
  --accent-soft: #f4e4de;
  --toc-width: 260px;
  --content-max: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17161a;
    --surface: #201f24;
    --text: #eeeeee;
    --text-muted: #a7a6ac;
    --border: #35333a;
    --accent: #e08a63;
    --accent-soft: #3a281f;
  }
}

:root[data-theme="dark"] {
  --bg: #17161a;
  --surface: #201f24;
  --text: #eeeeee;
  --text-muted: #a7a6ac;
  --border: #35333a;
  --accent: #e08a63;
  --accent-soft: #3a281f;
}

:root[data-theme="light"] {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1c1e;
  --text-muted: #5b5b60;
  --border: #e5e5e3;
  --accent: #b5482a;
  --accent-soft: #f4e4de;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

.toc {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--toc-width);
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 2.5rem 1.5rem;
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc-counter;
}

.toc li {
  counter-increment: toc-counter;
  margin-bottom: 0.35rem;
}

.toc a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.toc a::before {
  content: counter(toc-counter) ". ";
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.toc a:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.toc a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.content {
  margin-left: var(--toc-width);
  max-width: var(--content-max);
  padding: 4rem 2rem 6rem;
}

.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 2.1rem;
  margin: 0 0 0.3rem;
  letter-spacing: -0.01em;
}

.app-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.effective-date {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.intro p {
  font-size: 1.02rem;
}

section h2 {
  font-size: 1.3rem;
  margin: 2.5rem 0 0.75rem;
  scroll-margin-top: 2rem;
}

section h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}

p, li {
  color: var(--text);
  font-size: 0.98rem;
}

ul {
  padding-left: 1.3rem;
}

li {
  margin-bottom: 0.4rem;
}

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

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

thead {
  background: var(--accent-soft);
}

th, td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child td {
  border-bottom: none;
}

.contact-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.page-footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .toc {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 15;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0);
  }

  .toc.open {
    transform: translateX(0);
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35);
  }

  .content {
    margin-left: 0;
    padding: 5rem 1.25rem 4rem;
  }
}
