:root {
    --primary-color: #2a9d8f;
    --secondary-color: #264653;
    --background-color: #f7f9fa;
    --card-background: #ffffff;
    --text-color: #333333;
    --light-text-color: #666666;
    --border-color: #e0e0e0;
    --accent-color: #e9c46a;
    --danger-color: #e76f51;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}



@media (min-width: 768px) {
    .tr-calculator-container {
        padding: 30px;
    }
}

.tr-header {
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.tr-header h2 {
    color: var(--secondary-color);
    margin: 0 0 5px 0;
}

.tr-header p {
    color: var(--light-text-color);
    margin: 0;
    font-size: 0.95rem;
}

.tr-form-section {
    margin-bottom: 25px;
}

.tr-form-section h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
    display: inline-block;
}

.tr-input-group {
    margin-bottom: 20px;
}

.tr-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.tr-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #e0e7ec;
    border-radius: 5px;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid var(--card-background);
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}
input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid var(--card-background);
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

.tr-slider-value {
    font-weight: 600;
    color: var(--secondary-color);
    background-color: #e8f5e9;
    padding: 5px 10px;
    border-radius: 6px;
    min-width: 60px;
    text-align: center;
}

select, input[type="text"], input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background-color: var(--card-background);
}
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(42, 157, 143, 0.2);
}

.tr-radio-group, .tr-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.tr-radio-group label, .tr-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    background-color: var(--background-color);
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease-in-out;
}

.tr-radio-group input:checked + label,
.tr-checkbox-group input:checked + label {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.tr-radio-group label:hover, .tr-checkbox-group label:hover {
    border-color: var(--accent-color);
}
.tr-radio-group input, .tr-checkbox-group input {
    display: none;
}

.tr-tooltip {
    display: inline-block;
    background-color: var(--light-text-color);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 12px;
    text-align: center;
    line-height: 16px;
    cursor: help;
    position: relative;
}
.tr-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--secondary-color);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    width: 220px;
    text-align: left;
    white-space: pre-wrap;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}


.tr-results-section {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
}
@media (min-width: 768px) {
    .tr-results-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "summary chart"
            "breakdown chart";
        gap: 20px;
        align-items: flex-start;
    }
}

.tr-results-summary {
    grid-area: summary;
    background: var(--secondary-color);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

.tr-results-summary p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
}

.tr-results-summary h3 {
    font-size: 2.5rem;
    margin: 5px 0 0 0;
    color: var(--accent-color);
    letter-spacing: 1px;
}

.tr-results-breakdown {
    grid-area: breakdown;
    margin-bottom: 20px;
}

.tr-results-breakdown h4, .tr-chart-container h4 {
    margin-top: 0;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.tr-results-breakdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tr-results-breakdown li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}
.tr-results-breakdown li:last-child {
    border-bottom: none;
}
.tr-results-breakdown li strong {
    color: var(--primary-color);
    font-weight: 600;
}

.tr-chart-container {
    grid-area: chart;
}

.tr-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 180px;
    padding: 10px 0;
    border-left: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
}

.tr-chart-bar {
    width: 15%;
    background-color: var(--primary-color);
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 0.5s ease-in-out;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 0%;
}

.tr-chart-bar:nth-child(2) { background-color: #2b7a78; }
.tr-chart-bar:nth-child(3) { background-color: #fca311; }
.tr-chart-bar:nth-child(4) { background-color: #e76f51; }
.tr-chart-bar:nth-child(5) { background-color: #d62828; }

.tr-bar-label {
    color: white;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    padding-bottom: 5px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out 0.3s;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

.tr-chart-bar[style*="height: 0%"] .tr-bar-label {
    display: none;
}
.tr-chart-bar[style*="height"]:not([style*="height: 0%"]) .tr-bar-label {
    opacity: 1;
}