/* Livewire free tools: tuner + metronome */
.tl-crumb { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .9rem; font-size: .9rem; color: var(--ink-soft); }
.tl-crumb a { color: var(--ink-soft); }
.tl-crumb li + li::before { content: "/"; margin-right: .35rem; color: #aab1c0; }
.tl-head h1 { margin-bottom: .35em; }

.tl-stage { padding: 2rem 0 1rem; }
.tl-panel { max-width: 760px; margin: 0; background: var(--midnight); color: var(--white); border-radius: 22px; padding: 1.5rem; box-shadow: 0 24px 60px rgba(9,13,21,.25); }
.tl-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.tl-field { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: rgba(255,255,255,.8); }
.tl-field label { white-space: nowrap; }
.tl-panel select, .tl-panel input[type="number"] { font: 600 .95rem var(--font-body); color: var(--white); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); border-radius: 10px; padding: .5rem .7rem; max-width: 100%; }
.tl-panel select option { color: var(--midnight); }
.tl-panel input[type="number"] { width: 5.2rem; }
.tl-field--tuning { flex: 1 1 260px; min-width: 0; max-width: 100%; }
.tl-field--tuning select { flex: 1 1 0; width: 0; min-width: 0; }

.tl-read { text-align: center; padding: .5rem 0 0; }
.tl-note { font: 800 clamp(4.5rem, 16vw, 7rem)/1 var(--font-display); letter-spacing: -0.03em; }
.tl-oct { font: 700 1.6rem var(--font-display); color: rgba(255,255,255,.55); margin-left: .15rem; vertical-align: .4em; }
.tl-sub { display: flex; justify-content: center; gap: 1rem; min-height: 1.6rem; color: rgba(255,255,255,.7); font-variant-numeric: tabular-nums; }
.tl-status { margin: .5rem 0 0; font: 700 1.1rem var(--font-display); min-height: 1.7rem; }


.tl-strings { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin: 1.1rem 0 .75rem; }
.tl-string { appearance: none; cursor: pointer; min-width: 4.4rem; padding: .6rem .8rem .55rem; border-radius: 14px; border: 1.5px solid rgba(255,255,255,.22); background: rgba(255,255,255,.06); color: var(--white); text-align: center; font-family: var(--font-display); }
.tl-string .n { display: block; font: 600 .7rem var(--font-body); color: rgba(255,255,255,.55); letter-spacing: .04em; text-transform: uppercase; }
.tl-string .t { font-size: 1.5rem; font-weight: 800; line-height: 1.15; }
.tl-string .o { font-size: .8rem; font-weight: 600; color: rgba(255,255,255,.55); margin-left: 1px; }
.tl-string:hover { border-color: rgba(255,255,255,.55); }
.tl-string.is-near { border-color: var(--white); background: rgba(255,255,255,.16); }
.tl-string.is-tuned { border-color: #34d399; background: rgba(52,211,153,.2); }
.tl-string.is-locked { border-style: dashed; border-color: var(--white); }
.tl-string.is-playing { border-color: var(--pulse); background: rgba(240,45,131,.25); }
.tl-hint { margin: 0 0 1rem; text-align: center; font-size: .9rem; color: rgba(255,255,255,.65); }
.tl-err { margin: 0 0 1rem; padding: .75rem 1rem; border-radius: 10px; background: rgba(255,86,61,.16); border: 1px solid rgba(255,86,61,.5); font-size: .92rem; }

.tl-body { padding: 2.5rem 0 3rem; }
.tl-body .narrow { max-width: var(--container); }
.tl-body .narrow > * { max-width: 780px; }
.tl-body h2 { margin-top: 2.4rem; }
.tl-body h2:first-child { margin-top: 0; }
.tl-table { width: 100%; border-collapse: collapse; margin: 0 0 1.2rem; font-size: .98rem; }
.tl-table th, .tl-table td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
.tl-table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.tl-table td:last-child, .tl-table th:last-child { font-variant-numeric: tabular-nums; }
.tl-steps { counter-reset: s; display: grid; gap: .8rem; margin: 0 0 1rem; }
.tl-steps li { counter-increment: s; position: relative; padding-left: 2.6rem; }
.tl-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--midnight); color: var(--white); font: 700 .9rem/1.9rem var(--font-display); text-align: center; }
.tl-list { display: grid; gap: .6rem; margin: 0 0 1rem; padding-left: 1.2rem; list-style: disc; }
.tl-faq details { border-bottom: 1px solid var(--line); padding: .9rem 0; }
.tl-faq summary { cursor: pointer; font: 600 1.05rem var(--font-display); }
.tl-faq p { margin: .6rem 0 0; color: var(--ink-soft); }
.tl-related { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; margin-top: 1rem; }
.tl-related a { display: block; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.tl-related a:hover { border-color: #c9cfdc; box-shadow: 0 8px 22px rgba(9,13,21,.08); }
.tl-related b { display: block; font-family: var(--font-display); }
.tl-related span { color: var(--ink-soft); font-size: .9rem; }
.tl-strip { background: var(--grey-50); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.1rem 1.3rem; display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; justify-content: space-between; margin-top: 2.5rem; }
.tl-strip p { margin: 0; }
.tl-callout { background: var(--grey-50); border-left: 4px solid var(--electric); padding: .9rem 1.1rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1rem 0; }

/* Metronome */
.mt-main { text-align: center; }
.mt-bpm-row { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; }
.mt-round { appearance: none; cursor: pointer; width: 3rem; height: 3rem; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: var(--white); font: 700 1.2rem var(--font-display); }
.mt-round:hover { border-color: var(--white); }
.mt-round.sm { width: 2.5rem; height: 2.5rem; font-size: .9rem; }
.tl-panel input[type="number"].mt-bpm { width: 6.5rem; text-align: center; font: 800 4.2rem/1 var(--font-display); color: var(--white); background: transparent; border: 0; border-bottom: 2px solid rgba(255,255,255,.25); -moz-appearance: textfield; padding: 0; border-radius: 0; }
.mt-bpm::-webkit-outer-spin-button, .mt-bpm::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mt-unit { font: 600 .85rem var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.mt-term { margin: .3rem 0 1rem; font: 700 1.2rem var(--font-display); color: rgba(255,255,255,.85); }
.mt-slider { width: 100%; max-width: 560px; accent-color: var(--pulse); margin: .25rem 0 1rem; }
.mt-beats { display: flex; justify-content: center; flex-wrap: wrap; gap: .6rem; margin: .5rem 0 1.25rem; min-height: 1.8rem; }
.mt-dot { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: rgba(255,255,255,.16); transition: background .05s, transform .05s; }
.mt-dot.is-on { background: var(--white); transform: scale(1.15); }
.mt-dot.is-first { background: var(--pulse); box-shadow: 0 0 16px var(--pulse); }
.mt-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: 1rem 0 1.25rem; text-align: left; }
.mt-opts label { display: grid; gap: .3rem; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.mt-opts select { width: 100%; text-transform: none; letter-spacing: 0; }
.mt-opts input[type="range"] { accent-color: var(--pulse); width: 100%; }
.mt-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.mt-actions .btn { min-width: 9rem; }
.btn-ghost-dark { background: rgba(255,255,255,.1); color: var(--white); border-color: rgba(255,255,255,.3); }
.btn-ghost-dark:hover { background: rgba(255,255,255,.2); color: var(--white); }
.btn.is-running { background: var(--white); color: var(--midnight); }

@media (max-width: 600px) {
  .tl-panel { padding: 1.1rem; border-radius: 18px; }
  .tl-string { min-width: 3.7rem; padding: .5rem .55rem; }
  .tl-panel input[type="number"].mt-bpm { font-size: 3.4rem; width: 5.4rem; }
}
@media (prefers-reduced-motion: reduce) { .mt-dot { transition: none; } }

/* Save to home screen */
.tl-install[hidden], .tl-install-help[hidden] { display: none !important; }
.tl-install { max-width: 760px; margin: 1rem 0 0; background: var(--grey-50); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.tl-install-row { display: flex; align-items: center; gap: .75rem 1rem; flex-wrap: wrap; }
.tl-install-row p { margin: 0; flex: 1 1 260px; font-size: .95rem; }
.tl-install-x { appearance: none; border: 0; background: transparent; font-size: 1.5rem; line-height: 1; color: var(--ink-soft); cursor: pointer; padding: .2rem .5rem; }
.tl-install-help { margin: .6rem 0 0; font-size: .92rem; color: var(--ink-soft); }
