/**
 * Theme-supplied back-to-top button — hide on the MindMap report page so it
 * doesn't compete with the sticky CTA. mindmap-sales.css only loads on pages
 * that include the [dogology_mindmap] shortcode, so these rules don't leak
 * to other pages. If your theme uses a different selector, inspect the button
 * and add it here.
 */
#back-to-top,
.back-to-top,
.scroll-top,
.scroll-to-top,
.scrollup,
#scrollup,
.dt-back-to-top,
.go-top,
.gototop {
    display: none !important;
}

/**
 * MindMap Report — Premium Minimalist (matches /dogology-101/ design system)
 *
 * Tokens, rhythm, and component patterns mirror the 101 landing exactly so the
 * report and the landing read as one product. Source of truth for the system:
 *   ../dogology-commerce/templates/Dogology-Premium-Minimalist-Style.md
 *   ../dogology-commerce/templates/Dogology-Landing-Page-Design-Reference.md
 *
 * Key rules:
 *   - No card shadows at rest. Shadow + translateY(-4px) on hover only.
 *   - Section rhythm = alternating #FAFAFA / #FFFFFF backgrounds, no dividers.
 *   - Brand gradient is reserved for ONE moment per section max.
 *   - Cards: 1px #EEF0F4 border, 20px radius, hover border tints to brand-teal 22%.
 *   - Eyebrows: brand-teal, uppercase, letter-spacing: 3px, 0.78rem 700.
 *   - Body prose: #475569, line-height: 1.75, measure capped ~640px.
 */

/* =====================================================================
 * Shared tokens — applied to every report-flow component so the report
 * shares the 101 landing's grammar. Single source of truth.
 * ===================================================================== */
#dc-mm-sales-section,
#dc-mm-nextstep-after-cards,
#mm-diagnosis-hero,
.mm-utility-footer,
.mm-breakdown,
#mm-sticky-cta {
    --mm-ink: #0F172A;          /* headlines */
    --mm-ink-2: #1E293B;        /* body emphasis */
    --mm-body: #475569;         /* body prose */
    --mm-muted: #64748B;        /* tagline, meta, secondary */
    --mm-line: #EEF0F4;         /* card border at rest */
    --mm-line-hover: rgba(0, 171, 142, 0.22); /* card border on hover */
    --mm-bg-white: #FFFFFF;
    --mm-bg-warm: #FAFAFA;
    --mm-bg-soft: #F1F5F9;
    --mm-brand-teal: #00AB8E;
    --mm-brand-blue: #0076BA;
    --mm-gradient: linear-gradient(135deg, #00AB8E 0%, #0076BA 100%);

    --mm-radius-card: 20px;
    --mm-radius-card-mobile: 18px;
    --mm-radius-pill: 999px;

    --mm-shadow-hover: 0 16px 40px rgba(15, 23, 42, 0.06);
    --mm-shadow-cta: 0 8px 24px rgba(0, 118, 186, 0.18);

    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    color: var(--mm-ink);
    box-sizing: border-box;
}

#dc-mm-sales-section *,
#dc-mm-nextstep-after-cards *,
#mm-diagnosis-hero *,
.mm-utility-footer *,
.mm-breakdown *,
#mm-sticky-cta * {
    box-sizing: border-box;
}

/* =====================================================================
 * Body Section host (#dc-mm-sales-section)
 * Section rhythm: each .dc-mm-section alternates background. No dividers.
 * ===================================================================== */
#dc-mm-sales-section {
    margin: 0 auto;
    max-width: 1100px;
    padding: 0;
}

.dc-mm-section {
    padding: 56px 24px;
    margin: 0;
    background: var(--mm-bg-white);
}

.dc-mm-section + .dc-mm-section {
    border-top: 1px solid transparent; /* no visible divider — bg alt is the rhythm */
}

/* Alternating bg cadence: header(white) → narrative(warm) → traits(white) →
   growth(warm) → everyday(white) → nextstep(warm) */
.dc-mm-body-header { background: var(--mm-bg-white); }
.dc-mm-narrative   { background: var(--mm-bg-warm); }
.dc-mm-traits      { background: var(--mm-bg-white); }
.dc-mm-growth      { background: var(--mm-bg-warm); }
.dc-mm-everyday    { background: var(--mm-bg-white); }
.dc-mm-nextstep    { background: var(--mm-bg-warm); }

@media (max-width: 768px) {
    .dc-mm-section {
        padding: 40px 18px;
    }
}

/* ---- Eyebrow (canonical) ---- */
.dc-mm-eyebrow {
    display: block;
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--mm-brand-teal);
    text-transform: uppercase;
    margin: 0 0 16px;
    line-height: 1;
}

/* Inline gradient phrase — used once per section max (the one allowed
   gradient moment). Pair with plain headline copy. */
.dc-mm-grad-phrase {
    background: var(--mm-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--mm-brand-blue); /* fallback */
}

/* ---- Body section header (archetype identity, post-hero) ---- */
.dc-mm-body-header {
    padding: 64px 24px 24px;
    text-align: center;
}

.dc-mm-body-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    color: var(--mm-brand-teal);
    margin: 0 auto 16px;
}

.dc-mm-body-header-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.dc-mm-body-header-title {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: clamp(1.7rem, 4vw, 2.25rem);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--mm-ink);
    margin: 0 0 4px;
}

.dc-mm-body-header-en {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--mm-muted);
    letter-spacing: 0.02em;
    margin: 0;
}

/* ---- Narrative (editorial prose) ---- */
.dc-mm-prose {
    max-width: 680px;
    margin: 0 auto;
}

.dc-mm-prose p {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.75;
    color: var(--mm-body);
    margin: 0 0 20px;
}

.dc-mm-prose p:last-child { margin-bottom: 0; }

.dc-mm-narrative .dc-mm-eyebrow {
    text-align: center;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Traits list (flat typography, no card boxes) ----
   Items separated by thin dividers, teal dot marker. Sits on the section bg,
   no nested container — section-band is the only wrapping level. */
.dc-mm-traits {
    text-align: center;
}

.dc-mm-traits-list {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 760px;
    text-align: left;
    border-top: 1px solid var(--mm-line);
}

.dc-mm-traits-list li {
    position: relative;
    padding: 20px 0 20px 28px;
    border-bottom: 1px solid var(--mm-line);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--mm-ink-2);
}

.dc-mm-traits-list li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 28px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mm-brand-teal);
}

/* ---- Growth cards (was prescription cards) ---- */
.dc-mm-growth {
    text-align: center;
}

.dc-mm-growth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.dc-mm-growth-card {
    background: var(--mm-bg-white);
    /* Rest-state border carries the concept tint (low-key, low alpha) so the
       card identity reads even without hover. Hover deepens to the full hex. */
    border: 1px solid var(--mm-concept-tint, var(--mm-line));
    border-radius: var(--mm-radius-card);
    padding: 24px 24px;
    text-align: left;
    transition: border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout: icon left (spans 2 rows), title/score stacked right, definition
       spans both columns below. */
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 16px;
    row-gap: 4px;
    align-items: center;
}

.dc-mm-growth-card:hover {
    border-color: var(--mm-concept-color, var(--mm-line-hover));
    box-shadow: var(--mm-shadow-hover);
    transform: translateY(-4px);
}

/* Icon: left column, spans 2 rows (title + score). Color picks up the per-
   mindset hex from the radar palette via --mm-concept-color (set inline by
   renderGrowth in mindmap-sales.js). Falls back to brand-teal. */
.dc-mm-growth-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--mm-concept-tint, rgba(0, 171, 142, 0.08));
    color: var(--mm-concept-color, var(--mm-brand-teal));
    flex-shrink: 0;
    align-self: center;
    transition: background 0.25s ease, color 0.25s ease;
}

.dc-mm-growth-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.dc-mm-growth-card:hover .dc-mm-growth-icon {
    /* hover deepens whatever color the icon is using (brand-teal default or
       per-mindset). Slight bg lift via opacity bump. */
    filter: brightness(0.96) saturate(1.1);
}

.dc-mm-growth-title {
    grid-column: 2;
    grid-row: 1;
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    /* Heading picks up the darkened concept color — high-contrast variant so
       pale radar hues stay readable. Falls back to ink if no concept color. */
    color: var(--mm-concept-color-strong, var(--mm-ink));
    margin: 0;
    align-self: end;
}

.dc-mm-growth-score {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: var(--mm-muted);
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    align-self: start;
}

.dc-mm-growth-score-num {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--mm-ink);
}

.dc-mm-growth-score-max {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Concept definition — sourced from the same description that drives the
   accordion, so growth cards explain WHAT the mindset is, not just the score. */
.dc-mm-growth-def {
    grid-column: 1 / -1;
    grid-row: 3;
    margin: 14px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--mm-line);
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--mm-body);
}

@media (max-width: 768px) {
    .dc-mm-growth-grid { gap: 12px; }
    .dc-mm-growth-card {
        padding: 18px 18px;
        border-radius: var(--mm-radius-card-mobile);
        column-gap: 14px;
    }
    .dc-mm-growth-icon {
        width: 42px;
        height: 42px;
    }
    .dc-mm-growth-icon svg {
        width: 20px;
        height: 20px;
    }
    .dc-mm-growth-title {
        font-size: 1.05rem;
    }
    .dc-mm-growth-score-num {
        font-size: 1.2rem;
    }
    .dc-mm-growth-score-max {
        font-size: 0.78rem;
    }
    .dc-mm-growth-def {
        margin: 12px 0 0;
        padding: 12px 0 0;
        font-size: 0.85rem;
        line-height: 1.55;
    }
}

/* ---- Everyday list ---- */
.dc-mm-everyday {
    text-align: center;
}

.dc-mm-everyday-list {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 760px;
    text-align: left;
    border-top: 1px solid var(--mm-line);
}

.dc-mm-everyday-list li {
    position: relative;
    padding: 20px 0 20px 36px;
    border-bottom: 1px solid var(--mm-line);
    font-size: 0.98rem;
    line-height: 1.65;
    color: var(--mm-body);
}

.dc-mm-everyday-list li::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 28px;
    width: 14px;
    height: 7px;
    border-left: 2px solid var(--mm-brand-teal);
    border-bottom: 2px solid var(--mm-brand-teal);
    transform: rotate(-45deg);
}

/* ---- Next-step card ---- */
.dc-mm-nextstep {
    padding: 64px 24px;
}

.dc-mm-nextstep-card {
    max-width: 720px;
    margin: 0 auto;
    background: var(--mm-bg-white);
    border: 1px solid var(--mm-line);
    border-radius: var(--mm-radius-card);
    padding: 48px 40px;
    text-align: center;
    transition: border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.dc-mm-nextstep-card:hover {
    border-color: var(--mm-line-hover);
    box-shadow: var(--mm-shadow-hover);
}

.dc-mm-nextstep-hook {
    font-size: 1rem;
    color: var(--mm-muted);
    margin: 0 0 12px;
    line-height: 1.6;
}

.dc-mm-nextstep-title {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: clamp(1.5rem, 3.5vw, 1.85rem);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--mm-ink);
    margin: 0 0 28px;
}

.dc-mm-nextstep-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 36px;
    background: var(--mm-gradient);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.01em;
    box-shadow: var(--mm-shadow-cta);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dc-mm-nextstep-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 118, 186, 0.28);
    color: #fff;
}

.dc-mm-nextstep-cta:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .dc-mm-nextstep { padding: 48px 18px; }
    .dc-mm-nextstep-card {
        padding: 40px 28px;
        border-radius: var(--mm-radius-card-mobile);
    }
}

/* =====================================================================
 * Diagnosis Hero (#mm-diagnosis-hero)
 * The "one hero moment" of the page — gradient-border card pattern.
 * ===================================================================== */
.mm-diagnosis-hero {
    margin: 24px auto 0;
    max-width: 1100px;
    padding: 48px 40px;
    /* Gradient border via padding-box + border-box layering — matches the
       101 landing's "card--hero" pattern. White inside, gradient ring outside. */
    background:
        linear-gradient(var(--mm-bg-white), var(--mm-bg-white)) padding-box,
        var(--mm-gradient) border-box;
    border: 1.5px solid transparent;
    border-radius: var(--mm-radius-card);
    position: relative;
    overflow: hidden;

    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
        "text    radar"
        "caption caption"
        "actions actions";
    gap: 24px 40px;
    align-items: center;
}

.mm-dh-text {
    grid-area: text;
    min-width: 0;
}

.mm-dh-eyebrow {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--mm-brand-teal);
    margin: 0 0 16px;
    line-height: 1;
}

.mm-dh-title {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
    background: var(--mm-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--mm-brand-blue); /* fallback */
}

.mm-dh-en {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--mm-muted);
    letter-spacing: 0.02em;
    margin-bottom: 14px;
}

.mm-dh-tagline {
    font-size: clamp(1rem, 2vw, 1.1rem);
    color: var(--mm-ink-2);
    font-weight: 500;
    line-height: 1.55;
    margin: 0 0 12px;
}

.mm-dh-status {
    font-size: 0.85rem;
    color: var(--mm-muted);
    margin: 0;
    min-height: 1em;
}

.mm-dh-radar {
    grid-area: radar;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.mm-dh-radar canvas {
    max-width: 100%;
    height: auto !important;
    display: block;
}

.mm-dh-radar #chart-tooltip {
    position: absolute;
    pointer-events: none;
    max-width: min(320px, calc(100% - 16px));
    box-sizing: border-box;
    z-index: 3;
}

@media (max-width: 640px) {
    .mm-dh-radar #chart-tooltip {
        max-width: min(260px, calc(100% - 16px));
    }
}

/* ---- Mobile mindset detail panel ----
   Below the radar; replaces the floating tooltip on small screens where the
   tooltip can't fit cleanly without overlapping wedges. Hidden on desktop. */
.mm-radar-detail {
    display: none;
}

@media (max-width: 768px) {
    /* Float-tooltip off, panel on */
    .mm-dh-radar #chart-tooltip {
        display: none !important;
    }

    /* Mindset detail panel — concept-colored accents (border, icon, title)
       set inline via --mm-concept-color-strong / --mm-concept-tint. */
    .mm-radar-detail {
        grid-area: detail;
        display: block;
        position: relative;
        background: var(--mm-bg-white);
        border: 1px solid var(--mm-concept-color-strong, var(--mm-line));
        border-radius: 14px;
        padding: 18px 18px 16px;
        text-align: left;
    }

    /* Empty state shows a soft "tap the chart" hint instead of hiding the panel.
       Smaller font, muted color, neutral border — reads as guidance, not a card. */
    .mm-radar-detail.is-empty {
        background: transparent;
        border: 1px dashed var(--mm-line);
        padding: 14px 18px;
    }

    .mm-radar-detail-hint {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        justify-content: center;
        color: var(--mm-muted);
        font-size: 0.82rem;
        line-height: 1.4;
        font-weight: 500;
    }

    .mm-radar-detail-hint svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        opacity: 0.85;
    }

    /* Header: icon (left, spans 3 rows) + 3-row stack on the right —
       English (eyebrow), Thai name, score. */
    .mm-radar-detail-head {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 14px;
        row-gap: 2px;
        align-items: center;
        padding-right: 32px; /* space for the close button */
        padding-bottom: 12px;
        border-bottom: 1px solid var(--mm-concept-tint, var(--mm-line));
    }

    .mm-radar-detail-icon {
        grid-column: 1;
        grid-row: 1 / span 3;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: var(--mm-concept-tint, rgba(0, 171, 142, 0.08));
        color: var(--mm-concept-color-strong, var(--mm-brand-teal));
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .mm-radar-detail-icon svg {
        width: 26px;
        height: 26px;
        display: block;
    }

    .mm-radar-detail-en {
        grid-column: 2;
        grid-row: 1;
        align-self: end;
        font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 2px;
        text-transform: uppercase;
        color: var(--mm-concept-color-strong, var(--mm-brand-teal));
        line-height: 1;
    }

    .mm-radar-detail-thai {
        grid-column: 2;
        grid-row: 2;
        align-self: center;
        font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
        font-size: 0.95rem;
        font-weight: 600;
        letter-spacing: -0.005em;
        color: var(--mm-muted);
        line-height: 1.25;
    }

    .mm-radar-detail-score {
        grid-column: 2;
        grid-row: 3;
        align-self: start;
        font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--mm-ink);
        line-height: 1;
    }

    .mm-radar-detail-score-max {
        font-size: 0.78rem;
        font-weight: 500;
        color: var(--mm-muted);
        margin-left: 2px;
    }

    /* Body description — explicit normal weight, comfortable line height. */
    .mm-radar-detail-body {
        margin: 12px 0 0;
        font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
        font-size: 0.9rem;
        font-weight: 400;
        line-height: 1.65;
        color: var(--mm-body);
    }

    /* Close button — top-right of the panel. */
    .mm-radar-detail-close {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        background: transparent;
        border: 0;
        color: var(--mm-muted);
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border-radius: 50%;
        transition: background 0.2s ease, color 0.2s ease;
        z-index: 1;
    }

    .mm-radar-detail-close:hover,
    .mm-radar-detail-close:active {
        background: rgba(15, 23, 42, 0.06);
        color: var(--mm-ink);
    }

    .mm-radar-detail-close svg {
        width: 18px;
        height: 18px;
    }
}

/* ---- Concept icon overlay (replaces in-canvas text labels) ----
   Absolute-positioned icons over the radar canvas. Coords are percent-based
   so the overlay scales with the canvas's CSS-driven width. Each icon takes
   the per-mindset color from the radar palette via inline style. */
.mm-radar-icon-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

/* Tinted chips: darkened icon on lightened (tinted) bg of the same hue.
   Mirrors the detail-box icon recipe — soft, premium-minimal feel that matches
   the radar wedges without overwhelming the rim. */
.mm-radar-icon {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--mm-concept-tint, rgba(0, 171, 142, 0.14));
    border: 0;
    color: var(--mm-concept-color-strong, var(--mm-muted));
    box-shadow: none;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

/* Spotlight: when something is selected, fade non-active chips to neutral. */
.mm-radar-icon-overlay.has-active .mm-radar-icon:not(.is-active) {
    background: rgba(15, 23, 42, 0.06);
    color: var(--mm-muted);
}

.mm-radar-icon.is-active {
    transform: translate(-50%, -50%) scale(1.18);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    z-index: 3;
}

.mm-radar-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

@media (max-width: 768px) {
    .mm-radar-icon {
        width: 26px;
        height: 26px;
    }
    .mm-radar-icon svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 380px) {
    .mm-radar-icon {
        width: 22px;
        height: 22px;
    }
    .mm-radar-icon svg {
        width: 12px;
        height: 12px;
    }
}


/* Archetype icon — 96px badge at radar center, gradient-border circle.
   pointer-events: none so radar interactions still reach the canvas. */
.mm-dh-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 96px;
    height: 96px;
    border-radius: 50%;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--mm-brand-blue);
    background:
        linear-gradient(var(--mm-bg-white), var(--mm-bg-white)) padding-box,
        var(--mm-gradient) border-box;
    border: 2px solid transparent;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease 0.2s;
    text-align: center;
    line-height: 1;
    opacity: 0;
}

.mm-dh-icon[data-archetype] { opacity: 1; }

/* When a mindset wedge is selected, the center badge swaps its brand gradient
   border for a solid concept color, and the inner bg picks up a lightened
   (tinted) wash of the same hue. The tint is rgba so we layer it OVER an
   opaque white fill — that way the canvas wedges behind don't bleed through
   even at the badge edges, and we still get the soft tinted look. */
.mm-dh-icon.is-mindset-active {
    background:
        linear-gradient(var(--mm-concept-tint, rgba(0, 171, 142, 0.14)), var(--mm-concept-tint, rgba(0, 171, 142, 0.14))) padding-box,
        linear-gradient(var(--mm-bg-white), var(--mm-bg-white)) padding-box,
        var(--mm-concept-color-strong, var(--mm-brand-blue)) border-box;
    color: var(--mm-concept-color-strong, var(--mm-brand-blue));
    transition: background 0.25s ease, color 0.25s ease, opacity 0.3s ease 0.2s;
}

.mm-dh-icon.is-mindset-active .mm-dh-icon-label {
    color: var(--mm-concept-color-strong, var(--mm-ink));
}

.mm-dh-icon-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.mm-dh-icon-glyph svg {
    width: 100%;
    height: 100%;
    display: block;
}

.mm-dh-icon-label {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--mm-ink);
    line-height: 1.15;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mm-dh-caption {
    grid-area: caption;
    font-size: 0.85rem;
    color: var(--mm-muted);
    text-align: center;
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid var(--mm-line);
    line-height: 1.6;
}

.mm-dh-actions {
    grid-area: actions;
    display: flex;
    gap: 12px;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
}

.mm-dh-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.2s ease,
                border-color 0.2s ease,
                color 0.2s ease;
    min-height: 48px;
    line-height: 1.2;
    white-space: nowrap;
}

.mm-dh-cta-ghost {
    background: var(--mm-bg-white);
    border-color: var(--mm-line);
    color: var(--mm-ink);
}

.mm-dh-cta-ghost:hover {
    border-color: var(--mm-line-hover);
    color: var(--mm-brand-teal);
}

.mm-dh-cta-primary {
    background: var(--mm-gradient);
    color: #fff;
    box-shadow: var(--mm-shadow-cta);
}

.mm-dh-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 118, 186, 0.28);
    color: #fff;
}

.mm-dh-cta-primary:active {
    transform: translateY(0);
}

#dogology-mindmap-container.liff-share-enabled .mm-dh-cta.liff-only {
    display: inline-flex !important;
}

/* Responsive icon scaling — radar shrinks on narrow viewports, badge follows */
@media (max-width: 640px) {
    .mm-dh-icon {
        width: 80px;
        height: 80px;
        padding: 8px 10px;
    }
    .mm-dh-icon-glyph { width: 28px; height: 28px; }
    .mm-dh-icon-label { font-size: 11px; }
}

@media (max-width: 380px) {
    .mm-dh-icon {
        width: 64px;
        height: 64px;
        padding: 14px;
        gap: 0;
    }
    .mm-dh-icon-glyph { width: 28px; height: 28px; }
    .mm-dh-icon-label { display: none; }
}

@media (max-width: 768px) {
    .mm-diagnosis-hero {
        grid-template-columns: 1fr;
        grid-template-areas:
            "text"
            "radar"
            "caption"
            "detail"
            "actions";
        padding: 36px 24px;
        gap: 20px;
        margin: 16px auto 0;
        border-radius: var(--mm-radius-card-mobile);
    }
    .mm-dh-text { text-align: center; }
    .mm-dh-actions { flex-direction: column; gap: 8px; }
    .mm-dh-cta { width: 100%; }
}

/* Capture-only footer (QR + logo) — hidden on screen, revealed by html2canvas onclone */
.mm-dh-capture-footer {
    display: none;
    grid-area: caption;
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px dashed var(--mm-line);
}

.mm-dh-capture-footer[data-capture="on"] {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--mm-line);
    margin-top: 14px;
    flex-wrap: wrap;
}

.mm-dh-cf-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.mm-dh-cf-item h6 {
    font-size: 10px;
    font-weight: 500;
    color: var(--mm-muted);
    margin: 0;
    letter-spacing: 0.02em;
}

.mm-dh-cf-item .qr-code {
    width: 72px;
    height: 72px;
    display: block;
}

.mm-dh-cf-item .footer-logo {
    height: 36px;
    width: auto;
    display: block;
}

.mm-dh-cf-item-course h6 {
    color: var(--mm-brand-teal);
    font-weight: 700;
}

/* =====================================================================
 * 16-mindset breakdown — always expanded (no accordion). Header sits as
 * a normal section header above the always-visible cards.
 * ===================================================================== */
.mm-breakdown {
    display: block;
    padding: 64px 24px 56px;
    background: var(--mm-bg-white);
    text-align: center;
}

.mm-breakdown-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 0 auto 8px;
    max-width: 720px;
}

.mm-breakdown-eyebrow {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--mm-brand-teal);
    text-transform: uppercase;
    line-height: 1;
    margin: 0;
}

.mm-breakdown-title {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: clamp(1.5rem, 3.5vw, 1.85rem);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--mm-ink);
    margin: 0;
}

/* Body container — full width within the section, content max-width centered */
.mm-breakdown #results-container {
    padding: 0;
    margin: 48px auto 0;
    max-width: 1100px;
    border: none;
    background: transparent;
    border-radius: 0;
    display: grid;
    gap: 56px;
    text-align: left;
}

/* ---- Mindset group ---- */
.mm-mindset-group {
    display: grid;
    gap: 18px;
}

.mm-mindset-group-header {
    text-align: center;
    margin: 0 0 4px;
}

.mm-mindset-group-title {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.005em;
    color: var(--mm-ink);
    margin: 0;
    line-height: 1.4;
}

.mm-mindset-group-en {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--mm-brand-teal);
    margin: 4px 0 0;
    line-height: 1;
}

.mm-mindset-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 10px;
    align-items: start; /* expanded card grows independently, doesn't drag siblings tall */
}

@media (max-width: 768px) {
    .mm-mindset-group-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Mindset card (always-expanded) ----
   Body always visible. Border at rest carries a low-key concept tint;
   hover deepens to the full color. */
.mm-mindset-card {
    background: var(--mm-bg-white);
    border: 1px solid var(--mm-concept-tint, var(--mm-line));
    border-radius: 14px;
    overflow: hidden;
    /* Slower border-color transition (0.7s) so the scroll-triggered in-view
       highlight reads as an intentional reveal, not a snap. Shadow stays snappy. */
    transition: border-color 0.7s ease, box-shadow 0.25s ease;
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    animation: none;
    box-shadow: none;
}

.mm-mindset-card:hover,
.mm-mindset-card.is-in-view {
    border-color: var(--mm-concept-color, var(--mm-line-hover));
}

.mm-mindset-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1.2fr) minmax(120px, 1.6fr);
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    min-height: 56px;
}

/* Concept icon — left landmark for the row. Small (28px), bare (no tinted bg)
   so it doesn't compete with the bar/score for visual weight. Per-mindset color
   from --mm-concept-color (set inline by renderResultCards in mindmap.js,
   matched to the radar palette); falls back to brand-teal. is-strong cards
   override to muted gray below to keep the tonal hierarchy. */
.mm-mindset-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--mm-concept-color, var(--mm-brand-teal));
    flex-shrink: 0;
}

.mm-mindset-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.mm-mindset-summary-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mm-mindset-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--mm-ink);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mm-mindset-en {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--mm-muted);
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mm-mindset-card .result-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.mm-mindset-card .result-bar-bg {
    flex: 1;
    height: 4px;
    background: #F1F5F9;
    border-radius: var(--mm-radius-pill);
    overflow: hidden;
    min-width: 60px;
}

.mm-mindset-card .result-bar-fill {
    height: 100%;
    border-radius: var(--mm-radius-pill);
    transition: width 1s ease-in-out;
    background: var(--mm-gradient);
}

/* Subtle tonal differences only — premium minimalism doesn't shout. */
.mm-mindset-card .result-bar-fill.high   { background: linear-gradient(90deg, #34D399 0%, #10B981 100%); }
.mm-mindset-card .result-bar-fill.medium { background: linear-gradient(90deg, #FBBF24 0%, #F59E0B 100%); }
.mm-mindset-card .result-bar-fill.low    { background: linear-gradient(90deg, #FB7185 0%, #F43F5E 100%); }

.mm-mindset-card .result-score {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--mm-ink);
    text-align: right;
    line-height: 1;
    min-width: 56px;
}

.mm-mindset-card .result-score-max {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--mm-muted);
}

/* ---- Tonal hierarchy: pull eye toward weak scores ----
   Strong scores recede so weak ones stand out. Reader scans the accordion
   and naturally lands on what matters. */
.mm-mindset-card.is-strong .mm-mindset-name,
.mm-mindset-card.is-strong .result-score {
    color: var(--mm-muted);
}

.mm-mindset-card.is-strong .result-score-max {
    color: var(--mm-muted);
    opacity: 0.7;
}

.mm-mindset-card.is-strong .mm-mindset-en {
    opacity: 0.7;
}

/* is-strong cards keep their concept color on the icon (matches the radar
   wedge) — text mutes via the rules above, but the icon stays as the row's
   color landmark. */

.mm-mindset-card.is-weak .mm-mindset-name {
    color: var(--mm-ink);
    font-weight: 700;
}

/* ---- Expanded body ---- */
.mm-mindset-body {
    padding: 4px 20px 20px;
    border-top: 1px solid var(--mm-line);
    margin-top: 4px;
}

.mm-mindset-card .result-description {
    color: var(--mm-body);
    font-size: 0.92rem;
    line-height: 1.7;
    margin: 16px 0;
    text-align: left;
}

/* ---- Suggestion (action-card framing) ----
   No box, no warm-gray bg, no border-left bar. Body + links align flush to
   the suggestion's left edge (matching the description above). Icon sits
   inline with the "ลองทำ" eyebrow rather than indenting the whole block. */
.mm-mindset-card .mm-suggestion {
    margin-top: 4px;
    padding: 0;
    background: transparent;
    border: none;
    text-align: left;
}

.mm-mindset-card .mm-suggestion-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    line-height: 1;
}

.mm-mindset-card .mm-suggestion-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--mm-concept-tint, rgba(0, 171, 142, 0.08));
    color: var(--mm-concept-color, var(--mm-brand-teal));
    flex-shrink: 0;
}

.mm-mindset-card .mm-suggestion-icon svg {
    width: 12px;
    height: 12px;
}

.mm-mindset-card .mm-suggestion-eyebrow-text {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    /* Darkened variant for text legibility (pale radar hues need contrast). */
    color: var(--mm-concept-color-strong, var(--mm-brand-teal));
    letter-spacing: 2.5px;
    text-transform: uppercase;
    line-height: 1;
}

.mm-mindset-card .mm-suggestion-body {
    color: var(--mm-ink-2);
    font-size: 0.92rem;
    line-height: 1.7;
    margin: 0;
}

.mm-mindset-card .mm-suggestion-body strong {
    color: var(--mm-ink);
    font-weight: 600;
}

/* Chip-style links — extracted from body so they read as a real button, not a
   throwaway inline link. Sit below the body text, can wrap if multiple. */
.mm-mindset-card .mm-suggestion-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.mm-mindset-card .mm-suggestion-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--mm-bg-white);
    border: 1px solid var(--mm-line);
    border-radius: var(--mm-radius-pill);
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    /* Strong variant for text legibility — pale radar hues need contrast */
    color: var(--mm-concept-color-strong, var(--mm-brand-blue));
    text-decoration: none;
    line-height: 1;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.mm-mindset-card .mm-suggestion-link:hover {
    border-color: var(--mm-concept-color, var(--mm-line-hover));
    background: var(--mm-concept-tint, rgba(0, 171, 142, 0.04));
}

.mm-mindset-card .mm-suggestion-link span {
    transition: transform 0.2s ease;
}

.mm-mindset-card .mm-suggestion-link:hover span {
    transform: translateX(2px);
}

@media (max-width: 768px) {
    .mm-breakdown { padding: 48px 18px 40px; }
    .mm-breakdown #results-container {
        margin-top: 32px;
        gap: 40px;
    }
    .mm-mindset-summary {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: auto auto;
        column-gap: 12px;
        row-gap: 10px;
        padding: 14px 16px;
    }
    .mm-mindset-icon {
        grid-column: 1;
        grid-row: 1;
    }
    .mm-mindset-summary-text {
        grid-column: 2;
        grid-row: 1;
    }
    .mm-mindset-card .result-bar-container {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    .mm-mindset-body { padding: 4px 16px 18px; }
}

/* =====================================================================
 * Utility footer — ghost buttons, used both at top (after hero) and bottom
 * ===================================================================== */
.mm-utility-footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Top utility footer sits between the hero card and the body section. Needs
   breathing room on both sides so the buttons don't feel stranded. */
.mm-utility-footer-top {
    padding: 32px 24px 40px;
}

@media (max-width: 768px) {
    .mm-utility-footer-top {
        padding: 28px 18px 32px;
    }
}

.mm-uf-btn {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid var(--mm-line);
    color: var(--mm-ink);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    line-height: 1;
}

.mm-uf-btn:hover {
    border-color: var(--mm-line-hover);
    color: var(--mm-brand-teal);
}

.mm-uf-btn-ghost { background: transparent; }
.mm-uf-btn-icon { padding: 10px; width: 40px; }
.mm-uf-btn-icon svg { display: block; color: currentColor; }

#dogology-mindmap-container.liff-share-enabled .mm-uf-btn.liff-only {
    display: inline-flex !important;
}

/* =====================================================================
 * Sticky mobile CTA — gradient fill (one of the allowed gradient moments).
 * No price, no archetype-specific pressure copy.
 * ===================================================================== */
#mm-sticky-cta { display: none; }
#mm-sticky-cta[hidden] { display: none !important; }

@media (max-width: 768px) {
    #mm-sticky-cta {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 50;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid var(--mm-line);
        /* Hidden until the hero CTA scrolls out of view. JS adds .is-revealed
           via IntersectionObserver. Slides up when revealed. */
        transform: translateY(110%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.25s ease;
    }

    #mm-sticky-cta.is-revealed {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    #mm-sticky-cta-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 14px 18px;
        background: var(--mm-gradient);
        border-radius: 12px;
        color: #fff;
        text-decoration: none;
        font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
        font-size: 0.95rem;
        font-weight: 600;
        box-shadow: var(--mm-shadow-cta);
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    #mm-sticky-cta-btn:active {
        transform: translateY(1px);
        box-shadow: 0 4px 12px rgba(0, 118, 186, 0.18);
    }

    .mm-sticky-cta-label {
        flex: 1;
        min-width: 0;
        text-align: center;
    }

    /* Page-bottom padding so sticky doesn't cover the bottom utility footer */
    #results-screen { padding-bottom: 96px; }
}

/* =====================================================================
 * Reduced motion
 * ===================================================================== */
@media (prefers-reduced-motion: reduce) {
    #dc-mm-sales-section *,
    #mm-diagnosis-hero *,
    .mm-utility-footer *,
    .mm-breakdown *,
    #mm-sticky-cta * {
        transition: none !important;
        animation: none !important;
    }
}
