* { box-sizing: border-box; }
body {
  margin: 0;
  background: #0d1117;
  color: #c9d1d9;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  overflow-x: clip;   /* nothing gets to widen the page */
}
a { color: #58a6ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h2, h3 { margin: 0 0 12px; font-weight: 600; }
.muted { color: #8b949e; }
.small-text { font-size: 12px; }

.topbar {
  display: flex; align-items: baseline; gap: 12px;
  padding: 12px 20px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}
.brand { font-size: 18px; font-weight: 700; color: #e6edf3; }
.brand:hover { text-decoration: none; }
.tagline { color: #8b949e; font-size: 13px; }

main { max-width: 1500px; margin: 0 auto; padding: 16px 20px 60px; }

.panel {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

button {
  background: #21262d; color: #c9d1d9;
  border: 1px solid #30363d; border-radius: 6px;
  padding: 5px 12px; cursor: pointer; font-size: 13px;
}
button:hover { background: #30363d; }
button:disabled { opacity: 0.45; cursor: default; }
button.small { padding: 2px 9px; font-size: 12px; }
button.primary { background: #238636; border-color: #2ea043; color: #fff; }
button.primary:hover { background: #2ea043; }
button.danger { color: #f85149; }
button.active { background: #1f6feb; border-color: #388bfd; color: #fff; }
input[type="text"] {
  background: #0d1117; color: #c9d1d9;
  border: 1px solid #30363d; border-radius: 6px; padding: 5px 10px;
}
select.small {
  background: #21262d; color: #c9d1d9;
  border: 1px solid #30363d; border-radius: 6px;
  padding: 2px 5px; font-size: 12px; cursor: pointer;
}

/* upload */
.dropzone {
  border: 2px dashed #30363d; border-radius: 10px;
  padding: 26px; text-align: center;
}
.dropzone.drag { border-color: #58a6ff; background: #0d1524; }
.filelink { color: #58a6ff; cursor: pointer; }
.url-import { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.url-import input { width: min(420px, 90%); }
.progress { height: 8px; background: #21262d; border-radius: 4px; margin: 12px auto 6px; max-width: 420px; overflow: hidden; }
#upload-bar { height: 100%; width: 0; background: #1f6feb; transition: width 0.15s; }

/* library */
.rec-table { width: 100%; border-collapse: collapse; }
.rec-table th { text-align: left; color: #8b949e; font-weight: 500; font-size: 12px; padding: 6px 10px; border-bottom: 1px solid #30363d; }
.rec-table td { padding: 9px 10px; border-bottom: 1px solid #21262d; vertical-align: top; }

/* recording page */
.rec-header { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 14px; flex-wrap: wrap; }
.rec-header h2 { margin: 0; }
.spinner {
  display: inline-block; width: 16px; height: 16px; margin-right: 8px;
  border: 2px solid #30363d; border-top-color: #58a6ff; border-radius: 50%;
  animation: spin 0.8s linear infinite; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.wave-panel { padding: 10px; }
.overview-canvas { width: 100%; height: 48px; display: block; border-radius: 6px; margin-bottom: 6px; cursor: pointer; }
.main-canvas { width: 100%; height: 240px; display: block; border-radius: 6px; cursor: text; touch-action: none; }
.transport { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.play-btn { font-size: 16px; padding: 6px 18px; }
.piano-btn { background: #1f6feb; border-color: #388bfd; color: #fff; }
.piano-btn:hover { background: #388bfd; }
.piano-btn.active { background: #d29922; border-color: #e3b341; }
.loop-label { color: #8b949e; font-size: 13px; user-select: none; }
.speed-group, .zoom-group { display: inline-flex; gap: 4px; }
.sel-info { font-variant-numeric: tabular-nums; min-width: 210px; }
.hint { font-size: 12px; margin-top: 8px; }

/* analysis */
.analysis-panel { background: #dfe6f2; border-color: #b9c6da; }
.analysis-row { display: flex; align-items: stretch; gap: 14px; }
.chord-col { display: flex; flex-direction: column; gap: 8px; flex: 0 0 130px; width: 130px; }
.notes-btn {
  background: #eef2f8; color: #2b3a4e; border-color: #b9c6da;
  font-weight: 600;
}
.notes-btn:hover:not(:disabled) { background: #dce6f5; }
.chord-label {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 700; color: #1c2530;
  background: #eef2f8; border-radius: 10px; padding: 8px;
}

/* chord timeline */
.chord-timeline { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.tl-block {
  min-width: 68px; max-width: 100%; cursor: pointer; text-align: center;
  background: #eef2f8; border: 1px solid #b9c6da; border-radius: 8px;
  padding: 6px 4px 4px; user-select: none; overflow: hidden;
}
.tl-chord { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-block:hover { background: #dce6f5; }
.tl-block.active { background: #cfe0f7; border-color: #1f6feb; box-shadow: 0 0 0 1px #1f6feb inset; }
.tl-chord { display: block; font-weight: 700; color: #1c2530; font-size: 16px; }
.tl-time { display: block; font-size: 10px; color: #6b7a90; font-variant-numeric: tabular-nums; }
.keyboard-canvas { flex: 1; height: 215px; display: block; min-width: 0; }
.analysis-panel.with-spec .keyboard-canvas { height: 300px; }
.analysis-footer { display: flex; align-items: baseline; gap: 16px; margin-top: 8px; }
.notes-line { color: #46536b; font-size: 13px; flex: 1; min-width: 0; }
.spec-toggle { color: #6b7a90; font-size: 12px; user-select: none; white-space: nowrap; }

/* captures */
.captures-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.captures-header h3 { margin: 0; flex: 0 0 auto; }
.captures-header input { flex: 1; max-width: 380px; }
.capture-row {
  display: flex; align-items: baseline; gap: 14px;
  padding: 7px 4px; border-bottom: 1px solid #21262d;
}
.cap-time { font-variant-numeric: tabular-nums; color: #8b949e; min-width: 190px; }
.cap-chord { font-weight: 700; min-width: 60px; color: #e6edf3; }
.cap-notes { color: #8b949e; flex: 1; }
.cap-label { color: #c9d1d9; flex: 1; }
.cap-actions { display: inline-flex; gap: 6px; }

.site-footer { text-align: center; color: #56606b; font-size: 12px; padding: 16px 0 24px; }
.site-footer a { color: #8b949e; }

/* ---------- SaaS chrome ---------- */
.topnav { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 14px; }
.topnav a { color: #c9d1d9; }
.topnav a:hover { color: #fff; text-decoration: none; }
.topnav .navcta {
  background: #238636; color: #fff; padding: 6px 14px; border-radius: 6px; font-weight: 600;
}
.topnav .navcta:hover { background: #2ea043; }
.inline-form { display: inline; }
button.linklike {
  background: none; border: none; color: #c9d1d9; padding: 0; font-size: 14px;
}
button.linklike:hover { color: #fff; background: none; }
.trialbar {
  background: #1c2a45; color: #a9c1e8; text-align: center;
  padding: 6px 12px; font-size: 13px; border-bottom: 1px solid #263b5c;
}
.trialbar a { color: #7ea6ff; }

/* ---------- marketing ---------- */
.hero { text-align: center; padding: 48px 16px 24px; }
.hero h1 { font-size: 44px; margin: 0 0 14px; color: #f0f4f8; letter-spacing: -0.5px; }
.hero-sub { font-size: 19px; color: #9daabb; max-width: 640px; margin: 0 auto 24px; line-height: 1.55; }
.cta {
  display: inline-block; background: #238636; color: #fff !important;
  padding: 12px 26px; border-radius: 8px; font-weight: 700; font-size: 16px;
}
.cta:hover { background: #2ea043; text-decoration: none; }
.hero-shot { max-width: 1080px; margin: 30px auto 0; }
.hero-shot img {
  width: 100%; border-radius: 12px; border: 1px solid #30363d;
  box-shadow: 0 18px 60px rgba(0,0,0,0.5);
}
.features, .how, .faq, .pricing-strip { max-width: 1080px; margin: 48px auto; padding: 0 16px; }
.features h2, .how h2, .faq h2, .pricing-strip h2, .who h2 { font-size: 28px; text-align: center; margin-bottom: 26px; color: #e6edf3; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: 16px; }
.feature {
  background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 20px;
}
.feature h3 { margin: 0 0 8px; font-size: 17px; color: #e6edf3; }
.feature p { margin: 0; color: #9daabb; font-size: 14px; line-height: 1.55; }
.feature-hi { border-color: #2b5f6e; background: #12222a; }
.feature-hi h3 { color: #3ed3e8; }
.who { max-width: 860px; margin: 48px auto; text-align: center; }
.who p { color: #9daabb; font-size: 16px; line-height: 1.6; }

.price-card {
  max-width: 400px; margin: 0 auto; text-align: center;
  background: #161b22; border: 1px solid #2ea043; border-radius: 14px; padding: 28px;
}
.price-plan { font-size: 15px; color: #8b949e; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.price-amount { font-size: 46px; font-weight: 800; color: #f0f4f8; margin: 8px 0 4px; }
.price-period { font-size: 17px; color: #8b949e; font-weight: 400; }
.price-features { list-style: none; padding: 0; margin: 18px 0 22px; text-align: left; }
.price-features li { padding: 6px 0 6px 26px; position: relative; color: #c9d1d9; font-size: 14px; }
.price-features li::before { content: "✓"; position: absolute; left: 4px; color: #2ea043; font-weight: 700; }

.faq details {
  background: #161b22; border: 1px solid #30363d; border-radius: 10px;
  padding: 14px 18px; margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 600; color: #e6edf3; }
.faq details p { color: #9daabb; margin: 10px 0 2px; line-height: 1.55; }

/* ---------- auth + billing ---------- */
.authbox { max-width: 420px; margin: 48px auto; }
.authbox form label { display: block; margin-bottom: 14px; color: #8b949e; font-size: 13px; }
.authbox form input {
  display: block; width: 100%; margin-top: 5px;
  background: #0d1117; color: #c9d1d9; border: 1px solid #30363d;
  border-radius: 6px; padding: 9px 12px; font-size: 15px;
}
.authbox form input:focus { border-color: #388bfd; outline: none; }
button.wide { width: 100%; padding: 10px; font-size: 15px; margin-top: 6px; }
.form-error { color: #f85149; background: #2d1214; border: 1px solid #6e2c2f; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.billing-status { font-size: 18px; font-weight: 600; }
.status-active { color: #3fb950; }
.status-trial { color: #7ea6ff; }
.status-past_due { color: #d29922; }
.status-canceled { color: #f85149; }
.status-comp { color: #a371f7; }
.narrow { max-width: 720px; margin: 32px auto; }
.legal h3 { margin-top: 22px; }
.legal p { color: #9daabb; line-height: 1.6; }

/* ---------- admin ---------- */
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { background: #0d1117; border: 1px solid #30363d; border-radius: 10px; padding: 12px 18px; min-width: 110px; text-align: center; }
.stat-n { font-size: 24px; font-weight: 700; color: #e6edf3; }
.stat-l { font-size: 12px; color: #8b949e; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #21262d; font-size: 12px; }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 10px 14px;
  }
  .tagline { display: none; }
  .topnav {
    width: 100%;
    margin-left: 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 13px;
  }
  .topnav .navcta { padding: 5px 12px; }
  main { padding: 12px 12px 48px; }
  .panel { padding: 12px; overflow-x: auto; }
  .hero { padding: 28px 8px 12px; }
  .hero h1 { font-size: 30px; }
  .hero-sub { font-size: 16px; }
  .features h2, .how h2, .faq h2, .pricing-strip h2, .who h2 { font-size: 22px; }
  .features, .how, .faq, .pricing-strip { margin: 30px auto; padding: 0 8px; }
  .hero-shot img { border-radius: 8px; }
  .price-amount { font-size: 38px; }
  .authbox { margin: 24px auto; }
  .stat { min-width: 90px; padding: 10px 12px; }
  .rec-header h2 { font-size: 18px; }
}
