* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #101114;
    color: #f5f5f5;
    font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
    border-radius: 8px;
    border: 1px solid #333842;
    padding: 8px 10px;
    background: #181b20;
    color: #f5f5f5;
}

textarea {
    resize: vertical;
    font-family: Consolas, monospace;
}

button {
    cursor: pointer;
    background: #2f6fed;
    border-color: #2f6fed;
}

button.secondary {
    background: #303640;
    border-color: #303640;
}

button.danger {
    background: #a83232;
    border-color: #a83232;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

h2,
h3 {
    margin-top: 0;
}

h3 {
    font-size: 14px;
    margin-bottom: 10px;
}

hr {
    border: none;
    border-top: 1px solid #282d35;
    margin: 18px 0;
}

.layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    height: 100vh;
}

.sidebar {
    border-right: 1px solid #282d35;
    padding: 16px;
    overflow-y: auto;
    background: #15171c;
}

.viewer {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #282d35;
    background: #15171c;
}

.screen-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050505;
}

#screen {
    width: 100%;
    height: 100%;
    display: block;
    background: black;
    outline: none;
    cursor: crosshair;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.field label {
    font-size: 12px;
    color: #a7abb4;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.button-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.button-row button {
    flex: 1;
}

.device-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.device-card {
    padding: 12px;
    border: 1px solid #2d323c;
    border-radius: 10px;
    background: #1b1f26;
    cursor: pointer;
}

.device-card.selected {
    border-color: #2f6fed;
}

.device-name {
    font-weight: bold;
}

.device-id {
    margin-top: 4px;
    color: #a7abb4;
    font-size: 12px;
    word-break: break-all;
}

.status,
.hint {
    font-size: 13px;
    color: #a7abb4;
}

.hint {
    margin-top: 8px;
}

.badge {
    padding: 4px 8px;
    border-radius: 999px;
    background: #222832;
    color: #d4d7de;
    font-size: 12px;
}

.log {
    margin-top: 16px;
    padding: 10px;
    border-radius: 8px;
    background: #0f1115;
    color: #a7abb4;
    height: 180px;
    overflow-y: auto;
    font-family: Consolas, monospace;
    font-size: 12px;
    white-space: pre-wrap;
}

.checkbox-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d4d7de;
}

.checkbox-field input {
    width: auto;
}
