:root {
            --bg: #f5f0e8;
            --surface: #fffdf7;
            --surface2: #faf5e9;
            --border: #e8dfc8;
            --text: #1a1611;
            --text-muted: #7a6e5e;
            --accent: #2d6a4f;
            --accent-light: #e8f5ee;
            --under: #3a86ff;
            --normal: #2d6a4f;
            --over: #f4a261;
            --obese: #e63946;
            --radius: 16px;
            --shadow: 0 4px 24px rgba(0,0,0,0.07);
        }

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

        body {
            font-family: 'DM Sans', sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
        }

        /* HEADER */
        header {
            background: var(--surface);
            border-bottom: 1px solid var(--border);
            padding: 0 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 60px;
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .logo {
            font-family: 'DM Serif Display', serif;
            font-size: 1.25rem;
            color: var(--accent);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        nav {
            display: flex;
            align-items: center;
        }
        
        .desktop-nav > a, .desktop-nav .nav-dropdown {
            margin-left: 20px;
        }
        
        nav a {
            font-size: 0.875rem;
            color: var(--text-muted);
            text-decoration: none;
            font-weight: 500;
        }
        nav a:hover { color: var(--accent); }
        
        /* Dropdown Navigation */
        .nav-dropdown {
            position: relative;
            display: inline-block;
        }
        
        .nav-dropdown-toggle {
            cursor: pointer;
            user-select: none;
            padding: 10px 0;
        }
        
        .nav-dropdown-menu {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            padding-top: 8px;
            z-index: 1000;
        }
        
        .nav-dropdown-menu-inner {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 8px;
            box-shadow: var(--shadow);
            min-width: 180px;
            padding: 8px 0;
        }
        
        .nav-dropdown:hover .nav-dropdown-menu {
            display: block;
        }
        
        .nav-dropdown-menu a {
            display: block;
            padding: 10px 16px;
            margin: 0;
            color: var(--text);
            font-size: 0.875rem;
            transition: background 0.2s;
        }
        
        .nav-dropdown-menu a:hover {
            background: var(--accent-light);
            color: var(--accent);
        }

        /* Mobile Navigation */
        .mobile-menu-toggle {
            display: none;
            background: none;
            border: none;
            cursor: pointer;
            padding: 8px;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            width: 40px;
            height: 40px;
            border-radius: 8px;
            transition: background 0.2s;
        }

        .mobile-menu-toggle:hover {
            background: var(--surface2);
        }

        .hamburger-line {
            width: 24px;
            height: 2px;
            background: var(--text);
            margin: 2px 0;
            transition: all 0.3s ease;
            border-radius: 2px;
        }

        .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
            transform: rotate(45deg) translate(5px, 5px);
        }

        .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
            opacity: 0;
        }

        .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
            transform: rotate(-45deg) translate(7px, -6px);
        }

        .desktop-nav {
            display: flex;
            align-items: center;
        }

        .mobile-nav {
            display: none;
            position: fixed;
            top: 60px;
            left: 0;
            right: 0;
            background: var(--surface);
            border-bottom: 1px solid var(--border);
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            z-index: 99;
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease;
        }

        .mobile-nav.active {
            max-height: 400px;
            overflow-y: auto;
        }

        .mobile-nav-section {
            padding: 16px 24px;
            border-bottom: 1px solid var(--border);
        }

        .mobile-nav-section:last-child {
            border-bottom: none;
        }

        .mobile-nav-header {
            font-weight: 600;
            color: var(--accent);
            margin-bottom: 12px;
            font-size: 0.875rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .mobile-nav a {
            display: block;
            padding: 12px 0;
            color: var(--text);
            text-decoration: none;
            font-weight: 500;
            border-bottom: 1px solid var(--border);
            transition: color 0.2s;
        }

        .mobile-nav a:last-child {
            border-bottom: none;
        }

        .mobile-nav a:hover {
            color: var(--accent);
        }

        /* AdSense Centering */
        .adsbygoogle {
            margin: 0 auto !important;
            display: block !important;
            text-align: center !important;
        }

        .adsbygoogle[style*="display:block"] {
            margin: 0 auto !important;
            text-align: center !important;
        }

        .adsbygoogle[style*="display:inline-block"] {
            margin: 0 auto !important;
            display: block !important;
            text-align: center !important;
        }

        /* Container for ads */
        .ad-container {
            text-align: center;
            margin: 0 auto;
            width: 100%;
            max-width: 100%;
            display: block;
        }

        /* Ensure ads have proper width */
        .ad-container .adsbygoogle {
            min-width: 300px;
            max-width: 100%;
        }

        /* Mobile Responsive */
        @media (max-width: 768px) {
            .mobile-menu-toggle {
                display: flex;
            }

            .desktop-nav {
                display: none;
            }

            .mobile-nav {
                display: block;
            }

            header {
                padding: 0 16px;
            }

            /* AdSense mobile adjustments */
            .ad-container {
                width: 100%;
                padding: 0 10px;
            }

            .ad-container .adsbygoogle {
                min-width: 250px;
                width: 100%;
            }
        }

        @media (max-width: 480px) {
            .ad-container {
                padding: 0 5px;
            }

            .ad-container .adsbygoogle {
                min-width: 200px;
            }
        }

        /* HERO */
        .hero {
            text-align: center;
            padding: 56px 24px 32px;
            max-width: 640px;
            margin: 0 auto;
        }

        .hero h1 {
            font-family: 'DM Serif Display', serif;
            font-size: clamp(2rem, 5vw, 3rem);
            line-height: 1.1;
            color: var(--text);
            margin-bottom: 12px;
        }

        .hero h1 em {
            font-style: italic;
            color: var(--accent);
        }

        .hero p {
            color: var(--text-muted);
            font-size: 1rem;
            line-height: 1.6;
            max-width: 480px;
            margin: 0 auto;
        }

        /* MAIN LAYOUT */
        main {
            max-width: 1100px;
            margin: 0 auto;
            padding: 0 16px 80px;
            display: grid;
            grid-template-columns: 1fr 340px;
            gap: 24px;
            align-items: start;
        }

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

        /* CARD */
        .card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 28px;
            box-shadow: var(--shadow);
        }

        .card-title {
            font-family: 'DM Serif Display', serif;
            font-size: 1.25rem;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        /* UNIT TOGGLE */
        .unit-toggle {
            display: flex;
            background: var(--surface2);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 4px;
            margin-bottom: 24px;
            width: fit-content;
        }

        .unit-btn {
            padding: 7px 20px;
            border-radius: 7px;
            border: none;
            background: transparent;
            cursor: pointer;
            font-family: 'DM Sans', sans-serif;
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--text-muted);
            transition: all 0.2s;
        }

        .unit-btn.active {
            background: var(--surface);
            color: var(--accent);
            box-shadow: 0 1px 6px rgba(0,0,0,0.1);
        }

        /* FORM GRID */
        .form-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
            margin-bottom: 16px;
        }

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

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .form-group label {
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .input-wrap {
            position: relative;
            display: flex;
            gap: 8px;
        }

        .input-wrap input {
            width: 100%;
            padding: 11px 44px 11px 14px;
            border: 1.5px solid var(--border);
            border-radius: 10px;
            background: var(--surface2);
            font-family: 'DM Sans', sans-serif;
            font-size: 1rem;
            color: var(--text);
            transition: border-color 0.2s;
            -moz-appearance: textfield;
        }

        .input-wrap input::-webkit-outer-spin-button,
        .input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; }

        .input-wrap input:focus {
            outline: none;
            border-color: var(--accent);
            background: var(--surface);
        }

        .input-unit {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 0.8rem;
            color: var(--text-muted);
            font-weight: 500;
            pointer-events: none;
        }

        .height-imperial {
            display: flex;
            gap: 8px;
        }

        .height-imperial input {
            width: 100%;
        }

        /* SEX SELECTOR */
        .sex-selector {
            display: flex;
            gap: 8px;
        }

        .sex-btn {
            flex: 1;
            padding: 11px;
            border: 1.5px solid var(--border);
            border-radius: 10px;
            background: var(--surface2);
            cursor: pointer;
            font-family: 'DM Sans', sans-serif;
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--text-muted);
            transition: all 0.2s;
            text-align: center;
        }

        .sex-btn.active {
            border-color: var(--accent);
            background: var(--accent-light);
            color: var(--accent);
        }

        /* CALCULATE BTN */
        .calc-btn {
            width: 100%;
            padding: 14px;
            background: var(--accent);
            color: white;
            border: none;
            border-radius: 12px;
            font-family: 'DM Sans', sans-serif;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            margin-top: 8px;
            letter-spacing: 0.01em;
        }

        .calc-btn:hover {
            background: #235c42;
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(45,106,79,0.3);
        }

        .calc-btn:active { transform: translateY(0); }

        .calc-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .calc-btn:disabled:hover {
            background: var(--accent);
            transform: none;
            box-shadow: none;
        }

        /* RESULT */
        .result-card {
            margin-top: 20px;
            padding: 24px;
            border-radius: 14px;
            border: 2px solid;
            animation: slideIn 0.4s ease;
        }

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

        .result-card.underweight { border-color: var(--under); background: #eff6ff; }
        .result-card.normal      { border-color: var(--normal); background: var(--accent-light); }
        .result-card.overweight  { border-color: var(--over); background: #fff7ed; }
        .result-card.obese       { border-color: var(--obese); background: #fff1f2; }

        .result-top {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            flex-wrap: wrap;
        }

        .bmi-score {
            font-family: 'DM Serif Display', serif;
            font-size: 3.5rem;
            line-height: 1;
        }

        .bmi-score.underweight { color: var(--under); }
        .bmi-score.normal      { color: var(--normal); }
        .bmi-score.overweight  { color: var(--over); }
        .bmi-score.obese       { color: var(--obese); }

        .bmi-label {
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
            margin-bottom: 4px;
        }

        .bmi-category {
            font-size: 1.1rem;
            font-weight: 600;
            margin-top: 4px;
        }

        .bmi-category.underweight { color: var(--under); }
        .bmi-category.normal      { color: var(--normal); }
        .bmi-category.overweight  { color: var(--over); }
        .bmi-category.obese       { color: var(--obese); }

        /* GAUGE */
        .gauge-wrap {
            margin: 20px 0 16px;
        }

        .gauge-bar {
            height: 10px;
            border-radius: 99px;
            background: linear-gradient(to right, var(--under) 0%, var(--under) 20%, var(--normal) 20%, var(--normal) 50%, var(--over) 50%, var(--over) 75%, var(--obese) 75%);
            position: relative;
            margin-bottom: 6px;
        }

        .gauge-needle {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: white;
            border: 3px solid var(--text);
            position: absolute;
            top: 50%;
            transform: translate(-50%, -50%);
            transition: left 0.6s cubic-bezier(.34,1.56,.64,1);
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        }

        .gauge-labels {
            display: flex;
            justify-content: space-between;
            font-size: 0.7rem;
            color: var(--text-muted);
            font-weight: 500;
        }

        /* STATS ROW */
        .stats-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            margin-top: 16px;
        }

        .stat-box {
            background: rgba(255,255,255,0.6);
            border-radius: 10px;
            padding: 12px 14px;
        }

        .stat-label {
            font-size: 0.72rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-muted);
            margin-bottom: 3px;
        }

        .stat-value {
            font-size: 1rem;
            font-weight: 600;
            color: var(--text);
        }

        /* HEALTH TIP */
        .health-tip {
            margin-top: 16px;
            padding: 12px 14px;
            background: rgba(255,255,255,0.5);
            border-radius: 10px;
            font-size: 0.875rem;
            line-height: 1.5;
            color: var(--text);
        }

        .health-tip strong { font-weight: 600; }

        /* DISCLAIMER */
        .disclaimer-bar {
            margin-top: 16px;
            padding: 10px 14px;
            background: var(--surface2);
            border-radius: 8px;
            font-size: 0.75rem;
            color: var(--text-muted);
            line-height: 1.4;
            border: 1px solid var(--border);
        }

        /* SIDEBAR */
        .sidebar { display: flex; flex-direction: column; gap: 20px; }

        /* BMI TABLE */
        .bmi-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.875rem;
        }

        .bmi-table th {
            text-align: left;
            padding: 8px 10px;
            font-size: 0.72rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-muted);
            border-bottom: 1px solid var(--border);
        }

        .bmi-table td {
            padding: 10px 10px;
            border-bottom: 1px solid var(--border);
            vertical-align: middle;
        }

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

        .cat-dot {
            display: inline-block;
            width: 8px; height: 8px;
            border-radius: 50%;
            margin-right: 6px;
            vertical-align: middle;
        }

        .cat-dot.under  { background: var(--under); }
        .cat-dot.normal { background: var(--normal); }
        .cat-dot.over   { background: var(--over); }
        .cat-dot.obese  { background: var(--obese); }

        .cat-name { font-weight: 500; }
        .cat-range { color: var(--text-muted); font-size: 0.8rem; }

        /* MINI CHART */
        canvas#bmiChart { max-height: 200px; }

        /* SECTIONS BELOW */
        .below-grid {
            max-width: 1100px;
            margin: 0 auto 60px;
            padding: 0 16px;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
        }

        .info-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 24px;
        }

        .info-card h3 {
            font-family: 'DM Serif Display', serif;
            font-size: 1.25rem;
            font-weight: 600;
            margin-bottom: 15px;
            color: var(--text);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .info-card p {
            font-size: 0.95rem;
            color: var(--text);
            line-height: 1.6;
            margin-bottom: 15px;
        }

        .info-card ul {
            margin: 10px 0;
            padding-left: 20px;
        }

        .info-card li {
            font-size: 0.9rem;
            color: var(--text);
            margin-bottom: 6px;
            line-height: 1.5;
        }

        .faq-item {
            border-bottom: 1px solid var(--border);
            padding: 16px 0;
        }
        .faq-item:last-child { border-bottom: none; }

        .faq-q {
            font-weight: 600;
            font-size: 0.9rem;
            margin-bottom: 6px;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
        }

        .faq-a {
            font-size: 0.85rem;
            color: var(--text-muted);
            line-height: 1.6;
        }

        /* Back to Top Button */
        .back-to-top {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 50px;
            height: 50px;
            background: var(--accent);
            color: white;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            transition: all 0.3s ease;
            z-index: 999;
        }
        
        .back-to-top:hover {
            background: #1f4d37;
            transform: translateY(-3px);
            box-shadow: 0 6px 16px rgba(0,0,0,0.2);
        }
        
        .back-to-top.show {
            display: flex;
        }
        
        @media (max-width: 768px) {
            .back-to-top {
                bottom: 20px;
                right: 20px;
                width: 45px;
                height: 45px;
                font-size: 1.3rem;
            }
        }

        /* MAIN CONTAINER */
        main {
            max-width: 1100px;
            margin: 0 auto;
            padding: 40px 16px;
        }

        /* SECTION HEADING */
        .section-heading {
            max-width: 1100px;
            margin: 60px auto 20px;
            padding: 0 16px;
            text-align: left;
        }

        .section-heading h2 {
            font-family: 'DM Serif Display', serif;
            font-size: 1.8rem;
            font-weight: 600;
            color: var(--text);
            margin: 0;
            line-height: 1.3;
        }

        /* FORMULA BLOCK */
        .formula-block {
            background: var(--surface2);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 14px 16px;
            font-family: 'Courier New', monospace;
            font-size: 0.85rem;
            color: var(--accent);
            margin: 8px 0;
        }

        /* FOOTER */
        footer {
            background: var(--surface);
            border-top: 1px solid var(--border);
            padding: 28px 24px;
            text-align: center;
            font-size: 0.8rem;
            color: var(--text-muted);
            line-height: 1.6;
        }

        footer a { color: var(--text-muted); }
        footer .footer-links { margin-top: 8px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
