/* Site95 Virtual Piano — Self-hosted responsive styles (no Tailwind CDN) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

html { scroll-behavior: smooth;
    overflow-x: clip;
    max-width: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
    max-width: 100%;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

.hidden { display: none !important; }

/* ── Layout ── */

.container {
    width: 100%;
    min-width: 0;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.container-sm {
    width: 100%;
    max-width: 48rem;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.page-main { padding: 2.5rem 0 3rem; }

.section { padding: 4rem 0; }
.section-white { background: #fff; }
.section-head { text-align: center; margin-bottom: 3rem; }
.section-label {
    color: #7c3aed;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.section-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    margin: 0.5rem 0 1rem;
    color: #0f172a;
}
.section-desc {
    color: #64748b;
    max-width: 36rem;
    margin: 0 auto;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .site-nav { display: flex !important; }
    .menu-toggle { display: none !important; }
}

/* ── Header ── */

.site-header {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    max-width: 72rem;
    margin: 0 auto;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0;
    line-height: 0;
    flex-shrink: 0;
}

.site-logo-img {
    display: block;
    height: 3.5rem;
    width: auto;
    max-width: min(16rem, 64vw);
}

@media (max-width: 640px) {
    .site-logo-img {
        height: 3rem;
        max-width: min(14rem, 70vw);
    }
}

.logo-icon {
    width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
}

.site-nav {
    display: none;
    align-items: center;
    gap: 1.75rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.site-nav a { color: #475569; transition: color 0.2s; }
.site-nav a:hover { color: #7c3aed; }

.menu-toggle {
    color: #64748b;
    font-size: 1.25rem;
    padding: 0.25rem;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem 1rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.9rem;
    background: #fff;
}

.mobile-menu.is-open { display: flex; }
.mobile-menu a { color: #475569; padding: 0.25rem 0; }
.mobile-menu a:hover { color: #7c3aed; }

/* ── Footer ── */

.site-footer {
    background: #1e293b;
    color: #94a3b8;
    margin-top: 4rem;
    padding: 2.5rem 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-grid h3 {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
}

.footer-grid ul li { margin-bottom: 0.5rem; }
.footer-grid a { font-size: 0.875rem; transition: color 0.2s; }
.footer-grid a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    border-radius: 9999px;
    padding: 0.85rem 2rem;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.btn-red { background: #dc2626; color: #fff; }
.btn-red:hover { background: #b91c1c; }

.btn-blue { background: #2563eb; color: #fff; }
.btn-blue:hover { background: #1d4ed8; }

.btn-green { background: #16a34a; color: #fff; }
.btn-green:hover { background: #15803d; }

.btn-white { background: #fff; color: #6d28d9; box-shadow: 0 4px 14px rgba(0,0,0,0.15); }
.btn-white:hover { background: #f0fdfa; }

.btn-outline {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}
.btn-outline:hover { background: rgba(255,255,255,0.22); }

.btn-outline-green {
    background: rgba(74, 222, 128, 0.15);
    color: #fff;
    border: 2px solid rgba(74, 222, 128, 0.45);
}
.btn-outline-green:hover { background: rgba(74, 222, 128, 0.28); }

.btn-lg { padding: 1rem 2.5rem; font-size: 1.05rem; font-weight: 700; }
.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.875rem; }

.btn-neutral {
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.btn-neutral:hover { background: #f8fafc; border-color: #cbd5e1; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn-link {
    color: #64748b;
    font-size: 0.875rem;
    text-decoration: underline;
    background: none;
    padding: 0.5rem;
}
.btn-link:hover { color: #334155; }

.text-center { text-align: center; }

/* ── Hero (Homepage) ── */

.hero-section {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #4c1d95 45%, #6d28d9 100%);
    color: #fff;
}

.hero-grid {
    position: absolute;
    inset: 0;
    opacity: 0.3;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}

.hero-glow-1 { width: 400px; height: 400px; background: rgba(20,184,166,0.3); top: -100px; right: -50px; }
.hero-glow-2 { width: 300px; height: 300px; background: rgba(13,148,136,0.25); bottom: 0; left: -80px; }

.hero-inner {
    position: relative;
    padding: 4rem 1.25rem 6rem;
    max-width: 48rem;
    margin: 0 auto;
    text-align: center;
}

@media (min-width: 768px) {
    .hero-inner { padding: 5.5rem 1.25rem 7rem; }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fecaca;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    margin-bottom: 1.5rem;
}

.hero-badge i { color: #4ade80; }

.hero-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.hero-gradient-text {
    background: linear-gradient(90deg, #fca5a5, #fef08a, #fca5a5);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
    to { background-position: 200% center; }
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: rgba(254, 226, 226, 0.9);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.hero-actions .btn { width: 100%; max-width: 280px; }

@media (min-width: 768px) {
    .hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    .hero-actions .btn { width: auto; min-width: 200px; }
}

.hero-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    font-size: 0.875rem;
    color: rgba(254, 202, 202, 0.85);
}

.hero-trust span { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero-trust i { color: #4ade80; }

.hero-wave { line-height: 0; margin-bottom: -1px; }
.hero-wave svg { width: 100%; height: 3rem; display: block; }

@media (min-width: 768px) {
    .hero-wave svg { height: 5rem; }
}

/* ── Tool Cards ── */

.tool-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: #fff;
    border-radius: 1.25rem;
    padding: 2rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
    text-decoration: none;
}

.tool-card-red:hover  { border-color: #fecaca; }
.tool-card-blue:hover { border-color: #bfdbfe; }
.tool-card-green:hover { border-color: #bbf7d0; }

.tool-card-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: transform 0.25s;
}

.tool-card:hover .tool-card-icon { transform: scale(1.08); }

.tool-card-red .tool-card-icon  { background: #fef2f2; color: #dc2626; }
.tool-card-blue .tool-card-icon { background: #eff6ff; color: #2563eb; }
.tool-card-green .tool-card-icon { background: #f0fdf4; color: #16a34a; }

.tool-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; color: #0f172a; }
.tool-card-red:hover h3  { color: #dc2626; }
.tool-card-blue:hover h3 { color: #2563eb; }
.tool-card-green:hover h3 { color: #16a34a; }

.tool-card p { color: #64748b; font-size: 0.9rem; line-height: 1.6; }

.tool-card-link {
    display: inline-flex;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
}

.tool-card-red:hover .tool-card-link  { color: #dc2626; }
.tool-card-blue:hover .tool-card-link { color: #2563eb; }
.tool-card-green:hover .tool-card-link { color: #16a34a; }

/* ── How It Works ── */

.how-step { text-align: center; }

.how-step-number {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    font-weight: 800;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 14px rgba(220,38,38,0.35);
}

.how-step h3 { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; }
.how-step p { color: #64748b; font-size: 0.9rem; }

/* ── Feature Cards ── */

.feature-card {
    background: #fff;
    border-radius: 1.25rem;
    padding: 2rem;
    border: 1px solid #e2e8f0;
    text-align: center;
    transition: box-shadow 0.25s;
}

.feature-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.07); }

.feature-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin: 0 auto 1rem;
}

.feature-icon-green  { background: #f0fdf4; color: #16a34a; }
.feature-icon-yellow { background: #fefce8; color: #ca8a04; }
.feature-icon-blue   { background: #eff6ff; color: #2563eb; }

.feature-card h3 { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature-card p { color: #64748b; font-size: 0.9rem; line-height: 1.6; }

/* ── CTA Banner ── */

.cta-banner {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    text-align: center;
    color: #fff;
}

@media (min-width: 768px) {
    .cta-banner { padding: 3.5rem 4rem; }
}

.cta-banner-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 50%, #7f1d1d 100%);
}

.cta-banner-content { position: relative; }
.cta-banner h2 { font-size: clamp(1.5rem, 3vw, 1.85rem); font-weight: 800; margin-bottom: 0.75rem; }
.cta-banner p { color: #fecaca; margin-bottom: 2rem; max-width: 32rem; margin-left: auto; margin-right: auto; }

.cta-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 640px) {
    .cta-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ── Tool Pages ── */

.tool-page-title {
    font-size: clamp(1.75rem, 4vw, 2rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.tool-page-desc {
    text-align: center;
    color: #64748b;
    margin-bottom: 2rem;
}

.drop-zone {
    border: 3px dashed;
    border-radius: 1.25rem;
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 1.5rem;
}

.drop-zone-red  { border-color: #fca5a5; }
.drop-zone-red:hover, .drop-zone-red.drop-zone-active  { border-color: #dc2626; background: #fef2f2; }

.drop-zone-blue { border-color: #93c5fd; }
.drop-zone-blue:hover, .drop-zone-blue.drop-zone-active { border-color: #2563eb; background: #eff6ff; }

.drop-zone-green { border-color: #86efac; }
.drop-zone-green:hover, .drop-zone-green.drop-zone-active { border-color: #16a34a; background: #f0fdf4; }

.drop-zone-icon { font-size: 3rem; margin-bottom: 1rem; display: block; }
.drop-zone-red .drop-zone-icon  { color: #f87171; }
.drop-zone-blue .drop-zone-icon { color: #60a5fa; }
.drop-zone-green .drop-zone-icon { color: #4ade80; }

.drop-zone h2 { font-size: 1.15rem; font-weight: 600; color: #334155; margin-bottom: 0.25rem; }
.drop-zone .or-text { color: #94a3b8; margin: 0.5rem 0; }
.drop-zone .privacy-note { font-size: 0.85rem; color: #94a3b8; margin-top: 1rem; }
.drop-zone .privacy-note i { margin-right: 0.25rem; }

.file-input-hidden { display: none; }

.file-info-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.file-info-bar i.file-icon-red  { color: #dc2626; font-size: 1.5rem; }
.file-info-bar i.file-icon-blue { color: #2563eb; font-size: 1.5rem; }
.file-info-bar i.file-icon-green { color: #16a34a; font-size: 1.5rem; }

.file-info-bar .file-meta { flex: 1; min-width: 0; }
.file-info-bar .file-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info-bar .file-size { font-size: 0.85rem; color: #94a3b8; }

.file-list { margin-bottom: 1.5rem; }
.file-list h3 { font-weight: 600; color: #475569; margin-bottom: 0.75rem; }
.file-list ul { display: flex; flex-direction: column; gap: 0.5rem; }

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.file-item.is-dragging { opacity: 0.5; }
.file-item .grip { color: #cbd5e1; cursor: grab; }
.file-item .name { flex: 1; font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .size { font-size: 0.8rem; color: #94a3b8; }
.remove-btn { color: #94a3b8; padding: 0.25rem; cursor: pointer; }
.remove-btn:hover { color: #dc2626; }

.options-panel {
    background: #fff;
    border-radius: 0.85rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
}

.options-panel h3 { font-weight: 600; color: #475569; margin-bottom: 1rem; }

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    cursor: pointer;
}

.radio-option input { margin-top: 0.2rem; }
.radio-option .label-title { font-weight: 500; display: block; }
.radio-option .label-desc { font-size: 0.85rem; color: #64748b; }

.text-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    margin-top: 0.5rem;
}

.text-input:focus { outline: none; border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,0.15); }

.text-input-sm { width: 8rem; }

.progress-wrap { margin-bottom: 1.5rem; }
.progress-track { background: #e2e8f0; border-radius: 9999px; height: 0.65rem; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 9999px; transition: width 0.3s; }
.progress-fill-red   { background: #dc2626; }
.progress-fill-blue  { background: #2563eb; }
.progress-fill-green { background: #16a34a; }
.progress-text { text-align: center; color: #64748b; font-size: 0.9rem; margin-top: 0.5rem; }

.result-panel {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 1.25rem;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.result-panel i.result-icon { font-size: 3rem; color: #22c55e; margin-bottom: 1rem; display: block; }
.result-panel h3 { font-size: 1.2rem; font-weight: 700; color: #15803d; margin-bottom: 0.5rem; }
.result-panel p { color: #475569; margin-bottom: 1.25rem; }

.info-card {
    background: #fff;
    border-radius: 0.85rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    text-align: center;
}

.info-card .step-num {
    width: 2.5rem;
    height: 2.5rem;
    background: #dc2626;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 0.75rem;
}

.info-card h3 { font-weight: 700; margin-bottom: 0.5rem; }
.info-card p { color: #64748b; font-size: 0.9rem; }

.info-card-blue .step-num { background: #2563eb; }
.info-card-green .step-num { background: #16a34a; }

/* ── FAQ ── */

.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }

details.faq-item {
    background: #fff;
    border-radius: 0.85rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    cursor: pointer;
}

details.faq-item summary {
    font-weight: 600;
    list-style: none;
    color: #1e293b;
}

details.faq-item summary::-webkit-details-marker { display: none; }

details.faq-item summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    float: right;
    color: #94a3b8;
    transition: transform 0.2s;
}

details.faq-item[open] summary::after { transform: rotate(180deg); }
details.faq-item p { color: #64748b; font-size: 0.9rem; margin-top: 0.75rem; line-height: 1.6; }

/* ── Content Pages ── */

.content-card {
    background: #fff;
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    line-height: 1.75;
    color: #475569;
}

.content-card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 1.5rem 0 0.75rem;
}

.content-card h2:first-child { margin-top: 0; }

.content-card p { margin-bottom: 1rem; }
.content-card ul { list-style: disc; padding-left: 1.5rem; margin: 0.5rem 0 1rem; }
.content-card ul li { margin-bottom: 0.35rem; }
.content-card a { color: #dc2626; }
.content-card a:hover { text-decoration: underline; }

.form-card {
    background: #fff;
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 500; color: #475569; margin-bottom: 0.35rem; }

.form-input, .form-textarea {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.12);
}

.form-textarea { resize: vertical; min-height: 8rem; }

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 1.25rem;
    padding: 2rem;
    text-align: center;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.85rem;
    padding: 1rem;
    color: #b91c1c;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.page-subtitle { text-align: center; color: #64748b; margin-bottom: 2rem; }

.tool-section { margin-top: 3.5rem; }
.tool-section h2 { font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: 2rem; }

.border-section { border-top: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; }

.ads-slot { margin: 1.25rem 0; text-align: center; }

/* ── SEO: Breadcrumbs ── */

.breadcrumbs {
    padding: 1rem 1.25rem 0;
    max-width: 48rem;
    margin: 0 auto;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    font-size: 0.85rem;
    color: #64748b;
}

.breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin-left: 0.35rem;
    color: #cbd5e1;
}

.breadcrumbs a { color: #64748b; }
.breadcrumbs a:hover { color: #7c3aed; }
.breadcrumbs [aria-current="page"] { color: #334155; font-weight: 500; }

/* ── SEO: Content blocks ── */

.seo-intro {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.7;
}

.seo-content {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.seo-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
}

.seo-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 1.25rem 0 0.5rem;
}

.seo-content p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.seo-content a { color: #7c3aed; }
.seo-content a:hover { text-decoration: underline; }

.site-footer a { color: #94a3b8; }
.site-footer a:hover { color: #fff; }

/* ── Virtual Piano: teal theme ── */

.hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #4c1d95 40%, #312e81 100%);
}

.hero-gradient-text {
    background: linear-gradient(135deg, #c4b5fd, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-violet { background: #7c3aed; color: #fff; }
.btn-violet:hover { background: #6d28d9; }

.tool-card-teal .tool-card-icon { background: #f0fdfa; color: #7c3aed; }
.tool-card-teal:hover h3 { color: #7c3aed; }
.tool-card-teal:hover .tool-card-link { color: #7c3aed; }

.info-card-violet .step-num { background: #7c3aed; }

.cta-banner {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 50%, #4c1d95 100%);
}

.cta-banner p { color: #ddd6fe; }

/* ── Word Counter ── */

.counter-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.counter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.counter-textarea {
    width: 100%;
    min-height: 14rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.7;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.counter-textarea:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

.counter-textarea::placeholder { color: #94a3b8; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 4px 12px rgba(124,58,237,0.08);
}

.stat-card-featured {
    background: linear-gradient(135deg, #f0fdfa, #ede9fe);
    border-color: #c4b5fd;
}

.stat-value {
    display: block;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    color: #5b21b6;
    line-height: 1.2;
    margin-bottom: 0.35rem;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.privacy-note-inline {
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 0.5rem;
}

.privacy-note-inline i { margin-right: 0.35rem; color: #c4b5fd; }
/* ── Calculator UI ── */

.calc-stage {
    position: relative;
}

.calc-max-inner {
    width: 100%;
}

.calc-wrap {
    max-width: 22rem;
    margin: 0 auto 2rem;
    transition: max-width 0.2s ease;
}

.calculator {
    background: #0f172a;
    border-radius: 1.25rem;
    padding: 1.25rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}

.calc-display {
    background: #1e293b;
    border-radius: 0.75rem;
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
    text-align: right;
    min-height: 5.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.25rem;
    overflow: hidden;
}

.calc-expression {
    font-size: 0.9rem;
    color: #94a3b8;
    min-height: 1.25rem;
    word-break: break-all;
}

.calc-result {
    font-size: 2.25rem;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    word-break: break-all;
}

.calc-keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}

.calc-key {
    appearance: none;
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 0.5rem;
    font-size: 1.15rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s, opacity 0.15s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.calc-key:active { transform: scale(0.96); }
.calc-key:focus-visible {
    outline: 2px solid #c4b5fd;
    outline-offset: 2px;
}

.calc-key-num {
    background: #334155;
    color: #f8fafc;
}
.calc-key-num:hover { background: #475569; }

.calc-key-op {
    background: #7c3aed;
    color: #fff;
}
.calc-key-op:hover { background: #6d28d9; }

.calc-key-fn {
    background: #475569;
    color: #e2e8f0;
}
.calc-key-fn:hover { background: #64748b; }

.calc-key-eq {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
}
.calc-key-eq:hover { background: linear-gradient(135deg, #7c3aed, #6d28d9); }

.calc-key-zero {
    grid-column: span 2;
}

.calc-toolbar {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.calc-history {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1rem 1.15rem;
    margin-bottom: 2rem;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.calc-history h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.75rem;
}

.calc-history-list {
    list-style: none;
    max-height: 10rem;
    overflow-y: auto;
    font-size: 0.9rem;
    color: #475569;
}

.calc-history-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-variant-numeric: tabular-nums;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.calc-history-list li:last-child { border-bottom: none; }
.calc-history-list .hist-expr { color: #64748b; }
.calc-history-list .hist-val { font-weight: 600; color: #0f172a; }
.calc-history-empty { color: #94a3b8; font-size: 0.875rem; }

/* ── Maximized calculator (true full-viewport overlay) ── */

body.calc-is-maximized {
    overflow: hidden !important;
    touch-action: none;
}

/* Portal target: attached to <body> so header/page cannot cover it */
.calc-stage.is-maximized {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    z-index: 2147483000 !important;
    /* Solid background — avoids display blending into overlay + page bleed */
    background: #0b1220;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding:
        max(0.5rem, env(safe-area-inset-top, 0px))
        max(0.75rem, env(safe-area-inset-right, 0px))
        max(0.5rem, env(safe-area-inset-bottom, 0px))
        max(0.75rem, env(safe-area-inset-left, 0px));
    overflow: hidden;
    animation: calc-max-in 0.18s ease;
    box-sizing: border-box;
}

@keyframes calc-max-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.calc-stage.is-maximized .calc-max-inner {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.65rem;
    overflow: hidden;
}

.calc-stage.is-maximized .calc-toolbar {
    flex: 0 0 auto;
    margin-bottom: 0;
    gap: 0.5rem;
    z-index: 2;
}

.calc-stage.is-maximized .calc-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-width: none;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.calc-stage.is-maximized .calculator {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    padding: 0.85rem;
    border-radius: 1.15rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #111827;
    border: 1px solid #1f2937;
}

/* Display always visible — never shrink away */
.calc-stage.is-maximized .calc-display {
    flex: 0 0 auto;
    min-height: 4.75rem;
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    margin-bottom: 0;
    background: #020617;
    border: 1px solid #1e293b;
}

.calc-stage.is-maximized .calc-expression {
    font-size: clamp(0.85rem, 2.8vw, 1.1rem);
    min-height: 1.2rem;
    color: #94a3b8;
}

.calc-stage.is-maximized .calc-result {
    font-size: clamp(2rem, 9vw, 3.25rem);
    color: #f8fafc;
    line-height: 1.15;
}

/* Keys fill remaining space so whole pad fits on mobile */
.calc-stage.is-maximized .calc-keys {
    flex: 1 1 auto;
    min-height: 0;
    gap: 0.5rem;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, minmax(0, 1fr));
    align-content: stretch;
}

.calc-stage.is-maximized .calc-key {
    min-height: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    font-size: clamp(1.15rem, 4.5vmin, 1.75rem);
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calc-stage.is-maximized .calc-history {
    flex: 0 1 auto;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0.65rem 0.85rem;
    max-height: 5.5rem;
    background: #111827;
    border-color: #1f2937;
    color: #cbd5e1;
    overflow: hidden;
}

.calc-stage.is-maximized .calc-history h3 {
    color: #e2e8f0;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
}

.calc-stage.is-maximized .calc-history-list {
    max-height: 3.5rem;
    color: #cbd5e1;
    font-size: 0.8rem;
}

.calc-stage.is-maximized .calc-history-list li {
    border-bottom-color: #1f2937;
    padding: 0.25rem 0;
}

.calc-stage.is-maximized .calc-history-list .hist-expr { color: #94a3b8; }
.calc-stage.is-maximized .calc-history-list .hist-val { color: #f8fafc; }
.calc-stage.is-maximized .calc-history-empty { color: #64748b; }

.calc-stage.is-maximized .privacy-note-inline {
    flex: 0 0 auto;
    color: #64748b;
    margin: 0;
    font-size: 0.75rem;
    text-align: center;
}

.calc-stage.is-maximized .privacy-note-inline i {
    color: #c4b5fd;
}

.calc-stage.is-maximized #calc-maximize {
    background: #7c3aed;
    color: #fff;
    border-color: transparent;
}

.calc-stage.is-maximized #calc-maximize:hover {
    background: #6d28d9;
}

/* Short phones / landscape: prioritize display + keys */
@media (max-height: 640px) {
    .calc-stage.is-maximized .calc-history,
    .calc-stage.is-maximized .privacy-note-inline {
        display: none;
    }
    .calc-stage.is-maximized .calc-display {
        min-height: 3.75rem;
        padding: 0.55rem 0.75rem;
    }
    .calc-stage.is-maximized .calc-result {
        font-size: clamp(1.6rem, 7vw, 2.4rem);
    }
    .calc-stage.is-maximized .calculator {
        padding: 0.6rem;
        gap: 0.5rem;
    }
    .calc-stage.is-maximized .calc-keys {
        gap: 0.4rem;
    }
}

/* Narrow mobile width */
@media (max-width: 400px) {
    .calc-stage.is-maximized .calc-btn-text {
        display: none;
    }
    .calc-stage.is-maximized .calc-max-label {
        display: none;
    }
    .calc-stage.is-maximized .calc-toolbar .btn {
        padding: 0.5rem 0.75rem;
    }
}

/* Tablets / desktop large view */
@media (min-width: 640px) {
    .calc-stage.is-maximized .calc-max-inner {
        max-width: 26rem;
    }
    .calc-stage.is-maximized .calc-display {
        min-height: 6rem;
        padding: 1rem 1.25rem;
    }
    .calc-stage.is-maximized .calc-result {
        font-size: clamp(2.5rem, 5vw, 3.5rem);
    }
    .calc-stage.is-maximized .calculator {
        padding: 1.15rem;
    }
    .calc-stage.is-maximized .calc-keys {
        gap: 0.7rem;
    }
}

@media (min-width: 900px) and (min-height: 700px) {
    .calc-stage.is-maximized .calc-max-inner {
        max-width: 28rem;
    }
    .calc-stage.is-maximized .calc-history {
        max-height: 7rem;
    }
    .calc-stage.is-maximized .calc-history-list {
        max-height: 5rem;
    }
}


/* ── Virtual Piano widget + maximize + mobile ── */

.container-piano {
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Desktop: use nearly full viewport for more piano keys */
@media (min-width: 1024px) {
    .container-piano {
        max-width: min(96rem, 98vw);
        padding: 0 1.25rem;
    }
}

@media (min-width: 1400px) {
    .container-piano {
        max-width: min(100rem, 98vw);
    }
}

.piano-stage {
    position: relative;
    width: 100%;
}

.piano-max-inner {
    width: 100%;
}

.piano-widget {
    background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
    border-radius: 1.25rem;
    padding: 1.1rem 0.85rem 1.25rem;
    box-shadow: 0 20px 50px rgba(76, 29, 149, 0.35), 0 1px 3px rgba(0,0,0,0.2);
    color: #e2e8f0;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* Desktop: full-width keyboard, more keys */
@media (min-width: 1024px) {
    .piano-stage.piano-desktop-wide,
    .piano-stage {
        width: 100%;
        max-width: none;
    }
    .piano-stage.piano-desktop-wide .piano-widget {
        max-width: none;
        padding: 1.15rem 1rem 1.35rem;
    }
    .piano-stage.piano-desktop-wide .piano-keyboard {
        height: 240px;
        justify-content: stretch;
        width: 100%;
    }
    .piano-stage.piano-desktop-wide .piano-key.white {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        max-width: none;
    }
    .piano-stage.piano-desktop-wide .piano-key.black {
        width: clamp(28px, 2.4vw, 42px);
        height: 58%;
    }
}

/* Mobile portrait: rotate tip */
/* In-app browser: never show "Rotate to landscape" (orientation usually blocked) */
html.music-in-app-browser .piano-rotate-tip,
body.music-in-app-browser .piano-rotate-tip {
    display: none !important;
}

/* In-app browser (Facebook / Instagram) — open in Safari/Chrome for landscape */
.music-iab-tip {
    display: none;
    margin: 0 0 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, #1e1b4b, #4c1d95 55%, #5b21b6);
    border: 1px solid #a78bfa;
    color: #ede9fe;
    text-align: center;
    max-width: 100%;
    box-sizing: border-box;
}

.music-iab-tip:not([hidden]) {
    display: block;
}

.music-iab-tip-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.music-iab-icon {
    font-size: 1.35rem;
    color: #c4b5fd;
}

.music-iab-title,
.music-iab-steps {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    max-width: 26rem;
}

.music-iab-steps {
    font-size: 0.84rem;
    color: #ddd6fe;
    opacity: 0.95;
}

.music-iab-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.music-iab-actions .piano-btn,
.music-iab-actions .music-iab-open {
    min-width: 0;
    max-width: 100%;
    text-decoration: none;
    box-sizing: border-box;
}

a.music-iab-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.piano-rotate-tip {
    display: none;
    margin: 0 0 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, #4c1d95, #312e81);
    border: 1px solid #7c3aed;
    color: #ede9fe;
    text-align: center;
}

.piano-rotate-tip:not([hidden]) {
    display: block;
}

.piano-rotate-tip-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
}

.piano-rotate-icon {
    font-size: 1.75rem;
    color: #c4b5fd;
    animation: piano-tilt 1.6s ease-in-out infinite;
}

@keyframes piano-tilt {
    0%, 100% { transform: rotate(0deg); }
    40% { transform: rotate(90deg); }
    60% { transform: rotate(90deg); }
}

.piano-rotate-tip p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    max-width: 22rem;
}

@media (min-width: 901px) {
    .piano-rotate-tip { display: none !important; }
}

.piano-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.75rem;
    margin-bottom: 0.85rem;
    justify-content: space-between;
}

.piano-toolbar-left,
.piano-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.55rem;
}

.piano-label {
    font-size: 0.8rem;
    color: #a5b4fc;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.piano-label select {
    background: #312e81;
    color: #fff;
    border: 1px solid #4c1d95;
    border-radius: 0.5rem;
    padding: 0.45rem 0.5rem;
    font-size: 16px; /* prevent iOS zoom */
    max-width: 7.5rem;
}

.piano-label input[type="range"] {
    width: 88px;
    accent-color: #a78bfa;
    height: 1.5rem;
}

.piano-octave-chip {
    background: rgba(124, 58, 237, 0.25);
    border: 1px solid #5b21b6;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    white-space: nowrap;
}

.piano-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    background: #312e81;
    color: #e0e7ff;
    border: 1px solid #4c1d95;
    border-radius: 0.55rem;
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 2.5rem;
    transition: background 0.15s, transform 0.1s;
}

.piano-btn:hover { background: #4c1d95; }
.piano-btn:active { transform: scale(0.97); }
.piano-btn.is-on {
    background: #7c3aed;
    border-color: #a78bfa;
    color: #fff;
}

.piano-btn-max {
    background: #4c1d95;
    border-color: #7c3aed;
}

.piano-status {
    min-height: 1.4rem;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #c4b5fd;
    margin-bottom: 0.65rem;
    letter-spacing: 0.03em;
}

.piano-status .note-name {
    color: #fff;
    font-size: 1.15rem;
}

.piano-hint {
    text-align: center;
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 0.75rem;
    line-height: 1.45;
}

.piano-hint-mobile { display: none; }

.piano-keyboard-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: none; /* allow hold-and-drag glissando across keys */
    padding: 0.15rem 0 0.35rem;
    margin: 0 -0.15rem;
    scrollbar-width: thin;
    scrollbar-color: #7c3aed #1e1b4b;
}

.piano-keyboard-wrap::-webkit-scrollbar { height: 6px; }
.piano-keyboard-wrap::-webkit-scrollbar-thumb {
    background: #7c3aed;
    border-radius: 4px;
}

.piano-keyboard {
    position: relative;
    display: flex;
    height: 200px;
    width: 100%;
    min-width: 100%;
    margin: 0 auto;
    padding: 0 2px;
    justify-content: stretch;
    box-sizing: border-box;
}

.piano-key {
    position: relative;
    border: none;
    cursor: pointer;
    outline: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    flex: 0 0 auto;
}

.piano-key.white {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    height: 100%;
    background: linear-gradient(180deg, #fff 0%, #f1f5f9 70%, #e2e8f0 100%);
    border: 1px solid #94a3b8;
    border-radius: 0 0 6px 6px;
    margin: 0 1px;
    z-index: 1;
    box-shadow: 0 4px 0 #94a3b8, 0 6px 10px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 0.45rem;
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 600;
}

.piano-key.white:hover { background: linear-gradient(180deg, #faf5ff 0%, #ede9fe 100%); }
.piano-key.white.is-active,
.piano-key.white:active {
    background: linear-gradient(180deg, #ddd6fe 0%, #c4b5fd 100%);
    box-shadow: 0 1px 0 #7c3aed, 0 2px 6px rgba(0,0,0,0.2);
    transform: translateY(2px);
    color: #5b21b6;
}

.piano-key.black {
    position: absolute;
    top: 0;
    width: 30px;
    height: 58%;
    background: linear-gradient(180deg, #334155 0%, #0f172a 55%, #020617 100%);
    border: 1px solid #020617;
    border-radius: 0 0 4px 4px;
    z-index: 2;
    box-shadow: 0 4px 0 #020617, 0 6px 8px rgba(0,0,0,0.45);
    color: #a5b4fc;
    font-size: 0.55rem;
    font-weight: 600;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0.35rem;
}

.piano-key.black:hover { background: linear-gradient(180deg, #475569 0%, #1e293b 100%); }
.piano-key.black.is-active,
.piano-key.black:active {
    background: linear-gradient(180deg, #6d28d9 0%, #4c1d95 100%);
    box-shadow: 0 1px 0 #312e81;
    transform: translateY(2px);
    color: #fff;
}

.piano-key .key-label { pointer-events: none; opacity: 0.9; }
.piano-key .pc-key {
    display: block;
    font-size: 0.58rem;
    opacity: 0.55;
    margin-bottom: 0.1rem;
    text-transform: uppercase;
    pointer-events: none;
}

.piano-key.black .pc-key { color: #c4b5fd; }

/* Mobile / small screens */
@media (max-width: 720px) {
    .piano-widget {
        padding: 0.85rem 0.5rem 1rem;
        border-radius: 1rem;
    }

    .piano-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .piano-toolbar-left,
    .piano-toolbar-right {
        justify-content: center;
        width: 100%;
    }

    .piano-btn {
        min-height: 2.65rem;
        padding: 0.5rem 0.65rem;
        font-size: 0.8rem;
    }

    .piano-label select {
        max-width: 6.5rem;
        font-size: 16px;
    }

    .piano-label input[type="range"] {
        width: 72px;
    }

    .piano-key.white {
        width: 42px;
        font-size: 0.58rem;
    }

    .piano-key.black {
        width: 26px;
        height: 55%;
    }

    .piano-keyboard {
        height: 180px;
        justify-content: flex-start;
    }

    .piano-hint-full { display: none; }
    .piano-hint-mobile { display: inline; }
    .piano-hint { font-size: 0.72rem; margin-top: 0.55rem; }

    .piano-key .pc-key { display: none; } /* computer key labels less useful on phones */

    .piano-status { font-size: 0.88rem; min-height: 1.25rem; }
    .piano-status .note-name { font-size: 1.05rem; }
}

@media (max-width: 400px) {
    .piano-btn-text { display: none; }
    .piano-label-text { display: none; }
    .piano-max-label { display: none; }
    .piano-key.white { width: 38px; }
    .piano-key.black { width: 24px; }
    .piano-keyboard { height: 165px; }
}

/* ── Maximized piano (full-viewport overlay) ── */

body.piano-is-maximized {
    overflow: hidden !important;
    touch-action: none;
}

.piano-stage.is-maximized {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    z-index: 2147483000 !important;
    background: #0b0720;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding:
        max(0.4rem, env(safe-area-inset-top, 0px))
        max(0.5rem, env(safe-area-inset-right, 0px))
        max(0.4rem, env(safe-area-inset-bottom, 0px))
        max(0.5rem, env(safe-area-inset-left, 0px));
    overflow: hidden;
    animation: piano-max-in 0.18s ease;
    box-sizing: border-box;
}

@keyframes piano-max-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.piano-stage.is-maximized .piano-max-inner {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none; /* full desktop width for more keys */
    margin: 0;
    display: flex;
    flex-direction: column;
}

.piano-stage.is-maximized .piano-widget {
    flex: 1 1 auto;
    min-height: 0;
    max-width: none;
    width: 100%;
    margin: 0;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0.65rem 0.85rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid #312e81;
}

.piano-stage.is-maximized .piano-toolbar {
    flex: 0 0 auto;
    margin-bottom: 0.5rem;
}

.piano-stage.is-maximized .piano-status {
    flex: 0 0 auto;
}

.piano-stage.is-maximized .piano-keyboard-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
}

.piano-stage.is-maximized .piano-keyboard {
    height: min(58vh, 380px);
    min-height: 220px;
    margin: 0;
    width: 100%;
    justify-content: stretch;
}

.piano-stage.is-maximized .piano-key.white {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: none;
}

.piano-stage.is-maximized .piano-key.black {
    width: clamp(28px, 2.5vw, 48px);
    height: 58%;
}

/* Desktop fullscreen: tall keys, full width */
@media (min-width: 1024px) {
    .piano-stage.is-maximized .piano-keyboard {
        height: min(62vh, 420px);
        min-height: 280px;
    }
    .piano-stage.is-maximized .piano-key.black {
        width: clamp(32px, 2.2vw, 52px);
    }
}

.piano-stage.is-maximized .piano-hint {
    flex: 0 0 auto;
    margin-top: 0.5rem;
}

.piano-stage.is-maximized #piano-maximize {
    background: #7c3aed;
    border-color: #a78bfa;
    color: #fff;
}

.piano-stage.is-maximized #piano-maximize:hover {
    background: #6d28d9;
}

/* Maximized + mobile: taller keys, compact chrome */
@media (max-width: 720px) {
    .piano-stage.is-maximized .piano-widget {
        padding: 0.55rem 0.4rem 0.65rem;
        border-radius: 0.75rem;
    }

    .piano-stage.is-maximized .piano-toolbar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.4rem;
        justify-content: center;
    }

    .piano-stage.is-maximized .piano-toolbar-left,
    .piano-stage.is-maximized .piano-toolbar-right {
        width: auto;
        justify-content: center;
    }

    .piano-stage.is-maximized .piano-btn {
        min-height: 2.45rem;
        padding: 0.4rem 0.55rem;
    }

    .piano-stage.is-maximized .piano-keyboard {
        height: min(58dvh, 280px);
        min-height: 180px;
        justify-content: flex-start;
    }

    .piano-stage.is-maximized .piano-key.white {
        width: 46px;
    }

    .piano-stage.is-maximized .piano-key.black {
        width: 28px;
        height: 56%;
    }

    .piano-stage.is-maximized .piano-hint {
        font-size: 0.7rem;
    }

    .piano-stage.is-maximized .piano-sound-label {
        /* keep sound accessible but compact */
    }
}

@media (max-width: 400px) {
    .piano-stage.is-maximized .piano-key.white {
        width: 44px;
    }

    .piano-stage.is-maximized .piano-keyboard {
        height: min(55dvh, 260px);
    }
}

/* Landscape phones/tablets: play mode — more keys, less chrome */
@media (orientation: landscape) and (max-height: 560px) {
    .piano-rotate-tip { display: none !important; }

    .piano-stage.is-maximized .piano-hint {
        display: none;
    }

    .piano-stage.is-maximized .piano-status {
        margin-bottom: 0.2rem;
        min-height: 1rem;
        font-size: 0.8rem;
    }

    .piano-stage.is-maximized .piano-toolbar {
        margin-bottom: 0.2rem;
        gap: 0.35rem;
    }

    .piano-stage.is-maximized .piano-keyboard-wrap {
        flex: 1 1 auto;
    }

    .piano-stage.is-maximized .piano-keyboard {
        height: min(78dvh, 280px);
        min-height: 150px;
        width: 100%;
        justify-content: stretch;
    }

    .piano-stage.is-maximized .piano-key.white {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
    }

    .piano-stage.is-maximized .piano-key.black {
        width: clamp(22px, 3.2vh, 36px);
        height: 55%;
    }

    .piano-stage.is-maximized .piano-btn-text,
    .piano-stage.is-maximized .piano-label-text {
        display: none;
    }
}

/* In-page landscape (not only maximized) */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) {
    .piano-widget {
        padding: 0.45rem 0.4rem 0.55rem;
    }
    .piano-keyboard {
        height: min(62dvh, 200px);
    }
    .piano-key.white {
        width: auto;
        flex: 1 1 0;
        min-width: 36px;
    }
    .piano-keyboard {
        width: 100%;
        justify-content: stretch;
    }
    .piano-hint { display: none; }
}

.hero-section {
    background: linear-gradient(135deg, #4c1d95 0%, #1e1b4b 50%, #0f172a 100%);
}

/* Mobile menu group labels (user-friendly nav) */
.mobile-menu-label {
    display: block;
    margin-top: 0.65rem;
    margin-bottom: 0.15rem;
    padding-top: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}
.mobile-menu-label:first-child { margin-top: 0.15rem; padding-top: 0; }
.mobile-menu { max-height: min(80vh, 32rem); overflow-y: auto; }

/* ── Virtual Xylophone ── */

.xylo-stage {
    position: relative;
    width: 100%;
}

.xylo-widget {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-radius: 1.25rem;
    padding: 1.1rem 0.85rem 1.25rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.4);
    color: #e2e8f0;
    width: 100%;
    max-width: 100%;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.xylo-frame {
    position: relative;
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    border-radius: 0.85rem;
    padding: 1.1rem 0.65rem 0.85rem;
    border: 1px solid #475569;
    min-height: 220px;
    touch-action: none; /* hold-and-drag across bars */
}

.xylo-rail {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #78716c, #a8a29e, #78716c);
    margin: 0 0.35rem;
    box-shadow: 0 2px 0 #44403c;
}

.xylo-rail-top { margin-bottom: 0.65rem; }
.xylo-rail-bottom { margin-top: 0.65rem; }

.xylo-bars {
    display: flex;
    align-items: flex-end;
    justify-content: stretch;
    gap: 0.35rem;
    height: 200px;
    min-height: 160px;
    padding: 0 0.15rem;
}

.xylo-bar {
    flex: 1 1 0;
    min-width: 0;
    max-width: 72px;
    margin: 0 auto;
    position: relative;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    height: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}

.xylo-bar-face {
    display: block;
    width: 100%;
    flex: 1 1 auto;
    min-height: 60%;
    border-radius: 0.45rem 0.45rem 0.35rem 0.35rem;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bar-color) 88%, #fff) 0%, var(--bar-color) 45%, color-mix(in srgb, var(--bar-color) 70%, #000) 100%);
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.35),
        0 4px 0 color-mix(in srgb, var(--bar-color) 55%, #000),
        0 8px 14px rgba(0,0,0,0.35);
    border: 1px solid color-mix(in srgb, var(--bar-color) 40%, #000);
    transition: transform 0.08s, filter 0.08s;
}

/* Fallback if color-mix unsupported */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .xylo-bar-face {
        background: var(--bar-color);
        box-shadow: inset 0 2px 0 rgba(255,255,255,0.3), 0 4px 0 rgba(0,0,0,0.25), 0 8px 14px rgba(0,0,0,0.35);
    }
}

.xylo-bar.is-hit .xylo-bar-face,
.xylo-bar:active .xylo-bar-face {
    transform: translateY(4px) scale(0.98);
    filter: brightness(1.12);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.35),
        0 1px 0 color-mix(in srgb, var(--bar-color) 45%, #000),
        0 3px 8px rgba(0,0,0,0.3);
}

.xylo-note {
    font-size: 0.62rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-top: 0.3rem;
    pointer-events: none;
}

.xylo-pc {
    position: absolute;
    top: 0.35rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.58rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    text-shadow: 0 1px 2px rgba(0,0,0,0.45);
    pointer-events: none;
    z-index: 2;
}

.xylo-switch {
    margin: 0.75rem 0 0;
    text-align: center;
    font-size: 0.88rem;
    color: #a5b4fc;
}

.xylo-switch a {
    color: #c4b5fd;
    font-weight: 600;
    text-decoration: underline;
}

@media (min-width: 1024px) {
    .xylo-bars { height: 240px; gap: 0.45rem; }
    .xylo-frame { min-height: 260px; padding: 1.25rem 1rem 1rem; }
}

/* Full screen xylophone */
body.xylo-is-maximized {
    overflow: hidden !important;
}

.xylo-stage.is-maximized {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    z-index: 2147483000 !important;
    background: #0b1220;
    display: flex;
    flex-direction: column;
    padding:
        max(0.4rem, env(safe-area-inset-top, 0px))
        max(0.5rem, env(safe-area-inset-right, 0px))
        max(0.4rem, env(safe-area-inset-bottom, 0px))
        max(0.5rem, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
}

.xylo-stage.is-maximized .xylo-max-inner {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.xylo-stage.is-maximized .xylo-widget {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 0.75rem;
    max-width: none;
}

.xylo-stage.is-maximized .xylo-frame {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.xylo-stage.is-maximized .xylo-bars {
    flex: 1;
    height: auto;
    min-height: 180px;
}

.xylo-stage.is-maximized .xylo-bar {
    max-width: none;
}

.xylo-stage.is-maximized #xylo-maximize {
    background: #7c3aed;
    border-color: #a78bfa;
    color: #fff;
}

@media (orientation: landscape) and (max-height: 560px) {
    .xylo-stage.is-maximized .piano-hint,
    .xylo-stage.is-maximized .xylo-switch {
        display: none;
    }
    .xylo-stage.is-maximized .xylo-bars {
        min-height: 120px;
    }
    .xylo-stage.is-maximized .piano-toolbar {
        margin-bottom: 0.25rem;
    }
}

@media (max-width: 600px) {
    .xylo-pc { display: none; }
    .xylo-bars { height: 170px; gap: 0.25rem; }
    .xylo-note { font-size: 0.55rem; }
}

/* ── Tool-first landing ── */
html { scroll-padding-top: 5rem; }
.tool-anchor,
#online-calculator,
#online-qr,
#virtual-piano-tool,
#pdf-tools,
#image-tools,
#text-tools,
#qr-tool,
#qr-tool-wrap,
#calc-tool,
#calc-stage,
#piano-tool {
    scroll-margin-top: 5rem;
}
.tool-first-section {
    padding: 1.25rem 0 2rem;
}
.tool-first-main.page-main {
    padding-top: 1.25rem;
}
.tool-first-head {
    text-align: center;
    margin-bottom: 1.15rem;
}
.tool-first-head .tool-page-title {
    margin-bottom: 0.35rem;
}
.tool-first-head .tool-page-desc {
    margin-bottom: 0.75rem;
}
.tool-first-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 0 0 0.5rem !important;
    text-align: center;
}
@media (max-width: 640px) {
    html { scroll-padding-top: 4.5rem; }
    .tool-anchor,
    #online-calculator,
    #online-qr,
    #virtual-piano-tool,
    #pdf-tools,
    #image-tools,
    #text-tools,
    #qr-tool,
    #qr-tool-wrap,
    #calc-tool,
    #calc-stage,
    #piano-tool {
        scroll-margin-top: 4.5rem;
    }
    .tool-first-section { padding: 0.85rem 0 1.5rem; }
    .tool-first-main.page-main { padding-top: 0.85rem; }
}


/* Tool switcher: current page label vs neutral nav links */
.tool-switcher-current,
.calc-switcher-current {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    line-height: 1.25;
    cursor: default;
}
.tool-switcher-current i,
.calc-switcher-current i { opacity: 0.85; }
.tool-first-switch .btn-neutral {
    box-shadow: none;
}
.tool-first-switch .btn-neutral:active {
    transform: none;
    box-shadow: none;
}
/* Suite-tinted current labels */
.tool-card-teal ~ * .tool-switcher-current,
body .tool-switcher-current.calc-switcher-current {
    color: #0f766e;
    background: #f0fdfa;
    border-color: #99f6e4;
}



/* mobile-fit: narrow logo */
@media (max-width: 380px) {
    .site-logo-img {
        height: 2.5rem;
        max-width: min(11rem, 58vw);
    }
    .site-header-inner {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        gap: 0.4rem;
        min-width: 0;
    }
    .container,
    .container-sm {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .btn {
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
}

/* ── Mobile optimization pass ── */
@media (max-width: 640px) {
    .container,
    .container-sm {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }
    .site-header-inner {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
        gap: 0.5rem;
        min-width: 0;
    }
    .btn {
        max-width: 100%;
        min-width: 0;
        min-height: 2.75rem;
        box-sizing: border-box;
    }
    .btn-sm {
        min-height: 2.5rem;
    }
    .tool-first-switch,
    .calc-switcher {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.4rem;
        justify-content: flex-start;
        max-width: 100%;
        scrollbar-width: none;
        padding-bottom: 0.35rem;
        margin-bottom: 0.75rem !important;
    }
    .tool-first-switch::-webkit-scrollbar,
    .calc-switcher::-webkit-scrollbar {
        display: none;
        height: 0;
    }
    .tool-first-switch .btn,
    .tool-first-switch .tool-switcher-current,
    .calc-switcher .btn,
    .calc-switcher .tool-switcher-current {
        flex: 0 0 auto;
        white-space: nowrap;
        min-height: 2.5rem;
    }
    .tool-page-title {
        font-size: clamp(1.35rem, 6.5vw, 1.75rem);
        line-height: 1.2;
    }
    .tool-page-desc {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
    .page-main,
    .tool-first-main.page-main {
        padding-top: 0.75rem;
    }
    .tool-card {
        padding: 1.35rem 1.15rem;
    }
    .drop-zone {
        padding: 2rem 1rem;
    }
    .text-input,
    .form-input,
    .form-textarea,
    .counter-textarea {
        font-size: 16px;
    }
    details.faq-item summary {
        min-height: 2.5rem;
        line-height: 1.35;
    }
}


/* ── Online Metronome ── */
.metro-widget {
    background: linear-gradient(165deg, #1e1b4b 0%, #312e81 45%, #4c1d95 100%);
    border: 1px solid #5b21b6;
    border-radius: 1.25rem;
    padding: 1.35rem 1.25rem 1.4rem;
    max-width: 28rem;
    width: 100%;
    margin: 0 auto 1.5rem;
    color: #e9e5ff;
    box-shadow: 0 16px 40px rgba(76, 29, 149, 0.35);
    box-sizing: border-box;
    min-width: 0;
}
.metro-widget.is-running {
    box-shadow: 0 16px 48px rgba(167, 139, 250, 0.4);
}
.metro-widget.is-pulse .metro-bpm-value {
    transform: scale(1.04);
}
.metro-display-wrap {
    text-align: center;
    margin-bottom: 1rem;
}
.metro-bpm-label {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c4b5fd;
}
.metro-bpm-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.metro-bpm-value {
    font-size: clamp(3rem, 14vw, 4rem);
    font-weight: 800;
    line-height: 1;
    color: #fff;
    font-variant-numeric: tabular-nums;
    min-width: 4.5rem;
    transition: transform 0.08s ease;
}
.metro-step {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    border: 1px solid rgba(196, 181, 253, 0.45);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.metro-step:hover { background: rgba(255, 255, 255, 0.16); }
.metro-slider {
    width: 100%;
    margin: 0.85rem 0 0.35rem;
    accent-color: #a78bfa;
    min-height: 1.5rem;
}
.metro-tempo-name {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ddd6fe;
}
.metro-beats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 0.85rem 0 1.15rem;
}
.metro-beat {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(196, 181, 253, 0.45);
    transition: background 0.05s, transform 0.05s, box-shadow 0.05s;
}
.metro-beat.is-accent {
    border-color: #fbbf24;
}
.metro-beat.is-on {
    background: #c4b5fd;
    transform: scale(1.25);
    box-shadow: 0 0 12px rgba(196, 181, 253, 0.8);
}
.metro-beat.is-accent.is-on {
    background: #fbbf24;
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.85);
}
.metro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1rem;
}
.metro-actions .btn {
    flex: 1 1 8rem;
    min-height: 2.85rem;
    justify-content: center;
}
.metro-start {
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-weight: 700;
}
.metro-start:hover { background: #6d28d9; }
.metro-start.is-stop {
    background: #dc2626;
}
.metro-start.is-stop:hover { background: #b91c1c; }
.metro-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem 0.75rem;
    margin-bottom: 0.85rem;
}
.metro-field { min-width: 0; }
.metro-field-wide { grid-column: 1 / -1; }
.metro-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #c4b5fd;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.metro-select {
    width: 100%;
    min-height: 2.6rem;
    font-size: 16px;
    padding: 0.45rem 0.55rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(196, 181, 253, 0.4);
    background: rgba(15, 23, 42, 0.45);
    color: #f8fafc;
    box-sizing: border-box;
}
.metro-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-bottom: 0.75rem;
}
.metro-preset {
    min-width: 2.75rem;
    min-height: 2.35rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(196, 181, 253, 0.35);
    background: rgba(255, 255, 255, 0.08);
    color: #ede9fe;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.metro-preset:hover { background: rgba(255, 255, 255, 0.16); }
.metro-status {
    margin: 0;
    text-align: center;
    font-size: 0.82rem;
    color: #c4b5fd;
}
.metro-widget .privacy-note-inline {
    margin-top: 0.65rem;
    color: #a5b4fc;
}
.metro-widget .privacy-note-inline i { color: #c4b5fd; }

/* Violet info cards on music pages */
.info-card-violet .step-num { background: #7c3aed; }

@media (max-width: 420px) {
    .metro-widget {
        padding: 1.1rem 0.85rem 1.2rem;
        border-radius: 1rem;
    }
    .metro-controls {
        grid-template-columns: 1fr;
    }
    .metro-actions .btn {
        flex: 1 1 100%;
    }
    .metro-bpm-value {
        font-size: 3.25rem;
    }
}

/* Metronome practice options (v3) */
.metro-tempo-actions {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    margin: 0.45rem 0 0.15rem;
}
.metro-chip {
    min-width: 2.75rem;
    min-height: 2.25rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(196, 181, 253, 0.4);
    background: rgba(255, 255, 255, 0.1);
    color: #ede9fe;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.metro-chip:hover { background: rgba(255, 255, 255, 0.18); }
.metro-beat.has-num {
    width: 1.65rem;
    height: 1.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
}
.metro-beat.has-num.is-on {
    color: #1e1b4b;
}
.metro-beat.has-num.is-accent.is-on {
    color: #422006;
}
.metro-beat.is-muted-pulse {
    background: rgba(148, 163, 184, 0.45);
    transform: scale(1.12);
    box-shadow: none;
}
.metro-bar-hint {
    margin: -0.35rem 0 0.75rem;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: #ddd6fe;
    min-height: 1.1rem;
}
.metro-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.85rem;
    justify-content: center;
    margin: 0 0 0.85rem;
}
.metro-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e9e5ff;
    cursor: pointer;
    min-height: 2.25rem;
    -webkit-tap-highlight-color: transparent;
}
.metro-toggle input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: #a78bfa;
}
.metro-keys-hint {
    margin: 0.35rem 0 0;
    text-align: center;
    font-size: 0.72rem;
    color: #a5b4fc;
    line-height: 1.4;
}
.metro-keys-hint kbd {
    display: inline-block;
    padding: 0.05rem 0.35rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(196, 181, 253, 0.35);
    background: rgba(15, 23, 42, 0.35);
    font-size: 0.68rem;
    font-family: inherit;
}
.metro-widget.is-screen-flash {
    outline: 3px solid rgba(251, 191, 36, 0.85);
    outline-offset: 2px;
}
body.metro-body-flash {
    background-color: #2e1065 !important;
    transition: background-color 0.05s ease;
}
@media (max-width: 420px) {
    .metro-toggles {
        gap: 0.35rem 0.65rem;
    }
    .metro-keys-hint {
        font-size: 0.68rem;
    }
}

/* ── Metronome mobile optimization (v4) ── */
.metro-controls-core {
    margin-bottom: 0.65rem;
}
.metro-advanced {
    margin: 0 0 0.75rem;
    border: 1px solid rgba(196, 181, 253, 0.28);
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.28);
    overflow: hidden;
}
.metro-advanced-sum {
    list-style: none;
    cursor: pointer;
    padding: 0.7rem 0.85rem;
    font-weight: 700;
    font-size: 0.88rem;
    color: #ede9fe;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.55rem;
    min-height: 2.75rem;
    -webkit-tap-highlight-color: transparent;
}
.metro-advanced-sum::-webkit-details-marker { display: none; }
.metro-advanced-sum::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    font-size: 0.75rem;
    color: #c4b5fd;
    transition: transform 0.15s;
}
.metro-advanced[open] .metro-advanced-sum::after {
    transform: rotate(180deg);
}
.metro-advanced-hint {
    font-weight: 500;
    font-size: 0.72rem;
    color: #a5b4fc;
}
.metro-advanced-body {
    padding: 0 0.75rem 0.85rem;
}
.metro-controls-adv {
    margin-bottom: 0.5rem;
}
.metro-actions-dock .metro-btn-label {
    margin-left: 0.15rem;
}

/* Phones / small tablets */
@media (max-width: 640px) {
    .container-piano {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        max-width: 100%;
    }
    .tool-first-head {
        margin-bottom: 0.65rem;
    }
    .tool-first-head .tool-page-title {
        font-size: clamp(1.35rem, 6.5vw, 1.7rem);
        line-height: 1.2;
        margin-bottom: 0.3rem;
    }
    .tool-first-head .tool-page-desc {
        font-size: 0.88rem;
        margin-bottom: 0.55rem;
        line-height: 1.45;
    }
    .music-switcher,
    .tool-first-switch {
        margin-bottom: 0.65rem !important;
    }

    .metro-widget {
        padding: 0.9rem 0.75rem 5.75rem;
        margin-bottom: 0.75rem;
        border-radius: 1rem;
        max-width: 100%;
    }
    .metro-display-wrap {
        margin-bottom: 0.55rem;
    }
    .metro-bpm-label {
        font-size: 0.68rem;
        margin-bottom: 0.2rem;
    }
    .metro-bpm-value {
        font-size: clamp(2.6rem, 13vw, 3.4rem);
        min-width: 3.75rem;
    }
    .metro-step {
        width: 2.85rem;
        height: 2.85rem;
    }
    .metro-tempo-actions {
        margin: 0.3rem 0 0.05rem;
        gap: 0.35rem;
    }
    .metro-chip {
        min-height: 2.35rem;
        min-width: 3rem;
        padding: 0.3rem 0.85rem;
    }
    .metro-slider {
        margin: 0.55rem 0 0.2rem;
        min-height: 1.75rem;
    }
    .metro-tempo-name {
        font-size: 0.82rem;
    }
    .metro-beats {
        gap: 0.4rem;
        margin: 0.5rem 0 0.45rem;
    }
    .metro-beat.has-num {
        width: 1.85rem;
        height: 1.85rem;
        font-size: 0.7rem;
    }
    .metro-bar-hint {
        margin: 0 0 0.5rem;
        font-size: 0.74rem;
        min-height: 0.95rem;
    }

    /* Keep 2-col for core fields when width allows */
    .metro-controls-core {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem 0.55rem;
    }
    .metro-controls-adv {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem 0.55rem;
    }
    .metro-select {
        min-height: 2.75rem;
        padding: 0.5rem 0.5rem;
    }
    .metro-label {
        font-size: 0.68rem;
        margin-bottom: 0.22rem;
    }

    .metro-presets {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        gap: 0.35rem;
        margin: 0 0 0.65rem;
        padding-bottom: 0.25rem;
        scrollbar-width: none;
        mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 1.25rem), transparent 100%);
        -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 1.25rem), transparent 100%);
    }
    .metro-presets::-webkit-scrollbar { display: none; height: 0; }
    .metro-preset {
        flex: 0 0 auto;
        min-width: 2.85rem;
        min-height: 2.5rem;
    }

    .metro-advanced {
        margin-bottom: 0.55rem;
    }
    .metro-advanced-sum {
        padding: 0.75rem 0.8rem;
        font-size: 0.9rem;
    }
    .metro-advanced-hint {
        flex: 1 1 100%;
        order: 3;
        margin-top: -0.15rem;
    }
    .metro-toggles {
        gap: 0.35rem 0.75rem;
        margin: 0.15rem 0 0;
        justify-content: flex-start;
    }
    .metro-toggle {
        min-height: 2.5rem;
        font-size: 0.82rem;
    }

    .metro-status {
        font-size: 0.78rem;
        margin-bottom: 0.25rem;
        padding: 0 0.15rem;
    }
    .metro-keys-hint {
        display: none; /* desktop/laptop only */
    }
    .metro-widget .privacy-note-inline {
        font-size: 0.72rem;
        margin-top: 0.35rem;
        margin-bottom: 0.25rem;
        line-height: 1.35;
    }

    /* Fixed bottom dock — Start + Tap always reachable */
    .metro-actions-dock {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 90;
        display: flex;
        flex-wrap: nowrap;
        gap: 0.5rem;
        margin: 0;
        padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
        background: rgba(24, 20, 60, 0.97);
        border-top: 1px solid rgba(167, 139, 250, 0.4);
        box-shadow: 0 -8px 28px rgba(15, 10, 40, 0.45);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    .metro-actions-dock .btn {
        flex: 1 1 0;
        min-width: 0;
        min-height: 3.05rem;
        font-size: 1rem;
        border-radius: 9999px;
        justify-content: center;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .metro-actions-dock .btn-neutral {
        background: rgba(255, 255, 255, 0.1);
        color: #f5f3ff;
        border: 1px solid rgba(196, 181, 253, 0.35);
    }
    .metro-actions-dock .btn-neutral:hover {
        background: rgba(255, 255, 255, 0.16);
    }

    /* Space so fixed dock doesn't cover footer/content */
    body.metro-mobile-dock {
        padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
    }
}

/* Very narrow phones */
@media (max-width: 360px) {
    .metro-widget {
        padding: 0.75rem 0.6rem 5.6rem;
    }
    .metro-controls-core,
    .metro-controls-adv {
        grid-template-columns: 1fr;
    }
    .metro-bpm-value {
        font-size: 2.45rem;
    }
    .metro-actions-dock .metro-btn-label {
        /* keep labels; full width buttons */
    }
    .metro-advanced-hint {
        display: none;
    }
}

/* Desktop: actions stay in flow under controls (move dock order via flex) */
@media (min-width: 641px) {
    .metro-actions-dock {
        position: static;
        display: flex;
        margin: 0 0 1rem;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        order: 0;
    }
    /* Put actions near top: after beats — use display contents / reorder */
    .metro-widget {
        display: flex;
        flex-direction: column;
    }
    .metro-display-wrap { order: 1; }
    .metro-beats { order: 2; }
    .metro-bar-hint { order: 3; }
    .metro-actions-dock { order: 4; }
    .metro-controls-core { order: 5; }
    .metro-presets { order: 6; }
    .metro-advanced { order: 7; }
    .metro-status { order: 8; }
    .metro-keys-hint { order: 9; }
    .metro-widget .privacy-note-inline { order: 10; }
    .metro-advanced[open],
    .metro-advanced {
        /* desktop: open practice panel by default via attribute set in JS */
    }
}

/* ── Online Drum Pad (light UI — matches white product photos) ── */
.drum-widget {
    background: #f8fafc;
    border-radius: 1.25rem;
    padding: 1rem 1rem 1.15rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    color: #0f172a;
}
.drum-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    margin-bottom: 0.65rem;
}
.drum-toolbar-left,
.drum-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.75rem;
}
.drum-field-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}
.drum-label { white-space: nowrap; }
.drum-select {
    appearance: none;
    background: #fff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 0.55rem;
    padding: 0.4rem 1.75rem 0.4rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    cursor: pointer;
}
.drum-vol {
    width: min(9rem, 28vw);
    accent-color: #7c3aed;
    min-height: 2rem;
}
.drum-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.65rem;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.drum-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}
.drum-btn.is-on {
    background: #fee2e2;
    border-color: #f87171;
    color: #991b1b;
}
.drum-status {
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 0.75rem;
    min-height: 1.25rem;
}
.drum-stage {
    border-radius: 0.85rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 0.25rem;
    /* Drag across pads (glissando) — don't let browser steal the gesture */
    touch-action: none;
}
.drum-pads {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.2rem;
    touch-action: none;
}
@media (min-width: 480px) {
    .drum-pads { grid-template-columns: repeat(3, 1fr); gap: 0.22rem; }
}
@media (min-width: 768px) {
    .drum-pads { grid-template-columns: repeat(4, 1fr); gap: 0.25rem; }
}
.drum-pad {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.15rem;
    min-height: 5.25rem;
    padding: 0.75rem 0.8rem;
    border-radius: 0.9rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    /* none = hold-and-drag across pads works (glissando) */
    touch-action: none;
    /* Instant hit on mobile; hover polish only on fine pointers (see below) */
    transition: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
/* Desktop / mouse only — Android sticky :hover made presses feel laggy */
@media (hover: hover) and (pointer: fine) {
    .drum-pad {
        transition: transform 0.07s ease, box-shadow 0.1s ease, border-color 0.1s ease;
    }
    .drum-pad:hover {
        border-color: #a78bfa;
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(124, 58, 237, 0.12);
    }
}
.drum-pad:active,
.drum-pad.is-hit {
    transform: scale(0.96);
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.22);
    /* Snap pressed look — no ease fighting the short is-hit window */
    transition: none;
}
.drum-pad-key {
    position: absolute;
    top: 0.45rem;
    right: 0.55rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.04em;
}
.drum-pad-label {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.15;
    color: #0f172a;
}
.drum-pad-sub {
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
}
/* Light theme: no dark color washes over white product photos */
.drum-pad-kick,
.drum-pad-snare,
.drum-pad-chh,
.drum-pad-ohh,
.drum-pad-tomL,
.drum-pad-tomM,
.drum-pad-tomH,
.drum-pad-clap,
.drum-pad-rim,
.drum-pad-cow,
.drum-pad-ride,
.drum-pad-crash,
.drum-pad-cross,
.drum-pad-hatFoot,
.drum-pad-rideBell {
    background: #fff !important;
}

.drum-keys-hint {
    margin: 0.85rem 0 0.35rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #64748b;
    text-align: center;
}
.drum-keys-hint strong { color: #334155; }
.drum-keys-extra { display: inline; opacity: 0.9; }
.drum-widget .privacy-note-inline {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
}
.drum-widget .privacy-note-inline a {
    color: #6d28d9;
    font-weight: 600;
}

/* Fullscreen stage — keep light for white photos */
.drum-stage:fullscreen,
.drum-stage:-webkit-full-screen {
    background: #f8fafc;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.drum-stage:fullscreen .drum-pads,
.drum-stage:-webkit-full-screen .drum-pads {
    width: min(1100px, 100%);
    max-height: 100%;
}
.drum-stage:fullscreen .drum-pad,
.drum-stage:-webkit-full-screen .drum-pad {
    min-height: min(18vh, 8rem);
}

@media (max-width: 480px) {
    .drum-widget { padding: 0.85rem 0.75rem 1rem; border-radius: 1rem; }
    .drum-btn-text { display: none; }
    .drum-pad {
        min-height: 4.75rem;
        padding: 0.65rem 0.7rem;
    }
    .drum-pad-label { font-size: 0.92rem; }
    .drum-keys-hint { font-size: 0.72rem; }
}

.drum-keys-hint kbd {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.08rem 0.32rem;
    margin: 0 0.05rem;
    border-radius: 0.3rem;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    color: #334155;
}

/* Visual kit cards — seamless with white product photos; tight grid */
.drum-pads-visual {
    gap: 0.2rem;
}
@media (min-width: 480px) {
    .drum-pads-visual { gap: 0.22rem; }
}
@media (min-width: 768px) {
    .drum-pads-visual { gap: 0.25rem; }
}
.drum-pad-visual {
    align-items: center;
    justify-content: flex-start;
    gap: 0.12rem;
    min-height: 7.5rem;
    padding: 0.28rem 0.28rem 0.32rem;
    border-radius: 0.65rem;
    background: #fff !important;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
    /* Promote pad layer — cheaper hit scale on Android fullscreen */
    transform: translateZ(0);
}
@media (hover: hover) and (pointer: fine) {
    .drum-pad-visual:hover {
        border-color: #a78bfa;
        box-shadow: 0 8px 20px rgba(124, 58, 237, 0.12);
    }
    .drum-pad-visual:hover .drum-pad-art img {
        transform: scale(1.1);
    }
}
.drum-pad-visual.is-hit,
.drum-pad-visual:active {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
    transform: scale(0.97) translateZ(0);
    transition: none;
}
.drum-pad-art {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 4.65rem;
    border-radius: 0.4rem;
    /* Same white as photos — no gray box around images */
    background: #fff;
    overflow: hidden;
    pointer-events: none;
}
.drum-pad-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    /* Pull product photos a bit larger so empty card chrome feels smaller */
    transform: scale(1.06);
    user-select: none;
    -webkit-user-drag: none;
    /* No img transition by default — double-scale + ease felt laggy on Android */
    transition: none;
    will-change: auto;
    pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
    .drum-pad-art img {
        transition: transform 0.08s ease;
    }
}
/* Hit: dim/press without a second animated image scale (mobile-friendly) */
.drum-pad-visual.is-hit .drum-pad-art img,
.drum-pad-visual:active .drum-pad-art img {
    transform: scale(1.02);
    filter: brightness(0.92);
    transition: none;
}

/* Fullscreen on touch: avoid expensive multi-layer shadow animation */
.drum-stage:fullscreen .drum-pad,
.drum-stage:-webkit-full-screen .drum-pad,
.drum-stage:fullscreen .drum-pad-visual,
.drum-stage:-webkit-full-screen .drum-pad-visual {
    transition: none !important;
}
.drum-stage:fullscreen .drum-pad-art img,
.drum-stage:-webkit-full-screen .drum-pad-art img {
    transition: none !important;
}
.drum-pad-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.02rem;
    width: 100%;
    padding: 0.05rem 0.15rem 0;
}
.drum-pad-visual .drum-pad-label {
    font-size: 0.84rem;
    color: #0f172a;
}
.drum-pad-visual .drum-pad-sub {
    font-size: 0.64rem;
    color: #64748b;
}
.drum-pad-visual .drum-pad-key {
    top: 0.28rem;
    right: 0.3rem;
    z-index: 2;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.3rem;
    padding: 0.06rem 0.28rem;
    color: #475569;
    font-size: 0.64rem;
}

@media (min-width: 480px) {
    .drum-pad-visual { min-height: 8rem; }
    .drum-pad-art { height: 5.15rem; }
}
@media (min-width: 768px) {
    .drum-pad-visual { min-height: 8.35rem; padding: 0.3rem; }
    .drum-pad-art { height: 5.5rem; }
    .drum-pad-visual .drum-pad-label { font-size: 0.88rem; }
}
@media (max-width: 380px) {
    .drum-pad-visual { min-height: 6.75rem; padding: 0.22rem 0.22rem 0.28rem; }
    .drum-pad-art { height: 4rem; }
    .drum-pads,
    .drum-pads-visual { gap: 0.16rem; }
}

/* Fullscreen: larger art */
.drum-stage:fullscreen .drum-pad-visual,
.drum-stage:-webkit-full-screen .drum-pad-visual {
    min-height: min(22vh, 11rem);
}
.drum-stage:fullscreen .drum-pad-art,
.drum-stage:-webkit-full-screen .drum-pad-art {
    height: min(14vh, 7.5rem);
}

/* ── Virtual Guitar ── */
.guitar-widget {
    position: relative;
    background-color: #1c1917;
    background-image:
        linear-gradient(165deg, rgba(28, 25, 23, 0.82) 0%, rgba(12, 10, 9, 0.88) 45%, rgba(28, 25, 23, 0.9) 100%),
        url("../images/guitar/wood-bg.jpg?v=1");
    background-size: cover;
    background-position: center;
    border-radius: 1.25rem;
    padding: 1rem 0.85rem 1.15rem;
    border: 1px solid rgba(251, 191, 36, 0.28);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
    color: #f5f5f4;
    overflow: hidden;
}
.guitar-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    margin-bottom: 0.65rem;
}
.guitar-toolbar-left,
.guitar-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}
.guitar-field-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fcd34d;
}
.guitar-select {
    appearance: none;
    background: rgba(28, 25, 23, 0.85);
    color: #fafaf9;
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 0.55rem;
    padding: 0.4rem 1.75rem 0.4rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23fcd34d' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    cursor: pointer;
}
.guitar-vol {
    width: min(9rem, 28vw);
    accent-color: #f59e0b;
    min-height: 2rem;
}
.guitar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(251, 191, 36, 0.4);
    background: rgba(255, 255, 255, 0.08);
    color: #fafaf9;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.guitar-btn:hover { background: rgba(255, 255, 255, 0.14); }
.guitar-btn-primary {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #fbbf24;
    color: #1c1917;
}
.guitar-btn-primary:hover { filter: brightness(1.05); }
.guitar-status {
    text-align: center;
    font-size: 0.85rem;
    color: #fcd34d;
    margin: 0 0 0.65rem;
    min-height: 1.25rem;
}
.guitar-chords {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}
.guitar-chord-btn {
    min-height: 2.4rem;
    min-width: 2.5rem;
    padding: 0.35rem 0.7rem;
    border-radius: 9999px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(255, 255, 255, 0.08);
    color: #fafaf9;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.guitar-chord-btn.is-active {
    background: #fafaf9;
    color: #92400e;
    border-color: #fafaf9;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.guitar-stage {
    position: relative;
    border-radius: 1rem;
    background-color: #292524;
    background-image:
        linear-gradient(180deg, rgba(28, 25, 23, 0.35) 0%, rgba(12, 10, 9, 0.55) 100%),
        url("../images/guitar/neck-bg.jpg?v=1");
    background-size: cover;
    background-position: center 40%;
    padding: 0.75rem 0.45rem 0.95rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.15), inset 0 8px 28px rgba(0, 0, 0, 0.35);
}
.guitar-neck {
    position: relative;
    z-index: 1;
    min-width: 36rem;
}
.guitar-fret-nums {
    display: grid;
    grid-template-columns: 2rem repeat(13, minmax(2.1rem, 1fr));
    gap: 0;
    margin: 0 0 0.25rem 0;
    padding-left: 0;
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(251, 191, 36, 0.75);
    text-align: center;
}
.guitar-fret-num-open { font-size: 0.58rem; letter-spacing: -0.02em; }
.guitar-string-row {
    display: grid;
    grid-template-columns: 2rem 1fr;
    align-items: center;
    margin-bottom: 0.15rem;
}
.guitar-string-name {
    font-size: 0.8rem;
    font-weight: 800;
    color: #fde68a;
    text-align: center;
}
.guitar-string-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(13, minmax(2.1rem, 1fr));
    align-items: stretch;
    min-height: 2.55rem;
}
.guitar-string-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: linear-gradient(90deg, #a8a29e, #e7e5e4 20%, #d6d3d1 80%, #a8a29e);
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.85;
    box-shadow: 0 1px 0 rgba(0,0,0,0.35);
}
.guitar-string-row[data-string="5"] .guitar-string-line { height: 1px; opacity: 0.7; }
.guitar-string-row[data-string="0"] .guitar-string-line { height: 3px; opacity: 0.95; }

.guitar-fret {
    position: relative;
    z-index: 1;
    min-height: 2.55rem;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}
.guitar-fret::after {
    /* fret wire */
    content: "";
    position: absolute;
    right: 0;
    top: 10%;
    bottom: 10%;
    width: 2px;
    background: linear-gradient(180deg, #d6d3d1, #78716c);
    border-radius: 1px;
    opacity: 0.85;
    pointer-events: none;
}
.guitar-fret-open::after { display: none; }
.guitar-fret-open {
    border-right: 3px solid #fbbf24;
}
.guitar-fret-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0.85rem;
    height: 0.85rem;
    margin: -0.42rem 0 0 -0.42rem;
    border-radius: 50%;
    background: transparent;
    border: 2px solid transparent;
    transition: background 0.1s, transform 0.1s, box-shadow 0.1s;
}
.guitar-fret:hover .guitar-fret-dot {
    border-color: rgba(253, 230, 138, 0.7);
}
.guitar-fret.is-chord .guitar-fret-dot {
    background: #f59e0b;
    border-color: #fde68a;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35);
}
.guitar-fret.is-playing .guitar-fret-dot {
    background: #fafaf9;
    border-color: #fbbf24;
    transform: scale(1.25);
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.7);
}
.guitar-inlays {
    position: absolute;
    left: 50%;
    bottom: 0.2rem;
    width: 0.35rem;
    height: 0.35rem;
    margin-left: -0.17rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    pointer-events: none;
}
.guitar-keys-hint {
    margin: 0.85rem 0 0.35rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #d6d3d1;
    text-align: center;
}
.guitar-keys-hint kbd {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.08rem 0.32rem;
    margin: 0 0.05rem;
    border-radius: 0.3rem;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: rgba(28, 25, 23, 0.65);
    color: #fde68a;
}
.guitar-widget .privacy-note-inline {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: #a8a29e;
    text-align: center;
}

.guitar-stage:fullscreen,
.guitar-stage:-webkit-full-screen {
    background-color: #1c1917;
    background-image:
        linear-gradient(180deg, rgba(28, 25, 23, 0.4) 0%, rgba(12, 10, 9, 0.6) 100%),
        url("../images/guitar/neck-bg.jpg?v=1");
    background-size: cover;
    background-position: center;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.guitar-stage:fullscreen .guitar-neck,
.guitar-stage:-webkit-full-screen .guitar-neck {
    min-width: min(1100px, 100%);
    width: 100%;
}

@media (max-width: 640px) {
    .guitar-btn-text { /* keep strum text */ }
    .guitar-toolbar-right .guitar-btn:not(.guitar-btn-primary) .guitar-btn-text {
        display: none;
    }
    .guitar-string-track { min-height: 2.75rem; }
    .guitar-fret { min-height: 2.75rem; }
}

/* ── Virtual Violin ── */
.violin-widget {
    position: relative;
    background-color: #1c1410;
    background-image:
        linear-gradient(165deg, rgba(28, 20, 16, 0.84) 0%, rgba(12, 10, 9, 0.9) 50%, rgba(28, 20, 16, 0.88) 100%),
        url("../images/violin/body-bg.jpg?v=1");
    background-size: cover;
    background-position: center;
    border-radius: 1.25rem;
    padding: 1rem 0.85rem 1.15rem;
    border: 1px solid rgba(217, 119, 6, 0.35);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
    color: #fafaf9;
    overflow: hidden;
}
.violin-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    margin-bottom: 0.65rem;
}
.violin-toolbar-left,
.violin-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}
.violin-mode {
    display: inline-flex;
    border-radius: 9999px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    overflow: hidden;
    background: rgba(0,0,0,0.25);
}
.violin-mode-btn {
    min-height: 2.4rem;
    padding: 0.35rem 0.75rem;
    border: none;
    background: transparent;
    color: #fde68a;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}
.violin-mode-btn.is-active {
    background: #fafaf9;
    color: #92400e;
}
.violin-field-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fcd34d;
}
.violin-vol {
    width: min(7.5rem, 24vw);
    accent-color: #d97706;
    min-height: 2rem;
}
.violin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(251, 191, 36, 0.4);
    background: rgba(255, 255, 255, 0.08);
    color: #fafaf9;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.violin-btn:hover { background: rgba(255, 255, 255, 0.14); }
.violin-btn-primary {
    background: linear-gradient(135deg, #f59e0b, #b45309);
    border-color: #fbbf24;
    color: #1c1917;
}
.violin-status {
    text-align: center;
    font-size: 0.85rem;
    color: #fcd34d;
    margin: 0 0 0.65rem;
    min-height: 1.25rem;
}
.violin-patterns {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}
.violin-pattern-btn {
    min-height: 2.35rem;
    min-width: 2.4rem;
    padding: 0.3rem 0.7rem;
    border-radius: 9999px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(255, 255, 255, 0.08);
    color: #fafaf9;
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: inherit;
}
.violin-pattern-btn.is-active {
    background: #fafaf9;
    color: #92400e;
    border-color: #fafaf9;
}
.violin-stage {
    position: relative;
    border-radius: 1rem;
    background-color: #1c1410;
    background-image:
        linear-gradient(180deg, rgba(28, 20, 16, 0.4) 0%, rgba(12, 10, 9, 0.55) 100%),
        url("../images/violin/fingerboard-bg.jpg?v=1");
    background-size: cover;
    background-position: center 45%;
    padding: 0.75rem 0.45rem 0.95rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.18), inset 0 8px 28px rgba(0,0,0,0.4);
}
.violin-board {
    position: relative;
    z-index: 1;
    min-width: 32rem;
}
.violin-pos-nums {
    display: grid;
    grid-template-columns: 2rem repeat(13, minmax(2rem, 1fr));
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(253, 230, 138, 0.8);
    text-align: center;
    margin-bottom: 0.25rem;
}
.violin-pos-open { font-size: 0.58rem; }
.violin-string-row {
    display: grid;
    grid-template-columns: 2rem 1fr;
    align-items: center;
    margin-bottom: 0.2rem;
}
.violin-string-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: #fde68a;
    text-align: center;
}
.violin-string-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(13, minmax(2rem, 1fr));
    min-height: 2.7rem;
    align-items: stretch;
}
.violin-string-line {
    position: absolute;
    left: 0; right: 0; top: 50%;
    height: 2px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, #a8a29e, #f5f5f4 30%, #e7e5e4 70%, #a8a29e);
    opacity: 0.85;
    pointer-events: none;
    z-index: 0;
    box-shadow: 0 1px 1px rgba(0,0,0,0.35);
}
.violin-string-row[data-string="3"] .violin-string-line { height: 1.5px; opacity: 0.75; }
.violin-string-row[data-string="0"] .violin-string-line { height: 2.5px; }

.violin-pos {
    position: relative;
    z-index: 1;
    min-height: 2.7rem;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}
.violin-pos::after {
    content: "";
    position: absolute;
    right: 0; top: 12%; bottom: 12%;
    width: 2px;
    background: linear-gradient(180deg, #d6d3d1, #78716c);
    border-radius: 1px;
    opacity: 0.8;
    pointer-events: none;
}
.violin-pos-open::after { display: none; }
.violin-pos-open { border-right: 3px solid #fbbf24; }
.violin-pos-dot {
    position: absolute;
    left: 50%; top: 50%;
    width: 0.9rem; height: 0.9rem;
    margin: -0.45rem 0 0 -0.45rem;
    border-radius: 50%;
    border: 2px solid transparent;
    background: transparent;
    transition: background 0.1s, transform 0.1s, box-shadow 0.1s;
}
.violin-pos:hover .violin-pos-dot {
    border-color: rgba(253, 230, 138, 0.75);
}
.violin-pos.is-pattern .violin-pos-dot {
    background: #f59e0b;
    border-color: #fde68a;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35);
}
.violin-pos.is-playing .violin-pos-dot {
    background: #fafaf9;
    border-color: #fbbf24;
    transform: scale(1.3);
    box-shadow: 0 0 18px rgba(251, 191, 36, 0.75);
}
.violin-keys-hint {
    margin: 0.85rem 0 0.35rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #d6d3d1;
    text-align: center;
}
.violin-keys-hint kbd {
    display: inline-block;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.08rem 0.32rem;
    border-radius: 0.3rem;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: rgba(28, 20, 16, 0.7);
    color: #fde68a;
}
.violin-widget .privacy-note-inline {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: #a8a29e;
    text-align: center;
}
.violin-stage:fullscreen,
.violin-stage:-webkit-full-screen {
    background-color: #1c1410;
    background-image:
        linear-gradient(180deg, rgba(28, 20, 16, 0.45) 0%, rgba(12, 10, 9, 0.6) 100%),
        url("../images/violin/fingerboard-bg.jpg?v=1");
    background-size: cover;
    background-position: center;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.violin-stage:fullscreen .violin-board,
.violin-stage:-webkit-full-screen .violin-board {
    min-width: min(1000px, 100%);
    width: 100%;
}
@media (max-width: 640px) {
    .violin-toolbar-right .violin-btn:not(.violin-btn-primary) .violin-btn-text {
        display: none;
    }
    .violin-string-track,
    .violin-pos { min-height: 2.85rem; }
}
