:root {
    --bg-color: #f6f8fb;
    --card-bg: rgba(255, 255, 255, 0.85);
    --primary: #5eead4;
    --secondary: #6366f1;
    --accent: #f43f5e;
    --text-heading: #0f172a;
    --text-main: #1e293b;
    --text-sub: #64748b;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.5);
    --glass-sub: rgba(0, 0, 0, 0.03);
    --font-mono: 'JetBrains Mono', monospace;
}

.cta-box {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    text-align: center;
    padding: 3rem 1.5rem;
    border-radius: 24px;

    box-shadow: 0 20px 40px -10px rgba(30, 41, 59, 0.4);
    position: relative;
    overflow: hidden;
}

/* ... existing styles ... */

/* Category Grid Styles (Migrated from inline) */
.category-header {
    margin-bottom: 2rem;
    text-align: center;
}

.category-header h1 {
    font-size: 1rem;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.grid-item {
    display: block;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    height: 100%;
    display: flex;
    flex-direction: column;
    color: var(--text-main);
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.9);
}

.card-image {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.grid-item:hover .card-image img {
    transform: scale(1.05);
}

.badge-new {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-content h2 {
    font-size: 1.1rem;
    margin: 0 0 0.8rem;
    color: var(--text-heading);
    line-height: 1.4;
}

.card-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    flex-grow: 1;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.8s ease;
    padding-top: 70px;
    /* Space for fixed header */
}

strong {
    color: var(--secondary);
    font-weight: 700;
    background: linear-gradient(transparent 70%, rgba(99, 102, 241, 0.15) 70%);
    padding: 0 2px;
}

/* Site Header */
.site-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    /* Changed from sticky */
    top: 0;
    left: 0;
    z-index: 2000;
    width: 100%;
    padding: 12px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    /* Slight shadow for separation */
}

.header-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--secondary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.header-status-group {
    display: flex;
    gap: 8px;
}

.header-stat {
    background: var(--glass-sub);
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-sub);
    border: 1px solid var(--border-color);
}

/* Page Layout Wrapper Fix */
.app-wrapper {
    width: 100%;
    max-width: 500px;
    padding: 40px 20px;
    /* More padding for header/footer */
    margin: 0 auto;
    transition: max-width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bottom Footer */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    margin-top: 0px;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-sub);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--secondary);
}

.footer-nav-grid {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-nav-grid a,
.footer-nav-grid a:visited {
    background: rgba(255, 255, 255, 0.6);
    padding: 8px 16px;
    border-radius: 99px;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-nav-grid a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    color: var(--secondary);
    border-color: var(--secondary);
    background: #fff;
}

.copyright {
    font-size: 0.75rem;
    color: var(--text-sub);
    opacity: 0.8;
}

/* Background effects */
.light-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at top right, #ffffff, #eef2ff);
    transition: 0.8s;
}



.glow-orb {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
    border-radius: 50%;
    transition: transform 2s ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
}

.orb-2 {
    width: 300px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    opacity: 0.3;
}

/* Page Layout */
.app-wrapper {
    width: 100%;
    max-width: 500px;
    padding: 10px;
    margin: 0 auto;
    transition: max-width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(40px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 20px 48px -10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 28px;
    transition: all 0.5s ease;
}

/* Responsive Grid */
@media (min-width: 960px) {
    .app-wrapper {
        max-width: 1000px;
    }

    .main-content-layout {
        display: grid;
        grid-template-columns: 1.1fr 0.9fr;
        gap: 32px;
        align-items: start;
    }

    .content-left {
        display: flex;
        flex-direction: column;
        gap: 28px;
    }

    .content-right {
        display: flex;
        flex-direction: column;
        gap: 28px;
    }
}

/* Header Component */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-circle {
    width: 44px;
    height: 44px;
    background: var(--card-bg);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.icon-circle i {
    width: 22px;
    color: var(--secondary);
}

.logo-area h1 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.location-selector {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.location-selector select {
    background: transparent;
    border: none;
    font-size: 0.75rem;
    color: var(--text-sub);
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.outdoor-info {
    font-size: 0.7rem;
    color: var(--text-sub);
    background: var(--glass-sub);
    padding: 2px 8px;
    border-radius: 6px;
    font-family: var(--font-mono);
    margin-left: 4px;
}

.live-status {
    background: var(--card-bg);
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.live-status .dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* 3D Visualizer Component */
.visualizer-stage {
    height: 240px;
    perspective: 1200px;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0%, var(--bg-color) 100%);
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.room-isometric {
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(55deg) rotateZ(-45deg);
    width: 180px;
    height: 180px;
    transform-style: preserve-3d;
}

.room-floor {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fdf5e6 0%, #faebd7 100%);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}



.room-wall {
    position: absolute;
    background: #f1f5f9;
}

.room-wall.left {
    width: 20px;
    height: 100%;
    left: -20px;
    transform-origin: right;
    transform: rotateY(-90deg);
    background: #e2e8f0;
}

.room-wall.right {
    height: 20px;
    width: 100%;
    top: -20px;
    transform-origin: bottom;
    transform: rotateX(90deg);
    background: #cbd5e1;
}

.room-wall.front-left {
    height: 20px;
    width: 100%;
    top: 100%;
    transform-origin: top;
    transform: rotateX(-90deg);
    background: #cbd5e1;
}

.room-wall.front-right {
    width: 20px;
    height: 100%;
    left: 100%;
    transform-origin: left;
    transform: rotateY(90deg);
    background: #e2e8f0;
}



.interactive-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

/* Isometric Device Nodes */
.device-node {
    position: absolute;
    width: 32px;
    height: 32px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transform: rotateZ(45deg) rotateX(-55deg) translateZ(40px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    z-index: 20;
    color: var(--text-sub);
}

.device-node:hover {
    transform: rotateZ(45deg) rotateX(-55deg) translateZ(50px) scale(1.1);
}

.device-node.active {
    background: var(--secondary);
    color: white;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.device-ac {
    bottom: -10px;
    right: 10px;
}

.device-humidifier {
    bottom: 40px;
    left: -10px;
}

.device-light {
    top: -30px;
    right: 10px;
}

.device-sound {
    top: 10px;
    left: 10px;
}

.glow-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--secondary);
    border-radius: 50%;
    opacity: 0;
}

.device-node.active .glow-ring {
    animation: deviceRipple 2s infinite;
}

@keyframes deviceRipple {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.bed-structure {
    position: absolute;
    width: 35%;
    height: 45%;
    top: 25%;
    left: 32.5%;
    transform-style: preserve-3d;
}

.bed-shadow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.05);
    filter: blur(8px);
    transform: translateY(-5px);
}

.mattress {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #fff;
    transform: translateZ(15px);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 0 #cbd5e1, 0 4px 0 #94a3b8, 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: 0.4s;
}



.comforter {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 75%;
    background: #f8fafc;
    border-top: 2px solid #fff;
    border-radius: 0 0 4px 4px;
}



.pillow {
    position: absolute;
    top: 6px;
    left: 8px;
    width: 25px;
    height: 15px;
    background: #e0e7ff;
    border-radius: 3px;
    border: 1px solid #c7d2fe;
    opacity: 0.3;
    transition: 0.4s;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.05);
}

.env-field {
    position: absolute;
    width: 140%;
    height: 140%;
    top: -20%;
    left: -20%;
    background: radial-gradient(circle, rgba(94, 234, 212, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: 1s;
    pointer-events: none;
    transform: translateZ(1px);
}

.env-field.active {
    opacity: 1;
}

/* Metrics Section Component */
.main-metrics {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 10px 0;
}

.score-ring-box {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.score-ring-box svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: var(--glass-sub);
    stroke-width: 8;
}

.ring-progress {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 264;
    stroke-dashoffset: 264;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-data {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
}

.score-data .number {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1;
}

.score-data .label {
    font-size: 0.65rem;
    color: var(--text-sub);
}

.combo-display {
    position: relative;
    margin-top: -10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 30;
    min-height: 20px;
    align-items: center;
}

.combo-badge {
    background: var(--card-bg);
    border: 1px solid var(--secondary);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary);
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.1);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.score-guide {
    display: flex;
    gap: 12px;
    margin-top: 5px;
    padding: 6px 12px;
    background: var(--glass-sub);
    border-radius: 12px;
}

.guide-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-sub);
    letter-spacing: -0.02em;
}

.guide-item span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.guide-item.dark-red span {
    background: #7f1d1d;
}

.guide-item.bad span {
    background: #ef4444;
}

.guide-item.warn span {
    background: #f97316;
}

.guide-item.good span {
    background: #3b82f6;
}

.guide-item.ideal span {
    background: #10b981;
}


/* Sleep Glow Special Effects */
.score-ring-box.sleep-glow::before,
.score-ring-box.sleep-glow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

.score-ring-box.sleep-glow::before {
    width: 100%;
    height: 100%;
    border: 2px solid rgba(99, 102, 241, 0.4);
    animation: rippleExpand 1.5s ease-out forwards;
}

.score-ring-box.sleep-glow::after {
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 60%);
    animation: pulseCore 4s infinite ease-in-out;
}

@keyframes rippleExpand {
    0% {
        width: 80%;
        height: 80%;
        opacity: 0.8;
        border-width: 4px;
    }

    100% {
        width: 180%;
        height: 180%;
        opacity: 0;
        border-width: 0px;
    }
}

@keyframes pulseCore {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0.3;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.7;
    }
}

/* PERFECT Badge & Effects */
.perfect-badge {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 16px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

body.is-perfect .perfect-badge {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

body.is-perfect .score-ring-box.sleep-glow::after {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.5) 0%, transparent 70%);
    animation: greenPulse 2s infinite ease-in-out;
}

body.is-perfect .score-ring-box.sleep-glow::before {
    border-color: rgba(16, 185, 129, 0.6);
    animation: rippleExpand 2s ease-out infinite;
}

@keyframes greenPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0.8;
    }
}

body.is-perfect .ring-progress {
    filter: drop-shadow(0 0 8px #10b981);
}

body.is-perfect #mainScoreValue {
    color: #10b981 !important;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

@media (max-width: 959px) {
    .perfect-badge {
        top: 120px;
    }
}

.progress-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.prog-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
}

.label-row span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.bar-container {
    height: 6px;
    background: var(--glass-sub);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--secondary);
    width: 0%;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Controls Components */
.building-controls {
    padding: 18px;
    background: var(--glass-sub);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.ctrl-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ctrl-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-sub);
}

.seasonal-recommendations {
    padding: 16px;
    background: var(--glass-sub);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.seasonal-recommendations .title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
}

.seasonal-recommendations .title-row i {
    width: 14px;
    color: var(--secondary);
}

.seasonal-recommendations .season-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.season-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.season-item .tag {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    color: white;
    width: 40px;
    text-align: center;
}

.tag.summer {
    background: #f43f5e;
}

.tag.winter {
    background: #3b82f6;
}

.tag.spring {
    background: #10b981;
}

.season-item .val {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-main);
}

/* Cost Toggle & Display */
.cost-toggle-wrapper {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cost-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-sub);
}

.cost-info i {
    width: 14px;
    color: var(--secondary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.1);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--secondary);
}

input:checked+.slider:before {
    transform: translateX(16px);
}

.cost-display-box {
    margin-top: 10px;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    animation: fadeInSlide 0.4s ease-out;
}

.cost-main {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--secondary);
    font-family: var(--font-mono);
}

.cost-sub {
    font-size: 0.65rem;
    color: var(--text-sub);
    margin-top: 2px;
}

@keyframes fadeInSlide {
    0% {
        opacity: 0;
        transform: translateY(-5px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}



.segmented-control {
    display: flex;
    background: var(--glass-sub);
    padding: 4px;
    border-radius: 12px;
}

.seg-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    border-radius: 9px;
    transition: 0.2s;
}

.seg-btn.active {
    background: var(--card-bg);
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (min-width: 960px) {
    .controls-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.toggle-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 16px 8px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn i {
    width: 20px;
    color: var(--text-sub);
}

.toggle-btn span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-sub);
}

.toggle-btn.active {
    background: var(--secondary);
    border-color: var(--secondary);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.toggle-btn.active i,
.toggle-btn.active span {
    color: white;
}

/* Footer Message */
.footer-msg {
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-msg p {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.6;
    font-style: italic;
}

/* Authority & Basis */
.auth-badge.mini-cta-label {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    text-align: center;
    padding: 4px 0;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-main);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    line-height: 1.2;
}

/* Simple Product Card (Top Page Reco) */
.product-reco-area {
    border-radius: 16px;
    padding: 1.2rem;
    border: 1px solid var(--border-color);
}

.simple-product-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.6);
    padding: 0.8rem;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 1rem;
}

.simple-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.9);
}

.spc-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.spc-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.spc-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding-right: 24px;
}

.spc-tag {
    font-size: 0.7rem;
    color: var(--text-sub);
    font-weight: 600;
    margin-bottom: 2px;
}

.spc-title {
    font-size: 0.95rem;
    color: var(--text-main);
    margin: 0;
    line-height: 1.3;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.spc-arrow {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-sub);
    width: 18px;
    height: 18px;
}

/* Authority & Basis */
.auth-badge-overlay {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.auth-pill {
    background: white;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-sub);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.auth-pill i {
    width: 10px;
    color: #10b981;
}

.authority-panel {
    padding: 16px;
    background: var(--glass-sub);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 10px;
}

/* Related Articles Section */
.related-articles {
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);

}

.related-articles h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.related-card {
    display: block;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.9);
}

.related-card-image {
    height: 140px;
    overflow: hidden;
}

.related-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.related-card:hover .related-card-image img {
    transform: scale(1.05);
}

.related-card-content {
    padding: 1rem;
}

.related-card-content h4 {
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
    color: var(--text-heading);
    line-height: 1.4;
    font-weight: 700;
}

.related-card-content .category {
    font-size: 0.7rem;
    color: var(--text-sub);
    display: inline-block;
    background: var(--glass-sub);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* Affiliate CTA Placeholder */
.affiliate-cta-placeholder {
    min-height: 200px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px dashed var(--border-color);
    border-radius: 12px;

    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    font-size: 0.9rem;
}

.auth-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.auth-title i {
    width: 14px;
    color: var(--secondary);
}

.auth-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.auth-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-item .h {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-sub);
}

.auth-item .v {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-main);
}

/* FAQ Accordion Styles */
.faq-accordion details {
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.faq-accordion details[open] {
    background: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.faq-accordion summary {
    padding: 1.2rem;
    cursor: pointer;
    font-weight: 700;
    color: #1e293b;
    list-style: none;
    position: relative;
    padding-right: 2.5rem;
}

.faq-accordion summary::-webkit-details-marker {
    display: none;
}

.faq-accordion summary::after {
    content: '+';
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 300;
}

.faq-accordion details[open] summary::after {
    content: '-';
}

.faq-accordion .answer {
    padding: 0 1.5rem 1.5rem;
    border-top: none;
    color: #475569;
    line-height: 1.7;
}

.faq-accordion .answer strong {
    color: var(--secondary);
    background: none;
    font-weight: 700;
}

/* Recommendations in Top Page */
.recommendation-area {
    margin-top: 1.5rem;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.recommendation-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1rem;
}

.rec-card {
    display: flex;
    gap: 1rem;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
    color: var(--text-heading);
}

.rec-card:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.rec-thumb {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    background-color: #ddd;
}

.rec-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rec-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.4;
}

.rec-cat {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.rec-cat.thermal {
    color: #f97316;
}

.rec-cat.housing {
    color: #3b82f6;
}

.rec-cat.bedding {
    color: #10b981;
}

/* Article Styles */
.article-header h1 {
    font-size: 1.5rem;
    line-height: 1.4;
    color: var(--text-heading);
    margin: 1rem 0;
}

/* Product CTA Cards - Rich & Compact */
.product-cta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 1rem 0;
}

.product-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
    font-size: 0.95rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

/* Horizontal Layout for Single Product Focus */
.pc-main {
    display: flex;
    flex-direction: column;
}

@media (min-width: 640px) {
    .pc-main {
        flex-direction: row;
        align-items: stretch;
    }

    .pc-thumb {
        width: 260px;
        height: auto;
        min-height: 100%;
        border-bottom: none;
        border-right: 1px solid rgba(0, 0, 0, 0.05);
        background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    }
}

.product-card:hover {
    transform: translateY(-4px) scale(1.005);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    background: #fff;
    border-color: #fff;
}

.pc-thumb {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    height: 220px;
    position: relative;
}

.pc-thumb img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.product-card:hover .pc-thumb img {
    transform: scale(1.08) translateY(-5px);
}

.kit-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.kit-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.kit-list li::before {
    content: '‣';
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.2rem;
    color: var(--secondary);
    line-height: 1.6;
}

.pc-content {
    padding: 0.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.pc-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.2rem;
}

.pc-brand {
    font-family: var(--font-english);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

.pc-tier {
    font-size: 0.65rem;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #334155;
    padding: 3px 8px;
    border-radius: 99px;
    font-weight: 700;
    letter-spacing: 0.05em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.pc-title {
    margin: 0;
    font-size: 1.4rem;
    color: #1e293b;
    line-height: 1.3;
    font-weight: 800;
    background: linear-gradient(45deg, #1e293b, #334155);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.pc-price {
    font-family: var(--font-english);
    font-weight: 800;
    color: var(--accent);
    font-size: 1.2rem;
    text-shadow: 0 2px 10px rgba(244, 63, 94, 0.1);
}

.pc-summary {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.6;
    margin: 0.5rem 0 1rem;
    font-weight: 500;
    border-left: 3px solid #e2e8f0;
    padding-left: 1rem;
}

/* Pros and Cons Styling */
.pc-details {
    margin: 0 0 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.pc-pros-cons {
    display: grid;
    gap: 0.8rem;
}

.pc-list-group ul {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #475569;
}

.pc-list-group li {
    position: relative;
    padding-left: 1.4rem;
    margin-bottom: 0.3rem;
}

.pc-pros li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 2px;
    font-weight: 900;
    color: #10b981;
    font-size: 1rem;
}

.pc-cons li::before {
    content: '!';
    position: absolute;
    left: 2px;
    top: 3px;
    width: 14px;
    height: 14px;
    background: #fbbf24;
    color: #fff;
    border-radius: 50%;
    font-weight: 900;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pc-actions {
    margin-top: auto;
}

.btn-amazon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    color: #334155;
    font-weight: 700;
    padding: 1rem;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.95rem;
    border: 1px solid #cbd5e1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.btn-amazon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.btn-amazon:hover {
    background: #fff;
    border-color: #94a3b8;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    color: #0f172a;
}

.btn-amazon:hover::before {
    transform: translateX(100%);
}

.btn-amazon i {
    width: 18px;
    height: 18px;
    color: #d97706;
    filter: drop-shadow(0 1px 2px rgba(217, 119, 6, 0.3));
}