.screen-container {
    width: min(1320px, 100%);
    margin: auto;
    padding: 25px 20px 45px;
}

.page-heading {
    text-align: center;
    margin-bottom: 25px;
}

.page-heading h1 {
    font-size: clamp(25px, 4vw, 36px);
    font-weight: 800;
    letter-spacing: -.8px;
    margin-bottom: 9px;
}

.page-heading p {
    color: #64748b;
    font-size: 15px;
    margin: 0;
}

/* Main screen */

.screen-card {
    padding: 20px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 18px;
    box-shadow: 0 3px 15px rgba(15,23,42,.07);
    margin-bottom: 24px;
}

.screen-preview {
    height: clamp(300px, 43vw, 540px);
    min-height: 300px;
    width: 100%;
    background: #000;
    border-radius: 9px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    outline: none;
    transition: background-color .12s;
}

.screen-preview:fullscreen {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border-radius: 0;
}

.screen-preview:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border-radius: 0;
}

.preview-message {
    text-align: center;
    padding: 20px;
    pointer-events: none;
}

.preview-message h2 {
    font-size: 23px;
    font-weight: 700;
    margin-bottom: 8px;
}

.preview-message p {
    font-size: 14px;
    margin: 0;
}

.screen-preview.testing .preview-message {
    display: none;
}

.fullscreen-button {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 43px;
    height: 43px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: rgba(30,30,30,.72);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    z-index: 5;
    transition: background .2s;
}

.fullscreen-button:hover {
    background: rgba(75,75,75,.95);
}

.screen-preview:fullscreen .fullscreen-button,
.screen-preview:-webkit-full-screen .fullscreen-button {
    display: none;
}

.preview-label {
    position: absolute;
    left: 15px;
    top: 17px;
    background: rgba(25,25,25,.7);
    color: #fff;
    padding: 7px 12px;
    border-radius: 30px;
    font-size: 12px;
    display: none;
    z-index: 4;
}

.screen-preview.testing .preview-label {
    display: block;
}

/* Resolution toolbar */

.settings-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 17px 20px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    margin-bottom: 18px;
}

.dimension-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    white-space: nowrap;
}

.dimension-control input {
    width: 76px;
    border: 0;
    border-bottom: 1px solid #888;
    padding: 5px 3px;
    text-align: center;
    font-size: 15px;
    outline: none;
    background: transparent;
}

.dimension-control input:focus {
    border-bottom: 2px solid #2563eb;
}

.resolution-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
}

.resolution-control select {
    width: 110px;
    border: 0;
    border-bottom: 1px solid #888;
    padding: 7px 3px;
    background: transparent;
    outline: none;
    font-size: 15px;
}

.download-button {
    border: 0;
    background: #000;
    color: #fff;
    padding: 13px 25px;
    min-width: 220px;
    border-radius: 5px;
    font-size: 17px;
    font-weight: 700;
    transition: background .2s, transform .2s;
}

.download-button:hover {
    background: #292929;
    transform: translateY(-1px);
}

/* Colour buttons */

.color-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.color-button {
    border: 1px solid rgba(0,0,0,.09);
    border-radius: 8px;
    min-height: 100px;
    padding: 15px 8px;
    background: #fff;
    color: #111;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    font-size: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition: transform .2s, box-shadow .2s;
}

.color-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 19px rgba(0,0,0,.19);
}

.color-button.active {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

.color-button.red {
    background: #ff0000;
    color: #fff;
}

.color-button.green {
    background: #00ed00;
    color: #fff;
}

.color-button.blue {
    background: #0000ff;
    color: #fff;
}

.color-button.black {
    background: #000;
    color: #fff;
}

.color-button.gray {
    background: #808080;
    color: #fff;
}

.custom-color-button {
    background: #fff;
    position: relative;
}

.color-wheel {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: conic-gradient(
        #ff3333, #ff9900, #ffff00, #33dd33,
        #00ccff, #3344ff, #bb22dd, #ff3333
    );
    display: grid;
    place-items: center;
    padding: 7px;
}

.color-wheel-inner {
    background: #fff;
    border-radius: 50%;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #111;
    font-size: 23px;
}

#customColor {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Extra test patterns */

.panel {
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 3px 13px rgba(15,23,42,.045);
    margin-bottom: 22px;
}

.panel-title {
    font-size: 19px;
    font-weight: 750;
    margin-bottom: 6px;
}

.panel-description {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 18px;
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.pattern-button {
    padding: 13px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fff;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    transition: all .2s;
}

.pattern-button:hover,
.pattern-button.active {
    background: #eff6ff;
    border-color: #93b4ff;
    color: #1d4ed8;
}

.action-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.action-toolbar .btn {
    min-height: 43px;
    padding: 10px 17px;
    border-radius: 8px;
    font-weight: 600;
}

.status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    color: #64748b;
    font-size: 13px;
    margin-top: 14px;
}

.status-pill {
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    background: #f8fafc;
    padding: 7px 12px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.info-item {
    background: #f8fafc;
    border: 1px solid #edf0f5;
    border-radius: 12px;
    padding: 17px;
}

.info-item i {
    color: #2563eb;
    font-size: 23px;
    margin-bottom: 10px;
    display: block;
}

.info-item h3 {
    font-size: 16px;
    font-weight: 700;
}

.info-item p {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 0;
    line-height: 1.7;
}

footer {
    text-align: center;
    color: #64748b;
    font-size: 13px;
    padding-top: 15px;
}

@media (max-width: 900px) {
    .settings-bar {
        gap: 14px;
    }

    .color-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pattern-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .screen-container {
        padding: 15px 11px 28px;
    }

    .screen-card {
        padding: 8px;
        border-radius: 12px;
    }

    .screen-preview {
        height: 55vh;
        min-height: 280px;
    }

    .settings-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 17px;
        gap: 14px;
    }

    .dimension-control,
    .resolution-control {
        justify-content: space-between;
        font-size: 15px;
    }

    .dimension-control input {
        width: 95px;
    }

    .resolution-control select {
        width: 135px;
    }

    .download-button {
        width: 100%;
        min-width: 0;
    }

    .color-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .color-button {
        min-height: 75px;
        font-size: 15px;
    }

    .pattern-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 17px;
    }
}