:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #102a43;
  --muted: #4f6475;
  --primary: #0068b7;
  --primary-dark: #004b8d;
  --accent: #00a6d6;
  --border: #d8e8f2;
  --border-strong: #b7dbea;
  --shadow: 0 14px 34px rgba(0, 75, 141, 0.10);
  --radius: 18px;
  --max-width: 1120px;
  --font-sans: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
}

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

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 20;
  padding: 10px 14px;
  color: #fff;
  background: var(--primary-dark);
  border-radius: 999px;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  background: #fff;
  border-top: 8px solid var(--primary);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--primary-dark);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  height: auto;
}

.brand-text {
  font-size: clamp(1rem, 2vw, 1.35rem);
  letter-spacing: -0.02em;
}

.page-hero {
  background: #f7fbfe;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.page-hero-inner {
  padding: 30px 0 34px;
}

.page-hero h1 {
  margin: 0;
  color: var(--primary-dark);
  font-size: clamp(1.85rem, 4vw, 3rem);
  line-height: 1.25;
}

.breadcrumb {
  padding: 14px 0 10px;
  font-size: 0.92rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.breadcrumb li:not(:last-child)::after {
  margin-left: 6px;
  color: var(--muted);
  content: ">";
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb [aria-current="page"] {
  color: var(--primary-dark);
  font-weight: 700;
}

.hero-panel {
  padding: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f9fd 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

h1,
h2,
h3 {
  margin: 0; line-height: 1.35;
}

h1 {
  color: var(--primary-dark);
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  letter-spacing: -0.03em;
}

.lead {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.index-links,
.button-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 16px;
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
  background: #fff;
  border: 2px solid var(--border-strong);
  border-radius: 13px;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.action-button:hover {
  background: #f4fbff;
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(0, 75, 141, 0.10);
}

.external-link::after {
  content: "外部";
  margin-left: 8px;
  padding: 2px 7px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  background: var(--primary);
  border-radius: 999px;
}

.page-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(0, 75, 141, 0.08);
}

.page-nav-label {
  grid-column: 1 / -1;
  color: var(--primary-dark);
  font-size: 1rem;
  font-weight: 900;
}

.page-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 11px 12px;
  color: var(--primary-dark);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(180deg, #fff 0%, #f4f9fd 100%);
  border: 2px solid var(--border-strong);
  border-radius: 14px;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.page-nav a:hover {
  background: #f4fbff;
  border-color: var(--primary);
}

.content-section {
  padding: 26px 0 0; scroll-margin-top: 18px;
}

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

.section-heading h2,
.panel h2 {
  color: var(--primary-dark);
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.quick-card {
  display: block;
  min-height: 120px;
  padding: 18px;
  color: var(--primary-dark);
  text-decoration: none;
  background: #fff;
  border: 2px solid var(--border-strong);
  border-left: 8px solid var(--primary);
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(0, 75, 141, 0.08);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.quick-card:hover {
  background: #f4fbff;
  border-color: var(--primary);
}

.quick-card span {
  display: block;
  font-size: 1.05rem;
  font-weight: 900;
}

.quick-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.panel {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel > p,
.note {
  color: var(--muted);
}

.table-block {
  margin-top: 22px;
}

.table-block h3 {
  margin-bottom: 10px;
  color: var(--primary-dark);
  font-size: 1.16rem;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  text-align: center;
  color: var(--primary-dark);
  font-size: 0.9rem;
  font-weight: 900;
  background: #eef8ff;
  white-space: nowrap;
}

td:first-child {
  color: var(--primary-dark);
  font-weight: 900;
  white-space: nowrap;
}

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

.chart-table td:nth-child(2) {
  min-width: 220px;
}

.site-footer {
  margin-top: 42px;
  padding: 26px 0;
  color: #fff;
  background: var(--primary-dark);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.site-footer a {
  color: #fff; font-weight: 700;
}

@media (max-width: 980px) {
  .page-nav,
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body { font-size: 1.05rem; }
  .brand-text { font-size: clamp(1.02rem, 4.4vw, 1.2rem); }
  .breadcrumb { font-size: 1rem; }
  .page-hero h1,
  h1 { font-size: clamp(1.75rem, 7vw, 2.25rem); }
  .lead { font-size: 1.05rem; }
  .page-nav-label { font-size: 1.08rem; }
  .page-nav a,
  .action-button { font-size: 1.05rem; }
  .section-heading h2,
  .panel h2 { font-size: 1.45rem; }
  .quick-card span { font-size: 1.08rem; }
  .quick-card small { font-size: 1rem; }
  .table-block h3 { font-size: 1.25rem; }
  th { font-size: 1rem; }
  td { font-size: 1rem; }
  .site-footer { font-size: 1rem; }
  .container {
    width: min(100% - 24px, var(--max-width));
  }

  .header-inner {
    padding: 18px 0;
  }

  .brand {
    white-space: normal;
  }

  .brand-mark {
    width: 42px;
  }

  .hero-panel,
  .panel,
  .page-nav {
    padding: 18px; border-radius: 15px;
  }

  .page-nav,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .content-section {
    padding-top: 20px;
  }

  .action-button {
    width: 100%;
  }

  .quick-card {
    min-height: auto;
  }

  table {
    min-width: 680px;
  }
}

.chart-index-link {
  margin: 14px 0 6px;
}

.page-nav a.purchase-nav-button {
  color: #1f5f3a;
  background: rgba(46, 125, 50, 0.10);
  border-color: rgba(46, 125, 50, 0.34);
  box-shadow: none;
}

.page-nav a.purchase-nav-button:hover {
  color: #174b2d;
  background: rgba(46, 125, 50, 0.16);
  border-color: rgba(46, 125, 50, 0.48);
  box-shadow: 0 8px 18px rgba(46, 125, 50, 0.10);
}

.table-scroll-collapsible.is-collapsed tbody tr:nth-child(n+5) {
  display: none;
}

.table-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 6px;
  padding: 8px 20px;
  color: #263544;
  font: inherit;
  font-weight: 900;
  line-height: 1.4;
  background: #e5e7eb;
  border: 2px solid #9aa4b2;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(38, 53, 68, 0.16);
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.table-toggle:hover,
.table-toggle:focus-visible {
  color: #17212b;
  background: #d1d5db;
  border-color: #6b7280;
  box-shadow: 0 8px 18px rgba(38, 53, 68, 0.20);
}

.chart-table td:nth-child(3),
#charts .table-block:nth-of-type(2) table td:nth-child(3),
#aviation table td:nth-child(3),
#basic table td:nth-child(4) {
  text-align: right;
}

.action-button.external-link {
  color: #8a3b00;
  background: #fffaf3;
  border-color: #f59e0b;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.14);
}

.action-button.external-link:hover,
.action-button.external-link:focus-visible {
  color: #6f2f00;
  background: #fff3df;
  border-color: #ea7600;
  box-shadow: 0 10px 22px rgba(234, 118, 0, 0.18);
}

/* アクセシビリティ改善：キーボードフォーカスを明確化 */
.action-button:focus-visible,
.page-nav a:focus-visible,
.quick-card:focus-visible,
.site-footer a:focus-visible,
.breadcrumb a:focus-visible,
.brand:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
