body.resource-presenting{overflow:hidden}
#resource-window{position:fixed;inset:0;z-index:1000;display:flex;flex-direction:column;height:100vh;height:100dvh;background:#f5f8f7;color:#17333b}
.resource-topbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;border-bottom:2px solid #c4a45f;background:#fffffff2;padding:12px clamp(16px,3vw,38px);flex-shrink:0}
.resource-topbar .resource-view-label{font-size:clamp(1.05rem,2vw,1.35rem);line-height:1.3;margin:0;font-weight:750;flex:1}
.resource-topbar button{font-size:14px;min-height:40px;padding:8px 12px;white-space:nowrap}
.resource-window-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
#resource-window-content{overflow:auto;overscroll-behavior:contain;flex:1;padding:20px clamp(16px,3vw,38px);scrollbar-gutter:stable}
#resource-window-content>*{max-width:1440px;margin-left:auto;margin-right:auto}
#resource-window #search-form{margin-top:0}
#resource-window #topic-view .panel{font-size:clamp(1.05rem,1.35vw,1.2rem);line-height:1.65}
#resource-window #topic-title{font-size:clamp(1.6rem,3vw,2.5rem);max-width:1100px}
#resource-window #video-view{max-width:1150px}
#resource-window #overview-view{max-width:1200px}
#resource-window #overview-view .overview-frame{margin-top:0}
#resource-poster-view img{display:block;max-width:100%;max-height:none;width:auto;height:auto;margin:20px auto;object-fit:contain}
.quiz-presentation>.resource-topbar,.flash-presentation>.resource-topbar{padding:0 0 12px;background:transparent;position:sticky;top:0;z-index:1;background:#f5f8f7}
@media(max-width:700px){.resource-topbar{gap:8px;padding:10px 12px}.resource-window-actions{width:100%;gap:6px}.resource-window-actions button{font-size:13px;padding:7px 9px}#resource-window-content{padding:16px 12px}.resource-topbar .resource-view-label{font-size:1rem}}

/* Resource choices share one colour; action controls keep their own palettes. */
body .section-tabs button,body .section-tabs a.button{background:#ff8b78!important;color:#17232e!important;border:1px solid #c44d38!important;box-shadow:0 2px 0 #c44d38!important}
body .section-tabs button:hover:not(:disabled),body .section-tabs a.button:hover{background:#ff7963!important;color:#17232e!important}
body .section-tabs button:focus-visible,body .section-tabs a.button:focus-visible{outline:3px solid #a93c29!important;outline-offset:3px}
#resource-choice-hint{margin:22px 0;font-size:1rem}

#last-opened-resource{display:inline;margin-left:16px;font-size:.95rem;color:#52676e}
@media(max-width:500px){#last-opened-resource{display:block;margin:6px 0 0}}

#overview-previous,#overview-next{background:#176b61!important;color:#fff!important;border:1px solid #105147!important;box-shadow:0 2px 0 #105147!important;gap:9px}
#overview-previous:hover:not(:disabled),#overview-next:hover:not(:disabled){background:#10564e!important}
#overview-previous:disabled,#overview-next:disabled{opacity:.45;cursor:default}
#overview-previous:focus-visible,#overview-next:focus-visible{outline:3px solid #176b61;outline-offset:3px}

#resource-window[data-resource="videos"] .browse-heading{display:none}
#resource-window[data-resource="videos"] .resource-window-actions{width:auto}
#resource-video-total{font-size:15px;line-height:1.4;color:#52676e;margin:0}
#resource-window[data-resource="videos"] #resource-window-title{flex:0 1 auto}

.topic-speech-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:14px 0 20px}

#resource-window[data-resource="overview"]>.resource-topbar{display:none}
#resource-window[data-resource="overview"] #resource-window-content{padding-top:12px}
#resource-window .overview-topline .overview-label{flex:1;min-width:min(100%,240px);white-space:normal;line-height:1.4}
#last-opened-resource{display:inline-block;margin-left:14px;padding:5px 12px;border-radius:8px;background:#fff0dd;border:1px solid #d5b270;color:#493916;font-weight:650}
@media(max-width:500px){#last-opened-resource{margin:8px 0 0}}

#overview-view .overview-topline{gap:12px;margin-bottom:12px}#overview-view .overview-topline #overview-number{margin:0;font-size:1rem;letter-spacing:0;line-height:1.4}

/* Hidden audio buttons must stay hidden despite their global button styling. */
#resource-window .resource-window-actions[hidden],#resource-window .resource-window-actions>[hidden]{display:none!important}

/* The recent-resource reminder follows Auto Revision in the same toolbar. */
#last-opened-resource{margin:0;align-self:center;white-space:normal;max-width:100%}

.last-resource-button{position:relative;padding-right:25px!important}
.last-resource-button>.last-opened-marker{position:absolute;right:3px;bottom:3px;display:grid;place-items:center;width:15px;height:15px;font-size:12px;line-height:1;border-radius:4px;background:#fff0dd;color:#8a6420;border:1px solid #d5b270;pointer-events:none}
html[data-reading-contrast="high"] .last-resource-button>.last-opened-marker{background:#fff;color:#000;border-color:#000}
html[data-reading-contrast="high"][data-appearance="dark"] .last-resource-button>.last-opened-marker{background:#000;color:#ffe16d;border-color:#ffe16d}

/* A clear gold badge appears beside Auto Revision on both unit sites. */
#last-opened-resource{display:inline-flex;align-items:center;gap:7px;background:#fff4db;border:1px solid #d6b76b;box-shadow:0 1px 2px #62451414;color:#493916}
#last-opened-resource[hidden]{display:none!important}
.gold-star{display:inline-flex;flex:0 0 auto;width:20px;height:20px;filter:drop-shadow(0 1px 1px #70480b45)}
.gold-star svg{width:100%;height:100%;fill:#edb92f;stroke:#976617;stroke-width:.85}
.gold-star svg path{fill:#edb92f}
.last-opened-marker .gold-star{width:13px;height:13px}
.last-resource-button>.last-opened-marker{background:#fff4db;border-color:#d6b76b}
html[data-reading-contrast="high"] .gold-star svg path{fill:currentColor!important;stroke:currentColor}

/* Keep the recent resource beside its unit code, including on phones. */
body .heading .unit-code-row{display:flex;align-items:center;gap:10px;flex:0 0 100%;min-width:0;max-width:100%}
body .heading .unit-code-row>.unit-code{flex:none}
body .heading #last-opened-resource{margin:0;min-width:0;max-width:100%;font-size:14px;line-height:1.3;padding:5px 8px;overflow-wrap:anywhere}
body .heading #last-opened-resource>.gold-star{flex:none}

/* Match the Videos tile so the return action is easy to recognise. */
html body #video-close.video-return{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:44px;background:#ef9a87!important;color:#481f1b!important;border:1px solid #ac5a49!important;box-shadow:0 2px 0 #ac5a49!important;font-weight:700}
html body #video-close.video-return:hover{background:#f4b09f!important}
#video-close .video-return-icon{display:block;width:46px;height:25px;flex:none}
html body #video-close.video-return:focus-visible{outline:3px solid #ac5a49!important;outline-offset:3px}
html[data-appearance="dark"] body #video-close.video-return{background:#854336!important;color:#fff7e9!important}
html[data-appearance="dark"] body #video-close.video-return:hover{background:#975242!important}
html[data-reading-contrast="high"] body #video-close.video-return{background:#fff!important;color:#000!important;border-color:#000!important;box-shadow:none!important}
html[data-reading-contrast="high"][data-appearance="dark"] body #video-close.video-return{background:#000!important;color:#fff!important;border-color:#fff!important}

/* A poster fills its own screen and fits inside the space below its return bar. */
#resource-window #resource-poster-view:not([hidden]){position:fixed;inset:0;z-index:1100;display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:10px 14px;width:100%;height:100vh;height:100dvh;max-width:none;margin:0;padding:12px;padding-top:max(12px,env(safe-area-inset-top));padding-bottom:max(12px,env(safe-area-inset-bottom));box-sizing:border-box;border:0;border-radius:0;background:#f5f8f7;overflow:hidden}
#resource-window #poster-back-resource{align-self:start;justify-self:start}
#resource-window #resource-poster-title{align-self:center;margin:0;font-size:clamp(1rem,2vw,1.4rem);line-height:1.25;overflow-wrap:anywhere}
#resource-window #resource-poster-image{grid-column:1/-1;display:block;width:100%;height:100%;min-width:0;min-height:0;max-width:100%;max-height:100%;object-fit:contain;margin:0}
html[data-appearance="dark"] #resource-window #resource-poster-view{background:#172624;color:#edf6f1}
