/* Scale builder on /major-scales-chart and /minor-scales-chart (widget: tool/widgets/scale-builder.html).
   Everything is scoped to .sb. Dark skin on screen; white paper and black ink when printed (html.mtp-print-tool). */
@font-face { font-family: 'MtpAcc'; src: url('/vendor/vexflow/fonts/bravura-acc.woff2') format('woff2'); font-style: normal; font-weight: 400 700; unicode-range: U+266D-266F, U+1D12A-1D12B; font-display: swap; }
.sb { margin: 8px 0 20px; padding: clamp(14px, 2.4vw, 24px); }
.sb [hidden] { display: none; }
.sb-a { font-family: 'MtpAcc', 'Source Sans 3', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-style: normal; font-weight: 400; font-size: 1.3em; line-height: 0; position: relative; top: -.1em; margin: 0 .02em; }

.sb-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-bottom: 16px; }
.sb-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sb-f select { min-width: 120px; }
.sb-f-tempo input { width: 7.5em; }

.sb-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; }
.sb-name { margin: 0; font-size: clamp(26px, 4.4vw, 38px); line-height: 1.1; color: var(--mtp-brass-bright); font-weight: 700; border: 0; padding: 0; }
.sb-notes { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 20px; font-weight: 700; color: var(--mtp-paper); }
.sb-then { color: var(--mtp-muted); font-weight: 400; font-size: 14px; align-self: center; }
.sb-facts { list-style: none; margin: 10px 0 0 !important; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--mtp-paper); font-size: 15px; }
.sb-facts li { max-width: 62ch; margin: 0; padding: 0; list-style: none; }
.sb-facts strong { color: var(--mtp-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-right: 6px; }

.sb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 6px; }
.sb-sep { width: 14px; }
.sb-status { color: var(--mtp-brass-bright); font-size: 14px; }
.sb-links { margin: 6px 0 12px; color: var(--mtp-muted); font-size: 14px; line-height: 2.1; }
.sb-links button { min-height: 32px !important; padding: 2px 12px !important; font-size: 14px !important; margin-left: 2px; }
.sb-muted { color: var(--mtp-muted); font-size: .9em; }
.sb-dot { margin: 0 6px; }

/* the staff: cream paper with dark ink */
.sb-staves { margin: 12px 0; padding: 6px 8px; background: #f4e9cf; color: #1a1205; border-radius: 2px; overflow-x: auto; line-height: 0; -webkit-overflow-scrolling: touch; }
.sb-svg { display: block; width: 100%; min-width: 460px; max-width: 880px; height: auto; margin: 0 auto; overflow: visible; }
.sb-svg text { fill: currentColor; stroke: none; }
.sb-nm { font: 700 17px "Source Sans 3", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; }
.sb-nm, .sb-st, .sb-dg, .sb-rowlabel, .sb-kt { font-family: "Source Sans 3", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; }
.sb-nm tspan, .sb-kt tspan { font-family: 'MtpAcc', inherit; }
.sb-svg text.sb-nm { font-family: 'MtpAcc', "Source Sans 3", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; }
.sb-st { font-size: 13px; font-weight: 500; fill: #4a3b1a; }
.sb-st-h { font-weight: 800; fill: #a84f2a; }
.sb-dg { font-size: 12px; fill: #5a4a26; }
.sb-rowlabel { font-size: 13px; font-weight: 700; fill: #5a4a26; }
.sb-acc { font-family: 'MtpAcc', sans-serif; font-weight: 400; font-size: 1.3em; }
.sb-svg text.is-on, .sb-nm.is-on { fill: #a84f2a; }

/* keyboard */
.sb-keyboard-box { margin: 10px 0 4px; }
.sb-kb { display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto 0 0; user-select: none; }
.sb-k { cursor: pointer; }
.sb-wk rect { fill: #f6f1e4; stroke: #8a7a55; stroke-width: 1; }
.sb-bk rect { fill: #17121f; stroke: #000; stroke-width: 1; }
.sb-wk.sb-on rect { fill: #e0bd72; stroke: #8a6a1e; }
.sb-bk.sb-on rect { fill: #c49a49; stroke: #6e4f12; }
.sb-wk.sb-root rect { fill: #c9893a; stroke: #6e4f12; }
.sb-bk.sb-root rect { fill: #a86a1f; stroke: #6e4f12; }
.sb-wk.sb-alt rect { fill: #f6f1e4; stroke: #a84f2a; stroke-width: 2.5; }
.sb-bk.sb-alt rect { fill: #17121f; stroke: #e08a5a; stroke-width: 2.5; }
.sb-k.is-on rect { fill: #e8663a; }
.sb-kt { font-size: 10.5px; font-weight: 700; fill: #1a1205; pointer-events: none; font-family: 'MtpAcc', "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.sb-bk .sb-kt { fill: #fff; }
.sb-kt-c { fill: #7a6a46; font-weight: 400; }
.sb-legend { margin: 6px 0 0; color: var(--mtp-muted); font-size: 13px; max-width: 70ch; }

/* tables */
.sb-tables { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 28px; margin-top: 16px; }
@media (min-width: 1180px) { .sb-tables { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); } }
.sb-tablebox h3 { margin: 12px 0 6px; font-size: 16px; color: var(--mtp-paper); }
.sb-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sb-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sb-table th, .sb-table td { text-align: left; padding: 5px 10px; border-bottom: 1px solid var(--mtp-line); vertical-align: middle; white-space: nowrap; }
.sb-table thead th { color: var(--mtp-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.sb-table tbody th { font-weight: 700; color: var(--mtp-brass-bright); }
.sb-n { font-weight: 700; color: var(--mtp-paper); }
.sb-diff { color: #f0b49a; }
.sb-table tr.is-on > * { background: var(--mtp-raised-2); color: var(--mtp-brass-bright); }
.sb-play { white-space: nowrap; }
.sb-play button { min-height: 32px !important; padding: 2px 10px !important; margin-right: 4px; font-size: 13px !important; }
.sb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* all-keys sheet: built on demand, only ever shown on paper */
.sb-all { display: none; }

@media (max-width: 560px) {
  .sb-controls { gap: 8px 10px; }
  .sb-f select { min-width: 0; }
  .sb-actions button { flex: 1 1 auto; }
  .sb-table { font-size: 14px; }
}

@media print {
  html.mtp-print-tool .sb { border: 0 !important; padding: 0 !important; margin: 0 !important; background: none !important; }
  html.mtp-print-tool .sb-name { color: #111 !important; font-size: 24px; }
  html.mtp-print-tool .sb-staves { background: #fff !important; color: #000 !important; padding: 0; overflow: visible; }
  html.mtp-print-tool .sb-svg { min-width: 0; max-width: 100%; }
  html.mtp-print-tool .sb-svg text, html.mtp-print-tool .sb-st, html.mtp-print-tool .sb-dg, html.mtp-print-tool .sb-rowlabel, html.mtp-print-tool .sb-st-h { fill: #000 !important; }
  html.mtp-print-tool .sb-wk rect { fill: #fff !important; stroke: #000 !important; }
  html.mtp-print-tool .sb-bk rect { fill: #000 !important; stroke: #000 !important; }
  html.mtp-print-tool .sb-wk.sb-on rect { fill: #cfcfcf !important; }
  html.mtp-print-tool .sb-bk.sb-on rect { fill: #666 !important; }
  html.mtp-print-tool .sb-wk.sb-root rect { fill: #888 !important; }
  html.mtp-print-tool .sb-bk.sb-root rect { fill: #444 !important; }
  html.mtp-print-tool .sb-wk.sb-alt rect { fill: #fff !important; stroke-width: 3; }
  html.mtp-print-tool .sb-bk.sb-alt rect { stroke: #888 !important; stroke-width: 3; }
  html.mtp-print-tool .sb-bk .sb-kt { fill: #fff !important; }
  html.mtp-print-tool .sb-wk .sb-kt { fill: #000 !important; }
  html.mtp-print-tool .sb-kb { max-width: 520px; }
  html.mtp-print-tool .sb-tables { grid-template-columns: minmax(0, 1fr); }
  html.mtp-print-tool .sb-tablebox, html.mtp-print-tool .sb-staves { break-inside: avoid; }
  html.mtp-print-tool .sb-table th, html.mtp-print-tool .sb-table td { border-bottom: 1px solid #999 !important; padding: 3px 8px; font-size: 12px; }
  html.mtp-print-tool .sb-notes, html.mtp-print-tool .sb-facts { font-size: 13px; }
  html.mtp-print-tool .sb-legend { color: #111 !important; }
  /* all 15 keys */
  html.mtp-print-tool .sb.sb-print-all .sb-result { display: none !important; }
  html.mtp-print-tool .sb.sb-print-all .sb-all { display: block; column-count: 2; column-gap: 18px; }
  html.mtp-print-tool .sb-all-title { font-size: 15px; margin: 0 0 6px; color: #000 !important; column-span: all; }
  html.mtp-print-tool .sb-all-item { break-inside: avoid; margin: 0 0 4px; }
  html.mtp-print-tool .sb-all-item h3 { margin: 4px 0 0; font-size: 13px; color: #000 !important; }
  html.mtp-print-tool .sb-all .sb-staffbox { line-height: 0; }
  html.mtp-print-tool .sb-all .sb-svg { max-width: 100%; min-width: 0; width: 100%; }
}
