:root {
            /* Mapped from main.css */
            --main-color: #1A48EE;
            --secondary-color: #008AFF;
            --tertiary-color: #2c20E6;
            --secondary-background: #f9f9f9;
            --main-background: #e5f3ff;
            --color-white: #ffffff;
            --color-error-dark: #c53030;
            --color-green: #16a34a;
            --color-gray: #4a5568;
            --border-color: #e2e8f0;
            
            /* Accessibility / Utility mappings */
            --primary: var(--main-color);
            --primary-dark: var(--tertiary-color);
            --text-main: #0f172a; 
            --text-muted: #475569; 
            --border: var(--border-color);
            --error: #b91c1c; 
            --success: #15803d;
            --focus-ring: var(--main-color);
            --bg-card: var(--color-white);
        }

        /* Scoped Calculator Styles */
        .grid-container { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
        @media (min-width: 992px) { .grid-container { grid-template-columns: 1fr 1fr; gap: 2.5rem; } }

        /* Page Title */
        .page-title { 
            font-size: 2.25rem; 
            font-weight: 800; 
            color: var(--text-main); 
            text-align: center;
            margin: 0 0 0.5rem 0;
            line-height: 1.2;
            padding-top: 1rem;
        }
        
        .page-subtitle {
            text-align: center;
            color: var(--text-muted);
            font-size: 1.1rem;
            margin-bottom: 2rem;
        }

        /* Cards */
        .card {
            background: var(--bg-card);
            border-radius: 12px;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            padding: 2rem;
            margin-bottom: 2rem;
            border: 1px solid var(--border);
        }

        /* Table Styling */
        .input-grid {
            display: grid;
            grid-template-columns: auto 1fr 1fr auto;
            gap: 1rem;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .grid-header { font-weight: 700; text-align: center; color: var(--text-muted); }
        .grid-label { font-weight: 700; color: var(--text-main); }

        .input-wrapper { position: relative; }

        input[type="number"] {
            width: 100%;
            padding: 0.75rem;
            border: 2px solid var(--border);
            border-radius: 8px;
            font-size: 1rem;
            transition: border-color 0.2s, box-shadow 0.2s;
            text-align: center;
            -moz-appearance: textfield;
            -webkit-appearance: textfield;
            appearance: textfield;
            color: var(--text-main);
            background-color: #fff;
        }

        input[type="number"]::-webkit-outer-spin-button,
        input[type="number"]::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        input[type="number"]:focus, select:focus, button:focus, summary:focus {
            outline: 3px solid var(--focus-ring);
            outline-offset: 2px;
            border-color: var(--primary);
        }

        .total-cell {
            text-align: center;
            font-weight: bold;
            color: var(--text-muted);
            background: #f1f5f9;
            padding: 0.75rem;
            border-radius: 8px;
        }

        /* Button Group */
        .button-group {
            display: grid;
            grid-template-columns: 2fr 1fr 1fr;
            gap: 10px;
            margin-top: 1rem;
        }

        .btn {
            padding: 1rem;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.2s;
            text-align: center;
            font-family: inherit;
        }

        .btn-calculate { background-color: var(--primary); color: white; }
        .btn-calculate:hover { background-color: var(--primary-dark); }

        .btn-secondary { background-color: #e2e8f0; color: var(--text-main); border: 1px solid var(--border); }
        .btn-secondary:hover { background-color: #cbd5e1; }

        /* Results Styling */
        .results-section { display: none; animation: fadeIn 0.3s ease-in; }
        .results-section:focus { outline: none; }

        h2 { font-size: 1.25rem; margin-bottom: 0.75rem; color: var(--primary-dark); }

        .section-title {
            font-size: 1rem;
            font-weight: 700;
            color: var(--text-main);
            margin-top: 1.5rem;
            margin-bottom: 0.75rem;
            border-bottom: 2px solid var(--border);
            padding-bottom: 0.5rem;
        }

        .result-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .result-card {
            background: #f8fafc;
            padding: 1rem;
            border-radius: 8px;
            border: 1px solid var(--border);
        }

        .result-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.25rem; font-weight: 700; }
        .result-value { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }
        .result-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

        .significance {
            margin-top: 1rem;
            padding: 1rem;
            border-radius: 8px;
            font-weight: 600;
            text-align: center;
        }

        .sig-yes { background-color: #dcfce7; color: #14532d; border: 1px solid #bbf7d0; }
        .sig-no { background-color: #fee2e2; color: #7f1d1d; border: 1px solid #fecaca; }

        .error-msg {
            color: var(--error);
            font-size: 0.95rem;
            margin-top: 0.5rem;
            display: none;
            font-weight: 700;
            padding: 0.5rem;
            background-color: #fef2f2;
            border: 1px solid #fee2e2;
            border-radius: 6px;
        }

        /* Glossary Styling */
        .glossary-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1.5rem;
            margin-top: 1rem;
        }
        
        .glossary-item { border-left: 3px solid var(--primary); padding-left: 1rem; }
        .glossary-item dt { font-weight: 700; color: var(--primary-dark); margin-bottom: 0.25rem; font-size: 0.95rem; }
        .glossary-item dd { font-size: 0.9rem; color: var(--text-muted); margin: 0; line-height: 1.5; }
        
        .formula {
            margin-top: 0.35rem; 
            font-family: 'Courier New', monospace; 
            color: var(--text-main);
            background: #f1f5f9;
            padding: 2px 6px;
            border-radius: 4px;
            display: inline-block;
            font-size: 0.85rem;
            border: 1px solid var(--border);
        }

        /* Analysis Tables & Mobile Responsiveness */
        .analysis-tables-grid {
            display: grid;
            grid-template-columns: 1fr; /* Default mobile: 1 column */
            gap: 1.5rem;
            margin-bottom: 1.5rem;
        }
        
        @media (min-width: 768px) {
             .analysis-tables-grid {
                 grid-template-columns: 1fr 1fr; /* Desktop: 2 columns */
             }
        }

        /* Individual Table Container for Scrolling */
        .table-scroll-wrapper {
            width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
            border-radius: 8px;
            border: 1px solid var(--border);
            background: #fff;
            box-shadow: 0 1px 2px rgba(0,0,0,0.05);
        }

        .mini-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9rem;
            min-width: 300px; /* Ensure table doesn't squish too much */
        }

        .mini-table th, .mini-table td {
            padding: 0.75rem; /* Increased padding for touch targets */
            text-align: center;
            border: 1px solid var(--border);
            color: var(--text-main);
            white-space: nowrap; /* Prevent wrapping in cells */
        }

        .mini-table th { background-color: #f1f5f9; color: var(--text-muted); font-weight: 700; }
        .table-heading { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--primary-dark); }

        /* Canvas */
        .chart-container {
            width: 100%;
            height: 250px;
            background: #f8fafc;
            border: 1px solid var(--border);
            border-radius: 8px;
            position: relative;
            margin-top: 1rem;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        canvas { max-width: 100%; max-height: 100%; }

        /* Educational Section */
        .info-section { background-color: #eff6ff; border: 1px solid #bfdbfe; }
        .info-section h3 { margin-bottom: 0.5rem; color: var(--primary-dark); }
        .info-section p { margin-bottom: 0.5rem; font-size: 0.95rem; }
        
        /* Steps Styling */
        details summary {
            cursor: pointer; 
            font-weight: 600; 
            color: var(--primary-dark); 
            padding: 0.5rem 0;
        }
        details summary:focus { outline: 2px solid var(--primary); border-radius: 4px; }
        details summary::-webkit-details-marker { color: var(--primary); }
        details[open] summary ~ * { animation: fadeIn 0.3s ease-in-out; }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Footer Override for Calculator */

        .privacy-note strong { color: var(--primary); display: inline; font-size: 0.9rem; }

        @media (max-width: 600px) {
            .input-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
            .grid-header, .grid-label, .row-total-header, .col-total-header { display: none; }
            .button-group { grid-template-columns: 1fr; }
        }
        
        /* Breadcrumb Integration */
        .global-breadcrumb-wrapper {
            position: relative; z-index: 1; background-color: var(--main-background); 
            margin-left: 285px; padding: 10px 16px;
        }
        .breadcrumb ol {
            list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; font-size: 1rem; color: #333;
        }
        .breadcrumb li { display: flex; align-items: center; }
        .breadcrumb li a { text-decoration: none; color: var(--main-color); }
        .breadcrumb li a:hover { text-decoration: underline; }
        .breadcrumb li span { margin: 0 0.5rem; color: #333; font-weight: 500; }
        
        @media screen and (max-width:1280px){
            .global-breadcrumb-wrapper { margin-left: auto; margin-right: auto; margin-top: 80px; max-width: 1280px; }
        }