:root {
  --bg: #f4efe4;
  --bg-deep: #e9dfcf;
  --paper: rgba(255, 252, 247, 0.9);
  --panel: rgba(255, 255, 255, 0.78);
  --ink: #202420;
  --muted: #5b665d;
  --line: rgba(40, 52, 42, 0.14);
  --accent: #1f6a52;
  --accent-soft: #d9eadf;
  --accent-strong: #0f4c3a;
  --accent-warm: #e8d3b4;
  --shadow: 0 22px 60px rgba(50, 44, 31, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Sans JP", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(234, 195, 123, 0.32), transparent 28%),
    radial-gradient(circle at top right, rgba(46, 124, 89, 0.22), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, #f8f4ec 42%, var(--bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(31, 36, 31, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 36, 31, 0.035) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 86%);
}

a {
  color: inherit;
}

code,
pre {
  font-family: "Roboto Mono", monospace;
}

code {
  padding: 0.15em 0.42em;
  border-radius: 8px;
  background: rgba(29, 54, 43, 0.08);
  font-size: 0.92em;
}

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 72px;
}

.page-shell > .doc-main {
  margin-top: 28px;
}

.docs-layout {
  display: grid;
  gap: 32px;
}

.hero,
.panel,
.sidebar-card,
.module-card {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero,
.panel,
.sidebar-card {
  position: relative;
  border-radius: var(--radius-xl);
  backdrop-filter: blur(18px);
}

.panel,
.sidebar-card {
  overflow: hidden;
}

.hero::after,
.panel::after,
.sidebar-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -44px auto;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(31, 106, 82, 0.16), transparent 68%);
}

.hero {
  padding: 34px 40px 40px;
  overflow: visible;
  z-index: 5;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.position-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 6px;
  margin-bottom: 18px;
}

.position-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 18px 8px 16px;
  border: 1px solid rgba(15, 76, 58, 0.12);
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  overflow: hidden;
  filter:
    drop-shadow(0 1px 0 rgba(15, 76, 58, 0.14))
    drop-shadow(0 -1px 0 rgba(15, 76, 58, 0.14))
    drop-shadow(1px 0 0 rgba(15, 76, 58, 0.18));
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 8px 50%);
}

.position-chip::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 15px;
  height: 100%;
  border-top: 1px solid rgba(15, 76, 58, 0.12);
  border-right: 1px solid rgba(15, 76, 58, 0.12);
  border-bottom: 1px solid rgba(15, 76, 58, 0.12);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  pointer-events: none;
}

.position-chip:first-child {
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
  padding-left: 14px;
}

.position-chip:first-child::after {
  width: 14px;
}

.position-chip.current {
  background: linear-gradient(135deg, #214f3f, #2d7f61);
  color: #fcfff8;
  filter:
    drop-shadow(0 1px 0 rgba(252, 255, 248, 0.16))
    drop-shadow(0 -1px 0 rgba(252, 255, 248, 0.16))
    drop-shadow(1px 0 0 rgba(252, 255, 248, 0.2));
}

.position-chip.current::after {
  border-top-color: rgba(252, 255, 248, 0.22);
  border-right-color: rgba(252, 255, 248, 0.22);
  border-bottom-color: rgba(252, 255, 248, 0.22);
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-meta {
  display: grid;
  gap: 10px;
}

.hero h1 {
  margin: 10px 0 6px;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.hero-subline {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 700;
}

.module-card p,
.toc-empty {
  color: var(--muted);
}

.grid,
.info-pills {
  display: grid;
  gap: 18px;
}

.global-nav {
  margin-top: 26px;
  position: relative;
  z-index: 20;
}

.global-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.global-nav-item {
  position: relative;
  padding-bottom: 8px;
}

.global-nav-link {
  text-decoration: none;
}

.global-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid rgba(15, 76, 58, 0.12);
  background: rgba(233, 240, 236, 0.86);
  color: var(--muted);
  font-weight: 800;
}

.global-nav-link.current {
  background: linear-gradient(135deg, #214f3f, #2d7f61);
  color: #fcfff8;
}
.toc-toggle,
.mobile-toc-close,
.position-chip {
  text-decoration: none;
}

.toc-toggle,
.mobile-toc-close {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 52px;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid rgba(15, 76, 58, 0.15);
  font-weight: 700;
}

.panel {
  padding: 32px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 10px 0 0;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1.1;
}

.grid.three {
  grid-template-columns: 1fr;
}

.module-card {
  position: relative;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.module-card h3 {
  margin: 0 0 10px;
}

.toc-toggle {
  display: none;
  width: fit-content;
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-strong);
}

.docs-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 24px;
  align-items: start;
}

.doc-main {
  display: grid;
  gap: 28px;
}

.doc-sidebar {
  position: static;
}

.sidebar-card {
  padding: 24px;
}

.sidebar-card h2,
.sidebar-card h3 {
  margin: 0 0 12px;
}

.sidebar-card .eyebrow {
  margin-bottom: 10px;
}

.mobile-toc-close {
  display: none;
  margin-top: 16px;
  width: 100%;
  background: linear-gradient(135deg, #214f3f, #2d7f61);
  color: #fcfff8;
}

.scroll-top-button {
  position: fixed;
  right: 24px;
  bottom: 96px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  min-height: 60px;
  padding: 0 16px;
  border: 1px solid rgba(15, 76, 58, 0.18);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(33, 79, 63, 0.96), rgba(45, 127, 97, 0.94));
  color: #fcfff8;
  font-family: "Roboto Mono", monospace;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  box-shadow: 0 18px 36px rgba(26, 47, 39, 0.22);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease;
  z-index: 32;
  cursor: pointer;
}

.toc-fab-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  min-height: 60px;
  padding: 0 16px;
  border: 1px solid rgba(15, 76, 58, 0.18);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(33, 79, 63, 0.96), rgba(45, 127, 97, 0.94));
  color: #fcfff8;
  font-family: "Roboto Mono", monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 18px 36px rgba(26, 47, 39, 0.22);
  z-index: 32;
  cursor: pointer;
}

.scroll-top-button.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

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

.toc-item + .toc-item,
.toc-subitem + .toc-subitem,
.toc-item + .toc-subitem,
.toc-subitem + .toc-item {
  margin-top: 10px;
}

.toc-list a {
  display: block;
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.5;
}

.toc-list a:hover {
  background: rgba(31, 106, 82, 0.08);
  color: var(--accent-strong);
}

.toc-subitem a {
  padding-left: 22px;
  font-size: 0.95rem;
}

.info-pills {
  grid-template-columns: 1fr;
}

.info-pill {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.info-pill strong {
  display: block;
  margin-bottom: 6px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(217, 234, 223, 0.72);
  color: var(--accent-strong);
}

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

.code-block {
  overflow-x: auto;
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: #1d2b24;
  color: #f5f8f4;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.code-block code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.module-card code {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.note-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.checklist {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
}

.note-card {
  position: relative;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.note-card h3 {
  margin: 0 0 10px;
}

.note-card p,
.checklist li {
  color: var(--muted);
}

.note-card strong {
  color: var(--ink);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(15, 76, 58, 0.12);
}

.metric-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.2rem;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.95rem;
}

.inline-link-list a {
  text-decoration: none;
}

.directory-stack {
  display: grid;
  gap: 10px;
}

.download-inline {
  margin-bottom: 18px;
}

.download-inline a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(15, 76, 58, 0.14);
  background: rgba(233, 240, 236, 0.92);
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.download-inline a small {
  display: inline;
  margin: 0;
  color: inherit;
  opacity: 0.82;
  font-weight: 600;
}

.category-stack {
  max-width: 420px;
}

.directory-stack a {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 76, 58, 0.1);
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.directory-stack a.current {
  background: linear-gradient(135deg, #214f3f, #2d7f61);
  color: #fcfff8;
}

.directory-stack small,
.inline-link-list small {
  display: block;
  margin-top: 4px;
  color: inherit;
  opacity: 0.82;
  font-weight: 600;
}

.category-stack a {
  padding: 18px 20px;
  font-size: 1.06rem;
  border-color: rgba(92, 77, 43, 0.14);
  background: rgba(242, 234, 220, 0.88);
  color: #5f4e32;
}

.section-intro {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.9;
}

.inline-link-list {
  display: grid;
  gap: 10px;
}

.footer-link-block {
  margin-top: 28px;
}

.footer-link-block .inline-link-list {
  max-width: 420px;
}

.inline-link-list a {
  display: block;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(92, 77, 43, 0.14);
  background: rgba(242, 234, 220, 0.88);
  color: #5f4e32;
  font-weight: 700;
}

.sample-table th {
  background: #70ad47;
  color: #fcfff8;
}

.excel-preview {
  border: 1px solid rgba(100, 134, 85, 0.2);
  background: #f5fbf1;
}

.excel-preview + .excel-preview {
  margin-top: 18px;
}

.excel-preview-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(100, 134, 85, 0.2);
  background: #e2f0d9;
}

.excel-preview-head strong {
  color: #2f5f2f;
}

.excel-preview-head span {
  color: #557455;
  font-family: "Roboto Mono", monospace;
  font-size: 0.88rem;
  font-weight: 500;
}

.excel-table-wrap {
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

.excel-table {
  min-width: 0;
}

.excel-table th,
.excel-table td {
  border: 1px solid #b7cfad;
  padding: 10px 12px;
}

.excel-table td {
  background: #ffffff;
  color: var(--ink);
}

.excel-table tbody tr:last-child td {
  border-bottom: 1px solid #b7cfad;
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(33, 79, 63, 0.12);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 800;
}

.panel-lead {
  margin-top: 0;
  color: var(--muted);
  line-height: 1.85;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.step-stack {
  display: grid;
  gap: 16px;
}

.step-item {
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.step-item-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.step-number {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(15, 76, 58, 0.1);
  color: var(--accent-strong);
  font-weight: 800;
}

.step-item h3 {
  margin: 0;
}

.step-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
}

.step-item .inline-link-list {
  margin-top: 14px;
}

.number-card {
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.number-card strong {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(15, 76, 58, 0.1);
  color: var(--accent-strong);
}

.number-card p {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  width: min(1240px, calc(100% - 32px));
  margin: 32px auto 0;
  padding: 22px 24px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.78);
  box-shadow: var(--shadow);
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
}

.site-footer p + p {
  margin-top: 8px;
}

.site-footer .footer-link-block {
  margin: 0 0 14px;
  text-align: left;
}

.site-footer .footer-link-block .inline-link-list {
  max-width: 320px;
}

.site-footer .footer-link-block .inline-link-list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.site-footer .footer-link-block .inline-link-list a small {
  display: inline;
  margin: 0;
}

.site-footer .footer-title {
  font-size: 1.06rem;
  line-height: 1.5;
}

.site-footer strong {
  color: var(--ink);
}

.toc-toggle:hover,
.mobile-toc-close:hover,
.position-chip:hover {
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .docs-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc-toggle {
    display: none;
  }

  .doc-sidebar {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(88vw, 360px);
    z-index: 30;
    transform: translateX(100%);
    transition: transform 180ms ease;
    padding: 16px 12px 16px 0;
  }

  body.toc-open .doc-sidebar {
    transform: translateX(0);
  }

  body.toc-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(16, 22, 19, 0.42);
    z-index: 20;
  }

  .sidebar-card {
    height: calc(100vh - 32px);
    overflow-y: auto;
    padding-bottom: 28px;
  }

  .mobile-toc-close {
    display: inline-flex;
  }

  .toc-fab-button {
    display: inline-flex;
    right: 18px;
    bottom: 18px;
  }

  .scroll-top-button {
    right: 18px;
    bottom: 90px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(1240px, calc(100% - 20px));
    padding-top: 0;
  }

  .site-footer {
    width: min(1240px, calc(100% - 20px));
  }

  .hero,
  .panel,
  .sidebar-card {
    padding: 24px;
    border-radius: 24px;
  }

  .hero {
    border-radius: 0 0 24px 24px;
  }

  .scroll-top-button {
    right: 14px;
    bottom: 78px;
    min-width: 54px;
    min-height: 54px;
    padding: 0 14px;
    font-size: 0.84rem;
  }

  .toc-fab-button {
    right: 14px;
    bottom: 14px;
    min-width: 54px;
    min-height: 54px;
    padding: 0 14px;
    font-size: 0.8rem;
  }

  .global-nav {
    display: block;
    margin-top: 18px;
  }

  .global-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .global-nav-item {
    padding-bottom: 0;
  }

  .global-nav-link {
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.9rem;
  }

  .position-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .position-chip {
    min-height: 32px;
    padding: 6px 14px 6px 12px;
    font-size: 0.78rem;
  }

  .position-chip:first-child {
    padding-left: 12px;
  }

  .metric-strip,
  .number-grid,
  .note-grid {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 520px;
  }
}
