.difference-page {
    display: grid;
    gap: 24px;
    margin-top: 0;
}

.difference-page h1 {
    margin-bottom: 0;
    padding-left: 18px;
}

.difference-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
}

.diff-search {
    position: relative;
}

.diff-search .search-results {
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    z-index: 60;
}

.diff-search .search-result {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border: 0;
    border-bottom: 1px solid #edf1f6;
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.diff-search .search-result:hover,
.diff-search .search-result:focus {
    background: #f4f7fb;
    outline: none;
}

.diff-search .search-result span {
    color: var(--accent);
    font-weight: 700;
}

.diff-search .search-result small {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.difference-picker input[type="search"] {
    height: 50px;
    border-radius: 10px;
    font-size: 18px;
}

.diff-swap {
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
}

.diff-submit {
    height: 50px;
    border-radius: 10px;
}

.difference-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    padding: 30px;
    background: linear-gradient(135deg, #3d499f, #8567e8);
    color: #fff;
}

.diff-city {
    min-width: 0;
    container-type: inline-size;
    text-align: center;
}

.diff-city h2 {
    margin-bottom: 6px;
    font-size: 28px;
}

.diff-date {
    margin-bottom: 10px;
    color: rgba(255,255,255,.9);
    font-size: 17px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
}

.diff-time {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1em;
    font-size: min(124px, 23cqi);
    line-height: 1;
    font-weight: 300;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    white-space: nowrap;
    text-shadow: 0 2px 2px rgba(0,0,0,.25);
}

.difference-table-scroll {
    max-width: 100%;
    min-width: 0;
}

.diff-city p {
    margin: 14px 0 0;
    color: rgba(255,255,255,.9);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex-wrap: wrap;
}

.diff-city p img {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
}

.diff-badge {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0;
    background: rgba(255,255,255,.16);
    border: 8px solid rgba(255,255,255,.25);
    text-align: center;
}

.diff-badge strong {
    font-size: 42px;
    line-height: 1;
}

.diff-badge span {
    font-size: 18px;
    font-weight: 700;
}

.diff-badge em {
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    color: rgba(255,255,255,.9);
}

.difference-table-card h2 {
    padding-left: 0;
    margin-bottom: 12px;
}

.difference-table-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: 30px;
}

.difference-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 8px;
    table-layout: fixed;
}

.difference-table th {
    text-align: left;
    padding: 9px 12px;
    background: #eef4ff;
    font-size: 15px;
}

.difference-table th:nth-child(2),
.difference-table td:nth-child(2) {
    width: 86px;
    text-align: center;
    color: var(--accent);
    font-weight: 800;
}

.difference-table td {
    padding: 6px 12px;
    border-top: 1px solid var(--line);
    font-size: 16px;
    line-height: 1.25;
}

.difference-table tbody tr:nth-child(even) {
    background: #f7faff;
}

.difference-table tbody tr {
    cursor: pointer;
}

.difference-table tbody tr:hover {
    background: #eaf4ff;
}

.difference-table tbody tr.is-selected-time {
    background: #2fa7e8;
    color: #fff;
}

.difference-table tbody tr.is-selected-time:hover {
    background: #2fa7e8;
}

.difference-table tbody tr.is-selected-time td {
    border-top-color: #2fa7e8;
}

.difference-table tbody tr.is-selected-time span,
.difference-table tbody tr.is-selected-time td:nth-child(2) {
    color: #fff;
}

.difference-table tbody tr.is-now:not(.is-selected-time) {
    background: #fff7d6;
    box-shadow: inset 4px 0 0 #f4b400;
}

.difference-table tbody tr.is-now:not(.is-selected-time) td {
    border-top-color: #f5d56b;
}

.difference-table tbody tr.is-now td:first-child::after {
    content: "сейчас";
    display: inline-block;
    margin-left: 10px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(244, 180, 0, .18);
    color: #8a5c00;
    font-size: 12px;
    font-weight: 800;
    vertical-align: 2px;
}

.difference-table tbody tr.is-selected-time.is-now td:first-child::after {
    background: rgba(255,255,255,.22);
    color: #fff;
}

.difference-table span {
    color: var(--muted);
    font-size: 13px;
}

.difference-dial {
    position: sticky;
    top: 18px;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 360px;
    align-content: start;
    gap: 12px;
}

.dial-face {
    position: relative;
    width: min(320px, 100%);
    aspect-ratio: 1;
    container-type: inline-size;
    border-radius: 50%;
    background: #31a7e8;
    border: 18px solid #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), var(--shadow);
}

.dial-face::before {
    content: "";
    position: absolute;
    inset: 35%;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
}

.dial-tick {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2px;
    height: 12px;
    background: rgba(255,255,255,.78);
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-50cqi + 10px));
    transform-origin: center;
}

.dial-tick.is-major {
    width: 3px;
    height: 22px;
}

.dial-center {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 84px;
    height: 84px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #1f98da;
    border: 10px solid rgba(255,255,255,.16);
    color: #fff;
    font-size: 34px;
    font-weight: 800;
}

.dial-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    transform: rotate(var(--angle, 0deg)) translateY(calc(-50cqi + 18px));
    transform-origin: center;
    z-index: 2;
}

.dial-marker i {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 7px solid #31a7e8;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.dial-marker-right i {
    border-color: #fff;
    background: #31a7e8;
}

.dial-labels {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 100%;
}

.dial-label {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 6px 9px;
    border-radius: 5px;
    background: rgba(0,0,0,.82);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.dial-label::before {
    content: '';
    flex: 0 0 12px;
    height: 12px;
    border: 3px solid #31a7e8;
    border-radius: 50%;
    background: #fff;
}

.dial-label[data-dial-right-label]::before {
    border-color: #fff;
    background: #31a7e8;
}

@media (max-width: 1180px) {
    .difference-hero {
            grid-template-columns: minmax(0, 1fr) 112px minmax(0, 1fr);
            gap: 14px;
            padding: 24px;
        }

    .diff-city h2 {
            font-size: 26px;
        }

    .diff-date {
            font-size: 16px;
            line-height: 1.35;
        }

    .diff-time {
            font-size: min(92px, 23cqi);
        }

    .diff-city p {
            font-size: 16px;
            gap: 7px;
        }

    .diff-badge {
            width: 112px;
            height: 112px;
            border-width: 7px;
        }

    .diff-badge strong {
            font-size: 34px;
        }

    .diff-badge span {
            font-size: 16px;
        }

    .difference-picker {
            grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr);
        }

    .diff-submit {
            grid-column: 1 / -1;
            width: 100%;
        }

    .difference-table-layout {
            grid-template-columns: 1fr;
            gap: 22px;
        }

    .difference-dial {
            position: static;
            min-height: 320px;
            order: -1;
        }

    .dial-face {
            width: min(300px, 100%);
        }

}

@media (max-width: 860px) {
    .difference-picker,
    .difference-hero,
    .difference-table-layout {
            grid-template-columns: 1fr;
        }

    .diff-badge {
            margin: 0 auto;
        }
}

@media (max-width: 520px) {
    .diff-time { font-size: min(48px, 23cqi); }

    .difference-picker {
            padding: 14px;
        }

    .difference-hero {
            padding: 22px 16px;
        }

    .difference-table-scroll {
            overflow-x: visible;
            padding-bottom: 0;
        }

    .difference-table {
            min-width: 0;
            table-layout: fixed;
        }

    .difference-table th,
    .difference-table td {
            padding: 8px 7px;
            font-size: 14px;
            line-height: 1.2;
            overflow-wrap: anywhere;
        }

    .difference-table th:nth-child(2),
    .difference-table td:nth-child(2) {
            width: 58px;
            padding-right: 4px;
            padding-left: 4px;
        }

    .difference-table span {
            font-size: 11px;
        }

    .difference-table tbody tr.is-now td:first-child::after {
            margin-left: 5px;
            padding: 1px 6px;
            font-size: 11px;
        }

    .difference-dial {
            position: static;
            min-height: 300px;
        }

    .dial-face {
            width: min(280px, 100%);
        }

}

