:root {
  --bg: #ffffff;
  --bg-soft: #f5f9f8;
  --ink: #2a3534;
  --ink-soft: #5a6766;
  --ink-mute: #8a9694;
  --line: #e5ebe9;
  --line-soft: #f0f4f2;

  --green: #06c755;
  --green-deep: #04a648;
  --green-pale: #d6f4e0;
  --green-bg: #eaf7ef;

  --blue: #4dc4ff;
  --blue-pale: #d6eefb;
  --blue-bg: #eaf5fc;

  --orange: #ff8c42;
  --orange-pale: #ffe0cc;
  --orange-bg: #fff2e8;

  --primary: var(--green);
  --primary-deep: var(--green-deep);
  --primary-pale: var(--green-pale);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: 'LINE Seed JP', sans-serif;
  background: var(--bg-soft);
  color: var(--ink);
  font-weight: 400;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: 'Quicksand', sans-serif;
  letter-spacing: 0.05em;
}
.logo-mark {
  width: 38px; height: 38px;
  background: var(--primary);
  border-radius: 12px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(6, 199, 85, 0.3);
}
.logo-mark::before,
.logo-mark::after {
  content: '';
  position: absolute;
  background: white;
  border-radius: 50%;
  width: 8px; height: 8px;
  top: 12px;
}
.logo-mark::before { left: 11px; }
.logo-mark::after { right: 11px; }
.logo-mouth {
  position: absolute;
  bottom: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 6px;
  border-bottom: 2.5px solid white;
  border-radius: 0 0 12px 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
  font-family: inherit;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-deep);
  transform: translateY(-1px);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 32px;
}
.breadcrumb-inner {
  max-width: 1240px;
  margin: 0 auto;
  font-size: 12px;
  color: var(--ink-mute);
  font-weight: 400;
}
.breadcrumb a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .separator { margin: 0 8px; color: var(--line); }
.breadcrumb .current { color: var(--ink); font-weight: 700; }

/* ===== Page Title ===== */
.page-title-section {
  background: linear-gradient(135deg, var(--green-bg), var(--blue-bg));
  padding: 48px 32px;
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
}
.page-title-icon {
  width: 56px;
  height: 56px;
  background: white;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}
.page-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.page-subtitle {
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 700;
}
.page-meta {
  margin-top: 16px;
  font-size: 12px;
  color: var(--ink-mute);
  font-weight: 400;
}
.page-meta strong {
  color: var(--ink);
  font-weight: 700;
}

/* ===== Main Layout ===== */
.legal-layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 32px 80px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: flex-start;
}

/* ===== Sidebar TOC ===== */
.toc {
  position: sticky;
  top: 88px;
  background: white;
  border-radius: 0;
  padding: 22px;
  border: 1.5px solid var(--line-soft);
}
.toc-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-mute);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.toc-list li {
  position: relative;
}
.toc-list a {
  display: block;
  padding: 8px 12px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  border-radius: 0;
  transition: all 0.2s;
  line-height: 1.5;
  border-left: 3px solid transparent;
}
.toc-list a:hover {
  background: var(--bg-soft);
  color: var(--primary);
}
.toc-list a.active {
  background: var(--green-bg);
  color: var(--primary-deep);
  border-left-color: var(--primary);
}

/* ===== Content ===== */
.legal-content {
  background: white;
  border-radius: 0;
  padding: 48px 56px;
  border: 1.5px solid var(--line-soft);
}

.legal-intro {
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 400;
  line-height: 2;
  padding: 20px 24px;
  background: var(--bg-soft);
  border-radius: 0;
  margin-bottom: 40px;
  border-left: 3px solid var(--primary);
}
.legal-intro strong {
  color: var(--ink);
  font-weight: 700;
}

/* Article (Section) */
.legal-article {
  margin-bottom: 40px;
  scroll-margin-top: 80px;
}
.legal-article:last-child { margin-bottom: 0; }

.legal-h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  letter-spacing: 0.01em;
}
.legal-h2 .num {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  padding: 2px 10px;
  border-radius: 0;
  margin-right: 10px;
  vertical-align: middle;
}

.legal-h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 24px;
  margin-bottom: 10px;
}
.legal-h3::before {
  content: '▸ ';
  color: var(--primary);
}

.legal-p {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.95;
  margin-bottom: 14px;
  font-weight: 400;
}
.legal-p strong {
  font-weight: 700;
  color: var(--ink);
}

.legal-list {
  list-style: none;
  margin-bottom: 14px;
  padding-left: 0;
}
.legal-list li {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.95;
  padding-left: 24px;
  position: relative;
  margin-bottom: 8px;
  font-weight: 400;
}
.legal-list li::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 12px;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

.legal-list-ordered {
  list-style: none;
  counter-reset: legal-counter;
  margin-bottom: 14px;
  padding-left: 0;
}
.legal-list-ordered li {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.95;
  padding-left: 32px;
  position: relative;
  margin-bottom: 10px;
  font-weight: 400;
  counter-increment: legal-counter;
}
.legal-list-ordered li::before {
  content: counter(legal-counter);
  position: absolute;
  left: 0;
  top: 3px;
  width: 22px;
  height: 22px;
  background: var(--primary-pale);
  color: var(--primary-deep);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Quicksand', sans-serif;
}

/* Highlight Box */
.legal-highlight {
  background: var(--orange-bg);
  border-left: 4px solid var(--orange);
  padding: 18px 22px;
  border-radius: 0;
  margin: 18px 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink);
  font-weight: 400;
}
.legal-highlight strong {
  color: var(--orange-deep, #ed6f1f);
  font-weight: 700;
}
.legal-highlight.green {
  background: var(--green-bg);
  border-color: var(--primary);
}
.legal-highlight.green strong { color: var(--primary-deep); }
.legal-highlight.blue {
  background: var(--blue-bg);
  border-color: var(--blue);
}
.legal-highlight.blue strong { color: #2ba8e8; }

/* Definition table */
.legal-def-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13px;
}
.legal-def-table th,
.legal-def-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.85;
}
.legal-def-table th {
  background: var(--bg-soft);
  color: var(--ink);
  font-weight: 700;
  font-size: 12px;
  width: 28%;
  border-right: 1px solid var(--line);
}
.legal-def-table tr:last-child th,
.legal-def-table tr:last-child td {
  border-bottom: none;
}

/* Specified Commerce Table */
.commerce-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border: 1.5px solid var(--line);
  border-radius: 0;
  overflow: hidden;
}
.commerce-table th,
.commerce-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  line-height: 1.85;
  vertical-align: top;
}
.commerce-table th {
  background: var(--bg-soft);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  width: 30%;
  border-right: 1px solid var(--line);
}
.commerce-table tr:last-child th,
.commerce-table tr:last-child td {
  border-bottom: none;
}
.commerce-table .placeholder {
  color: var(--ink-mute);
  background: var(--orange-bg);
  border-left: 3px solid var(--orange);
  padding: 10px 14px;
  border-radius: 0;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
}

/* Last Updated */
.legal-meta-box {
  margin-top: 48px;
  padding: 24px;
  background: var(--bg-soft);
  border-radius: 0;
  text-align: center;
}
.legal-meta-box-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-mute);
  margin-bottom: 8px;
}
.legal-meta-box-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  font-family: 'Quicksand', sans-serif;
}
.legal-history {
  margin-top: 16px;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.85;
  font-weight: 400;
}
.legal-history-title {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

/* ===== Cross-page Nav ===== */
.legal-cross-nav {
  margin-top: 32px;
  padding: 24px;
  background: white;
  border-radius: 0;
  border: 1.5px solid var(--line-soft);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.legal-cross-nav-link {
  flex: 1;
  min-width: 180px;
  padding: 14px 18px;
  background: var(--bg-soft);
  border: 1.5px solid var(--line);
  border-radius: 0;
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.legal-cross-nav-link:hover {
  border-color: var(--primary);
  background: var(--green-bg);
  color: var(--primary-deep);
  transform: translateY(-2px);
}
.legal-cross-nav-link.current {
  background: var(--primary-pale);
  border-color: var(--primary);
  color: var(--primary-deep);
  pointer-events: none;
}
.legal-cross-nav-icon {
  font-size: 18px;
  flex-shrink: 0;
}

/* ===== Footer ===== */
footer {
  background: white;
  border-top: 1px solid var(--line);
  padding: 32px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-mute);
  font-weight: 400;
}
footer a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 700;
  margin: 0 8px;
}
footer a:hover { color: var(--primary); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .toc {
    position: static;
    order: 2;
  }
  .legal-content { order: 1; }
}
@media (max-width: 640px) {
  .header-inner { padding: 14px 16px; gap: 8px; }
  .logo { font-size: 18px; }
  .logo-mark { width: 32px; height: 32px; border-radius: 10px; }
  .logo-mark::before { left: 9px; top: 10px; width: 7px; height: 7px; }
  .logo-mark::after { right: 9px; top: 10px; width: 7px; height: 7px; }
  .logo-mouth { bottom: 9px; width: 10px; height: 5px; }
  .header-inner .btn { padding: 8px 12px; font-size: 11px; white-space: nowrap; }
  .breadcrumb { padding: 12px 16px; }
  .page-title-section { padding: 32px 20px; }
  .page-title { font-size: 22px; }
  .page-subtitle { font-size: 12px; }
  .legal-layout { padding: 24px 16px 40px; }
  .legal-content { padding: 28px 22px; border-radius: 0; }
  .legal-h2 { font-size: 17px; }
  .legal-h2 .num { font-size: 12px; padding: 1px 8px; }
  .legal-h3 { font-size: 14px; }
  .legal-p, .legal-list li, .legal-list-ordered li { font-size: 13px; line-height: 1.85; }
  .legal-intro { padding: 16px 18px; font-size: 13px; }
  .legal-cross-nav-link { min-width: 100%; }
  /* Tables: stack on mobile */
  .legal-def-table,
  .legal-def-table thead,
  .legal-def-table tbody,
  .legal-def-table tr,
  .legal-def-table th,
  .legal-def-table td,
  .commerce-table,
  .commerce-table thead,
  .commerce-table tbody,
  .commerce-table tr,
  .commerce-table th,
  .commerce-table td {
    display: block;
    width: 100%;
    border-right: none;
  }
  .legal-def-table th,
  .commerce-table th {
    background: var(--bg-soft);
    padding: 10px 14px;
    border-bottom: none;
    font-size: 11px;
    color: var(--ink-mute);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .legal-def-table td,
  .commerce-table td {
    padding: 10px 14px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--line);
  }
  .commerce-table { border-radius: 0; }
}

/* ===== Print ===== */
@media print {
  .header, .breadcrumb, .toc, .legal-cross-nav, footer { display: none; }
  .legal-layout { grid-template-columns: 1fr; padding: 0; max-width: 100%; }
  .legal-content { padding: 20px; border: none; }
  body { background: white; }
}
