:root {
  color-scheme: light;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --bg-gradient: radial-gradient(circle at top, #f9f6ff 0%, #eef2ff 55%, #f8fafc 100%);
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-border: rgba(148, 163, 184, 0.32);
  --card-shadow: 0 24px 50px -32px rgba(15, 23, 42, 0.38);
  --surface-shadow: 0 35px 90px -48px rgba(37, 99, 235, 0.32);
  --primary: #4338ca;
  --primary-accent: #7c3aed;
  --text-strong: #10163a;
  --text: #1f2937;
  --muted: #526387;
  --chip-note: rgba(59, 130, 246, 0.08);
  --chip-rest: rgba(16, 185, 129, 0.12);
  --chip-barline: rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-gradient);
  color: var(--text);
  display: flex;
  justify-content: center;
  width: 100%;
}

body.menu-open::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 30;
}

input,
select,
button {
  font: inherit;
}

.app-shell {
  width: min(1280px, 100%);
  padding: clamp(1.6rem, 4vw, 2.6rem) clamp(1.1rem, 3.5vw, 2.1rem)
    clamp(2rem, 5vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3.5vw, 2.1rem);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-bar-button {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.top-bar .primary.top-bar-button {
  min-width: 9rem;
  justify-content: center;
  position: relative;
}

.feedback-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.25);
  color: rgba(67, 56, 202, 0.92);
  text-decoration: none;
  font-weight: 600;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.feedback-link:hover,
.feedback-link:focus-visible {
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(79, 70, 229, 0.4);
  color: var(--primary);
  outline: none;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-bar-button {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.top-bar .primary.top-bar-button {
  min-width: 10.5rem;
  justify-content: center;
  position: relative;
}

.feedback-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.25);
  color: rgba(67, 56, 202, 0.92);
  text-decoration: none;
  font-weight: 600;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.feedback-link:hover,
.feedback-link:focus-visible {
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(79, 70, 229, 0.4);
  color: var(--primary);
  outline: none;
}

.site-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
  width: 100%;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: rgba(67, 56, 202, 0.92);
  font-weight: 700;
  font-size: clamp(1rem, 3vw, 1.15rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-logo img {
  width: clamp(38px, 6vw, 48px);
  height: clamp(38px, 6vw, 48px);
  border-radius: 14px;
  box-shadow: 0 18px 32px -20px rgba(79, 70, 229, 0.6);
}

.site-logo-text {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.site-menu-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.site-menu-link {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: rgba(67, 56, 202, 0.85);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(67, 56, 202, 0.08);
  transition: background 0.2s ease, color 0.2s ease;
}

.site-menu-link:hover,
.site-menu-link:focus-visible {
  background: rgba(79, 70, 229, 0.16);
  color: var(--primary);
  outline: none;
}

.site-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.22);
  background: rgba(79, 70, 229, 0.1);
  color: rgba(30, 64, 175, 0.92);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 16px 35px -24px rgba(30, 64, 175, 0.55);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease;
}

.site-menu-toggle:hover,
.site-menu-toggle:focus-visible {
  background: rgba(79, 70, 229, 0.16);
  border-color: rgba(79, 70, 229, 0.32);
  color: var(--primary);
  outline: none;
  box-shadow: 0 20px 40px -22px rgba(79, 70, 229, 0.55);
}

.site-menu-toggle-label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
}

.site-menu-toggle-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  width: 1.25rem;
}

.site-menu-toggle-icon span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.site-menu.is-open .site-menu-toggle-icon span:nth-child(1) {
  transform: translateY(0.48rem) rotate(45deg);
}

.site-menu.is-open .site-menu-toggle-icon span:nth-child(2) {
  opacity: 0;
}

.site-menu.is-open .site-menu-toggle-icon span:nth-child(3) {
  transform: translateY(-0.48rem) rotate(-45deg);
}

.site-menu-drawer {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: min(280px, 92vw);
  padding: 1.1rem 1.25rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 30px 60px -35px rgba(15, 23, 42, 0.6);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  backdrop-filter: blur(12px);
}

.site-menu.is-open .site-menu-drawer {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.site-menu-drawer a {
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(30, 64, 175, 0.92);
  text-decoration: none;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease;
}

.site-menu-drawer .menu-feedback-link {
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  box-shadow: 0 18px 38px -24px rgba(99, 102, 241, 0.75);
}

.site-menu-drawer .menu-feedback-link:hover,
.site-menu-drawer .menu-feedback-link:focus-visible {
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  color: #fff;
}

.site-menu-drawer a:hover,
.site-menu-drawer a:focus-visible {
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary);
  outline: none;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2.2vw, 1.35rem);
}

.site-footer {
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  padding: 1.5rem 0 0;
}

.footer-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.35rem;
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.28);
  color: rgba(67, 56, 202, 0.92);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease,
    transform 0.2s ease;
}

.footer-cta:hover,
.footer-cta:focus-visible {
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(79, 70, 229, 0.4);
  color: var(--primary);
  transform: translateY(-1px);
  outline: none;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.hero h1 {
  font-family: 'Newsreader', 'Inter', serif;
  font-size: clamp(2.2rem, 4vw, 3rem);
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text-strong);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.cta-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 20px 40px -26px rgba(79, 70, 229, 0.55);
  gap: 0.65rem;
}

.cta-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 20% 20%,
    rgba(255, 255, 255, 0.4) 0%,
    transparent 60%
  );
  pointer-events: none;
  mix-blend-mode: screen;
}

.cta-caption {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.7);
  line-height: 1.6;
}

.project-io-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.project-io-button {
  flex: 0 1 auto;
  min-width: 0;
}



.project-io-status,
.download-status {
  margin: 0.25rem 0 0;
  margin-left: auto;
  display: none;
  padding: 0.45rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.75);
  box-shadow: 0 12px 30px -22px rgba(15, 23, 42, 0.4);
}

.project-io-status.is-visible {
  display: inline-flex;
}

.project-io-status.is-success {
  border-color: rgba(22, 101, 52, 0.35);
  color: rgba(22, 101, 52, 0.9);
}

.download-status {
  align-items: center;
  gap: 0.55rem;
}

.download-status::before {
  content: '';
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 3px solid rgba(79, 70, 229, 0.24);
  border-top-color: rgba(79, 70, 229, 0.75);
  animation: download-spin 0.9s linear infinite;
}

.download-status.is-active {
  display: inline-flex;
}

.download-status.is-success {
  border-color: rgba(22, 163, 74, 0.35);
  color: rgba(22, 101, 52, 0.9);
}

.download-status.is-success::before {
  animation: none;
  border-color: rgba(22, 163, 74, 0.65);
  background: rgba(22, 163, 74, 0.12);
  box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.35);
}

@keyframes download-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.cta-button-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.cta-button-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.9rem;
  height: 1.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.65);
  transform-origin: center;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.cta-button-spinner::before {
  content: '';
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.14);
  opacity: 0.6;
}

.cta-button-spinner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.55);
  border-top-color: #ffffff;
  border-right-color: rgba(255, 255, 255, 0.3);
  border-bottom-color: rgba(255, 255, 255, 0.3);
  border-left-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15);
  animation: cta-spinner 0.75s linear infinite;
}

.cta-button:not(.is-loading) .cta-button-spinner {
  visibility: hidden;
}

.cta-button.is-loading .cta-button-label {
  opacity: 0;
  transform: translateY(0.35rem);
}

.cta-button.is-loading .cta-button-spinner {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  visibility: visible;
}

@keyframes cta-spinner {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.card {
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  padding: clamp(0.85rem, 2.2vw, 1.25rem) clamp(0.8rem, 2.5vw, 1.3rem);
  backdrop-filter: blur(6px);
}

.score-details-section {
  width: 100%;
}

.score-card {
  display: flex;
  flex-direction: column;
  gap: clamp(0.9rem, 2vw, 1.2rem);
}

.sequence-section {
  width: 100%;
}

.sequence-card {
  display: flex;
  flex-direction: column;
  gap: clamp(0.9rem, 2vw, 1.2rem);
}

.sequence-card-body {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 1.8vw, 1rem);
}

#sequence-display {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card .card-header {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.card .card-header.with-toggle {
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.card-header-text {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.note-toolbar--compact .card-header-text {
  gap: 0.15rem;
}

.card-header.with-toggle .card-header-text p {
  margin: 0;
  line-height: 1.45;
}

.card-header h2 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--text-strong);
}

.card-header p {
  margin: 0.4rem 0 1.5rem;
  color: var(--muted);
  line-height: 1.6;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(0.6rem, 2vw, 0.95rem);
}

.score-card.is-collapsed .field-grid {
  display: none;
}

.card-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.note-toolbar--compact .card-toggle {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
}

.card-toggle:hover,
.card-toggle:focus-visible {
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(79, 70, 229, 0.35);
  outline: none;
}

.card-toggle-icon {
  width: 0.65rem;
  height: 0.65rem;
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.note-toolbar--compact .card-toggle-icon {
  width: 0.45rem;
  height: 0.45rem;
}

.card.is-collapsed .card-toggle-icon {
  transform: rotate(-135deg);
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-strong);
}

.clef-selector-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: clamp(0.4rem, 1.6vw, 0.75rem);
}

.clef-track-control {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.03);
}

.clef-track-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.clef-track-select {
  width: 100%;
}

input,
select {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(248, 250, 252, 0.9);
  padding: 0.35rem 0.6rem;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.duration-row,
.entry-toolbar,
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(0.45rem, 2vw, 0.7rem);
}

.duration-row {
  margin-bottom: clamp(0.5rem, 2vw, 0.85rem);
}

.group-label {
  font-weight: 700;
  color: var(--text-strong);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-accent));
  box-shadow: 0 6px 12px -8px rgba(79, 70, 229, 0.5);
}

.group-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.note-group-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.note-toolbar .group-hint {
  line-height: 1.5;
}

.duration-button {
  font-size: 1.2rem;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 0.4rem 0.75rem;
  background: rgba(236, 239, 253, 0.75);
  font-weight: 600;
  color: var(--text-strong);
  cursor: pointer;
  transition: all 0.18s ease;
}

.toggle-pill.active,
.toggle-pill[aria-pressed='true'] {
  background: linear-gradient(135deg, var(--primary), var(--primary-accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 28px -18px rgba(79, 70, 229, 0.6);
}

.toggle-pill:focus-visible {
  outline: 3px solid rgba(129, 140, 248, 0.6);
  outline-offset: 3px;
}

.chord-tools {
  display: none;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.85rem 0 0;
}

.chord-tools.visible {
  display: flex;
}

.chord-summary {
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  border: 1px dashed rgba(59, 130, 246, 0.5);
  background: rgba(219, 234, 254, 0.55);
  color: #1d4ed8;
  font-weight: 600;
  line-height: 1.4;
}

.chord-summary.empty {
  border-color: rgba(148, 163, 184, 0.55);
  background: rgba(226, 232, 240, 0.4);
  color: rgba(71, 85, 105, 0.95);
  font-weight: 500;
}

.chord-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

button.primary.small {
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
}

button.ghost.small {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
}

.select-inline {
  min-width: 150px;
}

.piano-key {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.piano-key:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -18px rgba(15, 23, 42, 0.35);
}


.note-toolbar {
  display: flex;
  flex-direction: column;
  gap: clamp(0.25rem, 0.7vw, 0.45rem);
}

.note-toolbar--compact {
  position: static;
  margin: 0;
  padding: 0.2rem 0.45rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 6px 16px -18px rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
  gap: clamp(0.2rem, 0.6vw, 0.35rem);
}

.workspace > .note-toolbar--compact {
  align-self: stretch;
}

.preview-stage .note-toolbar--compact {
  align-self: stretch;
}

.note-toolbar-topline {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.note-toolbar-topline-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1 1 auto;
  flex-wrap: wrap;
  min-width: 0;
}

.note-toolbar-actions {
  margin-left: auto;
}

.note-toolbar-header {
  display: flex;
  justify-content: space-between;
  padding: 0;
  align-items: center;
  gap: 0.4rem;
}

.note-toolbar--compact .note-toolbar-header {
  padding: 0;
  min-height: 0;
  gap: 0.35rem;
}

.note-toolbar--compact .note-toolbar-header h2 {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.note-toolbar-header .card-header-text p {
  margin: 0;
}

.note-toolbar-body {
  display: flex;
  flex-direction: column;
  gap: clamp(0.5rem, 1.6vw, 0.85rem);
  max-height: var(--note-toolbar-body-max, 1200px);
  overflow: hidden;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}

.note-toolbar--compact .note-toolbar-body {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-height: var(--note-toolbar-body-max, 240px);
}

.track-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.45rem 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.9);
}

.note-toolbar--compact .track-selector {
  gap: 0.25rem;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  justify-content: flex-start;
}

.cursor-controls {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.65);
}

.note-toolbar--compact .cursor-controls {
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
}

.cursor-status {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.note-toolbar--compact .cursor-status {
  font-size: 0.62rem;
  white-space: nowrap;
}

.cursor-controls.has-selection .cursor-status {
  color: var(--primary);
  font-weight: 600;
}

.cursor-control-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.note-toolbar--compact .cursor-control-buttons {
  gap: 0.15rem;
}

.cursor-control-buttons button {
  flex: 1 1 0;
}

.note-toolbar--compact .cursor-control-buttons button {
  flex: 0 0 auto;
  padding: 0.2rem 0.4rem;
  font-size: 0.62rem;
}

.track-selector-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-strong);
}

.note-toolbar--compact .track-selector-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.track-selector-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.note-toolbar--compact .track-selector-buttons {
  gap: 0.15rem;
}

.track-toggle {
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.note-toolbar--compact .track-toggle {
  font-size: 0.65rem;
  padding: 0.22rem 0.5rem;
}

.track-toggle.is-active {
  background: linear-gradient(135deg, var(--primary), var(--primary-accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 20px -14px rgba(79, 70, 229, 0.6);
}

.track-toggle:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.45);
  outline-offset: 2px;
}

.track-selector.is-multi {
  border-color: rgba(148, 163, 184, 0.5);
}

.note-toolbar.is-collapsed .note-toolbar-body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.note-toolbar-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.note-toolbar--compact .note-toolbar-grid {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.control-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.note-toolbar--compact .control-stack {
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
}

.icon-button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.note-toolbar--compact .icon-button-grid {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.note-letter-grid {
  position: relative;
  margin-top: 0.75rem;
}

.note-toolbar--compact .note-letter-grid {
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.piano-keyboard {
  position: relative;
  width: 100%;
  height: clamp(4.2rem, 12vw, 5.2rem);
  padding: 0.12rem 0 0.4rem;
  box-sizing: border-box;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.65);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.piano-white-keys {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  height: 100%;
}

.piano-black-keys {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 58%;
  pointer-events: none;
}

.piano-black-keys .piano-key {
  pointer-events: auto;
}

.piano-key {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 0.3rem 0.22rem;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  background: rgba(59, 130, 246, 0.12);
  color: #1e1b4b;
  box-shadow: inset 0 -3px 0 rgba(59, 130, 246, 0.18);
  touch-action: manipulation;
  user-select: none;
}

.piano-key:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.6);
  outline-offset: 2px;
}

.piano-key-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.white-key {
  position: relative;
  height: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(224, 231, 255, 0.75));
  border-color: rgba(129, 140, 248, 0.35);
  color: #1f2937;
  box-shadow: inset 0 -6px 0 rgba(129, 140, 248, 0.2);
  padding: 0.35rem 0 0.55rem;
}

.white-key:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 12%;
  bottom: 9%;
  width: 2px;
  background: rgba(148, 163, 184, 0.25);
}

.white-key .piano-key-label {
  font-size: 1.1rem;
}

.black-key {
  position: absolute;
  top: 0;
  height: 100%;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border-color: rgba(30, 64, 175, 0.45);
  color: #e2e8f0;
  border-radius: 9px;
  padding: 0.45rem 0.2rem 0.4rem;
  font-size: 0.9rem;
  box-shadow: 0 16px 28px -20px rgba(15, 23, 42, 0.75);
  z-index: 2;
}

.black-key .piano-key-label span:first-child {
  font-size: 0.95rem;
}

.black-key .piano-key-label .enharmonic {
  font-size: 0.75rem;
  opacity: 0.85;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(79, 70, 229, 0.28);
  background: rgba(79, 70, 229, 0.08);
  color: #312e81;
  font-weight: 600;
  padding: 0.55rem 0.35rem;
  min-height: 2.8rem;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: none;
  font-size: 1.35rem;
}

.icon-button .note-icon {
  display: block;
  width: 1.9rem;
  height: auto;
}

.rest-button .note-icon {
  width: 1.6rem;
}

.icon-button .note-glyph {
  font-size: 1.6rem;
  line-height: 1;
}

.duration-button {
  background: rgba(79, 70, 229, 0.08);
}

.rest-button {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
}

.icon-button:hover {
  background: rgba(79, 70, 229, 0.16);
}

.rest-button:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.45);
  color: #047857;
}

.rest-button.active {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  color: #047857;
  box-shadow: none;
}

.icon-button.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 28px -16px rgba(79, 70, 229, 0.6);
}

.note-toolbar .toggle-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

.note-toolbar--compact .toggle-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.toggle-pill.icon {
  justify-content: center;
  width: 100%;
  min-height: 2.4rem;
  font-size: 1.15rem;
}

.toggle-pill.icon span {
  line-height: 1;
}

.stacked-chord-image {
  display: block;
  width: 1.7rem;
  height: auto;
}

.toggle-pill.icon .stacked-chord-image {
  width: 1.4rem;
  margin: 0 auto;
}

button.primary.small .stacked-chord-image {
  width: 1.4rem;
}

.select-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  align-items: center;
  line-height: 1;
}

.note-toolbar--compact .select-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.select-row select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(248, 250, 252, 0.7);
  padding: 0.32rem 0.3rem;
  font-weight: 600;
}

.note-toolbar .note-letter-grid {
  margin-top: 0.35rem;
}

.note-toolbar .piano-key {
  font-size: 1rem;
}

.note-toolbar--compact .piano-key {
  font-size: 0.85rem;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.note-toolbar--compact .action-row {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding: 0.4rem 0;
}

.note-toolbar--compact button,
.note-toolbar--compact select {
  font-size: 0.68rem;
}

.note-toolbar--compact .icon-button-grid button,
.note-toolbar--compact .note-letter-grid button,
.note-toolbar--compact .toggle-pill,
.note-toolbar--compact .action-row button {
  min-width: 1.45rem;
  min-height: 1.45rem;
  padding: 0.1rem 0.25rem;
}

.note-toolbar--compact .toggle-pill.icon {
  font-size: 0.8rem;
  min-height: 1.45rem;
}

.note-toolbar--compact .toggle-pill.icon .stacked-chord-image,
.note-toolbar--compact .chord-actions .stacked-chord-image {
  width: 0.95rem;
}

.note-toolbar--compact select {
  min-height: 1.55rem;
  padding: 0.15rem 0.3rem;
}

.note-toolbar--compact button.primary.small {
  padding: 0.25rem 0.45rem;
  font-size: 0.7rem;
  box-shadow: none;
}

.note-toolbar--compact button.ghost.small {
  padding: 0.25rem 0.4rem;
  font-size: 0.65rem;
}

.note-toolbar--compact .icon-action {
  font-size: 0.65rem;
  padding: 0.12rem 0.22rem;
}

.note-toolbar--compact .chord-tools {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.note-toolbar--compact .chord-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.note-toolbar--compact .chord-summary {
  font-size: 0.65rem;
}

button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-accent));
  box-shadow: var(--surface-shadow);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button.primary:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

button.primary:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 30px 60px -36px rgba(79, 70, 229, 0.55);
}

button.ghost {
  background: rgba(15, 23, 42, 0.05);
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  font-weight: 600;
  color: var(--text-strong);
  border: 1px solid rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

button.ghost:hover {
  background: rgba(30, 64, 175, 0.08);
  transform: translateY(-1px);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sequence-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.sequence-chip.note {
  background: var(--chip-note);
  border-color: rgba(59, 130, 246, 0.2);
  color: #1d4ed8;
}

.sequence-chip.note.chord {
  background: linear-gradient(120deg, rgba(59, 130, 246, 0.18), rgba(129, 140, 248, 0.15));
  border-color: rgba(59, 130, 246, 0.45);
  color: #1e3a8a;
}

.sequence-chip.rest {
  background: var(--chip-rest);
  border-color: rgba(16, 185, 129, 0.25);
  color: #047857;
}

.sequence-chip.barline {
  background: var(--chip-barline);
  border-color: rgba(71, 85, 105, 0.2);
  color: #334155;
}

.sequence-chip.empty {
  background: rgba(226, 232, 240, 0.5);
  border-color: rgba(148, 163, 184, 0.4);
  color: rgba(71, 85, 105, 0.9);
  font-weight: 500;
}

.sequence-track {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sequence-track-header {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-strong);
}

.sequence-track-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sequence-placeholder {
  padding: 0.7rem 1rem;
  border-radius: 16px;
  background: rgba(226, 232, 240, 0.45);
  color: rgba(71, 85, 105, 0.85);
  font-size: 0.9rem;
}


.preview-stage {
  display: flex;
  flex-direction: column;
  gap: clamp(0.6rem, 1.6vw, 0.95rem);
  padding: clamp(0.95rem, 3vw, 1.4rem) clamp(0.85rem, 2.5vw, 1.3rem);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 45px 80px -50px rgba(30, 64, 175, 0.45);
  min-height: clamp(24rem, 62vh, 38rem);
}

.preview-stage-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.preview-stage-bar h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-family: 'Newsreader', 'Inter', serif;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

.preview-pagination {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.preview-canvas {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: clamp(0.5rem, 2vw, 0.85rem);
}

.preview-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: min(100%, 980px);
  min-height: clamp(20rem, 58vh, 34rem);
  padding: clamp(0.35rem, 1.6vw, 0.7rem) clamp(0.45rem, 1.8vw, 0.85rem);
  border-radius: 20px;
  background: radial-gradient(circle at top, rgba(248, 250, 252, 0.95), #fff);
  box-shadow: 0 30px 70px -40px rgba(15, 23, 42, 0.35);
}

.preview-staff {
  position: relative;
  width: 100%;
  min-height: clamp(420px, 68vh, 780px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 3vw, 2rem);
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.08),
    rgba(15, 23, 42, 0.08) 1px,
    transparent 1px,
    transparent 18px
  );
  background-size: 100% 19px;
}

#preview-staff:empty::before {
  content: 'Ready for your music';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: rgba(15, 23, 42, 0.45);
}

.preview-staff:empty::before {
  content: '';
  display: block;
  width: min(100%, 820px);
  height: clamp(20rem, 60vh, 36rem);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.08))
      padding-box,
    repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 22px,
        rgba(148, 163, 184, 0.45) 22px,
        rgba(148, 163, 184, 0.45) 24px
      )
      border-box;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.workspace-panels {
  display: grid;
  gap: clamp(1.2rem, 3vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}

@media (min-width: 1100px) {
  .workspace-panels {
    grid-template-columns: minmax(220px, 260px) minmax(320px, 1fr)
      minmax(220px, 300px);
  }

  .workspace-panels .score-card {
    grid-column: 1;
  }

  .workspace-panels .sequence-card {
    grid-column: 2;
  }
}

.preview-staff:empty::before {
  content: '';
  display: block;
  width: min(100%, 820px);
  height: clamp(18rem, 55vh, 32rem);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.08))
      padding-box,
    repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 22px,
        rgba(148, 163, 184, 0.45) 22px,
        rgba(148, 163, 184, 0.45) 24px
      )
      border-box;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.workspace-panels {
  display: flex;
  flex-direction: column;
  gap: clamp(0.85rem, 2.5vw, 1.3rem);
}

.workspace-panels > * {
  width: 100%;
}

.preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(2.4rem, 6vw, 3rem);
  height: clamp(2.4rem, 6vw, 3rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.28);
  background: rgba(255, 255, 255, 0.88);
  color: var(--primary);
  font-size: 1.65rem;
  cursor: pointer;
  box-shadow: 0 18px 38px -26px rgba(15, 23, 42, 0.55);
  transition: all 0.2s ease;
  z-index: 2;
}

.preview-nav span {
  line-height: 1;
}

.preview-nav:hover:not(:disabled) {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 18px 45px -22px rgba(59, 130, 246, 0.4);
}

.preview-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.preview-nav.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preview-nav-prev {
  left: clamp(0.75rem, 2vw, 1.5rem);
}

.preview-nav-next {
  right: clamp(0.75rem, 2vw, 1.5rem);
}

.preview-pagination {
  margin: 0;
  text-align: inherit;
  font-weight: 500;
  color: var(--muted);
}

.preview-page-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.25s ease, filter 0.25s ease;
  will-change: transform;
}

.preview-page-wrapper:hover {
  transform: translateY(-6px);
  filter: drop-shadow(0 20px 35px rgba(15, 23, 42, 0.18));
}

.preview-page-scale {
  transform-origin: top center;
  transition: transform 0.2s ease;
  position: relative;
}

.preview-page { 
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.preview-interaction-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.preview-entry-button,
.preview-cursor-handle {
  position: absolute;
  border: none;
  background: transparent;
  padding: 0;
  pointer-events: auto;
  cursor: pointer;
}

.preview-entry-button {
  transition: background 0.2s ease;
}

.preview-entry-button:hover {
  background: rgba(79, 70, 229, 0.12);
}

.preview-entry-button.is-selected {
  background: rgba(79, 70, 229, 0.18);
  box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.35);
}

.preview-entry-button:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.6);
  outline-offset: 1px;
}

.preview-cursor-handle {
  width: 18px;
  transform: translateX(-50%);
  border-radius: 10px;
  opacity: 0;
  background: transparent;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.preview-cursor-handle.is-active {
  opacity: 0;
  background: transparent;
}

.preview-cursor-handle:hover,
.preview-cursor-handle:focus-visible {
  opacity: 1;
  background: rgba(59, 130, 246, 0.24);
  outline: none;
}

.preview-cursor-indicator {
  position: absolute;
  width: 3px;
  background: var(--primary);
  border-radius: 999px;
  pointer-events: none;
  transform: translateX(-50%);
  display: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.preview-page svg {
  width: 100%;
  height: 100%;
  display: block;
}

.preview-page-number {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(71, 85, 105, 0.8);
}

.preview-placeholder {
  text-align: center;
  color: rgba(71, 85, 105, 0.8);
  line-height: 1.6;
  font-weight: 500;
}

.preview-intro-hint {
  width: 100%;
  text-align: center;
  margin: -0.25rem 0 0;
  font-weight: 600;
  color: rgba(71, 85, 105, 0.85);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}


@media (max-width: 900px) {
  body {
    display: block;
  }

  .app-shell {
    padding: clamp(1.75rem, 8vw, 2.5rem) clamp(1rem, 6vw, 1.75rem)
      clamp(2.5rem, 10vw, 3.25rem);
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .top-bar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .preview-stage {
    border-radius: 24px;
  }
}

@media (max-width: 960px) {
  .workspace-panels {
    gap: clamp(0.75rem, 4vw, 1.1rem);
  }
}

@media (max-width: 640px) {
  .preview-stage {
    padding: clamp(1.1rem, 6vw, 1.6rem);
  }

  .preview-stage-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .top-bar-actions {
    gap: 0.4rem;
  }

  .preview-nav {
    width: clamp(2rem, 10vw, 2.4rem);
    height: clamp(2rem, 10vw, 2.4rem);
    font-size: 1.35rem;
  }

  .footer-cta {
    width: 100%;
    max-width: 320px;
  }
}

