/* ELECTRAL – doctor portal. Self-contained (no framework needed). */
:root{
  --g:#009846; --g-dark:#007a38; --g-deep:#0b3d24; --g-soft:#e6f6ec; --g-line:#cfe9da;
  --ink:#13261b; --muted:#5d6f64; --bg:#f3f7f4; --card:#fff; --line:#e3ebe6;
  --warn:#b7791f; --warn-bg:#fff7e6; --red:#d64545; --red-bg:#fdecec; --blue:#2563eb; --blue-bg:#eaf1ff;
  --r:16px; --shadow:0 1px 2px rgba(16,40,27,.05),0 8px 24px rgba(16,40,27,.07);
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;-webkit-font-smoothing:antialiased}
a{color:var(--g-dark);text-decoration:none}
h1,h2,h3,h4{margin:0;line-height:1.25;color:var(--ink)}
p{margin:0}
.icon{width:1.15em;height:1.15em;flex:none;vertical-align:-.2em}
.wrap{max-width:1080px;margin:0 auto;padding:0 20px}

/* ---------- top bar ---------- */
.topbar{background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:30}
.topbar .wrap{display:flex;align-items:center;justify-content:space-between;height:64px;gap:16px}
.brand img{height:34px;display:block}
.me{display:flex;align-items:center;gap:12px}
.avatar{width:38px;height:38px;border-radius:50%;background:var(--g);color:#fff;display:grid;place-items:center;font-weight:700;font-size:14px;letter-spacing:.3px}
.me-name{font-weight:600;font-size:14px;line-height:1.2}
.me-sub{font-size:12px;color:var(--muted)}
.btn-ghost{display:inline-flex;align-items:center;gap:8px;background:transparent;border:1px solid var(--line);color:var(--ink);padding:8px 14px;border-radius:10px;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.btn-ghost:hover{background:#f6faf7;border-color:var(--g-line)}

/* ---------- buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:12px;padding:12px 20px;font:inherit;font-weight:650;font-size:15px;cursor:pointer;transition:.15s;text-decoration:none;line-height:1.2}
.btn-primary{background:var(--g);color:#fff;box-shadow:0 6px 14px rgba(0,152,70,.25)}
.btn-primary:hover{background:var(--g-dark);color:#fff}
.btn-light{background:#fff;color:var(--g-dark);border:1px solid var(--g-line)}
.btn-light:hover{background:var(--g-soft)}
.btn-white{background:#fff;color:var(--g-dark)}
.btn-white:hover{background:#f1fbf5}
.btn[disabled],.btn.is-disabled{opacity:.45;pointer-events:none;box-shadow:none}
.btn-block{width:100%}
.btn-sm{padding:9px 14px;font-size:13px;border-radius:10px}

/* ---------- alerts ---------- */
.alert{display:flex;gap:10px;align-items:flex-start;padding:12px 16px;border-radius:12px;font-size:14px;margin:18px 0 0;border:1px solid}
.alert-warning{background:var(--warn-bg);border-color:#f3dba5;color:#7a4e07}
.alert-info{background:var(--blue-bg);border-color:#c9daff;color:#1e429f}
.alert-success{background:var(--g-soft);border-color:var(--g-line);color:var(--g-deep)}

/* ---------- hero ---------- */
.hero{margin-top:26px;border-radius:24px;padding:34px;color:#fff;position:relative;overflow:hidden;
  background:radial-gradient(900px 300px at 100% 0%,rgba(255,255,255,.16),transparent 60%),linear-gradient(135deg,#00a84d 0%,#007a38 60%,#0b3d24 130%)}
.hero:after{content:"";position:absolute;right:-60px;bottom:-90px;width:300px;height:300px;border-radius:50%;border:42px solid rgba(255,255,255,.07)}
.hero-grid{display:grid;grid-template-columns:1fr auto;gap:28px;align-items:center;position:relative;z-index:1}
.hero h1{color:#fff;font-size:28px;font-weight:750;letter-spacing:-.3px}
.hero p.sub{opacity:.88;margin-top:8px;max-width:560px}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px}
.chip{display:inline-flex;align-items:center;gap:7px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.22);padding:6px 12px;border-radius:999px;font-size:12.5px;font-weight:550}
.ring{position:relative;width:128px;height:128px}
.ring svg{transform:rotate(-90deg)}
.ring .num{position:absolute;inset:0;display:grid;place-items:center;text-align:center}
.ring .num b{font-size:28px;line-height:1.1;display:block}
.ring .num span{font-size:11px;opacity:.85;margin-top:3px;display:block}

/* ---------- section ---------- */
.sec-head{display:flex;justify-content:space-between;align-items:end;margin:34px 0 14px}
.sec-head h2{font-size:19px}
.sec-head span{color:var(--muted);font-size:13px}

/* ---------- module cards ---------- */
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(310px,1fr));gap:18px}
.mcard{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:22px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:14px;position:relative}
.mcard.is-soon,.mcard.is-locked{background:#f9fbfa;box-shadow:none}
.mcard.is-soon .mtitle,.mcard.is-locked .mtitle{color:#4b5a51}
.mtop{display:flex;justify-content:space-between;align-items:center;gap:10px}
.mnum{width:44px;height:44px;border-radius:13px;background:var(--g-soft);color:var(--g-dark);display:grid;place-items:center;font-weight:800;font-size:18px}
.is-soon .mnum,.is-locked .mnum{background:#eef1ef;color:#8a978f}
.badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;font-size:11.5px;font-weight:700;letter-spacing:.2px}
.b-mand{background:#fff1d6;color:#8a5a00}
.b-elec{background:#e8edff;color:#3646b3}
.b-done{background:var(--g-soft);color:var(--g-deep)}
.b-prog{background:#fff7e6;color:#8a5a00}
.b-soon{background:#eef1ef;color:#66756c}
.b-fail{background:var(--red-bg);color:#a02525}
.mtitle{font-size:17px;font-weight:700}
.mdesc{color:var(--muted);font-size:13.5px}
.bar{height:8px;border-radius:99px;background:#e8efea;overflow:hidden}
.bar>i{display:block;height:100%;background:linear-gradient(90deg,#27c26d,var(--g));border-radius:99px;transition:width .4s}
.bar-meta{display:flex;justify-content:space-between;font-size:12.5px;color:var(--muted);margin-top:7px}
.bar-meta b{color:var(--ink)}
.mfoot{margin-top:auto;display:flex;flex-direction:column;gap:10px}
.soon-note{display:flex;gap:8px;align-items:center;font-size:13px;color:#66756c;background:#f0f4f1;border-radius:12px;padding:11px 13px}

/* ---------- stepper (module overview) ---------- */
.page-head{margin:28px 0 6px;display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted)}
.steps{display:grid;gap:14px;margin-top:20px}
.step{background:#fff;border:1px solid var(--line);border-radius:18px;padding:20px 22px;display:grid;grid-template-columns:48px 1fr auto;gap:16px;align-items:center}
.step .dot{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;font-weight:800;background:#eef1ef;color:#7a897f}
.step.done .dot{background:var(--g);color:#fff}
.step.now{border-color:var(--g);box-shadow:0 0 0 4px var(--g-soft)}
.step.now .dot{background:var(--g-soft);color:var(--g-dark)}
.step h3{font-size:16px}
.step p{color:var(--muted);font-size:13.5px;margin-top:2px}
.step.lock{opacity:.7}
.panel{background:#fff;border:1px solid var(--line);border-radius:20px;padding:26px;box-shadow:var(--shadow)}
.stats3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:18px}
.stat{background:#f6faf7;border:1px solid var(--line);border-radius:14px;padding:14px 16px}
.stat b{display:block;font-size:20px}
.stat span{font-size:12.5px;color:var(--muted)}

/* ---------- reader ---------- */
.reader-top{background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:30}
.reader-top .wrap{max-width:980px;display:flex;align-items:center;gap:14px;height:60px}
.reader-top .ttl{font-weight:650;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}
.reader-top .pg{font-size:13px;color:var(--muted);white-space:nowrap}
.reader-top .pg b{color:var(--ink)}
.reader-bar{height:4px;background:#e8efea}
.reader-bar i{display:block;height:100%;background:var(--g);transition:width .3s}
.icon-btn{width:38px;height:38px;border-radius:10px;border:1px solid var(--line);background:#fff;display:grid;place-items:center;cursor:pointer;color:var(--ink)}
.icon-btn:hover{background:var(--g-soft)}
.reader{max-width:980px;margin:22px auto 120px;padding:0 20px}
.slide{background:#fff;border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow);overflow:hidden;min-height:380px}
.slide img{display:block;width:100%;height:auto}
.slide-body{padding:34px 38px;font-size:16.5px;line-height:1.75}
.slide-body h2{font-size:24px;margin-bottom:14px}
.slide-body img{max-width:100%;height:auto;border-radius:12px}
.slide-body ul,.slide-body ol{padding-left:22px}
.slide-body table{border-collapse:collapse;width:100%}
.slide-body td,.slide-body th{border:1px solid var(--line);padding:8px 10px}
.slide-body code{background:#f1f5f2;padding:2px 6px;border-radius:6px;font-size:.9em}
.readbar{position:fixed;left:0;right:0;bottom:0;background:rgba(255,255,255,.94);backdrop-filter:blur(8px);border-top:1px solid var(--line);z-index:40;padding-bottom:env(safe-area-inset-bottom)}
.readbar .wrap{max-width:980px;display:flex;align-items:center;justify-content:space-between;gap:12px;height:72px}
.readbar .mid{font-size:13px;color:var(--muted);text-align:center}
.readbar .mid b{color:var(--ink);font-size:15px}
/* page jump drawer */
.drawer-bg{position:fixed;inset:0;background:rgba(10,30,20,.45);z-index:60;display:none}
.drawer{position:fixed;top:0;right:0;bottom:0;width:min(380px,92vw);background:#fff;z-index:61;transform:translateX(100%);transition:.25s;padding:22px;overflow:auto}
.drawer.open{transform:none;box-shadow:-10px 0 40px rgba(0,0,0,.15)}
.drawer-bg.open{display:block}
.drawer h3{font-size:17px;margin-bottom:4px}
.pgrid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-top:16px}
.pchip{aspect-ratio:1;border-radius:11px;display:grid;place-items:center;font-weight:650;font-size:14px;border:1px solid var(--line);color:var(--ink);background:#fff}
.pchip.seen{background:var(--g-soft);border-color:var(--g-line);color:var(--g-deep)}
.pchip.cur{background:var(--g);border-color:var(--g);color:#fff}
.pchip.lock{background:#f3f5f4;color:#b2bcb5;pointer-events:none}
.legend{display:flex;gap:14px;font-size:12px;color:var(--muted);margin-top:16px;flex-wrap:wrap}
.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:5px;vertical-align:-1px}

/* ---------- quiz ---------- */
.quiz{max-width:760px;margin:26px auto 60px;padding:0 20px}
.qhead{display:flex;justify-content:space-between;align-items:center;font-size:13px;color:var(--muted);margin-bottom:10px}
.qcard{background:#fff;border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow);padding:30px}
.qnum{font-size:12.5px;font-weight:700;color:var(--g-dark);text-transform:uppercase;letter-spacing:.8px}
.qtext{font-size:20px;font-weight:650;margin:8px 0 20px;line-height:1.4}
.opt{display:flex;gap:14px;align-items:center;border:1.5px solid var(--line);border-radius:14px;padding:14px 16px;margin-bottom:10px;cursor:pointer;transition:.12s;background:#fff}
.opt:hover{border-color:var(--g-line);background:#fafdfb}
.opt input{position:absolute;opacity:0;pointer-events:none}
.opt .k{width:32px;height:32px;border-radius:9px;background:#eef3ef;color:#43544a;display:grid;place-items:center;font-weight:750;font-size:13px;flex:none}
.opt:has(input:checked){border-color:var(--g);background:var(--g-soft)}
.opt:has(input:checked) .k{background:var(--g);color:#fff}
.opt:has(input:focus-visible){outline:3px solid #9fdcb8}
.qnav{display:flex;justify-content:space-between;align-items:center;margin-top:22px;gap:10px}
.dots{display:flex;flex-wrap:wrap;gap:6px;margin-top:16px;justify-content:center}
.dots button{width:30px;height:30px;border-radius:9px;border:1px solid var(--line);background:#fff;font:600 12px inherit;cursor:pointer;color:var(--muted)}
.dots button.ans{background:var(--g-soft);border-color:var(--g-line);color:var(--g-deep)}
.dots button.cur{outline:2px solid var(--g);outline-offset:1px}
.qpane{display:none}.qpane.show{display:block}

/* ---------- result ---------- */
.res{display:grid;grid-template-columns:auto 1fr;gap:28px;align-items:center}
.score-ring{position:relative;width:150px;height:150px}
.score-ring svg{transform:rotate(-90deg)}
.score-ring .num{position:absolute;inset:0;display:grid;place-items:center;text-align:center}
.score-ring b{font-size:34px;line-height:1}
.score-ring span{font-size:12px;color:var(--muted);display:block;margin-top:2px}
.review{margin-top:22px;display:grid;gap:12px}
.rv{background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px 20px;border-left:5px solid var(--line)}
.rv.ok{border-left-color:var(--g)}.rv.no{border-left-color:var(--red)}
.rv h4{font-size:15px;margin-bottom:10px}
.rv .ans{font-size:13.5px;margin-top:4px;display:flex;gap:8px;align-items:flex-start}
.rv .ans .t{font-weight:700;min-width:96px;color:var(--muted)}
.rv .expl{margin-top:10px;background:#f6faf7;border-radius:10px;padding:10px 12px;font-size:13.5px;color:#3d5246}

/* ---------- login ---------- */
.login-shell{min-height:100vh;display:grid;grid-template-columns:1.05fr 1fr}
.login-art{position:relative;color:#fff;padding:48px;display:flex;flex-direction:column;justify-content:space-between;overflow:hidden;
  background:radial-gradient(700px 420px at 90% 0%,rgba(255,255,255,.18),transparent 60%),linear-gradient(150deg,#00a84d 0%,#007a38 55%,#0b3d24 120%)}
.login-art:before,.login-art:after{content:"";position:absolute;border-radius:50%;border:48px solid rgba(255,255,255,.07)}
.login-art:before{width:420px;height:420px;right:-140px;bottom:-120px}
.login-art:after{width:240px;height:240px;left:-90px;top:40%}
.login-art .logo-pill{align-self:flex-start;background:#fff;border-radius:14px;padding:10px 16px;display:inline-block;position:relative;z-index:1}
.login-art .logo-pill img{height:34px;display:block}
.login-art h2{color:#fff;font-size:34px;line-height:1.15;letter-spacing:-.5px;max-width:430px;position:relative;z-index:1}
.login-art p{opacity:.9;max-width:420px;margin-top:14px;position:relative;z-index:1}
.feat{display:grid;gap:12px;margin-top:28px;position:relative;z-index:1}
.feat div{display:flex;gap:12px;align-items:center;font-size:14.5px}
.feat .ic{width:34px;height:34px;border-radius:10px;background:rgba(255,255,255,.16);display:grid;place-items:center}
.login-art small{opacity:.7;position:relative;z-index:1}
.login-form-side{display:grid;place-items:center;padding:36px 22px;background:#fff}
.login-box{width:100%;max-width:410px}
.login-box .mlogo{display:none;margin-bottom:22px}
.login-box .mlogo img{height:38px}
.login-box h1{font-size:28px;letter-spacing:-.4px}
.login-box .lead{color:var(--muted);margin-top:6px}
.tabs{display:grid;grid-template-columns:1fr 1fr;background:#eef3ef;border-radius:14px;padding:5px;margin:26px 0 22px}
.tabs a{display:flex;align-items:center;justify-content:center;gap:8px;padding:11px 8px;border-radius:10px;font-weight:650;font-size:14px;color:#5d6f64}
.tabs a.on{background:#fff;color:var(--g-dark);box-shadow:0 2px 8px rgba(16,40,27,.1)}
.field{margin-bottom:16px}
.field label{display:block;font-weight:650;font-size:13.5px;margin-bottom:7px}
.input{position:relative}
.input .lead-ic{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#7c8d83}
.input input{width:100%;height:50px;border:1.5px solid var(--line);border-radius:12px;padding:0 44px 0 44px;font:inherit;font-size:15.5px;background:#fbfdfc;color:var(--ink);transition:.15s}
.input input:focus{outline:none;border-color:var(--g);background:#fff;box-shadow:0 0 0 4px var(--g-soft)}
.input input.bad{border-color:var(--red)}
.input .eye{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:38px;height:38px;border:0;background:transparent;cursor:pointer;color:#7c8d83;border-radius:10px;display:grid;place-items:center}
.input .eye:hover{background:#f0f4f1}
.err{color:var(--red);font-size:13px;margin-top:6px}
.hint{display:flex;gap:10px;background:var(--g-soft);border:1px solid var(--g-line);color:var(--g-deep);border-radius:12px;padding:11px 13px;font-size:13px;margin-top:18px}
.remember{display:flex;align-items:center;gap:8px;font-size:13.5px;color:var(--muted);margin:2px 0 18px}

/* ---------- misc ---------- */
.foot{text-align:center;color:#8a978f;font-size:12.5px;padding:34px 0 40px}
.back{display:inline-flex;align-items:center;gap:6px;font-weight:600;font-size:13.5px}
@media(max-width:860px){
  .login-shell{grid-template-columns:1fr}.login-art{display:none}.login-box .mlogo{display:block}
  .hero{padding:24px}.hero-grid{grid-template-columns:1fr}.ring{margin-top:4px}
  .hero h1{font-size:23px}
  .res{grid-template-columns:1fr;justify-items:center;text-align:center}
}
@media(max-width:560px){
  .me-name,.me-sub{display:none}
  .slide-body{padding:22px 20px;font-size:15.5px}
  .pgrid{grid-template-columns:repeat(5,1fr)}
  .stats3{grid-template-columns:1fr}
  .step{grid-template-columns:40px 1fr}.step .dot{width:40px;height:40px}.step>.btn,.step>span{grid-column:1/-1}
  .qcard{padding:22px 18px}.qtext{font-size:18px}
  .readbar .btn{padding:11px 14px;font-size:14px}
}
@media(max-width:560px){.hide-sm{display:none}}


/* ================================================================
   CHAPTER CONTENT: shared formatting for all 16 chapters
   Edit chapter HTML in database/seeders/data/chapters/chapter-XX.html.
   ================================================================ */
.chapter-content {
    font-size: 16px;
    line-height: 1.58;
    overflow-wrap: anywhere;
}
.chapter-content > :first-child { margin-top: 0; }
.chapter-content p {
    margin: 0 0 10px;
    line-height: 1.58;
}
.chapter-content h1,
.chapter-content h2,
.chapter-content h3,
.chapter-content h4,
.chapter-content h5,
.chapter-content h6 {
    line-height: 1.3;
    margin: 20px 0 9px;
    font-weight: 750;
}
.chapter-content h1 { font-size: 1.55rem; }
.chapter-content h2 { font-size: 1.35rem; }
.chapter-content h3 { font-size: 1.16rem; }
.chapter-content h4,
.chapter-content h5,
.chapter-content h6 { font-size: 1.04rem; }
.chapter-content ul,
.chapter-content ol {
    margin: 3px 0 12px;
    padding-left: 25px;
}
.chapter-content li {
    margin: 0 0 4px;
    padding: 0;
    line-height: 1.5;
}
.chapter-content li:last-child { margin-bottom: 0; }
.chapter-content li p { margin: 0; }
.chapter-content .doc-list {
    margin: 0 0 4px;
    padding-left: 0;
}
.chapter-content .doc-reference {
    margin-top: 14px;
    font-size: .92em;
    line-height: 1.5;
}
.chapter-content sup { font-size: .72em; vertical-align: super; line-height: 0; }
.chapter-content sub { font-size: .72em; vertical-align: sub; line-height: 0; }
.chapter-content u { text-decoration: underline; text-underline-offset: 2px; }
.chapter-content mark,
.chapter-content .highlight {
    background: #fff0a8;
    color: inherit;
    padding: 0 .12em;
    border-radius: 2px;
}
.chapter-content .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    margin: 16px 0 20px;
    border: 1px solid var(--g-line, #cfe9da);
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
}
.chapter-content table {
    width: 100%;
    min-width: 560px;
    margin: 0;
    border-collapse: collapse;
    border-spacing: 0;
    background: #fff;
}
.chapter-content table th,
.chapter-content table td {
    border: 1px solid #dce8e2;
    padding: 11px 13px;
    text-align: left;
    vertical-align: top;
    line-height: 1.5;
}
.chapter-content table th p,
.chapter-content table td p { margin: 0; }
.chapter-content table thead th,
.chapter-content table tr:first-child > th[colspan],
.chapter-content table tr:first-child > td[colspan] {
    background: #e2f5ec;
    color: #13261b;
    font-weight: 750;
}
.chapter-content table tr:first-child > th[colspan] p,
.chapter-content table tr:first-child > td[colspan] p { margin: 0; }
@media (max-width: 640px) {
    .chapter-content { font-size: 15px; }
    .chapter-content table th,
    .chapter-content table td { padding: 9px 10px; }
}

/* ---------- shared chapter content formatting ---------- */
.chapter-content { color: var(--ink); line-height: 1.6; overflow-wrap: anywhere; }
.chapter-content p { margin: 0 0 10px; }
.chapter-content h1, .chapter-content h2, .chapter-content h3,
.chapter-content h4, .chapter-content h5, .chapter-content h6 {
  color: var(--ink); line-height: 1.3; margin: 18px 0 8px;
}
.chapter-content h1:first-child, .chapter-content h2:first-child,
.chapter-content h3:first-child, .chapter-content h4:first-child { margin-top: 0; }
.chapter-content ul, .chapter-content ol { margin: 4px 0 12px; padding-left: 24px; }
.chapter-content li { margin: 0 0 4px; padding: 0; line-height: 1.5; }
.chapter-content li p { margin: 0 0 4px; }
.chapter-content sup { vertical-align: super; font-size: .75em; line-height: 0; }
.chapter-content sub { vertical-align: sub; font-size: .75em; line-height: 0; }
.chapter-content u, .chapter-content .underline { text-decoration: underline; text-underline-offset: 3px; }
.chapter-content mark, .chapter-content .highlight { background: #fff1a8; color: inherit; padding: 0 .12em; }

/* Responsive tables: title is a single merged row, data headings stay column-wise. */
.chapter-content .table-wrap { width: 100%; max-width: 100%; overflow-x: auto; margin: 16px 0; border: 1px solid var(--g-line); border-radius: 12px; }
.chapter-content table { width: 100%; border-collapse: collapse; border-spacing: 0; margin: 0; }
.chapter-content table th, .chapter-content table td { border: 1px solid #dce8e2; padding: 11px 12px; text-align: left; vertical-align: top; }
.chapter-content table th p, .chapter-content table td p { margin: 0; }
.chapter-content table tr:first-child > th[colspan],
.chapter-content table tr:first-child > td[colspan] { background: #e2f5ec; color: #10291c; font-weight: 700; }
.chapter-content table tr:first-child > th[colspan] p,
.chapter-content table tr:first-child > td[colspan] p { margin: 0; }
.chapter-content table thead tr:not(:first-child) th,
.chapter-content table tr:nth-child(2) > th,
.chapter-content table tr:nth-child(2) > td { background: #f1faf5; font-weight: 700; }
.chapter-content table tbody tr:nth-child(even) { background: #fbfdfc; }

/* Keep existing Previous / Next button UI; also style buttons included in chapter HTML. */
.readbar .btn, .chapter-content .btn, .chapter-content button,
.chapter-content input[type="button"], .chapter-content input[type="submit"],
.chapter-content a.button, .chapter-content a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--g-line); border-radius: 10px; padding: 9px 15px;
  background: var(--g); color: #fff; font: inherit; font-weight: 650;
  line-height: 1.25; text-decoration: none; cursor: pointer; transition: background .15s ease;
}
.readbar .btn-primary, .chapter-content .btn-primary,
.chapter-content button.btn-primary, .chapter-content a.button-primary {
  background: var(--g); color: #fff; border-color: var(--g); box-shadow: 0 5px 12px rgba(0,152,70,.18);
}
.readbar .btn-primary:hover, .chapter-content .btn-primary:hover,
.chapter-content button:hover, .chapter-content a.button:hover { background: var(--g-dark); color: #fff; }
.readbar .btn-light, .chapter-content .btn-light, .chapter-content .btn-secondary {
  background: #fff; color: var(--g-dark); border-color: var(--g-line); box-shadow: none;
}
.readbar .btn-light:hover, .chapter-content .btn-light:hover,
.chapter-content .btn-secondary:hover { background: var(--g-soft); color: var(--g-dark); }
.chapter-content a:not(.button):not(.btn) { color: var(--g-dark); text-decoration: underline; text-underline-offset: 2px; }
.chapter-content img { max-width: 100%; height: auto; }
@media (max-width: 640px) {
  .slide-body { padding: 22px 16px; font-size: 15.5px; }
  .chapter-content table th, .chapter-content table td { padding: 9px 10px; min-width: 110px; }
  .chapter-content table tr:first-child > th[colspan] { min-width: 0; }
}

/* ---------- Word/PPT-style content labels and compact lists ---------- */
.chapter-content p.content-button {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin: 10px 0 16px 7px;
    padding: 8px 13px;
    border: 0;
    border-radius: 2px;
    background: linear-gradient(180deg, #66bd45 0%, #319d20 100%);
    color: #fff;
    font-weight: 700;
    line-height: 1.25;
    box-shadow: 0 3px 7px rgba(0, 0, 0, .25);
}

/* Source content sometimes represents bullets as paragraphs with a bullet glyph. */
.chapter-content p.doc-list {
    margin: 0 0 4px !important;
    padding: 0 !important;
    line-height: 1.5;
}
.chapter-content p.doc-list + p.doc-list {
    margin-top: 0 !important;
}

/* One shared look for all table title rows, including colspan headings. */
.chapter-content table tr:first-child > th[colspan],
.chapter-content table tr:first-child > td[colspan] {
    background: #e2f5ec !important;
    color: #13261b;
    font-weight: 700;
}
.chapter-content table tr:first-child > th[colspan] p,
.chapter-content table tr:first-child > td[colspan] p {
    margin: 0 !important;
}


/* ---------- doctor application sidebar / breadcrumb ---------- */
.doctor-app { background:#f3f7f4; }
.doctor-shell { min-height:100vh; display:flex; }
.doctor-sidebar { width:282px; flex:0 0 282px; background:#fff; border-right:1px solid #dfe9e3; display:flex; flex-direction:column; min-height:100vh; position:sticky; top:0; height:100vh; z-index:60; transition:width .2s, flex-basis .2s, transform .2s; }
.sidebar-brand { height:68px; padding:0 16px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #edf2ee; gap:10px; }
.sidebar-logo img { display:block; max-width:156px; max-height:38px; object-fit:contain; }
.sidebar-toggle { width:30px; height:30px; border:1px solid #dce9e1; background:#fff; border-radius:8px; font-size:22px; line-height:1; cursor:pointer; color:#137943; }
.sidebar-profile { display:flex; align-items:center; gap:11px; padding:16px; border-bottom:1px solid #edf2ee; min-width:0; }
.sidebar-profile-text { display:flex; flex-direction:column; min-width:0; gap:2px; }
.sidebar-profile-text strong { font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-profile-text span { font-size:11px; color:#718176; }
.sidebar-nav { padding:12px 10px; flex:1; overflow-y:auto; }
.sidebar-section { padding:17px 12px 8px; color:#8b9b90; font-size:10px; font-weight:800; letter-spacing:.1em; }
.sidebar-link { display:flex; align-items:center; gap:11px; width:100%; min-height:42px; padding:10px 12px; border-radius:10px; color:#34483b; font-size:13px; font-weight:650; text-decoration:none; border:0; background:transparent; text-align:left; cursor:pointer; }
.sidebar-link:hover { background:#f1f8f3; color:#087b3d; }
.sidebar-link.active { color:#087b3d; background:#e5f6eb; box-shadow:inset 3px 0 #009846; }
.sidebar-icon { width:20px; flex:0 0 20px; text-align:center; font-size:20px; line-height:1; }
.sidebar-label { min-width:0; }
.sidebar-module { padding:3px 0; }
.module-link { gap:9px; }
.module-number { flex:0 0 27px; width:27px; height:27px; display:grid; place-items:center; border-radius:8px; background:#eef7f1; color:#087b3d; font-size:10px; font-weight:800; }
.module-title { flex:1; line-height:1.35; }
.mandatory-dot { color:#e0a02a; font-weight:900; }
.sidebar-subnav { display:none; margin:1px 0 6px 46px; padding-left:11px; border-left:1px solid #d8e8dd; }
.sidebar-module.expanded .sidebar-subnav { display:grid; }
.sidebar-sublink { display:block; padding:7px 6px; color:#5e7064; font-size:12px; line-height:1.3; border-radius:6px; }
.sidebar-sublink:hover { background:#f1f8f3; color:#087b3d; }
.sidebar-status { padding:0 10px 7px 47px; color:#8b978f; font-size:10px; }
.sidebar-status.is-done { color:#087b3d; }
.sidebar-progress { height:3px; background:#eaf0ec; margin:0 10px 7px 47px; border-radius:99px; overflow:hidden; }
.sidebar-progress i { display:block; height:100%; background:#009846; }
.sidebar-empty { padding:12px; color:#7b8b80; font-size:12px; }
.sidebar-bottom { padding:10px; border-top:1px solid #edf2ee; }
.sidebar-bottom form { margin:0; }
.logout-link { color:#a33d3d; }
.logout-link:hover { background:#fff0f0; color:#9c2222; }
.doctor-main { flex:1; min-width:0; }
.app-topbar { height:68px; background:#fff; border-bottom:1px solid #e1eae4; display:flex; align-items:center; gap:16px; padding:0 26px; position:sticky; top:0; z-index:40; }
.breadcrumbs { display:flex; align-items:center; gap:10px; min-width:0; flex:1; font-size:13px; color:#7b8b80; }
.breadcrumbs a { color:#708176; }
.breadcrumbs strong { color:#183b28; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.topbar-doctor { display:flex; align-items:center; gap:9px; font-size:12px; font-weight:650; white-space:nowrap; }
.small-avatar { width:30px; height:30px; font-size:11px; }
.mobile-sidebar-toggle { display:none; border:1px solid #dfe9e3; border-radius:8px; background:#fff; color:#176d3d; padding:6px 9px; font-size:18px; }
.doctor-main-content { min-width:0; }
.sidebar-overlay { display:none; }
.sidebar-collapsed .doctor-sidebar { width:78px; flex-basis:78px; }
.sidebar-collapsed .sidebar-brand { padding:0 12px; justify-content:center; }
.sidebar-collapsed .sidebar-logo { display:block; width:38px; overflow:hidden; flex:0 0 38px; }
.sidebar-collapsed .sidebar-logo img { max-width:38px; max-height:34px; object-fit:contain; object-position:left center; }
.sidebar-collapsed .sidebar-brand { justify-content:flex-start; gap:4px; padding:0 8px; }
.sidebar-collapsed .sidebar-toggle { width:26px; height:28px; flex:0 0 26px; font-size:19px; }
.sidebar-collapsed .sidebar-profile { justify-content:center; padding:14px 6px; }
.sidebar-collapsed .sidebar-profile-text, .sidebar-collapsed .sidebar-label, .sidebar-collapsed .mandatory-dot, .sidebar-collapsed .sidebar-subnav, .sidebar-collapsed .sidebar-status, .sidebar-collapsed .sidebar-progress { display:none !important; }
.sidebar-collapsed .sidebar-link { justify-content:center; padding:10px 5px; }
.sidebar-collapsed .module-number { flex-basis:32px; width:32px; height:32px; }
.sidebar-collapsed .sidebar-section { font-size:0; padding:10px 0; }
.sidebar-collapsed .sidebar-toggle { transform:rotate(180deg); }
/* Chapter content formatting: apply to the actual HTML wrapper in page.blade.php. */
.chapter-content { color:var(--ink); font-size:16px; line-height:1.65; overflow-wrap:anywhere; }
.chapter-content p { margin:0 0 12px; }
.chapter-content h1,.chapter-content h2,.chapter-content h3,.chapter-content h4 { margin:20px 0 10px; line-height:1.35; }
.chapter-content h3 { padding:2px 8px; background:linear-gradient(90deg,#d8f2d1 0%,#d8f2d1 72%,transparent 72%); font-size:1.08rem; }
.chapter-content .key-points { margin:20px 0 14px; border:1px solid #283b2f; background:#fff; padding:12px 16px; }
.chapter-content .key-points h3 { margin:0 0 6px; padding:0; background:none; font-size:1rem; }
.chapter-content .key-points ul { margin:0; padding-left:24px; }
.chapter-content .key-points li { margin:0 0 4px; padding:0; line-height:1.45; }
.chapter-content .key-points li:last-child { margin-bottom:0; }
.chapter-content .doc-reference { margin:8px 0 14px; font-size:.86rem; line-height:1.5; overflow-wrap:anywhere; }
.chapter-content .doc-reference strong:first-child { font-weight:750; }
.chapter-content .content-button { display:inline-flex; align-items:center; justify-content:center; width:fit-content; max-width:100%; margin:8px 7px 14px; padding:9px 15px; border-radius:3px; background:linear-gradient(180deg,#67bd45,#329c20); color:#fff; font-weight:750; box-shadow:0 3px 7px #0003; }
.chapter-content p.doc-list { margin:0 0 4px !important; padding:0 !important; line-height:1.5; }
.chapter-content p.doc-list + p.doc-list { margin-top:0 !important; }
.chapter-content .communication-flow { display:flex; align-items:center; justify-content:flex-start; gap:14px; flex-wrap:wrap; margin:18px 6px 22px; }
.chapter-content .communication-step { min-width:150px; min-height:58px; padding:12px 16px; display:flex; align-items:center; justify-content:center; text-align:center; border-radius:6px; background:linear-gradient(180deg,#437d98,#075879); color:#fff; font-weight:750; line-height:1.25; box-shadow:0 3px 7px #0004; }
.chapter-content .communication-arrow { color:#aab9c2; font-size:34px; line-height:1; font-weight:700; text-shadow:0 2px 3px #0002; }
@media (max-width:900px) {
 .doctor-sidebar { position:fixed; left:0; top:0; transform:translateX(-102%); width:282px; flex-basis:282px; box-shadow:8px 0 28px #14271b1a; }
 .sidebar-mobile-open .doctor-sidebar { transform:translateX(0); }
 .sidebar-overlay { display:none; position:fixed; inset:0; background:#10231966; z-index:50; }
 .sidebar-mobile-open .sidebar-overlay { display:block; }
 .mobile-sidebar-toggle { display:inline-flex; align-items:center; justify-content:center; }
 .app-topbar { padding:0 14px; height:60px; }
 .topbar-doctor > span:first-child { display:none; }
 .sidebar-collapsed .doctor-sidebar { width:282px; flex-basis:282px; }
 .sidebar-collapsed .sidebar-label, .sidebar-collapsed .sidebar-profile-text, .sidebar-collapsed .sidebar-subnav, .sidebar-collapsed .sidebar-status, .sidebar-collapsed .sidebar-progress { display:initial !important; }
 .sidebar-collapsed .sidebar-link { justify-content:flex-start; }
 .sidebar-collapsed .sidebar-module.expanded .sidebar-subnav { display:grid !important; }
}
@media (max-width:600px) {
 .breadcrumbs { font-size:12px; }
 .breadcrumbs a { display:none; }
 .chapter-content { font-size:15px; }
 .chapter-content .communication-flow { gap:8px; }
 .chapter-content .communication-step { min-width:120px; flex:1 1 120px; }
 .chapter-content .communication-arrow { font-size:24px; }
}


/* ---------- Interactive single-question quiz ---------- */
.quiz-modern { max-width:900px; margin:28px auto 70px; }
.quiz-intro { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:24px 28px; margin-bottom:20px; border:1px solid #dcebe1; border-radius:22px; background:linear-gradient(135deg,#ffffff 0%,#effaf3 100%); box-shadow:0 12px 30px rgba(24,74,44,.06); }
.quiz-intro h1 { margin:5px 0 7px; color:#173b28; font-size:clamp(21px,3vw,29px); line-height:1.25; text-align:left; }
.quiz-intro p { margin:0; color:#687b6e; font-size:13px; line-height:1.55; }
.quiz-kicker { color:#078344; font-size:10px; font-weight:850; letter-spacing:.16em; }
.quiz-total { display:flex; flex-direction:column; align-items:center; justify-content:center; width:76px; height:76px; flex:0 0 76px; border-radius:20px; color:#087b3d; background:#fff; border:1px solid #d8ebdf; box-shadow:0 5px 14px rgba(15,92,47,.08); }
.quiz-total strong { font-size:26px; line-height:1.05; }
.quiz-total span { margin-top:4px; font-size:10px; font-weight:700; }
.quiz-progress-head { display:flex; justify-content:space-between; gap:12px; margin:0 3px 8px; color:#66776b; font-size:12px; font-weight:700; }
.quiz-progress-track { height:8px; margin-bottom:18px; border-radius:99px; background:#e5eee8; overflow:hidden; }
.quiz-progress-track i { display:block; height:100%; border-radius:99px; background:linear-gradient(90deg,#0b8d48,#36bd78); transition:width .35s ease; }
.quiz-modern .qcard { min-height:310px; padding:clamp(22px,4vw,38px); border:1px solid #e0eae3; border-radius:22px; box-shadow:0 15px 40px rgba(26,61,39,.08); text-align:left; }
.quiz-modern .qcard-top { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; }
.quiz-modern .qnum { display:inline-flex; align-items:center; padding:7px 11px; border-radius:8px; color:#087b3d; background:#e8f7ed; font-size:11px; letter-spacing:.08em; }
.q-required { color:#9a6a24; font-size:11px; font-weight:700; }
.q-required span { color:#d04444; }
.quiz-modern .qtext { margin:0 0 24px; color:#172b20; font-size:clamp(18px,2.5vw,23px); font-weight:750; line-height:1.45; text-align:left; }
.options-list { display:grid; gap:11px; }
.quiz-modern .opt { position:relative; display:flex; gap:13px; align-items:center; min-height:62px; margin:0; padding:13px 16px; border:1.5px solid #e1e9e3; border-radius:14px; background:#fff; text-align:left; transition:border-color .2s,background .2s,box-shadow .2s,transform .2s; }
.quiz-modern .opt:hover { transform:translateY(-1px); border-color:#8bd0a5; background:#f8fdf9; box-shadow:0 5px 14px rgba(23,100,53,.06); }
.quiz-modern .opt input { position:absolute; opacity:0; width:1px; height:1px; }
.quiz-modern .option-letter { display:grid; place-items:center; width:36px; height:36px; flex:0 0 36px; border:1px solid #e1e9e3; border-radius:11px; color:#52675a; background:#f4f7f5; font-size:12px; font-weight:850; }
.quiz-modern .option-text { flex:1; color:#26382d; font-size:15px; line-height:1.5; }
.quiz-modern .option-check { display:grid; place-items:center; width:23px; height:23px; flex:0 0 23px; border-radius:50%; color:transparent; border:1px solid #dce6df; font-size:13px; font-weight:900; }
.quiz-modern .opt:has(input:checked) { border-color:#159650; background:#effaf3; box-shadow:0 0 0 3px rgba(21,150,80,.08); }
.quiz-modern .opt:has(input:checked) .option-letter { color:#fff; border-color:#078344; background:#078344; }
.quiz-modern .opt:has(input:checked) .option-check { color:#fff; border-color:#078344; background:#078344; }
.quiz-modern .opt:has(input:focus-visible) { outline:3px solid #9fdcb8; outline-offset:3px; }
.question-error { margin:14px 0 0; padding:10px 12px; border-radius:9px; color:#9b2828; background:#fff1f1; font-size:12px; font-weight:650; }
.question-error[hidden], .quiz-global-error[hidden], .quiz-btn[hidden] { display:none !important; }
.quiz-global-error { margin:14px 0 0; padding:12px 14px; border:1px solid #f0caca; border-radius:10px; color:#9b2828; background:#fff5f5; font-size:13px; }
.quiz-nav { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:18px; }
.quiz-nav-hint { flex:1; color:#718075; font-size:11px; text-align:center; }
.quiz-btn { display:inline-flex; align-items:center; justify-content:center; gap:10px; min-height:44px; padding:11px 18px; border:1px solid transparent; border-radius:12px; font:700 13px/1.2 inherit; text-decoration:none; cursor:pointer; transition:transform .18s,box-shadow .18s,background .18s; }
.quiz-btn:hover { transform:translateY(-1px); }
.quiz-btn:disabled { opacity:.45; cursor:not-allowed; transform:none; }
.quiz-btn-primary { color:#fff; background:linear-gradient(135deg,#079348,#00a65a); box-shadow:0 6px 14px rgba(0,145,70,.2); }
.quiz-btn-primary:hover { box-shadow:0 9px 20px rgba(0,145,70,.27); }
.quiz-btn-secondary { color:#31513d; background:#fff; border-color:#dce8e0; }
.quiz-question-map { margin-top:22px; padding:17px 18px; border:1px solid #e2ebe5; border-radius:16px; background:#fff; }
.question-map-label { display:block; margin-bottom:12px; color:#7b8a7f; font-size:10px; font-weight:850; letter-spacing:.12em; }
.quiz-modern .dots { display:flex; flex-wrap:wrap; justify-content:flex-start; gap:8px; margin:0; }
.quiz-modern .dots button { width:36px; height:36px; border-radius:11px; border:1px solid #dfe8e2; color:#65766a; background:#fff; font-size:12px; font-weight:800; transition:all .18s; }
.quiz-modern .dots button:disabled { opacity:.45; cursor:not-allowed; }
.quiz-modern .dots button.ans { border-color:#b9e3c7; color:#087b3d; background:#e9f8ee; }
.quiz-modern .dots button.cur { outline:none; border-color:#078344; color:#fff; background:#078344; box-shadow:0 0 0 3px rgba(7,131,68,.13); }
.map-legend { display:flex; flex-wrap:wrap; gap:15px; margin-top:13px; color:#748277; font-size:10px; }
.map-legend span { display:inline-flex; align-items:center; gap:6px; }
.map-legend i { width:9px; height:9px; border-radius:3px; display:inline-block; }
.legend-current { background:#078344; }.legend-answered { background:#b9e3c7; }.legend-unanswered { background:#e8ede9; border:1px solid #cfdad2; }
.qpane.show.slide-from-right { animation:quizSlideRight .32s cubic-bezier(.2,.75,.25,1) both; }
.qpane.show.slide-from-left { animation:quizSlideLeft .32s cubic-bezier(.2,.75,.25,1) both; }
.qpane.needs-answer { animation:quizNudge .28s ease; }
@keyframes quizSlideRight { from { opacity:0; transform:translateX(22px); } to { opacity:1; transform:translateX(0); } }
@keyframes quizSlideLeft { from { opacity:0; transform:translateX(-22px); } to { opacity:1; transform:translateX(0); } }
@keyframes quizNudge { 0%,100% { transform:translateX(0); } 25% { transform:translateX(-5px); } 75% { transform:translateX(5px); } }
@media (max-width:640px) {
 .quiz-modern { margin:14px auto 40px; padding:0 12px; }
 .quiz-intro { padding:18px; border-radius:16px; }
 .quiz-total { width:58px; height:58px; flex-basis:58px; border-radius:15px; }
 .quiz-total strong { font-size:21px; }
 .quiz-modern .qcard { min-height:0; padding:20px 16px; border-radius:16px; }
 .quiz-modern .opt { min-height:56px; padding:11px; gap:10px; }
 .quiz-modern .option-text { font-size:14px; }
 .quiz-nav { flex-wrap:wrap; }
 .quiz-nav-hint { order:3; flex-basis:100%; }
 .quiz-btn { padding:11px 13px; }
 .quiz-modern .dots { gap:6px; }
 .quiz-modern .dots button { width:32px; height:32px; }
}
@media (prefers-reduced-motion:reduce) {
 .qpane.show.slide-from-right,.qpane.show.slide-from-left,.qpane.needs-answer { animation:none; }
 .quiz-modern *, .quiz-progress-track i { transition:none !important; }
}


/* ===== Doctor portal layout fixes (keep these overrides at the end) ===== */
.sidebar-brand { min-height:76px; height:76px; padding:8px 14px; gap:8px; }
.sidebar-logo { display:flex; align-items:center; justify-content:center; min-width:0; flex:1 1 auto; }
.sidebar-logo img { width:100%; max-width:190px; max-height:50px; height:auto; object-fit:contain; object-position:left center; }
.sidebar-module.expanded .sidebar-subnav,
.sidebar-subnav { display:none !important; }
.sidebar-status, .sidebar-progress { display:none; }
.doctor-main-content { padding:0 24px 100px; }
.doctor-main-content > .wrap { max-width:1240px; }
.reader { max-width:1100px; margin:22px auto 125px; }
.slide { min-height:0; }
.slide-body { padding:30px 38px; }
.readbar { left:282px; right:0; z-index:45; }
.sidebar-collapsed .readbar { left:78px; }
.readbar .wrap { max-width:none; width:100%; padding:0 28px; }
.readbar .mid { line-height:1.45; min-width:110px; }
.readbar .btn { white-space:nowrap; }
.quiz-modern { max-width:1000px; padding-bottom:24px; }
.qcard { min-width:0; }
.options-list { display:grid; gap:10px; }
.opt { margin:0; min-width:0; }
.option-text { overflow-wrap:anywhere; }
@media (max-width:900px) {
  .doctor-main-content { padding:0 14px 100px; }
  .readbar, .sidebar-collapsed .readbar { left:0; }
  .readbar .wrap { padding:0 14px; gap:8px; }
  .sidebar-brand { min-height:76px; }
  .sidebar-logo img { max-width:190px; max-height:48px; }
  .sidebar-collapsed .sidebar-logo { width:auto; flex:1 1 auto; overflow:visible; }
  .sidebar-collapsed .sidebar-logo img { max-width:190px; max-height:48px; }
  .sidebar-collapsed .sidebar-brand { justify-content:space-between; padding:8px 14px; }
  .readbar .mid { min-width:75px; font-size:11px; }
}
@media (max-width:560px) {
  .doctor-main-content { padding:0 8px 96px; }
  .reader { padding:0 8px; margin-top:12px; }
  .slide-body { padding:20px 16px; font-size:15px; }
  .readbar .wrap { height:66px; padding:0 8px; }
  .readbar .btn { padding:10px 11px; font-size:12px; gap:5px; }
  .readbar .mid { min-width:62px; font-size:10px; }
  .quiz-modern { margin:14px auto 36px; padding:0 8px; }
  .quiz-intro { padding:18px 16px; }
  .qcard { padding:20px 15px; }
  .quiz-nav { gap:7px; flex-wrap:wrap; }
  .quiz-nav-hint { order:3; flex-basis:100%; text-align:center; }
  .quiz-btn { padding:10px 12px; font-size:13px; }
  .dots { justify-content:flex-start; }
  .dots button { width:32px; height:32px; }
}


/* ELECTRAL module review corrections: consistent content layout */
.chapter-content .key-points {
    margin: 22px 0 18px;
    padding: 14px 16px;
    border: 1px solid #cfe9da;
    border-left: 5px solid #329b45;
    border-radius: 8px;
    background: #fbfefb;
}
.chapter-content .key-points h3 {
    display: block;
    margin: 0 0 10px;
    padding: 8px 11px;
    border-radius: 5px;
    background: #d8f2d1;
    color: #173b25;
    font-size: 1rem;
    line-height: 1.35;
}
.chapter-content .key-points ul {
    margin: 0;
    padding-left: 24px;
}
.chapter-content .key-points li {
    margin: 0 0 7px;
    line-height: 1.55;
}
.chapter-content .key-points li:last-child { margin-bottom: 0; }

/* Consistent bullet spacing and hanging indentation throughout the module. */
.chapter-content p.doc-list {
    margin: 0 0 7px !important;
    padding-left: 22px !important;
    text-indent: -16px;
    line-height: 1.58 !important;
}
.chapter-content p + p.doc-list { margin-top: 8px !important; }
.chapter-content p.doc-list + p.doc-list { margin-top: 0 !important; }
.chapter-content ul,
.chapter-content ol {
    margin: 8px 0 16px;
    padding-left: 28px;
}
.chapter-content li {
    margin-bottom: 6px;
    line-height: 1.55;
}
.chapter-content li:last-child { margin-bottom: 0; }

/* Keep the WHO table's "Classification" heading on one line. */
.chapter-content table.classification-table {
    min-width: 620px;
}
.chapter-content table.classification-table tr:nth-child(2) > td:first-child {
    min-width: 155px;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}

/* PAT numbered domains. */
.chapter-content .pat-domain-list {
    margin: 10px 0 16px;
    padding-left: 30px;
}
.chapter-content .pat-domain-list li {
    padding-left: 3px;
    margin-bottom: 7px;
    font-weight: 650;
}

/* Responsive PAT / ABCDE decision flowchart. */
.chapter-content .clinical-flowchart {
    margin: 20px 0 24px;
    padding: 16px;
    border: 1px solid #d5ead8;
    border-radius: 12px;
    background: #f8fcf8;
    text-align: center;
}
.chapter-content .flow-root {
    max-width: 560px;
    margin: 0 auto;
}
.chapter-content .flow-node {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 12px 16px;
    border-radius: 7px;
    background: linear-gradient(180deg, #4cae3d 0%, #237b2e 100%);
    color: #fff;
    font-weight: 750;
    line-height: 1.35;
    box-shadow: 0 3px 8px rgba(20, 70, 30, .20);
}
.chapter-content .flow-stem {
    width: 2px;
    height: 22px;
    margin: 0 auto;
    background: #438b4c;
}
.chapter-content .flow-branches {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 0;
    position: relative;
}
.chapter-content .flow-branch {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    padding-top: 12px;
}
.chapter-content .flow-branch::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    height: 12px;
    border-left: 2px solid #438b4c;
}
.chapter-content .flow-detail {
    min-height: 72px;
    background: linear-gradient(180deg, #78c85a 0%, #329b36 100%);
}
.chapter-content .flow-final {
    background: linear-gradient(180deg, #67bd45 0%, #258b31 100%);
}
@media (max-width: 640px) {
    .chapter-content .clinical-flowchart { padding: 12px; }
    .chapter-content .flow-branches { grid-template-columns: 1fr; gap: 10px; }
    .chapter-content .flow-branch { padding-top: 8px; }
    .chapter-content .flow-branch::before { height: 8px; }
}

/* High-output diarrhoea monitoring figure. */
.chapter-content .monitor-flow {
    margin: 20px 0 24px;
    padding: 16px;
    border: 1px solid #d5ead8;
    border-radius: 12px;
    background: #f8fcf8;
}
.chapter-content .monitor-title {
    width: min(180px, 100%);
    margin: 0 auto 18px;
    padding: 12px 16px;
    border-radius: 7px;
    background: linear-gradient(180deg, #4cae3d 0%, #237b2e 100%);
    color: #fff;
    text-align: center;
    font-weight: 750;
    box-shadow: 0 3px 8px rgba(20, 70, 30, .20);
}
.chapter-content .monitor-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}
.chapter-content .monitor-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 76px;
    padding: 10px;
    border-radius: 7px;
    background: linear-gradient(180deg, #78c85a 0%, #329b36 100%);
    color: #fff;
    text-align: center;
    font-weight: 700;
    line-height: 1.3;
    box-shadow: 0 3px 7px rgba(20, 70, 30, .18);
}
@media (max-width: 800px) {
    .chapter-content .monitor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
    .chapter-content .monitor-grid { grid-template-columns: 1fr; }
}

/* Use the ELECTRAL green palette for the caregiver communication figure. */
.chapter-content .communication-step {
    background: linear-gradient(180deg, #67bd45 0%, #258b31 100%);
    color: #fff;
}
.chapter-content .communication-arrow {
    color: #438b4c;
}
