/* Marketing Management 4 — restrained editorial interface, light and dark reading modes. */
:root{--v4-ease:cubic-bezier(.2,.75,.2,1);--v4-accent:#405447;--v4-on-accent:#fff}
html[data-theme='light']{color-scheme:light}
html[data-theme='dark']{color-scheme:dark;--bg:#141615;--paper:#1f2220;--ink:#efeee8;--muted:#a8aea6;--line:#3c433d;--soft:#252a26;--v4-accent:#bed8c2;--v4-on-accent:#101612;background:var(--bg)}
body,main,.top,.chapter-strip,.sidebar,.definition,.study-example,.interactive-model,.model-art,.hero-card,.premium-dialog,.search-box,.mobile-chapter-select{transition:background-color .28s ease,color .28s ease,border-color .28s ease}
html[data-theme='dark'] body{background:var(--bg);color:var(--ink)}
html[data-theme='dark'] body:before{mix-blend-mode:normal;opacity:.025}
html[data-theme='dark'] ::selection{color:#111b14;background:#b6d5bb}
html[data-theme='dark'] .top{background:rgba(20,22,21,.95);border-color:var(--line)}
html[data-theme='dark'] .brand i{background:var(--ink)}
html[data-theme='dark'] .top .btn,html[data-theme='dark'] .top .actions .btn,html[data-theme='dark'] .completion-readout{color:var(--ink);border-color:var(--line);background:transparent}
html[data-theme='dark'] .top .btn:hover{background:#333c36;color:#fff}
html[data-theme='dark'] .chapter-strip{background:rgba(20,22,21,.97);border-color:var(--line)}
html[data-theme='dark'] .chapter-strip a{color:#c0c6bd;border-color:transparent}
html[data-theme='dark'] .chapter-strip a.current{color:var(--ink);background:#29312b;border-bottom-color:#a8c5ae}
html[data-theme='dark'] .chapter-strip a.current:after{background:#b7cbb7}
html[data-theme='dark'] .chapter-strip a:hover{background:#2a312c;color:#fff}
html[data-theme='dark'] .hero,html[data-theme='dark'] footer{border-color:var(--line)}
html[data-theme='dark'] .hero p,html[data-theme='dark'] .lead,html[data-theme='dark'] .content p,html[data-theme='dark'] .content li,html[data-theme='dark'] .content strong,html[data-theme='dark'] .unit-note{color:#d5d8d1}
html[data-theme='dark'] .eyebrow,html[data-theme='dark'] .sec-no,html[data-theme='dark'] .page,html[data-theme='dark'] .side-label,html[data-theme='dark'] .source-micro{color:#aeb9af}
html[data-theme='dark'] .hero-card,html[data-theme='dark'] .definition,html[data-theme='dark'] .simple,html[data-theme='dark'] .key,html[data-theme='dark'] .coverage,html[data-theme='dark'] .table-wrap,html[data-theme='dark'] .panel{background:#1d211e;border-color:var(--line)}
html[data-theme='dark'] .definition{border-left-color:#b8d1bd}
html[data-theme='dark'] .sidebar{border-color:var(--line)}
html[data-theme='dark'] .chapter-links a,html[data-theme='dark'] .nav a,html[data-theme='dark'] .nav-sub a{color:#abb6aa!important;border-color:var(--line)}
html[data-theme='dark'] .chapter-links a.is-active,html[data-theme='dark'] .nav a.active,html[data-theme='dark'] .nav a.reader-active,html[data-theme='dark'] .nav a:hover,html[data-theme='dark'] .nav-sub a:hover{color:#edf4ee!important}
html[data-theme='dark'] .nav-track,html[data-theme='dark'] .progress{background:#bed8c2}
html[data-theme='dark'] .lesson,html[data-theme='dark'] .block,html[data-theme='dark'] .stat,html[data-theme='dark'] .lecture-index,html[data-theme='dark'] .lecture-slide,html[data-theme='dark'] .chapter-next{border-color:var(--line)}
html[data-theme='dark'] .block h3,html[data-theme='dark'] .block .content .full-teaching,html[data-theme='dark'] .block .content .study-example .example-text,html[data-theme='dark'] .block .content .takeaway,html[data-theme='dark'] .concept-focus{color:#eef1e9!important}
html[data-theme='dark'] .study-example,html[data-theme='dark'] .checkpoints{background:#252c27;color:#e6ece4;border-color:#7f9984}
html[data-theme='dark'] .lesson-kicker{color:#b2bcb0}
html[data-theme='dark'] .lecture-slide li,html[data-theme='dark'] .lecture-index p,html[data-theme='dark'] .sect-keywords{color:#b8bcb3}
html[data-theme='dark'] .takeaway{border-color:#79907e}
html[data-theme='dark'] .media-figure{background:#222522;border-color:var(--line)}
html[data-theme='dark'] .media-figure img{background:#fff}
html[data-theme='dark'] .media-figure figcaption{color:#aeb5aa}
html[data-theme='dark'] th{background:#262e27;color:#f1f2ed;border-color:var(--line)}
html[data-theme='dark'] td{color:#dce3d9;border-color:var(--line)}
html[data-theme='dark'] .quick-outline a{border-color:var(--line);color:#d9e2d6}
html[data-theme='dark'] .quick-outline a:hover{background:#a5c7a9;color:#101710}
html[data-theme='dark'] .interactive-model{background:#222722;border-color:#4a594d}
html[data-theme='dark'] .interactive-model h3,html[data-theme='dark'] .model-top strong,html[data-theme='dark'] .model-detail,html[data-theme='dark'] .route-visual{color:#e6ede4}
html[data-theme='dark'] .model-top small{color:#a4b1a4}
html[data-theme='dark'] .model-art{background:#1a1e1b;border-color:#4c574d}
html[data-theme='dark'] .model-art .stage,html[data-theme='dark'] .diagram-grid>div{color:#e3e8de;border-color:#566257;background:#222a24}
html[data-theme='dark'] .model-art .stage:after{color:#aeb5ae}
html[data-theme='dark'] .model-art[data-stage='0'] .stage:nth-child(1),html[data-theme='dark'] .model-art[data-stage='1'] .stage:nth-child(2),html[data-theme='dark'] .model-art[data-stage='2'] .stage:nth-child(3),html[data-theme='dark'] .model-art[data-stage='3'] .stage:nth-child(4),html[data-theme='dark'] .model-options button.selected{background:#bdd7c0;color:#111b13;border-color:#bdd7c0}
html[data-theme='dark'] .model-options button{color:#e5eee2;border-color:#59665b}
html[data-theme='dark'] .model-options button:hover{background:#313e34}
html[data-theme='dark'] .plc-curve{stroke:#d2e3d1}
html[data-theme='dark'] .premium-dialog,html[data-theme='dark'] .search-box{background:#202521;color:#ecefe8;border-color:#4a544b}
html[data-theme='dark'] .premium-dialog>p,html[data-theme='dark'] .premium-dialog .dialog-heading small,html[data-theme='dark'] .search-hint,html[data-theme='dark'] .hit-meta,html[data-theme='dark'] .search-box .results .hit-snippet{color:#b4c0b2}
html[data-theme='dark'] .search-box input,html[data-theme='dark'] .search-box .results a{background:transparent;color:#f0f1e9;border-color:var(--line)}
html[data-theme='dark'] .search-box .results a:hover{background:#303c33}
html[data-theme='dark'] .search-box mark{background:#a5c3ab;color:#17231b}
html[data-theme='dark'] .premium-dialog button{color:#ecefe8;border-color:#667368}
html[data-theme='dark'] .premium-dialog button:hover{background:#344337}
html[data-theme='dark'] .mobile-chapter-select{background-color:#242a25;color:#ecf0e9;border-color:var(--line)}
html[data-theme='dark'] .resume-toast{background:#263027;color:#eff3e9;border-color:#536a58}
html[data-theme='dark'] .reader-mode button{color:#e6eee2;border-color:var(--line)}
html[data-theme='dark'] .narration-sentence.is-speaking{color:#142016!important;background:#bad9b6!important;box-shadow:0 0 0 3px #bad9b6!important}
html[data-theme='dark'] .chapter-next a{color:var(--ink)}
html[data-theme='dark'] .steps,html[data-theme='dark'] .step{background:#222922;color:#dce5db;border-color:var(--line)}
html[data-theme='dark'] .audio-dock{border-color:#738875}
html[data-theme='dark'] .mobile-tools:not([hidden]){background:#212922;border-color:#4b6250}
#themeBtn{min-width:94px}
#contentsOpen{min-width:105px}
.hero-contents-link{display:inline-flex;align-items:center;margin:16px 0 0;border:0;border-bottom:1px solid currentColor;background:none;padding:4px 0;color:var(--ink);font-size:12px;font-weight:850;cursor:pointer;transition:letter-spacing .2s ease,transform .2s ease}
.hero-contents-link:hover{letter-spacing:.02em;transform:translateX(3px)}
.contents-dialog{width:min(650px,calc(100vw - 22px));max-height:min(84dvh,880px);border:1px solid var(--line);background:var(--paper);color:var(--ink);padding:0;box-shadow:0 30px 100px rgba(0,0,0,.3)}
.contents-dialog::backdrop{background:rgba(4,9,6,.7);backdrop-filter:blur(5px)}
.contents-shell{padding:clamp(18px,3vw,32px)}
.contents-top{display:flex;align-items:start;justify-content:space-between;gap:18px}
.contents-top h2{font-size:clamp(30px,5vw,48px);line-height:1;margin:0}
.contents-top button{width:40px;height:40px;border:1px solid var(--line);background:transparent;color:inherit;font-size:25px;cursor:pointer;flex:none}
.contents-shell>p{font-size:13px;color:var(--muted);line-height:1.6}
.contents-shell input{display:block;width:100%;height:50px;background:transparent;border:1px solid var(--line);border-radius:0;padding:0 14px;color:inherit;font-size:14px;outline-offset:3px;margin:19px 0 11px}
#contentsLinks{display:flex;flex-direction:column;max-height: min(51dvh,440px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
#contentsLinks a{display:block;padding:13px 8px;border-bottom:1px solid var(--line);text-decoration:none;color:var(--ink);font-size:13px;font-weight:750;transition:background .18s ease,padding .2s ease}
#contentsLinks a:hover,#contentsLinks a:focus-visible{background:var(--soft);padding-left:15px}
#contentsLinks a[hidden]{display:none}
.reading-rail{position:fixed;right:20px;bottom:22px;z-index:183;display:flex;align-items:stretch;gap:0;background:var(--paper);color:var(--ink);border:1px solid var(--line);box-shadow:0 7px 22px rgba(0,0,0,.08);transition:bottom .26s var(--v4-ease),transform .28s var(--v4-ease);opacity:.97}
.reading-rail button{min-height:44px;min-width:43px;padding:0 11px;border:0;border-left:1px solid var(--line);background:transparent;color:inherit;font-size:16px;cursor:pointer;transition:background .2s,color .2s}
.reading-rail button:first-child{border-left:0}
.reading-rail button:hover{background:var(--soft)}
.reading-rail #currentTopic{max-width:216px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;font-weight:850;letter-spacing:.035em;text-transform:uppercase}
.reading-rail #backToTop{font-size:19px}
body:has(.audio-dock:not([hidden])) .reading-rail{bottom:154px}
body:has(.resume-toast:not([hidden])) .reading-rail{bottom:118px}
.reader-focus .reading-rail{display:flex!important}
/* Reading content stays motion-free. Reveal only headings and diagrams. */
@media(min-width:701px){main section h2.scroll-reveal.in-view{animation:heading-v4 .58s var(--v4-ease) both}}
@keyframes heading-v4{from{opacity:.75;transform:translateY(13px)}to{opacity:1;transform:none}}
@media(max-width:1190px){.top .actions #contentsOpen{font-size:0;padding:9px 11px}.top .actions #contentsOpen:after{content:'☷';font-size:17px}}
@media(max-width:700px){
 .top .actions #themeBtn{display:inline-flex!important;font-size:0!important;min-width:36px!important;padding:9px 6px!important}
 .top .actions #themeBtn:after{content:'◐';font-size:22px}
 .top .actions #contentsOpen{display:inline-flex!important;font-size:0!important;min-width:36px!important;padding:9px 5px!important}
 .top .actions #contentsOpen:after{content:'☷';font-size:20px}
 .top .brand{max-width:126px!important}.top .actions{gap:1px!important}
 .reading-rail{bottom:10px;right:9px;left:9px;justify-content:space-between}
 .reading-rail button{min-height:45px;min-width:42px}.reading-rail #currentTopic{flex:1;max-width:none}
 body:has(.audio-dock:not([hidden])) .reading-rail{bottom:169px}
 body:has(.resume-toast:not([hidden])) .reading-rail{bottom:103px}
 .contents-dialog{max-height:94dvh}
 .hero-contents-link{margin-top:11px}
}
@media(prefers-reduced-motion:reduce){@view-transition{navigation:none}.hero-contents-link,.reading-rail,.contents-links,.narration-sentence{animation:none!important;transition:none!important}}
@media print{.reading-rail,.contents-dialog,.hero-contents-link{display:none!important}}

.block[data-source-level^="additional"] .lesson-kicker:after{content:"  ·  ADDITIONAL CLARIFICATION";font-size:9px;font-weight:700;letter-spacing:.04em;opacity:.7}
/* Final legibility and mobile density refinements */
html[data-theme='dark'] .inline-listen{color:#d3e2d2;border-color:#657366;background:#252c27}
html[data-theme='dark'] .inline-listen:hover{color:#132016;background:#c1d8bf}
html[data-theme='dark'] .nav a.reader-active{background:#252e27;color:#f4f8f2!important}
html[data-theme='dark'] .reader-mode span{color:#c0c9bf}
html[data-theme='dark'] .contents-dialog{background:#202521;color:#f4f3ef;border-color:#59645b}
html[data-theme='dark'] .contents-shell>p{color:#b5c2b5}
html[data-theme='dark'] .contents-shell input{background:#151b16;color:#f3f4ee;border-color:#566257}
html[data-theme='dark'] #contentsLinks a{color:#f0f2ed;border-color:#39443c}
html[data-theme='dark'] #contentsLinks a:hover{background:#313c33}
html[data-theme='dark'] .reading-rail{background:#232923;border-color:#4f6053;color:#f1f4ec}
html[data-theme='dark'] .reading-rail button{border-color:#4f6053}
html[data-theme='dark'] .reading-rail button:hover{background:#3c4a3e}
html[data-theme='dark'] .hero-contents-link{color:#e5f0e3}
.reading-rail.is-hidden{opacity:0;pointer-events:none;transform:translateY(12px)}
.reading-rail button:disabled{opacity:.28;cursor:not-allowed}
@media(max-width:700px){
 .top .brand{max-width:78px!important}
 .top .brand span{font-size:0!important;letter-spacing:0}
 .top .brand span:after{content:'NOTES'!important;font-size:11px!important;letter-spacing:.06em}
 .sidebar .side-label{display:none!important}
 .sidebar .nav{padding-top:5px!important;padding-bottom:14px!important}
 .top .actions #contentsOpen,.top .actions #themeBtn{min-width:35px!important}
}
