.metro-panel{padding:28px;border:1px solid var(--line);border-radius:16px;background:var(--wash)}.metro-tempo{display:flex;justify-content:space-between;align-items:center;gap:20px}.metro-tempo>label{font-weight:650}.metro-number{display:flex;align-items:center;gap:10px}.metro-number input{width:115px;padding:8px 4px;font-size:2rem;font-weight:650;text-align:center;color:var(--teal);background:white;border:1px solid #bdcece;border-radius:8px;font-variant-numeric:tabular-nums}.metro-number span{font-size:.8rem;color:var(--muted)}.metro-number button{font-size:1.3rem;width:40px;padding:6px}.metro-panel input[type=range]{width:100%;accent-color:var(--teal)}#tempo-slider{margin:24px 0 8px}.metro-range{display:flex;justify-content:space-between;font-size:.75rem;color:var(--muted)}.metro-tap{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:22px 0}.metro-tap span{font-size:.8rem;color:var(--muted)}.metro-settings{display:grid;grid-template-columns:1fr 1fr;gap:28px;border-top:1px solid var(--line);padding-top:22px}.metro-settings label{font-size:.85rem;font-weight:600}.metro-settings select{display:block;width:100%;margin-top:10px;font:inherit;padding:10px;border:1px solid #bdcece;border-radius:8px;background:#fff;color:var(--ink)}#volume{display:block;margin-top:20px}#volume-value{float:right;font-weight:400;color:var(--muted)}.metro-accent{display:block;margin-top:20px;font-size:.85rem}.metro-accent input{accent-color:var(--teal)}.metro-visual{margin:24px 0;padding:22px 14px;text-align:center;background:white;border:1px solid var(--line);border-radius:14px}#beat-number{font-size:3.5rem;font-weight:750;line-height:1.2;color:var(--teal);font-variant-numeric:tabular-nums}#beat-number.hit{color:var(--coral)}#beat-dots{display:flex;justify-content:center;flex-wrap:wrap;gap:10px;margin:18px auto;max-width:420px}.beat-dot{width:18px;height:18px;border-radius:50%;border:1.5px solid #b8cccc;background:var(--wash)}.beat-dot.active{background:var(--teal);border-color:var(--teal)}.beat-dot.first.active{background:var(--coral);border-color:var(--coral)}#visual-description{font-size:.78rem;color:var(--muted);margin:0}.metro-actions{display:flex;gap:12px;flex-wrap:wrap}.metro-start{background:var(--teal);border-color:var(--teal);color:white;padding:11px 24px;font-weight:650}.metro-start:hover{background:#184f5e}button:disabled{opacity:.45;cursor:default}#status{min-height:1.6em;margin:16px 0 0;font-size:.8rem;color:var(--muted)}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media(max-width:600px){.metro-panel{padding:20px 16px}.metro-tempo{align-items:flex-start;flex-direction:column;gap:12px}.metro-number{width:100%;justify-content:center}.metro-settings{grid-template-columns:1fr;gap:20px}.beat-dot{width:15px;height:15px}#beat-dots{gap:8px}}

/* Editable accent buttons: labels convey the state as well as colour. */
#beat-dots{max-width:620px;gap:9px}.beat-dot{width:76px;height:62px;border-radius:10px;padding:6px 3px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--teal);background:#f5f8f7;border:1.5px solid #b8cccc}.beat-label{font-size:1.1rem;font-weight:750}.accent-label{font-size:.62rem;line-height:1.2}.beat-dot[data-accent="1"]{color:var(--coral);border-color:var(--coral);background:#fcf0ec}.beat-dot[data-accent="2"]{color:#70519a;border-color:#70519a;background:#f5f0fa}.beat-dot.active{color:white;background:var(--teal);border-color:var(--teal)}.beat-dot[data-accent="1"].active{color:white;background:var(--coral);border-color:var(--coral)}.beat-dot[data-accent="2"].active{color:white;background:#70519a;border-color:#70519a}.accents-off .beat-dot{color:var(--muted);border-color:#b8cccc;background:#f5f8f7}.accents-off .beat-dot.active{color:white;background:var(--teal)}.pulse-dot{width:22px;height:22px;border-radius:50%;border:1.5px solid #b8cccc;background:var(--wash)}.pulse-dot.active{background:var(--teal)}#beat-number.secondary-hit{color:#70519a}.beat-help{font-size:.78rem;color:var(--muted);margin:0 0 10px}@media(max-width:600px){.beat-dot{width:68px;height:60px}#beat-dots{gap:8px}}

/* Silent beats remain visible and flash on time. */
.beat-dot[data-accent="3"],.accents-off .beat-dot[data-accent="3"]{border:2px dashed #7b8383;background:#f5f5f3;color:#636969}.beat-dot[data-accent="3"].active,.accents-off .beat-dot[data-accent="3"].active{border-color:var(--teal);background:#d5e8e6;color:var(--teal);box-shadow:0 0 0 2px var(--teal)}

.subdivision-control{margin-top:22px;padding-top:20px;border-top:1px solid var(--line)}.subdivision-control label{display:block;font-size:.85rem;font-weight:650;margin-bottom:8px}.subdivision-control select{font:inherit;padding:10px;border:1px solid #bdcece;border-radius:8px;background:white;color:var(--ink);width:100%;max-width:340px}.subdivision-control p{font-size:.78rem;color:var(--muted);margin:8px 0 0}#subdivision-dots{display:flex;justify-content:center;gap:8px;margin:10px 0 18px}.subdivision-dot{display:grid;place-items:center;width:25px;height:25px;font-size:.7rem;border:1px solid var(--line);border-radius:50%;color:var(--muted)}.subdivision-dot.active{background:var(--teal);color:white;border-color:var(--teal)}

/* Subdivision sound switches retain their flash when muted. */
.subdivision-dot{width:44px;height:44px;padding:3px;border:1.5px solid #9dbab6;background:#f2f7f5;color:var(--teal);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;line-height:1.15;border-radius:50%}.subdivision-number{font-size:.85rem;font-weight:700}.subdivision-state{font-size:.57rem}.subdivision-dot[data-enabled="false"]{border-style:dashed;border-color:#828b88;background:#f6f6f3;color:#666}.subdivision-dot.active{background:var(--teal);color:#fff;border-color:var(--teal)}.subdivision-dot[data-enabled="false"].active{background:#d5e8e6;color:var(--teal);border-color:var(--teal);box-shadow:0 0 0 2px var(--teal)}.subdivision-help{font-size:.75rem;color:var(--muted);margin:0 auto 15px;max-width:470px}#subdivision-dots{margin-bottom:10px}

/* Wrap subdivision switches on small screens without shrinking touch targets. */
#subdivision-dots{flex-wrap:wrap;max-width:500px;margin-left:auto;margin-right:auto}.subdivision-dot{flex:0 0 44px;box-sizing:border-box}.metro-presets{margin:28px 0;padding:24px;border:1px solid var(--line);border-radius:14px}.metro-presets h2{font-size:1.3rem;margin:0 0 20px}.metro-presets h3{font-size:1rem;margin:22px 0 8px}.metro-presets p{font-size:.82rem;color:var(--muted)}.preset-buttons{display:flex;flex-wrap:wrap;gap:10px}.preset-buttons button{font:inherit;font-size:.8rem;padding:10px 13px;border:1px solid #9dbab6;border-radius:8px;background:var(--wash);color:var(--teal);cursor:pointer}.preset-buttons button:hover{background:#e4efed}.preset-buttons button:focus-visible,.subdivision-dot:focus-visible,.beat-dot:focus-visible{outline:3px solid var(--coral);outline-offset:3px}

/* Nine counts: four above five, with a new primary accent on five. */
#beat-dots.nine-beats{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));max-width:440px;gap:8px}.nine-beats .beat-dot{grid-column:span 2;width:100%;min-width:0}.nine-beats .beat-dot:first-child{grid-column:2 / span 2}.nine-beats .beat-dot:nth-child(5){grid-column:1 / span 2}@media(max-width:420px){.nine-beats .accent-label{font-size:.52rem}#beat-dots.nine-beats{gap:4px}}

.tempo-unit-help{font-size:.82rem;color:var(--teal);margin:14px 0 0}.metro-number #bpm-unit{max-width:105px;line-height:1.3}@media(max-width:400px){.metro-number{gap:6px}.metro-number input{width:85px}.metro-number #bpm-unit{max-width:80px;font-size:.7rem}}

.second-layer{border-top:1px solid var(--line);padding-top:18px;margin:24px 0}.second-layer h2{font-size:1.25rem;color:var(--teal);margin:0 0 12px}.second-layer p{font-size:.8rem;color:var(--muted)}.second-layer .metro-settings{border:0;padding-top:12px}.second-layer input[type=range]{display:block;margin-top:16px}#layer-volume-value{float:right;font-weight:400}#layer-dots{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin:20px 0}.layer-dot{width:48px;height:50px;padding:3px;display:flex;flex-direction:column;align-items:center;justify-content:center;border-color:#70519a;background:#f5f0fa;color:#70519a;flex:0 0 48px}.layer-dot small{font-size:.6rem}.layer-dot[data-enabled="false"]{border-style:dashed;color:#666;background:#f6f6f3}.layer-dot.active{color:white;background:#70519a}.layer-dot[data-enabled="false"].active{background:#e8def4;color:#503070;box-shadow:0 0 0 2px #70519a}

.metro-transport{position:sticky;top:0;z-index:10;padding:12px 0 8px;background:var(--wash);border-bottom:1px solid var(--line);margin:12px 0}.metro-transport #status{margin:6px 0 0;min-height:1.4em}.metro-transport .metro-actions{gap:8px}.shared-timeline{position:relative;margin:20px 0;text-align:left}.shared-timeline svg{display:block;width:100%;height:175px;overflow:visible}.timeline-row-label{position:absolute;top:0;left:0;font-size:.76rem;font-weight:650;color:var(--teal)}.timeline-row-label.second{top:80px;color:#70519a}.timeline-guide{stroke:#216476;opacity:.12;stroke-width:1}.timeline-guide.layer{stroke:#70519a}.timeline-tile{fill:#dcebea;stroke:#216476;stroke-width:1}.timeline-tile.layer{fill:#ede6f6;stroke:#70519a}.timeline-tile.silent{fill:white;stroke-dasharray:5 3}.timeline-tile.main.active{fill:#68b3b0}.timeline-tile.layer.active{fill:#b399d0}.timeline-number{font:17px system-ui;fill:#272727;pointer-events:none}.shared-playhead{stroke:#be5847;stroke-width:3;pointer-events:none}.shared-timeline #timeline-caption{font-size:.73rem;color:var(--muted);margin:8px 0}.second-layer{padding-top:14px;margin:18px 0}.second-layer .metro-settings{grid-template-columns:1fr 1fr 1fr;gap:16px}.second-layer p{margin:8px 0}.metro-visual{margin-top:18px}@media(max-width:600px){.second-layer .metro-settings{grid-template-columns:1fr;gap:12px}.shared-timeline svg{height:165px}.timeline-row-label.second{top:74px}.metro-transport button{font-size:.82rem;padding:9px 12px}}

/* Keep optional polyrhythm controls out of the default metronome view. */
.optional-layer{margin:20px 0 0;padding:16px 18px;border:1px solid var(--line);border-radius:12px;background:white}.optional-layer>summary{font-size:.95rem}.optional-layer .shared-timeline{margin:22px 0 12px}.optional-layer .second-layer{margin-bottom:0}.optional-layer:not([open]){padding-top:14px;padding-bottom:14px}
