/* mysportsmate Marketing-Site Styles */

/* stylelint-disable color-no-hex, function-disallowed-list -- token definitions */
:root {
    --m-color-primary: #090;
    --m-color-primary-light: #0B0;
    /* MSR-106: hover of the green footer link (the footer hover = "gets brighter"). */
    --m-color-primary-lighter: #3E3;
    /* Light brand-green surface (FAQ box, MSR-173). */
    --m-color-primary-tint: #EDF7ED;
    --m-color-text: #1A1A1A;
    --m-color-text-muted: #666;
    --m-color-bg: #FFF;
    --m-color-bg-alt: #F9F9F9;
    --m-color-border: #E0E0E0;
    --m-color-border-light: #EEE;
    /* Form errors (same red as the user-app) + its tint for the alert box. */
    --m-color-danger: #C0392B;
    --m-color-danger-tint: #FBEDEB;
    --m-color-dark: #0A0A0A;
    /* Text + hover colour on the dark footer (--m-color-dark). */
    --m-color-on-dark: #FFF;
    /* Muted text on dark: same 70% as the SPA --color-on-dark-muted (links, social icons). */
    --m-color-on-dark-muted: rgb(255 255 255 / 70%);
    --m-color-on-dark-faint: rgb(255 255 255 / 50%);
    --m-color-on-dark-border: rgb(255 255 255 / 40%);
    --m-color-on-dark-subtle: rgb(255 255 255 / 10%);
    --m-color-on-dark-hover: rgb(255 255 255 / 8%);
    --m-color-dark-mid: #111;
    --m-color-dark-green: #0D2E0D;
    /* Scrims behind modals / on images. */
    --m-color-overlay: rgb(0 0 0 / 50%);
    --m-color-overlay-strong: rgb(0 0 0 / 60%);
    --m-color-overlay-heavy: rgb(0 0 0 / 65%);
    --m-shadow-card: 0 0.125rem 0.5rem rgb(0 0 0 / 6%), 0 0 0 1px rgb(0 0 0 / 4%);
    --m-shadow-up: 0 -0.25rem 1.5rem rgb(0 0 0 / 12%);
    /* Subnav bar + hover/active chip, mirroring the user-app subnav (bg-secondary / bg-tertiary). */
    --m-color-subnav-active: #F5F5F5;
    --m-color-subnav-bg: #F9F9F9;
    /* The marketing page rhythm is deliberately wider than the app: lg = 2rem, xl = 4rem here vs
       1.5rem / 2rem in frontend/shared/styles/tokens.css. xs-md match shared (TokenParityTest). */
    --m-spacing-xs: 0.25rem;
    --m-spacing-sm: 0.5rem;
    --m-spacing-sm-md: 0.75rem;
    --m-spacing-md: 1rem;
    --m-spacing-lg: 2rem;
    --m-spacing-xl: 4rem;
    --m-radius: 0.5rem;
    --m-radius-lg: 1rem;
    --m-max-width: 75rem;
    --m-narrow-width: 45rem;
    /* Refined at runtime by marketing-nav.js so the mobile drawer/overlay start
       exactly at the header's bottom edge. */
    --m-header-height: 3.75rem;
    /* Typography: same values as the SPA tokens (frontend/shared/styles/tokens.css,
       --font-*), plus a few marketing-only display steps. */
    --m-font-family: -apple-system, blinkmacsystemfont, 'Segoe UI', roboto, oxygen, ubuntu, cantarell, sans-serif;
    --m-font-size-xs: 0.75rem;
    --m-font-size-sm: 0.875rem;
    --m-font-size-base: 1rem;
    --m-font-size-lg: 1.125rem;
    --m-font-size-title: 1.25rem;
    --m-font-size-xl: 1.5rem;
    --m-font-size-heading: 1.75rem;
    --m-font-size-2xl: 2rem;
    --m-font-size-3xl: 2.5rem;
    --m-font-size-display-sm: 4rem;
    --m-font-size-display: 6rem;
    --m-font-weight-normal: 400;
    --m-font-weight-medium: 500;
    --m-font-weight-semibold: 600;
    --m-font-weight-bold: 700;
    --m-line-height-none: 1;
    --m-line-height-heading: 1.1;
    --m-line-height-tight: 1.25;
    --m-line-height-snug: 1.4;
    --m-line-height-normal: 1.5;
    --m-line-height-relaxed: 1.6;
    --m-line-height-loose: 1.8;
    /* Stacking layers, same names and values as the SPA --z-* scale, so the consent
       banner sits at one documented layer on every surface. */
    --m-z-raised: 1;
    --m-z-sticky: 10;
    --m-z-dropdown: 20;
    --m-z-navbar-drawer: 40;
    --m-z-navbar: 50;
    --m-z-popover: 100;
    --m-z-consent: 900;
    --m-z-consent-bar: 950;
    --m-z-modal: 1000;
    --m-z-skip-link: 1200;

    color-scheme: light;
}
/* stylelint-enable color-no-hex, function-disallowed-list */

* {
    box-sizing: border-box;
}

html {
    font-size: 100%;
}

body {
    color: var(--m-color-text);
    display: flex;
    flex-direction: column;
    font-family: var(--m-font-family);
    font-size: var(--m-font-size-base);
    line-height: var(--m-line-height-relaxed);
    margin: 0;
    min-height: 100vh;
    /* The mobile drawer parks off-screen to the right (translateX(100%)); clip it
       so it never adds a horizontal scrollbar. */
    overflow-x: hidden;
}

/* Pushes the footer to the bottom of the viewport on short pages. */
.m-main {
    flex: 1 0 auto;
}

/* Programmatic focus target of the skip link; the jump itself is the cue. */
.m-main:focus {
    outline: none;
}

/* Skip link (WCAG 2.4.1): visually hidden until focused, then pinned above the header. */
.m-skip-link {
    background: var(--m-color-bg);
    border: 2px solid var(--m-color-primary);
    border-radius: var(--m-radius);
    color: var(--m-color-text);
    font-weight: var(--m-font-weight-semibold);
    left: var(--m-spacing-md);
    padding: var(--m-spacing-sm) var(--m-spacing-md);
    position: absolute;
    top: var(--m-spacing-sm);
    transform: translateY(-200%);
    z-index: var(--m-z-skip-link);
}

.m-skip-link:focus,
.m-skip-link:focus-visible {
    transform: translateY(0);
}

a {
    color: var(--m-color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    height: auto;
    max-width: 100%;
}

.m-container {
    margin: 0 auto;
    max-width: var(--m-max-width);
    padding: 0 var(--m-spacing-md);
}

.m-container--narrow {
    max-width: var(--m-narrow-width);
}

/* Header - dark bar mirroring the user-app navbar (shares --m-color-dark with the footer). */
.m-header {
    background: var(--m-color-dark);
    padding: var(--m-spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: var(--m-z-navbar);
}

.m-header .m-container {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.m-logo {
    align-items: center;
    color: var(--m-color-text);
    display: inline-flex;
    font-size: var(--m-font-size-title);
    font-weight: var(--m-font-weight-bold);
}

.m-logo__img {
    /* logo.png is a white wordmark (built for the dark hero/footer). The header
       is dark now, so render the wordmark plain white via a CSS mask over a white
       fill. aspect-ratio matches the 193x40 source. */
    aspect-ratio: 193 / 40;
    background-color: var(--m-color-bg);
    display: block;
    height: 1.75rem;
    /* Prefixed copy kept for Chromium < 120, which has no unprefixed mask shorthand. */
    /* stylelint-disable-next-line property-no-vendor-prefix */
    -webkit-mask: url('/images/logo.png') no-repeat center / contain;
    mask: url('/images/logo.png') no-repeat center / contain;
    width: auto;
}

.m-nav {
    align-items: center;
    display: flex;
    gap: var(--m-spacing-xs);
}

.m-nav a {
    border-radius: var(--m-radius);
    color: var(--m-color-on-dark-muted);
    font-size: var(--m-font-size-sm);
    font-weight: var(--m-font-weight-medium);
    padding: 0.5rem 1rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.m-nav a:hover {
    background: var(--m-color-on-dark-hover);
    color: var(--m-color-on-dark);
    text-decoration: none;
}

.m-nav a.is-active {
    background: color-mix(in srgb, var(--m-color-primary) 25%, transparent);
    color: var(--m-color-on-dark);
}

/* Right-hand header group: nav + CTA + mobile toggle. */
.m-header__right {
    align-items: center;
    display: flex;
    gap: var(--m-spacing-md);
}

/* CTA - standalone (moved out of .m-nav so it stays visible on mobile). */
.m-cta {
    background: var(--m-color-primary);
    border-radius: var(--m-radius);
    color: var(--m-color-on-dark);
    font-size: var(--m-font-size-sm);
    font-weight: var(--m-font-weight-medium);
    padding: 0.5rem 1rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.m-cta:hover {
    background: var(--m-color-primary-light);
    color: var(--m-color-on-dark);
    text-decoration: none;
}

/* Hamburger - hidden on desktop, shown in the mobile media query below.
   Three bars that morph into an "X" when the drawer is open (.is-open). */
.m-nav-toggle {
    background: transparent;
    border: 0;
    cursor: pointer;
    display: none;
    height: 1.25rem;
    padding: 0;
    position: relative;
    width: 1.5rem;
}

.m-nav-toggle__bar {
    background: var(--m-color-bg);
    border-radius: 0.0625rem;
    height: 0.125rem;
    left: 0;
    position: absolute;
    transition: background-color 0.15s ease, top 0.15s ease, bottom 0.15s ease, transform 0.2s ease;
    width: 1.5rem;
}

.m-nav-toggle:hover .m-nav-toggle__bar {
    background: var(--m-color-primary-light);
}

.m-nav-toggle__bar:nth-child(1) {
    top: 0;
}

.m-nav-toggle__bar:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.1s ease;
}

.m-nav-toggle__bar:nth-child(3) {
    bottom: 0;
}

.m-nav-toggle.is-open .m-nav-toggle__bar:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.m-nav-toggle.is-open .m-nav-toggle__bar:nth-child(2) {
    opacity: 0;
}

.m-nav-toggle.is-open .m-nav-toggle__bar:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* Locks background scroll while the drawer is open. */
body.m-no-scroll {
    overflow: hidden;
}

/* Language switcher - lives in the footer, so its colours sit on the dark bg. */
.m-lang {
    align-items: center;
    display: flex;
    gap: var(--m-spacing-xs);
    justify-content: center;
    margin-bottom: var(--m-spacing-md);
}

.m-lang__item {
    border-radius: var(--m-radius);
    color: var(--m-color-on-dark-faint);
    font-size: var(--m-font-size-sm);
    font-weight: var(--m-font-weight-bold);
    padding: var(--m-spacing-xs) 0.5rem;
}

.m-lang__item:hover {
    color: var(--m-color-on-dark);
    text-decoration: none;
}

.m-lang__item.is-active,
.m-lang__item[aria-current="page"] {
    background: var(--m-color-on-dark-subtle);
    color: var(--m-color-on-dark);
}

/* Sub-navigation bar (directly under the main navigation) - a distinct,
   centered tab strip so it reads clearly as a subnavigation. */
.m-topsubnav {
    background: var(--m-color-subnav-bg);
    border-bottom: 1px solid var(--m-color-border-light);
}

.m-topsubnav .m-container {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--m-spacing-xs);
    /* safe center: centred while the items fit, but falls back to start-alignment on overflow so the
       first items are never clipped/unreachable in the mobile horizontal-scroll variant below. */
    justify-content: safe center;
    padding-bottom: var(--m-spacing-sm);
    padding-top: var(--m-spacing-sm);
}

.m-topsubnav__link {
    border-radius: var(--m-radius);
    color: var(--m-color-text-muted);
    font-size: var(--m-font-size-sm);
    font-weight: var(--m-font-weight-medium);
    padding: var(--m-spacing-xs) 1rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.m-topsubnav__link:hover,
.m-topsubnav__link.is-active {
    background: var(--m-color-subnav-active);
    color: var(--m-color-primary);
    text-decoration: none;
}

/* Scroll indicators for the horizontally-scrollable subnav bars (MSR-105 finding 25). The chevron only
   appears on a side that can still be scrolled; the fade matches the bar's own background. */
.m-scroll-wrap {
    --m-scroll-fade: var(--m-color-bg);

    position: relative;
}

.m-topsubnav .m-scroll-wrap {
    --m-scroll-fade: var(--m-color-subnav-bg);
}

.m-scroll-hint {
    align-items: center;
    border: 0;
    bottom: 0;
    color: var(--m-color-primary);
    cursor: pointer;
    display: none;
    font-size: var(--m-font-size-title);
    justify-content: center;
    line-height: var(--m-line-height-none);
    padding: 0 var(--m-spacing-sm-md);
    position: absolute;
    top: 0;
    z-index: var(--m-z-raised);
}

.m-scroll-hint--left {
    background: linear-gradient(to right, var(--m-scroll-fade) 45%, transparent);
    left: 0;
}

.m-scroll-hint--right {
    background: linear-gradient(to left, var(--m-scroll-fade) 45%, transparent);
    right: 0;
}

.m-scroll-wrap.has-scroll-left .m-scroll-hint--left,
.m-scroll-wrap.has-scroll-right .m-scroll-hint--right {
    display: flex;
}

/* Inline SVG chevron: centred by the flex parent, so it never drifts below the text like the old
   ‹/› glyph did under line-height:1 (MSR-105). */
.m-scroll-chevron {
    height: 1rem;
    width: 1rem;
}

/* The blog subnav has bottom-only padding (+2px active border), so the text sits in the upper part of
   the box. Match that on the arrow so its centre lines up with the text, not the full box (MSR-105). */
.m-subnav .m-scroll-hint {
    padding-bottom: calc(var(--m-spacing-sm) + 0.125rem);
}

/* Hero */
.m-hero {
    background: linear-gradient(135deg, var(--m-color-dark) 0%, var(--m-color-dark-mid) 50%, var(--m-color-dark-green) 100%);
    color: var(--m-color-on-dark);
    padding: var(--m-spacing-xl) 0;
    text-align: center;
}

.m-hero__title {
    font-size: clamp(var(--m-font-size-2xl), 6vw, 3rem);
    font-weight: var(--m-font-weight-bold);
    line-height: var(--m-line-height-heading);
    margin: 0 0 var(--m-spacing-md);
}

.m-hero__accent {
    color: var(--m-color-primary-light);
}

.m-hero__subtitle {
    color: var(--m-color-on-dark-muted);
    font-size: var(--m-font-size-title);
    margin: 0 auto var(--m-spacing-lg);
    max-width: 35rem;
}

.m-hero__cta {
    display: flex;
    gap: var(--m-spacing-md);
    justify-content: center;
}

.m-btn {
    border: 1px solid transparent;
    border-radius: var(--m-radius);
    cursor: pointer;
    display: inline-block;
    font-size: var(--m-font-size-base);
    font-weight: var(--m-font-weight-semibold);
    padding: var(--m-spacing-sm-md) 1.5rem;
}

.m-btn--primary {
    background: var(--m-color-primary);
    color: var(--m-color-on-dark);
}

.m-btn--primary:hover {
    background: var(--m-color-primary-light);
    text-decoration: none;
}

.m-btn--ghost {
    background: transparent;
    border-color: var(--m-color-on-dark-border);
    color: var(--m-color-on-dark);
}

.m-btn--ghost:hover {
    background: var(--m-color-on-dark-subtle);
    text-decoration: none;
}

/* Features */
.m-features {
    padding: var(--m-spacing-xl) 0;
}

.m-features h2 {
    font-size: var(--m-font-size-2xl);
    margin: 0 0 var(--m-spacing-lg);
    text-align: center;
}

.m-features__grid {
    display: grid;
    gap: var(--m-spacing-lg);
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.m-feature {
    background: var(--m-color-bg-alt);
    border-radius: var(--m-radius);
    padding: var(--m-spacing-lg);
}

.m-feature h3 {
    color: var(--m-color-primary);
    margin-top: 0;
}

/* Blog Teaser */
.m-blog-teaser {
    background: var(--m-color-bg-alt);
    padding: var(--m-spacing-xl) 0;
}

.m-blog-teaser h2 {
    font-size: var(--m-font-size-2xl);
    margin: 0 0 var(--m-spacing-lg);
    text-align: center;
}

.m-blog-teaser__grid {
    display: grid;
    gap: var(--m-spacing-lg);
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.m-blog-teaser__item {
    background: var(--m-color-bg);
    border-radius: var(--m-radius);
    overflow: hidden;
}

.m-blog-teaser__item img {
    aspect-ratio: 3/2;
    object-fit: cover;
    width: 100%;
}

.m-blog-teaser__item h3,
.m-blog-teaser__item p {
    padding: 0 var(--m-spacing-md);
}

.m-blog-teaser__item .m-link {
    display: block;
    padding: 0 var(--m-spacing-md) var(--m-spacing-md);
}

/* Blog */
.m-blog {
    padding: var(--m-spacing-xl) 0;
}

.m-blog h1 {
    font-size: var(--m-font-size-3xl);
    margin: 0 0 var(--m-spacing-lg);
}

.m-blog__list {
    display: grid;
    gap: var(--m-spacing-lg);
    /* min(20rem, 100%) keeps a single card from overflowing viewports narrower than 20rem. */
    grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr));
}

.m-blog-card {
    background: var(--m-color-bg);
    border: 1px solid var(--m-color-border);
    border-radius: var(--m-radius);
    overflow: hidden;
}

.m-blog-card__hero img {
    /* Match the source filter (thumb_600 = 600×400 = 3/2); a 16/9 box cropped
       the hero and distorted the framing. */
    aspect-ratio: 3/2;
    display: block;
    object-fit: cover;
    width: 100%;
}

.m-blog-card__body {
    padding: var(--m-spacing-md);
}

.m-blog-card__title {
    /* Same size for the h2 (lists) and the h3 (related posts, MSR-193) variant of the card. */
    font-size: var(--m-font-size-xl);
    margin: var(--m-spacing-sm) 0;
}

.m-blog-card__title a {
    color: var(--m-color-text);
}

/* Topic chip (MSR-106): rectangular, white, light border, like the tk.de topic chips. */
.m-tag {
    background: var(--m-color-bg);
    border: 1px solid var(--m-color-border);
    border-radius: 0.125rem;
    color: var(--m-color-text);
    display: inline-block;
    font-size: var(--m-font-size-base);
    font-weight: var(--m-font-weight-bold);
    line-height: var(--m-line-height-tight);
    padding: var(--m-spacing-sm-md) 1rem;
    text-decoration: none;
    transition: border-color 0.15s ease;
}

a.m-tag:hover,
a.m-tag:focus-visible {
    border-color: var(--m-color-primary);
}

a.m-tag:focus-visible {
    outline: 0.125rem solid var(--m-color-primary);
    outline-offset: 0.125rem;
}

/* Topic chip inside the topic listing heading: one fixed smaller size. */
h1 .m-tag {
    font-size: var(--m-font-size-lg);
    padding: 0.5rem var(--m-spacing-sm-md);
    vertical-align: middle;
}

@media (prefers-reduced-motion: reduce) {
    .m-tag {
        transition: none;
    }
}

/* Blog category subnavigation */
.m-subnav {
    border-bottom: 1px solid var(--m-color-border);
    display: flex;
    flex-wrap: wrap;
    gap: var(--m-spacing-md);
    margin-bottom: var(--m-spacing-lg);
    padding-bottom: var(--m-spacing-sm);
}

.m-subnav__link {
    border-bottom: 2px solid transparent;
    color: var(--m-color-text-muted);
    font-weight: var(--m-font-weight-semibold);
    padding-bottom: var(--m-spacing-sm);
}

.m-subnav__link:hover {
    color: var(--m-color-text);
    text-decoration: none;
}

.m-subnav__link.is-active {
    border-bottom-color: var(--m-color-primary);
    color: var(--m-color-primary);
}

/* Breadcrumb - sits close under the (sub)navigation, links are clickable. */
.m-breadcrumb {
    padding-top: var(--m-spacing-md);
}

.m-breadcrumb__list {
    align-items: center;
    color: var(--m-color-text-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: var(--m-font-size-sm);
    gap: var(--m-spacing-sm);
    list-style: none;
    margin: 0;
    padding: 0;
}

.m-breadcrumb__item {
    align-items: center;
    display: flex;
    gap: var(--m-spacing-sm);
}

.m-breadcrumb__item + .m-breadcrumb__item::before {
    color: var(--m-color-text-muted);
    content: "\203A";
}

.m-breadcrumb__link {
    color: var(--m-color-text-muted);
}

.m-breadcrumb__link:hover {
    color: var(--m-color-primary);
}

.m-breadcrumb__link:focus-visible {
    border-radius: var(--m-radius);
    outline: 0.125rem solid var(--m-color-primary);
    outline-offset: 0.125rem;
}

.m-breadcrumb__current {
    color: var(--m-color-text);
    font-weight: var(--m-font-weight-semibold);
}

/* Page / Post */
.m-page,
.m-post {
    padding: var(--m-spacing-lg) 0 var(--m-spacing-xl);
}

/* Page + post titles: fluid size so a long title (e.g. "Datenschutzerklärung") shrinks on a phone,
   plus break/hyphenation so it never overflows the viewport. .m-page h1 was previously unstyled
   (browser-default ~2em), which overflowed on narrow screens. */
.m-page h1,
.m-post__header h1 {
    font-size: clamp(var(--m-font-size-heading), 6vw, var(--m-font-size-3xl));
    hyphens: auto;
    margin: 0 0 var(--m-spacing-sm);
    overflow-wrap: break-word;
}

/* MSR-183: signup CTA band below the content of the learn-more page. */
.m-page-cta {
    background: var(--m-color-primary-tint);
    border-top: 1px solid var(--m-color-border);
    padding: var(--m-spacing-xl) 0;
    text-align: center;
}

.m-page-cta h2 {
    font-size: var(--m-font-size-xl);
    margin: 0 0 var(--m-spacing-sm);
}

.m-page-cta p {
    color: var(--m-color-text-muted);
    margin: 0 0 var(--m-spacing-md);
}

/* Shared eyebrow look (small green uppercase label above a heading): the post category (MSR-214)
   and the plan-template card (MSR-204). Colour and margins stay on the individual rules. */
.m-post__category,
.m-plan-template__eyebrow {
    font-size: var(--m-font-size-sm);
    font-weight: var(--m-font-weight-semibold);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.m-post__category {
    line-height: var(--m-line-height-tight);
    margin: 0 0 var(--m-spacing-sm);
}

.m-post__category a {
    color: var(--m-color-primary);
}

/* MSR-172: table of contents between the hero image and the post content. */
.m-toc {
    background: var(--m-color-bg-alt);
    border: 1px solid var(--m-color-border);
    border-left: 4px solid var(--m-color-primary);
    border-radius: var(--m-radius);
    margin: var(--m-spacing-lg) 0;
    padding: var(--m-spacing-md) var(--m-spacing-lg);
}

.m-toc__title {
    color: var(--m-color-primary);
    font-size: var(--m-font-size-sm);
    font-weight: var(--m-font-weight-semibold);
    letter-spacing: 0.05em;
    margin: 0 0 var(--m-spacing-sm);
    text-transform: uppercase;
}

.m-toc__list {
    margin: 0;
    padding-left: 1.25rem;
}

.m-toc__list--nested {
    list-style-type: lower-alpha;
    margin-top: var(--m-spacing-xs);
}

.m-toc__item {
    line-height: var(--m-line-height-snug);
    margin: var(--m-spacing-xs) 0;
    overflow-wrap: break-word;
}

.m-toc__link {
    color: var(--m-color-text);
}

.m-toc__link:hover {
    color: var(--m-color-primary);
}

.m-toc__link:focus-visible {
    border-radius: 0.25rem;
    outline: 0.125rem solid var(--m-color-primary);
    outline-offset: 0.125rem;
}

/* MSR-215/MSR-106: topic chips below the post content, just above the author/date footer. */
.m-post__tags {
    margin-top: var(--m-spacing-lg);
}

.m-post__tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Author + date, moved to the end of the post */
.m-post__meta {
    align-items: center;
    border-top: 1px solid var(--m-color-border);
    color: var(--m-color-text-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: var(--m-font-size-sm);
    gap: var(--m-spacing-md);
    margin-top: var(--m-spacing-lg);
    padding-top: var(--m-spacing-md);
}

/* MSR-193: related posts below the post, one card per row on a phone, side by side from 768px. */
.m-related-posts {
    border-top: 1px solid var(--m-color-border);
    padding: var(--m-spacing-xl) 0;
}

.m-related-posts h2 {
    margin: 0 0 var(--m-spacing-lg);
}

.m-related-posts__list {
    display: grid;
    gap: var(--m-spacing-lg);
    grid-template-columns: minmax(0, 1fr);
}

@media (width > 768px) {
    .m-related-posts__list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* MSR-204: plan-template preview + "adopt plan" CTA on the blog detail page. */
.m-plan-template {
    background: var(--m-color-bg-alt);
    border: 1px solid var(--m-color-border);
    border-radius: var(--m-radius);
    margin-top: var(--m-spacing-lg);
    padding: var(--m-spacing-lg);
    /* MSR-106: the plan is a TOC target too, so it lands below the sticky header. */
    scroll-margin-top: calc(var(--m-header-height) + var(--m-spacing-md));
}

.m-plan-template__eyebrow {
    color: var(--m-color-primary);
    margin: 0;
}

.m-plan-template__title {
    margin: var(--m-spacing-sm) 0;
}

.m-plan-template__description {
    color: var(--m-color-text-muted);
    margin: 0 0 var(--m-spacing-md);
}

.m-plan-template__days {
    display: grid;
    gap: var(--m-spacing-sm);
    list-style: none;
    margin: 0;
    padding: 0;
}

.m-plan-template__day {
    background: var(--m-color-bg);
    border: 1px solid var(--m-color-border-light);
    border-radius: var(--m-radius);
    display: flex;
    gap: var(--m-spacing-md);
    padding: var(--m-spacing-sm) var(--m-spacing-md);
}

.m-plan-template__day-number {
    color: var(--m-color-primary);
    flex: 0 0 4rem;
    font-weight: var(--m-font-weight-semibold);
}

.m-plan-template__day-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-wrap: break-word;
}

/* More than 5 days: each day is a native <details>, summary = day + routine, exercises on click. */
.m-plan-template__day--collapsible {
    display: block;
    padding: 0;
}

.m-plan-template__day-summary {
    align-items: baseline;
    cursor: pointer;
    display: flex;
    gap: var(--m-spacing-md);
    list-style: none;
    padding: var(--m-spacing-sm) var(--m-spacing-md);
}

.m-plan-template__day-summary:focus-visible {
    border-radius: var(--m-radius);
    outline: 0.125rem solid var(--m-color-primary);
    outline-offset: 0.125rem;
}

.m-plan-template__day-summary::-webkit-details-marker {
    display: none;
}

.m-plan-template__day-summary::after {
    border-bottom: 2px solid currentcolor;
    border-right: 2px solid currentcolor;
    content: '';
    flex: none;
    height: 0.5rem;
    margin-left: auto;
    transform: translateY(-0.125rem) rotate(45deg);
    transition: transform 0.2s ease;
    width: 0.5rem;
}

.m-plan-template__day-details[open] > .m-plan-template__day-summary::after {
    transform: translateY(0.125rem) rotate(225deg);
}

.m-plan-template__day-summary .m-plan-template__routine {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: break-word;
}

.m-plan-template__day--collapsible .m-plan-template__day-body {
    padding: 0 var(--m-spacing-md) var(--m-spacing-sm);
}

.m-plan-template__meta {
    color: var(--m-color-text-muted);
    font-size: var(--m-font-size-sm);
}

.m-plan-template__round {
    margin-top: var(--m-spacing-sm);
}

.m-plan-template__round-heading {
    display: block;
    font-size: var(--m-font-size-sm);
    font-weight: var(--m-font-weight-semibold);
}

.m-plan-template__exercises {
    font-size: var(--m-font-size-sm);
    margin: 0;
    padding-left: 1.25rem;
}

.m-plan-template__cta {
    margin-top: var(--m-spacing-lg);
}

.m-plan-template__hint {
    color: var(--m-color-text-muted);
    font-size: var(--m-font-size-sm);
    margin: var(--m-spacing-lg) 0 0;
}

@media (width <= 768px) {
    .m-plan-template {
        padding: var(--m-spacing-md);
    }

    .m-plan-template__day {
        flex-direction: column;
        gap: 0;
    }

    /* In the column layout the desktop 4rem flex-basis would become the label's height. */
    .m-plan-template__day-number {
        flex: none;
    }

    .m-plan-template__day-summary {
        gap: var(--m-spacing-sm);
    }
}

.m-post__hero,
.m-page__hero {
    margin-left: 0;
    margin-right: 0;
}

/* MSR-206: positioned box for the hero / card image credit overlays (.m-image-ai, .m-image-source). */
.m-image-media {
    position: relative;
}

.m-image-media img {
    display: block;
}

.m-post__hero img,
.m-page__hero img {
    aspect-ratio: 2/1;
    border-radius: var(--m-radius);
    object-fit: cover;
    width: 100%;
}

.m-content {
    font-size: var(--m-font-size-lg);
    line-height: var(--m-line-height-relaxed);
    /* Long German compound words (e.g. "Verbraucherstreitbeilegung") must break instead of
       overflowing a phone. hyphens breaks nicely where supported; overflow-wrap is the guaranteed
       fallback. Both are inherited, so the content headings and paragraphs are covered too. */
    hyphens: auto;
    overflow-wrap: break-word;
}

.m-content h2 {
    font-size: var(--m-font-size-heading);
    margin-top: var(--m-spacing-lg);
}

/* MSR-172: table-of-contents targets land below the sticky header instead of under it. */
.m-content :is(h2, h3, h4)[id] {
    scroll-margin-top: calc(var(--m-header-height) + var(--m-spacing-md));
}

.m-content h3 {
    font-size: var(--m-font-size-title);
    margin-top: var(--m-spacing-lg);
}

.m-content img {
    border-radius: var(--m-radius);
    margin: var(--m-spacing-md) 0;
}

/* MSR-174: inline image block. The media box shrink-wraps the image so the AI badge
   (bottom-left) and the source credit (bottom-right) sit on the image itself. */
.m-content__figure {
    margin: var(--m-spacing-md) 0;
}

.m-content__figure-media {
    margin: 0 auto;
    max-width: 100%;
    position: relative;
    width: fit-content;
}

.m-content__figure img {
    display: block;
    margin: 0;
}

.m-content__figure--stretched .m-content__figure-media,
.m-content__figure--stretched img {
    width: 100%;
}

.m-content__figure--border img {
    border: 1px solid var(--m-color-border);
}

.m-content__figure--background {
    background: var(--m-color-bg-alt);
    border-radius: var(--m-radius);
    padding: var(--m-spacing-md);
}

.m-content__figure--background .m-content__figure-media {
    max-width: 60%;
}

.m-content__figure-ai,
.m-content__figure-source,
.m-image-ai,
.m-image-source {
    background: var(--m-color-overlay-heavy);
    border-radius: 0.25rem;
    bottom: var(--m-spacing-sm);
    color: var(--m-color-on-dark);
    font-size: var(--m-font-size-xs);
    hyphens: manual;
    line-height: var(--m-line-height-snug);
    max-width: calc(50% - 0.75rem);
    padding: 0.125rem 0.375rem;
    position: absolute;
}

.m-content__figure-ai,
.m-image-ai {
    font-weight: var(--m-font-weight-semibold);
    left: var(--m-spacing-sm);
}

.m-content__figure-source,
.m-image-source {
    right: var(--m-spacing-sm);
    text-align: right;
}

@media (width <= 30rem) {
    .m-content__figure--background .m-content__figure-media {
        max-width: 100%;
    }

    .m-content__figure-ai,
    .m-content__figure-source,
    .m-image-ai,
    .m-image-source {
        bottom: 0.25rem;
        font-size: var(--m-font-size-xs);
    }

    .m-content__figure-ai,
    .m-image-ai {
        left: 0.25rem;
    }

    .m-content__figure-source,
    .m-image-source {
        right: 0.25rem;
    }
}

.m-content blockquote {
    border-left: 4px solid var(--m-color-primary);
    color: var(--m-color-text-muted);
    margin: var(--m-spacing-md) 0;
    padding-left: var(--m-spacing-md);
}

.m-content pre {
    background: var(--m-color-bg-alt);
    border-radius: var(--m-radius);
    overflow-x: auto;
    padding: var(--m-spacing-md);
}

.m-content code {
    background: var(--m-color-bg-alt);
    border-radius: 0.25rem;
    font-size: var(--m-font-size-base);
    padding: 0.125rem 0.375rem;
}

.m-content pre code {
    background: transparent;
    padding: 0;
}

.m-content__table-wrap {
    margin: var(--m-spacing-md) 0;
    overflow-x: auto;
}

.m-content__table {
    border-collapse: collapse;
    font-size: var(--m-font-size-base);
    width: 100%;
}

.m-content__table th,
.m-content__table td {
    border: 1px solid var(--m-color-border);
    padding: 0.625rem 0.875rem;
    text-align: left;
    vertical-align: top;
}

.m-content__table thead th {
    background: var(--m-color-bg-alt);
    font-weight: var(--m-font-weight-semibold);
}

.m-content__table tbody tr:nth-child(even) {
    background: var(--m-color-bg-alt);
}

.m-content__delimiter {
    border: 0;
    border-top: 1px solid var(--m-color-border);
    margin: var(--m-spacing-lg) 0;
}

/* MSR-173: FAQ block. Native <details open> per question: all answers start expanded and
   collapse by clicking the question (no JavaScript, CSP). Look ("Karten-Box"): the section is a
   light brand-green box, every pair a white card; the "?" icons and the plus/minus toggle are
   CSS pseudo-elements (the '/ ""' alt text keeps screen readers from announcing them). */
.m-faq {
    background: var(--m-color-primary-tint);
    border-radius: var(--m-radius-lg);
    margin: var(--m-spacing-lg) 0;
    padding: var(--m-spacing-lg) var(--m-spacing-md);
}

.m-faq .m-faq__title {
    align-items: center;
    display: flex;
    font-size: var(--m-font-size-xl);
    gap: var(--m-spacing-sm-md);
    margin: 0 0 var(--m-spacing-md);
}

.m-faq__title::before,
.m-faq__question::before {
    align-items: center;
    background: var(--m-color-primary);
    border-radius: 50%;
    color: var(--m-color-bg);
    content: '?';
    content: '?' / '';
    display: inline-flex;
    flex: none;
    font-weight: var(--m-font-weight-bold);
    justify-content: center;
    line-height: var(--m-line-height-none);
}

.m-faq__title::before {
    font-size: var(--m-font-size-lg);
    height: 2rem;
    width: 2rem;
}

.m-faq__item {
    background: var(--m-color-bg);
    border-radius: var(--m-radius);
    box-shadow: var(--m-shadow-card);
}

.m-faq__item + .m-faq__item {
    margin-top: var(--m-spacing-sm-md);
}

.m-faq__question {
    align-items: center;
    border-radius: var(--m-radius);
    cursor: pointer;
    display: flex;
    font-weight: var(--m-font-weight-semibold);
    gap: var(--m-spacing-sm-md);
    line-height: var(--m-line-height-snug);
    list-style: none;
    overflow-wrap: anywhere;
    padding: var(--m-spacing-md);
}

.m-faq__question:focus-visible {
    outline: 0.125rem solid var(--m-color-primary);
    outline-offset: 0.125rem;
}

.m-faq__question::-webkit-details-marker {
    display: none;
}

.m-faq__question::before {
    font-size: var(--m-font-size-sm);
    height: 1.5rem;
    width: 1.5rem;
}

/* Plus (closed) / minus (open) toggle: two bars drawn as background gradients, the vertical bar
   is dropped when the item is open. */
.m-faq__question::after {
    background:
        linear-gradient(currentcolor, currentcolor) center / 0.875rem 0.125rem no-repeat,
        linear-gradient(currentcolor, currentcolor) center / 0.125rem 0.875rem no-repeat;
    color: var(--m-color-primary);
    content: '';
    flex: none;
    height: 1.5rem;
    margin-left: auto;
    transition: transform 0.2s ease;
    width: 1.5rem;
}

.m-faq__item[open] > .m-faq__question::after {
    background: linear-gradient(currentcolor, currentcolor) center / 0.875rem 0.125rem no-repeat;
    transform: rotate(180deg);
}

/* Indented under the question text: card padding + marker width + gap. */
.m-faq__answer {
    color: var(--m-color-text);
    overflow-wrap: anywhere;
    padding: 0 var(--m-spacing-md) var(--m-spacing-md) 3.25rem;
}

.m-faq__answer p {
    margin: 0;
}

@media (width <= 30rem) {
    .m-faq {
        padding: var(--m-spacing-md) var(--m-spacing-sm-md);
    }

    .m-faq__question {
        padding: var(--m-spacing-sm-md);
    }

    .m-faq__answer {
        padding: 0 var(--m-spacing-sm-md) var(--m-spacing-sm-md);
    }
}

@media (prefers-reduced-motion: reduce) {
    .m-faq__question::after {
        transition: none;
    }
}

/* Forced colors (Windows high contrast) drop the gradient bars and the card shadow: fall back to a
   text glyph for the toggle and a real border for the card. */
@media (forced-colors: active) {
    .m-faq__item {
        border: 1px solid CanvasText;
    }

    .m-faq__question::after {
        background: none;
        content: '+';
        font-size: var(--m-font-size-xl);
        line-height: var(--m-line-height-none);
        text-align: center;
        transform: none;
    }

    .m-faq__item[open] > .m-faq__question::after {
        background: none;
        content: '-';
        transform: none;
    }
}

/* Pagination */
.m-pagination {
    display: flex;
    gap: var(--m-spacing-sm);
    justify-content: center;
    margin: var(--m-spacing-lg) 0;
}

.m-pagination a,
.m-pagination__current {
    background: var(--m-color-bg-alt);
    border-radius: var(--m-radius);
    color: var(--m-color-text);
    padding: 0.5rem 0.875rem;
}

.m-pagination__current {
    background: var(--m-color-primary);
    color: var(--m-color-on-dark);
}

/* Contact */
.m-contact {
    padding: var(--m-spacing-xl) 0;
}

.m-form {
    display: flex;
    flex-direction: column;
    gap: var(--m-spacing-md);
}

.m-form input[type="text"],
.m-form input[type="email"],
.m-form textarea {
    border: 1px solid var(--m-color-border);
    border-radius: var(--m-radius);
    font-family: inherit;
    font-size: var(--m-font-size-base);
    padding: var(--m-spacing-sm-md);
    width: 100%;
}

.m-form label {
    display: block;
    font-weight: var(--m-font-weight-semibold);
    margin-bottom: var(--m-spacing-xs);
}

/* Field errors sit under their widget (marketing form theme), red like the user-app. */
.m-form__field-errors {
    color: var(--m-color-danger);
    font-size: var(--m-font-size-sm);
    list-style: none;
    margin: var(--m-spacing-xs) 0 0;
    padding: 0;
}

.m-form__row--invalid input,
.m-form__row--invalid select,
.m-form__row--invalid textarea,
.m-form input[aria-invalid="true"],
.m-form select[aria-invalid="true"],
.m-form textarea[aria-invalid="true"] {
    border-color: var(--m-color-danger);
}

/* Required-fields hint above the form (WCAG 3.3.2) */
.m-form__required-hint {
    color: var(--m-color-text-muted);
    font-size: var(--m-font-size-sm);
    margin: 0 0 var(--m-spacing-md);
}

/* Form-level errors (captcha, rate limit, delivery failure) */
.m-form__errors {
    background: var(--m-color-danger-tint);
    border: 1px solid var(--m-color-danger);
    border-radius: var(--m-radius);
    color: var(--m-color-danger);
    padding: var(--m-spacing-sm-md) 1rem;
}

.m-form__errors ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Request type dropdown (MSR-217), custom arrow instead of the native one */
.m-form select {
    appearance: none;
    background-color: var(--m-color-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1rem 1rem;
    border: 1px solid var(--m-color-border);
    border-radius: var(--m-radius);
    color: inherit;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--m-font-size-base);
    padding: var(--m-spacing-sm-md) 2.5rem var(--m-spacing-sm-md) var(--m-spacing-sm-md);
    width: 100%;
}

/* Contact thank-you page (MSR-106) */
.m-contact-success {
    padding: var(--m-spacing-xl) 0;
}

.m-contact-success__card {
    background: var(--m-color-bg);
    border: 1px solid var(--m-color-border);
    border-radius: var(--m-radius);
    padding: var(--m-spacing-xl) var(--m-spacing-lg);
    text-align: center;
}

.m-contact-success__icon {
    align-items: center;
    background: var(--m-color-primary-tint);
    border-radius: 50%;
    color: var(--m-color-primary);
    display: inline-flex;
    height: 4rem;
    justify-content: center;
    margin-bottom: var(--m-spacing-md);
    width: 4rem;
}

.m-contact-success__icon svg {
    height: 2rem;
    width: 2rem;
}

.m-contact-success__lead {
    font-size: var(--m-font-size-lg);
}

.m-contact-success__next {
    color: var(--m-color-text-muted);
    margin-top: var(--m-spacing-lg);
}

.m-contact-success__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--m-spacing-md);
    justify-content: center;
    margin-top: var(--m-spacing-md);
}

/* Footer */
.m-footer {
    background: var(--m-color-dark);
    color: var(--m-color-on-dark);
    padding: var(--m-spacing-xl) 0 var(--m-spacing-lg);
}

.m-footer-cols {
    display: grid;
    gap: var(--m-spacing-lg);
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    margin-bottom: var(--m-spacing-lg);
}

.m-footer-col strong {
    color: var(--m-color-primary-light);
    display: block;
    margin-bottom: var(--m-spacing-sm);
}

.m-footer-logo {
    display: block;
    filter: brightness(0) invert(1);
    height: 2rem;
    margin-bottom: var(--m-spacing-sm);
    width: auto;
}

.m-footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.m-footer-col a {
    color: var(--m-color-on-dark-muted);
    line-height: var(--m-line-height-loose);
}

/* MSR-106: one footer hover everywhere, the language switch effect: the item gets brighter, no
   underline, no background. Footer lists are navigation (not links in running text), so colour alone
   is fine (WCAG 1.4.1); keyboard users keep the focus outline. */
.m-footer-col a:hover {
    color: var(--m-color-on-dark);
    text-decoration: none;
}

/* MSR-106: Ko-fi support link closes the "App" column in green so it stands out (twin of the SPA footer). */
.m-footer-col .m-footer-kofi {
    color: var(--m-color-primary-light);
    font-weight: var(--m-font-weight-bold);
}

.m-footer-col .m-footer-kofi:hover {
    color: var(--m-color-primary-lighter);
}

/* MSR-220: social icon links under the footer tagline (twin of the SPA SocialLinks component). */
/* Footer-scoped: the plain .m-footer-col ul reset would otherwise win and drop the top margin. */
.m-footer-col .m-social {
    display: flex;
    gap: var(--m-spacing-sm);
    list-style: none;
    margin: var(--m-spacing-md) 0 0;
    padding: 0;
}

.m-footer-col .m-social__link {
    align-items: center;
    border-radius: var(--m-radius);
    color: var(--m-color-on-dark-muted);
    display: inline-flex;
    height: 2.75rem;
    justify-content: center;
    line-height: var(--m-line-height-none);
    transition: background-color 0.15s ease, color 0.15s ease;
    width: 2.75rem;
}

.m-footer-col .m-social__link:hover,
.m-footer-col .m-social__link:focus-visible {
    color: var(--m-color-on-dark);
}

.m-footer-col .m-social__link:focus-visible {
    outline: 2px solid var(--m-color-primary-light);
    outline-offset: 0.125rem;
}

/* MSR-106: on phones the stacked footer centres the social icons. */
@media (width <= 768px) {
    .m-footer-col .m-social {
        justify-content: center;
    }
}

.m-social__link svg {
    height: 1.5rem;
    width: 1.5rem;
}

.m-footer-copy {
    border-top: 1px solid var(--m-color-on-dark-subtle);
    color: var(--m-color-on-dark-faint);
    margin: 0;
    padding-top: var(--m-spacing-lg);
    text-align: center;
}

.m-empty {
    color: var(--m-color-text-muted);
    padding: var(--m-spacing-lg);
    text-align: center;
}

/* Error page (404 / generic) */
.m-error {
    padding: var(--m-spacing-xl) 0;
    text-align: center;
}

.m-error__code {
    color: var(--m-color-primary);
    font-size: var(--m-font-size-display);
    font-weight: var(--m-font-weight-bold);
    line-height: var(--m-line-height-none);
    margin: 0;
}

.m-error__heading {
    font-size: var(--m-font-size-2xl);
    margin: var(--m-spacing-md) 0 var(--m-spacing-sm);
}

.m-error__text {
    color: var(--m-color-text-muted);
    font-size: var(--m-font-size-lg);
    margin: 0 auto;
    max-width: 32rem;
}

.m-error__actions {
    margin-top: var(--m-spacing-lg);
}

/* Responsive */
@media (width <= 768px) {
    .m-error__code {
        font-size: var(--m-font-size-display-sm);
    }

    /* Hero action buttons stack full-width instead of sitting side by side. */
    .m-hero__cta {
        flex-direction: column;
    }

    .m-hero__cta .m-btn {
        width: 100%;
    }

    /* Sub-nav strips scroll horizontally instead of wrapping into several tall rows. */
    .m-topsubnav .m-container,
    .m-subnav {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    /* Top category bar: safe center keeps a short list centred but scrolls from the start once it
       overflows (no clipped leading items). The subcategory bar stays left-aligned as before. */
    .m-topsubnav .m-container {
        justify-content: safe center;
    }

    .m-subnav {
        justify-content: flex-start;
    }

    .m-topsubnav .m-container::-webkit-scrollbar,
    .m-subnav::-webkit-scrollbar {
        display: none;
    }

    .m-topsubnav__link,
    .m-subnav__link {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    /* MSR-213: the breadcrumb stays on one line and scrolls sideways instead of wrapping into
       several rows. The padding (offset by the negative margin, so the crumbs stay aligned with
       the content) keeps the links' focus outline inside the scroll box, where overflow would
       otherwise clip it. marketing-subnav.js adds the same scroll hints as on the subnav bars. */
    .m-breadcrumb__list {
        flex-wrap: nowrap;
        margin: -0.25rem;
        overflow-x: auto;
        padding: var(--m-spacing-xs);
        scrollbar-width: none;
    }

    .m-breadcrumb__list::-webkit-scrollbar {
        display: none;
    }

    .m-breadcrumb__item {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .m-nav-toggle {
        display: block;
    }

    /* Off-canvas drawer: slides in from the right, spans the full viewport
       height below the header, and stays under the sticky navbar. Toggled by
       the hamburger (.is-open). The CTA stays inline in .m-header__right. */
    .m-nav {
        background: var(--m-color-dark);
        bottom: 0;
        flex-direction: column;
        gap: var(--m-spacing-xs);
        overflow-y: auto;
        padding: var(--m-spacing-lg) var(--m-spacing-md) var(--m-spacing-md);
        position: fixed;
        right: 0;
        top: var(--m-header-height);
        transform: translateX(100%);
        transition: transform 0.3s ease, visibility 0.3s ease;
        visibility: hidden;
        width: 100vw;
        z-index: var(--m-z-navbar-drawer);
    }

    .m-nav.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .m-nav a {
        font-size: var(--m-font-size-lg);
        padding: var(--m-spacing-sm-md) 1rem;
    }
}

/* Cookie consent (MSR-170) */

/* The author display rules below outrank the UA `[hidden]{display:none}`, so restore it
   explicitly - otherwise the hidden modal/banner keeps intercepting pointer events. */
.m-cookie[hidden],
.m-cookie-modal[hidden] {
    display: none;
}

.m-btn--outline {
    background: transparent;
    border-color: var(--m-color-border);
    color: var(--m-color-text);
}

.m-btn--outline:hover {
    border-color: var(--m-color-text-muted);
    text-decoration: none;
}

.m-footer-linkbtn {
    background: none;
    border: none;
    color: var(--m-color-on-dark-muted);
    cursor: pointer;
    font: inherit;
    line-height: var(--m-line-height-loose);
    padding: 0;
    text-align: left;
}

.m-footer-linkbtn:hover {
    color: var(--m-color-on-dark);
}

.m-cookie__overlay {
    backdrop-filter: blur(2px);
    background: var(--m-color-overlay-strong);
    inset: 0;
    position: fixed;
    z-index: var(--m-z-consent);
}

.m-cookie__bar {
    align-items: center;
    background: var(--m-color-bg);
    border-top: 2px solid var(--m-color-primary);
    bottom: 0;
    box-shadow: var(--m-shadow-up);
    display: flex;
    flex-wrap: wrap;
    gap: var(--m-spacing-md);
    justify-content: space-between;
    left: 0;
    padding: var(--m-spacing-md) var(--m-spacing-lg);
    position: fixed;
    right: 0;
    z-index: var(--m-z-consent-bar);
}

.m-cookie__text {
    flex: 1 1 20rem;
    min-width: 0;
}

.m-cookie__title {
    display: block;
    font-size: var(--m-font-size-lg);
    margin-bottom: var(--m-spacing-sm);
}

.m-cookie__desc {
    color: var(--m-color-text-muted);
    font-size: var(--m-font-size-sm);
    margin: 0;
}

.m-cookie__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--m-spacing-sm);
}

.m-cookie__actions .m-btn {
    font-size: var(--m-font-size-sm);
    padding: 0.5rem 1rem;
}

.m-cookie-modal {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: var(--m-spacing-md);
    position: fixed;
    z-index: var(--m-z-modal);
}

.m-cookie-modal__overlay {
    background: var(--m-color-overlay);
    inset: 0;
    position: absolute;
}

.m-cookie-modal__card {
    background: var(--m-color-bg);
    border-radius: var(--m-radius);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    max-width: 34rem;
    position: relative;
    width: 100%;
    z-index: var(--m-z-raised);
}

.m-cookie-modal__header {
    align-items: center;
    border-bottom: 1px solid var(--m-color-border);
    display: flex;
    justify-content: space-between;
    padding: var(--m-spacing-md) var(--m-spacing-lg);
}

.m-cookie-modal__title {
    font-size: var(--m-font-size-title);
    margin: 0;
}

.m-cookie-modal__close {
    background: none;
    border: none;
    color: var(--m-color-text-muted);
    cursor: pointer;
    font-size: var(--m-font-size-heading);
    line-height: var(--m-line-height-none);
    padding: 0;
}

.m-cookie-modal__close:hover {
    color: var(--m-color-text);
}

.m-cookie-modal__body {
    display: flex;
    flex-direction: column;
    gap: var(--m-spacing-md);
    overflow-y: auto;
    padding: var(--m-spacing-lg);
}

.m-cookie-modal__footer {
    border-top: 1px solid var(--m-color-border);
    display: flex;
    gap: var(--m-spacing-sm);
    justify-content: flex-end;
    padding: var(--m-spacing-md) var(--m-spacing-lg);
}

.m-cookie-cat {
    border: 1px solid var(--m-color-border);
    border-radius: var(--m-radius);
    padding: var(--m-spacing-md);
}

.m-cookie-cat__head {
    align-items: center;
    display: flex;
    gap: var(--m-spacing-md);
    justify-content: space-between;
}

.m-cookie-cat__name {
    font-size: var(--m-font-size-base);
    font-weight: var(--m-font-weight-semibold);
}

.m-cookie-cat__desc {
    color: var(--m-color-text-muted);
    font-size: var(--m-font-size-sm);
    margin: var(--m-spacing-sm) 0 0;
}

/* Toggle switch built from a checkbox. */
.m-cookie-switch {
    display: inline-block;
    flex-shrink: 0;
    height: 1.5rem;
    position: relative;
    width: 2.75rem;
}

.m-cookie-switch input {
    height: 0;
    opacity: 0;
    width: 0;
}

.m-cookie-switch__slider {
    background: var(--m-color-border);
    border-radius: 1.5rem;
    cursor: pointer;
    inset: 0;
    position: absolute;
    transition: background 0.2s ease;
}

.m-cookie-switch__slider::before {
    background: var(--m-color-bg);
    border-radius: 50%;
    content: '';
    height: 1.125rem;
    left: 0.1875rem;
    position: absolute;
    top: 0.1875rem;
    transition: transform 0.2s ease;
    width: 1.125rem;
}

.m-cookie-switch input:checked + .m-cookie-switch__slider {
    background: var(--m-color-primary);
}

.m-cookie-switch input:checked + .m-cookie-switch__slider::before {
    transform: translateX(1.25rem);
}

.m-cookie-switch input:disabled + .m-cookie-switch__slider {
    cursor: not-allowed;
    opacity: 0.7;
}

.m-cookie-switch input:focus-visible + .m-cookie-switch__slider {
    outline: 2px solid var(--m-color-primary);
    outline-offset: 2px;
}

@media (width <= 768px) {
    .m-cookie__bar {
        padding: var(--m-spacing-md);
    }

    .m-cookie__actions {
        width: 100%;
    }

    .m-cookie__actions .m-btn {
        flex: 1 1 auto;
    }
}

/* Respect the OS "reduce motion" setting (WCAG 2.3.3): no transitions/animations. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
