@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #a8b4c7;
    --accent: #3b82f6;
    --link-color: #fde68a;
    --link-hover: #fbbf24;
    --link-decoration: rgba(253, 230, 138, 0.65);
    --correct: #22c55e;
    --incorrect: #ef4444;
    --hover: #334155;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

body.large-text {
    font-size: 112.5%;
}

body.theme-light {
    --bg-dark: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --hover: #e2e8f0;
    --link-color: #854d0e;
    --link-hover: #713f12;
    --link-decoration: rgba(133, 77, 14, 0.5);
    background-color: var(--bg-dark);
}

/* Give unstyled text links a deliberate, high-contrast treatment instead of
   the browser's default blue. Component links can still provide their own color. */
a {
    color: var(--link-color);
    text-decoration-color: var(--link-decoration);
    text-decoration-thickness: 0.1em;
    text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
    color: var(--link-hover);
    text-decoration-color: currentColor;
}

body.theme-light header,
body.theme-light .settings-menu,
body.theme-light .menu-section,
body.theme-light .seo-panel,
body.theme-light .content-page,
body.theme-light .result-card,
body.theme-light .stats-mini {
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

body.theme-light .seo-panel,
body.theme-light .content-page,
body.theme-light .stats-mini {
    background: rgba(255, 255, 255, 0.86);
}

body.theme-light .setting-toggle,
body.theme-light .menu-btn,
body.theme-light .option,
body.theme-light .seo-grid article,
body.theme-light .content-proof-grid div,
body.theme-light .sample-question,
body.theme-light .result-breakdown .row,
body.theme-light .explanation {
    background: #f1f5f9;
}

body.theme-light .subtitle {
    color: #dbeafe;
}

.app-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.site-header {
    position: relative;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 16px;
    background: rgba(30, 41, 59, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
}

.site-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    color: var(--text-main);
    font-size: 0.96rem;
    font-weight: 800;
    text-decoration: none;
}

.site-brand-link img {
    display: block;
    border-radius: 8px;
}

.primary-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.primary-nav a {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
    color: var(--text-main);
}

.app-toolbar {
    position: relative;
    z-index: 50;
    flex: 0 0 auto;
}

.settings-button {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
    font-size: 1.25rem;
    line-height: 1;
    text-align: center;
}

.settings-button:hover {
    background: var(--hover);
    transform: translateY(-1px);
}

.settings-menu {
    position: absolute;
    top: 52px;
    right: 0;
    width: min(290px, calc(100vw - 24px));
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: var(--card-bg);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 12px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.36);
}

.settings-menu.open {
    display: flex;
}

.screen {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: screenEnter 0.35s ease-out both;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.badge {
    background: var(--accent);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

#mode-text {
    font-style: italic;
    color: var(--accent);
    font-weight: 600;
}

.card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

h1 {
    font-size: 1.6rem;
    line-height: 1.4;
    margin-bottom: 30px;
    color: #ffffff;
}

#options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* The Option Button styling */
.option {
    position: relative;
    background: var(--bg-dark);
    color: var(--text-main);
    animation: optionFadeIn 0.22s ease-out both;
    transition: transform 0.12s ease, background 0.12s ease;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    text-align: left;
    z-index: 1; /* Establish stacking context */
}

.option:hover:not(.disabled) {
    background: var(--hover);
    transform: translateY(-2px);
}

.option.disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.option.selected {
    background: var(--bg-dark);
    border-color: transparent;
}

/* --- THE SVG SNAKE TRACER (Seamless Loop) --- */
.tracer-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    border-radius: 12px;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tracer-svg rect {
    fill: none;
    stroke: var(--correct);
    stroke-width: 4px;
    stroke-dasharray: 20 80; /* 20% line, 80% gap */
    stroke-dashoffset: 0;
    /* Optional: drop shadow on the SVG stroke to make it glow */
    filter: drop-shadow(0 0 4px var(--correct));
}

.option.selected .tracer-svg {
    opacity: 1;
}

.option.selected .tracer-svg rect {
    animation: snake 2.5s linear infinite;
}

/* Because pathLength="100", stroke-dashoffset of -100 is exactly one full lap */
@keyframes snake {
    to { stroke-dashoffset: -100; }
}
/* Submitting States */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.error-shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

.option.correct-reveal {
    background: rgba(34, 197, 94, 0.1) !important;
    border-color: var(--correct) !important;
    color: var(--correct) !important;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}
.option.correct-reveal .tracer-svg {
    display: none; /* Turn off tracer on submit */
}

.option.wrong-reveal {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: var(--incorrect) !important;
    color: var(--incorrect) !important;
}
.option.wrong-reveal .tracer-svg {
    display: none; /* Turn off tracer on submit */
}

/* Feedback Area */
#feedback-area {
    margin-top: 20px;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 800;
    animation: fadeIn 0.3s ease;
}

.feedback-correct {
    background: rgba(34, 197, 94, 0.15);
    color: var(--correct);
    border: 1px solid var(--correct);
}

.feedback-wrong {
    background: rgba(239, 68, 68, 0.15);
    color: var(--incorrect);
    border: 1px solid var(--incorrect);
}

.hidden {
    display: none !important;
}

/* Buttons */
.controls {
    display: flex;
    justify-content: flex-end;
}

button {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

#btn-submit {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

#btn-submit:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-2px);
}

#btn-submit:disabled {
    background: var(--hover);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

#btn-next {
    background: white;
    color: var(--bg-dark);
}

#btn-next:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

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

@keyframes flipOut {
    0%   { transform: perspective(1200px) rotateY(0deg)   scale(1);    }
    100% { transform: perspective(1200px) rotateY(90deg)  scale(0.96); }
}

@keyframes flipIn {
    0%   { transform: perspective(1200px) rotateY(-90deg) scale(0.96); }
    100% { transform: perspective(1200px) rotateY(0deg)   scale(1);    }
}

.card.flip-out {
    animation: flipOut 0.18s ease-in forwards;
}

.card.flip-in {
    animation: flipIn 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

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

@keyframes gradePop {
    0%   { opacity: 0; transform: scale(0.35); }
    65%  { opacity: 1; transform: scale(1.12); }
    100% { opacity: 1; transform: scale(1); }
}

.controls button {
    transition: transform 0.1s ease;
}
.controls button:active:not(:disabled) {
    transform: scale(0.97);
}

/* === BOOM EXPLOSION === */

/* 1. Violent Screen Shake */
@keyframes screen-shake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-8px, -4px); }
    20% { transform: translate(6px, 5px); }
    30% { transform: translate(-5px, 3px); }
    40% { transform: translate(7px, -6px); }
    50% { transform: translate(-3px, 4px); }
    60% { transform: translate(5px, -2px); }
    70% { transform: translate(-6px, 5px); }
    80% { transform: translate(4px, -3px); }
    90% { transform: translate(-2px, 6px); }
}

.screen-shake {
    animation: screen-shake 0.5s ease-in-out;
}

/* 2. The BOOM container overlays the entire screen */
.boom-container {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 9999;
}

/* 3. Radial Flash - bright orange flash that fades instantly */
.boom-flash {
    position: absolute;
    width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.6) 0%, transparent 70%);
    animation: flash-out 0.6s ease-out forwards;
}

@keyframes flash-out {
    0% { opacity: 1; transform: scale(0.5); }
    100% { opacity: 0; transform: scale(2); }
}

/* 4. Spark / Ember Particles */
.spark {
    position: fixed;
    top: 50%; left: 50%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    opacity: 1;
}

@keyframes spark-fly {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0);
        opacity: 0;
    }
}

/* ====================================================== */
/* ============== MENU SCREEN ============================= */
/* ====================================================== */

.menu-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-content: center;
    gap: 18px;
    text-align: left;
    padding: 28px 20px 18px;
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background:
        radial-gradient(circle at 18% 20%, rgba(34, 197, 94, 0.18), transparent 26%),
        linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(30, 41, 59, 0.44) 55%, rgba(15, 23, 42, 0.72));
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.hero-icon {
    width: 118px;
    height: 118px;
    display: block;
    border-radius: 22px;
    object-fit: cover;
    box-shadow: 0 18px 34px rgba(2, 6, 23, 0.42), 0 0 28px rgba(14, 165, 233, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.brand-copy {
    min-width: 0;
}

.brand-kicker {
    width: fit-content;
    margin-bottom: 8px;
    padding: 5px 9px;
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.24);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.logo {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.6rem);
    letter-spacing: 0;
    margin: 0;
    line-height: 0.95;
    color: var(--text-main);
    text-wrap: balance;
}

.subtitle {
    max-width: 520px;
    color: #cbd5e1;
    font-weight: 600;
    margin-top: 12px;
    letter-spacing: 0;
    line-height: 1.45;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

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

}

.menu-section {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-toggle {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-dark);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 700;
}

.setting-toggle input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

.menu-section h2 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
    font-weight: 800;
}

.menu-btn {
    color: var(--text-main);
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    text-align: left;
    transition: transform 0.14s ease, background 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Inter', sans-serif;
}

.menu-btn[data-mode] {
    --mode-color: #3b82f6;
    --mode-rgb: 59, 130, 246;
    --loop-angle: 0deg;
    position: relative;
    isolation: isolate;
    background:
        linear-gradient(var(--bg-dark), var(--bg-dark)) padding-box,
        conic-gradient(from var(--loop-angle),
            rgba(var(--mode-rgb), 0.30) 0deg,
            rgba(var(--mode-rgb), 0.42) 210deg,
            var(--mode-color) 260deg,
            rgba(255, 255, 255, 0.96) 288deg,
            var(--mode-color) 318deg,
            rgba(var(--mode-rgb), 0.30) 360deg) border-box;
    box-shadow:
        inset 0 0 18px rgba(var(--mode-rgb), 0.055),
        0 0 12px rgba(var(--mode-rgb), 0.15);
    animation: mode-border-loop 5.2s linear infinite;
}

.menu-section .menu-btn[data-mode]:nth-of-type(2) {
    animation-delay: -1.04s;
}

.menu-section .menu-btn[data-mode]:nth-of-type(3) {
    animation-delay: -2.08s;
}

.menu-section .menu-btn[data-mode]:nth-of-type(4) {
    animation-delay: -3.12s;
}

.menu-section .menu-btn[data-mode]:nth-of-type(5) {
    animation-delay: -4.16s;
}

.menu-btn[data-mode]:hover:not(:disabled),
.menu-btn[data-mode]:focus-visible,
.menu-btn[data-mode].is-launching {
    background:
        linear-gradient(rgba(var(--mode-rgb), 0.14), rgba(var(--mode-rgb), 0.08)) padding-box,
        linear-gradient(var(--bg-dark), var(--bg-dark)) padding-box,
        conic-gradient(from var(--loop-angle),
            rgba(var(--mode-rgb), 0.28) 0deg,
            rgba(var(--mode-rgb), 0.42) 205deg,
            var(--mode-color) 268deg,
            #ffffff 296deg,
            var(--mode-color) 322deg,
            rgba(var(--mode-rgb), 0.28) 360deg) border-box;
    box-shadow:
        inset 0 0 22px rgba(var(--mode-rgb), 0.10),
        0 0 14px rgba(var(--mode-rgb), 0.34),
        0 0 32px rgba(var(--mode-rgb), 0.16);
    animation: mode-border-loop 1.05s linear infinite;
}

.menu-btn[data-mode]:hover:not(:disabled),
.menu-btn[data-mode]:focus-visible {
    transform: translateY(-2px) scale(1.008);
}

.menu-btn[data-mode]:focus-visible {
    outline: 2px solid var(--text-main);
    outline-offset: 3px;
}

.menu-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.menu-btn:active:not(:disabled) {
    transform: scale(0.97) !important;
    transition: transform 0.08s ease;
}

.menu-btn.exam {
    --mode-color: #3b82f6;
    --mode-rgb: 59, 130, 246;
}

.menu-btn.study {
    --mode-color: #22c55e;
    --mode-rgb: 34, 197, 94;
}

.menu-btn.smart {
    --mode-color: #ec4899;
    --mode-rgb: 236, 72, 153;
}

.menu-btn.review {
    --mode-color: #f97316;
    --mode-rgb: 249, 115, 22;
}

.menu-btn.drill {
    --mode-color: #a855f7;
    --mode-rgb: 168, 85, 247;
}

.menu-btn.pt-practice {
    --mode-color: #0ea5e9;
    --mode-rgb: 14, 165, 233;
}

.menu-btn.diagnostic {
    --mode-color: #eab308;
    --mode-rgb: 234, 179, 8;
}

.menu-btn[data-mode].is-launching {
    z-index: 2;
    animation:
        mode-border-loop 0.42s linear infinite,
        mode-launch-flash 0.24s ease-out both;
}

@property --loop-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes mode-border-loop {
    to { --loop-angle: 360deg; }
}

@keyframes mode-launch-flash {
    45% {
        transform: scale(0.975);
        filter: brightness(1.1);
    }
    100% {
        transform: scale(1.018);
        filter: brightness(1.2);
        box-shadow:
            inset 0 0 28px rgba(var(--mode-rgb), 0.16),
            0 0 0 5px rgba(var(--mode-rgb), 0.12),
            0 0 38px rgba(var(--mode-rgb), 0.46),
            0 0 66px rgba(var(--mode-rgb), 0.20);
    }
}

.diagnostic-rec {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.4);
    border-radius: 8px;
    color: #fef08a;
    font-size: 0.9rem;
    text-align: center;
}

.menu-btn .hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 8px;
}

.stats-mini {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 12px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 10px;
}

.menu-footer {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.menu-btn.small {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 0.85rem;
    border-color: var(--text-muted);
    color: var(--text-muted);
    background: transparent;
}

.menu-btn.small:hover {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-main);
}

.seo-panel,
.content-page {
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 24px;
}

.seo-panel h2,
.content-page h1 {
    margin-bottom: 14px;
}

.seo-panel h2 {
    font-size: 1.25rem;
}

.seo-panel p,
.content-page p,
.content-page li {
    color: var(--text-muted);
    line-height: 1.65;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 18px 0;
}

.seo-grid article {
    background: rgba(15, 23, 42, 0.75);
    border-radius: 10px;
    padding: 14px;
}

.seo-grid h3,
.content-page h2 {
    color: var(--text-main);
    margin-bottom: 8px;
}

.seo-grid h3 {
    font-size: 1rem;
}

.disclaimer,
.muted-note {
    font-size: 0.92rem;
}

.seo-links {
    margin: 8px 0 4px 20px;
    line-height: 1.7;
}

.seo-links li {
    margin-bottom: 6px;
}

.certification-callout {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.08);
}

.certification-callout h3 {
    margin-bottom: 8px;
    color: var(--text-main);
}

.certification-callout p {
    margin-bottom: 12px;
}

.certification-link {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 9px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.certification-link:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.certification-callout .provider-disclosure {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.content-proof-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 18px 0 22px;
}

.content-proof-grid div {
    padding: 14px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 10px;
}

.content-proof-grid strong,
.content-proof-grid span {
    display: block;
}

.content-proof-grid strong {
    margin-bottom: 4px;
    color: var(--text-main);
    font-size: 1.1rem;
}

.content-proof-grid span {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.page-container {
    max-width: 820px;
}

.content-page {
    margin-top: 20px;
}

.content-page h1 {
    font-size: 2rem;
}

.content-page h2 {
    font-size: 1.2rem;
    margin-top: 24px;
}

.content-page h3 {
    color: var(--text-main);
    font-size: 1.05rem;
    margin-top: 18px;
    margin-bottom: 6px;
}

.content-page .byline {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: -6px;
    margin-bottom: 18px;
}

/* Highlight a regulation section when linked to directly */
.content-page h2[id] {
    scroll-margin-top: 16px;
}

.content-page h2:target {
    background: rgba(59, 130, 246, 0.18);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 8px 12px;
    margin-left: -12px;
}

.content-page ul {
    margin-left: 22px;
}

.sample-question {
    margin: 16px 0;
    padding: 18px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
}

.sample-question h3 {
    margin-top: 0;
}

.choice-list {
    margin: 12px 0 12px 26px;
}

.choice-list li {
    margin-bottom: 7px;
    padding-left: 4px;
}

.sample-question details {
    margin-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    padding-top: 12px;
}

.sample-question summary {
    color: var(--accent);
    cursor: pointer;
    font-weight: 800;
}

.sample-question details p {
    margin-top: 12px;
}

.content-page a,
.site-footer a,
.back-link {
    color: var(--text-main);
}

.back-link {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--link-color);
    font-weight: 700;
    text-decoration: none;
}

.site-footer {
    padding: 18px 0 8px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.85rem;
}

.ad-slot {
    width: 100%;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-slot .adsbygoogle {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
}

.ad-slot-top-outer {
    position: relative;
    padding-top: 90px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px 12px 0 0;
}

.ad-slot-top-wrap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.ad-slot-result {
    margin: 12px 0;
    min-height: 60px;
}

.ad-slot-result .adsbygoogle {
    min-height: 60px;
}

.site-footer nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 10px;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--text-main);
}

@media (max-width: 768px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-toolbar {
        position: absolute;
        top: 8px;
        right: 8px;
    }

    .primary-nav {
        justify-content: flex-start;
    }

    .seo-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-proof-grid {
        grid-template-columns: 1fr;
    }
}

/* ====================================================== */
/* ============== SEARCH GROWTH SPRINT =================== */
/* ====================================================== */

.hero-primary-cta {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 18px;
    padding: 14px 20px;
    overflow: hidden;
    border: 1px solid rgba(147, 197, 253, 0.65);
    border-radius: 13px;
    color: #ffffff;
    background: linear-gradient(120deg, #2563eb, #7c3aed 52%, #0891b2);
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.36), 0 0 34px rgba(124, 58, 237, 0.18);
    font-weight: 850;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hero-primary-cta::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -120% 45% -120% -25%;
    transform: rotate(18deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    animation: cta-shimmer 4.8s ease-in-out infinite;
}

.hero-primary-cta:hover,
.hero-primary-cta:focus-visible {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 18px 42px rgba(37, 99, 235, 0.46), 0 0 44px rgba(124, 58, 237, 0.25);
}

.hero-primary-cta small {
    color: #dbeafe;
    font-size: 0.72rem;
    font-weight: 650;
}

@keyframes cta-shimmer {
    0%, 58% { transform: translateX(-170%) rotate(18deg); }
    82%, 100% { transform: translateX(390%) rotate(18deg); }
}

.trust-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 13px;
    background: rgba(56, 189, 248, 0.18);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.24);
}

.trust-strip span {
    padding: 12px 14px;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.86);
    text-align: center;
    font-size: 0.82rem;
    font-weight: 650;
}

.trust-strip strong {
    color: #7dd3fc;
}

.new-here-path,
.practice-directory {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border-radius: 17px;
    border: 1px solid rgba(168, 85, 247, 0.24);
    background:
        radial-gradient(circle at 94% 5%, rgba(168, 85, 247, 0.20), transparent 28%),
        linear-gradient(145deg, rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.82));
    box-shadow: 0 20px 46px rgba(2, 6, 23, 0.28);
}

.new-here-path {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 1fr);
    gap: 18px 24px;
    align-items: center;
}

.section-kicker {
    margin-bottom: 7px;
    color: #c4b5fd;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 1.35px;
    text-transform: uppercase;
}

.path-copy h2,
.practice-directory h2 {
    margin-bottom: 8px;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    text-wrap: balance;
}

.path-copy p:last-child,
.directory-note {
    color: var(--text-muted);
    line-height: 1.55;
}

.path-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    list-style: none;
}

.path-steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #dbeafe;
    font-size: 0.78rem;
    font-weight: 750;
}

.path-steps span {
    display: grid;
    flex: 0 0 auto;
    width: 25px;
    height: 25px;
    place-items: center;
    border: 1px solid rgba(196, 181, 253, 0.42);
    border-radius: 50%;
    color: #ffffff;
    background: rgba(124, 58, 237, 0.36);
}

@property --gold-prism-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.path-cta,
.page-quiz-cta {
    --gold-prism-angle: 0deg;
    position: relative;
    isolation: isolate;
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    padding: 12px 17px;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 10px;
    color: #1c1917;
    background:
        linear-gradient(135deg, #fde047, #f59e0b) padding-box,
        conic-gradient(
            from var(--gold-prism-angle),
            #fffbe6,
            #facc15,
            #fff3a3,
            #f59e0b,
            #fde047,
            #fff8c5,
            #d97706,
            #fde68a,
            #fffbe6
        ) border-box;
    box-shadow:
        0 10px 26px rgba(245, 158, 11, 0.28),
        0 0 18px rgba(250, 204, 21, 0.16);
    font-weight: 850;
    text-decoration: none;
    animation: gold-prism-orbit 5.2s linear infinite;
    transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.path-cta::before,
.page-quiz-cta::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: -65% -110%;
    pointer-events: none;
    background: linear-gradient(
        112deg,
        transparent 38%,
        rgba(251, 191, 36, 0.26) 43%,
        rgba(255, 243, 163, 0.54) 47%,
        rgba(255, 255, 255, 0.84) 52%,
        rgba(253, 224, 71, 0.48) 57%,
        rgba(245, 158, 11, 0.3) 61%,
        transparent 65%
    );
    mix-blend-mode: screen;
    transform: translateX(-34%) rotate(7deg);
    animation: gold-prism-sweep 4.4s ease-in-out infinite;
}

.path-cta {
    grid-column: 1 / -1;
}

.path-cta:hover,
.path-cta:focus-visible,
.page-quiz-cta:hover,
.page-quiz-cta:focus-visible {
    color: #1c1917;
    transform: translateY(-3px) scale(1.018);
    filter: brightness(1.08) saturate(1.08);
    box-shadow:
        0 14px 32px rgba(245, 158, 11, 0.38),
        0 0 26px rgba(250, 204, 21, 0.3),
        0 0 10px rgba(255, 248, 197, 0.22);
    animation-duration: 1.25s;
}

.path-cta:hover::before,
.path-cta:focus-visible::before,
.page-quiz-cta:hover::before,
.page-quiz-cta:focus-visible::before {
    animation-duration: 1.35s;
}

.path-cta:active,
.page-quiz-cta:active {
    transform: translateY(0) scale(0.985);
}

@keyframes gold-prism-orbit {
    to { --gold-prism-angle: 360deg; }
}

@keyframes gold-prism-sweep {
    0%, 18% { transform: translateX(-34%) rotate(7deg); opacity: 0.45; }
    52% { opacity: 0.95; }
    82%, 100% { transform: translateX(34%) rotate(7deg); opacity: 0.45; }
}

.practice-directory {
    border-color: rgba(14, 165, 233, 0.24);
    background:
        radial-gradient(circle at 6% 4%, rgba(14, 165, 233, 0.18), transparent 26%),
        linear-gradient(145deg, rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.82));
}

.practice-directory-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.practice-directory-grid > a {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    min-width: 0;
    padding: 15px;
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 13px;
    color: var(--text-main);
    background: rgba(15, 23, 42, 0.72);
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.practice-directory-grid > a:hover,
.practice-directory-grid > a:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.7);
    box-shadow: 0 12px 26px rgba(14, 165, 233, 0.18);
}

.practice-directory-grid strong,
.practice-directory-grid small {
    display: block;
}

.practice-directory-grid small {
    margin-top: 4px;
    color: var(--text-muted);
    line-height: 1.35;
}

.practice-card-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    color: white;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 7px 18px rgba(37, 99, 235, 0.3);
    font-weight: 900;
}

.practice-card-icon.core-icon {
    background: linear-gradient(135deg, #059669, #0ea5e9);
}

.practice-card-icon.type1-icon {
    background: linear-gradient(135deg, #db2777, #22c55e);
}

.practice-card-icon.type2-icon {
    background: linear-gradient(135deg, #2563eb, #f59e0b);
}

.practice-card-icon.type3-icon {
    background: linear-gradient(135deg, #7c3aed, #0ea5e9);
}

.directory-note {
    margin-top: 14px;
    font-size: 0.86rem;
}

.directory-note a {
    color: var(--link-color);
}

.mode-grid-heading {
    margin: 2px 0 -8px;
    color: var(--text-main);
    font-size: 1.02rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 18px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.breadcrumb a {
    color: var(--link-color);
    text-decoration: none;
}

.breadcrumb span[aria-hidden="true"] {
    color: #64748b;
}

.landing-hero {
    position: relative;
    overflow: hidden;
    margin: -2px -2px 24px;
    padding: 26px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 16px;
    background:
        radial-gradient(circle at 92% 8%, rgba(124, 58, 237, 0.23), transparent 28%),
        radial-gradient(circle at 12% 96%, rgba(14, 165, 233, 0.16), transparent 32%),
        rgba(15, 23, 42, 0.78);
}

.landing-hero.core-landing {
    background:
        radial-gradient(circle at 92% 8%, rgba(34, 197, 94, 0.20), transparent 28%),
        radial-gradient(circle at 12% 96%, rgba(14, 165, 233, 0.17), transparent 32%),
        rgba(15, 23, 42, 0.78);
}

.landing-eyebrow {
    margin-bottom: 9px;
    color: #7dd3fc;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.landing-hero h1 {
    max-width: 720px;
    margin-bottom: 12px;
    font-size: clamp(1.9rem, 5vw, 3rem);
    line-height: 1.05;
    text-wrap: balance;
}

.landing-hero > p:not(.landing-eyebrow):not(.byline) {
    max-width: 690px;
    color: #cbd5e1;
    font-size: 1.02rem;
    line-height: 1.65;
}

.landing-hero .byline {
    margin: 16px 0 0;
}

.page-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
}

.page-cta-secondary {
    padding: 11px 14px;
    color: var(--link-color);
    font-weight: 750;
    text-decoration-color: var(--link-decoration);
}

.topic-grid,
.guide-card-grid,
.mistake-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0 22px;
}

.topic-card,
.guide-card,
.mistake-card {
    padding: 17px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 13px;
    background: rgba(15, 23, 42, 0.68);
}

.topic-card strong,
.guide-card h2,
.mistake-card strong {
    color: var(--text-main);
}

.topic-card p,
.guide-card p,
.mistake-card p {
    margin-top: 6px;
    color: var(--text-muted);
    line-height: 1.55;
}

.guide-card {
    position: relative;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.guide-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(#38bdf8, #8b5cf6);
}

.guide-card:hover,
.guide-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.55);
}

.guide-card h2 {
    margin: 0;
    font-size: 1.12rem;
}

.guide-card .guide-arrow {
    display: inline-block;
    margin-top: 10px;
    color: var(--link-color);
    font-weight: 850;
}

.study-order {
    counter-reset: study-step;
    display: grid;
    gap: 11px;
    margin: 16px 0 24px;
    list-style: none;
}

.study-order li {
    counter-increment: study-step;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.58);
}

.study-order li::before {
    content: counter(study-step);
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 10px;
    color: white;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    font-weight: 900;
}

.study-order strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-main);
}

.study-order span {
    color: var(--text-muted);
    line-height: 1.5;
}

.source-box,
.independent-note {
    margin: 22px 0;
    padding: 17px;
    border: 1px solid rgba(34, 197, 94, 0.28);
    border-radius: 13px;
    background: rgba(34, 197, 94, 0.07);
}

.source-box h2,
.independent-note h2 {
    margin-top: 0;
}

.source-box a {
    color: #86efac;
}

.current-rules-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 22px;
}

.current-rules-grid a {
    padding: 13px 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 11px;
    color: var(--text-main);
    background: rgba(15, 23, 42, 0.6);
    font-weight: 750;
    text-decoration: none;
}

.current-rules-grid a:hover {
    border-color: rgba(56, 189, 248, 0.55);
}

.full-width-cta {
    display: grid;
    justify-items: start;
    gap: 10px;
    margin-top: 25px;
    padding: 20px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 15px;
    background:
        radial-gradient(circle at 95% 20%, rgba(245, 158, 11, 0.18), transparent 30%),
        rgba(15, 23, 42, 0.7);
}

.full-width-cta h2 {
    margin: 0;
}

.comparison-table {
    width: 100%;
    margin: 16px 0 22px;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 12px;
}

.comparison-table th,
.comparison-table td {
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: var(--text-muted);
    text-align: left;
    vertical-align: top;
}

.comparison-table th {
    color: var(--text-main);
    background: rgba(59, 130, 246, 0.14);
}

.comparison-table td {
    background: rgba(15, 23, 42, 0.56);
}

body.theme-light .trust-strip span,
body.theme-light .new-here-path,
body.theme-light .practice-directory,
body.theme-light .practice-directory-grid > a,
body.theme-light .landing-hero,
body.theme-light .topic-card,
body.theme-light .guide-card,
body.theme-light .mistake-card,
body.theme-light .study-order li,
body.theme-light .current-rules-grid a,
body.theme-light .full-width-cta,
body.theme-light .comparison-table td {
    background: #f1f5f9;
}

body.theme-light .landing-hero > p:not(.landing-eyebrow):not(.byline),
body.theme-light .path-steps li {
    color: #334155;
}

@media (max-width: 700px) {
    .trust-strip,
    .practice-directory-grid,
    .topic-grid,
    .guide-card-grid,
    .mistake-grid,
    .current-rules-grid {
        grid-template-columns: 1fr;
    }

    .new-here-path {
        grid-template-columns: 1fr;
    }

    .path-cta {
        grid-column: auto;
        width: 100%;
    }

    .hero-primary-cta {
        align-items: center;
        width: 100%;
        text-align: center;
    }

    .landing-hero {
        padding: 20px 17px;
    }

    .comparison-table {
        display: block;
        overflow-x: auto;
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-primary-cta::after {
        animation: none;
    }

    .menu-btn[data-mode],
    .menu-btn[data-mode]:hover:not(:disabled),
    .menu-btn[data-mode]:focus-visible,
    .menu-btn[data-mode].is-launching {
        animation: none;
    }

    .path-cta,
    .page-quiz-cta,
    .path-cta::before,
    .page-quiz-cta::before {
        animation: none;
    }
}

/* =====================================================
   RECOVERY LEVELS REFERENCE + SECTION LANDING ACCENTS
   ===================================================== */
.landing-hero.type-i-landing {
    background:
        radial-gradient(circle at 92% 8%, rgba(236, 72, 153, 0.23), transparent 28%),
        radial-gradient(circle at 12% 96%, rgba(34, 197, 94, 0.17), transparent 32%),
        rgba(15, 23, 42, 0.78);
}

.landing-hero.type-ii-landing {
    background:
        radial-gradient(circle at 92% 8%, rgba(59, 130, 246, 0.25), transparent 28%),
        radial-gradient(circle at 12% 96%, rgba(245, 158, 11, 0.18), transparent 32%),
        rgba(15, 23, 42, 0.78);
}

.landing-hero.type-iii-landing {
    background:
        radial-gradient(circle at 92% 8%, rgba(139, 92, 246, 0.26), transparent 28%),
        radial-gradient(circle at 12% 96%, rgba(14, 165, 233, 0.18), transparent 32%),
        rgba(15, 23, 42, 0.78);
}

.landing-hero.reference-landing {
    border-color: rgba(245, 158, 11, 0.34);
    background:
        radial-gradient(circle at 90% 8%, rgba(245, 158, 11, 0.27), transparent 28%),
        radial-gradient(circle at 9% 95%, rgba(14, 165, 233, 0.2), transparent 34%),
        rgba(15, 23, 42, 0.8);
}

.reference-actions button {
    font: inherit;
    cursor: pointer;
}

.reference-actions .page-cta-secondary {
    border: 1px solid rgba(253, 230, 138, 0.46);
    border-radius: 10px;
    color: #fde68a;
    background: rgba(15, 23, 42, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.reference-actions .page-cta-secondary:hover,
.reference-actions .page-cta-secondary:focus-visible {
    color: #fef3c7;
    border-color: #fbbf24;
    background: rgba(30, 41, 59, 0.9);
}

.share-status {
    min-height: 1.2em;
    color: #86efac;
    font-size: 0.82rem;
    font-weight: 750;
}

.reference-caution {
    margin: 0 0 24px;
    padding: 16px 18px;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.08);
}

.reference-caution strong {
    color: #fde68a;
}

.reference-caution p {
    margin: 5px 0 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.level-finder {
    position: relative;
    overflow: hidden;
    margin: 22px 0 28px;
    padding: 22px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 17px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.85)),
        rgba(15, 23, 42, 0.88);
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.25);
}

.level-finder::before {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    right: -85px;
    top: -90px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.14);
    filter: blur(12px);
}

.finder-heading,
.finder-controls,
.finder-result {
    position: relative;
    z-index: 1;
}

.finder-heading h2 {
    margin: 2px 0 16px;
}

.finder-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.finder-controls label {
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 800;
}

.finder-controls select {
    width: 100%;
    margin-top: 7px;
    padding: 12px 38px 12px 12px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 10px;
    color: var(--text-main);
    background: #111c30;
    font: inherit;
}

.finder-controls select:focus-visible {
    outline: 3px solid rgba(56, 189, 248, 0.42);
    outline-offset: 2px;
}

.finder-result {
    display: grid;
    gap: 4px;
    margin-top: 15px;
    padding: 18px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 13px;
    background: rgba(34, 197, 94, 0.08);
}

.finder-result.result-pulse {
    animation: reference-result-pulse 0.46s ease-out;
}

.result-label {
    color: #86efac;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}

.finder-result strong {
    color: #f8fafc;
    font-size: clamp(1.35rem, 4vw, 2.15rem);
}

.finder-result p {
    margin: 3px 0 0;
    color: #cbd5e1;
}

.table-scroll {
    margin-bottom: 22px;
    overflow-x: auto;
    border-radius: 12px;
}

.table-scroll .comparison-table {
    min-width: 650px;
    margin: 0;
}

.evacuation-table strong {
    color: #fef3c7;
}

.type-one-rule-lab {
    position: relative;
    overflow: hidden;
    margin: 28px 0;
    padding: clamp(20px, 4vw, 30px);
    border: 1px solid transparent;
    border-radius: 22px;
    background:
        radial-gradient(circle at 8% 4%, rgba(236, 72, 153, 0.13), transparent 30%) padding-box,
        radial-gradient(circle at 94% 92%, rgba(34, 197, 94, 0.12), transparent 31%) padding-box,
        linear-gradient(145deg, rgba(20, 30, 50, 0.97), rgba(10, 18, 34, 0.96)) padding-box,
        linear-gradient(110deg, #ec4899, #fbbf24 34%, #22c55e 64%, #38bdf8, #ec4899) border-box;
    background-size: 100% 100%, 100% 100%, 100% 100%, 240% 100%;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.09),
        0 24px 58px rgba(2, 6, 23, 0.38),
        0 0 42px rgba(245, 158, 11, 0.07);
    animation: rule-border-drift 8s linear infinite;
    scroll-margin-top: 18px;
}

.type-one-rule-lab::after {
    content: "";
    position: absolute;
    z-index: 0;
    width: 220px;
    height: 220px;
    top: -150px;
    left: 35%;
    border-radius: 50%;
    background: rgba(251, 191, 36, 0.11);
    filter: blur(10px);
    animation: rule-orbit-glow 9s ease-in-out infinite alternate;
    pointer-events: none;
}

.rule-lab-heading,
.rule-lab-intro,
.rule-decision-track,
.rule-outcome,
.rule-memory-strip {
    position: relative;
    z-index: 1;
}

.rule-lab-heading {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
}

.rule-lab-heading h2 {
    margin: 3px 0 8px;
    font-size: clamp(1.45rem, 4vw, 2.15rem);
}

.rule-live-badge {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 7px;
    align-items: center;
    margin-top: 3px;
    padding: 7px 10px;
    border: 1px solid rgba(134, 239, 172, 0.28);
    border-radius: 999px;
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.08);
    font-size: 0.69rem;
    font-weight: 900;
    letter-spacing: 0.75px;
    text-transform: uppercase;
}

.rule-live-badge i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.11), 0 0 14px #22c55e;
    animation: rule-live-pulse 1.8s ease-in-out infinite;
}

.rule-lab-intro {
    max-width: 760px;
    margin: 0 0 20px;
    color: #cbd5e1;
}

.rule-decision-track {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
}

.rule-question {
    min-width: 0;
    margin: 0;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 34%),
        rgba(15, 23, 42, 0.7);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
    transition: opacity 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.rule-question legend {
    display: flex;
    gap: 9px;
    align-items: center;
    max-width: calc(100% - 8px);
    padding: 0 4px;
    color: #f8fafc;
    font-weight: 850;
    line-height: 1.35;
}

.rule-question legend span {
    display: inline-grid;
    flex: 0 0 27px;
    width: 27px;
    height: 27px;
    place-items: center;
    border: 1px solid rgba(253, 230, 138, 0.55);
    border-radius: 50%;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.1);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.14);
    font-size: 0.75rem;
}

.rule-question:disabled {
    opacity: 0.48;
}

.rule-choice-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 12px;
}

.rule-choice-row button {
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid rgba(251, 191, 36, 0.34);
    border-radius: 11px;
    color: #fef3c7;
    background:
        linear-gradient(110deg, rgba(255, 255, 255, 0.055), transparent 42%),
        rgba(245, 158, 11, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 820;
    line-height: 1.3;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.rule-choice-row button:hover,
.rule-choice-row button:focus-visible {
    transform: translateY(-2px);
    border-color: #fbbf24;
    color: #fff;
    background: rgba(245, 158, 11, 0.15);
    box-shadow: 0 0 22px rgba(245, 158, 11, 0.12);
}

.rule-choice-row button:focus-visible {
    outline: 3px solid rgba(56, 189, 248, 0.38);
    outline-offset: 2px;
}

.rule-choice-row button[aria-pressed="true"] {
    border-color: #fbbf24;
    color: #fff7d6;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(251, 191, 36, 0.09));
    box-shadow: inset 0 0 0 1px rgba(253, 230, 138, 0.12), 0 0 24px rgba(245, 158, 11, 0.17);
}

.rule-choice-row button[data-rule-compressor="working"][aria-pressed="true"] {
    border-color: #4ade80;
    background: rgba(34, 197, 94, 0.15);
    box-shadow: 0 0 24px rgba(34, 197, 94, 0.16);
}

.rule-choice-row button[data-rule-compressor="failed"][aria-pressed="true"] {
    border-color: #f472b6;
    background: rgba(236, 72, 153, 0.14);
    box-shadow: 0 0 24px rgba(236, 72, 153, 0.15);
}

.rule-question-note {
    min-height: 1.2em;
    margin: 10px 0 0;
    color: #94a3b8;
    font-size: 0.73rem;
}

.rule-flow-arrow {
    position: relative;
    display: grid;
    place-items: center;
}

.rule-flow-arrow span {
    position: relative;
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.18), #fbbf24, rgba(56, 189, 248, 0.22));
    box-shadow: 0 0 11px rgba(251, 191, 36, 0.2);
}

.rule-flow-arrow span::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -2px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fde68a;
    box-shadow: 0 0 12px #f59e0b;
    transform: translateY(-50%);
    animation: rule-signal 2.5s ease-in-out infinite;
}

.rule-decision-track[data-rule-state="pre"] .rule-question-era {
    border-color: rgba(244, 114, 182, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 26px rgba(236, 72, 153, 0.08);
}

.rule-decision-track[data-rule-state="post"] .rule-question-compressor,
.rule-decision-track[data-rule-state="complete"] .rule-question-compressor {
    opacity: 1;
    border-color: rgba(56, 189, 248, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 26px rgba(56, 189, 248, 0.08);
}

.rule-outcome {
    display: grid;
    grid-template-columns: minmax(110px, 0.3fr) minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    margin-top: 16px;
    padding: 18px 20px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 17px;
    background: rgba(15, 23, 42, 0.67);
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.rule-outcome-number {
    display: grid;
    min-height: 86px;
    place-content: center;
    text-align: center;
    border-right: 1px solid rgba(148, 163, 184, 0.17);
}

.rule-outcome-number span {
    color: #94a3b8;
    font-size: clamp(2.6rem, 8vw, 4.7rem);
    font-weight: 950;
    line-height: 0.9;
    letter-spacing: -3px;
    text-shadow: 0 0 30px currentColor;
}

.rule-outcome-number small {
    margin-top: 8px;
    color: #94a3b8;
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.rule-outcome-copy {
    display: grid;
    gap: 4px;
}

.rule-outcome-copy strong {
    color: #f8fafc;
    font-size: clamp(1rem, 2.5vw, 1.35rem);
}

.rule-outcome-copy p {
    margin: 0;
    color: #cbd5e1;
}

.rule-outcome[data-outcome="80"] {
    border-color: rgba(244, 114, 182, 0.5);
    background: linear-gradient(100deg, rgba(236, 72, 153, 0.13), rgba(15, 23, 42, 0.7) 58%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 0 32px rgba(236, 72, 153, 0.1);
}

.rule-outcome[data-outcome="80"] .rule-outcome-number span { color: #f9a8d4; }
.rule-outcome[data-outcome="80"] .result-label { color: #f9a8d4; }

.rule-outcome[data-outcome="90"] {
    border-color: rgba(74, 222, 128, 0.5);
    background: linear-gradient(100deg, rgba(34, 197, 94, 0.13), rgba(15, 23, 42, 0.7) 58%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 0 32px rgba(34, 197, 94, 0.11);
}

.rule-outcome[data-outcome="90"] .rule-outcome-number span { color: #86efac; }
.rule-outcome[data-outcome="90"] .result-label { color: #86efac; }

.rule-outcome.rule-result-pop {
    animation: rule-result-pop 0.52s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rule-memory-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 12px;
}

.rule-memory-strip > div {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 7px;
    align-items: center;
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 11px;
    background: rgba(15, 23, 42, 0.48);
}

.rule-memory-strip strong {
    color: #f8fafc;
    font-size: 0.82rem;
}

.rule-memory-strip small {
    color: #94a3b8;
    font-size: 0.66rem;
    line-height: 1.25;
}

.memory-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    box-shadow: 0 0 11px currentColor;
}

.memory-dot-pink { color: #f472b6; background: currentColor; }
.memory-dot-green { color: #4ade80; background: currentColor; }
.memory-dot-gold { color: #fbbf24; background: currentColor; }

@keyframes rule-border-drift {
    to { background-position: 0 0, 0 0, 0 0, 240% 0; }
}

@keyframes rule-orbit-glow {
    to { transform: translate(210px, 110px) scale(1.2); }
}

@keyframes rule-live-pulse {
    50% { opacity: 0.48; transform: scale(0.82); }
}

@keyframes rule-signal {
    0%, 10% { left: -2px; opacity: 0; }
    30% { opacity: 1; }
    80% { opacity: 1; }
    100% { left: calc(100% - 5px); opacity: 0; }
}

@keyframes rule-result-pop {
    0% { transform: translateY(5px) scale(0.985); }
    55% { transform: translateY(-2px) scale(1.006); }
}

@keyframes reference-result-pulse {
    0% { transform: scale(0.985); box-shadow: 0 0 0 rgba(34, 197, 94, 0); }
    55% { transform: scale(1.006); box-shadow: 0 0 28px rgba(34, 197, 94, 0.16); }
}

@media (max-width: 640px) {
    .finder-controls {
        grid-template-columns: 1fr;
    }

    .type-one-rule-lab {
        padding: 18px 14px;
        border-radius: 18px;
    }

    .rule-lab-heading {
        display: block;
    }

    .rule-live-badge {
        margin: 0 0 14px;
    }

    .rule-decision-track {
        grid-template-columns: 1fr;
    }

    .rule-flow-arrow {
        min-height: 34px;
    }

    .rule-flow-arrow span {
        width: 2px;
        height: 100%;
        background: linear-gradient(180deg, rgba(251, 191, 36, 0.18), #fbbf24, rgba(56, 189, 248, 0.22));
    }

    .rule-flow-arrow span::after {
        top: -2px;
        left: 50%;
        transform: translateX(-50%);
        animation: rule-signal-mobile 2.5s ease-in-out infinite;
    }

    .rule-choice-row {
        grid-template-columns: 1fr;
    }

    .rule-outcome {
        grid-template-columns: 90px minmax(0, 1fr);
        gap: 13px;
        padding: 15px 13px;
    }

    .rule-outcome-number {
        min-height: 78px;
    }

    .rule-outcome-number span {
        font-size: 3rem;
    }

    .rule-memory-strip {
        grid-template-columns: 1fr;
    }

    .rule-memory-strip > div {
        grid-template-columns: auto 58px 1fr;
    }
}

@keyframes rule-signal-mobile {
    0%, 10% { top: -2px; opacity: 0; }
    30% { opacity: 1; }
    80% { opacity: 1; }
    100% { top: calc(100% - 5px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .finder-result.result-pulse,
    .type-one-rule-lab,
    .type-one-rule-lab::after,
    .rule-live-badge i,
    .rule-flow-arrow span::after,
    .rule-outcome.rule-result-pop {
        animation: none;
    }
}

@media print {
    body {
        display: block;
        padding: 0;
        color: #111827;
        background: white;
    }

    .app-container,
    .content-page,
    .landing-hero,
    .level-finder,
    .type-one-rule-lab,
    .rule-memory-strip > div,
    .topic-card,
    .mistake-card,
    .source-box,
    .reference-caution {
        color: #111827;
        background: white !important;
        box-shadow: none !important;
    }

    .site-header,
    .site-footer,
    .breadcrumb,
    .reference-actions,
    .practice-reference-links,
    .finder-controls,
    .rule-decision-track,
    .rule-outcome,
    .rule-live-badge {
        display: none !important;
    }

    .content-page {
        border: 0;
        padding: 0;
    }

    .content-page p,
    .content-page li,
    .finder-result p,
    .topic-card p,
    .mistake-card p,
    .rule-memory-strip small,
    .comparison-table th,
    .comparison-table td {
        color: #334155 !important;
    }

    .landing-hero,
    .level-finder {
        padding: 12px 0;
        border: 0;
    }

    .finder-result {
        border-color: #94a3b8;
        background: white;
    }

    .finder-result strong,
    .topic-card strong,
    .mistake-card strong,
    .rule-memory-strip strong,
    .content-page h1,
    .content-page h2,
    .content-page h3 {
        color: #111827 !important;
    }

    .table-scroll .comparison-table {
        min-width: 0;
    }
}

/* =====================================================
   INTERACTIVE CONDENSING-UNIT COMPONENT LAB
   ===================================================== */
.component-lab-page {
    --lab-navy: #081225;
    --lab-air: #38bdf8;
    --lab-vapor: #fb7185;
    --lab-liquid: #4ade80;
    --lab-gold: #fbbf24;
}

.component-lab-hero {
    position: relative;
    overflow: hidden;
    margin: 18px 0 30px;
    padding: clamp(24px, 5vw, 44px);
    border: 1px solid transparent;
    border-radius: 24px;
    background:
        radial-gradient(circle at 8% 15%, rgba(236, 72, 153, 0.18), transparent 34%) padding-box,
        radial-gradient(circle at 92% 86%, rgba(34, 197, 94, 0.16), transparent 36%) padding-box,
        linear-gradient(145deg, rgba(15, 23, 42, 0.97), rgba(7, 14, 29, 0.98)) padding-box,
        linear-gradient(110deg, #ec4899, #fbbf24 31%, #22c55e 65%, #38bdf8, #ec4899) border-box;
    background-size: 100% 100%, 100% 100%, 100% 100%, 260% 100%;
    box-shadow: 0 24px 70px rgba(2, 6, 23, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: lab-prism-border 9s linear infinite;
}

.component-lab-hero::after {
    content: "";
    position: absolute;
    inset: -50% auto -50% -18%;
    width: 23%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.075), transparent);
    transform: skewX(-18deg);
    animation: lab-hero-sweep 8s ease-in-out infinite;
    pointer-events: none;
}

.component-lab-hero h1 { max-width: 820px; margin: 5px 0 15px; }
.component-lab-lede { max-width: 820px; color: #cbd5e1; font-size: clamp(1.03rem, 2vw, 1.2rem); }

.lab-fact-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
    padding: 0;
    list-style: none;
}

.lab-fact-strip span,
.lab-fact-strip li {
    padding: 9px 12px;
    border: 1px solid rgba(148, 163, 184, 0.19);
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.58);
    font-size: 0.75rem;
    font-weight: 800;
}

.lab-fact-strip b { margin-right: 3px; color: #fde68a; font-size: 0.87rem; }

.component-lab {
    position: relative;
    overflow: hidden;
    margin: 26px 0 34px;
    padding: clamp(16px, 3.4vw, 30px);
    border: 1px solid transparent;
    border-radius: 26px;
    background:
        radial-gradient(circle at 6% 6%, rgba(236, 72, 153, 0.12), transparent 32%) padding-box,
        radial-gradient(circle at 96% 96%, rgba(34, 197, 94, 0.11), transparent 34%) padding-box,
        linear-gradient(145deg, rgba(11, 20, 37, 0.98), rgba(5, 12, 25, 0.98)) padding-box,
        linear-gradient(110deg, #ec4899, #fbbf24 32%, #22c55e 65%, #38bdf8, #ec4899) border-box;
    background-size: 100% 100%, 100% 100%, 100% 100%, 270% 100%;
    box-shadow: 0 28px 90px rgba(2, 6, 23, 0.43), inset 0 1px 0 rgba(255, 255, 255, 0.055);
    animation: lab-prism-border 8s linear infinite;
}

.component-lab::before {
    content: "";
    position: absolute;
    z-index: 0;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.06);
    filter: blur(2px);
    pointer-events: none;
    animation: lab-ambient-orbit 12s ease-in-out infinite alternate;
}

.component-lab > * { position: relative; z-index: 1; }

.lab-heading-row {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.lab-heading-row h2 { margin: 2px 0 14px; }

.lab-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid rgba(74, 222, 128, 0.28);
    border-radius: 999px;
    color: #bbf7d0;
    background: rgba(20, 83, 45, 0.18);
    font-size: 0.65rem;
    font-weight: 950;
    letter-spacing: 0.75px;
    text-transform: uppercase;
}

.lab-live-badge i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 12px #22c55e;
    animation: lab-live-pulse 1.7s ease-in-out infinite;
}

.lab-control-deck {
    display: grid;
    grid-template-columns: minmax(270px, 1.3fr) minmax(230px, 1fr) auto;
    gap: 10px;
    margin: 8px 0 14px;
}

.lab-control-group {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 6px;
    align-items: center;
    padding: 7px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.72);
}

.lab-control-label {
    padding: 0 6px;
    color: #64748b;
    font-size: 0.59rem;
    font-weight: 950;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.lab-control-group button {
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #94a3b8;
    background: transparent;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 850;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.lab-control-group button:hover,
.lab-control-group button:focus-visible { color: #f8fafc; border-color: rgba(148, 163, 184, 0.26); transform: translateY(-1px); }
.lab-view-controls button[aria-pressed="true"] { color: #fff7d6; border-color: rgba(251, 191, 36, 0.5); background: rgba(245, 158, 11, 0.13); box-shadow: 0 0 20px rgba(245, 158, 11, 0.12), inset 0 1px rgba(255, 255, 255, 0.08); }
.lab-flow-controls .lab-toggle-air[aria-pressed="true"] { color: #bae6fd; border-color: rgba(56, 189, 248, 0.46); background: rgba(14, 165, 233, 0.13); box-shadow: 0 0 18px rgba(56, 189, 248, 0.11); }
.lab-flow-controls .lab-toggle-refrigerant[aria-pressed="true"] { color: #fecdd3; border-color: rgba(251, 113, 133, 0.46); background: rgba(244, 63, 94, 0.12); box-shadow: 0 0 18px rgba(244, 63, 94, 0.1); }
.lab-control-group button > i { display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: currentColor; vertical-align: 1px; box-shadow: 0 0 8px currentColor; }
.lab-zoom-controls { grid-template-columns: auto repeat(3, 48px); }
.lab-zoom-controls button { min-width: 42px; font-size: 0.9rem; }
.lab-zoom-controls .lab-zoom-value { color: #fde68a; font-size: 0.65rem; }

.lab-stage-shell {
    overflow: hidden;
    border: 1px solid rgba(125, 211, 252, 0.16);
    border-radius: 20px;
    background: #081225;
    box-shadow: inset 0 0 50px rgba(56, 189, 248, 0.055), 0 18px 50px rgba(2, 6, 23, 0.32);
}

.lab-stage {
    --lab-zoom: 1;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1.598;
    background: #081225;
    isolation: isolate;
}

.lab-stage::after {
    content: "";
    position: absolute;
    z-index: 20;
    inset: -20% auto -20% -25%;
    width: 18%;
    background: linear-gradient(90deg, transparent, rgba(186, 230, 253, 0.07), transparent);
    transform: skewX(-16deg);
    animation: lab-stage-scan 7.5s ease-in-out infinite;
    pointer-events: none;
}

.lab-image-stack {
    position: absolute;
    inset: 0;
    transform: scale(var(--lab-zoom));
    transform-origin: 50% 50%;
    transition: transform 0.35s cubic-bezier(0.2, 0.75, 0.25, 1);
}

.lab-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

.lab-fan-motion {
    position: absolute;
    z-index: 9;
    top: 7.5%;
    left: 31%;
    width: 39%;
    height: 22%;
    opacity: 0.5;
    border-radius: 50%;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lab-fan-motion i {
    position: absolute;
    inset: 5%;
    border-radius: 50%;
    background: conic-gradient(from 8deg, transparent 0 7%, rgba(186, 230, 253, 0.35) 8% 22%, transparent 23% 32%, rgba(186, 230, 253, 0.35) 33% 47%, transparent 48% 57%, rgba(186, 230, 253, 0.35) 58% 72%, transparent 73% 82%, rgba(186, 230, 253, 0.35) 83% 97%, transparent 98%);
    filter: blur(1px);
    animation: lab-fan-spin 1.25s linear infinite;
}

.component-lab[data-airflow="off"] .lab-fan-motion { opacity: 0; }

.lab-airflow,
.lab-refrigerant-flow { position: absolute; z-index: 10; inset: 0; opacity: 1; transition: opacity 0.3s ease; pointer-events: none; }
.component-lab[data-airflow="off"] .lab-airflow,
.component-lab[data-refrigerant="off"] .lab-refrigerant-flow { opacity: 0; }
.component-lab[data-view="assembled"] .lab-refrigerant-flow { opacity: 0.18; }

.air-particle,
.air-exhaust {
    position: absolute;
    width: clamp(4px, 0.62vw, 8px);
    height: clamp(4px, 0.62vw, 8px);
    border-radius: 50%;
    background: #7dd3fc;
    box-shadow: 0 0 8px #38bdf8, 0 0 16px rgba(56, 189, 248, 0.55);
}

.air-particle-1 { top: 42%; left: 9%; animation: lab-air-left 3.1s ease-in-out infinite; }
.air-particle-2 { top: 55%; left: 11%; animation: lab-air-left 3.1s 1.1s ease-in-out infinite; }
.air-particle-3 { top: 66%; left: 13%; animation: lab-air-left 3.1s 2.05s ease-in-out infinite; }
.air-particle-4 { top: 43%; right: 8%; animation: lab-air-right 3.1s 0.45s ease-in-out infinite; }
.air-particle-5 { top: 57%; right: 10%; animation: lab-air-right 3.1s 1.45s ease-in-out infinite; }
.air-particle-6 { top: 69%; right: 12%; animation: lab-air-right 3.1s 2.35s ease-in-out infinite; }
.air-exhaust-1 { top: 16%; left: 46%; animation: lab-air-up 2.45s ease-out infinite; }
.air-exhaust-2 { top: 17%; left: 52%; animation: lab-air-up 2.45s 0.8s ease-out infinite; }
.air-exhaust-3 { top: 18%; left: 58%; animation: lab-air-up 2.45s 1.6s ease-out infinite; }

.air-label,
.ref-label {
    position: absolute;
    padding: 4px 7px;
    border: 1px solid rgba(125, 211, 252, 0.24);
    border-radius: 999px;
    color: #bae6fd;
    background: rgba(8, 18, 37, 0.78);
    box-shadow: 0 4px 16px rgba(2, 6, 23, 0.28);
    font-size: clamp(0.42rem, 0.9vw, 0.65rem);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.air-label-in { left: 2%; top: 51%; }
.air-label-out { left: 48%; top: 2%; transform: translateX(-50%); }

.ref-line {
    position: absolute;
    height: clamp(3px, 0.43vw, 6px);
    border-radius: 999px;
    background-size: 220% 100%;
    box-shadow: 0 0 8px currentColor;
    animation: lab-ref-stream 1.85s linear infinite;
}

.ref-suction { left: 58%; top: 75%; width: 20%; color: #60a5fa; background-image: repeating-linear-gradient(90deg, transparent 0 7px, #60a5fa 8px 15px); transform: rotate(7deg); }
.ref-discharge-a { left: 58%; top: 48%; width: 17%; color: #fb7185; background-image: repeating-linear-gradient(90deg, transparent 0 7px, #fb7185 8px 15px); transform: rotate(-67deg); transform-origin: left center; }
.ref-discharge-b { left: 64%; top: 31%; width: 18%; color: #fb7185; background-image: repeating-linear-gradient(90deg, transparent 0 7px, #fb7185 8px 15px); transform: rotate(-4deg); }
.ref-condense-top { left: 31%; top: 24%; width: 38%; color: #fbbf24; background-image: repeating-linear-gradient(90deg, transparent 0 7px, #fbbf24 8px 15px); transform: rotate(-4deg); }
.ref-condense-side { left: 24%; top: 26%; width: 34%; color: #a3e635; background-image: repeating-linear-gradient(90deg, transparent 0 7px, #a3e635 8px 15px); transform: rotate(90deg); transform-origin: left center; }
.ref-liquid { left: 24%; top: 68%; width: 52%; color: #4ade80; background-image: repeating-linear-gradient(90deg, transparent 0 7px, #4ade80 8px 15px); transform: rotate(5deg); }
.ref-label-vapor { right: 4%; top: 27%; color: #fecdd3; border-color: rgba(251, 113, 133, 0.32); }
.ref-label-liquid { left: 25%; top: 72%; color: #bbf7d0; border-color: rgba(74, 222, 128, 0.3); }

.lab-hotspot {
    position: absolute;
    z-index: 14;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 999px;
    color: #fef3c7;
    background: rgba(8, 18, 37, 0.8);
    box-shadow: 0 5px 18px rgba(2, 6, 23, 0.35);
    font: inherit;
    font-size: clamp(0.42rem, 0.86vw, 0.65rem);
    font-weight: 850;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.3s ease;
}

.lab-hotspot span {
    display: grid;
    width: clamp(18px, 2vw, 24px);
    aspect-ratio: 1;
    place-items: center;
    border-radius: 50%;
    color: #111827;
    background: #fbbf24;
    box-shadow: 0 0 13px rgba(251, 191, 36, 0.55);
}

.lab-hotspot:hover,
.lab-hotspot:focus-visible { border-color: #fde68a; transform: translateY(-2px); box-shadow: 0 0 20px rgba(251, 191, 36, 0.22); }
.component-lab[data-component="fan"] .hotspot-fan,
.component-lab[data-component="coil"] .hotspot-coil,
.component-lab[data-component="compressor"] .hotspot-compressor,
.component-lab[data-component="controls"] .hotspot-controls,
.component-lab[data-component="valves"] .hotspot-valves { border-color: #fbbf24; box-shadow: 0 0 22px rgba(251, 191, 36, 0.32); animation: lab-hotspot-pulse 2.1s ease-in-out infinite; }
.hotspot-fan { left: 46%; top: 14%; }
.hotspot-coil { left: 22%; top: 44%; }
.hotspot-compressor { left: 45%; top: 55%; }
.hotspot-controls { left: 66%; top: 33%; }
.hotspot-valves { left: 68%; top: 72%; }
.component-lab[data-view="assembled"] .lab-hotspot { opacity: 0.72; }

.lab-stage-caption {
    margin: 0;
    padding: 10px 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.13);
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.86);
    font-size: 0.68rem;
    line-height: 1.45;
}

.lab-component-picker {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.lab-component-picker button {
    display: grid;
    gap: 2px;
    min-height: 82px;
    padding: 11px;
    border: 1px solid rgba(148, 163, 184, 0.17);
    border-radius: 13px;
    color: #f8fafc;
    text-align: left;
    background: rgba(15, 23, 42, 0.68);
    font: inherit;
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.lab-component-picker button:hover,
.lab-component-picker button:focus-visible { transform: translateY(-2px); border-color: rgba(251, 191, 36, 0.45); }
.lab-component-picker button[aria-pressed="true"] { border-color: #fbbf24; background: linear-gradient(145deg, rgba(245, 158, 11, 0.14), rgba(15, 23, 42, 0.75)); box-shadow: 0 0 22px rgba(251, 191, 36, 0.13); }
.lab-component-picker span { color: #fbbf24; font-size: 0.6rem; font-weight: 950; letter-spacing: 1px; }
.lab-component-picker strong { font-size: 0.76rem; }
.lab-component-picker small { color: #94a3b8; font-size: 0.63rem; line-height: 1.3; }

.lab-readout {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 15px;
    align-items: center;
    min-height: 132px;
    margin-top: 12px;
    padding: 18px;
    border: 1px solid rgba(251, 191, 36, 0.24);
    border-radius: 16px;
    background: linear-gradient(110deg, rgba(245, 158, 11, 0.1), rgba(15, 23, 42, 0.74) 55%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.lab-readout.lab-readout-pop { animation: lab-readout-pop 0.42s ease; }
.lab-readout-index { display: grid; width: 56px; aspect-ratio: 1; place-items: center; border: 1px solid rgba(251, 191, 36, 0.34); border-radius: 16px; color: #fde68a; background: rgba(245, 158, 11, 0.11); box-shadow: 0 0 25px rgba(245, 158, 11, 0.1); font-size: 1.1rem; font-weight: 950; }
.lab-readout > div:last-child { display: grid; gap: 4px; }
.lab-readout .result-label { color: #fbbf24; font-size: 0.63rem; font-weight: 950; letter-spacing: 1px; text-transform: uppercase; }
.lab-readout strong { color: #f8fafc; line-height: 1.35; }
.lab-readout p { margin: 0; color: #cbd5e1; font-size: 0.83rem; line-height: 1.55; }

.lab-definition-callout {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 22px;
    align-items: center;
    margin: 28px 0;
    padding: clamp(20px, 4vw, 30px);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 20px;
    background: linear-gradient(120deg, rgba(14, 165, 233, 0.1), rgba(15, 23, 42, 0.78) 48%, rgba(236, 72, 153, 0.06));
}

.lab-definition-callout h2 { margin: 3px 0 9px; }
.lab-definition-callout p:last-child { margin: 0; }
.lab-definition-symbol { display: flex; align-items: center; justify-content: center; gap: 7px; }
.lab-definition-symbol span { display: grid; width: 54px; aspect-ratio: 1; place-items: center; border: 1px solid rgba(125, 211, 252, 0.38); border-radius: 16px; color: #bae6fd; background: rgba(14, 165, 233, 0.1); box-shadow: 0 0 22px rgba(56, 189, 248, 0.1); font-size: 1.2rem; font-weight: 950; }
.lab-definition-symbol span:last-child { color: #f9a8d4; border-color: rgba(244, 114, 182, 0.36); background: rgba(236, 72, 153, 0.08); }
.lab-definition-symbol i { color: #fde68a; font-style: normal; font-weight: 950; animation: lab-plus-pulse 2.4s ease-in-out infinite; }

.lab-truth-table { margin: 18px 0 30px; }
.lab-truth-table table { min-width: 740px; }
.lab-truth-table tbody th { color: #f8fafc; text-align: left; }
.lab-truth-table tbody tr:nth-child(1) td:nth-child(2) { color: #93c5fd; }
.lab-truth-table tbody tr:nth-child(2) td:nth-child(2) { color: #fda4af; }
.lab-truth-table tbody tr:nth-child(3) td:nth-child(2) { color: #86efac; }
.lab-truth-table tbody tr:nth-child(4) td:nth-child(2) { color: #7dd3fc; }

.component-job-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
    margin: 16px 0 30px;
}

.component-job-grid article {
    position: relative;
    overflow: hidden;
    min-height: 182px;
    padding: 19px;
    border: 1px solid rgba(148, 163, 184, 0.17);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.83), rgba(8, 15, 29, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.component-job-grid article::after { content: ""; position: absolute; right: -50px; bottom: -60px; width: 120px; height: 120px; border-radius: 50%; background: rgba(56, 189, 248, 0.055); transition: transform 0.35s ease; }
.component-job-grid article:hover { transform: translateY(-3px); border-color: rgba(125, 211, 252, 0.34); box-shadow: 0 15px 35px rgba(2, 6, 23, 0.23); }
.component-job-grid article:hover::after { transform: scale(1.45); }
.component-job-grid article > span { color: #fbbf24; font-size: 0.65rem; font-weight: 950; letter-spacing: 1px; }
.component-job-grid h3 { margin: 8px 0 8px; color: #f8fafc; }
.component-job-grid p { margin: 0; color: #cbd5e1; font-size: 0.82rem; }
.component-job-grid .component-job-not-inside { border-color: rgba(244, 114, 182, 0.2); background: linear-gradient(145deg, rgba(76, 5, 25, 0.12), rgba(8, 15, 29, 0.9)); }
.component-job-grid .component-job-not-inside > span { color: #f9a8d4; }

.exam-connection-panel {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.4fr);
    gap: 24px;
    margin: 28px 0;
    padding: clamp(21px, 4vw, 32px);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 20px;
    background: linear-gradient(125deg, rgba(20, 83, 45, 0.13), rgba(15, 23, 42, 0.8) 54%);
}

.exam-connection-panel h2 { margin: 3px 0 0; }
.exam-connection-panel ol { display: grid; gap: 10px; margin: 0; padding-left: 24px; }
.exam-connection-panel li { padding-left: 4px; color: #cbd5e1; }
.exam-connection-panel li::marker { color: #4ade80; font-weight: 950; }

.lab-next-cta { background: radial-gradient(circle at 10% 20%, rgba(245, 158, 11, 0.11), transparent 32%), radial-gradient(circle at 92% 82%, rgba(236, 72, 153, 0.09), transparent 34%), rgba(15, 23, 42, 0.76); }

body.theme-light .component-lab-hero,
body.theme-light .component-lab { color: #0f172a; }
body.theme-light .component-lab-lede,
body.theme-light .lab-readout p,
body.theme-light .component-job-grid p { color: #475569; }
body.theme-light .lab-control-group,
body.theme-light .lab-component-picker button,
body.theme-light .lab-readout,
body.theme-light .component-job-grid article { background-color: rgba(255, 255, 255, 0.82); }
body.theme-light .lab-component-picker button,
body.theme-light .lab-readout strong,
body.theme-light .component-job-grid h3 { color: #0f172a; }

@keyframes lab-prism-border { to { background-position: 0 0, 0 0, 0 0, 270% 0; } }
@keyframes lab-hero-sweep { 0%, 22% { left: -28%; } 65%, 100% { left: 125%; } }
@keyframes lab-ambient-orbit { from { left: -90px; top: -100px; } to { left: calc(100% - 120px); top: calc(100% - 110px); } }
@keyframes lab-live-pulse { 50% { opacity: 0.48; transform: scale(0.72); } }
@keyframes lab-stage-scan { 0%, 18% { left: -25%; } 68%, 100% { left: 128%; } }
@keyframes lab-fan-spin { to { transform: rotate(360deg); } }
@keyframes lab-air-left { 0% { transform: translate(0, 0); opacity: 0; } 18% { opacity: 1; } 76% { opacity: 1; } 100% { transform: translate(31vw, -12vw); opacity: 0; } }
@keyframes lab-air-right { 0% { transform: translate(0, 0); opacity: 0; } 18% { opacity: 1; } 76% { opacity: 1; } 100% { transform: translate(-29vw, -12vw); opacity: 0; } }
@keyframes lab-air-up { 0% { transform: translateY(0) scale(0.7); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-15vw) scale(1.15); opacity: 0; } }
@keyframes lab-ref-stream { to { background-position: -220% 0; } }
@keyframes lab-hotspot-pulse { 50% { box-shadow: 0 0 30px rgba(251, 191, 36, 0.48); } }
@keyframes lab-readout-pop { 0% { transform: translateY(5px) scale(0.99); } 55% { transform: translateY(-2px) scale(1.003); } }
@keyframes lab-plus-pulse { 50% { color: #fbbf24; text-shadow: 0 0 16px rgba(251, 191, 36, 0.7); transform: scale(1.16); } }

@media (max-width: 880px) {
    .lab-control-deck { grid-template-columns: 1fr 1fr; }
    .lab-zoom-controls { grid-column: 1 / -1; justify-self: end; }
    .lab-component-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .component-job-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .component-lab-hero { padding: 23px 18px; border-radius: 20px; }
    .lab-fact-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lab-fact-strip span { text-align: center; }
    .component-lab { padding: 15px 12px; border-radius: 20px; }
    .lab-control-deck { grid-template-columns: 1fr; }
    .lab-control-group { grid-auto-flow: row; grid-template-columns: auto repeat(3, minmax(0, 1fr)); }
    .lab-flow-controls { grid-template-columns: auto repeat(2, minmax(0, 1fr)); }
    .lab-zoom-controls { grid-column: auto; justify-self: stretch; grid-template-columns: auto repeat(3, minmax(0, 1fr)); }
    .lab-control-group button { padding-inline: 7px; font-size: 0.65rem; }
    .lab-stage-shell { border-radius: 15px; }
    .lab-stage-caption { font-size: 0.62rem; }
    .lab-hotspot { padding: 3px; }
    .lab-hotspot b { display: none; }
    .lab-hotspot span { width: 19px; }
    .air-label,
    .ref-label { display: none; }
    .lab-component-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lab-component-picker button { min-height: 75px; }
    .lab-readout { grid-template-columns: 42px minmax(0, 1fr); gap: 11px; padding: 14px 12px; }
    .lab-readout-index { width: 42px; border-radius: 12px; font-size: 0.85rem; }
    .lab-readout strong { font-size: 0.84rem; }
    .lab-readout p { font-size: 0.75rem; }
    .lab-definition-callout { grid-template-columns: 1fr; }
    .lab-definition-symbol { justify-content: start; }
    .component-job-grid { grid-template-columns: 1fr; }
    .component-job-grid article { min-height: auto; }
    .exam-connection-panel { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
    .lab-heading-row { display: block; }
    .lab-live-badge { margin-bottom: 12px; }
    .lab-component-picker { grid-template-columns: 1fr 1fr; }
    .lab-component-picker button:last-child { grid-column: 1 / -1; }
    .lab-stage { aspect-ratio: 1.46; }
    .lab-image { object-fit: cover; }
    .hotspot-controls { left: 68%; }
    .hotspot-valves { left: 71%; }
}

@media (prefers-reduced-motion: reduce) {
    .component-lab-hero,
    .component-lab,
    .component-lab-hero::after,
    .component-lab::before,
    .lab-live-badge i,
    .lab-stage::after,
    .lab-fan-motion i,
    .air-particle,
    .air-exhaust,
    .ref-line,
    .lab-hotspot,
    .lab-readout.lab-readout-pop,
    .lab-definition-symbol i { animation: none !important; }
}

@media print {
    .lab-control-deck,
    .lab-hotspot,
    .lab-airflow,
    .lab-refrigerant-flow,
    .lab-fan-motion { display: none !important; }
    .component-lab,
    .component-lab-hero,
    .lab-readout,
    .lab-definition-callout,
    .component-job-grid article,
    .exam-connection-panel { color: #111827; background: white !important; box-shadow: none !important; }
    .lab-stage { max-height: 520px; }
}

/* Local celebration particles keep the quiz payoff fast and self-contained. */
.local-confetti-burst {
    position: fixed;
    z-index: 10000;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.local-confetti-burst i {
    position: absolute;
    left: 50%;
    top: 58%;
    width: var(--confetti-width);
    height: var(--confetti-height);
    border-radius: 2px;
    opacity: 0;
    background: var(--confetti-color);
    box-shadow: 0 0 8px color-mix(in srgb, var(--confetti-color) 70%, transparent);
    animation: local-confetti-flight var(--confetti-duration) cubic-bezier(0.16, 0.72, 0.24, 1) var(--confetti-delay) forwards;
}

.local-confetti-burst i:nth-child(3n) {
    border-radius: 50%;
}

.local-confetti-burst i:nth-child(4n) {
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

@keyframes local-confetti-flight {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) rotate(0deg) scale(0.35);
    }
    8% { opacity: 1; }
    38% {
        opacity: 1;
        transform: translate3d(var(--confetti-burst-x), var(--confetti-burst-y), 0) rotate(var(--confetti-mid-rotate)) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate3d(var(--confetti-fall-x), var(--confetti-fall-y), 0) rotate(var(--confetti-rotate)) scale(0.78);
    }
}

@media (prefers-reduced-motion: reduce) {
    .local-confetti-burst {
        display: none;
    }
}

/* ====================================================== */
/* ============== QUIZ HEADER EXTRAS ====================== */
/* ====================================================== */

.quit-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quit-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--incorrect);
    color: var(--incorrect);
}

/* ====================================================== */
/* ============== PROGRESS BAR ============================ */
/* ====================================================== */

.progress-bar {
    height: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--correct));
    border-radius: 6px;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====================================================== */
/* ============== EXPLANATION FIELD ======================= */
/* ====================================================== */

.explanation {
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-main);
    text-align: left;
    line-height: 1.5;
}

.explanation-resource {
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    padding: 7px 10px;
    border: 1px solid rgba(56, 189, 248, 0.34);
    border-radius: 9px;
    color: #bae6fd;
    background: rgba(14, 165, 233, 0.09);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.35;
    text-decoration: none;
}

.explanation-resource:hover,
.explanation-resource:focus-visible {
    color: #fff;
    border-color: #38bdf8;
    background: rgba(14, 165, 233, 0.17);
}

.reference {
    margin-top: 8px;
    text-align: left;
    font-size: 0.9rem;
}

.reference a {
    color: var(--link-color);
    font-weight: 600;
    text-decoration: none;
}

.reference a:hover {
    text-decoration: underline;
}

/* ===== Answer Explanations page ===== */
.ans-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 20px;
}

.ans-jump a {
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    color: var(--link-color);
}

.ans-section {
    margin-top: 28px;
}

.answer-entry {
    scroll-margin-top: 16px;
    padding: 14px 16px;
    margin: 12px 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
}

.answer-entry:target {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.16);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.ans-q {
    font-weight: 700;
    color: var(--text-main);
}

.ans-correct {
    color: var(--text-main);
}

.ans-exp {
    font-size: 0.95rem;
}

.ans-rule {
    font-size: 0.9rem;
}

.ans-rule a {
    color: var(--link-color);
    font-weight: 600;
    text-decoration: none;
}

.ans-rule a:hover {
    text-decoration: underline;
}

/* ====================================================== */
/* ============== KEYBOARD HINT FOOTER ==================== */
/* ====================================================== */

.kbd-hints {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 1px;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .kbd-hints {
        display: none;
    }
}

/* ====================================================== */
/* ============== RESULT SCREEN =========================== */
/* ====================================================== */

.result-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.result-grade {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 4rem;
    color: var(--accent);
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
    margin-bottom: 12px;
    animation: gradePop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.result-pct {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 12px;
    animation: fadeIn 0.35s ease 0.28s both;
}

.result-passfail {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    animation: fadeIn 0.35s ease 0.46s both;
    padding: 10px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    letter-spacing: 3px;
}

.result-passfail.pass {
    background: rgba(34, 197, 94, 0.2);
    color: var(--correct);
    border: 2px solid var(--correct);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.result-passfail.fail {
    background: rgba(239, 68, 68, 0.2);
    color: var(--incorrect);
    border: 2px solid var(--incorrect);
}

.result-summary {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 24px;
    animation: fadeIn 0.35s ease 0.6s both;
}

.result-breakdown {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
    animation: fadeIn 0.35s ease 0.72s both;
}

.result-breakdown h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.result-breakdown .row {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    margin-bottom: 8px;
    font-weight: 600;
}

.result-breakdown .row .pct {
    color: var(--accent);
}

.result-breakdown .row.weak .pct {
    color: var(--incorrect);
}

.result-breakdown .row.strong .pct {
    color: var(--correct);
}

.result-certification {
    max-width: 520px;
    margin: 24px auto 0;
}

.result-certification p {
    color: var(--text-muted);
    line-height: 1.5;
}

.result-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

#btn-back-menu {
    background: white;
    color: var(--bg-dark);
}

#btn-back-menu:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

#btn-review-missed-now {
    background: #f97316;
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

#btn-review-missed-now:hover {
    background: #fb923c;
    transform: translateY(-2px);
}

@media (max-width: 640px) {
    body {
        align-items: flex-start;
        padding: 12px;
    }

    .app-container,
    .screen {
        gap: 14px;
    }

    .menu-hero {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 12px;
        padding: 18px 14px;
    }

    .hero-icon {
        width: 88px;
        height: 88px;
        border-radius: 18px;
    }

    .brand-kicker {
        margin-inline: auto;
    }

    .logo {
        font-size: 2.05rem;
    }

    .subtitle {
        margin-top: 8px;
        font-size: 0.95rem;
    }

    header {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px 10px;
        align-items: center;
        padding: 12px;
    }

    #section-badge,
    #progress-text,
    #mode-text {
        min-width: 0;
    }

    #mode-text {
        grid-column: 1 / -1;
        font-size: 0.9rem;
    }

    .quit-btn {
        grid-row: 1 / 3;
        grid-column: 2;
        align-self: start;
        padding: 7px 12px;
    }

    .card,
    .result-card {
        padding: 22px 16px;
        border-radius: 14px;
    }

    h1 {
        font-size: 1.25rem;
        margin-bottom: 18px;
    }

    #options-container {
        gap: 10px;
    }

    .option {
        padding: 15px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .controls {
        justify-content: stretch;
    }

    .controls button {
        width: 100%;
    }

    button {
        padding: 13px 18px;
        font-size: 1rem;
    }

    .menu-footer {
        flex-direction: column;
    }

    .menu-btn.small {
        justify-content: center;
    }

    .ad-slot {
        min-height: 80px;
    }

    .seo-panel,
    .content-page {
        padding: 18px 16px;
        border-radius: 14px;
    }

    .seo-grid {
        grid-template-columns: 1fr;
    }

    .content-page h1 {
        font-size: 1.55rem;
    }

    .result-grade {
        font-size: 3rem;
    }

    .result-pct {
        font-size: 2rem;
    }
}

/* ====================================================== */
/* ============== MODAL & PT CHART ======================== */
/* ====================================================== */

.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.close-btn {
    position: absolute;
    top: 15px; right: 15px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
}

.close-btn:hover {
    color: var(--text-main);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--accent);
}

.table-responsive {
    overflow-x: auto;
}

.pt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.pt-table th, .pt-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pt-table th {
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
    font-weight: 700;
}

.pt-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.pt-table tbody tr:hover {
    background: rgba(14, 165, 233, 0.1);
}

.pt-chart-btn {
    background: rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
    border: 1px solid #0ea5e9;
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-right: 10px;
}

.pt-chart-btn:hover {
    background: #0ea5e9;
    color: white;
}

@media (max-width: 640px) {
    .modal-content {
        padding: 16px 12px;
        max-height: 95vh;
    }

    .modal-content h2 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    .pt-table th, .pt-table td {
        padding: 8px 4px;
        font-size: 0.85rem;
    }

    .close-btn {
        top: 10px;
        right: 10px;
    }
}

/* ====================================================== */
/* ============== PROGRESS DASHBOARD ===================== */
/* ====================================================== */

/* Stats mini bar: inline with dashboard button */
.stats-mini-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-mini-bar .stats-mini {
    flex: 1;
}

.menu-btn.dashboard-btn {
    flex: 0 0 auto;
    padding: 10px 16px;
    font-size: 0.9rem;
    border-color: #a855f7;
    color: var(--text-main);
    background: rgba(168, 85, 247, 0.1);
    white-space: nowrap;
}

.menu-btn.dashboard-btn:hover {
    background: rgba(168, 85, 247, 0.25);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
    transform: translateY(-2px);
}

/* Dashboard header */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

.dashboard-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
}

.dashboard-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* KPI Strip */
.dashboard-kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.kpi-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 18px 14px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.kpi-icon {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 6px;
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Section label */
.dashboard-section-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0 2px;
}

/* Per-section readiness cards grid */
.dashboard-sections-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.dash-section-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-section-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.dash-section-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dash-section-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
}

.dash-readiness-badge {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1.5px solid;
}

.dash-readiness-bar-bg {
    height: 8px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
    overflow: hidden;
}

.dash-readiness-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

.dash-section-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.dash-stat {
    text-align: center;
    padding: 8px 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.dash-stat-val {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.dash-stat-lbl {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Color helpers */
.mastered-color { color: #22c55e; }
.weak-color     { color: #f97316; }
.muted-color    { color: #94a3b8; }
.accent-color   { color: #3b82f6; }

/* History feed */
.dashboard-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: background 0.15s ease;
}

.history-row:hover {
    background: var(--hover);
}

.history-mode {
    font-weight: 700;
    font-size: 0.95rem;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-score {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.history-pct {
    color: var(--accent);
}

.history-badge {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.history-pass {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.history-fail {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.dash-empty {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Light theme overrides */
body.theme-light .dash-section-card,
body.theme-light .kpi-card,
body.theme-light .history-row,
body.theme-light .dashboard-header {
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

body.theme-light .dash-stat {
    background: rgba(15, 23, 42, 0.06);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-kpi-strip {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-mini-bar {
        flex-direction: column;
        align-items: stretch;
    }

    /* flex:1 in a column means a 0 basis; iOS Safari then ignores the wrapped Lifetime line and squeezes the buttons below. */
    .stats-mini-bar,
    .stats-mini-bar .stats-mini,
    .stats-mini-bar .menu-btn,
    .menu-footer {
        flex: 0 0 auto;
    }

    .menu-btn.dashboard-btn {
        justify-content: center;
    }

    .dashboard-header {
        padding: 14px 16px;
        border-radius: 12px;
    }

    .dashboard-title {
        font-size: 1.2rem;
    }

    .dashboard-kpi-strip {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

    .dashboard-sections-grid {
        grid-template-columns: 1fr;
    }

    .dash-section-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .history-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .history-date {
        width: 100%;
    }
}

/* ====================================================== */
/* ============== GLASS DEPTH SYSTEM ===================== */
/* ====================================================== */

:root {
    --glass-panel:
        linear-gradient(135deg, rgba(255, 255, 255, 0.065), transparent 28%),
        linear-gradient(145deg, rgba(30, 41, 59, 0.76), rgba(15, 23, 42, 0.62));
    --glass-panel-strong:
        linear-gradient(135deg, rgba(255, 255, 255, 0.075), transparent 24%),
        linear-gradient(145deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.74));
    --glass-card:
        linear-gradient(145deg, rgba(30, 41, 59, 0.62), rgba(15, 23, 42, 0.48));
    --glass-card-hover:
        linear-gradient(145deg, rgba(51, 65, 85, 0.72), rgba(30, 41, 59, 0.58));
    --glass-border: rgba(186, 230, 253, 0.16);
    --glass-border-bright: rgba(125, 211, 252, 0.3);
    --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.085);
    --glass-shadow: 0 18px 44px rgba(2, 6, 23, 0.3);
}

body {
    background:
        radial-gradient(circle at 8% 12%, rgba(37, 99, 235, 0.13), transparent 27%),
        radial-gradient(circle at 92% 28%, rgba(139, 92, 246, 0.11), transparent 25%),
        radial-gradient(circle at 52% 100%, rgba(14, 165, 233, 0.08), transparent 34%),
        var(--bg-dark);
    background-attachment: fixed;
}

body.theme-light {
    --glass-panel:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9), transparent 32%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(241, 245, 249, 0.7));
    --glass-panel-strong:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), transparent 28%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(241, 245, 249, 0.82));
    --glass-card:
        linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(241, 245, 249, 0.64));
    --glass-card-hover:
        linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(226, 232, 240, 0.76));
    --glass-border: rgba(15, 23, 42, 0.12);
    --glass-border-bright: rgba(2, 132, 199, 0.26);
    --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.92);
    --glass-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
    background:
        radial-gradient(circle at 8% 12%, rgba(59, 130, 246, 0.1), transparent 27%),
        radial-gradient(circle at 92% 28%, rgba(139, 92, 246, 0.08), transparent 25%),
        radial-gradient(circle at 52% 100%, rgba(14, 165, 233, 0.06), transparent 34%),
        var(--bg-dark);
    background-attachment: fixed;
}

/* Level 1: shared structure and reading surfaces. */
.site-header,
.settings-menu,
.menu-section,
.seo-panel,
.content-page,
.card,
.result-card,
.modal-content,
.dashboard-header,
header:not(.site-header) {
    border-color: var(--glass-border);
    background: var(--glass-panel-strong);
    box-shadow: var(--glass-edge), var(--glass-shadow);
    -webkit-backdrop-filter: blur(16px) saturate(128%);
    backdrop-filter: blur(16px) saturate(128%);
}

.settings-button {
    border-color: var(--glass-border-bright);
    background: var(--glass-panel);
    box-shadow: var(--glass-edge), 0 12px 28px rgba(2, 6, 23, 0.3);
    -webkit-backdrop-filter: blur(14px) saturate(135%);
    backdrop-filter: blur(14px) saturate(135%);
}

/* Level 2: featured, edge-lit glass. */
.new-here-path,
.practice-directory,
.landing-hero,
.full-width-cta,
.source-box,
.independent-note,
.certification-callout {
    border-color: var(--glass-border-bright);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 1px 0 0 rgba(255, 255, 255, 0.035),
        0 20px 48px rgba(2, 6, 23, 0.3);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
}

.new-here-path {
    background:
        radial-gradient(circle at 94% 5%, rgba(168, 85, 247, 0.22), transparent 30%),
        linear-gradient(145deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.58));
}

.practice-directory {
    background:
        radial-gradient(circle at 6% 4%, rgba(14, 165, 233, 0.2), transparent 29%),
        linear-gradient(145deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.58));
}

.landing-hero {
    background:
        radial-gradient(circle at 92% 8%, rgba(124, 58, 237, 0.25), transparent 30%),
        radial-gradient(circle at 12% 96%, rgba(14, 165, 233, 0.18), transparent 34%),
        linear-gradient(145deg, rgba(30, 41, 59, 0.76), rgba(15, 23, 42, 0.58));
}

.landing-hero.core-landing {
    background:
        radial-gradient(circle at 92% 8%, rgba(34, 197, 94, 0.22), transparent 30%),
        radial-gradient(circle at 12% 96%, rgba(14, 165, 233, 0.19), transparent 34%),
        linear-gradient(145deg, rgba(30, 41, 59, 0.76), rgba(15, 23, 42, 0.58));
}

.full-width-cta {
    background:
        radial-gradient(circle at 95% 20%, rgba(245, 158, 11, 0.2), transparent 33%),
        linear-gradient(145deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.54));
}

.source-box,
.independent-note {
    background:
        radial-gradient(circle at 100% 0, rgba(34, 197, 94, 0.13), transparent 35%),
        linear-gradient(145deg, rgba(30, 41, 59, 0.68), rgba(15, 23, 42, 0.52));
}

.certification-callout {
    background:
        radial-gradient(circle at 100% 0, rgba(59, 130, 246, 0.17), transparent 38%),
        linear-gradient(145deg, rgba(30, 41, 59, 0.68), rgba(15, 23, 42, 0.52));
}

/* Level 3: compact glass cards with interactive edge light. */
.stats-mini,
.seo-grid article,
.content-proof-grid div,
.sample-question,
.practice-directory-grid > a,
.topic-card,
.guide-card,
.mistake-card,
.study-order li,
.current-rules-grid a,
.kpi-card,
.dash-section-card,
.history-row,
.dash-empty {
    border-color: var(--glass-border);
    background: var(--glass-card);
    box-shadow: var(--glass-edge), 0 10px 26px rgba(2, 6, 23, 0.16);
}

.practice-directory-grid > a:hover,
.practice-directory-grid > a:focus-visible,
.guide-card:hover,
.guide-card:focus-visible,
.current-rules-grid a:hover,
.current-rules-grid a:focus-visible,
.kpi-card:hover,
.dash-section-card:hover,
.history-row:hover {
    border-color: var(--glass-border-bright);
    background: var(--glass-card-hover);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.11),
        0 14px 30px rgba(14, 165, 233, 0.13);
}

body.theme-light .new-here-path,
body.theme-light .practice-directory,
body.theme-light .landing-hero,
body.theme-light .landing-hero.core-landing,
body.theme-light .full-width-cta,
body.theme-light .source-box,
body.theme-light .independent-note,
body.theme-light .certification-callout {
    background:
        radial-gradient(circle at 92% 8%, rgba(59, 130, 246, 0.1), transparent 31%),
        var(--glass-panel);
}

@media (max-width: 700px) {
    .site-header,
    .settings-menu,
    .menu-section,
    .seo-panel,
    .content-page,
    .card,
    .result-card,
    .modal-content,
    .dashboard-header,
    header:not(.site-header),
    .new-here-path,
    .practice-directory,
    .landing-hero,
    .full-width-cta,
    .source-box,
    .independent-note,
    .certification-callout {
        -webkit-backdrop-filter: blur(10px) saturate(118%);
        backdrop-filter: blur(10px) saturate(118%);
    }
}

@media (prefers-reduced-transparency: reduce) {
    .site-header,
    .settings-menu,
    .menu-section,
    .seo-panel,
    .content-page,
    .card,
    .result-card,
    .modal-content,
    .dashboard-header,
    header:not(.site-header),
    .new-here-path,
    .practice-directory,
    .landing-hero,
    .full-width-cta,
    .source-box,
    .independent-note,
    .certification-callout {
        background-color: var(--card-bg);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* ====================================================== */
/* ============== DASHBOARD V2 =========================== */
/* ====================================================== */

#screen-dashboard {
    gap: 18px;
}

.dashboard-header {
    position: relative;
    overflow: hidden;
    padding: 22px 24px;
}

.dashboard-header::after {
    content: "";
    position: absolute;
    inset: 0 12% auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.75), rgba(168, 85, 247, 0.62), transparent);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.dashboard-eyebrow,
.dashboard-overview-kicker {
    margin-bottom: 5px;
    color: #7dd3fc;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 1.45px;
    text-transform: uppercase;
}

.dashboard-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-save-note {
    padding: 6px 10px;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 999px;
    color: #86efac;
    background: rgba(34, 197, 94, 0.08);
    font-size: 0.68rem;
    font-weight: 750;
    white-space: nowrap;
}

.dashboard-overview {
    --dashboard-progress: 0deg;
    --dashboard-color: #64748b;
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 20px 26px;
    align-items: center;
    overflow: hidden;
    padding: 24px;
    border: 1px solid rgba(125, 211, 252, 0.24);
    border-radius: 20px;
    background:
        radial-gradient(circle at 8% 15%, rgba(59, 130, 246, 0.18), transparent 29%),
        radial-gradient(circle at 96% 8%, rgba(168, 85, 247, 0.2), transparent 34%),
        var(--glass-panel);
    box-shadow: var(--glass-edge), 0 22px 52px rgba(2, 6, 23, 0.32);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
}

.dashboard-overview::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 260px;
    height: 260px;
    right: -130px;
    bottom: -170px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.08);
    filter: blur(4px);
}

.dashboard-mastery-ring {
    display: grid;
    width: 152px;
    aspect-ratio: 1;
    place-items: center;
    padding: 11px;
    border-radius: 50%;
    background: conic-gradient(var(--dashboard-color) var(--dashboard-progress), rgba(100, 116, 139, 0.22) 0);
    box-shadow:
        0 0 28px color-mix(in srgb, var(--dashboard-color) 28%, transparent),
        inset 0 0 16px rgba(255, 255, 255, 0.05);
    transition: background 0.5s ease;
}

.dashboard-mastery-ring-inner {
    display: grid;
    width: 100%;
    height: 100%;
    place-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.88);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    text-align: center;
}

.dashboard-mastery-ring strong {
    color: var(--text-main);
    font-size: 2rem;
    line-height: 1;
}

.dashboard-mastery-ring span {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.dashboard-next-step h3 {
    margin-bottom: 7px;
    color: var(--text-main);
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    line-height: 1.16;
}

.dashboard-next-step > p:last-of-type {
    max-width: 580px;
    color: var(--text-muted);
    line-height: 1.55;
}

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

.dashboard-action-primary,
.dashboard-action-secondary {
    min-height: 44px;
    padding: 11px 15px;
    border-radius: 11px;
    font-size: 0.86rem;
    font-weight: 800;
}

.dashboard-action-primary {
    border: 1px solid rgba(147, 197, 253, 0.58);
    color: #ffffff;
    background: linear-gradient(125deg, #2563eb, #7c3aed 58%, #0891b2);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.3), 0 0 20px rgba(124, 58, 237, 0.16);
}

.dashboard-action-secondary {
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: var(--text-main);
    background: rgba(15, 23, 42, 0.48);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.dashboard-action-primary:hover,
.dashboard-action-primary:focus-visible,
.dashboard-action-secondary:hover,
.dashboard-action-secondary:focus-visible {
    transform: translateY(-2px);
    filter: brightness(1.09);
}

.dashboard-coverage-strip {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.13);
}

.dashboard-coverage-strip span {
    padding: 10px 12px;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.5);
    text-align: center;
    font-size: 0.72rem;
    font-weight: 650;
}

.dashboard-coverage-strip strong {
    display: block;
    margin-bottom: 2px;
    color: #7dd3fc;
    font-size: 0.98rem;
}

.dashboard-kpi-strip {
    gap: 12px;
}

.kpi-card {
    --kpi-accent: #38bdf8;
    --kpi-rgb: 56, 189, 248;
    position: relative;
    overflow: hidden;
    min-height: 148px;
    padding: 17px;
    background:
        radial-gradient(circle at 95% 4%, rgba(var(--kpi-rgb), 0.17), transparent 38%),
        var(--glass-card);
    text-align: left;
}

.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--kpi-accent);
    box-shadow: 0 0 15px rgba(var(--kpi-rgb), 0.62);
}

#kpi-streak { --kpi-accent: #fb923c; --kpi-rgb: 251, 146, 60; }
#kpi-mastered { --kpi-accent: #facc15; --kpi-rgb: 250, 204, 21; }
#kpi-weak { --kpi-accent: #f97316; --kpi-rgb: 249, 115, 22; }
#kpi-overall { --kpi-accent: #38bdf8; --kpi-rgb: 56, 189, 248; }

.kpi-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    margin-bottom: 12px;
    border: 1px solid rgba(var(--kpi-rgb), 0.25);
    border-radius: 10px;
    background: rgba(var(--kpi-rgb), 0.1);
    font-size: 1.05rem;
}

.kpi-value {
    margin-bottom: 5px;
    font-size: 2rem;
}

.kpi-label {
    color: var(--text-main);
    font-size: 0.68rem;
    font-weight: 750;
}

.kpi-meta {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.7rem;
    line-height: 1.35;
}

.dashboard-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    margin-top: 7px;
    padding: 0 3px;
}

.dashboard-section-heading p {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.dashboard-section-label {
    color: var(--text-main);
    font-size: 0.76rem;
}

.dash-section-card {
    --section-accent: #64748b;
    position: relative;
    overflow: hidden;
    gap: 10px;
    padding: 18px 19px 19px;
}

.dash-section-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--section-accent);
    box-shadow: 0 0 16px var(--section-accent);
}

.dash-section-top {
    gap: 12px;
}

.dash-section-name {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.dash-section-icon {
    display: grid;
    min-width: 31px;
    height: 31px;
    padding: 0 6px;
    place-items: center;
    border: 1px solid var(--section-accent);
    border-radius: 9px;
    color: var(--section-accent);
    background: rgba(15, 23, 42, 0.42);
    font-size: 0.74rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dash-readiness-badge {
    border-color: var(--section-accent);
    color: var(--section-accent);
    background: rgba(15, 23, 42, 0.34);
    font-size: 0.72rem;
}

.dash-section-progress-copy {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 650;
}

.dash-section-progress-copy span:first-child {
    color: var(--section-accent);
}

.dash-readiness-bar-bg {
    height: 9px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(2, 6, 23, 0.42);
}

.dash-readiness-bar-fill {
    background: var(--section-accent);
    box-shadow: 0 0 12px var(--section-accent);
}

.dash-stat {
    border: 1px solid rgba(148, 163, 184, 0.09);
    background: rgba(2, 6, 23, 0.25);
}

.history-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    overflow: hidden;
    padding: 14px 16px 17px;
}

.history-row::after {
    content: "";
    position: absolute;
    inset: auto auto 0 0;
    width: var(--history-progress, 0%);
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #8b5cf6, #38bdf8);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

.history-session-copy {
    min-width: 0;
}

.history-score {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.history-session-result {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.history-pct {
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 850;
}

.dash-empty {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 34px 22px;
}

.dash-empty strong {
    color: var(--text-main);
}

.dash-empty > span:last-child {
    max-width: 470px;
    line-height: 1.5;
}

.dash-empty-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    margin-bottom: 4px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 13px;
    color: #7dd3fc;
    background: rgba(14, 165, 233, 0.1);
    font-size: 1.25rem;
}

body.theme-light .dashboard-overview {
    background:
        radial-gradient(circle at 8% 15%, rgba(59, 130, 246, 0.1), transparent 29%),
        radial-gradient(circle at 96% 8%, rgba(168, 85, 247, 0.09), transparent 34%),
        var(--glass-panel);
}

body.theme-light .dashboard-mastery-ring-inner,
body.theme-light .dashboard-action-secondary,
body.theme-light .dashboard-coverage-strip span,
body.theme-light .dash-section-icon,
body.theme-light .dash-readiness-badge,
body.theme-light .dash-stat {
    background: rgba(255, 255, 255, 0.7);
}

body.theme-light .dashboard-save-note {
    color: #166534;
}

@media (max-width: 700px) {
    .dashboard-overview {
        -webkit-backdrop-filter: blur(10px) saturate(118%);
        backdrop-filter: blur(10px) saturate(118%);
    }
}

@media (max-width: 640px) {
    .dashboard-header {
        align-items: flex-start;
        gap: 12px;
    }

    .dashboard-header-actions {
        flex-direction: column-reverse;
        align-items: flex-end;
        gap: 7px;
    }

    .dashboard-save-note {
        font-size: 0.62rem;
    }

    .dashboard-overview {
        grid-template-columns: 1fr;
        justify-items: center;
        padding: 21px 18px;
        text-align: center;
    }

    .dashboard-mastery-ring {
        width: 132px;
    }

    .dashboard-next-step > p:last-of-type {
        max-width: 440px;
    }

    .dashboard-actions {
        justify-content: center;
    }

    .dashboard-coverage-strip {
        width: 100%;
    }

    .kpi-card {
        min-height: 140px;
        padding: 14px;
    }

    .kpi-value {
        font-size: 1.65rem;
    }

    .dash-section-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-stat {
        padding: 10px 6px;
    }

    .history-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .history-session-result {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .history-date {
        width: auto;
    }
}

@media (max-width: 420px) {
    .dashboard-title {
        font-size: 1.08rem;
    }

    .dashboard-subtitle {
        font-size: 0.78rem;
    }

    .dashboard-save-note {
        display: none;
    }

    .dashboard-actions {
        width: 100%;
    }

    .dashboard-action-primary,
    .dashboard-action-secondary {
        width: 100%;
    }

    .dashboard-coverage-strip span {
        padding: 9px 5px;
        font-size: 0.64rem;
    }

    .dashboard-coverage-strip strong {
        font-size: 0.84rem;
    }

    .dash-section-top {
        align-items: flex-start;
    }

    .dash-readiness-badge {
        padding: 4px 7px;
        font-size: 0.64rem;
    }
}

/* ====================================================== */
/* ============== DASHBOARD MOTION ======================= */
/* ====================================================== */

@property --dashboard-progress {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.dashboard-overview > *,
.kpi-card > * {
    position: relative;
    z-index: 1;
}

.dashboard-overview::after {
    content: "";
    position: absolute;
    z-index: 0;
    top: -45%;
    bottom: -45%;
    left: -42%;
    width: 28%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.13), rgba(125, 211, 252, 0.12), transparent);
    mix-blend-mode: screen;
    transform: skewX(-16deg);
    animation: dashboard-glass-scan 7.2s ease-in-out 1.1s infinite;
}

.dashboard-mastery-ring {
    position: relative;
    transition: --dashboard-progress 1.15s cubic-bezier(0.2, 0.8, 0.2, 1) 90ms;
}

.dashboard-mastery-ring::after {
    content: "";
    position: absolute;
    inset: -5px;
    pointer-events: none;
    border: 2px solid transparent;
    border-top-color: color-mix(in srgb, var(--dashboard-color) 80%, white);
    border-right-color: color-mix(in srgb, var(--dashboard-color) 28%, transparent);
    border-radius: 50%;
    filter: drop-shadow(0 0 6px var(--dashboard-color));
    animation: dashboard-ring-orbit 4.8s linear infinite;
}

.dashboard-action-primary {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.dashboard-action-primary::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -100% 55% -100% -45%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
    transform: translateX(-150%) rotate(14deg);
    animation: dashboard-action-shine 4.6s ease-in-out infinite;
}

.kpi-card::after {
    content: "";
    position: absolute;
    z-index: 0;
    width: 105px;
    height: 105px;
    top: -55px;
    right: -48px;
    pointer-events: none;
    border-radius: 50%;
    background: rgba(var(--kpi-rgb), 0.18);
    filter: blur(18px);
    opacity: 0.42;
    animation: dashboard-kpi-breathe 4.4s ease-in-out infinite;
}

.kpi-card:nth-child(2)::after { animation-delay: -1.1s; }
.kpi-card:nth-child(3)::after { animation-delay: -2.2s; }
.kpi-card:nth-child(4)::after { animation-delay: -3.3s; }

.dash-section-card::after {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0 70% 0 -55%;
    pointer-events: none;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.07), transparent);
    transform: translateX(-40%);
    transition: transform 0.75s ease;
}

.dash-section-card:hover::after {
    transform: translateX(440%);
}

.dash-section-card > * {
    position: relative;
    z-index: 1;
}

.dash-readiness-bar-fill {
    width: 0;
    transition:
        width 1.05s cubic-bezier(0.2, 0.8, 0.2, 1) var(--dashboard-delay, 0ms),
        box-shadow 0.2s ease;
}

.history-row::after {
    transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) var(--dashboard-delay, 0ms);
}

.dashboard-overview.dashboard-motion-in {
    animation: dashboard-overview-enter 0.68s cubic-bezier(0.18, 0.85, 0.26, 1.08) backwards;
}

.kpi-card.dashboard-motion-in {
    animation: dashboard-kpi-enter 0.58s cubic-bezier(0.18, 0.85, 0.26, 1.08) var(--dashboard-delay, 0ms) backwards;
}

.dashboard-section-heading.dashboard-motion-in {
    animation: dashboard-heading-enter 0.48s ease-out var(--dashboard-delay, 0ms) backwards;
}

.dash-section-card.dashboard-motion-in {
    animation: dashboard-section-enter 0.62s cubic-bezier(0.18, 0.85, 0.26, 1.05) var(--dashboard-delay, 0ms) backwards;
}

.history-row.dashboard-motion-in {
    animation: dashboard-history-enter 0.52s ease-out var(--dashboard-delay, 0ms) backwards;
}

@keyframes dashboard-overview-enter {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
        filter: saturate(0.72);
    }
}

@keyframes dashboard-kpi-enter {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.94);
    }
}

@keyframes dashboard-heading-enter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

@keyframes dashboard-section-enter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
        filter: saturate(0.75);
    }
}

@keyframes dashboard-history-enter {
    from {
        opacity: 0;
        transform: translateX(-18px);
    }
}

@keyframes dashboard-glass-scan {
    0%, 17% { transform: translateX(0) skewX(-16deg); opacity: 0; }
    34% { opacity: 0.82; }
    58%, 100% { transform: translateX(650%) skewX(-16deg); opacity: 0; }
}

@keyframes dashboard-ring-orbit {
    to { transform: rotate(360deg); }
}

@keyframes dashboard-action-shine {
    0%, 52% { transform: translateX(-155%) rotate(14deg); opacity: 0; }
    66% { opacity: 0.8; }
    86%, 100% { transform: translateX(440%) rotate(14deg); opacity: 0; }
}

@keyframes dashboard-kpi-breathe {
    0%, 100% { transform: scale(0.82); opacity: 0.28; }
    50% { transform: scale(1.18); opacity: 0.62; }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-overview,
    .kpi-card,
    .dashboard-section-heading,
    .dash-section-card,
    .history-row,
    .dashboard-mastery-ring,
    .dash-readiness-bar-fill,
    .history-row::after {
        animation: none !important;
        transition: none !important;
    }

    .dashboard-overview::after,
    .dashboard-mastery-ring::after,
    .dashboard-action-primary::before,
    .kpi-card::after {
        animation: none !important;
    }
}

/* ====================================================== */
/* ===== RECOVER / RECYCLE / RECLAIM VISUAL GUIDE ======= */
/* ====================================================== */

.landing-hero.reclaim-landing {
    border-color: rgba(34, 197, 94, 0.34);
    background:
        radial-gradient(circle at 91% 8%, rgba(34, 197, 94, 0.24), transparent 29%),
        radial-gradient(circle at 10% 94%, rgba(236, 72, 153, 0.18), transparent 34%),
        linear-gradient(145deg, rgba(30, 41, 59, 0.77), rgba(15, 23, 42, 0.58));
}

.three-r-flow {
    position: relative;
    overflow: hidden;
    margin: 22px 0 30px;
    padding: 22px;
    border: 1px solid var(--glass-border-bright);
    border-radius: 18px;
    background:
        radial-gradient(circle at 8% 8%, rgba(56, 189, 248, 0.15), transparent 27%),
        radial-gradient(circle at 92% 90%, rgba(34, 197, 94, 0.12), transparent 31%),
        var(--glass-panel-strong);
    box-shadow: var(--glass-edge), 0 22px 50px rgba(2, 6, 23, 0.3);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
}

.three-r-flow::after {
    content: "";
    position: absolute;
    inset: -70% -30%;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 44%, rgba(255, 255, 255, 0.055) 50%, transparent 56%);
    transform: translateX(-32%);
    animation: three-r-glass-scan 8s ease-in-out infinite;
}

.three-r-flow > * {
    position: relative;
    z-index: 1;
}

.three-r-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin: 0 0 16px;
}

.three-r-tabs button {
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 11px;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.72);
    font: inherit;
    font-weight: 850;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.three-r-tabs button:hover,
.three-r-tabs button:focus-visible {
    color: var(--text-main);
    border-color: rgba(56, 189, 248, 0.58);
    transform: translateY(-1px);
}

.three-r-tabs button[aria-pressed="true"] {
    color: #fff;
    border-color: rgba(253, 230, 138, 0.62);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.23), rgba(59, 130, 246, 0.18));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 24px rgba(245, 158, 11, 0.12);
}

.three-r-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
}

.three-r-card {
    position: relative;
    overflow: hidden;
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
    padding: 19px 17px;
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    background: var(--glass-card);
    box-shadow: var(--glass-edge), 0 12px 28px rgba(2, 6, 23, 0.2);
    opacity: 0.72;
    transform: scale(0.985);
    transition: opacity 0.22s ease, transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.three-r-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--r-accent);
    box-shadow: 0 0 20px var(--r-glow);
}

.recover-card { --r-accent: #38bdf8; --r-glow: rgba(56, 189, 248, 0.68); }
.recycle-card { --r-accent: #f472b6; --r-glow: rgba(244, 114, 182, 0.65); }
.reclaim-card { --r-accent: #4ade80; --r-glow: rgba(74, 222, 128, 0.62); }

.three-r-stage[data-active-term="recover"] .recover-card,
.three-r-stage[data-active-term="recycle"] .recycle-card,
.three-r-stage[data-active-term="reclaim"] .reclaim-card {
    opacity: 1;
    transform: translateY(-3px) scale(1);
    border-color: var(--r-accent);
    box-shadow: var(--glass-edge), 0 18px 38px var(--r-glow);
}

.three-r-number {
    color: var(--r-accent);
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 1.5px;
}

.three-r-verb {
    margin: 0;
    color: var(--r-accent) !important;
    font-size: 0.72rem !important;
    font-weight: 900;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.three-r-card h3 {
    margin: 1px 0 2px;
    color: var(--text-main);
    font-size: 1.32rem;
}

.three-r-card p:not(.three-r-verb) {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.three-r-memory {
    align-self: end;
    margin-top: 7px;
    color: #fef3c7;
    font-size: 0.79rem;
    line-height: 1.45;
}

.three-r-connector {
    display: grid;
    place-content: center;
    gap: 1px;
    color: #fde68a;
    text-align: center;
}

.three-r-connector span {
    font-size: 1.45rem;
    line-height: 1;
}

.three-r-connector small {
    color: var(--text-muted);
    font-size: 0.58rem;
    font-weight: 850;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.three-r-result {
    display: grid;
    gap: 4px;
    margin-top: 15px;
    padding: 17px 18px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 13px;
    background: rgba(34, 197, 94, 0.08);
}

.three-r-result.result-pulse {
    animation: reference-result-pulse 0.46s ease-out;
}

.three-r-result strong {
    color: var(--text-main);
    font-size: 1.08rem;
}

.three-r-result p {
    margin: 0;
    color: var(--text-muted);
}

.ownership-rule {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
    margin: 16px 0 25px;
}

.ownership-rule > div:not(.ownership-divider) {
    padding: 20px;
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    background: var(--glass-card);
    box-shadow: var(--glass-edge), 0 12px 28px rgba(2, 6, 23, 0.17);
}

.ownership-rule h3 {
    margin: 8px 0 6px;
    color: var(--text-main);
}

.ownership-rule p {
    margin: 0;
}

.ownership-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 13px;
    color: #7dd3fc;
    background: rgba(56, 189, 248, 0.1);
    font-size: 1.45rem;
    font-weight: 900;
}

.ownership-icon.ownership-change {
    color: #86efac;
    border-color: rgba(74, 222, 128, 0.45);
    background: rgba(74, 222, 128, 0.1);
}

.ownership-divider {
    display: grid;
    place-items: center;
    color: #fde68a;
    font-size: 0.7rem;
    font-weight: 950;
    letter-spacing: 1px;
}

.three-r-table th[scope="row"] {
    color: #fef3c7;
    white-space: nowrap;
}

@keyframes three-r-glass-scan {
    0%, 18% { transform: translateX(-34%); }
    68%, 100% { transform: translateX(34%); }
}

/* Skip most paint/layout work for large sections until they approach the viewport. */
.menu-section,
.practice-directory,
.new-here-path,
.seo-panel,
.content-page > .topic-grid,
.content-page > .mistake-grid,
.content-page > .current-rules-grid,
.content-page > .table-scroll,
.content-page > .source-box,
.content-page > .full-width-cta,
.site-footer {
    content-visibility: auto;
    contain-intrinsic-block-size: auto 360px;
}

.menu-btn[data-mode].ambient-motion-paused,
.menu-btn[data-mode].ambient-motion-paused::before,
.menu-btn[data-mode].ambient-motion-paused::after,
.hero-primary-cta.ambient-motion-paused,
.hero-primary-cta.ambient-motion-paused::after,
.path-cta.ambient-motion-paused,
.path-cta.ambient-motion-paused::before,
.page-quiz-cta.ambient-motion-paused,
.page-quiz-cta.ambient-motion-paused::before {
    animation-play-state: paused !important;
}

body.theme-light .three-r-flow,
body.theme-light .three-r-card,
body.theme-light .ownership-rule > div:not(.ownership-divider) {
    background: var(--glass-card);
}

body.theme-light .three-r-tabs button {
    color: #334155;
    background: rgba(255, 255, 255, 0.8);
}

body.theme-light .three-r-result strong,
body.theme-light .three-r-card h3,
body.theme-light .ownership-rule h3 {
    color: #0f172a;
}

@media (max-width: 820px) {
    .three-r-stage {
        grid-template-columns: 1fr;
    }

    .three-r-connector {
        min-height: 25px;
    }

    .three-r-connector span {
        transform: rotate(90deg);
    }
}

@media (max-width: 640px) {
    .three-r-flow {
        padding: 18px 14px;
    }

    .three-r-tabs {
        grid-template-columns: 1fr;
    }

    .ownership-rule {
        grid-template-columns: 1fr;
    }

    .ownership-divider {
        min-height: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .three-r-flow::after,
    .three-r-result.result-pulse {
        animation: none;
    }
}

@media print {
    .three-r-flow,
    .three-r-card,
    .ownership-rule > div:not(.ownership-divider),
    .three-r-result {
        color: #111827;
        background: white !important;
        box-shadow: none !important;
    }

    .three-r-tabs,
    .three-r-flow::after {
        display: none !important;
    }

    .three-r-card {
        opacity: 1;
        transform: none;
    }
}

/* ====================================================== */
/* ======== ANIMATED STUDY EXPLANATIONS ================= */
/* ====================================================== */

.study-visual {
    position: relative;
    overflow: hidden;
    margin: 28px 0;
    padding: clamp(20px, 4vw, 30px);
    border: 1px solid transparent;
    border-radius: 22px;
    background:
        radial-gradient(circle at 4% 8%, rgba(56, 189, 248, 0.13), transparent 30%) padding-box,
        radial-gradient(circle at 96% 96%, rgba(168, 85, 247, 0.12), transparent 31%) padding-box,
        linear-gradient(145deg, rgba(20, 30, 50, 0.97), rgba(9, 16, 31, 0.96)) padding-box,
        linear-gradient(110deg, #38bdf8, #a855f7 34%, #fbbf24 67%, #22c55e, #38bdf8) border-box;
    background-size: 100% 100%, 100% 100%, 100% 100%, 240% 100%;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.09),
        0 24px 58px rgba(2, 6, 23, 0.38),
        0 0 40px rgba(56, 189, 248, 0.06);
    animation: study-visual-border 10s linear infinite;
    scroll-margin-top: 18px;
}

.study-visual::after {
    content: "";
    position: absolute;
    z-index: 0;
    width: 240px;
    height: 240px;
    top: -175px;
    left: 28%;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.1);
    filter: blur(12px);
    animation: study-visual-glow 11s ease-in-out infinite alternate;
    pointer-events: none;
}

.study-visual > * {
    position: relative;
    z-index: 1;
}

.study-visual-head {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
}

.study-visual-head h2 {
    margin: 3px 0 8px;
    font-size: clamp(1.4rem, 4vw, 2.05rem);
}

.visual-live-pill {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 7px;
    align-items: center;
    margin-top: 3px;
    padding: 7px 10px;
    border: 1px solid rgba(253, 230, 138, 0.31);
    border-radius: 999px;
    color: #fef3c7;
    background: rgba(245, 158, 11, 0.08);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.72px;
    text-transform: uppercase;
}

.visual-live-pill i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.1), 0 0 14px #f59e0b;
    animation: study-live-pulse 1.8s ease-in-out infinite;
}

.visual-intro {
    max-width: 820px;
    margin: 0 0 20px;
    color: #cbd5e1;
}

.visual-readout {
    display: grid;
    gap: 4px;
    margin-top: 16px;
    padding: 17px 19px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 15px;
    background:
        linear-gradient(100deg, rgba(56, 189, 248, 0.09), transparent 58%),
        rgba(15, 23, 42, 0.67);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.visual-readout strong {
    color: #f8fafc;
    font-size: clamp(1rem, 2.4vw, 1.25rem);
}

.visual-readout p {
    margin: 0;
    color: #cbd5e1;
}

.visual-readout.visual-readout-pop {
    animation: visual-readout-pop 0.48s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.visual-safety-note {
    margin: 12px 0 0;
    padding: 12px 14px;
    border-left: 3px solid #fbbf24;
    border-radius: 10px;
    color: #dbeafe;
    background: rgba(245, 158, 11, 0.07);
}

.visual-safety-note strong { color: #fde68a; }

/* Refrigeration cycle */
.cycle-map {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr);
    grid-template-rows: auto 64px auto;
    grid-template-areas:
        "compressor top condenser"
        "left center right"
        "evaporator bottom metering";
    gap: 0;
    align-items: stretch;
    margin-top: 18px;
}

.cycle-node {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 5px;
    align-content: center;
    min-height: 126px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    color: #f8fafc;
    text-align: left;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 36%),
        rgba(15, 23, 42, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
    font: inherit;
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.cycle-node::after {
    content: "";
    position: absolute;
    inset: auto -35% -70% 18%;
    height: 100%;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.09);
    filter: blur(8px);
    transition: background 0.22s ease, transform 0.22s ease;
}

.cycle-node:hover,
.cycle-node:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(125, 211, 252, 0.55);
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.1);
}

.cycle-node:focus-visible,
.gear-choice:focus-visible,
.recovery-stage-track button:focus-visible,
.chiller-stage-track button:focus-visible,
.leak-program-tabs button:focus-visible,
.leak-rate-picker button:focus-visible {
    outline: 3px solid rgba(56, 189, 248, 0.4);
    outline-offset: 2px;
}

.cycle-node[aria-pressed="true"] {
    transform: translateY(-3px);
    border-color: #38bdf8;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.065), transparent 36%),
        linear-gradient(145deg, rgba(14, 165, 233, 0.17), rgba(15, 23, 42, 0.76));
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.1), 0 0 28px rgba(56, 189, 248, 0.15);
}

.cycle-node[aria-pressed="true"]::after {
    background: rgba(56, 189, 248, 0.18);
    transform: scale(1.22);
}

.cycle-node-number {
    color: #7dd3fc;
    font-size: 0.67rem;
    font-weight: 950;
    letter-spacing: 1.2px;
}

.cycle-node strong { position: relative; z-index: 1; font-size: 1.06rem; }
.cycle-node small { position: relative; z-index: 1; color: #94a3b8; line-height: 1.38; }
.cycle-compressor { grid-area: compressor; }
.cycle-condenser { grid-area: condenser; }
.cycle-metering { grid-area: metering; }
.cycle-evaporator { grid-area: evaporator; }
.cycle-arrow-top { grid-area: top; }
.cycle-arrow-right { grid-area: right; }
.cycle-arrow-bottom { grid-area: bottom; }
.cycle-arrow-left { grid-area: left; }

.cycle-arrow {
    position: relative;
    display: grid;
    place-items: center;
}

.cycle-arrow::before {
    content: "";
    display: block;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), #38bdf8, rgba(168, 85, 247, 0.16));
    box-shadow: 0 0 11px rgba(56, 189, 248, 0.2);
}

.cycle-arrow-top::before,
.cycle-arrow-bottom::before { width: 100%; height: 2px; }
.cycle-arrow-left::before,
.cycle-arrow-right::before { width: 2px; height: 100%; }

.cycle-arrow i {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7dd3fc;
    box-shadow: 0 0 12px #38bdf8;
}

.cycle-arrow-top i { left: -2px; animation: flow-x 2.3s ease-in-out infinite; }
.cycle-arrow-right i { top: -2px; animation: flow-y 2.3s 0.55s ease-in-out infinite; }
.cycle-arrow-bottom i { right: -2px; animation: flow-x-reverse 2.3s 1.1s ease-in-out infinite; }
.cycle-arrow-left i { bottom: -2px; animation: flow-y-reverse 2.3s 1.65s ease-in-out infinite; }

.cycle-center {
    grid-area: center;
    display: grid;
    place-content: center;
    color: #f8fafc;
    text-align: center;
}

.cycle-center span { color: #fbbf24; font-size: 0.63rem; font-weight: 950; letter-spacing: 1.2px; }
.cycle-center strong { font-size: 0.95rem; }
.cycle-center small { color: #94a3b8; font-size: 0.62rem; }

/* Recovery equipment comparison */
.gear-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.gear-choice {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    color: #f8fafc;
    text-align: left;
    background: rgba(15, 23, 42, 0.7);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    font: inherit;
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.gear-choice:hover,
.gear-choice:focus-visible { transform: translateY(-2px); border-color: rgba(251, 191, 36, 0.5); }
.gear-choice[aria-pressed="true"] { border-color: #fbbf24; box-shadow: 0 0 28px rgba(245, 158, 11, 0.12); }
.gear-choice > strong { color: #fef3c7; }
.gear-choice > small { color: #aebed2; line-height: 1.48; }

.gear-diagram {
    display: grid;
    grid-template-columns: auto minmax(20px, 1fr) auto minmax(20px, 1fr) auto;
    align-items: center;
    min-height: 62px;
}

.gear-diagram i {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 48px;
    min-height: 46px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.8);
    font-style: normal;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.gear-diagram .gear-driver { border-color: rgba(251, 191, 36, 0.42); color: #fde68a; }
.gear-diagram .gear-powered { border-color: rgba(74, 222, 128, 0.42); color: #bbf7d0; }
.gear-powered::after {
    content: "";
    position: absolute;
    width: 17px;
    height: 17px;
    border: 2px dotted #4ade80;
    border-radius: 50%;
    animation: gear-spin 3s linear infinite;
}

.gear-diagram .gear-flow {
    min-width: 0;
    min-height: 3px;
    border: 0;
    border-radius: 0;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.14), #38bdf8, rgba(56, 189, 248, 0.14));
    background-size: 200% 100%;
    box-shadow: 0 0 9px rgba(56, 189, 248, 0.14);
    animation: hose-flow 2s linear infinite;
}

/* Liquid, vapor, verify sequence */
.recovery-stage-track {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr) 32px minmax(0, 1fr);
    align-items: center;
}

.recovery-stage-track button,
.chiller-stage-track button {
    display: grid;
    gap: 4px;
    min-height: 96px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    color: #f8fafc;
    text-align: left;
    background: rgba(15, 23, 42, 0.68);
    font: inherit;
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.recovery-stage-track button:hover,
.recovery-stage-track button:focus-visible,
.chiller-stage-track button:hover,
.chiller-stage-track button:focus-visible { transform: translateY(-2px); border-color: rgba(125, 211, 252, 0.52); }
.recovery-stage-track button[aria-pressed="true"],
.chiller-stage-track button[aria-pressed="true"] { border-color: #38bdf8; box-shadow: 0 0 24px rgba(56, 189, 248, 0.13); }
.recovery-stage-track button span,
.chiller-stage-track button span { color: #7dd3fc; font-size: 0.65rem; font-weight: 950; letter-spacing: 1px; }
.recovery-stage-track button small { color: #94a3b8; line-height: 1.35; }

.sequence-flow {
    position: relative;
    display: block;
    height: 2px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.16), #38bdf8, rgba(168, 85, 247, 0.16));
}

.sequence-flow::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7dd3fc;
    box-shadow: 0 0 11px #38bdf8;
    transform: translateY(-50%);
    animation: flow-x 2.4s ease-in-out infinite;
}

.recovery-machine-scene {
    display: grid;
    grid-template-columns: 92px minmax(45px, 1fr) 104px minmax(45px, 1fr) 92px;
    align-items: center;
    max-width: 700px;
    min-height: 132px;
    margin: 15px auto 0;
}

.source-vessel,
.recovery-unit,
.recovery-cylinder {
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: end center;
    min-height: 92px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.source-vessel small,
.recovery-unit small,
.recovery-cylinder small { position: relative; z-index: 2; color: #cbd5e1; font-size: 0.59rem; font-weight: 850; }
.source-liquid { position: absolute; inset: 42% 8px 8px; border-radius: 8px 8px 11px 11px; background: rgba(56, 189, 248, 0.28); animation: liquid-wave 3s ease-in-out infinite; }
.recovery-unit i { position: absolute; top: 17px; width: 32px; height: 32px; border: 3px dotted #fbbf24; border-radius: 50%; animation: gear-spin 3.2s linear infinite; }
.recovery-cylinder { border-radius: 23px 23px 15px 15px; }
.recovery-cylinder i { position: absolute; inset: 58% 7px 7px; border-radius: 0 0 10px 10px; background: rgba(74, 222, 128, 0.23); transition: inset 0.35s ease; }

.recovery-hose {
    position: relative;
    height: 3px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.14), #38bdf8, rgba(56, 189, 248, 0.14));
}

.recovery-hose i,
.recovery-hose b,
.recovery-hose em {
    position: absolute;
    top: 50%;
    left: -3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7dd3fc;
    box-shadow: 0 0 10px #38bdf8;
    transform: translateY(-50%);
    animation: flow-x 2.1s ease-in-out infinite;
}
.recovery-hose b { animation-delay: 0.7s; }
.recovery-hose em { animation-delay: 1.4s; }
.recovery-machine-scene[data-recovery-mode="vapor"] .recovery-hose i,
.recovery-machine-scene[data-recovery-mode="vapor"] .recovery-hose b,
.recovery-machine-scene[data-recovery-mode="vapor"] .recovery-hose em { width: 4px; height: 4px; background: #c4b5fd; }
.recovery-machine-scene[data-recovery-mode="verify"] .recovery-hose i,
.recovery-machine-scene[data-recovery-mode="verify"] .recovery-hose b,
.recovery-machine-scene[data-recovery-mode="verify"] .recovery-hose em,
.recovery-machine-scene[data-recovery-mode="verify"] .recovery-unit i { animation-play-state: paused; opacity: 0.35; }

/* Low-pressure chiller sequence */
.chiller-scene {
    position: relative;
    min-height: 220px;
    margin: 8px 0 16px;
}

.chiller-vessel {
    position: absolute;
    overflow: hidden;
    display: grid;
    left: 50%;
    top: 22px;
    width: min(250px, 42%);
    height: 148px;
    place-content: center;
    border: 2px solid rgba(125, 211, 252, 0.44);
    border-radius: 46% 46% 28% 28%;
    color: #e0f2fe;
    text-align: center;
    background: radial-gradient(circle at 50% 24%, rgba(56, 189, 248, 0.12), transparent 45%), rgba(15, 23, 42, 0.78);
    box-shadow: inset 0 0 28px rgba(56, 189, 248, 0.07), 0 0 30px rgba(56, 189, 248, 0.08);
    transform: translateX(-50%);
}

.chiller-vessel b { font-size: 1.05rem; letter-spacing: 2px; }
.chiller-vessel small { color: #94a3b8; }
.chiller-gauge { position: absolute; top: 13px; left: 50%; width: 34px; height: 18px; border: 2px solid #fbbf24; border-bottom: 0; border-radius: 34px 34px 0 0; transform: translateX(-50%); }
.chiller-gauge::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 2px; height: 12px; background: #fde68a; transform: rotate(-34deg); transform-origin: bottom; animation: gauge-sweep 4s ease-in-out infinite alternate; }
.chiller-water { position: absolute; inset: auto 14px 9px; height: 28px; border-radius: 7px 7px 18px 18px; background: repeating-linear-gradient(90deg, rgba(56, 189, 248, 0.3) 0 14px, rgba(14, 165, 233, 0.17) 14px 28px); background-size: 56px 100%; animation: water-circulate 2.4s linear infinite; }

.chiller-air {
    position: absolute;
    top: 78px;
    width: calc(29% - 22px);
    color: #c4b5fd;
    font-size: 0.68rem;
    font-weight: 850;
}
.chiller-air::after { content: ""; position: absolute; top: 22px; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, #a78bfa); }
.chiller-air::before { content: ""; position: absolute; top: 19px; width: 7px; height: 7px; border-radius: 50%; background: #c4b5fd; box-shadow: 0 0 11px #8b5cf6; }
.chiller-air-left { left: 0; text-align: left; }
.chiller-air-left::after { left: 0; }
.chiller-air-left::before { left: 0; animation: flow-x 2.5s ease-in-out infinite; }
.chiller-air-right { right: 0; text-align: right; }
.chiller-air-right::after { right: 0; transform: rotate(180deg); }
.chiller-air-right::before { right: 0; animation: flow-x-reverse 2.5s ease-in-out infinite; }

.chiller-service-flow { position: absolute; left: 50%; top: 170px; width: 3px; height: 38px; background: linear-gradient(#38bdf8, #22c55e); transform: translateX(-50%); }
.chiller-service-flow i,
.chiller-service-flow b,
.chiller-service-flow em { position: absolute; top: 0; left: 50%; width: 7px; height: 7px; border-radius: 50%; background: #7dd3fc; box-shadow: 0 0 10px #38bdf8; transform: translateX(-50%); animation: flow-y 2.2s ease-in-out infinite; }
.chiller-service-flow b { animation-delay: 0.72s; }
.chiller-service-flow em { animation-delay: 1.44s; }
.chiller-service-label { position: absolute; top: 178px; left: calc(50% + 13px); color: #94a3b8; font-size: 0.61rem; }
.chiller-visual[data-chiller-mode="recharge"] .chiller-service-flow i,
.chiller-visual[data-chiller-mode="recharge"] .chiller-service-flow b,
.chiller-visual[data-chiller-mode="recharge"] .chiller-service-flow em { top: auto; bottom: 0; animation-name: flow-y-reverse; background: #86efac; }
.chiller-visual[data-chiller-mode="water"] .chiller-water { box-shadow: 0 0 20px rgba(56, 189, 248, 0.34); animation-duration: 1.25s; }
.chiller-visual[data-chiller-mode="vapor"] .chiller-service-flow i,
.chiller-visual[data-chiller-mode="vapor"] .chiller-service-flow b,
.chiller-visual[data-chiller-mode="vapor"] .chiller-service-flow em { width: 4px; height: 4px; background: #c4b5fd; }

.chiller-stage-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}
.chiller-stage-track button { min-height: 76px; }

/* Leak-rule decision map */
.leak-path-visual {
    background:
        radial-gradient(circle at 5% 5%, rgba(236, 72, 153, 0.13), transparent 30%) padding-box,
        radial-gradient(circle at 96% 95%, rgba(34, 197, 94, 0.12), transparent 31%) padding-box,
        linear-gradient(145deg, rgba(20, 30, 50, 0.97), rgba(9, 16, 31, 0.96)) padding-box,
        linear-gradient(110deg, #ec4899, #fbbf24 36%, #22c55e 69%, #38bdf8, #ec4899) border-box;
    background-size: 100% 100%, 100% 100%, 100% 100%, 240% 100%;
}

.leak-program-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 10px 0 14px;
}

.leak-program-tabs button {
    display: grid;
    gap: 3px;
    padding: 15px;
    border: 1px solid rgba(148, 163, 184, 0.19);
    border-radius: 13px;
    color: #f8fafc;
    text-align: left;
    background: rgba(15, 23, 42, 0.68);
    font: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.leak-program-tabs button:hover,
.leak-program-tabs button:focus-visible { transform: translateY(-2px); border-color: rgba(251, 191, 36, 0.5); }
.leak-program-tabs button[aria-pressed="true"] { border-color: #fbbf24; box-shadow: 0 0 24px rgba(245, 158, 11, 0.12); }
.leak-program-tabs small { color: #94a3b8; }

.leak-coverage-card {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 17px;
    border: 1px solid rgba(244, 114, 182, 0.3);
    border-radius: 16px;
    background: linear-gradient(100deg, rgba(236, 72, 153, 0.1), rgba(15, 23, 42, 0.66) 55%);
    transition: border-color 0.25s ease, background 0.25s ease;
}
.leak-path-visual[data-leak-program="hfc"] .leak-coverage-card { border-color: rgba(74, 222, 128, 0.34); background: linear-gradient(100deg, rgba(34, 197, 94, 0.1), rgba(15, 23, 42, 0.66) 55%); }
.coverage-threshold { display: grid; place-content: center; min-height: 92px; border-right: 1px solid rgba(148, 163, 184, 0.17); text-align: center; }
.coverage-threshold strong { color: #f9a8d4; font-size: clamp(2.3rem, 7vw, 3.8rem); line-height: 0.92; text-shadow: 0 0 28px currentColor; }
.leak-path-visual[data-leak-program="hfc"] .coverage-threshold strong { color: #86efac; }
.coverage-threshold small { margin-top: 7px; color: #94a3b8; font-size: 0.62rem; font-weight: 850; text-transform: uppercase; }
.leak-coverage-card > div { display: grid; gap: 4px; }
.leak-coverage-card > div strong { color: #f8fafc; }
.leak-coverage-card p { margin: 0; color: #cbd5e1; }

.leak-rate-picker { margin-top: 16px; }
.leak-rate-picker > p { margin: 0 0 9px; color: #cbd5e1; }
.leak-rate-picker > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.leak-rate-picker button { display: grid; gap: 2px; padding: 13px; border: 1px solid rgba(148, 163, 184, 0.18); border-radius: 12px; color: #f8fafc; text-align: left; background: rgba(15, 23, 42, 0.62); font: inherit; cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.leak-rate-picker button:hover,
.leak-rate-picker button:focus-visible { transform: translateY(-2px); border-color: rgba(125, 211, 252, 0.5); }
.leak-rate-picker button[aria-pressed="true"] { border-color: #38bdf8; box-shadow: 0 0 22px rgba(56, 189, 248, 0.12); }
.leak-rate-picker button span { color: #7dd3fc; font-size: 1.35rem; font-weight: 950; }
.leak-rate-picker button small { color: #94a3b8; line-height: 1.25; }

.leak-action-track {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr);
    align-items: center;
    margin-top: 15px;
}
.leak-action-track > div { display: grid; gap: 4px; min-height: 94px; align-content: center; padding: 12px; border: 1px solid rgba(148, 163, 184, 0.17); border-radius: 12px; background: rgba(15, 23, 42, 0.6); }
.leak-action-track > div span { color: #f9a8d4; font-size: 0.62rem; font-weight: 950; letter-spacing: 1px; }
.leak-action-track > div strong { color: #f8fafc; font-size: 0.83rem; }
.leak-action-track > div small { color: #94a3b8; font-size: 0.67rem; line-height: 1.3; }
.leak-action-track > i { position: relative; height: 2px; background: linear-gradient(90deg, rgba(244, 114, 182, 0.15), #f472b6, rgba(251, 191, 36, 0.15)); }
.leak-action-track > i::after { content: ""; position: absolute; top: 50%; left: 0; width: 6px; height: 6px; border-radius: 50%; background: #f9a8d4; box-shadow: 0 0 10px #ec4899; transform: translateY(-50%); animation: flow-x 2.3s ease-in-out infinite; }

@keyframes study-visual-border { to { background-position: 0 0, 0 0, 0 0, 240% 0; } }
@keyframes study-visual-glow { to { transform: translate(240px, 115px) scale(1.2); } }
@keyframes study-live-pulse { 50% { opacity: 0.5; transform: scale(0.82); } }
@keyframes visual-readout-pop { 0% { transform: translateY(5px) scale(0.988); } 55% { transform: translateY(-2px) scale(1.004); } }
@keyframes flow-x { 0%, 10% { left: -2px; opacity: 0; } 30%, 80% { opacity: 1; } 100% { left: calc(100% - 5px); opacity: 0; } }
@keyframes flow-x-reverse { 0%, 10% { right: -2px; opacity: 0; } 30%, 80% { opacity: 1; } 100% { right: calc(100% - 5px); opacity: 0; } }
@keyframes flow-y { 0%, 10% { top: -2px; opacity: 0; } 30%, 80% { opacity: 1; } 100% { top: calc(100% - 5px); opacity: 0; } }
@keyframes flow-y-reverse { 0%, 10% { bottom: -2px; opacity: 0; } 30%, 80% { opacity: 1; } 100% { bottom: calc(100% - 5px); opacity: 0; } }
@keyframes gear-spin { to { transform: rotate(360deg); } }
@keyframes hose-flow { to { background-position: 200% 0; } }
@keyframes liquid-wave { 50% { transform: translateY(4px) skewY(-2deg); } }
@keyframes gauge-sweep { to { transform: rotate(34deg); } }
@keyframes water-circulate { to { background-position: 56px 0; } }

body.theme-light .study-visual {
    background:
        radial-gradient(circle at 5% 5%, rgba(56, 189, 248, 0.09), transparent 30%) padding-box,
        radial-gradient(circle at 96% 95%, rgba(168, 85, 247, 0.07), transparent 31%) padding-box,
        linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(241, 245, 249, 0.9)) padding-box,
        linear-gradient(110deg, #0ea5e9, #8b5cf6, #f59e0b, #16a34a, #0ea5e9) border-box;
    background-size: 100% 100%, 100% 100%, 100% 100%, 240% 100%;
}

body.theme-light .cycle-node,
body.theme-light .gear-choice,
body.theme-light .recovery-stage-track button,
body.theme-light .chiller-stage-track button,
body.theme-light .leak-program-tabs button,
body.theme-light .leak-rate-picker button,
body.theme-light .leak-action-track > div,
body.theme-light .visual-readout { background-color: rgba(255, 255, 255, 0.8); }

body.theme-light .cycle-node,
body.theme-light .gear-choice,
body.theme-light .recovery-stage-track button,
body.theme-light .chiller-stage-track button,
body.theme-light .leak-program-tabs button,
body.theme-light .leak-rate-picker button,
body.theme-light .visual-readout strong,
body.theme-light .leak-coverage-card > div strong { color: #0f172a; }

body.theme-light .visual-intro,
body.theme-light .visual-readout p,
body.theme-light .gear-choice > small,
body.theme-light .leak-coverage-card p { color: #475569; }

@media (max-width: 760px) {
    .cycle-map {
        grid-template-columns: 1fr;
        grid-template-rows: auto 34px auto 34px auto 34px auto;
        grid-template-areas: "compressor" "top" "condenser" "right" "metering" "bottom" "evaporator";
    }
    .cycle-arrow-left,
    .cycle-center { display: none; }
    .cycle-arrow-top::before,
    .cycle-arrow-right::before,
    .cycle-arrow-bottom::before { width: 2px; height: 100%; }
    .cycle-arrow-top i,
    .cycle-arrow-right i,
    .cycle-arrow-bottom i { top: -2px; left: 50%; right: auto; bottom: auto; transform: translateX(-50%); animation-name: flow-y; }
    .cycle-arrow-right i { animation-delay: 0.55s; }
    .cycle-arrow-bottom i { animation-delay: 1.1s; }
    .recovery-stage-track { grid-template-columns: 1fr; gap: 0; }
    .sequence-flow { width: 2px; height: 28px; margin: 0 auto; background: linear-gradient(180deg, rgba(56, 189, 248, 0.16), #38bdf8, rgba(168, 85, 247, 0.16)); }
    .sequence-flow::after { top: -2px; left: 50%; transform: translateX(-50%); animation-name: flow-y; }
    .recovery-machine-scene { grid-template-columns: 72px minmax(25px, 1fr) 84px minmax(25px, 1fr) 72px; }
    .chiller-stage-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .leak-action-track { grid-template-columns: 1fr; gap: 0; }
    .leak-action-track > i { width: 2px; height: 24px; margin: 0 auto; background: linear-gradient(180deg, rgba(244, 114, 182, 0.15), #f472b6, rgba(251, 191, 36, 0.15)); }
    .leak-action-track > i::after { top: -2px; left: 50%; transform: translateX(-50%); animation-name: flow-y; }
}

@media (max-width: 560px) {
    .study-visual { padding: 18px 14px; border-radius: 18px; }
    .study-visual-head { display: block; }
    .visual-live-pill { margin: 0 0 14px; }
    .gear-choice-grid,
    .leak-program-tabs,
    .leak-rate-picker > div { grid-template-columns: 1fr; }
    .gear-diagram { grid-template-columns: auto minmax(12px, 1fr) auto minmax(12px, 1fr) auto; }
    .gear-diagram i { min-width: 42px; min-height: 42px; font-size: 0.52rem; }
    .recovery-machine-scene { grid-template-columns: 60px minmax(18px, 1fr) 70px minmax(18px, 1fr) 60px; min-height: 110px; }
    .source-vessel,
    .recovery-unit,
    .recovery-cylinder { min-height: 76px; padding: 7px 3px; }
    .recovery-unit i { width: 25px; height: 25px; }
    .chiller-vessel { width: 54%; }
    .chiller-air { width: 20%; font-size: 0.55rem; }
    .chiller-stage-track { grid-template-columns: 1fr; }
    .chiller-stage-track button { min-height: 66px; }
    .leak-coverage-card { grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 14px 11px; }
    .coverage-threshold { min-height: 110px; }
    .coverage-threshold strong { font-size: 2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
    .study-visual,
    .study-visual::after,
    .visual-live-pill i,
    .cycle-arrow i,
    .gear-powered::after,
    .gear-diagram .gear-flow,
    .sequence-flow::after,
    .recovery-unit i,
    .recovery-hose i,
    .recovery-hose b,
    .recovery-hose em,
    .source-liquid,
    .chiller-gauge::after,
    .chiller-water,
    .chiller-air::before,
    .chiller-service-flow i,
    .chiller-service-flow b,
    .chiller-service-flow em,
    .leak-action-track > i::after,
    .visual-readout.visual-readout-pop { animation: none; }
}

@media print {
    .study-visual,
    .cycle-node,
    .gear-choice,
    .recovery-stage-track button,
    .chiller-stage-track button,
    .leak-program-tabs button,
    .leak-coverage-card,
    .leak-rate-picker button,
    .leak-action-track > div,
    .visual-readout { color: #111827; background: white !important; box-shadow: none !important; }
    .study-visual { break-inside: avoid; border-color: #94a3b8; }
    .study-visual::after,
    .visual-live-pill,
    .cycle-arrow i,
    .gear-flow,
    .recovery-machine-scene,
    .chiller-scene,
    .sequence-flow::after,
    .leak-action-track > i::after { display: none !important; }
    .study-visual p,
    .study-visual small { color: #334155 !important; }
    .study-visual strong { color: #111827 !important; }
}

/* Component Lab v2: matched equipment views + guided flow */
.lab-flow-tour {
    display: grid;
    gap: 10px;
    margin: 12px 0 14px;
    padding: 14px;
    border: 1px solid rgba(125, 211, 252, 0.18);
    border-radius: 16px;
    background: linear-gradient(120deg, rgba(14, 165, 233, 0.085), rgba(15, 23, 42, 0.72) 52%, rgba(245, 158, 11, 0.055));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.lab-tour-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lab-tour-head > div { display: grid; gap: 3px; }
.lab-tour-head .lab-control-label { padding: 0; color: #7dd3fc; }
.lab-tour-head strong { color: #f8fafc; font-size: 0.9rem; }

.lab-play-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(74, 222, 128, 0.35);
    border-radius: 999px;
    color: #bbf7d0;
    background: rgba(20, 83, 45, 0.16);
    font: inherit;
    font-size: 0.68rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.lab-play-button:hover,
.lab-play-button:focus-visible { transform: translateY(-1px); border-color: #4ade80; box-shadow: 0 0 20px rgba(34, 197, 94, 0.18); }
.lab-play-button[aria-pressed="true"] { color: #fef3c7; border-color: rgba(251, 191, 36, 0.55); background: rgba(245, 158, 11, 0.13); box-shadow: 0 0 22px rgba(245, 158, 11, 0.13); }

.lab-play-button i {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid currentColor;
}

.lab-play-button[aria-pressed="true"] i { width: 8px; height: 9px; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }

.lab-step-controls {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}

.lab-step-controls button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "number title" "number detail";
    gap: 1px 7px;
    align-items: center;
    min-height: 62px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.17);
    border-radius: 11px;
    color: #f8fafc;
    text-align: left;
    background: rgba(15, 23, 42, 0.68);
    font: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.lab-step-controls button:hover,
.lab-step-controls button:focus-visible { transform: translateY(-2px); border-color: rgba(125, 211, 252, 0.44); }
.lab-step-controls button[aria-pressed="true"] { border-color: #38bdf8; background: linear-gradient(145deg, rgba(14, 165, 233, 0.14), rgba(15, 23, 42, 0.77)); box-shadow: 0 0 22px rgba(56, 189, 248, 0.13); }
.lab-step-controls .lab-step-full[aria-pressed="true"] { border-color: #fbbf24; background: linear-gradient(145deg, rgba(245, 158, 11, 0.14), rgba(15, 23, 42, 0.77)); box-shadow: 0 0 22px rgba(251, 191, 36, 0.14); }

.lab-step-controls button > span {
    grid-area: number;
    display: grid;
    width: 29px;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(125, 211, 252, 0.28);
    border-radius: 9px;
    color: #7dd3fc;
    background: rgba(14, 165, 233, 0.08);
    font-size: 0.7rem;
    font-weight: 950;
}

.lab-step-controls .lab-step-full > span { color: #fde68a; border-color: rgba(251, 191, 36, 0.32); background: rgba(245, 158, 11, 0.08); font-size: 0.95rem; }
.lab-step-controls button > strong { grid-area: title; font-size: 0.68rem; line-height: 1.2; }
.lab-step-controls button > small { grid-area: detail; color: #94a3b8; font-size: 0.57rem; line-height: 1.2; }

.lab-step-readout {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    min-height: 82px;
    padding: 12px 14px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    background: rgba(8, 18, 37, 0.6);
}

.lab-step-readout.lab-step-readout-pop { animation: lab-step-pop 0.4s ease; }
.lab-step-badge { display: grid; min-width: 64px; min-height: 34px; place-items: center; padding: 6px 9px; border: 1px solid rgba(125, 211, 252, 0.27); border-radius: 999px; color: #bae6fd; background: rgba(14, 165, 233, 0.09); font-size: 0.62rem; font-weight: 950; text-transform: uppercase; }
.lab-step-readout > div { display: grid; gap: 2px; }
.lab-step-readout strong { color: #f8fafc; font-size: 0.78rem; }
.lab-step-readout p { margin: 0; color: #cbd5e1; font-size: 0.7rem; line-height: 1.45; }

.lab-view-image {
    z-index: 2;
    opacity: 0;
    transform: scale(0.985);
    filter: saturate(0.92) brightness(0.92);
    transition: opacity 0.58s ease, transform 0.7s cubic-bezier(0.2, 0.78, 0.25, 1), filter 0.58s ease;
}

.component-lab[data-view="assembled"] .lab-view-assembled,
.component-lab[data-view="cutaway"] .lab-view-cutaway,
.component-lab[data-view="exploded"] .lab-view-exploded { opacity: 1; transform: scale(1); filter: none; }

.component-lab .lab-airflow,
.component-lab .lab-refrigerant-flow,
.component-lab .lab-fan-motion { opacity: 0; }

.component-lab[data-view="cutaway"][data-refrigerant="on"] .lab-refrigerant-flow { opacity: 1; }
.component-lab[data-view="cutaway"][data-airflow="on"][data-flow-step="3"] .lab-airflow,
.component-lab[data-view="cutaway"][data-airflow="on"][data-flow-step="full"] .lab-airflow { opacity: 1; }
.component-lab[data-view="cutaway"][data-airflow="on"][data-flow-step="3"] .lab-fan-motion,
.component-lab[data-view="cutaway"][data-airflow="on"][data-flow-step="full"] .lab-fan-motion { opacity: 0.5; }

.component-lab .ref-line,
.component-lab .ref-label { opacity: 0; transition: opacity 0.25s ease; }
.component-lab[data-flow-step="1"] .ref-suction,
.component-lab[data-flow-step="1"] .ref-label-suction { opacity: 1; }
.component-lab[data-flow-step="2"] .ref-discharge-a,
.component-lab[data-flow-step="2"] .ref-discharge-b,
.component-lab[data-flow-step="2"] .ref-label-vapor { opacity: 1; }
.component-lab[data-flow-step="3"] .ref-condense-top,
.component-lab[data-flow-step="3"] .ref-condense-side,
.component-lab[data-flow-step="3"] .ref-label-condensing { opacity: 1; }
.component-lab[data-flow-step="4"] .ref-liquid,
.component-lab[data-flow-step="4"] .ref-label-liquid { opacity: 1; }
.component-lab[data-flow-step="full"] .ref-line,
.component-lab[data-flow-step="full"] .ref-label { opacity: 1; }

.ref-label-suction { right: 3%; top: 79%; color: #bfdbfe; border-color: rgba(96, 165, 250, 0.32); }
.ref-label-condensing { left: 15%; top: 48%; color: #fef3c7; border-color: rgba(251, 191, 36, 0.32); }

.component-lab[data-view="assembled"] .lab-hotspot { opacity: 0; pointer-events: none; }
.component-lab[data-view="exploded"] .lab-hotspot { opacity: 1; }
.component-lab[data-view="exploded"] .hotspot-fan { left: 48%; top: 11%; }
.component-lab[data-view="exploded"] .hotspot-coil { left: 21%; top: 36%; }
.component-lab[data-view="exploded"] .hotspot-compressor { left: 46%; top: 69%; }
.component-lab[data-view="exploded"] .hotspot-controls { left: 68%; top: 31%; }
.component-lab[data-view="exploded"] .hotspot-valves { left: 66%; top: 68%; }

.component-lab[data-view="cutaway"][data-flow-step="1"] .hotspot-compressor,
.component-lab[data-view="cutaway"][data-flow-step="1"] .hotspot-valves { border-color: #60a5fa; box-shadow: 0 0 20px rgba(96, 165, 250, 0.26); }
.component-lab[data-view="cutaway"][data-flow-step="2"] .hotspot-compressor { border-color: #fb7185; box-shadow: 0 0 22px rgba(251, 113, 133, 0.3); }
.component-lab[data-view="cutaway"][data-flow-step="3"] .hotspot-fan,
.component-lab[data-view="cutaway"][data-flow-step="3"] .hotspot-coil { border-color: #fbbf24; box-shadow: 0 0 22px rgba(251, 191, 36, 0.32); }
.component-lab[data-view="cutaway"][data-flow-step="4"] .hotspot-coil,
.component-lab[data-view="cutaway"][data-flow-step="4"] .hotspot-valves { border-color: #4ade80; box-shadow: 0 0 22px rgba(74, 222, 128, 0.28); }

.lab-tour-playing .lab-step-controls button[aria-pressed="true"] { animation: lab-tour-step-pulse 1.35s ease-in-out infinite; }

body.theme-light .lab-flow-tour,
body.theme-light .lab-step-controls button,
body.theme-light .lab-step-readout { background-color: rgba(255, 255, 255, 0.82); }
body.theme-light .lab-tour-head strong,
body.theme-light .lab-step-controls button,
body.theme-light .lab-step-readout strong { color: #0f172a; }
body.theme-light .lab-step-readout p { color: #475569; }

@keyframes lab-step-pop { 0% { transform: translateY(4px); opacity: 0.65; } 60% { transform: translateY(-1px); } }
@keyframes lab-tour-step-pulse { 50% { box-shadow: 0 0 28px rgba(56, 189, 248, 0.28); } }

@media (max-width: 760px) {
    .lab-step-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lab-step-controls .lab-step-full { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
    .lab-flow-tour { padding: 12px 9px; }
    .lab-tour-head { align-items: start; }
    .lab-tour-head strong { font-size: 0.78rem; }
    .lab-play-button { padding-inline: 10px; }
    .lab-step-controls button { min-height: 58px; padding: 7px; }
    .lab-step-controls button > span { width: 26px; }
    .lab-step-readout { grid-template-columns: 1fr; gap: 7px; }
    .lab-step-badge { justify-self: start; min-height: 29px; }
    .lab-step-readout strong { font-size: 0.74rem; }
    .lab-step-readout p { font-size: 0.66rem; }
}

@media (prefers-reduced-motion: reduce) {
    .lab-view-image,
    .lab-step-readout.lab-step-readout-pop,
    .lab-tour-playing .lab-step-controls button[aria-pressed="true"] { animation: none !important; transition: none !important; }
}

@media print {
    .lab-flow-tour { color: #111827; background: white !important; box-shadow: none !important; }
    .lab-play-button,
    .lab-step-controls { display: none !important; }
    .lab-step-readout strong { color: #111827 !important; }
    .lab-step-readout p { color: #334155 !important; }
}

/* Indoor air-handler lab: matched views + three-path guided model */
.indoor-lab-page {
    --indoor-air: #38bdf8;
    --indoor-liquid: #4ade80;
    --indoor-mixture: #fbbf24;
    --indoor-vapor: #60a5fa;
    --indoor-water: #22d3ee;
}

.indoor-lab-hero {
    background:
        radial-gradient(circle at 8% 15%, rgba(56, 189, 248, 0.17), transparent 34%) padding-box,
        radial-gradient(circle at 92% 86%, rgba(34, 211, 238, 0.14), transparent 36%) padding-box,
        linear-gradient(145deg, rgba(15, 23, 42, 0.97), rgba(7, 14, 29, 0.98)) padding-box,
        linear-gradient(110deg, #38bdf8, #fbbf24 31%, #22d3ee 65%, #4ade80, #38bdf8) border-box;
}

.indoor-control-deck { grid-template-columns: minmax(270px, 1.15fr) minmax(330px, 1.2fr) auto; }
.indoor-flow-controls { grid-template-columns: auto repeat(3, minmax(0, 1fr)); }
.indoor-flow-controls .lab-toggle-condensate[aria-pressed="true"] {
    color: #a5f3fc;
    border-color: rgba(34, 211, 238, 0.48);
    background: rgba(6, 182, 212, 0.13);
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.12);
}

.indoor-component-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.indoor-component-lab .lab-stage { aspect-ratio: 1.404; }

.indoor-airflow,
.indoor-refrigerant-flow,
.indoor-condensate-flow {
    position: absolute;
    z-index: 10;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.indoor-component-lab[data-view="cutaway"][data-airflow="on"][data-flow-step="1"] .indoor-airflow,
.indoor-component-lab[data-view="cutaway"][data-airflow="on"][data-flow-step="3"] .indoor-airflow,
.indoor-component-lab[data-view="cutaway"][data-airflow="on"][data-flow-step="full"] .indoor-airflow,
.indoor-component-lab[data-view="cutaway"][data-refrigerant="on"][data-flow-step="2"] .indoor-refrigerant-flow,
.indoor-component-lab[data-view="cutaway"][data-refrigerant="on"][data-flow-step="3"] .indoor-refrigerant-flow,
.indoor-component-lab[data-view="cutaway"][data-refrigerant="on"][data-flow-step="full"] .indoor-refrigerant-flow,
.indoor-component-lab[data-view="cutaway"][data-condensate="on"][data-flow-step="3"] .indoor-condensate-flow,
.indoor-component-lab[data-view="cutaway"][data-condensate="on"][data-flow-step="4"] .indoor-condensate-flow,
.indoor-component-lab[data-view="cutaway"][data-condensate="on"][data-flow-step="full"] .indoor-condensate-flow { opacity: 1; }

.indoor-blower-motion {
    position: absolute;
    z-index: 11;
    left: 39.7%;
    top: 14.5%;
    width: 14.5%;
    height: 14.5%;
    overflow: hidden;
    opacity: 0;
    border-radius: 42%;
    pointer-events: none;
    filter: drop-shadow(0 0 7px rgba(125, 211, 252, 0.36));
    transition: opacity 0.25s ease;
}

.indoor-blower-motion i {
    position: absolute;
    inset: 9% 5%;
    border-radius: inherit;
    background: repeating-linear-gradient(0deg, transparent 0 5px, rgba(125, 211, 252, 0.34) 6px 8px, transparent 9px 13px);
    background-size: 100% 26px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 38%, transparent 76%);
    mask-image: radial-gradient(ellipse at center, #000 38%, transparent 76%);
    animation: indoor-blower-roll 0.75s linear infinite;
}

.indoor-component-lab[data-view="cutaway"][data-airflow="on"][data-flow-step="3"] .indoor-blower-motion,
.indoor-component-lab[data-view="cutaway"][data-airflow="on"][data-flow-step="full"] .indoor-blower-motion { opacity: 0.72; }

.indoor-air-dot {
    position: absolute;
    top: 86%;
    left: 38%;
    width: clamp(5px, 0.65vw, 9px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: #7dd3fc;
    box-shadow: 0 0 8px #38bdf8, 0 0 18px rgba(56, 189, 248, 0.72);
    animation: indoor-air-full-route 3.55s ease-in-out infinite;
}

.indoor-air-dot-1 { animation-delay: -0.15s; }
.indoor-air-dot-2 { animation-delay: -0.75s; }
.indoor-air-dot-3 { animation-delay: -1.35s; }
.indoor-air-dot-4 { animation-delay: -1.95s; }
.indoor-air-dot-5 { animation-delay: -2.55s; }
.indoor-air-dot-6 { animation-delay: -3.15s; }

.indoor-component-lab[data-flow-step="1"] .indoor-air-dot { animation-name: indoor-air-return-route; animation-duration: 2.2s; }
.indoor-component-lab[data-flow-step="3"] .indoor-air-dot { animation-name: indoor-air-conditioned-route; animation-duration: 3s; }
.indoor-airflow .indoor-flow-label { opacity: 0; transition: opacity 0.25s ease; }
.indoor-component-lab[data-flow-step="1"] .indoor-label-return,
.indoor-component-lab[data-flow-step="3"] .indoor-label-supply,
.indoor-component-lab[data-flow-step="full"] .indoor-airflow .indoor-flow-label { opacity: 1; }

.indoor-flow-label {
    position: absolute;
    z-index: 2;
    padding: 4px 7px;
    border: 1px solid rgba(125, 211, 252, 0.27);
    border-radius: 999px;
    color: #bae6fd;
    background: rgba(8, 18, 37, 0.84);
    box-shadow: 0 4px 16px rgba(2, 6, 23, 0.34);
    font-size: clamp(0.42rem, 0.9vw, 0.65rem);
    line-height: 1.25;
    white-space: nowrap;
}

.indoor-label-return { left: 22%; top: 86%; }
.indoor-label-supply { left: 42%; top: 5%; transform: translateX(-50%); }

.indoor-ref-line {
    position: absolute;
    height: clamp(3px, 0.43vw, 6px);
    border-radius: 999px;
    opacity: 0;
    background-size: 220% 100%;
    box-shadow: 0 0 8px currentColor;
    animation: lab-ref-stream 1.75s linear infinite;
    transition: opacity 0.25s ease;
}

.indoor-ref-liquid { left: 52.5%; top: 59.5%; width: 12%; color: #4ade80; background-image: repeating-linear-gradient(90deg, transparent 0 7px, #4ade80 8px 15px); transform: rotate(-5deg); }
.indoor-ref-meter { left: 51.5%; top: 57.8%; width: clamp(11px, 1.25vw, 16px); height: clamp(11px, 1.25vw, 16px); border: 2px solid #fbbf24; border-radius: 50%; color: #fbbf24; background: rgba(251, 191, 36, 0.14); box-shadow: 0 0 9px #fbbf24, 0 0 18px rgba(251, 191, 36, 0.48); animation: indoor-meter-pulse 1.25s ease-in-out infinite; }
.indoor-ref-evap-a { left: 49.7%; top: 60%; width: 18%; color: #22d3ee; background-image: repeating-linear-gradient(90deg, transparent 0 7px, #22d3ee 8px 15px); transform: rotate(-90deg); transform-origin: left center; animation-direction: reverse; }
.indoor-ref-evap-b { left: 32%; top: 58.5%; width: 17.5%; color: #38bdf8; background-image: repeating-linear-gradient(90deg, transparent 0 7px, #38bdf8 8px 15px); transform: rotate(-77deg); transform-origin: left center; animation-direction: reverse; }
.indoor-ref-suction { left: 50.5%; top: 54.8%; width: 14.5%; color: #60a5fa; background-image: repeating-linear-gradient(90deg, transparent 0 7px, #60a5fa 8px 15px); transform: rotate(-7deg); animation-direction: reverse; }

.indoor-refrigerant-flow .indoor-flow-label { opacity: 0; transition: opacity 0.25s ease; }
.indoor-label-meter { right: 4%; top: 62%; color: #fef3c7; border-color: rgba(251, 191, 36, 0.34); }
.indoor-label-evap { left: 4%; top: 42%; color: #cffafe; border-color: rgba(34, 211, 238, 0.34); }
.indoor-label-suction { right: 4%; top: 47%; color: #bfdbfe; border-color: rgba(96, 165, 250, 0.34); }

.indoor-component-lab[data-flow-step="2"] .indoor-ref-liquid,
.indoor-component-lab[data-flow-step="2"] .indoor-ref-meter,
.indoor-component-lab[data-flow-step="2"] .indoor-ref-evap-a,
.indoor-component-lab[data-flow-step="2"] .indoor-ref-evap-b,
.indoor-component-lab[data-flow-step="2"] .indoor-label-meter,
.indoor-component-lab[data-flow-step="2"] .indoor-label-evap,
.indoor-component-lab[data-flow-step="3"] .indoor-ref-evap-a,
.indoor-component-lab[data-flow-step="3"] .indoor-ref-evap-b,
.indoor-component-lab[data-flow-step="3"] .indoor-ref-suction,
.indoor-component-lab[data-flow-step="3"] .indoor-label-evap,
.indoor-component-lab[data-flow-step="3"] .indoor-label-suction,
.indoor-component-lab[data-flow-step="full"] .indoor-ref-line,
.indoor-component-lab[data-flow-step="full"] .indoor-refrigerant-flow .indoor-flow-label { opacity: 1; }

.indoor-drip {
    position: absolute;
    top: 54%;
    width: clamp(5px, 0.62vw, 8px);
    height: clamp(8px, 0.92vw, 12px);
    border-radius: 60% 45% 60% 60%;
    opacity: 0;
    background: #67e8f9;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.88);
    transform: rotate(45deg);
    animation: indoor-water-drop 1.8s ease-in infinite;
}

.indoor-drip-1 { left: 38%; animation-delay: -0.2s; }
.indoor-drip-2 { left: 45%; animation-delay: -0.85s; }
.indoor-drip-3 { left: 51%; animation-delay: -1.45s; }

.indoor-drain-line {
    position: absolute;
    opacity: 0;
    color: #22d3ee;
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.78));
    animation: indoor-drain-glow 1.8s ease-in-out infinite;
}

.indoor-drain-drop { left: 55.5%; top: 64%; width: 0; height: 21%; border-left: clamp(2px, 0.32vw, 4px) solid currentColor; }
.indoor-drain-trap { left: 55.4%; top: 82%; width: 7.8%; height: 9.2%; border: clamp(2px, 0.32vw, 4px) solid currentColor; border-top: 0; border-radius: 0 0 22px 22px; }
.indoor-drain-out { left: 62.5%; top: 84.8%; width: 15%; height: clamp(2px, 0.32vw, 4px); border-radius: 999px; background: repeating-linear-gradient(90deg, #67e8f9 0 9px, rgba(34, 211, 238, 0.18) 10px 17px); background-size: 180% 100%; animation: lab-ref-stream 1.4s linear infinite, indoor-drain-glow 1.8s ease-in-out infinite; }

.indoor-condensate-flow .indoor-flow-label { opacity: 0; transition: opacity 0.25s ease; }
.indoor-label-pan { left: 22%; top: 63%; color: #cffafe; border-color: rgba(34, 211, 238, 0.34); }
.indoor-label-drain { right: 4%; top: 80%; color: #a5f3fc; border-color: rgba(34, 211, 238, 0.38); }

.indoor-component-lab[data-flow-step="3"] .indoor-drip,
.indoor-component-lab[data-flow-step="3"] .indoor-label-pan,
.indoor-component-lab[data-flow-step="4"] .indoor-drain-line,
.indoor-component-lab[data-flow-step="4"] .indoor-label-drain,
.indoor-component-lab[data-flow-step="full"] .indoor-drip,
.indoor-component-lab[data-flow-step="full"] .indoor-drain-line,
.indoor-component-lab[data-flow-step="full"] .indoor-condensate-flow .indoor-flow-label { opacity: 1; }

.indoor-component-lab .hotspot-filter { left: 35%; top: 76%; }
.indoor-component-lab .hotspot-coil { left: 34%; top: 48%; }
.indoor-component-lab .hotspot-metering { left: 51.5%; top: 55.5%; }
.indoor-component-lab .hotspot-blower { left: 42%; top: 21%; }
.indoor-component-lab .hotspot-controls { left: 62%; top: 22%; }
.indoor-component-lab .hotspot-drain { left: 60%; top: 76%; }

.indoor-component-lab[data-component="filter"] .hotspot-filter,
.indoor-component-lab[data-component="coil"] .hotspot-coil,
.indoor-component-lab[data-component="metering"] .hotspot-metering,
.indoor-component-lab[data-component="blower"] .hotspot-blower,
.indoor-component-lab[data-component="controls"] .hotspot-controls,
.indoor-component-lab[data-component="drain"] .hotspot-drain { border-color: #fbbf24; box-shadow: 0 0 22px rgba(251, 191, 36, 0.32); animation: lab-hotspot-pulse 2.1s ease-in-out infinite; }

.indoor-component-lab[data-view="exploded"] .hotspot-filter { left: 25%; top: 77%; }
.indoor-component-lab[data-view="exploded"] .hotspot-coil { left: 23%; top: 43%; }
.indoor-component-lab[data-view="exploded"] .hotspot-metering { left: 42%; top: 43%; }
.indoor-component-lab[data-view="exploded"] .hotspot-blower { left: 41%; top: 18%; }
.indoor-component-lab[data-view="exploded"] .hotspot-controls { left: 73%; top: 18%; }
.indoor-component-lab[data-view="exploded"] .hotspot-drain { left: 59%; top: 80%; }

.indoor-component-lab[data-view="cutaway"][data-flow-step="1"] .hotspot-filter { border-color: #38bdf8; box-shadow: 0 0 22px rgba(56, 189, 248, 0.3); }
.indoor-component-lab[data-view="cutaway"][data-flow-step="2"] .hotspot-metering,
.indoor-component-lab[data-view="cutaway"][data-flow-step="2"] .hotspot-coil { border-color: #fbbf24; box-shadow: 0 0 22px rgba(251, 191, 36, 0.3); }
.indoor-component-lab[data-view="cutaway"][data-flow-step="3"] .hotspot-coil,
.indoor-component-lab[data-view="cutaway"][data-flow-step="3"] .hotspot-blower { border-color: #22d3ee; box-shadow: 0 0 22px rgba(34, 211, 238, 0.3); }
.indoor-component-lab[data-view="cutaway"][data-flow-step="4"] .hotspot-drain { border-color: #22d3ee; box-shadow: 0 0 24px rgba(34, 211, 238, 0.36); }

/* The exploded guide reuses exact pixels from the final exploded image.
   Each clipped component begins over its installed cutaway position and lands
   directly on the matching component in the final frame. */
.indoor-assembly-tour {
    display: none;
    border-color: rgba(251, 191, 36, 0.22);
    background:
        radial-gradient(circle at 10% 20%, rgba(244, 114, 182, 0.08), transparent 38%),
        linear-gradient(145deg, rgba(13, 23, 43, 0.95), rgba(7, 15, 30, 0.96));
}

.indoor-component-lab[data-view="exploded"] .indoor-flow-tour { display: none; }
.indoor-component-lab[data-view="exploded"] .indoor-assembly-tour { display: block; animation: lab-step-pop 0.4s ease; }
.indoor-assembly-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.indoor-assembly-play { color: #fff7d6; border-color: rgba(251, 191, 36, 0.38); background: rgba(245, 158, 11, 0.1); }
.indoor-assembly-play:hover,
.indoor-assembly-play:focus-visible { border-color: rgba(251, 191, 36, 0.68); box-shadow: 0 0 23px rgba(251, 191, 36, 0.16); }
.assembly-tour-playing .indoor-assembly-play i { animation: lab-live-pulse 0.9s ease-in-out infinite; }
.assembly-tour-playing .indoor-assembly-steps button[aria-pressed="true"] { animation: lab-tour-step-pulse 1.15s ease-in-out infinite; }

.indoor-component-lab[data-view="exploded"] .lab-view-cutaway,
.indoor-component-lab[data-view="exploded"] .lab-view-exploded { filter: none; transform: scale(1); }
.indoor-component-lab[data-view="exploded"][data-assembly-step="0"] .lab-view-cutaway { opacity: 1; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="0"] .lab-view-exploded { opacity: 0; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="1"] .lab-view-cutaway { opacity: 0.9; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="1"] .lab-view-exploded { opacity: 0.06; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="2"] .lab-view-cutaway { opacity: 0.75; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="2"] .lab-view-exploded { opacity: 0.08; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="3"] .lab-view-cutaway { opacity: 0.6; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="3"] .lab-view-exploded { opacity: 0.1; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="4"] .lab-view-cutaway { opacity: 0.45; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="4"] .lab-view-exploded { opacity: 0.1; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="5"] .lab-view-cutaway { opacity: 0.3; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="5"] .lab-view-exploded { opacity: 0.12; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="6"] .lab-view-cutaway { opacity: 0.18; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="6"] .lab-view-exploded { opacity: 0.14; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="full"] .lab-view-cutaway { opacity: 0; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="full"] .lab-view-exploded { opacity: 1; }

.indoor-explode-sequence {
    position: absolute;
    z-index: 4;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.indoor-component-lab[data-view="exploded"] .indoor-explode-sequence { opacity: 1; }

.indoor-explode-part {
    --from-x: 0%;
    --from-y: 0%;
    --from-scale: 0.96;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: translate3d(var(--from-x), var(--from-y), 0) scale(var(--from-scale));
    transform-origin: center;
    transition:
        transform 1.18s cubic-bezier(0.16, 0.86, 0.22, 1),
        opacity 0.34s ease,
        filter 0.28s ease;
}

.indoor-explode-part.is-separated { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
.indoor-explode-part.is-current { z-index: 2; will-change: transform, opacity; animation: indoor-explode-focus 1.1s ease-in-out infinite alternate; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="full"] .indoor-explode-part { opacity: 0; transition-delay: 0.22s; }

.indoor-explode-panel-left { --from-x: 30.5%; --from-y: -3%; clip-path: polygon(7% 11%, 18% 11%, 18% 65%, 7% 65%); }
.indoor-explode-panel-right { --from-x: -22%; --from-y: -1%; clip-path: polygon(82% 28%, 92% 28%, 92% 84%, 82% 84%); }
.indoor-explode-filter { --from-x: 12%; --from-y: -4%; clip-path: polygon(15% 70%, 46% 70%, 46% 96%, 15% 96%); }
.indoor-explode-pan { --from-x: 13%; --from-y: -3%; clip-path: polygon(14% 59%, 48% 59%, 48% 79%, 14% 79%); }
.indoor-explode-drain { --from-x: 7%; --from-y: -2%; clip-path: polygon(43% 67%, 78% 67%, 78% 99%, 43% 99%); }
.indoor-explode-coil { --from-x: 12%; --from-y: 2%; clip-path: polygon(14% 27%, 53% 27%, 53% 65%, 14% 65%); }
.indoor-explode-blower { --from-x: -1%; --from-y: 2%; --from-scale: 0.82; clip-path: polygon(31% 6%, 61% 6%, 61% 35%, 31% 35%); }
.indoor-explode-controls { --from-x: -13%; --from-y: 0%; clip-path: polygon(72% 6%, 86% 6%, 86% 35%, 72% 35%); }

.indoor-component-lab[data-view="exploded"] .indoor-hotspot { opacity: 0; pointer-events: none; }
.indoor-component-lab[data-view="exploded"][data-assembly-step="2"] .hotspot-filter,
.indoor-component-lab[data-view="exploded"][data-assembly-step="3"] .hotspot-drain,
.indoor-component-lab[data-view="exploded"][data-assembly-step="4"] .hotspot-coil,
.indoor-component-lab[data-view="exploded"][data-assembly-step="4"] .hotspot-metering,
.indoor-component-lab[data-view="exploded"][data-assembly-step="5"] .hotspot-blower,
.indoor-component-lab[data-view="exploded"][data-assembly-step="6"] .hotspot-controls,
.indoor-component-lab[data-view="exploded"][data-assembly-step="full"] .indoor-hotspot { opacity: 1; pointer-events: auto; }

@keyframes indoor-explode-focus {
    from { filter: brightness(1.02) drop-shadow(0 0 2px rgba(251, 191, 36, 0.18)); }
    to { filter: brightness(1.1) drop-shadow(0 0 11px rgba(56, 189, 248, 0.68)); }
}

.indoor-drain-panel { border-color: rgba(34, 211, 238, 0.24); background: linear-gradient(125deg, rgba(8, 145, 178, 0.13), rgba(15, 23, 42, 0.8) 54%); }
.indoor-drain-panel p { margin-top: 0; }
.indoor-drain-panel p + p { margin-top: 12px; }

.paired-equipment-panel {
    display: grid;
    grid-template-columns: minmax(300px, 1.1fr) minmax(260px, 0.9fr);
    gap: clamp(20px, 4vw, 38px);
    align-items: center;
    margin: 30px 0;
    padding: clamp(20px, 4vw, 32px);
    border: 1px solid rgba(251, 191, 36, 0.22);
    border-radius: 22px;
    background: radial-gradient(circle at 24% 50%, rgba(56, 189, 248, 0.1), transparent 43%), linear-gradient(120deg, rgba(15, 23, 42, 0.9), rgba(8, 18, 37, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 22px 55px rgba(2, 6, 23, 0.22);
}

.paired-equipment-panel h2 { margin: 4px 0 10px; }
.paired-equipment-panel p:not(.section-kicker) { color: #cbd5e1; }
.paired-equipment-art { position: relative; display: flex; align-items: center; min-height: 190px; }
.paired-equipment-art img { position: relative; z-index: 2; width: 52%; height: auto; object-fit: contain; filter: drop-shadow(0 16px 24px rgba(2, 6, 23, 0.34)); }
.paired-equipment-art img:last-child { margin-left: -7%; }
.paired-equipment-art i { position: absolute; z-index: 1; left: 41%; right: 35%; top: 51%; height: 3px; border-radius: 999px; background: repeating-linear-gradient(90deg, #60a5fa 0 8px, transparent 9px 15px, #fbbf24 16px 24px, transparent 25px 31px); background-size: 190% 100%; box-shadow: 0 0 10px rgba(96, 165, 250, 0.5); animation: lab-ref-stream 2s linear infinite; }

@keyframes indoor-air-return-route {
    0% { left: 38%; top: 89%; opacity: 0; transform: scale(0.72); }
    16% { opacity: 1; }
    58% { left: 38%; top: 80%; opacity: 1; transform: scale(1); }
    100% { left: 38.5%; top: 70%; opacity: 0; transform: scale(0.78); }
}

@keyframes indoor-air-conditioned-route {
    0% { left: 38.5%; top: 65%; opacity: 0; transform: scale(0.72); }
    12% { opacity: 1; }
    38% { left: 40%; top: 46%; opacity: 1; transform: scale(1); }
    72% { left: 44%; top: 23%; opacity: 1; }
    100% { left: 46%; top: 5%; opacity: 0; transform: scale(0.78); }
}

@keyframes indoor-air-full-route {
    0% { left: 38%; top: 89%; opacity: 0; transform: scale(0.72); }
    10% { opacity: 1; }
    28% { left: 38.5%; top: 70%; opacity: 1; transform: scale(0.92); }
    55% { left: 40%; top: 46%; transform: scale(1); }
    79% { left: 44%; top: 23%; opacity: 1; }
    100% { left: 46%; top: 5%; opacity: 0; transform: scale(0.78); }
}

@keyframes indoor-meter-pulse { 50% { transform: scale(1.18); box-shadow: 0 0 13px #fbbf24, 0 0 24px rgba(251, 191, 36, 0.6); } }
@keyframes indoor-blower-roll { to { background-position: 0 26px; } }

@keyframes indoor-water-drop {
    0% { top: 54%; opacity: 0; transform: rotate(45deg) scale(0.7); }
    24% { opacity: 1; }
    100% { top: 64%; opacity: 0; transform: rotate(45deg) scale(1); }
}

@keyframes indoor-drain-glow { 50% { filter: drop-shadow(0 0 9px rgba(34, 211, 238, 0.95)); } }

body.theme-light .paired-equipment-panel { background-color: rgba(255, 255, 255, 0.9); }
body.theme-light .paired-equipment-panel h2 { color: #0f172a; }
body.theme-light .paired-equipment-panel p:not(.section-kicker) { color: #475569; }

@media (max-width: 1040px) {
    .indoor-control-deck { grid-template-columns: 1fr 1fr; }
    .indoor-control-deck .lab-zoom-controls { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .indoor-control-deck { grid-template-columns: 1fr; }
    .indoor-control-deck .lab-zoom-controls { grid-column: auto; }
    .indoor-component-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .paired-equipment-panel { grid-template-columns: 1fr; }
    .paired-equipment-art { min-height: 165px; }
    .indoor-assembly-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .indoor-flow-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .indoor-flow-controls .lab-control-label { grid-column: 1 / -1; }
    .indoor-flow-controls button { padding-inline: 5px; font-size: 0.61rem; }
    .indoor-hotspot { padding-right: 4px; }
    .indoor-hotspot b { display: none; }
    .indoor-flow-label { padding: 3px 5px; font-size: 0.39rem; }
    .paired-equipment-art { min-height: 135px; }
}

@media (prefers-reduced-motion: reduce) {
    .indoor-air-dot,
    .indoor-blower-motion i,
    .indoor-ref-line,
    .indoor-drip,
    .indoor-drain-line,
    .indoor-explode-part,
    .indoor-explode-part.is-current,
    .assembly-tour-playing .indoor-assembly-steps button[aria-pressed="true"],
    .paired-equipment-art i { animation: none !important; }
    .indoor-explode-part { transition: none !important; }
}

@media print {
    .indoor-airflow,
    .indoor-refrigerant-flow,
    .indoor-condensate-flow,
    .indoor-assembly-tour,
    .indoor-explode-sequence { display: none !important; }
    .paired-equipment-panel { color: #111827; background: white !important; box-shadow: none !important; }
}

/* =====================================================
   HVAC DUCT SIZE + ROOM AIRFLOW PLANNER
   ===================================================== */
.duct-planner-page {
    --duct-cyan: #38bdf8;
    --duct-blue: #60a5fa;
    --duct-gold: #fbbf24;
    --duct-green: #4ade80;
    --duct-pink: #f472b6;
    --duct-panel: rgba(10, 20, 38, 0.9);
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.duct-planner-hero {
    position: relative;
    overflow: hidden;
    margin: 18px 0 24px;
    padding: clamp(25px, 5vw, 46px);
    border: 1px solid transparent;
    border-radius: 25px;
    background:
        radial-gradient(circle at 8% 15%, rgba(56, 189, 248, 0.19), transparent 35%) padding-box,
        radial-gradient(circle at 92% 86%, rgba(244, 114, 182, 0.15), transparent 36%) padding-box,
        linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(6, 14, 28, 0.99)) padding-box,
        linear-gradient(110deg, #38bdf8, #fbbf24 32%, #4ade80 65%, #f472b6, #38bdf8) border-box;
    background-size: 100% 100%, 100% 100%, 100% 100%, 270% 100%;
    box-shadow: 0 26px 75px rgba(2, 6, 23, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: lab-prism-border 9s linear infinite;
}

.duct-planner-hero::after {
    content: "";
    position: absolute;
    inset: -50% auto -50% -20%;
    width: 22%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transform: skewX(-18deg);
    pointer-events: none;
    animation: lab-hero-sweep 8.5s ease-in-out infinite;
}

.duct-planner-hero h1 { max-width: 900px; margin: 5px 0 15px; }
.duct-planner-lede { max-width: 860px; color: #cbd5e1; font-size: clamp(1.03rem, 2vw, 1.2rem); }

.duct-planner-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.duct-planner-facts li {
    padding: 9px 12px;
    border: 1px solid rgba(148, 163, 184, 0.19);
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.58);
    font-size: 0.75rem;
    font-weight: 800;
}

.duct-planner-facts b { margin-right: 3px; color: #fde68a; }

.duct-safety-banner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 15px;
    align-items: start;
    margin: 22px 0;
    padding: 18px;
    border: 1px solid rgba(251, 191, 36, 0.27);
    border-radius: 17px;
    background: linear-gradient(110deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0.76) 58%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.duct-safety-banner > span {
    display: grid;
    width: 38px;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(251, 191, 36, 0.42);
    border-radius: 12px;
    color: #111827;
    background: #fbbf24;
    box-shadow: 0 0 22px rgba(251, 191, 36, 0.22);
    font-weight: 950;
}

.duct-safety-banner h2 { margin: 0 0 6px; color: #fef3c7; font-size: 1rem; }
.duct-safety-banner p { margin: 0; color: #cbd5e1; font-size: 0.82rem; }

.duct-planner {
    position: relative;
    overflow: hidden;
    margin: 26px 0 36px;
    padding: clamp(16px, 3.5vw, 31px);
    border: 1px solid transparent;
    border-radius: 26px;
    background:
        radial-gradient(circle at 4% 2%, rgba(56, 189, 248, 0.13), transparent 30%) padding-box,
        radial-gradient(circle at 96% 98%, rgba(74, 222, 128, 0.1), transparent 32%) padding-box,
        linear-gradient(145deg, rgba(10, 20, 38, 0.99), rgba(5, 12, 25, 0.99)) padding-box,
        linear-gradient(110deg, #38bdf8, #fbbf24 32%, #4ade80 65%, #f472b6, #38bdf8) border-box;
    background-size: 100% 100%, 100% 100%, 100% 100%, 280% 100%;
    box-shadow: 0 30px 90px rgba(2, 6, 23, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.055);
    animation: lab-prism-border 9s linear infinite;
}

.duct-planner::before {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.06);
    pointer-events: none;
    animation: lab-ambient-orbit 13s ease-in-out infinite alternate;
}

.duct-planner > * { position: relative; z-index: 1; }
.duct-planner-heading,
.duct-subhead { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.duct-planner-heading h2,
.duct-subhead h3 { margin: 3px 0 12px; }

.duct-live-pill,
.duct-result-warning {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 999px;
    color: #bbf7d0;
    background: rgba(20, 83, 45, 0.18);
    font-size: 0.63rem;
    font-weight: 950;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.duct-live-pill i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 12px #22c55e;
    animation: lab-live-pulse 1.7s ease-in-out infinite;
}

.duct-input-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
    margin: 8px 0 14px;
}

.duct-input-card {
    min-width: 0;
    margin: 0;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.duct-input-card legend {
    padding: 0 7px;
    color: #fde68a;
    font-size: 0.73rem;
    font-weight: 950;
    letter-spacing: 0.35px;
}

.duct-input-card > label,
.duct-source-panel > label,
.duct-inline-inputs label {
    display: grid;
    gap: 5px;
    color: #cbd5e1;
    font-size: 0.68rem;
    font-weight: 850;
}

.duct-input-card input[type="number"],
.duct-input-card select,
.duct-room-row input,
.duct-room-row select {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, 0.23);
    border-radius: 9px;
    color: #f8fafc;
    background: rgba(8, 18, 37, 0.82);
    font: inherit;
    font-size: 0.77rem;
    font-weight: 750;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.duct-input-card input:focus,
.duct-input-card select:focus,
.duct-room-row input:focus,
.duct-room-row select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.13), 0 0 18px rgba(56, 189, 248, 0.1);
}

.duct-input-unit,
.duct-mini-unit { position: relative; margin: 6px 0 10px; }
.duct-input-unit input { padding-right: 54px !important; }
.duct-mini-unit input { padding-right: 37px !important; }
.duct-input-unit > span,
.duct-mini-unit > span {
    position: absolute;
    right: 10px;
    top: 50%;
    color: #7dd3fc;
    font-size: 0.63rem;
    font-weight: 900;
    transform: translateY(-50%);
    pointer-events: none;
}

.duct-inline-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0 11px; }

.duct-action-button,
.duct-add-room,
.duct-print-button {
    min-height: 39px;
    padding: 9px 12px;
    border: 1px solid rgba(251, 191, 36, 0.42);
    border-radius: 10px;
    color: #fff7d6;
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.18), rgba(15, 23, 42, 0.8));
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.09);
    font: inherit;
    font-size: 0.69rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.duct-action-button { width: 100%; }
.duct-action-button:hover,
.duct-action-button:focus-visible,
.duct-add-room:hover,
.duct-add-room:focus-visible,
.duct-print-button:hover,
.duct-print-button:focus-visible { transform: translateY(-2px); border-color: #fbbf24; box-shadow: 0 0 22px rgba(251, 191, 36, 0.17); }

.duct-add-room { color: #bbf7d0; border-color: rgba(74, 222, 128, 0.38); background: rgba(20, 83, 45, 0.16); }
.duct-print-button { color: #bae6fd; border-color: rgba(56, 189, 248, 0.35); background: rgba(14, 165, 233, 0.1); }
.duct-field-note,
.duct-caution-note { margin: 9px 0 0; color: #94a3b8; font-size: 0.62rem; line-height: 1.5; }
.duct-caution-note { padding: 8px; border: 1px solid rgba(251, 191, 36, 0.18); border-radius: 9px; color: #fde68a; background: rgba(245, 158, 11, 0.07); }

.duct-radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.duct-radio-row label { cursor: pointer; }
.duct-radio-row input { position: absolute; opacity: 0; pointer-events: none; }
.duct-radio-row span {
    display: grid;
    min-height: 42px;
    place-items: center;
    padding: 7px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 9px;
    color: #94a3b8;
    background: rgba(8, 18, 37, 0.56);
    font-size: 0.64rem;
    font-weight: 850;
    text-align: center;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.duct-radio-row input:checked + span { color: #bae6fd; border-color: rgba(56, 189, 248, 0.5); background: rgba(14, 165, 233, 0.12); box-shadow: 0 0 17px rgba(56, 189, 248, 0.1); }
.duct-radio-row input:focus-visible + span { outline: 2px solid #fbbf24; outline-offset: 2px; }
.duct-source-panel[hidden] { display: none; }

.duct-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 13px 0;
}

.duct-summary article {
    display: grid;
    gap: 3px;
    min-height: 98px;
    align-content: center;
    padding: 13px;
    border: 1px solid rgba(56, 189, 248, 0.17);
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(14, 165, 233, 0.085), rgba(15, 23, 42, 0.7));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.duct-summary span { color: #7dd3fc; font-size: 0.59rem; font-weight: 950; letter-spacing: 0.65px; text-transform: uppercase; }
.duct-summary strong { color: #f8fafc; font-size: clamp(0.85rem, 1.45vw, 1.08rem); }
.duct-summary small { color: #94a3b8; font-size: 0.58rem; line-height: 1.3; }

.duct-plan-layout { display: grid; grid-template-columns: minmax(360px, 0.95fr) minmax(380px, 1.05fr); gap: 12px; margin: 14px 0; }
.duct-room-editor,
.duct-map-panel,
.duct-results-panel {
    padding: 17px;
    border: 1px solid rgba(148, 163, 184, 0.17);
    border-radius: 17px;
    background: rgba(15, 23, 42, 0.66);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.duct-editor-intro { margin: 0 0 11px; color: #94a3b8; font-size: 0.66rem; }
.duct-room-list { display: grid; gap: 7px; max-height: 550px; padding-right: 3px; overflow-y: auto; scrollbar-color: rgba(56, 189, 248, 0.35) transparent; }
.duct-room-row {
    display: grid;
    grid-template-columns: auto minmax(116px, 1.25fr) minmax(82px, 0.66fr) minmax(96px, 0.72fr) minmax(80px, 0.62fr) auto;
    gap: 6px;
    align-items: end;
    padding: 9px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 11px;
    background: rgba(8, 18, 37, 0.58);
    transition: border-color 0.2s ease, background 0.2s ease;
}
.duct-room-row:focus-within { border-color: rgba(56, 189, 248, 0.34); background: rgba(8, 18, 37, 0.76); }
.duct-room-number { align-self: center; color: #fbbf24; font-size: 0.6rem; font-weight: 950; }
.duct-room-row label { display: grid; gap: 3px; color: #64748b; font-size: 0.52rem; font-weight: 900; text-transform: uppercase; }
.duct-room-row input,
.duct-room-row select { min-height: 35px; padding: 6px 7px; font-size: 0.65rem; text-transform: none; }
.duct-room-row .duct-mini-unit { margin: 0; }
.duct-remove-room {
    display: grid;
    width: 32px;
    min-height: 35px;
    place-items: center;
    border: 1px solid rgba(251, 113, 133, 0.22);
    border-radius: 8px;
    color: #fda4af;
    background: rgba(159, 18, 57, 0.08);
    font: inherit;
    font-size: 1rem;
    cursor: pointer;
}
.duct-remove-room:hover,
.duct-remove-room:focus-visible { border-color: #fb7185; background: rgba(159, 18, 57, 0.18); }
.duct-area-status { margin: 10px 0 0; padding: 8px 10px; border-radius: 9px; font-size: 0.62rem; font-weight: 800; }
.duct-area-status.is-matched { color: #bbf7d0; background: rgba(20, 83, 45, 0.14); }
.duct-area-status.is-warning { color: #fde68a; background: rgba(146, 64, 14, 0.14); }

.duct-map {
    position: relative;
    overflow: hidden;
    min-height: 500px;
    padding: 18px 12px;
    border: 1px solid rgba(56, 189, 248, 0.16);
    border-radius: 15px;
    background:
        linear-gradient(rgba(56, 189, 248, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 50% 2%, rgba(56, 189, 248, 0.13), transparent 34%),
        #081225;
    background-size: 24px 24px, 24px 24px, 100% 100%, 100% 100%;
    box-shadow: inset 0 0 45px rgba(56, 189, 248, 0.04);
}

.duct-handler-node {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    width: min(210px, 78%);
    margin: 0 auto;
    padding: 10px 13px;
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.14), rgba(15, 23, 42, 0.9));
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.1);
}
.duct-handler-node > i {
    width: 37px;
    aspect-ratio: 1;
    border: 2px solid rgba(186, 230, 253, 0.35);
    border-radius: 50%;
    background: conic-gradient(from 10deg, #7dd3fc 0 11%, transparent 12% 24%, #7dd3fc 25% 36%, transparent 37% 49%, #7dd3fc 50% 61%, transparent 62% 74%, #7dd3fc 75% 86%, transparent 87%);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.22);
    animation: lab-fan-spin 2.2s linear infinite;
}
.duct-handler-node div { display: grid; gap: 2px; }
.duct-handler-node span { color: #fde68a; font-size: 0.59rem; font-weight: 950; letter-spacing: 0.6px; text-transform: uppercase; }
.duct-handler-node strong { color: #f8fafc; font-size: 0.88rem; }

.duct-main-line {
    position: relative;
    z-index: 1;
    width: 7px;
    height: 31px;
    margin: 0 auto;
    border-inline: 1px solid rgba(125, 211, 252, 0.22);
    background: rgba(14, 165, 233, 0.13);
}
.duct-main-line i,
.duct-floor-branch i,
.duct-room-feed::after {
    position: absolute;
    content: "";
    border-radius: 999px;
    background: repeating-linear-gradient(90deg, #7dd3fc 0 8px, transparent 9px 15px);
    background-size: 190% 100%;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.62);
    animation: lab-ref-stream 1.65s linear infinite;
}
.duct-main-line i { left: 2px; top: 0; bottom: 0; width: 3px; background-image: repeating-linear-gradient(180deg, #7dd3fc 0 8px, transparent 9px 15px); background-size: 100% 190%; }
.duct-floor-stack { position: relative; z-index: 2; display: grid; gap: 16px; }
.duct-floor { position: relative; padding: 11px 8px 10px; border: 1px solid rgba(148, 163, 184, 0.13); border-radius: 13px; background: rgba(15, 23, 42, 0.62); }
.duct-floor + .duct-floor::before { content: ""; position: absolute; left: 50%; top: -17px; width: 5px; height: 17px; background: rgba(56, 189, 248, 0.2); transform: translateX(-50%); }
.duct-floor-label { display: flex; align-items: center; justify-content: center; gap: 7px; margin-bottom: 6px; }
.duct-floor-label span { display: grid; width: 25px; aspect-ratio: 1; place-items: center; border: 1px solid rgba(251, 191, 36, 0.3); border-radius: 7px; color: #fde68a; background: rgba(245, 158, 11, 0.08); font-size: 0.57rem; font-weight: 950; }
.duct-floor-label strong { color: #cbd5e1; font-size: 0.67rem; }
.duct-floor-branch { position: relative; width: 72%; height: 6px; margin: 0 auto 13px; border: 1px solid rgba(125, 211, 252, 0.2); border-radius: 999px; background: rgba(14, 165, 233, 0.1); }
.duct-floor-branch i { inset: 1px; height: 2px; }
.duct-room-map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.duct-map-room {
    position: relative;
    display: grid;
    gap: 2px;
    min-height: 69px;
    align-content: center;
    padding: 10px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(14, 165, 233, 0.09), rgba(8, 18, 37, 0.8));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    animation: duct-room-breathe 3.2s var(--room-delay, 0s) ease-in-out infinite;
}
.duct-map-room.load-low { border-color: rgba(74, 222, 128, 0.25); }
.duct-map-room.load-high { border-color: rgba(244, 114, 182, 0.3); }
.duct-map-room > span { overflow: hidden; color: #cbd5e1; font-size: 0.58rem; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.duct-map-room > strong { color: #f8fafc; font-size: 0.78rem; }
.duct-map-room > small { color: #7dd3fc; font-size: 0.55rem; }
.duct-room-feed { position: absolute; left: 50%; top: -14px; width: 4px; height: 14px; background: rgba(56, 189, 248, 0.2); transform: translateX(-50%); }
.duct-room-feed::after { inset: 0 1px; width: 2px; background-image: repeating-linear-gradient(180deg, #7dd3fc 0 5px, transparent 6px 10px); background-size: 100% 180%; }

.duct-map-legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 0; padding: 0; color: #94a3b8; list-style: none; font-size: 0.58rem; }
.duct-map-legend li { display: inline-flex; align-items: center; gap: 5px; }
.duct-map-legend i { width: 8px; height: 8px; border-radius: 50%; background: #38bdf8; box-shadow: 0 0 7px currentColor; }
.duct-map-legend .load-low { color: #4ade80; background: #4ade80; }
.duct-map-legend .load-high { color: #f472b6; background: #f472b6; }

.duct-results-panel { margin-top: 14px; }
.duct-result-warning { color: #fde68a; border-color: rgba(251, 191, 36, 0.32); background: rgba(245, 158, 11, 0.1); }
.duct-results-table { min-width: 960px; }
.duct-results-table tbody th { color: #f8fafc; text-align: left; }
.duct-results-table td strong { color: #bae6fd; }
.duct-results-table td small { display: block; color: #64748b; font-size: 0.58rem; }
.duct-results-table tfoot { border-top: 2px solid rgba(251, 191, 36, 0.26); color: #fef3c7; font-weight: 850; }
.duct-load-chip { display: inline-flex; padding: 4px 7px; border: 1px solid rgba(56, 189, 248, 0.22); border-radius: 999px; color: #bae6fd; background: rgba(14, 165, 233, 0.08); font-size: 0.58rem; font-weight: 900; }
.duct-load-chip.load-low { color: #bbf7d0; border-color: rgba(74, 222, 128, 0.25); background: rgba(20, 83, 45, 0.11); }
.duct-load-chip.load-high { color: #fbcfe8; border-color: rgba(244, 114, 182, 0.27); background: rgba(157, 23, 77, 0.1); }

.duct-method-grid,
.duct-design-sequence,
.duct-planner-page .content-section {
    margin: 30px 0;
    padding: clamp(21px, 4vw, 32px);
    border: 1px solid rgba(148, 163, 184, 0.17);
    border-radius: 21px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(8, 18, 37, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.duct-method-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.65fr); gap: 28px; align-items: center; }
.duct-method-grid h2,
.duct-design-sequence h2,
.duct-planner-page .content-section h2 { margin: 4px 0 13px; }
.duct-method-copy p:last-child { margin-bottom: 0; }
.duct-formula-card {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 22px;
    border: 1px solid rgba(56, 189, 248, 0.26);
    border-radius: 18px;
    background: radial-gradient(circle at 50% 20%, rgba(56, 189, 248, 0.13), transparent 56%), rgba(8, 18, 37, 0.72);
    text-align: center;
}
.duct-formula-card figcaption { color: #7dd3fc; font-size: 0.62rem; font-weight: 950; letter-spacing: 0.8px; text-transform: uppercase; }
.duct-formula-card strong { color: #f8fafc; font-size: clamp(1rem, 2vw, 1.3rem); }
.duct-formula-card i { width: 70%; height: 4px; margin: 2px auto; border-radius: 999px; background: linear-gradient(90deg, #38bdf8, #fbbf24, #4ade80); box-shadow: 0 0 13px rgba(56, 189, 248, 0.25); animation: duct-formula-pulse 2.6s ease-in-out infinite; }
.duct-formula-card small { color: #94a3b8; font-size: 0.65rem; line-height: 1.5; }

.duct-design-sequence ol { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin: 18px 0 0; padding: 0; list-style: none; }
.duct-design-sequence li { position: relative; min-height: 190px; padding: 16px; border: 1px solid rgba(148, 163, 184, 0.15); border-radius: 14px; background: rgba(8, 18, 37, 0.58); }
.duct-design-sequence li:not(:last-child)::after { content: "›"; position: absolute; z-index: 2; right: -10px; top: 23px; color: #fbbf24; font-size: 1.25rem; font-weight: 950; }
.duct-design-sequence li > span { display: grid; width: 35px; aspect-ratio: 1; place-items: center; margin-bottom: 11px; border: 1px solid rgba(56, 189, 248, 0.3); border-radius: 10px; color: #bae6fd; background: rgba(14, 165, 233, 0.09); font-weight: 950; }
.duct-design-sequence li:last-child > span { color: #bbf7d0; border-color: rgba(74, 222, 128, 0.3); background: rgba(20, 83, 45, 0.12); }
.duct-design-sequence strong { color: #f8fafc; font-size: 0.75rem; }
.duct-design-sequence p { margin: 6px 0 0; color: #94a3b8; font-size: 0.66rem; line-height: 1.5; }
.duct-next-cta { background: radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.12), transparent 38%), linear-gradient(125deg, rgba(15, 23, 42, 0.9), rgba(8, 18, 37, 0.94)); }

@keyframes duct-room-breathe { 50% { box-shadow: 0 0 18px rgba(56, 189, 248, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.05); transform: translateY(-1px); } }
@keyframes duct-formula-pulse { 50% { width: 86%; filter: brightness(1.18); } }

body.theme-light .duct-planner-hero,
body.theme-light .duct-planner,
body.theme-light .duct-input-card,
body.theme-light .duct-room-editor,
body.theme-light .duct-map-panel,
body.theme-light .duct-results-panel,
body.theme-light .duct-method-grid,
body.theme-light .duct-design-sequence,
body.theme-light .duct-planner-page .content-section { color: #0f172a; }
body.theme-light .duct-planner-lede,
body.theme-light .duct-safety-banner p,
body.theme-light .duct-editor-intro { color: #475569; }
body.theme-light .duct-input-card,
body.theme-light .duct-room-editor,
body.theme-light .duct-map-panel,
body.theme-light .duct-results-panel { background-color: rgba(255, 255, 255, 0.88); }
body.theme-light .duct-input-card input,
body.theme-light .duct-input-card select,
body.theme-light .duct-room-row input,
body.theme-light .duct-room-row select { color: #0f172a; background: #fff; }
body.theme-light .duct-summary strong,
body.theme-light .duct-subhead h3,
body.theme-light .duct-planner-heading h2 { color: #0f172a; }

@media (max-width: 1060px) {
    .duct-input-grid { grid-template-columns: 1fr 1fr; }
    .duct-input-grid .duct-input-card:last-child { grid-column: 1 / -1; }
    .duct-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .duct-plan-layout { grid-template-columns: 1fr; }
    .duct-room-list { max-height: none; }
    .duct-design-sequence ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .duct-design-sequence li:not(:last-child)::after { display: none; }
}

@media (max-width: 760px) {
    .duct-input-grid { grid-template-columns: 1fr; }
    .duct-input-grid .duct-input-card:last-child { grid-column: auto; }
    .duct-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .duct-summary article:last-child { grid-column: 1 / -1; }
    .duct-room-row { grid-template-columns: auto minmax(0, 1fr) minmax(85px, 0.55fr) auto; }
    .duct-room-row label:nth-of-type(3),
    .duct-room-row label:nth-of-type(4) { grid-row: 2; }
    .duct-room-row label:nth-of-type(3) { grid-column: 2; }
    .duct-room-row label:nth-of-type(4) { grid-column: 3; }
    .duct-remove-room { grid-column: 4; grid-row: 1; }
    .duct-method-grid { grid-template-columns: 1fr; }
    .duct-design-sequence ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
    .duct-planner-hero { padding: 23px 18px; border-radius: 20px; }
    .duct-planner { padding: 15px 11px; border-radius: 20px; }
    .duct-safety-banner { grid-template-columns: 1fr; }
    .duct-planner-heading,
    .duct-subhead { align-items: stretch; flex-direction: column; }
    .duct-live-pill,
    .duct-result-warning { align-self: start; }
    .duct-inline-inputs,
    .duct-radio-row { grid-template-columns: 1fr; }
    .duct-summary { grid-template-columns: 1fr 1fr; }
    .duct-summary article { min-height: 88px; padding: 10px; }
    .duct-room-editor,
    .duct-map-panel,
    .duct-results-panel { padding: 12px 9px; }
    .duct-room-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .duct-room-row label:nth-of-type(1) { grid-column: 2; }
    .duct-room-row label:nth-of-type(2) { grid-column: 2; grid-row: 2; }
    .duct-room-row label:nth-of-type(3) { grid-column: 2; grid-row: 3; }
    .duct-room-row label:nth-of-type(4) { grid-column: 2; grid-row: 4; }
    .duct-remove-room { grid-column: 3; grid-row: 1; }
    .duct-room-number { grid-row: 1 / 5; }
    .duct-map { min-height: 430px; padding-inline: 8px; }
    .duct-room-map-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
    .duct-map-room { padding: 8px; }
    .duct-design-sequence ol { grid-template-columns: 1fr; }
    .duct-design-sequence li { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .duct-planner-hero,
    .duct-planner,
    .duct-planner-hero::after,
    .duct-planner::before,
    .duct-live-pill i,
    .duct-handler-node > i,
    .duct-main-line i,
    .duct-floor-branch i,
    .duct-room-feed::after,
    .duct-map-room,
    .duct-formula-card i { animation: none !important; }
}

@media print {
    .duct-planner-hero,
    .duct-safety-banner,
    .duct-planner,
    .duct-method-grid,
    .duct-design-sequence,
    .duct-planner-page .content-section { color: #111827 !important; background: white !important; box-shadow: none !important; }
    .duct-input-grid,
    .duct-room-editor,
    .duct-print-button,
    .duct-live-pill,
    .duct-map-legend { display: none !important; }
    .duct-plan-layout { display: block; }
    .duct-map-panel,
    .duct-results-panel { break-inside: avoid; border-color: #94a3b8; background: white !important; box-shadow: none !important; }
    .duct-map { min-height: 0; color: #111827; background: white !important; }
    .duct-map-room,
    .duct-handler-node,
    .duct-floor { color: #111827; background: white !important; box-shadow: none !important; }
    .duct-map-room strong,
    .duct-handler-node strong,
    .duct-floor-label strong { color: #111827 !important; }
}

.footer-disclaimer {
    margin: 0 auto 6px;
    max-width: 640px;
}

.safety-notice {
    margin: 12px 0 18px;
    padding: 10px 14px;
    border-left: 4px solid #d97706;
    border-radius: 6px;
    background: rgba(217, 119, 6, 0.1);
    font-size: 0.92rem;
}

.content-page > p + p {
    margin-top: 12px;
}

/* ====================================================== */
/* ============== BLOG POST + ARCHIVE CARDS ============== */
/* ====================================================== */

.blog-post article {
    min-width: 0;
}

.blog-post article > p,
.blog-post .quick-answer,
.blog-post .myth-list,
.blog-post .post-sources,
.blog-post .post-quiz {
    max-width: 70ch;
}

.blog-post h1 {
    text-wrap: balance;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.blog-post h2 {
    margin-top: 1.7em;
    margin-bottom: 0.7em;
    padding-left: 12px;
    border-left: 3px solid #2dd4bf;
    line-height: 1.3;
}

.blog-post article > p {
    margin-bottom: 1em;
    line-height: 1.75;
}

.blog-post .post-hero,
.blog-post .post-figure {
    margin: 0 0 18px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.45);
}

.blog-post .post-hero {
    margin-top: 4px;
}

.blog-post .post-hero img,
.blog-post .post-figure img,
.blog-list-thumb img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.blog-post .post-figure figcaption {
    padding: 10px 14px 12px;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.blog-post .post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    list-style: none;
}

.blog-post .post-meta li {
    padding: 4px 10px;
    border: 1px solid rgba(45, 212, 191, 0.28);
    border-radius: 999px;
    background: rgba(45, 212, 191, 0.1);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 650;
    line-height: 1.4;
}

.blog-post .quick-answer {
    margin: 0 0 18px;
    padding: 16px 18px 16px 20px;
    border: 1px solid rgba(45, 212, 191, 0.28);
    border-left: 4px solid #2dd4bf;
    border-radius: 0 12px 12px 0;
    background: rgba(45, 212, 191, 0.08);
}

.blog-post .quick-answer-label {
    margin-bottom: 6px;
    color: #5eead4;
    font-size: 0.76rem;
    font-weight: 800;
}

.blog-post .quick-answer p:last-child {
    margin: 0;
    color: var(--text-main);
    line-height: 1.7;
}

.blog-post .post-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 22px;
}

.blog-post .post-stats div {
    padding: 14px 10px;
    border: 1px solid rgba(45, 212, 191, 0.22);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.45);
    text-align: center;
}

.blog-post .post-stats strong {
    display: block;
    color: #5eead4;
    font-size: clamp(1.15rem, 3.4vw, 1.55rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.blog-post .post-stats span {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.blog-post .myth-list {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
}

.blog-post .myth-card {
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    background: var(--glass-card, rgba(15, 23, 42, 0.55));
}

.blog-post .myth-card p {
    margin: 0;
    line-height: 1.55;
}

.blog-post .myth-card p + p {
    margin-top: 8px;
}

.blog-post .myth-label,
.blog-post .fact-label {
    display: inline-block;
    margin-right: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.5;
}

.blog-post .myth-label {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.18);
}

.blog-post .fact-label {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.18);
}

.blog-post .post-sources {
    margin-top: 8px;
}

.blog-post .post-sources h2 {
    margin-top: 1.4em;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.blog-post .post-sources ul {
    margin: 0;
    list-style: none;
}

.blog-post .post-sources li {
    margin: 0 0 8px;
    padding-left: 10px;
    border-left: 2px solid rgba(148, 163, 184, 0.28);
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.blog-post .post-cta {
    margin-top: 22px;
    padding: 20px;
    border: 1px solid rgba(45, 212, 191, 0.3);
    border-radius: 16px;
    background:
        radial-gradient(circle at 100% 0, rgba(45, 212, 191, 0.16), transparent 42%),
        rgba(15, 23, 42, 0.45);
}

.blog-post .post-cta h2 {
    margin-top: 0;
}

.blog-post .post-cta p {
    margin-bottom: 14px;
    max-width: 70ch;
    line-height: 1.65;
}

.blog-post .post-cta-btn {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 10px;
    background: #0f766e;
    color: #f8fafc;
    font-weight: 800;
    text-decoration: none;
}

.blog-post .post-cta-btn:hover,
.blog-post .post-cta-btn:focus-visible {
    color: #ffffff;
    background: #0d9488;
}

.blog-post .post-cta-btn:focus-visible {
    outline: 2px solid #5eead4;
    outline-offset: 3px;
}

.blog-list-card {
    display: grid;
    grid-template-columns: minmax(0, 168px) minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    margin: 16px 0 0;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: var(--glass-card, rgba(15, 23, 42, 0.55));
}

.blog-list-card + .blog-list-card {
    margin-top: 12px;
}

.blog-list-thumb {
    display: block;
    min-height: 104px;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.45);
    text-decoration: none;
}

.blog-list-thumb img {
    height: 104px;
    object-fit: cover;
}

.blog-list-copy {
    min-width: 0;
}

.blog-list-copy h2 {
    margin: 0 0 6px;
    font-size: 1.08rem;
}

.blog-list-copy p {
    margin: 0;
}

.blog-list-copy p + p {
    margin-top: 6px;
}

.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 80;
    pointer-events: none;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: linear-gradient(90deg, #2dd4bf 0%, #2dd4bf 62%, #fbbf24 88%, #f59e0b 100%);
}

@media (prefers-reduced-motion: no-preference) {
    .read-progress {
        transition: transform 0.08s linear;
    }
}

.blog-post .post-quiz {
    margin: 0 0 18px;
}

.blog-post .post-quiz-item + .post-quiz-item {
    margin-top: 14px;
}

.blog-post .post-quiz-q {
    margin: 0 0 8px;
    font-weight: 650;
    line-height: 1.5;
}

.blog-post .post-quiz-options {
    display: grid;
    gap: 8px;
}

.blog-post .post-quiz-opt {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.45);
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.blog-post .post-quiz-opt:hover,
.blog-post .post-quiz-opt:focus-visible {
    border-color: rgba(45, 212, 191, 0.55);
}

.blog-post .post-quiz-opt:focus-visible {
    outline: 2px solid #5eead4;
    outline-offset: 2px;
}

.blog-post .post-quiz-item.is-answered .post-quiz-opt {
    pointer-events: none;
}

.blog-post .post-quiz-opt.is-right {
    border-color: rgba(34, 197, 94, 0.7);
    background: rgba(34, 197, 94, 0.16);
}

.blog-post .post-quiz-opt.is-wrong {
    border-color: rgba(239, 68, 68, 0.7);
    background: rgba(239, 68, 68, 0.16);
}

.blog-post .post-quiz-answer {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.blog-post .post-quiz-answer summary {
    cursor: pointer;
    color: #5eead4;
    font-size: 0.8rem;
    font-weight: 700;
}

.blog-post .post-quiz-answer p {
    margin: 8px 0 0;
}

.blog-post .post-related {
    margin-top: 22px;
}

.blog-post .post-related .blog-list-card {
    margin-top: 12px;
}

body.theme-light .blog-post h2 {
    border-left-color: #0f766e;
}

body.theme-light .blog-post .post-hero,
body.theme-light .blog-post .post-figure,
body.theme-light .blog-post .post-stats div,
body.theme-light .blog-post .myth-card,
body.theme-light .blog-post .post-cta,
body.theme-light .blog-post .post-quiz-opt,
body.theme-light .blog-list-card {
    background: #f1f5f9;
}

body.theme-light .blog-post .post-meta li {
    background: rgba(13, 148, 136, 0.1);
    border-color: rgba(13, 148, 136, 0.28);
}

body.theme-light .blog-post .quick-answer {
    background: rgba(13, 148, 136, 0.08);
    border-color: rgba(13, 148, 136, 0.28);
    border-left-color: #0f766e;
}

body.theme-light .blog-post .quick-answer-label,
body.theme-light .blog-post .post-stats strong {
    color: #0f766e;
}

body.theme-light .blog-post .myth-label {
    color: #991b1b;
    background: #fee2e2;
}

body.theme-light .blog-post .fact-label {
    color: #166534;
    background: #dcfce7;
}

body.theme-light .blog-post .post-cta {
    background:
        radial-gradient(circle at 100% 0, rgba(13, 148, 136, 0.12), transparent 42%),
        #f1f5f9;
}

body.theme-light .read-progress {
    background: linear-gradient(90deg, #0f766e 0%, #0f766e 62%, #d97706 88%, #b45309 100%);
}

body.theme-light .blog-post .post-quiz-answer summary {
    color: #0f766e;
}

body.theme-light .blog-post .post-quiz-opt.is-right {
    background: #dcfce7;
    border-color: #86efac;
}

body.theme-light .blog-post .post-quiz-opt.is-wrong {
    background: #fee2e2;
    border-color: #fca5a5;
}

@media (max-width: 700px) {
    .blog-post .post-stats {
        gap: 8px;
    }

    .blog-post .post-stats strong {
        font-size: 1.05rem;
    }

    .blog-post .post-hero,
    .blog-post .post-figure {
        border-radius: 12px;
    }

    .blog-list-card {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .blog-list-thumb {
        min-height: 168px;
    }

    .blog-list-thumb img {
        height: 168px;
    }

    .blog-post .post-cta-btn {
        display: block;
        text-align: center;
    }
}

/* Blog post extras: lists, tables, checklists, worked examples, FAQ. Posts using these load style.css?v=48. */
.blog-post article > ul,
.blog-post article > ol,
.blog-post .post-checklist,
.blog-post .worked-example,
.blog-post .post-faq {
    max-width: 70ch;
}

.blog-post article > ul,
.blog-post article > ol {
    margin: 0 0 1em 22px;
}

.blog-post article > ul li,
.blog-post article > ol li {
    margin-bottom: 6px;
}

.blog-post .table-scroll {
    margin-bottom: 18px;
}

.blog-post .comparison-table th,
.blog-post .comparison-table td {
    padding: 10px 12px;
    font-size: 0.92rem;
    line-height: 1.5;
}

.blog-post .comparison-table tbody th {
    background: rgba(15, 23, 42, 0.56);
}

.blog-post .post-checklist {
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
    list-style: none;
}

.blog-post .post-checklist li {
    position: relative;
    padding: 10px 12px 10px 40px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.45);
    line-height: 1.55;
}

.blog-post .post-checklist li::before {
    content: "";
    position: absolute;
    top: 13px;
    left: 13px;
    width: 14px;
    height: 14px;
    border: 2px solid #2dd4bf;
    border-radius: 4px;
}

.blog-post .worked-example {
    margin: 0 0 18px;
    padding: 16px 18px 16px 20px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-left: 4px solid #fbbf24;
    border-radius: 0 12px 12px 0;
    background: rgba(251, 191, 36, 0.07);
}

.blog-post .worked-example-label {
    margin-bottom: 6px;
    color: #fcd34d;
    font-size: 0.76rem;
    font-weight: 800;
}

.blog-post .worked-example p {
    margin: 0 0 8px;
    line-height: 1.7;
}

.blog-post .worked-example p:last-child {
    margin-bottom: 0;
}

.blog-post .worked-example .table-scroll {
    margin: 10px 0;
}

.blog-post .post-faq h3 {
    margin: 18px 0 6px;
    font-size: 1rem;
    line-height: 1.4;
}

.blog-post .post-faq p {
    margin: 0;
    line-height: 1.7;
}

body.theme-light .blog-post .post-checklist li,
body.theme-light .blog-post .comparison-table tbody th {
    background: #f1f5f9;
}

body.theme-light .blog-post .post-checklist li::before {
    border-color: #0f766e;
}

body.theme-light .blog-post .worked-example {
    border-color: rgba(217, 119, 6, 0.3);
    border-left-color: #d97706;
    background: rgba(217, 119, 6, 0.08);
}

body.theme-light .blog-post .worked-example-label {
    color: #b45309;
}

/* Phones: a "stack" table turns each row into a card (cells are labeled with data-label);
   a "compact" table shrinks to fit. Without either class a table scrolls sideways. */
@media (max-width: 700px) {
    .blog-post .table-scroll.stack {
        overflow: visible;
    }

    .blog-post .stack .comparison-table,
    .blog-post .stack tbody,
    .blog-post .stack tr,
    .blog-post .stack tbody th,
    .blog-post .stack td {
        display: block;
    }

    .blog-post .stack .comparison-table {
        min-width: 0;
        overflow: visible;
        border-radius: 0;
    }

    .blog-post .stack thead {
        display: none;
    }

    .blog-post .stack tr {
        margin-bottom: 10px;
        overflow: hidden;
        border: 1px solid rgba(148, 163, 184, 0.16);
        border-radius: 12px;
    }

    .blog-post .stack tbody th,
    .blog-post .stack td {
        border: 0;
    }

    .blog-post .stack tbody th {
        background: rgba(59, 130, 246, 0.14);
    }

    .blog-post .stack td {
        padding-top: 6px;
        padding-bottom: 8px;
    }

    .blog-post .stack td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        color: var(--text-main);
        font-size: 0.7rem;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .blog-post .compact .comparison-table {
        display: table;
        min-width: 0;
    }

    .blog-post .compact .comparison-table th,
    .blog-post .compact .comparison-table td {
        padding: 8px 6px;
        font-size: 0.82rem;
    }
}

/* --- Recovery Hookup Lab Specifics --- */
.recovery-lab-page {
    /* Scoped additions to avoid bleeding */
}
.recovery-component-picker button {
    flex: 1 1 120px;
    margin: 0.25rem;
}
.recovery-lab-page .lab-stage-shell {
    border-radius: 8px;
    overflow: hidden;
    background: #f0f4f8;
}

/* --- RECOVERY LAB PAGE SPECIFIC --- */
.recovery-lab-page .lab-image-stack {
    background: #f0f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#recovery-canvas {
    touch-action: pan-y;
    width: 100%;
    height: 100%;
    aspect-ratio: 1400 / 876;
    outline: none;
    cursor: grab;
    display: none;
}

.recovery-lab-page noscript img {
    width: 100%;
    height: auto;
    display: block;
}

#loading-indicator {
    position: absolute;
    pointer-events: none;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    font-weight: bold;
    color: #0f172a;
}

.recovery-component-picker {
    flex-wrap: wrap;
}

.recovery-lab-page .static-content-fallback {
    margin-top: 2rem;
}

.recovery-lab-page .static-content-fallback ul {
    list-style: none;
    padding: 0;
}
