/* Shared neutral colors for WordPress, React widgets and body portals.
 * Loaded only by the stage-gated theme-mode.php. Brand and gain/loss colors are unchanged. */
html.mm-theme-enabled {
  --mm-ui-page: #FFFFFF;
  --mm-ui-surface: #FFFFFF;
  --mm-ui-raised: #F7F7F7;
  --mm-ui-text: #141414;
  --mm-ui-muted: #525252;
  --mm-ui-border: #D6D6D6;
  --mm-ui-action: #141414;
  --mm-ui-action-text: #FFFFFF;
  --mm-ui-selected: #C9F7CB;
  --mm-ui-filter: #F8F4FF;
  --mm-ui-filter-selected: #E4DFF1;
  --mm-ui-badge: #7054C4;
  --mm-ui-positive: #067647;
  --mm-ui-negative: #B42318;
  --mm-legacy-muted: #525252;
  --mm-sponsored-long-text: #FFFFFF;
  --mm-sponsored-short-text: #141414;
  --mm-ui-positive-flash: #C9F7CB;
  --mm-ui-negative-flash: #FFE4E1;
}
html.mm-theme-enabled.mm-dark {
  color-scheme: dark;
  /* Legacy fallbacks preserve production colours. Dark aliases also reach
   * dropdowns portalled to body; stage light mode only strengthens muted text. */
  --mm-legacy-surface: var(--mm-ui-surface);
  --mm-legacy-raised: var(--mm-ui-raised);
  --mm-legacy-text: var(--mm-ui-text);
  --mm-legacy-muted: var(--mm-ui-muted);
  --mm-legacy-disabled: #7C8491;
  --mm-sponsored-long-text: var(--mm-ui-text);
  --mm-sponsored-short-text: var(--mm-ui-text);
  --mm-legacy-border: var(--mm-ui-border);
  --mm-legacy-filter: var(--mm-ui-filter);
  --mm-legacy-selected: var(--mm-ui-filter-selected);
  --mm-ui-page: #0C0E12;
  --mm-ui-surface: #13161B;
  --mm-ui-raised: #1C2027;
  --mm-ui-text: #F5F7F6;
  --mm-ui-muted: #B2B8C2;
  --mm-ui-border: #424955;
  --mm-ui-action: #F5F7F6;
  --mm-ui-action-text: #13161B;
  --mm-ui-selected: #204C3C;
  --mm-ui-filter: #1C2027;
  --mm-ui-filter-selected: #363044;
  --mm-ui-positive: #75E0A7;
  --mm-ui-negative: #FDA29B;
  --mm-ui-positive-flash: #173E2C;
  --mm-ui-negative-flash: #4B2221;
  --background: 220 20% 6%;
  --foreground: 150 11% 96%;
  --card: 218 17% 9%;
  --card-foreground: 150 11% 96%;
  --popover: 218 17% 9%;
  --popover-foreground: 150 11% 96%;
  --primary: 150 11% 96%;
  --primary-foreground: 218 17% 9%;
  --secondary: 218 16% 13%;
  --secondary-foreground: 150 11% 96%;
  --muted: 218 16% 13%;
  --muted-foreground: 218 12% 73%;
  --accent: 218 16% 13%;
  --accent-foreground: 150 11% 96%;
  --border: 218 13% 30%;
  --input: 218 13% 30%;
  --ring: 150 11% 96%;
}
html.mm-theme-enabled.mm-dark body {
  background-color: var(--mm-ui-page);
  color: var(--mm-ui-text);
}

/* Shared legacy utility bridge while components migrate to semantic colors.
 * Do not recolor success/error, issuer branding, images, or inverse buttons. */
html.mm-theme-enabled.mm-dark .bg-white:not(.text-black):not([class~="dark:bg-white"]) {
  background-color: var(--mm-ui-surface) !important;
}
html.mm-theme-enabled.mm-dark :is(.bg-gray-25, .bg-gray-50, .bg-gray-100, .bg-gray-200) {
  background-color: var(--mm-ui-raised) !important;
}
html.mm-theme-enabled.mm-dark :is(.text-black, .text-gray-800, .text-gray-900, .text-gray-950):not(.bg-white) {
  color: var(--mm-ui-text) !important;
}
html.mm-theme-enabled.mm-dark :is(.text-gray-500, .text-gray-600, .text-gray-700):not([class~="dark:bg-white"]) {
  color: var(--mm-ui-muted) !important;
}
html.mm-theme-enabled.mm-dark :is(.fill-gray-50, .fill-gray-100, .fill-gray-200) {
  fill: var(--mm-ui-raised);
}
/* Filter selection is neutral violet, distinct from gain/success green. */
html.mm-theme-enabled.mm-dark .MobileFilterView-overlayContent {
  --mm-ui-selected: var(--mm-ui-filter-selected);
}
html.mm-theme-enabled.mm-dark .MobileFilterView-overlayContent svg {
  color: var(--mm-ui-text);
}
html.mm-theme-enabled.mm-dark .MobileFilterView-overlayContent svg :is(path, line, circle)[stroke="#000"],
html.mm-theme-enabled.mm-dark .MobileFilterView-overlayContent svg :is(path, line, circle)[stroke="black"] {
  stroke: currentColor;
}
html.mm-theme-enabled.mm-dark .MobileFilterView-overlayContent svg path[fill="#000"],
html.mm-theme-enabled.mm-dark .MobileFilterView-overlayContent svg path[fill="black"] {
  fill: currentColor;
}

html.mm-theme-enabled.mm-dark .MobileFilterView-overlayContent svg path[stroke="#0B0E14"] {
  stroke: currentColor;
}
html.mm-theme-enabled.mm-dark .MobileFilterView-overlayContent svg circle[fill="white"] {
  fill: var(--mm-ui-surface);
}

html.mm-theme-enabled.mm-dark [role="checkbox"] {
  border-color: var(--mm-ui-muted) !important;
}
html.mm-theme-enabled.mm-dark :is(.text-blue-600, .text-blue-700, .text-blue-800, .text-blue-900) {
  color: #84CAFF;
}

/* Legacy sections set text-fill on containers. Reset inheritance on children
 * so inverse buttons and gain/loss labels use their own semantic text color. */
html.mm-theme-enabled.mm-dark body * {
  -webkit-text-fill-color: currentColor;
}

/* Neutral imported SVG controls retain brand-colored artwork elsewhere. */
html.mm-theme-enabled.mm-dark .mm-neutral-icon path {
  fill: var(--mm-ui-text);
}

/* Selected chart tabs are inverse controls inside the legacy position dialog. */
html.mm-theme-enabled.mm-social-trading-page.mm-dark body [role="dialog"].mm-position-dialog .bg-foreground.text-background,
html.mm-theme-enabled.mm-social-trading-page.mm-dark body [role="dialog"].mm-position-dialog .bg-foreground.text-background svg {
  color: var(--mm-ui-action-text) !important;
  -webkit-text-fill-color: currentColor !important;
}

/* Explicit dark-mode white backings protect transparent issuer/underlying artwork
 * from older editorial white-surface overrides too. */
html.mm-theme-enabled.mm-dark body .bg-white[class~="dark:bg-white"] {
  background: #fff !important;
  color: #525252 !important;
  -webkit-text-fill-color: currentColor !important;
}

/* Sidebar editorial cards also appear outside the editorial page theme. */
html.mm-theme-enabled.mm-dark body .mm-warrant-sidebar-card {
  background-color: var(--mm-ui-surface) !important;
  color: var(--mm-ui-text);
}
html.mm-theme-enabled.mm-dark body .mm-warrant-sidebar-card h5 a {
  color: var(--mm-ui-text) !important;
}
html.mm-theme-enabled.mm-dark body .mm-warrant-sidebar-card :is(.text-theme-dark-purple:not(.bg-theme-purple), .text-theme-gray-750) {
  color: var(--mm-ui-muted) !important;
}

/* Shared WordPress sections are used by homepage, archives, articles and
 * landing pages. Keep partner logos on their original white backing. */
html.mm-theme-enabled.mm-dark body .partners {
  background: var(--mm-ui-raised) !important;
}
html.mm-theme-enabled.mm-dark body .partners :is(h2, p) {
  color: var(--mm-ui-text) !important;
  -webkit-text-fill-color: currentColor !important;
}
html.mm-theme-enabled.mm-dark body :is(.text-zinc-500, .text-theme-gray-550, .text-theme-gray-750) {
  color: var(--mm-ui-muted);
}
html.mm-theme-enabled.mm-dark body .single-instrument-ad {
  background: var(--mm-ui-raised) !important;
  color: var(--mm-ui-text) !important;
}
html.mm-theme-enabled.mm-dark body .single-instrument-ad :is(h3, .copy-text, .sourcesanspro.truncate) {
  color: var(--mm-ui-text) !important;
  -webkit-text-fill-color: currentColor !important;
}
html.mm-theme-enabled.mm-dark body .single-instrument-ad .copy-text-tooltip {
  color: #141414 !important;
  -webkit-text-fill-color: currentColor !important;
}
html.mm-theme-enabled.mm-dark body :is(.grey-btn-color, .sidebar) {
  background: var(--mm-ui-raised);
  color: var(--mm-ui-text);
}
html.mm-theme-enabled.mm-dark body .entry-content-single-newsfeed tr:nth-child(odd) {
  background: var(--mm-ui-raised);
}
html.mm-theme-enabled.mm-dark body .mm-notice-content {
  color: var(--mm-ui-muted) !important;
}
html.mm-theme-enabled.mm-dark body :is(.gform_wrapper, .contact-modal) :is(input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), select, textarea) {
  background: var(--mm-ui-surface) !important;
  color: var(--mm-ui-text) !important;
  -webkit-text-fill-color: currentColor !important;
  border-color: var(--mm-ui-border) !important;
}
html.mm-theme-enabled.mm-dark body :is(.gform_wrapper, .contact-modal) ::placeholder {
  color: var(--mm-ui-muted) !important;
  opacity: 1;
}

/* Inverse quick-search buttons/chips keep their light backing even when the
 * generic editorial surface bridge applies to their bg-white utility. */
html.mm-theme-enabled.mm-dark body .bg-white.text-black {
  background: #FFFFFF !important;
  color: #141414 !important;
  -webkit-text-fill-color: currentColor !important;
}
/* The compiled WordPress palette uses color-1 for dark grey and color-3
 * for light grey. Set heading colours explicitly over their text-white utility. */
html.mm-theme-enabled:not(.mm-dark) body .single-instrument-ad.bg-theme-instruments-color-1,
html.mm-theme-enabled:not(.mm-dark) body .single-instrument-ad.bg-theme-instruments-color-1 h3 {
  color: #FFFFFF !important;
}
html.mm-theme-enabled:not(.mm-dark) body .single-instrument-ad.bg-theme-instruments-color-3,
html.mm-theme-enabled:not(.mm-dark) body .single-instrument-ad.bg-theme-instruments-color-3 h3 {
  color: #141414 !important;
}
html.mm-theme-enabled:not(.mm-dark) body .mm-warrant-sidebar-card.bg-theme-gray-550 {
  background-color: #525252;
}
html.mm-theme-enabled:not(.mm-dark) body .mm-warrant-sidebar-card.bg-theme-gray-550 .text-theme-gray-750 {
  color: #FFFFFF;
}

/* Reusable inline editorial feature (also inserted through WordPress content). */
html.mm-theme-enabled.mm-dark body .mm-inline-feature {
  background: var(--mm-ui-raised) !important;
}
html.mm-theme-enabled.mm-dark body .mm-inline-text :is(h3, p) {
  color: var(--mm-ui-text) !important;
}
html.mm-theme-enabled.mm-dark body .mm-inline-tag {
  background: var(--mm-ui-surface);
  color: var(--mm-ui-muted);
}

/* Embedded toplist also appears on the homepage, outside Social Trading.
 * Leave gain/loss values and inverse buttons inside trader rows alone. */
html.mm-theme-enabled.mm-dark body #trader-spotlight-widget > div > div:first-child h1,
html.mm-theme-enabled.mm-dark body #trader-spotlight-widget > div > div:first-child h1::after,
html.mm-theme-enabled.mm-dark body #trader-spotlight-widget > div > div:first-child > a,
html.mm-theme-enabled.mm-dark body #trader-spotlight-widget > div > div:last-child a,
html.mm-theme-enabled.mm-dark body #trader-spotlight-widget p:not([class*="text-error-"]) {
  color: var(--mm-ui-text) !important;
  -webkit-text-fill-color: currentColor !important;
}
html.mm-theme-enabled.mm-dark body #trader-spotlight-widget > div > span {
  color: var(--mm-ui-muted) !important;
  -webkit-text-fill-color: currentColor !important;
}
html.mm-theme-enabled.mm-dark body :is(.text-error-500, .text-error-600, .text-error-700, .text-red-500, .text-red-600, .text-red-700):not([class*="bg-error-"]) {
  color: var(--mm-ui-negative);
}
html.mm-theme-enabled.mm-dark body :is(.text-success-600, .text-success-700, .text-green-500, .text-green-600, .text-green-700):not([class*="bg-success-"]) {
  color: var(--mm-ui-positive);
}

html.mm-theme-enabled.mm-dark body .mm-notice-title {
  color: var(--mm-ui-text);
}

/* Auth/read-more surfaces retain the content restriction and button hierarchy. */
html.mm-theme-enabled.mm-dark body #login-message {
  background: var(--mm-ui-raised);
  color: var(--mm-ui-text);
  border-color: var(--mm-ui-border);
}
html.mm-theme-enabled.mm-dark body #login-message .btn-alt {
  background: var(--mm-ui-surface);
  color: var(--mm-ui-text);
}
html.mm-theme-enabled.mm-dark body #content-mask {
  background: linear-gradient(to bottom, transparent 0%, var(--mm-ui-page) 50%);
}
html.mm-theme-enabled.mm-dark body .js-economic-calendar .bg-theme-light-green2 {
  background: var(--mm-ui-selected);
  color: var(--mm-ui-text);
}

html.mm-theme-enabled.mm-dark body :is(.mm-spcx-card__meta, .mm-sive-card__meta, .mm-omx-card__meta, .mm-spx-card__meta, .mm-btc-card__meta, .mm-silver-card__meta, .mm-brent-card__meta) span {
  color: var(--mm-ui-muted) !important;
}
html.mm-theme-enabled.mm-dark body .mk-tags .green {
  color: var(--mm-ui-positive);
}

/* Prefer an editorially supplied dark logo. Never paint a backing on the link:
 * it leaves a blank tile while artwork is loading or unavailable. */
.mm-issuer-logo-dark { display: none; }
html.mm-theme-enabled.mm-dark .mm-issuer-logo-light.has-dark-logo { display: none; }
html.mm-theme-enabled.mm-dark .mm-issuer-logo-dark { display: block; }
/* Nordea's supplied wordmark is monochrome blue on transparency. Its white
 * silhouette is a safe fallback until the optional dark artwork is supplied. */
html.mm-theme-enabled.mm-dark .mm-issuer-logo-light.mm-logo-nordea:not(.has-dark-logo) {
  filter: brightness(0) invert(1) !important;
}
html.mm-theme-enabled.mm-dark body .sponsored-instruments-heading > h3 {
  color: var(--mm-ui-text);
}

/* Authored education content has its own light panels inside the article body. */
html.mm-theme-enabled.mm-dark body .entry-content :is(.info-block, .factor-block) {
  background-color: var(--mm-ui-raised);
}
html.mm-theme-enabled.mm-dark body .entry-content :is(.factor-highlight, .info-block .etp-box-cta a) {
  background-color: var(--mm-ui-surface);
  color: var(--mm-ui-text);
}
html.mm-theme-enabled.mm-dark body .entry-content div[style*="background-color: #f5f6f7" i] {
  background-color: var(--mm-ui-raised) !important;
  color: var(--mm-ui-text) !important;
}

/* Theme parity: a table is one surface, not a stack of painted rectangles.
 * Preserve native radii/border widths; change only the existing colours. */
html.mm-theme-enabled.mm-dark body .MarketMateTable-tableContainer {
  --mm-table-surface: var(--mm-ui-surface);
  background: var(--mm-table-surface) !important;
  border-color: transparent !important;
}
html.mm-theme-enabled.mm-warrantlista-page.mm-dark body .MarketMateTable-tableContainer:not(:has(.MarketMateTable-tableHeaderTitle)) {
  --mm-table-surface: var(--mm-ui-page);
}
html.mm-theme-enabled.mm-dark body .MarketMateTable-tableContainer :is(table, thead, tbody, tr, th, td, .MarketMateTable-tableHeaderTitle),
html.mm-theme-enabled.mm-warrantlista-page.mm-dark body .MarketMateTable-tableContainer .MuiTableHead-root .MuiTableCell-root {
  background: var(--mm-table-surface) !important;
  border-color: #2D333D !important;
}
html.mm-theme-enabled.mm-dark body .Search-searchDesktop .MuiOutlinedInput-root,
html.mm-theme-enabled.mm-dark body .search-input .MuiOutlinedInput-root {
  background: var(--mm-ui-surface) !important;
}
html.mm-theme-enabled.mm-dark body :is(.Search-searchDesktop, .search-input) :is(input, fieldset, .MuiInputAdornment-root) {
  background: transparent !important;
  box-shadow: none !important;
}
html.mm-theme-enabled.mm-dark body .Search-searchDesktop::before,
html.mm-theme-enabled.mm-dark body .Search-searchDesktop::after {
  background: transparent !important;
}
/* A cross-origin light TrustBox must not inherit the dark iframe canvas. */
html.mm-theme-enabled .trustpilot-widget,
html.mm-theme-enabled .trustpilot-widget iframe {
  color-scheme: light;
  background: transparent !important;
  border: 0;
  box-shadow: none;
}

/* Social Trading uses the same restrained hierarchy in both modes. These
 * hooks are scoped to stage's theme gate, so production is unchanged. */
html.mm-theme-enabled body .mm-feed-card {
  background: var(--mm-ui-surface) !important;
  box-shadow: none !important;
  border: 1px solid var(--mm-ui-border);
  border-radius: 16px;
  padding-top: 20px;
}
html.mm-theme-enabled body .mm-feed-card .mm-table-heading {
  background: var(--mm-ui-raised) !important;
  color: var(--mm-ui-muted) !important;
  -webkit-text-fill-color: currentColor !important;
  padding-block: 12px;
}
html.mm-theme-enabled body .mm-feed-card .mm-table-heading [role="columnheader"] {
  border: 0;
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
}
html.mm-theme-enabled body .mm-event-date {
  background: transparent !important;
  color: var(--mm-ui-muted) !important;
  -webkit-text-fill-color: currentColor !important;
  height: auto;
  min-height: 32px;
  margin-top: 12px;
  border-bottom: 1px solid var(--mm-ui-border);
  border-radius: 0;
  font-size: 12px;
}
html.mm-theme-enabled body .mm-event-date * {
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
}
html.mm-theme-enabled body .mm-feed-card [role="row"]:not(.mm-table-heading) {
  min-height: 48px;
}
html.mm-theme-enabled body .mm-feed-card [role="row"]:not(.mm-table-heading):hover {
  background: var(--mm-ui-raised);
}

/* Authored newsletter content contains a dark-only full-width redesign.
 * Retain its light-mode panel geometry at each native breakpoint. */
html.mm-theme-enabled.mm-dark .mm-newsletter {
  padding: 36px 0 54px !important;
}
html.mm-theme-enabled.mm-dark .mm-newsletter__inner {
  width: min(calc(100% - 48px), 1850px) !important;
  margin: 0 auto !important;
  border-radius: 30px !important;
  background: var(--mm-ui-surface) !important;
}
@media (max-width: 1000px) {
  html.mm-theme-enabled.mm-dark .mm-newsletter { padding: 24px 0 42px !important; }
  html.mm-theme-enabled.mm-dark .mm-newsletter__inner { border-radius: 24px !important; }
}
@media (max-width: 680px) {
  html.mm-theme-enabled.mm-dark .mm-newsletter { padding: 18px 0 34px !important; }
  html.mm-theme-enabled.mm-dark .mm-newsletter__inner {
    width: calc(100% - 24px) !important;
    border-radius: 22px !important;
  }
}
html.mm-theme-enabled.mm-dark a[href$="/utbildning/"].bg-theme-light-green2 {
  border: 0 !important;
  box-shadow: none !important;
}

/* WordPress's legacy input selector has four :not() attributes and otherwise
 * wins over the widget rule. Paint only the outlined root, in both themes. */
html.mm-theme-enabled.mm-warrantlista-page body .Search-searchDesktop .MuiOutlinedInput-root input.MuiInputBase-input {
  height: 100%;
  box-sizing: border-box;
  padding-block: 0;
}
html.mm-theme-enabled.mm-warrantlista-page.mm-dark body .Search-searchDesktop .MuiOutlinedInput-root input.MuiInputBase-input {
  background: transparent !important;
  box-shadow: none !important;
}

/* Profile history is a body portal on a grey surface in light mode. Reuse
 * readable semantic colours rather than the lighter Tailwind defaults. */
html.mm-theme-enabled.mm-social-trading-page:not(.mm-dark) body .text-red-600 {
  color: var(--mm-ui-negative);
}
html.mm-theme-enabled.mm-social-trading-page:not(.mm-dark) body .text-green-600 {
  color: var(--mm-ui-positive);
}

/* Second colour pass: light-page metadata also needs readable contrast.
 * Promotional market cards keep their authored dark backgrounds in both modes. */
html.mm-theme-enabled:not(.mm-dark) body :is(.mm-spcx-card__meta, .mm-sive-card__meta, .mm-omx-card__meta, .mm-spx-card__meta, .mm-btc-card__meta, .mm-silver-card__meta, .mm-brent-card__meta) span {
  color: #B2B8C2 !important;
}
html.mm-theme-enabled:not(.mm-dark) body .mk-tags .green {
  color: #75E0A7 !important;
}
html.mm-theme-enabled:not(.mm-dark) body :is(.mm-newsletter__subtitle, .mm-newsletter__legal, .mm-newsletter__legal a, .text-theme-gray-550.truncate) {
  color: #525252 !important;
}
html.mm-theme-enabled:not(.mm-dark) body :is(.mm-portfolio-release-badge__new, .mm-portfolio-release-badge__label) {
  color: #067647 !important;
}
html.mm-theme-enabled:not(.mm-dark) body .mm-home-hero .home-hero-wrapper form button.bg-theme-purple.text-black {
  color: #141414 !important;
}
/* Purple action buttons keep black text in dark mode; the generic text-black remap made it light-on-lilac. */
html.mm-theme-enabled.mm-dark body .bg-theme-purple.text-black:not(:hover) {
  color: #141414 !important;
  -webkit-text-fill-color: currentColor !important;
}

/* Keep the homepage search hint readable. */
html.mm-theme-enabled.mm-dark body .mm-home-hero .home-hero-wrapper input::placeholder {
  color: var(--mm-ui-muted) !important;
  opacity: 1 !important;
}
/* Risk footer follows the page; article widgets retain a subtle section surface. */
html.mm-theme-enabled.mm-dark body footer.footer,
html.mm-theme-enabled.mm-dark body footer.footer .prefooter {
  background: var(--mm-ui-page) !important;
}
html.mm-theme-enabled.mm-dark body .mm-warrant-section {
  background: color-mix(in srgb, var(--mm-ui-page), var(--mm-ui-surface)) !important;
}
/* MM-2132: partner panel follows the page theme without inverting arbitrary artwork. */
.mm-partner-logo-dark { display: none; }
html.mm-theme-enabled.mm-dark .partners .mm-partners-panel {
  background: var(--mm-ui-surface);
}
html.mm-theme-enabled.mm-dark .partners .mm-partner-logo-light.has-dark-logo { display: none; }
html.mm-theme-enabled.mm-dark .partners .mm-partner-logo-dark {
  display: block;
  filter: none;
}
html.mm-theme-enabled.mm-dark .partners .mm-partner-monochrome {
  filter: grayscale(1) invert(1) !important;
}
html.mm-theme-enabled.mm-dark .partners .mm-partner-original {
  background: #fff;
  border-radius: 4px;
  padding: 4px;
  box-sizing: content-box;
  filter: none;
}

/* MM-2135: match the native 2.0 header rhythm and theme action control. */
/* Match native primary labels without changing their size, spacing or dropdowns. */
html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-nav-main,
html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-mobile-row-main > a {
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
}

html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-header-shell {
  max-width: 1280px;
  padding: 40px 32px;
}
html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-tools,
html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-auth { gap: 8px !important; }
html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-theme {
  width: 36px !important;
  height: 36px !important;
  color: var(--mm-ui-text) !important;
  background: transparent;
}
html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-theme svg { width: 20px; height: 20px; }
html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-auth-login,
html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-auth-signup { padding-inline: 24px !important; }
html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-auth-login { border-color: transparent !important; }
html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-desktop-nav { margin-top: 8px !important; margin-inline: -12px !important; }
@media (max-width: 1279px) {
  html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-header-shell { padding: 16px 32px !important; }
  html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-mobile-actions { gap: 8px !important; }
  html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-mobile-actions .mm-v24-theme { flex-basis: 36px !important; }
}
@media (max-width: 1023px) {
  html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-header-shell { padding-inline: 24px !important; }
}
@media (max-width: 639px) {
  html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-header-shell { padding: 14px 16px !important; }
  html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-top { min-height: 44px !important; height: 44px !important; }
  html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-mobile-actions .mm-v24-theme {
    width: 44px !important; height: 44px !important; flex-basis: 44px !important;
  }
}

@media (max-width: 639px) {
  html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-mobile-open {
    width: 44px !important; height: 44px !important; flex-basis: 44px !important;
  }
}

/* MM-2132: optional admin shortcuts must not wrap over the mobile menu.
 * Keep site/new/edit/account access; these tools remain available in wp-admin.
 */
@media (max-width: 600px) {
  html.mm-theme-enabled.mm-v26-header-enabled body.admin-bar #wpadminbar #wp-admin-bar-customize,
  html.mm-theme-enabled.mm-v26-header-enabled body.admin-bar #wpadminbar #wp-admin-bar-wpseo-menu,
  html.mm-theme-enabled.mm-v26-header-enabled body.admin-bar #wpadminbar #wp-admin-bar-gform-forms {
    display: none !important;
  }
}

/* MM-2132: Gravity Forms supplies its own light label/choice/error palette. */
html.mm-theme-enabled.mm-dark body .gform_wrapper :is(.gfield_label, .gform-field-label) {
  color: var(--mm-ui-text) !important;
}
html.mm-theme-enabled.mm-dark body .gform_wrapper :is(.gfield_description, .gform_required_legend, .gfield_consent_description) {
  color: var(--mm-ui-muted) !important;
  border-color: var(--mm-ui-border) !important;
}
html.mm-theme-enabled.mm-dark body .gform_wrapper :is(.gfield_required, .gfield_validation_message, .validation_message, .gform_validation_errors, .gform_validation_errors h2) {
  color: var(--mm-ui-negative) !important;
}
html.mm-theme-enabled.mm-dark body .gform_wrapper :is(.gfield_validation_message, .validation_message, .gform_validation_errors) {
  background: var(--mm-ui-surface) !important;
  border-color: var(--mm-ui-negative) !important;
}
html.mm-theme-enabled.mm-dark body .gform_wrapper :is(input[type="checkbox"], input[type="radio"]) {
  background: var(--mm-ui-surface) !important;
  border-color: var(--mm-ui-muted) !important;
}
html.mm-theme-enabled.mm-dark body .gform_wrapper :is(input[type="checkbox"], input[type="radio"])::before {
  color: var(--mm-ui-text) !important;
}

/* Number and search fields in filter panels need a visible boundary and focus
 * state, including menus portalled outside the widget root. */
html.mm-theme-enabled.mm-dark :is(.MobileFilterView-overlayContent, .RangeSliderSelector-popoverRoot, .MultiSelectList-popoverRoot, .MultiDimensionalSelectList-popoverRoot) {
  --mm-filter-input-border: #7C8491;
}
html.mm-theme-enabled.mm-dark :is(.MobileFilterView-overlayContent, .RangeSliderSelector-popoverRoot, .MultiSelectList-popoverRoot, .MultiDimensionalSelectList-popoverRoot) .MuiOutlinedInput-root:not(.Mui-disabled) .MuiOutlinedInput-notchedOutline {
  border-color: var(--mm-filter-input-border) !important;
}
html.mm-theme-enabled.mm-dark :is(.MobileFilterView-overlayContent, .RangeSliderSelector-popoverRoot, .MultiSelectList-popoverRoot, .MultiDimensionalSelectList-popoverRoot) .MuiOutlinedInput-root:not(.Mui-disabled):hover .MuiOutlinedInput-notchedOutline {
  border-color: var(--mm-ui-muted) !important;
}
html.mm-theme-enabled.mm-dark :is(.MobileFilterView-overlayContent, .RangeSliderSelector-popoverRoot, .MultiSelectList-popoverRoot, .MultiDimensionalSelectList-popoverRoot) .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: var(--mm-ui-text) !important;
}

/* MM-2132: production homepage authored CSS must not invert opaque partner logos
 * or split the full-width sponsor section into mismatched inner/outer surfaces. */
html.mm-theme-enabled.mm-dark body .partners > div {
  background: var(--mm-ui-raised) !important;
}
html.mm-theme-enabled.mm-dark body .partners :is(.mm-partner-original, .mm-partner-logo-dark) {
  filter: none !important;
  -webkit-filter: none !important;
  opacity: 1 !important;
}
/* TradingView transparent widgets (mini charts, market quotes) use a normal-scheme child document.
 * Matching its embedding scheme prevents Chromium's opaque white fallback. */
html.mm-theme-enabled.mm-dark iframe[src*="tradingview-widget.com/embed-widget/"] {
  color-scheme: normal;
}

html.mm-theme-enabled.mm-dark body .partners .mm-partners-panel.bg-white {
  background: var(--mm-ui-raised) !important;
}
html.mm-theme-enabled.mm-dark body .partners .mm-partner-monochrome {
  filter: brightness(0) invert(1) !important;
  -webkit-filter: brightness(0) invert(1) !important;
  opacity: 1 !important;
}
html.mm-theme-enabled.mm-dark body .mm-social-legal-accept {
  background: var(--mm-ui-action) !important;
  color: var(--mm-ui-action-text) !important;
  -webkit-text-fill-color: currentColor !important;
}
html.mm-theme-enabled.mm-dark body a.mm-education-related-link.bg-theme-light-purple.text-theme-dark-purple {
  background: #053321 !important;
  color: var(--mm-ui-positive) !important;
  -webkit-text-fill-color: currentColor !important;
}

html.mm-theme-enabled.mm-dark body a.mm-education-related-link.bg-theme-light-purple.text-theme-dark-purple:hover {
  background: #0A3D29 !important;
  color: #82EABC !important;
}

/* Pair the homepage search label with an explicit dark surface, including without CMS overrides. */
html.mm-theme-enabled.mm-dark body .mm-home-hero .home-hero-wrapper form button.bg-theme-purple.text-black {
  background-color: #1C2027 !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: currentColor !important;
}
/* Row direction icons have a fixed dark SVG fill; preserve disabled opacity on the SVG itself. */
html.mm-theme-enabled.mm-dark body .mm-direction-arrow path {
  fill: #FFFFFF !important;
}

html.mm-theme-enabled.mm-dark body .mm-search-modal-close path {
  stroke: #FFFFFF !important;
}

/* Sort direction is semantic: only the active chevron is green, including on header hover. */
html.mm-theme-enabled.mm-warrantlista-page.mm-dark body :is(.MarketMateTable-tableHeaderRootOverride, .MarketMateTable-headerTableCell) svg.mm-sort-chevron path[data-sort-state='neutral'] {
  fill: #F5F7F6 !important;
}
html.mm-theme-enabled.mm-warrantlista-page.mm-dark body :is(.MarketMateTable-tableHeaderRootOverride, .MarketMateTable-headerTableCell) svg.mm-sort-chevron path[data-sort-state='active'] {
  fill: #17B26A !important;
}

/* MM-2132: keep the close control above legacy important CMS rules.
 * The 26px visual surface sits inside a 44px touch target. Only its
 * background is translucent; the icon and keyboard focus stay opaque. */
@layer mm-auth-close {
html.mm-theme-enabled body .mm-auth-dialog button[data-dialog-close] {
  --mm-close-rgb: 232, 235, 238;
  --mm-close-icon: #272D34;
  width: 44px !important;
  height: 44px !important;
  top: 6px !important;
  right: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: var(--mm-close-icon) !important;
  -webkit-text-fill-color: currentColor !important;
  opacity: 1 !important;
}
html.mm-theme-enabled.mm-dark body .mm-auth-dialog button[data-dialog-close] {
  --mm-close-rgb: 28, 33, 40;
  --mm-close-icon: #F3F5F7;
}
html.mm-theme-enabled body .mm-auth-dialog button[data-dialog-close]::before {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle closest-side, rgba(var(--mm-close-rgb), 0.25) 0%, rgba(var(--mm-close-rgb), 0.15) 65%, rgba(var(--mm-close-rgb), 0.05) 100%);
  box-shadow: none;
  pointer-events: none;
}
html.mm-theme-enabled body .mm-auth-dialog button[data-dialog-close]:hover::before {
  background: radial-gradient(circle closest-side, rgba(var(--mm-close-rgb), 0.35) 0%, rgba(var(--mm-close-rgb), 0.20) 65%, rgba(var(--mm-close-rgb), 0.05) 100%);
}
html.mm-theme-enabled body .mm-auth-dialog button[data-dialog-close]:focus-visible {
  outline: 2px solid #009865 !important;
  outline-offset: 1px !important;
}
html.mm-theme-enabled body .mm-auth-dialog button[data-dialog-close] svg {
  position: relative;
  width: 16px !important;
  height: 16px !important;
  color: inherit !important;
  stroke: currentColor !important;
}
/* The close icon overlays the pale green artwork in both themes. */
html.mm-theme-enabled body .mm-auth-dialog:has(.mm-auth-art) button[data-dialog-close],
html.mm-theme-enabled.mm-dark body .mm-auth-dialog:has(.mm-auth-art) button[data-dialog-close] {
  --mm-close-icon: #272D34;
}
/* The mobile signup heading is dark in both themes. */
@media (max-width: 767px) {
  html.mm-theme-enabled body .mm-auth-dialog:has(.mm-auth-heading) button[data-dialog-close],
  html.mm-theme-enabled.mm-dark body .mm-auth-dialog:has(.mm-auth-heading) button[data-dialog-close] {
    --mm-close-rgb: 28, 33, 40;
  }

}
/* The desktop branded illustration is dark in both themes. Preserve the
 * approved translucent surface, with a light icon over that artwork. */
html.mm-theme-enabled body .mm-auth-dialog.mm-auth-dark-art button[data-dialog-close],
html.mm-theme-enabled.mm-dark body .mm-auth-dialog.mm-auth-dark-art button[data-dialog-close] {
  --mm-close-rgb: 28, 33, 40;
  --mm-close-icon: #F3F5F7;
}
@media (width >= 768px) {
  /* The fixed desktop close position overlays the pale green SVG shape. */
  html.mm-theme-enabled body .mm-auth-dialog.mm-auth-dark-art button[data-dialog-close],
  html.mm-theme-enabled.mm-dark body .mm-auth-dialog.mm-auth-dark-art button[data-dialog-close] {
    --mm-close-icon: #272D34;
  }
}

/* Match the exact complement of the shared ipad min-width: 768px layout. */
@media (width < 768px) {
  html.mm-theme-enabled:not(.mm-dark) body .mm-auth-dialog.mm-auth-dark-art button[data-dialog-close] {
    --mm-close-rgb: 244, 246, 248;
    --mm-close-icon: #272D34;
  }
}
}

/* MM-2132: authored article panels retain light inline surfaces beneath the
 * shared dark text rules. Match these neutral brand panels to the dark palette. */
html.mm-theme-enabled.mm-dark {
  --mm-editorial-source-text: #C9F7CB;
}
html.mm-theme-enabled.mm-dark .entry-content table[role="presentation"][style*="#f4f3ff" i] {
  background: #242036 !important;
  border-color: #52476D !important;
}
/* Authored advertising graphics contain dark labels. Retain their matching
 * pale brand surfaces and restore readable text instead of recolouring images. */
html.mm-theme-enabled.mm-dark .entry-content .wp-block-group.has-background:is(
  [style*="#f8f4ff" i], [style*="#f4f3ff" i]
) :is(h1, h2, h3, h4, p) {
  color: #5F5099 !important;
  -webkit-text-fill-color: currentColor !important;
}
html.mm-theme-enabled.mm-dark .entry-content .wp-block-group.has-background:is(
  [style*="#c9f7cb" i], [style*="#f1f1f1" i]
) :is(h1, h2, h3, h4, p) {
  color: #141414 !important;
  -webkit-text-fill-color: currentColor !important;
}

/* The disclosure may be reused on pages without the article typography rules. */
html.mm-theme-enabled.mm-dark .entry-content table[role="presentation"][style*="#f4f3ff" i] :is(h4, p) {
  color: var(--mm-ui-text) !important;
  -webkit-text-fill-color: currentColor !important;
}
/* MM-2189: keep top-list dividers subtle in dark mode. */
html.mm-dark { --mm-toplist-divider: #282D35; }

/* Keep the established drawer on smaller screens; use one row when there is room. */
@media (min-width: 1440px) {
  html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-header-shell { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 22px; max-width: 1540px !important; padding: 20px 32px !important; }
  html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-top { display: contents; }
  html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-logo { grid-column: 1; grid-row: 1; width: 180px !important; max-width: none !important; }
  html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-tools { grid-column: 3; grid-row: 1; gap: 12px !important; }
  html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-desktop-nav { grid-column: 2; grid-row: 1; margin-top: 0 !important; margin-inline: 0 !important; justify-content: center; gap: 0 !important; }
  html.mm-theme-enabled.mm-v26-header-enabled .mm-v24-nav-main { padding-left: 9px !important; padding-right: 9px !important; font-size: 14px !important; gap: 5px !important; }
}
