@font-face {
  font-display: swap; 
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/poppins-v24-latin-regular.woff2') format('woff2'), 
       url('../fonts/poppins-v24-latin-regular.woff') format('woff');
}

:root {
        --bg: #181818;
        --panel: #212121;
        --text: #E0E0E0;
        --betaflight: #FF5252;
        --actual: #52A9FF;
    }

body {
    font-family: 'Poppins';
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 { margin-bottom: 5px; }
p.subtitle { color: #888; margin-top: 0; margin-bottom: 30px; }

.main-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    justify-content: center;
    align-items: flex-start;
}

.panel {
    background: var(--panel);
    padding: 20px;
    border-radius: 12px;
    width: 275px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    text-transform: uppercase;
    font-size: 1.2rem;
    font-weight: bold;
}

.betaflight-title { color: var(--betaflight); }
.actual-title { color: var(--actual); }

.control-group { 
    margin-bottom: 30px; 
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

label {
    font-size: 1rem;
    color: #bbb;
}

.val-display { font-weight: bold; color: #fff; }

input[type=text] {
    width: 40px;
    height: 100%;
    background: rgba(122, 122, 115, 0.2);
    box-shadow: 0 0 5px rgba(122, 122, 115, 0.4);
    border-radius: 5px;
    outline: none;
    text-align: center;
    font-family: monospace;
    font-size: 1rem;
    border: 0px solid;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #424242;
    border-radius: 5px;
    outline: none;
    margin-top: 10px;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: background .15s ease-in-out;
}

#rateGraph {
    flex-grow: 1;
    width: 450px;
    height: 450px;
    background: var(--panel);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    position: relative;
}

#btn-automatch {
    width: 300px;
    padding: 20px;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #57595B, #7A7A73);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    text-transform: uppercase;
    transition: transform 0.1s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#btn-automatch:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(122, 122, 115, 0.4);
}

#btn-automatch:active { transform: translateY(0); }

.max-rate-box {
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    margin-top: 10px;
}
.max-rate-label { font-size: 0.75rem; color: #888; letter-spacing: 1px; }
.max-rate-val { font-size: 1.5rem; font-weight: bold; }