.utility-page {
    max-width: 1050px;
    padding-top: 48px;
    padding-bottom: 64px
}

.utility-panel {
    padding: 28px;
    background: #fff;
    border: 1px solid #dce5f1;
    border-radius: 20px;
    margin: 24px 0;
    box-shadow: 0 10px 40px #12345608
}

.utility-panel label {
    display: block;
    font-weight: 600;
    margin: 16px 0
}

.utility-panel input, .utility-panel select, .utility-panel textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #c7d5e5;
    border-radius: 9px;
    padding: 12px;
    margin-top: 8px;
    font: inherit
}

.utility-grid {
    display: grid;
    grid-template-columns:repeat(2, 1fr);
    gap: 0 20px
}

.utility-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0
}

.utility-links button {
    border: 1px solid #c7d5e5;
    border-radius: 20px;
    padding: 7px 14px;
    background: #eff6ff;
    cursor: pointer
}

.smart-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    border: 1px solid #f4c86a;
    border-radius: 14px;
    background: #fffbeb;
    color: #78350f;
    margin: 12px 0
}

.smart-card.schema {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e3a8a
}

.smart-card.title {
    background: #fff1f2;
    border-color: #fda4af;
    color: #881337
}

.smart-card h4, .smart-card p {
    margin: 4px 0
}

.smart-card a, .smart-card button {
    flex-shrink: 0;
    background: #245eea;
    color: #fff;
    padding: 11px 16px;
    border: 0;
    border-radius: 9px;
    text-decoration: none;
    cursor: pointer
}

.smart-actions {
    margin: 20px 0
}

.smart-actions nav {
    font-size: 14px
}

.schema-dialog {
    max-width: 640px;
    width: 90%;
    border: 0;
    border-radius: 18px;
    padding: 28px
}

.schema-dialog::backdrop {
    background: #13243a99
}

.schema-dialog textarea {
    width: 100%;
    min-height: 260px;
    box-sizing: border-box
}

.serp-preview {
    max-width: 600px;
    overflow: hidden
}

.serp-preview h2 {
    color: #1a0dab;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    font: 20px Arial
}

.serp-preview p {
    color: #4d5156
}

.utility-result {
    padding: 16px;
    border-bottom: 1px solid #ddd;
    overflow-wrap: anywhere
}

@media (max-width: 640px) {
    .utility-grid {
        grid-template-columns:1fr
    }

    .utility-panel {
        padding: 18px
    }

    .smart-card {
        align-items: stretch;
        flex-direction: column
    }

    .utility-page {
        padding-top: 28px
    }
}

/* Image workspace */
#mediaForm {
    background: linear-gradient(135deg, #fff 65%, #f0f6ff);
    border-color: #dbe6f6
}

#mediaForm > label:first-child {
    border: 2px dashed #b8cced;
    border-radius: 14px;
    padding: 22px;
    background: #f4f8ff;
    color: #244b84
}

#mediaForm input[type=file] {
    border: 0;
    background: transparent;
    padding: 8px 0
}

#mediaForm input[type=file]::file-selector-button {
    border: 0;
    border-radius: 8px;
    background: #245eea;
    color: white;
    padding: 10px 16px;
    margin-right: 12px;
    cursor: pointer
}

#mediaForm > .btn {
    margin: 8px 8px 0 0
}

#mediaResults {
    scroll-margin-top: 32px
}

.media-grid {
    display: grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap: 20px
}

.media-grid:empty {
    display: none
}

#mediaInputs {
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0
}

#mediaInputs .media-card-body {
    padding: 12px
}

#mediaInputs h3 {
    font-size: 12px
}

#mediaInputs .media-thumb {
    aspect-ratio: 4/3
}

.media-card {
    position: relative;
    border: 1px solid #dce5f1;
    border-radius: 16px;
    overflow: hidden;
    background: white;
    box-shadow: 0 5px 20px #16385f08;
    min-width: 0;
    transition: box-shadow .2s, transform .2s
}

.media-card:hover {
    box-shadow: 0 12px 28px #16385f15;
    transform: translateY(-2px)
}

.media-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    padding: 12px;
    border: 0;
    border-bottom: 1px solid #e7edf5;
    background: repeating-conic-gradient(#eef2f7 0% 25%, #f8fafc 0% 50%) 50%/20px 20px;
    cursor: zoom-in
}

.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain
}

.media-zoom {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #132b4cdb;
    color: white;
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 20px;
    pointer-events: none
}

.media-card-body {
    padding: 18px
}

.media-card h3 {
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #172f52
}

.media-card small {
    color: #6a7b93;
    font-size: 12px
}

.media-card p {
    font-size: 12px;
    color: #6a7b93;
    margin: 14px 0
}

.media-saving {
    position: absolute;
    top: 12px;
    left: 12px;
    border: 1px solid #a7e5ca;
    background: #e6fff1;
    color: #087847;
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
    pointer-events: none
}

.media-saving.increased {
    background: #fff3de;
    color: #955a0b;
    border-color: #f9d58e
}

.media-metrics {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 12px;
    background: #f5f8fc;
    border-radius: 10px;
    padding: 12px
}

.media-metrics small, .media-metrics strong {
    display: block
}

.media-metrics strong {
    font-size: 16px;
    margin-top: 4px;
    color: #172f52
}

.media-metrics > div:last-child strong {
    color: #087847
}

.media-card-actions {
    display: flex;
    gap: 8px
}

.media-card-actions a, .media-card-actions button {
    flex: 1;
    text-align: center;
    border: 1px solid #d4e0f1;
    border-radius: 8px;
    padding: 10px 4px;
    font: 600 12px/1.4 inherit;
    cursor: pointer;
    text-decoration: none;
    background: white;
    color: #245eea
}

.media-card-actions a {
    background: #245eea;
    color: white;
    border-color: #245eea
}

.media-results-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 36px 0 20px
}

.media-results-heading h2 {
    font-size: 23px;
    margin: 0
}

.media-results-heading p {
    font-size: 14px;
    color: #47705d;
    background: #eaf9f0;
    padding: 10px 14px;
    border-radius: 10px;
    margin: 0
}

.media-viewer {
    width: min(1100px, 94vw);
    max-width: 94vw;
    max-height: 92vh;
    padding: 20px;
    border: 1px solid #dce5f1;
    border-radius: 18px;
    box-sizing: border-box;
    background: #f9fbff
}

.media-viewer::backdrop {
    background: #0b1834d9;
    backdrop-filter: blur(5px)
}

.media-viewer-bar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px
}

.media-viewer-bar strong {
    overflow-wrap: anywhere;
    font-size: 15px
}

.media-viewer-bar button {
    border: 1px solid #ccd8e9;
    background: white;
    border-radius: 8px;
    padding: 9px 14px;
    cursor: pointer;
    flex-shrink: 0
}

.media-viewer > img {
    display: block;
    max-width: 100%;
    max-height: 67vh;
    object-fit: contain;
    margin: 0 auto 18px
}

.media-thumb:focus-visible, .media-card-actions a:focus-visible, .media-card-actions button:focus-visible {
    outline: 3px solid #6098ff;
    outline-offset: 2px
}

#mediaResults[aria-busy=true] {
    opacity: .55
}

#utilityStatus {
    color: #456080;
    line-height: 1.7
}

@media (max-width: 900px) {
    .media-grid {
        grid-template-columns:repeat(2, minmax(0, 1fr))
    }

    #mediaInputs {
        grid-template-columns:repeat(3, minmax(0, 1fr))
    }

    .media-results-heading {
        align-items: flex-start;
        flex-direction: column
    }
}

@media (max-width: 540px) {
    .media-grid {
        grid-template-columns:1fr
    }

    #mediaInputs {
        grid-template-columns:repeat(2, minmax(0, 1fr))
    }

    .media-card-body {
        padding: 16px
    }

    .media-results-heading p {
        font-size: 12px
    }

    .media-viewer {
        padding: 12px
    }

    .media-viewer-bar strong {
        font-size: 12px
    }
}

/* Guided utility pages */
.utility-page {
    max-width: 1120px;
    padding-top: 48px;
    padding-bottom: 72px
}

.utility-hero {
    padding: 32px 36px;
    border: 1px solid #dce7f6;
    border-radius: 24px;
    background: radial-gradient(ellipse at top right, #dfeeff, transparent 65%), #fff
}

.utility-hero h1 {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.25;
    letter-spacing: -1.3px;
    margin: 12px 0 16px
}

.utility-intro {
    max-width: 760px;
    color: #586d89;
    font-size: 16px;
    margin: 0;
    line-height: 1.85
}

.utility-tabs {
    gap: 8px;
    margin: 22px 0 36px;
    padding: 6px;
    background: #eaf0f8;
    border-radius: 14px;
    width: fit-content
}

.utility-tabs a {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid #526983;
    color: #526983
}

.utility-tabs a[aria-current=page] {
    background: #fff;
    color: #2164d9;
    box-shadow: 0 3px 10px #183c6810
}

.utility-tabs a:hover {
    background: #fff
}

.utility-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px
}

.utility-section-heading h2, .utility-faq h2 {
    font-size: 24px;
    letter-spacing: -.6px;
    margin: 6px 0 0;
    line-height: 1.4
}

.utility-section-heading > a {
    font-size: 13px;
    color: #2468dc;
    font-weight: 700;
    white-space: nowrap
}

.utility-steps {
    display: grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap: 18px
}

.utility-steps article {
    padding: 24px;
    border: 1px solid #e0e8f2;
    background: #fff;
    border-radius: 16px
}

.utility-step-number {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: #eaf2ff;
    color: #286bdd;
    font-weight: 800;
    font-size: 13px
}

.utility-steps h3 {
    font-size: 15px;
    margin: 16px 0 8px
}

.utility-steps p {
    font-size: 13px;
    line-height: 1.85;
    color: #60738c;
    margin: 0
}

.utility-workspace {
    margin-top: 40px;
    scroll-margin-top: 108px
}

.utility-badge {
    border: 1px solid #c7e9df;
    color: #24725d;
    background: #edf9f4;
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap
}

.utility-workspace > p {
    color: #60738c;
    font-size: 14px
}

.utility-panel {
    margin-top: 20px;
    padding: 30px
}

.utility-panel h3 {
    margin: 0 0 8px;
    font-size: 18px
}

.utility-help {
    color: #657a94;
    font-size: 13px
}

.utility-panel label {
    font-size: 13px;
    color: #304865
}

.utility-panel input, .utility-panel select, .utility-panel textarea {
    background: #fcfdff;
    transition: border-color .15s;
    font-weight: 400;
    color: #172f52
}

.utility-panel input:focus, .utility-panel select:focus, .utility-panel textarea:focus {
    outline: 3px solid #deebff;
    border-color: #397eec
}

.utility-panel textarea {
    resize: vertical
}

.utility-panel input::placeholder, .utility-panel textarea::placeholder {
    color: #8796aa
}

.utility-panel .utility-links {
    gap: 8px;
    margin-top: -6px
}

.utility-panel .utility-links:empty {
    display: none
}

.utility-links button {
    font-size: 12px;
    color: #3b6293
}

.utility-panel button:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none
}

.utility-page [hidden] {
    display: none !important
}

#utmOutput {
    background: #f0f6ff;
    border-color: #cbdcf4;
    overflow-wrap: anywhere
}

#snippetWidth {
    font-size: 12px;
    color: #57728e;
    background: #eff5fd;
    padding: 10px 14px;
    border-radius: 9px
}

.utility-panel .utility-preview-heading {
    margin-top: 28px;
    font-size: 13px;
    color: #6b7b90
}

.serp-preview {
    background: #fff;
    padding: 24px;
    border: 1px solid #e2e8f1;
    border-radius: 12px;
    min-height: 140px
}

.serp-preview small {
    color: #3c4043;
    overflow-wrap: anywhere
}

.serp-preview h2 {
    margin: 8px 0;
    font-weight: 400;
    line-height: 1.4
}

.serp-preview p {
    font: 14px/1.65 Arial, sans-serif;
    margin: 0;
    overflow-wrap: anywhere
}

.utility-tip {
    padding: 22px 26px;
    border: 1px solid #cbdff8;
    border-left: 4px solid #4384e7;
    border-radius: 12px;
    background: #edf5ff;
    margin: 28px 0 40px;
    font-size: 13px;
    color: #3c5c82
}

.utility-tip p {
    margin: 6px 0 0;
    line-height: 1.85
}

.utility-faq details {
    background: #fff;
    border: 1px solid #dde6f1;
    border-radius: 12px;
    padding: 18px 22px;
    margin-top: 12px
}

.utility-faq h2 {
    margin-bottom: 20px
}

.utility-faq summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 700
}

.utility-faq details p {
    font-size: 13px;
    line-height: 1.85;
    color: #60738c;
    margin: 12px 0 0
}

.utility-tabs a:focus-visible, .utility-faq summary:focus-visible {
    outline: 3px solid #80b1fa;
    outline-offset: 3px
}

@media (max-width: 720px) {
    .utility-hero {
        padding: 24px
    }

    .utility-steps {
        grid-template-columns:1fr;
        gap: 12px
    }

    .utility-steps article {
        padding: 20px
    }

    .utility-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px
    }

    .utility-tabs {
        width: 100%;
        gap: 4px
    }

    .utility-tabs a {
        flex: 1;
        text-align: center;
        padding: 9px 6px;

        font-size: 11px
    }

    .utility-panel {
        padding: 20px
    }

    .utility-intro {
        font-size: 14px
    }

    .serp-preview {
        padding: 16px
    }

    .utility-section-heading h2, .utility-faq h2 {
        font-size: 22px
    }
}

.snippet-meter { --meter-color: #94a3b8; margin: -6px 0 22px; }
.snippet-meter[data-state="green"] { --meter-color: #15803d; }
.snippet-meter[data-state="yellow"] { --meter-color: #ca8a04; }
.snippet-meter[data-state="orange"] { --meter-color: #ea580c; }
.snippet-meter-track { height: 6px; background: #e8edf3; border-radius: 999px; overflow: hidden; }
.snippet-meter-track span { display: block; height: 100%; background: var(--meter-color); transition: width .15s, background-color .15s; }
.snippet-meter p, .snippet-meter #snippetWidth { margin: 8px 0 0; padding: 0; background: transparent; color: #52657b; font-size: 12px; line-height: 1.7; }
.snippet-explainer { margin-top: 32px; padding-top: 28px; border-top: 1px solid #e2e8f1; color: #475569; line-height: 1.85; overflow-wrap: anywhere; }
.snippet-explainer h2 { color: #182b49; font-size: 22px; margin: 28px 0 12px; }
.snippet-explainer li { margin-bottom: 10px; }
.snippet-explainer a { color: #1d4ed8; text-decoration: underline; }
.snippet-legend { padding-left: 0; list-style: none; }
.snippet-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.snippet-dot.green { background: #15803d; }
.snippet-dot.yellow { background: #ca8a04; }
.snippet-dot.orange { background: #ea580c; }
.serp-preview p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
