.triathlon-calculator {
    font-family: var(--font-body);
    max-width: 28rem;
    margin: 0 auto;
    width: 100%;
    padding: 1rem;
    box-sizing: border-box;
}

.triathlon-calculator * {
    box-sizing: border-box;
}

.navigation {
    margin-bottom: 1.25rem;
}

.nav-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.nav-step {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: var(--line-1);
    color: var(--text-secondary-6);
}

.nav-step.active {
    background: var(--navy);
    color: white;
    transform: scale(1.05);
}

.nav-step:hover {
    background: var(--line-3);
}

.nav-step.active:hover {
    background: var(--navy);
}

.nav-line {
    width: 2rem;
    height: 0.125rem;
    margin: 0 0.25rem;
    background: var(--line-1);
    transition: all 0.2s;
}

.nav-line.active {
    background: var(--navy);
}

.nav-labels {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.75rem;
}

.nav-label {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
    background: none;
    border: none;
    color: var(--text-secondary-6);
}

.nav-label.active {
    color: var(--navy);
    font-weight: 500;
}

.nav-label:hover {
    color: var(--navy);
    background: var(--bg);
}

.section {
    background: white;
    border-radius: var(--radius-xxl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--line-1);
    padding: 1rem;
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--navy);
}

.section-number {
    width: 1.25rem;
    height: 1.25rem;
    background: var(--red);
    color: white;
    font-family: var(--font-mono);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.distance-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.distance-preset {
    padding: 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--line-1);
    background: var(--field-bg);
    color: var(--text-secondary-8);
}

.distance-preset.active {
    background: var(--navy);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.distance-preset.active div {
    color: white !important;
}

.distance-preset:hover {
    background: var(--line-1);
}

.distance-preset.active:hover {
    background: var(--navy);
}

.custom-toggle {
    text-align: center;
    margin-bottom: 0.75rem;
}

.custom-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    background: var(--field-bg);
    color: #4b5563;
}

.custom-btn.active {
    background: var(--navy);
    color: white;
}

.custom-btn:hover {
    background: var(--line-1);
}

.custom-btn.active:hover {
    background: var(--navy);
}

.distance-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.distance-input-group {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.distance-input-group .input-field {
    flex: 1;
}

.distance-input-group .unit-selector {
    width: auto;
    min-width: 3.5rem;
}

.distance-labels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-secondary-6);
    margin-bottom: 0.5rem;
}

.input-field {
    padding: 0.75rem;
    border: 1px solid var(--line-3);
    border-radius: var(--radius-m);
    background: var(--field-bg);
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
    background: var(--field-bg);
    color: var(--text-secondary-8);
}

/* Hide spinner arrows completely */
.input-field[type="number"]::-webkit-inner-spin-button,
.input-field[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* For Firefox and other browsers */
.input-field[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.input-field:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 1px var(--red);
}

.input-field:hover {
    background: var(--field-bg);
}

.speed-section {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--line-1);
    background: white;
    position: relative;
}

/* Consistent theme for all sport sections */
.speed-section {
    background: linear-gradient(to bottom, #fafbfc, white);
}

.speed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.speed-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary-8);
}

.speed-value {
    font-size: 0.875rem;
    font-weight: bold;
}

.speed-value.swim {
    color: var(--navy);
}

.speed-value.bike {
    color: #dc2626;
}

.speed-value.run {
    color: var(--text-secondary-6);
}

.speed-slider {
    width: 100%;
    height: 0.25rem;
    background: var(--line-3);
    border-radius: 9999px;
    outline: none;
    border: 1px solid var(--line-3);
    margin-bottom: 0.5rem;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #475569;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.speed-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.speed-slider.bike::-webkit-slider-thumb {
    background: #dc2626;
}

.speed-slider.run::-webkit-slider-thumb {
    background: var(--text-secondary-6);
}

.speed-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--field-bg);
    border-radius: 0.5rem;
    margin-top: 0.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Distance input with unit selector */
.distance-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.unit-selector {
    padding: 0.5rem;
    border: 1px solid var(--line-3);
    border-radius: 0.375rem;
    background: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.unit-selector:hover {
    background: var(--field-bg);
    border-color: #9ca3af;
}

.unit-selector:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 1px var(--navy);
}

/* Alternate background for pace inputs */
.input-group:first-child {
    padding: 0.5rem;
    background: white;
    border-radius: 0.375rem;
    border: 1px solid var(--line-1);
}

/* Time inputs group styling */
.input-group:last-child {
    padding: 0.5rem;
    background: var(--line-1);
    border-radius: 0.375rem;
}

.input-label {
    font-size: 0.75rem;
    color: var(--text-secondary-6);
}

/* Kurzlabel nur mobil (siehe max-width: 480px); Volltext bleibt sonst sichtbar */
.input-label .label-short {
    display: none;
}
.pace-label-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    min-height: 1.5rem;
}
.pace-unit-selector {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--line-3);
    border-radius: 0.375rem;
    background: white;
    color: var(--text-secondary-8);
    cursor: pointer;
}

/* Ensure consistent input group heights */
.speed-inputs .input-group {
    display: flex;
    flex-direction: column;
    min-height: 5.5rem;
}

.speed-inputs .input-group .input-label {
    min-height: 1.5rem;
    display: flex;
    align-items: center;
}

.time-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(30, 41, 59, 0.03);
    border-radius: 0.375rem;
    border: 1px solid rgba(30, 41, 59, 0.08);
}

.time-inputs.pace-inputs {
    grid-template-columns: repeat(2, 1fr);
    background: rgba(59, 130, 246, 0.03);
    border-color: rgba(59, 130, 246, 0.1);
}

.time-input {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-input .input-field {
    padding: 0.75rem;
    padding-right: 1.75rem;
    width: 100%;
    min-width: 3rem;
}

.time-suffix {
    position: absolute;
    right: 0.375rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    color: var(--text-secondary-6);
    pointer-events: none;
    font-weight: 500;
}

.single-input-wrapper .input-field {
    margin: 0;
    padding-right: 3rem;
}

.single-input-wrapper .input-suffix {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--text-secondary-6);
    pointer-events: none;
    background: white;
    padding: 0 0.25rem;
}

/* Single input wrapper to match height of time-inputs */
.single-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 3.5rem; /* Match the height of time-inputs */
}

.single-input-wrapper .input-field {
    margin: 0;
    width: 100%;
    background: var(--field-bg);
    border: 1px solid var(--line-3);
}

.time-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-secondary-8);
}

.input-suffix {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--text-secondary-6);
    pointer-events: none;
    background: white;
    padding: 0 0.25rem;
}

.time-suffix {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--text-secondary-6);
}

.transition-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

/* Transition section styling */
#section-3 .input-group {
    background: linear-gradient(135deg, rgba(249, 168, 37, 0.05), rgba(249, 168, 37, 0.02));
    border: 1px solid rgba(249, 168, 37, 0.2);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

#section-3 .time-inputs {
    background: rgba(249, 168, 37, 0.08);
    border-color: rgba(249, 168, 37, 0.15);
}

.result-section {
    text-align: center;
}

.result-main {
    background: var(--navy);
    border-radius: var(--radius-l);
    padding: 1rem;
    color: white;
    margin-bottom: 1rem;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.result-title {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.9;
}

.result-time {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    text-align: center;
}

.result-distance {
    color: var(--line-3);
    font-size: 0.75rem;
    text-align: center;
}

.result-breakdown {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    font-size: 0.75rem;
}

.result-item {
    border-radius: 0.5rem;
    padding: 0.75rem;
    text-align: center;
}

.result-item.swim {
    background: var(--field-bg);
}

.result-item.bike {
    background: #fef2f2;
}

.result-item.run {
    background: var(--field-bg);
}

.result-item.transition {
    background: var(--field-bg);
}

.result-icon {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.result-item-time {
    font-weight: 600;
    font-size: 0.875rem;
}

.result-item-distance {
    color: var(--text-secondary-6);
}

.result-item-pace {
    color: #9ca3af;
}

.page-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--navy);
    line-height: 1.2;
}

.intro-text {
    font-size: 0.875rem;
    color: var(--text-secondary-6);
    text-align: center;
    margin-bottom: 1rem;
}

.intro-text a {
    color: var(--navy);
    text-decoration: none;
}

.intro-text a:hover {
    text-decoration: underline;
}

.widget-custom-text-host {
    unicode-bidi: isolate;
    color: var(--text-secondary-6);
    font-size: 0.8125rem;
}

.results-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.results-header .page-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.distance-time-display {
    background: var(--field-bg);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-l);
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.distance-time-display .label {
    font-size: 0.75rem;
    color: var(--text-secondary-6);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.distance-time-display .value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--navy);
    margin: 0.25rem 0;
}

.distance-time-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.distance-time-display .label,
.distance-time-display .value {
    overflow-wrap: anywhere;
}

/* Mobile First Responsive Design */
@media (max-width: 480px) {
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .triathlon-calculator {
        padding: 0.5rem;
    }

    .section {
        padding: 0.75rem;
    }

    .nav-labels {
        gap: 0.5rem;
    }

    .nav-label {
        font-size: 0.7rem;
        padding: 0.2rem 0.3rem;
    }

    .input-field {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .distance-labels {
        font-size: 0.7rem;
        margin-bottom: 0.25rem;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
    }

    .distance-labels div:last-child {
        grid-column: 1 / -1;
        justify-self: center;
    }

    .distance-inputs {
        gap: 0.25rem;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
    }

    .distance-inputs .distance-input-group:last-child {
        grid-column: 1 / -1;
        justify-self: center;
        max-width: 50%;
    }

    .distance-input-group {
        gap: 0.2rem;
    }

    .distance-input-group .unit-selector {
        min-width: 3rem;
        font-size: 0.75rem;
    }

    .speed-inputs .input-group {
        margin-bottom: 0.75rem;
    }

    .input-label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    .time-input-field {
        min-width: 4rem;
    }

    .single-input-wrapper .time-input-field {
        min-width: 0;
    }

    .pace-unit-selector {
        max-width: 100%;
    }

    .distance-time-grid {
        gap: 0.5rem;
    }

    .distance-time-display {
        padding: 0.75rem 0.5rem;
    }

    .single-input-wrapper {
        min-height: 2.5rem;
        padding: 0;
    }

    .single-input-wrapper .input-field {
        padding: 0.5rem;
        font-size: 0.875rem;
        background: #ffffff;
        border: 1px solid var(--line-3);
        color: var(--text-secondary-8);
        height: 2.5rem;
        box-sizing: border-box;
    }

    .pace-label-group {
        min-height: 1.5rem;
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.25rem 0.5rem;
    }

    .input-group {
        margin-bottom: 0.75rem;
    }

    .input-label {
        min-height: 1.5rem;
        display: flex;
        align-items: center;
        margin-bottom: 0.25rem;
    }

    .pace-unit-selector {
        height: 2rem;
        padding: 0.25rem;
    }

    .distance-input-group .input-field,
    .distance-input-group .unit-selector {
        height: 2.5rem;
        padding: 0.5rem;
    }

    /* Lange Labels mobil kuerzen: Kurztext sichtbar, Volltext nur fuer Screenreader */
    .input-label .label-short {
        display: inline;
    }

    .input-label .label-full {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }
}

@media (min-width: 640px) {
    .triathlon-calculator {
        max-width: 85vw;
        width: 85%;
    }

    .distance-presets {
        grid-template-columns: repeat(4, 1fr);
    }

    .result-breakdown {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) {
    .triathlon-calculator {
        max-width: 75vw;
        width: 75%;
    }
}

@media (min-width: 1024px) {
    .triathlon-calculator {
        max-width: 65vw;
        width: 65%;
    }
}

@media (min-width: 1280px) {
    .triathlon-calculator {
        max-width: 55vw;
        width: 55%;
    }
}
