/* ================= GLOBAL ================= */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
}

button {
    padding: 5px 8px;
    font-size: 13px;
    line-height: 1.1;
}

/* ================= APP LAYOUT ================= */
.appContainer {
    max-width: 320px;
    margin: 0 auto;
    padding: 6px;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 8px;
}

/* ================= TOP BAR ================= */
#topBar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.appTitleBtn {
    font-size: 24px;
    font-weight: bold;
}

    .appTitleBtn.connected {
        color: #00c853;
    }

/* ================= GRIP ================= */
#gripHeaderWrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

#gripHeaderWrap,
.iqBlock {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.gripLabel {
    font-size: 14px;
    color: #666;
}

.gripBar.horizontal {
    width: 100%;
    height: 10px;
    display: flex;
    gap: 3px;
}

    .gripBar.horizontal .led {
        flex: 1;
        border-radius: 5px;
    }

.led {
    background: #d0d7de;
}

    .led.active.low {
        background: #ffeb3b;
    }

    .led.active.mid {
        background: #ff9800;
    }

    .led.active.high {
        background: #f44336;
    }

/* ================= METRICS ================= */

.metricBlock {
    display: flex;
    flex-direction: column;
    align-items: center; /* 🔥 THIS is the real fix */
    justify-content: center;
}

.metricLabel {
    font-size: 12px;
    color: #888;
}

.metricValue {
    font-size: 20px;
    font-weight: bold;
}

.iqValue {
    color: #00bfa5;
}

.iqBlock {
    text-align: center;
}
/* ================= SECTION ================= */
.sectionBlock,
.sessionBlock,
#coachBox {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 8px;
}

/* HEADERS */
.sectionHeaderBox,
.sessionHeader {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-align: center;
    padding: 4px 0;
    margin-bottom: 4px;
    background: #f0f2f5;
    border-radius: 6px;
}

/* ================= GRID (CORRECT) ================= */
.selectRow {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 🔥 equal columns */
    width: 100%; /* 🔥 fill container */
    gap: 6px;
}
    /* ================= BUTTONS ================= */
    .selectRow button {
        width: 100%; /* fill each cell */
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2px;
        border-radius: 8px;
        border: none;
        background: #f0f2f5;
        color: #555;
        font-size: 8.5px;
        font-weight: 600; /* 🔒 same always */

        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        box-sizing: border-box;
    }

        /* ACTIVE (NO size change!) */
        .selectRow button.active {
            background: linear-gradient(135deg, #4CAF50, #2ecc71);
            color: white;
        }

/* ================= DRILL ================= */
.highlightBlock {
    padding: 5px;
}

#selectedDrill {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

#coachBox {
    width: 100%;
    max-width: 340px;
    margin: 20px auto;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

#coachTitle {
    font-size: 18px;
    font-weight: 700; /* bold */
    color: #222;
    margin-bottom: 8px;
}

#coachText {
    font-size: 15px;
    color: #bbb;
}

/* ================= MAIN BUTTONS ================= */
#startDrillBtn {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #2196F3, #00bcd4);
    color: white;
    font-size: 15px;
    font-weight: bold;
}

.secondaryBtn {
    width: 100%;
    margin-top: 6px;
    padding: 7px;
    border-radius: 10px;
    border: none;
    background: #eaeef2;
    color: #555;
}

/* ================= SESSION ================= */

#sessionView canvas {
    width: 100% !important;
    height: 140px !important;
}

#sessionView {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#sessionScore {
    font-size: 32px;
    text-align: center;
}

#sessionSubtitle {
    font-size: 12px;
    text-align: center;
    color: #777;
}

/* ================= DEV ================= */
#devPanel {
    padding: 8px;
    background: #f7f9fb;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.devGrid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
}

#sessionCoachBox {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 8px;
}

#sessionCoachBox {
    width: 100%;
    max-width: 340px;
    margin: 20px auto;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

#sessionCoachTitle {
    font-size: 18px;
    font-weight: 700; /* bold */
    color: #222;
    margin-bottom: 8px;
}

#sessionCoachText {
    font-size: 15px;
    color: #bbb;
}

/* ===
============== STOP ================= */
#stopSessionBtn {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border-radius: 50px;
    border: none;
    background: #e53935;
    color: white;
}

.histBox canvas {
    width: 100% !important;
    height: 180px !important;
}

.waveBox,
.histBox {
    height: 180px;
}
/* ================= WAVE ================= */
.waveRow {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.waveBox canvas {
    width: 100% !important;
    height: 180px !important;
}
/* ================= HIST ================= */
.histRow {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.histBox {
    height: 150px;
}
