/* ==========================================================================
   Toko Gitar AYRI — tools.css (tampilan komponen alat latihan)
   Tuner: panel penunjuk, gelembung, nada, senar, acuan A4, editor senar.
   Chord: pencarian, kartu chord, diagram SVG (chord-engine.js), pratinjau, putar.
   Metronom: panggung analog/digital/LED/kedip, tempo, aksen, sakelar, slider.
   Transkrip: area unggah, progres, panggung chord, garis waktu, daftar, kamus, cetak.
   Nama kelas mengikuti yang dipakai skrip tuner (jangan diganti).
   Kerangka layar & kontrol form ada di app.css.
   ========================================================================== */

/* 1. Panel penunjuk — selalu gelap, gaya alat tuner fisik
      (token gelap untuk .tm didefinisikan di theme-dark.css)
   ========================================================================== */
.tm {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  padding: 12px 12px 16px;
  border: 1px solid rgba(255, 255, 255, .06); border-radius: var(--r-xl);
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(226, 166, 90, .14), transparent 70%),
    var(--bg);
  color: var(--ink); text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 18px 40px -18px rgba(28, 22, 16, .55);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.tm.ok {
  border-color: rgba(92, 209, 150, .55);
  background:
    radial-gradient(80% 70% at 50% 35%, rgba(46, 180, 115, .2), transparent 70%),
    var(--bg);
  box-shadow: 0 0 0 4px rgba(46, 180, 115, .18), 0 18px 40px -18px rgba(28, 22, 16, .55);
}

/* Bidang penunjuk: grid halus, zona tepat (±4 sen), skala -50…+50 sen */
.bf {
  position: relative; overflow: hidden;
  flex: 1 1 auto; min-height: 88px;
  border: 1px solid rgba(255, 255, 255, .05); border-radius: var(--r-lg);
  background:
    linear-gradient(90deg, transparent 46.8%, rgba(46, 180, 115, .12) 46.8% 53.2%, transparent 53.2%),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(255, 255, 255, .04) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(255, 255, 255, .04) 23px 24px),
    rgba(0, 0, 0, .24);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, .45);
}
.bf::after {
  content: ""; position: absolute; left: 10%; right: 10%; bottom: 0; height: 10px; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(239, 232, 221, .32) 0 1px, transparent 1px 10%);
  border-right: 1px solid rgba(239, 232, 221, .32);
}
.bf-mid {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: linear-gradient(180deg, transparent, rgba(226, 166, 90, .75) 18%, rgba(226, 166, 90, .75) 82%, transparent);
}
.bf-s { position: absolute; top: 8px; font: 600 1.5rem/1 var(--font-display); color: var(--ink-3); }
.bf-fl { left: 14px; }
.bf-sh { right: 14px; }
#trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Gelembung penunjuk */
.bf-bub {
  position: absolute; z-index: 1; top: 14px; left: 50%;
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin-left: -28px;
  border: 3px solid rgba(239, 232, 221, .22); border-radius: 50%;
  background: #231D18;
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, .6);
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.bf-bub::after {
  content: ""; position: absolute; bottom: -9px; left: 50%;
  width: 12px; height: 12px; margin-left: -6px;
  background: inherit; border: solid; border-color: inherit; border-width: 0 3px 3px 0;
  border-radius: 0 0 3px 0; transform: rotate(45deg);
}
.bf-bub b { position: relative; z-index: 1; font: 800 1.0625rem/1 var(--font-sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.bf-bub.warn { border-color: #E2A65A; }
.bf-bub.good { border-color: #3CC383; background: #173526; box-shadow: 0 0 0 6px rgba(46, 180, 115, .2), 0 8px 18px -6px rgba(0, 0, 0, .6); }
.bf-bub i {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: none; padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--r-pill);
  background: rgba(35, 29, 24, .9);
  font: 700 .8125rem/1 var(--font-sans); font-style: normal; color: var(--ink); white-space: nowrap;
}
.bf-bub.on i { display: block; }
.bf-bub.l i { left: calc(100% + 10px); }
.bf-bub.r i { right: calc(100% + 10px); }
.bf-bub.good i { display: none; }

/* Nada, status, frekuensi */
.t-note {
  display: flex; align-items: flex-start; justify-content: center; gap: 2px;
  margin-top: 8px;
  font: 600 clamp(2.6rem, 9dvh, 4.6rem)/1 var(--font-display); font-optical-sizing: auto;
  color: var(--ink); letter-spacing: -.02em;
  transition: color .3s, text-shadow .3s;
}
.t-note sup { margin-top: .12em; font: 700 .32em/1 var(--font-sans); color: var(--ink-3); letter-spacing: 0; }
.tm.idle .t-note { color: var(--ink-3); }
/* tuner di HP: nada jadi pusat layar (besar), penunjuk setinggi secukupnya; di PC tetap tampilan lama */
@media (max-width: 899.98px), (max-height: 519.98px) {
  .tuner-app .bf { flex: 0 0 auto; height: clamp(110px, 22dvh, 230px); }
  .tuner-app .t-note { margin-top: 14px; font-size: clamp(3.6rem, 13dvh, 8rem); }
}
.tm.ok .t-note { text-shadow: 0 0 28px rgba(46, 180, 115, .55); }
.t-status { min-height: 1.4em; font-size: 1rem; font-weight: 700; color: var(--ink-2); }
.t-status.ok { color: #5CD196; }
.t-status.bad { color: #E9B567; }
.t-hz { font-size: .8125rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* 2. Tombol senar
   ========================================================================== */
.t-strings { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(36px, 1fr)); gap: 6px; }
.t-string {
  position: relative;
  display: grid; grid-template-columns: auto auto; justify-content: center; align-content: center; align-items: baseline;
  min-height: 52px; padding: 0 2px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font: 700 1.0625rem/1.1 var(--font-sans);
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s, transform .15s var(--ease);
}
.t-string sub { font-size: .66em; font-weight: 700; color: var(--ink-3); vertical-align: baseline; }
.t-string small { display: none; grid-column: 1 / -1; margin-top: 3px; font-size: .625rem; font-weight: 600; color: var(--ink-3); }
.t-string:hover { border-color: var(--ink-3); }
.t-string:active { transform: scale(.94); }
.t-string.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-soft); }
.t-string.act { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.t-string.act sub, .t-string.act small { color: inherit; opacity: .7; }
.t-string.done::after {
  content: ""; position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #2FB574; box-shadow: 0 0 0 2px var(--surface);
}
.t-string.done { border-color: rgba(47, 181, 116, .7); }
.t-string.done.act { border-color: var(--wa); background: var(--wa); color: #fff; }
.t-string.done.act::after { box-shadow: 0 0 0 2px var(--wa); background: #fff; }

/* Tombol Auto menyala saat tidak ada senar target */
.tuner-app #auto { min-width: 58px; padding: 0 10px; border-radius: var(--r-sm); }
.tuner-app #strrow:not(:has(.t-string.on)) #auto { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.tuner-app #edopen { height: auto; border-radius: var(--r-sm); }
.tuner-app #pauto { border-radius: var(--r-sm); }

/* 3. Acuan A4
   ========================================================================== */
.a4row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: .8125rem; font-weight: 700; color: var(--ink-3);
}
.a4row > span:first-child { min-width: 22px; color: var(--ink-2); }
.a4row button {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font: 700 1.25rem/1 var(--font-sans); cursor: pointer;
  transition: border-color .2s, transform .15s var(--ease);
}
.a4row button:hover { border-color: var(--ink-3); }
.a4row button:active { transform: scale(.92); }
.a4row input {
  width: 78px; height: 44px; flex: none;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  text-align: center; font: 800 1.0625rem/1 var(--font-sans); font-variant-numeric: tabular-nums;
}
.a4row input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.a4row .a4r { width: auto; padding: 0 12px; border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); font-size: .8125rem; }
.t-a4s { margin-left: auto; font-size: .75rem; font-weight: 700; color: var(--wa-ink); }
.t-a4s.chg { color: var(--accent); }

/* Tombol mulai: ikon mikrofon (teks diatur skrip) */
.tuner-app #start { min-height: 54px; font-size: 1.0625rem; }
.tuner-app #start::before {
  content: ""; width: 20px; height: 20px; flex: none;
  background: currentColor;
  -webkit-mask: var(--i-mic) center / contain no-repeat;
  mask: var(--i-mic) center / contain no-repeat;
}

/* 4. Isi laci: editor senar, bantuan, ajakan servis
   ========================================================================== */
.t-editor { display: grid; gap: 8px; margin-top: 14px; }
.t-ed { display: grid; grid-template-columns: 76px 1fr 1fr; align-items: center; gap: 8px; }
.t-ed span { font-size: .875rem; font-weight: 700; color: var(--ink-2); }
.t-ed select {
  width: 100%; height: 44px; padding: 0 30px 0 12px;
  -webkit-appearance: none; appearance: none;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface) var(--chev) no-repeat right 9px center / 16px;
  color: var(--ink); font: 600 .9375rem/1.2 var(--font-sans); cursor: pointer;
}
.t-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.t-help { margin-top: 10px; font-size: .9375rem; line-height: 1.7; color: var(--ink-2); }
.t-help b { color: var(--ink); }
.drawer-in .pwa-btn { margin-top: 18px; }
.pwa-note { font-size: .875rem; }
.t-cta {
  display: block; margin-top: 20px; padding: 16px 18px;
  border: 1px solid rgba(18, 128, 77, .25); border-radius: var(--r-lg);
  background: var(--wa-soft); color: var(--ink-2);
  font-size: .9375rem; line-height: 1.6;
  transition: transform .3s var(--ease-out), border-color .2s;
}
.t-cta strong { color: var(--wa-ink); }
.t-cta:hover { transform: translateY(-2px); border-color: rgba(18, 128, 77, .5); }

/* 5. Chord: pencarian, kartu chord, diagram, pratinjau, putar
   ========================================================================== */
.srch {
  height: 44px; padding: 0 12px 0 38px;
  -webkit-appearance: none; appearance: none;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface) var(--i-search) no-repeat 12px center / 18px;
  color: var(--ink); font: 600 .9375rem/1.2 var(--font-sans);
  transition: border-color .2s, box-shadow .2s;
}
.srch::placeholder { color: var(--ink-3); font-weight: 500; }
.srch:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.srch.bad { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(180, 35, 24, .14); }
.qh { margin: -2px 0 8px; font-size: .75rem; font-weight: 700; color: var(--danger); }
.qh:empty { display: none; }
.chip.na { opacity: .4; }
.chip small { margin-left: 5px; font-size: .75em; font-weight: 600; opacity: .7; }

.chcard {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px 12px; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--surface); box-shadow: var(--shadow-md);
  text-align: left;
}
.chleft { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 0; overflow: hidden; }
.ch-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.ch-h > div { flex: 1 1 auto; min-width: 0; }
/* Nama chord selalu satu baris; ukuran huruf dikecilkan otomatis oleh site.js (data-fit) */
.ch-name {
  overflow: hidden; white-space: nowrap;
  font: 600 clamp(2.3rem, 8dvh, 4rem)/1.05 var(--font-display); font-optical-sizing: auto;
  letter-spacing: -.02em; color: var(--ink);
}
.ch-type { margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; font-weight: 600; color: var(--ink-3); }
.star {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--surface); color: var(--ink-3);
  font-size: 1.2rem; line-height: 1; cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s, transform .15s var(--ease);
}
.star:active { transform: scale(.88); }
.star[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); color: #E0A030; animation: star-pop .45s var(--spring); }
.ch-notes { display: none; font-size: .8125rem; line-height: 1.5; color: var(--ink-2); }
@media (min-height: 780px) { .ch-notes { display: block; } }
.ch-pinfo { font-size: .8125rem; line-height: 1.3; color: var(--ink-3); }
.ch-pinfo b { font-weight: 700; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.opts .chip { height: 32px; padding: 0 12px; font-size: .8125rem; }

/* Area diagram dengan latar "kertas" */
.chright {
  display: flex; align-items: center; justify-content: center;
  min-height: 0; padding: 6px;
  border-radius: var(--r-lg); background: var(--surface-2);
}
#dia { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
#dia .cd { width: auto; height: 100%; max-width: 100%; max-height: 100%; }

/* Diagram chord (SVG dibuat chord-engine.js; nama kelas jangan diganti) */
.cd { display: block; width: 100%; max-width: 300px; margin: 0 auto; }
.cd-s { stroke: var(--ink-2); stroke-linecap: round; }
.cd-f { stroke: var(--line-strong); stroke-width: 2; }
.cd-nut { stroke: var(--ink); stroke-width: 7; stroke-linecap: round; }
.cd-dot, .cd-barre { fill: var(--accent); }
.cd-dt { fill: var(--on-accent); font: 700 14px var(--font-sans); text-anchor: middle; }
.cd-o { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.cd-x { stroke: var(--danger); stroke-width: 3; stroke-linecap: round; }
.cd-nm { fill: var(--ink-3); font: 600 12px var(--font-sans); text-anchor: middle; }
.cd-fr { fill: var(--ink); font: 700 15px var(--font-sans); }
.cd-hit { fill: transparent; cursor: pointer; }
.cd-hit:hover { fill: rgba(128, 128, 128, .12); }
/* Piano */
.pk-w { fill: #FFFDF8; stroke: #CDBFAE; stroke-width: 1; }
.pk-b { fill: #1F1A16; stroke: #0E0B09; }
.pk-w.on { fill: #E0A048; }
.pk-b.on { fill: #A8620F; stroke: #6B3E08; }
.pk-t { fill: #1A140E; font: 700 11px var(--font-sans); text-anchor: middle; pointer-events: none; }
.pk-tb { fill: #fff; }
.pk-o { fill: var(--ink-3); font: 600 9px var(--font-sans); text-anchor: middle; }
html[data-theme="dark"] .pk-w { fill: #EDE6DB; stroke: #6E6358; }

/* Bawah kartu: pratinjau bentuk + cara memainkan */
.chbot { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; }
.navrow { display: flex; align-items: center; gap: 6px; }
.rb {
  display: grid; place-items: center; flex: 0 0 38px;
  width: 38px; height: 50px; padding: 0 0 .12em;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font: 600 1.7rem/1 var(--font-sans); cursor: pointer;
  transition: border-color .2s, transform .15s var(--ease);
}
.rb:hover { border-color: var(--ink-3); }
.rb:active { transform: scale(.9); }
.th { display: flex; flex: 1 1 0; justify-content: center; gap: 5px; min-width: 0; overflow: hidden; }
.th button {
  flex: 1 1 0; min-width: 30px; max-width: 58px; padding: 3px;
  border: 1px solid var(--line); border-radius: var(--r-xs);
  background: var(--surface-2); cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s var(--ease);
}
.th button:hover { border-color: var(--line-strong); }
.th button:active { transform: scale(.94); }
.th button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); background: var(--surface); }
.th svg { display: block; width: 100%; }
.th .cd-dt { display: none; }

.playrow { display: flex; align-items: center; gap: 6px; }
.playrow .seg {
  display: flex; flex: 1 1 0; gap: 3px; min-width: 0; padding: 3px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface-2);
}
.playrow .seg .chip {
  flex: 1 1 0; min-width: 0; height: 34px; padding: 0 4px;
  border: 0; background: transparent; color: var(--ink-3);
  font-size: .75rem; justify-content: center; white-space: nowrap;
}
.playrow .seg .chip[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
html[data-theme="dark"] .playrow .seg .chip[aria-pressed="true"] { background: var(--line-strong); }
.pbtn {
  flex: 0 0 auto; min-width: 96px; height: 42px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  background: var(--wa); color: #fff;
  font: 700 .875rem/1 var(--font-sans); white-space: nowrap; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 18px -8px rgba(18, 128, 77, .6);
  transition: background-color .2s, transform .15s var(--ease);
}
.pbtn:hover { background: var(--wa-hover); }
.pbtn:active { transform: scale(.95); }
.pbtn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: none; animation: pbp 1s ease-in-out infinite; }

/* Isi laci "Lainnya": favorit, progresi, tempo */
.hint { font-size: .9375rem; line-height: 1.6; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.drawer-in .chips .chip { height: 38px; }
.pre { display: inline-flex; align-items: center; gap: 2px; }
.drawer-in .fav-x { padding: 0 12px; }
.prog.on { box-shadow: 0 0 0 3px var(--accent-line); }
.pg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.fld { display: flex; flex-wrap: wrap; gap: 8px; font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.fld input[type=number] {
  width: 5rem; height: 44px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  text-align: center; font: 800 1rem/1 var(--font-sans); font-variant-numeric: tabular-nums;
}
.fld input[type=number]:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

@media (min-width: 900px) and (min-height: 520px) {
  .chcard { grid-template-columns: minmax(0, 4fr) minmax(0, 5fr); gap: 14px 18px; padding: 20px; }
  .chright { padding: 12px; }
  .th button { max-width: 64px; }
  .playrow .seg .chip { font-size: .8125rem; }
}
@media (max-height: 620px) {
  .ch-name { font-size: 2.2rem; }
  .chleft { gap: 3px; justify-content: flex-start; }
  .ch-pinfo { font-size: .75rem; }
}
@media (max-height: 600px) and (max-width: 899px) { .ch-pinfo { display: none; } }
main.app.fit1 .rb { height: 40px; }
main.app.fit1 .th button { max-width: 46px; }
main.app.fit1 .playrow .seg .chip { height: 30px; }
main.app.fit1 .pbtn { height: 38px; }

@keyframes star-pop { 40% { transform: scale(1.25); } }
@keyframes pbp { 50% { box-shadow: 0 0 0 6px var(--accent-soft); } }

/* 6. Metronom: panggung visual, tempo, aksen, pengaturan
   ========================================================================== */
.metro-app #mt {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px;
  border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--surface); box-shadow: var(--shadow-md);
}

/* Pilihan tampilan: segmented control */
.mt-tabs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px;
  padding: 3px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface-2);
}
.mt-tabs .chip {
  justify-content: center; height: 34px; padding: 0 4px;
  border: 0; background: transparent; color: var(--ink-3); font-size: .8125rem;
}
.mt-tabs .chip[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
html[data-theme="dark"] .mt-tabs .chip[aria-pressed="true"] { background: var(--line-strong); }

/* Panggung visual (selalu gelap; token dari theme-dark.css) */
.mt-vis {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex: 1 1 auto; min-height: 70px;
  border: 1px solid rgba(255, 255, 255, .05); border-radius: var(--r-lg);
  background:
    radial-gradient(70% 80% at 50% 10%, rgba(226, 166, 90, .16), transparent 70%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 5px),
    var(--bg);
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, .45);
  color: var(--ink);
}
.mt-vis > div, .mt-vis > svg { display: none; width: 100%; }
.mt-vis > .show { display: flex; }

/* Analog: badan kayu, batang nikel, pemberat brass (bisa digeser) */
.an { height: 100%; max-height: 100%; width: auto; max-width: 240px; padding: 8px 0 4px; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .5)); }
.an-body { fill: url(#g-wood); stroke: rgba(243, 228, 207, .45); stroke-width: 2; }
.an-rod { stroke: #D9D4CC; stroke-width: 4; stroke-linecap: round; }
.an-w { fill: url(#g-brass); stroke: #7A5A12; stroke-width: 1.5; cursor: grab; touch-action: none; }
.an-w:active { cursor: grabbing; }
.an-p { fill: #E8E0D0; stroke: #6E6358; }
.an-t { fill: #F3E4CF; font: 700 26px var(--font-sans); text-anchor: middle; }

/* Digital: layar LCD amber bergaya vintage */
.lcd {
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: calc(100% - 20px) !important; height: calc(100% - 20px); margin: 10px; padding: 10px;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #0D0A08, #17120E);
  box-shadow: inset 0 0 0 1px rgba(242, 201, 138, .14), inset 0 10px 26px rgba(0, 0, 0, .6);
}
.lcd-n {
  font: 700 clamp(2.6rem, 10dvh, 5rem)/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: .04em; color: #F2C98A; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(242, 201, 138, .55);
}
.lcd-t { font: 700 .8125rem/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .22em; text-transform: uppercase; color: rgba(242, 201, 138, .7); }
.boxes { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.boxes span { width: 26px; height: 10px; border-radius: 3px; background: rgba(242, 201, 138, .14); }
.boxes span.on { background: #F2C98A; box-shadow: 0 0 12px rgba(242, 201, 138, .7); }

/* LED */
.leds { flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(8px, 2vw, 14px); padding: 12px; }
.led {
  width: clamp(28px, 6dvh, 48px); height: clamp(28px, 6dvh, 48px); border-radius: 50%;
  border: 2px solid #3A2A22;
  background: radial-gradient(circle at 35% 30%, #5A1A16, #2A0B09);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6);
  transition: background .06s, box-shadow .06s;
}
.led.l2 { background: radial-gradient(circle at 35% 30%, #16422C, #0A2116); }
.led.l0 { opacity: .35; }
.led.on { border-color: #FF9B94; background: radial-gradient(circle at 35% 30%, #FF8A80, #FF3B30 60%); box-shadow: 0 0 22px 6px rgba(255, 59, 48, .6); }
.led.l2.on { border-color: #A7F3D0; background: radial-gradient(circle at 35% 30%, #A7F3D0, #34D399 60%); box-shadow: 0 0 22px 6px rgba(52, 211, 153, .6); }

/* Kedip */
.flash {
  align-items: center; justify-content: center; align-self: stretch;
  padding: 12px; text-align: center;
  font-size: .9375rem; font-weight: 700; color: var(--ink-3);
  transition: background-color .25s;
}
.flash.on { background: #E2A65A; color: #1A140E; transition: none; }
.flash.on2 { background: #2FB574; color: #fff; transition: none; }

/* Tempo */
.mt-bpm { display: flex; align-items: center; justify-content: center; gap: 14px; }
.mt-bpm .rb { flex: 0 0 52px; width: 52px; height: 52px; padding: 0; border-radius: 50%; font-size: 1.6rem; }
.mt-num { display: flex; flex-direction: column; align-items: center; min-width: 7.5rem; }
.mt-num input {
  width: 7.5rem; padding: 0; border: 0; border-radius: var(--r-xs); background: transparent;
  text-align: center; font: 600 clamp(2.4rem, 7dvh, 3.4rem)/1.05 var(--font-display); font-optical-sizing: auto;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.mt-num input:focus-visible { outline: none; box-shadow: 0 2px 0 var(--accent); }
.mt-num span { font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

/* Slider (tempo & volume) */
input[type=range].rg {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer;
  accent-color: var(--accent);
}
.rg::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: var(--line-strong); }
.rg::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px;
  border: 2px solid var(--accent); border-radius: 50%; background: var(--surface);
  box-shadow: 0 2px 6px rgba(28, 22, 16, .25);
}
.rg::-moz-range-track { height: 6px; border-radius: 6px; background: var(--line-strong); }
.rg::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--accent); }
.rg::-moz-range-thumb { width: 18px; height: 18px; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface); }
.rg:focus-visible { outline: none; }
.rg:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }

/* Mulai / tap */
.mt-act { display: grid; grid-template-columns: 1.5fr 1fr; gap: 8px; }
.mt-act .t-btn { width: 100%; padding: 0 .6rem; white-space: nowrap; }
.t-btn.on { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.t-btn.on:hover { background: var(--accent); }

/* Aksen ketukan */
.accr { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ad {
  width: 40px; height: 40px; padding: 0;
  border: 2px solid var(--line-strong); border-radius: 50%;
  background: var(--surface); color: var(--ink-3);
  font: 800 .875rem/1 var(--font-sans); cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.ad.l2 { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.ad.l1 { border-color: var(--accent); color: var(--ink); }
.ad.l0 { border-style: dashed; opacity: .45; }
.ad.cur { transform: scale(1.18); box-shadow: 0 0 0 4px var(--accent-soft); }

/* Pengaturan samping */
.mtside {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px;
  border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.metro-app .mtside select.sel { height: 40px; padding: 0 24px 0 9px; background-position: right 6px center; background-size: 14px; font-size: .8125rem; }
.metro-app .mtside .numin { height: 40px; font-size: .9375rem; }

/* Sakelar ala iOS untuk kotak centang */
.tgl { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: .8125rem; font-weight: 700; line-height: 1.15; color: var(--ink-2); cursor: pointer; }
.tgl input {
  -webkit-appearance: none; appearance: none;
  position: relative; flex: none; width: 42px; height: 26px; margin: 0;
  border-radius: var(--r-pill); background: var(--line-strong); cursor: pointer;
  transition: background-color .25s var(--ease);
}
.tgl input::before {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .3s var(--spring);
}
.tgl input:checked { background: var(--wa); }
.tgl input:checked::before { transform: translateX(16px); }
.tgl input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mtpre .chip { height: 40px; padding: 0 14px; }

@media (min-width: 900px) and (min-height: 520px) {
  .metro-app #mt { padding: 16px; gap: 14px; }
  .mtside { padding: 18px; gap: 14px; }
  .mt-bpm .rb { flex-basis: 60px; width: 60px; height: 60px; }
  .ad { width: 46px; height: 46px; }
}
@media (max-height: 700px) {
  .mt-bpm .rb { flex-basis: 44px; width: 44px; height: 44px; font-size: 1.4rem; }
  .mt-num input { font-size: 2.5rem; }
  .lcd-t { display: none; }
  .ad { width: 34px; height: 34px; }
  .mt-tabs .chip { height: 30px; }
}
main.app.fit1 .mt-bpm .rb { flex-basis: 40px; width: 40px; height: 40px; font-size: 1.3rem; }
main.app.fit1 .mt-num input { font-size: 2.3rem; }
main.app.fit1 .ad { width: 32px; height: 32px; }
main.app.fit1 .mtside select.sel, main.app.fit1 .mtside .numin, main.app.fit1 .mtpre .chip { height: 34px; }
main.app.fit1 .tgl { min-height: 34px; }
main.app.fit2 .mt-num span { display: none; }

/* 7. Transkrip: area unggah, progres, panggung chord, garis waktu, kontrol, daftar & kamus
   ========================================================================== */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 32px 20px; text-align: center; cursor: pointer;
  border: 2px dashed var(--accent-line); border-radius: var(--r-xl);
  background:
    radial-gradient(60% 60% at 50% 0%, rgba(208, 138, 46, .1), transparent 70%),
    var(--surface);
  color: var(--ink);
  transition: border-color .25s, background-color .25s, transform .2s var(--ease-out);
}
.drop b { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.drop span:not(.drop__icon) { max-width: 26rem; font-size: .875rem; line-height: 1.6; color: var(--ink-3); }
.drop__icon {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 4px;
  border-radius: var(--r-lg); background: var(--accent-soft); color: var(--accent);
  transition: transform .5s var(--spring);
}
.drop__icon .ic { width: 30px; height: 30px; }
.drop:hover, .drop.over { border-color: var(--accent); background-color: var(--accent-soft); }
.drop:hover .drop__icon, .drop.over .drop__icon { transform: translateY(-4px) rotate(-6deg); }
.drop:active { transform: scale(.99); }

.prgb { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.prgt { height: 10px; overflow: hidden; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); }
#bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-bright)); transition: width .2s; }
#ptxt { display: block; margin-top: 8px; font-size: .875rem; font-weight: 600; color: var(--ink-2); }

/* Panggung chord yang sedang dimainkan */
.tr-stage {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px;
  border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--surface); box-shadow: var(--shadow-md);
  text-align: left;
}
.tr-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tr-top .tr-ttl { flex: 1 1 0; min-width: 0; }
.tr-ttl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; font-weight: 700; color: var(--ink-3); }
.tr-now { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tr-now > div:first-child { min-width: 0; }
.tr-cn {
  overflow: hidden; white-space: nowrap;
  font: 600 clamp(2.6rem, 9dvh, 4.4rem)/1.05 var(--font-display); font-optical-sizing: auto;
  letter-spacing: -.02em; color: var(--ink);
}
.tr-cs { margin-top: 4px; font-size: .8125rem; font-weight: 600; color: var(--ink-3); }
.tr-cd {
  display: flex; align-items: center; justify-content: center; flex: 0 0 42%;
  height: 100%; min-height: 0; padding: 6px;
  border-radius: var(--r-lg); background: var(--surface-2);
}
.tr-cd .cd { width: auto; height: 100%; max-height: 100%; }
.tr-next { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: .8125rem; font-weight: 600; color: var(--ink-3); }
.tr-next b { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--ink); }
.tr-next small { margin-left: auto; font-size: .75rem; font-variant-numeric: tabular-nums; }
.tr-nd { width: 54px; }
canvas.ctab {
  display: block; flex: 0 0 auto; width: 100%; height: 68px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2); cursor: grab;
  touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
canvas.ctab.seret { cursor: grabbing; }

/* Posisi lagu: waktu berjalan | penggeser | durasi. Bagian yang sudah diputar berwarna aksen, loop A-B hijau. */
.tr-seek { display: flex; align-items: center; gap: 10px; font-size: .75rem; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tr-seek span { flex: 0 0 auto; min-width: 2.7em; }
.tr-seek span:last-child { text-align: right; }
.tr-seek { margin-bottom: 6px; }
.tr-seek .tr-rg { position: relative; flex: 1 1 0; min-width: 0; display: flex; }
.tr-seek .rg { flex: 1 1 0; width: 0; min-width: 0; }
/* waktu titik A/B di bawah penggeser: A melebar ke kiri dari titiknya, B ke kanan */
.tr-mk { position: absolute; top: 22px; padding: 0 2px; color: var(--wa); font: 800 .625rem/1 var(--font-sans); font-style: normal; white-space: nowrap; pointer-events: none; }
.tr-mk.kiri { transform: translateX(-100%); }
.tr-seek .rg::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--accent) var(--p, 0%), var(--line-strong) var(--p, 0%)); }
.tr-seek .rg.loop::-webkit-slider-runnable-track { background: linear-gradient(90deg, transparent var(--a), var(--wa) var(--a), var(--wa) var(--b), transparent var(--b)), linear-gradient(90deg, var(--accent) var(--p, 0%), var(--line-strong) var(--p, 0%)); }
.tr-seek .rg.loop::-moz-range-track { background: linear-gradient(90deg, var(--line-strong) var(--a), var(--wa) var(--a), var(--wa) var(--b), var(--line-strong) var(--b)); }

/* Kontrol pemutar: loop A-B, mundur, putar/jeda (besar), maju, stop */
.tr-bar { --tb: 46px; --go: 62px; display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3.4vw, 22px); padding: 4px 0 2px; }
.tb {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: var(--tb); height: var(--tb); padding: 0;
  border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm);
  cursor: pointer; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
  transition: transform .15s var(--ease-out), background-color .2s, border-color .2s, color .2s, box-shadow .25s;
}
.tb:hover { border-color: var(--ink-3); }
.tb:active { transform: scale(.92); transition-duration: .06s; }
.tb:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tb svg { width: 56%; height: 56%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tb svg text { fill: currentColor; stroke: none; font: 800 9px var(--font-sans); }
.tb svg rect { fill: currentColor; stroke: none; }
.tb-go {
  width: var(--go); height: var(--go); border-color: transparent; background: var(--wa); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 6px var(--wa-soft), 0 10px 24px -8px rgba(18, 128, 77, .7);
}
.tb-go:hover { border-color: transparent; background: var(--wa-hover); }
.tb-go:focus-visible { border-color: transparent; box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent); }
.tb-go svg { width: 46%; height: 46%; fill: currentColor; stroke: none; }
.tb-go .i-ps, .tb-go.on .i-pl { display: none; }
.tb-go.on .i-ps { display: block; }
.tb-go.hitung { animation: tr-denyut .45s ease-in-out infinite alternate; }
@keyframes tr-denyut { to { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 11px var(--wa-soft), 0 10px 24px -8px rgba(18, 128, 77, .7); } }
@media (prefers-reduced-motion: reduce) { .tb-go.hitung { animation: none; } }
/* A-B Loop: huruf A menyala setelah titik A dipasang, tombol hijau penuh saat loop berjalan */
.tb-ab { flex-direction: column; gap: 2px; width: auto; min-width: calc(var(--tb) + 10px); padding: 0 9px; border-radius: var(--r-pill); color: var(--ink-3); }
.tb-ab .ab-t { display: flex; align-items: center; gap: 1px; font: 800 .8125rem/1 var(--font-sans); }
.tb-ab svg { width: 13px; height: 13px; stroke-width: 2.4; }
.tb-ab .ab-l { font: 800 .5625rem/1 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; }
.tb-ab.separuh { border-color: var(--wa); }
.tb-ab.separuh .ab-a { color: var(--wa); }
.tb-ab.on, .tb-ab.on:hover { border-color: var(--wa); background: var(--wa); color: #fff; }
@media (max-width: 359.98px) { .tr-bar { --tb: 40px; --go: 54px; } }

/* Deretan kontrol: pengaturan sebagai chip ringkas di kiri-kanan tombol pemutar (HP: di bawahnya) */
.row { display: flex; align-items: center; gap: 6px; }
.fill { flex: 1 1 auto; min-height: 0; }
.tr-kontrol { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 6px; }
.tr-kontrol .tr-bar { order: -1; flex: 1 0 100%; }
.tr-set { display: contents; }
.ts {
  display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; height: 34px; padding: 0 0 0 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface);
  color: var(--ink-3); font: 700 .6875rem/1 var(--font-sans); white-space: nowrap; cursor: pointer;
}
.ts[hidden] { display: none; }
.ts:hover { border-color: var(--ink-3); }
.ts:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ts .ic { width: 16px; height: 16px; flex: none; }
.ts-k { text-transform: uppercase; letter-spacing: .05em; font-size: .625rem; }
.ts-s { position: relative; display: inline-flex; align-items: center; height: 100%; padding-right: 24px; background: var(--chev) no-repeat right 7px center / 14px; color: var(--ink); font: 700 .8125rem/1 var(--font-sans); }
.ts-s select { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; font-size: 16px; cursor: pointer; -webkit-appearance: none; appearance: none; }
.ts-s:has(select:disabled) { opacity: .45; }
.ts-s select:disabled { cursor: default; }
.ts-s select option { color: var(--ink); background: var(--surface); }
.ts-bpm { display: inline-flex; align-items: center; gap: 3px; height: 100%; padding-left: 6px; border-left: 1px solid var(--line); }
.ts-bpm[hidden] { display: none; }
.trans-app .ts-bpm #bpm { width: 38px; max-width: none; height: 26px; padding: 0 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); font: 800 1rem/1 var(--font-sans); text-align: center; -moz-appearance: textfield; }
.ts-bpm #bpm::-webkit-inner-spin-button, .ts-bpm #bpm::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ts-bpm #bpmhalf { width: 28px; height: 100%; padding: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0 var(--r-pill) var(--r-pill) 0; background: none; color: var(--ink-2); font: 800 .8125rem/1 var(--font-sans); cursor: pointer; }
.ts-bpm #bpmhalf:hover { color: var(--accent); }
.tr-saran { flex: 1 0 100%; display: flex; justify-content: center; }
.tr-saran[hidden] { display: none; }
#capoapply { height: auto; min-height: 30px; padding: 5px 12px; border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); font-size: .75rem; white-space: normal; text-align: center; justify-content: center; }

/* Laci daftar: lembar chord, editor, kamus */
.drawer-in .t-card { padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.drawer-in #swap { height: 44px; }
.sheet {
  position: relative; display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 34vh; overflow: auto; padding: 8px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface-2);
}
.sc {
  display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 6px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .15s var(--ease);
}
.sc:active { transform: scale(.95); }
.sc b { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; line-height: 1.2; }
.sc small { font-size: .6875rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sc.on { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.sc.on small { color: inherit; opacity: .8; }
.sc.sel { outline: 3px solid rgba(47, 181, 116, .55); outline-offset: 1px; }

/* Edit chord: pilihan bentuk jari */
.bp { display: flex; align-items: center; gap: 14px; margin: .8rem 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.bp[hidden] { display: none; }
.bp-d { flex: 0 0 112px; }
.bp-d .cd { display: block; width: 100%; height: auto; }
.bp-t { display: grid; gap: 6px; min-width: 0; }
.bp-t b { font-size: 1rem; }
.bp-t .pg-row { margin: 0; }

/* Chord lagu ini: tampilan kedua di layar utama, di dalam kartu panggung */
.tr-lagu { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.tr-lagu .sheet { max-height: 30vh; }
/* daftar chord lagu seperti di aplikasi: 3 kolom, tiap sel nama + waktu + diagram, yang berbunyi berbingkai emas, yang sudah lewat redup */
.tr-lagu .sheet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: var(--baris, 128px); gap: 8px; align-content: start; scroll-behavior: smooth; }
.tr-lagu .sheet::before, .tr-lagu .sheet::after { content: ""; grid-column: 1 / -1; height: var(--baris, 128px); }
.tr-lagu .sc { align-items: stretch; min-width: 0; height: 100%; padding: 6px 8px; overflow: hidden; }
.tr-lagu .sc-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 6px; min-width: 0; }
.tr-lagu .sc-h b { max-width: 100%; overflow: hidden; font-size: 1.15rem; white-space: nowrap; text-overflow: ellipsis; }
.tr-lagu .sc-h small { margin-left: auto; }
.tr-lagu .sc-d { flex: 1 1 0; min-height: 0; display: flex; justify-content: center; padding-top: 2px; }
.tr-lagu .sc-d .cd { height: 100%; width: auto; max-width: 100%; }
.tr-lagu .sc.past { opacity: .55; }
.tr-lagu .sc.on { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--ink); }
.tr-lagu .sc.on small { color: var(--ink-2); opacity: 1; }
.tr-lagu #edit { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.tr-bawah { display: contents; }
.tr-kontrol { position: relative; }
.tr-more-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.tr-more-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tr-more-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tr-more-panel { display: none; position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 20; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-md); }
.tr-more-panel.buka { display: flex; }
.tr-more-panel .tr-saran { flex: 0 0 auto; }
.tr-more-btn { position: relative; }
.tr-more-btn.ada::after { content: ""; position: absolute; top: -1px; right: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.tr-kontrol:has(#capohint:not([hidden])) .tr-more-btn::after { content: ""; position: absolute; top: -1px; right: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.tr-tampil { flex: 0 0 auto; display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface-2); }
.tr-tampil .tt-b { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 28px; padding: 0; border: 0; border-radius: var(--r-pill); background: none; color: var(--ink-3); cursor: pointer; }
.tr-tampil .tt-b .ic { width: 18px; height: 18px; }
.tr-tampil .tt-b[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
/* HP: satu tampilan saja. Panggung = seperti biasa; Daftar = daftar chord di atas, kontrol pemutar tetap di bawah */
@media (max-width: 899.98px), (max-height: 519.98px) {
  .trans-app .tapp[data-tampil="panggung"] .tr-lagu { display: none; }
  .trans-app .tapp[data-tampil="daftar"] .tr-lagu { order: -1; flex: 1 1 0; min-height: 120px; }
  .trans-app .tapp[data-tampil="daftar"] .tr-lagu .sheet { flex: 1 1 0; max-height: none; min-height: 0; align-content: flex-start; }
  .trans-app .tapp[data-tampil="daftar"] .tr-stage > :is(.tr-now, .tr-adj, .tr-next, .ctab), .trans-app .tapp[data-tampil="daftar"] .tr-top .tr-ttl { display: none; }
  .trans-app .tapp[data-tampil="daftar"] .tr-top { display: none; }
}
/* HP: pengaturan satu baris, sisanya di panel tombol pengaturan lain */
@media (max-width: 899.98px), (max-height: 519.98px) {
  .tr-more-btn { width: 34px; height: 34px; }
  .trans-app .tr-kontrol .tr-more-panel { right: 4px; }
}
@media (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {
  .trans-app .tr-stage { position: relative; }
  .trans-app .tr-top { display: contents; }
}
/* layar lebar: kiri chord yang sedang dimainkan, kanan daftar chord (sama lebar); seek dan kontrol selebar kartu di bawahnya */
@media (min-width: 900px) and (min-height: 520px) {
  .tr-tampil { display: none; }
  .trans-app .tr-stage {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 18px; align-content: stretch;
    grid-template-rows: minmax(0, 1fr) auto auto auto auto;
    grid-template-areas: "now list" "adj list" "next list" "tab list" "bawah bawah";
  }
  /* halaman tidak boleh tergulir: isi menyesuaikan tinggi layar (diagram chord mengecil), hanya daftar chord yang bergulir sendiri */
  main.app.trans-app { overflow-y: hidden; }
  .trans-app .tapp, .trans-app .tr-stage { min-height: 0; }
  .trans-app .tr-stage { overflow: hidden; }
  .trans-app .tr-stage > .tr-now { min-height: 84px; overflow: hidden; }
  .trans-app .tr-nd { width: 46px; flex: none; }
  .trans-app .tr-nd svg { display: block; width: 100%; height: auto; }
  .trans-app .tr-stage > .tr-top { display: none; }
  .trans-app .tr-stage > .tr-now { grid-area: now; }
  .trans-app .tr-stage > .tr-adj { grid-area: adj; }
  .trans-app .tr-stage > .tr-next { grid-area: next; }
  .trans-app .tr-stage > .ctab { grid-area: tab; }
  .trans-app .tr-stage > .tr-lagu { grid-area: list; }
  .tr-lagu .sheet { flex: 1 1 0; max-height: none; align-content: flex-start; min-height: 0; }
  /* panel ubah chord melayang di atas bagian bawah daftar: tidak mengubah tinggi halaman */
  .tr-lagu { position: relative; }
  .tr-lagu #edit { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 3; box-shadow: var(--shadow-md); }
  /* bar bawah: satu baris ala transport DAW. Kiri tombol pemutar, tengah posisi lagu, kanan kecepatan + transpose + tombol pengaturan lain */
  .trans-app .tr-stage > .tr-bawah {
    grid-area: bawah; position: relative; display: grid; grid-template-columns: auto minmax(160px, 1fr) auto auto; align-items: center; gap: 4px 18px;
    margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line);
  }
  .tr-bawah .tr-kontrol { display: contents; }
  .tr-bawah .tr-bar { --tb: 40px; --go: 50px; grid-column: 1; grid-row: 1; justify-content: flex-start; gap: 4px; padding: 0; }
  .tr-bawah .tr-seek { grid-column: 2; grid-row: 1; margin: 0; }
  .tr-bawah .tr-set { grid-column: 3; grid-row: 1; display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
  .tr-bawah .tr-more-btn { grid-column: 4; grid-row: 1; }
  /* tombol pemutar minimalis: tanpa bingkai dan bayangan, hanya Putar yang berwarna */
  .tr-bawah .tb:not(.tb-go) { border-color: transparent; background: transparent; box-shadow: none; color: var(--ink-2); }
  .tr-bawah .tb:not(.tb-go):hover { background: var(--surface-2); color: var(--ink); }
  .tr-bawah .tb-go { box-shadow: none; }
  .tr-bawah .tb-ab { flex-direction: row; min-width: 0; width: auto; height: 32px; padding: 0 10px; border-radius: var(--r-pill); color: var(--ink-3); }
  .tr-bawah .tb-ab .ab-l { display: none; }
  .tr-bawah .tb-ab.on, .tr-bawah .tb-ab.on:hover { background: var(--wa); color: #fff; }
  .tr-bawah .tb-ab.separuh { border-color: var(--wa); }
  .tr-bawah .ts { height: 32px; }
}
}
.pg-row select.srch {
  padding: 0 30px 0 12px;
  background-image: var(--chev); background-position: right 9px center; background-size: 16px;
  cursor: pointer;
}
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.lg { padding: 8px 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); text-align: center; }
.lg b { display: block; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.lg small { font-size: .75rem; color: var(--ink-3); }
.lg svg { max-width: 110px; }
.print-only, #pa { display: none; }

@media (min-width: 900px) and (min-height: 520px) {
  .tr-stage { padding: 18px; gap: 10px; }
  .tr-nd { display: block; }
  .tr-bar { --tb: 48px; --go: 66px; }
  /* layar lebar: chip pengaturan di kiri dan kanan tombol pemutar, satu baris */
  .tr-kontrol { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px 22px; }
  .tr-kontrol .tr-bar { order: 0; }
  .tr-set { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .tr-set:first-child { justify-content: flex-end; }
  .tr-saran { grid-column: 1 / -1; }
}
@media (max-width: 899.98px), (max-height: 519.98px) { .trans-app .tr-nd { display: none; } }
@media (max-height: 700px) {
  .trans-app .tr-ttl { display: none; }
  .tr-bar { --tb: 42px; --go: 56px; }
}
@media (max-height: 620px) { canvas.ctab { height: 54px; } }

main.app.fit1 canvas.ctab { height: 56px; }
main.app.fit1 .tr-bar { --go: 54px; }
main.app.fit2 .tr-ttl, main.app.fit2 .tr-next { display: none; }
main.app.fit2 .tr-bar { --tb: 40px; --go: 50px; }
main.app.fit3 canvas.ctab { height: 44px; }
main.app.fit2 .ts { height: 30px; }
main.app.fit3 .tr-bar { --tb: 36px; --go: 42px; padding: 0; }
main.app.fit3 .tb-go { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 4px var(--wa-soft); }

/* Cetak transkrip (tombol "Cetak transkrip" mengisi #pa lalu memanggil print) */
@media print {
  body.app-page { height: auto !important; overflow: visible !important; padding: 0 !important; background: #fff !important; color: #000 !important; }
  .skip-link, .site-header, main.app, .drawer, .site-footer { display: none !important; }
  #pa { display: block !important; padding: 0 8px; }
  #pa h2 { margin: .6rem 0; font: 600 1.3rem/1.2 var(--font-display); color: #000; }
  #pa .sheet { max-height: none; overflow: visible; border: 0; background: #fff; padding: 0; }
  #pa .sc-d { display: none; }
  #pa .sc-h { display: flex; flex-direction: column; align-items: center; }
  #pa .sc { border: 1px solid #888; background: #fff; color: #000; break-inside: avoid; }
  #pa .sc.on { border-color: #888; background: #fff; color: #000; }
  #pa .sc small, #pa .sc.on small { color: #444; opacity: 1; }
  #pa .lg { border-color: #ccc; background: #fff; break-inside: avoid; }
  #pa .lg b { color: #000; }
  #pa .cd-s, #pa .cd-f { stroke: #444; }
  #pa .cd-nut { stroke: #000; }
  #pa .cd-dot, #pa .cd-barre { fill: #000; }
  #pa .cd-dt { fill: #fff; }
  #pa .cd-nm { fill: #333; }
}

/* 8. Kepadatan (diatur app.js)
   ========================================================================== */
@media (max-height: 690px) {
  .tuner-app .t-string { min-height: 44px; }
  .a4row button, .a4row input { height: 40px; }
}
main.app.fit1 .t-note { font-size: 2.4rem; }
main.app.fit1 .t-string { min-height: 42px; }
main.app.fit1 .a4row button, main.app.fit1 .a4row input { height: 38px; }
main.app.fit3 .t-string { min-height: 38px; }
@media (min-width: 900px) and (min-height: 520px) {
  .t-string small { display: block; }
  .tuner-app .t-string { min-height: 60px; }
}
.lb-cek { flex-direction: row; align-items: center; gap: 8px; }
.lb-cek input { width: 20px; height: 20px; accent-color: var(--accent); }
