/* Shared page palette. Keep document previews, charts and status colours tool-specific. */
html body.ng-site {
    --page-bg:#f5f5f7;
    --page-surface:#fff;
    --page-text:#1d1d1f;
    --page-muted:#646468;
    --page-line:#d6d6db;
    --action-blue:#2c67c5;
    --page-focus:#ffc400;
    background:var(--page-bg);
    color:var(--page-text);
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
html[data-theme="dark"] body.ng-site {
    --page-bg:#1c1c1e;
    --page-surface:#29292c;
    --page-text:#f5f5f7;
    --page-muted:#b5b5ba;
    --page-line:#48484d;
}
.ng-site #main, .ng-site.ng-workspace {
    --bg:var(--page-bg); --bg-soft:var(--page-bg);
    --card:var(--page-surface); --panel:var(--page-surface); --surface:var(--page-surface);
    --ink:var(--page-text); --text:var(--page-text); --muted:var(--page-muted);
    --border:var(--page-line); --focus:var(--page-focus);
    --govuk-text:var(--page-text); --govuk-muted:var(--page-muted);
    --govuk-blue:var(--action-blue); --govuk-yellow:var(--page-focus);
    --ng-text:var(--page-text); --ng-muted:var(--page-muted); --ng-bg:var(--page-bg);
    --ng-border:var(--page-line); --ng-card:var(--page-surface); --ng-blue:var(--action-blue);
    --brand:var(--action-blue); --blue:var(--action-blue);
    --eb-bg:var(--page-bg); --eb-surface:var(--page-surface); --eb-surface2:var(--page-bg);
    --eb-text:var(--page-text); --eb-muted:var(--page-muted); --eb-border:var(--page-line);
}
.ng-site #main :is(.page-intro,.ng-hero,.ng-section,.ng-synthid,.wrap > .header) {
    background:var(--page-bg); color:var(--page-text);
}
.ng-site #main :is(.card,.ng-card,.ng-step,.ng-faq,.ng-feature-link,.pkg,.kpi,.age-form) {
    background-color:var(--page-surface); color:var(--page-text); border-color:var(--page-line);
}
.ng-site #main :is(.page-intro p,.hint,.ng-subtitle,.ng-muted,.ng-feature-desc) { color:var(--page-muted); }
.ng-site #main :is(.ng-title,.section-title,.page-intro h1) { color:var(--page-text); letter-spacing:-.025em; }
.ng-site #main :is(.btn-primary,.ng-btn,.age-form #btn-age-calc),
.ng-workspace .btn-brand, .ng-workspace #calc {
    background:var(--action-blue); color:white; border-color:var(--action-blue);
}
.ng-site #main :is(input,select,textarea,button,a,summary):focus-visible,
.ng-workspace :is(input,select,textarea,button,a):focus-visible {
    outline:2px solid var(--page-focus); outline-offset:2px;
}
.ng-site footer.gov-footer { background:var(--page-bg); color:var(--page-muted); border-color:var(--page-line); }
.ng-site footer.gov-footer :is(h3,a,.copyright) { color:inherit; }
.ng-site .workspace-brand {
    display:flex; align-items:center; gap:6px; padding:4px max(16px,calc((100% - 1120px)/2));
    background:#000; color:#f5f5f7; text-decoration:none; font-weight:700;
}
.workspace-brand img { width:42px; height:42px; filter:brightness(0) invert(82%); }

.tool-trail, .context-links, .directory-siblings { display:flex; align-items:baseline; flex-wrap:wrap; gap:.4rem .9rem; }
.tool-trail { margin:1rem 0; font-size:.875rem; color:var(--page-muted); }
.context-links { margin:1rem 0; font-size:.9rem; }
.context-links h2 { font-size:inherit; margin:0; font-weight:600; }
.directory-more { margin:2rem 0; max-width:76ch; }
.directory-more h2 { margin:1.4rem 0 .5rem; font-size:1.15rem; }
.directory-siblings { padding:0; list-style:none; }
.directory-list { padding-left:1.2rem; }
.directory-list li { margin-block:1rem; }
.directory-list p { margin:.25rem 0; color:var(--page-muted); }

/* Keep the Tools menu legible against both the black header and the light tool cards. */
.ng-site .ng-header .dropdown-menu[aria-labelledby="toolsDrop"] {
    min-width: 12rem;
    max-width: 100%;
    margin-top: .35rem;
    padding: .35rem;
    border: 1px solid var(--page-line);
    border-radius: .8rem;
    background: #161617 !important;
    box-shadow: 0 .45rem 1rem rgb(24 38 60 / 12%);
}
.ng-site .ng-header [aria-labelledby="toolsDrop"] .dropdown-item {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: .45rem .8rem;
    border-radius: .5rem;
    color: #f5f5f7 !important;
    font-weight: 500;
}
.ng-site .ng-header [aria-labelledby="toolsDrop"] .dropdown-item:is(:hover,:focus-visible) {
    background: #343438 !important;
    color: #f5f5f7 !important;
}
.ng-site .ng-header [aria-labelledby="toolsDrop"] .dropdown-item:focus-visible {
    outline: 2px solid var(--action-blue);
    outline-offset: -2px;
}

#ngx-home .market-bar { background:var(--card); color:var(--ink); padding:1rem; min-width:0; }
#ngx-home .market-quotes { overflow-x:auto; }
#ngx-home #market-tickers { min-width:60rem; min-height:6.5rem; }
#ngx-home .market-note { color:var(--muted); font-size:.8rem; margin-top:.4rem; }
#ngx-home .market-quotes:focus-visible { outline:2px solid var(--action-blue); outline-offset:2px; }
