/* Update 12aj — site polish: the problems the 12-Nov audit measured on the live pages.
   Loaded after every theme file (public + admin). contrast-guard.js catches anything left. */

/* 1 · huge empty space before the footer (100px + 120px + 75–108px of padding on every page) */
main#main > :nth-last-child(1 of :not(script,style,template,link,dialog)){margin-bottom:0!important}
footer.ajf{margin-top:44px!important}
footer.ajf .ajf-in{padding-top:60px!important}
#ph{margin-bottom:20px!important}
#ph #phGal{padding-bottom:20px!important}

/* 2 · family tree cover: cream text sat on a white glass card */
#ft .ft-cover-in{background:rgba(21,55,43,.80)!important;border-color:rgba(255,252,244,.22)!important;color:#fffcf4}
#ft .ft-chips span{background:rgba(255,252,244,.14)!important;border-color:rgba(255,252,244,.28)!important;color:#fffcf4!important}
#ft .ft-chips b{color:#f1c983!important}

/* 3 · Lifescape number tiles: cyan / amber / pink numbers on white were too pale */
.ls-stats b{color:color-mix(in srgb,currentColor 58%,#10221a)!important}
.ls-stats small,.ls-stats span{color:#4b5a52!important}
/* the Lifescape tab bar: one even row, scrolls sideways on phones instead of being cut */
.ls-tabs,[role=tablist].ls-tabs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.ls-tabs::-webkit-scrollbar{display:none}
.ls-tabs button{flex:none;white-space:nowrap}

/* 4 · footer link chips: grey text on coloured chips */
footer.ajf .ajf-chip{color:#1c2b24!important;font-weight:600}

/* 5 · Courses & teaching hero: dark list text on purple / green */
.tr-hero .tr-side li,.tr-hero .tr-side small{color:rgba(255,255,255,.94)!important}

/* 6 · Work page: grey type labels on beige */
.bw-type,.wd-meta span{color:#4a5560!important}

/* 7 · pale "+N more" and helper text across lists */
em:where(.more),.more,li.more{color:#555e58}

/* 8 · the wide "My Story" menu: two columns, kept inside the screen */
@media (min-width:1100px){
  .dd8 .dd8-panel.two{width:620px!important;max-width:calc(100vw - 32px)}
  .nv9-g:last-of-type .dd8-panel.two,.nv9-g:nth-last-of-type(2) .dd8-panel.two{left:auto!important;right:0!important;transform:none!important}
}
@media (max-width:1099px){.dd8 .dd8-panel.two .dd8-list{grid-template-columns:minmax(0,1fr)!important}}

/* 9 · My Journey tab row: one sliding row on phones instead of five stacked rows */
@media (max-width:700px){nav.jt{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-left:-4px;margin-right:-4px;padding:2px 4px}nav.jt::-webkit-scrollbar{display:none}nav.jt a{flex:none}}

/* 10 · ADMIN: the theme tokens were a bright red (--primary) and a bright yellow (--accent) — white text on
   them was hard or impossible to read on buttons, badges, active tabs and toggles. Earth palette, AA-safe. */
:root body.ax,body.ax{--primary:20 52% 40%;--primary-foreground:0 0% 100%;--accent:36 58% 68%;--accent-foreground:158 45% 14%;
  --ring:20 52% 40%;--muted-foreground:150 9% 34%;--secondary-foreground:158 45% 14%}
body.ax .badge,body.ax .tag,body.ax .pill,body.ax .chip{font-weight:600}
body.ax .btn-ghost,body.ax .btn-outline,body.ax .btn-secondary{color:#15372b!important}
body.ax .btn-danger,body.ax .btn-red{background:#b42318!important;border-color:#b42318!important;color:#fff!important}
body.ax .muted,body.ax .text-muted,body.ax .hint,body.ax small.muted{color:#4d5a53!important}
body.ax ::placeholder{color:#6b756e;opacity:1}
body.ax .side-link{color:#2a3a32}
/* admin pop-up forms (Add Memory, edit dialogs): the frosted 62%-white panel turned grey over the dark
   backdrop, so labels, tabs and boxes looked faded. Solid paper panel, clear tabs and fields. */
body.ax .modal-box,body.ax .al-dlg{background:#fffcf4!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;color:#15372b}
body.ax .modal.open,body.ax .modal[open]{background:rgba(16,28,22,.5)!important}
body.ax .al-dlg .al-tabs,body.ax .al-dlg .al-seg{background:#f1e6d0!important}
body.ax .al-dlg .al-tabs button.active,body.ax .al-dlg .al-seg button.active{background:#fff!important;color:#15372b!important;box-shadow:0 1px 3px rgba(21,55,43,.18)}
body.ax .al-dlg label,body.ax .al-dlg .label{color:#15372b}
body.ax .mp-more,body.ax .al-media-pick{background:#fbf6ea!important}
body.ax .modal-close,body.ax .al-dlg [data-close],body.ax .al-dlg .close{min-width:34px;min-height:34px;color:#15372b!important;background:#f1e6d0!important;border-radius:10px}
/* footer group headings */
footer.ajf h4{color:#fbe9c6!important}
/* CV page numbers / running header */
.pg-n,.cv-run,.pg-h span{color:#5d6370!important}
/* Academic record: kind / grade tags sat just under 4.5:1 */
.ms-kind,.ms-grade{color:color-mix(in srgb,currentColor 78%,#000)!important}
/* My Domain filter labels (light grey on white) */
.md-f span,.md-filters span,.md-bar label span{color:#4b5563!important}
