:root {
  --bg: #0b0b0c;
  --panel: #151517;
  --panel-2: #1d1d20;
  --panel-3: #26262a;
  --ink: #f2f0e8;
  --muted: #a7a198;
  --dim: #6f6b65;
  --line: rgba(242, 240, 232, 0.13);
  --red: #d64234;
  --red-soft: rgba(214, 66, 52, 0.18);
  --warm: #d8b16a;
  --green: #66d18f;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #080809;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 22% 0, rgba(214, 66, 52, 0.16), transparent 34%),
    linear-gradient(145deg, #060607, #111113 48%, #080809);
  background-size: 26px 26px, auto, auto;
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0e0e10;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: rgba(214, 66, 52, 0.8);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.visually-hidden {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-rows: auto 1fr;
  padding: max(16px, env(safe-area-inset-top)) 14px calc(96px + max(10px, env(safe-area-inset-bottom)));
}

.performance-shell {
  display: block;
  padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
}

.performance-shell .topbar,
.performance-shell .bottom-nav {
  display: none;
}

.concert-shell .bottom-nav {
  display: none;
}

.performance-shell .screen {
  width: min(100%, 980px);
  height: calc(100vh - max(10px, env(safe-area-inset-top)) - max(10px, env(safe-area-inset-bottom)) - 2px);
  height: calc(100dvh - max(10px, env(safe-area-inset-top)) - max(10px, env(safe-area-inset-bottom)) - 2px);
  padding-bottom: 0;
}

.concert-shell .screen {
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 880px);
  margin: 0 auto 14px;
  transition: gap 160ms ease, margin 160ms ease;
}

.brand {
  min-width: 0;
  transition: width 160ms ease;
}

.brand-title {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  transition: gap 160ms ease;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.7rem, 7vw, 3rem);
  letter-spacing: 0;
  line-height: 0.95;
  transition: font-size 160ms ease;
}

.app-version {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
}

.topbar-icon-btn {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(242, 240, 232, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  padding: 0;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, opacity 140ms ease, transform 140ms ease;
}

.topbar-icon-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.topbar-icon-btn:hover {
  border-color: rgba(216, 177, 106, 0.34);
  color: var(--warm);
}

.save-status-btn.ok {
  border-color: rgba(139, 211, 163, 0.32);
  color: #9bdcab;
  background: rgba(139, 211, 163, 0.07);
}

.save-status-btn.needs-backup {
  border-color: rgba(216, 177, 106, 0.42);
  color: var(--warm);
  background: rgba(216, 177, 106, 0.09);
}

.save-status-btn.error {
  border-color: rgba(255, 116, 102, 0.48);
  color: #ffb0a7;
  background: rgba(255, 116, 102, 0.09);
}

.demo-save-status {
  border-color: rgba(124, 179, 255, 0.38);
  color: #9ec8ff;
  background: rgba(124, 179, 255, 0.08);
}

.save-status-dot {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 6px;
  height: 6px;
  border: 1px solid #111113;
  border-radius: 999px;
  background: currentColor;
}

.account-status-btn.signed_out,
.account-status-btn.session_expired {
  border-color: rgba(216, 177, 106, 0.34);
  color: var(--warm);
  background: rgba(216, 177, 106, 0.075);
}

.account-status-btn.signed_in {
  border-color: rgba(139, 211, 163, 0.32);
  color: #9bdcab;
  background: rgba(139, 211, 163, 0.07);
}

.account-status-btn.sending,
.account-status-btn.check_email {
  border-color: rgba(124, 179, 255, 0.38);
  color: #9ec8ff;
  background: rgba(124, 179, 255, 0.08);
}

.account-status-btn.config_missing,
.account-status-btn.auth_error,
.account-status-btn.offline_or_unavailable,
.account-status-btn.signed_in_offline {
  border-color: rgba(255, 116, 102, 0.46);
  color: #ffb0a7;
  background: rgba(255, 116, 102, 0.08);
}

.account-status-dot {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 6px;
  height: 6px;
  border: 1px solid #111113;
  border-radius: 999px;
  background: currentColor;
}

.settings-status-btn {
  color: #c9c2b6;
}

.settings-short-label {
  display: none;
}

.demo-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 880px);
  margin: -5px auto 14px;
  padding: 9px 11px;
  border: 1px solid rgba(124, 179, 255, 0.24);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(124, 179, 255, 0.13), rgba(216, 177, 106, 0.07)),
    rgba(18, 20, 24, 0.78);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.demo-status-banner strong {
  display: block;
  font-size: 0.86rem;
  line-height: 1.2;
}

.demo-status-banner span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.28;
}

.demo-status-banner .btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  transition: opacity 140ms ease;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.mode-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px;
  transition: width 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.mode-switch::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 9px) / 2);
  border-radius: 999px;
  background: rgba(216, 177, 106, 0.18);
  transform: translateX(0);
  transition: transform 180ms ease, background 180ms ease;
}

.mode-switch.concert-active::before {
  transform: translateX(calc(100% + 3px));
}

.mode-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 950;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.mode-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 0.78em;
  height: 0.78em;
  color: currentColor;
}

.mode-icon-pause::before,
.mode-icon-pause::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  border-radius: 2px;
  background: currentColor;
}

.mode-icon-pause::before {
  left: 12%;
}

.mode-icon-pause::after {
  right: 12%;
}

.mode-icon-play {
  width: 0.7em;
}

.mode-icon-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 12%;
  width: 0;
  height: 0;
  border-top: 0.38em solid transparent;
  border-bottom: 0.38em solid transparent;
  border-left: 0.58em solid currentColor;
  transform: translateY(-50%);
}

.mode-btn.active {
  background: transparent;
  color: var(--warm);
}

@media (max-width: 560px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }

  .topbar-actions {
    display: block;
    width: 100%;
  }

  .brand {
    width: 100%;
  }

  .brand-title {
    display: grid;
    grid-template-columns: minmax(0, auto) auto minmax(0, 1fr) 42px 42px;
    gap: 6px;
    width: 100%;
    align-items: center;
  }

  .brand-title.has-account-status {
    grid-template-columns: minmax(0, auto) auto minmax(0, 1fr) 42px 42px 42px;
  }

  .brand h1 {
    font-size: clamp(1.35rem, 8vw, 1.85rem);
  }

  .app-version {
    font-size: 0.62rem;
  }

  .brand p {
    display: none;
  }

  .topbar-icon-btn {
    width: 42px;
    height: 42px;
  }

  .topbar-icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .save-status-btn {
    grid-column: 4;
  }

  .account-status-btn {
    grid-column: 5;
  }

  .settings-status-btn {
    grid-column: 5;
  }

  .brand-title.has-account-status .settings-status-btn {
    grid-column: 6;
  }

  .save-status-dot,
  .account-status-dot {
    right: 8px;
    bottom: 8px;
    width: 7px;
    height: 7px;
  }

  .demo-status-banner {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
  }

  .demo-status-banner .btn {
    width: 100%;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-btn {
    min-height: 40px;
    padding: 7px 10px;
    font-size: 0.76rem;
  }

  .concert-shell .topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .concert-shell .brand {
    width: auto;
    flex: 1 1 auto;
  }

  .concert-shell .brand-title {
    display: flex;
    width: auto;
    gap: 6px;
  }

  .concert-shell .brand h1 {
    font-size: clamp(1.2rem, 6.2vw, 1.55rem);
  }

  .concert-shell .app-version {
    font-size: 0.56rem;
  }

  .concert-shell .topbar-actions {
    width: auto;
    flex: 0 0 auto;
  }

  .concert-shell .mode-switch {
    width: auto;
    min-width: 164px;
  }

  .concert-shell .mode-btn {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 0.7rem;
  }
}

.screen {
  --swipe-x: 0px;
  width: min(100%, 880px);
  margin: 0 auto;
  padding-bottom: 16px;
}

.screen.swipe-enabled {
  touch-action: pan-y;
}

.screen.is-swiping {
  transform: translate3d(var(--swipe-x), 0, 0);
  transition: none;
  will-change: transform;
}

.screen.swipe-settling {
  transform: translate3d(var(--swipe-x), 0, 0);
  pointer-events: none;
  transition: transform 210ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .screen.swipe-settling {
    transition-duration: 1ms;
  }
}

.module-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(170, 126, 67, 0.08), transparent 18%, transparent 82%, rgba(170, 126, 67, 0.08)),
    repeating-linear-gradient(110deg, rgba(255, 255, 255, 0.032) 0 1px, transparent 1px 8px),
    linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  padding: 16px;
}

.module-panel::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(214, 66, 52, 0.16), transparent) 0 0 / 100% 2px no-repeat,
    radial-gradient(circle at 96% 4%, rgba(216, 177, 106, 0.16), transparent 18%);
  content: "";
  pointer-events: none;
}

.module-panel > * {
  position: relative;
}

.tuner-screen {
  min-height: calc(100vh - 130px);
  overflow: hidden;
  border: 1px solid rgba(242, 240, 232, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    radial-gradient(circle at 50% 18%, rgba(38, 198, 151, 0.08), transparent 28%),
    #17191b;
  background-size: 28px 28px, 28px 28px, auto, auto;
  padding: 18px 16px 14px;
}

.tuner-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.tuner-head h2 {
  margin: 0;
  color: #f7f7f2;
  font-size: clamp(2rem, 10vw, 3.1rem);
  line-height: 0.95;
}

.tuner-mode-title {
  display: block;
  margin-top: 14px;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-size: 1.02rem;
  font-weight: 800;
  text-align: left;
}

.tuner-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.auto-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.auto-pill i {
  position: relative;
  display: block;
  width: 58px;
  height: 34px;
  border-radius: 999px;
  background: #2b2d31;
}

.auto-pill i::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #f3f2eb;
  content: "";
  transition: transform 180ms ease;
}

.auto-pill i.on {
  background: #17c994;
}

.auto-pill i.on::after {
  transform: translateX(24px);
}

.tuna-meter {
  position: relative;
  height: 310px;
  margin: 12px -16px 8px;
  overflow: hidden;
}

.pitch-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(242, 240, 232, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(242, 240, 232, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black 10%, transparent 92%);
}

.flat-sign,
.sharp-sign {
  position: absolute;
  top: 44px;
  color: #d4d4d0;
  font-size: 2rem;
}

.flat-sign {
  left: 20px;
}

.sharp-sign {
  right: 24px;
}

.center-line {
  position: absolute;
  top: -18px;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(242, 240, 232, 0.16), transparent);
}

.smooth-pointer {
  position: absolute;
  top: 54px;
  left: 50%;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 3px solid #f2f0e8;
  border-radius: 999px;
  background: #17191b;
  transform: translateX(0);
  transition: transform 180ms cubic-bezier(0.22, 0.9, 0.28, 1);
  will-change: transform;
}

.smooth-pointer::after {
  position: absolute;
  bottom: -10px;
  left: 50%;
  width: 0;
  height: 0;
  border-right: 6px solid transparent;
  border-left: 6px solid transparent;
  border-top: 10px solid #f2f0e8;
  content: "";
  transform: translateX(-50%);
}

.smooth-pointer span {
  display: none;
}

.tuner-message {
  position: absolute;
  right: 28px;
  bottom: 62px;
  left: 28px;
  border-radius: 999px;
  background: #2d2f34;
  color: var(--ink);
  padding: 15px 18px;
  text-align: center;
  font-weight: 800;
}

.peg-tuner {
  display: grid;
  grid-template-columns: 74px 1fr 74px;
  gap: 12px;
  align-items: center;
  margin-top: -70px;
}

.peg-column {
  display: grid;
  gap: 18px;
  z-index: 1;
}

.peg {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
}

.peg-column.right .peg {
  grid-template-columns: 1fr 44px;
}

.peg-column.right .peg-label {
  order: 2;
}

.peg-column.right .peg-post {
  order: 1;
}

.peg-label {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 999px;
  background: #292c31;
  color: #f4f2ec;
  font-size: 1.08rem;
  font-weight: 900;
}

.peg.active .peg-label {
  background: #17c994;
  color: #081714;
}

.peg-post {
  display: block;
  width: 44px;
  height: 36px;
  border-radius: 16px 999px 999px 16px;
  background: linear-gradient(90deg, #4e5255, #f0f1ec 46%, #656a6e);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.55);
}

.peg-post.right {
  border-radius: 999px 16px 16px 999px;
}

.headstock-lite {
  position: relative;
  min-height: 360px;
  border: 2px solid rgba(242, 240, 232, 0.65);
  border-radius: 44% 44% 18px 18px / 14% 14% 10px 10px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 24%, transparent 76%, rgba(255, 255, 255, 0.06)),
    repeating-linear-gradient(90deg, #5a301c 0 6px, #7e4528 6px 12px, #3c2116 12px 18px);
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.45), 0 22px 50px rgba(0, 0, 0, 0.34);
}

.string-line {
  position: absolute;
  top: 32px;
  bottom: -22px;
  width: 2px;
  background: linear-gradient(#dfe4e1, #7f8585);
  opacity: 0.74;
  transform-origin: top center;
}

.string-line.active {
  background: #17c994;
  box-shadow: 0 0 12px rgba(23, 201, 148, 0.8);
  opacity: 1;
}

.s1 { left: 24%; transform: rotate(-8deg); }
.s2 { left: 34%; transform: rotate(-4deg); }
.s3 { left: 44%; transform: rotate(-1deg); }
.s4 { right: 44%; transform: rotate(1deg); }
.s5 { right: 34%; transform: rotate(4deg); }
.s6 { right: 24%; transform: rotate(8deg); }

.target-note {
  position: absolute;
  right: 18px;
  bottom: 56px;
  left: 18px;
  text-align: center;
  color: #f7f4ea;
  font-size: clamp(3.6rem, 18vw, 5.4rem);
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.target-frequency {
  position: absolute;
  right: 0;
  bottom: 24px;
  left: 0;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.chromatic-readout {
  display: grid;
  gap: 22px;
  margin-top: -48px;
  padding: 0 18px 16px;
  text-align: center;
}

.chromatic-readout span {
  display: block;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.chromatic-readout strong {
  display: block;
  margin-top: 8px;
  color: #17c994;
  font-size: 1.7rem;
}

.chromatic-note {
  color: #f7f4ea;
  font-size: clamp(4rem, 20vw, 6rem);
  font-weight: 950;
}

.tuner-modes {
  margin-top: 16px;
}

.a4-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  border-top: 1px solid rgba(242, 240, 232, 0.08);
  padding-top: 12px;
}

.section-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(1.25rem, 5vw, 2rem);
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.schema-title {
  align-items: start;
  margin-bottom: 10px;
}

.schema-active-song-title {
  display: block;
  margin-top: 4px;
  color: var(--warm);
  font-size: clamp(1.05rem, 4.8vw, 1.55rem);
  font-weight: 950;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.schema-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.schema-meta-line span {
  min-width: 0;
  border: 1px solid rgba(242, 240, 232, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.15;
  padding: 5px 8px;
}

.schema-meta-line span:first-child {
  border-color: rgba(242, 240, 232, 0.1);
  color: var(--muted);
}

.schema-context-chip {
  min-width: min(220px, 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
}

.schema-context-chip strong {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.schema-context-chip small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.grid {
  display: grid;
  gap: 12px;
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

.three-col {
  grid-template-columns: repeat(3, 1fr);
}

.btn,
.chip,
.icon-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(#27272b, #121214);
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
  font-weight: 900;
}

.btn.primary,
.chip.active {
  border-color: rgba(214, 66, 52, 0.74);
  background: linear-gradient(#d64234, #782018);
  color: white;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.btn.danger {
  color: #ffd5ce;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.chip {
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 0.84rem;
}

.mini-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.library-controls,
.schema-picker {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.project-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: end;
}

.project-picker-row label {
  min-width: 0;
}

.project-picker-row select {
  min-width: 0;
  width: 100%;
}

.project-create-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-color: rgba(216, 177, 106, 0.32);
  background: rgba(216, 177, 106, 0.08);
  color: var(--warm);
}

.project-create-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.library-controls .wide {
  grid-column: 1 / -1;
}

.library-stats,
.arranger-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.arranger-summary {
  opacity: 0.76;
}

.library-stats div,
.arranger-summary div {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.arranger-summary div {
  padding: 8px 10px;
}

.library-stats strong,
.arranger-summary strong {
  color: var(--ink);
  font-size: 1rem;
}

.library-stats span,
.arranger-summary span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.project-song-list,
.program-editor,
.rehearsal-order {
  display: grid;
  gap: 10px;
}

.project-welcome {
  display: grid;
  justify-items: start;
  gap: 12px;
  border: 1px dashed rgba(216, 177, 106, 0.38);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(216, 177, 106, 0.12), rgba(255, 255, 255, 0.025));
  color: var(--ink);
  padding: 18px;
  text-align: left;
}

.project-welcome h3 {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: 0;
}

.project-welcome p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.welcome-note {
  max-width: 560px;
  font-size: 0.84rem;
}

.project-song-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 8px;
}

.project-song-card.active {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.song-library-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.song-library-search label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.song-library-search .icon-btn {
  width: 40px;
  min-height: 40px;
}

@media (max-width: 640px) {
  .project-song-card {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .project-song-card > .project-song-actions {
    display: grid;
    grid-template-columns: repeat(2, 42px);
    grid-auto-rows: 42px;
    justify-content: end;
    justify-items: center;
    align-items: center;
    align-self: center;
    width: max-content;
    gap: 6px;
  }

  .project-song-card > .project-song-actions .song-action-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
  }

  .project-song-card .song-title-display strong {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

.song-card-main {
  display: grid;
  min-width: 0;
  gap: 5px;
  border: 0;
  border-radius: 10px;
  background: rgba(10, 10, 11, 0.58);
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.song-card-main strong,
.song-card-main input,
.program-song-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-title-display {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.song-title-display small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.song-title-inline {
  width: 100%;
  min-height: 42px;
  font-weight: 900;
}

.song-title-inline.invalid,
#arrangerTitle.invalid {
  border-color: rgba(214, 66, 52, 0.86);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.song-title-error {
  display: none;
  margin: 6px 0 0;
  color: #ffb0a8;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.35;
}

.song-title-error.show {
  display: block;
}

.song-card-main span,
.song-card-main em {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.song-card-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  padding: 4px 7px;
  white-space: nowrap;
}

.program-editor.locked {
  opacity: 1;
}

.arrangement-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.compact-dialog {
  max-width: 520px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.template-section-label {
  display: block;
  margin: 14px 0 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.template-helper {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.template-choice {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(242, 240, 232, 0.12);
  border-radius: 12px;
  background: rgba(12, 12, 13, 0.74);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.template-choice.selected {
  border-color: rgba(216, 177, 106, 0.82);
  background: rgba(216, 177, 106, 0.14);
  box-shadow: inset 0 0 0 1px rgba(216, 177, 106, 0.16);
}

.template-choice small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.35;
}

.custom-template-choice {
  border-color: rgba(216, 177, 106, 0.28);
  background: rgba(216, 177, 106, 0.08);
}

.create-song-error {
  display: none;
  margin: -4px 0 10px;
  color: #ffb0a8;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
}

.create-song-error.show {
  display: block;
}

.create-song-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.create-song-footer strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
  border: 1px solid rgba(242, 240, 232, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  padding: 10px;
}

.arrangement-maintenance {
  margin-top: 8px;
  border: 1px solid rgba(214, 66, 52, 0.22);
  border-radius: 12px;
  background: rgba(214, 66, 52, 0.055);
  padding: 8px 10px;
}

.arrangement-maintenance summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
}

.arrangement-maintenance p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.arrangement-maintenance .btn {
  width: 100%;
}

.section-suggestions {
  border: 1px solid rgba(242, 240, 232, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  padding: 8px;
}

.section-suggestions summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
}

.suggestion-compose {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.suggestion-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.suggestion-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(242, 240, 232, 0.1);
  border-radius: 10px;
  background: rgba(12, 12, 13, 0.62);
  padding: 8px;
}

.suggestion-item strong,
.suggestion-item span {
  display: block;
}

.suggestion-item strong {
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.25;
}

.suggestion-item span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.suggestion-item.resolved {
  opacity: 0.62;
}

.suggestion-actions {
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
}

.suggestion-actions .btn,
.suggestion-actions .icon-btn {
  min-height: 38px;
}

.template-manage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 6px;
  align-items: stretch;
}

.template-manage-row .template-choice {
  min-width: 0;
}

.template-choice strong {
  font-size: 0.92rem;
}

.template-choice span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.section-meta-details {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(242, 240, 232, 0.1);
  border-radius: 12px;
  background: rgba(12, 12, 13, 0.52);
  padding: 10px;
}

.section-meta-details summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
}

.section-meta-details[open] {
  gap: 10px;
}

.section-meta-details[open] summary {
  margin-bottom: 8px;
}

.add-program-song,
.program-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.add-program-song {
  grid-template-columns: minmax(128px, 0.72fr) minmax(0, 1fr) auto;
}

.program-add-message {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid rgba(216, 177, 106, 0.18);
  border-radius: 10px;
  background: rgba(216, 177, 106, 0.06);
  color: var(--muted);
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
}

.program-repeat-confirm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.program-repeat-confirm .inline-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.program-repeat-confirm .btn {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.74rem;
}

.schema-floating-actions {
  position: sticky;
  z-index: 49;
  bottom: calc(82px + max(10px, env(safe-area-inset-bottom)));
  display: flex;
  justify-self: end;
  width: fit-content;
  max-width: min(100%, 220px);
  margin: 2px 0 0 auto;
  border: 0;
  border-radius: 16px;
  background: transparent;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: none;
}

.schema-floating-actions #arrangerPlay {
  pointer-events: auto;
  width: 100%;
  min-height: 48px;
  min-width: 160px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 920;
  box-shadow: 0 12px 26px rgba(214, 66, 52, 0.3);
}

.version-save-action {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  border-top: 1px solid rgba(242, 240, 232, 0.08);
  padding-top: 8px;
}

.version-save-action .btn {
  justify-self: start;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.76rem;
}

.version-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.version-notes-toggle.active {
  border-color: rgba(216, 177, 106, 0.34);
  color: var(--warm);
}

.version-save-action p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.28;
}

.autosave-status {
  display: grid;
  gap: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-overflow: ellipsis;
}

.autosave-status strong,
.autosave-status small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.autosave-status strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.autosave-status small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.autosave-status.local strong {
  color: var(--warm);
}

.autosave-status.synced strong {
  color: var(--green);
}

.bottom-nav {
  position: fixed;
  z-index: 50;
  right: auto;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: min(calc(100% - 28px), 880px);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(12, 12, 13, 0.92);
  padding: 8px;
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.nav-btn {
  display: grid;
  min-width: 0;
  min-height: 56px;
  place-items: center;
  gap: 4px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.nav-btn span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-btn svg {
  width: 21px;
  height: 21px;
  stroke-width: 2.2;
}

.nav-btn.active {
  background: var(--red-soft);
  color: var(--ink);
}

.tuner-meter {
  display: grid;
  gap: 14px;
}

.note-card {
  display: grid;
  min-height: 230px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    #101012;
  padding: 18px;
}

.note-main {
  font-size: clamp(5rem, 28vw, 8rem);
  font-weight: 950;
  line-height: 0.86;
}

.needle-track {
  position: relative;
  width: min(100%, 360px);
  height: 56px;
  margin-top: 8px;
}

.needle-track::before {
  position: absolute;
  top: 26px;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), var(--warm), var(--green), var(--warm), var(--red));
  content: "";
}

.needle-track::after {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 2px;
  height: 36px;
  background: var(--ink);
  content: "";
}

.needle {
  position: absolute;
  top: 2px;
  left: calc(50% - 2px);
  width: 4px;
  height: 48px;
  border-radius: 999px;
  background: var(--red);
  transform: translateX(0);
  transition: transform 110ms ease-out;
}

.meter-copy {
  display: flex;
  justify-content: space-between;
  width: min(100%, 360px);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.readouts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.readout {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.readout strong {
  display: block;
  margin-top: 4px;
  font-size: 1.45rem;
}

.string-bank,
.mode-bank,
.duration-bank {
  display: grid;
  gap: 8px;
}

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

.mode-bank {
  grid-template-columns: repeat(3, 1fr);
}

.duration-bank {
  grid-template-columns: repeat(3, 1fr);
}

.metronome-display {
  display: grid;
  gap: 14px;
  text-align: center;
}

.bpm {
  font-size: clamp(4.8rem, 28vw, 8rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.85;
}

.bpm small {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
}

.beat-numbers {
  display: grid;
  grid-template-columns: repeat(var(--beats, 4), 1fr);
  gap: 8px;
}

.beat-number {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #101012;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 950;
}

.beat-number.accent {
  border-color: rgba(216, 177, 106, 0.8);
  color: var(--warm);
}

.beat-number.active {
  background: var(--red);
  color: white;
  transform: translateY(-2px);
}

.tap-button {
  width: min(74vw, 260px);
  aspect-ratio: 1;
  border: 2px solid rgba(214, 66, 52, 0.72);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.12), transparent 32%),
    linear-gradient(#242428, #0c0c0d);
  color: var(--ink);
  font-size: clamp(2.4rem, 14vw, 4.2rem);
  font-weight: 950;
  letter-spacing: 0;
  margin: 0 auto;
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.38), inset 0 0 0 8px rgba(255, 255, 255, 0.03);
}

.tap-button.flash {
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.22), transparent 32%),
    linear-gradient(#d64234, #5e1711);
}

.metro-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.setlist-layout {
  display: grid;
  gap: 12px;
}

.performance-stage {
  display: grid;
  height: 100%;
  grid-template-rows: auto auto auto auto auto auto auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(216, 177, 106, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 84% 0, rgba(216, 177, 106, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.018)),
    #0d0d0f;
  padding: 10px;
}

.performance-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, 34%);
  gap: 10px;
  align-items: stretch;
}

.performance-song,
.performance-current,
.performance-lyrics,
.metronome-lamp {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.performance-song {
  min-width: 0;
  padding: 12px;
}

.performance-song h2 {
  overflow: hidden;
  margin: 0;
  font-size: clamp(1.7rem, 8vw, 3.6rem);
  line-height: 0.96;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.performance-song p,
.performance-current span:not(.now-badge) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.performance-session {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.performance-session span {
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(242, 240, 232, 0.1);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  padding: 4px 7px;
  font-size: 0.68rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emergency-stop {
  min-height: 78px;
  border: 1px solid rgba(255, 210, 200, 0.34);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(#ff5b4e, #8f2018);
  color: white;
  font-size: clamp(1.8rem, 9vw, 3rem);
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: 0 20px 42px rgba(214, 66, 52, 0.25);
}

.performance-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
  gap: 5px;
  overflow: hidden;
  max-height: 116px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 7px;
}

.performance-map .song-map-item {
  min-height: 34px;
  padding: 4px;
}

.performance-map .song-map-gap {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px dashed rgba(242, 240, 232, 0.22);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.performance-map .song-map-item.now {
  border-color: rgba(255, 218, 128, 1);
  background: linear-gradient(180deg, rgba(216, 177, 106, 0.34), rgba(214, 66, 52, 0.18));
  box-shadow: 0 0 18px rgba(216, 177, 106, 0.3);
}

.performance-now {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(84px, 22%);
  gap: 10px;
}

.performance-current {
  display: grid;
  min-width: 0;
  gap: 7px;
  padding: 12px;
  border-color: rgba(255, 218, 128, 0.72);
  background:
    linear-gradient(90deg, rgba(216, 177, 106, 0.18), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.04);
}

.performance-current strong {
  overflow: hidden;
  font-size: clamp(1.6rem, 8vw, 3.4rem);
  line-height: 0.98;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.performance-bars {
  margin-top: 3px;
}

.performance-bars i {
  position: relative;
}

.performance-bars i.has-audio-cue::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #66d18f;
  box-shadow: 0 0 0 1px rgba(6, 10, 9, 0.76), 0 0 10px rgba(102, 209, 143, 0.34);
  pointer-events: none;
  transform: translateY(-50%);
}

.performance-bars i.audio-cue-now::after {
  width: 8px;
  height: 8px;
  background: #fff1bd;
  box-shadow: 0 0 0 2px rgba(6, 10, 9, 0.78), 0 0 16px rgba(255, 241, 189, 0.72);
  animation: performance-audio-cue-pulse 360ms ease-out both;
}

.metronome-lamp {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px;
}

.metronome-lamp i {
  display: block;
  width: min(19vw, 74px);
  aspect-ratio: 1;
  border-radius: 999px;
  background: #321915;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.54);
}

.metronome-lamp.on i {
  background: radial-gradient(circle at 38% 32%, #ffe9b2, rgba(216, 177, 106, 0.42) 42%, rgba(107, 62, 33, 0.55) 76%);
  box-shadow: 0 0 12px rgba(216, 177, 106, 0.22), inset 0 0 16px rgba(0, 0, 0, 0.2);
  animation: metronomeLampPulse 220ms ease-out both;
}

.metronome-lamp.pending i {
  background: radial-gradient(circle at 38% 32%, #fff7d1, #caa86d 42%, #5b4630 76%);
  box-shadow: 0 0 22px rgba(216, 177, 106, 0.46), inset 0 0 12px rgba(255, 255, 255, 0.24);
}

.metronome-lamp.accent i {
  background: radial-gradient(circle at 38% 32%, #ffd8c9, rgba(255, 99, 85, 0.52) 44%, rgba(142, 32, 24, 0.68) 78%);
  box-shadow: 0 0 16px rgba(214, 66, 52, 0.28), inset 0 0 16px rgba(0, 0, 0, 0.16);
  animation: metronomeAccentPulse 220ms ease-out both;
}

.metronome-lamp span {
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 950;
}

.performance-beats {
  display: grid;
  grid-template-columns: repeat(var(--beats, 4), minmax(0, 1fr));
  gap: 8px;
}

.performance-beats span {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid rgba(242, 240, 232, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.026);
  color: rgba(242, 240, 232, 0.46);
  font-size: 1rem;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  transition:
    background 90ms ease-out,
    border-color 90ms ease-out,
    color 90ms ease-out,
    box-shadow 90ms ease-out,
    transform 90ms ease-out;
}

.performance-beats span.active {
  border-color: rgba(216, 177, 106, 0.58);
  background: rgba(216, 177, 106, 0.12);
  color: #f1cf8a;
  box-shadow: 0 0 8px rgba(216, 177, 106, 0.12), inset 0 0 0 1px rgba(255, 236, 176, 0.1);
  animation: beatPulse 220ms ease-out both;
}

.performance-beats span.accent {
  border-color: rgba(214, 66, 52, 0.34);
  background: rgba(214, 66, 52, 0.08);
  color: rgba(255, 127, 108, 0.72);
}

.performance-beats span.active.accent {
  border-color: rgba(255, 114, 92, 0.78);
  background: rgba(214, 66, 52, 0.14);
  color: #ff907b;
  box-shadow: 0 0 10px rgba(214, 66, 52, 0.18), inset 0 0 0 1px rgba(255, 202, 178, 0.12);
  animation-name: beatAccentPulse;
}

@keyframes metronomeLampPulse {
  0% {
    background: radial-gradient(circle at 38% 32%, #fffbe6, #ffd773 40%, #b36a2b 76%);
    box-shadow: 0 0 36px rgba(216, 177, 106, 0.66), inset 0 0 12px rgba(255, 255, 255, 0.34);
    transform: scale(1.04);
  }

  55% {
    background: radial-gradient(circle at 38% 32%, #fff1c5, #e1ad56 42%, #8d4f24 76%);
    box-shadow: 0 0 18px rgba(216, 177, 106, 0.36), inset 0 0 12px rgba(255, 255, 255, 0.18);
    transform: scale(1.01);
  }

  100% {
    background: radial-gradient(circle at 38% 32%, #ffe9b2, rgba(216, 177, 106, 0.42) 42%, rgba(107, 62, 33, 0.55) 76%);
    box-shadow: 0 0 12px rgba(216, 177, 106, 0.22), inset 0 0 16px rgba(0, 0, 0, 0.2);
    transform: scale(1);
  }
}

@keyframes performance-audio-cue-pulse {
  from {
    transform: translateY(-50%) scale(1.42);
  }

  to {
    transform: translateY(-50%) scale(1);
  }
}

@keyframes metronomeAccentPulse {
  0% {
    background: radial-gradient(circle at 38% 32%, #fff2dd, #ff6355 44%, #8e2018 78%);
    box-shadow: 0 0 40px rgba(214, 66, 52, 0.78), inset 0 0 12px rgba(255, 255, 255, 0.34);
    transform: scale(1.07);
  }

  55% {
    background: radial-gradient(circle at 38% 32%, #ffdcca, #e8493e 44%, #742018 78%);
    box-shadow: 0 0 22px rgba(214, 66, 52, 0.42), inset 0 0 12px rgba(255, 255, 255, 0.16);
    transform: scale(1.02);
  }

  100% {
    background: radial-gradient(circle at 38% 32%, #ffd8c9, rgba(255, 99, 85, 0.52) 44%, rgba(142, 32, 24, 0.68) 78%);
    box-shadow: 0 0 16px rgba(214, 66, 52, 0.28), inset 0 0 16px rgba(0, 0, 0, 0.16);
    transform: scale(1);
  }
}

@keyframes beatPulse {
  0% {
    border-color: rgba(255, 225, 145, 0.98);
    background: rgba(255, 216, 116, 0.42);
    color: #fff6d5;
    box-shadow: 0 0 22px rgba(216, 177, 106, 0.48), inset 0 0 0 1px rgba(255, 246, 213, 0.32);
    transform: translateY(-1px) scale(1.02);
  }

  54% {
    border-color: rgba(216, 177, 106, 0.7);
    background: rgba(216, 177, 106, 0.2);
    color: #f4d691;
    box-shadow: 0 0 12px rgba(216, 177, 106, 0.24), inset 0 0 0 1px rgba(255, 236, 176, 0.16);
    transform: translateY(0) scale(1.01);
  }

  100% {
    border-color: rgba(216, 177, 106, 0.58);
    background: rgba(216, 177, 106, 0.12);
    color: #f1cf8a;
    box-shadow: 0 0 8px rgba(216, 177, 106, 0.12), inset 0 0 0 1px rgba(255, 236, 176, 0.1);
    transform: none;
  }
}

@keyframes beatAccentPulse {
  0% {
    border-color: rgba(255, 176, 144, 1);
    background: rgba(255, 91, 70, 0.5);
    color: #fff0e9;
    box-shadow: 0 0 26px rgba(214, 66, 52, 0.58), inset 0 0 0 1px rgba(255, 230, 215, 0.36);
    transform: translateY(-1px) scale(1.03);
  }

  54% {
    border-color: rgba(255, 114, 92, 0.88);
    background: rgba(214, 66, 52, 0.24);
    color: #ffb19f;
    box-shadow: 0 0 14px rgba(214, 66, 52, 0.3), inset 0 0 0 1px rgba(255, 202, 178, 0.18);
    transform: translateY(0) scale(1.01);
  }

  100% {
    border-color: rgba(255, 114, 92, 0.78);
    background: rgba(214, 66, 52, 0.14);
    color: #ff907b;
    box-shadow: 0 0 10px rgba(214, 66, 52, 0.18), inset 0 0 0 1px rgba(255, 202, 178, 0.12);
    transform: none;
  }
}

.performance-progress {
  overflow: hidden;
  height: 11px;
  border-radius: 999px;
  background: rgba(242, 240, 232, 0.14);
}

.performance-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--warm));
  transition: width 120ms linear;
}

.performance-role-focus {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}

.performance-role-focus div {
  display: grid;
  min-width: 0;
  gap: 4px;
  border: 1px solid rgba(242, 240, 232, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 9px 10px;
}

.performance-role-focus strong {
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(0.92rem, 3vw, 1.18rem);
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-vocalist .performance-lyrics {
  border-color: rgba(216, 177, 106, 0.36);
  background: rgba(216, 177, 106, 0.055);
}

.role-vocalist .performance-lyrics strong {
  font-size: clamp(1.8rem, 7.4vw, 3.55rem);
}

.role-vocalist .performance-lyrics p {
  font-size: clamp(1.42rem, 6.4vw, 2.9rem);
}

.role-drummer .performance-now {
  grid-template-columns: minmax(0, 1fr) minmax(104px, 28%);
}

.role-drummer .performance-beats span {
  min-height: 50px;
  font-size: 1.18rem;
}

.role-drummer .metronome-lamp i {
  width: min(24vw, 92px);
}

.role-guitar .performance-role-focus div {
  border-color: rgba(216, 177, 106, 0.24);
  background: rgba(216, 177, 106, 0.07);
}

.role-viewer .emergency-stop {
  opacity: 0.78;
}

.performance-cues {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.performance-cues div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(242, 240, 232, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.performance-cues strong {
  color: var(--ink);
  font-size: clamp(0.9rem, 3vw, 1.22rem);
  line-height: 1.2;
}

.performance-lyrics {
  overflow: hidden;
  min-height: 0;
  padding: clamp(14px, 3.5vw, 26px);
  line-height: 1.28;
}

.performance-lyrics strong {
  display: block;
  margin-bottom: 0.45em;
  color: var(--ink);
  font-size: clamp(1.55rem, 6.4vw, 3.2rem);
  line-height: 1.12;
}

.performance-lyrics p {
  margin: 0.25em 0;
  color: var(--ink);
  font-size: clamp(1.28rem, 5.6vw, 2.65rem);
  font-weight: 780;
}

@media (max-width: 900px), (max-height: 720px) {
  .performance-shell {
    padding: max(6px, env(safe-area-inset-top)) 6px max(6px, env(safe-area-inset-bottom));
  }

  .performance-shell .screen {
    width: 100%;
    height: calc(100vh - max(6px, env(safe-area-inset-top)) - max(6px, env(safe-area-inset-bottom)) - 2px);
    height: calc(100dvh - max(6px, env(safe-area-inset-top)) - max(6px, env(safe-area-inset-bottom)) - 2px);
  }

  .performance-stage {
    grid-template-rows: auto auto auto auto auto auto auto minmax(0, 1fr);
    gap: 8px;
    border-radius: 14px;
    padding: 8px;
  }

  .performance-top {
    grid-template-columns: minmax(0, 1fr) minmax(96px, 28%);
    gap: 8px;
  }

  .performance-song,
  .performance-current {
    padding: 10px;
  }

  .performance-song h2,
  .performance-current strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: clip;
    white-space: normal;
  }

  .performance-song h2 {
    font-size: clamp(1.3rem, 5.4vw, 2.7rem);
    line-height: 1.02;
  }

  .performance-song p,
  .performance-current span:not(.now-badge) {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.78rem;
    line-height: 1.2;
    text-overflow: clip;
    white-space: normal;
  }

  .performance-session {
    gap: 4px;
    margin-top: 6px;
  }

  .performance-session span {
    padding: 3px 6px;
    font-size: 0.62rem;
  }

  .emergency-stop {
    min-height: 64px;
    border-radius: 13px;
    font-size: clamp(1.45rem, 5.8vw, 2.5rem);
  }

  .performance-map {
    grid-template-columns: repeat(auto-fit, minmax(26px, 1fr));
    gap: 4px;
    max-height: 66px;
    border-radius: 12px;
    padding: 5px;
  }

  .performance-map .song-map-item,
  .performance-map .song-map-gap {
    min-height: 26px;
    border-radius: 8px;
    padding: 3px;
  }

  .performance-map .song-map-item span,
  .performance-map .song-map-gap {
    font-size: 0.55rem;
  }

  .performance-map .song-map-item strong {
    font-size: 0.62rem;
  }

  .performance-now {
    grid-template-columns: minmax(0, 1fr) minmax(76px, 22%);
    gap: 8px;
  }

  .performance-current {
    gap: 5px;
  }

  .performance-current strong {
    font-size: clamp(1.35rem, 5.8vw, 2.85rem);
    line-height: 1.02;
  }

  .metronome-lamp {
    gap: 3px;
    padding: 8px;
  }

  .metronome-lamp i {
    width: min(15vw, 60px);
  }

  .performance-beats {
    gap: 6px;
  }

  .performance-beats span {
    min-height: 36px;
    border-radius: 9px;
    font-size: 0.92rem;
  }

  .performance-progress {
    height: 9px;
  }

  .performance-role-focus {
    gap: 6px;
  }

  .performance-role-focus div,
  .performance-cues div {
    border-radius: 10px;
    padding: 8px;
  }

  .performance-role-focus strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: clip;
    white-space: normal;
  }

  .performance-cues {
    gap: 6px;
  }

  .performance-cues strong {
    font-size: clamp(0.86rem, 2.5vw, 1.1rem);
  }

  .performance-lyrics {
    overflow: auto;
    padding: 12px;
  }

  .performance-lyrics strong {
    font-size: clamp(1.35rem, 4.8vw, 2.6rem);
  }

  .performance-lyrics p {
    font-size: clamp(1.1rem, 4vw, 2.1rem);
  }

  .role-drummer .performance-now {
    grid-template-columns: minmax(0, 1fr) minmax(84px, 24%);
  }

  .role-drummer .performance-beats span {
    min-height: 40px;
    font-size: 1rem;
  }

  .role-drummer .metronome-lamp i {
    width: min(17vw, 68px);
  }
}

@media (max-width: 640px) {
  .performance-stage {
    gap: 6px;
    padding: 7px;
  }

  .performance-top {
    grid-template-columns: minmax(0, 1fr) minmax(86px, 30%);
    gap: 6px;
  }

  .performance-song,
  .performance-current {
    padding: 8px;
  }

  .performance-song h2 {
    font-size: clamp(1.15rem, 6.2vw, 2rem);
  }

  .performance-song p,
  .performance-current span:not(.now-badge) {
    -webkit-line-clamp: 1;
    font-size: 0.7rem;
  }

  .performance-session {
    margin-top: 4px;
  }

  .performance-session span {
    font-size: 0.57rem;
  }

  .emergency-stop {
    min-height: 56px;
    font-size: clamp(1.28rem, 7vw, 2rem);
  }

  .performance-map {
    grid-template-columns: repeat(auto-fit, minmax(22px, 1fr));
    max-height: 48px;
    padding: 4px;
  }

  .performance-map .song-map-item,
  .performance-map .song-map-gap {
    min-height: 22px;
    padding: 2px;
  }

  .performance-map .song-map-item span {
    display: none;
  }

  .performance-map .song-map-item strong,
  .performance-map .song-map-gap {
    font-size: 0.58rem;
  }

  .performance-now {
    grid-template-columns: minmax(0, 1fr) minmax(66px, 23%);
    gap: 6px;
  }

  .performance-current {
    gap: 4px;
  }

  .performance-current strong {
    font-size: clamp(1.22rem, 6.8vw, 2.2rem);
  }

  .performance-bars i {
    min-height: 6px;
  }

  .performance-bars i.current {
    min-height: 10px;
  }

  .performance-bars i.has-audio-cue::after {
    right: 2px;
    width: 5px;
    height: 5px;
  }

  .performance-bars i.audio-cue-now::after {
    width: 7px;
    height: 7px;
  }

  .metronome-lamp {
    padding: 6px;
  }

  .metronome-lamp i {
    width: min(14vw, 48px);
  }

  .metronome-lamp span {
    font-size: 1rem;
  }

  .performance-beats {
    gap: 4px;
  }

  .performance-beats span {
    min-height: 30px;
    border-radius: 8px;
    font-size: 0.82rem;
  }

  .performance-role-focus {
    grid-template-columns: 1fr;
  }

  .performance-role-focus div,
  .performance-cues div {
    padding: 7px;
  }

  .performance-cues {
    grid-template-columns: 1fr;
  }

  .performance-lyrics {
    padding: 10px;
  }

  .performance-lyrics strong {
    margin-bottom: 0.35em;
    font-size: clamp(1.2rem, 6vw, 2rem);
  }

  .performance-lyrics p {
    font-size: clamp(1rem, 5vw, 1.7rem);
  }
}

@media (max-width: 640px) and (max-height: 680px) {
  .performance-stage {
    gap: 5px;
    padding: 6px;
  }

  .performance-session {
    display: none;
  }

  .emergency-stop {
    min-height: 50px;
  }

  .performance-map {
    max-height: 38px;
  }

  .performance-map .song-map-item,
  .performance-map .song-map-gap {
    min-height: 18px;
  }

  .performance-current strong {
    font-size: clamp(1.12rem, 6.4vw, 1.85rem);
  }

  .metronome-lamp i {
    width: min(12vw, 40px);
  }

  .performance-beats span {
    min-height: 26px;
  }

  .performance-progress {
    height: 8px;
  }

  .performance-role-focus div,
  .performance-cues div {
    padding: 6px;
  }

  .performance-lyrics {
    padding: 8px;
  }
}

.arranger-panel {
  display: grid;
  gap: 10px;
  overflow: visible;
  padding-bottom: calc(92px + max(10px, env(safe-area-inset-bottom)));
}

.arranger-transport,
.arranger-library,
.arranger-lock-note,
.sync-panel,
.arranger-summary,
.arranger-now,
.arranger-orientation,
.song-map,
.arranger-section,
.arranger-editor,
.karaoke-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.arranger-transport {
  display: grid;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}

.arranger-library {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.project-program {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(216, 177, 106, 0.2);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(216, 177, 106, 0.09), rgba(255, 255, 255, 0.03)),
    rgba(8, 8, 9, 0.42);
  padding: 10px;
}

.project-program.locked {
  opacity: 0.72;
}

.schema-onboarding {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(216, 177, 106, 0.24);
  border-radius: 14px;
  background: rgba(216, 177, 106, 0.08);
  padding: 10px;
}

.schema-onboarding div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
}

.schema-onboarding span:not(.mini-label) {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 8, 9, 0.32);
  color: var(--muted);
  padding: 8px;
  font-size: 0.76rem;
  font-weight: 900;
}

.schema-onboarding .done {
  color: var(--green);
}

.compact-textarea {
  min-height: 52px;
  resize: vertical;
}

.program-toolbar,
.program-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.program-view-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.setlist-readonly-title {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.setlist-readonly-title .mini-label {
  margin: 0;
}

.setlist-readonly-title strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.program-title-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

.program-title-actions .btn {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.75rem;
}

.program-title-actions .quiet-setlist-action {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
}

.program-title-actions .setlist-action-icon {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
}

.program-title-actions .setlist-action-icon svg,
.program-title-actions .setlist-lock-toggle svg,
.project-song-actions .song-action-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.project-song-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
}

.project-song-actions .song-action-icon {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  padding: 0;
}

.project-song-actions .song-schema-action {
  border-color: rgba(216, 177, 106, 0.46);
  background: rgba(216, 177, 106, 0.12);
  color: var(--warm);
}

.program-title-actions .setlist-notes-title-action {
  display: none;
}

.setlist-notes-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: stretch;
}

.setlist-notes-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted);
  padding: 8px 10px;
  text-align: left;
}

.setlist-notes-preview .mini-label {
  margin: 0;
  white-space: nowrap;
}

.setlist-notes-preview strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setlist-notes-preview:disabled {
  cursor: default;
  opacity: 0.82;
}

.add-setlist-note {
  justify-self: start;
  width: max-content;
  min-height: 36px;
  padding: 7px 10px;
}

.setlist-duration-summary {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(216, 177, 106, 0.18);
  border-radius: 999px;
  background: rgba(216, 177, 106, 0.07);
  color: var(--muted);
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 900;
}

.setlist-duration-summary strong {
  color: var(--warm);
  font-size: 0.86rem;
}

.program-song-list {
  display: grid;
  gap: 7px;
  padding-bottom: calc(104px + max(12px, env(safe-area-inset-bottom)));
}

.program-song {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  padding: 6px;
}

.program-song.view-only {
  grid-template-columns: minmax(0, 1fr) auto;
}

.program-song.view-only .program-song-actions {
  max-width: none;
}

.program-song.active {
  border-color: var(--line);
  background: rgba(0, 0, 0, 0.24);
}

.program-song-main {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 5px;
  text-align: left;
}

.program-song-main.has-drag-grip {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.program-song-body {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.program-song-body.has-drag-grip .program-arrangement-field,
.program-song-body.has-drag-grip .program-arrangement-static,
.program-song-body.has-drag-grip .program-note-preview {
  padding-left: 77px;
}

.program-song-main .program-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--warm);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
}

.program-song-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.program-song-main em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.program-arrangement-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 0 5px 4px 41px;
}

.program-arrangement-field .mini-label {
  margin: 0;
  font-size: 0.62rem;
}

.program-arrangement-field select {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 0.78rem;
}

.program-arrangement-static {
  overflow: hidden;
  color: var(--muted);
  padding: 0 5px 4px 41px;
  font-size: 0.72rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.program-item-note {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.78rem;
  resize: vertical;
}

.program-item-note-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
  padding: 0 5px 4px 41px;
}

.program-item-note-editor .program-item-note {
  min-height: 34px;
  resize: none;
}

.compact-note-done {
  min-height: 34px;
  padding: 6px 10px;
}

.program-note-preview {
  overflow: hidden;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--warm);
  padding: 0 5px 4px 41px;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 900;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.program-note-preview:disabled {
  cursor: default;
  opacity: 0.86;
}

.program-song-actions {
  display: flex;
  max-width: none;
  flex-wrap: nowrap;
  gap: 5px;
  align-content: center;
  align-items: center;
  justify-content: flex-end;
}

.program-song-actions .note-action {
  width: auto;
  min-width: 64px;
  padding-inline: 8px;
  font-size: 0.68rem;
}

.setlist-lock-toggle {
  display: inline-flex;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  justify-self: end;
  border: 1px solid rgba(216, 177, 106, 0.28);
  border-radius: 10px;
  background: rgba(216, 177, 106, 0.08);
  color: var(--warm);
  padding: 0;
  font: inherit;
  font-weight: 950;
}

.setlist-lock-toggle span {
  display: inline-grid;
  place-items: center;
  width: 16px;
  line-height: 1;
}

.setlist-lock-toggle strong {
  font-size: 0.72rem;
  line-height: 1;
}

.setlist-lock-toggle.locked {
  border-color: rgba(216, 177, 106, 0.42);
  color: var(--warm);
}

.setlist-lock-toggle:disabled {
  cursor: default;
  opacity: 0.72;
}

.play-song-btn {
  border-color: rgba(216, 177, 106, 0.48);
  background: rgba(216, 177, 106, 0.12);
  color: var(--warm);
}

.program-song-actions .icon-btn:not(.play-song-btn):not(.note-action) {
  border-color: rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.program-drag-handle {
  display: grid;
  align-self: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--warm);
  cursor: grab;
  padding: 0;
  touch-action: none;
}

.program-drag-handle svg {
  width: 18px;
  height: 18px;
}

.program-drag-handle:disabled {
  cursor: default;
  opacity: 0.72;
}

.program-drag-handle:active {
  cursor: grabbing;
}

.program-song.dragging {
  opacity: 0.56;
}

.program-song.drop-before {
  box-shadow: inset 0 4px 0 rgba(255, 218, 128, 0.98), 0 0 0 2px rgba(216, 177, 106, 0.24);
}

.program-song.drop-after {
  box-shadow: inset 0 -4px 0 rgba(255, 218, 128, 0.98), 0 0 0 2px rgba(216, 177, 106, 0.24);
}

@media (max-width: 640px) {
  .program-edit-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .program-title-actions {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    justify-content: flex-end;
    align-items: center;
  }

  .program-title-actions .btn,
  .program-title-actions .setlist-lock-toggle {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    font-size: 0.68rem;
  }

  .program-title-actions .setlist-notes-title-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .add-setlist-note.setlist-notes-standalone {
    display: none;
  }

  .program-song:not(.view-only) .program-song-actions {
    display: flex;
    width: auto;
    max-width: none;
    justify-content: end;
  }

  .program-song:not(.view-only) .program-song-actions .note-action {
    min-width: 0;
  }

  .program-song-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .program-song-main.has-drag-grip {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .program-song-main em {
    grid-column: 2;
  }

  .program-song-main.has-drag-grip em {
    grid-column: 3;
  }
}

.concert-setlist {
  min-height: calc(100dvh - 96px);
  overflow: visible;
}

.concert-controls {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.concert-song-list {
  display: grid;
  gap: 10px;
}

.concert-progress {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  border: 1px solid rgba(216, 177, 106, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(216, 177, 106, 0.08), rgba(0, 0, 0, 0.12)),
    rgba(15, 15, 16, 0.94);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
  padding: 6px;
  backdrop-filter: blur(10px);
}

.concert-progress div {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(216, 177, 106, 0.18);
  border-radius: 12px;
  background: rgba(216, 177, 106, 0.07);
  padding: 9px 10px;
}

.concert-progress span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.concert-progress strong {
  color: var(--ink);
  font-size: clamp(1rem, 5vw, 1.35rem);
  font-weight: 950;
}

.concert-song {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(64px, 18%);
  gap: 10px;
  align-items: stretch;
  border: 1px solid rgba(242, 240, 232, 0.12);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.24);
  padding: 8px;
}

.concert-song.played {
  opacity: 0.48;
}

.concert-song.played .concert-play {
  border-color: rgba(242, 240, 232, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.concert-song-main {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 6px;
  text-align: left;
}

.concert-song-main span {
  display: grid;
  grid-row: span 2;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: rgba(216, 177, 106, 0.14);
  color: var(--warm);
  font-size: 0.82rem;
  font-weight: 950;
}

.concert-song-main strong {
  overflow: hidden;
  font-size: clamp(1rem, 4.8vw, 1.45rem);
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.concert-song-main em {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.concert-song-main small {
  grid-column: 2;
  overflow: hidden;
  color: var(--warm);
  font-size: 0.76rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.concert-song-main .concert-played-label {
  color: var(--green);
}

.concert-play {
  min-height: 58px;
  border: 1px solid rgba(216, 177, 106, 0.58);
  border-radius: 12px;
  background: rgba(216, 177, 106, 0.16);
  color: var(--warm);
  font-size: 1.3rem;
  font-weight: 950;
}

@media (max-width: 520px) {
  .concert-progress {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-bottom: 7px;
    border: 1px solid rgba(216, 177, 106, 0.18);
    border-radius: 12px;
    background:
      linear-gradient(90deg, rgba(216, 177, 106, 0.07), rgba(0, 0, 0, 0.08)),
      rgba(15, 15, 16, 0.95);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
    padding: 3px;
  }

  .concert-progress div {
    gap: 1px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    padding: 5px 6px;
  }

  .concert-progress div + div {
    border-left: 1px solid rgba(242, 240, 232, 0.08);
    border-radius: 0;
  }

  .concert-progress span {
    font-size: 0.56rem;
  }

  .concert-progress strong {
    font-size: 0.86rem;
  }

  .concert-song.played .concert-song-main em {
    display: none;
  }

  .concert-song.played .concert-song-main .concert-played-label {
    grid-column: 2;
  }
}

.empty.compact {
  margin: 0;
  font-size: 0.82rem;
}

.sync-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.sync-panel.active {
  border-color: rgba(216, 177, 106, 0.5);
  background:
    radial-gradient(circle at 100% 0, rgba(216, 177, 106, 0.14), transparent 32%),
    rgba(255, 255, 255, 0.04);
}

.sync-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.sync-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sync-sim-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 22px;
  border: 1px solid rgba(216, 177, 106, 0.44);
  border-radius: 999px;
  background: rgba(216, 177, 106, 0.12);
  color: var(--warm);
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.sync-head h3 {
  margin: 0;
  font-size: clamp(1.15rem, 5vw, 1.8rem);
}

.sync-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.sync-led {
  display: block;
  width: 20px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: #3a2a22;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
}

.sync-led.ready {
  background: var(--warm);
  box-shadow: 0 0 18px rgba(216, 177, 106, 0.45), inset 0 0 8px rgba(255, 255, 255, 0.22);
}

.sync-led.on {
  background: var(--red);
  box-shadow: 0 0 22px rgba(214, 66, 52, 0.6), inset 0 0 8px rgba(255, 255, 255, 0.22);
}

.sync-sim-notice {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(216, 177, 106, 0.24);
  border-radius: 14px;
  background: rgba(216, 177, 106, 0.075);
  padding: 10px 12px;
}

.sync-sim-notice strong {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 950;
}

.sync-sim-notice span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.sync-health {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(242, 240, 232, 0.1);
  border-radius: 14px;
  background: rgba(8, 8, 9, 0.36);
  padding: 10px 12px;
}

.sync-health.good {
  border-color: rgba(102, 209, 143, 0.36);
}

.sync-health.sim {
  border-color: rgba(216, 177, 106, 0.44);
  background: rgba(216, 177, 106, 0.06);
}

.sync-health.watch {
  border-color: rgba(216, 177, 106, 0.44);
}

.sync-health.bad {
  border-color: rgba(214, 66, 52, 0.52);
}

.sync-health strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.sync-health p {
  margin: 0;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 800;
  line-height: 1.35;
}

.sync-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 8px;
}

.sync-author-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

.role-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.role-preset {
  display: grid;
  gap: 4px;
  min-height: 72px;
  border: 1px solid rgba(242, 240, 232, 0.1);
  border-radius: 12px;
  background: rgba(8, 8, 9, 0.42);
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.role-preset.active {
  border-color: rgba(216, 177, 106, 0.54);
  background: rgba(216, 177, 106, 0.1);
}

.role-preset strong {
  font-size: 0.86rem;
}

.role-preset span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
}

.role-setup-body {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.role-setup-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.42;
}

.setup-presets {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.sync-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.library-sync-block .sync-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sync-transfer-block {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(242, 240, 232, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    rgba(0, 0, 0, 0.18);
  padding: 12px;
}

.sync-transfer-block p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.sync-transfer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sync-participants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.sync-participant {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 8, 9, 0.42);
  padding: 9px;
}

.sync-participant.ready {
  border-color: rgba(102, 209, 143, 0.36);
}

.sync-participant.simulated {
  border-color: rgba(216, 177, 106, 0.4);
}

.sync-participant span,
.sync-participant strong,
.sync-participant em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-participant span {
  color: var(--ink);
  font-weight: 950;
}

.sync-participant strong {
  color: var(--warm);
  font-size: 0.74rem;
}

.sync-participant em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

.sync-session-song {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(216, 177, 106, 0.22);
  border-radius: 12px;
  background: rgba(216, 177, 106, 0.07);
  padding: 10px;
}

.sync-session-song strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-session-song p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.sync-block {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 8, 9, 0.32);
  padding: 12px;
}

.sync-block-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.sync-block-head h3 {
  margin: 0;
  font-size: clamp(1.05rem, 4.8vw, 1.55rem);
}

.sync-block-head p,
.sync-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.35;
}

.provider-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 7px 9px;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.provider-pill.connected {
  border-color: rgba(102, 209, 143, 0.48);
  color: var(--green);
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.provider-card {
  display: grid;
  gap: 4px;
  min-height: 74px;
  border: 1px solid rgba(242, 240, 232, 0.1);
  border-radius: 12px;
  background: rgba(8, 8, 9, 0.42);
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.provider-card.active {
  border-color: rgba(216, 177, 106, 0.56);
  background: rgba(216, 177, 106, 0.1);
}

.provider-card.disabled {
  opacity: 0.58;
}

.provider-card strong {
  font-size: 0.88rem;
}

.provider-card span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.28;
}

.library-grid {
  grid-template-columns: 1fr 1fr 1.15fr;
}

.secret-field input {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0;
}

.sync-token-note,
.sync-backup-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.35;
}

.sync-backup-note {
  border-left: 3px solid var(--warm);
  background: rgba(216, 177, 106, 0.07);
  padding: 8px 10px;
}

.sync-automation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.34fr);
  gap: 8px;
  align-items: stretch;
  border: 1px solid rgba(242, 240, 232, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.toggle-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.toggle-row input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--warm);
}

.toggle-row strong,
.toggle-row em {
  display: block;
}

.toggle-row strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.toggle-row em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.32;
}

.compact-select {
  align-self: stretch;
}

.sync-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.sync-stats div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 10px 8px;
  text-align: center;
}

.sync-stats strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
}

.sync-stats span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 950;
  text-transform: uppercase;
}

.sync-operation-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.sync-operation-status i {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.2);
}

.sync-operation-status.busy i {
  background: var(--warm);
  box-shadow: 0 0 18px rgba(216, 177, 106, 0.55), inset 0 0 6px rgba(255, 255, 255, 0.28);
  animation: syncPulse 0.9s ease-in-out infinite;
}

.sync-operation-status.ok i {
  background: var(--green);
  box-shadow: 0 0 16px rgba(102, 209, 143, 0.45), inset 0 0 6px rgba(255, 255, 255, 0.22);
}

.sync-operation-status.warning i,
.sync-operation-status.error i {
  background: var(--red);
  box-shadow: 0 0 16px rgba(214, 66, 52, 0.42), inset 0 0 6px rgba(255, 255, 255, 0.22);
}

.sync-operation-status div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.sync-operation-status strong,
.sync-operation-status span,
.sync-operation-status em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sync-operation-status strong {
  color: var(--ink);
  font-weight: 950;
}

.sync-operation-status span {
  color: var(--warm);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.35;
}

.sync-operation-status em {
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 800;
}

.sync-result-banner {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(242, 240, 232, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
}

.sync-result-banner.ok {
  border-color: rgba(102, 209, 143, 0.46);
  background: rgba(102, 209, 143, 0.1);
}

.sync-result-banner.error,
.sync-result-banner.warning {
  border-color: rgba(214, 66, 52, 0.42);
  background: rgba(214, 66, 52, 0.1);
}

.sync-result-banner strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

.sync-result-banner span {
  color: var(--warm);
  font-size: 0.84rem;
  font-weight: 850;
  line-height: 1.35;
}

.sync-result-banner em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

@keyframes syncPulse {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.72;
  }

  50% {
    transform: scale(1.16);
    opacity: 1;
  }
}

.sync-note strong {
  color: var(--warm);
}

.sync-diagnostics {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.conflict-list {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(216, 177, 106, 0.34);
  border-radius: 14px;
  background: rgba(216, 177, 106, 0.08);
  padding: 10px;
}

.conflict-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 8, 9, 0.42);
  padding: 10px;
}

.conflict-card strong,
.conflict-card span {
  display: block;
}

.conflict-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.conflict-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.conflict-compare div {
  min-width: 0;
  border: 1px solid rgba(242, 240, 232, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  padding: 8px;
}

.conflict-compare strong,
.conflict-compare em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conflict-compare strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.conflict-compare em {
  margin-top: 3px;
  color: var(--warm);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

.conflict-diff {
  border: 1px solid rgba(216, 177, 106, 0.28);
  border-radius: 10px;
  background: rgba(216, 177, 106, 0.07);
  padding: 8px;
}

.conflict-diff strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.35;
}

.conflict-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.conflict-actions .btn {
  min-height: 38px;
  padding: 8px;
  font-size: 0.72rem;
}

.revision-history {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.revision-history summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.revision-history-body {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.revision-history-body p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.revision-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 8, 9, 0.36);
  padding: 8px;
}

.revision-row strong,
.revision-row span,
.revision-row em {
  display: block;
}

.revision-row span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.revision-row em {
  margin-top: 2px;
  color: var(--warm);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
}

.sync-log {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.sync-log-row,
.sync-log-empty {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 8, 9, 0.32);
  padding: 8px;
}

.sync-log-row span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.sync-log-row strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 0.76rem;
}

.sync-log-empty {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.sync-diagnostics summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

.diagnostic-grid strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-modal,
.settings-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

.sync-modal-backdrop,
.settings-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background: rgba(4, 4, 5, 0.62);
  backdrop-filter: blur(14px);
}

.sync-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(100%, 720px);
  max-height: min(86vh, 760px);
  overflow: auto;
  border: 1px solid rgba(242, 240, 232, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(216, 177, 106, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.028)),
    #111113;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.66);
  padding: 14px;
}

.lyrics-import-dialog {
  width: min(100%, 920px);
}

.lyrics-import-source {
  display: grid;
  gap: 12px;
  border: 1px dashed rgba(216, 177, 106, 0.34);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.lyrics-import-source.drag-over {
  border-color: rgba(255, 218, 128, 0.9);
  background: rgba(216, 177, 106, 0.12);
}

.lyrics-import-source > div:first-child {
  display: grid;
  gap: 4px;
}

.lyrics-import-source strong {
  color: var(--ink);
}

.lyrics-import-source span,
.lyrics-import-message,
.lyrics-import-route-note,
.lyrics-import-footer span,
.lyrics-import-preview-head span,
.lyrics-import-block-actions span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.lyrics-import-source textarea,
.lyrics-import-block-text {
  min-height: 150px;
  resize: vertical;
}

.lyrics-import-message {
  border: 1px solid rgba(216, 177, 106, 0.24);
  border-radius: 10px;
  background: rgba(216, 177, 106, 0.08);
  padding: 10px 12px;
}

.lyrics-import-preview {
  display: grid;
  gap: 10px;
}

.lyrics-import-song-title {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
}

.lyrics-import-preview-head,
.lyrics-import-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lyrics-import-preview-head strong {
  display: block;
  color: var(--ink);
}

.lyrics-import-block {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(10, 10, 11, 0.52);
  padding: 10px;
}

.lyrics-import-block.needs-action {
  border-color: rgba(214, 66, 52, 0.66);
  background: rgba(214, 66, 52, 0.1);
}

.lyrics-import-block-head,
.lyrics-import-block-route {
  display: grid;
  grid-template-columns: auto minmax(140px, 0.6fr) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.lyrics-import-block-route {
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.55fr);
}

.lyrics-import-block-number {
  display: grid;
  width: 36px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(216, 177, 106, 0.28);
  border-radius: 10px;
  background: rgba(216, 177, 106, 0.1);
  color: var(--warm);
  font-weight: 950;
}

.lyrics-import-block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lyrics-import-block-actions span {
  margin-right: auto;
}

.text-action {
  width: auto;
  min-width: 56px;
  padding-inline: 10px;
  font-size: 0.78rem;
}

@media (max-width: 680px) {
  .lyrics-import-preview-head,
  .lyrics-import-footer {
    display: grid;
  }

  .lyrics-import-block-head,
  .lyrics-import-block-route {
    grid-template-columns: 1fr;
  }

  .lyrics-import-block-number {
    width: 100%;
    height: 34px;
  }
}

.sync-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.sync-modal-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 6vw, 2.2rem);
}

.sync-modal-close {
  flex: 0 0 auto;
}

.sync-dialog .sync-panel {
  border-color: rgba(242, 240, 232, 0.12);
  background: rgba(255, 255, 255, 0.035);
}

.settings-dialog {
  width: min(100%, 560px);
}

.settings-panel {
  display: grid;
  gap: 12px;
}

.settings-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.account-settings-block {
  border-color: rgba(216, 177, 106, 0.24);
}

.account-settings-block.signed_in,
.account-settings-block.signed_in_offline {
  border-color: rgba(139, 211, 163, 0.24);
}

.account-settings-block.auth_error,
.account-settings-block.config_missing {
  border-color: rgba(255, 116, 102, 0.42);
}

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

.account-login-form input {
  width: 100%;
}

.account-status-panel {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(242, 240, 232, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.account-status-panel strong,
.account-status-panel span,
.account-safe-note,
.account-message,
.account-subblock p {
  overflow-wrap: anywhere;
}

.account-status-panel strong {
  color: var(--paper);
  font-size: 0.92rem;
}

.account-status-panel span,
.account-safe-note,
.account-message,
.account-subblock p {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.account-status-panel.ok {
  border-color: rgba(139, 211, 163, 0.24);
  background: rgba(139, 211, 163, 0.07);
}

.account-status-panel.busy {
  border-color: rgba(124, 179, 255, 0.26);
  background: rgba(124, 179, 255, 0.075);
}

.account-status-panel.muted {
  border-color: rgba(242, 240, 232, 0.1);
}

.account-message.error {
  color: #ffb0a7;
}

.account-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-subblock {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(242, 240, 232, 0.08);
  padding-top: 10px;
}

.account-storage-meter {
  position: relative;
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(242, 240, 232, 0.1);
}

.account-storage-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--warm);
}

.account-meta-list {
  margin-top: 0;
}

.account-sync-readiness {
  border-color: rgba(242, 240, 232, 0.1);
}

.account-sync-readiness.blocked {
  border-top-color: rgba(255, 197, 92, 0.18);
}

.account-sync-readiness-list dd {
  overflow-wrap: anywhere;
}

.account-sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-sync-actions .btn {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.78rem;
}

.first-sync-preview-launcher-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.first-sync-preview-qa-actions {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 8px;
}

.first-sync-preview-launcher-actions .btn,
.first-sync-preview-qa-actions .btn {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.78rem;
}

.first-sync-preview-modal {
  z-index: 132;
}

.first-sync-preview-dialog {
  width: min(100%, 760px);
  border-color: rgba(124, 179, 255, 0.24);
}

.first-sync-preview-dialog.warning {
  border-color: rgba(255, 197, 92, 0.34);
}

.first-sync-preview-dialog.muted {
  border-color: rgba(242, 240, 232, 0.14);
}

.first-sync-preview-body {
  display: grid;
  gap: 12px;
}

.first-sync-preview-message {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(124, 179, 255, 0.24);
  border-radius: 12px;
  background: rgba(124, 179, 255, 0.08);
  padding: 12px;
}

.first-sync-preview-message.warning {
  border-color: rgba(255, 197, 92, 0.32);
  background: rgba(255, 197, 92, 0.08);
}

.first-sync-preview-message.muted {
  border-color: rgba(242, 240, 232, 0.1);
  background: rgba(255, 255, 255, 0.035);
}

.first-sync-preview-message strong {
  color: var(--paper);
  line-height: 1.35;
}

.first-sync-preview-message span,
.first-sync-preview-card p,
.first-sync-preview-action span,
.first-sync-preview-fineprint {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.35;
}

.first-sync-preview-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.first-sync-preview-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  border: 1px solid rgba(242, 240, 232, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.first-sync-preview-card.present,
.first-sync-preview-card.real {
  border-color: rgba(139, 211, 163, 0.24);
}

.first-sync-preview-card.unknown {
  border-color: rgba(255, 197, 92, 0.3);
}

.first-sync-preview-card strong {
  overflow-wrap: anywhere;
  color: var(--paper);
  font-size: 1rem;
}

.first-sync-preview-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.first-sync-preview-card dl div {
  display: grid;
  gap: 2px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px;
}

.first-sync-preview-card dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.first-sync-preview-card dd {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 950;
}

.first-sync-preview-actions {
  display: grid;
  gap: 8px;
}

.first-sync-preview-action {
  display: grid;
  grid-template-columns: minmax(190px, 0.46fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(242, 240, 232, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.028);
  padding: 8px;
}

.first-sync-preview-action.safe {
  border-color: rgba(139, 211, 163, 0.22);
}

.first-sync-preview-action.caution {
  border-color: rgba(255, 197, 92, 0.22);
}

.first-sync-preview-action .btn:disabled {
  opacity: 0.62;
}

.first-sync-preview-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  position: sticky;
  bottom: -1px;
  z-index: 2;
  margin: 0 -2px -2px;
  border-top: 1px solid rgba(242, 240, 232, 0.1);
  background: linear-gradient(180deg, rgba(20, 20, 22, 0.84), rgba(20, 20, 22, 0.98));
  padding: 10px 0 2px;
  backdrop-filter: blur(14px);
}

.first-sync-preview-fineprint {
  margin: 0;
  border-top: 1px solid rgba(242, 240, 232, 0.08);
  padding-top: 10px;
}

@media (max-width: 680px) {
  .first-sync-preview-modal {
    align-items: end;
    padding: max(12px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .first-sync-preview-dialog {
    width: 100%;
    max-height: min(88vh, 760px);
    border-radius: 18px 18px 12px 12px;
  }

  .first-sync-preview-cards,
  .first-sync-preview-action {
    grid-template-columns: 1fr;
  }

  .first-sync-preview-card dl {
    grid-template-columns: repeat(3, minmax(58px, 1fr));
  }

  .first-sync-preview-footer {
    display: grid;
    margin-inline: -4px;
    padding: 10px 0 calc(6px + env(safe-area-inset-bottom));
  }

  .first-sync-preview-footer .btn {
    width: 100%;
  }
}

.storage-health-block.ok {
  border-color: rgba(139, 211, 163, 0.22);
}

.storage-health-block.error {
  border-color: rgba(255, 116, 102, 0.5);
  background: rgba(255, 116, 102, 0.08);
}

.storage-health-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
}

.storage-health-list div {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
  align-items: baseline;
  border-top: 1px solid rgba(242, 240, 232, 0.08);
  padding-top: 6px;
}

.storage-health-list dt,
.storage-health-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.storage-health-list dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.storage-health-list dd {
  color: var(--paper);
  font-size: 0.82rem;
  font-weight: 800;
}

.settings-footer {
  display: flex;
  justify-content: end;
}

.transport-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.arranger-transport.split {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.18fr);
}

.arranger-lock-note {
  display: none;
  border-color: rgba(216, 177, 106, 0.58);
  background: rgba(216, 177, 106, 0.11);
  color: var(--warm);
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 900;
}

.arranger-lock-note.show {
  display: block;
}

.arranger-song-title {
  min-width: 0;
}

.schema-template-tools {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  border: 1px solid rgba(216, 177, 106, 0.2);
  border-radius: 12px;
  background: rgba(216, 177, 106, 0.045);
  padding: 8px;
}

.schema-template-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
}

.schema-template-head span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schema-template-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, 36px);
  gap: 6px;
  align-items: center;
}

.schema-template-row select {
  min-width: 0;
}

.schema-template-action {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
}

.schema-template-action svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.schema-template-action.primary {
  border-color: rgba(216, 177, 106, 0.58);
  background: rgba(216, 177, 106, 0.12);
  color: var(--warm);
}

.schema-template-action.danger {
  color: #ffb0a8;
}

.schema-template-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
  line-height: 1.3;
}

.schema-template-confirm-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.arranger-notes-field {
  display: grid;
  gap: 4px;
}

.arranger-notes-field .compact-textarea {
  min-height: 46px;
}

.arranger-notes-preview {
  margin: 0;
  border: 1px solid rgba(242, 240, 232, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.13);
  color: var(--muted);
  padding: 7px 9px;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.25;
}

.arranger-metro {
  display: grid;
  gap: 8px;
}

.arranger-metro .btn {
  min-height: 34px;
  padding-inline: 9px;
}

.arranger-metro .metro-toggle {
  align-self: center;
  min-height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.05;
}

.arranger-metro .schema-toggle-icon {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
}

.arranger-metro .schema-toggle-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.arranger-metro .schema-x2-toggle {
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
}

.sound-toggle.active,
.section-cue-toggle.active,
.double-cue-toggle.active,
.audio-cue-toggle.active {
  border-color: rgba(216, 177, 106, 0.56);
  background: rgba(216, 177, 106, 0.08);
  color: var(--warm);
}

.mini-beats {
  display: grid;
  grid-template-columns: repeat(var(--beats, 4), 1fr);
  gap: 6px;
}

.mini-beat {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #101012;
  color: var(--muted);
  font-weight: 950;
}

.mini-beat.accent {
  border-color: rgba(216, 177, 106, 0.78);
  color: var(--warm);
}

.mini-beat.active {
  background: var(--red);
  color: white;
  transform: translateY(-2px);
}

.arranger-bpm {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.arranger-bpm span {
  color: var(--muted);
  font-weight: 950;
}

#arrangerBpm::-webkit-outer-spin-button,
#arrangerBpm::-webkit-inner-spin-button {
  margin-left: 6px;
  opacity: 1;
  cursor: pointer;
}

.arranger-tap {
  min-height: 44px;
  border: 1px solid rgba(214, 66, 52, 0.62);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.1), transparent 36%),
    linear-gradient(#2b2b2f, #121214);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.025);
}

.arranger-tap:active {
  transform: translateY(1px);
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.16), transparent 36%),
    linear-gradient(#d64234, #681c15);
}

.arranger-tap:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.arranger-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: -2px 0 2px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.arranger-summary strong {
  font-size: 0.94rem;
  line-height: 1;
}

.arranger-summary span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.arranger-summary div {
  display: grid;
  align-items: baseline;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(242, 240, 232, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  padding: 6px 8px;
}

.arranger-orientation {
  display: grid;
  gap: 8px;
  padding: 8px;
  background:
    radial-gradient(circle at 100% 0, rgba(214, 66, 52, 0.16), transparent 34%),
    rgba(15, 15, 17, 0.72);
}

.arranger-now {
  position: static;
  z-index: 8;
  display: grid;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 2px 2px 0;
  box-shadow: none;
  backdrop-filter: none;
}

.arranger-now.playing {
  border-color: rgba(214, 66, 52, 0.82);
}

.arranger-now strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(1.15rem, 4vw, 1.65rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arranger-now p,
.save-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.playhead-meter {
  overflow: hidden;
  height: 10px;
  border-radius: 99px;
  background: rgba(242, 240, 232, 0.14);
}

.playhead-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--warm));
  transition: width 120ms linear;
}

.song-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 0;
}

.song-map-item {
  display: grid;
  min-width: 0;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 8, 9, 0.58);
  color: var(--muted);
  padding: 4px;
}

.song-map-item.now {
  border-color: rgba(216, 177, 106, 0.9);
  background: rgba(216, 177, 106, 0.16);
  color: var(--ink);
}

.song-map-item span {
  font-size: 0.62rem;
  font-weight: 950;
}

.song-map-item strong {
  overflow: hidden;
  max-width: 100%;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arranger-layout {
  display: grid;
  gap: 14px;
}

.arranger-board {
  display: grid;
  gap: 10px;
}

.arranger-add-section {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border: 1px dashed rgba(216, 177, 106, 0.36);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(216, 177, 106, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(0, 0, 0, 0.12);
  color: var(--ink);
  padding: 11px 13px;
  text-align: left;
}

.arranger-add-section span {
  display: grid;
  width: 30px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 999px;
  background: rgba(216, 177, 106, 0.14);
  color: var(--warm);
  font-size: 1.05rem;
  font-weight: 950;
}

.arranger-add-section strong {
  color: var(--warm);
  font-size: 0.9rem;
  font-weight: 920;
}

.arranger-add-section:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.arranger-section {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
  padding: 8px;
}

.arranger-section.has-section-drag {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.section-drag-handle {
  position: relative;
  z-index: 2;
  display: grid;
  align-self: stretch;
  width: 34px;
  min-height: 100%;
  place-items: center;
  border: 1px solid rgba(216, 177, 106, 0.38);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(216, 177, 106, 0.22), rgba(216, 177, 106, 0.08)),
    rgba(0, 0, 0, 0.2);
  color: var(--warm);
  cursor: grab;
  padding: 0;
  touch-action: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.section-drag-handle svg {
  width: 19px;
  height: 19px;
  opacity: 0.95;
}

.section-drag-handle:active {
  cursor: grabbing;
}

.section-drag-handle.disabled,
.section-drag-handle:disabled {
  cursor: default;
  opacity: 0.58;
}

.arranger-section.active {
  border-color: rgba(214, 66, 52, 0.72);
  background: var(--red-soft);
}

.arranger-section.now {
  border-color: rgba(255, 218, 128, 0.98);
  background:
    linear-gradient(90deg, rgba(216, 177, 106, 0.24), rgba(214, 66, 52, 0.09) 38%, rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.035);
  box-shadow:
    0 0 0 2px rgba(216, 177, 106, 0.38),
    0 0 34px rgba(216, 177, 106, 0.22),
    0 16px 34px rgba(0, 0, 0, 0.32);
}

.arranger-section.now::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, var(--warm), var(--red));
  content: "";
}

.arranger-section.now::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(216, 177, 106, 0.18), transparent 42%);
  pointer-events: none;
  content: "";
}

.arranger-now.playing + .song-map + .arranger-layout .arranger-section.now {
  animation: current-section-pulse 1.05s ease-in-out infinite alternate;
}

.arranger-section.dragging {
  opacity: 0.55;
  transform: scale(0.992);
}

.arranger-section.locked {
  cursor: default;
}

.arranger-section.drop-before {
  box-shadow:
    inset 0 4px 0 rgba(255, 218, 128, 0.98),
    0 0 0 2px rgba(216, 177, 106, 0.28),
    0 16px 34px rgba(0, 0, 0, 0.32);
}

.arranger-section.drop-after {
  box-shadow:
    inset 0 -4px 0 rgba(255, 218, 128, 0.98),
    0 0 0 2px rgba(216, 177, 106, 0.28),
    0 16px 34px rgba(0, 0, 0, 0.32);
}

.section-dragging-active,
.section-dragging-active * {
  cursor: grabbing !important;
  user-select: none;
}

.section-main {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
}

.section-card {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 10px 92px 10px 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(10, 10, 11, 0.58);
  color: var(--ink);
  text-align: left;
}

.section-card:disabled,
.song-map-item:disabled {
  cursor: default;
}

.section-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
}

.section-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.section-card .section-type {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--warm);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.now-badge {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: linear-gradient(#d64234, #7a1f17);
  color: white;
  padding: 4px 7px;
  font-size: 0.62rem;
  letter-spacing: 0;
}

.section-start-button {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 74px;
  min-height: 28px;
  border: 1px solid rgba(255, 218, 128, 0.56);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(214, 66, 52, 0.92), rgba(122, 31, 23, 0.96));
  color: white;
  padding: 4px 8px;
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(214, 66, 52, 0.22);
}

.section-start-button span {
  color: inherit;
  font-size: 0.58rem;
  line-height: 1;
}

.section-start-button:disabled {
  cursor: default;
  opacity: 0.52;
  box-shadow: none;
}

.bar-strip {
  display: grid;
  grid-template-columns: repeat(var(--bars, 4), 1fr);
  gap: 3px;
  margin-top: 2px;
}

.bar-strip i {
  display: block;
  min-height: 8px;
  border-radius: 99px;
  background: rgba(242, 240, 232, 0.2);
}

.audio-cue-strip {
  gap: 4px;
}

.audio-cue-strip i {
  position: relative;
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.audio-cue-strip i:hover {
  background: rgba(242, 240, 232, 0.36);
  box-shadow: 0 0 0 2px rgba(216, 177, 106, 0.18);
}

.audio-cue-strip i.has-audio-cue {
  background: rgba(102, 209, 143, 0.75);
  box-shadow: 0 0 0 1px rgba(102, 209, 143, 0.35), 0 0 16px rgba(102, 209, 143, 0.18);
}

.audio-cue-strip i.has-audio-cue::after {
  content: "";
  position: absolute;
  inset: -4px 50% auto auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #fff1bd;
  box-shadow: 0 0 0 2px rgba(12, 12, 13, 0.92);
}

.arranger-section.active .bar-strip i {
  background: rgba(214, 66, 52, 0.9);
}

.arranger-section.active .bar-strip i.has-audio-cue {
  background: linear-gradient(90deg, rgba(214, 66, 52, 0.9), rgba(102, 209, 143, 0.82));
}

.bar-strip i.played {
  background: rgba(216, 177, 106, 0.55);
}

.bar-strip i.current {
  min-height: 14px;
  background: #fff1bd;
  box-shadow: 0 0 0 2px rgba(216, 177, 106, 0.3), 0 0 20px rgba(255, 241, 189, 0.72);
}

.arranger-section.now .bar-strip i.current {
  background: #fff1bd;
  box-shadow: 0 0 0 2px rgba(216, 177, 106, 0.34), 0 0 22px rgba(255, 241, 189, 0.82);
}

@keyframes current-section-pulse {
  from {
    box-shadow:
      0 0 0 2px rgba(216, 177, 106, 0.32),
      0 0 24px rgba(216, 177, 106, 0.18),
      0 16px 34px rgba(0, 0, 0, 0.32);
  }
  to {
    box-shadow:
      0 0 0 3px rgba(255, 218, 128, 0.62),
      0 0 42px rgba(216, 177, 106, 0.34),
      0 16px 34px rgba(0, 0, 0, 0.32);
  }
}

.section-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-content: center;
  align-items: center;
  justify-content: flex-end;
}

.section-configure {
  display: none;
}

.section-actions .icon-btn {
  align-self: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
}

.section-actions .icon-btn svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.drag-handle {
  touch-action: none;
  cursor: grab;
}

.drag-handle:not(:disabled) {
  border-color: rgba(216, 177, 106, 0.45);
  background: rgba(216, 177, 106, 0.12);
  color: var(--warm);
}

.arranger-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.arranger-editor-close,
.arranger-editor-backdrop {
  display: none;
}

@keyframes editor-attention-pulse {
  0% {
    border-color: rgba(216, 177, 106, 0.22);
    box-shadow: 0 0 0 rgba(216, 177, 106, 0);
  }
  38% {
    border-color: rgba(255, 218, 128, 0.72);
    box-shadow: 0 0 0 3px rgba(216, 177, 106, 0.14), 0 0 28px rgba(216, 177, 106, 0.18);
  }
  100% {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 rgba(216, 177, 106, 0);
  }
}

.arranger-editor.attention {
  animation: editor-attention-pulse 1.15s ease-out;
}

.section-title.compact {
  margin-bottom: 0;
}

.section-title.compact h3 {
  margin: 0;
  font-size: 1.1rem;
}

.arranger-editor-subhead {
  display: grid;
  gap: 3px;
}

.arranger-editor-subhead.current {
  padding-left: 2px;
}

.arranger-editor-subhead strong {
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.arranger-editor-subhead span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.arranger-editor-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.arranger-editor-group.current {
  position: relative;
  margin-top: 14px;
  padding-top: 14px;
  border-color: rgba(216, 177, 106, 0.22);
  border-left: 3px solid rgba(216, 177, 106, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.arranger-editor-group.current::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.audio-cue-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
}

.audio-cue-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(8px);
}

.audio-cue-sheet {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 430px);
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(21, 21, 23, 0.98);
  box-shadow: var(--shadow);
  padding: 16px;
}

.audio-cue-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.audio-cue-head h3 {
  margin: 2px 0 4px;
  font-size: 1.08rem;
}

.audio-cue-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.audio-cue-recorder {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.audio-cue-recorder strong {
  display: block;
  font-size: 1.24rem;
}

.audio-cue-recorder p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.audio-cue-waveform {
  display: grid;
  grid-template-columns: repeat(12, minmax(3px, 1fr));
  align-items: center;
  gap: 4px;
  width: 104px;
  height: 54px;
  padding: 8px;
  border: 1px solid rgba(242, 240, 232, 0.08);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    rgba(8, 8, 9, 0.42);
}

.audio-cue-waveform span {
  display: block;
  min-height: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(216, 177, 106, 0.74), rgba(118, 82, 42, 0.62));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  opacity: 0.56;
  transform-origin: center;
}

.audio-cue-recorder.recording .audio-cue-waveform {
  border-color: rgba(214, 66, 52, 0.34);
  background:
    linear-gradient(180deg, rgba(214, 66, 52, 0.12), rgba(255, 255, 255, 0.016)),
    rgba(8, 8, 9, 0.52);
}

.audio-cue-recorder.recording .audio-cue-waveform span {
  background: linear-gradient(180deg, #f06a5b, #7f2a23);
  opacity: 0.88;
  animation: audioCueWave 820ms ease-in-out infinite alternate;
  animation-delay: var(--wave-delay, 0ms);
}

.demo-audio-cue-sheet {
  border-color: rgba(124, 179, 255, 0.24);
}

.audio-cue-recorder.demo {
  border-color: rgba(124, 179, 255, 0.18);
  background: rgba(124, 179, 255, 0.055);
}

.audio-cue-recorder.demo .audio-cue-waveform span {
  background: linear-gradient(180deg, rgba(124, 179, 255, 0.72), rgba(216, 177, 106, 0.52));
  opacity: 0.78;
}

@keyframes audioCueWave {
  from {
    opacity: 0.62;
    transform: scaleY(0.68);
  }

  to {
    opacity: 1;
    transform: scaleY(1.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .audio-cue-recorder.recording .audio-cue-waveform span,
  .performance-bars i.audio-cue-now::after {
    animation: none;
  }
}

.audio-cue-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.audio-cue-actions .danger {
  border-color: rgba(214, 66, 52, 0.42);
}

.audio-cue-message {
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(216, 177, 106, 0.11);
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.35;
}

.audio-cue-message.error {
  background: rgba(214, 66, 52, 0.14);
  color: #ffd8d2;
}

#audioCuePlayer {
  width: 100%;
}

@media (max-width: 720px) {
  .audio-cue-modal {
    align-items: end;
    place-items: end stretch;
    padding: 0;
  }

  .audio-cue-backdrop {
    background: rgba(0, 0, 0, 0.66);
  }

  .audio-cue-sheet {
    width: 100%;
    max-height: calc(100dvh - max(20px, env(safe-area-inset-top)));
    overflow: auto;
    border-radius: 18px 18px 0 0;
    padding: 16px 16px calc(22px + max(12px, env(safe-area-inset-bottom)));
  }

  .audio-cue-recorder {
    gap: 10px;
  }

  .audio-cue-waveform {
    width: 88px;
    gap: 3px;
    padding: 7px;
  }

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

.section-title.compact + .arranger-editor-group.current {
  margin-top: 0;
}

.section-title.compact + .arranger-editor-group.current::before {
  display: none;
}

.karaoke-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  line-height: 1.45;
}

.karaoke-card strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.karaoke-card span:not(.mini-label) {
  color: var(--muted);
}

.program-row,
.song-row,
.lyrics-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.program-row.active,
.song-row.active,
.lyrics-row.active {
  border-color: rgba(214, 66, 52, 0.68);
  background: var(--red-soft);
}

.row-title {
  min-width: 0;
}

.row-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-title span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.inline-actions {
  display: flex;
  gap: 6px;
}

.sync-open-btn {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 7px;
}

.topbar-sync-btn {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.74rem;
}

.sync-open-btn.active {
  border-color: rgba(216, 177, 106, 0.58);
  color: var(--warm);
}

.sync-dot {
  display: block;
  width: 9px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--dim);
}

.sync-open-btn.active .sync-dot {
  background: var(--warm);
  box-shadow: 0 0 12px rgba(216, 177, 106, 0.52);
}

.icon-btn {
  display: grid;
  width: 40px;
  min-height: 40px;
  place-items: center;
  padding: 0;
}

.icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 8px;
}

.markdown-preview {
  overflow: auto;
  max-height: 42vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 14px;
  line-height: 1.55;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
  margin: 0.7em 0 0.35em;
}

.markdown-preview p,
.markdown-preview ul,
.markdown-preview ol {
  margin: 0.5em 0;
}

.empty {
  border: 1px dashed rgba(242, 240, 232, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  padding: 16px 18px;
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.empty-action {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.empty-action p {
  margin: 0;
}

.schema-empty-state {
  margin-top: 18px;
  min-height: 220px;
  align-content: center;
}

.schema-empty-state h3 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.25rem, 3.2vw, 1.7rem);
}

.schema-empty-state p {
  max-width: 560px;
}

.recorder-layout {
  display: grid;
  gap: 14px;
}

.recorder-display {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 38%, rgba(214, 66, 52, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.02)),
    #101012;
  text-align: center;
}

.record-ring {
  display: grid;
  width: min(54vw, 180px);
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid rgba(242, 240, 232, 0.16);
  border-radius: 999px;
  background: linear-gradient(#202024, #0c0c0d);
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.03), 0 18px 42px rgba(0, 0, 0, 0.36);
}

.record-ring span {
  display: block;
  width: 42%;
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--dim);
}

.record-ring.recording {
  border-color: rgba(214, 66, 52, 0.86);
  box-shadow: 0 0 42px rgba(214, 66, 52, 0.24), inset 0 0 0 10px rgba(255, 255, 255, 0.03);
}

.record-ring.recording span {
  background: var(--red);
}

.recorder-display strong {
  font-size: clamp(3rem, 16vw, 5rem);
  line-height: 0.9;
}

.recorder-display p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.recording-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

#recordingPlayer {
  width: 100%;
}

@media (min-width: 760px) {
  .module-panel {
    padding: 22px;
  }

  .arranger-transport {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .arranger-library {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .arranger-metro {
    grid-template-columns: minmax(0, 1fr) 92px 82px auto auto auto auto;
    align-items: center;
  }

  .arranger-metro .metro-toggle {
    min-width: 38px;
  }

  .schema-floating-actions {
    width: fit-content;
    max-width: min(100%, 220px);
    margin-left: auto;
    padding-right: 0;
  }

  .arranger-orientation {
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr);
    align-items: center;
  }

  .setlist-layout,
  .lyrics-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 14px;
    align-items: start;
  }

  .recorder-layout {
    grid-template-columns: 300px 1fr;
    align-items: start;
  }
}

@media (min-width: 760px) and (max-width: 1023px) {
  .arranger-transport.split {
    grid-template-columns: 1fr;
  }

  .arranger-metro.transport-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: fit-content;
    max-width: 100%;
  }

  .arranger-metro .mini-beats {
    width: 220px;
    max-width: 100%;
  }

  .arranger-metro .arranger-bpm {
    width: 110px;
  }

  .arranger-metro .arranger-tap {
    min-width: 126px;
  }

  .arranger-metro .metro-toggle {
    flex: 0 0 auto;
  }

  .schema-floating-actions {
    justify-self: end;
  }
}

@media (min-width: 1024px) {
  .arranger-layout {
    grid-template-columns: 1.08fr 0.92fr;
    align-items: start;
  }

  .arranger-editor {
    position: sticky;
    top: max(14px, env(safe-area-inset-top));
    align-self: start;
    overflow: visible;
  }
}

@media (min-width: 1100px) {
  .arranger-transport.split {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(260px, 300px);
    align-items: start;
    gap: 16px;
  }

  .arranger-song-title.transport-card,
  .arranger-metro.transport-card {
    align-self: start;
  }

  .arranger-song-title.transport-card {
    padding: 10px 12px;
  }

  .arranger-metro.transport-card {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    justify-self: start;
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
  }

  .arranger-metro .mini-beats {
    width: 100%;
    max-width: 100%;
  }

  .arranger-metro .arranger-bpm {
    flex: 1 1 108px;
    min-width: 98px;
  }

  .arranger-metro .arranger-tap {
    flex: 1 1 122px;
    min-width: 118px;
  }

  .arranger-metro .metro-toggle {
    flex: 0 0 38px;
    min-width: 38px;
  }

  .arranger-orientation {
    grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1fr) auto;
    gap: 10px;
  }

  .schema-floating-actions {
    position: sticky;
    bottom: calc(82px + max(12px, env(safe-area-inset-bottom)));
    justify-self: end;
    margin-left: auto;
    border: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .schema-floating-actions #arrangerPlay {
    min-width: 150px;
  }
}

@media (any-hover: hover) {
  .arranger-section .section-configure {
    display: none !important;
  }
}

@media (max-width: 759px) {
  .arranger-transport.split {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .arrangement-row {
    grid-template-columns: 1fr;
  }

  .arrangement-row .btn {
    width: 100%;
  }

  .arranger-metro {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
  }

  .arranger-metro .mini-beats {
    grid-column: 1 / -1;
  }

  .arranger-bpm {
    grid-column: 1 / 3;
  }

  .arranger-tap {
    grid-column: 3 / -1;
  }

  #arrangerSound {
    grid-column: auto;
  }

  #arrangerSectionCue {
    grid-column: auto;
  }

  #arrangerDoubleCue {
    grid-column: auto;
  }

  #arrangerAudioCues {
    grid-column: auto;
  }
}

@media (max-width: 1023px) {
  .arranger-layout {
    grid-template-columns: 1fr;
  }

  .section-actions {
    align-content: start;
    gap: 5px;
  }

  .section-configure {
    display: grid;
    place-items: center;
    width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .section-configure svg {
    width: 18px;
    height: 18px;
  }

  .arranger-editor-backdrop.show {
    position: fixed;
    z-index: 78;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(3px);
    padding: 0;
  }

  .arranger-editor {
    position: fixed;
    z-index: 79;
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(76px + max(8px, env(safe-area-inset-bottom)));
    left: max(10px, env(safe-area-inset-left));
    max-height: min(76vh, 680px);
    overflow: auto;
    padding-bottom: calc(24px + max(10px, env(safe-area-inset-bottom)));
    transform: translateY(calc(100% + 110px));
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    border-color: rgba(255, 255, 255, 0.18);
    background:
      linear-gradient(180deg, rgba(33, 33, 35, 0.98), rgba(15, 15, 16, 0.99)),
      #101012;
    box-shadow: 0 -22px 54px rgba(0, 0, 0, 0.66);
  }

  .arranger-editor.sheet-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    border-color: rgba(216, 177, 106, 0.34);
  }

  .arranger-editor-close {
    display: grid;
  }

  @media (hover: hover) and (pointer: fine) {
    .section-actions {
      gap: 6px;
    }

    .section-configure {
      display: none;
    }
  }

  .schema-floating-actions {
    justify-self: end;
    margin-left: auto;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  .module-panel {
    border-radius: 16px;
    padding: 13px;
  }

  .brand h1 {
    font-size: 1.8rem;
  }

  .bottom-nav {
    gap: 5px;
    width: calc(100% - 20px);
    padding: 6px;
  }

  .nav-btn {
    min-height: 54px;
    font-size: 0.58rem;
  }

  .nav-btn svg {
    width: 18px;
    height: 18px;
  }

  .string-bank {
    grid-template-columns: repeat(3, 1fr);
  }

  .duration-bank,
  .mode-bank {
    grid-template-columns: 1fr;
  }

  .metro-controls,
  .readouts,
  .form-grid,
  .sync-grid {
    grid-template-columns: 1fr;
  }

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

  .library-sync-block .sync-actions,
  .sync-transfer-actions,
  .settings-actions,
  .account-login-form,
  .conflict-compare,
  .conflict-actions {
    grid-template-columns: 1fr;
  }

  .revision-row {
    grid-template-columns: 1fr;
  }

  .sync-block-head,
  .library-grid,
  .provider-grid,
  .sync-automation {
    grid-template-columns: 1fr;
  }

  .provider-pill {
    justify-self: start;
  }

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

  .arranger-summary {
    padding: 10px 8px;
  }

  .arranger-panel > .section-title {
    display: grid;
    gap: 10px;
  }

  .arranger-panel > .section-title .inline-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .program-toolbar,
  .program-edit-row,
  .program-view-row,
  .add-program-song,
  .template-grid,
  .create-song-footer {
    grid-template-columns: 1fr;
  }

  .create-song-footer .btn {
    width: 100%;
  }

  .program-toolbar .inline-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .program-song-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .program-song-main.has-drag-grip {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .program-song-main em {
    grid-column: 2;
  }

  .program-song-main.has-drag-grip em {
    grid-column: 3;
  }

  .program-item-note-editor {
    grid-template-columns: 1fr;
  }

  .program-repeat-confirm {
    grid-template-columns: 1fr;
  }

  .program-repeat-confirm .inline-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .setlist-notes-editor,
  .setlist-notes-preview {
    grid-template-columns: 1fr;
  }

  .program-song-actions {
    max-width: 116px;
  }

  .program-song-actions .note-action {
    min-width: 100%;
  }

  .program-song:not(.view-only) .program-song-actions {
    max-width: none;
  }

  .program-song:not(.view-only) .program-song-actions .note-action {
    min-width: 0;
  }

  .arranger-panel {
    padding-bottom: calc(92px + max(10px, env(safe-area-inset-bottom)));
  }

  .schema-floating-actions {
    bottom: calc(84px + max(8px, env(safe-area-inset-bottom)));
    justify-self: center;
    margin-right: auto;
    margin-left: auto;
    max-width: min(100%, 188px);
    padding: 0;
  }

  .schema-floating-actions #arrangerPlay {
    min-width: 148px;
  }

  .transport-card {
    padding: 9px;
  }

  .arranger-summary {
    gap: 5px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .arranger-summary div {
    padding: 5px 7px;
  }

  .arranger-orientation {
    padding: 7px;
  }

  .arranger-metro {
    gap: 7px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
  }

  .arranger-metro .mini-beats {
    grid-column: 1 / -1;
  }

  .arranger-bpm {
    grid-column: 1 / 3;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .arranger-tap {
    grid-column: 3 / -1;
    min-height: 48px;
  }

  #arrangerSound {
    grid-column: auto;
    min-height: 34px;
  }

  #arrangerSectionCue {
    grid-column: auto;
    min-height: 34px;
  }

  #arrangerDoubleCue {
    grid-column: auto;
    min-height: 34px;
  }

  #arrangerAudioCues {
    grid-column: auto;
    min-height: 34px;
  }

  .section-actions {
    gap: 4px;
  }

  .section-actions .icon-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }
}
