/* Lifted from CHAPTER_TEMPLATE.html by build_web.py. Do not edit here —
   edit the template and rebuild, or the PDF and the web book drift apart. */

/* ==========================================================================
   AMBOSS-STYLE CLINICAL STUDY REFERENCE — stylesheet
   Values measured from "Biliary Diseases" (Chromium 141 / Carlito).
   Do not change values here if the goal is an identical look.
   ========================================================================== */

:root {
  --teal: #0C8A78;        /* bars, rules, badges, bullets, TOC numbers   */
  --teal-dark: #0A6457;   /* sub-headings, labels, key answers           */
  --teal-soft: #E7F4F1;   /* pearl / objectives / table head / answers   */
  --teal-line: #CFE6E0;   /* answer-strip divider                        */
  --navy: #173447;        /* title, section titles, table row heads      */
  --ink: #1B2A33;         /* body text                                   */
  --ink-bold: #122530;    /* bold body text                              */
  --muted: #5B6C76;       /* subtitle, TOC page numbers                  */
  --muted-2: #4E5E67;     /* small notes                                 */
  --faint: #8494A0;       /* nested-list dash                            */
  --panel: #F4F7F8;       /* summary / flow boxes                        */
  --line: #D9E2E6;        /* box borders, table row lines                */
  --dots: #C4CFD5;        /* TOC dotted rules                            */
  --zebra: #FAFCFC;       /* even table rows                             */
  --hl: #FFEFA6;          /* high-yield highlight                        */
  --gold: #D99A1E;   --gold-dark: #7A540B;  --gold-soft: #FFF5DB;
  --red: #C0443A;    --red-dark: #972F26;   --red-soft: #FBEBE9;
  --blue: #4E6FA6;   --blue-dark: #34507F;  --blue-soft: #EDF1F8;
  --case-soft: #F3F5F7; --case-dash: #BFCAD0;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Carlito", "Calibri", "DejaVu Sans", sans-serif;
  font-size: 10.3pt;
  line-height: 1.42;
  color: var(--ink);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
b, strong { font-weight: 700; color: var(--ink-bold); }
i, em { font-style: italic; }
p { margin: 0 0 7px; orphans: 2; widows: 2; }
sup, sub { line-height: 0; font-size: 70%; }

/* ---------- Icons (vector SVG, drawn by CSS) ---------- */
.ico { display: inline-block; width: 12px !important; vertical-align: -1px; margin-right: 6px; background-repeat: no-repeat; background-position: center; }
.ico-star   { height: 9px; background-size: 9.5px 9px;  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 23'%3E%3Cpath fill='%23D99A1E' d='M12 0l3.6 7.6 8.4 1-6.2 5.8 1.6 8.3L12 18.6 4.6 22.7l1.6-8.3L0 8.6l8.4-1z'/%3E%3C/svg%3E"); }
.ico-star-d { height: 9px; background-size: 9.5px 9px;  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 23'%3E%3Cpath fill='%237A540B' d='M12 0l3.6 7.6 8.4 1-6.2 5.8 1.6 8.3L12 18.6 4.6 22.7l1.6-8.3L0 8.6l8.4-1z'/%3E%3C/svg%3E"); }
.ico-warn   { height: 9.7px; background-size: 10.5px 9.7px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 24'%3E%3Cpath fill='%23C0443A' d='M13 0c.8 0 1.5.4 1.9 1.1l10.8 19.4c.8 1.5-.3 3.4-2 3.4H2.3c-1.7 0-2.8-1.9-2-3.4L11.1 1.1C11.5.4 12.2 0 13 0z'/%3E%3Crect fill='%23fff' x='11.6' y='7' width='2.8' height='8.6' rx='1.2'/%3E%3Ccircle fill='%23fff' cx='13' cy='19' r='1.6'/%3E%3C/svg%3E"); }
.ico-warn-d { height: 9.7px; background-size: 10.5px 9.7px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 24'%3E%3Cpath fill='%23972F26' d='M13 0c.8 0 1.5.4 1.9 1.1l10.8 19.4c.8 1.5-.3 3.4-2 3.4H2.3c-1.7 0-2.8-1.9-2-3.4L11.1 1.1C11.5.4 12.2 0 13 0z'/%3E%3Crect fill='%23fff' x='11.6' y='7' width='2.8' height='8.6' rx='1.2'/%3E%3Ccircle fill='%23fff' cx='13' cy='19' r='1.6'/%3E%3C/svg%3E"); }
.ico-info   { height: 10px; background-size: 10px 10px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle fill='%230C8A78' cx='10' cy='10' r='10'/%3E%3Crect fill='%23fff' x='8.9' y='8.2' width='2.2' height='7.4' rx='1'/%3E%3Ccircle fill='%23fff' cx='10' cy='5.4' r='1.35'/%3E%3C/svg%3E"); }
.ico-info-d { height: 10px; background-size: 10px 10px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle fill='%230A6457' cx='10' cy='10' r='10'/%3E%3Crect fill='%23fff' x='8.9' y='8.2' width='2.2' height='7.4' rx='1'/%3E%3Ccircle fill='%23fff' cx='10' cy='5.4' r='1.35'/%3E%3C/svg%3E"); }
.ico-plus   { height: 10px; background-size: 10px 10px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect fill='%234E6FA6' width='20' height='20' rx='4'/%3E%3Cpath stroke='%23fff' stroke-width='2.4' stroke-linecap='round' d='M10 5v10M5 10h10'/%3E%3C/svg%3E"); }
.ico-plus-d { height: 10px; background-size: 10px 10px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect fill='%2334507F' width='20' height='20' rx='4'/%3E%3Cpath stroke='%23fff' stroke-width='2.4' stroke-linecap='round' d='M10 5v10M5 10h10'/%3E%3C/svg%3E"); }
.ico-bank   { height: 10px; background-size: 10px 10px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect fill='%23D99A1E' width='20' height='20' rx='4'/%3E%3Cpath stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' fill='none' d='M5.4 10.4l3 3 6.2-6.6'/%3E%3C/svg%3E"); }
.ico-bank-d { height: 10px; background-size: 10px 10px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect fill='%237A540B' width='20' height='20' rx='4'/%3E%3Cpath stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' fill='none' d='M5.4 10.4l3 3 6.2-6.6'/%3E%3C/svg%3E"); }
.ico-case   { height: 10px; background-size: 8.2px 10px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 20'%3E%3Crect fill='%23173447' y='2.5' width='16' height='17.5' rx='2.5'/%3E%3Crect fill='%23173447' stroke='%23F3F5F7' stroke-width='1.2' x='4' y='0.6' width='8' height='4.4' rx='1.2'/%3E%3Cpath stroke='%23fff' stroke-width='1.5' stroke-linecap='round' d='M4.3 9.5h7.4M4.3 12.5h7.4M4.3 15.5h4.2'/%3E%3C/svg%3E"); }
.star-after::after { content: ""; display: inline-block; width: 9.5px; height: 9px; margin-left: 5px; vertical-align: -0.5px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 23'%3E%3Cpath fill='%23D99A1E' d='M12 0l3.6 7.6 8.4 1-6.2 5.8 1.6 8.3L12 18.6 4.6 22.7l1.6-8.3L0 8.6l8.4-1z'/%3E%3C/svg%3E") no-repeat center / contain; }

.star { display: inline-block; width: 9.5px; height: 9px; margin: 0 1px 0 3px; vertical-align: -0.5px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 23'%3E%3Cpath fill='%23D99A1E' d='M12 0l3.6 7.6 8.4 1-6.2 5.8 1.6 8.3L12 18.6 4.6 22.7l1.6-8.3L0 8.6l8.4-1z'/%3E%3C/svg%3E") no-repeat center / contain; }

/* ---------- Title block ---------- */
.doc-head { position: relative; border-left: 6px solid var(--teal); padding: 2px 0 4px 16px; margin: 0 0 12px; }
.doc-head .eyebrow { font-size: 9pt; font-weight: 700; color: var(--teal); letter-spacing: .08em; text-transform: uppercase; }
.doc-head .author { position: absolute; top: 1px; right: 1px; font-size: 10.5pt; font-weight: 700; color: var(--navy); line-height: 1.2; }
.doc-head h1 { font-size: 33pt; line-height: 1.1; letter-spacing: -.01em; color: var(--navy); margin: 0; font-weight: 700; }
.doc-head .subtitle { font-size: 13pt; line-height: 1.3; color: var(--muted); margin: 3px 0 7px; }
.doc-head .desc { font-size: 8.9pt; line-height: 1.44; color: var(--muted); }

/* ---------- Labels (small caps line at the top of boxes) ---------- */
.label { display: block; font-size: 8.6pt; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-dark); margin: 0 0 2.5px; }

/* ---------- Summary + flow boxes ---------- */
.summary { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 9px 14px 9px; margin: 0 0 14px; }
.flow { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 5.5px 11px 6.5px; line-height: 1.5; margin: 0 0 10px; }

/* ---------- Contents ---------- */
.toc-label { margin-bottom: 2px; }
ol.toc { list-style: none; margin: 0 0 14px; padding: 0; columns: 2; column-gap: 20px; font-size: 10pt; }
ol.toc li { display: flex; align-items: baseline; padding: 3.2px 0; border-bottom: 1px dotted var(--dots); break-inside: avoid; }
ol.toc .n { width: 16px; flex: none; text-align: right; margin-right: 7px; font-weight: 700; color: var(--teal); }
ol.toc .t { flex: 1; }
ol.toc .pg { color: var(--muted); margin-left: 8px; }

/* ---------- Two-column grid ---------- */
.grid2 { column-count: 2; column-gap: 14px; margin: 12px 0 8px; }
.grid2 > div > h3:first-child { margin-top: 0; }
.grid2 > * { min-width: 0; }

/* ---------- Objectives + legend ---------- */
.objectives { background: var(--teal-soft); border-left: 4px solid var(--teal); border-radius: 6px; padding: 7px 12px 9px; }
.objectives ul { margin-bottom: 2px; }
.objectives .assessed { font-size: 9.2pt; color: var(--muted-2); margin: 2px 0 0; }
.legend { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px 7.5px; }
.legend .legend-title { font-size: 10.4pt; font-weight: 700; color: var(--teal-dark); margin: 0 0 4px; }
.legend .item { margin: 0 0 2px; }
.legend .item:last-child { margin-bottom: 0; }
.legend .item b { color: var(--ink-bold); }

/* ---------- Section heading ---------- */
h2.sec { display: flex; align-items: center; font-size: 17pt; line-height: 1.2; font-weight: 700; color: var(--navy);
  border-bottom: 2px solid var(--teal); padding: 0 0 6px; margin: 24px 0 8.5px; break-after: avoid; }
h2.sec .num { flex: none; min-width: 35px; height: 27px; padding: 0 8px; margin-right: 10px; border-radius: 5px;
  background: var(--teal); color: #fff; font-size: 13.5pt; display: flex; align-items: center; justify-content: center; }

/* ---------- Transcript timestamp on a heading ---------- */
h2.sec .ts { flex: none; margin-left: auto; padding-left: 12px; font-size: 10.5pt; font-weight: 700;
  line-height: 1.2; color: var(--teal); letter-spacing: .01em; white-space: nowrap; }
h3 .ts { font-size: 9.4pt; font-weight: 700; color: var(--teal); margin-left: 7px; white-space: nowrap; }

/* ---------- Sub-headings ---------- */
h3 { font-size: 12.3pt; line-height: 1.3; font-weight: 700; color: var(--teal-dark); margin: 16px 0 6px; break-after: avoid; }
h4 { font-size: 10.6pt; font-weight: 700; color: var(--navy); margin: 10px 0 4px; break-after: avoid; }

/* ---------- Definition line ---------- */
.def { font-size: 10.6pt; margin: 0 0 9px; }
.def .term { font-weight: 700; color: var(--teal-dark); }

/* ---------- Lists ---------- */
ul { list-style: none; margin: 0 0 8px; padding: 0 0 0 18px; }
ul li { position: relative; margin: 0 0 2px; }
ul li::before { content: ""; position: absolute; left: -15px; top: 0.62em; width: 4px; height: 4px; border-radius: 50%; background: var(--teal); }
ul ul { margin: 2px 0 3.5px; padding-left: 17px; }
ul ul li::before { content: "–"; background: none; width: auto; height: auto; border-radius: 0; top: 0.04em; left: -11px; color: var(--faint); }

/* ---------- Inline emphasis ---------- */
.hl { background: var(--hl); border-radius: 2px; }
.ref { font-weight: 700; color: var(--teal-dark); }
.cn { font-style: italic; }                 /* optional: class-note aside */
.small-note { font-size: 9.8pt; color: var(--muted-2); margin: 0 0 9px; }

/* ---------- Callout boxes ---------- */
.box { border-left: 4px solid; border-radius: 6px; padding: 7px 12px 9px; margin: 10px 0; break-inside: auto; orphans: 2; widows: 2; }
.box > :last-child { margin-bottom: 0; }
.box .label { margin-bottom: 1.5px; }
.box ul { margin-bottom: 0; }
.box.exam    { background: var(--gold-soft); border-color: var(--gold); }
.box.exam    .label { color: var(--gold-dark); }
.box.warn    { background: var(--red-soft);  border-color: var(--red); }
.box.warn    .label { color: var(--red-dark); }
.box.pearl   { background: var(--teal-soft); border-color: var(--teal); }
.box.pearl   .label { color: var(--teal-dark); }
.box.beyond  { background: var(--blue-soft); border-color: var(--blue); }
.box.beyond  .label { color: var(--blue-dark); }
.box.bank    { background: var(--gold-soft); border-color: var(--gold); }
.box.bank    .label { color: var(--gold-dark); }
.box.bank    .qstem { display: block; margin-top: 3px; }
.box.bank    .qans { color: var(--gold-dark); font-weight: 700; }
.box.bank    .freq { color: var(--muted-2); font-style: italic; }
.box.case    { background: var(--case-soft); border-color: var(--navy); }
.box.case    .label { color: var(--navy); }
.box.case { padding-bottom: 6.5px; }
.box.case .dx { border-top: 1px dashed var(--case-dash); margin-top: 4px; padding-top: 5.5px; }
.grid2 > .box { margin: 0; }
.boxes2 { margin: 10px 0 12px; }

/* ---------- Figures (images lifted from the slides) ---------- */
figure.fig { margin: 11px 0 13px; break-inside: avoid; }
figure.fig img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
figure.fig figcaption { font-size: 9.2pt; line-height: 1.36; color: var(--muted-2); margin: 4.5px 2px 0; }
figure.fig figcaption .fignum { font-weight: 700; color: var(--teal-dark); margin-right: 5px; }
figure.fig figcaption b { color: var(--ink-bold); }
figure.fig.narrow { width: 62%; margin-left: auto; margin-right: auto; }   /* portrait / tall images */
.figs2 { margin: 11px 0 13px; }                                            /* grid2 of two figures */
.grid2 > figure.fig { margin: 0; }
.grid2 figure.fig figcaption { font-size: 9pt; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 9.5pt; line-height: 1.35; margin: 4px 0 12px; break-inside: auto; }
th { background: var(--teal-soft); color: var(--teal-dark); font-weight: 700; text-align: left;
  padding: 4.5px 7px 5.5px; border-bottom: 1px solid var(--teal); }
td { padding: 4.5px 7px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr { break-inside: avoid; }
tbody tr:nth-child(even) td { background: var(--zebra); }
td:first-child { font-weight: 700; color: var(--navy); }
td b { color: var(--ink-bold); }
table.plain td:first-child { font-weight: 400; color: var(--ink); }
table.kv td:first-child { width: 30%; }

/* ---------- Test yourself ---------- */
.qa-intro { font-size: 9.8pt; color: var(--muted-2); margin: 0 0 9px; }
.qa { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin: 0 0 8px; break-inside: avoid; }
.qa .q { display: flex; align-items: flex-start; padding: 5px 10px 5.5px 9px; background: #fff; }
.qa .q .n { flex: none; width: 19px; height: 19px; border-radius: 50%; background: var(--navy); color: #fff;
  font-size: 9pt; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 8px 0 0; }
.qa .a { background: var(--teal-soft); border-top: 1px solid var(--teal-line); font-size: 9.8pt; line-height: 1.38;
  padding: 6px 10px 6px 36px; }
.qa .a .k { font-weight: 700; color: var(--teal-dark); }

/* ---------- Screen-only note for the user (never printed) ---------- */
@media print { 
/* ---------- Page control ---------- */
.page-break { break-before: page; }
.keep { break-inside: avoid; }
