:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1d2126;
  --muted: #5d6670;
  --border: #dfe2e6;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --ok: #1a7f37;
  --ok-bg: #e6f4ea;
  --ng: #c62828;
  --ng-bg: #fdecea;
  --biz: #2e7d32;
  --tech: #1565c0;
  --sec: #e65100;
  --ad: #eef0f3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --surface: #1c2024;
    --text: #e6e8ea;
    --muted: #9aa3ad;
    --border: #2e343a;
    --accent: #4c8dff;
    --accent-text: #0b0d0f;
    --ok: #57c472;
    --ok-bg: #16301f;
    --ng: #ff7a7a;
    --ng-bg: #3a1d1d;
    --biz: #66bb6a;
    --tech: #64b5f6;
    --sec: #ffab40;
    --ad: #22272c;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  line-height: 1.75;
  font-size: 16px;
}
a { color: var(--accent); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: 1.4rem; line-height: 1.4; margin: 0.4em 0 0.6em; }
h2 { font-size: 1.15rem; margin: 1.4em 0 0.5em; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; flex-wrap: wrap; }
.logo { font-weight: 700; color: var(--text); text-decoration: none; }
.site-header nav { display: flex; gap: 14px; font-size: 0.92rem; }
.site-header nav a { text-decoration: none; }
.site-footer { margin-top: 48px; padding: 24px 0 40px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; }

.crumbs { font-size: 0.85rem; color: var(--muted); margin: 16px 0 4px; }
.crumbs a { color: var(--muted); }
.lead { color: var(--muted); }

.badge { display: inline-block; font-size: 0.72rem; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; line-height: 1.6; vertical-align: 1px; white-space: nowrap; }
.badge-ipa { color: var(--tech); }
.badge-original { color: var(--muted); }
.badge-new { color: var(--sec); }

.btn { display: inline-block; padding: 10px 18px; border-radius: 8px; text-decoration: none; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 0.95rem; }
.btn-main { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* question */
.q-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.85rem; color: var(--muted); margin: 12px 0 0; }
.q-count { margin-left: auto; }
.stem { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px 18px; }
.stem-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; margin: 12px 0; }
.stem-list dt { font-weight: 700; }
.stem-list dd { margin: 0; }
.note { font-size: 0.9rem; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.code { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-size: 0.85rem; line-height: 1.6; }
.code code { font-family: ui-monospace, "Cascadia Mono", Consolas, "BIZ UDGothic", monospace; white-space: pre; }
.caption { font-weight: 700; margin: 16px 0 0; font-size: 0.92rem; }
table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 0.92rem; }
th, td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--bg); white-space: nowrap; }

.choices { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.choices-grid { grid-template-columns: 1fr 1fr; }
.choice { width: 100%; display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice:disabled { cursor: default; }
.choice-label { font-weight: 700; min-width: 1.4em; }
.choice.is-correct { border-color: var(--ok); background: var(--ok-bg); }
.choice.is-wrong { border-color: var(--ng); background: var(--ng-bg); }
.reveal-row { text-align: center; }
.reveal { background: none; border: none; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.9rem; }

.result { border-top: 2px solid var(--border); margin-top: 8px; padding-top: 4px; }
.verdict { font-size: 1.3rem; font-weight: 700; margin: 12px 0 0; }
.verdict.ok { color: var(--ok); }
.verdict.ng { color: var(--ng); }
.answer-line { margin: 4px 0; }
.choice-notes { list-style: none; padding: 0; }
.choice-notes li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.choice-notes li b { margin-right: 8px; }
.choice-notes li.is-answer b { color: var(--ok); }
.source { font-size: 0.82rem; color: var(--muted); margin-top: 20px; }
.source a { color: var(--muted); }
.q-nav { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0; }

/* lists */
.q-list { list-style: none; padding: 0; }
.q-list li { border-bottom: 1px solid var(--border); }
.q-list a { display: flex; gap: 8px; align-items: baseline; padding: 12px 4px; color: var(--text); text-decoration: none; }
.q-list a:hover { background: var(--surface); }
.status { width: 1.2em; flex: none; }
.q-list-body { flex: 1; min-width: 0; }
.q-list-head { display: block; font-weight: 600; font-size: 0.9rem; }
.q-list-text { display: block; color: var(--muted); font-size: 0.92rem; }
.q-list li.was-ok .status::before { content: "○"; color: var(--ok); }
.q-list li.was-ng .status::before { content: "×"; color: var(--ng); }
.legacy { font-size: 0.9rem; color: var(--muted); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.progress { margin: 12px 0; color: var(--muted); font-size: 0.9rem; }
.progress:empty { display: none; }

.field h2 { border-left: 4px solid var(--muted); padding-left: 10px; }
.field-business h2 { border-color: var(--biz); }
.field-technology h2 { border-color: var(--tech); }
.field-security h2 { border-color: var(--sec); }
.cat-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.cat-list li + li { border-top: 1px solid var(--border); }
.cat-list a, .cat-list li > span { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--text); text-decoration: none; }
.cat-list a:hover { background: var(--bg); }
.cat-list .is-empty { color: var(--muted); }
.cat-no { display: inline-block; min-width: 2em; color: var(--muted); font-size: 0.85rem; }
.cat-count { margin-left: auto; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

/* home */
.hero { padding: 24px 0 8px; }
.hero h1 { font-size: 1.6rem; }
.exam-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.exam-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px 18px; color: var(--text); text-decoration: none; }
.exam-card:hover { border-color: var(--accent); }
.exam-card h2 { margin-top: 14px; color: var(--accent); }
.exam-card-meta { font-size: 0.85rem; color: var(--muted); }

/* ad slots: invisible until an ad tag is placed; outlined in preview builds */
.ad-slot { margin: 24px 0; }
.show-ad-placeholders .ad-slot { min-height: 100px; background: var(--ad); border: 1px dashed var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.8rem; }
.show-ad-placeholders .ad-slot::after { content: "広告枠（" attr(data-ad-slot) "）"; }

@media (max-width: 480px) {
  h1 { font-size: 1.25rem; }
  .choices-grid { grid-template-columns: 1fr; }
  .stem { padding: 2px 14px; }
}
