/* Travytour Core 1.3.2 — public calculator comparison mode. */

.tt-mode-field,
.tt-compare-fields {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.tt-mode-field > legend,
.tt-compare-fields > legend {
    margin-bottom: 0.5rem;
    color: var(--tt-ink, #172033);
    font-size: 0.9rem;
    font-weight: 750;
}

.tt-mode-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.tt-mode-options label {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.tt-mode-options input {
    position: absolute;
    width: 1px;
    min-height: 0;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.tt-mode-options label > span {
    min-height: 88px;
    display: grid;
    align-content: center;
    gap: 0.28rem;
    padding: 0.9rem;
    border: 1px solid rgba(23, 32, 51, 0.14);
    border-radius: 14px;
    background: var(--tt-light-gray, #f5f7f9);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.tt-mode-options label:hover > span {
    transform: translateY(-2px);
    border-color: rgba(47, 111, 168, 0.45);
}

.tt-mode-options input:checked + span {
    border-color: var(--tt-sky-blue-dark, #2f6fa8);
    background: #edf6fd;
    box-shadow: inset 0 0 0 1px var(--tt-sky-blue-dark, #2f6fa8);
}

.tt-mode-options input:focus-visible + span {
    outline: 3px solid rgba(91, 155, 213, 0.5);
    outline-offset: 3px;
}

.tt-mode-options strong {
    color: var(--tt-ink, #172033);
    font-size: 0.96rem;
}

.tt-mode-options small {
    color: var(--tt-muted, #637083);
    font-size: 0.74rem;
    line-height: 1.35;
}

.tt-compare-fields {
    padding: 1rem;
    border: 1px dashed rgba(47, 111, 168, 0.3);
    border-radius: 16px;
    background: rgba(237, 246, 253, 0.48);
}

.tt-compare-fields[hidden],
.tt-compare-picker-card[hidden],
.tt-compare-controls [hidden] {
    display: none !important;
}

.tt-compare-guidance {
    margin: 0 0 0.9rem;
    color: var(--tt-muted, #637083);
    font-size: 0.78rem;
    line-height: 1.45;
}

.tt-compare-error {
    margin: -0.25rem 0 0.9rem;
    padding: 0.7rem 0.8rem;
    color: #7a241f;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.45;
    border-left: 4px solid #c94b40;
    border-radius: 8px;
    background: #fff2f0;
}

.tt-compare-error[hidden] {
    display: none !important;
}

.tt-compare-picker-card select.tt-duplicate-selection {
    border-color: #c94b40;
    box-shadow: 0 0 0 2px rgba(201, 75, 64, 0.16);
}

.tt-compare-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.tt-compare-picker-card {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 0.8rem;
    padding: 0.9rem;
    border: 1px solid rgba(23, 32, 51, 0.11);
    border-radius: 14px;
    background: #fff;
}

.tt-compare-number {
    margin: 0;
    color: var(--tt-sky-blue-deep, #245985);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tt-compare-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.85rem;
}

.tt-compare-controls .tt-button {
    min-height: 42px;
    cursor: pointer;
}

.tt-mode-compare .tt-calculator-grid {
    grid-template-columns: 1fr;
}

.tt-mode-compare .tt-budget-results {
    position: static;
    top: auto;
}

.tt-comparison-header {
    display: grid;
    gap: 0.55rem;
    padding-bottom: 1.3rem;
    border-bottom: 1px solid var(--tt-line, #e1e5e9);
}

.tt-comparison-header h2 {
    margin: 0;
    color: var(--tt-ink, #172033);
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.tt-comparison-summary {
    max-width: 70ch;
    margin: 0;
    color: var(--tt-muted, #637083);
    font-weight: 700;
}

.tt-comparison-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin: 1.25rem 0 1.5rem;
}

.tt-comparison-cards.has-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tt-comparison-card {
    position: relative;
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 0.45rem;
    padding: 1.1rem;
    border: 1px solid var(--tt-line, #e1e5e9);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.92);
}

.tt-comparison-card.is-lowest {
    border-color: rgba(47, 111, 168, 0.55);
    background: linear-gradient(155deg, #ffffff 0%, #edf6fd 100%);
    box-shadow: inset 0 0 0 1px rgba(47, 111, 168, 0.22);
}

.tt-comparison-badge {
    width: fit-content;
    margin-bottom: 0.2rem;
    padding: 0.28rem 0.48rem;
    color: #174f7c;
    font-size: 0.67rem;
    font-weight: 800;
    border-radius: 999px;
    background: #dcedfa;
}

.tt-comparison-card h3 {
    margin: 0;
    color: var(--tt-ink, #172033);
    font-size: 1.25rem;
}

.tt-comparison-basis,
.tt-comparison-total-label,
.tt-comparison-difference {
    margin: 0;
    color: var(--tt-muted, #637083);
    font-size: 0.75rem;
    line-height: 1.4;
}

.tt-comparison-total {
    margin-top: 0.35rem;
    color: var(--tt-ink, #172033);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.tt-comparison-stats {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.75rem;
    margin: 0.85rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(23, 32, 51, 0.08);
}

.tt-comparison-stats dt,
.tt-comparison-stats dd {
    margin: 0;
    font-size: 0.77rem;
}

.tt-comparison-stats dt {
    color: var(--tt-muted, #637083);
}

.tt-comparison-stats dd {
    color: var(--tt-ink, #172033);
    font-weight: 800;
    text-align: right;
}

.tt-comparison-difference {
    margin-top: 0.55rem;
    color: #7b4b08;
    font-weight: 750;
}

.tt-comparison-destination-link {
    width: fit-content;
    margin-top: 0.65rem;
    font-size: 0.78rem;
    font-weight: 800;
}

.tt-comparison-table-section h3 {
    margin: 0 0 0.75rem;
    color: var(--tt-ink, #172033);
    font-size: 1.15rem;
}

.tt-comparison-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--tt-line, #e1e5e9);
    border-radius: 14px;
    overscroll-behavior-inline: contain;
}

.tt-comparison-table {
    width: 100%;
    min-width: 680px;
    margin: 0;
    border-collapse: collapse;
    background: #fff;
}

.tt-comparison-table th,
.tt-comparison-table td {
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid rgba(23, 32, 51, 0.08);
    text-align: right;
    white-space: nowrap;
}

.tt-comparison-table th:first-child,
.tt-comparison-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    text-align: left;
    background: #fff;
}

.tt-comparison-table thead th {
    color: var(--tt-ink, #172033);
    font-size: 0.78rem;
    background: #f5f7f9;
}

.tt-comparison-table thead th:first-child {
    z-index: 2;
    background: #f5f7f9;
}

.tt-comparison-table tbody th {
    color: var(--tt-ink, #172033);
    font-size: 0.78rem;
}

.tt-comparison-table td {
    color: var(--tt-muted, #637083);
    font-size: 0.79rem;
    font-weight: 700;
}

.tt-comparison-total-row th,
.tt-comparison-total-row td {
    color: var(--tt-ink, #172033);
    font-weight: 850;
    border-bottom: 0;
    background: #edf6fd;
}

.tt-comparison-total-row th:first-child {
    background: #edf6fd;
}

@media (max-width: 980px) {
    .tt-compare-picker-grid,
    .tt-comparison-cards {
        grid-template-columns: 1fr;
    }

    .tt-comparison-cards.has-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .tt-mode-options {
        grid-template-columns: 1fr;
    }

    .tt-mode-options label > span {
        min-height: 72px;
    }

    .tt-compare-fields {
        padding: 0.75rem;
    }

    .tt-compare-picker-card {
        padding: 0.75rem;
    }

    .tt-compare-controls .tt-button {
        width: 100%;
        justify-content: center;
    }

    .tt-comparison-header h2 {
        font-size: clamp(1.8rem, 10vw, 2.6rem);
    }

    .tt-comparison-card {
        padding: 0.9rem;
    }

    .tt-comparison-total {
        font-size: 2.2rem;
    }

    .tt-comparison-table th,
    .tt-comparison-table td {
        padding: 0.65rem 0.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tt-mode-options label > span {
        transition: none;
    }
}
