* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #a1e5f8;
    /* Light Sky Blue */
    --card: #ffffff;
    /* Pure White */
    --text: #01096b;
    /* Deep Indigo */
    --muted: #08880c;
    /* Medium Green */
    --coral: #2196F3;
    /* Vibrant Blue */
    --teal: #6ab515;
    /* Lime Green */
    --gold: #b89d00;
    /* Bright Gold */
    --panel: #BBDEFB;
    /* Light Blue */
    --track: #c7e8ff;
    /* Very Light Blue */
    --border: #72a7d2;
    /* Soft Blue */
}

body {
    font-family: "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 32px 16px;
}

.container {
    background: var(--card);
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    width: 100%;
    border: 1px solid var(--border);
    position: relative;
}

h1 {
    font-size: 1.7em;
    color: var(--coral);
    margin-bottom: 4px;
}

.subtitle {
    color: var(--muted);
    margin-bottom: 20px;
    font-size: 0.95em;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.85em;
    color: var(--muted);
    margin-bottom: 20px;
}

.settings-row label {
    font-weight: 600;
    color: var(--text);
}

.settings-row input {
    width: 60px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    background: var(--panel);
    color: var(--text);
    font: inherit;
}

.button-group {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.btn {
    flex: 1;
    padding: 13px;
    border: none;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
}

.btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.btn-primary {
    background: var(--coral);
    color: #fff;
}

.btn-secondary {
    background: var(--teal);
    color: #fff;
}

.btn-inline {
    flex: none;
    padding: 8px 16px;
}

.sample-row {
    text-align: center;
    margin-bottom: 18px;
}

.sample-label {
    display: block;
    color: var(--muted);
    font-size: 0.82em;
    margin-bottom: 8px;
}

.sample-buttons {
    display: flex;
    gap: 10px;
}

.sample-buttons {
    display: flex;
    gap: 10px;
}

.sample-buttons .btn {
    font-size: 0.85em;
    padding: 10px;
}

.status {
    text-align: center;
    color: var(--muted);
    min-height: 20px;
    margin-bottom: 16px;
}

.status.error {
    color: var(--coral);
    font-weight: 600;
}

.meter {
    width: 100%;
    height: 8px;
    background: var(--track);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.meter-fill {
    height: 100%;
    background: var(--teal);
    width: 0%;
    transition: width 0.1s;
}


.tuner-reading {
    text-align: center;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 18px;
    font-variant-numeric: tabular-nums;
}

.display-box {
    background: var(--panel);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 18px;

}

.result-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.lock-badge {
    background: var(--coral);
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72em;
    font-weight: 700;
    visibility: hidden;
}

.lock-badge.on {
    visibility: visible;
}

.chip-btn {
    background: none;
    border: 1px solid var(--muted);
    color: var(--muted);
    padding: 4px 12px;
    border-radius: 20px;
    font: inherit;
    font-size: 0.75em;
    font-weight: 600;
    cursor: pointer;
}

.chip-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.note-display {
    text-align: center;
    font-size: 3em;
    font-weight: 700;
    color: var(--coral);
    margin-bottom: 6px;
}

.scale-display {
    text-align: center;
    font-size: 1.15em;
    color: var(--teal);
    font-weight: 600;
    margin-bottom: 4px;
}

.sargam-display {
    text-align: center;
    color: var(--muted);
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--track);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gold);
    transition: width 0.2s ease;
}

.confidence {
    text-align: center;
    color: var(--muted);
    font-size: 0.85em;
    font-weight: 600;
}

canvas {
    width: 100%;
    height: 130px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel);
    margin-bottom: 18px;
}

.info-box {
    color: var(--muted);
    font-size: 0.85em;
    text-align: center;
    margin-bottom: 20px;
}

.drone-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.drone-controls .btn {
    flex: 1 1 45%;
    min-width: 130px;
    font-size: 0.88em;
}

.note-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

.pill {
    background: var(--coral);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85em;
    text-align: center;
}

.pill-swara {
    display: block;
    font-size: 0.7em;
    opacity: 0.85;
    font-weight: 400;
}

.util-card {
    background: var(--panel);
    border-radius: 14px;
    padding: 18px;
    margin-top: 16px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card-title {
    font-weight: 700;
    color: var(--teal);
    margin-bottom: 10px;
    display: block;
}

.metro-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.metro-row input {
    width: 56px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    background: var(--card);
    color: var(--text);
    font: inherit;
}

.bpm-label {
    color: var(--muted);
    font-size: 0.85em;
    font-weight: 600;
}

.metro-beats {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
}

.beat-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--muted);
    transition: transform 0.08s ease, background 0.08s ease
}

.beat-dot.sam {
    border-color: var(--coral);
}

.beat-dot.now {
    background: var(--gold);
    border-color: var(--gold);
    transform: scale(1.3);


}

.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
}

.history-note {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--coral);
    min-width: 32px;
}

.history-detail {
    flex: 1;
    font-size: 0.85em;
}

.history-time {
    color: var(--muted);
    font-size: 0.72em;
    white-space: nowrap;
}