/* Key & BPM Finder — tool-specific styles. Reuses tokens + globals from
   /styles.css (wrap, brand, btn, footer). */

/* ── tool nav link (App link in the shared header) ────────────────── */
.nav__link--ext {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 0.95rem;
  transition: color 0.2s var(--ease);
}
.nav__link--ext:hover { color: var(--ink); }
.nav__link--ext svg { width: 15px; height: 15px; }

/* ── hero ─────────────────────────────────────────────────────────── */
.kb-hero { text-align: center; padding: clamp(40px, 8vw, 84px) 0 clamp(18px, 3vw, 30px); }
.kb-hero__title {
  font-size: clamp(2.1rem, 6vw, 3.6rem); line-height: 1.04; letter-spacing: -0.02em;
  font-weight: 600; margin: 0 0 14px;
}
.kb-hero__sub {
  font-size: clamp(1rem, 2.2vw, 1.18rem); color: var(--ink-soft);
  max-width: 38ch; margin: 0 auto; line-height: 1.5;
}

/* ── the tool card ────────────────────────────────────────────────── */
.kb { max-width: 760px; margin: 0 auto clamp(40px, 7vw, 72px); }

.kb-drop {
  position: relative; border: 1.5px dashed var(--line-2); border-radius: var(--radius-lg);
  background: var(--surface); padding: clamp(34px, 6vw, 56px) 24px; text-align: center;
  cursor: pointer; transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.kb-drop:hover, .kb-drop.is-over { border-color: var(--ink-soft); background: var(--surface-2); }
.kb-drop.is-over { transform: scale(1.005); }
.kb-drop__icon { display: block; width: 46px; height: 46px; margin: 0 auto 16px; color: var(--ink-soft); }
.kb-drop__icon svg { width: 100%; height: 100%; }
.kb-drop__title { font-size: 1.22rem; font-weight: 600; margin: 0 0 6px; }
.kb-drop__sub { color: var(--ink-soft); margin: 0 0 12px; font-size: 0.98rem; }
.kb-drop__browse {
  background: none; border: none; color: var(--ink); font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0;
}
.kb-drop__note { font-size: 0.83rem; color: var(--ink-faint); margin: 0; }

/* ── player (top of the result) ───────────────────────────────────── */
.kb-player {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin: 0 0 14px;
}
.kb-player__play {
  flex: none; width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  background: var(--ink); border: none; color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center; transition: transform 0.05s;
}
.kb-player__play:active { transform: scale(0.94); }
.kb-player__play svg { width: 20px; height: 20px; }
.kb-player__play .ic-pause { display: none; }
.kb-player.is-playing .ic-play { display: none; }
.kb-player.is-playing .ic-pause { display: block; }
.kb-player__seek {
  flex: 1 1 auto; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px;
  background: var(--surface-2); outline: none; cursor: pointer;
}
.kb-player__seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); cursor: pointer; }
.kb-player__seek::-moz-range-thumb { width: 14px; height: 14px; border: none; border-radius: 50%; background: var(--ink); cursor: pointer; }
.kb-player__time { flex: none; font-size: 0.8rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* loading dots inside a stat value while detecting */
.kb-dots { display: inline-flex; gap: 6px; vertical-align: middle; }
.kb-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); animation: kb-dot 1s var(--ease) infinite; }
.kb-dots i:nth-child(2) { animation-delay: 0.15s; }
.kb-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes kb-dot { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* ── result ───────────────────────────────────────────────────────── */
.kb-result__file {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 18px; padding: 0 2px;
}
.kb-result__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-result__meta { color: var(--ink-faint); font-size: 0.85rem; flex: none; }
.kb-result__change {
  background: none; border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink-soft);
  font: inherit; font-size: 0.85rem; padding: 6px 14px; cursor: pointer; flex: none;
  transition: border-color 0.2s, color 0.2s;
}
.kb-result__change:hover { border-color: var(--ink-soft); color: var(--ink); }

.kb-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .kb-stats { grid-template-columns: 1fr; } }
.kb-stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; text-align: center;
}
.kb-stat__label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); margin: 0 0 10px; }
.kb-stat__value { font-size: clamp(2.4rem, 8vw, 3.4rem); font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.kb-stat__value small { font-size: 1rem; font-weight: 500; color: var(--ink-soft); letter-spacing: 0; }
.kb-stat__extra { margin: 12px 0 0; font-size: 0.85rem; color: var(--ink-soft); min-height: 1.2em; }
.kb-camelot {
  display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line-2); font-size: 0.82rem; color: var(--ink-soft);
}
.kb-conf { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.kb-conf--hi { background: #5BD6A0; } .kb-conf--mid { background: #E8C15A; } .kb-conf--lo { background: #E07A6B; }

.kb-tap {
  margin: 16px auto 0; display: block;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink);
  font: inherit; font-weight: 600; padding: 10px 20px; cursor: pointer; transition: background 0.15s, transform 0.05s;
}
.kb-tap:hover { background: var(--line); }
.kb-tap:active { transform: scale(0.96); }
.kb-tap small { display: block; font-weight: 400; font-size: 0.72rem; color: var(--ink-faint); }

/* ── prose / SEO content ──────────────────────────────────────────── */
.kb-content { max-width: 720px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) 0 clamp(50px, 9vw, 90px); }
.kb-content h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); letter-spacing: -0.01em; margin: 40px 0 14px; }
.kb-content h3 { font-size: 1.12rem; margin: 26px 0 8px; }
.kb-content p, .kb-content li { color: var(--ink-soft); line-height: 1.65; }
.kb-content a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.kb-content ul { padding-left: 1.1em; }
.kb-content li { margin: 6px 0; }
.kb-faq { border-top: 1px solid var(--line); margin-top: 12px; }
.kb-faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.kb-faq summary { cursor: pointer; font-weight: 600; color: var(--ink); padding: 16px 2px; list-style: none; position: relative; }
.kb-faq summary::-webkit-details-marker { display: none; }
.kb-faq summary::after { content: "+"; position: absolute; right: 4px; font-weight: 400; color: var(--ink-soft); transition: transform 0.2s; }
.kb-faq details[open] summary::after { content: "−"; }
.kb-faq details p { margin: 0 2px 16px; }

[hidden] { display: none !important; }
