* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 6px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #333;
    background: transparent;
}

.ptz-box {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.intro {
    margin-bottom: 7px;
}

.intro strong {
    color: #d00;
    margin-right: 5px;
}

.intro span {
    font-style: italic;
    font-weight: bold;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 8px;
}

.preset {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.preset input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.preset span {
    display: block;
    min-height: 36px;
    padding: 8px 8px 8px 38px;
    border: 1px solid #d1d3d4;
    border-radius: 4px;
    background: #fff;
    line-height: 18px;
    position: relative;
}

.preset span::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 30px;
    background: #d1d3d4;
    border-radius: 3px 0 0 3px;
}

.preset input:checked + span::before {
    content: '✓';
    color: #fff;
    background: #5cb85c;
    text-align: center;
    line-height: 36px;
    font-weight: bold;
}

.preset input:disabled + span {
    opacity: .55;
    cursor: not-allowed;
}

button {
    border: 0;
    border-radius: 4px;
    padding: 7px 14px;
    background: #337ab7;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

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

.countdown,
.disabled-message,
.message {
    margin: 6px 0;
}

.countdown {
    font-weight: bold;
}

.disabled-message {
    color: #b00;
}

.message.success { color: #237a23; }
.message.error { color: #b00; }
.message.info { color: #555; }

[hidden] { display: none !important; }

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