:root {
            --cream: #FAFAF7;
            --white: #FFFFFF;
            --navy: #1A1A2E;
            --navy-light: #2D2D4F;
            --navy-muted: #6B6B8A;
            --gold: #C5A55A;
            --gold-light: #D4BC7A;
            --gold-bg: rgba(197, 165, 90, 0.08);
            --border: #E5E0D0;
            --border-light: #F0EDE6;
            --success: #2D6A4F;
            --success-bg: #E8F5E9;
            --warning: #B69121;
            --warning-bg: #FFF8E1;
            --danger: #9B2335;
            --danger-bg: #FFEBEE;
            --shadow: 0 1px 3px rgba(26, 26, 46, 0.06), 0 4px 12px rgba(26, 26, 46, 0.04);
            --shadow-lg: 0 4px 6px rgba(26, 26, 46, 0.05), 0 10px 30px rgba(26, 26, 46, 0.08);
        }

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

        html { scroll-behavior: smooth; }

        body {
            font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: var(--cream);
            color: var(--navy);
            line-height: 1.6;
            -webkit-font-smoothing: antialiased;
            overflow-x: hidden;
        }

        /* ===== HEADER ===== */
        .header {
            background: var(--white);
            border-bottom: 1px solid var(--border);
            padding: 16px 24px;
        }
        .header-inner {
            max-width: 960px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .brand {
            display: flex;
            align-items: center;
            gap: 12px;
            text-decoration: none;
        }
        .brand-logo {
            display: block;
            width: 142px;
            height: auto;
        }
        .trust-badge {
            font-size: 12px;
            color: var(--navy-muted);
            letter-spacing: 0.3px;
        }

        /* ===== HERO ===== */
        .hero {
            text-align: center;
            padding: 48px 24px 32px;
            max-width: 640px;
            margin: 0 auto;
        }
        .hero h1 {
            font-family: Georgia, serif;
            font-size: clamp(26px, 5vw, 36px);
            font-weight: 400;
            line-height: 1.25;
            margin-bottom: 12px;
            color: var(--navy);
        }
        .hero h1 em {
            color: var(--gold);
            font-style: normal;
        }
        .hero p {
            font-size: 16px;
            color: var(--navy-muted);
            max-width: 480px;
            margin: 0 auto;
        }

        /* ===== MAIN LAYOUT ===== */
        .container {
            max-width: 960px;
            margin: 0 auto;
            padding: 0 24px 64px;
        }
        .grid {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
            gap: 24px;
            min-width: 0;
        }
        @media (max-width: 768px) {
            .grid { grid-template-columns: minmax(0, 1fr); }
            .hero { padding: 32px 20px 24px; }
            .container { padding: 0 16px 48px; }
            .header { padding: 14px 16px; }
            .trust-badge { display: none; }
            .hero h1 {
                font-size: 30px;
                max-width: 340px;
                margin-left: auto;
                margin-right: auto;
            }
            .hero p {
                max-width: 340px;
            }
            .card {
                padding: 24px;
                width: min(340px, calc(100vw - 32px));
                max-width: min(340px, calc(100vw - 32px));
                margin-left: 16px;
                margin-right: auto;
            }
            .disclaimer {
                width: min(340px, calc(100vw - 32px));
                max-width: min(340px, calc(100vw - 32px));
                margin-left: 16px;
                margin-right: auto;
            }
        }
        @media (max-width: 420px) {
            .container { padding-left: 0; padding-right: 0; }
            .card,
            .disclaimer {
                width: min(340px, calc(100vw - 32px));
                max-width: min(340px, calc(100vw - 32px));
                margin-left: auto;
                margin-right: auto;
            }
            .card { padding: 22px 20px; }
            .input-addon { padding: 0 12px; }
            .opt-row {
                align-items: flex-start;
            }
            .opt-value {
                max-width: 46%;
            }
        }

        /* ===== CARD ===== */
        .card {
            background: var(--white);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 28px;
            box-shadow: var(--shadow);
            min-width: 0;
        }
        .card-title {
            font-family: Georgia, serif;
            font-size: 18px;
            font-weight: 400;
            margin-bottom: 20px;
            color: var(--navy);
            display: flex;
            align-items: center;
            gap: 8px;
            text-wrap: balance;
        }
        .card-title .icon {
            font-size: 20px;
        }

        /* ===== FORM ===== */
        .form-group {
            margin-bottom: 20px;
            min-width: 0;
        }
        .form-label {
            display: block;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.6px;
            color: var(--navy-muted);
            margin-bottom: 8px;
        }
        .form-hint {
            font-size: 13px;
            color: var(--navy-muted);
            margin-top: 6px;
            line-height: 1.5;
        }

        .input-wrap {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: stretch;
            gap: 0;
            border: 1.5px solid var(--border);
            border-radius: 8px;
            overflow: hidden;
            transition: border-color 0.2s, box-shadow 0.2s;
            min-width: 0;
            width: 100%;
        }
        .input-wrap:focus-within {
            border-color: var(--gold);
            box-shadow: 0 0 0 3px var(--gold-bg);
        }
        .input-wrap input, .input-wrap select {
            border: none;
            outline: none;
            padding: 12px 14px;
            font-size: 15px;
            color: var(--navy);
            background: transparent;
            min-width: 0;
            width: 100%;
        }
        .input-wrap input::placeholder {
            color: #B5B5C8;
        }
        .input-addon {
            display: flex;
            align-items: center;
            padding: 0 14px;
            background: var(--cream);
            border-left: 1px solid var(--border-light);
            font-size: 14px;
            color: var(--navy-muted);
            font-weight: 500;
            white-space: nowrap;
            flex-shrink: 0;
        }
        .input-addon.clickable {
            cursor: pointer;
            user-select: none;
            transition: background 0.15s;
        }
        .input-addon.clickable:hover {
            background: var(--border-light);
        }
        .input-addon.clickable.active {
            background: var(--navy);
            color: var(--white);
        }

        select {
            width: 100%;
            padding: 12px 14px;
            font-size: 15px;
            border: 1.5px solid var(--border);
            border-radius: 8px;
            background: var(--white);
            color: var(--navy);
            cursor: pointer;
            outline: none;
        }
        select:focus {
            border-color: var(--gold);
            box-shadow: 0 0 0 3px var(--gold-bg);
        }

        .radio-group {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }
        .radio-pill {
            padding: 8px 16px;
            border: 1.5px solid var(--border);
            border-radius: 100px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.15s;
            background: var(--white);
            color: var(--navy-muted);
        }
        .radio-pill:hover {
            border-color: var(--gold);
            color: var(--navy);
        }
        .radio-pill.active {
            background: var(--navy);
            border-color: var(--navy);
            color: var(--white);
        }
        .radio-pill input {
            position: absolute;
            opacity: 0;
        }

        /* ===== RESULTS ===== */
        .results-section {
            display: flex;
            flex-direction: column;
            gap: 16px;
            min-width: 0;
        }

        /* Threshold Bar */
        .threshold-bar-wrap {
            margin-bottom: 4px;
        }
        .threshold-labels {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: var(--navy-muted);
            margin-bottom: 8px;
        }
        .threshold-bar {
            height: 32px;
            border-radius: 8px;
            overflow: hidden;
            display: flex;
            background: var(--border-light);
            position: relative;
        }
        .threshold-segment {
            height: 100%;
            transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
            position: relative;
            min-width: 0;
        }
        .threshold-segment.salary { background: var(--navy); }
        .threshold-segment.other { background: var(--navy-light); }
        .threshold-segment.copyright { background: var(--gold); }
        .threshold-segment.overflow { background: var(--danger); }
        .threshold-segment.copyright.pattern {
            background-image: repeating-linear-gradient(
                45deg,
                var(--gold),
                var(--gold) 8px,
                var(--gold-light) 8px,
                var(--gold-light) 16px
            );
        }
        .threshold-legend {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
            margin-top: 12px;
        }
        .legend-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 13px;
            color: var(--navy-muted);
        }
        .legend-dot {
            width: 10px; height: 10px;
            border-radius: 3px;
        }

        /* Stat Cards */
        .stat-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
        }
        @media (max-width: 480px) {
            .stat-grid { grid-template-columns: 1fr; }
        }
        .stat-box {
            padding: 16px;
            border-radius: 10px;
            border: 1px solid var(--border);
        }
        .stat-box.success { background: var(--success-bg); border-color: #C8E6C9; }
        .stat-box.warning { background: var(--warning-bg); border-color: #FFE082; }
        .stat-box.danger { background: var(--danger-bg); border-color: #FFCDD2; }
        .stat-label {
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--navy-muted);
            margin-bottom: 4px;
        }
        .stat-value {
            font-size: 22px;
            font-weight: 700;
            color: var(--navy);
            font-variant-numeric: tabular-nums;
        }
        .stat-value.success { color: var(--success); }
        .stat-value.warning { color: var(--warning); }
        .stat-value.danger { color: var(--danger); }
        .stat-note {
            font-size: 12px;
            color: var(--navy-muted);
            margin-top: 4px;
        }

        /* Optimization Card */
        .opt-card {
            background: var(--gold-bg);
            border: 1.5px solid var(--gold);
            border-radius: 12px;
            padding: 24px;
            position: relative;
            overflow: hidden;
        }
        .opt-card::before {
            content: '';
            position: absolute;
            top: 0; left: 0;
            width: 4px; height: 100%;
            background: var(--gold);
        }
        .opt-title {
            font-family: Georgia, serif;
            font-size: 18px;
            line-height: 1.35;
            margin-bottom: 16px;
            color: var(--navy);
            text-wrap: balance;
        }
        .opt-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 16px;
            padding: 8px 0;
            border-bottom: 1px dashed var(--border);
            font-size: 14px;
        }
        .opt-row:last-child {
            border-bottom: none;
            padding-top: 12px;
            margin-top: 4px;
        }
        .opt-label {
            color: var(--navy-muted);
            min-width: 0;
        }
        .opt-value {
            font-weight: 600;
            color: var(--navy);
            font-variant-numeric: tabular-nums;
            text-align: right;
            white-space: nowrap;
        }
        .opt-value.highlight { color: var(--success); font-size: 18px; }
        .opt-arrow {
            color: var(--gold);
            margin: 0 4px;
        }

        .opt-explain {
            margin-top: 16px;
            padding-top: 16px;
            border-top: 1px solid var(--border);
        }
        .opt-explain-content {
            font-size: 13px;
            line-height: 1.7;
            color: var(--navy-muted);
        }
        .opt-summary {
            margin: 0 0 12px;
            color: var(--navy-light);
        }
        .opt-summary strong {
            color: var(--navy);
        }
        .opt-explain-content ul {
            margin: 8px 0 0 18px;
        }
        .opt-explain-content li {
            margin-bottom: 4px;
        }

        /* Alert Box */
        .alert-box {
            border-radius: 10px;
            padding: 20px;
            display: flex;
            gap: 14px;
            align-items: flex-start;
        }
        .alert-box.danger {
            background: var(--danger-bg);
            border: 1px solid #FFCDD2;
        }
        .alert-icon {
            font-size: 22px;
            line-height: 1;
            flex-shrink: 0;
        }
        .alert-content h4 {
            font-family: Georgia, serif;
            font-size: 16px;
            margin-bottom: 6px;
            color: var(--danger);
        }
        .alert-content p {
            font-size: 14px;
            color: var(--navy-light);
            line-height: 1.6;
        }

        /* Empty State */
        .empty-state {
            text-align: center;
            padding: 40px 20px;
            color: var(--navy-muted);
        }
        .empty-state .icon {
            font-size: 40px;
            margin-bottom: 12px;
            opacity: 0.4;
        }
        .empty-state p {
            font-size: 14px;
        }

        /* Disclaimer */
        .disclaimer {
            margin-top: 32px;
            padding: 16px 20px;
            background: var(--white);
            border: 1px solid var(--border);
            border-radius: 10px;
            font-size: 13px;
            color: var(--navy-muted);
            line-height: 1.6;
            text-align: center;
        }
        .disclaimer strong {
            color: var(--navy-light);
        }

        /* Animations */
        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(12px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .animate-in {
            animation: fadeInUp 0.4s ease forwards;
        }
        .delay-1 { animation-delay: 0.05s; }
        .delay-2 { animation-delay: 0.1s; }
        .delay-3 { animation-delay: 0.15s; }

        /* Copy button */
        .copy-btn {
            background: none;
            border: none;
            cursor: pointer;
            color: var(--navy-muted);
            font-size: 14px;
            padding: 2px 4px;
            border-radius: 4px;
            transition: all 0.15s;
            margin-left: 4px;
        }
        .copy-btn:hover {
            background: var(--gold-bg);
            color: var(--gold);
        }

        /* Number formatting */
        .num { font-variant-numeric: tabular-nums; }
