/* CSS tools share the existing developer-tool shell and controls. */
.css-tools-page #css-controls {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.css-tools-page .css-controls-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    align-items: start;
    min-width: 0;
}

.css-tools-page .option-field,
.css-tools-page .css-field-group {
    min-width: 0;
    width: 100%;
}

.css-tools-page .field-help {
    display: block;
    margin: 6px 0 0;
    line-height: 1.6;
}

.css-tools-page .css-range-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 80px;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.css-tools-page input[type="range"] {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    margin: 0;
    accent-color: #0052cc;
    cursor: pointer;
}

.css-tools-page input[type="range"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.css-tools-page .css-color-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
    align-items: start;
    min-width: 0;
}

.css-tools-page input[type="color"] {
    width: 44px;
    height: 42px;
    padding: 3px;
    margin-top: 26px;
    border: 1px solid #c8d4e3;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.css-tools-page .css-gradient-stops {
    display: grid;
    gap: 12px;
}

.css-tools-page .css-gradient-stop {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(80px, 0.75fr) auto;
    gap: 9px;
    align-items: start;
    padding: 12px;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #fbfcfe;
}

.css-tools-page .css-gradient-stop > .tool-button {
    margin-top: 26px;
    padding: 9px 11px;
}

.css-tools-page .tool-button:disabled {
    cursor: not-allowed;
}

.css-tools-page #css-preview {
    position: relative;
    min-width: 0;
    min-height: 220px;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    background: #f3f7fc;
}

.css-tools-page #css-details {
    max-width: 100%;
    margin-top: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.css-tools-page #tool-output {
    min-height: 150px;
    margin-top: 8px;
}

.css-tools-page .css-gradient-surface {
    min-height: 300px;
    width: 100%;
}

.css-tools-page .css-shadow-stage,
.css-tools-page .css-centered-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 55px 28px;
    min-height: 300px !important;
}

.css-tools-page .css-shadow-card {
    display: grid;
    place-items: center;
    width: 200px;
    min-height: 150px;
    max-width: 100%;
    border: 1px solid #d9e4f2;
    border-radius: 12px;
    background: #fff;
    color: #17335d;
    font-weight: 700;
}

.css-tools-page .css-shadow-text {
    max-width: 100%;
    color: #17335d;
    font-size: 36px;
    font-weight: 800;
    line-height: 1.5;
    text-align: center;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.css-tools-page .css-radius-box {
    display: grid;
    place-items: center;
    width: 240px;
    height: 180px;
    max-width: 100%;
    background: #0052cc;
    color: #fff;
    font-weight: 700;
}

.css-tools-page .css-flex-surface {
    min-width: 0;
    width: 100%;
    height: 320px;
    padding: 16px;
    overflow: auto;
}

.css-tools-page .css-flex-item,
.css-tools-page .css-grid-item {
    display: grid;
    place-items: center;
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 7px;
    color: #fff;
    font-weight: 700;
    line-height: 1.2;
}

.css-tools-page .css-flex-item {
    flex: 0 1 72px;
    min-width: 52px;
    min-height: 52px;
    font-size: 22px;
}

.css-tools-page .css-flex-item:nth-child(2) { font-size: 32px; }
.css-tools-page .css-flex-item:nth-child(4) { font-size: 18px; }
.css-tools-page .css-item-1 { background: #0052cc; }
.css-tools-page .css-item-2 { background: #0f766e; }
.css-tools-page .css-item-3 { background: #9333ea; }
.css-tools-page .css-item-4 { background: #c2410c; }

.css-tools-page .css-layout-scroll {
    max-width: 100%;
    max-height: 480px;
    overflow: auto;
}

.css-tools-page .css-grid-surface {
    min-height: 300px;
    padding: 12px;
}

.css-tools-page .css-grid-item {
    min-width: 0;
    min-height: 40px;
    font-size: 15px;
}

.css-tools-page .css-clamp-stage {
    padding: 26px;
    max-height: 380px;
    overflow: auto !important;
}

.css-tools-page .css-clamp-text {
    max-width: 100%;
    color: #17335d;
    font-weight: 700;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.css-tools-page .css-filter-stage {
    padding: 20px;
    background-color: #fff !important;
    background-image: linear-gradient(45deg, #e6edf5 25%, transparent 25%), linear-gradient(-45deg, #e6edf5 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e6edf5 75%), linear-gradient(-45deg, transparent 75%, #e6edf5 75%) !important;
    background-size: 20px 20px !important;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0 !important;
}

.css-tools-page .css-filter-scene {
    position: relative;
    height: 270px;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    isolation: isolate;
    background: linear-gradient(180deg, #3899e7 0%, #9ddffe 63%, #ffe5bc 100%);
}

.css-tools-page .css-scene-sun {
    position: absolute;
    top: 27px;
    right: 15%;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #ffd34f;
    box-shadow: 0 0 28px #ffed9c;
}

.css-tools-page .css-scene-mountain {
    position: absolute;
    width: 90%;
    height: 155px;
    clip-path: polygon(0 100%, 45% 0, 100% 100%);
}

.css-tools-page .css-scene-back {
    top: 63px;
    right: -14%;
    background: #0c8294;
}

.css-tools-page .css-scene-front {
    top: 92px;
    left: -22%;
    background: #23a984;
}

.css-tools-page .css-scene-water {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 55px;
    background: linear-gradient(180deg, #62d5ec, #176ac9);
}

.css-tools-page .css-scene-palette {
    position: absolute;
    bottom: 19px;
    left: 18px;
    display: flex;
    gap: 7px;
}

.css-tools-page .css-palette-color {
    width: 28px;
    height: 28px;
    border: 2px solid #fff;
    border-radius: 50%;
}

/* Shared by the color, unit and contrast pages. */
.css-tools-page .css-details-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px 12px;
    margin: 0;
}

.css-tools-page .css-details-list dd {
    margin: 0;
}

.css-tools-page .css-unit-preview {
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: 24px;
    color: #17335d;
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    overflow-wrap: anywhere;
}

.css-tools-page .css-aspect-box {
    flex: 0 1 auto;
    background: #0052cc;
    border: 1px solid #003f9e;
    border-radius: 4px;
}

.css-tools-page .css-color-swatch {
    min-height: 220px;
    width: 100%;
    border-radius: 9px;
}

.css-tools-page .css-contrast-preview {
    min-height: 220px;
    padding: 28px;
    overflow-wrap: anywhere;
}

.css-tools-page .css-contrast-preview .css-large-text {
    margin: 16px 0 0;
    font-size: 24px;
}

.css-tools-page .css-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.css-tools-page .css-results-table th,
.css-tools-page .css-results-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #dbe4f0;
    text-align: left;
    overflow-wrap: anywhere;
}

.css-tools-page .css-pass { color: #17633a; font-weight: 700; }
.css-tools-page .css-fail { color: #8c2424; font-weight: 700; }

@media (max-width: 1000px) and (min-width: 769px) {
    .css-tools-page .css-controls-grid { grid-template-columns: minmax(0, 1fr); }
    .css-tools-page .css-gradient-stop { grid-template-columns: minmax(0, 1fr) 92px; }
    .css-tools-page .css-gradient-stop > .tool-button { grid-column: 1 / -1; margin-top: 0; }
}

@media (max-width: 520px) {
    .css-tools-page .css-controls-grid { grid-template-columns: minmax(0, 1fr); }
    .css-tools-page .css-gradient-stop { grid-template-columns: minmax(0, 1fr); }
    .css-tools-page .css-gradient-stop > .tool-button { margin-top: 0; }
    .css-tools-page .css-range-pair { grid-template-columns: minmax(0, 1fr) 84px; }
    .css-tools-page .css-shadow-stage,
    .css-tools-page .css-centered-preview { padding: 45px 22px; }
    .css-tools-page .css-shadow-text { font-size: 30px; }
    .css-tools-page .css-filter-stage { padding: 14px; }
    .css-tools-page .css-clamp-stage { padding: 20px; }
}
