
/* Mysterious Chorus mileage reader */
.chorus-container {
    max-width: 1080px;
}

.chorus-page {
    display: grid;
    gap: 1rem;
}

.chorus-head {
    padding: 1.4rem 0 0.35rem;
}

.chorus-kicker {
    display: inline-block;
    margin-bottom: 0.55rem;
    color: rgba(242, 241, 236, 0.5);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.chorus-head h1 {
    margin: 0;
    color: #f4f3ef;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1;
    letter-spacing: -0.065em;
}

.chorus-head p {
    margin: 0.75rem 0 0;
    color: rgba(232, 230, 221, 0.58);
    line-height: 1.65;
}

.chorus-dropzone {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 0.38rem;
    min-height: 210px;
    padding: 2rem 1.2rem;
    border: 1px dashed rgba(255, 255, 255, 0.23);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 54%),
        #0b0b0b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.18s, background-color 0.18s, transform 0.18s;
}

.chorus-dropzone:hover,
.chorus-dropzone.is-dragging {
    border-color: rgba(255, 255, 255, 0.58);
    background-color: #111;
    transform: translateY(-1px);
}

.chorus-dropzone.has-image {
    min-height: 118px;
    padding: 1.2rem;
}

.chorus-upload-mark {
    position: relative;
    width: 2.7rem;
    height: 2.7rem;
    margin-bottom: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.chorus-upload-mark::before,
.chorus-upload-mark::after {
    content: "";
    position: absolute;
    left: 50%;
    background: #e8e7e2;
    transform: translateX(-50%);
}

.chorus-upload-mark::before {
    top: 0.7rem;
    width: 1px;
    height: 1.15rem;
}

.chorus-upload-mark::after {
    top: 0.7rem;
    width: 0.62rem;
    height: 0.62rem;
    border-top: 1px solid #e8e7e2;
    border-left: 1px solid #e8e7e2;
    background: transparent;
    transform: translateX(-50%) rotate(45deg);
}

.chorus-dropzone.has-image .chorus-upload-mark {
    display: none;
}

.chorus-dropzone strong {
    color: #f1f0eb;
    font-size: 1.08rem;
}

.chorus-dropzone > span:not(.chorus-upload-mark) {
    color: rgba(232, 230, 221, 0.62);
    font-size: 0.9rem;
}

.chorus-dropzone small {
    margin-top: 0.3rem;
    color: rgba(232, 230, 221, 0.4);
    line-height: 1.5;
}

.chorus-status {
    min-height: 1.35rem;
    padding: 0 0.2rem;
    color: rgba(232, 230, 221, 0.58);
    font-size: 0.88rem;
    line-height: 1.55;
}

.chorus-status[data-tone="good"] {
    color: rgba(255, 255, 255, 0.82);
}

.chorus-status[data-tone="warn"] {
    color: rgba(255, 255, 255, 0.68);
}

.chorus-workspace {
    display: grid;
    gap: 0.8rem;
    padding-top: 0.3rem;
    scroll-margin-top: 1rem;
}

.chorus-workspace[hidden] {
    display: none;
}

.chorus-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chorus-toolbar button {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: #101010;
    color: rgba(242, 241, 236, 0.76);
    padding: 0.62rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 750;
    cursor: pointer;
}

.chorus-toolbar button:hover,
.chorus-toolbar button.is-active {
    border-color: rgba(255, 255, 255, 0.42);
    background: #202020;
    color: #fff;
}

.chorus-image-stage {
    display: grid;
    place-items: center;
    overflow: hidden;
    max-height: 690px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 20px;
    background: #030303;
    box-shadow: 0 22px 65px rgba(0, 0, 0, 0.34);
}

#chorus-image-canvas {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 690px;
    object-fit: contain;
}

#chorus-image-canvas.is-selecting {
    cursor: crosshair;
    touch-action: none;
}

.chorus-selection-help {
    color: rgba(232, 230, 221, 0.43);
    font-size: 0.8rem;
    line-height: 1.55;
}

.chorus-analysis-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 0.8rem;
}

.chorus-bar-card,
.chorus-result-card {
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 19px;
    background: linear-gradient(145deg, #171717, #090909 70%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
    padding: 1rem;
}

.chorus-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.75rem;
}

.chorus-card-head strong {
    color: #efeee9;
    font-size: 0.9rem;
}

#chorus-confidence {
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    color: rgba(232, 230, 221, 0.58);
    padding: 0.28rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 780;
}

#chorus-confidence[data-tone="good"] {
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

#chorus-confidence[data-tone="warn"] {
    border-style: dashed;
    color: rgba(255, 255, 255, 0.72);
}

.chorus-bar-preview {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    background: #000;
}

#chorus-bar-canvas {
    display: block;
    width: 100%;
    height: auto;
}

.chorus-range-field {
    display: grid;
    gap: 0.58rem;
    margin-top: 0.85rem;
}

.chorus-range-field span {
    color: rgba(232, 230, 221, 0.52);
    font-size: 0.78rem;
    font-weight: 720;
}

.chorus-range-field input {
    width: 100%;
    accent-color: #e5e5e5;
    cursor: ew-resize;
}

.chorus-result-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chorus-result-card > span {
    color: rgba(232, 230, 221, 0.5);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.chorus-result-card > strong {
    margin-top: 0.3rem;
    color: #fff;
    font-size: clamp(1.85rem, 5vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.06em;
}

.chorus-result-card > p {
    margin: 0.52rem 0 0;
    color: rgba(232, 230, 221, 0.46);
    font-size: 0.8rem;
    line-height: 1.5;
}

.chorus-result-detail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.chorus-result-detail > div {
    display: grid;
    gap: 0.28rem;
    min-width: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.72rem;
}

.chorus-result-detail span {
    color: rgba(232, 230, 221, 0.42);
    font-size: 0.7rem;
}

.chorus-result-detail strong {
    overflow: hidden;
    color: rgba(242, 241, 236, 0.88);
    font-size: 0.98rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .chorus-container {
        max-width: 100%;
        margin-top: 1rem;
        padding: 0 0.8rem;
    }

    .chorus-head {
        padding-top: 0.75rem;
    }

    .chorus-head p {
        font-size: 0.9rem;
    }

    .chorus-dropzone {
        min-height: 178px;
        border-radius: 17px;
    }

    .chorus-dropzone.has-image {
        min-height: 104px;
    }

    .chorus-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chorus-toolbar button {
        padding-inline: 0.55rem;
    }

    .chorus-image-stage,
    #chorus-image-canvas {
        max-height: 72vh;
    }

    .chorus-analysis-grid {
        grid-template-columns: 1fr;
    }

    .chorus-bar-card,
    .chorus-result-card {
        border-radius: 16px;
    }
}
