/* The Accidental Analyst | Book library. Standalone, no dependency on site CSS. */
:root{--cream:#faf7ef;--paper:#fffefa;--ink:#18191b;--muted:#5d616a;--blue:#286ecb;--red:#bd302b;--line:#dadbdc;--soft:#f2f1ed;--shadow:0 12px 32px rgba(0,0,0,.07)}
*{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:225px}
body{margin:0;background:var(--cream);color:var(--ink);font:16px/1.62 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;-webkit-font-smoothing:antialiased}
a{color:#145da8}a:hover{text-decoration-thickness:2px}button,select,input{font:inherit}button{cursor:pointer}
.skip{position:absolute;left:-9999px;top:2px;background:white;padding:9px;z-index:1000}.skip:focus{left:10px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.book-shell{position:sticky;top:0;z-index:50;background:rgba(250,247,239,.98);box-shadow:0 4px 22px rgba(0,0,0,.07);border-bottom:1px solid var(--line)}
.book-top{min-height:76px;padding:11px max(22px,calc((100vw - 1290px)/2));display:flex;align-items:center;gap:24px;border-bottom:1px solid #e8e3d7}
.book-brand{display:flex;gap:12px;align-items:center;text-decoration:none;color:var(--ink);min-width:300px}
.book-brand strong{font-size:14px;letter-spacing:.075em;display:block;line-height:1.35;white-space:nowrap}.book-brand em{font-style:normal;color:var(--red)}
.book-brand small{display:block;font-size:11px;font-weight:550;color:var(--muted);letter-spacing:.04em}
.dotmark{display:grid;grid-template-columns:repeat(3,7px);gap:5px;background:var(--ink);border-radius:12px;padding:11px;flex:0 0 auto}
.dotmark i{height:7px;border-radius:50%;border:1.4px solid #faf7ef}.dotmark i.blue{border:2px solid #6bb2ff}.dotmark i.red{border:2px solid #ff4b4b}
.search-wrap{margin-left:auto;position:relative;width:min(390px,36vw)}
#book-search{background:white;color:var(--ink);border:1.5px solid #c7cad1;width:100%;padding:11px 44px 11px 17px;border-radius:14px;outline-offset:3px}
#book-search:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(40,110,203,.12)}
.search-wrap kbd{position:absolute;right:15px;top:10px;border:1px solid var(--line);padding:1px 8px;border-radius:5px;color:var(--muted);pointer-events:none;font-size:13px}
.search-results{position:absolute;top:calc(100% + 7px);left:0;right:0;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);border-radius:12px;max-height:480px;overflow-y:auto;z-index:60}
.search-result{display:block;padding:12px 16px;border-bottom:1px solid var(--line);text-decoration:none;color:var(--ink)}.search-result:hover,.search-result:focus{background:#eef5ff}.search-result strong{display:block;font-size:13px}.search-result p{font-size:12px;margin:4px 0;color:var(--muted);line-height:1.45}
.search-empty{padding:16px;font-size:13px;color:var(--muted)}
.home-link{font-size:13px;font-weight:700;white-space:nowrap;color:var(--ink)}
.chapter-row,.section-row{margin:auto;padding:0 max(22px,calc((100vw - 1290px)/2));display:flex;gap:7px;align-items:stretch;overflow-x:auto;scrollbar-width:thin}
.chapter-row{min-height:53px;background:var(--paper)}
.chapter-tab{display:flex;align-items:center;gap:7px;padding:8px 15px;white-space:nowrap;text-decoration:none;color:#3f4245;font-weight:700;border-bottom:3px solid transparent;font-size:13.5px}
.chapter-tab b{width:23px;height:23px;display:grid;place-items:center;border:1.5px solid #c7c9ce;border-radius:50%;font-size:11px}
.chapter-tab:hover{color:var(--blue);background:#f1f5fe}.chapter-tab.selected{color:var(--ink);border-bottom-color:var(--red);background:#f4f4f3}.chapter-tab.selected b{background:var(--blue);border-color:var(--blue);color:white}
.section-row{min-height:43px;background:#f2f0ea;border-top:1px solid #e6e4df;gap:4px}
.section-tab{display:flex;align-items:center;padding:8px 12px;white-space:nowrap;text-decoration:none;font-size:12px;font-weight:650;color:#50545e;border-bottom:2px solid transparent}
.section-tab:hover,.section-tab.active{color:var(--blue);border-bottom-color:var(--blue)}.section-note{font-size:12px;color:var(--muted);padding:10px}
.book-layout{max-width:1160px;margin:0 auto;min-height:65vh}.article-wrap{padding:29px 34px 72px;max-width:920px;margin:auto}
.breadcrumb{display:flex;gap:11px;align-items:center;font-size:12px;color:var(--muted);font-weight:650;padding-bottom:20px}
.chapter-article{background:var(--paper);border:1px solid #ece7de;box-shadow:var(--shadow);border-radius:18px;padding:clamp(22px,4vw,62px)}
.chapter-kicker{text-transform:uppercase;font-weight:850;letter-spacing:.14em;color:var(--red);font-size:11px}
.chapter-article>h1,.book-hero h1{font:800 clamp(30px,5vw,46px)/1.13 system-ui,sans-serif;letter-spacing:-.045em;margin:12px 0 15px}
.edition-line{font-size:13px;color:var(--muted);margin:0 0 18px;border-bottom:1px solid #e4e0d9;padding-bottom:18px}
.original-book-text{font-size:16px;line-height:1.77;overflow-wrap:anywhere}
.original-book-text h1{font-size:27px;line-height:1.3;margin-top:32px}.original-book-text h2{font-size:25px;line-height:1.3;margin-top:48px;border-top:1px solid #e6e6e5;padding-top:20px}.original-book-text h3{font-size:20px;line-height:1.4;margin-top:33px}.original-book-text h4{font-size:17px;line-height:1.4;margin-top:20px}
.original-book-text p{margin:13px 0}.original-book-text img{max-width:100%;height:auto;object-fit:contain;display:block;margin:18px auto}.original-book-text blockquote{margin:24px 0;padding:12px 26px;border-left:4px solid var(--blue);background:#f0f5fb;border-radius:0 12px 12px 0}
.original-book-text li{margin:6px 0}.original-book-text hr{border:0;border-top:1px solid var(--line);margin:27px 0}
h1[id],h2[id],h3[id],article[id],section[id]{scroll-margin-top:220px}
.book-hero{padding:43px 38px;background:var(--paper);border-radius:17px;border:1px solid #ece7de;box-shadow:var(--shadow)}
.book-hero p{font-size:17px;max-width:710px}.book-hero .small{font-size:13px;color:var(--muted)}.article-wrap>section>h2{font-size:22px;margin:36px 0 18px}
.chapter-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.chapter-card{display:flex;align-items:center;gap:18px;background:var(--paper);padding:19px 20px;border:1px solid #e8e4de;border-radius:13px;text-decoration:none;color:var(--ink)}.chapter-card:hover{border-color:var(--blue);box-shadow:0 4px 15px rgba(0,0,0,.06)}
.chapter-num{font-weight:850;color:var(--blue);font-size:19px;min-width:35px}.chapter-card-content{flex:1}.chapter-card strong{display:block;font-size:15px}.chapter-card small{display:block;color:var(--muted);font-size:12px}
.pending{background:#f4f4f2;border:1px solid var(--line);padding:26px;border-radius:12px;margin-top:24px}.pending p{font-size:15px}
.library-notice,.book-access{background:#eeede7;border:1px solid #dcd8cf;padding:19px 24px;border-radius:13px;margin-top:22px}.library-notice p,.book-access p{font-size:14px;color:#50545e;line-height:1.55}
.notice-links{display:flex;flex-wrap:wrap;gap:9px}.notice-btn{background:var(--ink);border:1px solid var(--ink);border-radius:8px;padding:9px 13px;color:white;text-decoration:none;font-size:13px;font-weight:700}.notice-btn.outline{background:transparent;color:var(--ink)}.notice-btn:hover{background:var(--blue);border-color:var(--blue);color:white}
.chapter-next{display:flex;justify-content:space-between;margin:26px 0;gap:12px}.chapter-next a{border:1px solid #bbbdbd;padding:10px 15px;border-radius:9px;font-weight:750;text-decoration:none;font-size:14px}
.book-footer{display:flex;justify-content:space-between;flex-wrap:wrap;gap:10px;border-top:1px solid #ddd8cc;padding:25px 5%;font-size:12px;color:var(--muted);background:#f5f0e7}
/* Resource controls */
.media-slot{margin:20px 0}.media-slot:empty{display:none}.book-resources{border:1px solid #dedfdc;background:#f8fafb;border-radius:13px;padding:16px 18px;margin:10px 0 23px}
.book-resources h2,.book-resources h3{font-size:15px!important;margin:0!important;line-height:1.4!important;border:0!important;padding:0!important}
.resource-top{display:flex;align-items:center;justify-content:space-between;gap:15px;flex-wrap:wrap}
.resource-heading{display:flex;align-items:center;gap:9px;font-weight:800;font-size:14px;color:var(--ink)}
.resource-heading .resource-bullet{width:10px;height:10px;display:inline-block;border:2px solid var(--blue);border-radius:50%;background:#d4e6ff}
.resource-select{border:1px solid #c4c8ce;padding:7px 25px 7px 12px;border-radius:7px;min-width:156px;background:white;color:#25272b;font-size:13px}
.resource-catalog{font-size:12px;color:#656a73;margin:9px 0 0;line-height:1.5}
.resource-catalog strong{color:#3a3c42}.resource-list{display:grid;gap:10px;margin-top:14px}
.resource-item{border:1px solid #dadfe8;border-radius:10px;background:white;padding:13px 15px;display:flex;justify-content:space-between;align-items:center;gap:18px;flex-wrap:wrap}
.resource-item p{margin:3px 0 0;font-size:12px;line-height:1.4;color:var(--muted)}.resource-title{font-size:13px;font-weight:800}
.resource-type{display:inline-block;font-size:10px;letter-spacing:.05em;text-transform:uppercase;font-weight:850;color:#4d5360;background:#eceef3;border-radius:4px;padding:2px 6px;margin-right:7px}
.resource-action{padding:7px 13px;border:1px solid #1e64aa;border-radius:7px;color:white;background:#1e64aa;text-decoration:none;font-size:12px;font-weight:800;white-space:nowrap}.resource-action.secondary{background:white;color:#255995;border-color:#95b0d1}
.resource-empty{font-size:12px;color:#656a73;background:white;border:1px dashed #c4c9d0;padding:10px 12px;border-radius:7px}
.resource-upcoming{font-size:12px;color:#61666f;margin-top:10px}
.resource-player{width:100%;margin-top:12px;max-width:100%;border-radius:7px}
.resource-restricted{border-left:3px solid #be312e}
@media(max-width:850px){.book-top{gap:12px;flex-wrap:wrap;padding:11px 15px}.book-brand{min-width:0;flex:1}.search-wrap{width:100%;order:3;margin-left:0}.home-link{font-size:12px}.chapter-row,.section-row{padding:0 9px}.chapter-tab{padding:8px 12px}.article-wrap{padding:18px 15px 35px}.chapter-article{padding:24px 19px}.chapter-cards{grid-template-columns:1fr}html{scroll-padding-top:240px}h1[id],h2[id],h3[id],article[id],section[id]{scroll-margin-top:240px}}
@media(max-width:480px){.dotmark{display:none}.book-brand strong{font-size:12px}.book-brand small{font-size:10px}.chapter-tab{padding:8px 10px}.chapter-tab span{font-size:12px}.resource-select{width:100%}.resource-top{align-items:flex-start}.resource-item{align-items:flex-start}.book-hero{padding:26px 20px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

/* web220 alignment: current MyDataCanvas mark and brand palette */
.brand-mark{width:54px;height:40px;object-fit:contain;flex:0 0 auto}.book-brand{min-width:280px}
@media(max-width:800px){.book-brand{min-width:0}.brand-mark{width:43px;height:34px}}
