.speed-card {
    max-width: 900px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0ebff 100%);
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding: 2.5rem;
}

.speed-unit-selection {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.speed-unit-btn {
    padding: 0.9rem 4rem;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-weight: 500;
    font-family: "Roboto Slab", serif;
    text-transform: uppercase;
    color: #000;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.speed-unit-btn.active {
    background: linear-gradient(135deg, #0F2BC9 0%, #667eea 100%);
    color: #fff;
}

.speed-input-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.speed-input-field {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    flex: 1;
}

.speed-input-field label {
    font-weight: 600;
    margin: 6px 0;
    color: #111;
}

.speed-input-field input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-weight: 400;
    font-family: "Roboto Slab", serif;
    font-size: 1rem;
    box-sizing: border-box;
    background: #fff;
}

.speed-custom-select {
    position: relative;
    width: 48.5%;
}

.speed-selected {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 9px 12px;
    font-weight: 400;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
}

.speed-selected:after {
    content: "\25BC";
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.speed-items {
    position: absolute;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 999;
    display: none;
    max-height: 150px;
    overflow-y: auto;
}

.speed-items div {
    padding: 10px;
    cursor: pointer;
    font-weight: 400;
}

.speed-items div:hover {
    background-color: #f0f4ff;
}

.speed-items.show {
    display: block;
}

.speed-selected.speed-active:after {
    transform: translateY(-50%) rotate(180deg);
}

.speed-time-inputs {
    display: flex;
    gap: 10px;
}

.metric { display: block; }
.imperial { display: none; }

.speed-btn-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.speed-calc-btn {
    padding: 1rem 3rem;
    background: linear-gradient(135deg, #0F2BC9 0%, #667eea 100%);
    text-transform: uppercase;
    color: #fff;
    font-weight: 600;
    font-family: "Roboto Slab", serif;
    border: none;
    border-radius: 8px;
    width: 40%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.speed-calc-btn:hover {
    transform: translateY(1px);
}

.speed-result-card {
    max-width: 600px;
    margin: 1.75rem auto 0 auto;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
    padding: 1.75rem;
    text-align: center;
}

#resultLabel {
    font-size: 1.6rem;
    font-weight: 500;
    color: #000;
    font-family: "Roboto Slab", serif;
}

#resultValue {
    font-size: 1.5rem;
    font-weight: 600;
    font-family: "Roboto Slab", serif;
    color: rgb(9,119,9);
    margin-top: 8px;
}

/* Input adjustments */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}


/***** Media Query *****/
/***** Standard tablets & landscape phones (≤768px) ******/
@media (max-width: 768px) {
.speed-card {
    max-width: 650px;
    gap: 1.75rem;
    padding: 2.5rem;
}

.speed-custom-select {
    position: relative;
    width: 75%;
}

.speed-calc-btn {
    width: 60%;
}
}

/***** Large smartphones & phablets (≤617px) ******/
@media (max-width: 617px) {
.speed-card {
    max-width: 500px;
    gap: 1.75rem;
    padding: 2.5rem;
}

.speed-custom-select {
    position: relative;
    width: 100%;
}

.speed-calc-btn {
    width: 100%;
}

.speed-unit-selection {
    flex-direction: column;
}

.speed-result-card {
    max-width: 500px;
}

#resultLabel {
    font-size: 1.5rem;
}

#resultValue {
    font-size: 1.4rem;
}
}

/***** Small smartphones (≤450px) ******/
@media (max-width: 450px) {
.speed-card {
    max-width: 400px;
    gap: 1.75rem;
    padding: 2.5rem;
}

.speed-custom-select {
    position: relative;
    width: 100%;
}

.speed-calc-btn {
    width: 100%;
}

.speed-unit-selection {
    flex-direction: column;
}

.speed-result-card {
    max-width: 400px;
}

#resultLabel {
    font-size: 1.4rem;
}

#resultValue {
    font-size: 1.3rem;
}
}

/***** Extra small phones & older devices (≤365px) ******/
@media (max-width: 365px) {
.speed-card {
    max-width: 320px;
    gap: 1.75rem;
    padding: 2.5rem;
}

.speed-custom-select {
    position: relative;
    width: 100%;
}

.speed-calc-btn {
    width: 100%;
}

.speed-unit-selection {
    flex-direction: column;
}

.speed-result-card {
    max-width: 320px;
}

#resultLabel {
    font-size: 1.2rem;
}

#resultValue {
    font-size: 1rem;
}
}

