.fraction-display {
            font-size: 2.8rem;
            font-family: 'Cambria Math', 'Latin Modern Math', STIXGeneral, serif;
            text-align: center;
            padding: 0.5rem 1rem;
            background: #f8f9fa;
            border-radius: 12px;
            border: 1px solid #e9ecef;
            display: inline-block;
            min-width: 120px;
        }
        .fraction-display .frac {
            display: inline-block;
            text-align: center;
            vertical-align: middle;
        }
        .fraction-display .frac .num {
            display: block;
            border-bottom: 3px solid #333;
            padding: 0 0.6rem 0.2rem 0.6rem;
        }
        .fraction-display .frac .den {
            display: block;
            padding: 0.2rem 0.6rem 0 0.6rem;
        }
        .mixed-display {
            font-size: 2.8rem;
            font-family: 'Cambria Math', 'Latin Modern Math', STIXGeneral, serif;
            text-align: center;
            padding: 0.5rem 1rem;
            background: #e8f4f8;
            border-radius: 12px;
            border: 1px solid #b8d4de;
            display: inline-block;
            min-width: 120px;
        }
        .mixed-display .whole {
            font-size: 2.8rem;
            margin-right: 0.3rem;
        }
        .mixed-display .frac-small {
            display: inline-block;
            text-align: center;
            vertical-align: middle;
            font-size: 1.8rem;
            margin-left: 0.2rem;
        }
        .mixed-display .frac-small .num {
            display: block;
            border-bottom: 2px solid #333;
            padding: 0 0.4rem 0.1rem 0.4rem;
        }
        .mixed-display .frac-small .den {
            display: block;
            padding: 0.1rem 0.4rem 0 0.4rem;
        }
        .step-container {
            background: #f8faff;
            border-radius: 8px;
            padding: 1.2rem 1.5rem;
            border-left: 5px solid #0d6efd;
            margin: 0.8rem 0;
        }
        .step-container .step-num {
            font-weight: 700;
            color: #0d6efd;
            margin-right: 0.5rem;
        }
        .visual-bar-container {
            width: 100%;
            max-width: 600px;
            margin: 1.5rem auto;
            background: #f0f2f5;
            border-radius: 8px;
            padding: 0.5rem 0;
            position: relative;
        }
        .visual-bar {
            display: flex;
            height: 40px;
            border-radius: 6px;
            overflow: hidden;
            background: #e9ecef;
            position: relative;
        }
        .visual-bar .segment {
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-weight: 600;
            font-size: 0.85rem;
            transition: width 0.4s ease;
            border-right: 1px solid rgba(255,255,255,0.3);
            min-width: 24px;
        }
        .visual-bar .segment:last-child {
            border-right: none;
        }
        .visual-bar .segment-full {
            background: #0d6efd;
        }
        .visual-bar .segment-partial {
            color: #fff;
        }
        .visual-legend {
            display: flex;
            justify-content: center;
            gap: 1.5rem;
            margin: 0.5rem 0 1rem 0;
            font-size: 0.9rem;
        }
        .visual-legend .dot {
            display: inline-block;
            width: 14px;
            height: 14px;
            border-radius: 4px;
            margin-right: 6px;
        }
        .dot-full { background: #0d6efd; }
        .dot-partial { background: #6c9bd2; }
        .dot-empty { background: #dee2e6; }
        .math-box .accordion-item {
            border: 1px solid #dee2e6;
        }
        .accordion-button:not(.collapsed) {
            background: rgba(13, 110, 253, 0.05);
            color: #0d6efd;
        }
  
        .badge-custom {
            background: rgba(13, 110, 253, 0.12);
            color: #0d6efd;
            padding: 0.25rem 0.75rem;
            border-radius: 30px;
            font-size: 0.8rem;
            font-weight: 500;
        }
        .input-group-custom {
            margin-bottom: 0.8rem;
        }
        .coord-input {
            margin-bottom: 0.4rem;
        }
        @media (max-width: 768px) {
            .fraction-display, .mixed-display { font-size: 2rem; }
            .mixed-display .frac-small { font-size: 1.4rem; }
        }