/* ==========================================================================
   GuitarCraft — Modern Guitarist Toolkit Styles
   Color Palette: Deep Obsidian, Aged Wood, Electric Amber & Gold Accents
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #0d0f12;
    --bg-surface: #14171d;
    --bg-card: #1a1e26;
    --bg-card-hover: #212631;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(245, 158, 11, 0.35);

    /* Amber / Gold / Flame Accents */
    --accent-amber: #f59e0b;
    --accent-gold: #fbbf24;
    --accent-orange: #f97316;
    --accent-glow: rgba(245, 158, 11, 0.4);
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --danger-red: #ef4444;

    /* Text Colors */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Wood & Guitar Fretboard Colors */
    --fretboard-wood: #1e1915;
    --fretboard-wood-dark: #14110e;
    --fret-wire: #cbd5e1;
    --fret-wire-shadow: #64748b;
    --fret-inlay: #e2e8f0;
    --nut-color: #f5f5f4;

    /* Typography & Spacing */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

/* Base Resets */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Accessibility: Hidden labels for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Common Layout */
.app-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header */
.app-header {
    background: rgba(20, 23, 29, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 12px var(--accent-glow));
}

.brand-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 40%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--accent-amber);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    display: block;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 16px;
}

.audio-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

.btn-help {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-help:hover {
    border-color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.08);
    transform: translateY(-1px);
}

/* Main Content Grid */
.app-main {
    flex: 1;
    padding: 30px 0 50px;
}

.toolkit-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 26px;
}

/* Card Styling */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
    border-color: rgba(245, 158, 11, 0.25);
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(245, 158, 11, 0.08);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.015);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.card-icon {
    font-size: 1.6rem;
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Generic Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-amber), var(--accent-orange));
    color: #111;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Select inputs */
.select-input {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
}

.select-input:focus {
    border-color: var(--accent-amber);
}

/* ==========================================================================
   1. GUITAR TUNER MODULE
   ========================================================================== */
.tuner-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* Toggle Control */
.toggle-control {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.toggle-control input {
    display: none;
}

.toggle-slider {
    width: 38px;
    height: 20px;
    background: #2b303c;
    border-radius: 20px;
    position: relative;
    transition: background-color 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-control input:checked + .toggle-slider {
    background: var(--accent-amber);
}

.toggle-control input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* Wave Visualizer Canvas */
.wave-visualizer-wrap {
    position: relative;
    background: #0d1015;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#tunerWaveCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.tuner-freq-display {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.freq-note {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-gold);
    line-height: 1.1;
    text-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.freq-hz {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* Strings Tuning Pegs Grid */
.strings-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.string-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.string-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-amber);
    transform: translateY(-2px);
}

.string-btn.active {
    background: rgba(245, 158, 11, 0.12);
    border-color: var(--accent-amber);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.25) inset, 0 0 12px rgba(245, 158, 11, 0.3);
}

.string-order {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.string-note {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.string-btn.active .string-note {
    color: var(--accent-gold);
}

.string-hz {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* Realistic String Wire under button */
.string-wire {
    width: 80%;
    margin-top: 6px;
    background: linear-gradient(90deg, #94a3b8, #cbd5e1, #94a3b8);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    transition: all 0.1s ease;
}

.wire-6 { height: 5px; }
.wire-5 { height: 4px; }
.wire-4 { height: 3.2px; }
.wire-3 { height: 2.5px; }
.wire-2 { height: 2px; }
.wire-1 { height: 1.5px; }

.string-btn.active .string-wire {
    background: linear-gradient(90deg, var(--accent-amber), #fff, var(--accent-amber));
    animation: wireVibrate 0.08s infinite alternate;
}

@keyframes wireVibrate {
    0% { transform: scaleY(0.7) translateY(-1px); }
    100% { transform: scaleY(1.3) translateY(1px); }
}

.tuner-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================================================
   2. METRONOME MODULE
   ========================================================================== */
.metronome-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Beat LED Indicators */
.beat-indicators {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.beat-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #232834;
    border: 2px solid rgba(255, 255, 255, 0.08);
    transition: all 0.08s ease;
}

.beat-dot.active-first {
    background: var(--accent-amber);
    border-color: #fff;
    box-shadow: 0 0 16px var(--accent-gold), 0 0 24px rgba(245, 158, 11, 0.8);
    transform: scale(1.25);
}

.beat-dot.active-sub {
    background: var(--accent-cyan);
    border-color: #fff;
    box-shadow: 0 0 14px var(--accent-cyan), 0 0 20px rgba(6, 182, 212, 0.7);
    transform: scale(1.18);
}

/* BPM Display Box */
.bpm-display-box {
    text-align: center;
    position: relative;
    user-select: none;
}

.bpm-number {
    font-size: 4.8rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.bpm-unit {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent-amber);
}

.bpm-tempo-name {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 4px;
}

/* Custom Range Slider */
.slider-control-group {
    width: 100%;
    max-width: 440px;
}

.custom-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    background: #232834;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    cursor: grab;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
    transition: transform 0.1s, box-shadow 0.1s;
}

.custom-range::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.2);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.8);
}

/* Tempo Step & Tap Buttons */
.tempo-buttons-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.btn-step, .btn-tap {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-step:hover {
    border-color: var(--accent-amber);
    background: var(--bg-card-hover);
}

.btn-tap {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--accent-amber);
    color: var(--accent-gold);
    min-width: 60px;
}

.btn-tap:active {
    background: var(--accent-amber);
    color: #000;
    transform: scale(0.94);
}

.metronome-action-bar {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 4px;
}

.btn-metro-play {
    background: linear-gradient(135deg, var(--accent-amber), var(--accent-orange));
    color: #0d0f12;
    border: none;
    border-radius: 40px;
    padding: 14px 44px;
    font-size: 1.15rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
    transition: all 0.2s ease;
}

.btn-metro-play:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.45);
}

.btn-metro-play.playing {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

/* ==========================================================================
   3. FRETBOARD & CHORD FINDER MODULE
   ========================================================================== */
.fretboard-card {
    grid-column: span 2;
}

.chord-controls-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-strum {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--accent-amber);
    color: var(--accent-gold);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-strum:hover {
    background: var(--accent-amber);
    color: #0d0f12;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.fretboard-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Quick Chords Bar */
.quick-chords-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chord-pill {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chord-pill:hover {
    border-color: var(--accent-amber);
    background: var(--bg-card-hover);
}

.chord-pill.active {
    background: var(--accent-amber);
    border-color: var(--accent-amber);
    color: #111;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

/* Chord Info Banner */
.chord-info-banner {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.chord-badge {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-gold);
}

.chord-formula {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.fret-mode-toggles {
    display: flex;
    gap: 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* Fretboard Graphical Neck */
.fretboard-wrapper {
    background: #090a0f;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px 16px 16px;
    overflow-x: auto;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.fretboard-neck {
    display: flex;
    min-width: 680px;
    height: 240px;
    background: linear-gradient(180deg, var(--fretboard-wood-dark) 0%, var(--fretboard-wood) 50%, var(--fretboard-wood-dark) 100%);
    border-radius: var(--radius-sm);
    position: relative;
    border: 2px solid #332a22;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}

/* Fret Column */
.fret-column {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 3px solid var(--fret-wire);
    box-shadow: 2px 0 4px var(--fret-wire-shadow);
}

.fret-column.fret-0 {
    flex: 0 0 75px;
    background: rgba(0, 0, 0, 0.3);
    border-right: 6px solid var(--nut-color);
    box-shadow: 3px 0 6px rgba(0, 0, 0, 0.7);
}

.fret-num {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* Inlay Pearl Marker Dot */
.inlay-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff, #cbd5e1);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
    pointer-events: none;
    z-index: 1;
}

/* String Slots container inside fret column */
.string-slots {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 10px 0;
    position: relative;
    z-index: 2;
}

.string-cell {
    position: relative;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Continuous Horizontal String Lines across the fretboard */
.fretboard-neck::before,
.fretboard-neck::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 2;
}

/* Finger Marker Dots on Fretboard */
.marker {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #111;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-amber));
    border: 2px solid #fff;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.8), 0 2px 6px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 5;
    animation: markerPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes markerPop {
    0% { transform: scale(0.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.marker.root-note {
    background: linear-gradient(135deg, #fb7185, #e11d48);
    color: #fff;
    border-color: #fff;
    box-shadow: 0 0 14px rgba(225, 29, 72, 0.8);
}

/* Nut Markers (Open 'O' or Mute 'X') */
.nut-marker {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    font-weight: 800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nut-marker.open {
    background: transparent;
    border: 2px solid var(--accent-emerald);
    color: var(--accent-emerald);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.nut-marker.mute {
    background: transparent;
    border: 2px solid var(--danger-red);
    color: var(--danger-red);
}

/* String lines drawn inside fret cells */
.string-cell::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    background: linear-gradient(90deg, #94a3b8, #e2e8f0, #94a3b8);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

.string-cell[data-s="6"]::before { height: 4.5px; }
.string-cell[data-s="5"]::before { height: 3.8px; }
.string-cell[data-s="4"]::before { height: 3.0px; }
.string-cell[data-s="3"]::before { height: 2.3px; }
.string-cell[data-s="2"]::before { height: 1.8px; }
.string-cell[data-s="1"]::before { height: 1.3px; }

/* Fretboard Legend */
.fret-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 0 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
}

.legend-badge.open {
    border: 1px solid var(--accent-emerald);
    color: var(--accent-emerald);
}

.legend-badge.mute {
    border: 1px solid var(--danger-red);
    color: var(--danger-red);
}

.legend-badge.dot {
    background: var(--accent-amber);
    color: #111;
}

/* ==========================================================================
   4. QUICK TAB SCRATCHPAD MODULE
   ========================================================================== */
.scratchpad-card {
    grid-column: span 2;
}

.scratchpad-status {
    font-size: 0.8rem;
    color: var(--accent-emerald);
    font-family: var(--font-mono);
}

.scratchpad-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tab-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-tool {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-tool:hover {
    border-color: var(--accent-amber);
    background: var(--bg-card-hover);
}

.btn-save {
    margin-left: auto;
    background: var(--accent-amber);
    color: #111;
    font-size: 0.82rem;
    padding: 6px 14px;
}

.btn-save:hover {
    background: var(--accent-gold);
}

.editor-wrapper {
    background: #090a0f;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.tab-textarea {
    width: 100%;
    min-height: 220px;
    background: transparent;
    color: #38bdf8;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.45;
    padding: 16px;
    border: none;
    outline: none;
    resize: vertical;
    white-space: pre;
    overflow-x: auto;
}

.tab-textarea::selection {
    background: rgba(245, 158, 11, 0.35);
    color: #fff;
}

/* ==========================================================================
   MODAL & FOOTER
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    transform: translateY(10px);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-head {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-head h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
}

.modal-close-btn:hover {
    color: #fff;
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.shortcut-row:last-child {
    border-bottom: none;
}

kbd {
    background: #232834;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 3px 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-gold);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

/* Footer */
.app-footer {
    border-top: 1px solid var(--border-color);
    background: rgba(13, 15, 18, 0.8);
    padding: 24px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-inner {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-note {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLETS & MOBILE)
   ========================================================================== */
@media (max-width: 1024px) {
    .toolkit-grid {
        grid-template-columns: 1fr;
    }
    .fretboard-card,
    .scratchpad-card {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .header-tools {
        width: 100%;
        justify-content: space-between;
    }
    .strings-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .bpm-number {
        font-size: 3.8rem;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .chord-controls-top {
        width: 100%;
        justify-content: space-between;
    }
    .tab-toolbar {
        gap: 6px;
    }
    .btn-tool, .btn-save {
        flex: 1 1 calc(50% - 6px);
        text-align: center;
    }
}
