/* ============================================================
   Global Styles — editorial design system
   ------------------------------------------------------------
   Serif display (Cormorant Garamond) + light Inter body,
   square corners, hairline borders, no shadows.
   All brand decisions live in the :root tokens below.
   ============================================================ */

:root {
    /* Brand */
    --accent:         #4a6741;
    --accent-hover:   #3a5432;
    --accent-soft:    #edf1eb;
    --accent-on-dark: #a8c5a0;

    /* Neutrals */
    --bg:             #ffffff;
    --band:           #f5f4f0;
    --surface:        #ffffff;
    --heading:        #1c1c1c;
    --text:           #3a3a3a;
    --text-muted:     #6a6a6a;
    --text-faint:     #9a9a9a;
    --border:         #e8e8e8;
    --border-strong:  #d9d9d9;

    /* Ink = high-contrast fill (near-black on light, near-white on dark) */
    --ink:            #1c1c1c;
    --ink-contrast:   #ffffff;

    /* Fixed dark bands (hero, CTA, footer — dark in both themes) */
    --dark-band:      #1c1c1c;
    --on-dark-muted:  #909090;

    /* Status */
    --success:        #3e7a52;
    --success-light:  #eef5f0;
    --error:          #b04a38;
    --error-light:    #faf0ee;
    --warning:        #a8752c;
    --warning-light:  #faf5ec;
    --info:           #4a6a8a;

    /* Focus */
    --focus-ring:     0 0 0 3px rgba(74, 103, 65, 0.18);

    /* Type */
    --font-serif:     'Cormorant Garamond', Georgia, serif;
    --font-sans:      'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
    --font-mono:      'JetBrains Mono', 'Courier New', monospace;

    /* Layout */
    --inner-max:      1200px;
    --nav-height:     64px;
    --section-pad:    5.5rem 2rem;
}

[data-theme="dark"] {
    --accent:         #8fae83;
    --accent-hover:   #a8c5a0;
    --accent-soft:    rgba(143, 174, 131, 0.14);
    --accent-on-dark: #a8c5a0;

    --bg:             #191919;
    --band:           #1f1e1c;
    --surface:        #1f1e1c;
    --heading:        #f0ede6;
    --text:           #d6d3cd;
    --text-muted:     #9a9a9a;
    --text-faint:     #6e6e6e;
    --border:         #2d2d2b;
    --border-strong:  #3c3c3a;

    --ink:            #f0ede6;
    --ink-contrast:   #191919;

    --dark-band:      #101010;
    --on-dark-muted:  #909090;

    --success:        #6fae85;
    --success-light:  rgba(111, 174, 133, 0.12);
    --error:          #d98a7c;
    --error-light:    rgba(217, 138, 124, 0.10);
    --warning:        #c9a05e;
    --warning-light:  rgba(201, 160, 94, 0.10);
    --info:           #7c9cb8;

    --focus-ring:     0 0 0 3px rgba(143, 174, 131, 0.25);
}

/* ── Purple palette — matches the Irish EMT MCQ Study Bank PDF cover ──
   (deep aubergine + violet/lavender accents). Toggled via the navbar
   palette button, independent of the light/dark switch above; status
   colours (success/error/warning/info) are intentionally left to fall
   through from the sage palette above — they're semantic, not brand. */
[data-palette="purple"][data-theme="light"] {
    --accent:         #7c3aed;
    --accent-hover:   #6d28d9;
    --accent-soft:    #f3ebfd;
    --accent-on-dark: #c586fa;

    --band:           #f8f5fc;
    --heading:        #2e1a47;
    --text:           #3a3542;
    --text-muted:     #756e80;
    --text-faint:     #a79fb3;
    --border:         #e9e1f5;
    --border-strong:  #d5c5ec;

    --ink:            #2e1a47;
    --ink-contrast:   #ffffff;

    --dark-band:      #2e1a47;
    --on-dark-muted:  #b9a9cc;

    --focus-ring:     0 0 0 3px rgba(124, 58, 237, 0.18);
}

[data-palette="purple"][data-theme="dark"] {
    --accent:         #b088f5;
    --accent-hover:   #c8a8fa;
    --accent-soft:    rgba(176, 136, 245, 0.14);
    --accent-on-dark: #c8a8fa;

    --bg:             #18131f;
    --band:           #1e1826;
    --surface:        #1e1826;
    --heading:        #ede7f6;
    --text:           #d6cfe0;
    --text-muted:     #a89bb8;
    --text-faint:     #766a86;
    --border:         #2e2638;
    --border-strong:  #3d3348;

    --ink:            #ede7f6;
    --ink-contrast:   #18131f;

    --dark-band:      #120e17;
    --on-dark-muted:  #9c8fae;

    --focus-ring:     0 0 0 3px rgba(176, 136, 245, 0.25);
}

/* ── Home redesign tokens ───────────────────────────────────
   "Studio" direction, previewed on the home page only via body.theme-studio.
   Palette: deep slate/navy base, teal-blue sections, warm cream highlights
   and a purple call to action. Remaps the generic tokens above (so the
   shared navbar, footer, cookie banner and toasts follow) and adds --hx-*
   tokens for the new components. --accent stays the text-safe accent
   (deep teal on light, cream on dark). */
:root { --font-display: var(--font-serif); }

.theme-studio {
    --font-display:   'Sora', 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
    --font-sans:      'Figtree', 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
    --nav-height:     72px;
    --inner-max:      1200px;

    /* Brand colours (fixed in both themes) */
    --hx-navy:        #0f1f29;
    --hx-navy-deep:   #09141b;
    --hx-slate:       #212a2f;
    --hx-teal:        #20626e;
    --hx-teal-deep:   #16475f;
    --hx-blue:        #2a678a;
    --hx-cream:       #fce1aa;
    --hx-cream-hover: #ffffff;
    --hx-purple:      #914dd3;
    --hx-purple-hover:#7a3cb8;
    --hx-on-purple:   #ffffff;
    --hx-on-cream:    #0f1f29;
    --hx-white:       #ffffff;

    /* Dark bands (navbar, hero, services, footer) */
    --hx-nav-bg:      #0b1a22;
    --hx-dark-text:   #f4f1ea;
    --hx-dark-muted:  #b3c1cb;
    --hx-dark-line:   rgba(255, 255, 255, 0.12);
    --hx-dark-card:   rgba(255, 255, 255, 0.06);
    --hx-glow:        rgba(42, 103, 138, 0.55);
    --hx-dot:         rgba(255, 255, 255, 0.09);

    /* Hero product-window graphic */
    --hx-app-bg:      #ffffff;
    --hx-app-bar:     #eef2f5;
    --hx-app-line:    #dbe4ea;

    /* Depth */
    --hx-radius:      16px;
    --hx-radius-sm:   10px;
    --hx-shadow-sm:   0 1px 2px rgba(9, 20, 27, 0.06), 0 4px 12px -4px rgba(9, 20, 27, 0.08);
    --hx-shadow-md:   0 12px 28px -10px rgba(9, 20, 27, 0.22);
    --hx-shadow-lg:   0 24px 48px -16px rgba(9, 20, 27, 0.35);
    --hx-shadow-cta:  0 10px 24px -8px rgba(145, 77, 211, 0.6);
    --hx-shadow-feat: 0 20px 44px -16px rgba(145, 77, 211, 0.45);
}

[data-theme="dark"] .theme-studio {
    --bg:             #0b161d;
    --band:           #0f1f29;
    --surface:        #132733;
    --heading:        #f4f1ea;
    --text:           #c9d3da;
    --text-muted:     #98a8b3;
    --text-faint:     #7d8e9a;
    --border:         #1f3442;
    --border-strong:  #2d4a5b;
    --ink:            #f4f1ea;
    --ink-contrast:   #0b161d;
    --accent:         #fce1aa;
    --accent-hover:   #ffffff;
    --accent-soft:    rgba(252, 225, 170, 0.1);
    --dark-band:      #07121a;
    --on-dark-muted:  #98a8b3;
    --focus-ring:     0 0 0 3px rgba(252, 225, 170, 0.35);
    --hx-focus:       #fce1aa;
    --hx-card-bg:     #132733;
    --hx-card-hover:  #fce1aa;
    --hx-icon-bg:     #fce1aa;
}

[data-theme="light"] .theme-studio {
    --bg:             #ffffff;
    --band:           #f3f6f8;
    --surface:        #ffffff;
    --heading:        #0f1f29;
    --text:           #3a4852;
    --text-muted:     #55646f;
    --text-faint:     #6a7882;
    --border:         #dde4e9;
    --border-strong:  #c5d0d8;
    --ink:            #0f1f29;
    --ink-contrast:   #ffffff;
    --accent:         #20626e;
    --accent-hover:   #16475f;
    --accent-soft:    rgba(32, 98, 110, 0.08);
    --dark-band:      #07121a;
    --on-dark-muted:  #98a8b3;
    --focus-ring:     0 0 0 3px rgba(32, 98, 110, 0.3);
    --hx-focus:       #914dd3;
    --hx-card-bg:     #ffffff;
    --hx-card-hover:  #914dd3;
    --hx-icon-bg:     #fce1aa;
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

a { text-decoration: none; color: var(--accent); }
a:hover { color: var(--accent-hover); }

body {
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: 15px;
    line-height: 1.7;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

strong { font-weight: 600; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--heading);
    line-height: 1.15;
}

/* ── Eyebrow label (uppercase micro-label with hairline dash) */
.mk-label {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 400;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mk-label::before {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: currentColor;
    flex-shrink: 0;
}

.mk-label-center { justify-content: center; }

.mk-label-on-dark { color: rgba(255, 255, 255, 0.72); }

.mk-italic {
    font-style: italic;
    color: var(--accent-on-dark);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 400;
    line-height: 1.4;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: 0;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn-action:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.btn-action:disabled,
.btn-action:disabled:hover {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-lg { padding: 15px 36px; }

.btn-validate {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.btn-validate:hover { opacity: 0.85; color: #ffffff; }

.btn-export {
    background: transparent;
    border-color: var(--ink);
    color: var(--ink);
}

.btn-export:hover {
    background: var(--ink);
    color: var(--ink-contrast);
}

/* Light outline button for dark bands (hero) */
.btn-ghost-light {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.8);
    color: #ffffff;
}

.btn-ghost-light:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* Inline text-link button (e.g. "Forgot password?") */
.auth-link-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.auth-link-btn:hover {
    color: var(--accent-hover);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================================
   Marketing shell — navbar
   ============================================================ */
.mk-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.mk-nav-inner {
    max-width: var(--inner-max);
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
}

.mk-brand {
    font-family: var(--font-sans);
    color: var(--heading);
    text-decoration: none;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.mk-brand:hover { color: var(--heading); }

/* Logo mark: the diamond is cropped from img/Carroll Codeworks_logo.jpg
   (300x224, dark navy tile) so it stays tied to that one file. */
/* Logo mark: the diamond from img/logo-diamond.png, transparent so it sits on any background */
.mk-brand-mark {
    display: block;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    background: url("../img/logo-diamond.png") center / contain no-repeat;
}

.mk-brand-name {
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.mk-brand-name strong {
    margin-right: 0.3em;   /* clear gap between "Carroll" and "Codeworks" */
    font-weight: 800;
}

.mk-nav-links {
    display: flex;
    gap: 1.9rem;
    align-items: center;
    margin-left: auto;
}

.mk-nav-link {
    font-size: 11.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.15s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mk-nav-link:hover { color: var(--accent); }

.mk-nav-actions {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-shrink: 0;
}

.mk-nav-cta {
    background: var(--ink);
    color: var(--ink-contrast);
    font-size: 11.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 400;
    padding: 10px 22px;
    text-decoration: none;
    transition: opacity 0.15s ease;
    white-space: nowrap;
}

.mk-nav-cta:hover { opacity: 0.85; color: var(--ink-contrast); }

.mk-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    transition: color 0.15s ease;
    padding: 0;
}

.mk-icon-btn:hover { color: var(--heading); }

[data-theme="light"] .dm-to-light { display: none; }
[data-theme="dark"]  .dm-to-dark  { display: none; }

[data-palette="sage"]   .palette-to-sage   { display: none; }
[data-palette="purple"] .palette-to-purple { display: none; }

.mk-nav-auth {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.mk-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.mk-user-chip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.mk-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.mk-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--heading);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mk-signin-link-mobile {
    display: none;
}

.mk-menu-btn {
    display: none;
    width: 36px;
    height: 34px;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--ink);
    color: var(--ink);
    font-size: 17px;
    cursor: pointer;
    padding: 0;
}

/* ============================================================
   Page content
   ============================================================ */
.mk-main {
    animation: pageIn 0.18s ease both;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Marketing shell — sections & bands
   ============================================================ */
.mk-inner {
    max-width: var(--inner-max);
    margin: 0 auto;
}

.mk-section { padding: var(--section-pad); }

.mk-section--band { background: var(--band); }

.mk-section-head {
    text-align: center;
    margin-bottom: 3.5rem;
}

.mk-section-title {
    font-size: clamp(30px, 4vw, 44px);
    margin: 0 0 12px;
}

.mk-section-sub {
    font-size: 15px;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.8;
    max-width: 560px;
    margin: 0 auto;
}

/* ── Hero (dark band in both themes) ────────────────────── */
.mk-hero {
    background: var(--dark-band);
    text-align: center;
    padding: 7.5rem 2rem 6.5rem;
}

.mk-hero-title {
    font-size: clamp(40px, 5.5vw, 64px);
    color: #ffffff;
    line-height: 1.12;
    max-width: 760px;
    margin: 0 auto 1.5rem;
}

.mk-hero-sub {
    font-size: 16px;
    font-weight: 300;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    max-width: 520px;
    margin: 0 auto 2.5rem;
}

.mk-hero-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* ── Accent band ────────────────────────────────────────── */
.mk-band {
    background: var(--accent);
    padding: 1.1rem 2rem;
}

[data-theme="dark"] .mk-band { background: #4a6741; }

.mk-band-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.mk-band-item {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #ffffff;
    font-weight: 300;
}

.mk-band-sep { color: #ffffff; opacity: 0.35; }

/* ── Value propositions ─────────────────────────────────── */
.mk-value-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.mk-value-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2.25rem 2rem;
}

.mk-value-icon {
    font-size: 26px;
    color: var(--accent);
    display: block;
    margin-bottom: 1.1rem;
    line-height: 1;
}

.mk-value-title {
    font-size: 22px;
    margin: 0 0 8px;
}

.mk-value-desc {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.75;
    margin: 0;
}

/* ── Feature tiles ──────────────────────────────────────── */
.mk-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.mk-feature-tile {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.75rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.mk-feature-tile:hover { border-color: var(--ink); }

.mk-feature-icon {
    font-size: 20px;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 3px;
    line-height: 1;
}

.mk-feature-name {
    font-family: var(--font-serif);
    font-size: 19px;
    color: var(--heading);
    margin: 0 0 4px;
    line-height: 1.25;
}

.mk-feature-desc {
    font-size: 13.5px;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

/* ── Closing CTA (dark band) ────────────────────────────── */
.mk-cta {
    background: var(--dark-band);
    text-align: center;
    padding: 5.5rem 2rem;
}

.mk-cta-title {
    font-size: clamp(30px, 4vw, 44px);
    color: #ffffff;
    margin: 0 0 12px;
}

.mk-cta-sub {
    font-size: 15px;
    font-weight: 300;
    color: var(--on-dark-muted);
    margin: 0 0 2.25rem;
}

/* ============================================================
   Marketing shell — footer (dark in both themes)
   ============================================================ */
.mk-footer {
    background: var(--dark-band);
    padding: 3.5rem 2rem 0;
    margin-top: 0;
}

.mk-footer-inner {
    max-width: var(--inner-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

/* Footer logo: same mark + wordmark as the navbar, in white on the dark footer */
.mk-footer-logo-link,
.mk-footer-logo-link:hover {
    color: #ffffff;
    margin-bottom: 14px;
}

.mk-footer-tagline {
    font-size: 13px;
    font-weight: 300;
    color: var(--on-dark-muted);
    margin: 0;
}

.mk-footer-col-title {
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin: 0 0 14px;
}

.mk-footer-link {
    font-size: 13px;
    color: var(--on-dark-muted);
    text-decoration: none;
    font-weight: 300;
    display: block;
    margin-bottom: 10px;
    transition: color 0.15s ease;
}

.mk-footer-link:hover { color: #ffffff; }

.mk-footer-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: var(--font-sans);
    text-align: left;
}

.mk-footer-bottom {
    max-width: var(--inner-max);
    margin: 3rem auto 0;
    padding: 1.4rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    color: var(--on-dark-muted);
}

/* ============================================================
   Marketing shell — page scaffolding (pricing, etc.)
   ============================================================ */
.mk-page {
    max-width: var(--inner-max);
    margin: 0 auto;
    padding: 0 2rem;
}

.mk-page-head {
    text-align: center;
    padding: 4.5rem 0 3rem;
}

.mk-page-title {
    font-size: clamp(32px, 4.5vw, 48px);
    margin: 0 0 12px;
}

.mk-page-sub {
    font-size: 15px;
    font-weight: 300;
    color: var(--text-muted);
    margin: 0 auto;
    max-width: 520px;
}

.mk-page-body {
    padding-bottom: 5rem;
}

/* ============================================================
   Pricing
   ============================================================ */
.mk-plans {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding-bottom: 6rem;
}

.plan-card {
    position: relative;
    width: 100%;
    max-width: 340px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2.25rem 2rem;
}

.plan-card--featured {
    border: 2px solid var(--accent);
}

.plan-tag {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #ffffff;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 400;
    padding: 4px 12px;
    white-space: nowrap;
}

.plan-name {
    font-family: var(--font-serif);
    font-size: 24px;
    color: var(--heading);
    margin: 0 0 2px;
}

.plan-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 10px 0 6px;
}

.plan-price {
    font-family: var(--font-serif);
    font-size: 46px;
    color: var(--heading);
    line-height: 1;
}

.plan-period {
    font-size: 13px;
    font-weight: 300;
    color: var(--text-muted);
}

.plan-desc {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-muted);
    margin: 0 0 1.5rem;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
}

.plan-features li {
    font-size: 14px;
    font-weight: 300;
    color: var(--text);
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.plan-features i {
    color: var(--accent);
    margin-right: 10px;
    font-size: 13px;
}

/* ============================================================
   Legal pages (typographic document)
   ============================================================ */
.legal-doc {
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}

.legal-title {
    font-size: clamp(34px, 5vw, 48px);
    margin: 0 0 10px;
}

.legal-doc .text-meta {
    font-size: 11.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.legal-h2 {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.4;
    color: var(--heading);
    margin: 32px 0 10px;
}

.legal-body-text {
    font-size: 15px;
    font-weight: 300;
    color: var(--text);
    line-height: 1.85;
    margin: 0 0 8px;
}

.legal-body-text a { color: var(--accent); }

.legal-body-text a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Payment page ───────────────────────────────────────── */
.payment-card {
    max-width: 460px;
    margin: 0 auto;
    padding: 2.25rem 2rem;
}

/* ── Setup Guide page ───────────────────────────────────── */
.guide-intro { max-width: 760px; margin: 0 auto 2rem; }

.guide-lede {
    font-size: 15px;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.8;
    margin: 0;
}

.guide-card {
    max-width: 760px;
    padding: 2rem 2.25rem;
    margin: 0 auto 1.25rem;
}

.guide-step-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.guide-step-num {
    font-family: var(--font-serif);
    font-size: 26px;
    color: var(--accent);
    line-height: 1;
    flex-shrink: 0;
    min-width: 38px;
}

.guide-step-title {
    font-size: 19px;
    margin: 0;
}

.guide-body p,
.guide-body li {
    font-size: 14.5px;
    font-weight: 300;
    color: var(--text);
    line-height: 1.8;
}

.guide-body p { margin: 0 0 12px; }
.guide-body p:last-child { margin-bottom: 0; }

.guide-body ul,
.guide-body ol {
    margin: 0;
    padding-left: 20px;
}

.guide-body ul + p,
.guide-body ol + p {
    margin-top: 12px;
}

.guide-body li { margin-bottom: 8px; }
.guide-body li:last-child { margin-bottom: 0; }

.guide-body code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    background: var(--band);
    border: 1px solid var(--border);
    padding: 1px 6px;
    color: var(--heading);
}

.guide-body a { text-decoration: underline; text-underline-offset: 2px; }

.guide-note-label {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--text-muted);
    margin: 20px 0 10px !important;
}

.guide-code-block {
    background: var(--band);
    border: 1px solid var(--border);
    padding: 16px 18px;
    margin: 10px 0 0;
    overflow-x: auto;
}

.guide-code-block code {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text);
    white-space: pre;
}

.guide-table-wrap {
    overflow-x: auto;
    margin-top: 10px;
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
}

.guide-table th {
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--text-muted);
    text-align: left;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
}

.guide-table td {
    font-size: 13px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.guide-table td:first-child { white-space: nowrap; }

.guide-table tr:last-child td { border-bottom: none; }

/* ============================================================
   Auth pages (centered editorial forms)
   ============================================================ */
.auth-shell {
    max-width: 400px;
    margin: 0 auto;
    padding: 4.5rem 1.5rem 6rem;
}

.auth-shell--center {
    max-width: 460px;
    text-align: center;
}

/* ------------------------------------------------------------
   Password strength meter — "vital signs" monitor
   (Pages/Shared/_PasswordMeter.cshtml + js/password-meter.js)
   ------------------------------------------------------------ */
.pw-meter {
    margin-top: 10px;
    color: var(--error);
}

.pw-meter[data-level="2"] { color: var(--warning); }
.pw-meter[data-level="3"],
.pw-meter[data-level="4"] { color: var(--success); }

.pw-meter-monitor {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: var(--dark-band);
    border: 1px solid var(--border-strong);
}

.pw-meter-ecg {
    flex: 1;
    height: 34px;
    min-width: 0;
}

.pw-meter-trace {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linejoin: round;
    stroke-linecap: round;
    stroke-dasharray: 100;   /* paths use pathLength="100" */
    animation: pw-meter-sweep 2s linear infinite;
}

.pw-meter-trace--flat { display: none; }
.pw-meter[data-level="0"] .pw-meter-trace--beat { display: none; }
.pw-meter[data-level="0"] .pw-meter-trace--flat { display: inline; animation-duration: 3s; }
/* Sweep speed matches the BPM shown (two beats per sweep): 100 → 1.2s, 70 → 1.7s, 60 → 2s, 55 → 2.2s */
.pw-meter[data-level="1"] .pw-meter-trace { animation-duration: 1.2s; }
.pw-meter[data-level="2"] .pw-meter-trace { animation-duration: 1.7s; }
.pw-meter[data-level="4"] .pw-meter-trace { animation-duration: 2.2s; }

@keyframes pw-meter-sweep {
    from { stroke-dashoffset: 100; }
    to   { stroke-dashoffset: 0; }
}

.pw-meter-bpm {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 20px;
    line-height: 1;
    min-width: 3.2em;
    text-align: right;
}

.pw-meter-bpm-unit {
    display: block;
    margin-top: 3px;
    font-size: 9px;
    letter-spacing: 0.14em;
    color: var(--on-dark-muted);
}

.pw-meter-bars {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin-top: 8px;
}

.pw-meter-bars span {
    height: 4px;
    background: var(--border-strong);
    transition: background 0.2s ease;
}

.pw-meter-bars span:first-child,
.pw-meter[data-level="1"] .pw-meter-bars span:nth-child(-n+2),
.pw-meter[data-level="2"] .pw-meter-bars span:nth-child(-n+3),
.pw-meter[data-level="3"] .pw-meter-bars span:nth-child(-n+4),
.pw-meter[data-level="4"] .pw-meter-bars span { background: currentColor; }

.pw-meter-status {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.5;
}

.pw-meter-label { font-weight: 600; }   /* inherits the level colour */
.pw-meter-detail { color: var(--text-muted); }

.pw-meter-tip {
    margin: 2px 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-faint);
}

.pw-meter-tip:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
    .pw-meter-trace { animation: none; stroke-dashoffset: 0; }
}

/* Terms & privacy acceptance checkbox on sign-up */
.auth-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-muted);
    cursor: pointer;
}

.auth-consent input[type="checkbox"] {
    margin: 3px 0 0;
    flex-shrink: 0;
    accent-color: var(--accent);
}

.auth-consent a { color: var(--accent); }
.auth-consent a:hover { color: var(--accent-hover); }

.auth-extra {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.auth-head {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: clamp(30px, 4vw, 38px);
    margin: 0 0 6px;
}

.auth-sub {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-muted);
    margin: 0;
}

.auth-logged-in {
    text-align: center;
    padding: 2rem 0;
}

.auth-status-text {
    font-size: 15px;
    font-weight: 300;
    color: var(--text-muted);
}

.auth-status-text strong { color: var(--heading); }

.auth-logged-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.verify-icon {
    font-size: 40px;
    color: var(--accent);
    display: block;
    margin-bottom: 1.25rem;
    line-height: 1;
}

/* Tabs */
.auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    font-family: var(--font-sans);
    font-size: 11.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 400;
    color: var(--text-muted);
    padding: 10px 16px;
    cursor: pointer;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.tab-btn:hover { color: var(--heading); }

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============================================================
   Forms
   ============================================================ */
.form-input {
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: 14.5px;
    font-weight: 300;
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input::placeholder { color: var(--text-faint); }

.form-input:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

.field-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 7px;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ── Pro-tier badge + locked-control styling ────────────── */
.pro-badge {
    display: inline-block;
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 7px;
    margin-left: 6px;
    vertical-align: middle;
}

.pro-locked {
    opacity: 0.55;
    cursor: not-allowed;
}

.pro-locked-link {
    color: var(--accent);
    text-decoration: underline;
}

.field-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-helptext {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.75;
    margin: 0;
}

/* ── Alerts (result headers) ────────────────────────────── */
.result-header {
    padding: 12px 14px;
    border-left: 2px solid transparent;
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 20px;
}

.result-header.error {
    background: var(--error-light);
    border-left-color: var(--error);
    color: var(--error);
}

.result-header.success {
    background: var(--success-light);
    border-left-color: var(--success);
    color: var(--success);
}

.result-header.upsell {
    background: var(--accent-soft);
    border-left-color: var(--accent);
    color: var(--heading);
}

.result-header.upsell a { color: var(--accent); }

.result-header.error a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

/* ============================================================
   Cards
   ============================================================ */
.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.card-head-title {
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 400;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-head-title i { color: var(--accent); }

.output-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

/* ── Accordion (Quiz History) ───────────────────────────── */
.output-body[hidden] { display: none; }

.mk-accordion {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mk-accordion .tool-card { height: auto; }

.card-head-toggle {
    width: 100%;
    padding: 20px 24px;
    background: var(--band);
    border: 0;
    border-bottom: 1px solid var(--border);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.card-head-toggle:hover { background: var(--accent-soft); }

.card-head-toggle[aria-expanded="false"] {
    background: var(--surface);
    border-bottom-color: transparent;
}

.card-head-toggle[aria-expanded="false"]:hover { background: var(--accent-soft); }

.card-head-toggle .card-head-title {
    font-family: var(--font-serif);
    font-size: 21px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--heading);
    gap: 12px;
}

.card-head-toggle .card-head-title i { font-size: 18px; }

.card-head-chevron {
    flex-shrink: 0;
    margin-left: 16px;
    color: var(--accent);
    transition: transform 0.2s ease;
}

.card-head-toggle[aria-expanded="false"] .card-head-chevron { transform: rotate(-90deg); }

/* ── Account page ───────────────────────────────────────── */
.account-card {
    margin: 0 auto 20px;
    padding: 26px 28px;
    max-width: 640px;
}

.account-section-title {
    font-family: var(--font-sans);
    font-size: 11.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-section-title i {
    color: var(--accent);
    font-size: 14px;
}

.account-card .btn-action { align-self: flex-start; }

.account-field-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.account-field-row:last-of-type { border-bottom: none; }

.account-field-label {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 400;
    color: var(--text-faint);
    min-width: 90px;
}

.account-field-value {
    font-size: 14.5px;
    font-weight: 400;
    color: var(--heading);
}

.account-billing-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.account-billing-hint { margin-top: 14px; }

/* ── System Administration pages ────────────────────────── */
.admin-card {
    margin: 0 auto 20px;
    padding: 26px 28px;
    max-width: 1100px;
}

.admin-back {
    max-width: 1100px;
    margin: 0 auto 14px;
    font-size: 13px;
}

.admin-back a { color: var(--text-muted); text-decoration: none; }
.admin-back a:hover { color: var(--accent); }

.admin-table td { vertical-align: middle; }

.admin-code {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--heading);
    margin-right: 10px;
}

.admin-copy-btn { padding: 5px 10px; }

.admin-status--active   { color: var(--success); }
.admin-status--used-up  { color: var(--text-muted); }
.admin-status--expired  { color: var(--warning); }
.admin-status--disabled { color: var(--error); }

/* Bootstrap modal, restyled to the editorial look: square corners, hairline borders, no shadow */
.mk-modal .modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    color: var(--text);
}

.mk-modal .modal-header,
.mk-modal .modal-footer {
    border-color: var(--border);
    padding: 16px 24px;
}

.mk-modal .modal-body { padding: 20px 24px; }

.mk-modal .modal-title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 400;
    color: var(--heading);
}

.mk-modal .btn-close { border-radius: 0; }

/* Announcements: scrollable checkbox lists */
.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-toolbar .form-helptext { margin: 0 0 0 auto; }

.admin-check-list {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.admin-check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.admin-check-row:last-child { border-bottom: none; }
.admin-check-row:hover { background: var(--accent-soft); }
.admin-check-row input[type="checkbox"] { margin: 0; flex-shrink: 0; accent-color: var(--accent); }

.admin-check-name {
    font-size: 14.5px;
    color: var(--heading);
}

.admin-check-meta {
    font-size: 13px;
    font-weight: 300;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.admin-check-tag {
    margin-left: auto;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-faint);
    white-space: nowrap;
}

.admin-check-row--disabled { cursor: default; }
.admin-check-row--disabled:hover { background: none; }
.admin-check-row--disabled .admin-check-name { color: var(--text-muted); }

.admin-check-empty { padding: 16px; margin: 0; }

/* ── Example page ───────────────────────────────────────── */
.example-note {
    padding: 18px 20px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 300;
    line-height: 1.7;
    margin: 0;
}

.example-actions { padding: 0 20px 20px; }

.example-output-text {
    padding: 18px 20px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-muted);
}

/* ── Shared text utilities ──────────────────────────────── */
.text-meta {
    font-size: 13px;
    font-weight: 300;
    color: var(--text-muted);
}

/* ============================================================
   Toasts
   ============================================================ */
.toast-container { z-index: 9999; }

.app-toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    min-width: 220px;
}

.app-toast .toast-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 400;
    color: var(--text);
}

.app-toast .toast-body i { font-size: 15px; }

.app-toast--success i { color: var(--success); }
.app-toast--error   i { color: var(--error); }
.app-toast--info    i { color: var(--info); }
.app-toast--warning i { color: var(--warning); }

/* ============================================================
   Cookie consent banner
   ============================================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    animation: cookieBannerSlideUp 0.3s ease;
}

@keyframes cookieBannerSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.cookie-banner-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-banner-text {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 240px;
}

.cookie-banner-icon {
    font-size: 17px;
    color: var(--accent);
    flex-shrink: 0;
    line-height: 1.5;
}

.cookie-banner-text strong {
    display: block;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--heading);
    margin-bottom: 3px;
}

.cookie-banner-text p {
    margin: 0;
    font-size: 13px;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.6;
}

.cookie-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-btn {
    font-family: var(--font-sans);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 400;
    padding: 10px 20px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.cookie-btn-accept {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.cookie-btn-accept:hover { opacity: 0.85; }

.cookie-btn-decline {
    background: transparent;
    border-color: var(--ink);
    color: var(--ink);
}

.cookie-btn-decline:hover {
    background: var(--ink);
    color: var(--ink-contrast);
}

.cookie-policy-link {
    color: var(--accent);
    font-weight: 400;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-policy-link:hover { color: var(--accent-hover); }

/* ── Scrollbars ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ============================================================
   Quiz
   ============================================================ */
.quiz-continue-card {
    margin: 0 auto 20px;
    max-width: 560px;
}

.quiz-setup-card {
    margin: 0 auto;
    padding: 26px 28px;
    max-width: 480px;
}

.quiz-setup-card .btn-action { width: 100%; }

.quiz-timed-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}

.quiz-timed-toggle input[type="checkbox"] { margin: 0; }

.quiz-error {
    color: var(--error);
}

.quiz-taking {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.quiz-progress-bar {
    position: sticky;
    top: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 10px 16px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    z-index: 10;
}

.quiz-timer {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--heading);
}

.quiz-timer.quiz-timer-low { color: var(--error); }

.quiz-question-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.quiz-question-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 22px 24px;
}

.quiz-question-num {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0 0 10px;
}

.quiz-question-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.quiz-question-head .quiz-question-num { margin: 0; }

.quiz-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 1px solid var(--border-strong);
    background: none;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.quiz-info-btn:hover,
.quiz-info-btn[aria-expanded="true"] {
    color: var(--accent);
    border-color: var(--accent);
}

.quiz-question-text {
    font-family: var(--font-sans);
    font-size: 17px;
    font-weight: 700;
    color: var(--heading);
    margin: 0 0 16px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 14.5px;
    font-weight: 300;
    color: var(--text);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.quiz-option:hover { border-color: var(--accent); }

.quiz-option input[type="radio"] { accent-color: var(--accent); }

.quiz-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.quiz-submit-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

/* ── Review (results page) ─────────────────────────────── */
.quiz-review-card { border-left: 3px solid var(--border-strong); }
.quiz-review-card--correct { border-left-color: var(--success); }
.quiz-review-card--incorrect { border-left-color: var(--error); }

.quiz-option--review {
    cursor: default;
    justify-content: space-between;
}

.quiz-option--review:hover { border-color: var(--border); }

.quiz-option--correct {
    border-color: var(--success);
    background: var(--success-light);
    color: var(--success);
}

.quiz-option--wrong {
    border-color: var(--error);
    background: var(--error-light);
    color: var(--error);
}

.quiz-option-tag {
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    white-space: nowrap;
}

.quiz-rationale {
    background: var(--band);
    border: 1px solid var(--border);
    padding: 14px 16px;
    margin: 16px 0 0;
}

.quiz-rationale-category {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--accent);
    margin: 0 0 6px;
}

.quiz-rationale-text {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.7;
    color: var(--text);
    margin: 0;
}

.quiz-score-summary {
    text-align: center;
    padding: 2.25rem 2rem;
    margin-bottom: 1.25rem;
}

.quiz-score-value {
    font-family: var(--font-serif);
    font-size: 56px;
    color: var(--heading);
    margin: 0;
    line-height: 1.1;
}

.quiz-score-label {
    font-size: 15px;
    color: var(--text-muted);
    margin: 8px 0 20px;
}

.quiz-score-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── History page ───────────────────────────────────────── */
.quiz-history-empty {
    font-size: 14.5px;
    font-weight: 300;
    color: var(--text-muted);
    padding: 20px;
    margin: 0;
}

.quiz-history-empty a { color: var(--accent); }

.quiz-section-stats {
    display: flex;
    flex-direction: column;
}

.quiz-stat-row {
    display: grid;
    grid-template-columns: 220px 1fr 130px;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

.quiz-stat-row:last-child { border-bottom: none; }

.quiz-stat-name {
    font-size: 13.5px;
    color: var(--text);
}

.quiz-stat-bar-wrap {
    height: 8px;
    background: var(--band);
    border: 1px solid var(--border);
}

.quiz-stat-bar {
    height: 100%;
    background: var(--accent);
}

.quiz-stat-pct {
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

.quiz-attempt-list {
    display: flex;
    flex-direction: column;
}

.quiz-attempt-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}

.quiz-attempt-row:last-child { border-bottom: none; }

.quiz-attempt-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.quiz-attempt-link:hover { opacity: 0.65; }

.quiz-attempt-retake {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 10.5px;
}

.quiz-attempt-section {
    font-size: 14px;
    color: var(--heading);
    margin: 0;
}

.quiz-attempt-date {
    font-size: 12px;
    color: var(--text-faint);
    margin: 2px 0 0;
}

.quiz-attempt-score {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    white-space: nowrap;
}

@media (max-width: 600px) {
    .quiz-stat-row { grid-template-columns: 1fr; gap: 6px; }
    .quiz-stat-pct { text-align: left; }
}

/* ── Friends & Messages pages ───────────────────────────── */
.btn-compact {
    padding: 8px 16px;
    font-size: 10.5px;
    flex-shrink: 0;
}

.result-header.notice {
    background: var(--band);
    border-left-color: var(--info);
    color: var(--text);
}

.result-header.warning {
    background: var(--warning-light);
    border-left-color: var(--warning);
    color: var(--warning);
}

.friends-code-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding: 18px 20px;
    background: var(--band);
    border: 1px solid var(--border);
}

.friends-code {
    font-family: var(--font-mono);
    font-size: 26px;
    letter-spacing: 0.12em;
    color: var(--heading);
    margin: 0 0 4px;
}

.friends-code-box .text-meta { margin: 0; }

.friends-subhead { margin: 24px 0 0; }

.friends-redeem-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.friends-code-input {
    flex: 1;
    min-width: 200px;
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.friends-code-input::placeholder { text-transform: none; }

.friends-result { margin: 16px 0 0; }

.friends-list {
    display: flex;
    flex-direction: column;
}

.friends-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.friends-row:last-child { border-bottom: none; }

.friends-row-title {
    font-size: 14px;
    color: var(--heading);
    margin: 0;
}

.friends-row-meta {
    font-size: 12px;
    color: var(--text-faint);
    margin: 2px 0 0;
}

.message-row--unread {
    border-left: 2px solid var(--accent);
    padding-left: 12px;
}

.message-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.message-outcome {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: right;
    flex-shrink: 0;
    max-width: 45%;
}

.mk-nav-badge {
    display: inline-block;
    min-width: 17px;
    margin-left: 6px;
    padding: 1px 5px;
    font-size: 10px;
    letter-spacing: 0;
    line-height: 1.4;
    text-align: center;
    background: var(--accent);
    color: var(--ink-contrast);
}

/* ── Sharing results ────────────────────────────────────── */
.quiz-share-card { margin-bottom: 1.25rem; }

.quiz-share-friends {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0 4px;
}

.quiz-share-friend {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--heading);
    cursor: pointer;
}

.quiz-share-friend input,
.quiz-share-review-toggle input { accent-color: var(--accent); margin: 0; }

.quiz-share-review-toggle { margin-top: 14px; }

.shared-result-meta { margin: 6px 0 16px; }

.shared-result-note {
    text-align: center;
    margin: 0 0 1.25rem;
}

/* ── Challenges ─────────────────────────────────────────── */
.quiz-challenge-banner { margin-bottom: 0; }

.quiz-challenge-deadline { margin-top: 16px; }
.quiz-challenge-deadline .form-input { width: 220px; max-width: 100%; }

.quiz-challenge-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.quiz-challenge-custom .form-input { width: 90px; }

.challenge-status {
    text-align: center;
    padding: 2rem;
    max-width: 760px;
    margin: 0 auto 1.25rem;
}

.challenge-headline {
    font-family: var(--font-serif);
    font-size: 30px;
    color: var(--heading);
    margin: 0 0 8px;
}

.challenge-subline {
    max-width: 560px;
    margin: 0 auto 18px;
}

/* Podium: 2nd | 1st | 3rd, with the winner standing tallest */
.challenge-podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 1rem;
    max-width: 760px;
    margin: 0 auto 1.25rem;
}

.challenge-podium-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--border-strong);
    text-align: center;
    padding: 20px 16px;
}

.challenge-podium-card--1 { order: 2; padding-top: 36px; border-top-color: var(--accent); }
.challenge-podium-card--2 { order: 1; }
.challenge-podium-card--3 { order: 3; }
.challenge-podium-card--me { background: var(--accent-soft); }

.challenge-medal {
    font-size: 40px;
    line-height: 1;
    margin: 0 0 8px;
}

.challenge-podium-name {
    font-size: 15px;
    color: var(--heading);
    margin: 0 0 6px;
}

.challenge-podium-score {
    font-family: var(--font-serif);
    font-size: 36px;
    color: var(--heading);
    margin: 0;
}

.challenge-podium-card .text-meta { margin: 2px 0 0; }

.challenge-tag {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 8px 0 0;
}

.challenge-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.friends-row .challenge-badges { justify-content: flex-start; margin-top: 6px; }

.challenge-badge {
    font-size: 11px;
    padding: 3px 8px;
    color: var(--heading);
    background: var(--accent-soft);
    border: 1px solid var(--border);
}

.challenge-row--me .friends-row-title { font-weight: 600; }

/* Confetti for the winner (skipped when reduced motion is preferred) */
.challenge-confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 2000;
}

.challenge-confetti-piece {
    position: absolute;
    top: -16px;
    width: 8px;
    height: 14px;
    animation-name: confetti-fall;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.challenge-confetti-piece--0 { background: var(--accent); }
.challenge-confetti-piece--1 { background: var(--error); }
.challenge-confetti-piece--2 { background: var(--warning); }
.challenge-confetti-piece--3 { background: var(--info); }
.challenge-confetti-piece--4 { background: var(--success); }

@keyframes confetti-fall {
    to { transform: translateY(105vh) rotate(720deg); }
}

/* ── Chat ───────────────────────────────────────────────── */
.chat-app {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: min(70vh, 680px);
    min-height: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.chat-list-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--border);
}

.chat-pane-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-list { flex: 1; overflow-y: auto; }
.chat-list-empty { padding: 18px; margin: 0; }

.chat-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    text-align: left;
    color: inherit;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    border-left: 2px solid transparent;
    cursor: pointer;
}

.chat-list-item:hover { background: var(--band); }

.chat-list-item--active {
    background: var(--accent-soft);
    border-left-color: var(--accent);
}

.chat-list-text { flex: 1; min-width: 0; }

.chat-list-name {
    font-size: 14px;
    color: var(--heading);
    margin: 0;
}

.chat-list-preview {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-list-badge { margin-left: 0; flex-shrink: 0; }

.chat-convo-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.chat-convo-name {
    flex: 1;
    font-size: 14px;
    color: var(--heading);
}

.chat-connection { font-size: 12px; color: var(--warning); }

.chat-back { display: none; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: var(--band);
}

.chat-empty { text-align: center; margin: 40px 0; }

.chat-load-earlier { display: block; margin: 0 auto 12px; }

.chat-day {
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 14px 0;
}

.chat-row {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    margin-bottom: 10px;
}

.chat-row--me   { margin-left: auto; align-items: flex-end; }
.chat-row--them { align-items: flex-start; }

.chat-bubble {
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border: 1px solid var(--border);
}

.chat-bubble--me {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--ink-contrast);
}

.chat-bubble--them {
    background: var(--surface);
    color: var(--text);
}

/* Cards (shared results, challenges) stay light so their links read clearly */
.chat-card { white-space: normal; }

.chat-bubble--me.chat-card {
    background: var(--accent-soft);
    color: var(--heading);
}

.chat-card-title {
    font-weight: 500;
    color: var(--heading);
    margin: 0 0 4px;
}

.chat-card-detail {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.chat-card-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 11.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
}

.chat-card-link:hover { text-decoration: underline; }

.chat-meta {
    font-size: 11px;
    color: var(--text-faint);
    margin: 4px 2px 0;
}

.chat-seen {
    font-size: 11px;
    color: var(--accent);
    margin: 2px 2px 0;
}

.chat-typing {
    font-size: 12.5px;
    font-style: italic;
    color: var(--text-muted);
    margin: 0;
    padding: 6px 18px;
    border-top: 1px solid var(--border);
}

.chat-composer {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
}

.chat-input {
    flex: 1;
    min-height: 44px;
    max-height: 160px;
    resize: none;
    line-height: 1.5;
}

.chat-send { padding: 12px 18px; }

.chat-counter { padding: 0 18px 10px; margin: 0; }

.chat-privacy-note { text-align: center; margin: 14px 0 0; }

/* Phones: one pane at a time — the list, then the open conversation */
@media (max-width: 768px) {
    .chat-app { grid-template-columns: 1fr; height: 75vh; }
    .chat-convo-pane { display: none; }
    .chat-app--open .chat-list-pane { display: none; }
    .chat-app--open .chat-convo-pane { display: flex; }
    .chat-back { display: inline-flex; }
    .chat-row { max-width: 88%; }
}

@media (max-width: 600px) {
    .challenge-podium { grid-template-columns: 1fr; }
    .challenge-podium-card--1 { order: 1; }
    .challenge-podium-card--2 { order: 2; }
    .challenge-podium-card--3 { order: 3; }
}

@media (max-width: 600px) {
    .friends-row { flex-direction: column; align-items: flex-start; }
    .message-outcome { text-align: left; max-width: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 992px) {
    .mk-value-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Signed-in users have seven nav links plus the theme buttons and account chip:
   tighten the spacing on mid-size screens, then collapse to the menu. */
@media (max-width: 1240px) {
    .mk-nav-inner { gap: 1.25rem; }
    .mk-nav-links { gap: 1.25rem; }
}

@media (max-width: 1100px) {
    .mk-nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 1.25rem 2rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.1rem;
        margin-left: 0;
        z-index: 999;
    }

    .mk-navbar.mk-nav-open .mk-nav-links { display: flex; }

    .mk-menu-btn { display: inline-flex; }

    .mk-nav-actions { margin-left: auto; }

    .mk-signin-link-desktop { display: none; }

    .mk-signin-link-mobile { display: block; }
}

@media (max-width: 768px) {
    :root {
        --section-pad: 4rem 1.25rem;
    }

    .mk-hero { padding: 5rem 1.25rem 4.5rem; }

    .mk-value-grid { grid-template-columns: 1fr; }

    .mk-footer-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    /* Logo + icon buttons must fit a 320px phone; the account chip shows just its avatar */
    .mk-nav-inner   { padding: 0 1rem; gap: 1rem; }
    .mk-nav-actions { gap: 0.5rem; }
    .mk-navbar .mk-brand       { gap: 8px; }
    .mk-navbar .mk-brand-mark  { width: 40px; height: 40px; }
    .mk-navbar .mk-brand-name  { font-size: 12px; letter-spacing: 0.08em; }
    .mk-user-name   { display: none; }

    .field-grid-2 { grid-template-columns: 1fr; }

    .cookie-banner-actions { width: 100%; }
    .cookie-banner-actions .cookie-btn { flex: 1; }
}

/* ============================================================
   Home redesign — "studio" system (body.theme-studio)
   Navy hero with an orbit graphic, centred section titles, stat blocks,
   a full-bleed teal services band and a gradient call-to-action panel.
   Rounded corners and soft layered shadows for depth; purple for actions,
   cream for highlights. Motion is driven by wwwroot/js/home.js (GSAP);
   everything here is visible without it.
   ============================================================ */
.theme-studio {
    font-weight: 400;
}

.theme-studio h1,
.theme-studio h2,
.theme-studio h3,
.theme-studio h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.theme-studio .mk-main { animation: none; }

.theme-studio a:focus-visible,
.theme-studio button:focus-visible,
.theme-studio [role="button"]:focus-visible {
    outline: 2px solid var(--hx-focus);
    outline-offset: 3px;
}

.theme-studio .mk-navbar a:focus-visible,
.theme-studio .mk-navbar button:focus-visible,
.theme-studio .mk-navbar [role="button"]:focus-visible,
.theme-studio .mk-hero a:focus-visible,
.theme-studio .mk-section--services a:focus-visible,
.theme-studio .mk-cta-panel a:focus-visible,
.theme-studio .mk-footer a:focus-visible,
.theme-studio .mk-footer button:focus-visible { outline-color: var(--hx-cream); }

/* ── Labels ─────────────────────────────────────────────── */
.theme-studio .mk-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--accent);
}

/* Eyebrow bullet: the logo's diamond (img/logo-diamond.png, made from the logo mark) */
.theme-studio .mk-label::before {
    width: 18px;
    height: 18px;
    background: url("../img/logo-diamond.png") center / cover no-repeat;
    transform: none;
}

.theme-studio .mk-label-on-dark { color: var(--hx-cream); }

/* ── Buttons ────────────────────────────────────────────── */
.theme-studio .btn-action {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    border-width: 1.5px;
    border-radius: var(--hx-radius-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theme-studio .btn-lg { padding: 15px 28px; }

.theme-studio .btn-lg::after {
    content: "\f138";
    font-family: "bootstrap-icons";
    font-size: 16px;
    font-weight: 400;
    transition: transform 0.2s ease;
}

.theme-studio .btn-action:hover { transform: translateY(-2px); }
.theme-studio .btn-action:hover::after { transform: translateX(4px); }
.theme-studio .btn-action:active { transform: translateY(0); }

.theme-studio .btn-validate {
    background: var(--hx-purple);
    border-color: var(--hx-purple);
    color: var(--hx-on-purple);
    box-shadow: var(--hx-shadow-cta);
}

.theme-studio .btn-validate:hover {
    opacity: 1;
    background: var(--hx-purple-hover);
    border-color: var(--hx-purple-hover);
    color: var(--hx-on-purple);
    box-shadow: 0 14px 28px -8px rgba(145, 77, 211, 0.7);
}

.theme-studio .btn-ghost-light {
    border-color: var(--hx-dark-line);
    background: var(--hx-dark-card);
    color: var(--hx-dark-text);
}

.theme-studio .btn-ghost-light:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--hx-cream);
    color: var(--hx-dark-text);
}

/* ── Navbar (navy in both themes) ───────────────────────── */
.theme-studio .mk-navbar {
    background: var(--hx-nav-bg);
    border-bottom: 1px solid var(--hx-dark-line);
}

.theme-studio .mk-brand,
.theme-studio .mk-brand:hover { color: var(--hx-dark-text); }

.theme-studio .mk-nav-link {
    position: relative;
    padding: 6px 0;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--hx-dark-text);
}

.theme-studio .mk-nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--hx-cream);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.theme-studio .mk-nav-link:hover,
.theme-studio .mk-nav-link:focus-visible { color: var(--hx-cream); }

.theme-studio .mk-nav-link:hover::after,
.theme-studio .mk-nav-link:focus-visible::after { transform: scaleX(1); }

.theme-studio .mk-signin-link-desktop {
    padding: 9px 20px;
    border: 1.5px solid var(--hx-dark-line);
    border-radius: var(--hx-radius-sm);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theme-studio .mk-signin-link-desktop::after { display: none; }

.theme-studio .mk-signin-link-desktop:hover,
.theme-studio .mk-signin-link-desktop:focus-visible {
    background: var(--hx-cream);
    border-color: var(--hx-cream);
    color: var(--hx-on-cream);
}

.theme-studio .mk-icon-btn { color: var(--hx-dark-muted); }
.theme-studio .mk-icon-btn:hover { color: var(--hx-cream); }

.theme-studio .mk-user-name { color: var(--hx-dark-text); }

.theme-studio .mk-menu-btn {
    border: 1.5px solid var(--hx-dark-line);
    border-radius: var(--hx-radius-sm);
    color: var(--hx-dark-text);
}

/* One accent system on the home page, so the sage/purple switch is hidden here */
.theme-studio #paletteToggle { display: none; }

.mk-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    height: 3px;
    background: var(--hx-cream);
    transform: scaleX(0);
    transform-origin: left;
    pointer-events: none;
}

/* ── Hero (navy in both themes) ─────────────────────────── */
.theme-studio .mk-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(4rem, 8vw, 6.5rem) 2rem clamp(6.5rem, 10vw, 9rem);
    background: linear-gradient(135deg, var(--hx-navy-deep) 0%, var(--hx-navy) 55%, var(--hx-teal-deep) 130%);
    color: var(--hx-dark-text);
    text-align: left;
}

.mk-hero-bg {
    position: absolute;
    inset: -8% 0;
    z-index: -1;
    background-image: radial-gradient(var(--hx-dot) 1.2px, transparent 1.4px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse 70% 80% at 75% 45%, #000 10%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 80% at 75% 45%, #000 10%, transparent 75%);
}

.mk-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle 460px at 76% 46%, var(--hx-glow), transparent 70%);
}

.mk-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 3rem;
    align-items: center;
}

.theme-studio .mk-hero-title {
    max-width: none;
    margin: 0 0 1.5rem;
    font-size: clamp(2.3rem, 4.9vw, 4.1rem);
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: var(--hx-dark-text);
}

.theme-studio .mk-italic {
    font-style: normal;
    color: var(--hx-cream);
}

.theme-studio .mk-hero-sub {
    max-width: 520px;
    margin: 0 0 2.25rem;
    font-size: 18px;
    line-height: 1.65;
    color: var(--hx-dark-muted);
}

.theme-studio .mk-hero-actions {
    justify-content: flex-start;
    gap: 14px;
}

/* Word mask used by home.js for the headline reveal */
.mk-word {
    display: inline-block;
    overflow: clip;
    padding: 0.12em 0;
    margin: -0.12em 0;
    vertical-align: top;
}

.mk-word-in { display: inline-block; will-change: transform; }

/* Hero items are hidden until GSAP reveals them; a timed fallback guarantees
   they appear even if the animation library fails to load. */
.js .mk-hero [data-hero] {
    opacity: 0;
    animation: mk-hero-failsafe 0.01s 3s forwards;
}

@keyframes mk-hero-failsafe { to { opacity: 1; } }

/* ── Hero visual: a solar system, built in CSS ──────────────
   Sizes are in cqw (percent of the visual's width) so the whole system
   scales with the hero. Each orbit spins; moons are children of their
   planet, so they travel with it. Planet sizes are to scale with each other
   (Earth = 1.5cqw) and orbit distances are on a log scale. The Sun and the
   moons are not to scale. Orbit timings and start positions are set below. */
.mk-hero-visual {
    position: relative;
    width: min(100%, 520px);
    margin-left: auto;
    aspect-ratio: 1;
    container-type: inline-size;
}

.mk-vis-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.mk-sun {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20cqw;
    height: 20cqw;
    margin: -10cqw 0 0 -10cqw;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 32%, #fff7dc, #fce1aa 42%, #e9953a 78%, #b35a18);
    box-shadow: 0 0 2.5rem 0.5rem rgba(252, 225, 170, 0.3);
}

/* An orbit is a ring that spins; its planet sits on the ring's top edge */
.mk-solar-orbit {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--d);
    height: var(--d);
    margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    animation: mk-solar-spin var(--t) linear infinite;
}

.mk-planet {
    position: absolute;
    top: 0;
    left: 50%;
    width: var(--p);
    height: var(--p);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, var(--pl), var(--pd) 80%);
}

/* A moon orbit is centred on its planet and spins around it */
.mk-moon-orbit {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--m);
    height: var(--m);
    margin: calc(var(--m) / -2) 0 0 calc(var(--m) / -2);
    border-radius: 50%;
    animation: mk-solar-spin var(--mt) linear infinite;
}

.mk-moon {
    position: absolute;
    top: 0;
    left: 50%;
    width: 0.5cqw;
    height: 0.5cqw;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #d8d4cc;
}

.mk-saturn-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 230%;
    height: 44%;
    transform: translate(-50%, -50%) rotate(-18deg);
    border: 1.5px solid rgba(236, 220, 168, 0.55);
    border-radius: 50%;
}

@keyframes mk-solar-spin {
    to { transform: rotate(360deg); }
}

/* Orbit size (--d), spin time (--t) and start position (negative delay) */
.mk-solar-orbit--mercury { --d: 30cqw; --t: 9s;  animation-delay: -1s; }
.mk-solar-orbit--venus   { --d: 39.5cqw; --t: 13s; animation-delay: -4s; }
.mk-solar-orbit--earth   { --d: 44.4cqw; --t: 17s; animation-delay: -8s; }
.mk-solar-orbit--mars    { --d: 50.8cqw; --t: 23s; animation-delay: -13s; }
.mk-solar-orbit--jupiter { --d: 69.4cqw; --t: 36s; animation-delay: -20s; }
.mk-solar-orbit--saturn  { --d: 78.6cqw; --t: 48s; animation-delay: -30s; }
.mk-solar-orbit--uranus  { --d: 89.2cqw; --t: 64s; animation-delay: -40s; }
.mk-solar-orbit--neptune { --d: 96cqw; --t: 78s; animation-delay: -55s; }

/* Planet size (--p) and colours */
.mk-planet--mercury { --p: 0.57cqw; --pl: #d9d1c4; --pd: #6f675c; }
.mk-planet--venus   { --p: 1.42cqw; --pl: #f3dca6; --pd: #a9783a; }
.mk-planet--earth   { --p: 1.5cqw; --pl: #8cc4ee; --pd: #1d4f7a; }
.mk-planet--mars    { --p: 0.8cqw;   --pl: #e9a07c; --pd: #8a3b1e; }
.mk-planet--jupiter { --p: 16.46cqw;   --pl: #f1d9b3; --pd: #9a6b42; }
.mk-planet--saturn  { --p: 13.71cqw; --pl: #f3e7b8; --pd: #a88a4f; }
.mk-planet--uranus  { --p: 5.97cqw; --pl: #d2f3f4; --pd: #3f8f96; }
.mk-planet--neptune { --p: 5.8cqw; --pl: #86a9f0; --pd: #213f8a; }

/* Moon orbit size (--m) and spin time (--mt) */
.mk-moon-orbit--earth     { --m: 9cqw;  --mt: 5s; }
.mk-moon-orbit--mars-a    { --m: 8cqw;  --mt: 3s; }
.mk-moon-orbit--mars-b    { --m: 11cqw; --mt: 4.5s; }
.mk-moon-orbit--jupiter-a { --m: 22cqw; --mt: 6s; }
.mk-moon-orbit--jupiter-b { --m: 27cqw; --mt: 8s; }
.mk-moon-orbit--jupiter-c { --m: 32cqw; --mt: 10s; }
.mk-moon-orbit--jupiter-d { --m: 37cqw; --mt: 12s; }
.mk-moon-orbit--saturn-a  { --m: 19cqw; --mt: 8s; }
.mk-moon-orbit--saturn-b  { --m: 24cqw; --mt: 12s; }
.mk-moon-orbit--uranus    { --m: 10cqw;  --mt: 10s; }
.mk-moon-orbit--neptune   { --m: 10cqw;  --mt: 9s; }

@media (prefers-reduced-motion: reduce) {
    .mk-solar-orbit,
    .mk-moon-orbit { animation-play-state: paused; }
}

/* ── Capability strip ───────────────────────────────────── */
.theme-studio .mk-band {
    padding: 0;
    background: var(--band);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.theme-studio .mk-band-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.9rem 1.25rem;
    max-width: var(--inner-max);
    margin: 0 auto;
    padding: 1.6rem 2rem;
}

.theme-studio .mk-band-item {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--text-muted);
}

/* Highlights separator: the same logo diamond as the eyebrow bullet */
.theme-studio .mk-band-sep {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    font-size: 0;
    background: url("../img/logo-diamond.png") center / cover no-repeat;
    opacity: 1;
    transform: none;
}

/* ── Section scaffolding ────────────────────────────────── */
.theme-studio .mk-section { padding: clamp(4.5rem, 8vw, 7rem) 2rem; }

.theme-studio .mk-section--band { background: var(--bg); }

.theme-studio .mk-section-head {
    max-width: 720px;
    margin: 0 auto 3.5rem;
    text-align: center;
}

.theme-studio .mk-section-title {
    max-width: none;
    margin: 0 0 1rem;
    font-size: clamp(2rem, 3.8vw, 3rem);
}

.theme-studio .mk-section-sub {
    max-width: 560px;
    margin: 0 auto;
    font-size: 17px;
    line-height: 1.65;
    color: var(--text-muted);
}

/* ── Value cards + stat blocks ──────────────────────────── */
.theme-studio .mk-value-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    counter-reset: value;
}

.theme-studio .mk-value-card {
    position: relative;
    padding: 2.25rem 2rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--hx-radius);
    background: var(--hx-card-bg);
    box-shadow: var(--hx-shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.theme-studio .mk-value-card::before {
    counter-increment: value;
    content: '0' counter(value);
    position: absolute;
    top: 1.5rem;
    right: 1.75rem;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-faint);
}

.theme-studio .mk-value-card:hover {
    transform: translateY(-6px);
    border-color: var(--hx-teal);
    box-shadow: var(--hx-shadow-md);
}

.theme-studio .mk-value-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 1.5rem;
    border-radius: 50%;
    background: var(--hx-icon-bg);
    color: var(--hx-on-cream);
    font-size: 24px;
    transition: transform 0.3s ease;
}

.theme-studio .mk-value-card:hover .mk-value-icon { transform: scale(1.1) rotate(-6deg); }

.theme-studio .mk-value-title {
    margin: 0 0 0.75rem;
    font-size: 1.3rem;
}

.theme-studio .mk-value-desc {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.65;
    color: var(--text-muted);
}

.mk-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.mk-stat {
    padding: 2rem 1.5rem;
    border-radius: var(--hx-radius);
    color: var(--hx-white);
    text-align: center;
    background: var(--hx-navy);
}

.mk-stat:nth-child(2) { background: var(--hx-teal); }
.mk-stat:nth-child(3) { background: var(--hx-purple); }

.mk-stat-num {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 4.4vw, 3.5rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--hx-white);
}

.mk-stat-label {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--hx-white);
}

/* ── Services: full-bleed teal band ─────────────────────── */
.theme-studio .mk-section--services {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--hx-teal-deep) 0%, var(--hx-teal) 100%);
}

.theme-studio .mk-section--services::before,
.theme-studio .mk-section--services::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.theme-studio .mk-section--services::before {
    top: -200px;
    left: -170px;
    width: 560px;
    height: 560px;
    background: rgba(255, 255, 255, 0.06);
}

.theme-studio .mk-section--services::after {
    right: -120px;
    bottom: -220px;
    width: 460px;
    height: 460px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.theme-studio .mk-section--services .mk-inner { position: relative; z-index: 1; }

.theme-studio .mk-section--services .mk-section-head {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 4rem;
    align-items: end;
    max-width: none;
    text-align: left;
}

.theme-studio .mk-section--services .mk-label { grid-column: 1 / -1; margin-bottom: 0; color: var(--hx-cream); }
.theme-studio .mk-section--services .mk-section-title { margin: 0; color: var(--hx-white); }
.theme-studio .mk-section--services .mk-section-sub { margin: 0; max-width: 460px; color: #dbe7ee; }

.theme-studio .mk-service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* One service: a single card, centred */
.theme-studio .mk-service-grid--single {
    grid-template-columns: minmax(0, 520px);
    justify-content: center;
}

.theme-studio .mk-service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 2.25rem 2rem 2rem;
    overflow: hidden;
    border-radius: var(--hx-radius);
    background: var(--surface);
    box-shadow: var(--hx-shadow-md);
    color: var(--heading);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.theme-studio .mk-service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--hx-purple);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
}

.theme-studio .mk-service-card:hover,
.theme-studio .mk-service-card:focus-visible {
    transform: translateY(-8px);
    box-shadow: var(--hx-shadow-lg);
}

.theme-studio .mk-service-card:hover::before,
.theme-studio .mk-service-card:focus-visible::before { transform: scaleX(1); }

.theme-studio .mk-service-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0;
    border-radius: 50%;
    background: var(--hx-icon-bg);
    color: var(--hx-on-cream);
    font-size: 28px;
    transition: transform 0.3s ease;
}

.theme-studio .mk-service-card:hover .mk-service-icon { transform: scale(1.08) rotate(-6deg); }

.theme-studio .mk-service-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--heading);
}

.theme-studio .mk-service-desc {
    flex: 1;
    margin: 0;
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-muted);
}

.theme-studio .mk-service-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
}

.theme-studio .mk-service-more::after {
    content: "\f138";
    font-family: "bootstrap-icons";
    font-weight: 400;
    transition: transform 0.2s ease;
}

.theme-studio .mk-service-card:hover .mk-service-more::after { transform: translateX(5px); }

/* ── Closing CTA: gradient panel overlapping the footer ─── */
.theme-studio .mk-cta {
    position: relative;
    z-index: 2;
    padding: clamp(4rem, 7vw, 6rem) 2rem 0;
    background: transparent;
    text-align: left;
}

.mk-cta-panel {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 2rem 4rem;
    align-items: center;
    margin-bottom: -4.5rem;
    padding: clamp(2.5rem, 5vw, 4.5rem);
    border-radius: 24px;
    background: linear-gradient(135deg, var(--hx-navy) 0%, var(--hx-teal-deep) 100%);
    box-shadow: var(--hx-shadow-lg);
}

.mk-cta-panel::before {
    content: '';
    position: absolute;
    top: -140px;
    right: -100px;
    width: 400px;
    height: 400px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    pointer-events: none;
}

.mk-cta-panel > * { position: relative; }

.theme-studio .mk-cta-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.1rem);
    color: var(--hx-dark-text);
}

.theme-studio .mk-cta-sub {
    margin: 0 0 1.5rem;
    font-size: 17px;
    line-height: 1.6;
    color: var(--hx-dark-muted);
}

.theme-studio .mk-cta-panel .btn-validate {
    background: var(--hx-cream);
    border-color: var(--hx-cream);
    color: var(--hx-on-cream);
    box-shadow: var(--hx-shadow-md);
}

.theme-studio .mk-cta-panel .btn-validate:hover {
    background: var(--hx-cream-hover);
    border-color: var(--hx-cream-hover);
    color: var(--hx-on-cream);
}

/* ── Footer ─────────────────────────────────────────────── */
/* Room for the home page's closing panel to overlap the footer */
.page-home .mk-footer { padding-top: calc(3.5rem + 4.5rem); }

.theme-studio .mk-footer-col-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--hx-cream);
}

.theme-studio .mk-footer-link { font-size: 14px; font-weight: 400; }
.theme-studio .mk-footer-link:hover { color: var(--hx-cream); }

/* ── Inner pages (pricing, sign in, account, legal): shared banner, cards, forms ── */
.theme-studio .mk-page-banner {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(3rem, 6vw, 4.75rem) 2rem clamp(5rem, 8vw, 7rem);
    background: linear-gradient(135deg, var(--hx-navy-deep) 0%, var(--hx-navy) 55%, var(--hx-teal-deep) 130%);
    color: var(--hx-dark-text);
}

.theme-studio .mk-page-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(var(--hx-dot) 1.2px, transparent 1.4px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse 70% 120% at 85% 40%, #000 10%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 120% at 85% 40%, #000 10%, transparent 75%);
}

.theme-studio .mk-page-banner::after {
    content: '';
    position: absolute;
    top: -160px;
    right: -90px;
    z-index: -1;
    width: 420px;
    height: 420px;
    border: 1px dashed var(--hx-dark-line);
    border-radius: 50%;
}

.theme-studio .mk-page-banner--strip {
    height: clamp(7rem, 12vw, 9rem);
    padding: 0;
}

.theme-studio .mk-page-banner .mk-inner { position: relative; }

.theme-studio .mk-page-title {
    margin: 0 0 0.75rem;
    font-size: clamp(2rem, 4vw, 3.1rem);
    letter-spacing: -0.025em;
    color: var(--hx-dark-text);
}

.theme-studio .mk-page-sub {
    max-width: 560px;
    margin: 0;
    font-size: 17px;
    line-height: 1.65;
    color: var(--hx-dark-muted);
}

/* Content that rides up over the banner's bottom edge */
.theme-studio .mk-page--overlap {
    position: relative;
    z-index: 1;
    margin-top: calc(-1 * clamp(2.5rem, 5vw, 4rem));
}

/* Buttons that sit on light surfaces */
.theme-studio .btn-export {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--heading);
}

.theme-studio .btn-export:hover {
    background: var(--accent-soft);
    border-color: var(--hx-purple);
    color: var(--heading);
}

/* Cards */
.theme-studio .tool-card,
.theme-studio .plan-card {
    border: 1px solid var(--border);
    border-radius: var(--hx-radius);
    background: var(--hx-card-bg);
    box-shadow: var(--hx-shadow-md);
}

.theme-studio .plan-card { padding: 2.5rem 2rem 2.25rem; max-width: 380px; }

.theme-studio .plan-card--featured {
    border: 2px solid var(--hx-purple);
    box-shadow: var(--hx-shadow-feat);
}

.theme-studio .plan-tag {
    top: -14px;
    padding: 6px 16px;
    border-radius: 999px;
    background: var(--hx-purple);
    color: var(--hx-on-purple);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
}

.theme-studio .plan-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.theme-studio .plan-price {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.theme-studio .plan-period,
.theme-studio .plan-desc,
.theme-studio .plan-features li { font-weight: 400; }

.theme-studio .plan-features li { font-size: 15px; }

.theme-studio .account-card { padding: 28px 30px; }

.theme-studio .account-section-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--heading);
}

.theme-studio .account-field-value { font-weight: 500; }

/* Sign in / create account */
.theme-studio .auth-shell {
    position: relative;
    z-index: 1;
    width: calc(100% - 2.5rem);
    max-width: 480px;
    margin: calc(-1 * clamp(3.5rem, 6vw, 4.5rem)) auto 5rem;
    padding: 2.5rem 2.25rem;
    background: var(--hx-card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--hx-shadow-lg);
}

.theme-studio .auth-title {
    font-size: clamp(1.7rem, 3.4vw, 2.1rem);
    letter-spacing: -0.025em;
}

.theme-studio .auth-sub { font-size: 15px; font-weight: 400; }

.theme-studio .tab-btn {
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.theme-studio .tab-btn.active {
    color: var(--heading);
    border-bottom-color: var(--hx-purple);
}

.theme-studio .field-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--heading);
}

.theme-studio .form-input {
    padding: 12px 14px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--hx-radius-sm);
    font-size: 15px;
    font-weight: 400;
}

.theme-studio .form-input:focus { border-color: var(--accent); }

.theme-studio .auth-link-btn { font-weight: 600; }

.theme-studio .result-header { border-radius: var(--hx-radius-sm); }

.theme-studio .pw-meter-monitor { border-radius: var(--hx-radius-sm); }

/* Legal documents */
.theme-studio .legal-doc { padding: 3.5rem 2rem 6rem; }

.theme-studio .legal-h2 {
    margin: 2.25rem 0 0.6rem;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--heading);
}

.theme-studio .legal-body-text {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.75;
}

.theme-studio .legal-body-text a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Cookie banner and toasts */
.theme-studio .cookie-btn {
    padding: 10px 20px;
    border-width: 1.5px;
    border-radius: var(--hx-radius-sm);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.theme-studio .cookie-btn-accept {
    background: var(--hx-purple);
    border-color: var(--hx-purple);
    color: var(--hx-on-purple);
}

.theme-studio .cookie-btn-accept:hover { opacity: 1; background: var(--hx-purple-hover); border-color: var(--hx-purple-hover); }

.theme-studio .cookie-btn-decline {
    border-color: var(--border-strong);
    color: var(--heading);
}

.theme-studio .cookie-btn-decline:hover {
    background: var(--accent-soft);
    border-color: var(--hx-purple);
    color: var(--heading);
}

.theme-studio .cookie-policy-link { font-weight: 600; }

.theme-studio .app-toast {
    border-radius: 12px;
    box-shadow: var(--hx-shadow-md);
}

/* ── Showcase ───────────────────────────────────────────── */
.theme-studio .showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.theme-studio .showcase-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 2rem 1.75rem;
    border: 1px solid var(--border);
    border-radius: var(--hx-radius);
    background: var(--hx-card-bg);
    box-shadow: var(--hx-shadow-md);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.theme-studio .showcase-card:hover,
.theme-studio .showcase-card:focus-visible {
    transform: translateY(-6px);
    border-color: var(--hx-purple);
    box-shadow: var(--hx-shadow-lg);
    color: var(--text);
}

.theme-studio .showcase-card-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--heading);
}

.theme-studio .showcase-card-desc {
    flex: 1;
    margin: 0;
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-muted);
}

.theme-studio .showcase-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 0.5rem;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

.theme-studio .showcase-empty {
    max-width: 520px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--hx-radius);
    background: var(--hx-card-bg);
    box-shadow: var(--hx-shadow-md);
    color: var(--text-muted);
}

/* ── Home: responsive ───────────────────────────────────── */
@media (max-width: 900px) {
    .mk-hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .mk-hero-visual { width: min(100%, 420px); margin: 0 auto; }

    .theme-studio .mk-value-grid,
    .theme-studio .mk-service-grid { grid-template-columns: 1fr; }

    .theme-studio .mk-section--services .mk-section-head { grid-template-columns: 1fr; }

    .mk-cta-panel { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .theme-studio .mk-page-banner { padding-left: 1.25rem; padding-right: 1.25rem; }
    .theme-studio .legal-doc { padding-left: 1.25rem; padding-right: 1.25rem; }
    .theme-studio .auth-shell { padding: 2rem 1.5rem; }
    .theme-studio .mk-hero { padding-left: 1.25rem; padding-right: 1.25rem; }
    .theme-studio .mk-section { padding-left: 1.25rem; padding-right: 1.25rem; }
    .theme-studio .mk-cta { padding-left: 1.25rem; padding-right: 1.25rem; }

    .mk-cta-panel { margin-bottom: -3.5rem; }
    .page-home .mk-footer { padding-top: calc(3.5rem + 3.5rem); }

    .theme-studio .mk-hero-actions .btn-action { flex: 1 1 100%; }
}

@media (max-width: 600px) {
    .theme-studio .mk-band-row { gap: 0.6rem 1.5rem; padding: 1.25rem 1.25rem; }
    .theme-studio .mk-band-sep { display: none; }
    .theme-studio .mk-band-item { font-size: 13px; white-space: normal; text-align: center; }

    .mk-hero-visual { display: none; }
    .mk-stats { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .theme-studio .mk-hero-title { font-size: 2.15rem; }
}

/* Reduced motion: no travelling hovers; hero shown immediately */
@media (prefers-reduced-motion: reduce) {
    .js .mk-hero [data-hero] { opacity: 1; animation: none; }

    .theme-studio .btn-action,
    .theme-studio .btn-action::after,
    .theme-studio .mk-value-card,
    .theme-studio .mk-value-icon,
    .theme-studio .mk-service-card,
    .theme-studio .mk-service-card::before,
    .theme-studio .mk-service-icon,
    .theme-studio .mk-service-more::after,
    .theme-studio .mk-nav-link::after { transition: none; }

    .theme-studio .btn-action:hover,
    .theme-studio .btn-action:hover::after,
    .theme-studio .mk-value-card:hover,
    .theme-studio .mk-value-card:hover .mk-value-icon,
    .theme-studio .mk-service-card:hover,
    .theme-studio .mk-service-card:hover .mk-service-icon,
    .theme-studio .mk-service-card:hover .mk-service-more::after { transform: none; }
}

/* Very narrow phones: the logo mark alone, so the menu button stays on screen */
@media (max-width: 379px) {
    .mk-navbar .mk-brand-name { display: none; }
}

/* ============================================================
   Print (Pro results export)
   ============================================================ */
@media print {
    .mk-navbar, .mk-footer, #toastContainer, .cookie-banner,
    .quiz-score-actions, .quiz-info-btn {
        display: none !important;
    }

    .mk-main { animation: none; }

    .quiz-score-summary, .quiz-question-card {
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .quiz-rationale { display: block !important; }
}
