/* Distinct display options: mourning removes color; dark mode changes surfaces. */
html.nsm-grayscale-mode { filter: grayscale(100%); }
html.nsm-color-dark { color-scheme: dark; }

/* Compact display controls share the top contact/social strip. */
.top-bar-right { gap: 4px; }
.nsm-theme-mode-widget {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 5px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, .28);
}
.nsm-theme-toggle-btn,
body.nsm-redesign .nsm-theme-toggle-btn {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .8);
    font: inherit;
    font-size: .95rem;
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease;
}
.nsm-theme-toggle-icon { display: inline-grid; place-items: center; }
.nsm-theme-toggle-btn:hover,
body.nsm-redesign .nsm-theme-toggle-btn:hover {
    background: #d6ae5c;
    color: #281630;
}
.nsm-theme-toggle-btn.is-active,
body.nsm-redesign .nsm-theme-toggle-btn.is-active {
    background: rgba(214, 174, 92, .23);
    color: #f7d98f;
}
.nsm-theme-toggle-btn:focus-visible {
    outline: 2px solid #f7d98f;
    outline-offset: 2px;
}
@media (max-width: 900px) {
    .top-bar-left span:nth-child(2) { display: none; }
}
@media (max-width: 640px) {
    .nsm-theme-toggle-btn,
    body.nsm-redesign .nsm-theme-toggle-btn { width: 27px; height: 26px; }
    .nsm-theme-mode-widget { padding-left: 5px; margin-left: 2px; }
}
@media (prefers-reduced-motion: reduce) {
    .nsm-theme-toggle-btn { transition: none; }
}
/* Actual dark palette. Images retain their original colors. */
html.nsm-color-dark {
    --primary: #c598ea;
    --primary-light: #dcb5f6;
    --primary-hover: #e0b7fa;
    --primary-surface: #30213b;
    --primary-subtle: rgba(197, 152, 234, .14);
    --bg: #111019;
    --bg-card: #211a2a;
    --bg-card-subtle: #261e30;
    --text: #f4eef8;
    --text-secondary: #d0c4d8;
    --text-muted: #baaac6;
    --border: #453750;
    --border-light: #342a3d;
    --glass-bg: rgba(30, 24, 38, .94);
    --glass-border: rgba(197, 152, 234, .22);
}

html.nsm-color-dark body {
    background: #111019 !important;
    color: #f4eef8;
}

html.nsm-color-dark body.nsm-redesign {
    --nsr-ink: #f4eef8;
    --nsr-muted: #c7b7cf;
    --nsr-paper: #111019;
    --nsr-paper-deep: #1b1622;
    --nsr-plum: #d2a5ea;
    --nsr-plum-deep: #4d2a60;
    --nsr-purple: #d2a5ea;
    --nsr-violet: #d2a5ea;
    --nsr-lilac: #805a91;
    --nsr-gold: #e0b968;
    --nsr-gold-soft: #edcf8c;
    --nsr-divider: #453750;
}

html.nsm-color-dark body.nsm-citizen-service {
    --svc-purple: #d2a5ea;
    --svc-purple-deep: #d2a5ea;
    --svc-lilac: #30213b;
    --svc-ink: #f4eef8;
    --svc-muted: #c7b7cf;
    --svc-border: #453750;
    --svc-paper: #111019;
}

/* Shared navigation, search, and footer. */
html.nsm-color-dark .header,
html.nsm-color-dark .header.scrolled,
html.nsm-color-dark body.nsm-redesign .header,
html.nsm-color-dark body.nsm-redesign .header.scrolled {
    background: rgba(25, 19, 33, .97) !important;
    border-color: #453750 !important;
}

html.nsm-color-dark .logo-glow,
html.nsm-color-dark .dropdown-content,
html.nsm-color-dark .mobile-nav-panel,
html.nsm-color-dark .search-input,
html.nsm-color-dark .search-results,
html.nsm-color-dark .search-box {
    background: #211a2a !important;
    border-color: #453750 !important;
}

html.nsm-color-dark .logo-title,
html.nsm-color-dark .logo-subtitle,
html.nsm-color-dark .nav-link,
html.nsm-color-dark body.nsm-redesign .nav-link,
html.nsm-color-dark .dropdown-content a,
html.nsm-color-dark .mobile-nav-links a,
html.nsm-color-dark .mobile-nav-links summary {
    color: #eee3f4 !important;
}

html.nsm-color-dark .nav-link:hover,
html.nsm-color-dark .nav-link.active,
html.nsm-color-dark body.nsm-redesign .nav-link:hover,
html.nsm-color-dark body.nsm-redesign .nav-link.active {
    color: #edc986 !important;
}

html.nsm-color-dark .dropdown-content a:hover,
html.nsm-color-dark body.nsm-redesign .dropdown-content a:hover,
html.nsm-color-dark .mobile-nav-links a:hover,
html.nsm-color-dark .mobile-nav-links summary:hover {
    background: #34233e !important;
    color: #f5d396 !important;
}

html.nsm-color-dark .search-toggle,
html.nsm-color-dark body.nsm-redesign .search-toggle,
html.nsm-color-dark body.nsm-redesign .hamburger {
    color: #dfb8f4 !important;
    border-color: #654b70 !important;
}

html.nsm-color-dark .footer { background: #18121f !important; }
html.nsm-color-dark .back-to-top { background: #2f223b !important; color: #f5e9fb !important; }

/* Homepage and editorial content use dark surfaces with purple and gold accents. */
html.nsm-color-dark .nsr-main,
html.nsm-color-dark .nsr-services,
html.nsm-color-dark .nsr-ita { background: #111019 !important; }
html.nsm-color-dark .nsr-news,
html.nsm-color-dark .nsr-magazines,
html.nsm-color-dark .nsr-city-facts,
html.nsm-color-dark .nsr-noticeboard { background: #1b1622 !important; }

html.nsm-color-dark .nsr-service-item:hover,
html.nsm-color-dark .nsr-ita-item:hover { background: #2b2034 !important; }

html.nsm-color-dark .nsr-news-feature-copy,
html.nsm-color-dark .nsr-news-featured.is-portrait .nsr-news-feature-copy,
html.nsm-color-dark .nsr-notice-item:not(.is-featured),
html.nsm-color-dark .nsr-notice-item:not(.is-featured):hover,
html.nsm-color-dark .nsr-annual-featured,
html.nsm-color-dark .nsr-annual-secondary,
html.nsm-color-dark .nsr-btn-secondary,
html.nsm-color-dark .nsr-annual-tag-subtle,
html.nsm-color-dark .nsr-link-dl,
html.nsm-color-dark .service-smart-card,
html.nsm-color-dark .smart-city-showcase-card,
html.nsm-color-dark .news-smart-card,
html.nsm-color-dark .smart-city-tab-btn,
html.nsm-color-dark .stat-item {
    background: #211a2a !important;
    border-color: #453750 !important;
}

html.nsm-color-dark .nsr-news-feature-copy,
html.nsm-color-dark .nsr-annual-featured,
html.nsm-color-dark .nsr-annual-secondary,
html.nsm-color-dark .nsr-notice-copy,
html.nsm-color-dark .nsr-btn-secondary,
html.nsm-color-dark .stat-item {
    color: #f4eef8 !important;
}

html.nsm-color-dark .nsr-annual-featured :is(h2,h3,p,span,strong),
html.nsm-color-dark .nsr-annual-secondary :is(h2,h3,p,span,strong),
html.nsm-color-dark .nsr-notice-copy :is(h2,h3,p,span,strong) {
    color: #f4eef8 !important;
}

/* Shared inner-page cards, forms, and content lists. */
html.nsm-color-dark body.nsm-section-redesign,
html.nsm-color-dark body.nsm-section-redesign .page-content,
html.nsm-color-dark body.nsm-section-redesign .alderman-page { background: #111019 !important; }

html.nsm-color-dark body.nsm-section-redesign :is(
    .card-wrapper, .structure-section, .executive-group-section,
    .meetings-card-wrapper, .ita-wrapper, .alderman-empty-state,
    .timeline-card, .org-card, .org-box, .exec-card, .alderman-card,
    .ita-doc-card, .accordion-item, .news-card, .newsletter-card,
    .public-record-card, .news-article-card, .search-result-card,
    .contact-info-wrapper, .map-card-wrapper, .school-procure-list,
    .school-procure-search, .newsletter-filter, .school-tabs a,
    .search-page-input-wrap, .search-page-header .ai-summarize-card
) {
    background: #211a2a !important;
    border-color: #453750 !important;
    color: #f4eef8 !important;
}

html.nsm-color-dark body.nsm-section-redesign :is(
    .accordion-header, .ita-doc-icon, .plan-item-icon,
    .newsletter-date-box, .newsletter-year-badge, .newsletter-state,
    .school-tabs strong, .school-procure-count, .school-procure-card-icon,
    .search-result-thumb, .public-record-file, .record-print-button,
    .contact-card-icon, .pdf-icon-box, .action-arrow
) { background: #30243b !important; color: #f4eef8 !important; }

html.nsm-color-dark body.nsm-section-redesign :is(
    .newsletter-input-wrap input, .newsletter-filter select,
    .school-procure-search input, .search-page-input-wrap input
) { background: #17121e !important; color: #f4eef8 !important; border-color: #654b70 !important; }

html.nsm-color-dark body.nsm-section-redesign .alderman-photo-frame { background: #30243b !important; }

html.nsm-color-dark body.nsm-section-redesign .exec-photo-wrap { background: #30243b !important; }
html.nsm-color-dark body.nsm-section-redesign .exec-name { color: #f4eef8 !important; }
html.nsm-color-dark body.nsm-section-redesign .exec-position { color: #d2a5ea !important; }
html.nsm-color-dark body.nsm-section-redesign .exec-phone { color: #c7b7cf !important; }
html.nsm-color-dark body.nsm-section-redesign .exec-detail-button {
    background: #30243b !important;
    color: #edcf8c !important;
    border-color: #654b70 !important;
}

html.nsm-color-dark body.nsm-section-redesign .archive-header h1 { color: #d2a5ea !important; }

html.nsm-color-dark body.nsm-section-redesign .tab-toggle-btn {
    color: #e2d5e9 !important;
}
html.nsm-color-dark body.nsm-section-redesign .tab-toggle-btn:is(.active, :hover) {
    color: #f7e6ac !important;
    background: #392b45 !important;
}

html.nsm-color-dark body.nsm-section-redesign .ita-wrapper :is(
    h2, h3, p, .ita-doc-title, .accordion-header,
    .accordion-header-title, .plan-item-link, .load-more-btn
) { color: #f4eef8 !important; }

html.nsm-color-dark body.nsm-section-redesign .ita-wrapper .ita-doc-category {
    color: #edcf8c !important;
    background: #392b45 !important;
}

/* Citizen service pages, including the complaint summary shell. */
html.nsm-color-dark body.nsm-citizen-service .svc-section,
html.nsm-color-dark body.nsm-citizen-service .svc-section:nth-of-type(even),
html.nsm-color-dark body.nsm-complaint-page .cmp-stats-section { background: #16121d !important; }

html.nsm-color-dark body.nsm-citizen-service :is(
    .svc-figure, .svc-step-list li, .svc-summary-card, .svc-map,
    .svc-monitor, .svc-aqi-card, .wifi-summary-card,
    .wifi-search-bar, .wifi-search-bar input, .wifi-point-list li,
    .wifi-no-results, .cmp-qr-card, .cmp-qr-card a,
    .cmp-stats-panel, .cmp-steps li
) { background: #211a2a !important; border-color: #453750 !important; color: #f4eef8 !important; }

html.nsm-color-dark body.nsm-citizen-service :is(
    .svc-heading h2, .svc-heading p, .svc-figure figcaption,
    .cmp-service-copy h2, .cmp-service-copy > p,
    .cmp-qr-card figcaption, .cmp-steps strong,
    .cmp-steps li > span:last-child, .cmp-stats-hint
) { color: #eee3f4 !important; }

html.nsm-color-dark body.nsm-citizen-service :is(.cmp-section-label,.cmp-qr-label,.cmp-destination-note) {
    color: #d2a5ea !important;
}
html.nsm-color-dark body.nsm-citizen-service .cmp-qr-label span:first-child { color: #77d9a3 !important; }

html.nsm-color-dark body.nsm-citizen-service :is(.cmp-help-note,.svc-callout) {
    background: #30243b !important;
    color: #f4eef8 !important;
}

/* Search, AI assistant, and overlays remain readable in either page family. */
html.nsm-color-dark .hero-smart-search-card,
html.nsm-color-dark .mangkee-teaser,
html.nsm-color-dark .mangkee-chat-modal,
html.nsm-color-dark .mangkee-messages-body,
html.nsm-color-dark .mangkee-msg.bot .mangkee-bubble,
html.nsm-color-dark .mangkee-quick-chips,
html.nsm-color-dark .mangkee-input-bar,
html.nsm-color-dark .mangkee-typing,
html.nsm-color-dark .mangkee-sources,
html.nsm-color-dark .ai-summarize-card,
html.nsm-color-dark .ai-summary-content {
    background: #211a2a !important;
    color: #f4eef8 !important;
    border-color: #453750 !important;
}

html.nsm-color-dark .mangkee-input-bar input,
html.nsm-color-dark .search-input input {
    background: #17121e !important;
    color: #f4eef8 !important;
}

html.nsm-color-dark .mangkee-chat-modal [style*="background: #f8fafc"] {
    background: #211a2a !important;
}

html.nsm-color-dark .nsr-hero {
    background: radial-gradient(circle at 80% 18%, #59346d 0%, transparent 42%),
                linear-gradient(135deg, #201528 0%, #392247 58%, #2b1b38 100%) !important;
}

html.nsm-color-dark .nsr-notice-copy,
html.nsm-color-dark .nsr-magazine-cover {
    background: #261e30 !important;
    color: #f4eef8 !important;
}

html.nsm-color-dark .nsr-notice-item.is-pinned:not(.is-featured) {
    background: #352737 !important;
}

html.nsm-color-dark .nsm-cookie-modal,
html.nsm-color-dark .nsm-cookie-modal-intro,
html.nsm-color-dark .nsm-cookie-cat-item,
html.nsm-color-dark .nsm-cookie-modal-footer {
    background: #211a2a !important;
    color: #f4eef8 !important;
    border-color: #453750 !important;
}

html.nsm-color-dark .nsm-cookie-modal-intro,
html.nsm-color-dark .nsm-cookie-modal-footer {
    background: #2b2134 !important;
}

html.nsm-color-dark .nsm-cookie-modal-body,
html.nsm-color-dark .nsm-cookie-cat-title,
html.nsm-color-dark .nsm-cookie-cat-desc { color: #eee3f4 !important; }

html.nsm-color-dark .nsm-cookie-badge-locked {
    background: #19342b !important;
    color: #9ce6c4 !important;
}

/* The public login page shares the display preference but has its own CSS. */
html.nsm-color-dark .login-wrapper,
html.nsm-color-dark .form-panel { background: #211a2a !important; border-color: #453750 !important; }

html.nsm-color-dark .brand-panel {
    background: linear-gradient(135deg, #392148, #674079) !important;
}

html.nsm-color-dark .form-title,
html.nsm-color-dark .form-label,
html.nsm-color-dark .support-note strong { color: #f4eef8 !important; }

html.nsm-color-dark .form-subtitle,
html.nsm-color-dark .support-note,
html.nsm-color-dark .link-back { color: #c7b7cf !important; }

html.nsm-color-dark .form-input,
html.nsm-color-dark .form-input:focus {
    background: #17121e !important;
    border-color: #654b70 !important;
    color: #f4eef8 !important;
}

html.nsm-color-dark .form-input::placeholder { color: #a998b5 !important; }
html.nsm-color-dark .form-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #17121e inset !important;
    -webkit-text-fill-color: #f4eef8 !important;
}

html.nsm-color-dark .support-note { background: #30243b !important; border-color: #654b70 !important; }
html.nsm-color-dark .support-note a { color: #edcf8c !important; }
html.nsm-color-dark .btn-submit {
    background: linear-gradient(135deg, #704689, #59316d) !important;
    color: #fff !important;
}

/* Gold and download actions must not inherit pale dark-mode text colors. */
html.nsm-color-dark body.nsm-redesign :is(.search-overlay-close, .nsr-button-gold) {
    color: var(--nsr-gold-ink) !important;
}
html.nsm-color-dark body.nsm-redesign .nsr-link-dl {
    color: #f4eef8;
}
html.nsm-color-dark body.nsm-redesign :is(.nsr-btn-secondary, .nsr-link-dl):hover {
    color: #fff !important;
    background: #4b245c !important;
    border-color: #d6ae5c !important;
}

html.nsm-color-dark body.nsm-redesign .nsr-link-read { color: #d2a5ea; }
html.nsm-color-dark body.nsm-redesign .nsr-link-read:hover { color: #edcf8c; }

/* Pagination uses a light label on dark paper, with a filled selected state. */
html.nsm-color-dark body.nsm-section-redesign :is(.pagination, .school-procure-pagination, .newsletter-pagination, .transparency-pagination, .banner-pagination) a {
    color: #d2a5ea !important;
    background: #211a2a !important;
    border-color: #654b70 !important;
}
html.nsm-color-dark body.nsm-section-redesign :is(.pagination, .school-procure-pagination, .newsletter-pagination, .transparency-pagination, .banner-pagination) a:is(:hover, .active, [aria-current="page"]),
html.nsm-color-dark body.nsm-section-redesign .pagination .active > a {
    color: #fff !important;
    background: #4b245c !important;
    border-color: #d6ae5c !important;
}
