:root {
    --bg-primary: #F5F5F5;
    --bg-panel: #E0E0E0;
    --text-primary: #222222;
    --accent-primary: #4A90E2;
    --accent-secondary: #FF9500;
    --border-color: #333333;
    --input-bg: #f9f9f9;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --error-color: #e74c3c;
    --neutral-axis-color: #0077cc;
    --concrete-color: #e6e6e6;
    --bar-color: #222222;
}

.colorblind {
    --success-color: #000000;
    --warning-color: #666666;
    --error-color: #333333;
    --neutral-axis-color: #0000FF;
    --bar-color: #000000;
    filter: grayscale(100%);
}

.crack-width-estimator-wrapper * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.crack-width-estimator-wrapper body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

.crack-width-estimator-wrapper .container {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .crack-width-estimator-wrapper .container {
        grid-template-columns: 1fr;
    }
}

.crack-width-estimator-wrapper .panel {
    background-color: var(--bg-panel);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.crack-width-estimator-wrapper .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.crack-width-estimator-wrapper .panel-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.crack-width-estimator-wrapper .toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crack-width-estimator-wrapper .toggle-label {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.crack-width-estimator-wrapper .toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.crack-width-estimator-wrapper .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.crack-width-estimator-wrapper .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.crack-width-estimator-wrapper .toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.crack-width-estimator-wrapper input:checked + .toggle-slider {
    background-color: var(--accent-primary);
}

.crack-width-estimator-wrapper input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

.crack-width-estimator-wrapper .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.crack-width-estimator-wrapper .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crack-width-estimator-wrapper .form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.crack-width-estimator-wrapper .form-group .hint {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.crack-width-estimator-wrapper .input-field {
    padding: 14px 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--input-bg);
    font-size: 1rem;
    color: var(--text-primary);
    transition: border-color 0.3s, box-shadow 0.3s;
    height: 52px;
    min-height: 52px;
    line-height: 1.4;
}

.crack-width-estimator-wrapper .input-field:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.crack-width-estimator-wrapper .input-field.invalid {
    border-color: var(--error-color);
    background-color: rgba(231, 76, 60, 0.05);
}

.crack-width-estimator-wrapper .code-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 25px;
}

.crack-width-estimator-wrapper .code-tab {
    padding: 15px;
    text-align: center;
    background-color: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crack-width-estimator-wrapper .code-tab:hover {
    background-color: #e9e9e9;
}

.crack-width-estimator-wrapper .code-tab.active {
    background-color: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.crack-width-estimator-wrapper .button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.crack-width-estimator-wrapper .btn {
    padding: 16px 28px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    min-width: 140px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crack-width-estimator-wrapper .btn-primary {
    background-color: var(--accent-primary);
    color: white;
}

.crack-width-estimator-wrapper .btn-primary:hover {
    background-color: #3a7bc8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.crack-width-estimator-wrapper .btn-secondary {
    background-color: var(--accent-secondary);
    color: white;
}

.crack-width-estimator-wrapper .btn-secondary:hover {
    background-color: #e08500;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.crack-width-estimator-wrapper .btn-neutral {
    background-color: var(--bg-panel);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.crack-width-estimator-wrapper .btn-neutral:hover {
    background-color: #d0d0d0;
    transform: translateY(-2px);
}

.crack-width-estimator-wrapper .results-section {
    margin-top: 25px;
}

.crack-width-estimator-wrapper .result-card {
    background-color: white;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.crack-width-estimator-wrapper .result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.crack-width-estimator-wrapper .result-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.crack-width-estimator-wrapper .result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.crack-width-estimator-wrapper .result-value.pass {
    color: var(--success-color);
}

.crack-width-estimator-wrapper .result-value.warning {
    color: var(--warning-color);
}

.crack-width-estimator-wrapper .result-value.fail {
    color: var(--error-color);
}

.crack-width-estimator-wrapper .step-calculation {
    background-color: var(--input-bg);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    white-space: pre-wrap;
    border: 1px solid #ddd;
}

.crack-width-estimator-wrapper .visualization-container {
    background-color: white;
    border-radius: 6px;
    padding: 20px;
    margin-top: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.crack-width-estimator-wrapper .svg-container {
    width: 100%;
    height: 360px;
    overflow: visible;
    margin: 20px 0;
}

.crack-width-estimator-wrapper .commentary {
    background-color: #f0f8ff;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
    border-left: 4px solid var(--accent-primary);
}

.crack-width-estimator-wrapper .commentary h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.crack-width-estimator-wrapper .commentary p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.crack-width-estimator-wrapper .error-message {
    background-color: rgba(231, 76, 60, 0.1);
    border: 2px solid var(--error-color);
    color: var(--error-color);
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    font-weight: 600;
}

.crack-width-estimator-wrapper .trademark {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-size: 0.8rem;
    color: var(--text-primary);
    opacity: 0.7;
    z-index: 1000;
}

@media (max-width: 768px) {
    .crack-width-estimator-wrapper body {
        padding: 15px;
    }
    
    .crack-width-estimator-wrapper .container {
        gap: 20px;
    }
    
    .crack-width-estimator-wrapper .panel {
        padding: 20px;
    }
    
    .crack-width-estimator-wrapper .form-grid {
        grid-template-columns: 1fr;
    }
    
    .crack-width-estimator-wrapper .code-selector {
        grid-template-columns: 1fr;
    }
    
    .crack-width-estimator-wrapper .button-group {
        flex-direction: column;
    }
    
    .crack-width-estimator-wrapper .btn {
        width: 100%;
    }
    
    .crack-width-estimator-wrapper .trademark {
        position: static;
        text-align: center;
        margin-top: 30px;
        padding-top: 20px;
        border-top: 1px solid #ddd;
    }
}

.crack-width-estimator-wrapper .input-section {
    margin-bottom: 25px;
}

.crack-width-estimator-wrapper .section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.crack-width-estimator-wrapper .collapse-header {
    background-color: var(--input-bg);
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    transition: background-color 0.3s;
    min-height: 50px;
}

.crack-width-estimator-wrapper .collapse-header:hover {
    background-color: #e9e9e9;
}

.crack-width-estimator-wrapper .collapse-content {
    padding: 20px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 0 0 6px 6px;
    margin-bottom: 20px;
    display: none;
}

.crack-width-estimator-wrapper .collapse-content.active {
    display: block;
}

.crack-width-estimator-wrapper .collapse-icon {
    transition: transform 0.3s;
}

.crack-width-estimator-wrapper .collapse-icon.active {
    transform: rotate(180deg);
}

.crack-width-estimator-wrapper .info-box {
    background-color: #f8f9fa;
    border-left: 4px solid var(--accent-secondary);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 0 4px 4px 0;
}

.crack-width-estimator-wrapper .info-box p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

.crack-width-estimator-wrapper .engineering-commentary {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
    border-left: 4px solid var(--accent-secondary);
}

.crack-width-estimator-wrapper .engineering-commentary h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.crack-width-estimator-wrapper .engineering-commentary ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.crack-width-estimator-wrapper .engineering-commentary li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.crack-width-estimator-wrapper select.input-field {
    height: 52px;
    min-height: 52px;
    padding-top: 12px;
    padding-bottom: 12px;
    line-height: 1.4;
    appearance: menulist;
}

.crack-width-estimator-wrapper option {
    padding: 10px;
    line-height: 1.4;
    height: auto;
    min-height: 30px;
}

/* Ensure all text is visible */
.crack-width-estimator-wrapper input,
.crack-width-estimator-wrapper select,
.crack-width-estimator-wrapper textarea {
    font-size: 16px !important; /* Prevent zoom on mobile */
    line-height: 1.4 !important;
}

/* Fix for mobile visibility */
@media (max-width: 480px) {
    .crack-width-estimator-wrapper .input-field {
        font-size: 16px !important;
        height: 56px !important;
        min-height: 56px !important;
    }
    
    .crack-width-estimator-wrapper select.input-field {
        height: 56px !important;
        min-height: 56px !important;
    }
}