/*
 * Owner review: English tool pages on localhost only.
 * The server's exact local-host + English-tool gate adds .kbt-msn-local.
 * No ad requests or tool algorithms are introduced by this stylesheet.
 */
html.kbt-msn-local {
    --msn-font: "Segoe UI", "Segoe UI Midlevel", "Segoe WP", Arial, sans-serif;
    --msn-bg: #242424;
    --msn-card: #303030;
    --msn-raised: #3b3b3b;
    --msn-ink: #f5f5f5;
    --msn-muted: #c8c8c8;
    --msn-line: #484848;
    --msn-link: #86b9ff;
    --msn-hover: #414141;
    --msn-width: 1240px;
    --msn-radius: 8px;
    background: var(--msn-bg);
    color-scheme: dark;
    scroll-padding-top: 24px;
}

html.kbt-msn-local[data-kbt-msn-theme="light"] {
    --msn-bg: #f4f4f4;
    --msn-card: #ffffff;
    --msn-raised: #e9e9e9;
    --msn-ink: #242424;
    --msn-muted: #595959;
    --msn-line: #dedede;
    --msn-link: #005fb8;
    --msn-hover: #e5e5e5;
    color-scheme: light;
}

html.kbt-msn-local body,
html.kbt-msn-local .landing-main {
    --landing-bg: var(--msn-bg);
    --landing-surface: var(--msn-card);
    --landing-ink: var(--msn-ink);
    --landing-text: var(--msn-ink);
    --landing-muted: var(--msn-muted);
    --landing-border: var(--msn-line);
    --landing-accent: var(--msn-link);
    --landing-accent-hover: var(--msn-link);
    --landing-radius: var(--msn-radius);
    --bg-color: var(--msn-bg);
    --surface: var(--msn-card);
    --card-bg: var(--msn-card);
    --card-border: var(--msn-line);
    --card-radius: var(--msn-radius);
    --border: var(--msn-line);
    --border-color: var(--msn-line);
    --text-color: var(--msn-ink);
    --heading-color: var(--msn-ink);
    --text-secondary: var(--msn-muted);
    --text-muted: var(--msn-muted);
    --link-color: var(--msn-link);
    --font-primary: var(--msn-font);
    background: var(--msn-bg) !important;
    color: var(--msn-ink);
    font-family: var(--msn-font) !important;
    font-size: 16px;
    line-height: 1.5;
}

html.kbt-msn-local body { margin: 0; padding-top: 0 !important; }
html.kbt-msn-local .landing-main { contain: none; min-height: 0; }
html.kbt-msn-local :is(.site-header, .home-category-band, .tool-category-strip) { display: none !important; }
html.kbt-msn-local .msn-local-skip { position: fixed; top: -80px; left: 16px; z-index: 10010; padding: 10px 16px; border-radius: 6px; background: var(--msn-card); color: var(--msn-ink); font: 600 14px/20px var(--msn-font); }
html.kbt-msn-local .msn-local-skip:focus { top: 12px; }
html.kbt-msn-local :is(.msn-local-header, .msn-local-nav, .msn-local-shortcuts) [hidden] { display: none !important; }

/* Familiar MSN header: identity, a broad search pill, quiet utility actions. */
html.kbt-msn-local .msn-local-header {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(272px, 1fr) minmax(240px, 800px) minmax(120px, 1fr);
    align-items: center;
    gap: 24px;
    width: 100%;
    padding: 8px 28px;
    min-height: 64px;
    color: var(--msn-ink);
    background: var(--msn-bg);
    font-family: var(--msn-font);
}
html.kbt-msn-local .msn-local-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: fit-content;
    color: var(--msn-ink);
    font-size: 24px;
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: -0.6px;
    white-space: nowrap;
    text-decoration: none;
}
html.kbt-msn-local .msn-local-brand :is(svg, img) { width: 36px; height: 36px; object-fit: contain; flex: 0 0 auto; }
html.kbt-msn-local .msn-local-brand small { font-size: inherit; color: var(--msn-link); }
html.kbt-msn-local .msn-local-brand-icon { display: inline-flex; color: #66baff; }
html.kbt-msn-local .msn-local-brand-dot { color: var(--msn-link); }
html.kbt-msn-local .msn-local-brand:is(:hover, :focus-visible) .msn-local-brand-wordmark { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
html.kbt-msn-local .msn-local-search { width: 100%; min-width: 0; }
html.kbt-msn-local button.msn-local-search {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 0 20px;
    background: #ffffff;
    border: 1px solid #d6d6d6;
    border-radius: 28px;
    color: #646464;
    font: 400 16px/22px var(--msn-font);
    text-align: left;
    cursor: pointer;
}
html.kbt-msn-local .msn-local-search svg { width: 20px; height: 20px; flex: 0 0 auto; }
html.kbt-msn-local .msn-local-search kbd { margin-left: auto; color: #777777; background: #f2f2f2; border: 1px solid #e1e1e1; border-radius: 4px; padding: 1px 5px; font: 12px/20px var(--msn-font); }
/* Homepage search stays in the masthead, with an attached MSN-style suggestion list. */
html.kbt-msn-local .msn-local-inline-search { position: relative; box-sizing: border-box; display: flex; align-items: center; gap: 16px; min-height: 46px; padding: 0 20px; border: 1px solid #d6d6d6; border-radius: 28px; background: #fff; color: #646464; color-scheme: light; cursor: text; }
html.kbt-msn-local .msn-local-inline-search:focus-within { outline: 2px solid #86b9ff; outline-offset: 2px; }
html.kbt-msn-local .msn-local-inline-search.is-expanded { border-radius: 24px 24px 0 0; }
html.kbt-msn-local .msn-local-inline-search input { box-sizing: border-box; flex: 1; width: 100%; min-width: 0; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 0; outline: 0; box-shadow: none; background: transparent; color: #242424; font: 400 16px/22px var(--msn-font); }
html.kbt-msn-local .msn-local-inline-search input::placeholder { color: #646464; opacity: 1; }
html.kbt-msn-local .msn-local-inline-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
html.kbt-msn-local .msn-local-inline-search .msn-local-search-clear { flex: 0 0 28px; display: grid; place-items: center; width: 28px; height: 28px; min-height: 28px; margin: 0 -8px 0 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #646464; font: 400 24px/28px var(--msn-font); cursor: pointer; }
html.kbt-msn-local .msn-local-inline-search .msn-local-search-clear:hover { background: #ededed; }
html.kbt-msn-local .msn-local-search-results { position: absolute; z-index: 2; box-sizing: border-box; top: 100%; left: -1px; right: -1px; max-height: min(450px, calc(100dvh - 180px)); padding: 8px 0; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #d6d6d6; border-top: 1px solid #ededed; border-radius: 0 0 24px 24px; background: #fff; color: #242424; box-shadow: 0 12px 22px rgba(0,0,0,.2); cursor: default; }
html.kbt-msn-local .msn-local-search-group { padding: 6px 20px; color: #666; font: 400 11px/16px var(--msn-font); text-transform: uppercase; }
html.kbt-msn-local .msn-local-search-result { display: block; padding: 8px 20px; color: #242424; text-decoration: none; font: 400 16px/22px var(--msn-font); overflow-wrap: anywhere; }
html.kbt-msn-local .msn-local-search-result:hover, html.kbt-msn-local .msn-local-search-result[aria-selected="true"] { background: #f0f4fa; }
html.kbt-msn-local .msn-local-search-result strong { display: block; color: #005fb8; font: 600 16px/22px var(--msn-font); }
html.kbt-msn-local .msn-local-search-result small { display: block; margin-top: 2px; color: #595959; font: 400 13px/18px var(--msn-font); }
html.kbt-msn-local .msn-local-search-empty { margin: 0; padding: 12px 20px; font: 400 14px/22px var(--msn-font); }
html.kbt-msn-local .msn-local-search-status { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html.kbt-msn-local .msn-local-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
html.kbt-msn-local .msn-local-actions :is(button, a) { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; min-width: 36px; padding: 6px; border: 0; border-radius: 6px; color: var(--msn-ink); background: transparent; text-decoration: none; font: 14px/20px var(--msn-font); cursor: pointer; }
html.kbt-msn-local .msn-local-actions :is(button, a):hover { background: var(--msn-hover); }
html.kbt-msn-local .msn-local-actions svg { width: 21px; height: 21px; }
html.kbt-msn-local .msn-local-language { position: relative; z-index: 3; }
html.kbt-msn-local .msn-local-language summary { box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 36px; padding: 6px; border-radius: 6px; color: var(--msn-ink); font: 400 14px/20px var(--msn-font); cursor: pointer; list-style: none; }
html.kbt-msn-local .msn-local-language summary::-webkit-details-marker { display: none; }
html.kbt-msn-local .msn-local-language summary:hover, html.kbt-msn-local .msn-local-language[open] summary { background: var(--msn-hover); }
html.kbt-msn-local .msn-local-language summary:focus-visible { outline: 2px solid var(--msn-link); outline-offset: 3px; }
html.kbt-msn-local .msn-local-language summary svg { width: 12px; height: 12px; }
html.kbt-msn-local .msn-local-language[open] summary svg { transform: rotate(180deg); }
html.kbt-msn-local .msn-local-language-options { position: absolute; top: calc(100% + 8px); right: 0; box-sizing: border-box; width: 230px; max-width: calc(100vw - 32px); max-height: min(450px, calc(100dvh - 100px)); overflow-y: auto; overscroll-behavior: contain; padding: 8px; border: 1px solid var(--msn-line); border-radius: 10px; background: var(--msn-card); color: var(--msn-ink); box-shadow: 0 12px 28px rgba(0,0,0,.25); }
html.kbt-msn-local .msn-local-language-title { display: block; padding: 6px 10px 8px; color: var(--msn-muted); font: 400 12px/18px var(--msn-font); }
html.kbt-msn-local .msn-local-language-options a { display: flex; justify-content: flex-start; gap: 10px; padding: 8px 10px; min-height: 36px; font: 400 14px/20px var(--msn-font); }
html.kbt-msn-local .msn-local-language-options a[aria-current="page"] { color: var(--msn-link); background: var(--msn-hover); }
html.kbt-msn-local .msn-local-language-options img { flex: 0 0 20px; width: 20px; height: 15px; object-fit: cover; border-radius: 2px; }
html.kbt-msn-local .msn-local-language-current { margin-left: auto; }

/* The homepage masthead sticks; categories and the ad stay in ordinary flow. */
html.kbt-msn-local .msn-local-header--home { position: sticky; top: 0; z-index: 1000; transition: transform .22s ease, box-shadow .2s ease; }
html.kbt-msn-local .msn-local-header--home.scrolled { box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
html.kbt-msn-local .msn-local-header--home.msn-local-header--tool-hidden { transform: translateY(calc(-100% - 1px)); box-shadow: none; pointer-events: none; visibility: hidden; }
/* Keep the button measurable for shared ad-clearance/docking calculations. */
html.kbt-msn-local:has(.msn-local-header--home):not([data-kbt-msn-after-tool]) #back-to-top { visibility: hidden; opacity: 0; pointer-events: none; }

/* Shortcuts retain real KBT destinations, rather than unrelated portal links. */
html.kbt-msn-local .msn-local-shortcuts { display: flex; align-items: start; justify-content: center; gap: 24px; width: min(100% - 32px, 880px); margin: 8px auto 18px; padding: 0 0 2px; }
html.kbt-msn-local .msn-local-shortcut { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 0 0 76px; min-width: 0; color: var(--msn-ink); font: 600 12px/16px var(--msn-font); text-decoration: none; text-align: center; }
html.kbt-msn-local .msn-local-shortcut-icon { display: grid; place-items: center; box-sizing: border-box; width: 42px; height: 42px; padding: 9px; border-radius: 12px; background: var(--msn-raised); color: var(--shortcut-color, #80c8ff); transition: background .15s ease; }
html.kbt-msn-local .msn-local-shortcut-icon :is(svg, img) { display: block; width: 25px; height: 25px; object-fit: contain; }
html.kbt-msn-local[data-kbt-msn-theme="light"] .msn-local-shortcut-icon { color: var(--msn-link); }
html.kbt-msn-local .msn-local-shortcut:hover .msn-local-shortcut-icon { background: var(--msn-hover); }
html.kbt-msn-local .msn-local-shortcuts[data-msn-tool-categories] .msn-local-shortcut { --shortcut-visible-color: color-mix(in srgb, var(--shortcut-color) 72%, white); }
html.kbt-msn-local[data-kbt-msn-theme="light"] .msn-local-shortcuts[data-msn-tool-categories] .msn-local-shortcut { --shortcut-visible-color: var(--shortcut-color); }
html.kbt-msn-local .msn-local-shortcuts[data-msn-tool-categories] .msn-local-shortcut-icon { color: #80c8ff; transition: color .15s ease, background .15s ease; }
html.kbt-msn-local[data-kbt-msn-theme="light"] .msn-local-shortcuts[data-msn-tool-categories] .msn-local-shortcut-icon { color: var(--msn-link); }
html.kbt-msn-local .msn-local-shortcuts[data-msn-tool-categories] .msn-local-shortcut:is(:hover, :focus-visible),
html.kbt-msn-local .msn-local-shortcuts[data-msn-tool-categories] .msn-local-shortcut:is(:hover, :focus-visible) .msn-local-shortcut-icon { color: var(--shortcut-visible-color); }
html.kbt-msn-local .msn-local-shortcuts[data-msn-tool-categories] .msn-local-shortcut:focus-visible { outline: none; text-decoration: underline; text-underline-offset: 3px; }

/* An inert reservation for the owner's local layout review. */
html.kbt-msn-local .msn-local-ad { width: min(100% - 32px, 970px); margin: 0 auto 22px; font-family: var(--msn-font); }
html.kbt-msn-local .msn-local-ad-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; width: 970px; max-width: 100%; height: 250px; overflow: hidden; border: 1px solid var(--msn-line); background: linear-gradient(120deg, var(--msn-card), var(--msn-bg)); color: var(--msn-muted); }
html.kbt-msn-local .msn-local-ad-slot > :is(strong, b) { color: var(--msn-muted); font: 400 20px/26px var(--msn-font); }
html.kbt-msn-local .msn-local-ad-slot > :is(span, small, p) { margin: 0; font: 400 12px/18px var(--msn-font); }
html.kbt-msn-local .msn-local-ad-size { color: var(--msn-muted); font: 400 12px/18px var(--msn-font); }

html.kbt-msn-local .msn-local-nav { display: flex; align-items: center; gap: 6px; box-sizing: border-box; width: min(100% - 32px, var(--msn-width)); margin: 0 auto 12px; padding: 0; }
html.kbt-msn-local .msn-local-nav :is(a, button) { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; min-height: 36px; padding: 7px 13px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--msn-ink); font: 400 14px/20px var(--msn-font); text-decoration: none; cursor: pointer; }
html.kbt-msn-local .msn-local-nav :is(a, button):hover { background: var(--msn-hover); }
html.kbt-msn-local .msn-local-nav :is([aria-current="page"], [aria-current="true"], [aria-selected="true"], .is-active) { background: var(--msn-raised); border-color: var(--msn-line); color: var(--msn-link); font-weight: 600; }
html.kbt-msn-local .msn-local-nav .msn-local-nav-end { margin-left: auto; border-color: var(--msn-muted); border-radius: 20px; font-weight: 400; }
html.kbt-msn-local .msn-local-nav .msn-local-nav-guide { margin-left: auto; border-color: var(--msn-muted); border-radius: 20px; font-weight: 400; }

/* Keep each existing H1 and lead; remove the tall photo/CTA hero treatment. */
html.kbt-msn-local .landing-main .landing-hero { box-sizing: border-box; width: min(100% - 32px, var(--msn-width)); min-height: 0 !important; margin: 0 auto 12px; padding: 18px 22px !important; border: 0 !important; border-radius: var(--msn-radius); overflow: visible; background: var(--msn-card) !important; }
html.kbt-msn-local body .landing-main .landing-hero :is(.home-banner, .home-banner-content, .home-banner-copy, .landing-hero-grid, .hero-copy) { position: static !important; display: block !important; width: 100% !important; max-width: none !important; min-height: 0 !important; height: auto !important; margin: 0 !important; padding: 0 !important; transform: none !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
html.kbt-msn-local body .landing-main .landing-hero::after,
html.kbt-msn-local body .landing-main .landing-hero .home-banner::before,
html.kbt-msn-local body .landing-main .landing-hero .home-banner::after { content: none !important; }
html.kbt-msn-local body .landing-main .landing-hero :is(.home-banner-media, .hero-visual, .hero-actions, .hero-kicker, .hero-badges, .hero-languages, .hero-metrics, .home-hero-store-button, .hero-store-slot, .kbt-ad-slot, .kbt-gam-ad, .home-banner-ad, .hero-stack) { display: none !important; }
html.kbt-msn-local body .landing-main .landing-hero .hero-title,
html.kbt-msn-local body .landing-main .landing-hero .home-banner-copy h1.hero-title,
html.kbt-msn-local body .landing-main .landing-hero h1.hero-title { max-width: none !important; margin: 0 0 6px !important; color: var(--msn-ink) !important; font: 600 24px/32px var(--msn-font) !important; letter-spacing: 0 !important; text-shadow: none !important; }
html.kbt-msn-local body .landing-main .landing-hero .hero-title-line { display: inline !important; white-space: normal !important; color: inherit !important; }
html.kbt-msn-local body .landing-main .landing-hero .hero-lede { width: auto !important; max-width: 960px !important; margin: 0 !important; color: var(--msn-muted) !important; font: 400 16px/24px var(--msn-font) !important; text-shadow: none !important; }
html.kbt-msn-local body .landing-main .landing-hero .home-banner-copy { color: var(--msn-ink) !important; }
html.kbt-msn-local body :is(.landing-hero, .at-language-panel) .kbt-visible-breadcrumb { color: var(--msn-muted) !important; font: 400 12px/18px var(--msn-font); }
html.kbt-msn-local body :is(.landing-hero, .at-language-panel) .kbt-visible-breadcrumb a { color: var(--msn-link) !important; }
html.kbt-msn-local body :is(.landing-hero, .at-language-panel) :is(.kbt-visible-breadcrumb__current, .kbt-visible-breadcrumb__separator) { color: var(--msn-muted) !important; }

/* One homepage introduction/ad band, rendered in place with the original H1. */
html.kbt-msn-local .msn-local-hero-row { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 16px; box-sizing: border-box; width: min(100% - 32px, 1440px); margin: 0 auto 20px; }
/* A full-width photo strip followed by the original title and description. */
html.kbt-msn-local .landing-main .msn-local-hero-row > .home-hero { grid-column: 1; grid-row: 1; display: block !important; align-self: stretch; width: 100%; min-width: 0; margin: 0; padding: 0 !important; overflow: hidden !important; }
html.kbt-msn-local body .landing-main .msn-local-hero-row .home-hero .home-banner-media { position: static !important; inset: auto !important; display: block !important; width: 100% !important; max-width: none !important; height: 120px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; overflow: hidden; border-radius: 0; transform: none !important; }
html.kbt-msn-local body .landing-main .msn-local-hero-row .home-hero .home-banner-media img { position: static !important; display: block; width: 100% !important; max-width: 100% !important; height: 100% !important; object-fit: cover !important; object-position: center !important; filter: none !important; transform: none !important; opacity: 1 !important; }
html.kbt-msn-local body .landing-main .msn-local-hero-row .home-hero .home-banner-content { box-sizing: border-box; padding: 18px 22px !important; }
html.kbt-msn-local .msn-local-hero-row > .msn-local-ad { grid-column: 1; grid-row: 2; width: 728px; max-width: 100%; margin: 0 auto; }
html.kbt-msn-local .msn-local-hero-row .msn-local-ad-slot { width: 728px; max-width: 100%; height: 90px; }
@media (min-width: 1051px) {
    /* Match the feed's five columns: the ad spans three, the introduction two. */
    html.kbt-msn-local .msn-local-hero-row { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; gap: 12px; }
    html.kbt-msn-local .msn-local-hero-row > .msn-local-ad { grid-column: 1 / span 3; grid-row: 1; width: 100%; min-width: 0; }
    html.kbt-msn-local .msn-local-hero-row .msn-local-ad-slot { width: 100%; height: 100%; min-height: 250px; border-radius: var(--msn-radius); }
    html.kbt-msn-local .landing-main .msn-local-hero-row > .home-hero { grid-column: 4 / span 2; grid-row: 1; }
}
@media (max-width: 600px) {
    html.kbt-msn-local .msn-local-hero-row > .msn-local-ad, html.kbt-msn-local .msn-local-hero-row .msn-local-ad-slot { width: 320px; }
    html.kbt-msn-local .msn-local-hero-row .msn-local-ad-slot { height: 100px; }
    html.kbt-msn-local body .landing-main .msn-local-hero-row .home-hero .home-banner-media { height: 110px !important; }
    html.kbt-msn-local body .landing-main .msn-local-hero-row .home-hero .home-banner-content { padding: 16px !important; }
}

/* The functional tool keeps its own geometry, colors and fullscreen logic. */
html.kbt-msn-local .landing-main .tool-stage { box-sizing: border-box; width: min(100% - 32px, var(--msn-width)); min-height: 0 !important; margin: 0 auto 20px; padding: 0 !important; border: 0; background: transparent !important; }
html.kbt-msn-local .landing-main .tool-stage .tool-shell { box-sizing: border-box; width: 100% !important; max-width: 100% !important; min-height: 0 !important; margin: 0 auto !important; padding: 20px !important; border: 1px solid var(--msn-line) !important; border-radius: var(--msn-radius) !important; background: var(--msn-card) !important; box-shadow: none !important; }
html.kbt-msn-local .landing-main #keyboard-stage .tool-shell,
html.kbt-msn-local .landing-main #mouse-test-tool .tool-shell { padding: 0 !important; border: 0 !important; background: transparent !important; }
/* Match the outer edges of the homepage title and advertisement band. */
html.kbt-msn-local .landing-main .msn-local-hero-row ~ #keyboard-stage { width: min(100% - 32px, 1440px); max-width: none; }
html.kbt-msn-local .landing-main .msn-local-hero-row ~ #keyboard-stage :is(.keyboard-container, #keyboard-controls, .feature-controls) { width: 100%; max-width: none; }

/* Compact homepage controls, using the same neutral surfaces as the cards. */
html.kbt-msn-local .msn-local-hero-row ~ #keyboard-stage #keyboard-controls { --control-height: 88px; min-height: 0; padding: 8px; gap: 10px; border-color: var(--msn-line); border-radius: var(--msn-radius); background: var(--msn-card); color: var(--msn-ink); box-shadow: none; }
html.kbt-msn-local .msn-local-hero-row ~ #keyboard-stage #keyboard-controls .textarea-wrapper { height: var(--control-height); border-color: var(--msn-line); border-radius: 4px; background: var(--msn-bg); }
html.kbt-msn-local .msn-local-hero-row ~ #keyboard-stage #keyboard-controls .textarea-label { display: none; }
html.kbt-msn-local .msn-local-hero-row ~ #keyboard-stage #keyboard-controls .text-box { height: 100%; min-height: 0; padding: 10px 12px; background: var(--msn-bg); color: var(--msn-ink); }
html.kbt-msn-local .msn-local-hero-row ~ #keyboard-stage #keyboard-controls .text-box:focus { background: var(--msn-bg); box-shadow: inset 0 0 0 2px var(--msn-link); }
html.kbt-msn-local .msn-local-hero-row ~ #keyboard-stage #keyboard-controls .text-box::placeholder { color: var(--msn-muted); }
html.kbt-msn-local .msn-local-hero-row ~ #keyboard-stage #keyboard-controls :is(.select-wrapper, .reset-button) { border-color: var(--msn-line); border-radius: 4px; background: var(--msn-bg); color: var(--msn-ink); box-shadow: none; }
html.kbt-msn-local .msn-local-hero-row ~ #keyboard-stage #keyboard-controls .select-wrapper { padding: 3px 8px; gap: 2px; }
html.kbt-msn-local .msn-local-hero-row ~ #keyboard-stage #keyboard-controls .select-wrapper label { color: var(--msn-muted); }
html.kbt-msn-local .msn-local-hero-row ~ #keyboard-stage #keyboard-controls .select-wrapper select { min-height: 20px; color: var(--msn-ink); }
html.kbt-msn-local .msn-local-hero-row ~ #keyboard-stage #keyboard-controls .select-wrapper option { background: var(--msn-bg); color: var(--msn-ink); }
html.kbt-msn-local .msn-local-hero-row ~ #keyboard-stage #keyboard-controls .reset-button:hover { border-color: var(--msn-muted); background: var(--msn-hover); color: var(--msn-ink); }
html.kbt-msn-local .msn-local-hero-row ~ #keyboard-stage #keyboard-controls .advanced-toggle-btn { border-radius: 4px; }

/* Advanced diagnostics follow the page theme independently of the keycap theme. */
html.kbt-msn-local body.home-redesign #keyboard-stage :is(#feature-controls, .stats-panel) {
    --bg-primary: var(--msn-bg);
    --bg-secondary: var(--msn-card);
    --bg-tertiary: var(--msn-raised);
    --key-text: var(--msn-ink);
    --key-border: var(--msn-line);
    --text-primary: var(--msn-ink);
    --text-secondary: var(--msn-muted);
    --text-muted: var(--msn-muted);
    --border-subtle: var(--msn-line);
    --accent-primary: var(--msn-link);
    --accent-success: #64d996;
    --accent-warning: #ffd166;
    --accent-danger: #ff8a8a;
    --glow-color: transparent;
    color: var(--msn-ink);
    font-family: var(--msn-font);
    border-color: var(--msn-line);
    border-radius: var(--msn-radius);
    background: var(--msn-card);
    box-shadow: none;
}
html.kbt-msn-local[data-kbt-msn-theme="light"] body.home-redesign #keyboard-stage :is(#feature-controls, .stats-panel) {
    --accent-success: #167044;
    --accent-warning: #8a5700;
    --accent-danger: #b42318;
}
html.kbt-msn-local body.home-redesign #keyboard-stage #feature-controls .feature-button { border-color: var(--msn-line); background: var(--msn-bg); color: var(--msn-ink); }
html.kbt-msn-local body.home-redesign #keyboard-stage #feature-controls .feature-button:hover { border-color: var(--msn-muted); background: var(--msn-hover); color: var(--msn-ink); }
html.kbt-msn-local body.home-redesign #keyboard-stage #feature-controls .feature-button.active { border-color: #0067b8; background: #0067b8; color: #fff; }
html.kbt-msn-local body.home-redesign #keyboard-stage .stats-panel :is(.status-indicator, .status-indicator span) { color: var(--msn-ink); }
html.kbt-msn-local body.home-redesign #keyboard-stage .stats-panel .info-text { color: var(--msn-muted); }
html.kbt-msn-local body.home-redesign #keyboard-stage .stats-panel .big-latency { background: none; background-clip: border-box; -webkit-background-clip: border-box; -webkit-text-fill-color: currentColor; color: var(--msn-link); }
html.kbt-msn-local body.home-redesign #keyboard-stage .stats-panel :is(.stat-item, .log-container, .rating-box, .action-btn, .close-btn) { border-radius: var(--msn-radius); }
html.kbt-msn-local body.home-redesign #keyboard-stage .stats-panel .info-box { background: var(--msn-raised); }
html.kbt-msn-local body.home-redesign #keyboard-stage .stats-panel .action-btn.primary { border-color: #0067b8; background: #0067b8; color: #fff; box-shadow: none; }
html.kbt-msn-local body.home-redesign #keyboard-stage :is(#feature-controls, .stats-panel) :is(button, summary):focus-visible { outline: 2px solid var(--msn-link); outline-offset: 3px; }
html.kbt-msn-local body.home-redesign #keyboard-stage #adv-pro-panel {
    --pn-bg: var(--msn-card);
    --pn-bg-card: var(--msn-bg);
    --pn-bg-elev: var(--msn-raised);
    --pn-border: var(--msn-line);
    --pn-border-2: var(--msn-muted);
    --pn-text: var(--msn-ink);
    --pn-text-2: var(--msn-muted);
    --pn-text-3: var(--msn-muted);
    --pn-accent: var(--msn-link);
    --pn-accent-2: var(--msn-link);
    --pn-accent-soft: var(--msn-raised);
    --pn-success: var(--accent-success);
    --pn-success-soft: rgba(62, 207, 142, .1);
    --pn-danger: var(--accent-danger);
    --pn-danger-soft: rgba(239, 68, 68, .1);
    --pn-r-lg: var(--msn-radius);
    --pn-r: var(--msn-radius);
    --pn-r-sm: 4px;
    --pn-shadow: none;
    --pn-shadow-lg: none;
}
html.kbt-msn-local body.home-redesign #keyboard-stage #adv-pro-panel .adv-preset-active { background: #0067b8; color: #fff; }

/* One existing inline ad, with the genuine usage and rating widgets beside it. */
html.kbt-msn-local #keyboard-stage .msn-local-ad-trust-row { order: 16; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 16px; width: 100%; margin: 12px 0 0; }
html.kbt-msn-local #keyboard-stage .msn-local-ad-trust-row > .kbt-keyboard-inline-surface { order: 0; width: min(970px, 100%); margin: 0 auto; }
html.kbt-msn-local #keyboard-stage .msn-local-trust { box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 90px; padding: 10px 8px; border: 1px solid var(--msn-line); border-radius: var(--msn-radius); background: var(--msn-card); color: var(--msn-ink); }
html.kbt-msn-local #keyboard-stage .msn-local-trust :is(.kbt-usage-row, .kbt-rating-row) { width: 100%; margin: 0 !important; padding: 0 !important; }
html.kbt-msn-local #keyboard-stage .msn-local-trust .kbt-usage { white-space: nowrap; }
html.kbt-msn-local #keyboard-stage .msn-local-trust .kbt-rating { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--msn-ink); font: 500 13px/20px var(--msn-font); white-space: nowrap; }
html.kbt-msn-local #keyboard-stage .msn-local-trust .kbt-rating-label { flex: 0 0 auto; }
html.kbt-msn-local #keyboard-stage .msn-local-trust .kbt-rating-star { font-size: 20px; padding: 0; }
html.kbt-msn-local #keyboard-stage .msn-local-trust .kbt-rating-meta { gap: 4px; }
html.kbt-msn-local #keyboard-stage .msn-local-trust .kbt-rating-avg { font-size: 13px; }
html.kbt-msn-local #keyboard-stage .msn-local-trust .kbt-rating-count { font-size: 12px; }
html.kbt-msn-local body.home-redesign #keyboard-stage .msn-local-trust .kbt-rating-prompt { display: none; }
html.kbt-msn-local #keyboard-stage .msn-local-trust :is(.kbt-rating-prompt, .kbt-rating-thanks) { flex-basis: 100%; white-space: normal; }
html.kbt-msn-local #keyboard-stage .msn-local-trust .msn-local-rating-feedback-link { display: inline-block; margin-inline-start: 4px; color: var(--msn-link); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
html.kbt-msn-local #keyboard-stage .msn-local-trust .msn-local-rating-feedback-link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
html.kbt-msn-local #keyboard-stage .msn-local-trust :is(.kbt-rating-label, .kbt-rating-avg, .kbt-rating-prompt, .kbt-usage b) { color: var(--msn-ink); }
html.kbt-msn-local #keyboard-stage .msn-local-trust :is(.kbt-rating-count, .kbt-usage) { color: var(--msn-muted); }
@media (min-width: 1281px) {
    html.kbt-msn-local #keyboard-stage .msn-local-ad-trust-row { grid-template-columns: 970px minmax(0, 1fr); gap: 24px; }
    html.kbt-msn-local #keyboard-stage .msn-local-ad-trust-row > .kbt-keyboard-inline-surface { margin: 0; }
}

html.kbt-msn-local .tool-template-inline-head { display: none !important; }
html.kbt-msn-local .tool-stage-header { margin: 0 0 12px; padding: 16px 20px; background: var(--msn-card); border-radius: var(--msn-radius); }
html.kbt-msn-local .tool-stage-header :is(h2, p) { margin: 0; }
html.kbt-msn-local .tool-stage-header h2 { color: var(--msn-ink); font: 600 20px/26px var(--msn-font); }
html.kbt-msn-local .msn-local-tool-panel { border-radius: var(--msn-radius) !important; box-shadow: none !important; }

/* Retheme the mouse tester's panel variables without touching its canvas. */
html.kbt-msn-local #mouse-tester-app { --mt-surface: var(--msn-card); --mt-bg: var(--msn-bg); --mt-text: var(--msn-ink); --mt-muted: var(--msn-muted); --mt-border: var(--msn-line); }
html.kbt-msn-local :is(.mt-intro, .mt-card) { border-radius: var(--msn-radius); box-shadow: none; }
html.kbt-msn-local .mt-layout { gap: 12px; }
html.kbt-msn-local .mt-intro h2 { font-size: 24px; line-height: 32px; }
html.kbt-msn-local .mt-card-head h3 { font-size: 20px; line-height: 26px; }

/* Cards below the tool borrow the compact MSN image/headline rhythm. */
html.kbt-msn-local :is(.tool-popular-tools, .related-tools, .homepage-latest-blog, .feature-band, .process-band, .trust-strip, .tools-list-section, .guidelines.landing-guide, .home-guideline-brief) { margin: 0; padding: 20px 16px !important; background: var(--msn-bg) !important; border: 0 !important; }
html.kbt-msn-local :is(.tool-popular-tools, .related-tools, .homepage-latest-blog, .feature-band, .process-band, .trust-strip, .tools-list-section) > .container { box-sizing: border-box; width: 100% !important; max-width: var(--msn-width) !important; margin: 0 auto; padding: 0 !important; }
html.kbt-msn-local :is(.tool-popular-tools-head, .homepage-latest-blog-head, .related-tools-header, .section-head) { margin: 0 0 14px; }
html.kbt-msn-local :is(.tool-popular-tools-head h2, .homepage-latest-blog-head h2, .related-tools-header h2, .section-head h2, .tools-list-section > .container > h2) { margin: 0; color: var(--msn-ink) !important; font: 600 24px/32px var(--msn-font) !important; }
html.kbt-msn-local :is(.tool-popular-tools-grid, .homepage-latest-blog-grid, .related-tools-grid, .landing-feature-grid, .process-grid, .tools-grid, .msn-local-grid) { gap: 12px !important; background: transparent !important; border: 0 !important; }
html.kbt-msn-local :is(.tool-popular-tools-grid, .homepage-latest-blog-grid, .related-tools-grid, .msn-local-grid) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.kbt-msn-local :is(.tool-popular-card, .homepage-latest-blog-card, .related-tool-card, .landing-feature-card, .process-card, .trust-item, .tool-card, .help-card, .msn-local-card) { min-width: 0; overflow: hidden; border: 1px solid var(--msn-line) !important; border-radius: var(--msn-radius) !important; background: var(--msn-card) !important; color: var(--msn-ink); box-shadow: none !important; text-decoration: none; }
html.kbt-msn-local :is(.tool-popular-card, .homepage-latest-blog-card, .related-tool-card, .tool-card):hover { border-color: #777777 !important; background: var(--msn-raised) !important; transform: none !important; }
html.kbt-msn-local :is(.tool-popular-card-img, .homepage-latest-blog-img) { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 7px 7px 0 0; }
html.kbt-msn-local .tool-popular-card-body { padding: 14px 16px 16px; }
html.kbt-msn-local :is(.tool-popular-card h3, .homepage-latest-blog-card h3, .related-tool-card h3, .landing-feature-card h3, .process-card h3, .tool-card .tool-name, .help-card h3, .msn-local-card h3) { color: var(--msn-ink) !important; font: 600 20px/26px var(--msn-font) !important; letter-spacing: 0 !important; }
html.kbt-msn-local .tool-popular-card-body > strong { color: var(--msn-ink) !important; font: 600 20px/26px var(--msn-font) !important; letter-spacing: 0 !important; }
html.kbt-msn-local :is(.tool-popular-card-category, .homepage-latest-blog-date, .tool-card-category, .section-kicker) { color: var(--msn-muted) !important; font: 400 12px/18px var(--msn-font) !important; letter-spacing: 0 !important; text-transform: none !important; }
html.kbt-msn-local :is(.tool-popular-card-desc, .related-tool-card p, .landing-feature-card p, .process-body p, .trust-desc, .section-lede, .related-tools-intro) { color: var(--msn-muted) !important; font: 400 16px/24px var(--msn-font); }
html.kbt-msn-local :is(.tool-popular-card-cta, .homepage-latest-blog-cta, .related-tool-link, .tool-card-link, .tool-popular-tools-all) { color: var(--msn-link) !important; font: 600 14px/20px var(--msn-font); }
html.kbt-msn-local .tool-popular-card-cta { background: transparent !important; padding: 0 !important; border: 0 !important; }
html.kbt-msn-local .tool-popular-tools--home-carousel .tool-popular-tools-grid { display: grid !important; grid-auto-flow: row !important; grid-auto-columns: unset !important; overflow: visible !important; padding-bottom: 0 !important; }
html.kbt-msn-local .tool-popular-tools--home-carousel :is(.tool-popular-tools-scroll-button, .tool-popular-tools-help) { display: none !important; }
html.kbt-msn-local .msn-local-feature { grid-column: span 2; }

/* Reading cards: two balanced columns with comfortable line lengths. */
html.kbt-msn-local .home-guideline-layout { box-sizing: border-box; width: 100% !important; max-width: var(--msn-width) !important; margin: 0 auto; padding: 0; gap: 12px !important; }
html.kbt-msn-local :is(.home-guideline-copy, .home-faq-panel) { padding: 24px !important; border: 1px solid var(--msn-line) !important; border-radius: var(--msn-radius); background: var(--msn-card) !important; box-shadow: none !important; }
html.kbt-msn-local :is(.home-guideline-copy h2, .home-faq-panel h2) { color: var(--msn-ink) !important; font: 600 24px/32px var(--msn-font) !important; margin: 6px 0 16px; }
html.kbt-msn-local :is(.home-guideline-copy > p, .home-guideline-step small, .home-faq-list p, .home-faq-support span, .home-guideline-note, .help-accordion p) { color: var(--msn-muted) !important; font: 400 16px/25px var(--msn-font) !important; }
html.kbt-msn-local :is(.home-guideline-step strong, .home-faq-list summary, .home-faq-support strong) { color: var(--msn-ink) !important; font: 600 16px/24px var(--msn-font) !important; }
html.kbt-msn-local :is(.home-guideline-steps, .home-guideline-step, .home-faq-list, .home-faq-list details, .home-faq-support, .help-accordion details) { border-color: var(--msn-line) !important; }
html.kbt-msn-local :is(.home-faq-list details, .home-faq-list details[open], .home-faq-support, .home-guideline-note, .help-accordion details) { background: transparent !important; }
html.kbt-msn-local :is(.home-guideline-copy a, .home-faq-panel a, .home-guideline-step-number) { color: var(--msn-link) !important; }

/* A direct route from the local keyboard controls to the existing guide. */
html.kbt-msn-local body.home-redesign .msn-home-guide-jump { display: flex; justify-content: flex-end; box-sizing: border-box; width: min(100% - 32px, 1440px); margin: 8px auto 0; }
html.kbt-msn-local body.home-redesign .msn-home-guide-jump a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 6px; color: var(--msn-link); font: 600 14px/20px var(--msn-font); text-decoration: none; }
html.kbt-msn-local body.home-redesign .msn-home-guide-jump a:hover { background: var(--msn-hover); text-decoration: underline; text-underline-offset: 3px; }
html.kbt-msn-local body.home-redesign .msn-home-guide-jump a:focus-visible { outline: 2px solid var(--msn-link); outline-offset: 2px; }
html.kbt-msn-local body.home-redesign #guidelines { scroll-margin-top: 80px; }
html.kbt-msn-local body.home-redesign #guidelines:focus { outline: none; }
html.kbt-msn-local body.home-redesign .msn-home-guide-heading { max-width: var(--msn-width); margin: 0 auto 20px; }
html.kbt-msn-local body.home-redesign .msn-home-guide-heading h2 { margin: 0; color: var(--msn-ink); font: 600 28px/36px var(--msn-font); }
html.kbt-msn-local body.home-redesign #guidelines :is(.home-guideline-copy > p:not(.section-kicker), .home-guideline-step small, .home-faq-list p) { text-align: justify; text-align-last: start; hyphens: auto; }
@media (max-width: 800px) {
    html.kbt-msn-local body.home-redesign #guidelines { scroll-margin-top: 120px; }
}
html.kbt-msn-local .home-keyword-strip a { background: var(--msn-raised) !important; border-color: var(--msn-line) !important; border-radius: 6px; font: 400 14px/20px var(--msn-font); }
html.kbt-msn-local :is(.home-after-tool-banner, .home-before-footer-multiplex):empty { display: none; }
html.kbt-msn-local :is(.kbt-rating-row, .kbt-usage-row) { color: var(--msn-muted); }

/* Existing search dialog is shared with the functional top search button. */
html.kbt-msn-local .kbt-search__dialog { background: var(--msn-card) !important; border-color: var(--msn-line); color: var(--msn-ink); font-family: var(--msn-font); }
html.kbt-msn-local .kbt-search__field { background: var(--msn-card); border-color: var(--msn-line); }
html.kbt-msn-local .kbt-search__input { background: transparent !important; color: var(--msn-ink) !important; font-family: var(--msn-font); }
html.kbt-msn-local .kbt-search__input::placeholder { color: var(--msn-muted); }
html.kbt-msn-local .kbt-search__esc { background: var(--msn-raised); border-color: var(--msn-line); color: var(--msn-ink); }
html.kbt-msn-local :is(.site-footer, footer.site-footer) { background: var(--msn-bg) !important; border-top: 1px solid var(--msn-line); color: var(--msn-muted); }
html.kbt-msn-local :is(.msn-local-header, .msn-local-shortcuts, .msn-local-nav) :is(a, button):focus-visible { outline: 2px solid var(--msn-link); outline-offset: 3px; }

/* The English directory uses its existing filters, language links and card counts. */
html.kbt-msn-local body.all-tools-page main { background: var(--msn-bg) !important; color: var(--msn-ink); font-family: var(--msn-font); }
html.kbt-msn-local body.all-tools-page .at-wrap { width: min(100% - 32px, var(--msn-width)); max-width: var(--msn-width); padding: 0 0 44px !important; }
html.kbt-msn-local body.all-tools-page .at-hero { margin: 0 0 20px; padding: 0 !important; background: transparent !important; border: 0 !important; }
html.kbt-msn-local body.all-tools-page .at-language-panel { padding: 20px !important; gap: 20px; background: var(--msn-card) !important; border: 1px solid var(--msn-line) !important; border-radius: var(--msn-radius); box-shadow: none !important; }
html.kbt-msn-local body.all-tools-page :is(.at-title, .at-language-title, .at-cat-head h2, .at-sponsor h2) { color: var(--msn-ink) !important; font: 600 24px/32px var(--msn-font) !important; letter-spacing: 0 !important; }
html.kbt-msn-local body.all-tools-page :is(.at-sub, .at-language-copy > p:not(.at-language-eyebrow), .at-card-desc, .at-feature-card__copy, .at-sponsor p) { color: var(--msn-muted) !important; font: 400 16px/24px var(--msn-font) !important; }
html.kbt-msn-local body.all-tools-page :is(.at-language-eyebrow, .at-kicker, .at-feature-card__label, .at-sponsor__eyebrow) { color: var(--msn-link) !important; font: 400 12px/18px var(--msn-font) !important; letter-spacing: 0 !important; text-transform: none; }
html.kbt-msn-local body.all-tools-page .at-language-grid { gap: 8px; }
html.kbt-msn-local body.all-tools-page .at-language-link { background: var(--msn-raised) !important; border-color: var(--msn-line) !important; border-radius: 6px; color: var(--msn-ink) !important; }
html.kbt-msn-local body.all-tools-page .at-language-link:hover,
html.kbt-msn-local body.all-tools-page .at-language-link.is-current { background: var(--msn-hover) !important; border-color: var(--msn-link) !important; box-shadow: none !important; }
html.kbt-msn-local body.all-tools-page .at-language-native { color: var(--msn-ink) !important; font: 600 14px/20px var(--msn-font); }
html.kbt-msn-local body.all-tools-page .at-language-name { color: var(--msn-muted) !important; font: 400 12px/16px var(--msn-font); }
html.kbt-msn-local body.all-tools-page .at-language-current { background: #0067b8; color: #ffffff; font: 600 10px/14px var(--msn-font); }
html.kbt-msn-local body.all-tools-page .at-filter { gap: 8px; margin-bottom: 24px; background: transparent !important; border: 0 !important; }
html.kbt-msn-local body.all-tools-page .at-pill { min-height: 40px; padding: 7px 10px; border: 1px solid var(--msn-line) !important; border-radius: 8px; background: var(--msn-card) !important; color: var(--msn-ink) !important; font: 400 14px/20px var(--msn-font); }
html.kbt-msn-local body.all-tools-page .at-pill::before { content: none; }
html.kbt-msn-local body.all-tools-page .at-pill:hover,
html.kbt-msn-local body.all-tools-page .at-pill.is-active { background: var(--msn-raised) !important; border-color: var(--msn-link) !important; color: var(--msn-link) !important; }
html.kbt-msn-local body.all-tools-page .at-pill-count,
html.kbt-msn-local body.all-tools-page .at-pill.is-active .at-pill-count { color: inherit !important; background: transparent !important; font: 400 12px/18px var(--msn-font); }
html.kbt-msn-local body.all-tools-page .at-cat-head { padding-top: 0; border: 0; margin: 0 0 14px; }
html.kbt-msn-local body.all-tools-page .at-cat-count { background: var(--msn-raised) !important; color: var(--msn-muted) !important; border: 1px solid var(--msn-line) !important; border-radius: 6px; font: 400 12px/18px var(--msn-font); }
html.kbt-msn-local body.all-tools-page .at-grid { gap: 12px !important; }
html.kbt-msn-local body.all-tools-page :is(.at-card, .at-feature-card) { border: 1px solid var(--msn-line) !important; border-radius: var(--msn-radius); background: var(--msn-card) !important; color: var(--msn-ink) !important; box-shadow: none !important; }
html.kbt-msn-local body.all-tools-page :is(.at-card, .at-feature-card):hover { border-color: #777777 !important; background: var(--msn-raised) !important; box-shadow: none !important; }
html.kbt-msn-local body.all-tools-page :is(.at-card-title, .at-feature-card__title) { color: var(--msn-ink) !important; font: 600 20px/26px var(--msn-font) !important; letter-spacing: 0; white-space: normal; overflow: visible; text-overflow: clip; }
html.kbt-msn-local body.all-tools-page :is(.at-card-body, .at-feature-card__body) { padding: 16px !important; }
html.kbt-msn-local body.all-tools-page .at-card-media { border-color: var(--msn-line); background: var(--msn-raised); }
html.kbt-msn-local body.all-tools-page :is(.at-card-cta, .at-feature-card__cta),
html.kbt-msn-local body.all-tools-page :is(.at-card:hover .at-card-cta, .at-feature-card:hover .at-feature-card__cta) { min-height: 30px; padding: 4px 0; background: transparent !important; color: var(--msn-link) !important; font: 600 14px/20px var(--msn-font) !important; }
html.kbt-msn-local body.all-tools-page .at-sections-wrap > .at-section + .at-section { margin-top: 32px; }
html.kbt-msn-local body.all-tools-page .at-page-map { display: none !important; }
html.kbt-msn-local body.all-tools-page :is(.at-page-map__toggle, .at-page-map__panel) { background: var(--msn-card) !important; border-color: var(--msn-line); }
html.kbt-msn-local body.all-tools-page :is(.at-page-map__title, .at-page-map__item) { color: var(--msn-ink) !important; font-family: var(--msn-font); }
html.kbt-msn-local body.all-tools-page :is(.at-page-map__item:hover, .at-page-map__item.is-active) { color: var(--msn-link) !important; background: var(--msn-raised) !important; }
html.kbt-msn-local body.all-tools-page .at-page-map__count { color: var(--msn-muted) !important; }
html.kbt-msn-local body.all-tools-page :is(.at-sponsor, .at-guide-links, .at-guide-links a, .at-proof-strip span) { background: var(--msn-card) !important; color: var(--msn-ink) !important; border-color: var(--msn-line); border-radius: var(--msn-radius); box-shadow: none; }

@media (max-width: 1100px) {
    html.kbt-msn-local .msn-local-header { grid-template-columns: 220px minmax(200px, 1fr) auto; gap: 18px; padding-inline: 20px; }
    html.kbt-msn-local .msn-local-brand { font-size: 20px; }
    html.kbt-msn-local .msn-local-shortcuts { gap: 16px; }
}
@media (max-width: 1000px) {
    html.kbt-msn-local .msn-local-ad { width: min(100% - 32px, 728px); }
    html.kbt-msn-local .msn-local-ad-slot { width: 728px; height: 90px; gap: 2px; }
    html.kbt-msn-local .msn-local-ad-slot > :is(strong, b) { font-size: 16px; line-height: 22px; }
}
@media (max-width: 800px) {
    html.kbt-msn-local .msn-local-header { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 6px 16px; }
    html.kbt-msn-local .msn-local-brand { gap: 7px; font-size: 18px; }
    html.kbt-msn-local .msn-local-brand :is(svg, img) { width: 34px; height: 34px; }
    html.kbt-msn-local .msn-local-search { grid-column: 1 / -1; grid-row: 2; }
    html.kbt-msn-local .msn-local-actions { grid-column: 2; grid-row: 1; }
    html.kbt-msn-local .msn-local-brand,
    html.kbt-msn-local .msn-local-actions > :is(button, a),
    html.kbt-msn-local .msn-local-language > summary { box-sizing: border-box; min-height: 44px; }
    html.kbt-msn-local .msn-local-shortcuts { justify-content: flex-start; overflow-x: auto; gap: 12px; padding: 2px 0 8px; margin-top: 8px; scrollbar-width: thin; }
    html.kbt-msn-local .msn-local-shortcut { flex-basis: 70px; }
    html.kbt-msn-local .msn-local-nav { overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; gap: 2px; }
    html.kbt-msn-local .msn-local-nav :is(a, button) { padding-inline: 11px; }
    html.kbt-msn-local .msn-local-nav .msn-local-nav-end { display: none; }
    html.kbt-msn-local .msn-local-nav .msn-local-nav-guide { display: none; }
    html.kbt-msn-local :is(.tool-popular-tools-grid, .homepage-latest-blog-grid, .related-tools-grid, .msn-local-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html.kbt-msn-local .home-guideline-layout { grid-template-columns: minmax(0, 1fr) !important; }
    html.kbt-msn-local .msn-local-feature { grid-column: auto; }
}
@media (max-width: 600px) {
    html.kbt-msn-local .msn-local-header { column-gap: 8px; }
    html.kbt-msn-local .msn-local-actions { gap: 6px; }
    html.kbt-msn-local .msn-local-ad { width: 320px; max-width: calc(100% - 32px); margin-bottom: 14px; }
    html.kbt-msn-local .msn-local-ad-slot { width: 320px; height: 100px; }
    html.kbt-msn-local .msn-local-search kbd { display: none; }
    html.kbt-msn-local .landing-main .landing-hero { padding: 16px !important; }
    html.kbt-msn-local .landing-main .tool-stage .tool-shell { padding: 12px !important; }
    html.kbt-msn-local .landing-main #keyboard-stage .tool-shell,
    html.kbt-msn-local .landing-main #mouse-test-tool .tool-shell { padding: 0 !important; }
    html.kbt-msn-local :is(.tool-popular-tools-grid, .homepage-latest-blog-grid, .related-tools-grid, .msn-local-grid) { grid-template-columns: minmax(0, 1fr); }
    html.kbt-msn-local :is(.home-guideline-copy, .home-faq-panel) { padding: 20px !important; }
    html.kbt-msn-local .tool-stage-header { display: block; }

    /* Long API names and the controller comparison table keep access on phones. */
    html.kbt-msn-local .seo-article :is(p, li) code { overflow-wrap: anywhere; white-space: normal; }
    html.kbt-msn-local .seo-article .gp-guide-table { display: block; width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
}
@media (max-width: 400px) {
    /* Preserve the two-row masthead while leaving the full brand readable. */
    html.kbt-msn-local .msn-local-header { grid-template-columns: minmax(0, 1fr) auto auto; }
    html.kbt-msn-local .msn-local-brand { grid-column: 1 / span 2; grid-row: 1; }
    html.kbt-msn-local .msn-local-search { grid-column: 1; grid-row: 2; }
    html.kbt-msn-local .msn-local-inline-search .msn-local-search-results { right: auto; width: calc(100vw - 32px); }
    html.kbt-msn-local .msn-local-actions { display: contents; }
    html.kbt-msn-local .msn-local-actions > a:first-child { grid-column: 2; grid-row: 2; }
    html.kbt-msn-local .msn-local-actions > :is(.msn-local-language, a[aria-label="Choose language"]) { grid-column: 3; grid-row: 2; }
    html.kbt-msn-local .msn-local-actions > .msn-local-theme { grid-column: 3; grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) {
    html.kbt-msn-local .msn-local-shortcut-icon { transition: none; }
    html.kbt-msn-local .msn-local-header--home { transition: none; }
}
