/* デジタル庁デザインシステムを参考にした、スマートフォン向けの見た目。
   色・文字の大きさ・余白（8pxの倍数）・タップ領域（44px以上）・フォーカスの見え方を、参考にしている。 */
:root {
  --blue-50: #e8f1fe;
  --blue-100: #d9e6ff;
  --blue-200: #c5d7fb;
  --blue-400: #7096f8;
  --blue-800: #0031d8;
  --blue-900: #0017c1;
  --blue-1000: #00118f;
  --gray-50: #f2f2f2;
  --gray-100: #e6e6e6;
  --gray-200: #cccccc;
  --gray-536: #767676;
  --gray-700: #4d4d4d;
  --gray-900: #1a1a1a;
  --focus: #ffd43d;

  --bg: #f2f2f2;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #4d4d4d;
  --line: #cccccc;
  --primary: #0017c1;
  --primary-ink: #ffffff;
  --link: #00118f;
  --soft: #e8f1fe;
  --tabbar-h: 64px;

  --c-blue: #0031d8;
  --c-cyan: #006f83;
  --c-purple: #6f23d0;
  --c-green: #197a4b;
  --c-orange: #c04200;
  --c-magenta: #b4005f;
  --c-indigo: #3f3fa7;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
.shell { max-width: 640px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.skip { position: absolute; left: -999px; top: 8px; background: #000; color: #fff; padding: 8px 16px; z-index: 100; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
a { color: var(--link); }
a, button, input, label { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px #000; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-s { width: 16px; height: 16px; margin-right: 4px; vertical-align: -3px; }
.ic-chev { width: 20px; height: 20px; color: var(--muted); margin-left: auto; }

/* ヘッダー */
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; min-height: 56px; padding: env(safe-area-inset-top) 12px 0 8px; background: var(--primary); color: var(--primary-ink); }
.appbar-logo { width: 36px; height: 36px; margin-left: 4px; border-radius: 10px; background: #fff; color: var(--blue-900); font-weight: 900; font-size: 20px; display: grid; place-items: center; }
.appbar-back { display: grid; place-items: center; width: 48px; height: 48px; color: inherit; }
.appbar-title { color: inherit; text-decoration: none; font-weight: 700; font-size: 17px; line-height: 1.3; }

.main { flex: 1; padding: 16px 16px 24px; }
.h1 { font-size: 26px; line-height: 1.45; margin: 8px 0 12px; font-weight: 700; }
.h2 { font-size: 20px; line-height: 1.5; margin: 0 0 12px; font-weight: 700; }
.lead { margin: 0 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sec { margin: 28px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.card p { margin: 0 0 8px; }
.card p:last-child { margin-bottom: 0; }
.link { display: inline-block; min-height: 44px; line-height: 44px; font-weight: 700; }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border-radius: 8px; font-weight: 700; font-size: 16px; text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-light { background: #fff; color: var(--blue-900); }

/* ホームのヒーロー */
.hero { margin: -16px -16px 24px; padding: 28px 20px 32px; background: linear-gradient(160deg, var(--blue-900), var(--blue-1000)); color: #fff; }
.hero-kicker { margin: 0 0 8px; font-size: 14px; font-weight: 700; opacity: 0.85; }
.hero-title { margin: 0 0 12px; font-size: 32px; line-height: 1.35; font-weight: 700; }
.hero-lead { margin: 0 0 20px; opacity: 0.95; }
.resume { margin-bottom: 8px; }

/* リスト・カード */
.list { display: flex; flex-direction: column; gap: 12px; }
.scard, .ep { display: flex; align-items: center; gap: 14px; padding: 14px 12px 14px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; min-height: 72px; }
.scard:active, .ep:active { background: var(--soft); }
.scard-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: currentColor; flex: none; }
.scard-ic .ic { color: #fff; }
.scard-body, .ep-body { display: flex; flex-direction: column; min-width: 0; }
.scard-name { font-weight: 700; font-size: 17px; line-height: 1.4; }
.scard-tag { font-size: 14px; color: var(--muted); line-height: 1.5; }
.scard-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ep-num { flex: none; min-width: 56px; padding: 4px 8px; border-radius: 999px; font-size: 13px; font-weight: 700; text-align: center; color: #fff; background: currentColor; }
.ep-num { color: var(--c-blue); }
.ep-num::before { content: none; }
.ep-title { font-weight: 700; line-height: 1.5; }
.ep-meta { font-size: 13px; color: var(--muted); }
.ep.is-soon .ep-title { color: var(--muted); }
.s-net { color: var(--c-blue); } .s-inet { color: var(--c-cyan); } .s-sec { color: var(--c-purple); } .s-ops { color: var(--c-green); }
.s-myna { color: var(--c-orange); } .s-mn { color: var(--c-magenta); } .s-law { color: var(--c-indigo); }
.ep-num[class*="s-"] { color: #fff; }
.ep-num.s-net { background: var(--c-blue); } .ep-num.s-inet { background: var(--c-cyan); } .ep-num.s-sec { background: var(--c-purple); }
.ep-num.s-ops { background: var(--c-green); } .ep-num.s-myna { background: var(--c-orange); } .ep-num.s-mn { background: var(--c-magenta); } .ep-num.s-law { background: var(--c-indigo); }
.scard .scard-name, .scard .scard-tag, .scard .scard-meta { color: var(--text); }
.scard .scard-tag, .scard .scard-meta { color: var(--muted); }

/* シリーズのヘッダー */
.shero { margin: -16px -16px 20px; padding: 24px 20px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.shero-title { margin: 0; font-size: 26px; line-height: 1.4; color: var(--text); }
.shero-tag { margin: 0; color: var(--muted); }

/* 各回 */
.crumb { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.crumb a { color: var(--muted); }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; margin: 4px 0 8px; }
.player iframe, .player img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.player-btn { position: absolute; inset: 0; padding: 0; border: 0; background: #000; cursor: pointer; }
.player-play { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; background: var(--blue-900); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 4px #fff; }
.player-play .ic { width: 32px; height: 32px; fill: currentColor; stroke: none; margin-left: 4px; }
.player-soon { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--soft); border: 1px solid var(--line); }
.player-soon p { margin: 0; font-weight: 700; color: var(--text); }
.meta { margin: 0; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.yt-link { margin-left: auto; min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; }
.chap { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.chap li + li { border-top: 1px solid var(--line); }
.chap-btn { width: 100%; min-height: 48px; display: flex; gap: 12px; align-items: center; padding: 8px 16px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.chap-btn:active { background: var(--soft); }
.chap-t { font-variant-numeric: tabular-nums; color: var(--link); font-weight: 700; min-width: 3em; }

/* チェックリスト */
.check { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; gap: 12px; align-items: flex-start; min-height: 56px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.check-row input { position: absolute; opacity: 0; }
.check-box { flex: none; width: 28px; height: 28px; border: 2px solid var(--gray-536); border-radius: 8px; display: grid; place-items: center; background: var(--surface); color: transparent; }
.check-row input:checked + .check-box { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.check-row input:checked ~ .check-text { color: var(--muted); text-decoration: line-through; }
.check-row input:focus-visible + .check-box { outline: 4px solid var(--focus); outline-offset: 2px; }
.check-box .ic { width: 20px; height: 20px; stroke-width: 3; }

/* 前後の回 */
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 28px 0; }
.pn-a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; min-height: 72px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--text); }
.pn-next { text-align: right; }
.pn-one { grid-template-columns: 1fr; }
.pn-one .pn-next { text-align: left; }
.pn-l { font-size: 12px; color: var(--muted); }
.pn-t { font-weight: 700; font-size: 14px; line-height: 1.5; }

/* 検索 */
.searchbox { margin-bottom: 8px; }
.input { width: 100%; min-height: 52px; padding: 0 16px; font: inherit; border: 2px solid var(--gray-536); border-radius: 8px; background: var(--surface); color: var(--text); }

/* 下のタブ */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar-in { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tab { min-height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700; }
.tab[aria-current="page"] { color: var(--primary); }
.tab[aria-current="page"] .ic { stroke-width: 2.4; }

.foot { padding: 8px 16px 32px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.foot p { margin: 0 0 6px; }

/* 会社のカード */
.promo { padding: 22px 20px; border-radius: 16px; color: #fff; background: linear-gradient(150deg, #0017c1, #00118f); }
.promo-kicker { margin: 0 0 2px; font-size: 14px; font-weight: 700; opacity: 0.9; }
.promo-title { margin: 0 0 10px; font-size: 26px; line-height: 1.4; font-weight: 700; }
.promo-body { margin: 0 0 16px; font-size: 15px; line-height: 1.8; opacity: 0.95; }

/* サイトマップ */
.map { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.map li + li { border-top: 1px solid var(--line); }
.map a { display: block; min-height: 48px; padding: 12px 16px; text-decoration: none; color: var(--text); }
.map a:active { background: var(--soft); }
.maplink { color: var(--text); text-decoration: none; }
.foot a { color: var(--muted); }

/* テーマ別の入り口 */
.chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-size: 15px; font-weight: 700; }
.chip:active { background: var(--soft); }

/* 解説（テキスト版） */
.h3 { font-size: 17px; line-height: 1.5; margin: 24px 0 8px; font-weight: 700; padding-left: 10px; border-left: 4px solid var(--primary); }
.article p { margin: 0 0 12px; line-height: 1.95; font-size: 16px; }

/* 理解度テスト */
.qq { margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.qq.is-ok { border-color: #197a4b; border-width: 2px; }
.qq.is-ng { border-color: #ec0000; border-width: 2px; }
.ql { font-weight: 700; line-height: 1.7; padding: 0; margin-bottom: 8px; }
.qn { display: inline-block; margin-right: 8px; padding: 0 10px; border-radius: 999px; background: var(--soft); color: var(--link); font-size: 14px; }
.qopt { display: flex; gap: 12px; align-items: flex-start; min-height: 52px; padding: 10px 12px; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; line-height: 1.7; }
.qopt input { position: absolute; opacity: 0; }
.qmark { flex: none; width: 24px; height: 24px; margin-top: 2px; border: 2px solid var(--gray-536); border-radius: 50%; background: var(--surface); }
.qopt input:checked + .qmark { border-color: var(--primary); box-shadow: inset 0 0 0 5px var(--primary); }
.qopt input:focus-visible + .qmark { outline: 4px solid var(--focus); outline-offset: 2px; }
.qopt.is-picked { background: #fde8e8; border-color: #ec0000; }
.qopt.is-answer { background: #e6f5ec; border-color: #197a4b; border-width: 2px; }
.qexp { margin: 12px 0 0; padding: 12px; background: var(--soft); border-radius: 8px; line-height: 1.8; }
.quiz-go { width: 100%; margin-top: 8px; }
.quiz-out { margin: 12px 0; padding: 14px 16px; border-radius: 10px; font-weight: 700; background: var(--soft); }
.quiz-out.is-warn { background: #fff3cf; }
.quiz-out.is-perfect { background: #e6f5ec; color: #115c37; }

/* 成績 */
.sum { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.sum-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.sum-l { margin: 0; font-size: 13px; color: var(--muted); }
.sum-n { margin: 4px 0 0; font-size: 22px; font-weight: 800; color: var(--primary); }
.bar { height: 10px; margin-top: 14px; border-radius: 999px; background: var(--gray-100); overflow: hidden; }
.bar-in { height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .4s; }
.scores { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sc { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
.sc-t { line-height: 1.5; }
.sc-v { flex: none; font-weight: 800; color: var(--muted); font-size: 15px; }
.is-taken .sc-v { color: var(--primary); }
.is-full .sc { background: #e6f5ec; border-color: #197a4b; }
.is-full .sc-v { color: #115c37; }
.btnrow { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.btn-sub { background: var(--surface); color: var(--link); border: 2px solid var(--primary); }
.pw-show { display: flex; gap: 8px; align-items: center; min-height: 44px; font-size: 14px; }
.sync-msg { margin: 8px 0 0; font-weight: 700; color: #115c37; }
.sync-msg.is-bad { color: #ec0000; }

.ql { float: left; width: 100%; margin: 0 0 4px; }
.ql + * { clear: both; }
