:root {
            --body-bg: #f0f2f5;
            --container-bg: #ffffff;
            --text-color: #333;
            --heading-color: #1c1e21;
            --label-color: #606770;
            --border-color: #dddfe2;
            --input-bg: #ffffff;
            --focus-shadow: #e7f3ff;
            --link-color: #1877f2;
            --button-bg: #1877f2;
            --button-hover-bg: #166fe5;
        }

        body.dark-mode {
            --body-bg: #18191a;
            --container-bg: #242526;
            --text-color: #e4e6eb;
            --heading-color: #e4e6eb;
            --label-color: #b0b3b8;
            --border-color: #3a3b3c;
            --input-bg: #3a3b3c;
            --focus-shadow: rgba(24, 119, 242, 0.3);
            --link-color: #4599ff;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            background-color: var(--body-bg);
            color: var(--text-color);
            margin: 0;
            padding-top: 5rem; /* Make space for switch and center container */
            display: flex;
            justify-content: center;
            /*min-height: 100vh;*/
            box-sizing: border-box;
            transition: background-color 0.3s, color 0.3s;
        }

        .container {
            background-color: var(--container-bg);
            padding: 2rem 3rem;
            border-radius: 10px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            text-align: center;
            max-width: 400px;
            width: 90%;
        }

        h1 {
            color: var(--heading-color);
            margin-bottom: 1.5rem;
        }

        .logo {
            max-width: 80px;
            margin-bottom: 1rem;
        }

        .nav-link {
            margin-bottom: 1.5rem;
            font-size: 0.9rem;
        }

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

        .nav-link a:hover { text-decoration: underline; }

        .input-group {
            margin-bottom: 1.5rem;
        }

        label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 600;
            color: var(--label-color);
        }

        input[type="number"] {
            width: 100%;
            padding: 0.75rem;
            border: 1px solid var(--border-color);
            background-color: var(--input-bg);
            color: var(--text-color);
            border-radius: 6px;
            font-size: 1rem;
            box-sizing: border-box; /* Ensures padding doesn't affect width */
        }

        input[type="number"]:focus {
            outline: none;
            border-color: var(--link-color);
            box-shadow: 0 0 0 2px var(--focus-shadow);
        }

        button {
            width: 100%;
            padding: 0.75rem;
            background-color: var(--button-bg);
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.2s;
        }

        button:hover {
            background-color: var(--button-hover-bg);
        }

        #result {
            margin-top: 1.5rem;
            font-size: 1.1rem;
            font-weight: 500;
            min-height: 4rem; /* Reserve space for multi-line result */
            color: var(--heading-color);
            line-height: 1.5;
        }

        .error {
            color: #d93025;
            font-weight: normal;
        }

        /* Theme Switch Styles */
        .theme-switch-wrapper {
            position: absolute;
            top: 1rem;
            right: 1rem;
            display: flex;
            align-items: center;
        }
        .theme-switch {
            display: inline-block;
            height: 24px;
            position: relative;
            width: 48px;
        }
        .theme-switch input {
            display: none;
        }
        .slider {
            background-color: #ccc;
            bottom: 0;
            cursor: pointer;
            left: 0;
            position: absolute;
            right: 0;
            top: 0;
            transition: .4s;
        }
        .slider:before {
            background-color: #fff;
            bottom: 4px;
            content: "";
            height: 16px;
            left: 4px;
            position: absolute;
            transition: .4s;
            width: 16px;
        }
        input:checked + .slider {
            background-color: #1877f2;
        }
        input:checked + .slider:before {
            transform: translateX(24px);
        }
        .slider.round {
            border-radius: 24px;
        }
        .slider.round:before {
            border-radius: 50%;
        }