/* AWS SAA MASTER — デザインシステム
   色・余白・角丸はすべてトークンで管理する。ダークモードは [data-theme="dark"] で切り替え。 */
:root {
  --bg: #f3f5f9;
  --bg-elev: #ffffff;
  --bg-sunk: #e8ecf3;
  --line: #d9dfea;
  --line-strong: #c0c9d9;
  --text: #101a2e;
  --text-2: #45516b;
  --text-3: #6b7790;
  --brand: #c2540a;
  --brand-2: #e0700f;
  --brand-soft: #fff1e3;
  --brand-ink: #8f3d05;
  --on-brand: #ffffff;
  --accent: #f59e0b;
  --ok: #059669;
  --ok-soft: #e6f7f0;
  --ng: #dc2626;
  --ng-soft: #fdecec;
  --warn: #b45309;
  --warn-soft: #fff5e1;
  --d-secure: #5b5fe0;
  --d-resilient: #0f9a76;
  --d-performance: #b97d00;
  --d-cost: #d9468f;
  --k-user: #64748b;
  --k-edge: #8b5cf6;
  --k-network: #0ea5e9;
  --k-compute: #f97316;
  --k-storage: #22c55e;
  --k-database: #3b82f6;
  --k-integration: #ec4899;
  --k-security: #ef4444;
  --k-other: #14b8a6;
  --shadow-1: 0 1px 2px rgba(20, 30, 60, .06), 0 1px 3px rgba(20, 30, 60, .05);
  --shadow-2: 0 4px 16px rgba(20, 30, 60, .08), 0 1px 3px rgba(20, 30, 60, .06);
  --shadow-3: 0 18px 50px rgba(20, 30, 60, .18);
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Courier New", monospace;
  --side-w: 248px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1426;
  --bg-elev: #121e36;
  --bg-sunk: #08101f;
  --line: #22304d;
  --line-strong: #33456a;
  --text: #e9eef8;
  --text-2: #aab6cf;
  --text-3: #8390ad;
  --brand: #ff9900;
  --brand-2: #ffb84d;
  --brand-soft: #33240f;
  --brand-ink: #ffc266;
  --on-brand: #1a1204;
  --d-secure: #7a82ee;
  --d-resilient: #18a883;
  --d-performance: #c08a1a;
  --d-cost: #dd5c9c;
  --ok: #34d399;
  --ok-soft: #0f2e25;
  --ng: #f87171;
  --ng-soft: #3a1717;
  --warn: #fbbf24;
  --warn-soft: #33270d;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-3: 0 18px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0; letter-spacing: .01em; }
p { margin: 0; }
ul { margin: 0; padding-left: 1.2em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-soft); }

/* ---------- レイアウト ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w);
  background: var(--bg-elev); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 14px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); display: grid; place-items: center; color: var(--on-brand); font-weight: 800; font-size: 14px; box-shadow: var(--shadow-1); flex: none; }
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: .04em; }
.brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: .06em; }
.nav { padding: 6px 12px 16px; overflow-y: auto; flex: 1; }
.nav-sec { font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: .08em; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-s);
  color: var(--text-2); font-weight: 600; font-size: 14px; text-decoration: none;
}
.nav a:hover { background: var(--bg-sunk); color: var(--text); }
.nav a.on { background: var(--brand-soft); color: var(--brand-ink); }
.nav a .ico { width: 20px; height: 20px; flex: none; }
.nav a .badge { margin-left: auto; }
.side-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }

.main { flex: 1; margin-left: var(--side-w); min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 10; height: 60px; display: flex; align-items: center; gap: 12px;
  padding: 0 32px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar h1 { font-size: 17px; font-weight: 800; }
.topbar .crumb { color: var(--text-3); font-size: 13px; }
.topbar .sp { flex: 1; }
.page { padding: 8px 32px 64px; max-width: 1240px; margin: 0 auto; }
.page.enter { animation: pageIn .28s cubic-bezier(.2, .7, .3, 1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tabbar { display: none; }
.mob-only { display: none; }

/* ---------- 部品 ---------- */
.grid { display: grid; gap: var(--sp-4); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gauto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.span2 { grid-column: span 2; }
.row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.mt1 { margin-top: var(--sp-2); } .mt2 { margin-top: var(--sp-4); } .mt3 { margin-top: var(--sp-5); } .mt4 { margin-top: var(--sp-6); }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.b { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.hidden { display: none !important; }

.card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: var(--sp-5); box-shadow: var(--shadow-1);
}
.card.pad-s { padding: var(--sp-4); }
.card.link { cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; display: block; color: inherit; text-decoration: none; }
.card.link:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-strong); text-decoration: none; }
.card h2 { font-size: 16px; font-weight: 800; }
.card h3 { font-size: 15px; font-weight: 800; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: var(--sp-4); }
.sec-title { font-size: 13px; font-weight: 800; color: var(--text-2); letter-spacing: .06em; margin: var(--sp-6) 0 var(--sp-3); }

.hero {
  border-radius: var(--r-l); padding: 28px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(900px 280px at 100% 0%, rgba(255, 153, 0, .16), transparent 60%), linear-gradient(135deg, #0f1b33, #16264a);
  box-shadow: var(--shadow-2);
}
.hero h2 { font-size: 24px; font-weight: 800; }
.hero p { opacity: .9; }
.hero .btn { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .3); }
.hero .btn.primary { background: #ff9900; color: #1a1204; border-color: #ff9900; }
.hero-deco { position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .07); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg-elev);
  font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; color: var(--text);
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { background: var(--bg-sunk); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 35%, transparent); }
:root[data-theme="dark"] .btn.primary { color: #0d1220; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-sunk); }
.btn.danger { color: var(--ng); border-color: color-mix(in srgb, var(--ng) 40%, transparent); }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { min-height: 48px; padding: 10px 22px; font-size: 15px; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn .ico { width: 18px; height: 18px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-elev); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-2);
  transition: all .15s; white-space: nowrap;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
:root[data-theme="dark"] .chip.on { color: #0d1220; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--bg-sunk); color: var(--text-2); white-space: nowrap; }
.tag.brand { background: var(--brand-soft); color: var(--brand-ink); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.ng { background: var(--ng-soft); color: var(--ng); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.d-secure { background: color-mix(in srgb, var(--d-secure) 15%, transparent); color: var(--d-secure); }
.tag.d-resilient { background: color-mix(in srgb, var(--d-resilient) 15%, transparent); color: var(--d-resilient); }
.tag.d-performance { background: color-mix(in srgb, var(--d-performance) 18%, transparent); color: var(--warn); }
.tag.d-cost { background: color-mix(in srgb, var(--d-cost) 15%, transparent); color: var(--d-cost); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ng); color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.badge.soft { background: var(--bg-sunk); color: var(--text-2); }

.input, .select {
  width: 100%; min-height: 42px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--bg-elev); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.search { position: relative; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 40px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-2); }

.seg { display: inline-flex; background: var(--bg-sunk); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--text-2); }
.seg button.on { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-1); }

.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .lbl { font-size: 12px; font-weight: 700; color: var(--text-3); letter-spacing: .04em; }
.kpi .val { font-size: 28px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 14px; font-weight: 700; color: var(--text-3); margin-left: 2px; }
.kpi .sub { font-size: 12px; color: var(--text-3); }
.kpi-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 6px; }
.kpi-ico .ico { width: 20px; height: 20px; }

.bar { height: 8px; border-radius: 999px; background: var(--bg-sunk); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width .6s cubic-bezier(.2, .7, .3, 1); }
.ring { position: relative; display: inline-grid; place-items: center; }
.ring .ring-val { position: absolute; text-align: center; line-height: 1.1; }
.ring .ring-val b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--bg-sunk); text-decoration: none; border-radius: 8px; }
.list-item .grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { text-align: center; padding: 48px 16px; color: var(--text-3); }
.empty .ico { width: 44px; height: 44px; margin-bottom: 10px; opacity: .6; }

.ico { width: 20px; height: 20px; display: inline-block; vertical-align: middle; flex: none; }

/* ---------- サービス図鑑 ---------- */
.svc-card { display: flex; flex-direction: column; gap: 10px; position: relative; }
.svc-card .svc-top { display: flex; gap: 12px; align-items: flex-start; }
.svc-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; flex: none; letter-spacing: -.02em; }
.svc-card h3 { font-size: 15px; }
.svc-card .full { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.svc-card .ov { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fav { border: 0; background: transparent; cursor: pointer; color: var(--text-3); padding: 4px; border-radius: 8px; line-height: 0; }
.fav:hover { background: var(--bg-sunk); }
.fav.on { color: var(--accent); }
.fav .ico { width: 22px; height: 22px; }
.stars { color: var(--accent); letter-spacing: 1px; font-size: 12px; }
.detail-head { display: flex; gap: 18px; align-items: flex-start; }
.detail-head .svc-icon { width: 64px; height: 64px; border-radius: 16px; font-size: 18px; }
.detail-head h2 { font-size: 26px; font-weight: 800; }
.kv { display: grid; grid-template-columns: 1fr; gap: 6px; }
.bullets { display: flex; flex-direction: column; gap: 8px; padding: 0; list-style: none; }
.bullets li { position: relative; padding-left: 20px; }
.bullets li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.bullets.ok li::before { background: var(--ok); }
.bullets.ng li::before { background: var(--ng); }
.bullets.warn li::before { background: var(--accent); }
.callout { border-radius: var(--r-m); padding: 14px 16px; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.callout.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.callout.ng { background: var(--ng-soft); border-color: color-mix(in srgb, var(--ng) 35%, transparent); }
.callout .tag.brand { background: var(--bg-elev); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.callout-title { font-weight: 800; font-size: 13px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.src { font-size: 12px; color: var(--text-3); }
.src a { word-break: break-all; }

/* ---------- 比較 ---------- */
.cmp-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-m); }
table.cmp { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 560px; font-size: 14px; }
table.cmp th, table.cmp td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.cmp thead th { background: var(--bg-sunk); font-weight: 800; position: sticky; top: 0; font-size: 14px; }
table.cmp tbody th { background: var(--bg-sunk); font-weight: 700; color: var(--text-2); width: 140px; font-size: 13px; position: sticky; left: 0; }
table.cmp tr:last-child th, table.cmp tr:last-child td { border-bottom: 0; }
table.cmp tr.same td { color: var(--text-3); }
table.cmp tr.diff td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
table.cmp tr.diff th::after { content: "違い"; display: inline-block; margin-left: 6px; font-size: 10px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; vertical-align: 1px; }
table.cmp td.hl { box-shadow: inset 3px 0 0 var(--brand); background: var(--brand-soft); }
.crit { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px 14px; align-items: center; }
.crit .sig { background: var(--bg-sunk); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.crit .arrow { color: var(--text-3); }
.crit .ans { font-weight: 800; color: var(--brand-ink); background: var(--brand-soft); border-radius: 10px; padding: 10px 14px; font-size: 14px; }

/* ---------- カード（暗記） ---------- */
.flash-stage { perspective: 1400px; max-width: 680px; margin: 0 auto; }
.flash { position: relative; height: 340px; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2, .7, .3, 1); cursor: pointer; }
.flash.flip { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--r-l); padding: 28px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 12px;
  background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-2); overflow-y: auto;
}
.flash-face.back { transform: rotateY(180deg); align-items: stretch; text-align: left; justify-content: flex-start; }
.flash-face .big { font-size: 28px; font-weight: 800; line-height: 1.3; }
.flash-face .hint { font-size: 12px; color: var(--text-3); }
.grade { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 680px; margin: 18px auto 0; }
.grade .btn { flex-direction: column; gap: 0; min-height: 58px; line-height: 1.3; }
.grade .btn small { font-weight: 600; font-size: 11px; color: var(--text-3); }
.grade .g0 { border-color: color-mix(in srgb, var(--ng) 50%, transparent); color: var(--ng); }
.grade .g3 { border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--warn); }
.grade .g4 { border-color: color-mix(in srgb, var(--ok) 50%, transparent); color: var(--ok); }
.grade .g5 { border-color: color-mix(in srgb, var(--brand) 50%, transparent); color: var(--brand); }
.progress-line { height: 4px; background: var(--bg-sunk); border-radius: 999px; overflow: hidden; }
.progress-line i { display: block; height: 100%; background: var(--brand); transition: width .3s; }

/* ---------- 問題 ---------- */
.q-text { font-size: 17px; line-height: 1.85; font-weight: 600; }
.q-text mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }
.q-text mark.cond { background: color-mix(in srgb, var(--brand) 22%, transparent); }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; padding: 14px 16px; border-radius: var(--r-m);
  border: 1.5px solid var(--line); background: var(--bg-elev); cursor: pointer; transition: border-color .15s, background .15s, transform .08s; font-size: 15px;
}
.choice:hover:not([disabled]) { border-color: var(--brand); background: var(--brand-soft); }
.choice .mark { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--text-2); }
.choice.multi .mark { border-radius: 6px; }
.choice.sel { border-color: var(--brand); background: var(--brand-soft); }
.choice.sel .mark { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.choice.correct { border-color: var(--ok); background: var(--ok-soft); }
.choice.correct .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.choice.wrong { border-color: var(--ng); background: var(--ng-soft); }
.choice.wrong .mark { background: var(--ng); border-color: var(--ng); color: #fff; }
.choice[disabled] { cursor: default; }
.choice .why { display: block; margin-top: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.choice .why b { margin-right: 4px; }
.result-banner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--r-m); font-weight: 800; font-size: 17px; animation: pop .3s; }
.result-banner.ok { background: var(--ok-soft); color: var(--ok); }
.result-banner.ng { background: var(--ng-soft); color: var(--ng); }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.req { display: flex; flex-direction: column; gap: 10px; }
.req-item { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.req-no { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
:root[data-theme="dark"] .req-no { color: #0d1220; }
.req-item .t { font-weight: 700; font-size: 14px; }
.req-item .d { font-size: 13px; color: var(--text-2); }
.req-item .h { font-size: 12px; color: var(--brand-ink); margin-top: 2px; }

/* ---------- 構成図 ---------- */
.arch-svg { width: 100%; height: auto; display: block; background: var(--bg-elev); border-radius: var(--r-m); user-select: none; }
.arch-svg .grp rect { rx: 14; }
.arch-svg .grp.region rect { fill: color-mix(in srgb, var(--k-other) 5%, transparent); stroke: var(--k-other); stroke-dasharray: 6 4; }
.arch-svg .grp.vpc rect { fill: color-mix(in srgb, var(--k-network) 5%, transparent); stroke: var(--k-network); }
.arch-svg .grp.az rect { fill: transparent; stroke: var(--line-strong); stroke-dasharray: 4 4; }
.arch-svg .grp.public rect { fill: color-mix(in srgb, var(--k-storage) 8%, transparent); stroke: color-mix(in srgb, var(--k-storage) 60%, transparent); }
.arch-svg .grp.private rect { fill: color-mix(in srgb, var(--k-database) 8%, transparent); stroke: color-mix(in srgb, var(--k-database) 60%, transparent); }
.arch-svg .grp text { font-size: 12px; font-weight: 700; fill: var(--text-2); }
.arch-svg .edge path { fill: none; stroke: var(--line-strong); stroke-width: 2; transition: stroke .2s, stroke-width .2s, opacity .2s; }
.arch-svg .edge.dashed path { stroke-dasharray: 6 5; }
.arch-svg .edge text { font-size: 11px; fill: var(--text-3); font-weight: 600; paint-order: stroke; stroke: var(--bg-elev); stroke-width: 4px; }
.arch-svg .edge.hot path { stroke: var(--brand); stroke-width: 3; }
.arch-svg .edge.hot text { fill: var(--brand); }
.arch-svg.focus .edge:not(.hot) { opacity: .25; }
.arch-svg.focus .node:not(.hot):not(.sel) { opacity: .45; }
.arch-svg .node { cursor: pointer; transition: opacity .2s; }
.arch-svg .node rect.box { fill: var(--bg-elev); stroke: var(--line-strong); stroke-width: 1.5; transition: stroke .2s, filter .2s; }
.arch-svg .node:hover rect.box, .arch-svg .node.sel rect.box { stroke: var(--brand); stroke-width: 2.5; }
.arch-svg .node text.l { font-size: 13px; font-weight: 800; fill: var(--text); }
.arch-svg .node text.s { font-size: 10.5px; fill: var(--text-3); font-weight: 600; }
.arch-svg .node.quiz rect.box { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 5 4; }
.arch-svg .dot { fill: var(--brand); filter: drop-shadow(0 0 4px var(--brand)); }
.flow-list { counter-reset: f; list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.flow-list li { counter-increment: f; position: relative; padding: 8px 12px 8px 44px; border-radius: 10px; transition: background .2s; font-size: 14px; }
.flow-list li::before { content: counter(f); position: absolute; left: 10px; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-sunk); display: grid; place-items: center; font-weight: 800; font-size: 12px; color: var(--text-2); }
.flow-list li.on { background: var(--brand-soft); }
.flow-list li.on::before { background: var(--brand); color: var(--on-brand); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- グラフ ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .ax { stroke: var(--line); }
.chart .gl { stroke: var(--line); stroke-dasharray: 3 4; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .lbl-v { fill: var(--text-2); font-weight: 700; }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.heat .c { aspect-ratio: 1; border-radius: 4px; background: var(--bg-sunk); position: relative; }
.heat .c.l1 { background: color-mix(in srgb, var(--brand) 25%, var(--bg-sunk)); }
.heat .c.l2 { background: color-mix(in srgb, var(--brand) 50%, var(--bg-sunk)); }
.heat .c.l3 { background: color-mix(in srgb, var(--brand) 75%, var(--bg-sunk)); }
.heat .c.l4 { background: var(--brand); }
.heat .c.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.tip { position: fixed; z-index: 100; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; box-shadow: var(--shadow-2); }

/* ---------- ロードマップ ---------- */
.week { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg-elev); overflow: hidden; }
.week-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; }
.week-no { width: 44px; height: 44px; border-radius: 12px; background: var(--bg-sunk); display: grid; place-items: center; font-weight: 800; flex: none; }
.week.now .week-no { background: var(--brand); color: var(--on-brand); }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; padding: 0 20px 20px; }
.day { border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px; display: flex; flex-direction: column; gap: 6px; min-height: 150px; background: var(--bg); }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.day.done { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.day .dt { font-size: 11px; color: var(--text-3); font-weight: 700; display: flex; justify-content: space-between; }
.day .tt { font-size: 13px; font-weight: 800; line-height: 1.4; }
.day a.task { font-size: 12px; display: block; line-height: 1.45; padding: 4px 6px; border-radius: 6px; background: var(--bg-elev); color: var(--text-2); text-decoration: none; }
.day a.task:hover { color: var(--brand); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--ok); }

/* ---------- 模擬試験 ---------- */
.exam-bar { position: sticky; top: 60px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-1); flex-wrap: wrap; }
.timer { font-family: var(--mono); font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer.low { color: var(--ng); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .55; } }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.qgrid button { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg-elev); font-weight: 800; font-size: 12px; cursor: pointer; position: relative; color: var(--text-2); }
.qgrid button.ans { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.qgrid button.cur { outline: 2px solid var(--text); outline-offset: 1px; }
.qgrid button.flag::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.qgrid button.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.qgrid button.ng { background: var(--ng-soft); border-color: var(--ng); color: var(--ng); }

/* ---------- モーダル・トースト ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 12, 24, .5); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fade .2s; backdrop-filter: blur(3px); }
.modal { background: var(--bg-elev); border-radius: var(--r-l); box-shadow: var(--shadow-3); width: min(560px, 100%); max-height: 88vh; overflow-y: auto; padding: 24px; animation: pop .22s; }
.modal h3 { font-size: 18px; margin-bottom: 10px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-2); animation: pop .25s; }
.sheet-bg { position: fixed; inset: 0; z-index: 55; background: rgba(8, 12, 24, .45); animation: fade .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 56; background: var(--bg-elev); border-radius: 20px 20px 0 0; padding: 12px 16px calc(20px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-3); animation: up .25s cubic-bezier(.2, .7, .3, 1); max-height: 80vh; overflow-y: auto; }
.sheet .grab { width: 40px; height: 4px; border-radius: 999px; background: var(--line-strong); margin: 0 auto 12px; }
.sheet .nav-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet .nav-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 12px; background: var(--bg-sunk); color: var(--text); font-size: 12px; font-weight: 700; text-decoration: none; text-align: center; }
.sheet .nav-grid a .ico { width: 24px; height: 24px; color: var(--brand); }
@keyframes up { from { transform: translateY(100%); } }

/* ---------- レスポンシブ ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  body { font-size: 15px; }
  .side { display: none; }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; height: 54px; }
  .page { padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .card { padding: var(--sp-4); border-radius: var(--r-m); }
  .hero { padding: 22px 20px; }
  .hero h2 { font-size: 20px; }
  .mob-only { display: initial; }
  .desk-only { display: none !important; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--bg-elev) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 10.5px; font-weight: 700; color: var(--text-3); text-decoration: none; border: 0; background: transparent; cursor: pointer; position: relative; }
  .tabbar .ico { width: 22px; height: 22px; }
  .tabbar .on { color: var(--brand); }
  .tabbar .badge { position: absolute; top: 4px; left: calc(50% + 6px); height: 16px; min-width: 16px; font-size: 10px; }
  .exam-bar { top: 54px; }
  .days { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 12px 12px; }
  .week-head { padding: 14px; }
  .crit { grid-template-columns: 1fr; gap: 4px; }
  .crit .arrow { transform: rotate(90deg); justify-self: center; }
  .crit .ans { margin-bottom: 10px; }
  .flash { height: 380px; }
  .flash-face { padding: 20px; }
  .flash-face .big { font-size: 24px; }
  .grade { gap: 6px; }
  .grade .btn { padding: 6px 4px; font-size: 13px; }
  .q-text { font-size: 16px; }
  .detail-head .svc-icon { width: 52px; height: 52px; }
  .detail-head h2 { font-size: 21px; }
  table.cmp tbody th { width: 96px; }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .val { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .side, .topbar, .tabbar { display: none; }
  .main { margin: 0; }
}

/* 2026-11 追加：Chart.js・難易度・フロー図・履歴 */
.cjs { position: relative; width: 100%; }
.cjs canvas { display: block; }
.tag.lv-basic { background: var(--ok-soft); color: var(--ok); }
.tag.lv-standard { background: var(--warn-soft); color: var(--warn); }
.tag.lv-advanced { background: var(--ng-soft); color: var(--ng); }
.mermaid-box { overflow-x: auto; text-align: center; min-height: 120px; }
.mermaid-box svg { max-width: 100%; height: auto; }
.table-wrap { overflow-x: auto; }
table.hist { width: 100%; border-collapse: collapse; font-size: 13px; }
table.hist th, table.hist td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.hist th:first-child, table.hist td:first-child { text-align: left; }
table.hist th { color: var(--text-3); font-weight: 700; font-size: 12px; }
