/* ITパスポートの解説サイト（/learn/…）。scripts/build-learn.mjs が講義データから作るページの見た目。
   立ち位置はふつうの解説サイト（アプリの画面には寄せない）。色・字・動きは紹介ページ（lp.css）と同じ流れ。
   いちばん大事なのは読みやすさ：本文は17px・行間2、動きは「見るところを案内する」ためだけに使う。 */

:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --ink: #12201c;
  --ink-soft: #56675f;
  --line: #e1e8e4;
  --accent: #10b981;
  --accent-ink: #047857;
  --accent-tint: #ddf4e9;
  --on-accent: #ffffff;
  --warn: #ea580c;
  --warn-tint: #fdebdd;
  /* プラスアルファ（これも覚えよう）の囲み */
  --plus-ink: #0369a1;
  --plus-tint: #eef7fc;
  --plus-line: #9fd0ec;
  --glow-1: rgba(16, 185, 129, 0.22);
  --glow-2: rgba(56, 189, 248, 0.16);
  --shadow: 0 1px 2px rgba(18, 32, 28, 0.05), 0 18px 40px -22px rgba(18, 32, 28, 0.22);
  /* 図の色 */
  --fig-box: #ffffff;
  --fig-line: #9fb1aa;
  --fig-acc-box: #ddf4e9;
  /* 色つきの箱の、透けない版（流れる点を箱の後ろに隠す図で使う。暗い表示では --fig-acc-box を図の地の上に重ねた色） */
  --fig-acc-solid: #ddf4e9;
  --fig-panel: #f6f8f7;
  --font-display: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif;
  --font-body: "Noto Sans JP", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-num: "Outfit", "Noto Sans JP", sans-serif;
  --head-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1513;
    --surface: #151f1c;
    --ink: #e3ece8;
    --ink-soft: #9aaca5;
    --line: #25322e;
    --accent: #34d399;
    --accent-ink: #6ee7b7;
    --accent-tint: rgba(52, 211, 153, 0.14);
    --on-accent: #04221a;
    --warn: #fb923c;
    --warn-tint: rgba(251, 146, 60, 0.15);
    --plus-ink: #7dd3fc;
    --plus-tint: rgba(56, 189, 248, 0.08);
    --plus-line: rgba(125, 211, 252, 0.4);
    --glow-1: rgba(52, 211, 153, 0.16);
    --glow-2: rgba(56, 189, 248, 0.1);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -20px rgba(0, 0, 0, 0.7);
    --fig-box: #1b2723;
    --fig-line: #5d7069;
    --fig-acc-box: rgba(52, 211, 153, 0.16);
    --fig-acc-solid: #1a3c30;
    --fig-panel: #111a17;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1513;
  --surface: #151f1c;
  --ink: #e3ece8;
  --ink-soft: #9aaca5;
  --line: #25322e;
  --accent: #34d399;
  --accent-ink: #6ee7b7;
  --accent-tint: rgba(52, 211, 153, 0.14);
  --on-accent: #04221a;
  --warn: #fb923c;
  --warn-tint: rgba(251, 146, 60, 0.15);
  --plus-ink: #7dd3fc;
  --plus-tint: rgba(56, 189, 248, 0.08);
  --plus-line: rgba(125, 211, 252, 0.4);
  --glow-1: rgba(52, 211, 153, 0.16);
  --glow-2: rgba(56, 189, 248, 0.1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -20px rgba(0, 0, 0, 0.7);
  --fig-box: #1b2723;
  --fig-line: #5d7069;
  --fig-acc-box: rgba(52, 211, 153, 0.16);
  --fig-acc-solid: #1a3c30;
  --fig-panel: #111a17;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--head-h) + 20px);
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-wrap: balance;
  /* 日本語を文節で折り返す（語の途中で切らない） */
  word-break: auto-phrase;
  /* 1つの文節が画面より長いとき（「情報流通プラットフォーム対処法」など）だけは途中で折る */
  overflow-wrap: anywhere;
  margin: 0;
}
p {
  margin: 0;
}
a {
  color: var(--accent-ink);
}
button {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 100;
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 999px;
}
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

/* ---------- 上の帯・読んだところまでの線 ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--head-h);
  transition: background-color 0.3s, box-shadow 0.3s;
}
.site-head.scrolled {
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.site-head-inner {
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-name {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
  min-width: 0;
}
.wordmark {
  display: block;
  flex: none;
  height: 20px;
  aspect-ratio: 515 / 137;
  background-color: currentColor;
  -webkit-mask: url("/masudy-wordmark.svg") center / contain no-repeat;
  mask: url("/masudy-wordmark.svg") center / contain no-repeat;
}
.site-sub {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  border-left: 1px solid var(--line);
  padding-left: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--accent-ink);
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}
.app-btn:hover {
  background: var(--accent-ink);
  color: var(--on-accent);
}
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 60;
  pointer-events: none;
}
.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #38bdf8);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- ヒーロー（記事・単元・トップの見出しの帯） ---------- */
.hero {
  position: relative;
  margin-top: calc(var(--head-h) * -1);
  padding: calc(var(--head-h) + 28px) 0 56px;
  overflow: hidden;
  isolation: isolate;
}
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.hero-glow i {
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  filter: blur(70px);
  background: radial-gradient(circle, var(--glow-1), transparent 66%);
  top: -260px;
  right: -140px;
  animation: drift 18s ease-in-out infinite alternate;
}
.hero-glow i:nth-child(2) {
  background: radial-gradient(circle, var(--glow-2), transparent 66%);
  top: -120px;
  left: -260px;
  animation-duration: 22s;
}
.hero-glow i:nth-child(3) {
  top: 180px;
  right: 30%;
  width: 380px;
  height: 380px;
  animation-duration: 26s;
}
@keyframes drift {
  to {
    transform: translate(-60px, 50px) scale(1.08);
  }
}
.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  font-size: 12px;
  color: var(--ink-soft);
}
.crumbs a {
  color: inherit;
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--accent-ink);
}
.crumbs span[aria-hidden] {
  opacity: 0.45;
}
.hero-eyebrow {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 13px;
  font-weight: 700;
}
.hero-eyebrow a,
.hero-eyebrow > span:first-child {
  color: var(--accent-ink);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.hero-eyebrow a::before,
.hero-eyebrow > span:first-child::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  margin-right: 8px;
  vertical-align: middle;
  background: var(--accent);
}
.hero-eyebrow .num {
  color: var(--ink-soft);
  font-size: 13px;
}
.hero h1 {
  margin-top: 12px;
  font-size: clamp(26px, 6.2vw, 42px);
  line-height: 1.38;
  max-width: 24em;
}
.hero-meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  font-size: 13px;
  color: var(--ink-soft);
}
.keywords {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 760px;
}
.keywords li {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
/* 見出しまわりは読み込んだときにふわっと出す */
.js .hero-inner > * {
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.js .hero-inner > *:nth-child(2) {
  animation-delay: 0.06s;
}
.js .hero-inner > *:nth-child(3) {
  animation-delay: 0.12s;
}
.js .hero-inner > *:nth-child(4) {
  animation-delay: 0.18s;
}
.js .hero-inner > *:nth-child(5) {
  animation-delay: 0.24s;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* ---------- 本文と右の目次 ---------- */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 72px;
  display: grid;
  gap: 40px;
}
@media (min-width: 1100px) {
  .page {
    grid-template-columns: minmax(0, 740px) 260px;
    justify-content: space-between;
    padding: 0 28px 96px;
  }
}
.page-narrow {
  max-width: 820px;
  display: block;
}
.page-wide {
  display: block;
}
.article {
  min-width: 0;
}
.rail {
  display: none;
}
@media (min-width: 1100px) {
  .rail {
    display: block;
  }
  .rail .contents {
    position: sticky;
    top: calc(var(--head-h) + 24px);
    margin-top: 0;
    /* 小見出しまで並ぶと画面より長くなるので、目次の中だけでスクロールする */
    max-height: calc(100vh - var(--head-h) - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .article > .contents {
    display: none;
  }
}

/* スクロールで出てくる（JavaScript があるときだけ隠しておく） */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- 本文 ---------- */
.prose {
  font-size: 17px;
  line-height: 2;
  overflow-wrap: anywhere;
}
.prose > * + * {
  margin-top: 1.25em;
}
.prose.lead {
  margin-top: 32px;
  font-size: 17.5px;
}
.prose strong {
  font-weight: 700;
  background: linear-gradient(transparent 64%, color-mix(in srgb, var(--accent) 30%, transparent) 64%);
}
.prose ul,
.prose ol {
  padding-left: 1.4em;
}
.prose li + li {
  margin-top: 0.45em;
}
.prose li::marker {
  color: var(--accent);
  font-weight: 700;
}
.prose pre {
  margin-left: 0;
  margin-right: 0;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  overflow-x: auto;
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.9;
}
.prose pre code {
  font-family: inherit;
  background: none;
  padding: 0;
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--accent-tint);
  padding: 0.1em 0.4em;
  border-radius: 5px;
}
.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.75;
}
.prose th,
.prose td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.prose tr:last-child td {
  border-bottom: 0;
}
.prose th {
  background: var(--accent-tint);
  font-weight: 700;
  white-space: nowrap;
}
.prose td:first-child {
  font-weight: 700;
  white-space: nowrap;
}

/* 講義の画像（押すと大きく見られる） */
.pic {
  margin: 0;
}
.pic img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: zoom-in;
}
.pic figcaption,
.fig figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- 節の見出し ---------- */
.sec {
  margin-top: 64px;
}
.sec h2 {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.sec-no {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
}
.sec-head {
  display: grid;
  gap: 2px;
}
.sec-kicker {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-ink);
  letter-spacing: 0.02em;
}
.sec-title {
  font-size: clamp(21px, 4.6vw, 25px);
  line-height: 1.4;
}
.sec > .fig {
  margin-top: 28px;
}

/* ---------- 目次 ---------- */
.contents {
  margin-top: 32px;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.contents-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}
.contents-title::-webkit-details-marker {
  display: none;
}
/* 折りたたみの案内（開いているときは「閉じる」、閉じているときは「開く」） */
.contents-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.contents-toggle::before {
  content: "開く";
}
.contents details[open] .contents-toggle::before {
  content: "閉じる";
}
.contents-toggle::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
}
.contents details[open] .contents-toggle::after {
  transform: rotate(-135deg) translateY(-1px);
}
.contents ol {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.contents a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 6px;
  padding: 7px 8px;
  margin: 0 -8px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14.5px;
  line-height: 1.6;
  transition: background-color 0.2s, color 0.2s;
}
.contents a:hover {
  background: var(--bg);
}
.contents .num {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  padding-top: 1px;
}
/* 目次の小見出し（h3）：節の下に、番号なしで少し小さく */
.contents .contents-sub {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
}
.contents-sub a {
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.rail .contents {
  background: transparent;
  border: 0;
  padding: 0;
}
.rail .contents a {
  font-size: 13.5px;
  color: var(--ink-soft);
}
.rail .contents-sub a {
  font-size: 12.5px;
}
.rail .contents a.on {
  background: var(--accent-tint);
  color: var(--ink);
  font-weight: 700;
}

/* ---------- 図 ---------- */
.fig {
  margin: 0;
}
.fig-art {
  padding: 18px 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.fig svg {
  display: block;
  width: 100%;
  height: auto;
}
/* スマホでは図を画面の幅に収め、押すと大きく見られる（learn.js） */
@media (max-width: 699px) {
  .fig-art {
    padding: 12px 10px;
    cursor: zoom-in;
  }
  .fig figcaption::after {
    content: "（図を押すと大きく見られます）";
    display: block;
    font-size: 11.5px;
    opacity: 0.8;
  }
}
@media (min-width: 640px) {
  .fig-art {
    padding: 22px 24px;
  }
}
.fg {
  font-family: var(--font-body);
}
/* 幅560の図（scripts/learn/figkit.mjs）は、PCで大きくなりすぎないようにする */
.fig svg.fg-narrow {
  max-width: 600px;
  margin: 0 auto;
}
.fg-t {
  fill: var(--ink);
}
.fg-sub {
  fill: var(--ink-soft);
}
.fg-acc-t {
  fill: var(--accent-ink);
}
.fg-warn-t {
  fill: var(--warn);
}
.fg-on-hot {
  fill: var(--on-accent);
}
.fg-box {
  fill: var(--fig-box);
  stroke: var(--fig-line);
  stroke-width: 1.5;
}
.fg-box-acc {
  fill: var(--fig-acc-solid);
  stroke: var(--accent);
  stroke-width: 2;
}
.fg-box-out {
  fill: var(--fig-panel);
  stroke: var(--fig-line);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}
.fg-group {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
}
.fg-scope {
  fill: color-mix(in srgb, var(--accent) 7%, transparent);
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 8 6;
}
.fg-panel {
  fill: var(--fig-panel);
  stroke: var(--line);
}
.fg-line {
  stroke: var(--fig-line);
  stroke-width: 1.8;
  fill: none;
}
.fg-line-acc {
  stroke: var(--accent);
  stroke-width: 2.4;
  fill: none;
}
.fg-head {
  fill: var(--fig-line);
}
.fg-head-acc {
  fill: var(--accent);
}
.fg-node {
  fill: var(--fig-box);
  stroke: var(--ink);
  stroke-width: 1.8;
}
.fg-crit {
  stroke: color-mix(in srgb, var(--accent) 32%, transparent);
  stroke-width: 16;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fg-divider {
  stroke: var(--line);
  stroke-width: 1.5;
}
.fg-bar {
  fill: var(--accent);
}
.fg-bar-soft {
  fill: color-mix(in srgb, var(--accent) 45%, transparent);
}
.fg-bar-warn {
  fill: var(--warn);
}
.fg-bar-mid {
  fill: color-mix(in srgb, var(--accent) 70%, transparent);
}
.fg-track {
  fill: var(--fig-panel);
  stroke: var(--line);
}
.fg-limit-strong {
  stroke: var(--accent-ink);
  stroke-width: 2.5;
  stroke-dasharray: 5 4;
}
.fg-limit {
  stroke: var(--ink-soft);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}
.fg-today {
  stroke: var(--warn);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}
.fg-person {
  fill: var(--fig-box);
  stroke: var(--fig-line);
  stroke-width: 1.5;
}
.fg-person-acc {
  fill: var(--accent);
  stroke: var(--accent);
}
.fg-person-mark {
  fill: var(--fig-line);
}
.fg-person-acc + .fg-person-mark,
.fg-person-acc ~ .fg-person-mark {
  fill: var(--on-accent);
}
.fg-icon {
  fill: var(--accent-tint);
}
.fg-icon-t {
  fill: var(--accent-ink);
}
.fg-icon-fill {
  fill: var(--accent-ink);
}
.fg-icon-line {
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fg-cell {
  fill: var(--fig-panel);
  stroke: var(--line);
}
.fg-cell-mid {
  fill: color-mix(in srgb, var(--accent) 22%, transparent);
}
.fg-cell-hot {
  fill: var(--accent);
}
/* 機器の絵・繰り返す動きの部品（scripts/learn/figkit.mjs） */
.fg-dev {
  fill: var(--fig-box);
  stroke: var(--ink-soft);
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.fg-dev-acc {
  fill: var(--fig-acc-solid);
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linejoin: round;
}
.fg-dev-warn {
  fill: var(--warn-tint);
  stroke: var(--warn);
  stroke-width: 2;
}
.fg-screen {
  fill: var(--fig-panel);
  stroke: var(--fig-line);
}
.fg-dev-line {
  stroke: var(--fig-line);
  stroke-width: 1.5;
}
.fg-dev-dot {
  fill: var(--accent);
}
.fg-cloud {
  fill: var(--fig-panel);
  stroke: var(--fig-line);
  stroke-width: 1.8;
}
.fg-x {
  fill: var(--warn);
}
.fg-x-mark,
.fg-ok-mark {
  fill: none;
  stroke: var(--on-accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fg-ok {
  fill: var(--accent);
}
.fg-pill {
  fill: var(--accent);
}
.fg-pill-out {
  fill: var(--fig-box);
  stroke: var(--accent);
  stroke-width: 2;
}
.fg-pill-warn {
  fill: var(--warn);
}
.fg-pk {
  fill: var(--accent);
  stroke: var(--fig-box);
  stroke-width: 2;
}
.fg-pk-warn {
  fill: var(--warn);
  stroke: var(--fig-box);
  stroke-width: 2;
}
.fg-glow {
  fill: color-mix(in srgb, var(--accent) 14%, transparent);
  stroke: var(--accent);
  stroke-width: 2.5;
}
.fg-glow-warn {
  fill: color-mix(in srgb, var(--warn) 16%, transparent);
  stroke: var(--warn);
  stroke-width: 2.5;
}
.fg-dim {
  fill: color-mix(in srgb, var(--surface) 70%, transparent);
}
.fg-slot {
  fill: var(--fig-box);
  stroke: var(--fig-line);
  stroke-width: 1.5;
}
.fg-slot-move {
  fill: var(--fig-acc-solid);
  stroke: var(--accent);
  stroke-width: 2;
}
/* ブラックボックスは暗い表示でも黒い箱のまま（縁で地と分ける） */
.fg-black {
  fill: #12201c;
  stroke: var(--ink-soft);
  stroke-width: 1.5;
}
.fg-on-dark {
  fill: #ffffff;
}
.fg-playhead {
  stroke: var(--warn);
  stroke-width: 2.5;
}
.fg-playhead-head {
  fill: var(--warn);
}
.fg-halo {
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 6px;
  stroke-linejoin: round;
}
/* 図の動き：画面に入ると（.in）、部品が --d の順に出てくる */
.js .fig .a-pop,
.js .fig .a-fade {
  opacity: 0;
  transition: opacity 0.5s ease var(--d, 0s), transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s);
}
.js .fig .a-pop {
  transform: translateY(10px);
}
.js .fig.in .a-pop,
.js .fig.in .a-fade {
  opacity: 1;
  transform: none;
}
.js .fig .a-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.4, 0, 0.2, 1) var(--d, 0s);
}
.js .fig.in .a-draw {
  stroke-dashoffset: 0;
}
.js .fig .a-grow {
  transform: scaleX(0);
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s);
}
.js .fig.in .a-grow {
  transform: none;
}

/* ---------- 過去問で確かめよう ---------- */
.quiz {
  margin-top: 72px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.quiz-top {
  position: relative;
  padding: 22px 22px 20px;
  background: linear-gradient(135deg, var(--accent-ink), color-mix(in srgb, var(--accent-ink) 70%, #0ea5e9));
  color: #fff;
}
:root[data-theme="dark"] .quiz-top {
  color: var(--on-accent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .quiz-top {
    color: var(--on-accent);
  }
}
.quiz-label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.92;
}
.quiz-label .num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: 13px;
}
.quiz-top h2,
.quiz-top h3 {
  margin-top: 6px;
  font-size: 22px;
}
/* 狭い幅では（令和8年度 問39）の途中で折り返さない */
.quiz-top h2 .nowrap,
.quiz-top h3 .nowrap {
  white-space: nowrap;
}
.quiz-hint {
  margin-top: 2px;
  font-size: 13px;
  opacity: 0.85;
}
.quiz-body {
  padding: 22px;
}
.question-text {
  font-size: 16px;
  line-height: 1.95;
}
.question-text > * + * {
  margin-top: 1em;
}
.question-text img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: zoom-in;
}
.question-text .hang {
  display: flex;
  align-items: baseline;
}
.question-text .hang-mark {
  flex: none;
  white-space: pre;
}
.question-text .hang-body {
  min-width: 0;
  flex: 1;
}
.question-text .mock-blank {
  display: inline-block;
  min-width: 2em;
  padding: 0 0.4em;
  border: 1px solid currentColor;
  text-align: center;
  line-height: 1.5;
}
.question-text .mock-underline {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.question-text table {
  border-collapse: collapse;
}
.question-text th,
.question-text td {
  border: 1px solid var(--line);
  padding: 4px 12px;
}
.question-text table.ans-table th,
.question-text table.ans-center th,
.question-text table.ans-center td {
  text-align: center;
}
.choices {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.choice {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  text-align: left;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 15.5px;
  line-height: 1.7;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}
/* 選択肢が問題文の表や図の中にある問題：記号だけのボタンを横に4つ並べる */
.choices-marks {
  grid-template-columns: repeat(4, 1fr);
}
.choices-marks .choice {
  grid-template-columns: 1fr;
  justify-items: center;
}
.choice:hover {
  border-color: var(--accent);
  transform: translateX(3px);
}
.choice .mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--line);
  font-weight: 700;
  color: var(--accent-ink);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.answered .choice {
  cursor: default;
  transform: none;
}
.answered .choice:not(.is-correct):not(.is-wrong) {
  opacity: 0.55;
}
.choice.is-correct {
  border-color: var(--accent);
  background: var(--accent-tint);
  animation: pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
.choice.is-correct .mark {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.choice.is-wrong {
  border-color: var(--warn);
  background: var(--warn-tint);
  animation: shake 0.4s;
}
.choice.is-wrong .mark {
  background: var(--warn);
  border-color: var(--warn);
  color: #fff;
}
@keyframes pop {
  50% {
    transform: scale(1.025);
  }
}
@keyframes shake {
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}
.verdict {
  margin-top: 16px;
  font-weight: 700;
  font-size: 16px;
}
.verdict:empty {
  display: none;
}
.verdict.ok {
  color: var(--accent-ink);
}
.verdict.ng {
  color: var(--warn);
}
.answer {
  margin-top: 16px;
}
.answer summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
}
.answer summary::-webkit-details-marker {
  display: none;
}
.answer summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
}
.answer[open] summary::after {
  transform: rotate(-135deg) translateY(-1px);
}
.answer-body {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: 15.5px;
  line-height: 1.95;
}
.answer[open] .answer-body {
  animation: rise 0.4s ease both;
}
.answer-body > * + * {
  margin-top: 1em;
}
.answer-body ul {
  padding-left: 1.3em;
}
.answer-body img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: zoom-in;
}
.answer-body strong {
  font-weight: 700;
  color: var(--accent-ink);
}
.answer-key {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-soft);
}
.answer-key b {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 17px;
}
.source-note {
  padding: 0 22px 18px;
  font-size: 12px;
  color: var(--ink-soft);
}
@media (min-width: 640px) {
  .quiz-top,
  .quiz-body {
    padding-left: 30px;
    padding-right: 30px;
  }
  .source-note {
    padding: 0 30px 22px;
  }
}

/* ---------- 前後の記事・この単元の記事 ---------- */
.pager {
  margin-top: 48px;
  display: grid;
  gap: 12px;
}
@media (min-width: 640px) {
  .pager {
    grid-template-columns: 1fr 1fr;
  }
}
.pager a {
  display: block;
  padding: 16px 20px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.pager a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.pager small {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-ink);
}
.pager b {
  display: block;
  margin-top: 2px;
  font-size: 15.5px;
  line-height: 1.6;
}
.pager .next {
  text-align: right;
}
.series {
  margin-top: 48px;
  padding: 24px 22px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.series-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-ink);
}
.series h2 {
  font-size: 19px;
  margin-top: 2px;
}
.series ol {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  counter-reset: none;
}
.series a {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 9px 10px;
  margin: 0 -10px;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14.5px;
  line-height: 1.6;
  transition: background-color 0.2s;
}
.series a:hover {
  background: var(--bg);
}
.series .num {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}
.series a[aria-current="page"] {
  background: var(--accent-tint);
  font-weight: 700;
}
.series a[aria-current="page"] .num {
  color: var(--accent-ink);
}

/* ---------- 単元のトップ ---------- */
.hero-split {
  display: grid;
  gap: 28px;
  align-items: center;
}
@media (min-width: 900px) {
  .hero-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 48px;
  }
}
.fig-unit .fig-art {
  box-shadow: var(--shadow);
}
.chapters {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  position: relative;
}
.chapters::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 30px;
  bottom: 30px;
  width: 2px;
  background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 15%, transparent));
}
.chapter a {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  color: var(--ink);
  text-decoration: none;
}
.chapter-no {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  font-size: 19px;
  font-weight: 800;
  color: var(--accent-ink);
  transition: background-color 0.2s, color 0.2s;
}
.chapter a:hover .chapter-no {
  background: var(--accent);
  color: var(--on-accent);
}
.chapter-body {
  display: grid;
  gap: 4px;
  padding: 16px 20px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.2s;
}
.chapter a:hover .chapter-body {
  border-color: var(--accent);
  transform: translateX(4px);
}
.chapter-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17.5px;
  line-height: 1.5;
  word-break: auto-phrase;
  /* 「ソーシャルエンジニアリングとは？」のような長い語がスマホの幅に収まらないときだけ、語の途中で折る */
  overflow-wrap: anywhere;
}
.chapter-excerpt {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-soft);
}
.chapter-terms {
  font-size: 12px;
  line-height: 1.7;
  color: var(--accent-ink);
}
.start {
  margin-top: 28px;
  padding-left: 72px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  background: var(--accent-ink);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 90%, transparent);
  transition: transform 0.2s;
}
.btn:hover {
  transform: translateY(-2px);
}

/* ---------- 講座のトップ ---------- */
.hero-top {
  padding-bottom: 40px;
}
.hero-top h1 {
  font-size: clamp(40px, 11vw, 76px);
  line-height: 1.12;
  letter-spacing: 0.02em;
  margin-top: 14px;
}
.hero-stats {
  margin-top: 22px;
  display: flex;
  gap: 24px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}
.hero-stats b {
  font-size: 40px;
  font-weight: 800;
  color: var(--ink);
  margin-right: 4px;
  line-height: 1;
}
.orbit {
  position: relative;
  height: 300px;
}
.orb {
  position: absolute;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 2px;
  border-radius: 50%;
  text-decoration: none;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: float 7s ease-in-out infinite alternate;
}
.orb-en {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.orb-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
}
.orb-count {
  font-size: 12px;
  color: var(--ink-soft);
}
.orb-count b {
  font-size: 16px;
  color: var(--ink);
  margin-right: 2px;
}
.orb-strategy {
  width: 170px;
  height: 170px;
  left: 4%;
  top: 70px;
}
.orb-management {
  width: 140px;
  height: 140px;
  left: 42%;
  top: 0;
  animation-delay: -2.5s;
}
.orb-technology {
  width: 190px;
  height: 190px;
  right: 2%;
  top: 100px;
  animation-delay: -4.5s;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}
@keyframes float {
  to {
    transform: translateY(-14px);
  }
}
@media (max-width: 899px) {
  .orbit {
    height: 230px;
  }
  .orb-strategy {
    width: 128px;
    height: 128px;
    top: 64px;
    left: 0;
  }
  .orb-management {
    width: 112px;
    height: 112px;
    left: 36%;
  }
  .orb-technology {
    width: 140px;
    height: 140px;
    top: 84px;
    right: 0;
  }
  .orb-name {
    font-size: 14px;
  }
}
.majors {
  display: grid;
  gap: 56px;
  max-width: 1180px;
  margin: 0 auto;
}
.major-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}
.major-en {
  position: absolute;
  right: 0;
  bottom: 6px;
  font-family: var(--font-num);
  font-weight: 800;
  font-size: clamp(30px, 8vw, 56px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--accent) 55%, transparent);
  pointer-events: none;
}
.major-head h2 {
  font-size: clamp(22px, 5vw, 28px);
}
.major-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}
.unit-grid {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}
@media (max-width: 639px) {
  .unit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .major-en {
    display: none;
  }
}
.unit-card > a,
.unit-card > .unit-name:only-child,
.unit-card:not(.is-open) {
  border-radius: 16px;
}
.unit-card a,
.unit-card:not(.is-open) {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 84px;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  color: var(--ink-soft);
  text-decoration: none;
}
.js .reveal .unit-card {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease calc(var(--i) * 0.05s), transform 0.5s ease calc(var(--i) * 0.05s);
}
.js .reveal.in .unit-card {
  opacity: 1;
  transform: none;
}
.unit-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.5;
  word-break: auto-phrase;
  /* 「ビジネスインダストリ」のような長い単元名が2列のスマホ幅に収まらないときだけ、語の途中で折る */
  overflow-wrap: anywhere;
}
@media (max-width: 639px) {
  .unit-name {
    font-size: 14px;
  }
}
.unit-meta {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
}
.unit-card.is-open a {
  background: var(--surface);
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}
.unit-card.is-open a:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.unit-card.is-open .unit-meta {
  color: var(--accent-ink);
  font-weight: 700;
}
.unit-card.is-open .unit-meta .num {
  font-size: 15px;
}
.unit-go {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
}
.unit-go::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 10px;
  width: 7px;
  height: 7px;
  border-top: 2px solid var(--on-accent);
  border-right: 2px solid var(--on-accent);
  transform: rotate(45deg);
}

/* ---------- 下の帯 ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 32px 0 calc(32px + env(safe-area-inset-bottom));
}
.site-foot-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  gap: 12px;
  justify-items: start;
  color: var(--ink-soft);
}
.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 13px;
}
.site-foot nav a {
  color: inherit;
  text-decoration: none;
}
.site-foot nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.site-foot small {
  font-size: 12px;
}

/* ---------- 画像を大きく見る ---------- */
.zoom {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 12, 10, 0.86);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
}
.zoom[hidden] {
  display: none;
}
.zoom img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  background: #fff;
}
.zoom img:not([src]),
.zoom-fig:empty {
  display: none;
}
.zoom-fig {
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  border-radius: 14px;
  background: var(--surface);
  cursor: default;
}
.zoom-fig svg {
  display: block;
  width: 860px;
  max-width: none;
  height: auto;
  padding: 16px;
}
.zoom-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
}
.zoom-close::before,
.zoom-close::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 19px;
  width: 18px;
  height: 2px;
  background: #fff;
  transform: rotate(45deg);
}
.zoom-close::after {
  transform: rotate(-45deg);
}

@media (min-width: 640px) {
  .hero-inner,
  .site-head-inner,
  .site-foot-inner {
    padding-left: 28px;
    padding-right: 28px;
  }
  .page {
    padding-left: 28px;
    padding-right: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- 講座を1本の道にした部品（はじめに・単元の番号） ---------- */
.prose.lead-first {
  margin-top: 8px;
}
.hero-cta {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}
.hero-cta-sub {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: none;
}
.hero-cta-sub:hover {
  color: var(--accent-ink);
}
.start-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 16px;
  padding: 20px 22px;
  border-radius: 20px;
  background: var(--surface);
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s;
}
.start-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.start-card-label {
  grid-column: 1;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-ink);
  letter-spacing: 0.06em;
}
.start-card-title {
  grid-column: 1;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(17px, 4.4vw, 21px);
  line-height: 1.5;
  word-break: auto-phrase;
}
.start-card .unit-go {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 40px;
  height: 40px;
}
.start-card .unit-go::after {
  left: 14px;
  top: 16px;
  width: 9px;
  height: 9px;
}
.unit-no {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-ink);
  letter-spacing: 0.04em;
}
.unit-card a {
  justify-content: flex-start;
  gap: 2px;
}
.unit-card .unit-meta {
  margin-top: auto;
  padding-top: 8px;
}
.page-narrow .pager {
  margin-top: 40px;
}

/* ---------- 記事だけの書き足し（scripts/learn/extra） ---------- */
/* 節の中の小見出し */
.prose h3 {
  font-size: 19px;
  line-height: 1.5;
  margin-top: 2.2em;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
/* 計算例などの囲み */
.prose blockquote {
  margin: 0;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.prose blockquote > * + * {
  margin-top: 1em;
}
.prose blockquote pre {
  background: var(--bg);
}
/* 表の1列目：長いときは文節で折り返す（横にはみ出さない） */
.prose td:first-child {
  white-space: normal;
  word-break: auto-phrase;
  min-width: 6.5em;
}
/* 試験ではここを見る */
.sec-exam .sec-no {
  background: var(--warn-tint);
  color: var(--warn);
}
.sec-exam .sec-kicker {
  color: var(--warn);
}
/* この回のまとめ */
.sec-summary .prose {
  padding: 22px 24px;
  border-radius: 18px;
  background: var(--accent-tint);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.sec-summary .prose .table-wrap {
  background: var(--surface);
}
.sec-summary .prose strong {
  background: none;
  color: var(--accent-ink);
}
@media (max-width: 699px) {
  .sec-summary .prose {
    padding: 18px 16px;
  }
}
.sec-summary .prose > ul,
.sec-summary .prose > ol {
  margin: 0;
}
/* プラスアルファ（これも覚えよう）：アプリの講義の最後に出る用語を、記事では話の近い節に置く。本文と分けて点線の囲みに */
.plus {
  margin: 22px 0 6px;
  padding: 16px 18px 14px;
  border-radius: 16px;
  border: 1.5px dashed var(--plus-line);
  background: var(--plus-tint);
}
.plus-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--plus-ink);
}
.plus-label span {
  display: inline-grid;
  place-items: center;
  height: 1.7em;
  padding: 0 0.6em;
  border-radius: 999px;
  background: var(--plus-ink);
  color: var(--surface);
  font-family: var(--font-num);
  font-size: 0.78rem;
}
.plus dl {
  display: grid;
  gap: 10px;
  margin: 0;
}
.plus dt {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.plus dd {
  margin: 2px 0 0;
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--ink-soft);
}
/* 表の見出し：長いときは文節で折り返す */
.prose th {
  white-space: normal;
  word-break: auto-phrase;
}

/* ---------- 触って試せる部品（public/lp/widgets） ---------- */
.widget {
  margin-top: 28px;
  padding: 20px 22px 22px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.widget-wait {
  font-size: 14px;
  color: var(--ink-soft);
}
.widget-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-ink);
  background: var(--accent-tint);
  padding: 3px 10px;
  border-radius: 999px;
}
.widget-title {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.5;
}
.widget-lead {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-soft);
}
.widget-body {
  margin-top: 16px;
  display: grid;
  gap: 16px;
  font-size: 15px;
  line-height: 1.75;
}
.w-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}
.w-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.w-slider {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: baseline;
}
.w-slider label {
  font-size: 14px;
  font-weight: 700;
}
.w-slider-value {
  font-family: var(--font-num);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
}
.w-slider input[type='range'] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--accent);
  height: 28px;
}
.w-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.w-choice-label {
  font-size: 14px;
  font-weight: 700;
  margin-right: 4px;
}
.w-btn {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
.w-btn:hover {
  border-color: var(--accent);
}
.w-btn:active {
  transform: scale(0.97);
}
.w-btn:focus-visible,
.w-bit:focus-visible,
.widget input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}
.w-btn[aria-pressed='true'],
.w-btn.is-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.w-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.w-stat {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.w-stat-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.w-stat-value {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.w-stat[data-tone='good'] .w-stat-value {
  color: var(--accent-ink);
}
.w-stat[data-tone='bad'] .w-stat-value {
  color: var(--warn);
}
.w-note {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-soft);
}
.w-note b {
  color: var(--ink);
}
.w-input {
  font: inherit;
  font-size: 16px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  width: 100%;
  min-width: 0;
}
.w-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
.w-svg {
  width: 100%;
  height: auto;
  display: block;
}
.w-svg text {
  font-family: var(--font-body);
  fill: var(--ink);
}
.w-svg .w-soft {
  fill: var(--ink-soft);
}
.w-anim {
  transition: all 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
  .w-anim,
  .w-btn {
    transition: none;
  }
}
@media (max-width: 699px) {
  .widget {
    padding: 16px 14px 18px;
  }
}
/* 部品の中の図と表 */
.w-bits {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.w-bit-col {
  display: grid;
  gap: 4px;
  text-align: center;
}
.w-bit-w {
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--ink-soft);
}
.w-bit {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 800;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}
.w-bit[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.w-bit:active {
  transform: scale(0.94);
}
.w-split {
  display: grid;
  gap: 16px;
  align-items: center;
}
@media (min-width: 700px) {
  .w-split {
    grid-template-columns: 3fr 2fr;
  }
}
.w-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  text-align: center;
  font-size: 15px;
}
.w-table th,
.w-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.w-table th {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
}
.w-table tr.is-on td {
  background: var(--accent-tint);
  font-weight: 800;
  color: var(--accent-ink);
}
.w-table-wrap {
  overflow-x: auto;
}
.w-venn-on {
  fill: color-mix(in srgb, var(--accent) 55%, transparent);
}
.w-venn-off {
  fill: var(--bg);
}
.w-venn-line {
  stroke: var(--ink-soft);
  stroke-width: 1.5;
}
rect.w-venn-on,
rect.w-venn-off {
  stroke: var(--line);
}
.w-axis,
.w-wire {
  stroke: var(--fig-line);
  stroke-width: 2;
}
.w-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}
.w-dot {
  fill: var(--accent);
}
.w-dot-strong {
  fill: var(--warn);
  stroke: var(--surface);
  stroke-width: 3;
}
line.w-mark-acc,
.w-line-acc {
  stroke: var(--accent);
  stroke-width: 3;
}
line.w-mark-warn,
.w-line-warn {
  stroke: var(--warn);
  stroke-width: 3;
}
text.w-mark-acc {
  fill: var(--accent-ink);
}
text.w-mark-warn {
  fill: var(--warn);
}
.w-line-soft {
  stroke: var(--fig-line);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}
.w-line-dash {
  stroke: var(--ink-soft);
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
}
.w-wave {
  fill: none;
  stroke: var(--fig-line);
  stroke-width: 2.5;
}
.w-step {
  fill: none;
  stroke: var(--warn);
  stroke-width: 3;
  stroke-linejoin: round;
}
.w-box {
  fill: var(--fig-acc-box);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.widget-body {
  grid-template-columns: minmax(0, 1fr);
}
.widget-body > * {
  min-width: 0;
}
.w-bit {
  padding: 0;
  min-width: 0;
  font-size: clamp(16px, 4.6vw, 22px);
}
.w-bits {
  gap: clamp(3px, 1vw, 6px);
}
.w-controls {
  display: grid;
  gap: 12px 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
/* 記事の本文の表の決まり（1列目を太字・左寄せ）を、部品の表には効かせない */
.prose .widget td:first-child {
  font-weight: inherit;
  white-space: normal;
  min-width: 0;
}
.prose .widget th {
  white-space: nowrap;
}
.prose .widget td,
.prose .widget th {
  text-align: center;
  padding: 6px 8px;
}
.w-steps {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-x: auto;
}
.w-progress {
  height: 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
}
.w-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #38bdf8));
}
.w-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.w-check {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}
.w-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.w-hash {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.w-hash.is-prev {
  color: var(--ink-soft);
}
.w-hash.is-ok {
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}
.w-hash .is-diff {
  color: var(--warn);
  font-weight: 700;
}
.w-edge {
  stroke: color-mix(in srgb, var(--warn) 45%, transparent);
  stroke-width: 1.2;
}
.w-node {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 3;
}
.w-bar {
  fill: var(--fig-acc-box);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.w-bar-cmp {
  fill: color-mix(in srgb, #38bdf8 45%, transparent);
  stroke: #0ea5e9;
  stroke-width: 2;
}
.w-bar-swap {
  fill: color-mix(in srgb, var(--warn) 50%, transparent);
  stroke: var(--warn);
  stroke-width: 2;
}
.w-bar-done {
  fill: var(--accent);
}
.w-container {
  display: flex;
  gap: 8px;
  padding: 12px;
  min-height: 74px;
  border-radius: 14px;
  border: 2px dashed var(--line);
  background: var(--bg);
  align-items: center;
}
.w-container.is-stack {
  flex-direction: column;
  width: 120px;
  min-height: 250px;
  justify-content: flex-end;
  border-top-style: none;
  border-radius: 0 0 14px 14px;
}
.w-container.is-queue {
  overflow-x: auto;
}
.w-cell {
  display: grid;
  place-items: center;
  min-width: 52px;
  height: 32px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 800;
  animation: w-pop 0.25s ease-out;
}
.w-container.is-stack .w-cell {
  width: 100%;
}
.w-cell.is-next {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.w-empty {
  color: var(--ink-soft);
  font-size: 14px;
  margin: auto;
}
@keyframes w-pop {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
}
.w-slots {
  display: grid;
  gap: 6px;
}
.w-slot {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
  transition: background 0.3s;
}
.w-slot-no {
  display: grid;
  place-items: center;
  height: 100%;
  font-family: var(--font-num);
  font-weight: 800;
  background: var(--accent-tint);
  color: var(--accent-ink);
}
.w-slot-vals {
  padding: 0 12px;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 17px;
}
.w-slot.is-hit {
  background: color-mix(in srgb, var(--accent) 18%, var(--bg));
}
.w-slot.is-collide .w-slot-vals {
  color: var(--warn);
}
.w-row-input .w-input {
  width: 8em;
}
.w-swatch {
  height: 120px;
  border-radius: 16px;
  border: 1px solid var(--line);
  transition: background 0.15s;
}
@media (prefers-reduced-motion: reduce) {
  .w-cell {
    animation: none;
  }
}
.w-paths {
  display: grid;
  gap: 6px;
}
.w-path {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}
.w-path.is-critical {
  border-color: var(--warn);
  background: var(--warn-tint);
  font-weight: 700;
}
.w-tasks {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.w-task {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.w-task-name {
  font-size: 13.5px;
  font-weight: 700;
}
.w-task-val {
  min-width: 2.6em;
  text-align: center;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.w-task-val.is-changed {
  color: var(--warn);
}
.w-btn.w-mini {
  padding: 2px 10px;
  font-size: 16px;
}
.w-arrow,
.w-arrow-on {
  stroke-width: 3;
}
.w-arrow {
  stroke: var(--fig-line);
}
.w-arrow-on {
  stroke: var(--warn);
  stroke-width: 5;
}
.w-head {
  fill: var(--fig-line);
}
.w-head-on {
  fill: var(--warn);
}
.w-node-o {
  fill: var(--surface);
  stroke: var(--ink-soft);
  stroke-width: 2;
}
.w-disks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.w-disk {
  font: inherit;
  display: grid;
  gap: 4px;
  width: 92px;
  padding: 8px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, opacity 0.2s;
}
.w-disk:hover {
  border-color: var(--accent);
}
.w-disk.is-broken {
  border-color: var(--warn);
  opacity: 0.55;
  background: repeating-linear-gradient(45deg, var(--warn-tint), var(--warn-tint) 8px, var(--bg) 8px, var(--bg) 16px);
}
.w-disk-name {
  font-size: 12.5px;
  font-weight: 700;
}
.w-block {
  display: block;
  padding: 3px 0;
  border-radius: 6px;
  background: var(--fig-acc-box);
  font-family: var(--font-num);
  font-weight: 800;
  font-size: 14px;
}
.w-block.is-parity {
  background: color-mix(in srgb, #38bdf8 30%, transparent);
}
.w-tree {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
}
.w-tree-row {
  padding: 4px 10px;
  transition: background 0.2s;
}
.w-tree-row::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 10px;
  margin-right: 8px;
  border-radius: 2px;
  vertical-align: -1px;
}
.w-tree-row.is-dir::before {
  background: color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 2px 5px 2px 2px;
}
.w-tree-row.is-file::before {
  width: 9px;
  height: 12px;
  border: 1.5px solid var(--ink-soft);
}
.w-tree-row.is-current {
  font-weight: 700;
}
.w-tree-row.is-hit {
  background: var(--warn-tint);
  color: var(--warn);
  font-weight: 700;
}
.w-sheet {
  display: grid;
  grid-template-columns: 34px repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--font-num);
  font-size: 14px;
}
.w-sheet-h,
.w-sheet-c {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.w-sheet-h {
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-weight: 700;
}
.w-sheet-c.is-src {
  background: color-mix(in srgb, #38bdf8 25%, transparent);
  font-weight: 800;
}
.w-sheet-c.is-dst {
  background: var(--warn-tint);
  color: var(--warn);
  font-weight: 800;
}
.w-sheet-c.is-ref,
.w-sheet-c.is-ref2 {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
}
.w-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
}
.w-day {
  display: grid;
  gap: 4px;
  justify-items: center;
  font-size: 12.5px;
}
.w-day-name {
  font-weight: 700;
}
.w-day-bar {
  width: 70%;
  border-radius: 6px 6px 0 0;
  background: var(--fig-acc-box);
  border: 1px solid var(--line);
  transition: height 0.3s;
}
.w-day.is-used .w-day-bar {
  background: var(--accent);
  border-color: var(--accent);
}
.w-day.is-future {
  opacity: 0.3;
}
.w-day-size {
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--ink-soft);
}
.w-two {
  display: grid;
  gap: 12px;
}
@media (min-width: 700px) {
  .w-two {
    grid-template-columns: 3fr 2fr;
  }
}
.prose .widget th.is-on {
  background: var(--warn-tint);
  color: var(--warn);
}
.w-ipbits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.w-octet {
  display: grid;
  gap: 2px;
  text-align: center;
}
.w-octet-dec {
  font-family: var(--font-num);
  font-weight: 800;
  font-size: 17px;
}
.w-octet-bin {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(11px, 2.6vw, 15px);
  letter-spacing: 0.02em;
}
.w-octet-bin .is-net {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  font-weight: 700;
}
.w-octet-bin .is-host {
  color: var(--ink-soft);
}
.w-area-frr {
  fill: color-mix(in srgb, var(--accent) 35%, transparent);
}
.w-area-far {
  fill: color-mix(in srgb, var(--warn) 40%, transparent);
}
.w-curve-self,
.w-curve-other {
  fill: none;
  stroke-width: 3;
}
.w-curve-self {
  stroke: var(--accent);
}
.w-curve-other {
  stroke: var(--warn);
}
.w-line-limit {
  stroke: var(--ink);
  stroke-width: 3;
}
.w-route {
  fill: none;
  stroke: var(--line);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.w-packet {
  fill: var(--accent);
}
.w-packet-t {
  fill: var(--on-accent);
}
.w-box-warn {
  fill: var(--warn-tint);
  stroke: var(--warn);
  stroke-width: 1.5;
}
.w-flow {
  stroke-dasharray: 10 8;
  animation: w-flow 0.8s linear infinite;
}
@keyframes w-flow {
  to {
    stroke-dashoffset: -18;
  }
}
@media (prefers-reduced-motion: reduce) {
  .w-flow {
    animation: none;
  }
}
.w-task {
  grid-template-columns: auto 1fr auto;
}
.w-task-name {
  grid-column: 1 / -1;
  white-space: nowrap;
}
.w-stat-value {
  font-size: clamp(17px, 4.8vw, 22px);
  overflow-wrap: normal;
  word-break: keep-all;
}
.w-quiz-card {
  padding: 18px 18px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.7;
  min-height: 76px;
  display: flex;
  align-items: center;
  animation: w-pop 0.25s ease-out;
}
.w-quiz-card.is-done {
  border-left-color: var(--warn);
  font-size: 19px;
}
.w-btn.is-right {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  opacity: 1;
}
.w-btn.is-wrong {
  background: var(--warn-tint);
  border-color: var(--warn);
  color: var(--warn);
  opacity: 1;
}
.w-feedback {
  font-size: 15px;
  line-height: 1.8;
}
.w-feedback.is-ok::first-line,
.w-feedback.is-ng::first-line {
  font-weight: 700;
}
.w-feedback.is-ok {
  color: var(--accent-ink);
}
.w-feedback.is-ng {
  color: var(--warn);
}
.w-feedback:empty {
  display: none;
}
.w-row:has(> button[hidden]:only-child) {
  display: none;
}
.w-five {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}
.w-mini-label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
}
.w-mini-label .w-input {
  font-size: 15px;
  padding: 6px 8px;
}
.w-g-A {
  fill: var(--accent);
}
.w-g-B {
  fill: color-mix(in srgb, var(--accent) 50%, transparent);
}
.w-g-C {
  fill: var(--fig-acc-box);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.prose .widget td.w-g-t-A {
  color: var(--accent-ink);
  font-weight: 800;
}
.w-cum,
.w-stock {
  fill: none;
  stroke-width: 3;
  stroke-linejoin: round;
}
.w-cum {
  stroke: var(--warn);
}
.w-stock {
  stroke: var(--accent);
}
.w-prob {
  display: flex;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.w-prob i {
  display: block;
  height: 100%;
  transition: width 0.25s;
}
.w-prob .is-win {
  background: var(--accent);
}
.w-prob .is-lose {
  background: var(--warn-tint);
}
.w-ppm {
  max-width: 420px;
}
.w-cell-on {
  fill: var(--accent-tint);
  stroke: var(--accent);
  stroke-width: 2;
}
.w-cell-off {
  fill: var(--bg);
  stroke: var(--line);
  stroke-width: 1.5;
}
.w-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.w-list-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-weight: 700;
  animation: w-pop 0.25s ease-out;
}
.w-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  margin-left: 6px;
  white-space: nowrap;
}
.w-list-item .w-tag {
  margin-left: 0;
  min-width: 5.5em;
  text-align: center;
}
.w-field {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.w-field legend {
  font-weight: 700;
  font-size: 14.5px;
  padding: 0 4px;
}
.w-digits {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.w-digit {
  display: grid;
  place-items: center;
  width: 24px;
  height: 34px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-family: var(--font-num);
  font-weight: 800;
}
.w-digit.is-country {
  background: color-mix(in srgb, #38bdf8 25%, transparent);
}
.w-digit.is-cd {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.w-ticks {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
}
.w-ticks span {
  height: 18px;
  border-radius: 4px;
}
.w-ticks .is-a {
  background: var(--accent);
}
.w-ticks .is-b {
  background: color-mix(in srgb, #38bdf8 50%, transparent);
}
.w-band {
  display: flex;
  height: 22px;
  border-radius: 8px;
  overflow: hidden;
  gap: 2px;
}
.w-band .is-up {
  background: var(--accent);
  transition: flex 0.25s;
}
.w-band .is-down {
  background: var(--warn);
  transition: flex 0.25s;
}
.w-flow-steps {
  margin: 0;
  padding-left: 1.4em;
  display: grid;
  gap: 6px;
  font-size: 14.5px;
  line-height: 1.75;
}
.w-flow-steps b {
  display: inline-block;
  min-width: 4em;
  margin-right: 6px;
  color: var(--accent-ink);
}
.w-flow-steps .is-bad {
  color: var(--warn);
}
.w-flow-steps .is-bad b {
  color: var(--warn);
}
.w-flow-steps .is-ok {
  color: var(--accent-ink);
  font-weight: 700;
}
.w-range {
  display: grid;
  grid-template-columns: repeat(50, 1fr);
  gap: 2px;
}
.w-range span {
  height: 14px;
  border-radius: 3px;
  background: var(--line);
  transition: background 0.25s;
}
.w-range span.is-in {
  background: color-mix(in srgb, var(--accent) 45%, transparent);
}
.w-range span.is-mid {
  background: var(--warn);
}
.w-range span.is-found {
  background: var(--accent);
  outline: 2px solid var(--accent-ink);
}
.w-shape {
  fill: var(--bg);
  stroke: var(--fig-line);
  stroke-width: 2;
}
.w-shape-on {
  fill: var(--accent-tint);
  stroke: var(--accent);
  stroke-width: 3.5;
}
.w-flowchart {
  max-width: 380px;
}

/* 上へ戻るボタン：目次が横に出ない幅（スマホ・タブレット）だけ。JavaScript で、読み進めてから出す */
.to-top {
  display: none;
}
.js .to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent-ink);
  box-shadow: var(--shadow);
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s, visibility 0s 0.25s;
}
.js .to-top.show {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.25s, transform 0.25s;
}
.to-top span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
/* 矢印（上向きのくの字） */
.to-top::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-left: 2.5px solid currentColor;
  border-top: 2.5px solid currentColor;
  transform: rotate(45deg);
}
.to-top:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
@media (hover: hover) {
  .to-top:hover {
    background: var(--accent-tint);
  }
}
@media (min-width: 1100px) {
  .js .to-top {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .js .to-top,
  .js .to-top.show {
    transition: none;
    transform: none;
  }
}

/* ---------- 用語：押すと意味が出る（アプリの用語リンクと同じ役目） ---------- */
.prose .term {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline dotted color-mix(in srgb, var(--accent-ink) 70%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.28em;
  cursor: pointer;
}
@media (hover: hover) {
  .prose .term:hover {
    color: var(--accent-ink);
    text-decoration-style: solid;
  }
}
.prose .term[aria-expanded="true"] {
  color: var(--accent-ink);
  background: var(--accent-tint);
  border-radius: 4px;
}
.prose .term:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.term-pop {
  position: absolute;
  z-index: 70;
  width: min(400px, calc(100vw - 24px));
  padding: 18px 20px 20px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), 0 10px 30px -10px rgba(0, 0, 0, 0.25);
  animation: term-pop-in 0.18s ease-out;
}
.term-pop[hidden] {
  display: none;
}
.term-pop:focus {
  outline: none;
}
.term-pop.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: auto;
  max-height: 72vh;
  overflow: auto;
  padding: 20px 20px calc(22px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  border-width: 1px 0 0;
  box-shadow: 0 -12px 40px -8px rgba(0, 0, 0, 0.3);
  animation-name: term-sheet-in;
  animation-duration: 0.22s;
}
@keyframes term-pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
@keyframes term-sheet-in {
  from {
    transform: translateY(100%);
  }
}
.term-pop-h {
  margin: 0 36px 6px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-ink);
}
.term-pop-body.prose {
  font-size: 15.5px;
  line-height: 1.85;
}
.term-pop-body.prose > * + * {
  margin-top: 0.8em;
}
.term-pop-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.term-pop-close::before,
.term-pop-close::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 17px;
  width: 16px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
}
.term-pop-close::after {
  transform: rotate(-45deg);
}
@media (hover: hover) {
  .term-pop-close:hover {
    background: var(--accent-tint);
  }
}
.term-pop-more {
  position: relative;
  display: block;
  margin-top: 16px;
  padding: 14px 46px 14px 16px;
  border-radius: 14px;
  background: var(--accent-tint);
  border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.term-pop-more[hidden] {
  display: none;
}
.term-pop-more small {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-ink);
}
.term-pop-more b {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  line-height: 1.55;
}
.term-pop-more span {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.term-pop-more::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-right: 2.5px solid var(--accent-ink);
  border-top: 2.5px solid var(--accent-ink);
  transform: rotate(45deg);
}
@media (hover: hover) {
  .term-pop-more:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .term-pop,
  .term-pop.sheet {
    animation: none;
  }
}

/* ---------- 作り替えた記事（scripts/learn/articles）：最後の過去問・途中の例題 ---------- */
.quiz-inline {
  margin-top: 28px;
  margin-bottom: 28px;
}
.quiz-inline .quiz-top h3 {
  font-size: 18px;
}
/* オリジナル問題は過去問と色を分ける（出典が IPA でないことが一目で分かるように） */
.quiz-original .quiz-top {
  background: linear-gradient(135deg, var(--plus-ink), color-mix(in srgb, var(--plus-ink) 70%, #0ea5e9));
}
/* 例題：問題文は見せて、答えはアコーディオン。本文と分けるため左に色の線 */
.example {
  margin: 24px 0;
  padding: 16px 20px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: var(--surface);
}
.example-label {
  margin: 0 0 6px;
}
.example-label span {
  display: inline-grid;
  place-items: center;
  height: 1.8em;
  padding: 0 0.75em;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.example-q {
  font-size: 15.5px;
  line-height: 1.9;
}
.example-q > * + * {
  margin-top: 0.6em;
}
.example-q ol {
  padding-left: 1.3em;
}
/* 例題の選択肢（「- ア　…」）は点を付けない */
.example-q ul {
  list-style: none;
  padding-left: 0;
}
.example-a {
  margin-top: 12px;
}
.example-a summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
}
.example-a summary::-webkit-details-marker {
  display: none;
}
.example-a summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
}
.example-a[open] summary::after {
  transform: rotate(-135deg) translateY(-1px);
}
.example-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 15px;
  line-height: 1.9;
}
.example-a[open] .example-body {
  animation: rise 0.4s ease both;
}
.example-body > * + * {
  margin-top: 0.8em;
}
.example-body ul {
  padding-left: 1.3em;
}
.example-key {
  font-weight: 700;
}
.example-key b {
  color: var(--accent-ink);
}
/* 作り替えた記事の解説の中の式（本文の式と同じ見た目。狭い画面では横にスクロール） */
.answer-body pre,
.example-body pre {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  overflow-x: auto;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.85;
}
.answer-body pre code,
.example-body pre code {
  font-family: inherit;
  background: none;
  padding: 0;
}
