:root {
  --primary: #1768c4;
  --primary-dark: #0e4f99;
  --navy: #163250;
  --text: #26384b;
  --subtext: #607286;
  --muted: #8291a2;
  --line: #dbe3eb;
  --soft-line: #e9eef3;
  --bg: #f5f7f9;
  --pale-blue: #eef6fd;
  --white: #fff;
  --warning-bg: #fff8e7;
  --warning-line: #e2c674;
  --warning-text: #775c10;
  --max-width: 1040px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  color: var(--text);
  background: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    "Yu Gothic Medium", "Yu Gothic", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container { width: min(calc(100% - 40px), var(--max-width)); margin-inline: auto; }

.topline { height: 5px; background: var(--primary); }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--line);
}

.header-inner { display: flex; min-height: 70px; align-items: center; gap: 28px; }

.logo { display: flex; flex-shrink: 0; align-items: center; gap: 10px; }
.logo img { width: 38px; height: 38px; object-fit: contain; }
.logo-name { color: var(--navy); font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.logo-name span { color: var(--primary); }

.header-nav { display: flex; align-items: stretch; align-self: stretch; margin-left: auto; }
.header-nav a {
  display: flex; align-items: center; padding: 0 16px;
  color: #34495e; font-size: 14px; font-weight: 600;
  border-bottom: 3px solid transparent;
}
.header-nav a:hover, .header-nav a.active { color: var(--primary); border-bottom-color: var(--primary); }

.header-button {
  display: inline-flex; min-height: 40px; align-items: center; justify-content: center;
  padding: 0 17px; color: var(--white); background: var(--primary);
  border: 1px solid var(--primary); border-radius: 6px;
  font-size: 13px; font-weight: 700;
}
.header-button:hover { background: var(--primary-dark); }

.breadcrumbs { background: #f6f8fa; border-bottom: 1px solid var(--line); }
.breadcrumbs ol {
  display: flex; min-height: 42px; align-items: center; gap: 9px;
  list-style: none; color: var(--muted); font-size: 12px;
}
.breadcrumbs li + li::before { margin-right: 9px; content: ">"; color: #a3adb8; }
.breadcrumbs a:hover { color: var(--primary); text-decoration: underline; }

.page-head {
  padding: 52px 0 46px;
  background: linear-gradient(90deg, #f4f9fe 0%, #fff 74%);
  border-bottom: 1px solid var(--line);
}
.page-label { color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.page-head h1 { margin-top: 7px; color: var(--navy); font-size: clamp(28px, 4vw, 40px); line-height: 1.45; }
.page-head p { max-width: 720px; margin-top: 13px; color: var(--subtext); }

.main { padding: 56px 0 84px; }

.draft-alert {
  margin-bottom: 32px; padding: 18px 20px;
  color: var(--warning-text); background: var(--warning-bg);
  border: 1px solid var(--warning-line); border-left: 5px solid #d9a91a;
}
.draft-alert strong { display: block; margin-bottom: 3px; color: #5d470c; }

.content-section + .content-section { margin-top: 52px; }
.content-section h2 {
  margin-bottom: 18px; padding-bottom: 10px;
  color: var(--navy); font-size: 23px;
  border-bottom: 2px solid var(--primary);
}
.content-section h3 { margin: 26px 0 10px; color: var(--navy); font-size: 17px; }
.content-section p + p { margin-top: 12px; }

.legal-table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); }
.legal-table th, .legal-table td {
  padding: 17px 19px; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.legal-table tr:last-child th, .legal-table tr:last-child td { border-bottom: 0; }
.legal-table th {
  width: 245px; color: #42586e; background: #f7f9fb;
  text-align: left; font-size: 13px;
}
.legal-table td { color: var(--text); background: var(--white); }

.needs-input {
  display: inline-block; padding: 2px 7px;
  color: #9a3d21; background: #fff0e9;
  border: 1px solid #ecc1b2; border-radius: 3px;
  font-weight: 700;
}

.note-box {
  margin-top: 24px; padding: 19px 21px;
  background: var(--pale-blue); border: 1px solid #cbdff1;
}
.note-box strong { color: var(--navy); }

.definition-list { display: grid; grid-template-columns: 210px 1fr; border: 1px solid var(--line); }
.definition-list dt, .definition-list dd {
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.definition-list dt { color: #516578; background: #f7f9fb; font-size: 13px; font-weight: 700; }
.definition-list dd { border-left: 1px solid var(--line); }
.definition-list dt:nth-last-of-type(1), .definition-list dd:nth-last-of-type(1) { border-bottom: 0; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { padding: 22px; background: var(--white); border: 1px solid var(--line); }
.card .number { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.card h3 { margin: 8px 0; color: var(--navy); font-size: 17px; }
.card p { color: var(--subtext); font-size: 13px; }

.link-list { list-style: none; border-top: 1px solid var(--line); }
.link-list li { border-bottom: 1px solid var(--line); }
.link-list a { display: flex; justify-content: space-between; padding: 14px 4px; color: var(--primary); font-weight: 700; }
.link-list a::after { content: ">"; }
.link-list a:hover { background: #f8fbfe; }

.site-footer { padding: 46px 0 24px; color: #9db0c3; background: #102940; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 38px; padding-bottom: 34px; }
.footer-brand .logo-name { color: var(--white); }
.footer-brand p { max-width: 330px; margin-top: 14px; font-size: 13px; }
.footer-column h3 { margin-bottom: 13px; color: var(--white); font-size: 13px; }
.footer-column ul { list-style: none; }
.footer-column li + li { margin-top: 8px; }
.footer-column a { color: #aebdcb; font-size: 13px; }
.footer-column a:hover { color: var(--white); text-decoration: underline; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 20px;
  padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12px;
}

/* Terms-specific styles */
.terms-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 20px;
  color: var(--subtext);
  font-size: 13px;
}
.terms-meta strong { color: var(--navy); }

.terms-layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  align-items: start;
  gap: 42px;
}

.terms-toc {
  position: sticky;
  top: 94px;
  background: #f7f9fb;
  border: 1px solid var(--line);
}
.terms-toc h2 {
  padding: 15px 17px;
  color: var(--navy);
  background: #eef3f8;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.terms-toc ol { list-style: none; }
.terms-toc a {
  display: block;
  padding: 9px 16px;
  color: #4b6177;
  border-bottom: 1px solid var(--soft-line);
  font-size: 12px;
  line-height: 1.5;
}
.terms-toc li:last-child a { border-bottom: 0; }
.terms-toc a:hover {
  color: var(--primary);
  background: var(--white);
}

.terms-intro {
  margin-bottom: 34px;
  padding: 22px 24px;
  color: #40566c;
  background: var(--pale-blue);
  border: 1px solid #cbdff1;
}

.term-article {
  scroll-margin-top: 96px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}
.term-article + .term-article { margin-top: 38px; }
.term-article:last-child { border-bottom: 0; }
.term-article h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 17px;
  padding-bottom: 10px;
  color: var(--navy);
  border-bottom: 2px solid var(--primary);
  font-size: 21px;
}
.term-article h2 .article-en {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}
.term-article p + p { margin-top: 12px; }

.term-list {
  margin: 12px 0 0 1.35em;
  padding-left: .4em;
}
.term-list > li { padding-left: .25em; }
.term-list > li + li { margin-top: 10px; }
.term-list ol {
  margin: 9px 0 0 1.4em;
  list-style: none;
  counter-reset: subitem;
}
.term-list ol li {
  position: relative;
  padding-left: 2.2em;
  counter-increment: subitem;
}
.term-list ol li + li { margin-top: 7px; }
.term-list ol li::before {
  position: absolute;
  left: 0;
  content: "(" counter(subitem) ")";
  color: #516578;
}

.definition-items {
  list-style: none;
  counter-reset: definition;
  border-top: 1px solid var(--line);
}
.definition-items li {
  position: relative;
  padding: 15px 16px 15px 54px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  counter-increment: definition;
}
.definition-items li::before {
  position: absolute;
  top: 15px;
  left: 17px;
  color: var(--primary);
  font-weight: 800;
  content: "(" counter(definition) ")";
}

.operator-box {
  margin-top: 26px;
  padding: 20px 22px;
  background: #f7f9fb;
  border: 1px solid var(--line);
}
.operator-box h3 {
  margin-bottom: 10px;
  color: var(--navy);
  font-size: 16px;
}
.operator-box dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 7px 16px;
  font-size: 13px;
}
.operator-box dt { color: var(--muted); font-weight: 700; }
.operator-box dd { color: var(--text); }

.terms-related { margin-top: 52px; }

@media (max-width: 820px) {
  .header-nav { display: none; }
  .header-button { margin-left: auto; }
  .cards { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .terms-layout { grid-template-columns: 1fr; gap: 28px; }
  .terms-toc { position: static; }
  .terms-toc ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .terms-toc a { height: 100%; border-right: 1px solid var(--soft-line); }
}

@media (max-width: 620px) {
  .container { width: min(calc(100% - 28px), var(--max-width)); }
  .page-head { padding: 40px 0 36px; }
  .main { padding: 40px 0 64px; }
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table th, .legal-table td { display: block; width: 100%; }
  .legal-table th { padding-bottom: 8px; border-bottom: 0; }
  .legal-table td { padding-top: 8px; }
  .definition-list { grid-template-columns: 1fr; }
  .definition-list dd { border-left: 0; }
  .definition-list dt { border-bottom: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .terms-toc ol { grid-template-columns: 1fr; }
  .term-article h2 {
    display: block;
    font-size: 19px;
  }
  .term-article h2 .article-en {
    display: block;
    margin-top: 3px;
  }
  .operator-box dl { grid-template-columns: 1fr; gap: 2px; }
  .operator-box dd + dt { margin-top: 9px; }
}

/* ── Buttons ── */
.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.button-primary {
  color: var(--white);
  background: var(--primary);
  border-color: var(--primary);
}

.button-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.button-outline {
  color: var(--primary);
  background: var(--white);
  border-color: #a9c7e6;
}

.button-outline:hover {
  background: var(--pale-blue);
  border-color: var(--primary);
}
