:root {
  --navy: #153a59;
  --navy-2: #0f2b43;
  --teal: #0e838b;
  --teal-light: #e6f5f4;
  --coral: #e45e55;
  --gold: #efb336;
  --paper: #fffdfa;
  --ink: #243442;
  --muted: #647583;
  --rule: #c8d9dc;
  --ok: #19733d;
  --ok-bg: #eaf7ef;
  --bad: #a32924;
  --bad-bg: #fff0ee;
  --shadow: 0 12px 32px rgb(20 55 75 / 10%);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: #f2f7f7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; line-height: 1.75; }
a { color: #086d77; text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--coral); }
img { max-width: 100%; height: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: white; color: var(--navy); padding: .7rem 1rem; z-index: 99;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgb(15 43 67 / 96%); color: white;
  border-bottom: 3px solid var(--teal);
}
.header-inner {
  max-width: 1180px; margin: auto; min-height: 64px; padding: .6rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { color: white; font-weight: 800; text-decoration: none; letter-spacing: .03em; }
.brand small { display: block; color: #b9e5e5; font-size: .67rem; font-weight: 600; }
.global-nav { display: flex; flex-wrap: wrap; gap: .35rem .8rem; justify-content: flex-end; }
.global-nav a { color: #eaf8f8; font-size: .87rem; text-decoration: none; white-space: nowrap; }
.global-nav a:hover { color: #ffd485; }

.page-shell { max-width: 1180px; margin: 0 auto; padding: 2.1rem 1.1rem 4rem; }
.content-card {
  background: var(--paper); border: 1px solid #d9e4e5; border-radius: 18px;
  box-shadow: var(--shadow); padding: clamp(1.2rem, 3.5vw, 3rem);
}
.narrow { max-width: 900px; margin-inline: auto; }
.eyebrow { color: var(--teal); font-weight: 800; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.35; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: .25em 0 .6em; }
h2 { margin-top: 2.2em; border-bottom: 2px solid var(--teal); padding-bottom: .25em; }
h3 { margin-top: 1.8em; }
p, li { overflow-wrap: anywhere; }
blockquote { margin: 1.2rem 0; border-left: 4px solid var(--gold); background: #fff8e8; padding: .8rem 1.1rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

.hero {
  color: white; border-radius: 22px; padding: clamp(1.6rem, 5vw, 4rem);
  background: linear-gradient(135deg, var(--navy-2), var(--navy) 58%, #126e77);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after { content: "60"; position: absolute; right: -1rem; bottom: -5rem; font-size: 18rem; font-weight: 900; color: rgb(255 255 255 / 5%); line-height: 1; }
.hero h1 { color: white; max-width: 850px; position: relative; z-index: 1; }
.hero p { max-width: 760px; color: #e1f1f2; position: relative; z-index: 1; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; position: relative; z-index: 1; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 0; border-radius: 999px; padding: .72rem 1.15rem; font-weight: 800;
  text-decoration: none; cursor: pointer; background: var(--teal); color: white;
}
.button:hover { color: white; background: #096c74; }
.button-primary { background: var(--coral); }
.button-primary:hover { background: #c94942; }
.button-secondary { margin-left: .35rem; background: #f4e1ad; color: #674600; }
.button-secondary:hover { background: #e8cb7b; color: #493200; }
.button-light { background: white; color: var(--navy); }
.button-light:hover { background: #e8f5f5; color: var(--navy); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.mini-card { background: white; border: 1px solid var(--rule); border-radius: 13px; padding: 1.05rem; }
.mini-card h3 { margin: 0 0 .35rem; }
.mini-card p { margin: .3rem 0; color: var(--muted); }
.stat { color: var(--teal); font-size: 1.8rem; font-weight: 900; }

.breadcrumb { margin: 0 0 1rem; font-size: .82rem; color: var(--muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; gap: .25rem; }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: .25rem; color: #94a5ad; }

.question-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .8rem; }
.pill { display: inline-block; border-radius: 999px; padding: .2rem .65rem; font-size: .76rem; font-weight: 800; background: var(--teal-light); color: #07646b; }
.pill-format { background: #fff0dc; color: #8a5300; }
.question-body ol { padding-left: 1.5rem; }
.question-body table, .markdown-body table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; margin: 1.2rem 0; }
th, td { border: 1px solid #b9cdd0; padding: .45rem .55rem; vertical-align: top; }
th { color: var(--navy); background: #eff7f7; text-align: left; }

.answer-panel { margin-top: 2rem; padding: 1.25rem; border: 2px solid var(--teal); border-radius: 14px; background: #f8ffff; }
.answer-panel h2 { margin-top: 0; border: 0; font-size: 1.25rem; }
.choice-grid { display: grid; gap: .55rem; margin: 1rem 0; }
.choice-label { display: flex; gap: .65rem; align-items: center; border: 1px solid var(--rule); background: white; border-radius: 9px; padding: .65rem .8rem; cursor: pointer; }
.choice-label:hover { border-color: var(--teal); background: #f2fbfb; }
.choice-label input { width: 1.15rem; height: 1.15rem; accent-color: var(--teal); }
.blank-grid, .declaration-grid { display: grid; gap: .75rem; margin: 1rem 0; }
.blank-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.declaration-grid { grid-template-columns: auto minmax(160px, 1fr) minmax(140px, .7fr); align-items: center; }
label > span { display: block; font-weight: 800; color: var(--navy); margin-bottom: .2rem; }
select, input[type="text"] { width: 100%; padding: .65rem; border: 1px solid #9db7bb; border-radius: 8px; background: white; color: var(--ink); font: inherit; }
select:focus, input:focus { outline: 3px solid rgb(14 131 139 / 20%); border-color: var(--teal); }
.result-message { display: none; margin: 1rem 0 0; border-radius: 9px; padding: .8rem 1rem; font-weight: 800; }
.result-message.is-visible { display: block; }
.result-message.is-correct { color: var(--ok); background: var(--ok-bg); border: 1px solid #9dd0b1; }
.result-message.is-wrong { color: var(--bad); background: var(--bad-bg); border: 1px solid #e5aaa6; }
.form-note { color: var(--muted); font-size: .85rem; }

.question-appendix-callout,
.subject-appendix-callout {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: 1.2rem 0; padding: 1rem; border: 2px solid var(--gold); border-radius: 13px;
  background: #fff9e9;
}
.question-appendix-callout strong,
.subject-appendix-callout strong { display: block; color: var(--navy); }
.question-appendix-callout span,
.subject-appendix-callout span { display: block; color: var(--muted); font-size: .86rem; }
.question-appendix-callout .button,
.subject-appendix-callout .button { flex: 0 0 auto; }

.page-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: .7rem; align-items: stretch; margin-top: 2rem; }
.page-nav a { border: 1px solid var(--rule); background: white; border-radius: 10px; padding: .75rem; text-decoration: none; font-weight: 700; }
.page-nav .next { text-align: right; }
.page-nav .center { text-align: center; }
.answer-history { border-left: 4px solid var(--teal); background: var(--teal-light); padding: .65rem 1rem; margin-bottom: 1.2rem; display: none; }

.question-list { list-style: none; padding: 0; display: grid; gap: .5rem; }
.question-list a { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: .6rem; align-items: center; border: 1px solid var(--rule); background: white; padding: .65rem .8rem; border-radius: 9px; text-decoration: none; }
.question-list a:hover { border-color: var(--teal); background: #f3fbfb; }
.q-number { color: var(--teal); font-weight: 900; }
.q-format { color: var(--muted); font-size: .75rem; }

.download-list { display: grid; gap: .7rem; }
.download-item { display: flex; justify-content: space-between; gap: 1rem; align-items: center; border: 1px solid var(--rule); border-radius: 10px; padding: .8rem; background: white; }
.download-item small { display: block; color: var(--muted); }
.feature-figure { max-width: 680px; margin: 1.5rem auto; background: #f1f9f9; border: 1px solid var(--rule); border-radius: 14px; padding: 1rem; text-align: center; }
.feature-figure img { max-height: 330px; }

.illustration-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem; margin: 1.25rem 0 1.8rem;
}
.illustration-card {
  display: grid; grid-template-rows: 190px auto; overflow: hidden;
  background: #f3f9f9; border: 1px solid var(--rule); border-radius: 14px;
}
.illustration-card > img {
  width: 100%; height: 190px; object-fit: contain; padding: .8rem; background: white;
}
.illustration-card > div { padding: .9rem 1rem 1rem; }
.illustration-card h4 { margin: 0 0 .35rem; font-size: 1rem; }
.illustration-card p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.65; }
.illustration-grid.is-compact .illustration-card {
  grid-template: auto / 92px 1fr; align-items: center;
}
.illustration-grid.is-compact .illustration-card > img {
  width: 92px; height: 92px; padding: .55rem;
}
.illustration-grid.is-compact .illustration-card > div { padding: .75rem .8rem; }
.table-scroll { width: 100%; overflow-x: auto; margin: 1.2rem 0; }
.appendix-table-scroll {
  width: 100%; overflow-x: auto; margin: 1.2rem 0 2rem;
  border: 1px solid var(--rule); border-radius: 8px; background: white;
  overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch;
}
.appendix-scroll-hint { display: none; }
.appendix-page .markdown-body .appendix-table-scroll table {
  display: table; max-width: none; margin: 0; overflow: visible;
  border-collapse: collapse; table-layout: fixed;
}
.appendix-page .appendix-export-table { width: 1280px; }
.appendix-page .appendix-export-table th:nth-child(1),
.appendix-page .appendix-export-table td:nth-child(1) { width: 80px; }
.appendix-page .appendix-export-table th:nth-child(2),
.appendix-page .appendix-export-table td:nth-child(2) { width: 86px; }
.appendix-page .appendix-export-table th:nth-child(3),
.appendix-page .appendix-export-table td:nth-child(3) { width: 58px; }
.appendix-page .appendix-export-table th:nth-child(4),
.appendix-page .appendix-export-table td:nth-child(4) { width: 58px; }
.appendix-page .appendix-export-table th:nth-child(5),
.appendix-page .appendix-export-table td:nth-child(5) { width: 65px; }
.appendix-page .appendix-export-table th:nth-child(6),
.appendix-page .appendix-export-table td:nth-child(6) { width: 310px; }
.appendix-page .appendix-export-table th:nth-child(7),
.appendix-page .appendix-export-table td:nth-child(7) { width: 400px; }
.appendix-page .appendix-export-table th:nth-child(8),
.appendix-page .appendix-export-table td:nth-child(8) { width: 220px; }
.appendix-page .appendix-import-table { width: 1280px; }
.appendix-page .appendix-import-table th:nth-child(1),
.appendix-page .appendix-import-table td:nth-child(1) { width: 80px; }
.appendix-page .appendix-import-table th:nth-child(2),
.appendix-page .appendix-import-table td:nth-child(2) { width: 88px; }
.appendix-page .appendix-import-table th:nth-child(3),
.appendix-page .appendix-import-table td:nth-child(3) { width: 58px; }
.appendix-page .appendix-import-table th:nth-child(4),
.appendix-page .appendix-import-table td:nth-child(4) { width: 320px; }
.appendix-page .appendix-import-table th:nth-child(5),
.appendix-page .appendix-import-table td:nth-child(5) { width: 74px; }
.appendix-page .appendix-import-table th:nth-child(6),
.appendix-page .appendix-import-table td:nth-child(6) { width: 74px; }
.appendix-page .appendix-import-table th:nth-child(7),
.appendix-page .appendix-import-table td:nth-child(7) { width: 125px; }
.appendix-page .appendix-import-table th:nth-child(8),
.appendix-page .appendix-import-table td:nth-child(8) { width: 72px; }
.appendix-page .appendix-import-table th:nth-child(9),
.appendix-page .appendix-import-table td:nth-child(9) { width: 390px; }
.markdown-body .table-scroll .illustrated-table {
  display: table; width: 100%; min-width: 760px; margin: 0; table-layout: fixed;
}
.illustrated-table .illustration-heading,
.illustrated-table .illustration-cell { width: 52px; min-width: 52px; max-width: 52px; }
.illustrated-table .illustration-heading { padding-inline: .2rem; text-align: center; }
.illustrated-table .illustration-cell { padding: .2rem; text-align: center; vertical-align: middle; background: white; }
.illustrated-table .illustration-cell img { display: block; width: 46px; height: 46px; object-fit: contain; margin: auto; }
.table-rules th:nth-child(2), .table-rules td:nth-child(2) { width: 54px; }
.table-rules th:nth-child(3), .table-rules td:nth-child(3) { width: 52%; }
.table-rules th:nth-child(4), .table-rules td:nth-child(4) { width: auto; }
.table-sections th:nth-child(2), .table-sections td:nth-child(2) { width: 38px; }
.table-sections th:nth-child(3), .table-sections td:nth-child(3) { width: 60px; }
.table-sections th:nth-child(4), .table-sections td:nth-child(4) { width: 51%; }
.table-food th:nth-child(2), .table-food td:nth-child(2),
.table-textile th:nth-child(2), .table-textile td:nth-child(2),
.table-chemical th:nth-child(2), .table-chemical td:nth-child(2),
.table-machine th:nth-child(2), .table-machine td:nth-child(2) { width: 27%; }
.table-food th:nth-child(3), .table-food td:nth-child(3),
.table-textile th:nth-child(3), .table-textile td:nth-child(3),
.table-chemical th:nth-child(3), .table-chemical td:nth-child(3),
.table-machine th:nth-child(3), .table-machine td:nth-child(3) { width: 52px; }
.table-highlights-digital th:nth-child(2), .table-highlights-digital td:nth-child(2),
.table-highlights-resources th:nth-child(2), .table-highlights-resources td:nth-child(2),
.table-highlights-food th:nth-child(2), .table-highlights-food td:nth-child(2) { width: 22%; }
.table-highlights-digital th:nth-child(3), .table-highlights-digital td:nth-child(3),
.table-highlights-resources th:nth-child(3), .table-highlights-resources td:nth-child(3),
.table-highlights-food th:nth-child(3), .table-highlights-food td:nth-child(3) { width: 21%; }
.cheatsheet-illustrated > h3 { scroll-margin-top: 82px; }

.site-ad { max-width: 1180px; min-height: 90px; margin: 1.5rem auto 0; padding: 0 1.1rem; }
.site-ad .adsbygoogle { min-height: 90px; }

.site-footer { background: var(--navy-2); color: #dbe9ec; padding: 2.5rem 1.1rem; }
.footer-inner { max-width: 1180px; margin: auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1.5rem; }
.site-footer a { color: #b9e5e5; }
.site-footer h2 { color: white; border: 0; margin: 0 0 .5rem; font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.copyright { max-width: 1180px; margin: 1.5rem auto 0; border-top: 1px solid #31536a; padding-top: 1rem; font-size: .75rem; color: #9eb1bc; }

@media (max-width: 760px) {
  .header-inner { align-items: flex-start; flex-direction: column; }
  .global-nav { justify-content: flex-start; }
  .page-shell { padding-top: 1.1rem; }
  .content-card { border-radius: 12px; padding: 1rem; }
  .page-nav { grid-template-columns: 1fr 1fr; }
  .page-nav .center { grid-column: 1 / -1; grid-row: 2; }
  .declaration-grid { grid-template-columns: 1fr; border-bottom: 1px solid var(--rule); padding-bottom: .8rem; }
  .question-list a { grid-template-columns: 4rem 1fr; }
  .q-format { grid-column: 2; }
  .footer-inner { grid-template-columns: 1fr; }
  .download-item { align-items: flex-start; flex-direction: column; }
  .button-secondary { margin: .45rem 0 0; }
  .question-appendix-callout,
  .subject-appendix-callout { align-items: stretch; flex-direction: column; }
  .question-appendix-callout .button,
  .subject-appendix-callout .button { width: 100%; }
  .appendix-scroll-hint {
    display: block; position: sticky; left: 0; width: max-content;
    margin: 0; padding: .35rem .65rem; color: #5b6e78; background: #edf6f6;
    font-size: .72rem; font-weight: 800;
  }
  .illustration-grid { grid-template-columns: 1fr; }
  .illustration-card { grid-template-rows: 160px auto; }
  .illustration-card > img { height: 160px; }
  .table-scroll { overflow: visible; }
  .markdown-body .table-scroll .illustrated-table { display: block; min-width: 0; table-layout: auto; }
  .illustrated-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .illustrated-table tbody { display: grid; gap: .8rem; }
  .illustrated-table tr {
    display: grid; grid-template-columns: 62px minmax(0, 1fr);
    overflow: hidden; border: 1px solid var(--rule); border-radius: 11px; background: white;
  }
  .illustrated-table td,
  .illustrated-table th { width: auto !important; min-width: 0 !important; max-width: none !important; }
  .illustrated-table td {
    display: block; grid-column: 2; border: 0; border-bottom: 1px solid #dce7e8;
    padding: .55rem .65rem; overflow-wrap: anywhere;
  }
  .illustrated-table td:last-child { border-bottom: 0; }
  .illustrated-table td::before {
    content: attr(data-label); display: block; margin-bottom: .12rem;
    color: var(--teal); font-size: .7rem; font-weight: 900; letter-spacing: .04em;
  }
  .illustrated-table .illustration-cell {
    grid-column: 1; grid-row: 1 / span 8; display: flex; align-items: flex-start;
    justify-content: center; width: 62px !important; padding: .65rem .35rem;
    border: 0; border-right: 1px solid #dce7e8; background: #f4fafa;
  }
  .illustrated-table .illustration-cell::before { display: none; }
  .illustrated-table .illustration-cell img { width: 52px; height: 52px; }
}

@media print {
  .site-header, .site-footer, .page-nav, .answer-panel { display: none; }
  body, :root { background: white; }
  .page-shell { max-width: none; padding: 0; }
  .content-card { box-shadow: none; border: 0; padding: 0; }
}
