:root {
    --google-blue: #4285f4;
    --bg-gray: #f8f9fa;
    --text-dark: #3c4043;
    --card-bg: #ffffff;
    --border-color: #dadce0;
}

body {
    background-color: var(--bg-gray);
    font-family: "Segoe UI", system-ui, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    min-height: 100vh;
    color: var(--text-dark);
    overflow-y: auto;
    touch-action: none;
}

.flex-center { display: flex; justify-content: center; align-items: center; }

.header { text-align: center; padding-top: 20px; }

#status { font-size: 13px; color: #5f6368; margin-top: 4px; }

.controls-wrapper { width: 85vw; max-width: 450px; }

.sensitivity-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 8px 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    color: #5f6368;
}

#sensSlider, #scrollDecay, #scrollBoost {
    flex-grow: 1;
    accent-color: var(--google-blue);
    cursor: pointer;
}

#sensValue, #scrollDecayVal, #scrollBoostVal {
    min-width: 25px;
    font-family: monospace;
    font-weight: bold;
    color: var(--google-blue);
}

#trackpad-card {
    background: var(--card-bg);
    width: 85vw;
    max-width: 450px;
    height: 40vh;
    border-radius: 28px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: crosshair;
    transition: all 0.3s ease;
    position: relative;
}

#trackpad-card.active {
    border: 2px solid var(--google-blue);
    box-shadow: 0 8px 24px rgba(66, 133, 244, 0.15);
    transform: scale(1.01);
}

.btn {
    background: var(--google-blue);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.btn-ota { background: #34a853; width: 100%; margin-top: 10px; }
.btn-ota:disabled { background: #ccc; cursor: not-allowed; }

#confirmBtn { background: #34a853; display: none; }

.key-container {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2px 10px;
    margin-bottom: 10px;
}

#aesKey {
    border: none;
    padding: 8px;
    outline: none;
    text-align: center;
    font-family: monospace;
    width: 160px;
    font-size: 14px;
}

.toggle-pass { cursor: pointer; font-size: 18px; padding: 5px; }

.shortcut-hint {
    position: absolute;
    bottom: 20px;
    font-size: 12px;
    color: #70757a;
    background: #f1f3f4;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    list-style: none;
    margin: 0;
}

#trackpad-card.active .shortcut-hint { opacity: 1; }

.key-cap {
    background: #fff;
    border: 1px solid #bdc1c6;
    border-bottom-width: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
}

#ota-panel { margin-top: 15px; width: 85vw; max-width: 450px; text-align: center; display: none; }
.ota-toggle, .reset-link { color: #5f6368; font-size: 12px; cursor: pointer; text-decoration: underline; display: block; }
#ota-controls { display: none; background: #fff; padding: 15px; border-radius: 16px; border: 1px solid var(--border-color); flex-direction: column; gap: 8px; }

#fileList { max-height: 120px; overflow-y: auto; margin-bottom: 10px; border: 1px solid #eee; border-radius: 8px; }
.file-item { text-align: left; font-size: 13px; padding: 12px; cursor: pointer; background: #f8f9fa; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; }
.file-item.selected { background: #e8f0fe; font-weight: bold; color: var(--google-blue); border-left: 4px solid var(--google-blue); }

.progress-bar { width: 100%; height: 6px; background: #e8eaed; border-radius: 3px; overflow: hidden; margin: 10px 0; display: none; }
.progress-fill { height: 100%; background: var(--google-blue); width: 0%; transition: width 0.1s; }
#otaStatus { font-size: 11px; color: #5f6368; margin-top: 5px; }