:root {
  --paper: #ffffff;
  --panel: #ffffff;
  --ink: #000000;
  --soft-ink: #111111;
  --muted: rgba(0, 0, 0, 0.56);
  --quiet: #e6e6e6;
  --rule: #000000;
  --green: #00d652;
  --timer-color: var(--green);
  --bpm-number-size: clamp(5.25rem, 12.075vw, 8.006rem);
  --timer-number-size: clamp(6rem, 15vw, 13.4375rem);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-panel: cubic-bezier(0.2, 0, 0, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --focus-ring:
    0 0 0 1px #ffffff,
    0 0 0 3px rgba(0, 214, 82, 0.72);
}

@font-face {
  font-family: "Google Sans Flex";
  src: url("./Google%20Sans%20Flex/GoogleSansFlex-VariableFont_GRAD,ROND,opsz,slnt,wdth,wght.ttf") format("truetype");
  font-display: swap;
  font-style: oblique 0deg 10deg;
  font-stretch: 25% 151%;
  font-weight: 1 1000;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Google Sans Flex", "Google Sans", "Google Sans Text", "Product Sans", Arial, Helvetica, sans-serif;
  font-stretch: normal;
  font-variation-settings: "wdth" 100;
  font-weight: 500;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input {
  font: inherit;
}

button {
  --button-scale: 1;
  --button-motion-duration: 150ms;
  -webkit-tap-highlight-color: transparent;
  transform: scale(var(--button-scale));
  transform-origin: center;
  transition-property: transform;
  transition-duration: var(--button-motion-duration);
  transition-timing-function: var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  button:hover:not(:disabled) {
    --button-scale: 1;
  }
}

button:active:not(:disabled) {
  --button-scale: 0.96;
  --button-motion-duration: 100ms;
}

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(242px, 1fr) minmax(260px, 1fr);
  column-gap: 20px;
  min-height: 100vh;
  overflow: hidden;
  padding: 0 20px 32px;
  background: var(--paper);
}

.top-bar {
  position: relative;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 20px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  padding: 32px 0;
}

.login-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: start;
  min-width: 0;
  min-height: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  padding: 0;
  text-transform: uppercase;
}

.login-button::before {
  display: block;
  width: 18px;
  height: 14px;
  background: url("./Arrow icon.svg") center / contain no-repeat;
  content: "";
}

.login-button:hover,
.login-button:focus-visible {
  color: var(--green);
  outline: 0;
}

.login-button:focus-visible,
.mini-chart-button:focus-visible,
.tally-button:focus-visible {
  box-shadow: var(--focus-ring);
}

.performance-date {
  grid-column: 2;
  justify-self: start;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  white-space: nowrap;
}

.pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  background: transparent;
}

.left-panel {
  grid-column: 1;
}

.metronome-pane {
  grid-row: 2;
  padding-top: 52px;
}

.timer-pane {
  grid-row: 3;
  align-self: stretch;
  display: grid;
  align-content: end;
  grid-template-rows: auto auto auto;
}

.pane-header {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.mode-switch,
.preset-tabs {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.mode-switch {
  margin-bottom: clamp(58px, 10vh, 88px);
}

.preset-tabs {
  margin-bottom: 32px;
}

.mode-button,
.preset-tab {
  min-height: 40px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  transition-property: background-color, color, transform;
  transition-duration: 160ms, 160ms, var(--button-motion-duration);
  transition-timing-function: var(--ease-out);
}

.mode-button:hover,
.mode-button:focus-visible,
.mode-button.is-selected,
.preset-tab:hover,
.preset-tab:focus-visible,
.preset-tab.is-selected {
  background: var(--ink);
  color: #ffffff;
  outline: 0;
}

.mode-button:focus-visible,
.preset-tab:focus-visible,
.control:focus-visible,
.load-button:focus-visible,
.login-submit:focus-visible,
.login-close:focus-visible,
.chart-close:focus-visible,
.tally-remove:focus-visible,
.chart-range select:focus-visible {
  box-shadow: var(--focus-ring);
}

.sound-panel[hidden] {
  display: none;
}

#metronome-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, max-content) max-content max-content;
  align-items: center;
  gap: clamp(42px, 7vw, 110px);
  min-height: 122px;
}

#metronome-panel[hidden] {
  display: none;
}

.bpm-label,
.tempo-control,
.stepper,
.control-label,
.beat small,
#timer-reset {
  display: none;
}

.bpm-wrap {
  display: contents;
}

.bpm-input,
.readout {
  color: var(--soft-ink);
  font-stretch: normal;
  font-weight: 400;
  line-height: 1;
  font-kerning: normal;
  font-variant-numeric: normal;
  letter-spacing: 0;
}

.bpm-input {
  font-variation-settings: "wdth" 100, "opsz" 120;
  width: 3ch;
  border: 0;
  background: transparent;
  font-size: var(--bpm-number-size);
  outline: 0;
  padding: 0;
  appearance: textfield;
}

.bpm-input::-webkit-outer-spin-button,
.bpm-input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.bpm-input:hover,
.bpm-input:focus,
.timer-editor:hover,
.timer-editor:focus,
.timer-editor.is-editing {
  color: var(--green);
}

.beats {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 122px;
}

.beat {
  display: block;
}

.beat span {
  display: block;
  width: 16px;
  height: 122px;
  border-radius: 0;
  background: var(--quiet);
  transition-property: background-color;
  transition-duration: 90ms;
  transition-timing-function: ease;
}

.beat.active span {
  background: var(--green);
}

.controls {
  display: flex;
  align-items: center;
}

.metro-controls {
  margin: 0;
}

.control {
  display: grid;
  place-items: center;
  width: 72px;
  height: 82px;
  min-width: 72px;
  min-height: 82px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  transition-property: border-color, color, transform;
  transition-duration: 180ms, 180ms, var(--button-motion-duration);
  transition-timing-function: var(--ease-out);
}

.metro-controls .control,
.timer-row .control {
  min-width: 0;
  min-height: 0;
}

.metro-controls .control {
  width: calc(var(--bpm-number-size) * 0.85);
  height: var(--bpm-number-size);
}

.timer-row .control {
  width: calc(var(--timer-number-size) * 0.48);
  height: var(--timer-number-size);
}

.control:hover,
.control:focus-visible,
.play-toggle.is-active {
  border-color: var(--green);
  color: var(--green);
  outline: 0;
}

.symbol {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  color: currentColor;
}

.symbol-icon {
  grid-area: 1 / 1;
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  background: currentColor;
  transition-property: opacity, transform, filter;
  transition-duration: 200ms;
  transition-timing-function: var(--ease-panel);
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.play-icon {
  mask-image: url("./Play-icon.svg");
  -webkit-mask-image: url("./Play-icon.svg");
  transform: translateX(calc(0.05em - 3px)) scale(1);
}

.pause-icon {
  mask-image: url("./Pause-icon.svg");
  -webkit-mask-image: url("./Pause-icon.svg");
  opacity: 0;
  filter: blur(4px);
  transform: scale(0.25);
}

.play-toggle.is-active .play-icon {
  opacity: 0;
  filter: blur(4px);
  transform: translateX(calc(0.05em - 3px)) scale(0.25);
}

.play-toggle.is-active .pause-icon {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

.music-panel {
  display: grid;
  gap: 12px;
  width: 100%;
}

.spotify-stage {
  display: contents;
}

.spotify-stage iframe {
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
}

.spotify-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.spotify-form label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.spotify-form span {
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1;
  text-transform: uppercase;
}

.spotify-form input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: transparent;
  padding: 0 10px;
  outline: 0;
}

.spotify-form input:focus,
.spotify-form.has-error input {
  border-color: var(--green);
}

.spotify-form input:focus,
.login-form input:focus {
  box-shadow: var(--focus-ring);
}

.load-button {
  min-height: 40px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  padding: 0 14px;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.load-button:hover,
.load-button:focus-visible {
  background: var(--ink);
  color: #ffffff;
  outline: 0;
}

.timer-progress {
  display: none;
}

.timer-row {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr) max-content;
  align-items: center;
  gap: clamp(42px, 7vw, 110px);
  width: min(100%, 725px);
}

.timer-row .controls {
  grid-column: 3;
}

.readout {
  max-width: 100%;
  font-variation-settings: "wdth" 100, "opsz" 144;
  font-size: var(--timer-number-size);
  outline: 0;
  white-space: nowrap;
}

.timer-editor {
  cursor: text;
}

.timer-linear-progress {
  position: relative;
  width: min(100%, 725px);
  height: 8px;
  margin-top: 48px;
  background: linear-gradient(to bottom, transparent 0 3px, #cccccc 3px 5px, transparent 5px);
}

.timer-linear-progress span {
  display: block;
  width: 100%;
  height: 8px;
  background: var(--timer-color);
  transform: scaleX(1);
  transform-origin: left center;
  transition-property: transform, background-color;
  transition-duration: 220ms;
  transition-timing-function: linear;
}

.performance-bar {
  position: relative;
  grid-column: 2;
  grid-row: 2 / span 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 1px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding-top: 52px;
}

.history-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 480px);
  align-items: stretch;
  gap: 20px;
  min-width: 0;
  min-height: 0;
}

.section-label {
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
}

.mini-chart-button {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.mini-chart-button:hover,
.mini-chart-button:focus-visible {
  color: var(--green);
  outline: 0;
}

.history-total {
  display: block;
  color: var(--soft-ink);
  font-size: clamp(4rem, 8vw, 4.5rem);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hour-grid {
  align-self: end;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(5px, 0.72vw, 8px);
  width: 100%;
  padding-bottom: 30px;
}

.hour-cell {
  display: block;
  justify-self: center;
  width: 80%;
  aspect-ratio: 1;
  border-radius: 0;
  background: var(--quiet);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.025);
  transition-property: background-color;
  transition-duration: 160ms;
  transition-timing-function: var(--ease-out);
}

.hour-cell[data-level="1"] {
  background: rgba(0, 214, 82, 0.42);
}

.hour-cell[data-level="2"] {
  background: var(--green);
}

.chart-axis,
.chart-grid {
  stroke: rgba(0, 0, 0, 0.12);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.large-chart.is-empty .chart-line {
  stroke: var(--quiet);
}

.chart-hover {
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.chart-hover.is-visible {
  opacity: 1;
}

.chart-hover-line {
  stroke: var(--green);
  stroke-width: 1.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.chart-hover-dot {
  fill: var(--green);
}

.chart-hover-label {
  fill: var(--ink);
  font-size: 0.6rem;
  font-weight: 400;
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 5;
  stroke-linejoin: round;
}

.chart-label {
  fill: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.history-rule {
  width: 100%;
  height: 1px;
  background: var(--rule);
}

.performance-tally {
  position: relative;
  display: grid;
  min-height: 0;
  overflow: hidden;
  padding-top: 30px;
}

.tally-button {
  position: relative;
  display: block;
  width: 100%;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.tally-button:hover,
.tally-button:focus-visible {
  outline: 0;
}

.tally-title {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  pointer-events: none;
  text-transform: uppercase;
}

.tally-button.has-marks .tally-title {
  display: block;
}

.tally-empty {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 310px) minmax(120px, 227px);
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  color: var(--green);
  font-family: "Google Sans Flex", "Google Sans", "Google Sans Text", "Product Sans", Arial, Helvetica, sans-serif;
  font-size: 38px;
  font-stretch: normal;
  font-style: normal;
  font-variation-settings: "wdth" 100, "GRAD" 0, "ROND" 0, "slnt" 0;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  text-transform: uppercase;
}

.tally-button.has-marks .tally-empty {
  display: none;
}

.tally-empty-hand {
  display: block;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  width: min(34vw, 227px);
  max-width: 100%;
  height: auto;
  transform: translateX(-40px);
}

.tally-empty-text {
  display: block;
  grid-column: 1;
  grid-row: 1;
  max-width: 310px;
  justify-self: start;
}

.tally-board {
  position: absolute;
  right: 0;
  bottom: 18px;
  display: block;
  width: min(48%, 325px);
  height: 122px;
  min-width: 260px;
  overflow: visible;
}

.tally-mark {
  stroke: currentColor;
  stroke-width: 12;
  stroke-linecap: square;
  vector-effect: non-scaling-stroke;
}

.tally-cross {
  stroke: currentColor;
  stroke-width: 12;
  stroke-linecap: square;
  vector-effect: non-scaling-stroke;
}

.tally-remove {
  position: absolute;
  top: 30px;
  right: 0;
  z-index: 2;
  width: 72px;
  height: 72px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition-property: border-color, color, opacity, transform;
  transition-duration: 160ms, 160ms, 160ms, 160ms;
  transition-timing-function: var(--ease-out);
}

.performance-tally:hover .tally-remove:not(:disabled),
.performance-tally:focus-within .tally-remove:not(:disabled) {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.tally-remove::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 1px;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
}

.tally-remove:hover,
.tally-remove:focus-visible {
  border-color: var(--green);
  color: var(--green);
  outline: 0;
}

.tally-remove:disabled {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  opacity: 0;
  padding: 1rem;
  transition: opacity 200ms var(--ease-out);
}

.login-modal[hidden] {
  display: none;
}

.login-modal.is-open {
  opacity: 1;
}

.login-dialog {
  position: relative;
  width: min(100%, 25rem);
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: var(--paper);
  padding: 2rem;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.14),
    0 1px 2px rgba(0, 0, 0, 0.08);
  transform: translateY(10px) scale(0.98);
  transition: transform 200ms var(--ease-out);
}

.login-modal.is-open .login-dialog {
  transform: translateY(0) scale(1);
}

.login-form {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.login-form h2 {
  margin: 0;
  padding-right: 2.75rem;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.05;
  text-wrap: balance;
}

.login-form label {
  display: grid;
  gap: 0.45rem;
}

.login-form label span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  outline: 0;
  padding: 0 1rem;
}

.login-form input:focus {
  border-color: var(--green);
}

.login-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
  text-wrap: pretty;
}

.login-submit {
  min-height: 3rem;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: var(--ink);
  color: #ffffff;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0 1.25rem;
  text-transform: uppercase;
}

.login-submit:hover,
.login-submit:focus-visible {
  background: var(--green);
  border-color: var(--green);
  outline: 0;
}

.login-close,
.chart-close {
  position: absolute;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

.login-close {
  top: 1.25rem;
  right: 1.25rem;
}

.login-close::before,
.login-close::after,
.chart-close::before,
.chart-close::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1rem;
  height: 1px;
  background: currentColor;
  content: "";
}

.login-close::before,
.chart-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.login-close::after,
.chart-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.login-close:hover,
.login-close:focus-visible,
.chart-close:hover,
.chart-close:focus-visible {
  border-color: var(--green);
  color: var(--green);
  outline: 0;
}

.chart-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 240ms var(--ease-out);
}

.chart-modal[hidden] {
  display: none;
}

.chart-modal.is-open {
  opacity: 1;
}

.chart-dialog {
  display: flex;
  flex-direction: column;
  width: min(50vw, 46rem);
  min-width: min(100vw, 34rem);
  height: 100dvh;
  max-height: 100dvh;
  border-left: 1px solid var(--ink);
  background: var(--paper);
  padding: 36px;
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 300ms var(--ease-drawer);
}

.chart-modal.is-open .chart-dialog {
  transform: translateX(0);
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chart-header h2 {
  margin: 0 0 0.35rem;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1;
}

.chart-header span {
  color: var(--muted);
  font-size: 0.875rem;
  text-transform: uppercase;
}

.chart-close {
  position: relative;
  top: auto;
  right: auto;
  flex: 0 0 auto;
}

.chart-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: clamp(1rem, 4vw, 3rem);
  margin-bottom: 1.25rem;
}

.chart-summary strong {
  font-size: clamp(4.5rem, 10vw, 8rem);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.chart-range {
  align-self: end;
  display: flex;
  justify-content: flex-end;
}

.chart-range select {
  min-width: 12rem;
  min-height: 2.5rem;
  border: 1px solid var(--ink);
  border-radius: 5px;
  appearance: none;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  padding: 0.52rem 2.5rem 0.48rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 1.05rem) 50%,
    calc(100% - 0.72rem) 50%;
  background-repeat: no-repeat;
  background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
}

.chart-range select:hover,
.chart-range select:focus-visible {
  border-color: var(--green);
  outline: 0;
}

.large-chart {
  flex: 0 0 auto;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-history {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  margin-top: 1.25rem;
}

.chart-history h3 {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
}

.chart-history-list {
  flex: 1 1 0;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 0.35rem;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
  scrollbar-gutter: stable;
}

.chart-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.25rem;
  min-height: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.14);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.45rem 0 0.35rem;
}

.chart-history-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.chart-history-row time {
  min-width: 0;
  color: var(--muted);
  text-transform: uppercase;
}

.chart-history-row strong {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.chart-history-times {
  grid-column: 1 / -1;
  min-width: 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.35;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  button,
  .symbol-icon,
  .timer-linear-progress span,
  .tally-remove,
  .login-modal,
  .login-dialog,
  .chart-modal,
  .chart-dialog {
    transition-duration: 1ms !important;
  }

  button,
  button:active:not(:disabled),
  .login-dialog,
  .chart-dialog,
  .tally-remove,
  .tally-remove:disabled {
    transform: none !important;
  }

  .timer-linear-progress span {
    transition-property: background-color;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .login-modal,
  .chart-modal {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: rgba(0, 0, 0, 0.72);
    --quiet: #d6d6d6;
    --focus-ring:
      0 0 0 1px #ffffff,
      0 0 0 4px #000000;
  }

  .login-dialog,
  .chart-dialog {
    box-shadow: none;
  }
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    overflow: visible;
    row-gap: 44px;
  }

  .left-panel,
  .performance-bar {
    grid-column: 1;
  }

  .metronome-pane {
    grid-row: 2;
  }

  .timer-pane {
    grid-row: 3;
  }

  .performance-bar {
    grid-row: 4;
    min-height: 520px;
    padding-top: 0;
  }

  .history-panel {
    grid-template-columns: 1fr;
  }

  .mini-chart-button {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .hour-grid {
    gap: clamp(5px, 1.25vw, 8px);
  }

  #metronome-panel {
    grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  }

  .metro-controls {
    grid-column: 1 / -1;
  }

  .timer-row {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .timer-row .controls {
    grid-column: 2;
  }

  .timer-pane {
    --timer-number-size: clamp(5rem, 22vw, 9rem);
  }

  .chart-dialog {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .app {
    padding: 0 14px 32px;
  }

  .top-bar {
    grid-template-columns: 1fr auto;
  }

  .performance-date {
    justify-self: end;
  }

  #metronome-panel {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .beats {
    min-height: 86px;
  }

  .beat span {
    width: 12px;
    height: 86px;
  }

  .timer-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .timer-row .controls {
    grid-column: 1;
    justify-self: end;
  }

  .tally-board {
    width: 80%;
    min-width: 0;
  }

  .chart-summary {
    grid-template-columns: 1fr;
  }

  .chart-range {
    justify-content: flex-start;
  }
}

.top-bar-right { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.achievements-button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 4px; border: 0; background: transparent; cursor: pointer; text-transform: uppercase; font-size: .875rem; color: var(--ink); }
.achievement-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); visibility: hidden; }
.has-unread .achievement-dot { visibility: visible; }
.achievements-button:hover { color: var(--green); }
.achievements-dialog, .achievement-unlock { color: var(--ink); background: var(--paper); border: 0; padding: 28px; width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; border-radius: 20px; box-shadow: 0 8px 32px #0002, 0 1px 4px #0001; }
.achievements-dialog::backdrop, .achievement-unlock::backdrop { background: #0005; }
.achievements-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.achievements-header h2, .achievement-unlock h2 { font-size: 26px; margin: 0; font-weight: 600; text-wrap: balance; }
.achievements-header p { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.achievement-close { display: grid; place-items: center; flex-shrink: 0; padding: 0; line-height: 1; width: 40px; height: 40px; background: #f4f4f4; border: 0; border-radius: 50%; font-size: 26px; cursor: pointer; }
.achievements-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.achievement-card { display: flex; gap: 16px; padding: 16px; border-radius: 12px; background: #f6f6f6; }
.achievement-icon { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; background: #e6e6e6; border-radius: 12px; font-size: 26px; }
.is-earned .achievement-icon, .achievement-unlock .achievement-icon { background: var(--green); }
.achievement-card h3 { font-size: 16px; margin: 0 0 6px; font-weight: 600; }
.achievement-card p { margin: 0 0 8px; font-size: 14px; }
.achievement-card small { display: block; color: var(--muted); line-height: 1.45; font-size: 12px; }
.achievement-card div > span { display: block; margin-top: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.is-earned div > span { color: #00782e; }
.achievement-unlock { text-align: center; width: min(420px, calc(100vw - 32px)); padding: 36px; }
.unlock-eyebrow { display: block; text-transform: uppercase; font-size: 11px; letter-spacing: .12em; color: var(--muted); }
.achievement-unlock .achievement-icon { margin: 24px auto; width: 64px; height: 64px; font-size: 36px; border-radius: 18px; }
#unlock-pun { font-size: 17px; line-height: 1.4; }
#unlock-description { color: var(--muted); font-size: 14px; line-height: 1.5; }
#unlock-ok { width: 100%; min-height: 44px; margin-top: 16px; border: 0; border-radius: 8px; background: var(--ink); color: white; cursor: pointer; }
.achievements-button:focus-visible, .achievement-close:focus-visible, #unlock-ok:focus-visible { outline: 2px solid #008b36; outline-offset: 4px; }
@media (max-width: 640px) { .top-bar-right { flex-wrap: wrap; justify-content: flex-end; gap: 8px; } .top-bar-right .performance-date { font-size: 12px; } .achievements-button { font-size: 12px; } .achievements-dialog { padding: 20px; } }
@media (prefers-reduced-motion: no-preference) { .achievements-dialog[open], .achievement-unlock[open] { animation: achievement-enter 180ms var(--ease-panel); } @keyframes achievement-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } } }

.achievement-close svg { display: block; width: 16px; height: 16px; }
