/* ============ Tra cứu độc lập ============ */
.cf-app {
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #2c3e50;
}

.cf-header { margin-bottom: 20px; }
.cf-title { font-size: 24px; font-weight: 700; color: #0088ff; }
.cf-desc { font-size: 15px; color: #64748b; line-height: 1.6; margin: 6px 0 0; }
.cf-tabs { display: flex; background: #e2e8f0; padding: 4px; border-radius: 8px; }
.cf-tab { padding: 8px 16px; border: none; background: transparent; font-weight: 600; cursor: pointer; border-radius: 6px; }
.cf-tab.active { background: #fff; color: #0088ff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

.cf-selector { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.cf-selector select { height: auto; padding: 10px 14px; border-radius: 8px; border: 1px solid #cbd5e1; font-size: 16px; line-height: 1.2; outline: none; width: 100%; box-sizing: border-box; }

.cf-name { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.cf-info { margin-bottom: 16px; font-size: 14px; color: #555; line-height: 1.7; }
.cf-info .cf-row { margin: 2px 0; }
.cf-info .cf-label { font-weight: 600; color: #94a3b8; }
.cf-info .cf-val { color: #0088ff; font-weight: 600; }

.cf-main {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.cf-left {
    flex: 1 1 400px;
    min-width: 0;
    margin-top: 60px;
}
.cf-piano-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 10px 0;
    margin-top: 16px;
}
.cf-piano { width: 100%; max-width: 860px; height: auto; display: block; margin: 0 auto; }
.cf-guitar-wrapper {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    padding: 10px 0;
    margin-top: -50px;
}
.cf-guitar { width: 100%; max-width: 280px; height: auto; }
@media (max-width: 768px) {
    .cf-guitar-wrapper { margin-top: 0; }
}

/* Bài viết về hòa âm (cuối trang tra cứu) */
.cf-article {
    max-width: 1000px;
    margin: 32px auto 0;
    padding: 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    color: #2c3e50;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.8;
}
.cf-article h2 {
    font-size: 24px;
    font-weight: 800;
    color: #0088ff;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}
.cf-article h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 24px 0 10px;
}
.cf-article p {
    font-size: 15px;
    color: #334155;
    margin: 0 0 14px;
}
.cf-article ul {
    margin: 0 0 16px;
    padding-left: 22px;
}
.cf-article ul li {
    font-size: 15px;
    color: #334155;
    margin: 6px 0;
}
.cf-article strong { color: #1e293b; }
.cf-article em { color: #475569; }

/* phím đàn */
.cf-key-white { fill: #fff; stroke: #333; stroke-width: 1.5; cursor: pointer; }
.cf-key-black { fill: #2b2b2b; stroke: #0a0a0a; stroke-width: 2; cursor: pointer; }
.cf-key-white:hover { fill: #f1f5f9; }
.cf-key-black:hover { fill: #404040; }
.cf-key-chord { fill: #f97316 !important; }
.cf-key-chord:hover { fill: #ea580c !important; }
.cf-key-bass { fill: #dc2626 !important; }
.cf-key-bass:hover { fill: #b91c1c !important; }
.cf-key-optional { fill: #f97316 !important; opacity: 0.5; }
.cf-key-underlay { fill: #fff; stroke: none; pointer-events: none; }
.cf-label-key-text { font-size: 11px; font-weight: bold; fill: #7c2d12; }
.cf-label-text { font-size: 11px; font-weight: bold; fill: #9a3412; }
.cf-label-line { stroke: #9a3412; stroke-width: 1.2; }

/* guitar */
.cf-fretboard-bg { fill: url(#cfWoodGrad); stroke: #1d0f06; stroke-width: 2; rx: 8; }
.cf-fret-wire { stroke: #d8c8a8; stroke-width: 3; }
.cf-string-label { font-size: 14px; font-weight: bold; fill: #64748b; text-anchor: middle; }
.cf-finger-circle { fill: #ff6b6b; stroke: #fff; stroke-width: 2.5; }
.cf-finger-text { fill: #fff; font-size: 14px; font-weight: bold; text-anchor: middle; dominant-baseline: central; }

/* ============ Tự động hiện thế bấm trong bài ============ */
.cf-auto {
    margin: 20px 0;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.cf-auto-title {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
}
.cf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}
.cf-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.cf-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}
.cf-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #0088ff;
    margin-bottom: 6px;
}
.cf-card .cf-mini-piano {
    width: 100%;
    max-width: 150px;
    height: auto;
    display: block;
    margin: 8px auto 0;
}
.cf-card .cf-mini-guitar {
    width: 100%;
    max-width: 140px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Modal phóng to hợp âm */
.cf-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}
.cf-modal {
    background: #fff;
    border-radius: 14px;
    padding: 28px 24px 24px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.cf-modal-close {
    position: absolute;
    top: 6px; right: 12px;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #94a3b8;
    border: none;
    background: none;
    padding: 4px 8px;
}
.cf-modal-close:hover { color: #334155; }
.cf-modal-name {
    font-size: 36px;
    font-weight: 800;
    color: #0088ff;
    margin-bottom: 14px;
}
.cf-modal-guitar {
    width: 100%;
    max-width: 210px;
    height: auto;
    display: block;
    margin: 0 auto;
}
.cf-modal-piano {
    width: 100%;
    max-width: 340px;
    height: auto;
    display: block;
    margin: 18px auto 0;
}
