/* Training Methodology — सरल डिजिटल पुस्तक · study UI */
body.study-body { background: var(--bg); }

.study-wrap { max-width: 1180px; margin: 0 auto; padding: 24px 18px 64px; }
.study-wrap-narrow { max-width: 980px; }

/* ---------- hub hero ---------- */
.study-hero {
  position: relative; overflow: hidden; color: #fff; border-radius: var(--radius-lg);
  padding: 38px 34px; background:
    radial-gradient(circle at 88% 18%, rgba(197,139,42,.32), transparent 38%),
    radial-gradient(circle at 12% 92%, rgba(13,107,95,.55), transparent 45%),
    linear-gradient(135deg, var(--navy-2), #123a5e 58%, #0b5047);
  box-shadow: var(--shadow);
}
.study-hero::after {
  content: ""; position: absolute; right: -70px; top: -70px; width: 260px; height: 260px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 50%;
}
.study-hero > * { position: relative; z-index: 1; }
.study-hero .pill.dark { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.28); }
.study-hero h1 {
  font-size: clamp(25px, 4vw, 42px); line-height: 1.15; margin: 14px 0 10px;
  max-width: 760px;
}
.study-hero p.lead { color: #cfe0ea; font-size: 15px; max-width: 680px; margin: 0 0 20px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions .btn-ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.35); }
.hero-actions .btn-ghost:hover { background: rgba(255,255,255,.16); }
.hero-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  margin-top: 26px; max-width: 620px;
}
.hero-stat {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px; padding: 12px 14px;
}
.hero-stat b { display: block; font-family: var(--font-display); font-size: 22px; line-height: 1.15; }
.hero-stat span { font-size: 11.5px; color: #bcd2df; letter-spacing: .3px; }

/* ---------- progress ---------- */
.study-progress { margin-top: 22px; }
.progress-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; margin-bottom: 7px; }
.progress-head b { font-size: 14px; }
.progress-track { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #26a08c); transition: width .4s ease; }

/* ---------- toolbar ---------- */
.study-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 26px 0 16px;
}
.study-toolbar h2 { font-size: 20px; margin: 0; }
.study-toolbar .grow { flex: 1; min-width: 160px; }
.study-search {
  display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; min-width: 240px;
}
.study-search input {
  border: 0; outline: 0; background: transparent; padding: 11px 0; width: 100%;
  font-size: 14px; min-width: 0;
}
.study-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,107,95,.12); }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-weight: 700;
}
.chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- module grid ---------- */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 15px; }
.module-card {
  display: flex; flex-direction: column; gap: 9px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 17px 15px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  position: relative;
}
.module-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.module-card.is-read { border-color: #bfe5ce; background: linear-gradient(180deg, #fff, #f5fcf8); }
.module-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.module-num {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark); font-family: var(--font-display);
  font-weight: 800; font-size: 15px; flex: none;
}
.module-card.is-read .module-num { background: var(--good-soft); color: var(--good); }
.module-card h3 { font-size: 16.5px; margin: 0; line-height: 1.3; }
.module-card h3 a { color: var(--ink); text-decoration: none; }
.module-card h3 a:hover { color: var(--brand); }
.module-sub { margin: 0; font-size: 11.5px; color: var(--muted-2); letter-spacing: .2px; }
.module-tagline { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; flex: 1; }
.module-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.module-meta span {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px;
}
.module-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-top: 1px solid var(--line); padding-top: 11px; margin-top: 2px;
}
.quiz-state { font-size: 11.5px; color: var(--muted); }
.quiz-state strong { color: var(--ink); }
.study-empty { grid-column: 1 / -1; }

/* ---------- chapter layout ---------- */
.chapter-layout {
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px;
  max-width: 1180px; margin: 0 auto; padding: 22px 18px 64px;
  align-items: start;
}
.chapter-side {
  position: sticky; top: calc(var(--header-h) + 14px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; max-height: calc(100vh - var(--header-h) - 30px); overflow: auto;
}
.chapter-side h2 { font-size: 13px; letter-spacing: .4px; color: var(--muted); margin: 0 0 4px; }
.chapter-side .side-sub { font-size: 11.5px; color: var(--muted-2); margin: 0 0 10px; }
.chapter-nav-list { display: flex; flex-direction: column; gap: 2px; }
.chapter-nav-list a {
  display: flex; gap: 9px; align-items: flex-start; padding: 8px 9px; border-radius: 8px;
  text-decoration: none; color: var(--ink); font-size: 12.5px; line-height: 1.4;
}
.chapter-nav-list a:hover { background: var(--surface-2); }
.chapter-nav-list a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.chapter-nav-list .nav-num {
  width: 21px; height: 21px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 10.5px; font-weight: 800; flex: none;
}
.chapter-nav-list a[aria-current="page"] .nav-num { background: var(--brand); color: #fff; border-color: var(--brand); }
.chapter-nav-list a.is-read .nav-num { background: var(--good-soft); color: var(--good); border-color: #bfe5ce; }
.side-progress { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.side-progress .progress-track { height: 6px; margin-top: 6px; }

.chapter-article {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 30px 32px 36px; box-shadow: var(--shadow-sm); min-width: 0;
}
.chapter-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chapter-eyebrow {
  font-size: 11.5px; font-weight: 800; letter-spacing: .6px; color: var(--brand-dark);
  background: var(--brand-soft); border-radius: 999px; padding: 5px 11px;
}
.chapter-article h1 { font-size: clamp(23px, 3.2vw, 33px); margin: 0 0 5px; line-height: 1.2; }
.chapter-subtitle { color: var(--muted-2); font-size: 13px; margin: 0 0 10px; }
.chapter-tagline {
  margin: 0 0 18px; font-size: 15px; color: var(--brand-dark); font-weight: 600;
  border-left: 4px solid var(--brand); padding: 2px 0 2px 12px;
}
.chapter-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chapter-actions .btn.is-read { background: var(--good-soft); color: var(--good); border: 1px solid #bfe5ce; }

.intro-box {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 15px 17px; font-size: 14.5px; color: var(--ink);
}
.intro-box p:last-child { margin-bottom: 0; }

.outcome-box, .key-box, .example-box, .remember-box, .copyright-box {
  border-radius: 12px; padding: 15px 17px; margin: 18px 0;
}
.outcome-box { background: var(--info-soft); border: 1px solid #c9dbfa; }
.outcome-box h2, .key-box h2, .example-box h2, .remember-box h2 {
  font-size: 14px; letter-spacing: .3px; margin: 0 0 8px; text-transform: none;
}
.outcome-box ul, .key-box ul, .example-box ul, .remember-box ul { margin: 0; padding-left: 20px; }
.outcome-box li { margin: 4px 0; font-size: 13.5px; color: #123f8c; }
.key-box { background: var(--brand-soft); border: 1px solid #c6e8e0; }
.key-box li { margin: 5px 0; font-size: 13.5px; color: #0b4a41; }
.example-box { background: var(--accent-soft); border: 1px solid #edd9b0; }
.example-box h2 { color: #6b4a0d; }
.example-box p { margin: 0; font-size: 13.8px; color: #4d3608; line-height: 1.7; }
.remember-box { background: linear-gradient(135deg, #f3effe, #eef4fb); border: 1px solid #d8ccf7; color: #3b2a70; font-weight: 600; font-size: 14px; }

.section-block { margin: 26px 0; }
.section-block h2 {
  font-size: 19px; margin: 0 0 10px; display: flex; gap: 10px; align-items: baseline;
}
.sec-num {
  font-family: var(--font-display); font-size: 12px; font-weight: 800; color: var(--brand);
  background: var(--brand-soft); border-radius: 6px; padding: 2px 7px; flex: none;
}
.section-block p { font-size: 14.5px; line-height: 1.75; color: #23313d; margin: 0 0 9px; }
.section-block ul { margin: 8px 0 0; padding-left: 22px; }
.section-block li { margin: 5px 0; font-size: 14px; line-height: 1.6; }
.section-block li::marker { color: var(--brand); }

/* ---------- figures / diagrams ---------- */
.study-figure {
  margin: 18px 0; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, #f8fbfc, #f2f7f9); padding: 14px 14px 12px;
}
.study-figure .fig-title {
  display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800;
  color: var(--brand-dark); margin-bottom: 11px; letter-spacing: .2px;
}
.fig-canvas { min-width: 0; }
.fig-node {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--line-strong); background: #fff; border-radius: 11px;
  padding: 9px 11px; text-align: left; min-width: 0; color: var(--ink); font: inherit;
}
.fig-node .fig-num {
  position: absolute; top: -7px; left: -5px; width: 20px; height: 20px; border-radius: 7px;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,.14);
}
.fig-node .fig-ic { font-size: 17px; line-height: 1.1; }
.fig-node .fig-label { font-size: 12.8px; line-height: 1.35; }
.fig-node .fig-note { font-size: 11px; color: var(--muted); line-height: 1.4; }
.fig-node.is-concealed { background: #eef3f6; border-style: dashed; }
.fig-node.is-concealed .fig-label { color: var(--muted-2); letter-spacing: 1px; }

.fig-flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.fig-flow .fig-node { flex: 1 1 132px; }
.fig-arrow { display: grid; place-items: center; color: var(--brand); font-size: 17px; font-weight: 900; flex: none; }

.fig-cycle { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 10px; }
.fig-loop-note { margin: 10px 0 0; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--brand-dark); }

.fig-pyramid { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-inline: 4px; }
.fig-pyramid .fig-node { text-align: center; align-items: center; }
.fig-pyramid .fig-node .fig-num { position: static; width: auto; height: auto; background: transparent; color: var(--muted-2); box-shadow: none; font-size: 10px; }

.fig-ladder { display: flex; flex-direction: column; gap: 6px; }
.fig-ladder .fig-node { width: 100%; }

.fig-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fig-col { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px 12px; }
.fig-col h4 { margin: 0 0 6px; font-size: 12.5px; color: var(--brand-dark); }
.fig-col ul { margin: 0; padding-left: 17px; }
.fig-col li { font-size: 12px; line-height: 1.5; margin: 3px 0; }

.fig-map-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 9px; margin-top: 9px; }
.fig-center {
  margin: 0 auto; width: fit-content; max-width: 100%; text-align: center;
  background: var(--brand); color: #fff; border-radius: 999px; padding: 7px 16px;
  font-size: 12.5px; font-weight: 800; box-shadow: 0 5px 14px rgba(0,0,0,.14);
}
.fig-caption { margin: 10px 0 0; font-size: 11.8px; line-height: 1.55; color: var(--muted); }

button.fig-node { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
button.fig-node:hover:not(:disabled) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); transform: translateY(-1px); }
button.fig-node:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 1px; }
button.fig-node.found { border-color: var(--good); background: var(--good-soft); transform: none; }
button.fig-node.found .fig-label { color: #0c5a35; }
button.fig-node.miss { border-color: var(--bad); background: var(--bad-soft); animation: fig-shake .32s ease; }
@keyframes fig-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.fig-interactive .study-figure { margin: 0 0 12px; }

.find-panel { border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); padding: 11px 12px; }
.find-panel .sim-summary { margin-bottom: 9px; }
.find-prompt { margin: 0 0 7px; font-size: 14px; font-weight: 700; line-height: 1.55; color: var(--ink); }
.find-feedback { font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.find-feedback.good { color: var(--good); font-weight: 600; }
.find-feedback.bad { color: var(--bad); font-weight: 600; }

/* ---------- simulators ---------- */
.sim-card, .quiz-card {
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  overflow: hidden; margin: 26px 0; background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.sim-head {
  padding: 14px 17px; background: linear-gradient(120deg, var(--navy), #144766 70%, var(--brand-dark));
  color: #fff;
}
.sim-kicker { display: block; font-size: 10.5px; letter-spacing: 1px; color: #a9c7d7; font-weight: 800; margin-bottom: 2px; }
.sim-head h2 { font-size: 16.5px; margin: 0; color: #fff; }
.sim-head p { margin: 5px 0 0; font-size: 12.5px; color: #c8dbe7; line-height: 1.55; }
.sim-body { padding: 17px; }
.sim-note { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.sim-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; margin-bottom: 12px; font-size: 12.5px; color: var(--muted);
}
.sim-summary b { color: var(--ink); }
.sim-status { font-weight: 700; }
.sim-status.good { color: var(--good); }
.sim-status.bad { color: var(--bad); }
.sim-done {
  margin-top: 12px; background: var(--good-soft); border: 1px solid #bfe5ce; color: #0c5a35;
  border-radius: 10px; padding: 10px 13px; font-size: 13px; font-weight: 700;
}
.sim-hint { margin-top: 10px; font-size: 12.5px; color: var(--muted); }

/* sort */
.sort-item {
  border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px;
  margin-bottom: 9px; background: var(--surface); transition: border-color .15s, background .15s;
}
.sort-item .sort-text { font-size: 13.5px; line-height: 1.55; margin-bottom: 8px; }
.bucket-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.bucket-btn {
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink);
  border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 700;
}
.bucket-btn:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.bucket-btn:disabled { opacity: .55; }
.sort-item.ok { border-color: #bfe5ce; background: #f5fcf8; }
.sort-item.bad { border-color: #f5c6c2; background: #fff7f6; }
.sort-item.ok .bucket-btn.correct { background: var(--good); border-color: var(--good); color: #fff; opacity: 1; }
.sort-item.bad .bucket-btn.correct { background: var(--good-soft); border-color: var(--good); color: var(--good); opacity: 1; }
.sort-item.bad .bucket-btn.chosen { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); opacity: 1; }
.item-feedback { font-size: 12.5px; margin-top: 8px; line-height: 1.55; }
.item-feedback.good { color: var(--good); }
.item-feedback.bad { color: var(--bad); }

/* sequence */
.seq-list { list-style: none; padding: 0; margin: 0; }
.seq-row {
  display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 11px; margin-bottom: 8px; background: var(--surface);
}
.seq-pos {
  width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--muted); flex: none;
}
.seq-text { flex: 1; font-size: 13.3px; line-height: 1.55; min-width: 0; }
.seq-why { display: block; font-size: 12px; color: var(--good); margin-top: 5px; }
.seq-moves { display: flex; gap: 4px; flex: none; }
.move-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface-2); display: grid; place-items: center; font-size: 14px; font-weight: 800;
}
.move-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.move-btn:disabled { opacity: .35; }
.seq-row.ok { border-color: #bfe5ce; background: #f5fcf8; }
.seq-row.bad { border-color: #f5c6c2; background: #fff7f6; }
.sim-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 11px; }

/* conditioning */
.cond-stage {
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
  padding: 14px; text-align: center;
}
.cond-meter { display: flex; gap: 5px; justify-content: center; margin: 10px 0 8px; }
.cond-meter span { width: 34px; height: 8px; border-radius: 999px; background: var(--line-strong); }
.cond-meter span.on { background: var(--brand); }
.cond-state { font-size: 15px; font-weight: 800; color: var(--ink); }
.cond-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.cond-log {
  list-style: none; margin: 12px 0 0; padding: 0; max-height: 150px; overflow: auto;
  font-size: 12px; color: var(--muted);
}
.cond-log li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.cond-log li:last-child { border-bottom: 0; }
.cond-log b { color: var(--ink); }

/* scenario */
.scenario-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }
.scenario-round { font-size: 11.5px; font-weight: 800; color: var(--muted-2); letter-spacing: .4px; }
.scenario-situation {
  font-size: 14.5px; font-weight: 700; line-height: 1.6; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
}
.option-btn {
  display: block; width: 100%; text-align: left; border: 1px solid var(--line-strong);
  background: var(--surface); border-radius: 10px; padding: 11px 12px; margin-bottom: 7px;
  font-size: 13.3px; line-height: 1.5;
}
.option-btn:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.option-btn:disabled { cursor: default; }
.option-btn.ok { border-color: var(--good); background: var(--good-soft); color: #0c5a35; font-weight: 700; }
.option-btn.bad { border-color: var(--bad); background: var(--bad-soft); color: #7a1a13; }
.option-why { display: block; margin-top: 6px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.option-why.good { color: var(--good); }
.option-why.bad { color: var(--bad); }

/* checklist */
.check-list { display: flex; flex-direction: column; gap: 7px; }
.check-row {
  display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 11px; font-size: 13.3px; line-height: 1.55; background: var(--surface);
}
.check-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.check-row.ok { border-color: #bfe5ce; background: #f5fcf8; }
.check-row.bad { border-color: #f5c6c2; background: #fff7f6; }
.check-why { display: block; font-size: 12px; margin-top: 5px; color: var(--muted); }
.check-row.ok .check-why { color: var(--good); }
.check-row.bad .check-why { color: var(--bad); }

/* calculator */
.calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.calc-grid .full { grid-column: 1 / -1; }
.calc-result {
  margin-top: 12px; border: 1px solid #c6e8e0; background: #f4fbf9; border-radius: 12px;
  padding: 13px 15px;
}
.calc-result h3 { font-size: 14px; margin: 0 0 8px; color: var(--brand-dark); }
.calc-result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 9px; }
.calc-stat { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; }
.calc-stat span { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: .3px; }
.calc-stat b { font-size: 16px; font-family: var(--font-display); }
.calc-stat.good b { color: var(--good); }
.calc-stat.bad b { color: var(--bad); }
.calc-msg { font-size: 12.5px; margin-top: 9px; color: var(--muted); line-height: 1.55; }
.calc-msg.bad { color: var(--bad); font-weight: 700; }
.calc-msg.good { color: var(--good); font-weight: 700; }

/* levels */
.level-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.level-chip {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); font-weight: 800; font-size: 14px; display: grid; place-items: center;
}
.level-chip:hover { border-color: var(--brand); color: var(--brand); }
.level-chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.level-chip[data-level="5"] { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent-soft); }
.level-detail { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.level-detail h3 { font-size: 16px; margin: 0 0 5px; }
.level-detail p { margin: 0 0 7px; font-size: 13.5px; }
.level-detail .level-example { font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 8px; }

/* match */
.match-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match-col h3 { font-size: 11.5px; letter-spacing: .5px; color: var(--muted); margin: 0 0 7px; text-transform: uppercase; }
.match-btn {
  display: block; width: 100%; text-align: left; border: 1px solid var(--line-strong);
  border-radius: 9px; padding: 9px 11px; margin-bottom: 6px; font-size: 12.8px;
  background: var(--surface); line-height: 1.45;
}
.match-btn:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.match-btn.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(13,107,95,.18); }
.match-btn.matched { border-color: var(--good); background: var(--good-soft); color: #0c5a35; opacity: 1; }
.match-btn.wrong { border-color: var(--bad); background: var(--bad-soft); }
.match-btn:disabled { cursor: default; opacity: .75; }

/* quiz */
.quiz-q { border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px; margin-bottom: 11px; }
.quiz-q legend, .quiz-q .quiz-question { font-weight: 700; font-size: 13.8px; line-height: 1.55; padding: 0; margin-bottom: 8px; }
.quiz-q fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.quiz-opt {
  display: flex; gap: 9px; align-items: flex-start; padding: 8px 10px; border-radius: 8px;
  border: 1px solid transparent; font-size: 13.2px; line-height: 1.5; cursor: pointer; margin-bottom: 3px;
}
.quiz-opt:hover { background: var(--surface-2); }
.quiz-opt input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.quiz-opt.correct { background: var(--good-soft); border-color: #bfe5ce; }
.quiz-opt.wrong { background: var(--bad-soft); border-color: #f5c6c2; }
.quiz-why { font-size: 12.5px; margin-top: 7px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); line-height: 1.55; }
.quiz-why.good { background: var(--good-soft); color: #0c5a35; }
.quiz-why.bad { background: var(--bad-soft); color: #7a1a13; }
.quiz-score {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-radius: 10px; padding: 11px 14px; font-weight: 700; font-size: 14px; margin-top: 4px;
}
.quiz-score.good { background: var(--good-soft); color: #0c5a35; border: 1px solid #bfe5ce; }
.quiz-score.bad { background: var(--warn-soft); color: #6b3d04; border: 1px solid #f0d9ae; }
.quiz-score b { font-size: 17px; }

/* chapter nav bottom + footer */
.chapter-footnav { display: flex; justify-content: space-between; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.chapter-footnav a { flex: 1; min-width: 200px; }
.study-footer {
  max-width: 1180px; margin: 0 auto; padding: 0 18px 40px; color: var(--muted);
  font-size: 11.8px; line-height: 1.65;
}
.study-footer .copyright-box {
  margin: 0; background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.study-footer b { color: var(--ink); }
.chapter-note {
  margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted); line-height: 1.6;
}

/* hub info strip */
.hub-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.hub-info .panel { padding: 15px; }
.hub-info h3 { font-size: 13.5px; margin: 0 0 4px; }
.hub-info p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.hub-info .ico {
  width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-dark);
  display: grid; place-items: center; font-weight: 800; margin-bottom: 8px; font-size: 13px;
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .chapter-layout { grid-template-columns: 1fr; }
  .chapter-side { position: static; max-height: none; order: 2; }
  .chapter-article { order: 1; padding: 24px 20px 28px; }
  .chapter-nav-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .study-wrap { padding: 16px 12px 48px; }
  .study-hero { padding: 26px 20px; }
  .hero-stats { grid-template-columns: 1fr; gap: 8px; }
  .hero-stat { display: flex; align-items: baseline; gap: 8px; padding: 9px 12px; }
  .hero-stat b { font-size: 19px; }
  .study-toolbar { margin-top: 18px; }
  .study-search { min-width: 100%; }
  .module-grid { grid-template-columns: 1fr; }
  .chapter-layout { padding: 14px 10px 48px; }
  .chapter-article { padding: 20px 15px 24px; border-radius: 14px; }
  .chapter-nav-list { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
  .fig-compare { grid-template-columns: 1fr; }
  .fig-arrow { display: none; }
  .fig-flow .fig-node { flex: 1 1 100%; }
  .fig-pyramid .fig-node { width: 100% !important; }
  .match-wrap { grid-template-columns: 1fr; gap: 8px; }
  .match-col + .match-col { border-top: 1px dashed var(--line); padding-top: 10px; }
  .hub-info { grid-template-columns: 1fr; }
  .study-footer { padding: 0 12px 30px; }
  .chapter-footnav a { min-width: 100%; white-space: normal; line-height: 1.45; }
  .sim-body { padding: 13px; }
  .bucket-btn { font-size: 11.5px; padding: 6px 9px; }
}
@media (max-width: 420px) {
  .chapter-eyebrow { font-size: 10.5px; }
  .chapter-actions .btn { flex: 1; }
  .level-chip { width: 36px; height: 36px; }
}

@media print {
  body.study-body { background: #fff; }
  .fi-header, .chapter-side, .chapter-actions, .sim-actions, .study-footer,
  .chapter-footnav, .chapter-note, .study-toolbar { display: none !important; }
  .chapter-layout { display: block; padding: 0; max-width: none; }
  .chapter-article { border: 0; box-shadow: none; padding: 0; }
  .sim-card, .quiz-card { break-inside: avoid; box-shadow: none; }
  .sim-head { background: #eee !important; color: #000 !important; }
  .sim-head h2, .sim-head .sim-kicker, .sim-head p { color: #000 !important; }
  a { color: #000; text-decoration: none; }
}
