:root {
  color-scheme: dark;
  --bg: #06120f;
  --bg-deep: #030b09;
  --panel: rgba(13, 31, 26, 0.86);
  --panel-solid: #0d1f1a;
  --panel-light: #132a23;
  --line: rgba(196, 235, 216, 0.13);
  --line-strong: rgba(196, 235, 216, 0.24);
  --text: #f3f7f5;
  --muted: #93aaa0;
  --muted-strong: #b9c8c1;
  --accent: #b8f23d;
  --accent-strong: #d1ff69;
  --accent-deep: #273c0e;
  --cyan: #56dcc4;
  --danger: #ff806e;
  --warning: #ffd36a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius-lg: 28px;
  --radius-md: 19px;
  --radius-sm: 13px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg-deep);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 14% -10%, rgba(86, 220, 196, 0.14), transparent 33rem),
    radial-gradient(circle at 92% 20%, rgba(184, 242, 61, 0.08), transparent 28rem),
    linear-gradient(180deg, #081a15 0%, var(--bg) 35%, var(--bg-deep) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

button,
select,
input {
  font: inherit;
}

button,
select,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(184, 242, 61, 0.5);
  outline-offset: 3px;
}

.noscript {
  padding: 14px;
  color: #181e0c;
  background: var(--warning);
  text-align: center;
  font-weight: 800;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
}

.ambient-one {
  width: 20rem;
  height: 20rem;
  top: 32rem;
  left: -14rem;
  background: rgba(86, 220, 196, 0.1);
}

.ambient-two {
  width: 26rem;
  height: 26rem;
  right: -18rem;
  bottom: 20%;
  background: rgba(184, 242, 61, 0.07);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 14, 11, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid rgba(184, 242, 61, 0.22);
  border-radius: 14px;
  color: var(--accent);
  background: linear-gradient(145deg, rgba(184, 242, 61, 0.16), rgba(86, 220, 196, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-mark svg {
  width: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark .accent-stroke {
  stroke: var(--cyan);
  stroke-width: 2;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.96rem;
  letter-spacing: -0.01em;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.78rem;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(184, 242, 61, 0.1), 0 0 12px rgba(184, 242, 61, 0.45);
}

.status-dot.is-playing {
  animation: statusPulse 1.2s ease-in-out infinite;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 72px;
}

.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  align-items: end;
  gap: 40px;
  margin-bottom: 38px;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.5rem, 7vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: -0.065em;
  font-weight: 820;
}

h1 span {
  color: var(--muted);
  font-weight: 580;
}

.hero-note {
  max-width: 35rem;
  margin-bottom: 5px;
  padding-left: 20px;
  border-left: 2px solid var(--accent);
  color: var(--muted-strong);
  line-height: 1.65;
  font-size: 0.96rem;
}

.workspace {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(18, 41, 34, 0.9), rgba(8, 24, 19, 0.91));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.setup-panel,
.progression-panel,
.voice-panel {
  padding: clamp(20px, 3.5vw, 32px);
}

.setup-panel {
  grid-column: span 5;
}

.progression-panel {
  grid-column: span 7;
}

.voice-panel {
  grid-column: span 7;
}

.transport-panel {
  grid-column: span 5;
  align-self: stretch;
  padding: clamp(22px, 3.5vw, 34px);
  background:
    radial-gradient(circle at 100% 0, rgba(184, 242, 61, 0.11), transparent 18rem),
    linear-gradient(150deg, #142c24, #0a1c17 75%);
}

.panel-heading,
.subheading-row,
.now-playing,
.progression-actions,
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading {
  margin-bottom: 24px;
}

.panel-heading > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.025em;
}

.step-number {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  color: var(--accent);
  background: rgba(184, 242, 61, 0.09);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 800;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.icon-button svg,
.volume-row svg,
.transport-actions svg,
.mic-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button svg {
  width: 18px;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field > span,
.volume-row label,
.tempo-readout > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

select {
  width: 100%;
  min-height: 48px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background-color: rgba(1, 10, 7, 0.42);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  appearance: none;
  cursor: pointer;
}

select:hover {
  border-color: var(--line-strong);
}

.tempo-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 18px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(1, 10, 7, 0.28);
}

.tempo-readout {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 92px;
}

.tempo-readout strong {
  margin-top: 3px;
  font-size: 1.42rem;
}

.tempo-readout small {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
}

.tempo-controls {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
}

.mini-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.03);
  font-size: 1.1rem;
  cursor: pointer;
}

input[type="range"] {
  width: 100%;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.tap-button {
  position: relative;
  grid-column: 1 / -1;
  min-height: 43px;
  border: 1px dashed rgba(184, 242, 61, 0.27);
  border-radius: 12px;
  color: var(--accent-strong);
  background: rgba(184, 242, 61, 0.055);
  font-weight: 760;
  cursor: pointer;
  overflow: hidden;
}

.tap-button:active {
  transform: translateY(1px);
  background: rgba(184, 242, 61, 0.11);
}

.volume-row {
  display: grid;
  grid-template-columns: auto 18px 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.volume-row svg {
  width: 18px;
  color: var(--muted);
}

.secondary-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.secondary-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(184, 242, 61, 0.2);
  border-radius: 12px;
  color: var(--accent-strong);
  background: rgba(184, 242, 61, 0.07);
  font-size: 0.78rem;
  font-weight: 750;
}

.section-help {
  margin: -12px 0 19px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.chord-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 10px;
}

.chord-slot {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 78px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--text);
  background: rgba(1, 10, 7, 0.34);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.chord-slot:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.chord-slot.is-active {
  border-color: rgba(184, 242, 61, 0.65);
  color: #101908;
  background: var(--accent);
  box-shadow: 0 8px 30px rgba(184, 242, 61, 0.16);
}

.chord-slot small,
.degree-button small {
  position: absolute;
  top: 8px;
  left: 9px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.62rem;
}

.chord-slot.is-active small {
  color: rgba(16, 25, 8, 0.58);
}

.chord-slot strong {
  font-size: 1.42rem;
  letter-spacing: -0.04em;
}

.empty-progression {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 88px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 15px;
  color: var(--muted);
  text-align: center;
  font-size: 0.84rem;
}

.degree-builder {
  margin-top: 22px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.subheading-row {
  margin-bottom: 12px;
}

.subheading-row h3 {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.83rem;
}

.subheading-row span {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 780;
}

.degree-buttons {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}

.degree-button {
  position: relative;
  min-width: 0;
  min-height: 52px;
  padding: 16px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.022);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.degree-button:hover {
  border-color: rgba(184, 242, 61, 0.35);
  color: var(--accent-strong);
  background: rgba(184, 242, 61, 0.05);
}

.degree-button small {
  top: 5px;
  left: 0;
  width: 100%;
  text-align: center;
}

.progression-actions {
  justify-content: flex-start;
  margin-top: 15px;
}

.text-button {
  padding: 5px 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 700;
}

.text-button:hover {
  color: var(--text);
}

.mic-state {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.mic-state.is-live {
  color: var(--cyan);
}

.tuner {
  padding: 8px clamp(8px, 2vw, 20px) 18px;
}

.tuner-scale {
  display: flex;
  justify-content: space-between;
  padding: 0 1px 7px;
  color: #5e766c;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.62rem;
}

.tuner-track {
  position: relative;
  height: 11px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 128, 110, 0.45), rgba(255, 211, 106, 0.52) 35%, rgba(184, 242, 61, 0.75) 50%, rgba(255, 211, 106, 0.52) 65%, rgba(255, 128, 110, 0.45));
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.tuner-center {
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--text);
  opacity: 0.85;
}

.tuner-needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 3px solid #082018;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22), 0 4px 12px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
  transition: left 80ms linear, background 120ms ease;
}

.tuner-needle.is-in-tune {
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(184, 242, 61, 0.2), 0 0 18px rgba(184, 242, 61, 0.5);
}

.note-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 19px;
  min-height: 115px;
  padding-top: 18px;
}

.note-display > strong {
  min-width: 92px;
  color: var(--text);
  font-size: clamp(4.1rem, 11vw, 6.8rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
  text-align: center;
}

.note-display > div span,
.note-display > div small {
  display: block;
}

.note-display > div span {
  margin-bottom: 6px;
  color: var(--muted-strong);
  font-size: 0.95rem;
  font-weight: 750;
}

.note-display > div small {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
}

.tuning-message {
  margin: 2px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 650;
}

.tuning-message.is-in-tune {
  color: var(--accent);
}

.chromatic-notes {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  margin: 0 0 20px;
}

.chromatic-note {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #6f887d;
  background: rgba(255, 255, 255, 0.018);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.6rem;
}

.chromatic-note.is-active {
  border-color: rgba(86, 220, 196, 0.55);
  color: #06251e;
  background: var(--cyan);
  box-shadow: 0 5px 16px rgba(86, 220, 196, 0.16);
}

.mic-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 10px 16px;
  border: 1px solid rgba(86, 220, 196, 0.24);
  border-radius: 16px;
  color: var(--text);
  background: rgba(86, 220, 196, 0.07);
  cursor: pointer;
}

.mic-button:hover {
  background: rgba(86, 220, 196, 0.11);
}

.mic-button.is-live {
  border-color: rgba(255, 128, 110, 0.35);
  background: rgba(255, 128, 110, 0.08);
}

.mic-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--cyan);
  background: rgba(86, 220, 196, 0.11);
}

.mic-button.is-live .mic-icon {
  color: var(--danger);
  background: rgba(255, 128, 110, 0.11);
}

.mic-icon svg {
  width: 21px;
}

.mic-button strong,
.mic-button small {
  display: block;
  text-align: left;
}

.mic-button strong {
  margin-bottom: 2px;
  font-size: 0.88rem;
}

.mic-button small {
  color: var(--muted);
  font-size: 0.68rem;
}

.now-playing {
  align-items: flex-start;
}

.now-playing > div > span,
.bar-count span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.now-playing > div > strong {
  display: block;
  font-size: clamp(4.2rem, 10vw, 7rem);
  line-height: 0.9;
  letter-spacing: -0.075em;
}

.bar-count {
  min-width: 88px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
  text-align: center;
}

.bar-count span {
  margin-bottom: 4px;
  font-size: 0.6rem;
}

.bar-count strong {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}

.beat-indicator {
  display: grid;
  grid-template-columns: repeat(var(--beat-count, 6), 1fr);
  gap: 7px;
  margin: 30px 0;
}

.beat-dot {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 100ms ease, box-shadow 100ms ease;
}

.beat-dot.is-active {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(184, 242, 61, 0.4);
}

.transport-actions {
  display: grid;
  grid-template-columns: 0.6fr 1.4fr;
  gap: 10px;
}

.stop-button,
.play-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 58px;
  border-radius: 16px;
  font-weight: 820;
  cursor: pointer;
}

.stop-button {
  border: 1px solid var(--line);
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.035);
}

.stop-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.play-button {
  border: 0;
  color: #121b09;
  background: linear-gradient(135deg, var(--accent-strong), #9fe71f);
  box-shadow: 0 12px 34px rgba(184, 242, 61, 0.14);
}

.play-button:hover {
  filter: brightness(1.05);
}

.play-button.is-playing {
  color: #061611;
  background: var(--cyan);
}

.transport-actions svg {
  width: 19px;
}

.play-button svg {
  fill: currentColor;
  stroke: none;
}

.transport-tip {
  margin: 19px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
  text-align: center;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 calc(34px + var(--safe-bottom));
  color: #597166;
  font-size: 0.7rem;
}

.sheet-dialog {
  width: min(520px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  color: var(--text);
  background: transparent;
  overflow: visible;
}

.sheet-dialog::backdrop {
  background: rgba(0, 5, 4, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dialog-card {
  max-height: calc(100dvh - 24px);
  padding: 13px 24px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: #10241e;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.55);
  overflow-y: auto;
}

.dialog-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.17);
}

.dialog-heading {
  margin-bottom: 22px;
}

.dialog-heading span {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}

.dialog-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dialog-primary {
  width: 100%;
  min-height: 52px;
  margin-top: 20px;
  border: 0;
  border-radius: 14px;
  color: #111b08;
  background: var(--accent);
  font-weight: 850;
  cursor: pointer;
}

.preset-list {
  display: grid;
  gap: 9px;
}

.preset-option {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.16);
  text-align: left;
  cursor: pointer;
}

.preset-option:hover {
  border-color: rgba(184, 242, 61, 0.3);
  background: rgba(184, 242, 61, 0.045);
}

.preset-option strong,
.preset-option small {
  display: block;
}

.preset-option strong {
  margin-bottom: 4px;
  font-size: 0.84rem;
}

.preset-option small {
  color: var(--muted);
  font-size: 0.7rem;
}

.preset-option > span:last-child {
  color: var(--accent);
  font-size: 1.1rem;
}

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  background: rgba(13, 31, 26, 0.96);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.42);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes statusPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.72); opacity: 0.65; }
}

@media (max-width: 900px) {
  .hero-copy {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .hero-note {
    max-width: 44rem;
  }

  .setup-panel,
  .progression-panel,
  .voice-panel,
  .transport-panel {
    grid-column: 1 / -1;
  }

  .setup-panel {
    order: 1;
  }

  .progression-panel {
    order: 2;
  }

  .voice-panel {
    order: 3;
  }

  .transport-panel {
    order: 4;
  }
}

@media (max-width: 600px) {
  .topbar {
    min-height: 68px;
    padding-inline: 16px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
  }

  .header-status {
    padding: 7px 9px;
  }

  .header-status span:last-child {
    max-width: 82px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 35px;
  }

  .hero-copy {
    margin-bottom: 26px;
  }

  h1 {
    font-size: clamp(2.65rem, 14.5vw, 4.1rem);
  }

  .hero-note {
    font-size: 0.85rem;
  }

  .workspace {
    gap: 12px;
  }

  .panel {
    border-radius: 22px;
  }

  .panel-heading {
    margin-bottom: 21px;
  }

  .progression-heading {
    align-items: flex-start;
  }

  .tempo-card {
    grid-template-columns: 1fr;
  }

  .tempo-readout {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .chord-timeline {
    grid-template-columns: repeat(2, 1fr);
  }

  .degree-buttons {
    grid-template-columns: repeat(4, 1fr);
  }

  .chromatic-notes {
    grid-template-columns: repeat(6, 1fr);
  }

  .note-display {
    gap: 13px;
  }

  .note-display > strong {
    min-width: 80px;
  }

  .transport-actions {
    grid-template-columns: 1fr;
  }

  .play-button {
    grid-row: 1;
  }

  .stop-button {
    min-height: 48px;
  }

  footer {
    flex-direction: column;
    width: calc(100% - 28px);
    gap: 5px;
  }

  .sheet-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 8px);
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
  }

  .dialog-card {
    padding-bottom: calc(22px + var(--safe-bottom));
    border-radius: 24px 24px 0 0;
  }

  .dialog-fields {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
