/* ===========================
GLOBAL RESET
=========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --viewport-height: 100vh;
    --viewport-unit: 1vh;
    /* The full-width bar sits flush with the top of the viewport. */
    --navbar-height: clamp(64px, calc(var(--viewport-unit) * 8.666667), 104px);
    --navbar-inset: 0px;
    --navbar-footprint: calc(var(--navbar-height) + var(--navbar-inset));
    --page-available-height: max(0px, calc(var(--viewport-height) - var(--navbar-footprint)));
}

@supports (height: 100dvh) {
    :root {
        --viewport-height: 100dvh;
        --viewport-unit: 1dvh;
    }
}

html {
    min-height: 100%;
    /* Only the navbar participates; content keeps its existing entrance. */
    view-transition-name: none;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

body > *:not(.navbar):not(.screen-top-background):not(script) {
    opacity: 0;
    animation: pageFadeIn var(--page-load-duration, 1200ms)
        var(--page-load-easing, cubic-bezier(0.05, 0.8, 0.15, 1)) forwards;
}

body {
    --page-load-duration: 1200ms;
    --page-load-easing: cubic-bezier(0.05, 0.8, 0.15, 1);

    min-height: var(--viewport-height);
    overflow-x: hidden;

    font-family: "Mozilla Text", sans-serif;
    color: #181818;

    /* Page backdrops are defined in page_backgrounds.css. */

    position: relative;
    isolation: isolate;
}

@media (min-width: 801px) {
    /* Contain the navbar margin so its whole footprint is inside the viewport. */
    body { display: flow-root; }
    body > main { min-height: var(--page-available-height); }
}

.page-home {
    --page-load-duration: var(--home-page-fade-duration, 1200ms);
    --page-load-easing: cubic-bezier(0.05, 0.8, 0.15, 1);
}

/* Let the blue backdrop reach the screen edges on every phone page while
   keeping content clear of the notch, rounded corners and home indicator. */
.screen-top-background {
    display: none;
}

@media (max-width: 600px) {
    body {
        /* Page content uses the toolbar-expanded height. Unlike dvh, svh does
           not resize fields/cards as the browser chrome hides during scroll. */
        --mobile-stable-viewport-unit: 1svh;
        --mobile-layout-viewport-unit: var(--mobile-stable-viewport-unit);
        --mobile-page-gutter: clamp(10px, 3vw, 16px);
        min-height: 100svh;
        /* The navbar owns the top safe area so its surface reaches the edge. */
        padding-top: 0;
        padding-right: env(safe-area-inset-right, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        padding-left: env(safe-area-inset-left, 0px);
    }

    /* page_backgrounds.css supplies the active mobile palette. Keep the light
       top edge distinct for Safari's fixed-element color sampling. A real
       element above 10px remains sampleable without a notch inset. */
    .screen-top-background {
        display: block;
        position: fixed;
        inset: 0 0 auto;
        height: max(12px, env(safe-area-inset-top, 0px));
        z-index: 1;
        pointer-events: none;
    }
}

.page-compare {
    --page-load-duration: 850ms;
    --page-load-easing: cubic-bezier(0.16, 1, 0.3, 1);
}

.page-leaderboard {
    --page-load-duration: 1050ms;
    --page-load-easing: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Ensure form controls use the site font */

button,
input,
textarea,
select {
    font: inherit;
}

/* ===========================
REDUCED MOTION
=========================== */

@media (prefers-reduced-motion: reduce) {
    body > *:not(.navbar):not(script) {
        opacity: 1;
        animation: none;
    }
}

/* ===========================
SCROLLBAR
=========================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.20);
}

::-webkit-scrollbar-thumb {
    background: rgba(125, 155, 185, 0.38);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(95, 130, 165, 0.52);
}

/* ===========================
TEXT SELECTION
=========================== */

::selection {
    background: rgba(120, 195, 255, 0.38);
}

/* ===========================
IMAGE PROCESSING STATUS
=========================== */

#image-request-progress {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10000;
    width: min(390px, calc(100vw - 32px));
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.image-request-toast {
    --request-accent: #6f7b83;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    padding: 13px 14px;
    color: #202427;
    background: #f6f8f9;
    border: 1px solid #bcc8cf;
    border-radius: 22px;
    box-shadow:
        0 10px 24px rgba(24, 70, 105, 0.18),
        0 2px 4px rgba(24, 70, 105, 0.14),
        inset 0 1px 0 #fff,
        inset 0 -1px 0 #c4cfd5;
    pointer-events: auto;
    animation: imageRequestEnter 240ms cubic-bezier(.2, .8, .2, 1) both;
}

.image-request-toast::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, .98) 0,
        rgba(255, 255, 255, .72) 2px,
        rgba(255, 255, 255, 0) 14px
    );
}

.image-request-toast > * {
    position: relative;
    z-index: 1;
}

.image-request-indicator {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--request-accent);
    background: #e4e8ea;
    border: 1px solid #c4cdd2;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .9);
}

.image-request-indicator::after {
    content: "";
    width: 13px;
    height: 13px;
    border: 2px solid rgba(111, 123, 131, .28);
    border-top-color: var(--request-accent);
    border-radius: 50%;
    animation: imageRequestSpin 850ms linear infinite;
}

.image-request-toast.is-queued .image-request-indicator::after {
    width: 8px;
    height: 8px;
    border: 0;
    background: var(--request-accent);
    animation: imageRequestPulse 1.35s ease-in-out infinite;
}

.image-request-toast.is-success {
    --request-accent: #587563;
}

.image-request-toast.is-success .image-request-indicator::after {
    width: 12px;
    height: 7px;
    border: 0;
    border-left: 2px solid var(--request-accent);
    border-bottom: 2px solid var(--request-accent);
    border-radius: 0;
    transform: translateY(-1px) rotate(-45deg);
    animation: none;
}

.image-request-toast.is-error {
    --request-accent: #8a5f5f;
}

.image-request-toast.is-error .image-request-indicator::after {
    content: "!";
    width: auto;
    height: auto;
    border: 0;
    color: var(--request-accent);
    font-size: 17px;
    font-weight: 850;
    line-height: 1;
    animation: none;
}

.image-request-toast.is-warning {
    --request-accent: #837763;
}

.image-request-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.image-request-title {
    font-size: 14px;
    font-weight: 820;
    line-height: 1.2;
}

.image-request-label {
    color: rgba(32, 36, 39, .66);
    font-size: 12px;
    font-weight: 620;
    line-height: 1.35;
}

.image-request-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.image-request-action,
.image-request-link {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 7px 11px;
    border: 1px solid #c5ced3;
    border-radius: 999px;
    background: #fff;
    color: #30363a;
    box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(24, 70, 105, .1);
    font-size: 11px;
    font-weight: 780;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.image-request-action:hover:not(:disabled),
.image-request-link:hover {
    background: #e9edef;
    border-color: #aab7be;
    transform: translateY(-1px);
}

.image-request-action:disabled {
    opacity: .5;
    cursor: wait;
}

@keyframes imageRequestEnter {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes imageRequestSpin {
    to { transform: rotate(360deg); }
}

@keyframes imageRequestPulse {
    0%, 100% { opacity: .38; transform: scale(.78); }
    50% { opacity: 1; transform: scale(1); }
}

@media (max-width: 560px) {
    #image-request-progress {
        right: 16px;
        bottom: 16px;
        left: 16px;
        width: auto;
    }

    .image-request-toast {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .image-request-actions {
        grid-column: 2;
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .image-request-toast {
        animation: none;
    }

    .image-request-indicator::after {
        animation-duration: 1.8s;
    }
}

/* ===========================
SHARED HARD WHITE PLASTIC CARD
=========================== */

.surface-card {
    --surface-radius: 28px;

    position: relative;
    overflow: hidden;

    background: #f6f8f9;

    backdrop-filter: none;
    -webkit-backdrop-filter: none;

    border-radius: var(--surface-radius);
    border: 1px solid #bcc8cf;

    box-shadow:
        0 8px 16px rgba(24, 70, 105, 0.16),
        0 2px 3px rgba(24, 70, 105, 0.13),
        inset 0 1px 0 #ffffff,
        inset 0 -1px 0 #c4cfd5;
}

/* Narrow, hard-edged reflection instead of a soft molded sheen. */
.surface-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.98) 0,
        rgba(255, 255, 255, 0.78) 2px,
        rgba(255, 255, 255, 0.08) 3px,
        rgba(255, 255, 255, 0) 14px
    );
}

/* Keep card contents in their own stacking context. */
.surface-card > * {
    position: relative;
    z-index: 1;
}

.surface-card .surface-texture,
.surface-card[data-texture="true"]::marker {
    display: none;
}

/* ===========================
SIDE AD BARS
=========================== */

.ads-shell {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;

    display: grid;
    grid-template-columns: clamp(120px, 10vw, 160px) minmax(0, 1fr) clamp(120px, 10vw, 160px);
    align-items: start;
    column-gap: 18px;
}

.site-ads-shell {
    padding: 16px 16px 24px;
    row-gap: 16px;
    grid-template-areas:
        "left top right"
        "left content right";
}

.manual-ad-group { display: contents; }

.site-ads-shell > .site-left-ad,
.site-ads-shell > :where(.manual-ad-group) > .site-left-ad {
    grid-area: left;
}

.site-ads-shell > .site-right-ad,
.site-ads-shell > :where(.manual-ad-group) > .site-right-ad {
    grid-area: right;
}

.site-ads-shell > .desktop-top-ad {
    grid-area: top;
}

.site-ads-shell > .site-ads-content {
    grid-area: content;
    min-width: 0;
}

.desktop-top-ad {
    box-sizing: border-box;
    width: min(728px, 100%);
    min-height: 90px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.desktop-top-ad span {
    color: rgba(20, 20, 20, .45);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .15em;
    text-transform: uppercase;
}

/* Shared top ad replaces the old per-page navbar clearance. */
.site-ads-content .full-leaderboard-card,
.site-ads-content .explore-page {
    margin-top: 0;
}

.site-ads-content .upload-page {
    padding-top: 0;
}

.site-ads-content .compare-main {
    padding: 0 0 48px;
}

.site-ads-content .leaderboard-main,
.site-ads-content .explore-main,
.site-ads-content .upload-main {
    padding-left: 0;
    padding-right: 0;
}

.page-dashboard .ads-shell {
    max-width: 1720px;
}

.site-ads-content .dashboard-page {
    max-width: none;
    padding-top: 8px;
    padding-left: 0;
    padding-right: 0;
}

.site-ads-content .shop-page,
.site-ads-content .profile-page,
.site-ads-content .analysis-page,
.site-ads-content .settings-page,
.site-ads-content .progress-page,
.site-ads-content .login-container,
.site-ads-content .signup-container {
    padding-top: 8px;
}

.site-ads-content .notifications-page {
    margin-top: 8px;
}

.side-ad {
    box-sizing: border-box;
    width: clamp(120px, 10vw, 160px);
    height: clamp(440px, 66vh, 620px);

    display: flex;
    justify-content: center;
    align-items: center;
    align-self: start;

    position: sticky;
    top: calc(var(--navbar-footprint) + 4px);
}

.side-ad span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);

    font-size: 12px;
    font-weight: 850;

    letter-spacing: 0.15em;
    text-transform: uppercase;

    color: rgba(20, 20, 20, 0.45);
}

.mobile-comparison-ad {
    display: none;
}

/* Admin-only persistent ad positioning */
.ad-layout-layer {
    position: absolute;
    inset: 0 0 auto;
    width: 100%;
    height: 0;
    z-index: 18;
    pointer-events: none;
}

.ad-layout-placeholder {
    box-sizing: border-box;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none;
}

.ad-layout-placeholder::before,
.ad-layout-placeholder::after {
    display: none !important;
}

.ad-layout-guide {
    position: fixed;
    z-index: 999;
    display: none;
    pointer-events: none;
    background: rgba(27, 111, 198, .92);
}

.ad-layout-guide.is-visible {
    display: block;
}

.ad-layout-guide.is-vertical {
    top: 0;
    bottom: 0;
    width: 1px;
}

.ad-layout-guide.is-horizontal {
    left: 0;
    right: 0;
    height: 1px;
}

.ad-layout-layer > [data-ad-slot] {
    position: absolute !important;
    left: var(--ad-layout-x) !important;
    right: auto !important;
    top: var(--ad-layout-y) !important;
    margin: 0 !important;
    transform: translateX(-50%) !important;
    pointer-events: auto;
}

.ad-layout-layer > [data-ad-slot].is-ad-sticky {
    position: fixed !important;
}

/* Saved ad positions are stored as a percentage of the viewport. Keep side
   banners fully on-screen as that viewport narrows or widens instead of
   allowing their centre point to drift beyond a safe edge. */
.ad-layout-layer > .side-ad {
    --ad-side-safe-edge: calc(clamp(60px, 5vw, 80px) + 16px);
    left: clamp(
        var(--ad-side-safe-edge),
        var(--ad-layout-x),
        calc(100% - var(--ad-side-safe-edge))
    ) !important;
}

.ad-layout-editing .ad-layout-layer > [data-ad-slot] {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    outline: 3px dashed rgba(31, 95, 154, .82);
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.ad-layout-editing .ad-layout-layer > [data-ad-slot].is-ad-dragging {
    z-index: 2;
    cursor: grabbing;
}

.custom-ad {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.custom-ad-horizontal {
    width: min(728px, calc(100vw - 32px));
    height: 90px;
}

.custom-ad-vertical {
    width: 160px;
    height: min(600px, calc(100vh - 32px));
}

.custom-ad span {
    color: rgba(20, 20, 20, .45);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .15em;
    text-transform: uppercase;
    visibility: visible;
}

.ad-layout-editing .ad-layout-layer > [data-ad-slot].is-ad-selected {
    outline: 3px solid #1769e0;
    outline-offset: 3px;
}

.ad-layout-admin {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1000;
    /* Hide the page editor for every account; keep its implementation intact. */
    display: none !important;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(20, 20, 20, .14);
    border-radius: 16px;
    background: #f8f8f8;
    box-shadow: 0 14px 36px rgba(0, 0, 0, .18);
}

.ad-layout-admin button {
    padding: 9px 12px;
    border: 0;
    border-radius: 10px;
    background: #1a1a1a;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}

.ad-layout-admin button[data-action="cancel"] {
    background: #e5e5e5;
    color: #222;
}

.ad-layout-admin button[data-action="remove"] {
    background: #b42318;
}

.ad-layout-admin button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.ad-layout-admin label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #333;
    font-size: 12px;
    font-weight: 750;
}

.ad-layout-admin select {
    padding: 8px 28px 8px 9px;
    border: 1px solid rgba(20, 20, 20, .18);
    border-radius: 9px;
    background: #fff;
    color: #222;
    font: inherit;
}

.ad-layout-admin span {
    max-width: 190px;
    color: #555;
    font-size: 12px;
    font-weight: 700;
}

.page-layout-controls {
    display: contents;
}

[data-page-card].has-page-layout {
    width: var(--page-card-layout-width, var(--page-card-width)) !important;
    height: var(--page-card-layout-height, var(--page-card-height)) !important;
    max-width: none !important;
    overflow: auto;
    transform: translate(var(--page-card-dx), var(--page-card-dy))
        scale(var(--page-card-scale, 1)) !important;
    transform-origin: top left !important;
    /* Transforming a very tall backdrop-filtered card causes Chromium to
       expose its internal compositing tiles across the page background. */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.page-layout-editing [data-page-card].has-page-layout {
    outline: 3px dashed rgba(31, 95, 154, .82);
    outline-offset: 2px;
    cursor: move;
    touch-action: none;
    user-select: none;
}

.page-layout-editing [data-page-card].has-page-layout.is-page-card-selected {
    outline-style: solid;
    outline-color: #1769e0;
}

.page-card-ratio-guide {
    position: fixed;
    z-index: 1001;
    display: none;
    padding: 8px 12px;
    border: 1px solid rgba(23, 105, 224, .32);
    border-radius: 999px;
    color: #124f9f;
    background: rgba(239, 248, 255, .96);
    box-shadow: 0 8px 24px rgba(16, 66, 126, .18);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(-50%);
}

.page-card-ratio-guide.is-visible {
    display: block;
    opacity: 1 !important;
}

.page-card-ratio-guide.is-snapped {
    border-color: rgba(37, 142, 84, .4);
    color: #176b3c;
    background: rgba(237, 255, 244, .97);
}

[data-page-text].has-page-text-layout {
    position: relative;
    z-index: 1;
    transform: translate(var(--page-text-dx, 0), var(--page-text-dy, 0))
        rotate(var(--page-text-rotation, 0deg))
        scale(var(--page-text-scale-x, var(--page-text-scale, 1)), var(--page-text-scale-y, var(--page-text-scale, 1)))
        var(--page-text-warp, matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)) !important;
    transform-origin: var(--page-text-origin, center) !important;
}

span[data-page-text].has-page-text-layout,
strong[data-page-text].has-page-text-layout,
em[data-page-text].has-page-text-layout,
small[data-page-text].has-page-text-layout {
    display: inline-block;
}

.page-custom-text {
    position: absolute !important;
    left: calc(50% - 120px);
    top: 220px;
    z-index: 12;
    width: 240px;
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #222;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 8px 24px rgba(20, 20, 20, .12);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}

.page-text-layout-editing [data-page-text].has-page-text-layout {
    outline: 2px dashed rgba(31, 95, 154, .72);
    outline-offset: 4px;
    cursor: move;
    touch-action: none;
    user-select: none;
}

.page-text-layout-editing [data-page-text].has-page-text-layout.is-page-text-selected {
    z-index: 2;
    outline-style: solid;
    outline-color: #1769e0;
}

.page-layout-controls select,
.page-layout-controls label {
    min-height: 34px;
    border: 1px solid rgba(20, 20, 20, .18);
    border-radius: 9px;
    background: #fff;
    color: #222;
    font-size: 12px;
    font-weight: 750;
}

.page-layout-controls select {
    padding: 6px 28px 6px 9px;
}

.page-layout-controls label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
}

.page-layout-layer {
    position: absolute;
    inset: 0 0 auto;
    width: 100%;
    height: 0;
    z-index: 17;
    pointer-events: none;
}

.page-layout-layer > [data-page-card] {
    position: absolute !important;
    left: var(--page-card-x) !important;
    top: var(--page-card-y) !important;
    width: var(--page-card-layout-width, var(--page-card-width)) !important;
    height: var(--page-card-layout-height, var(--page-card-height)) !important;
    max-width: none !important;
    margin: 0 !important;
    overflow: auto;
    transform: scale(var(--page-card-scale, 1)) translateX(-50%) !important;
    transform-origin: top left !important;
    pointer-events: auto;
    /* Large absolutely positioned glass cards can make Chromium tile the
       backdrop into visible rectangles outside the card. Keep the same
       translucent surface without GPU backdrop sampling while arranged. */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.page-layout-placeholder {
    visibility: hidden !important;
    pointer-events: none !important;
}

.page-layout-editing .page-layout-layer > [data-page-card] {
    outline: 3px dashed rgba(31, 95, 154, .82);
    outline-offset: 2px;
    cursor: move;
    touch-action: none;
    user-select: none;
}

.page-layout-editing .page-layout-layer > [data-page-card].is-page-card-selected {
    outline-style: solid;
    outline-color: #1769e0;
}

.page-card-resize-handle {
    position: absolute;
    right: 2px;
    bottom: 2px;
    z-index: 5;
    display: none;
    width: 22px;
    height: 22px;
    border: 2px solid #1769e0;
    border-top: 0;
    border-left: 0;
    cursor: nwse-resize;
}

.page-layout-editing .page-card-resize-handle {
    display: block;
}

.page-layout-guide {
    position: fixed;
    z-index: 999;
    display: none;
    pointer-events: none;
    background: rgba(27, 111, 198, .92);
}

.page-layout-guide.is-visible {
    display: block;
}

.page-layout-guide.is-vertical {
    top: 0;
    bottom: 0;
    width: 1px;
}

.page-layout-guide.is-horizontal {
    left: 0;
    right: 0;
    height: 1px;
}

/* ===========================
RESPONSIVE
=========================== */

@media (max-width: 1200px) {
    .ads-shell {
        grid-template-columns: minmax(0, 1fr);
        max-width: 980px;
    }

    .site-ads-shell {
        grid-template-areas:
            "top"
            "content"
            "left"
            "right";
    }

    .ads-shell > .side-ad,
    .ads-shell > :where(.manual-ad-group) > .side-ad {
        display: flex;
        /* Contain the card's absolute highlight after leaving the side rail. */
        position: relative;
        top: auto;
        width: min(728px, calc(100vw - 32px));
        height: auto;
        min-height: 72px;
        margin: 0 auto;
    }

    .ads-shell > .side-ad:first-child {
        margin-bottom: 16px;
    }

    .ads-shell > .side-ad:last-child {
        margin-top: 16px;
    }

    .site-ads-shell > .side-ad:first-child,
    .site-ads-shell > .side-ad:last-child,
    .site-ads-shell > :where(.manual-ad-group) > .side-ad {
        margin-top: 0;
        margin-bottom: 0;
    }

    .ads-shell > .side-ad span,
    .ads-shell > :where(.manual-ad-group) > .side-ad span {
        writing-mode: horizontal-tb;
        transform: none;
    }
}

@media (max-width: 850px) {
    .page-compare .ads-shell > .side-ad {
        display: none;
    }

    .mobile-comparison-ad {
        --surface-radius: 18px;

        width: min(100%, 480px);
        min-height: 64px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px 16px;
    }

    .mobile-comparison-ad span {
        font-size: 10px;
        font-weight: 850;
        letter-spacing: .14em;
        text-transform: uppercase;
        color: rgba(20, 20, 20, .42);
    }

    .page-home .mobile-comparison-ad {
        max-width: 480px;
        margin-inline: auto;
    }

    .page-compare .mobile-comparison-ad:first-of-type {
        margin-bottom: 16px;
    }

    .page-compare .mobile-comparison-ad:last-of-type {
        margin-top: 16px;
    }
}
