/* --- 1. VARIABLES & THEME --- */
    #elhryx_calculator_wrapper {
      --primary-color: #0B1F51;    /* Navy */
      --text-color: #2B3445;       /* Body Text */
      --hover-color: #AFC8FF;      /* Light Blue Hover */
      --bg-color: #F8FAFC;
      --white: #FFFFFF;
      --border-color: #E2E8F0;
      --danger-color: #EF4444;     /* Red */
      --danger-bg: #FEF2F2;
      --info-bg: #EFF6FF;
      --info-text: #1E40AF;
      --warning-text: #B45309;
    }

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

    #elhryx_calculator_wrapper {
      font-family: 'Inter', sans-serif;
      background-color: var(--bg-color);
      color: var(--text-color);
      line-height: 1.6;
      padding: 20px;
      -webkit-font-smoothing: antialiased;
    }

    /* --- 2. LAYOUT --- */
    #elhryx_calculator_wrapper .elhryx_calculator-container {
      max-width: 1100px;
      margin: 0 auto;
      background: var(--white);
      border-radius: 12px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
      border: 1px solid var(--border-color);
      overflow: hidden;
    }

    #elhryx_calculator_wrapper .elhryx_calculator-grid {
      display: grid;
      grid-template-columns: 1fr 1.1fr; /* Split View Desktop */
      min-height: 600px;
    }

    #elhryx_calculator_wrapper .elhryx_input-section, #elhryx_calculator_wrapper .elhryx_results-section { padding: 35px; }

    #elhryx_calculator_wrapper .elhryx_input-section {
      background-color: #ffffff;
      border-right: 1px solid var(--border-color);
      display: flex;
      flex-direction: column;
    }

    #elhryx_calculator_wrapper .elhryx_results-section {
      background-color: #fafbfd;
      display: flex;
      flex-direction: column;
      min-width: 0;
      position: relative;
    }
    
    #elhryx_calculator_wrapper .elhryx_section-title {
      color: var(--primary-color);
      font-size: 18px;
      font-weight: 800;
      margin-bottom: 20px;
      padding-bottom: 10px;
      border-bottom: 2px solid var(--border-color);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    /* --- 3. INPUTS & CONTROLS --- */
    
    #elhryx_calculator_wrapper .elhryx_type-selector {
        display: flex;
        gap: 10px;
        margin-bottom: 25px;
        background: #F1F5F9;
        padding: 5px;
        border-radius: 8px;
    }
    
    #elhryx_calculator_wrapper .elhryx_type-btn {
        flex: 1;
        padding: 14px 10px;
        border: none;
        background: transparent;
        color: #64748B;
        font-weight: 600;
        font-size: 14px;
        cursor: pointer;
        border-radius: 6px;
        transition: all 0.2s;
        text-align: center;
    }
    
    #elhryx_calculator_wrapper .elhryx_type-btn.elhryx_active {
        background: var(--white);
        color: var(--primary-color);
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        font-weight: 700;
        border: 1px solid var(--border-color);
    }

    #elhryx_calculator_wrapper .elhryx_input-group { margin-bottom: 20px; position: relative; }
    
    #elhryx_calculator_wrapper .elhryx_input-group label {
      display: block; 
      margin-bottom: 8px;
      font-weight: 700; 
      color: var(--primary-color);
      font-size: 13px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    #elhryx_calculator_wrapper .elhryx_input-helper {
        display: block;
        font-size: 11px;
        color: #64748B;
        margin-top: -4px;
        margin-bottom: 8px;
        font-style: italic;
    }

    #elhryx_calculator_wrapper .elhryx_input-wrapper { position: relative; width: 100%; }

    #elhryx_calculator_wrapper .elhryx_input-field {
        width: 100%;
        padding: 16px; 
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-size: 16px; 
        background-color: var(--white);
        font-family: 'Inter', sans-serif;
        color: var(--primary-color);
        font-weight: 500;
        transition: border-color 0.2s;
    }

    #elhryx_calculator_wrapper .elhryx_input-field:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(11, 31, 81, 0.1);
    }

    /* Checkbox Styling */
    #elhryx_calculator_wrapper .elhryx_checkbox-wrapper {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 15px;
        background: #F8FAFC;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        cursor: pointer;
        margin-bottom: 20px;
    }
    
    #elhryx_calculator_wrapper .elhryx_checkbox-wrapper input[type="checkbox"] {
        width: 20px;
        height: 20px;
        accent-color: var(--primary-color);
    }

    /* ADDED: Missing label styling to fix visibility issue */
    #elhryx_calculator_wrapper .elhryx_checkbox-label {
        font-weight: 600;
        color: var(--primary-color);
        font-size: 14px;
        cursor: pointer;
    }

    /* Quick Fill Bar */
    #elhryx_calculator_wrapper .elhryx_quick-fill-bar {
        display: flex;
        gap: 10px;
        align-items: end;
        background: #EFF6FF;
        padding: 10px;
        border-radius: 6px;
        margin-bottom: 10px;
        border: 1px solid #DBEAFE;
    }
    #elhryx_calculator_wrapper .elhryx_quick-fill-bar .elhryx_input-wrapper {
        flex: 1;
    }
    #elhryx_calculator_wrapper .elhryx_quick-fill-bar label {
        font-size: 10px;
        margin-bottom: 4px;
        color: var(--info-text);
        font-weight: 600;
    }
    #elhryx_calculator_wrapper .elhryx_quick-fill-bar input {
        padding: 8px;
        font-size: 12px;
    }
    #elhryx_calculator_wrapper .elhryx_quick-fill-btn {
        padding: 8px 12px;
        background: var(--info-text);
        color: white;
        border: none;
        border-radius: 4px;
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
        height: 38px;
    }

    /* Dynamic Year Table for Vacation */
    #elhryx_calculator_wrapper .elhryx_year-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        overflow: hidden;
    }
    #elhryx_calculator_wrapper .elhryx_year-table th {
        background: #F1F5F9;
        padding: 10px;
        font-size: 11px;
        text-align: left;
        color: var(--primary-color);
        border-bottom: 1px solid var(--border-color);
    }
    #elhryx_calculator_wrapper .elhryx_year-table td {
        padding: 10px;
        background: white;
        border-bottom: 1px solid #F1F5F9;
        vertical-align: top;
    }
    #elhryx_calculator_wrapper .elhryx_year-table input[type="text"] {
        width: 100%;
        padding: 8px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        font-size: 13px;
    }

    /* Breakdown Text Styling */
    #elhryx_calculator_wrapper .elhryx_breakdown-text {
        font-size: 11px;
        line-height: 1.6;
        color: #334155;
    }
    #elhryx_calculator_wrapper .elhryx_breakdown-line {
        display: flex;
        justify-content: space-between;
        margin-bottom: 2px;
        align-items: baseline;
    }
    #elhryx_calculator_wrapper .elhryx_breakdown-line.elhryx_total {
        border-top: 1px solid #eee;
        padding-top: 4px;
        margin-top: 4px;
        font-weight: 600;
    }
    #elhryx_calculator_wrapper .elhryx_breakdown-line strong {
        color: var(--primary-color);
    }
    #elhryx_calculator_wrapper .elhryx_cap-warning {
        color: var(--warning-text);
        font-weight: 700;
    }

    /* Error States */
    #elhryx_calculator_wrapper .elhryx_input-field.elhryx_error, 
    #elhryx_calculator_wrapper .elhryx_year-table input.elhryx_error {
        border-color: var(--danger-color);
        background-color: #FEF2F2;
        box-shadow: 0 0 0 1px var(--danger-color);
    }

    #elhryx_calculator_wrapper .elhryx_error-msg {
        color: var(--danger-color);
        font-size: 12px;
        margin-top: 6px;
        font-weight: 600;
        display: none; 
        animation: fadeIn 0.3s;
    }
    
    #elhryx_calculator_wrapper .elhryx_field-error-text {
        color: var(--danger-color);
        font-size: 11px;
        margin-top: 2px;
        display: none;
    }
    
    /* Action Buttons */
    #elhryx_calculator_wrapper .elhryx_action-buttons { 
        margin-top: auto; 
        padding-top: 20px; 
        display: grid; 
        gap: 12px; 
    }
    
    #elhryx_calculator_wrapper button.elhryx_primary-btn {
      background-color: var(--primary-color); 
      color: white; 
      border: none; 
      padding: 18px; 
      border-radius: 8px;
      font-weight: 700; 
      font-size: 16px; 
      cursor: pointer; 
      transition: transform 0.1s, background-color 0.2s;
      width: 100%;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    
    #elhryx_calculator_wrapper button.elhryx_primary-btn:hover { background-color: #1a3a7a; }
    #elhryx_calculator_wrapper button.elhryx_secondary-btn {
      background-color: white; 
      color: var(--text-color); 
      border: 1px solid var(--border-color); 
      padding: 14px; 
      border-radius: 8px;
      font-weight: 600; 
      cursor: pointer;
      width: 100%;
    }

    /* --- 4. RESULTS UI --- */
    #elhryx_calculator_wrapper .elhryx_hero-card {
        background-color: var(--white);
        border-radius: 8px;
        border: 1px solid var(--border-color);
        border-left: 6px solid var(--primary-color);
        margin-bottom: 25px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        padding: 25px;
        text-align: center;
        /* Initially hidden */
        display: none; 
        transform: translateY(10px);
        transition: opacity 0.4s ease, transform 0.4s ease;
        opacity: 0;
    }
    
    #elhryx_calculator_wrapper .elhryx_hero-card.elhryx_visible { 
        display: block; 
        opacity: 1; 
        transform: translateY(0); 
    }

    #elhryx_calculator_wrapper .elhryx_hero-label { font-size: 13px; color: var(--primary-color); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
    #elhryx_calculator_wrapper .elhryx_hero-value { font-size: 42px; font-weight: 800; color: var(--primary-color); margin-bottom: 5px; line-height: 1; }
    #elhryx_calculator_wrapper .elhryx_hero-subtext { font-size: 14px; color: #64748B; font-weight: 500; }

    #elhryx_calculator_wrapper .elhryx_breakdown-box {
        background: var(--white);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        overflow: hidden;
        margin-bottom: 20px;
        display: none; 
    }
    
    #elhryx_calculator_wrapper .elhryx_breakdown-header {
        background: #F1F5F9;
        padding: 12px 20px;
        font-size: 13px;
        font-weight: 700;
        color: var(--primary-color);
        text-transform: uppercase;
        border-bottom: 1px solid var(--border-color);
    }

    #elhryx_calculator_wrapper .elhryx_result-row {
        display: flex;
        justify-content: space-between;
        padding: 12px 20px;
        border-bottom: 1px solid #F1F5F9;
        font-size: 14px;
        color: #334155;
    }
    #elhryx_calculator_wrapper .elhryx_result-row:last-child { border-bottom: none; }
    #elhryx_calculator_wrapper .elhryx_result-val { font-weight: 700; color: var(--primary-color); }
    
    #elhryx_calculator_wrapper .elhryx_rule-note {
        background-color: var(--info-bg); color: var(--info-text); padding: 12px; border-radius: 6px; font-size: 13px; margin-top: 20px; border-left: 3px solid #3B82F6; line-height: 1.5; display: none;
    }

    #elhryx_calculator_wrapper .elhryx_disclaimer-box {
        margin-top: 40px;
        border-top: 2px dashed #E2E8F0;
        padding-top: 20px;
        font-size: 12px;
        color: #64748B;
        text-align: center;
        display: none; /* Hidden on screen, shown in print */
    }

    #elhryx_calculator_wrapper .elhryx_hidden { display: none !important; }
    
    @keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

    /* Responsive */
    @media (max-width: 900px) {
      #elhryx_calculator_wrapper .elhryx_calculator-grid { grid-template-columns: 1fr; }
      #elhryx_calculator_wrapper .elhryx_input-section { border-right: none; border-bottom: 1px solid var(--border-color); padding: 25px; }
      #elhryx_calculator_wrapper .elhryx_results-section { padding: 25px; }
    }
    @media (max-width: 480px) {
        #elhryx_calculator_wrapper { padding: 10px; }
        #elhryx_calculator_wrapper .elhryx_input-section, #elhryx_calculator_wrapper .elhryx_results-section { padding: 20px; }
    }
    
    /* PRINT STYLES - FIXED TO HIDE SITE HEADER/FOOTER */
    @media print {
        /* HIDE everything on the page first (Header, Footer, Sidebar, etc.) */
        body * {
            visibility: hidden;
        }

        /* Show ONLY the calculator wrapper and its contents */
        #elhryx_calculator_wrapper, #elhryx_calculator_wrapper * {
            visibility: visible;
        }

        /* Position wrapper at absolute top left to fill page */
        #elhryx_calculator_wrapper {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            margin: 0;
            padding: 0;
            background: white;
            z-index: 99999; /* Ensure it overlays everything else */
            font-family: sans-serif;
            border: none;
            box-shadow: none;
        }
        
        #elhryx_calculator_wrapper .elhryx_calculator-container { 
            box-shadow: none; 
            border: none; 
            max-width: 100%; 
            margin: 0; 
        }
        
        /* HIDE Inputs/Controls inside the calculator */
        #elhryx_calculator_wrapper .elhryx_input-section, 
        #elhryx_calculator_wrapper .elhryx_type-selector, 
        #elhryx_calculator_wrapper .elhryx_section-title, 
        #elhryx_calculator_wrapper .elhryx_input-group, 
        #elhryx_calculator_wrapper .elhryx_action-buttons { 
            display: none !important; 
        }
        
        /* Reset Grid to full width */
        #elhryx_calculator_wrapper .elhryx_calculator-grid { 
            display: block; 
        }
        
        #elhryx_calculator_wrapper .elhryx_results-section { 
            width: 100%; 
            padding: 20px; 
            display: block !important; 
            background: white !important; 
        }
        
        /* Show Disclaimer */
        #elhryx_calculator_wrapper .elhryx_disclaimer-box { 
            display: block; 
        }
        
        /* Clean up result card */
        #elhryx_calculator_wrapper .elhryx_hero-card { 
            border: 1px solid #000; 
            box-shadow: none; 
            page-break-inside: avoid; 
            margin-bottom: 30px; 
            display: block !important; 
            opacity: 1 !important; 
            transform: none !important;
        }
        
        #elhryx_calculator_wrapper .elhryx_breakdown-box { 
            page-break-inside: avoid; 
            border: 1px solid #000; 
            margin-bottom: 20px; 
        }
        
        #elhryx_calculator_wrapper .elhryx_rule-note { 
            border: 1px solid #000; 
        }
        
        #elhryx_calculator_wrapper .elhryx_breakdown-header { 
            background: #eee !important; 
            -webkit-print-color-adjust: exact; 
        }
    }
