
        :root {
            --primary: #f59e0b;
            --primary-dark: #d97706;
            --bg-gradient: linear-gradient(90deg, #a6ddff 0%, #4c8fff 100%);
            --card-bg: #ffffff;
            --text-main: #1e293b;
            --text-muted: #64748b;
            --accent-red: #ef4444;
            --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }header {
            text-align: center;
            padding: 20px 0;
            color: white;
            position: relative;
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 5px;
        }

        .logo {
            font-size: 2.5rem;
            font-weight: 800;
            letter-spacing: -1px;
            margin-bottom: 4px;
        }

        .logo span {
            color: var(--primary);
        }

        .back-link {
            color: white;
            text-decoration: none;
            font-size: 1.1rem;
            font-weight: 600;
        }

        .tagline {
            font-size: 0.95rem;
            opacity: 0.8;
            font-weight: 300;
            text-align: left;
            width: 100%;
            padding: 0 5px;
        }

        .menu-btn {
            background: none;
            border: none;
            color: white;
            font-size: 2.2rem;
            cursor: pointer;
            line-height: 1;
            transition: transform 0.2s;
        }

        .menu-btn:hover {
            transform: scale(1.1);
        }

        .side-menu {
            position: fixed;
            top: 0;
            right: -280px;
            width: 280px;
            height: 100%;
            background: white;
            box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
            z-index: 2000;
            transition: right 0.3s ease-out;
            padding: 20px;
            color: #0f172a;
            text-align: left;
        }

        .side-menu.active {
            right: 0;
        }

        .menu-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #e2e8f0;
            padding-bottom: 15px;
            margin-bottom: 20px;
        }

        .menu-header h2 {
            font-size: 1.5rem;
            font-weight: 800;
        }

        .close-btn {
            background: none;
            border: none;
            font-size: 2rem;
            cursor: pointer;
            color: #64748b;
        }

        .menu-nav ul {
            list-style: none;
        }

        .menu-nav li {
            margin-bottom: 10px;
        }

        .menu-nav a {
            text-decoration: none;
            color: #0f172a;
            font-size: 1.1rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            border-radius: 12px;
            transition: all 0.2s;
        }

        .menu-nav a:hover {
            background: #f1f5f9;
            transform: translateX(5px);
        }

        .menu-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            z-index: 1000;
            display: none;
            backdrop-filter: blur(4px);
        }

        .menu-overlay.active {
            display: block;
        }

        .card {
            background: var(--card-bg);
            border-radius: 28px;
            padding: 20px;
            box-shadow: var(--shadow);
        }

        .card h2 {
            font-size: 1.3rem;
            font-weight: 800;
        }

        .sub {
            margin-top: 6px;
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        .pie-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 20px;
            margin-top: 16px;
            justify-items: center;
        }

        .pie-card {
            background: transparent;
            border-radius: 20px;
            padding: 16px;
            text-align: center;
            width: 100%;
            max-width: 100%;
        }

        .pie-title {
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--text-main);
            margin-bottom: 10px;
        }

        .pie-canvas {
            width: 360px;
            height: 320px;
            display: block;
            margin: 0 auto 10px;
        }

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

        #realBox .pie-summary,
        #realBox .legend,
        #realBox .warning,
        #realBox .sub {
            text-align: center;
        }

        #realBox .legend {
            justify-items: center;
        }

        #realBox .legend-item {
            justify-content: center;
        }

        #realBox .legend-main {
            align-items: center;
            text-align: center;
        }

        .legend {
            margin-top: 16px;
            display: grid;
            gap: 10px;
        }

        .legend-item {
            display: grid;
            grid-template-columns: 16px 1fr;
            gap: 10px;
            align-items: center;
        }

        .swatch {
            width: 14px;
            height: 14px;
            border-radius: 50%;
        }

        .legend-main {
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .legend-title {
            font-weight: 700;
            font-size: 0.95rem;
        }

        .legend-meta {
            color: var(--text-muted);
            font-size: 0.85rem;
        }

        .settings-card {
            padding: 16px;
        }

        .settings-card h2 {
            font-size: 1.15rem;
        }

        .settings-card .sub {
            font-size: 0.85rem;
        }

        .controls {
            display: grid;
            gap: 12px;
            margin-top: 10px;
        }

        .control-row {
            display: grid;
            gap: 8px;
        }

        .control-row label {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-main);
        }

        .control-input {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 10px;
            align-items: center;
        }

        input[type="range"] {
            width: 100%;
        }

        .value-pill {
            padding: 6px 10px;
            border-radius: 999px;
            background: #e2e8f0;
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--text-main);
            min-width: 64px;
            text-align: center;
        }

        .warning {
            margin-top: 12px;
            font-size: 0.85rem;
            color: #b45309;
            background: #fff7ed;
            border-radius: 12px;
            padding: 10px 12px;
            display: none;
        }

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

            .pie-canvas {
                width: 300px;
                height: 260px;
            }
        }
    
