@font-face {
  font-family: "Bravura";
  src: url("./assets/fonts/Bravura.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

/* v194: bounded Stage lists, touch ordering and scroll-stable controls. */
.stage-song-browser-list {
  display: flex;
  flex-direction: column;
}

.stage-song-browser-list-head,
.stage-song-bulk-toolbar,
.stage-list-pagination {
  flex: 0 0 auto;
}

.stage-song-browser-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.stage-list-pagination {
  min-width: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px auto;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-top: 1px solid rgba(0, 229, 255, 0.17);
  background:
    linear-gradient(90deg, rgba(0, 229, 255, 0.07), transparent 58%),
    rgba(0, 0, 0, 0.28);
}

.stage-list-pagination button {
  min-width: 32px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #dce8ec;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 900;
  cursor: pointer;
}

.stage-list-pagination button:hover,
.stage-list-pagination button.active {
  border-color: rgba(0, 229, 255, 0.72);
  background: rgba(0, 229, 255, 0.14);
  color: #d9fbff;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.14);
}

.stage-list-pagination button:disabled {
  opacity: 0.3;
  cursor: default;
  box-shadow: none;
}

.stage-list-pagination button svg {
  width: 17px;
  height: 17px;
}

.stage-list-page-numbers {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.stage-list-page-numbers span {
  color: #75838a;
  font-size: 0.8rem;
  font-weight: 900;
}

.stage-list-pagination small {
  display: grid;
  justify-items: end;
  gap: 1px;
  color: #819198;
  font-size: 0.6rem;
  font-weight: 760;
  white-space: nowrap;
}

.stage-list-pagination small b {
  color: #bfeff5;
  font-size: 0.7rem;
}

.stage-song-drag-grip,
.stage-click-set-drag-grip {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 7px;
  background: rgba(0, 229, 255, 0.045);
  color: #00d9ed;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.stage-song-drag-grip {
  width: 26px;
  height: 32px;
}

.stage-song-drag-grip svg,
.stage-click-set-drag-grip svg {
  width: 16px;
  height: 16px;
}

.stage-song-row.touch-drag-origin,
.stage-click-set-target.touch-drag-origin,
.click-set-row-shell.touch-drag-origin {
  opacity: 0.58;
  transform: scale(0.992);
}

.stage-click-set-target.touch-drop-target {
  border-color: #00e5ff;
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.23), rgba(0, 229, 255, 0.08)),
    rgba(0, 0, 0, 0.34);
  box-shadow: inset 0 0 0 2px rgba(0, 229, 255, 0.38), 0 0 26px rgba(0, 229, 255, 0.22);
}

[data-click-set-drag-id].touch-drop-before {
  box-shadow: inset 0 3px 0 #00e5ff, 0 -7px 18px rgba(0, 229, 255, 0.18);
}

[data-click-set-drag-id].touch-drop-after {
  box-shadow: inset 0 -3px 0 #00e5ff, 0 7px 18px rgba(0, 229, 255, 0.18);
}

.stage-click-drop-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.stage-click-set-heading {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.stage-click-set-heading > span {
  width: 42px;
  height: 42px;
  display: grid !important;
  place-items: center;
  border: 1px solid rgba(0, 229, 255, 0.42);
  border-radius: 11px;
  background: rgba(0, 229, 255, 0.1);
  color: #00e5ff !important;
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.13);
}

.stage-click-set-heading > span svg {
  width: 21px;
  height: 21px;
}

.stage-click-set-heading > div {
  min-width: 0;
}

.stage-click-drop-panel > header .stage-click-set-heading strong {
  margin: 0;
  color: #f6fdff;
  font-size: clamp(1.22rem, 1.8vw, 1.55rem);
  font-weight: 950;
  letter-spacing: -0.025em;
}

.stage-click-drop-panel > header .stage-click-set-heading small {
  margin-top: 3px;
  color: #92a7ae;
  font-size: 0.68rem;
  font-weight: 720;
}

.stage-click-set-target {
  grid-template-columns: 28px minmax(0, 1fr) 34px;
}

.stage-click-set-drag-grip {
  width: 28px;
  height: 38px;
}

.stage-click-set-target[draggable="true"] {
  cursor: default;
}

.stage-click-set-target[draggable="true"] .stage-click-set-drag-grip:active,
.stage-song-drag-grip:active,
.click-set-drag-grip:active {
  cursor: grabbing;
}

.click-set-list {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

/* v194 piano: one continuous 88-key A0-C8 keyboard with a full-screen iPad landscape mode. */
.piano-range-card strong {
  color: #dffbff;
  font-size: 1rem;
  font-weight: 950;
  letter-spacing: 0.02em;
}

.piano-stage-keyboard {
  --piano-white-width: clamp(44px, 4.7vw, 68px);
  position: relative;
  min-height: 292px;
  padding: 7px 0;
}

.piano-keyboard-viewport {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: rgba(0, 229, 255, 0.66) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.piano-keyboard-viewport::-webkit-scrollbar {
  height: 7px;
}

.piano-keyboard-viewport::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.piano-keyboard-viewport::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(90deg, #00d8ff, #7768ff);
}

.piano-stage-keyboard .piano-keyboard-panel.piano-global-keyboard {
  width: max-content;
  height: 100%;
  min-height: 0;
  display: block;
}

.piano-stage-keyboard .piano-keyboard-row.piano-global-row {
  width: max-content;
  height: 100%;
  min-height: 0;
  display: flex;
  grid-template-columns: none;
  gap: 0;
  overflow: visible;
  border-radius: 0;
}

.piano-stage-keyboard .piano-global-row .piano-octave {
  flex: 0 0 calc(var(--piano-white-width) * var(--piano-white-count, 7));
  width: calc(var(--piano-white-width) * var(--piano-white-count, 7));
  height: 100%;
  min-height: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.72);
}

.piano-stage-keyboard .piano-global-row .piano-key.white {
  min-width: var(--piano-white-width);
}

.piano-stage-keyboard .piano-global-row .piano-edge-group .piano-key.black {
  width: calc(var(--piano-white-width) * 0.62);
}

.piano-keyboard-pan {
  position: absolute;
  top: 50%;
  z-index: 12;
  width: 42px;
  height: 72px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(0, 229, 255, 0.48);
  background: rgba(3, 12, 15, 0.78);
  color: #dffcff;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.piano-keyboard-pan.previous {
  left: 7px;
  border-radius: 0 13px 13px 0;
}

.piano-keyboard-pan.next {
  right: 7px;
  border-radius: 13px 0 0 13px;
}

.piano-keyboard-pan svg {
  width: 26px;
  height: 26px;
}

.piano-keyboard-pan:active {
  color: #fff;
  background: rgba(0, 229, 255, 0.22);
  transform: translateY(-50%) scale(0.96);
}

@media (orientation: landscape) and (max-width: 1366px) {
  html,
  body,
  #app,
  .app-frame.view-piano {
    width: 100vw !important;
    height: var(--app-height) !important;
    min-height: var(--app-height) !important;
    overflow: hidden !important;
    background: #020304;
  }

  .app-frame.view-piano {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }

  .app-frame.view-piano > .library-panel,
  .app-frame.view-piano .topbar,
  .app-frame.view-piano .piano-stage-hero,
  .app-frame.view-piano .piano-stage-controls,
  .app-frame.view-piano .piano-stage-bottom {
    display: none !important;
  }

  .app-frame.view-piano > .workspace {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: 100vw !important;
    height: var(--app-height) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-rows: minmax(0, 1fr) !important;
    overflow: hidden !important;
  }

  .app-frame.view-piano .workspace-main,
  .app-frame.view-piano .metronome-standalone-main,
  .app-frame.view-piano .piano-stage-shell,
  .app-frame.view-piano .piano-stage-main {
    width: 100vw !important;
    height: var(--app-height) !important;
    min-height: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  .app-frame.view-piano .piano-stage-main {
    display: block !important;
  }

  .app-frame.view-piano .piano-stage-keyboard {
    --piano-white-width: clamp(50px, 5.6vw, 74px);
    width: 100vw !important;
    height: var(--app-height) !important;
    min-height: var(--app-height) !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #020304;
    box-shadow: none;
  }

  .app-frame.view-piano .piano-keyboard-viewport,
  .app-frame.view-piano .piano-keyboard-panel,
  .app-frame.view-piano .piano-keyboard-row,
  .app-frame.view-piano .piano-octave {
    height: 100% !important;
    min-height: 100% !important;
  }

  .app-frame.view-piano .piano-stage-keyboard .piano-key.black {
    height: 61%;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 13px 18px rgba(0, 0, 0, 0.62), inset 0 0 13px rgba(255, 255, 255, 0.1);
  }

  .app-frame.view-piano .piano-stage-keyboard .piano-key.white {
    border-right-color: rgba(31, 39, 42, 0.72);
  }

  .app-frame.view-piano .piano-stage-keyboard .octave-label {
    bottom: max(12px, env(safe-area-inset-bottom));
    font-size: 0.92rem;
  }

  .app-frame.view-piano .piano-keyboard-pan {
    width: 48px;
    height: 92px;
  }

  .app-frame.view-piano .piano-keyboard-pan.previous {
    left: max(0px, env(safe-area-inset-left));
  }

  .app-frame.view-piano .piano-keyboard-pan.next {
    right: max(0px, env(safe-area-inset-right));
  }

  html body #app.app-frame.view-piano.tool-page-shell > main.workspace.metronome-workspace > section.workspace-main.metronome-standalone-main,
  html body #app.app-frame.view-piano.tool-page-shell .piano-stage-shell > .piano-stage-main {
    padding: 0 !important;
  }

  html body #app.app-frame.view-piano.tool-page-shell .piano-stage-shell,
  html body #app.app-frame.view-piano.tool-page-shell .piano-stage-keyboard {
    inset: auto !important;
    transform: none !important;
  }
}

@media (orientation: portrait) and (max-width: 999px) {
  .app-frame.view-piano .piano-stage-keyboard {
    --piano-white-width: clamp(46px, 7vw, 58px);
    min-height: 330px;
  }

  .app-frame.view-piano .piano-keyboard-pan {
    width: 38px;
    height: 64px;
  }
}

.click-set-list > .stage-list-pagination {
  border-top-color: rgba(0, 229, 255, 0.2);
}

.click-song-image-card.empty-image-card {
  min-height: 116px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border-style: dashed;
  background:
    radial-gradient(circle at 8% 20%, rgba(0, 229, 255, 0.12), transparent 38%),
    rgba(0, 0, 0, 0.22);
}

.click-song-empty-image-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 13px;
  background: rgba(0, 229, 255, 0.08);
  color: #00e5ff;
}

.click-song-empty-image-icon svg {
  width: 25px;
  height: 25px;
}

.click-song-image-card.empty-image-card > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.click-song-image-card.empty-image-card span {
  color: #00e5ff;
  font-size: 0.65rem;
  font-weight: 950;
  letter-spacing: 0.1em;
}

.click-song-image-card.empty-image-card strong {
  color: #f4fbfd;
  font-size: 0.95rem;
}

.click-song-image-card.empty-image-card p {
  margin: 0;
  color: #94a4aa;
  font-size: 0.74rem;
}

.click-song-image-card.empty-image-card > button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid rgba(0, 229, 255, 0.48);
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.11);
  color: #d7fbff;
  font: inherit;
  font-size: 0.77rem;
  font-weight: 900;
  cursor: pointer;
}

.click-song-image-card.empty-image-card > button:hover {
  border-color: #00e5ff;
  background: rgba(0, 229, 255, 0.2);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.18);
}

.click-song-image-card.empty-image-card > button svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 920px) {
  .app-frame.view-metronome .stage-song-browser-list {
    min-height: 680px;
  }

  .app-frame.view-metronome .stage-click-drop-panel {
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  .stage-list-pagination {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
  }

  .stage-list-pagination > small {
    grid-column: 1 / -1;
    grid-template-columns: auto auto;
    justify-content: center;
    justify-items: center;
    gap: 8px;
  }

  .stage-click-set-heading {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .stage-click-set-heading > span {
    width: 38px;
    height: 38px;
  }

  .click-song-image-card.empty-image-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .click-song-empty-image-icon {
    width: 46px;
    height: 46px;
  }

  .click-song-image-card.empty-image-card > button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

:root {
  color-scheme: dark;
  --bg: #111313;
  --panel: #171a1a;
  --panel-2: #202424;
  --panel-3: #272c2c;
  --paper: #f4f0e4;
  --paper-line: #d7cfbd;
  --ink: #202321;
  --text: #f2f1ed;
  --muted: #a7aaa4;
  --line: #333939;
  --line-soft: #252a2a;
  --accent: #1fb6a6;
  --accent-strong: #15d1bd;
  --amber: #d89e32;
  --red: #dc625b;
  --green: #80b35a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, ui-sans-serif, system-ui, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

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

button {
  color: inherit;
}

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.boot-panel {
  display: grid;
  gap: 14px;
  justify-items: center;
  color: var(--muted);
}

.boot-mark,
.brand-mark {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(31, 182, 166, 0.42);
  border-radius: 8px;
  color: var(--accent-strong);
  background: #101616;
  font-weight: 800;
}

.app-frame {
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(268px, 23vw, 300px) minmax(0, 1fr);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 38px 38px;
}

.app-frame.library-mode-songs,
.app-frame.library-mode-playlists,
.app-frame.library-mode-playlist {
  grid-template-columns: clamp(320px, 36vw, 420px) minmax(0, 1fr);
}

.app-frame.view-setlists {
  grid-template-columns: minmax(280px, 34vw) minmax(0, 1fr);
}

.app-frame.metronome-standalone {
  grid-template-columns: minmax(0, 1fr);
}

.app-frame.tool-page-shell {
  grid-template-columns: clamp(150px, 18vw, 250px) minmax(0, 1fr);
}

.app-frame.view-setlists .context-panel,
.app-frame.library-mode-songs .context-panel,
.app-frame.library-mode-playlists .context-panel,
.app-frame.library-mode-playlist .context-panel {
  display: none;
}

.composer-frame {
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: 84px minmax(0, 1fr);
  background: #1f2023;
  color: var(--text);
  overflow: hidden;
}

.composer-topbar {
  display: grid;
  grid-template-columns: 88px 52px 1fr 190px;
  align-items: center;
  gap: 10px;
  height: 84px;
  padding: 0 28px;
  border-bottom: 1px solid #050606;
  background: #020303;
}

.composer-topbar > strong {
  justify-self: center;
  font-size: 1.36rem;
}

.composer-right {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 22px;
}

.composer-link,
.composer-help {
  border: 0;
  background: transparent;
  color: #00d8ff;
  font-size: 1.08rem;
  font-weight: 800;
  cursor: pointer;
}

.composer-link.muted {
  color: rgba(255, 255, 255, 0.22);
}

.composer-help {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.composer-help svg {
  width: 29px;
  height: 29px;
}

.composer-workspace {
  min-height: 0;
  overflow: hidden;
}

.focused-chart-composer {
  min-height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.focused-paper-wrap {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 0 28px 20px;
}

.focused-paper-wrap .chart-paper {
  width: min(1080px, calc(100vw - 56px));
  min-height: 100%;
  margin-top: 0;
  border-radius: 0;
  box-shadow: none;
}

.composer-frame .chord-keyboard {
  position: static;
  margin: 0;
  border-radius: 0;
  border-width: 1px 0 0;
  padding: 8px 8px 10px;
  background: rgba(29, 30, 33, 0.99);
}

.library-panel,
.context-panel {
  background: rgba(23, 26, 26, 0.96);
  border-color: var(--line-soft);
  border-style: solid;
  overflow: auto;
  max-height: 100vh;
}

.library-panel {
  border-width: 0 1px 0 0;
  padding: 0;
  background: #050606;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.context-panel {
  border-width: 0 0 0 1px;
  padding: 18px;
}

.workspace {
  min-width: 0;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  max-height: 100vh;
  overflow: hidden;
}

.browser-workspace {
  padding: 0;
  background: #202023;
}

.workspace-main {
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 32px;
}

.app-frame.view-metronome .workspace-main,
.app-frame.view-clicksets .workspace-main,
.app-frame.view-piano .workspace-main,
.app-frame.view-recordings .workspace-main,
.app-frame.view-tuner .workspace-main {
  height: 100%;
  overflow: hidden;
  padding: 14px 20px 16px;
}

.metronome-standalone-main {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    #111313;
}

.browser-workspace-main {
  overflow: hidden;
  padding: 0;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.ireal-brand {
  min-height: 104px;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 18px 24px;
  border-bottom: 1px solid #1c2024;
  background: #030404;
}

.brand > div {
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ireal-brand h1 {
  font-size: 1.26rem;
  text-align: center;
  line-height: 1.08;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.ireal-brand p {
  text-align: center;
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #00d8ff;
  padding: 0;
  cursor: pointer;
}

.brand-icon svg {
  width: 30px;
  height: 30px;
}

.ireal-library-categories {
  display: grid;
  border-bottom: 1px solid #1c2024;
  background: #1b1d20;
}

.library-category-row {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid #30333a;
  background: transparent;
  color: #f2f1ed;
  padding: 0 18px 0 24px;
  text-align: left;
  cursor: pointer;
}

.library-category-row:last-child {
  border-bottom: 0;
}

.library-category-row svg:first-child {
  width: 27px;
  height: 27px;
  color: #00d8ff;
}

.library-category-row svg:last-child {
  width: 20px;
  height: 20px;
  color: #60646c;
}

.library-category-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.08rem;
  font-weight: 700;
}

.library-category-row b {
  color: #9b9da5;
  font-size: 1rem;
  font-weight: 500;
}

.ireal-sidebar-section {
  border-top: 1px solid #111315;
}

.ireal-section-label {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 18px;
  color: #888b92;
  background: #030404;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.ireal-section-label span {
  letter-spacing: 0;
}

.ireal-section-label small {
  color: #888b92;
  font-size: 0.82rem;
}

.ireal-section-label .icon-btn {
  width: 34px;
  min-height: 34px;
  border-color: #30333a;
  color: #00d8ff;
}

.ireal-search {
  width: calc(100% - 36px);
  margin: 14px 18px 12px;
  border-radius: 10px;
  background: #1c1e22;
  border-color: #22262b;
  font-size: 1rem;
}

.songs-browser-panel {
  position: relative;
  background: #000;
  padding: 0;
  overflow: hidden;
}

.songs-browser-header {
  min-height: 84px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid #16191d;
  background: #000;
}

.songs-browser-header strong {
  font-size: 1.32rem;
  font-weight: 900;
}

.songs-browser-header button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: #00d8ff;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 750;
  cursor: pointer;
}

.songs-browser-header button:last-child {
  justify-self: end;
}

.songs-browser-header .playlist-edit-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.playlist-edit-trigger {
  justify-self: end;
}

.songs-browser-header svg {
  width: 27px;
  height: 27px;
}

.songs-browser-search {
  width: calc(100% - 36px);
  margin: 14px 18px 16px;
  border-radius: 12px;
  background: #1c1c20;
  border-color: #1f2228;
  min-height: 50px;
  font-size: 1.14rem;
  font-weight: 650;
}

.songs-browser-list {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: grid;
  align-content: start;
  grid-template-columns: minmax(0, 1fr);
  padding-right: 20px;
  border-top: 1px solid #15181c;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.songs-browser-list .song-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: grid;
  min-height: 78px;
  grid-template-columns: minmax(0, 1fr) minmax(54px, 66px);
  grid-template-areas:
    "copy side";
  align-items: center;
  gap: 2px 8px;
  padding: 10px 28px 10px 18px;
}

.songs-browser-list .song-card.edit-mode {
  grid-template-columns: 32px minmax(0, 1fr) minmax(54px, 66px);
  grid-template-areas: "check copy side";
}

.song-edit-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.song-edit-actions .library-edit-action,
.song-bulk-edit-strip button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.song-bulk-edit-strip {
  flex: 0 0 auto;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 18px 10px;
  padding: 8px 12px;
  border: 1px solid rgba(0, 216, 255, 0.26);
  border-radius: 8px;
  background: rgba(0, 216, 255, 0.075);
  color: #dff8fb;
  font-weight: 800;
}

.song-bulk-edit-strip button {
  min-height: 34px;
  border: 1px solid rgba(220, 98, 91, 0.55);
  border-radius: 8px;
  background: rgba(220, 98, 91, 0.12);
  color: #ff7b75;
  font-weight: 900;
  cursor: pointer;
}

.song-bulk-edit-strip button:disabled,
.song-edit-actions .library-edit-action:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.song-swipe-row {
  position: relative;
  min-width: 0;
  min-height: 78px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: #050606;
}

.song-swipe-row .song-card {
  position: relative;
  z-index: 2;
  border: 0;
  border-radius: 0;
  border-bottom: 0;
  background: rgba(20, 24, 24, 0.96);
  transition: transform 190ms ease, background 190ms ease, border-color 190ms ease, box-shadow 190ms ease;
}

.song-swipe-row:hover .song-card {
  background: linear-gradient(90deg, rgba(0, 216, 255, 0.13), rgba(20, 24, 24, 0.96) 58%);
  box-shadow: inset 3px 0 0 rgba(0, 216, 255, 0.78);
}

.song-swipe-row.swipe-open .song-card {
  transform: none;
}

.song-swipe-actions {
  display: none;
}

.song-swipe-actions button {
  border: 0;
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
  gap: 4px;
  font-weight: 900;
  cursor: pointer;
}

.song-row-hover-actions {
  display: none;
}

.song-rename-actions button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(0, 216, 255, 0.42);
  border-radius: 8px;
  background: rgba(4, 12, 14, 0.9);
  color: #00d8ff;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.song-rename-actions button:hover {
  border-color: rgba(0, 216, 255, 0.78);
  background: rgba(0, 216, 255, 0.14);
}

.song-rename-actions button:last-child {
  border-color: rgba(255, 75, 68, 0.48);
  color: #ff605b;
}

.song-context-menu {
  position: fixed;
  z-index: 220;
  min-width: 208px;
  max-width: min(232px, calc(100vw - 16px));
  border-color: rgba(0, 216, 255, 0.34);
  background: linear-gradient(180deg, rgba(19, 24, 28, 0.98), rgba(9, 12, 14, 0.98));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.55), 0 0 22px rgba(0, 216, 255, 0.12);
  backdrop-filter: blur(12px);
}

.song-context-menu button:hover {
  background: rgba(0, 216, 255, 0.11);
}

.song-context-menu .danger-text:hover {
  background: rgba(255, 75, 68, 0.12);
}

.song-card.selected {
  background: rgba(0, 216, 255, 0.12);
  box-shadow: inset 3px 0 0 #00d8ff;
}

.library-check {
  grid-area: check;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.58);
}

.library-check.checked {
  color: #00d8ff;
  filter: drop-shadow(0 0 10px rgba(0, 216, 255, 0.38));
}

.library-check svg {
  width: 22px;
  height: 22px;
}

.song-card.renaming {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "copy actions";
  align-items: center;
  min-height: 78px;
  gap: 10px;
  padding: 10px 12px 10px 18px;
  color: var(--text);
}

.song-card.renaming.edit-mode {
  grid-template-columns: 32px minmax(0, 1fr) auto;
  grid-template-areas: "check copy actions";
}

.song-card-rename input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(0, 216, 255, 0.48);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  padding: 0 10px;
  font-weight: 900;
  outline: none;
}

.song-card-rename input:focus {
  border-color: rgba(0, 216, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(0, 216, 255, 0.11);
}

.song-rename-actions {
  grid-area: actions;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.song-card-copy {
  grid-area: copy;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.songs-browser-list .song-card-copy strong {
  min-width: 0;
  font-size: 1.08rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.songs-browser-list .song-card-copy small {
  min-width: 0;
  font-size: 0.94rem;
  color: #c0c3c8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.songs-browser-list .song-meta {
  grid-area: side;
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 4px;
  margin: 0;
  text-align: right;
  color: #b8bbc1;
  font-size: 0.92rem;
}

.library-edit-action:disabled {
  opacity: 0.34;
  cursor: default;
}

.danger-text {
  color: #ff6a64 !important;
}

.library-check {
  grid-area: check;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #3a3d45;
  border-radius: 50%;
  color: #8b8f99;
}

.library-check.checked {
  border-color: #00d8ff;
  background: rgba(0, 216, 255, 0.18);
  color: #00d8ff;
}

.library-check svg {
  width: 16px;
  height: 16px;
}

.song-alpha-section {
  min-height: 44px;
  display: flex;
  align-items: end;
  padding: 0 18px 7px;
  border-bottom: 1px solid #15181c;
  background: #000;
  color: #7c8087;
  font-size: 0.95rem;
  font-weight: 850;
}

.songs-alpha-rail {
  position: absolute;
  right: 8px;
  top: 146px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #00d8ff;
  font-size: 0.78rem;
  font-weight: 850;
  pointer-events: none;
}

.playlist-index-panel {
  background: #000;
}

.playlist-index-list {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-top: 1px solid #15181c;
  background: #000;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.playlist-index-row {
  position: relative;
  min-height: 70px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: stretch;
  border-bottom: 1px solid #24272d;
  background: #1b1d20;
  cursor: grab;
}

.playlist-index-row.dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.playlist-index-row.edit-mode {
  cursor: default;
}

.playlist-index-row.active {
  background: rgba(0, 216, 255, 0.09);
}

.playlist-index-row.selected {
  background: rgba(0, 216, 255, 0.14);
}

.playlist-drag-grip,
.playlist-index-check {
  display: grid;
  place-items: center;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  background: transparent;
  color: #00d8ff;
}

.playlist-index-check {
  cursor: pointer;
}

.playlist-drag-grip svg,
.playlist-index-check svg {
  width: 22px;
  height: 22px;
}

.playlist-index-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: #f5f5f7;
  padding: 0 14px 0 8px;
  text-align: left;
  cursor: pointer;
}

.playlist-index-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.1rem;
  font-weight: 650;
}

.playlist-index-main b {
  color: #9b9da5;
  font-size: 1.05rem;
  font-weight: 500;
}

.playlist-index-main svg {
  width: 20px;
  height: 20px;
  color: #60646c;
}

.playlist-index-order {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2px;
  padding-right: 8px;
}

.playlist-index-order button {
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #00d8ff;
  cursor: pointer;
}

.playlist-index-order svg {
  width: 20px;
  height: 20px;
}

.playlist-index-dock {
  min-height: 64px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  border-top: 1px solid #1c2024;
  background: #000;
}

.playlist-drag-hint {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #00d8ff;
  font-size: 0.9rem;
  font-weight: 800;
}

.playlist-drag-hint svg {
  width: 22px;
  height: 22px;
}

.ireal-song-list,
.ireal-playlist-list {
  gap: 0;
  border-top: 1px solid #24272d;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-start;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(17, 19, 19, 0.92);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.page-nav {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.page-nav button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(0, 216, 255, 0.28);
  border-radius: 10px;
  padding: 0 12px;
  background: rgba(18, 28, 31, 0.92);
  color: #d9f9ff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.page-nav button:disabled {
  opacity: 1;
  cursor: default;
  color: rgba(255, 255, 255, 0.34);
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(16, 18, 19, 0.78);
  box-shadow: none;
  filter: saturate(0.2);
}

.page-nav svg {
  width: 17px;
  height: 17px;
}

.tabs,
.button-row,
.icon-row,
.metadata-grid,
.stage-actions,
.queue-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.tabs {
  flex-wrap: nowrap;
}

.tab-button,
.btn,
.icon-btn,
.chip,
.song-card,
.setlist-card,
.queue-item,
.measure-card {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tab-button,
.btn,
.icon-btn,
.chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--panel-2);
  padding: 0 12px;
  cursor: pointer;
}

.tab-button {
  min-width: 112px;
  max-width: 160px;
  min-inline-size: 0;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-button.active,
.btn.primary {
  background: rgba(31, 182, 166, 0.16);
  border-color: rgba(31, 182, 166, 0.56);
  color: var(--text);
}

.btn.warn {
  background: rgba(216, 158, 50, 0.14);
  border-color: rgba(216, 158, 50, 0.42);
}

.btn.danger,
.icon-btn.danger {
  background: rgba(220, 98, 91, 0.12);
  border-color: rgba(220, 98, 91, 0.42);
}

.btn.ghost,
.icon-btn.ghost {
  background: transparent;
}

.icon-btn {
  width: 38px;
  padding: 0;
  flex: 0 0 auto;
}

.icon-btn svg,
.btn svg,
.tab-button svg,
.chip svg {
  width: 17px;
  height: 17px;
}

.btn:hover,
.icon-btn:hover,
.tab-button:hover,
.chip:hover,
.song-card:hover,
.setlist-card:hover,
.queue-item:hover,
.measure-card:hover {
  border-color: rgba(242, 241, 237, 0.34);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.field span,
.section-title small,
.mini-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.field input,
.field textarea,
.field select,
.search-input,
.bulk-area {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101212;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

.field textarea,
.bulk-area {
  resize: vertical;
  min-height: 88px;
  line-height: 1.45;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-input:focus,
.bulk-area:focus {
  border-color: rgba(31, 182, 166, 0.78);
  box-shadow: 0 0 0 3px rgba(31, 182, 166, 0.12);
}

.search-input {
  margin-bottom: 12px;
}

.songs-browser-panel .songs-browser-search {
  display: block;
  width: auto;
  margin: 14px 18px 16px;
}

.playlist-browser-panel {
  max-height: 100vh;
}

.playlist-browser-header strong {
  color: #00d8ff;
}

.playlist-edit-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -4px 18px 14px;
  padding: 10px 12px;
  border: 1px solid rgba(220, 98, 91, 0.24);
  border-radius: 8px;
  background: rgba(220, 98, 91, 0.08);
}

.playlist-edit-strip span {
  min-width: 0;
  color: #bfc4ca;
  font-size: 0.9rem;
  font-weight: 800;
}

.playlist-remove-selected {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: rgba(220, 98, 91, 0.16);
  color: #ff8a84;
  padding: 0 10px;
  font-weight: 900;
  cursor: pointer;
}

.playlist-remove-selected:disabled {
  opacity: 0.42;
  cursor: default;
}

.playlist-song-list {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-top: 1px solid #15181c;
}

.playlist-song-row {
  width: 100%;
  min-width: 0;
  min-height: 78px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) minmax(54px, 76px);
  align-items: center;
  gap: 8px;
  padding: 9px 18px 9px 8px;
  border: 0;
  border-bottom: 1px solid #202329;
  background: #000;
  color: #f5f5f7;
  text-align: left;
  cursor: pointer;
}

.playlist-song-row.active {
  background: rgba(31, 182, 166, 0.14);
}

.playlist-song-number {
  color: #898d95;
  font-size: 0.9rem;
  text-align: center;
}

.playlist-song-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.playlist-song-copy strong,
.playlist-song-copy em,
.playlist-song-copy small {
  min-width: 0;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: normal;
}

.playlist-song-copy strong {
  color: #f5f5f7;
  font-size: 1.08rem;
  line-height: 1.15;
  font-weight: 900;
}

.playlist-song-copy em {
  color: #e6e7ea;
  font-size: 0.98rem;
}

.playlist-song-copy small {
  color: #8f9299;
  font-size: 0.92rem;
}

.playlist-song-side {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 4px;
  color: #9ea1a8;
  font-size: 0.92rem;
}

.playlist-song-side b {
  font-weight: 550;
}

.playlist-song-side i {
  min-width: 40px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 4px;
  background: #303139;
  color: #c8c9d0;
  font-style: normal;
  padding: 1px 7px;
}

.library-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.song-list,
.setlist-list,
.queue-list {
  display: grid;
  gap: 8px;
}

.library-panel .song-list,
.library-panel .setlist-list {
  gap: 0;
}

.song-card,
.setlist-card,
.queue-item {
  width: 100%;
  background: rgba(32, 36, 36, 0.74);
  color: var(--text);
  padding: 11px;
  text-align: left;
  cursor: pointer;
}

.ireal-song-list .song-card,
.ireal-playlist-list .setlist-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title side"
    "sub side";
  align-items: center;
  gap: 2px 10px;
  min-height: 66px;
  border: 0;
  border-bottom: 1px solid #202329;
  border-radius: 0;
  background: #050606;
  padding: 9px 18px 9px 24px;
}

.ireal-song-list .song-card.active,
.ireal-playlist-list .setlist-card.active {
  background: rgba(31, 182, 166, 0.14);
  border-color: rgba(31, 182, 166, 0.45);
}

.ireal-song-list .song-card strong,
.ireal-playlist-list .setlist-card strong {
  grid-area: title;
  font-size: 0.96rem;
}

.ireal-song-list .song-card small,
.ireal-playlist-list .setlist-card small {
  grid-area: sub;
  margin: 0;
  font-size: 0.82rem;
}

.ireal-song-list .song-meta,
.ireal-playlist-list .setlist-meta {
  grid-area: side;
  display: grid;
  justify-items: end;
  gap: 4px;
  margin: 0;
  text-align: right;
}

.ireal-song-list .song-meta .pill,
.ireal-playlist-list .setlist-meta .pill {
  order: 3;
  background: #303139;
  border-color: #303139;
}

.playlists-section {
  padding-bottom: 74px;
}

.ireal-sidebar-dock {
  flex: 0 0 auto;
  margin-top: auto;
  min-height: 66px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 8px;
  border-top: 1px solid #14171a;
  background: #030404;
  padding: 8px 18px;
  z-index: 6;
}

.ireal-dock-btn {
  min-height: 48px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #00d8ff;
  cursor: pointer;
}

.ireal-dock-btn svg {
  width: 28px;
  height: 28px;
}

.song-card.active,
.setlist-card.active,
.queue-item.active {
  border-color: rgba(31, 182, 166, 0.68);
  background: rgba(31, 182, 166, 0.12);
}

.song-card strong,
.setlist-card strong,
.queue-title strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-card small,
.setlist-card small,
.queue-title small {
  display: block;
  margin-top: 4px;
  color: #c0c2bd;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-meta,
.setlist-meta,
.stage-meta,
.media-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.pill.chart {
  color: #9ce6d9;
  border-color: rgba(31, 182, 166, 0.42);
}

.pill.media {
  color: #f1cd87;
  border-color: rgba(216, 158, 50, 0.48);
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  margin-bottom: 14px;
}

.section-title > div {
  min-width: 0;
}

.section-title h2,
.section-title h3 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-title h2 {
  font-size: 1.3rem;
}

.section-title h3 {
  font-size: 0.98rem;
}

.home-hero-title {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.home-hero-title .home-page-nav {
  padding-top: 2px;
}

.prep-save-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(0, 216, 255, 0.62);
  border-radius: 10px;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(0, 132, 148, 0.82), rgba(0, 82, 96, 0.86));
  color: #eaffff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(0, 216, 255, 0.18);
}

.prep-save-btn svg {
  width: 18px;
  height: 18px;
}

.muted {
  color: var(--muted);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  background: rgba(32, 36, 36, 0.48);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.stat {
  min-height: 70px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(23, 26, 26, 0.7);
  padding: 12px;
}

.stat b {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.chart-grid,
.stage-chart-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.chart-scroll {
  width: 100%;
  overflow: auto;
  padding: 4px;
}

.prep-stage-editor.chart-mode {
  min-height: calc(100vh - 112px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prep-stage-editor.chart-mode .section-title {
  margin-bottom: 0;
}

.prep-stage-editor.chart-mode .chart-scroll {
  flex: 1 1 auto;
  min-height: min(68vh, 760px);
  display: grid;
  align-items: stretch;
  border: 1px solid #292d33;
  border-radius: 8px;
  background: #1f2023;
  padding: 22px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.prep-stage-editor.chart-mode .chart-paper {
  width: min(920px, 96%);
  min-height: 100%;
  border-radius: 0;
}

.prep-stage-editor.chart-mode .chord-keyboard {
  position: static;
  margin-bottom: 0;
}

.chart-paper {
  min-width: 560px;
  max-width: 1040px;
  margin: 0 auto;
  background: #fbfaf4;
  color: #090a09;
  border: 1px solid #d9d4c8;
  border-radius: 6px;
  padding: 16px 18px 24px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

.browser-chart-wrap .chart-paper,
.ireal-chart-wrap .chart-paper {
  border-color: #eee9dd;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.48);
}

.stage-paper {
  min-width: 780px;
  max-width: none;
  min-height: 100%;
}

.chart-paper-header {
  display: grid;
  grid-template-columns: minmax(96px, 0.9fr) minmax(0, 1.35fr) minmax(96px, 0.9fr);
  align-items: start;
  gap: 12px;
  margin-bottom: 18px;
}

.chart-paper-title {
  min-width: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0 4px;
}

.chart-paper-title h2 {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  min-height: clamp(24px, 3.2vw, 38px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  font-size: clamp(0.68rem, var(--paper-title-size, 1.62rem), 1.62rem);
  line-height: 0.98;
  letter-spacing: 0;
  text-transform: uppercase;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  text-wrap: balance;
  font-weight: 950;
}

.chart-paper-title .paper-title-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  text-align: center;
  text-overflow: clip;
  white-space: normal;
  font-size: inherit;
  line-height: inherit;
}

.chart-paper-title input.paper-title-input {
  overflow: hidden;
  white-space: nowrap;
}

.chart-paper-title textarea.paper-title-input {
  height: calc(2em + 2px);
  min-height: calc(2em + 2px);
  max-height: calc(2em + 2px);
  border: 0;
  background: transparent;
  color: #090a09;
  padding: 0;
  resize: none;
  outline: 0;
  font-family: inherit;
  text-transform: uppercase;
}

.chart-paper-title span,
.chart-paper-meta span {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #4f524e;
  margin-top: 5px;
  font-size: 0.9rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-paper-title span.paper-title-input {
  display: -webkit-box;
  margin-top: 0;
  overflow: hidden;
  color: #090a09;
  font-size: inherit;
  font-weight: 950;
  line-height: inherit;
  white-space: normal;
  box-shadow: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chart-paper-meta {
  min-width: 0;
  color: #8c8c88;
  font-size: 1rem;
}

.chart-paper-meta strong {
  display: block;
  color: #747672;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-paper-meta .paper-style {
  color: #151615;
  font-size: 1.02rem;
  font-weight: 850;
}

.chart-paper-meta .paper-tempo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #151615;
  font-size: 0.96rem;
  font-weight: 850;
}

.chart-paper-meta .paper-tempo svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}

.chart-paper-meta.right {
  min-width: 0;
  text-align: right;
  color: #151615;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.chart-paper-meta.right strong {
  color: #151615;
  font-weight: 900;
}

.chart-paper-meta.right .paper-key {
  max-width: 100%;
  overflow: hidden;
  color: #151615;
  font-size: 0.98rem;
  font-weight: 850;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .library-category-row:hover,
  .tab-button:hover,
  .songs-browser-header button:hover,
  .playlist-index-row:hover,
  .songs-browser-list .song-card:hover,
  .playlist-song-row:hover,
  .setlist-list-row:hover,
  .setlist-song-row:hover,
  .click-set-row:hover,
  .click-song-row:hover,
  .ireal-dock-btn:hover,
  .metro-card-actions button:hover,
  .playlist-picker-row:hover {
    background-color: rgba(0, 216, 255, 0.08);
  }

  .playlist-index-row.active:hover,
  .playlist-index-row.selected:hover,
  .songs-browser-list .song-card.active:hover,
  .playlist-song-row.active:hover,
  .setlist-list-row.active:hover,
  .setlist-song-row.active:hover,
  .click-set-row.active:hover,
  .click-song-row.active:hover {
    background-color: rgba(0, 216, 255, 0.16);
  }
}

.paper-title-input,
.paper-meta-input,
.paper-key-edit select,
.paper-number-wrap input {
  min-width: 0;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  letter-spacing: 0;
  outline: 0;
  padding: 0;
}

.paper-title-input {
  width: 100%;
  text-align: center;
  text-transform: uppercase;
}

.paper-meta-input {
  width: 100%;
}

.paper-number-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #151615;
  font-size: 0.96rem;
  font-weight: 850;
}

.paper-number-wrap svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}

.paper-number-wrap input {
  width: 82px;
}

.paper-key-edit {
  position: relative;
  display: inline-grid;
  justify-items: end;
  gap: 2px;
  color: #151615;
  font-weight: 900;
}

.paper-key-button {
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  border: 0;
  background: transparent;
  color: #151615;
  font: inherit;
  font-weight: 900;
  padding: 2px 4px;
  cursor: pointer;
}

.paper-key-button span,
.paper-key-label {
  color: #151615;
  font-size: 0.98rem;
  font-weight: 900;
}

.paper-key-button b {
  color: #151615;
  font-size: 0.98rem;
  font-weight: 950;
}

.paper-key-button svg {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.paper-key-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 80;
  min-width: 158px;
  display: grid;
  grid-template-columns: repeat(3, minmax(42px, 1fr));
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(31, 182, 166, 0.42);
  border-radius: 8px;
  background: #101213;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.paper-key-menu button {
  min-height: 32px;
  border: 1px solid #2b3033;
  border-radius: 6px;
  background: #1d2024;
  color: #edf5f3;
  font-size: 0.84rem;
  font-weight: 850;
  cursor: pointer;
}

.paper-key-menu button.active {
  border-color: rgba(0, 216, 255, 0.7);
  background: rgba(0, 216, 255, 0.16);
  color: #00d8ff;
}

.paper-key-edit select {
  width: auto;
  text-align: right;
  appearance: none;
}

.chart-paper input:focus,
.chart-paper select:focus {
  border-radius: 3px;
  background: rgba(31, 182, 166, 0.09);
  box-shadow: 0 0 0 1px rgba(31, 182, 166, 0.46);
}

.chart-sheet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  row-gap: 13px;
  padding-top: 7px;
}

.chart-paper.preview-paper {
  width: min(100%, 1040px);
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.chart-paper.preview-paper .chart-sheet-grid {
  min-height: 0;
  align-content: stretch;
  grid-auto-rows: minmax(0, 1fr);
}

.chart-paper.preview-paper .chart-measure {
  min-height: 0;
}

.chart-measure {
  min-height: 88px;
  position: relative;
  display: flex;
  align-items: center;
  border-left: 3px solid #0d0e0d;
  padding: 14px 8px 20px 12px;
  cursor: pointer;
}

.chart-measure:nth-child(4n) {
  border-right: 3px solid #0d0e0d;
}

.chart-measure.selected {
  background: rgba(31, 182, 166, 0.12);
  outline: 3px solid rgba(31, 182, 166, 0.68);
  outline-offset: -3px;
}

.chart-measure.range-selected {
  background: rgba(31, 182, 166, 0.14);
  outline: 2px solid rgba(31, 182, 166, 0.82);
  outline-offset: -2px;
}

.chart-measure.selected.range-selected {
  outline-width: 3px;
}

.chart-measure.paste-target {
  cursor: copy;
}

.chart-measure.paste-target:hover {
  background: rgba(0, 216, 255, 0.14);
  box-shadow: inset 0 0 0 3px rgba(0, 216, 255, 0.62);
}

.chart-measure:hover {
  background: rgba(31, 182, 166, 0.08);
}

.chart-measure.preview-empty {
  cursor: default;
}

.chart-measure.preview-empty .sheet-index {
  color: rgba(9, 10, 9, 0.14);
}

.chart-measure.preview-empty .sheet-chords {
  min-height: 1em;
}

.chart-measure.preview-empty:hover {
  background: transparent;
}

.stage-paper .chart-measure {
  min-height: 108px;
  cursor: pointer;
}

.stage-paper .chart-measure.has-notation {
  align-items: flex-start;
  padding-top: 8px;
}

.sheet-index {
  position: absolute;
  right: 9px;
  top: 6px;
  color: rgba(13, 14, 13, 0.22);
  font-size: 0.7rem;
}

.sheet-section,
.sheet-memo {
  position: absolute;
  left: -24px;
  min-width: 22px;
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b32927;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.sheet-section {
  left: -19px;
  top: -7px;
  border: 1px solid #e12b24;
  border-radius: 2px;
  background: #e12b24;
  padding: 1px 4px 0;
  font-size: 0.64rem;
  letter-spacing: 0;
  color: #fff;
  z-index: 8;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
}

.sheet-memo {
  bottom: 5px;
  font-size: 1rem;
}

.sheet-annotation {
  position: absolute;
  left: 24px;
  top: 5px;
  z-index: 2;
  max-width: calc(100% - 34px);
  color: #e12b24;
  font-size: 1.02rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-details {
  position: absolute;
  left: 13px;
  right: 20px;
  top: 3px;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  gap: 3px;
  flex-wrap: wrap;
  max-height: 31px;
  overflow: hidden;
  pointer-events: none;
}

.sheet-detail-badge {
  min-height: 14px;
  max-width: 58px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #b32927;
  border-radius: 2px;
  background: rgba(251, 250, 244, 0.96);
  color: #b32927;
  padding: 0 3px;
  font-size: 0.54rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-measure:has(.sheet-section) .sheet-details {
  left: 38px;
}

.stage-paper .sheet-section {
  left: -19px;
  top: -7px;
  min-width: 18px;
  min-height: 16px;
  font-size: 0.66rem;
}

.chart-measure.has-notation .sheet-details {
  left: 12px;
  right: 12px;
  top: auto;
  bottom: 3px;
  align-items: center;
  max-width: none;
  max-height: 17px;
}

.chart-measure.has-notation .sheet-detail-badge {
  font-size: 0.5rem;
}

.chart-measure.has-notation:has(.sheet-details) {
  padding-bottom: 24px;
}

.sheet-chords {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 10px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.chord-symbol {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #050605;
  white-space: nowrap;
  line-height: 0.9;
}

.chord-main {
  display: inline-flex;
  align-items: baseline;
  line-height: 0.9;
}

.chord-root {
  font-size: 2.72rem;
  font-weight: 600;
  line-height: 0.9;
}

.chord-quality {
  align-self: flex-end;
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1;
  margin-left: 2px;
  padding-bottom: 4px;
}

.chord-bass {
  align-self: center;
  display: inline-flex;
  align-items: baseline;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1;
  margin-top: -2px;
  padding: 0;
}

.accidental {
  font-size: 0.6em;
  vertical-align: super;
  margin-left: 1px;
}

.repeat-symbol,
.sheet-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 42px;
  color: #050605;
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  transform: rotate(-14deg);
}

.sheet-empty {
  opacity: 0.18;
}

.chord-symbol.text-only {
  font-size: 1.85rem;
  font-weight: 800;
}

.double-bar {
  color: #050605;
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: -5px;
}

.sheet-melody {
  position: absolute;
  left: 56px;
  right: 8px;
  bottom: 4px;
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.sheet-melody .note-token {
  min-height: 15px;
  padding: 0 3px;
  background: rgba(5, 6, 5, 0.08);
  color: #30312f;
  font-size: 0.56rem;
}

.engraved-notation {
  position: absolute;
  inset: 0;
  z-index: 2;
  font-family: Georgia, serif;
}

.engraved-note {
  position: absolute;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
}

.engraved-head {
  position: absolute;
  left: 0;
  top: 4px;
  width: 17px;
  height: 11px;
  border: 2px solid #050605;
  border-radius: 50%;
  background: #050605;
  transform: rotate(-18deg);
}

.engraved-note.dur-w .engraved-head,
.engraved-note.dur-h .engraved-head {
  background: #fbfaf4;
}

.engraved-stem {
  position: absolute;
  width: 2px;
  height: 33px;
  background: #050605;
}

.engraved-note.dur-w .engraved-stem {
  display: none;
}

.engraved-note.stem-up .engraved-stem {
  left: 15px;
  bottom: 8px;
}

.engraved-note.stem-down .engraved-stem {
  left: 1px;
  top: 10px;
}

.engraved-note.dur-e .engraved-stem::after,
.engraved-note.dur-s .engraved-stem::after {
  content: "";
  position: absolute;
  right: -9px;
  top: 0;
  width: 12px;
  height: 18px;
  border-top: 3px solid #050605;
  border-right: 3px solid #050605;
  border-radius: 0 8px 0 0;
}

.engraved-accidental {
  position: absolute;
  left: -13px;
  top: -2px;
  color: #050605;
  font-size: 0.9rem;
  font-weight: 800;
}

.engraved-tie {
  position: absolute;
  left: 11px;
  top: 17px;
  width: 26px;
  height: 9px;
  border-bottom: 2px solid #050605;
  border-radius: 50%;
}

.engraved-rest {
  position: absolute;
  top: 46%;
  transform: translate(-50%, -50%);
  color: #050605;
  font-size: 1.3rem;
  font-weight: 800;
}

.sheet-ink-preview {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0.95;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.measure-notation-staff.clean-active .sheet-ink-preview {
  opacity: 1;
  mix-blend-mode: multiply;
}

.measure-notation-staff {
  position: absolute;
  left: 8px;
  right: 6px;
  bottom: 6px;
  height: 58%;
  min-height: 50px;
  background: rgba(251, 250, 244, 0.78);
  pointer-events: none;
}

.chart-measure.has-notation:has(.sheet-details) .measure-notation-staff {
  bottom: 24px;
  height: 48%;
  min-height: 42px;
}

.measure-notation-staff .mini-clef {
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  color: #111;
  font-family: Georgia, serif;
  font-size: 2.05rem;
  line-height: 1;
}

.staff-line {
  position: absolute;
  left: 42px;
  right: 4px;
  height: 1px;
  background: rgba(17, 17, 17, 0.62);
}

.staff-line.l1 { top: 18%; }
.staff-line.l2 { top: 34%; }
.staff-line.l3 { top: 50%; }
.staff-line.l4 { top: 66%; }
.staff-line.l5 { top: 82%; }

.measure-notation-staff.no-clef .staff-line {
  left: 12px;
}

.measure-notation-staff.no-clef .sheet-melody {
  left: 18px;
}

.measure-notation-staff.clean-active .staff-line {
  left: 36px;
  right: 6px;
  height: 1px;
  background: rgba(5, 6, 5, 0.84);
}

.measure-notation-staff.clean-active .engraved-notation {
  left: 36px;
  right: 4px;
}

.measure-notation-staff.ink-active .staff-line {
  left: 2.3%;
  right: 2.3%;
  height: 1px;
  background: rgba(5, 6, 5, 0.86);
}

.measure-notation-staff.ink-active .staff-line.l1 { top: 30%; }
.measure-notation-staff.ink-active .staff-line.l2 { top: 40%; }
.measure-notation-staff.ink-active .staff-line.l3 { top: 50%; }
.measure-notation-staff.ink-active .staff-line.l4 { top: 60%; }
.measure-notation-staff.ink-active .staff-line.l5 { top: 70%; }

.measure-notation-staff.ink-active .mini-clef {
  left: 3.2%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.22rem;
}

.measure-notation-staff.ink-active .sheet-ink-preview {
  opacity: 1;
  mix-blend-mode: multiply;
}

.stage-paper .chord-root {
  font-size: 3.45rem;
}

.stage-paper .chord-quality {
  font-size: 1.24rem;
}

.stage-paper .chord-bass {
  font-size: 1.12rem;
}

.stage-paper .repeat-symbol,
.stage-paper .sheet-empty {
  font-size: 3.2rem;
  width: 62px;
}

.stage-paper .chart-measure.has-notation .sheet-chords {
  position: relative;
  z-index: 2;
  transform: scale(0.72);
  transform-origin: left top;
  width: 138%;
  max-width: none;
}

.stage-paper .chart-measure.has-notation .chord-root {
  font-size: 2.45rem;
}

.stage-paper .chart-measure.has-notation .chord-quality,
.stage-paper .chart-measure.has-notation .chord-bass {
  font-size: 0.9rem;
}

.stage-paper .chart-measure.has-notation .sheet-index {
  z-index: 3;
}

.chart-measure.chord-density-tight .sheet-chords {
  gap: 6px;
}

.chart-measure.chord-density-tight .chord-root {
  font-size: 2.22rem;
}

.chart-measure.chord-density-tight .chord-quality,
.chart-measure.chord-density-tight .chord-bass {
  font-size: 0.82rem;
}

.chart-measure.chord-density-dense .sheet-chords {
  gap: 5px;
}

.chart-measure.chord-density-dense .chord-root {
  font-size: 1.92rem;
}

.chart-measure.chord-density-dense .chord-quality,
.chart-measure.chord-density-dense .chord-bass {
  font-size: 0.82rem;
}

.chart-measure.chord-density-packed .sheet-chords {
  gap: 4px;
}

.chart-measure.chord-density-packed .chord-root {
  font-size: 1.64rem;
}

.chart-measure.chord-density-packed .chord-quality,
.chart-measure.chord-density-packed .chord-bass {
  font-size: 0.76rem;
}

.stage-paper .chart-measure.chord-density-tight:not(.has-notation) .chord-root {
  font-size: 2.58rem;
}

.stage-paper .chart-measure.chord-density-dense:not(.has-notation) .chord-root {
  font-size: 2.32rem;
}

.stage-paper .chart-measure.chord-density-packed:not(.has-notation) .chord-root {
  font-size: 2.02rem;
}

.stage-paper .chart-measure.chord-density-tight.has-notation .sheet-chords {
  transform: scale(0.66);
  width: 152%;
  gap: 7px;
}

.stage-paper .chart-measure.chord-density-dense.has-notation .sheet-chords {
  transform: scale(0.58);
  width: 172%;
  gap: 6px;
}

.stage-paper .chart-measure.chord-density-packed.has-notation .sheet-chords {
  transform: scale(0.5);
  width: 200%;
  gap: 5px;
}

.stage-paper .chart-measure.chord-density-tight.has-notation .chord-root,
.stage-paper .chart-measure.chord-density-dense.has-notation .chord-root,
.stage-paper .chart-measure.chord-density-packed.has-notation .chord-root {
  font-size: 2.45rem;
}

.measure-card {
  min-height: 122px;
  background: var(--paper);
  color: var(--ink);
  padding: 9px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.measure-card.selected {
  outline: 3px solid rgba(31, 182, 166, 0.56);
  outline-offset: 2px;
}

.measure-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  color: #63665f;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--paper-line);
  padding-bottom: 5px;
  margin-bottom: 7px;
}

.section-chip {
  background: #202321;
  color: #f4f0e4;
  border-radius: 5px;
  padding: 2px 7px;
}

.chord-line {
  min-height: 38px;
  font-weight: 800;
  font-size: 1.18rem;
  line-height: 1.25;
  word-break: break-word;
}

.melody-line {
  min-height: 30px;
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  border-top: 1px solid var(--paper-line);
  margin-top: 8px;
  padding-top: 7px;
}

.note-token {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 6px;
  border: 1px solid rgba(32, 35, 33, 0.22);
  border-radius: 5px;
  background: rgba(32, 35, 33, 0.08);
  font-size: 0.78rem;
  color: #2b2f2c;
}

.editor-panel,
.setlist-panel,
.media-panel,
.inspector-block {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(23, 26, 26, 0.84);
  padding: 14px;
  margin-bottom: 14px;
}

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

.chip-group {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.chip {
  min-height: 31px;
  padding: 0 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.chip.accent {
  color: #9ce6d9;
  border-color: rgba(31, 182, 166, 0.36);
}

.chip.amber {
  color: #f1cd87;
  border-color: rgba(216, 158, 50, 0.38);
}

.chord-keyboard {
  position: sticky;
  bottom: 0;
  z-index: 20;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px 8px 0 0;
  background: rgba(28, 29, 32, 0.96);
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.32);
  padding: 9px;
  margin-bottom: 14px;
}

.chord-keyboard.compact {
  padding-bottom: 8px;
}

.chord-keyboard.compact .keyboard-rows {
  display: none;
}

.chord-keyboard.compact .chord-entry-strip {
  margin-bottom: 0;
}

.keyboard-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}

.keyboard-mode-switch button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #3b3e46;
  border-radius: 8px;
  background: #202228;
  color: #d8dbe0;
  font-size: 1rem;
  font-weight: 900;
  padding: 0 18px;
  cursor: pointer;
}

.keyboard-mode-switch button > span {
  min-width: 0;
}

.keyboard-mode-switch button svg:last-child {
  width: 16px;
  height: 16px;
  margin-left: 2px;
  opacity: 0.78;
}

.keyboard-mode-switch button.active {
  border-color: rgba(0, 216, 255, 0.74);
  background: linear-gradient(rgba(0, 216, 255, 0.24), rgba(0, 132, 255, 0.18));
  color: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(0, 216, 255, 0.18),
    0 0 0 1px rgba(0, 216, 255, 0.08);
}

.keyboard-mode-switch svg {
  width: 19px;
  height: 19px;
}

.keyboard-mode-switch .editor-measure-details-trigger {
  border-color: rgba(0, 216, 255, 0.42);
  background: rgba(0, 216, 255, 0.07);
}

.keyboard-mode-switch .editor-measure-details-trigger:hover,
.keyboard-mode-switch .editor-measure-details-trigger.active {
  border-color: rgba(0, 216, 255, 0.82);
  background: linear-gradient(rgba(0, 216, 255, 0.24), rgba(0, 132, 255, 0.18));
  color: #fff;
}

@media (max-width: 820px) {
  .preparation-workspace .keyboard-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .preparation-workspace .keyboard-mode-switch button {
    min-width: 0;
    padding-inline: 10px;
  }
}

.chord-entry-strip {
  display: grid;
  grid-template-columns: minmax(74px, 110px) minmax(0, 1fr) 42px 42px 48px 78px 78px 88px;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.current-chord-preview {
  min-height: 44px;
  display: grid;
  align-content: center;
  border-radius: 7px;
  background: #050607;
  color: #00d8ff;
  padding: 5px 9px;
}

.current-chord-preview.measure-focus {
  place-items: center;
  text-align: center;
  padding: 6px 8px;
  border: 1px solid rgba(0, 216, 255, 0.48);
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(0, 216, 255, 0.2), rgba(0, 95, 110, 0.18)),
    #050607;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 18px rgba(0, 216, 255, 0.12);
}

.current-chord-preview b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-chord-preview.measure-focus b {
  color: #f7ffff;
  font-size: 1.02rem;
  font-weight: 950;
  line-height: 1;
}

.current-chord-preview small {
  color: #8f9098;
  font-size: 0.68rem;
}

.current-chord-preview.measure-focus small {
  color: #00d8ff;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.chord-entry-strip input {
  min-height: 44px;
  border: 1px solid #303137;
  border-radius: 7px;
  background: #050607;
  color: #f7f7f7;
  font-size: 1.16rem;
  padding: 0 12px;
  outline: 0;
}

.chord-entry-strip button,
.keyboard-grid button {
  min-height: 44px;
  border: 1px solid #505156;
  border-radius: 7px;
  background: linear-gradient(#777, #626262);
  color: #fff;
  font-size: 1.06rem;
  font-weight: 700;
  cursor: pointer;
}

.chord-entry-strip button:last-child {
  background: #0a84ff;
  border-color: #0a84ff;
}

.chord-entry-strip .history-key {
  min-width: 40px;
  padding: 0;
  background: #3a3c43;
  border-color: #50525a;
}

.chord-entry-strip .add-measure-key {
  background: #42454d;
  border-color: #595c65;
  font-size: 0.82rem;
}

.chord-entry-strip .notation-entry-key {
  gap: 5px;
  padding: 0 8px;
  border-color: rgba(0, 216, 255, 0.48);
  background: linear-gradient(rgba(0, 216, 255, 0.22), rgba(0, 132, 255, 0.18));
  color: #f7fdff;
  font-size: 0.84rem;
}

.chord-entry-strip .notation-entry-key svg {
  width: 17px;
  height: 17px;
}

.chord-entry-strip .remove-measure-key {
  border-color: rgba(220, 98, 91, 0.54);
  background: linear-gradient(rgba(104, 47, 51, 0.96), rgba(70, 34, 38, 0.96));
  color: #ffdeda;
  font-size: 0.82rem;
}

.chord-entry-strip .history-key svg {
  width: 20px;
  height: 20px;
}

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

.keyboard-rows {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: stretch;
}

.keyboard-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(5, 6, 7, 0.2);
  padding: 5px 7px;
}

.keyboard-row > span {
  justify-self: stretch;
  border: 1px solid rgba(0, 216, 255, 0.18);
  border-radius: 7px;
  background:
    radial-gradient(circle at 28% 10%, rgba(0, 216, 255, 0.26), transparent 38%),
    linear-gradient(180deg, rgba(13, 39, 43, 0.82), rgba(8, 12, 15, 0.92));
  color: #c8fbff;
  font-size: 0.7rem;
  font-weight: 950;
  padding: 7px 6px;
  text-align: right;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0, 216, 255, 0.5), 0 1px 0 #000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 16px rgba(0, 0, 0, 0.22);
  letter-spacing: 0.07em;
}

.keyboard-row:hover > span {
  border-color: rgba(0, 216, 255, 0.46);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 18px rgba(0, 216, 255, 0.16);
}

.keyboard-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 5px;
}

.keyboard-grid.compact button {
  min-height: 36px;
  padding: 0 6px;
  font-size: 0.88rem;
}

.keyboard-grid button.root-key {
  background: linear-gradient(#858585, #686868);
}

.keyboard-grid button.quality-key,
.keyboard-grid button.extension-key {
  background: linear-gradient(#727276, #5f6066);
}

.keyboard-row:has(.quality-key),
.keyboard-row:has(.extension-key) {
  grid-template-columns: 70px minmax(0, 1fr);
  padding: 4px 6px;
}

.keyboard-row:has(.quality-key) .keyboard-grid.compact,
.keyboard-row:has(.extension-key) .keyboard-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 4px;
}

.keyboard-row:has(.quality-key) .keyboard-grid.compact button,
.keyboard-row:has(.extension-key) .keyboard-grid.compact button {
  min-height: 30px;
  padding: 0 4px;
  font-size: 0.76rem;
}

.keyboard-grid button.bass-key,
.keyboard-grid button.sign-key {
  background: linear-gradient(#5f6066, #51525a);
  color: #dff8ff;
}

.keyboard-grid button.preset-key {
  background: linear-gradient(#484a54, #3b3d46);
  color: #f7f7f7;
}

.keyboard-grid button.add-bar-key {
  background: #0a84ff;
  border-color: #0a84ff;
  color: #fff;
}

.keyboard-grid button.accent,
.keyboard-grid button.section-key {
  background:
    linear-gradient(180deg, rgba(112, 34, 39, 0.98), rgba(69, 21, 26, 0.98)),
    #4c171b;
}

.keyboard-grid button.section-key {
  color: #fff5f4;
  font-size: 1.18rem;
  border-color: rgba(255, 94, 90, 0.62);
  text-shadow: 0 0 10px rgba(255, 72, 67, 0.32), 0 1px 0 #000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13), 0 7px 14px rgba(0, 0, 0, 0.18);
}

.keyboard-grid button.detail-key {
  border-color: rgba(255, 94, 90, 0.58);
  background:
    linear-gradient(180deg, rgba(107, 35, 39, 0.98), rgba(63, 21, 25, 0.98)),
    #441519;
  color: #ffe5e2;
  text-shadow: 0 0 9px rgba(255, 68, 62, 0.28), 0 1px 0 #000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11), 0 7px 14px rgba(0, 0, 0, 0.18);
}

.keyboard-grid button:hover,
.chord-entry-strip button:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 216, 255, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 0 16px rgba(0, 216, 255, 0.18),
    0 10px 20px rgba(0, 0, 0, 0.24);
}

.keyboard-grid button.section-key:hover,
.keyboard-grid button.detail-key:hover {
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 216, 255, 0.26), transparent 48%),
    linear-gradient(180deg, rgba(132, 38, 45, 1), rgba(82, 22, 29, 1));
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 216, 255, 0.5), 0 0 14px rgba(255, 71, 65, 0.28);
}

.keyboard-grid button.active,
.keyboard-grid button.section-key.active,
.keyboard-grid button.detail-key.active {
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 216, 255, 0.34), transparent 52%),
    linear-gradient(180deg, rgba(111, 35, 42, 0.98), rgba(51, 19, 24, 0.98));
  border-color: #00d8ff;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 216, 255, 0.24), 0 0 18px rgba(0, 216, 255, 0.18);
}

.details-panel {
  border-top: 1px solid var(--line-soft);
  margin-top: 12px;
  padding-top: 12px;
}

.details-panel summary {
  cursor: pointer;
  color: var(--muted);
  margin-bottom: 10px;
}

.media-stage,
.media-editor-preview {
  min-height: 420px;
  position: relative;
  display: grid;
  place-items: center;
  background: #0d0f0f;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.media-editor-preview {
  min-height: 310px;
}

.media-stage img,
.media-editor-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #0d0f0f;
}

.media-stage.fit-contain img,
.media-editor-preview.fit-contain img {
  object-fit: contain;
}

.score-title-box {
  border: 1px solid rgba(31, 182, 166, 0.28);
  border-radius: 8px;
  background: rgba(31, 182, 166, 0.06);
  padding: 12px;
  margin-bottom: 12px;
}

.score-title-box .field {
  margin-bottom: 0;
}

.score-title-box input {
  font-size: 1.05rem;
  font-weight: 700;
}

.song-organizer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.organizer-menu {
  min-width: 0;
  border: 1px solid rgba(66, 214, 198, 0.22);
  border-radius: 8px;
  background: #07090c;
  overflow: hidden;
}

.organizer-menu summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: #42d6c6;
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
}

.organizer-menu summary::marker {
  color: rgba(66, 214, 198, 0.7);
}

.organizer-menu summary svg {
  width: 17px;
  height: 17px;
}

.organizer-options {
  display: grid;
  gap: 7px;
  padding: 9px;
  border-top: 1px solid #1d2128;
}

.organizer-option {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #2a3039;
  border-radius: 8px;
  background: #11141a;
  color: #eef4f4;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.organizer-option:hover {
  border-color: rgba(66, 214, 198, 0.5);
}

.organizer-option.active,
.organizer-option:disabled {
  border-color: rgba(66, 214, 198, 0.58);
  background: rgba(66, 214, 198, 0.13);
  cursor: default;
}

.organizer-option span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

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

.organizer-option strong {
  font-size: 0.88rem;
}

.organizer-option small,
.organizer-empty,
.organizer-new-album span {
  color: #8c929b;
  font-size: 0.74rem;
}

.organizer-option b {
  flex: 0 0 auto;
  color: #42d6c6;
  font-size: 0.76rem;
}

.organizer-empty {
  padding: 8px 2px;
}

.organizer-new-album {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.organizer-new-album input {
  min-height: 38px;
  border: 1px solid #2a3039;
  border-radius: 8px;
  background: #0b0d10;
  color: #f1f4f5;
  padding: 0 10px;
  outline: 0;
}

.score-prep-tools {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(16, 18, 18, 0.78);
  padding: 12px;
  margin-top: 12px;
}

.crop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.crop-field {
  display: grid;
  gap: 7px;
}

.crop-field span {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.78rem;
}

.crop-field b {
  color: var(--text);
}

.crop-field input {
  width: 100%;
  accent-color: var(--accent);
}

.media-stage iframe,
.media-editor-preview iframe {
  width: 100%;
  height: 78vh;
  min-height: 520px;
  border: 0;
  background: #fff;
}

.media-editor-preview iframe {
  height: 440px;
  min-height: 360px;
}

.media-title-overlay {
  position: absolute;
  left: 18px;
  right: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(17, 19, 19, 0.84);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.media-title-overlay.top {
  top: 16px;
}

.media-title-overlay.bottom {
  bottom: 16px;
}

.media-title-overlay b {
  font-size: 1.08rem;
}

.upload-drop {
  display: grid;
  place-items: center;
  gap: 12px;
  text-align: center;
  min-height: 220px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 24px;
}

.upload-drop svg {
  width: 46px;
  height: 46px;
  color: var(--amber);
}

.setlist-board {
  min-height: calc(100vh - 112px);
  display: grid;
  grid-template-columns: minmax(220px, 288px) minmax(0, 1fr);
  border: 1px solid #202329;
  border-radius: 8px;
  overflow: hidden;
  background: #050606;
}

.setlist-browser {
  min-width: 0;
  border-right: 1px solid #202329;
  background: #050606;
}

.setlist-browser-header,
.setlist-detail-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #202329;
  background: #000;
}

.setlist-browser-header {
  padding: 0 14px;
}

.setlist-browser-header span {
  display: block;
  color: #8b8e96;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.setlist-browser-header strong {
  display: block;
  margin-top: 2px;
  color: #dfe4e5;
  font-size: 1.05rem;
}

.setlist-browser-list,
.setlist-song-table {
  display: grid;
}

.setlist-list-row {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid #202329;
  border-radius: 0;
  background: #050606;
  color: var(--text);
  padding: 9px 12px 9px 16px;
  text-align: left;
  cursor: pointer;
}

.setlist-list-row:hover,
.setlist-song-main:hover {
  background: rgba(255, 255, 255, 0.035);
}

.setlist-list-row.active {
  background: rgba(31, 182, 166, 0.14);
  border-color: rgba(31, 182, 166, 0.45);
}

.setlist-row-main,
.queue-title {
  min-width: 0;
}

.setlist-row-main strong,
.queue-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setlist-row-main small,
.queue-title small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #9ca1aa;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setlist-row-count {
  color: #a7abb3;
  font-size: 0.98rem;
  font-weight: 850;
}

.setlist-list-row svg {
  width: 18px;
  height: 18px;
  color: #5f646d;
}

.setlist-detail-panel {
  min-width: 0;
  background: #090b0c;
}

.setlist-detail-header {
  padding: 10px 14px;
}

.setlist-detail-header h2 {
  margin: 0;
  font-size: 1.32rem;
  line-height: 1.1;
}

.setlist-detail-header small {
  display: block;
  margin-top: 4px;
  color: #9ca1aa;
  font-size: 0.82rem;
}

.setlist-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.setlist-header-actions .btn {
  min-height: 34px;
  padding: 0 11px;
}

.setlist-meta-strip {
  display: grid;
  grid-template-columns: 1.1fr 1fr 150px 1.1fr;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #181b1f;
  background: #0b0d0e;
}

.setlist-meta-strip label {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.setlist-meta-strip span {
  color: #8f949c;
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.setlist-meta-strip input,
.setlist-add-strip select {
  width: 100%;
  min-height: 34px;
  border: 1px solid #252a31;
  border-radius: 6px;
  background: #050606;
  color: var(--text);
  padding: 0 9px;
  outline: none;
}

.setlist-add-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #181b1f;
  background: #070909;
}

.setlist-add-strip .btn {
  min-height: 34px;
}

.setlist-song-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  align-items: center;
  border-bottom: 1px solid #202329;
  background: #000;
}

.setlist-song-row.active {
  background: rgba(31, 182, 166, 0.13);
}

.setlist-song-row.active .setlist-song-main:hover {
  background: transparent;
}

.setlist-song-main {
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) minmax(62px, 92px);
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 9px 10px 9px 14px;
  text-align: left;
  cursor: pointer;
}

.setlist-song-main .queue-index {
  width: 24px;
  height: auto;
  display: block;
  border-radius: 0;
  background: transparent;
  color: #7f848d;
  font-size: 0.9rem;
  font-weight: 750;
}

.queue-side {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 3px;
  color: #aeb3bb;
  font-size: 0.82rem;
}

.queue-side b {
  color: #bfc4ca;
  font-size: 0.82rem;
  font-weight: 800;
}

.queue-side i {
  min-width: 34px;
  display: inline-flex;
  justify-content: center;
  border-radius: 5px;
  background: #2b2d34;
  color: #e8ebef;
  padding: 2px 7px;
  font-style: normal;
  font-weight: 850;
}

.queue-side em {
  color: #6fe3d3;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 800;
}

.setlist-song-row .queue-actions {
  display: inline-flex;
  justify-content: end;
  gap: 5px;
  padding-right: 10px;
  flex-wrap: nowrap;
}

.setlist-song-row .queue-actions .icon-btn {
  width: 31px;
  min-height: 31px;
  border-color: #252a31;
  color: #00d8ff;
}

.setlist-song-row .queue-actions .remove-row {
  display: none;
}

.setlist-song-row .queue-actions .icon-btn:disabled {
  opacity: 0.34;
  cursor: default;
}

.queue-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  cursor: default;
}

.queue-index {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #101212;
  color: var(--muted);
}

.stage-shell {
  min-height: calc(100vh - 102px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
}

.stage-viewer {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.stage-header {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: rgba(23, 26, 26, 0.92);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.stage-title h2 {
  margin: 0;
  font-size: 1.42rem;
}

.stage-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.stage-chart {
  background: #0f1111;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
}

.stage-chart .chart-paper {
  margin: 0;
}

.stage-chart-grid .measure-card {
  min-height: 160px;
  cursor: default;
}

.stage-chart-grid .chord-line {
  font-size: 1.55rem;
}

.stage-chart-grid .note-token {
  font-size: 0.9rem;
  min-height: 26px;
}

.stage-queue {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(23, 26, 26, 0.92);
  padding: 12px;
  overflow: auto;
}

.stage-queue h3 {
  margin: 0 0 10px;
  font-size: 0.98rem;
}

.stage-queue .queue-item {
  grid-template-columns: 30px minmax(0, 1fr);
  cursor: pointer;
}

.hidden-file {
  display: none;
}

.stage-app-frame {
  min-height: 100vh;
  background: #000;
  color: #f7f7f7;
}

.ireal-stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 34vw) minmax(0, 1fr);
  background: #000;
  color: #f4f4f4;
}

.ireal-stage.no-sidebar {
  grid-template-columns: minmax(0, 1fr);
}

.ireal-sidebar {
  min-width: 0;
  max-height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border-right: 1px solid #2c2c2f;
  background: #000;
}

.ireal-sidebar-top,
.ireal-toolbar {
  min-height: 84px;
  display: grid;
  align-items: center;
  border-bottom: 1px solid #262629;
}

.ireal-sidebar-top {
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  padding: 0 22px;
}

.ireal-sidebar-top strong {
  font-size: 1.28rem;
}

.ireal-link,
.ireal-tool,
.ireal-play {
  border: 0;
  background: transparent;
  color: #00d8ff;
  cursor: pointer;
}

.ireal-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  font-size: 1.1rem;
}

.ireal-link:last-child {
  justify-self: end;
}

.ireal-link svg {
  width: 24px;
  height: 24px;
}

.ireal-search {
  margin: 18px 20px 16px;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 12px;
  background: #1d1d20;
  color: #8f9098;
}

.ireal-search svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.ireal-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: #f5f5f7;
  background: transparent;
  font-size: 1.08rem;
}

.ireal-search input::placeholder {
  color: #8f9098;
}

.ireal-song-list {
  overflow: auto;
  border-top: 1px solid #1b1b1e;
}

.ireal-song-row {
  width: 100%;
  min-height: 86px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 18px 9px 10px;
  border: 0;
  border-bottom: 1px solid #242428;
  background: #000;
  color: #f5f5f7;
  text-align: left;
  cursor: pointer;
}

.ireal-song-row.active {
  background: #111114;
}

.ireal-song-index {
  color: #8f9098;
  font-size: 0.9rem;
  text-align: right;
}

.ireal-song-copy {
  min-width: 0;
}

.ireal-song-copy strong,
.ireal-song-copy em,
.ireal-song-copy small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: normal;
}

.ireal-song-copy strong {
  font-size: 1.06rem;
  line-height: 1.18;
}

.ireal-song-copy em {
  margin-top: 2px;
  color: #e8e8ea;
}

.ireal-song-copy small {
  margin-top: 2px;
  color: #8f9098;
}

.ireal-song-side {
  display: grid;
  gap: 8px;
  justify-items: end;
  color: #8f9098;
}

.ireal-song-side b {
  font-weight: 500;
}

.ireal-song-side i {
  min-width: 42px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 4px;
  background: #2a2a2e;
  color: #b9bac1;
  font-style: normal;
}

.ireal-sidebar-actions {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #242428;
  padding: 0 20px;
}

.ireal-main {
  min-width: 0;
  max-height: 100vh;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #202023;
}

.ireal-toolbar {
  grid-template-columns: 1fr auto 1fr;
  padding: 0 22px;
  background: #000;
}

.ireal-toolbar-left,
.ireal-toolbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ireal-toolbar-right {
  justify-content: flex-end;
}

.ireal-toolbar-center {
  color: #8f9098;
  font-size: 1.7rem;
  line-height: 1;
}

.ireal-tool {
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 1.22rem;
}

.ireal-tool.active {
  background: rgba(0, 216, 255, 0.18);
}

.ireal-tool svg {
  width: 30px;
  height: 30px;
}

.ireal-chart-area {
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 30px 18px;
  background: #202023;
}

.ireal-chart-wrap {
  width: 100%;
  display: grid;
  place-items: center;
}

.ireal-chart-wrap .chart-paper {
  width: min(860px, 96%);
  min-width: 0;
  max-width: 96%;
  margin: 0 auto;
  border-radius: 0;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45);
}

.ireal-chart-wrap .media-stage {
  width: min(960px, 96%);
  height: min(72vh, 860px);
  min-height: 420px;
  border: 0;
  border-radius: 0;
  background: #111;
}

.browser-preview-shell {
  min-width: 0;
  min-height: 100vh;
  max-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #202023;
  color: #f5f5f7;
}

.browser-preview-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  background: #111;
}

.browser-preview-shell:fullscreen .browser-preview-toolbar {
  min-height: 64px;
}

.browser-preview-shell:fullscreen .browser-preview-right {
  display: none;
}

.browser-preview-shell:fullscreen .browser-chart-area {
  padding: clamp(8px, 1.4vw, 18px);
  display: grid;
  place-items: center;
  background: #111;
}

.browser-preview-shell:fullscreen .browser-chart-wrap {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.browser-preview-shell:fullscreen .browser-chart-wrap .chart-paper {
  width: min(calc(100vw - 28px), 1480px);
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 88px);
  min-height: 0;
  aspect-ratio: 16 / 9;
  box-shadow: none;
}

.browser-preview-shell:fullscreen .browser-chart-wrap .media-stage {
  width: calc(100vw - 28px);
  height: calc(100vh - 64px);
  min-height: 0;
}

.browser-preview-shell:fullscreen .browser-song-footer {
  display: none;
}

.browser-preview-toolbar {
  min-height: 84px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid #262629;
  background: #000;
}

.browser-preview-toolbar > strong {
  color: #8f9098;
  font-size: 1.48rem;
  line-height: 1;
}

.browser-preview-left,
.browser-preview-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.browser-preview-right {
  justify-content: flex-end;
}

.browser-preview-toolbar .text-tool {
  min-width: auto;
  padding: 0 4px;
  color: #00d8ff;
  font-size: 1.7rem;
  font-weight: 650;
}

.browser-chart-area {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: stretch center;
  overflow: auto;
  padding: 30px 18px;
  background: #202023;
}

.browser-chart-wrap {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
}

.browser-chart-wrap .chart-paper {
  width: min(860px, 96%);
  min-width: 0;
  max-width: 96%;
  margin: 0 auto;
  border-radius: 0;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45);
}

.browser-chart-wrap .chart-paper.preview-paper {
  height: 100%;
  max-height: 100%;
}

.browser-chart-wrap .chart-measure {
  cursor: default;
}

.browser-chart-wrap .chart-measure.selected {
  background: transparent;
  outline: 0;
}

.browser-chart-wrap .chart-measure:hover {
  background: transparent;
}

.browser-chart-wrap .media-stage {
  width: min(980px, 96%);
  height: min(76vh, 880px);
  min-height: 420px;
  border: 0;
  border-radius: 0;
  background: #111;
}

.browser-select-empty {
  color: #9b9ca3;
  font-size: 1.42rem;
  font-weight: 600;
}

.browser-song-footer {
  min-height: 84px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  border-top: 1px solid #003643;
  background: #000;
  color: #00d8ff;
  text-align: center;
  font-size: 1.05rem;
}

.browser-song-footer span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 10px;
}

.media-score-mode .ireal-chart-area {
  position: relative;
  overflow: hidden;
  padding: 0;
  place-items: center;
}

.media-score-mode .ireal-chart-wrap {
  position: absolute;
  inset: 14px 18px;
  width: auto;
  height: auto;
  max-width: none;
  min-height: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.media-score-mode .media-stage {
  position: relative;
  width: min(1040px, 100%);
  height: 100%;
  min-height: 0;
  max-height: 100%;
}

.media-score-mode .media-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  clip-path: none !important;
}

.media-score-mode .media-stage iframe {
  height: 100%;
  min-height: 0;
}

.stage-note-panel {
  position: fixed;
  left: calc(clamp(268px, 23vw, 300px) + 20px);
  right: auto;
  bottom: 0;
  transform: none;
  z-index: 40;
  width: min(var(--stage-panel-width, calc(100vw - clamp(268px, 23vw, 300px) - 40px)), calc(100vw - clamp(268px, 23vw, 300px) - 40px));
  min-width: min(430px, calc(100vw - 40px));
  max-width: calc(100vw - clamp(268px, 23vw, 300px) - 28px);
  height: var(--stage-panel-height, min(45dvh, 430px));
  min-height: 250px;
  max-height: calc(100dvh - 92px);
  border: 1px solid rgba(0, 216, 255, 0.38);
  border-radius: 8px 8px 0 0;
  background: rgba(8, 9, 10, 0.95);
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.52);
  color: #f7f7f7;
  overflow: auto;
  resize: none;
}

.stage-note-panel header {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px 6px 14px;
  border-bottom: 1px solid #242428;
  cursor: default;
  touch-action: manipulation;
  user-select: none;
}

.stage-note-panel.collapsed {
  width: min(360px, calc(100% - 36px));
  height: auto;
  min-height: 0;
  resize: none;
}

.stage-note-panel header strong {
  color: #00d8ff;
  font-size: 1rem;
}

.stage-panel-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stage-measure-jump {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 3px 8px;
  border: 1px solid rgba(0, 216, 255, 0.42);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(0, 216, 255, 0.16), rgba(0, 216, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 18px rgba(0, 216, 255, 0.1);
  color: #f7ffff;
  cursor: text;
}

.stage-measure-jump span {
  color: #00d8ff;
  font-size: 0.82rem;
  font-weight: 900;
}

.stage-measure-jump input {
  width: 42px;
  height: 26px;
  border: 1px solid rgba(0, 216, 255, 0.32);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-weight: 950;
  text-align: center;
  outline: 0;
}

.stage-measure-jump input:focus {
  border-color: rgba(0, 216, 255, 0.82);
  box-shadow: 0 0 0 3px rgba(0, 216, 255, 0.14);
}

.stage-measure-jump em {
  color: #99a4aa;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.stage-panel-title svg {
  width: 18px;
  height: 18px;
  color: #6d7178;
}

.stage-note-panel header .ireal-tool {
  min-width: 34px;
  min-height: 34px;
}

.stage-note-panel header .ireal-tool svg {
  width: 22px;
  height: 22px;
}

.stage-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stage-collapsed-body {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 12px 12px;
  color: #8f9098;
}

.stage-collapsed-body b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f7f7f7;
  font-size: 1.08rem;
}

.stage-tool-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 0;
}

.stage-tool-switch button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #33343a;
  border-radius: 8px;
  background: #15161a;
  color: #aeb1b8;
  font-weight: 800;
  padding: 0 12px;
  cursor: pointer;
}

.stage-tool-switch button.active {
  border-color: rgba(0, 216, 255, 0.64);
  background: rgba(0, 216, 255, 0.14);
  color: #f7f7f7;
}

.stage-tool-switch svg {
  width: 17px;
  height: 17px;
}

.stage-note-fields {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 110px;
  gap: 10px;
  padding: 12px;
}

.stage-note-fields label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.stage-note-fields label.wide {
  grid-column: span 2;
}

.stage-note-fields span {
  color: #8f9098;
  font-size: 0.74rem;
}

.stage-note-fields input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #33343a;
  border-radius: 7px;
  background: #15161a;
  color: #f7f7f7;
  outline: 0;
  padding: 0 10px;
}

.stage-note-fields input:focus {
  border-color: #00d8ff;
  box-shadow: 0 0 0 3px rgba(0, 216, 255, 0.13);
}

.stage-chord-tool {
  padding: 0 12px 12px;
}

.stage-chord-entry {
  grid-template-columns: minmax(70px, 96px) minmax(130px, 1fr) 36px 36px 42px 66px 66px 74px;
  margin-bottom: 8px;
}

.stage-chord-tool .keyboard-row {
  grid-template-columns: 72px minmax(0, 1fr);
  padding: 5px 6px;
}

.stage-chord-tool .keyboard-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 5px;
}

.stage-chord-tool .keyboard-grid.compact button {
  min-height: 30px;
  border-radius: 6px;
  font-size: 0.78rem;
}

.stage-chord-tool .keyboard-grid button.detail-key {
  border-color: rgba(255, 94, 90, 0.58);
  background:
    linear-gradient(180deg, rgba(107, 35, 39, 0.98), rgba(63, 21, 25, 0.98)),
    #441519;
  color: #ffe5e2;
  text-shadow: 0 0 9px rgba(255, 68, 62, 0.28), 0 1px 0 #000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11), 0 7px 14px rgba(0, 0, 0, 0.18);
}

.stage-chord-tool .keyboard-grid button.detail-key.active {
  border-color: #00d8ff;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 216, 255, 0.34), transparent 52%),
    linear-gradient(180deg, rgba(111, 35, 42, 0.98), rgba(51, 19, 24, 0.98));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 216, 255, 0.24), 0 0 18px rgba(0, 216, 255, 0.18);
}

.stage-note-shortcuts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 12px;
}

.notation-shortcut {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0, 216, 255, 0.38);
  border-radius: 8px;
  background: rgba(0, 216, 255, 0.12);
  color: #f7f7f7;
  font-weight: 800;
  padding: 0 13px;
  cursor: pointer;
}

.notation-shortcut svg {
  width: 18px;
  height: 18px;
}

.notation-status {
  color: #8f9098;
  font-size: 0.8rem;
}

.stage-note-chips {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.stage-note-chips > strong {
  color: #00d8ff;
  font-size: 0.96rem;
}

.notation-tool-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.notation-tool-row > span {
  width: 54px;
  color: #8f9098;
  font-size: 0.76rem;
}

.stage-note-chips button {
  min-height: 32px;
  border: 1px solid #33343a;
  border-radius: 7px;
  background: #15161a;
  color: #00d8ff;
  padding: 0 10px;
  cursor: pointer;
}

.stage-note-chips button:hover {
  border-color: rgba(0, 216, 255, 0.52);
  background: rgba(0, 216, 255, 0.08);
}

.stage-note-chips button.active {
  border-color: rgba(0, 216, 255, 0.72);
  background: rgba(0, 216, 255, 0.18);
  color: #f7f7f7;
}

.clef-symbol {
  display: inline-block;
  min-width: 18px;
  margin-right: 5px;
  font-family: "Bravura", "Noto Music", "Apple Symbols", serif;
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 400;
  text-rendering: geometricPrecision;
}

.ink-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ink-actions button.icon-only {
  width: 34px;
  min-width: 34px;
  padding: 0;
  justify-content: center;
}

.ink-actions button.clean-score-btn {
  border-color: rgba(0, 216, 255, 0.42);
  background: rgba(0, 216, 255, 0.12);
  color: #f7f7f7;
  min-height: 28px;
  padding: 0 7px;
  font-size: 0.74rem;
  font-weight: 800;
}

.ink-actions button.clean-score-btn.danger {
  border-color: rgba(255, 90, 84, 0.54);
  background: rgba(177, 41, 39, 0.16);
  color: #ffefee;
}

.ink-actions button.clean-score-btn.danger:hover {
  border-color: rgba(0, 216, 255, 0.5);
  background: rgba(0, 216, 255, 0.08);
  color: #f7f7f7;
}

.detail-actions button {
  min-height: 30px;
  border-color: rgba(177, 41, 39, 0.52);
  color: #ffdedc;
  background: rgba(177, 41, 39, 0.12);
  font-weight: 800;
}

.detail-actions button:hover {
  border-color: rgba(0, 216, 255, 0.42);
  background: rgba(0, 216, 255, 0.08);
  color: #f7f7f7;
}

.section-tag-actions button {
  min-width: 39px;
  border-color: rgba(177, 41, 39, 0.6);
  background: rgba(251, 250, 244, 0.04);
  color: #ffefee;
  letter-spacing: 0;
}

.section-tag-actions button:hover {
  border-color: rgba(0, 216, 255, 0.42);
  background: rgba(0, 216, 255, 0.08);
  color: #f7f7f7;
}

.section-tag-actions button.active,
.detail-actions button.active {
  border-color: #ff5a54;
  background: rgba(177, 41, 39, 0.28);
  color: #fff;
}

.ink-actions svg {
  width: 16px;
  height: 16px;
}

.stage-staff-pad {
  padding: 0 12px 12px;
}

.stage-staff-title {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #8f9098;
  font-size: 0.82rem;
}

.stage-staff-title span,
.stage-staff-title button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.stage-staff-title svg {
  width: 17px;
  height: 17px;
}

.stage-staff-title button {
  min-height: 30px;
  border: 1px solid #33343a;
  border-radius: 7px;
  background: #15161a;
  color: #00d8ff;
  padding: 0 10px;
  cursor: pointer;
}

.stage-staff-surface {
  --stage-clef-left: clamp(34px, 4vw, 72px);
  --stage-clef-size: 4.75rem;
  position: relative;
  height: 170px;
  overflow: hidden;
  border: 1px solid #33343a;
  border-radius: 8px;
  background: #fbfaf4;
  container-type: size;
}

.stage-clef {
  position: absolute;
  left: var(--stage-clef-left);
  top: 60%;
  transform: translateY(-50%);
  z-index: 1;
  color: #050605;
  font-family: "Bravura", "Noto Music", "Apple Symbols", serif;
  font-size: var(--stage-clef-size);
  font-weight: 400;
  line-height: 1;
  text-rendering: geometricPrecision;
  pointer-events: none;
}

.stage-staff-surface[data-clef="bass"] {
  --stage-clef-size: 3.5rem;
}

.stage-staff-surface[data-clef="bass"] .stage-clef {
  top: 40%;
}

.stage-staff-surface[data-clef="alto"] {
  --stage-clef-size: 4.25rem;
}

.stage-staff-surface[data-clef="alto"] .stage-clef {
  top: 50%;
}

/* v228 globally scaled professional clefs.
   Each clef follows the real staff height, so the enlarged Pencil canvas keeps
   concert-score proportions in portrait, landscape and desktop layouts. */
.stage-note-panel.notation-expanded .stage-staff-surface[data-clef="treble"] {
  --stage-clef-size: clamp(10rem, 26dvh, 14.5rem);
}

.stage-note-panel.notation-expanded .stage-staff-surface[data-clef="bass"] {
  --stage-clef-size: clamp(7rem, 18dvh, 10.5rem);
}

.stage-note-panel.notation-expanded .stage-staff-surface[data-clef="alto"] {
  --stage-clef-size: clamp(8rem, 22dvh, 12.5rem);
}

@supports (font-size: 1cqh) {
  .stage-staff-surface {
    --stage-clef-left: clamp(34px, 5cqw, 84px);
  }

  .stage-staff-surface[data-clef="treble"] {
    --stage-clef-size: clamp(4.75rem, 30cqh, 14.5rem);
  }

  .stage-staff-surface[data-clef="bass"] {
    --stage-clef-size: clamp(3.5rem, 21cqh, 10.5rem);
  }

  .stage-staff-surface[data-clef="alto"] {
    --stage-clef-size: clamp(4.25rem, 25cqh, 12.5rem);
  }
}

.stage-line {
  position: absolute;
  left: 24px;
  right: 24px;
  height: 2px;
  background: #050605;
  opacity: 0.9;
  pointer-events: none;
}

.stage-line.l1 { top: 30%; }
.stage-line.l2 { top: 40%; }
.stage-line.l3 { top: 50%; }
.stage-line.l4 { top: 60%; }
.stage-line.l5 { top: 70%; }

.stage-ink-canvas {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  touch-action: none;
  cursor: crosshair;
}

.ireal-player {
  min-height: 54px;
  display: grid;
  grid-template-rows: auto;
  background: #000;
  border-top: 1px solid #070707;
}

.ireal-song-stats {
  min-height: 54px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  color: #00d8ff;
  text-align: center;
  font-size: 1.15rem;
}

.ireal-song-stats span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 10px;
}

.ireal-play {
  width: 82px;
  height: 82px;
  display: inline-grid;
  place-items: center;
}

.ireal-play svg {
  width: 66px;
  height: 66px;
  fill: currentColor;
}

.paper-title-button,
.paper-meta-button,
.inline-title-edit,
.inline-meta-edit {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.paper-title-button:hover,
.paper-meta-button:hover,
.inline-title-edit:hover,
.inline-meta-edit:hover {
  color: #008c82;
}

.chart-paper-meta .paper-meta-button {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.song-meta-editor {
  border: 1px solid rgba(31, 182, 166, 0.28);
  border-radius: 8px;
  background: rgba(7, 9, 10, 0.94);
  padding: 14px;
  margin: 0 0 14px;
}

.song-meta-editor header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.song-meta-editor header strong {
  color: #f4f7f7;
  font-size: 1.08rem;
}

.song-meta-editor header button {
  width: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #333939;
  border-radius: 8px;
  background: #121516;
  color: #00d8ff;
  cursor: pointer;
}

.song-meta-editor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.song-meta-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.browser-toolbar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-transpose-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(0, 216, 255, 0.34);
  border-radius: 999px;
  background: rgba(0, 216, 255, 0.08);
  padding: 3px;
}

.transpose-step {
  min-width: 34px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #00d8ff;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
}

.transpose-step:hover {
  background: rgba(0, 216, 255, 0.14);
}

.transpose-accidental {
  min-width: 34px;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #9fb3b9;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.transpose-accidental:hover,
.transpose-accidental.active {
  border-color: rgba(0, 216, 255, 0.72);
  background: #00d8ff;
  color: #041014;
  box-shadow: 0 0 16px rgba(0, 216, 255, 0.2);
}

.transpose-key-label {
  min-width: 82px;
  color: #eefcff;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 850;
}

.chart-sign-symbol {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.15rem;
  font-weight: 700;
}

.chart-text-sign {
  color: #111;
  font-size: 1.12rem;
  font-weight: 950;
  letter-spacing: 0;
}

.single-bar {
  letter-spacing: 0;
}

.chart-measure.notation-only {
  min-height: 118px;
  align-items: flex-start;
  padding-top: 8px;
  padding-bottom: 10px;
}

.stage-paper .chart-measure.notation-only {
  min-height: 134px;
}

.chart-measure.notation-only .sheet-chords {
  min-height: 0;
}

.chart-measure.notation-only .measure-notation-staff {
  left: 10px;
  right: 8px;
  top: 28px;
  bottom: 10px;
  height: auto;
  min-height: 74px;
  background: rgba(251, 250, 244, 0.96);
}

.stage-paper .chart-measure.notation-only .measure-notation-staff {
  top: 30px;
  bottom: 10px;
  min-height: 88px;
}

.chart-measure.notation-with-chords {
  align-items: flex-start;
  padding-top: 8px;
  padding-bottom: 58px;
}

.chart-measure.notation-with-chords.has-details {
  min-height: 132px;
  padding-top: 9px;
  padding-bottom: 66px;
}

.chart-measure.notation-with-chords .sheet-chords {
  position: relative;
  z-index: 3;
  align-self: flex-start;
  gap: 7px;
  padding-right: 10px;
}

.chart-measure.notation-with-chords .chord-root {
  font-size: 2rem;
}

.chart-measure.notation-with-chords .chord-quality,
.chart-measure.notation-with-chords .chord-bass {
  font-size: 0.78rem;
}

.chart-measure.notation-with-chords .measure-notation-staff {
  left: 10px;
  right: 8px;
  bottom: 8px;
  height: 50px;
  min-height: 50px;
  background: rgba(251, 250, 244, 0.92);
}

.chart-measure.notation-with-chords.has-details .sheet-details {
  left: 14px;
  right: 12px;
  top: 48px;
  bottom: auto;
  z-index: 6;
  max-height: 18px;
  align-items: center;
  overflow: hidden;
}

.chart-measure.notation-with-chords.has-details .sheet-detail-badge {
  background: rgba(251, 250, 244, 0.98);
  font-size: 0.55rem;
}

.chart-measure.notation-with-chords.has-details .measure-notation-staff {
  bottom: 8px;
  height: 50px;
  min-height: 50px;
}

.chart-measure.notation-with-chords.chord-density-tight .sheet-chords {
  gap: 5px;
}

.chart-measure.notation-with-chords.chord-density-dense .sheet-chords,
.chart-measure.notation-with-chords.chord-density-packed .sheet-chords {
  gap: 4px;
}

.chart-measure.notation-with-chords.chord-density-tight .chord-root {
  font-size: 1.7rem;
}

.chart-measure.notation-with-chords.chord-density-dense .chord-root {
  font-size: 1.48rem;
}

.chart-measure.notation-with-chords.chord-density-packed .chord-root {
  font-size: 1.28rem;
}

.chart-measure.notation-with-chords.chord-density-tight .chord-quality,
.chart-measure.notation-with-chords.chord-density-tight .chord-bass,
.chart-measure.notation-with-chords.chord-density-dense .chord-quality,
.chart-measure.notation-with-chords.chord-density-dense .chord-bass,
.chart-measure.notation-with-chords.chord-density-packed .chord-quality,
.chart-measure.notation-with-chords.chord-density-packed .chord-bass {
  font-size: 0.66rem;
}

.stage-paper .chart-measure.notation-with-chords {
  padding-bottom: 62px;
}

.stage-paper .chart-measure.notation-with-chords.has-details {
  min-height: 146px;
  padding-bottom: 70px;
}

.stage-paper .chart-measure.has-notation .sheet-chords,
.stage-paper .chart-measure.chord-density-tight.has-notation .sheet-chords,
.stage-paper .chart-measure.chord-density-dense.has-notation .sheet-chords,
.stage-paper .chart-measure.chord-density-packed.has-notation .sheet-chords {
  transform: none;
  width: 100%;
  max-width: 100%;
}

.stage-paper .chart-measure.notation-with-chords .chord-root,
.stage-paper .chart-measure.chord-density-tight.has-notation .chord-root,
.stage-paper .chart-measure.chord-density-dense.has-notation .chord-root,
.stage-paper .chart-measure.chord-density-packed.has-notation .chord-root {
  font-size: 2.05rem;
}

.stage-paper .chart-measure.notation-with-chords.chord-density-tight .chord-root {
  font-size: 1.82rem;
}

.stage-paper .chart-measure.notation-with-chords.chord-density-dense .chord-root {
  font-size: 1.58rem;
}

.stage-paper .chart-measure.notation-with-chords.chord-density-packed .chord-root {
  font-size: 1.38rem;
}

.stage-paper .chart-measure.notation-with-chords .chord-quality,
.stage-paper .chart-measure.notation-with-chords .chord-bass {
  font-size: 0.78rem;
}

.measure-notation-staff.clean-active {
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(5, 6, 5, 0.04);
}

.measure-notation-staff.clean-active .staff-line {
  left: 34px;
  right: 6px;
  height: 1.5px;
  background: rgba(5, 6, 5, 0.96);
}

.chart-measure.notation-only .measure-notation-staff.clean-active .staff-line {
  left: 42px;
  height: 2px;
}

.measure-notation-staff.clean-active .mini-clef {
  left: 6px;
  color: #050605;
  font-size: 2.35rem;
}

.chart-measure.notation-only .measure-notation-staff.clean-active .mini-clef {
  left: 7px;
  font-size: 3.05rem;
}

.measure-notation-staff.clean-active .engraved-notation {
  left: 38px;
  right: 8px;
  filter: contrast(1.1);
}

.chart-measure.notation-only .measure-notation-staff.clean-active .engraved-notation {
  left: 48px;
  right: 9px;
}

.measure-notation-staff.clean-active .engraved-note {
  width: 21px;
  height: 21px;
  transform: translate(-50%, -50%) scale(1.06);
}

.chart-measure.notation-only .measure-notation-staff.clean-active .engraved-note {
  transform: translate(-50%, -50%) scale(1.32);
}

.measure-notation-staff.clean-active .engraved-head {
  width: 18px;
  height: 12px;
  border-width: 2.4px;
}

.measure-notation-staff.clean-active .engraved-stem {
  width: 2.4px;
  height: 34px;
}

.chart-measure.notation-only .measure-notation-staff.clean-active .engraved-stem {
  height: 39px;
}

.measure-notation-staff.clean-active .engraved-accidental {
  left: -16px;
  font-size: 1.08rem;
}

.measure-notation-staff.ink-active .staff-line {
  height: 1.4px;
  background: rgba(5, 6, 5, 0.96);
}

.chart-measure.notation-only .measure-notation-staff.ink-active .staff-line {
  height: 2px;
}

.sheet-detail-badge {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.setlist-sort-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(31, 182, 166, 0.24);
  border-radius: 8px;
  background: rgba(31, 182, 166, 0.06);
  padding: 8px;
  margin: 10px 0;
}

.setlist-sort-strip strong {
  display: block;
  color: #f5f5f7;
  font-size: 0.94rem;
  line-height: 1.2;
}

.setlist-sort-strip span {
  color: #a7aaa4;
  font-size: 0.82rem;
}

.setlist-sort-strip small {
  color: #8f949b;
  font-size: 0.76rem;
}

.setlist-sort-strip.active {
  border-color: rgba(0, 216, 255, 0.42);
  background: rgba(0, 216, 255, 0.08);
}

.setlist-song-row.sortable {
  cursor: grab;
}

.setlist-song-row.dragging {
  opacity: 0.48;
}

.queue-drag-handle {
  display: inline-grid;
  place-items: center;
  color: #00d8ff;
}

.queue-drag-handle svg {
  width: 20px;
  height: 20px;
}

.metronome-prep-shell {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 20px;
  overflow: hidden;
}

.metronome-standalone .topbar {
  background:
    radial-gradient(circle at 18% -120%, rgba(0, 229, 255, 0.11), transparent 45%),
    rgba(3, 7, 9, 0.95);
}

.metronome-standalone .tab-button {
  min-height: 42px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.metronome-standalone .tab-button:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 229, 255, 0.55);
  background: rgba(0, 229, 255, 0.09);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.12);
  color: #f6feff;
}

.metronome-standalone .tab-button.active {
  border-color: rgba(0, 229, 255, 0.72);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.22), rgba(0, 229, 255, 0.07));
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.12), 0 0 24px rgba(0, 229, 255, 0.15);
}

.metronome-prep-rail {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 0;
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(0, 229, 255, 0.08), rgba(0, 0, 0, 0.2)),
    rgba(3, 7, 9, 0.9);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
  overflow: hidden;
}

.metronome-prep-rail button {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #f5f8fa;
  font: inherit;
  cursor: pointer;
}

.prep-rail-brand {
  min-height: 138px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 18px 10px;
  color: #00e5ff;
  text-align: center;
  font-weight: 900;
}

.prep-rail-brand svg {
  width: 46px;
  height: 46px;
  color: #00e5ff;
  filter: drop-shadow(0 0 16px rgba(0, 229, 255, 0.32));
}

.prep-rail-brand span {
  color: #00e5ff;
  line-height: 1.25;
}

.metronome-prep-rail nav,
.prep-rail-bottom {
  display: grid;
  gap: 7px;
  padding: 0 8px;
}

.prep-rail-bottom {
  align-self: end;
  padding-bottom: 10px;
}

.metronome-prep-rail nav button,
.prep-rail-bottom button {
  min-height: 66px;
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 10px 6px;
  border-radius: 8px;
  color: #d9e1e5;
  font-weight: 850;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.prep-rail-bottom .stage-settings-link {
  min-height: 46px;
  grid-template-columns: auto 1fr;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.prep-rail-bottom .stage-settings-link svg {
  width: 20px;
  height: 20px;
}

.metronome-prep-rail nav button svg,
.prep-rail-bottom button svg {
  width: 25px;
  height: 25px;
  color: currentColor;
}

.metronome-prep-rail nav button.active,
.prep-rail-brand.active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.18), rgba(0, 229, 255, 0.045));
  color: #00e5ff;
  box-shadow: inset 3px 0 0 #00e5ff, 0 0 24px rgba(0, 229, 255, 0.09);
}

.prep-rail-brand,
.metronome-prep-rail nav button,
.prep-rail-bottom button {
  position: relative;
}

.prep-rail-brand::before,
.metronome-prep-rail nav button::before,
.prep-rail-bottom button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.prep-rail-brand:hover,
.metronome-prep-rail nav button:hover,
.prep-rail-bottom button:hover {
  transform: translateY(-1px);
  color: #f4fdff;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.14), rgba(0, 229, 255, 0.035));
}

.prep-rail-brand:hover::before,
.metronome-prep-rail nav button:hover::before,
.prep-rail-bottom button:hover::before {
  border-color: rgba(0, 229, 255, 0.44);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.08), 0 0 20px rgba(0, 229, 255, 0.1);
}

.metronome-prep-main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.metronome-prep-hero {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.metronome-prep-hero h2 {
  margin: 0 0 6px;
  color: #f7fbff;
  font-size: clamp(1.55rem, 2.3vw, 2.05rem);
  line-height: 1;
  letter-spacing: 0;
}

.metronome-prep-hero h2 span {
  color: #00e5ff;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.32);
}

.metronome-prep-hero p {
  margin: 0;
  color: #c2c7cc;
  font-weight: 650;
}

.metro-prep-card {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 229, 255, 0.08), transparent 30%),
    rgba(5, 8, 10, 0.84);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
  overflow: visible;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.metro-prep-card:hover {
  border-color: rgba(0, 229, 255, 0.2);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.32), 0 0 28px rgba(0, 229, 255, 0.055);
}

.quick-song-card {
  padding: 20px 22px 18px;
  margin-bottom: 14px;
}

.prep-card-title,
.stage-song-table-top,
.quick-setlist-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.prep-card-title {
  margin-bottom: 18px;
}

.prep-card-title h3,
.stage-song-table-top h3,
.quick-setlist-card h3 {
  margin: 0;
  color: #f7fbff;
  font-size: 1.08rem;
  font-weight: 950;
  letter-spacing: 0.02em;
}

.prep-card-title span {
  min-height: 18px;
  color: #00e5ff;
  font-weight: 850;
}

.quick-song-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.82fr);
  align-items: stretch;
  gap: 22px;
}

.quick-song-form {
  display: grid;
  grid-template-columns: minmax(190px, 1.25fr) minmax(160px, 0.92fr) minmax(120px, 0.58fr);
  align-items: end;
  gap: 18px;
}

.quick-field {
  min-width: 0;
  display: grid;
  gap: 8px;
  color: #f4f8fa;
  font-weight: 800;
}

.quick-field.title-field {
  grid-column: span 1;
}

.quick-field.count-field {
  grid-column: span 1;
}

.quick-field span {
  color: #d9e1e5;
  font-size: 0.9rem;
  line-height: 1;
}

.quick-field input,
.quick-field select,
.stage-song-search input,
.stage-song-sort select {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.34);
  color: #f7fbff;
  padding: 0 12px;
  font: inherit;
  font-weight: 750;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.quick-field select,
.stage-song-sort select {
  background-color: #05090b;
  color: #f8feff;
  color-scheme: dark;
}

.quick-field select option,
.stage-song-sort select option {
  background: #071014;
  color: #f8feff;
}

.quick-field select option:checked,
.stage-song-sort select option:checked {
  background: #063a42;
  color: #ffffff;
}

.quick-choice-field {
  position: relative;
  z-index: 4;
}

.quick-choice-field.open {
  z-index: 24;
}

.quick-choice-trigger {
  width: 100%;
  min-width: 0;
  height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(0, 216, 255, 0.07), rgba(0, 0, 0, 0.36)),
    rgba(0, 0, 0, 0.34);
  color: #f7fbff;
  padding: 0 12px;
  font: inherit;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.quick-choice-trigger strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-choice-trigger svg {
  width: 18px;
  height: 18px;
  color: #00e5ff;
  transition: transform 180ms ease;
}

.quick-choice-field.open .quick-choice-trigger {
  border-color: rgba(0, 229, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12), 0 14px 34px rgba(0, 0, 0, 0.32);
}

.quick-choice-field.open .quick-choice-trigger svg {
  transform: rotate(180deg);
}

.quick-choice-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  gap: 4px;
  max-height: 218px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 10px;
  background:
    radial-gradient(circle at 22% 0%, rgba(0, 229, 255, 0.14), transparent 36%),
    linear-gradient(145deg, rgba(18, 25, 26, 0.98), rgba(5, 7, 8, 0.98));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.045);
}

.quick-choice-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(246, 252, 255, 0.82);
  padding: 0 10px;
  font: inherit;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.quick-choice-menu button:hover,
.quick-choice-menu button.active {
  background: rgba(0, 229, 255, 0.14);
  color: #eaffff;
  box-shadow: inset 3px 0 0 #00e5ff;
}

.quick-input-icon {
  position: relative;
  display: block;
}

.quick-input-icon svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #9fefff;
  pointer-events: none;
}

.quick-input-icon input {
  padding-left: 42px;
}

.quick-field input:focus,
.quick-field select:focus,
.stage-song-search input:focus,
.stage-song-sort select:focus {
  border-color: rgba(0, 229, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
}

.quick-field .stage-time-signature-input:invalid {
  border-color: rgba(255, 99, 99, 0.72);
  box-shadow: 0 0 0 3px rgba(255, 99, 99, 0.1);
}

.quick-field:hover input,
.quick-field:hover select,
.quick-choice-field:hover .quick-choice-trigger,
.stage-song-search:hover input,
.stage-song-sort:hover select {
  border-color: rgba(0, 229, 255, 0.38);
  background: rgba(0, 229, 255, 0.045);
}

.quick-bpm-control {
  display: grid;
  grid-template-columns: 40px minmax(58px, 1fr) 40px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.34);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.quick-bpm-control:hover {
  border-color: rgba(0, 229, 255, 0.46);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.08);
}

.quick-bpm-control input {
  height: 42px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: transparent;
  color: #00e5ff;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 950;
  box-shadow: none;
}

.quick-bpm-control button,
.tap-tempo-btn,
.create-stage-song-btn,
.stage-prep-ghost-btn,
.stage-table-filter,
.stage-danger-btn {
  min-height: 44px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.08);
  color: #efffff;
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.quick-bpm-control button {
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.045);
  font-size: 1.25rem;
}

.stage-bpm-tap-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(96px, 0.72fr) minmax(128px, 1fr);
  align-items: end;
  gap: 10px;
}

.stage-manual-bpm {
  min-width: 0;
  display: grid;
  gap: 8px;
  color: #d9e1e5;
  font-weight: 850;
}

.stage-manual-bpm span {
  font-size: 0.9rem;
}

.stage-manual-bpm input {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.34);
  color: #00e5ff;
  padding: 0 12px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 950;
  text-align: center;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.stage-manual-bpm input:hover,
.stage-manual-bpm input:focus {
  border-color: rgba(0, 229, 255, 0.72);
  background: rgba(0, 229, 255, 0.06);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.1);
}

.tap-tempo-btn,
.stage-prep-ghost-btn,
.create-stage-song-btn,
.stage-table-filter,
.stage-danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
}

.tap-tempo-btn svg,
.stage-prep-ghost-btn svg,
.create-stage-song-btn svg,
.stage-table-filter svg,
.stage-danger-btn svg {
  width: 19px;
  height: 19px;
}

.create-stage-song-btn {
  min-width: 158px;
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.48), rgba(0, 132, 156, 0.32)),
    rgba(0, 229, 255, 0.14);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.18);
}

.stage-prep-ghost-btn {
  background: rgba(0, 0, 0, 0.18);
}

.tap-tempo-btn:hover,
.stage-prep-ghost-btn:hover,
.create-stage-song-btn:hover,
.stage-table-filter:hover,
.stage-preview-play:hover,
.stage-row-play:hover,
.stage-song-actions > button:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 229, 255, 0.72);
  background: rgba(0, 229, 255, 0.14);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.16);
}

.stage-preview-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 142px 90px minmax(120px, 1fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 16px 20px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(0, 229, 255, 0.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 22% 12%, rgba(0, 229, 255, 0.16), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.18));
}

.stage-preview-dial {
  width: 134px;
  height: 134px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(6, 11, 13, 0.96) 0 50%, transparent 51%),
    conic-gradient(from -90deg, #00e5ff var(--dial-deg), rgba(255, 255, 255, 0.11) 0);
  box-shadow: inset 0 0 0 8px rgba(0, 0, 0, 0.34), 0 0 30px rgba(0, 229, 255, 0.18);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.stage-preview-dial:active {
  cursor: grabbing;
  transform: scale(1.015);
}

.stage-preview-card.playing .stage-preview-dial {
  background:
    radial-gradient(circle at center, rgba(6, 15, 11, 0.96) 0 50%, transparent 51%),
    conic-gradient(from -90deg, #29ff84 var(--dial-deg), rgba(255, 255, 255, 0.12) 0);
  box-shadow: inset 0 0 0 8px rgba(0, 0, 0, 0.34), 0 0 34px rgba(41, 255, 132, 0.24);
}

.stage-preview-dial > div {
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
}

.stage-preview-dial strong {
  color: #fff;
  font-size: 2.32rem;
  line-height: 1;
}

.stage-preview-dial span {
  color: #00e5ff;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.stage-preview-play {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.16), transparent 24%),
    radial-gradient(circle at center, rgba(0, 229, 255, 0.34), rgba(0, 77, 88, 0.5) 48%, rgba(4, 8, 10, 0.78) 62%),
    conic-gradient(from 220deg, #008aa0, #00e5ff, #74fff0, #00a8c6, #008aa0);
  color: #fff;
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.24), inset 0 0 0 3px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.stage-preview-play svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.stage-preview-play.playing {
  border-color: rgba(41, 255, 132, 0.9);
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.18), transparent 24%),
    radial-gradient(circle at center, rgba(41, 255, 132, 0.34), rgba(0, 117, 86, 0.42) 48%, rgba(4, 8, 10, 0.76) 62%),
    conic-gradient(from 220deg, #0c8f84, #26ffcc, #67ff9d, #00e5ff, #0c8f84);
  box-shadow: 0 0 40px rgba(41, 255, 132, 0.26), inset 0 0 0 3px rgba(0, 0, 0, 0.24);
}

.stage-preview-play:hover {
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.2), transparent 24%),
    radial-gradient(circle at center, rgba(0, 229, 255, 0.4), rgba(0, 86, 98, 0.52) 48%, rgba(4, 8, 10, 0.74) 62%),
    conic-gradient(from 220deg, #008aa0, #00e5ff, #9bfff4, #00bfd8, #008aa0);
}

.stage-preview-play.playing:hover {
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.2), transparent 24%),
    radial-gradient(circle at center, rgba(41, 255, 132, 0.4), rgba(0, 117, 86, 0.48) 48%, rgba(4, 8, 10, 0.72) 62%),
    conic-gradient(from 220deg, #0c8f84, #26ffcc, #7bffa6, #00e5ff, #0c8f84);
}

.stage-preview-status {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.stage-preview-status b {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #00e5ff;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.stage-preview-status b span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: none;
}

.stage-preview-card.playing .stage-preview-status b span {
  background: #00e676;
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.72);
}

.stage-preview-status small,
.stage-preview-status em {
  color: #c8d1d6;
  font-style: normal;
  font-weight: 700;
}

.stage-preview-sound-dots {
  display: inline-grid;
  grid-template-columns: repeat(5, 18px);
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.stage-preview-sound-dots button {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 32%, rgba(255, 255, 255, 0.9), transparent 0 18%, var(--sound-color) 22% 58%, rgba(0, 0, 0, 0.56) 100%);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2), 0 0 14px color-mix(in srgb, var(--sound-color) 44%, transparent);
  cursor: pointer;
  opacity: 0.76;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.stage-preview-sound-dots button:hover,
.stage-preview-sound-dots button.active {
  border-color: color-mix(in srgb, var(--sound-color) 82%, white);
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.3),
    0 0 0 5px color-mix(in srgb, var(--sound-color) 18%, transparent),
    0 0 18px color-mix(in srgb, var(--sound-color) 72%, transparent);
  opacity: 1;
  transform: translateY(-1px) scale(1.08);
}

.stage-preview-volume {
  width: min(150px, 100%);
  min-width: 0;
  display: grid;
  grid-template-columns: 16px minmax(58px, 1fr) 26px;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
}

.stage-preview-volume svg {
  width: 15px;
  height: 15px;
  color: #9fefff;
}

.stage-preview-volume input {
  width: 100%;
  accent-color: #00e5ff;
}

.stage-preview-volume strong {
  color: #dffbff;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: right;
}

.stage-beat-bars {
  min-height: 36px;
  display: flex;
  align-items: end;
  gap: 8px;
}

.stage-beat-bars span {
  width: 7px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: height 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.stage-beat-bars span.strong {
  height: 32px;
}

.stage-beat-bars span.active {
  height: 36px;
  background: #00e5ff;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.66);
}

.stage-create-main {
  grid-column: 1 / -1;
  width: 100%;
}

.stage-song-table-card {
  margin-bottom: 14px;
  overflow: visible;
}

.stage-song-table-top {
  min-height: 64px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stage-song-search {
  min-width: 220px;
  max-width: 380px;
  flex: 1 1 280px;
  position: relative;
  display: block;
}

.stage-song-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #aeb8be;
  pointer-events: none;
}

.stage-song-search input {
  padding-left: 38px;
}

.stage-song-count {
  color: #aeb6bc;
  font-weight: 850;
  white-space: nowrap;
}

.stage-song-sort {
  min-width: 210px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #aeb6bc;
  font-weight: 800;
}

.stage-song-table {
  min-width: 0;
  overflow: visible;
}

.stage-song-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(230px, 1.55fr) minmax(130px, 1fr) 70px 70px 76px 104px 132px 52px;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  color: #edf2f5;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.stage-song-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-song-header {
  min-height: 48px;
  color: #00e5ff;
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.018);
}

.stage-song-row:not(.stage-song-header)::before {
  content: "";
  position: absolute;
  inset: 5px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  pointer-events: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.stage-song-row:not(.stage-song-header):hover {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.11), rgba(0, 229, 255, 0.025) 56%, transparent);
  transform: translateY(-1px);
}

.stage-song-row:not(.stage-song-header):hover::before,
.stage-song-row.selected::before,
.stage-song-row.previewing::before {
  border-color: rgba(0, 229, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.08), 0 0 26px rgba(0, 229, 255, 0.12);
}

.stage-song-row.selected {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.12), rgba(0, 229, 255, 0.04) 54%, transparent);
}

.stage-song-title-cell strong {
  color: #fff;
  font-weight: 900;
}

.stage-song-title-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stage-row-play {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: #dce6eb;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.stage-row-play svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.stage-song-row:hover .stage-row-play,
.stage-row-play.playing {
  border-color: rgba(0, 229, 255, 0.72);
  background: rgba(0, 229, 255, 0.12);
  color: #f8ffff;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.18);
}

.stage-song-row > .stage-song-actions {
  position: relative;
  justify-self: end;
  overflow: visible;
}

.stage-song-actions > button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #f6fbff;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.stage-song-actions > button.active {
  border-color: rgba(0, 229, 255, 0.58);
  background: rgba(0, 229, 255, 0.11);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.16);
}

.stage-song-actions > button svg {
  width: 22px;
  height: 22px;
}

.stage-song-inline-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: -2px 10px 8px 52px;
  padding: 8px;
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 10px;
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 229, 255, 0.18), transparent 46%),
    linear-gradient(180deg, rgba(10, 18, 22, 0.98), rgba(6, 9, 12, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 26px rgba(0, 0, 0, 0.24);
}

.stage-song-inline-menu button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #f8feff;
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.stage-song-inline-menu button svg {
  width: 16px;
  height: 16px;
}

.stage-song-inline-menu button:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 229, 255, 0.58);
  background: rgba(0, 229, 255, 0.12);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.14);
}

.stage-song-inline-menu .danger-text {
  color: #ff9a93;
  border-color: rgba(255, 92, 84, 0.24);
}

.stage-song-inline-menu .danger-text:hover {
  border-color: rgba(255, 92, 84, 0.58);
  background: rgba(255, 92, 84, 0.12);
  color: #ffd8d5;
}

.stage-song-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  gap: 8px;
  color: #aeb6bc;
  text-align: center;
}

.stage-song-empty strong {
  color: #f7fbff;
  font-size: 1.2rem;
}

.stage-song-table-card footer {
  min-height: 48px;
  display: grid;
  place-items: center;
  color: #a8b0b6;
  font-weight: 750;
}

.stage-song-browser-card {
  min-height: clamp(460px, 56vh, 690px);
  margin-bottom: 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.stage-song-browser-card footer {
  min-height: 42px;
  display: grid;
  place-items: center;
  color: #a8b0b6;
  font-weight: 750;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.stage-song-browser-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(310px, 0.48fr) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.stage-song-browser-list,
.stage-song-detail-slot {
  min-width: 0;
  min-height: 0;
}

.stage-song-browser-list {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(4, 8, 10, 0.64);
  overflow: hidden;
}

.stage-song-browser-list-head {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.16);
  background:
    radial-gradient(circle at 8% 8%, rgba(0, 229, 255, 0.18), transparent 42%),
    rgba(255, 255, 255, 0.025);
}

.stage-song-browser-list-head span {
  color: #00e5ff;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stage-song-browser-list-head strong {
  color: #f7fbff;
  font-size: 1.28rem;
  line-height: 1.05;
}

.stage-song-browser-scroll {
  overflow: auto;
}

.stage-song-browser-row {
  grid-template-columns: minmax(0, 1fr) minmax(92px, 0.44fr) auto 42px;
  gap: 8px;
  min-height: 78px;
  padding: 9px 10px 9px 12px;
  cursor: pointer;
}

.stage-song-browser-row > span {
  white-space: normal;
}

.stage-song-browser-row .stage-row-play {
  width: 30px;
  height: 30px;
}

.stage-song-browser-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.stage-song-browser-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-song-browser-copy small {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.stage-song-browser-copy small span {
  max-width: 100%;
  min-width: 0;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #aeb8be;
  font-size: 0.76rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-song-browser-copy small span + span {
  color: #00e5ff;
}

.stage-song-browser-artist {
  color: #b8c0c6;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap !important;
}

.stage-song-browser-meta {
  justify-self: end;
  display: grid;
  justify-items: end;
  gap: 5px;
}

.stage-song-browser-meta b {
  color: #f3fbff;
  font-size: 0.96rem;
  white-space: nowrap;
}

.stage-song-browser-meta em {
  min-width: 42px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #e7ecef;
  font-style: normal;
  text-align: center;
}

.stage-song-detail-slot > .metronome-panel {
  height: 100%;
  min-height: 0;
}

.stage-song-empty-panel {
  min-height: 100%;
  text-align: center;
}

.stage-song-empty-panel > div {
  max-width: 540px;
}

.stage-song-empty-panel span {
  display: block;
  color: #00e5ff;
  font-size: 0.8rem;
  font-weight: 950;
  letter-spacing: 0.1em;
}

.stage-song-empty-panel strong {
  display: block;
  margin-top: 10px;
  color: #f7fbff;
  font-size: clamp(1.35rem, 2.4vw, 2.15rem);
  line-height: 1.1;
}

.stage-song-empty-panel small {
  display: block;
  margin-top: 10px;
  color: #9ea8ae;
  font-size: 0.98rem;
}

.stage-song-detail-panel .metro-panel-hero h2 {
  font-size: clamp(1.3rem, 2vw, 2.05rem);
}

.stage-song-detail-panel .tempo-dial {
  --size: clamp(148px, 15vw, 194px);
}

.stage-table-filter {
  width: 44px;
  padding: 0;
  flex: 0 0 auto;
}

.stage-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(7px);
}

.stage-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 80;
  width: min(620px, calc(100vw - 34px));
  max-height: calc(100vh - 48px);
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(0, 229, 255, 0.24);
  border-radius: 10px;
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 229, 255, 0.11), transparent 36%),
    rgba(8, 12, 14, 0.98);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.58), 0 0 34px rgba(0, 229, 255, 0.12);
  transform: translate(-50%, -50%);
  overflow: auto;
}

.stage-modal header,
.stage-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.stage-modal header span {
  display: block;
  margin-bottom: 6px;
  color: #00e5ff;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.1em;
}

.stage-modal h3 {
  margin: 0;
  color: #fff;
  font-size: 1.35rem;
}

.stage-modal header > button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
  cursor: pointer;
}

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

.stage-modal-grid .title-field {
  grid-column: 1 / -1;
}

.stage-detail-grid span {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.stage-detail-grid b {
  color: #9aa5ab;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stage-detail-grid strong {
  color: #f8fcff;
  font-size: 1.08rem;
}

.stage-delete-modal p {
  margin: 0;
  color: #d9e0e4;
  font-size: 1.04rem;
}

.stage-danger-btn {
  border-color: rgba(255, 61, 96, 0.48);
  background: rgba(255, 61, 96, 0.12);
  color: #ffd7de;
}

.stage-danger-btn:hover {
  border-color: rgba(255, 61, 96, 0.74);
  box-shadow: 0 0 24px rgba(255, 61, 96, 0.16);
}

.quick-setlist-card {
  min-height: 160px;
  padding: 24px;
}

.quick-setlist-card p {
  margin: 6px 0 0;
  color: #d0d7dc;
}

.quick-setlist-steps {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(140px, 1fr) auto minmax(140px, 1fr);
  align-items: center;
  gap: 18px;
}

.quick-setlist-steps span {
  min-width: 0;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 5px 10px;
  align-items: start;
}

.quick-setlist-steps b {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #00e5ff;
  color: #041012;
  font-weight: 950;
}

.quick-setlist-steps strong {
  color: #f7fbff;
  line-height: 1.2;
}

.quick-setlist-steps small {
  grid-column: 2;
  color: #b8c0c6;
  line-height: 1.35;
}

.quick-setlist-steps > svg {
  color: #e7eef2;
}

.quick-setlist-actions {
  display: grid;
  gap: 10px;
  min-width: 178px;
}

.metronome-stage-grid {
  width: 100%;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-columns: minmax(210px, 0.78fr) minmax(280px, 1fr) minmax(420px, 1.55fr);
  gap: 14px;
  min-height: 0;
  align-items: start;
  overflow: hidden;
}

.click-set-home-grid {
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  align-items: stretch;
}

.metronome-detail-grid {
  width: 100%;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-columns: minmax(220px, 0.58fr) minmax(0, 1.42fr);
  gap: 14px;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}

.click-set-home-grid > .click-set-list,
.metronome-detail-grid > .click-song-list {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
}

.click-set-home-preview {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
  padding: 28px;
  text-align: center;
}

.click-set-home-preview span {
  display: block;
  color: #00e5ff;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.click-set-home-preview strong {
  display: block;
  margin-top: 10px;
  color: #f7fbff;
  font-size: clamp(1.35rem, 2.6vw, 2.4rem);
  line-height: 1.1;
}

.click-set-home-preview small {
  display: block;
  max-width: 520px;
  margin-top: 10px;
  color: #9ca4aa;
  font-size: 1rem;
}

.click-song-browser-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.metronome-detail-grid .click-song-scroll {
  max-height: none;
}

.click-set-home-grid .click-set-scroll {
  max-height: none;
}

.metro-card {
  min-width: 0;
  background: rgba(5, 8, 10, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
  overflow: hidden;
}

.metro-card-head,
.metro-panel-hero,
.live-click-header,
.live-click-status,
.live-click-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metro-card-head {
  min-height: 76px;
  padding: 14px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.11), rgba(255, 255, 255, 0.025) 52%, rgba(0, 0, 0, 0.22)),
    rgba(255, 255, 255, 0.025);
}

.metro-card-head span,
.metro-panel-hero small,
.live-click-header small,
.metro-option-card > strong,
.metro-select-label span {
  display: block;
  color: #9ca4aa;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metro-card-head strong,
.metro-panel-hero h2,
.live-click-header strong {
  color: #f7fbff;
  font-weight: 900;
}

.metro-card-head strong {
  margin-top: 2px;
  display: block;
  color: #eaffff;
  font-size: 1.38rem;
  line-height: 1;
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.32);
}

.metro-last-used {
  display: block;
  margin-top: 4px;
  color: #7d878e;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.click-set-scroll,
.click-song-scroll {
  overflow: auto;
  overscroll-behavior: contain;
}

.click-set-scroll {
  max-height: calc(100vh - 250px);
}

.click-song-scroll {
  max-height: calc(100vh - 318px);
}

.click-set-row,
.click-song-row {
  appearance: none;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #f5f7f8;
  text-align: left;
  cursor: pointer;
}

.click-set-row-shell {
  position: relative;
}

.click-song-row-shell {
  position: relative;
}

.click-set-row-shell.dragging,
.click-song-row-shell.dragging {
  opacity: 0.55;
}

.click-set-row-shell .click-set-context-menu {
  right: 10px;
  top: 44px;
}

.click-song-row-shell .click-song-context-menu {
  right: 10px;
  top: 42px;
}

.click-song-drag-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #00e5ff;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.click-song-drag-hint svg {
  width: 16px;
  height: 16px;
}

.click-set-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 13px 14px 13px 10px;
}

.click-set-drag-grip {
  width: 24px;
  min-width: 24px;
  display: inline-grid;
  place-items: center;
  color: #00e5ff;
  opacity: 0.78;
}

.click-set-drag-grip svg {
  width: 18px;
  height: 18px;
}

.click-set-copy {
  min-width: 0;
}

.click-set-row b {
  display: block;
  color: #f8fbfc;
  font-size: 1.02rem;
  line-height: 1.08;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.click-set-row small,
.click-song-title small {
  display: block;
  margin-top: 3px;
  color: #9ba2a8;
  font-weight: 700;
}

.click-song-title .click-song-clean-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 5px;
  color: #9ba2a8;
  font-weight: 800;
}

.click-song-title .click-song-clean-meta span {
  max-width: 100%;
  min-width: 0;
  padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.click-song-title .click-song-clean-meta span + span {
  color: #00e5ff;
}

.click-set-row em,
.click-song-meta em {
  color: #d6dce0;
  font-style: normal;
}

.click-set-row em {
  min-width: 42px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.09);
  color: #eaffff;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.14);
}

.click-set-row.active,
.click-song-row.active {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.18), rgba(0, 229, 255, 0.04));
  box-shadow: inset 3px 0 0 #00e5ff;
}

.click-set-row.editing-row,
.click-song-row.editing-row {
  cursor: text;
}

.click-rename-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.42);
  color: #f8fbfc;
  padding: 0 10px;
  font-weight: 900;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.08);
}

.click-rename-input:focus {
  border-color: rgba(0, 229, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

.click-song-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 10px 14px 10px 8px;
}

.click-order {
  color: #9da6ad;
  font-weight: 900;
  text-align: center;
}

.click-song-drag-grip {
  display: inline-grid;
  grid-template-columns: 14px 1fr;
  align-items: center;
  gap: 2px;
  color: #9da6ad;
}

.click-song-drag-grip svg {
  width: 14px;
  height: 18px;
  color: #00e5ff;
}

.click-song-drag-grip b {
  color: inherit;
  font-size: 0.95rem;
}

.click-song-title b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.click-song-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: #e7ecef;
}

.click-song-meta em {
  min-width: 44px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  text-align: center;
}

.metro-card-actions {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.metro-card-actions.split {
  display: grid;
  gap: 8px;
}

.metro-card-actions button,
.metro-select-label select,
.metro-option-card button,
.live-click-footer button,
.tempo-actions button,
.tap-tempo {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: #f4f7f8;
  font-weight: 800;
}

.metro-card-actions button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.metro-select-label {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
}

.metro-select-label select {
  width: 100%;
  padding: 0 12px;
}

.metronome-panel {
  min-width: 0;
  padding: 18px;
  overflow: hidden;
}

.metronome-detail-grid > .metronome-panel {
  height: 100%;
  max-height: 100%;
  align-self: stretch;
  overflow: hidden;
}

.empty-metronome-panel {
  display: grid;
  place-items: center;
  min-height: 420px;
}

.metro-panel-hero {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.metro-panel-hero h2 {
  margin: 4px 0;
  font-size: clamp(1.6rem, 2.4vw, 2.55rem);
}

.metro-panel-hero p {
  margin: 0;
  color: #aeb5bb;
  font-weight: 700;
}

.live-click-cta {
  position: relative;
  isolation: isolate;
  min-height: 46px;
  min-width: 142px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(0, 229, 255, 0.74);
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(58, 250, 255, 0.22), rgba(0, 143, 171, 0.14) 48%, rgba(0, 0, 0, 0.32)),
    radial-gradient(circle at 30% 0%, rgba(255, 255, 255, 0.34), transparent 38%);
  box-shadow:
    0 13px 24px rgba(0, 0, 0, 0.44),
    0 0 24px rgba(0, 229, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -12px 22px rgba(0, 0, 0, 0.22);
  color: #eaffff;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5), 0 0 12px rgba(0, 229, 255, 0.52);
  transform: translateY(0);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.live-click-cta::before {
  content: "";
  position: absolute;
  inset: 2px 4px auto;
  height: 42%;
  border-radius: 9px 9px 5px 5px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent);
  pointer-events: none;
  z-index: -1;
}

.live-click-cta svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.65));
}

.live-click-cta.compact {
  justify-self: end;
  min-width: 126px;
  padding: 0 14px;
}

.live-click-cta.sync-live {
  min-height: 40px;
  min-width: 132px;
  padding: 0 14px;
  border-radius: 10px;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.36),
    0 0 18px rgba(0, 229, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -8px 14px rgba(0, 0, 0, 0.2);
}

.live-button {
  min-width: 154px;
}

@media (hover: hover) and (pointer: fine) {
  .live-click-cta:hover {
    border-color: #6ff7ff;
    box-shadow:
      0 17px 30px rgba(0, 0, 0, 0.5),
      0 0 34px rgba(0, 229, 255, 0.36),
      inset 0 1px 0 rgba(255, 255, 255, 0.42),
      inset 0 -12px 22px rgba(0, 0, 0, 0.18);
    transform: translateY(-2px);
  }
}

.live-click-cta:active {
  transform: translateY(1px) scale(0.99);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.46),
    0 0 18px rgba(0, 229, 255, 0.2),
    inset 0 2px 12px rgba(0, 0, 0, 0.24);
}

.metro-sync-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 10px 10px 10px 12px;
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.065);
  color: #00e5ff;
  font-weight: 800;
}

.metro-sync-strip span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metro-sync-strip strong {
  color: #e8ffff;
  font-size: 0.95rem;
  white-space: nowrap;
}

.manual-bpm-control {
  flex: 0 0 auto;
  min-width: 108px;
  display: grid;
  gap: 5px;
  justify-items: end;
  color: #00e5ff;
  font-weight: 900;
}

.manual-bpm-control span {
  color: #9aa4aa;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.manual-bpm-control input {
  width: 104px;
  height: 42px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.42);
  color: #f8feff;
  padding: 0 10px;
  text-align: center;
  font-size: 1.18rem;
  font-weight: 950;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.08), 0 0 22px rgba(0, 229, 255, 0.08);
}

.manual-bpm-control input:focus {
  border-color: #00e5ff;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.14), 0 0 28px rgba(0, 229, 255, 0.14);
}

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

.metro-panel-main {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(170px, 0.78fr);
  align-items: center;
  gap: 18px;
}

.tempo-block {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.tempo-dial {
  --size: clamp(168px, 21vw, 220px);
  position: relative;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(0, 229, 255, 0.16) 0 42%, rgba(0, 0, 0, 0.35) 43% 100%),
    conic-gradient(from -90deg, #00e5ff var(--dial-deg), rgba(255, 255, 255, 0.12) 0);
  box-shadow: 0 0 44px rgba(0, 229, 255, 0.16), inset 0 0 0 8px rgba(0, 0, 0, 0.34);
  cursor: grab;
  touch-action: none;
}

.tempo-dial:active {
  cursor: grabbing;
}

.tempo-ring {
  position: absolute;
  inset: 15px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(7, 10, 12, 0.92);
}

.tempo-dial span,
.tempo-dial strong,
.tempo-dial em {
  position: relative;
  z-index: 1;
}

.tempo-dial span {
  align-self: end;
  color: #aab2b8;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.tempo-dial strong {
  font-size: clamp(3.2rem, 7vw, 5.9rem);
  line-height: 0.95;
  color: #fff;
}

.tempo-dial em {
  align-self: start;
  color: #cbd3d8;
  font-style: normal;
  font-weight: 900;
}

.tempo-dial.live {
  --size: min(46vw, 360px);
}

.tempo-actions {
  display: grid;
  grid-template-columns: minmax(66px, 86px) minmax(120px, 1fr) minmax(66px, 86px);
  gap: 10px;
  width: min(100%, 420px);
}

.tempo-actions small {
  color: #8fdde7;
}

.tap-tempo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #00e5ff;
}

.click-controls {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.giant-play {
  display: grid;
  place-items: center;
  gap: 8px;
  width: clamp(116px, 15vw, 150px);
  height: clamp(116px, 15vw, 150px);
  border: 2px solid #00e5ff;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.22), rgba(0, 0, 0, 0.62));
  color: #eaffff;
  box-shadow: 0 0 36px rgba(0, 229, 255, 0.32);
  font-weight: 900;
}

.giant-play svg {
  width: clamp(38px, 5vw, 52px);
  height: clamp(38px, 5vw, 52px);
}

.giant-play.playing {
  background: radial-gradient(circle, rgba(41, 255, 119, 0.22), rgba(0, 0, 0, 0.62));
  border-color: #55ff9b;
}

.metro-slider {
  display: grid;
  gap: 8px;
  width: 150px;
  color: #b5bec5;
  font-weight: 800;
}

.metro-slider input {
  accent-color: #00e5ff;
}

.metro-volume-control {
  display: inline-flex;
  align-items: end;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.metro-volume-control b {
  min-width: 38px;
  color: #eaffff;
  font-size: 0.82rem;
  text-align: right;
}

.metro-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metro-option-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.accent-sound-card {
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.accent-sound-card > strong:first-child {
  justify-self: center;
  color: #00e5ff;
  letter-spacing: 0.1em;
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.34);
}

.metro-option-divider {
  height: 1px;
  margin: 2px 0;
  background: rgba(255, 255, 255, 0.1);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-row button {
  min-width: 64px;
  padding: 0 12px;
}

.pill-row button.active {
  border-color: #00e5ff;
  background: rgba(0, 229, 255, 0.18);
  color: #eaffff;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.14);
}

.time-signature-custom {
  display: grid;
  grid-template-columns: auto minmax(72px, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  color: #9fa8ae;
  font-size: 0.78rem;
  font-weight: 900;
}

.time-signature-custom input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: #f8fbfc;
  font: inherit;
}

.time-signature-custom input:invalid {
  border-color: rgba(255, 107, 107, 0.75);
}

.click-sound-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
}

.click-sound-row button {
  min-width: 0;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(0.74rem, 0.9vw, 0.88rem);
  line-height: 1.05;
}

.click-sound-row button.active {
  border-color: #55ff9b;
  background: rgba(85, 255, 155, 0.16);
  color: #effff6;
}

.beat-dot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  min-height: 64px;
  overflow-x: hidden;
}

.accent-sound-card .beat-dot-row {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 74px));
  justify-content: center;
  justify-items: center;
  align-items: center;
  gap: 12px;
  min-height: 94px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 44%, rgba(0, 229, 255, 0.14), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -18px 34px rgba(0, 0, 0, 0.18),
    0 0 26px rgba(0, 229, 255, 0.08);
}

.accent-sound-card .beat-dot-row::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(0, 229, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 229, 255, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 74%);
  mask-image: radial-gradient(circle, #000 18%, transparent 74%);
}

.metronome-detail-grid .metronome-panel {
  padding: 14px;
}

.metronome-detail-grid .metro-panel-hero {
  padding-bottom: 9px;
}

.metronome-detail-grid .metro-panel-hero h2 {
  max-width: 100%;
  margin: 0 0 3px;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metronome-detail-grid .metro-panel-hero p {
  font-size: 0.92rem;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metronome-detail-grid .metro-sync-strip {
  min-height: 38px;
  margin: 8px 0 10px;
  padding: 7px 10px;
}

.metronome-detail-grid .metro-panel-main {
  grid-template-columns: minmax(190px, 1fr) minmax(145px, 0.7fr);
  gap: 12px;
}

.metronome-detail-grid .tempo-block,
.metronome-detail-grid .click-controls {
  gap: 10px;
}

.metronome-detail-grid .tempo-dial {
  --size: clamp(150px, 15vw, 184px);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.14), inset 0 0 0 7px rgba(0, 0, 0, 0.34);
}

.metronome-detail-grid .tempo-ring {
  inset: 13px;
}

.metronome-detail-grid .tempo-dial strong {
  font-size: clamp(3.45rem, 5.4vw, 4.65rem);
}

.metronome-detail-grid .tempo-actions {
  grid-template-columns: minmax(58px, 76px) minmax(98px, 1fr) minmax(58px, 76px);
  gap: 8px;
  width: min(100%, 360px);
}

.metronome-detail-grid .tempo-actions button,
.metronome-detail-grid .tap-tempo,
.metronome-detail-grid .metro-option-card button {
  min-height: 36px;
}

.metronome-detail-grid .giant-play {
  position: relative;
  isolation: isolate;
  gap: 0;
  width: clamp(110px, 11vw, 128px);
  height: clamp(110px, 11vw, 128px);
  border: 2px solid #00e5ff;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.22), rgba(0, 0, 0, 0.62));
  box-shadow: 0 0 36px rgba(0, 229, 255, 0.32);
  color: #f7ffff;
  overflow: hidden;
}

.metronome-detail-grid .giant-play::before {
  display: none;
}

.metronome-detail-grid .giant-play svg {
  width: clamp(34px, 4vw, 44px);
  height: clamp(34px, 4vw, 44px);
  margin-left: 3px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.56));
}

.metronome-detail-grid .giant-play.playing {
  border-color: #37ff80;
  background: radial-gradient(circle, rgba(55, 255, 128, 0.34), rgba(0, 0, 0, 0.62));
  box-shadow: 0 0 36px rgba(55, 255, 128, 0.34);
}

.play-rainbow-mark {
  display: inline-grid;
  place-items: center;
  transform: translateX(4px);
  background: linear-gradient(135deg, #8effff, #00e5ff 45%, #35ffcf 74%, #f5ffff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(3.1rem, 5vw, 4rem);
  font-weight: 950;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.46));
}

.metronome-detail-grid .metro-volume-control {
  gap: 8px;
  padding: 7px 9px;
}

.metronome-detail-grid .metro-slider {
  width: 136px;
  gap: 6px;
}

.metronome-detail-grid .metro-options-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 10px;
  margin-top: 10px;
}

.metronome-detail-grid .metro-option-card {
  gap: 8px;
  padding: 10px;
}

.metronome-detail-grid .metro-option-card > strong {
  font-size: 0.68rem;
}

.metronome-detail-grid .pill-row,
.metronome-detail-grid .click-sound-row {
  gap: 6px;
}

.metronome-detail-grid .pill-row button {
  min-width: 54px;
  padding: 0 8px;
}

.metronome-detail-grid .time-signature-custom {
  gap: 6px;
}

.metronome-detail-grid .time-signature-custom input {
  height: 30px;
}

.metronome-detail-grid .click-sound-row {
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
}

.metronome-detail-grid .click-sound-row button {
  min-width: 0;
  padding: 4px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(0.72rem, 1vw, 0.82rem);
  line-height: 1.05;
}

.metronome-detail-grid .beat-dot-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
  align-items: end;
  gap: 7px;
  min-height: 0;
}

.metronome-detail-grid .beat-dot {
  min-width: 0;
  gap: 5px;
}

.metronome-detail-grid .beat-dot span {
  width: 20px;
  height: 20px;
}

.metronome-detail-grid .beat-dot.current span {
  transform: scale(1.22);
}

.beat-dot {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 32px;
  border: 0;
  background: transparent;
  color: #9fa8ae;
  cursor: pointer;
}

.accent-sound-card .beat-dot {
  width: 68px;
  min-width: 0;
  min-height: 58px;
  align-content: center;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055);
}

.beat-dot span {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.42), transparent 20%),
    radial-gradient(circle at 50% 58%, rgba(255, 255, 255, 0.18), rgba(70, 75, 78, 0.55) 52%, rgba(22, 24, 26, 0.92) 72%);
  box-shadow:
    0 8px 14px rgba(0, 0, 0, 0.42),
    inset 0 1px 3px rgba(255, 255, 255, 0.28),
    inset 0 -7px 10px rgba(0, 0, 0, 0.42);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, filter 160ms ease;
}

.accent-sound-card .beat-dot span {
  width: 30px;
  height: 30px;
}

.beat-dot span::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.22), transparent 62%);
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: -1;
}

.beat-dot.strong span {
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.96), transparent 18%),
    radial-gradient(circle at 50% 58%, #b6fff3 0 18%, #20ff9a 34%, #00e5ff 58%, #006fff 88%);
  box-shadow:
    0 0 24px rgba(0, 229, 255, 0.76),
    0 0 12px rgba(32, 255, 154, 0.42),
    0 9px 22px rgba(0, 229, 255, 0.24),
    inset 0 2px 4px rgba(255, 255, 255, 0.52),
    inset 0 -8px 12px rgba(0, 65, 120, 0.58);
  filter: saturate(1.45);
}

.beat-dot.strong span::after {
  opacity: 1;
  transform: scale(1);
}

.beat-dot.current span {
  transform: scale(1.32);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.06),
    0 12px 24px rgba(0, 0, 0, 0.46),
    inset 0 2px 5px rgba(255, 255, 255, 0.32),
    inset 0 -8px 12px rgba(0, 0, 0, 0.46);
}

.beat-dot.current span::after {
  opacity: 0;
  transform: scale(0.82);
}

.beat-dot.strong.current span {
  box-shadow:
    0 0 0 5px rgba(32, 255, 154, 0.14),
    0 0 30px rgba(0, 229, 255, 0.88),
    0 0 16px rgba(32, 255, 154, 0.5),
    0 12px 26px rgba(0, 0, 0, 0.46),
    inset 0 2px 5px rgba(255, 255, 255, 0.64),
    inset 0 -9px 14px rgba(0, 65, 120, 0.58);
}

.beat-dot.strong.current span::after {
  opacity: 1;
  transform: scale(1.24);
}

.beat-dot em {
  font-style: normal;
  font-weight: 900;
  color: #b8bec3;
  text-shadow: none;
}

.beat-dot.strong em {
  color: #f5ffff;
  text-shadow:
    0 0 12px rgba(0, 229, 255, 0.62),
    0 0 18px rgba(32, 255, 154, 0.34);
}

.accent-sound-card .beat-dot.strong,
.accent-sound-card .beat-dot.current {
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.16), rgba(0, 229, 255, 0.035));
  box-shadow:
    inset 0 0 0 1px rgba(0, 229, 255, 0.24),
    0 0 18px rgba(0, 229, 255, 0.12);
}

.metronome-detail-grid .accent-sound-card .beat-dot-row {
  grid-template-columns: repeat(auto-fit, minmax(40px, 48px));
  justify-content: center;
  min-height: 86px;
  gap: 10px;
  padding: 12px 10px 10px;
}

.metronome-detail-grid .accent-sound-card .beat-dot {
  width: 42px;
  min-height: 54px;
}

.metronome-detail-grid .accent-sound-card .beat-dot span {
  width: 28px;
  height: 28px;
}

.live-click-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 24px;
  padding: 28px;
  background:
    radial-gradient(circle at 76% 52%, rgba(0, 229, 255, 0.16), transparent 28%),
    #030506;
  color: #f8fbfc;
}

.live-click-header,
.live-click-status,
.live-click-footer {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 16px 20px;
}

.live-click-header strong {
  display: block;
  font-size: clamp(1.45rem, 3vw, 2.6rem);
}

.live-click-header button,
.live-click-footer button {
  padding: 0 16px;
}

.live-click-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.live-click-status span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #eef5f7;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-weight: 900;
}

.live-click-main {
  display: grid;
  grid-template-columns: 160px minmax(260px, 1fr) 160px minmax(180px, 0.7fr);
  align-items: center;
  justify-items: center;
  gap: 28px;
}

.live-tempo-step {
  width: 150px;
  height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
  font-size: 2.4rem;
  font-weight: 900;
}

.live-tempo-step span {
  display: block;
  color: #00e5ff;
  font-size: 1rem;
}

.live-play {
  width: 190px;
  height: 190px;
}

.live-beats {
  display: flex;
  justify-content: center;
}

@media (max-width: 1180px) {
  .metronome-prep-shell {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 14px;
  }

  .prep-rail-brand {
    min-height: 118px;
  }

  .prep-rail-brand svg {
    width: 38px;
    height: 38px;
  }

  .stage-song-row {
    grid-template-columns: minmax(210px, 1.35fr) minmax(116px, 0.95fr) 62px 62px 66px 88px 112px 44px;
    gap: 8px;
    padding: 0 14px;
  }

  .quick-song-layout {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
    gap: 16px;
  }

  .quick-song-form {
    grid-template-columns: minmax(170px, 1fr) minmax(132px, 0.8fr);
  }

  .stage-bpm-tap-row {
    grid-template-columns: minmax(92px, 0.72fr) minmax(124px, 1fr);
  }

  .quick-field.title-field {
    grid-column: span 2;
  }

  .stage-preview-card {
    grid-template-columns: 118px 76px minmax(110px, 1fr);
    gap: 14px;
  }

  .stage-preview-dial {
    width: 112px;
    height: 112px;
  }

  .stage-preview-play {
    width: 74px;
    height: 74px;
  }

  .quick-setlist-card {
    align-items: stretch;
    flex-direction: column;
  }

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

@media (max-width: 920px) {
  .metronome-prep-shell {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .metronome-prep-rail {
    min-height: auto;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    align-items: stretch;
  }

  .prep-rail-brand {
    min-height: 76px;
    min-width: 120px;
  }

  .metronome-prep-rail nav,
  .prep-rail-bottom {
    grid-auto-flow: column;
    grid-auto-columns: minmax(84px, 1fr);
    padding: 8px;
    overflow-x: auto;
  }

  .metronome-prep-rail nav button,
  .prep-rail-bottom button {
    min-height: 58px;
  }

  .metronome-prep-main {
    overflow: visible;
    padding-right: 0;
  }

  .stage-song-table {
    overflow-x: auto;
  }

  .stage-song-row {
    min-width: 920px;
  }

  .quick-song-layout {
    grid-template-columns: 1fr;
  }

  .stage-preview-card {
    grid-template-columns: 130px 86px minmax(0, 1fr);
  }

  .quick-setlist-steps {
    grid-template-columns: 1fr;
  }

  .quick-setlist-steps > svg {
    display: none;
  }
}

@media (max-width: 640px) {
  .metronome-prep-hero,
  .stage-song-table-top,
  .quick-setlist-card {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-field.title-field,
  .quick-field.count-field {
    grid-column: span 1;
  }

  .quick-song-form,
  .stage-bpm-tap-row,
  .stage-preview-card,
  .stage-modal-grid,
  .stage-detail-grid {
    grid-template-columns: 1fr;
  }

  .stage-preview-dial,
  .stage-preview-play {
    justify-self: center;
  }

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

  .stage-song-search,
  .stage-song-sort {
    width: 100%;
    max-width: none;
  }
}

.piano-key.active,
.piano-stage-keyboard .piano-key.active,
.piano-strip-key.active,
.piano-strip-key.active.white,
.piano-strip-row:first-child .piano-strip-key.active,
.piano-strip-row:nth-child(2) .piano-strip-key.active {
  background: linear-gradient(180deg, var(--retro-top, #efffff) 0%, var(--retro-middle, #10e5f4) 55%, var(--retro-bottom, #5f55ff) 100%) !important;
  color: #fff;
  box-shadow:
    inset 0 0 24px rgba(255, 255, 255, 0.58),
    inset 0 -10px 18px rgba(20, 3, 38, 0.22),
    0 0 24px var(--retro-glow, rgba(16, 229, 244, 0.88)) !important;
  filter: saturate(1.18) brightness(1.04);
}

.piano-key.active.black,
.piano-strip-key.active.black {
  box-shadow:
    inset 0 0 18px rgba(255, 255, 255, 0.44),
    inset 0 -8px 14px rgba(8, 2, 22, 0.34),
    0 8px 16px rgba(0, 0, 0, 0.42),
    0 0 22px var(--retro-glow, rgba(16, 229, 244, 0.82)) !important;
}

.record-form-card.edit-mode {
  border-color: rgba(198, 118, 255, 0.54) !important;
  box-shadow: inset 3px 0 0 rgba(198, 118, 255, 0.68), 0 0 30px rgba(158, 80, 255, 0.11) !important;
}

.record-form-card.edit-mode .record-form-card-head > span,
.record-form-card.edit-mode .record-form-card-head > em {
  border-color: rgba(198, 118, 255, 0.38);
  background: rgba(158, 80, 255, 0.12);
  color: #d9b7ff;
}

.record-console.editing-info {
  opacity: 0.64;
  filter: saturate(0.62);
}

.record-save-row:has(.record-edit-cancel-btn) {
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.3fr);
  gap: 9px;
}

.record-edit-cancel-btn {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #eaf5f7;
  font-weight: 850;
}

@media (max-width: 1180px) {
  .metronome-stage-grid {
    grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.4fr);
  }

  .metronome-detail-grid {
    grid-template-columns: minmax(220px, 0.58fr) minmax(0, 1.42fr);
  }

  .metronome-stage-grid > .metronome-panel {
    grid-column: 1 / -1;
  }

  .metronome-detail-grid > .metronome-panel {
    grid-column: auto;
    align-self: stretch;
  }

  .live-click-main {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .metronome-stage-grid,
  .metro-panel-main,
  .metro-options-grid,
  .live-click-status {
    grid-template-columns: 1fr;
  }

  .click-set-home-grid {
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr);
  }

  .metronome-detail-grid {
    grid-template-columns: minmax(180px, 0.56fr) minmax(0, 1.44fr);
    gap: 10px;
  }

  .metronome-detail-grid .metro-panel-main,
  .metronome-detail-grid .metro-options-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .metronome-detail-grid .metro-panel-hero h2 {
    font-size: clamp(1.18rem, 2.4vw, 1.55rem);
  }

  .metronome-detail-grid .tempo-dial {
    --size: clamp(134px, 18vw, 160px);
  }

  .metronome-detail-grid .giant-play {
    width: clamp(92px, 13vw, 112px);
    height: clamp(92px, 13vw, 112px);
  }

  .metro-sync-strip {
    grid-template-columns: 1fr auto;
  }

  .metro-sync-strip .sync-live {
    grid-column: 1 / -1;
    width: 100%;
  }

  .live-click-overlay {
    overflow: auto;
  }
}

/* v180: verified audio export and professional share choices. */
.record-download-location.prepared {
  border-color: rgba(77, 224, 160, 0.66);
  background: linear-gradient(135deg, rgba(77, 224, 160, 0.14), rgba(0, 229, 255, 0.06));
  box-shadow: inset 3px 0 0 #4de0a0, 0 0 22px rgba(77, 224, 160, 0.09);
}

.record-download-sheet .record-save-btn svg {
  width: 18px;
  height: 18px;
}

/* v182: visible, browser-safe recording download destination and completion state. */
.record-download-destination {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.105), rgba(0, 229, 255, 0.025)),
    rgba(0, 0, 0, 0.2);
  box-shadow: inset 3px 0 0 rgba(0, 229, 255, 0.72);
}

.record-download-destination.completed {
  border-color: rgba(77, 224, 160, 0.62);
  background:
    linear-gradient(135deg, rgba(77, 224, 160, 0.16), rgba(0, 229, 255, 0.045)),
    rgba(0, 0, 0, 0.2);
  box-shadow: inset 3px 0 0 #4de0a0, 0 0 24px rgba(77, 224, 160, 0.09);
}

.record-download-destination-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.record-download-destination-head > svg {
  width: 28px;
  height: 28px;
  color: #00e5ff;
}

.record-download-destination.completed .record-download-destination-head > svg {
  color: #4de0a0;
}

.record-download-destination-head > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.record-download-destination-head strong {
  color: #f4ffff;
  font-size: 0.96rem;
}

.record-download-destination-head small {
  color: rgba(234, 255, 255, 0.7);
  font-size: 0.77rem;
  line-height: 1.35;
}

.record-download-destination-head small b {
  color: #bffaff;
}

.record-download-path {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 0.9fr);
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
}

.record-download-path > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #eaffff;
  font-size: 0.78rem;
  font-weight: 850;
}

.record-download-path svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #00e5ff;
}

.record-download-destination.completed .record-download-path span:last-child,
.record-download-destination.completed .record-download-path span:last-child svg {
  color: #86f6bc;
}

.record-download-destination > p {
  margin: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  color: rgba(234, 255, 255, 0.7);
  font-size: 0.75rem;
  line-height: 1.4;
}

.record-download-destination > p svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: #7beeff;
}

.record-download-destination > p b {
  color: #eaffff;
}

.record-download-destination > button {
  justify-self: start;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(77, 224, 160, 0.36);
  border-radius: 9px;
  background: rgba(77, 224, 160, 0.08);
  color: #baffd7;
  font-size: 0.76rem;
  font-weight: 850;
}

.record-download-destination > button svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 520px) {
  .record-download-path {
    grid-template-columns: minmax(0, 1fr);
  }

  .record-download-path > svg {
    display: none;
  }
}

.record-share-sheet {
  width: min(590px, calc(100vw - 28px));
  max-height: min(760px, calc(100dvh - 28px));
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(0, 229, 255, 0.34);
  border-radius: 16px;
  background:
    radial-gradient(circle at 14% 0%, rgba(0, 229, 255, 0.15), transparent 42%),
    linear-gradient(145deg, rgba(16, 22, 22, 0.99), rgba(4, 7, 8, 0.99));
  color: #eaffff;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.6), 0 0 34px rgba(0, 229, 255, 0.12);
}

.record-share-sheet header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: start;
  gap: 12px;
}

.record-share-sheet header > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.record-share-sheet header strong {
  color: #f5feff;
  font-size: 1.25rem;
  font-weight: 950;
}

.record-share-sheet header span {
  color: rgba(234, 255, 255, 0.64);
  font-size: 0.82rem;
}

.record-share-sheet header > button,
.record-share-sheet footer button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #eaffff;
}

.record-share-note {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.055);
  color: rgba(224, 251, 255, 0.72);
  font-size: 0.76rem;
  line-height: 1.4;
}

.record-share-note svg {
  width: 18px;
  height: 18px;
  color: #00e5ff;
}

.record-share-options {
  display: grid;
  gap: 8px;
}

.record-share-option {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #f2feff;
  text-align: left;
  cursor: pointer;
}

.record-share-option:hover {
  border-color: rgba(0, 229, 255, 0.58);
  background: rgba(0, 229, 255, 0.09);
  transform: translateY(-1px);
}

.record-share-option > svg:first-child {
  width: 32px;
  height: 32px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.12);
  color: #00e5ff;
}

.record-share-option.telegram > svg:first-child {
  background: rgba(41, 169, 235, 0.16);
  color: #55c7ff;
}

.record-share-option.whatsapp > svg:first-child {
  background: rgba(37, 211, 102, 0.14);
  color: #44e77f;
}

.record-share-option.copy > svg:first-child {
  background: rgba(172, 118, 255, 0.15);
  color: #c7a7ff;
}

.record-share-option > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.record-share-option strong {
  color: #f7feff;
  font-size: 0.94rem;
  font-weight: 920;
}

.record-share-option small {
  overflow: hidden;
  color: rgba(234, 255, 255, 0.6);
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-share-option > em {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(77, 224, 160, 0.13);
  color: #71efb8;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.record-share-option > svg:last-child {
  width: 18px;
  height: 18px;
  color: rgba(234, 255, 255, 0.46);
}

.record-share-busy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #aef8ff;
  font-size: 0.8rem;
  font-weight: 850;
}

.record-share-busy svg {
  width: 18px;
  height: 18px;
  animation: record-share-spin 0.85s linear infinite;
}

.record-share-sheet footer {
  display: flex;
  justify-content: flex-end;
}

.record-share-sheet footer button {
  min-width: 110px;
  padding-inline: 18px;
  font-weight: 850;
}

@keyframes record-share-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .record-share-sheet {
    width: min(100% - 16px, 520px);
    max-height: calc(100dvh - 16px);
    gap: 10px;
    padding: 12px;
  }

  .record-share-option {
    min-height: 64px;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px;
  }

  .record-share-option > svg:first-child {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 760px) {
  .click-set-home-grid {
    grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1fr);
  }

  .metronome-detail-grid {
    grid-template-columns: minmax(168px, 0.54fr) minmax(0, 1.46fr);
  }

  .metronome-detail-grid .click-song-scroll,
  .click-set-home-grid .click-set-scroll {
    max-height: none;
  }

  .metronome-detail-grid > .metronome-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .ireal-stage {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .ireal-chart-area {
    padding: 22px 10px;
  }

  .ireal-chart-wrap .stage-paper .chord-root {
    font-size: 2.55rem;
  }

  .ireal-chart-wrap .stage-paper .chord-quality,
  .ireal-chart-wrap .stage-paper .chord-bass {
    font-size: 0.96rem;
  }

  .ireal-chart-wrap .stage-paper .repeat-symbol,
  .ireal-chart-wrap .stage-paper .sheet-empty {
    width: 46px;
    font-size: 2.55rem;
  }

  .stage-note-panel {
    left: 10px;
    right: auto;
    bottom: 0;
    width: min(var(--stage-panel-width, calc(100vw - 20px)), calc(100vw - 20px));
    min-width: min(360px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    height: min(48dvh, 420px);
    transform: none;
  }

  .stage-note-fields {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .stage-note-fields label.wide {
    grid-column: 1 / -1;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 100;
  max-width: min(520px, calc(100vw - 24px));
  border: 1px solid rgba(31, 182, 166, 0.48);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(17, 19, 19, 0.94);
  box-shadow: var(--shadow);
  color: var(--text);
}

.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
}

.preparation-save-modal {
  width: min(560px, calc(100vw - 28px));
  max-height: min(720px, calc(var(--app-height) - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(0, 216, 255, 0.42);
  border-radius: 16px;
  background:
    radial-gradient(circle at 18% 0%, rgba(0, 216, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(17, 22, 25, 0.98), rgba(7, 10, 12, 0.98));
  color: #f6fbfc;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62), 0 0 34px rgba(0, 216, 255, 0.14);
}

.preparation-save-modal header {
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 14px;
}

.preparation-save-modal header strong {
  font-size: 1.05rem;
}

.preparation-save-modal header button {
  min-height: 36px;
  border: 1px solid rgba(0, 216, 255, 0.32);
  border-radius: 10px;
  background: rgba(22, 31, 34, 0.9);
  color: #e7fbff;
  font-weight: 850;
  cursor: pointer;
}

.preparation-save-modal header button:last-child {
  justify-self: end;
  background: linear-gradient(180deg, rgba(0, 153, 170, 0.9), rgba(0, 99, 116, 0.92));
}

.preparation-save-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.preparation-save-summary,
.preparation-playlist-picker {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 14px;
}

.preparation-save-summary span,
.preparation-picker-title small,
.preparation-save-summary small {
  display: block;
  color: rgba(255, 255, 255, 0.64);
}

.preparation-save-summary strong {
  display: block;
  margin: 5px 0;
  font-size: 1.35rem;
}

.preparation-playlist-picker {
  display: grid;
  gap: 10px;
}

.preparation-picker-title strong {
  display: block;
  color: #00d8ff;
}

.preparation-playlist-picker button {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.24);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.preparation-playlist-picker button.active {
  border-color: rgba(0, 216, 255, 0.76);
  background: linear-gradient(90deg, rgba(0, 216, 255, 0.26), rgba(0, 216, 255, 0.08));
}

.preparation-playlist-picker button strong,
.preparation-playlist-picker button small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preparation-playlist-picker button small,
.preparation-empty-playlist {
  color: rgba(255, 255, 255, 0.62);
}

.song-action-menu {
  margin: 0 18px 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 216, 255, 0.22);
  border-radius: 10px;
  background: #101216;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
}

.song-action-menu header {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #252830;
  padding: 10px 12px;
}

.song-action-menu header span,
.song-action-playlists > span {
  display: block;
  color: #8f949c;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.song-action-menu header strong {
  display: block;
  margin-top: 2px;
  color: #fff;
  font-size: 0.98rem;
}

.song-action-menu header button,
.song-action-grid button,
.song-action-playlists button {
  border: 1px solid #30343b;
  border-radius: 8px;
  background: #171a20;
  color: #e9edf1;
  cursor: pointer;
}

.song-action-menu header button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
}

.song-action-menu svg {
  width: 18px;
  height: 18px;
}

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

.song-action-grid button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.song-action-playlists {
  display: grid;
  gap: 7px;
  border-top: 1px solid #252830;
  padding: 10px;
}

.song-action-playlists button {
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 8px 10px;
}

.song-action-playlists button strong,
.song-action-playlists button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-action-playlists button small {
  color: #9da2aa;
  font-size: 0.78rem;
}

.playlist-index-row {
  position: relative;
}

.playlist-index-sort-controls {
  position: absolute;
  right: 44px;
  top: 50%;
  display: inline-flex;
  gap: 6px;
  transform: translateY(-50%);
  z-index: 3;
}

.playlist-index-sort-controls button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #27313a;
  border-radius: 8px;
  background: #090b0d;
  color: #00d8ff;
  cursor: pointer;
}

.playlist-index-sort-controls button:disabled {
  opacity: 0.3;
  cursor: default;
}

.playlist-context-menu {
  position: absolute;
  right: 12px;
  top: 52px;
  z-index: 30;
  min-width: 190px;
  display: grid;
  gap: 4px;
  border: 1px solid #30343b;
  border-radius: 10px;
  background: #15171d;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.5);
  padding: 6px;
}

.playlist-context-menu button {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #f1f3f5;
  font-weight: 750;
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
}

.playlist-context-menu button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.playlist-empty-add {
  min-height: calc(100vh - 250px);
  display: grid;
  place-items: center;
  padding: 26px;
}

.playlist-empty-add button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: #00d8ff;
  font-size: 1.08rem;
  font-weight: 800;
  cursor: pointer;
}

.playlist-empty-add svg {
  width: 34px;
  height: 34px;
}

.playlist-add-modal,
.playlist-rename-modal,
.playlist-picker-modal {
  width: min(760px, calc(100vw - 56px));
  max-height: min(84vh, 860px);
  overflow: hidden;
  border: 1px solid #20242b;
  border-radius: 12px;
  background: #1f2024;
  color: #f4f6f7;
  box-shadow: 0 34px 92px rgba(0, 0, 0, 0.74);
}

.playlist-add-modal header,
.playlist-rename-modal header,
.playlist-picker-modal header {
  height: 62px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #30333a;
  background: #020303;
  padding: 0 18px;
}

.playlist-add-modal header strong,
.playlist-rename-modal header strong,
.playlist-picker-modal header strong {
  font-size: 1.18rem;
}

.playlist-add-modal header button,
.playlist-rename-modal header button,
.playlist-picker-modal header button {
  border: 0;
  background: transparent;
  color: #00d8ff;
  font-size: 1.04rem;
  font-weight: 800;
  cursor: pointer;
}

.playlist-add-modal header button:first-child,
.playlist-rename-modal header button:first-child {
  justify-self: start;
}

.playlist-add-modal header button:last-child,
.playlist-rename-modal header button:last-child,
.playlist-picker-modal header button:last-child {
  justify-self: end;
}

.playlist-modal-form {
  padding: 64px 28px 36px;
}

.playlist-modal-form input {
  width: 100%;
  min-height: 64px;
  border: 1px solid #30343b;
  border-radius: 10px;
  background: #2a2c31;
  color: #f7f8f9;
  font-size: 1.52rem;
  padding: 0 22px;
  outline: 0;
}

.playlist-add-options {
  display: grid;
  gap: 12px;
  padding: 26px 30px 34px;
}

.playlist-add-options button {
  min-height: 74px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid #30343b;
  border-radius: 10px;
  background: #2a2c31;
  color: #f6f8f9;
  text-align: left;
  padding: 12px 16px;
  cursor: pointer;
}

.playlist-add-options button svg {
  width: 34px;
  height: 34px;
  color: #00d8ff;
}

.playlist-add-options button strong,
.playlist-add-options button small {
  display: block;
}

.playlist-add-options button small {
  margin-top: 3px;
  color: #a0a5ad;
}

.playlist-picker-search {
  width: calc(100% - 56px);
  margin: 16px 28px;
}

.playlist-picker-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 28px 0;
}

.playlist-picker-heading span {
  min-width: 0;
  overflow: hidden;
  color: #00d8ff;
  font-size: 1rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-picker-heading strong {
  color: #a0a5ad;
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: right;
}

.playlist-picker-list {
  max-height: min(62vh, 620px);
  overflow: auto;
  border-top: 1px solid #30333a;
}

.playlist-picker-row {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 44px;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #30333a;
  padding: 10px 28px;
}

.playlist-picker-row strong,
.playlist-picker-row em,
.playlist-picker-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-picker-row strong {
  color: #fff;
  font-size: 1.04rem;
}

.playlist-picker-row em,
.playlist-picker-row small,
.playlist-picker-row span,
.playlist-picker-row i {
  color: #a0a5ad;
  font-style: normal;
}

.playlist-picker-row.active {
  opacity: 0.56;
}

.playlist-picker-row button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #00d8ff;
  color: #031014;
  cursor: pointer;
}

.playlist-picker-row button:disabled {
  background: #475057;
  color: #d7dbdf;
  cursor: default;
}

/* v267: playlist plus opens Songs picker, Songs has no redundant plus. */
@media (max-width: 720px) {
  .playlist-picker-modal {
    width: calc(100vw - 24px);
    max-height: min(88vh, 760px);
  }

  .playlist-picker-heading {
    display: block;
    padding: 14px 18px 0;
  }

  .playlist-picker-heading strong {
    display: block;
    margin-top: 4px;
    text-align: left;
  }

  .playlist-picker-search {
    width: calc(100% - 36px);
    margin: 14px 18px;
  }

  .playlist-picker-row {
    min-height: 72px;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 10px;
    padding: 10px 18px;
  }

  .playlist-picker-row > span,
  .playlist-picker-row > i {
    display: none;
  }
}

.new-song-modal,
.new-playlist-modal {
  width: min(860px, calc(100vw - 36px));
  min-height: 560px;
  max-height: min(86vh, 820px);
  border-radius: 12px;
  overflow: auto;
  background: #050607;
  border: 1px solid #20242b;
  box-shadow: 0 34px 92px rgba(0, 0, 0, 0.74);
  color: #f1f4f5;
}

.new-playlist-modal {
  min-height: min(620px, 76vh);
}

.new-song-modal header,
.new-playlist-modal header {
  height: 62px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #1d2128;
  background: #020303;
  padding: 0 18px;
}

.new-song-modal header strong,
.new-playlist-modal header strong {
  font-size: 1.34rem;
}

.new-song-modal header button,
.new-playlist-modal header button {
  border: 0;
  background: transparent;
  color: #42d6c6;
  font-size: 1.08rem;
  font-weight: 800;
  cursor: pointer;
}

.new-song-modal header button:first-child,
.new-playlist-modal header button:first-child {
  justify-self: start;
}

.new-song-modal header button:last-child,
.new-playlist-modal header button:last-child {
  justify-self: end;
}

.new-playlist-form {
  padding: 86px 28px 28px;
}

.new-playlist-form input {
  width: 100%;
  min-height: 72px;
  border: 1px solid #252a31;
  border-radius: 10px;
  background: #2b2d32;
  color: #f5f5f7;
  font-size: 1.82rem;
  font-weight: 500;
  outline: 0;
  padding: 0 24px;
}

.new-playlist-form input:focus {
  border-color: #00d8ff;
  box-shadow: 0 0 0 4px rgba(0, 216, 255, 0.12);
}

.new-song-form {
  display: grid;
  gap: 12px;
  padding: 28px;
}

.new-song-form label {
  min-height: 66px;
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: center;
  border: 1px solid #222730;
  border-radius: 10px;
  background: #0b0d10;
  padding: 0 18px;
}

.new-song-form label:first-child {
  border-radius: 10px;
}

.new-song-form label:last-child {
  border-radius: 10px;
}

.new-song-form span {
  color: #8c929b;
  text-align: right;
  padding-right: 18px;
  font-size: 0.98rem;
  font-weight: 800;
}

.new-song-form input,
.new-song-form select {
  width: 100%;
  border: 0;
  background: transparent;
  color: #f1f4f5;
  font-size: 1.2rem;
  font-weight: 700;
  outline: 0;
}

.new-song-form select {
  color: #d8e3e5;
}

.new-song-form .style-field {
  border-color: rgba(66, 214, 198, 0.28);
  background: #07090c;
}

.new-song-style-control {
  min-height: 54px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  border: 1px solid rgba(66, 214, 198, 0.28);
  border-radius: 10px;
  background: #07090c;
  padding: 0 14px;
}

.new-song-style-control > span {
  padding-right: 14px;
  color: #8c929b;
  text-align: right;
  font-size: 0.86rem;
  font-weight: 800;
}

.new-song-style-control > button {
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
  color: #f1f4f5;
  cursor: pointer;
}

.new-song-style-control > button strong {
  overflow: hidden;
  font-size: 1.02rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-song-style-control > button svg {
  flex: 0 0 auto;
  color: #42d6c6;
}

.new-song-style-control.open {
  border-color: rgba(66, 214, 198, 0.72);
  box-shadow: 0 0 0 2px rgba(66, 214, 198, 0.08);
}

#new-song-style-bank {
  min-height: 0;
}

.style-bank {
  display: grid;
  gap: 12px;
  border: 1px solid #20242b;
  border-radius: 12px;
  background: #080a0d;
  padding: 14px;
}

.style-bank.compact {
  max-height: 280px;
  overflow: auto;
  padding: 10px;
}

.style-group {
  display: grid;
  gap: 8px;
}

.style-group > strong {
  color: #8c929b;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.style-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.style-pill {
  min-height: 34px;
  border: 1px solid #2a3039;
  border-radius: 8px;
  background: #11141a;
  color: #d8e3e5;
  padding: 0 11px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.style-pill:hover {
  border-color: rgba(66, 214, 198, 0.48);
  background: #151a20;
}

.style-pill.active {
  border-color: rgba(66, 214, 198, 0.82);
  background: rgba(66, 214, 198, 0.16);
  color: #f5ffff;
}

.style-panel {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(7, 9, 12, 0.82);
  padding: 10px;
  margin-bottom: 12px;
}

.style-panel summary {
  color: #42d6c6;
  cursor: pointer;
  font-weight: 800;
}

.new-song-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.new-song-row label {
  border-radius: 0;
}

.divider {
  height: 1px;
  background: var(--line-soft);
  margin: 14px 0;
}

.keyboard-hint {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .app-frame {
    grid-template-columns: clamp(246px, 28vw, 290px) minmax(0, 1fr);
  }

  .app-frame.metronome-standalone {
    grid-template-columns: minmax(0, 1fr);
  }

  .context-panel {
    grid-column: 1 / -1;
    border-width: 1px 0 0;
    max-height: none;
  }

  .workspace {
    max-height: none;
  }

  .workspace-main {
    padding: 16px 16px 28px;
  }

  .setlist-meta-strip {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .app-frame.view-setlists .setlist-board {
    grid-template-columns: 1fr;
  }

  .app-frame.view-setlists .setlist-browser {
    border-right: 0;
    border-bottom: 1px solid #202329;
  }

  .app-frame.view-setlists .setlist-browser-list {
    max-height: 220px;
    overflow: auto;
  }

  .app-frame.view-setlists .setlist-detail-panel {
    min-width: 0;
  }
}

@media (max-width: 820px) {
  .app-frame {
    grid-template-columns: 246px minmax(0, 1fr);
  }

  .app-frame.metronome-standalone {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-frame.library-mode-songs,
  .app-frame.library-mode-playlists,
  .app-frame.library-mode-playlist {
    grid-template-columns: minmax(274px, 36vw) minmax(0, 1fr);
  }

  .app-frame.view-setlists {
    grid-template-columns: 246px minmax(0, 1fr);
  }

  .ireal-brand {
    min-height: 92px;
    padding: 14px 16px;
  }

  .ireal-brand h1 {
    font-size: 1.08rem;
  }

  .library-category-row {
    min-height: 52px;
    grid-template-columns: 38px minmax(0, 1fr) auto 18px;
    padding: 0 12px 0 16px;
  }

  .songs-browser-header {
    min-height: 72px;
  }

  .songs-browser-list .song-card {
    min-height: 70px;
    padding-left: 14px;
  }

  .playlist-index-row {
    min-height: 64px;
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .playlist-index-main {
    padding-left: 8px;
  }

  .playlist-index-main span {
    font-size: 1rem;
  }

  .playlist-song-row {
    min-height: 70px;
    grid-template-columns: 26px minmax(0, 1fr) minmax(48px, 66px);
    padding: 8px 14px 8px 6px;
  }

  .playlist-song-copy strong {
    font-size: 0.98rem;
  }

  .playlist-song-copy em,
  .playlist-song-copy small,
  .playlist-song-side {
    font-size: 0.82rem;
  }

  .metronome-detail-grid .click-song-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .metronome-detail-grid .click-song-meta {
    grid-column: 2;
    justify-items: start;
    grid-template-columns: auto auto;
    align-items: center;
  }

  .topbar {
    gap: 10px;
    padding: 12px 14px;
  }

  .topbar .button-row {
    justify-content: flex-end;
  }

  .tab-button {
    min-width: 96px;
    padding: 0 10px;
  }

  .ireal-stage {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  .ireal-sidebar-top,
  .ireal-toolbar {
    min-height: 72px;
  }

  .ireal-sidebar-top {
    padding: 0 14px;
  }

  .ireal-sidebar-top strong {
    font-size: 1.05rem;
  }

  .ireal-link {
    font-size: 0.95rem;
  }

  .ireal-search {
    margin: 12px 12px;
    min-height: 46px;
  }

  .ireal-song-row {
    min-height: 74px;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    padding: 8px 12px 8px 8px;
  }

  .ireal-song-copy strong {
    font-size: 0.98rem;
  }

  .ireal-song-copy em,
  .ireal-song-copy small,
  .ireal-song-side {
    font-size: 0.82rem;
  }

  .ireal-toolbar {
    padding: 0 14px;
  }

  .ireal-toolbar-left,
  .ireal-toolbar-right {
    gap: 10px;
  }

  .ireal-tool {
    min-width: 36px;
    min-height: 36px;
  }

  .ireal-tool svg {
    width: 25px;
    height: 25px;
  }

  .ireal-chart-area {
    padding: 18px 10px;
  }

  .ireal-song-stats {
    min-height: 48px;
    font-size: 0.98rem;
  }

  .ireal-play {
    width: 68px;
    height: 68px;
  }

  .ireal-play svg {
    width: 54px;
    height: 54px;
  }

  .browser-preview-toolbar {
    min-height: 72px;
    padding: 0 14px;
  }

  .browser-preview-left,
  .browser-preview-right {
    gap: 10px;
  }

  .browser-preview-toolbar > strong {
    font-size: 1.22rem;
  }

  .browser-chart-area {
    padding: 18px 10px;
  }

  .browser-song-footer {
    min-height: 62px;
    font-size: 0.98rem;
  }
}

/* v210 global responsive contract:
   Every screen owns the available device viewport. Grid/flex children may
   shrink, but no page is allowed to preserve a desktop minimum width and
   create a narrow left strip or an empty right canvas. */
:root {
  --responsive-page-gutter: clamp(8px, 1.5vw, 22px);
  --responsive-control-height: clamp(40px, 5.2vw, 48px);
}

html,
body,
#app,
.app-frame,
.workspace,
.workspace-main,
.stage-app-frame,
.composer-frame {
  min-width: 0 !important;
  max-width: 100vw !important;
}

html,
body,
#app {
  width: 100% !important;
  overflow-x: hidden !important;
}

.app-frame,
.stage-app-frame,
.composer-frame {
  width: 100vw !important;
}

.app-frame > *,
.workspace > *,
.workspace-main > *,
.browser-workspace-main > *,
.metronome-standalone-main > * {
  min-width: 0;
  max-width: 100%;
}

img,
video,
canvas {
  max-width: 100%;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

/* A chart/media preview always becomes a real viewport page. This rule is
   deliberately device-agnostic: iPad desktop mode, desktop side panels and
   touch laptops must all produce the same geometry. */
body > .browser-preview-shell.preview-expanded.browser-preview-portal {
  box-sizing: border-box !important;
  width: 100vw !important;
  width: 100dvw !important;
  min-width: 100vw !important;
  min-width: 100dvw !important;
  max-width: 100vw !important;
  max-width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
}

body > .browser-preview-shell.preview-expanded.browser-preview-portal .browser-preview-toolbar,
body > .browser-preview-shell.preview-expanded.browser-preview-portal .browser-song-info,
body > .browser-preview-shell.preview-expanded.browser-preview-portal .browser-chart-area,
body > .browser-preview-shell.preview-expanded.browser-preview-portal .browser-chart-wrap {
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

body > .browser-preview-shell.preview-expanded.browser-preview-portal .browser-chart-wrap .chart-paper.preview-paper {
  width: min(calc(100dvw - (2 * var(--responsive-page-gutter))), 1180px) !important;
  max-width: calc(100dvw - (2 * var(--responsive-page-gutter))) !important;
}

@media (min-width: 1181px) {
  .workspace-main:not(.browser-workspace-main) {
    padding-inline: var(--responsive-page-gutter);
  }
}

/* iPad Pro/Air/Mini and similarly sized tablets: two-column cards remain
   readable while tools and previews use the complete workspace width. */
@media (min-width: 760px) and (max-width: 1180px) {
  :root {
    --responsive-page-gutter: clamp(10px, 1.8vw, 18px);
  }

  .workspace-main,
  .home-workspace-main,
  .metronome-standalone-main {
    padding-inline: var(--responsive-page-gutter) !important;
  }

  .home-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .browser-song-info {
    grid-template-columns: minmax(104px, 0.8fr) minmax(180px, 1.45fr) minmax(104px, 0.8fr);
  }
}

/* Portrait tablets and phones: one readable content column, fluid controls,
   no horizontal page scrolling. */
@media (max-width: 759px) {
  :root {
    --responsive-page-gutter: clamp(7px, 2.8vw, 12px);
  }

  .workspace-main,
  .home-workspace-main,
  .metronome-standalone-main {
    padding-inline: var(--responsive-page-gutter) !important;
  }

  .home-tool-grid,
  .recordings-grid,
  .metronome-detail-grid,
  .stage-song-browser-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .browser-song-info {
    grid-template-columns: minmax(62px, 0.72fr) minmax(112px, 1.5fr) minmax(62px, 0.72fr);
    padding-inline: var(--responsive-page-gutter);
  }

  body > .browser-preview-shell.preview-expanded.browser-preview-portal .browser-chart-wrap .chart-paper.preview-paper {
    width: calc(100dvw - (2 * var(--responsive-page-gutter))) !important;
    max-width: calc(100dvw - (2 * var(--responsive-page-gutter))) !important;
  }
}

@media (max-width: 430px) {
  .browser-song-info {
    grid-template-columns: minmax(54px, 0.68fr) minmax(92px, 1.6fr) minmax(54px, 0.68fr);
    gap: 5px;
  }

  .browser-preview-toolbar {
    gap: 5px;
  }
}

/* v207 iPad Safari portal:
   iPadOS can report a desktop-sized layout viewport and keep fixed children
   inside a CSS grid column. Expanded charts are mounted directly under body,
   so the preview always owns the complete visual viewport. */
body > .browser-preview-shell.preview-expanded.browser-preview-portal {
  position: fixed !important;
  inset: 0 !important;
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 2147483000 !important;
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  transform: none !important;
  overflow: hidden !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  isolation: isolate;
  background: #090b0c;
}

body > .browser-preview-shell.preview-expanded.browser-preview-portal .browser-chart-area,
body > .browser-preview-shell.preview-expanded.browser-preview-portal .browser-chart-wrap {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

body > .browser-preview-shell.preview-expanded.browser-preview-portal .browser-chart-wrap .chart-paper.preview-paper {
  width: min(calc(100vw - 24px), 1180px) !important;
  min-width: 0 !important;
  max-width: calc(100vw - 24px) !important;
}

@supports not (height: 100dvh) {
  body > .browser-preview-shell.preview-expanded.browser-preview-portal {
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
  }
}

@media (max-width: 640px) {
  .app-frame {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(190px, 38dvh);
    height: 100dvh;
    overflow: hidden;
  }

  .app-frame.metronome-standalone {
    grid-template-rows: minmax(0, 1fr);
  }

  .library-panel,
  .context-panel,
  .workspace {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .workspace {
    order: 0;
  }

  .library-panel {
    order: 1;
    border-width: 0 0 1px;
  }

  .context-panel {
    order: 2;
  }

  .app-frame.view-metronome .workspace-main,
  .app-frame.view-clicksets .workspace-main {
    overflow: auto;
  }

  .click-set-home-grid,
  .metronome-detail-grid {
    height: auto;
    max-height: none;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .click-set-home-grid > .click-set-list,
  .metronome-detail-grid > .click-song-list {
    height: auto;
    min-height: 260px;
  }

  .topbar,
  .stage-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
  }

  .tab-button {
    min-width: 106px;
  }

  .summary-strip,
  .setlist-layout,
  .setlist-board,
  .stage-shell,
  .workbench-grid {
    grid-template-columns: 1fr;
  }

  .setlist-browser {
    border-right: 0;
    border-bottom: 1px solid #202329;
  }

  .setlist-meta-strip {
    grid-template-columns: 1fr 1fr;
  }

  .chart-grid,
  .stage-chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .library-actions {
    grid-template-columns: 1fr;
  }

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

  .workspace-main {
    padding: 14px 12px 28px;
  }

  .queue-item {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .queue-actions {
    grid-column: 1 / -1;
  }

  .setlist-meta-strip,
  .setlist-add-strip,
  .setlist-song-main {
    grid-template-columns: 1fr;
  }

  .setlist-song-row {
    grid-template-columns: 1fr;
  }

  .setlist-song-row .queue-actions {
    padding: 0 10px 10px 14px;
  }
}

.app-frame.view-home .workspace {
  background:
    radial-gradient(circle at 74% 12%, rgba(0, 216, 255, 0.1), transparent 34%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    #0b0f10;
  background-size: auto, 38px 38px, 38px 38px, auto;
}

.app-frame.view-home {
  grid-template-columns: clamp(238px, 20vw, 258px) minmax(0, 1fr);
}

.home-workspace-main {
  height: 100%;
  overflow: hidden;
  padding: clamp(14px, 1.45vw, 20px);
}

.home-dashboard {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(220px, 0.95fr) minmax(238px, 0.86fr);
  gap: clamp(14px, 1.5vw, 20px);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(218px, 0.82fr) minmax(230px, 1.18fr);
  align-items: center;
  gap: 10px;
}

.home-hero h2 {
  margin: 0;
  font-size: clamp(1.18rem, 1.6vw, 1.55rem);
  line-height: 1.05;
  white-space: nowrap;
}

.home-hero p {
  margin: 6px 0 0;
  color: #9ea5ae;
  font-size: clamp(0.92rem, 1.2vw, 1.02rem);
}

.home-search-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
}

.home-search {
  min-height: 46px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(28, 35, 39, 0.92), rgba(12, 16, 18, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #8e98a3;
}

.home-search svg {
  justify-self: center;
  width: 19px;
  height: 19px;
}

.home-search input {
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #eef5f7;
  font: inherit;
}

.home-filter-btn,
.drawer-actions button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(28, 32, 35, 0.88);
  color: #d5eef2;
  cursor: pointer;
}

.home-filter-btn:hover,
.drawer-actions button:hover,
.home-tool-open:hover,
.home-secondary-btn:hover,
.quick-action-grid button:hover,
.quick-action-split:hover,
.home-nav-row:hover {
  background: rgba(0, 216, 255, 0.12);
  border-color: rgba(0, 216, 255, 0.32);
}

.home-tool-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.4vw, 18px);
}

.home-tool-card,
.home-card {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 30%, rgba(31, 182, 166, 0.12), transparent 44%),
    linear-gradient(155deg, rgba(28, 36, 41, 0.96), rgba(11, 15, 17, 0.98));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.home-tool-card {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(80px, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  padding: clamp(16px, 1.8vw, 22px);
}

.home-tool-copy span {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(0, 216, 255, 0.1);
  color: #00d8ff;
}

.home-tool-copy h3 {
  margin: 12px 0 7px;
  font-size: clamp(1.05rem, 1.35vw, 1.34rem);
}

.home-tool-copy p {
  margin: 0;
  max-width: 22ch;
  color: #a6aeb8;
  font-size: clamp(0.84rem, 1vw, 0.96rem);
  line-height: 1.42;
}

.home-tool-visual {
  min-height: 0;
  display: grid;
  place-items: center;
}

.home-tool-open,
.home-secondary-btn {
  min-height: 42px;
  border: 1px solid rgba(0, 216, 255, 0.65);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(0, 216, 255, 0.18), rgba(0, 100, 115, 0.18));
  color: #00e5ff;
  font-weight: 800;
  cursor: pointer;
}

.analog-metronome-art,
.piano-card-art,
.tuner-card-art {
  width: min(78%, 220px);
  aspect-ratio: 1.28;
  position: relative;
}

.metro-body {
  position: absolute;
  inset: 8% 26% 0;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(110deg, #4b2e16, #9c6734 48%, #2b1a10);
  border: 1px solid rgba(255, 220, 150, 0.28);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.48), inset 0 0 18px rgba(255, 211, 127, 0.12);
}

.metro-scale {
  position: absolute;
  left: 43%;
  top: 18%;
  width: 14%;
  height: 58%;
  border-radius: 999px;
  background: repeating-linear-gradient(180deg, #d5be83 0 2px, #1b120c 2px 5px);
}

.metro-pendulum {
  position: absolute;
  left: 49%;
  top: 7%;
  width: 3px;
  height: 78%;
  background: #d8d2c5;
  transform: rotate(22deg);
  transform-origin: top center;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.34);
}

.metro-weight {
  position: absolute;
  left: 54%;
  top: 34%;
  width: 20px;
  height: 18px;
  border-radius: 4px;
  background: #d8d2c5;
  transform: rotate(22deg);
}

.metro-badge {
  position: absolute;
  left: 30%;
  right: 30%;
  bottom: 13%;
  height: 16%;
  border-radius: 50%;
  background: radial-gradient(circle, #d8b46a, #624016);
}

.piano-card-art {
  width: min(86%, 250px);
}

.piano-lid {
  position: absolute;
  left: 10%;
  top: 4%;
  width: 72%;
  height: 42%;
  border-radius: 50% 50% 12px 12px;
  background: linear-gradient(135deg, #0f1518, #020303 58%, #27343a);
  transform: skew(-18deg) rotate(-10deg);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.5);
}

.piano-case {
  position: absolute;
  left: 20%;
  right: 10%;
  top: 45%;
  height: 32%;
  border-radius: 12px;
  background: linear-gradient(180deg, #11191c, #030405);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.piano-keys-mini {
  position: absolute;
  left: 24%;
  right: 15%;
  top: 59%;
  height: 16%;
  border-radius: 5px;
  background: repeating-linear-gradient(90deg, #f3f0e8 0 13px, #111 13px 16px, #f3f0e8 16px 25px);
}

.tuner-card-art {
  display: grid;
  grid-template-columns: 1fr 54px 1fr;
  align-items: center;
  gap: 12px;
}

.tuner-wave {
  height: 56px;
  background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(0, 216, 255, 0.74) 9px 12px, transparent 12px 18px);
  filter: drop-shadow(0 0 14px rgba(0, 216, 255, 0.62));
  clip-path: polygon(0 48%, 8% 34%, 14% 64%, 22% 22%, 29% 74%, 37% 36%, 45% 62%, 54% 20%, 63% 78%, 72% 40%, 80% 58%, 90% 30%, 100% 50%);
}

.tuner-fork {
  width: 45px;
  height: 102px;
  justify-self: center;
  border: 5px solid rgba(235, 244, 246, 0.9);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  position: relative;
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.3));
}

.tuner-fork::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 5px;
  height: 40px;
  background: rgba(235, 244, 246, 0.9);
  transform: translateX(-50%);
}

.home-lower-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.95fr);
  gap: clamp(12px, 1.4vw, 18px);
}

.home-card {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  padding: clamp(14px, 1.5vw, 18px);
}

.home-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.home-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.03rem;
}

.home-card header button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #aeb8c0;
  padding: 8px 12px;
  cursor: pointer;
}

.last-setlist-head {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.last-setlist-head strong {
  font-size: 1rem;
}

.last-setlist-head span {
  color: #98a3ad;
  font-size: 0.86rem;
}

.last-setlist-songs {
  min-height: 0;
  overflow: hidden;
  display: grid;
  gap: 2px;
  margin: 10px 0 12px;
  padding: 0;
  list-style: none;
}

.last-setlist-songs li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 29px;
  color: #d8e0e4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.last-setlist-songs b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}

.last-setlist-songs span,
.last-setlist-songs em {
  color: #9da6af;
  font-style: normal;
  font-size: 0.8rem;
}

.quick-actions-card {
  grid-template-rows: auto minmax(0, 1fr);
}

.quick-action-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.quick-action-grid > button,
.quick-action-split {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: #eef4f5;
  padding: 14px 10px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
}

.quick-action-grid svg,
.quick-action-split > svg {
  width: 30px;
  height: 30px;
  color: #00d8ff;
}

.quick-action-grid strong,
.quick-action-split strong {
  font-size: 0.9rem;
}

.quick-action-grid span,
.quick-action-split span {
  color: #98a3ad;
  font-size: 0.76rem;
  line-height: 1.25;
}

.quick-action-split > div {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: auto;
}

.quick-action-split > div button {
  min-height: 30px;
  border: 1px solid rgba(0, 216, 255, 0.35);
  border-radius: 7px;
  background: rgba(0, 216, 255, 0.08);
  color: #00e5ff;
  cursor: pointer;
}

.home-empty-panel {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: #8e98a2;
}

.home-nav-row.active {
  background: linear-gradient(90deg, rgba(0, 216, 255, 0.22), rgba(0, 216, 255, 0.08));
  box-shadow: inset 3px 0 0 #00d8ff;
}

.sidebar-cloud-status {
  margin: auto 18px 18px;
  min-height: 86px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(0, 216, 255, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0, 216, 255, 0.08), rgba(255, 255, 255, 0.035));
}

.sidebar-cloud-status svg {
  color: #00d8ff;
  width: 28px;
  height: 28px;
}

.sidebar-cloud-status span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sidebar-cloud-status strong {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-cloud-status small {
  color: #00e5ff;
}

.sidebar-cloud-status b {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #37df68;
  box-shadow: 0 0 14px rgba(55, 223, 104, 0.75);
}

.home-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  z-index: 30;
}

.home-tool-drawer {
  position: fixed;
  top: clamp(14px, 1.5vw, 22px);
  right: clamp(14px, 1.5vw, 22px);
  bottom: clamp(14px, 1.5vw, 22px);
  width: clamp(430px, 39vw, 610px);
  z-index: 31;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(0, 216, 255, 0.24);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 18%, rgba(0, 216, 255, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(21, 28, 32, 0.98), rgba(7, 10, 12, 0.98));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.tuner-drawer {
  grid-template-rows: auto auto minmax(250px, 1fr) auto;
}

.tool-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-drawer-header span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #00d8ff;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tool-drawer-header h2 {
  margin: 6px 0 0;
  font-size: clamp(1.35rem, 2vw, 1.78rem);
}

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

.drawer-actions button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
}

.piano-control-strip,
.tuner-top-controls {
  display: grid;
  gap: 10px;
}

.piano-control-strip {
  grid-template-columns: minmax(0, 1fr) 116px 94px;
  align-items: end;
}

.piano-control-strip label,
.tuner-top-controls label {
  display: grid;
  gap: 5px;
  color: #aeb7bf;
  font-size: 0.78rem;
  font-weight: 700;
}

.piano-control-strip input[type="range"] {
  accent-color: #00d8ff;
}

.piano-control-strip input[type="number"],
.tuner-top-controls input {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.34);
  color: #eef4f5;
  padding: 0 10px;
  font: inherit;
}

.piano-control-strip button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  color: #eef4f5;
  font-weight: 800;
  cursor: pointer;
}

.piano-control-strip button.active {
  border-color: rgba(0, 216, 255, 0.7);
  background: rgba(0, 216, 255, 0.16);
  color: #00e5ff;
}

.piano-keyboard-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}

.piano-keyboard-row {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(124px, 1fr));
  gap: 8px;
}

.piano-octave {
  position: relative;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  overflow: hidden;
  background: #050606;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.8);
}

.white-key-row {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.piano-key {
  position: relative;
  min-width: 0;
  border: 0;
  cursor: pointer;
  font: inherit;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.piano-key.white {
  background: linear-gradient(180deg, #fbfbf8, #d6d6d2);
  border-right: 1px solid #333;
  color: #262a2c;
}

.piano-key.white:last-child {
  border-right: 0;
}

.black-key-row {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.piano-key.black {
  position: absolute;
  top: 0;
  width: 8.5%;
  height: 62%;
  transform: translateX(-50%);
  z-index: 2;
  border-radius: 0 0 5px 5px;
  background: linear-gradient(180deg, #202326, #020303);
  border: 1px solid #000;
  color: #e7faff;
  pointer-events: auto;
}

.piano-key span {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  font-size: 0.68rem;
  font-weight: 800;
  opacity: 0.72;
}

.piano-key.black span {
  bottom: 8px;
  color: #d6faff;
}

.piano-key.active {
  background: linear-gradient(180deg, #79f3ff, #7b42ff);
  color: #fff;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.42), 0 0 18px rgba(0, 216, 255, 0.7);
}

.octave-label {
  position: absolute;
  left: 8px;
  bottom: 7px;
  z-index: 3;
  color: rgba(0, 0, 0, 0.38);
  font-size: 0.7rem;
  font-weight: 900;
  pointer-events: none;
}

.piano-readout {
  min-height: 64px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.piano-readout span {
  display: grid;
  gap: 4px;
}

.piano-readout small {
  color: #8e98a3;
}

.piano-readout strong {
  font-size: 1.12rem;
}

.piano-stage-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 16px;
  color: #f6f7f9;
  overflow: hidden;
}

.piano-stage-rail {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  padding: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 18px 18px 0;
  background:
    radial-gradient(circle at 48% 0%, rgba(0, 216, 255, 0.13), transparent 38%),
    linear-gradient(180deg, rgba(4, 11, 14, 0.98), rgba(0, 0, 0, 0.94));
  box-shadow: inset -1px 0 0 rgba(0, 216, 255, 0.08);
}

.piano-rail-time {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  font-weight: 800;
}

.piano-rail-brand {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.piano-rail-brand > span {
  width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(0, 216, 255, 0.52);
  border-radius: 50%;
  color: #00d8ff;
  background: rgba(0, 216, 255, 0.08);
  box-shadow: 0 0 24px rgba(0, 216, 255, 0.16);
}

.piano-rail-brand strong {
  display: block;
  font-size: 1.28rem;
  line-height: 1.02;
}

.piano-rail-brand small {
  display: block;
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.76rem;
  font-weight: 750;
}

.piano-stage-rail nav,
.piano-rail-bottom {
  display: grid;
  align-content: start;
  gap: 7px;
}

.piano-rail-bottom {
  align-self: end;
}

.piano-rail-item {
  min-height: 48px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 820;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.piano-rail-item svg {
  width: 22px;
  height: 22px;
}

.piano-rail-item:hover,
.piano-rail-item.active {
  color: #00e5ff;
  border-color: rgba(0, 216, 255, 0.44);
  background: linear-gradient(135deg, rgba(0, 216, 255, 0.18), rgba(0, 216, 255, 0.045));
  box-shadow: inset 3px 0 0 #00d8ff, 0 0 22px rgba(0, 216, 255, 0.13);
  transform: translateY(-1px);
}

.piano-cloud-card {
  position: relative;
  min-height: 84px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.piano-cloud-card svg {
  color: #00d8ff;
}

.piano-cloud-card span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  font-weight: 760;
}

.piano-cloud-card strong {
  grid-column: 2;
  color: #00d8ff;
  font-size: 0.74rem;
}

.piano-cloud-card b {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #27f56f;
  box-shadow: 0 0 12px rgba(39, 245, 111, 0.58);
}

.piano-stage-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
  padding: 2px 4px 0 0;
}

.piano-stage-hero {
  min-height: 72px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 10px;
}

.piano-stage-hero h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3.6vw, 2.65rem);
  letter-spacing: 0;
}

.piano-stage-hero h2::first-letter {
  color: inherit;
}

.piano-stage-hero h2 {
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
}

.piano-stage-hero h2::after {
  content: "";
}

.piano-stage-hero p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1rem;
  font-weight: 650;
}

.piano-hero-status {
  display: inline-flex;
  gap: 12px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.8rem;
  font-weight: 850;
}

.piano-stage-controls {
  display: grid;
  grid-template-columns: minmax(120px, 0.76fr) minmax(126px, 0.72fr) minmax(126px, 0.72fr) minmax(180px, 1.18fr) minmax(174px, 1fr) 56px;
  gap: 10px;
  align-items: stretch;
}

.piano-control-card,
.piano-square-action {
  min-height: 96px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 216, 255, 0.08), transparent 42%),
    rgba(8, 18, 21, 0.84);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 18px 34px rgba(0, 0, 0, 0.22);
}

.piano-control-card {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
  padding: 12px 16px;
}

.piano-control-card > span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.84rem;
  font-weight: 800;
}

.piano-control-card select,
.piano-control-card input[type="number"] {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  padding: 0 12px;
  outline: none;
  text-overflow: ellipsis;
}

.piano-stepper {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.42);
}

.piano-stepper button,
.piano-square-action {
  border: 0;
  color: #fff;
  cursor: pointer;
}

.piano-stepper button {
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
}

.piano-stepper strong {
  display: inline-grid;
  place-items: center;
  color: #fff;
}

.piano-toggle {
  width: 58px;
  height: 32px;
  border: 1px solid rgba(0, 216, 255, 0.45);
  border-radius: 999px;
  background: rgba(0, 216, 255, 0.12);
  padding: 3px;
  cursor: pointer;
}

.piano-toggle i {
  width: 24px;
  height: 24px;
  display: block;
  border-radius: 50%;
  background: #778087;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.piano-toggle.active i {
  transform: translateX(24px);
  background: #00e5ff;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.62);
}

.piano-volume-card div {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.piano-volume-card input {
  accent-color: #00d8ff;
}

.piano-square-action {
  display: inline-grid;
  place-items: center;
  align-self: end;
  min-width: 0;
  min-height: 62px;
  background: rgba(255, 255, 255, 0.045);
  color: #dce5e7;
}

.piano-square-action:hover,
.piano-control-card:hover {
  border-color: rgba(0, 216, 255, 0.44);
  box-shadow: 0 0 24px rgba(0, 216, 255, 0.1), 0 18px 34px rgba(0, 0, 0, 0.22);
}

.piano-stage-keyboard {
  min-height: 0;
  display: grid;
  padding: 6px;
  border: 1px solid rgba(0, 216, 255, 0.24);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(0, 216, 255, 0.075), rgba(0, 0, 0, 0.2));
  box-shadow: 0 0 28px rgba(0, 216, 255, 0.1);
  overflow: hidden;
}

.piano-stage-keyboard .piano-keyboard-panel {
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.piano-stage-keyboard .piano-keyboard-row {
  grid-template-columns: repeat(var(--piano-row-octaves, 4), minmax(0, 1fr));
  gap: 0;
  border: 1px solid rgba(0, 216, 255, 0.18);
  border-radius: 10px;
  overflow: hidden;
  background: #030405;
}

.piano-stage-keyboard .piano-octave {
  border: 0;
  border-radius: 0;
  min-height: 0;
  box-shadow: none;
}

.piano-stage-keyboard .piano-key.white {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.14), transparent 12%, transparent 88%, rgba(0, 0, 0, 0.22)),
    linear-gradient(180deg, #fdfdfb, #d9dad7);
}

.piano-stage-keyboard .piano-key.black {
  width: 9.5%;
  height: 63%;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(180deg, #282c31, #030405 92%);
  box-shadow: 0 8px 10px rgba(0, 0, 0, 0.55), inset 0 0 10px rgba(255, 255, 255, 0.08);
}

.piano-stage-keyboard .piano-key:hover {
  box-shadow: inset 0 0 16px rgba(0, 216, 255, 0.24), 0 0 14px rgba(0, 216, 255, 0.18);
}

.piano-stage-keyboard .piano-key.active {
  background: linear-gradient(180deg, #ecfbff, #25dff5 58%, #6362ff);
  color: #fff;
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.56), 0 0 24px rgba(0, 216, 255, 0.82);
}

.piano-stage-keyboard .piano-key span {
  display: none;
}

.piano-stage-keyboard .octave-label {
  left: 9px;
  bottom: 9px;
  color: rgba(0, 0, 0, 0.7);
  font-size: 0.82rem;
}

.piano-stage-bottom {
  min-height: 142px;
  display: grid;
  grid-template-columns: 0.92fr 1.45fr 1.75fr;
  gap: 14px;
}

.piano-info-card {
  min-width: 0;
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background:
    radial-gradient(circle at 16% 0%, rgba(0, 216, 255, 0.08), transparent 42%),
    rgba(8, 18, 21, 0.84);
}

.piano-info-card strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.piano-tip-card strong {
  color: #00d8ff;
}

.piano-tip-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

.piano-active-notes {
  display: flex;
  align-items: center;
  gap: 14px;
}

.piano-active-notes span {
  min-width: 58px;
  min-height: 58px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(0, 216, 255, 0.46);
  border-radius: 10px;
  background: rgba(0, 216, 255, 0.08);
  color: #00d8ff;
  font-size: 1.26rem;
  font-weight: 950;
}

.piano-active-notes span:nth-child(2) {
  border-color: rgba(255, 84, 171, 0.52);
  background: rgba(255, 84, 171, 0.08);
  color: #ff61b6;
}

.piano-active-notes span:nth-child(3) {
  border-color: rgba(159, 86, 255, 0.56);
  background: rgba(159, 86, 255, 0.09);
  color: #a76cff;
}

.piano-wave {
  min-width: 118px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.piano-wave i {
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #00e5ff, rgba(0, 216, 255, 0.26));
}

.piano-note-readout-card {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  text-align: center;
}

.piano-note-readout-card span {
  min-width: 0;
  display: grid;
  gap: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.piano-note-readout-card span:last-child {
  border-right: 0;
}

.piano-note-readout-card small {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.88rem;
}

.piano-note-readout-card strong {
  display: block;
  color: #fff;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
}

.piano-note-readout-card span:first-child strong {
  color: #00d8ff;
  font-size: clamp(2rem, 3vw, 2.5rem);
}

.recordings-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 18px;
  color: #f4f4f0;
  overflow: hidden;
}

.app-frame.view-piano .piano-stage-shell,
.app-frame.view-recordings .recordings-shell,
.app-frame.view-tuner .tuner-page,
.app-frame.view-metronome .metronome-prep-shell {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.app-frame.view-piano .piano-stage-rail,
.app-frame.view-recordings .piano-stage-rail,
.app-frame.view-tuner .piano-stage-rail,
.app-frame.view-metronome .metronome-prep-rail {
  display: none;
}

.app-frame.view-piano .piano-stage-main,
.app-frame.view-recordings .recordings-main,
.app-frame.view-tuner .tuner-main,
.app-frame.view-metronome .metronome-prep-main {
  width: 100%;
  max-width: none;
  padding-left: clamp(12px, 1.6vw, 22px);
  padding-right: clamp(12px, 1.6vw, 22px);
}

.recordings-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
  padding-right: 2px;
}

.recordings-hero {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 10px 0 6px;
}

.recordings-hero h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1.95rem, 3.1vw, 2.55rem);
  letter-spacing: 0;
}

.recordings-hero h2 svg {
  width: 32px;
  height: 32px;
  color: #00e5ff;
  filter: drop-shadow(0 0 16px rgba(0, 229, 255, 0.38));
}

.recordings-hero p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-weight: 650;
}

.recordings-top-icons {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.recordings-top-icons span {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.82);
}

.recordings-top-icons b {
  position: absolute;
  right: 3px;
  bottom: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10d987;
  box-shadow: 0 0 10px rgba(16, 217, 135, 0.8);
}

.recordings-grid {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.95fr);
  grid-template-rows: minmax(0, 1.35fr) minmax(238px, 0.95fr);
  gap: 12px;
  overflow: hidden;
}

.record-console,
.record-form-card,
.record-list-card,
.record-player-card {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background:
    radial-gradient(circle at 12% 0%, rgba(205, 136, 58, 0.13), transparent 34%),
    radial-gradient(circle at 70% 30%, rgba(0, 216, 255, 0.07), transparent 42%),
    rgba(7, 10, 11, 0.92);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.record-console {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.92fr) minmax(0, 1.38fr);
  grid-column: 1;
  grid-row: 1;
  padding: 10px;
  border-color: rgba(205, 136, 58, 0.34);
  background:
    linear-gradient(135deg, rgba(66, 40, 21, 0.42), rgba(6, 8, 9, 0.96) 42%),
    rgba(5, 6, 7, 0.98);
}

.record-console::before,
.record-console::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, #e4a64c, #2d1708);
  box-shadow: 0 0 8px rgba(228, 166, 76, 0.42);
  z-index: 4;
}

.record-console::before {
  left: 14px;
  top: 14px;
}

.record-console::after {
  right: 14px;
  top: 14px;
}

.record-mic-panel {
  min-width: 0;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #120d09;
}

.record-mic-panel img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 10% 50%;
  transform: scale(1.52);
  filter: saturate(1.08) contrast(1.08) brightness(0.86);
}

.record-console-screen {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(84px, 1fr) auto auto;
  gap: 9px;
  padding: 26px 18px 8px 24px;
}

.record-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.record-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #ff5b44;
  font-weight: 950;
  letter-spacing: 0.02em;
}

.record-live-dot i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px rgba(255, 91, 68, 0.64);
}

.record-live-dot.ready {
  color: #3bff8f;
}

.record-live-dot.ready i {
  box-shadow: 0 0 14px rgba(59, 255, 143, 0.68);
}

.record-live-dot.denied {
  color: #ff7b63;
}

.record-live-dot.active i {
  animation: recordPulse 950ms ease-in-out infinite;
}

@keyframes recordPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.78);
  }
}

.record-quality {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  color: #cfc6b8;
  font-size: 0.82rem;
  font-weight: 850;
}

.record-time {
  color: #f4dbc0;
  font-size: clamp(3.1rem, 6.3vw, 5.4rem);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 0.96;
  text-shadow: 0 0 24px rgba(244, 219, 192, 0.12);
}

.record-time-label {
  color: rgba(255, 255, 255, 0.56);
  font-size: 1rem;
  font-weight: 700;
}

.record-waveform {
  min-width: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.record-waveform i {
  flex: 1 1 2px;
  height: var(--h);
  min-height: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #00f0ff, rgba(0, 216, 255, 0.46));
  box-shadow: 0 0 10px rgba(0, 216, 255, 0.18);
  transform: scaleY(calc(0.68 + (var(--d) * 0.025)));
}

.record-levels {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 6px 10px;
}

.record-levels span,
.record-levels em {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 780;
}

.record-level-meter {
  display: grid;
  grid-template-columns: repeat(28, 1fr);
  gap: 3px;
}

.record-level-meter i {
  height: 13px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.record-level-meter i.active {
  background: #22d66d;
  box-shadow: 0 0 8px rgba(34, 214, 109, 0.35);
}

.record-level-meter i.active.warm {
  background: #f5d338;
}

.record-level-meter i.active.hot {
  background: #ff4b32;
}

.record-transport {
  min-height: 90px;
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  align-items: center;
  gap: 22px;
  margin-top: 2px;
  padding: 12px 26px;
  border: 1px solid rgba(205, 136, 58, 0.2);
  border-radius: 999px;
  background: rgba(25, 21, 17, 0.78);
}

.record-round {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: #d5c6ad;
  font-weight: 900;
  cursor: pointer;
}

.record-round:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.record-round > svg {
  width: 52px;
  height: 52px;
  padding: 13px;
  border: 1px solid rgba(205, 136, 58, 0.35);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(205, 136, 58, 0.18), rgba(0, 0, 0, 0.72));
}

.record-round.primary > svg {
  width: 74px;
  height: 74px;
  padding: 21px;
  color: #ff543d;
  border-color: rgba(255, 84, 61, 0.8);
  box-shadow: 0 0 22px rgba(255, 84, 61, 0.32), inset 0 0 18px rgba(255, 84, 61, 0.22);
}

.record-round.primary span {
  color: #ff543d;
}

.record-form-card {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 16px;
}

.record-form-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(150px, 0.56fr);
  gap: 10px 12px;
}

.record-form-card label,
.record-edit-modal label {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.record-form-card label span,
.record-edit-modal label span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.82rem;
  font-weight: 820;
}

.record-form-card input,
.record-form-card textarea,
.record-edit-modal input,
.record-edit-modal textarea {
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.34);
  color: #f7f7f4;
  padding: 0 12px;
  outline: none;
}

.record-form-card textarea,
.record-edit-modal textarea {
  min-height: 82px;
  padding: 10px 12px;
  resize: none;
}

.record-form-card input:focus,
.record-form-card textarea:focus,
.record-edit-modal input:focus,
.record-edit-modal textarea:focus,
.record-search:focus-within {
  border-color: rgba(0, 216, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(0, 216, 255, 0.1);
}

.record-tags-field,
.record-description-field {
  grid-column: span 1;
}

.record-tag-picker {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.record-tag-picker button {
  min-height: 32px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  color: #d7d7d2;
  padding: 0 10px;
  font-weight: 800;
  cursor: pointer;
}

.record-tag-picker button.active {
  border-color: rgba(0, 216, 255, 0.55);
  background: rgba(0, 216, 255, 0.14);
  color: #00e5ff;
}

.record-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  align-items: center;
  gap: 16px;
}

.record-backup-check {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.record-backup-check input {
  width: 20px;
  height: 20px;
  min-height: 0;
  accent-color: #00d8ff;
}

.record-save-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(0, 216, 255, 0.7);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(0, 216, 255, 0.86), rgba(0, 124, 143, 0.9));
  color: #eaffff;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(0, 216, 255, 0.16);
}

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

.record-list-card {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 10px;
}

.record-list-card > header {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.2fr) 42px;
  align-items: center;
  gap: 10px;
  padding: 0 0 9px;
}

.record-list-card > header strong {
  font-size: 1.12rem;
}

.record-list-card > header > button {
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #e7eef0;
}

.record-search {
  min-width: 0;
  min-height: 40px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.28);
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.58);
}

.record-search input {
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
}

.recording-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  overflow: auto;
  padding-right: 2px;
}

.recording-row {
  position: relative;
  min-height: 70px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 74px 70px 34px;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #f1f4f4;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 180ms ease;
}

.recording-row:hover,
.recording-row.active {
  border-color: rgba(0, 216, 255, 0.68);
  background: linear-gradient(90deg, rgba(0, 216, 255, 0.16), rgba(0, 216, 255, 0.035));
  box-shadow: 0 0 20px rgba(0, 216, 255, 0.1);
}

.recording-row-play {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.045);
  color: #eafcff;
  cursor: pointer;
}

.recording-row.active .recording-row-play,
.recording-row-play.playing {
  border-color: rgba(0, 216, 255, 0.8);
  background: rgba(0, 216, 255, 0.16);
  color: #00e5ff;
}

.recording-row-main {
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.recording-row-main strong,
.recording-row-main span {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recording-row-main span,
.recording-row > span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.8rem;
}

.recording-menu-btn {
  border: 0;
  background: transparent;
  color: #f2f2ef;
  cursor: pointer;
}

.recording-action-menu {
  position: absolute;
  right: 10px;
  top: 54px;
  z-index: 10;
  width: 178px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(14, 17, 18, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

.recording-action-menu button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #eef4f5;
  padding: 0 8px;
  text-align: left;
  cursor: pointer;
}

.recording-action-menu button:hover {
  background: rgba(0, 216, 255, 0.12);
  color: #00e5ff;
}

.recording-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  font-weight: 850;
}

.recording-empty span {
  color: rgba(255, 255, 255, 0.48);
  font-weight: 700;
}

.record-player-card {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-rows: auto minmax(54px, 0.75fr) auto auto auto;
  gap: 10px;
  padding: 14px;
}

.record-player-card.empty {
  place-items: center;
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
}

.record-player-card > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  align-items: center;
  gap: 8px;
}

.record-player-card > header strong {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1.05rem;
}

.record-player-card > header button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #e8efef;
  cursor: pointer;
}

.record-player-waveform {
  min-height: 58px;
  border-bottom: 0;
}

.record-scrub-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.82rem;
}

.record-scrub-row input,
.record-player-controls input {
  accent-color: #00d8ff;
}

.record-player-controls {
  display: grid;
  grid-template-columns: 36px 36px 54px 36px 64px minmax(100px, 1fr);
  align-items: center;
  gap: 10px;
}

.record-player-controls button,
.record-player-controls select,
.record-player-card footer button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: #eef5f7;
  cursor: pointer;
}

.record-player-controls button.active {
  border-color: rgba(0, 216, 255, 0.58);
  color: #00e5ff;
}

.record-player-main {
  width: 54px;
  height: 54px;
  min-height: 54px !important;
  border-radius: 50% !important;
  background: linear-gradient(180deg, #00e5ff, #008fa5) !important;
  color: #031012 !important;
  border-color: rgba(0, 229, 255, 0.8) !important;
  box-shadow: 0 0 18px rgba(0, 216, 255, 0.35);
}

.record-player-controls label {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.record-player-card footer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.record-player-card footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 850;
}

.record-player-card .danger-text,
.recording-action-menu .danger-text {
  color: #ff5b52;
}

.record-modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
}

.record-edit-modal {
  width: min(520px, calc(100vw - 40px));
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(0, 216, 255, 0.25);
  border-radius: 14px;
  background: rgba(12, 16, 18, 0.98);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.58);
}

.record-edit-modal header,
.record-edit-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.record-edit-modal header button,
.record-edit-modal footer button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: #eef4f5;
  padding: 0 14px;
  cursor: pointer;
}

.tuner-top-controls {
  grid-template-columns: minmax(0, 1.15fr) 128px;
}

.tuner-tab-row {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tuner-tab-row.compact {
  grid-column: 1 / 2;
}

.tuner-tab-row button,
.mic-state {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #eaf4f5;
  padding: 0 12px;
  font-weight: 750;
  cursor: pointer;
}

.tuner-tab-row button.active {
  border-color: rgba(0, 216, 255, 0.68);
  background: rgba(0, 216, 255, 0.16);
  color: #00e5ff;
}

.mic-state {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mic-state b {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #858b92;
}

.mic-state.active b {
  background: #37df68;
  box-shadow: 0 0 14px rgba(55, 223, 104, 0.75);
}

.tuner-meter-shell {
  --needle: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  position: relative;
}

.tuner-meter {
  width: min(92%, 500px);
  height: 230px;
  position: relative;
  overflow: hidden;
}

.tuner-meter::before {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  top: 20px;
  height: 360px;
  border-radius: 360px 360px 0 0;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-bottom: 0;
  background: conic-gradient(from 235deg at 50% 100%, #f1503f 0deg, #ff9f45 46deg, #39df70 82deg, #00d8ff 125deg, transparent 126deg);
  filter: drop-shadow(0 0 18px rgba(0, 216, 255, 0.18));
}

.tuner-needle {
  position: absolute;
  left: 50%;
  bottom: 26px;
  width: 3px;
  height: 144px;
  border-radius: 999px;
  background: #00e5ff;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(calc(var(--needle) * 1.55deg));
  box-shadow: 0 0 18px rgba(0, 216, 255, 0.78);
}

.tuner-scale {
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 20px;
  display: flex;
  justify-content: space-between;
  color: #a8b2ba;
  font-size: 0.78rem;
}

.tuner-readout {
  position: absolute;
  left: 50%;
  bottom: 18px;
  display: grid;
  justify-items: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.tuner-readout strong {
  font-size: clamp(3.2rem, 7vw, 5.4rem);
  line-height: 0.96;
}

.tuner-readout span {
  margin-top: 7px;
  font-size: 1.15rem;
  font-weight: 800;
}

.tuner-readout em {
  color: #37df68;
  font-style: normal;
  font-weight: 800;
}

.tuner-readout p {
  margin: 5px 0 0;
  color: #aeb8c0;
  font-size: 0.88rem;
}

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

.tuner-string-card {
  min-width: 0;
  min-height: 82px;
  display: grid;
  place-items: center;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  color: #eaf4f5;
}

.tuner-string-card strong {
  font-size: 1.22rem;
}

.tuner-string-card span,
.tuner-string-card em {
  color: #9faab2;
  font-style: normal;
  font-size: 0.78rem;
}

.tuner-string-card.active {
  border-color: #00d8ff;
  background: rgba(0, 216, 255, 0.14);
  box-shadow: 0 0 22px rgba(0, 216, 255, 0.22);
}

.tuner-string-card.active em {
  color: #37df68;
}

.tuner-prototype-note {
  align-self: end;
  border: 1px solid rgba(0, 216, 255, 0.2);
  border-radius: 12px;
  background: rgba(0, 216, 255, 0.08);
  color: #b9c5cb;
  padding: 14px;
  line-height: 1.45;
}

.tuner-page {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 10px;
  color: #f4f7f8;
  overflow: hidden;
  background:
    radial-gradient(circle at 47% 24%, rgba(0, 216, 255, 0.11), transparent 31%),
    radial-gradient(circle at 22% 68%, rgba(255, 148, 55, 0.07), transparent 32%),
    linear-gradient(135deg, #060b0d 0%, #0b1113 48%, #050708 100%);
}

.tuner-page .piano-stage-rail {
  grid-template-rows: 1fr auto;
  gap: 10px;
  padding: 14px 8px;
}

.tuner-page .piano-rail-time,
.tuner-page .piano-rail-brand,
.tuner-page .piano-cloud-card {
  display: none;
}

.tuner-page .piano-stage-rail nav {
  gap: 8px;
}

.tuner-page .piano-rail-item {
  min-height: 62px;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 6px;
  padding: 8px 6px;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.12;
}

.tuner-page .piano-rail-item svg {
  width: 25px;
  height: 25px;
}

.tuner-page .piano-rail-bottom {
  gap: 8px;
}

.tuner-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 82px minmax(0, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(6, 9, 10, 0.9);
}

.tuner-hero {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.tuner-hero h2 {
  margin: 0;
  font-size: clamp(1.8rem, 2.6vw, 2.45rem);
  line-height: 1;
  letter-spacing: 0;
}

.tuner-hero p {
  margin: 7px 0 0;
  color: #aeb8bd;
  font-size: 1rem;
  font-weight: 650;
}

.tuner-hero-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.tuner-hero-actions > button,
.tuner-mic-pill,
.tuner-top-level {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: #edf4f5;
}

.tuner-hero-actions > button {
  width: 42px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.tuner-mic-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
  font-weight: 850;
  cursor: pointer;
}

.tuner-mic-pill.active {
  border-color: rgba(0, 216, 255, 0.55);
  background: rgba(0, 216, 255, 0.1);
  color: #dffcff;
  box-shadow: 0 0 18px rgba(0, 216, 255, 0.12);
}

.tuner-mic-pill svg {
  color: #00e5ff;
}

.tuner-top-level {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 12px;
}

.tuner-top-level svg {
  width: 16px;
  color: #aeb8bd;
}

.tuner-top-level b {
  width: 4px;
  height: 17px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.tuner-top-level b.active {
  background: linear-gradient(180deg, #39ff83, #00d8ff);
  box-shadow: 0 0 8px rgba(0, 216, 255, 0.38);
}

.tuner-workbench {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(500px, 1.22fr) minmax(380px, 0.9fr);
  grid-template-rows: minmax(0, 1fr) 104px 54px;
  gap: 10px;
  padding: 10px;
}

.award-tuner-console,
.tuner-side-panel,
.tuner-bottom-panel,
.tuner-action-dock {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(19, 22, 22, 0.98), rgba(7, 9, 10, 0.98)),
    #090b0c;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55), 0 18px 42px rgba(0, 0, 0, 0.34);
}

.award-tuner-console {
  --needle: 0;
  --level: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(220px, 1fr) 108px;
  padding: 12px;
  background:
    radial-gradient(circle at 49% 41%, rgba(0, 216, 255, 0.13), transparent 36%),
    radial-gradient(circle at 22% 10%, rgba(255, 183, 96, 0.08), transparent 32%),
    linear-gradient(145deg, #1c1b18, #090909 56%, #16110c);
  border-color: rgba(188, 142, 80, 0.32);
}

.award-tuner-console::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(212, 154, 84, 0.22);
  border-radius: 10px;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.72);
  pointer-events: none;
}

.tuner-console-top {
  position: absolute;
  z-index: 3;
  top: 28px;
  left: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.tuner-console-status,
.tuner-auto-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(7, 8, 8, 0.72);
  color: #f6e6c8;
  padding: 0 15px;
  font-size: 0.78rem;
  font-weight: 950;
  pointer-events: auto;
}

.tuner-console-status b,
.tuner-auto-btn b {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #777;
}

.tuner-console-status.active b,
.tuner-auto-btn.active b {
  background: #55e966;
  box-shadow: 0 0 14px rgba(85, 233, 102, 0.7);
}

.award-arc {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  background:
    radial-gradient(ellipse at 50% 96%, rgba(0, 216, 255, 0.2), transparent 32%),
    radial-gradient(ellipse at 50% 52%, rgba(70, 255, 143, 0.14), transparent 26%),
    linear-gradient(180deg, rgba(10, 12, 11, 0.62), rgba(3, 4, 4, 0.75));
}

.award-arc::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 118%;
  border-radius: 999px 999px 0 0;
  border: 2px solid rgba(235, 170, 93, 0.28);
  border-bottom: 0;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(0, 216, 255, 0.08), transparent 48%);
  opacity: 1;
  box-shadow:
    inset 0 12px 24px rgba(255, 142, 51, 0.08),
    inset 0 -20px 30px rgba(0, 216, 255, 0.08),
    0 0 26px rgba(0, 216, 255, 0.12);
}

.award-arc-scale {
  position: absolute;
  z-index: 2;
  left: 17%;
  right: 17%;
  top: 18%;
  height: 64%;
  color: #ff9b45;
  font-size: 1.15rem;
  font-weight: 850;
  pointer-events: none;
}

.award-arc-scale span {
  position: absolute;
  transform: translate(-50%, -50%);
}

.award-arc-scale span:nth-child(1) { left: 3%; top: 69%; }
.award-arc-scale span:nth-child(2) { left: 22%; top: 25%; }
.award-arc-scale span:nth-child(3) { left: 50%; top: 8%; color: #ffe47a; }
.award-arc-scale span:nth-child(4) { left: 78%; top: 25%; color: #45f0ff; }
.award-arc-scale span:nth-child(5) { left: 98%; top: 69%; color: #45f0ff; }

.award-needle {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 19%;
  width: 3px;
  height: min(38%, 178px);
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(calc(var(--needle) * 1.25deg));
  border-radius: 999px;
  background: linear-gradient(180deg, #60f5ff, #f6bb72 78%, #7a4b22);
  box-shadow: 0 0 16px rgba(0, 216, 255, 0.62);
}

.award-needle::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 15px;
  height: 15px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #a07134;
  border: 2px solid rgba(0, 0, 0, 0.65);
}

.award-note-readout {
  z-index: 4;
  display: grid;
  justify-items: center;
  margin-top: 52px;
}

.award-note-readout strong {
  font-size: clamp(4.2rem, 7.6vw, 6.4rem);
  line-height: 0.9;
  color: #80fff1;
  text-shadow: 0 0 22px rgba(82, 255, 232, 0.66);
}

.award-note-readout span {
  margin-top: 12px;
  color: #38f4ff;
  font-size: clamp(1.35rem, 2.1vw, 2rem);
  font-weight: 850;
}

.tuner-cent-readout {
  position: absolute;
  z-index: 4;
  bottom: 22%;
  display: grid;
  gap: 3px;
  color: #ff7b37;
}

.tuner-cent-readout.left {
  left: 19%;
}

.tuner-cent-readout.right {
  right: 17%;
  color: #32f4ff;
}

.tuner-cent-readout strong {
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  line-height: 0.9;
}

.tuner-cent-readout span {
  font-size: 1rem;
}

.tuner-accuracy-badge {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 18px;
  min-width: 174px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(8, 9, 9, 0.86);
  color: #ffbf4a;
  font-size: clamp(1rem, 1.55vw, 1.35rem);
  font-weight: 850;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45);
}

.tuner-accuracy-badge.tuned {
  color: #58ef61;
}

.tuner-console-controls {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 118px minmax(170px, 1fr) 164px;
  gap: 8px;
  border-top: 1px solid rgba(212, 154, 84, 0.18);
  padding-top: 10px;
}

.tuner-gain-block,
.tuner-vu-block,
.tuner-calibration-block {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.24);
  padding: 8px;
}

.tuner-gain-block > span,
.tuner-vu-block > span,
.tuner-calibration-block > span {
  color: #f4d59d;
  font-size: 0.68rem;
  font-weight: 950;
}

.tuner-gain-knob {
  --gain: 0.68;
  width: 58px;
  height: 58px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(from -145deg, #45361f 0deg, #f2bb62 calc(var(--gain) * 270deg), #1c1d1d calc(var(--gain) * 270deg), #0b0c0c 270deg, transparent 271deg);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.12), 0 8px 20px rgba(0, 0, 0, 0.48);
}

.tuner-gain-knob input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.tuner-gain-knob b {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #e7c68d, #73552c 42%, #17100b 100%);
  border: 1px solid rgba(255, 232, 170, 0.42);
}

.tuner-gain-block div {
  width: 100%;
  display: flex;
  justify-content: space-between;
  color: #d8b86f;
  font-weight: 850;
}

.tuner-vu-meter {
  width: min(100%, 250px);
  height: 58px;
  position: relative;
  overflow: hidden;
  border: 4px solid #1b1209;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(255, 204, 103, 0.55), transparent 64%),
    linear-gradient(180deg, #d69c4f, #6e481d);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5);
}

.tuner-vu-meter i {
  --vu: 0;
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 2px;
  height: 48px;
  transform-origin: bottom center;
  transform: rotate(calc(-42deg + var(--vu) * 84deg));
  background: #3b120b;
  box-shadow: 0 0 7px rgba(0, 0, 0, 0.4);
}

.tuner-vu-meter b {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  color: #1d140d;
  font-size: 1.1rem;
}

.tuner-calibration-control {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(94px, 1fr) 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  overflow: hidden;
}

.tuner-calibration-control button,
.tuner-calibration-control label {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  background: rgba(0, 0, 0, 0.42);
  color: #f4f0e7;
  font-weight: 900;
}

.tuner-calibration-control label {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px;
  padding: 0 5px;
}

.tuner-calibration-control input {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: #cfcfcf;
  text-align: center;
  font-size: 1rem;
  font-weight: 850;
  outline: none;
  appearance: textfield;
}

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

.tuner-calibration-control em {
  color: #a5a5a5;
  font-style: normal;
  font-size: 0.78rem;
}

.tuner-reset-btn {
  min-height: 28px;
  border: 1px solid rgba(246, 198, 112, 0.25);
  border-radius: 8px;
  background: rgba(246, 198, 112, 0.08);
  color: #f7d999;
  padding: 0 18px;
  font-weight: 900;
}

.tuner-side-panel {
  min-width: 0;
  min-height: 0;
  grid-row: 1 / 3;
  grid-column: 2;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 10px;
}

.tuner-instrument-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.tuner-instrument-tabs button {
  min-height: 38px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  color: #d8dfe1;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.tuner-instrument-tabs button:last-child {
  border-right: 0;
}

.tuner-instrument-tabs button.active {
  background: rgba(0, 216, 255, 0.15);
  color: #00e5ff;
  box-shadow: inset 0 0 0 1px #00d8ff, 0 0 18px rgba(0, 216, 255, 0.24);
}

.tuner-string-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #bfd8de;
}

.tuner-string-head strong {
  color: #a8dfe6;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.tuner-string-head label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d9dee0;
  font-size: 0.9rem;
}

.tuner-string-head select {
  border: 0;
  background: transparent;
  color: #d9dee0;
  font-weight: 800;
}

.award-string-list {
  min-height: 0;
  display: grid;
  gap: 6px;
  overflow: auto;
  padding-right: 2px;
}

.award-string-row {
  min-height: 44px;
  display: grid;
  grid-template-columns: 34px 62px 28px minmax(68px, 1fr) 24px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: #f4f6f6;
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.award-string-row:hover,
.award-string-row.active {
  border-color: #00d8ff;
  background: linear-gradient(90deg, rgba(0, 216, 255, 0.18), rgba(0, 216, 255, 0.045));
  box-shadow: 0 0 22px rgba(0, 216, 255, 0.18), inset 3px 0 0 #00d8ff;
}

.award-string-row span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: #aeb7ba;
  font-weight: 850;
}

.award-string-row strong {
  color: #f3f6f6;
  font-size: 1.55rem;
  line-height: 1;
}

.award-string-row.active strong {
  color: #00e5ff;
  text-shadow: 0 0 14px rgba(0, 216, 255, 0.42);
}

.award-string-row em,
.award-string-row b {
  color: #bdc6c9;
  font-style: normal;
  font-weight: 750;
}

.award-string-row svg {
  width: 19px;
  height: 19px;
  color: #c1a17b;
}

.tuner-mode-block {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.tuner-mode-block > span,
.tuner-helper-grid span,
.tuner-bottom-panel > div > span {
  color: #a9dbe2;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.06em;
}

.tuner-mode-block > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
}

.tuner-mode-block button {
  min-height: 36px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.035);
  color: #dfe7e8;
  cursor: pointer;
}

.tuner-mode-block button.active {
  background: rgba(0, 216, 255, 0.14);
  color: #00e5ff;
  box-shadow: inset 0 0 0 1px #00d8ff;
}

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

.tuner-helper-grid button {
  min-height: 56px;
  display: grid;
  justify-items: start;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: #edf4f5;
  padding: 10px;
  cursor: pointer;
}

.tuner-helper-grid button svg {
  color: #00d8ff;
}

.tuner-helper-grid button strong {
  font-size: 0.88rem;
}

.tuner-helper-grid button span {
  color: #adb6ba;
  letter-spacing: 0;
  font-weight: 700;
}

.tuner-helper-grid button.active {
  border-color: rgba(0, 216, 255, 0.32);
}

.tuner-bottom-panel {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  display: grid;
  grid-template-columns: 0.85fr 0.72fr 1.22fr;
  gap: 0;
  overflow: hidden;
}

.tuner-bottom-panel > div {
  min-width: 0;
  display: grid;
  grid-template-rows: 28px minmax(0, 1fr);
  gap: 6px;
  padding: 12px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.085);
}

.tuner-bottom-panel > div:last-child {
  border-right: 0;
}

.tuner-recent-notes div {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.tuner-recent-notes div span {
  min-width: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.tuner-recent-notes strong {
  color: #eaf8fb;
  font-size: 1.05rem;
}

.tuner-recent-notes em {
  color: #bfc8ca;
  font-style: normal;
}

.tuner-waveform {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
}

.tuner-waveform i {
  width: 3px;
  height: var(--h);
  min-height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #00efff, #008a9a);
  box-shadow: 0 0 9px rgba(0, 216, 255, 0.32);
}

.tuner-reference-notes div {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 7px;
}

.tuner-reference-notes button {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  color: #f1f5f6;
  font-weight: 850;
  cursor: pointer;
}

.tuner-reference-notes button:hover {
  border-color: rgba(0, 216, 255, 0.55);
  background: rgba(0, 216, 255, 0.12);
}

.tuner-action-dock {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 7px 48px;
}

.tuner-action-dock button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  color: #dfe8ea;
  font-weight: 850;
  cursor: pointer;
}

.tuner-action-dock button:hover,
.tuner-hero-actions > button:hover,
.tuner-mic-pill:hover {
  border-color: rgba(0, 216, 255, 0.46);
  background: rgba(0, 216, 255, 0.1);
}

@media (max-width: 1180px) {
  .tuner-workbench {
    grid-template-columns: minmax(500px, 1.35fr) minmax(300px, 0.95fr);
    grid-template-rows: minmax(0, 1fr) 104px 54px;
  }

  .award-tuner-console {
    grid-template-rows: minmax(290px, 1fr) 154px;
    padding: 12px;
  }

  .tuner-console-controls {
    grid-template-columns: 132px minmax(180px, 1fr) 170px;
  }

  .tuner-helper-grid {
    grid-template-columns: 1fr;
  }

  .tuner-helper-grid button {
    min-height: 52px;
  }
}

@media (max-width: 980px) {
  .app-frame.view-tuner .workspace-main {
    overflow: auto;
  }

  .tuner-page {
    height: auto;
    min-height: 100%;
    grid-template-columns: 118px minmax(0, 1fr);
    overflow: visible;
  }

  .tuner-page .piano-stage-rail {
    min-height: 680px;
  }

  .tuner-main {
    height: auto;
    min-height: 680px;
    overflow: visible;
  }

  .tuner-hero {
    flex-wrap: wrap;
    min-height: 118px;
    align-items: start;
  }

  .tuner-hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .tuner-workbench {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    overflow: visible;
  }

  .award-tuner-console {
    min-height: 430px;
    grid-template-rows: minmax(250px, 1fr) 118px;
  }

  .tuner-side-panel {
    grid-column: 1;
    grid-row: auto;
    min-height: 440px;
  }

  .award-string-list {
    max-height: 286px;
  }

  .tuner-bottom-panel,
  .tuner-action-dock {
    grid-column: 1;
    grid-row: auto;
  }

  .tuner-bottom-panel {
    min-height: 132px;
    grid-template-columns: 1fr;
  }

  .tuner-bottom-panel > div {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.085);
  }

  .tuner-bottom-panel > div:last-child {
    border-bottom: 0;
  }

  .tuner-reference-notes div {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .tuner-action-dock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
  }
}

@media (max-width: 1180px) {
  .home-dashboard {
    grid-template-rows: auto minmax(204px, 0.85fr) minmax(230px, 0.9fr);
  }

  .home-tool-card {
    padding: 14px;
  }

  .quick-action-grid {
    grid-template-columns: 1fr;
  }

  .quick-action-grid > button,
  .quick-action-split {
    grid-template-columns: 34px minmax(0, 1fr);
    justify-items: start;
    text-align: left;
    align-content: center;
  }

  .quick-action-grid span,
  .quick-action-split span {
    display: none;
  }
}

@media (max-width: 1280px) {
  .quick-action-grid span,
  .quick-action-split span {
    display: none;
  }

  .quick-action-grid > button,
  .quick-action-split {
    align-content: center;
  }
}

@media (max-width: 960px) {
  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-tool-grid {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .home-lower-grid {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .home-tool-drawer {
    left: clamp(12px, 2vw, 18px);
    width: auto;
  }
}

.home-dashboard {
  grid-template-columns: minmax(430px, 1fr) minmax(320px, 40%);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
}

.home-main-column {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(190px, 0.82fr) minmax(318px, 1.18fr);
  gap: clamp(12px, 1.2vw, 18px);
}

.home-live-tools {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(230px, 0.92fr) minmax(300px, 1.08fr);
  gap: clamp(12px, 1.2vw, 18px);
}

.home-lower-grid {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(158px, 0.9fr) minmax(150px, 0.82fr);
}

.home-card {
  overflow: hidden;
}

.home-inline-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background:
    radial-gradient(circle at 52% 24%, rgba(0, 216, 255, 0.11), transparent 38%),
    linear-gradient(155deg, rgba(22, 30, 35, 0.96), rgba(7, 10, 12, 0.98));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.33), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  padding: 12px;
  overflow: hidden;
}

.home-inline-panel > header {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-inline-panel h3 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 1rem;
}

.home-inline-panel h3 svg {
  color: #00d8ff;
}

.home-inline-panel > header button,
.inline-piano-toolbar button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
  color: #dceff2;
  cursor: pointer;
}

.inline-piano-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.inline-piano-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inline-piano-toolbar > span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #aeb8c0;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 750;
}

.inline-piano-toolbar > div {
  display: flex;
  gap: 6px;
}

.inline-piano-keys {
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 9px;
}

.inline-piano-keys > div {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(62px, 1fr));
  gap: 5px;
}

.inline-piano-keys .piano-octave {
  border-radius: 7px;
}

.inline-piano-keys .piano-key span {
  display: none;
  font-size: 0.58rem;
  bottom: 4px;
}

.inline-piano-keys .piano-key.black span {
  display: none;
}

.inline-piano-readout {
  min-height: 54px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.inline-piano-readout span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.inline-piano-readout small {
  color: #8e98a3;
  font-size: 0.7rem;
}

.inline-piano-readout strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.inline-tuner-panel {
  grid-template-rows: auto auto minmax(126px, 1fr) auto;
}

.inline-tuner-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(118px, auto);
  gap: 8px;
  align-items: center;
}

.inline-tuner-controls > span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
  color: #aeb8c0;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-tuner-controls .mic-state {
  grid-column: auto;
  grid-row: auto;
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.inline-tuner-meter {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.inline-tuner-meter .tuner-meter {
  width: 100%;
  max-width: 430px;
  height: 150px;
}

.inline-tuner-meter .tuner-meter::before {
  left: 6%;
  right: 6%;
  top: 15px;
  height: 230px;
  border-width: 2px;
}

.inline-tuner-meter .tuner-needle {
  bottom: 22px;
  height: 98px;
}

.inline-tuner-meter .tuner-scale {
  bottom: 16px;
  padding: 0 10px;
}

.inline-tuner-meter .tuner-readout {
  bottom: 8px;
}

.inline-tuner-meter .tuner-readout strong {
  font-size: clamp(2.45rem, 5.2vw, 3.6rem);
}

.inline-tuner-meter .tuner-readout span {
  margin-top: 2px;
  font-size: 0.92rem;
}

.inline-tuner-meter .tuner-readout p {
  margin-top: 2px;
  font-size: 0.74rem;
}

.inline-tuner-panel .tuner-string-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.inline-tuner-panel .tuner-string-card {
  min-height: 64px;
  border-radius: 9px;
}

.inline-tuner-panel .tuner-string-card strong {
  font-size: 1rem;
}

.inline-tuner-panel .tuner-string-card span,
.inline-tuner-panel .tuner-string-card em {
  font-size: 0.68rem;
}

@media (max-width: 1120px) {
  .home-dashboard {
    grid-template-columns: minmax(400px, 1fr) minmax(300px, 39%);
  }

  .home-lower-grid {
    grid-template-columns: 1fr;
  }

  .quick-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .home-workspace-main {
    overflow: auto;
  }

  .home-dashboard {
    height: auto;
    min-height: 100%;
    grid-template-columns: 1fr;
  }

  .home-main-column,
  .home-live-tools {
    grid-template-rows: none;
  }
}

.app-frame.view-home .library-category-row {
  grid-template-columns: 42px minmax(0, 1fr) auto 18px;
  padding-left: 18px;
  padding-right: 14px;
}

.app-frame.view-home .library-category-row span {
  font-size: 1rem;
}

.home-nav-row b:empty {
  display: none;
}

.home-tool-card {
  grid-template-rows: auto minmax(118px, 1fr) auto;
}

.home-tool-visual {
  align-self: stretch;
}

.home-tool-metronome .analog-metronome-art {
  width: min(88%, 170px);
  aspect-ratio: 0.88;
}

.home-tool-metronome .metro-body {
  inset: 2% 18% 0;
}

.home-tool-piano .piano-card-art {
  width: min(95%, 220px);
  transform: translateY(4px) scale(1.08);
}

.home-tool-tuner .tuner-card-art {
  width: min(96%, 230px);
  height: 132px;
  grid-template-columns: 1fr 62px 1fr;
}

.home-tool-tuner .tuner-wave {
  height: 88px;
}

.home-tool-tuner .tuner-fork {
  width: 50px;
  height: 116px;
}

.quick-action-grid > button,
.quick-action-split {
  padding: 10px 8px;
  gap: 6px;
}

.quick-action-grid svg,
.quick-action-split > svg {
  width: 28px;
  height: 28px;
}

.quick-action-grid strong,
.quick-action-split strong {
  font-size: 0.84rem;
}

.quick-action-grid span,
.quick-action-split span {
  font-size: 0.7rem;
}

.inline-piano-keys > div {
  gap: 3px;
}

.inline-piano-keys .piano-octave {
  border-radius: 5px;
  border-color: rgba(255, 255, 255, 0.24);
}

.inline-piano-keys .piano-key span {
  display: none;
}

.inline-piano-keys .octave-label {
  left: 4px;
  bottom: 3px;
  color: rgba(0, 0, 0, 0.54);
  font-size: 0.58rem;
}

.inline-tuner-panel {
  grid-template-rows: auto auto minmax(156px, 1fr) auto;
}

.inline-tuner-meter .tuner-meter {
  height: 176px;
}

.inline-tuner-meter .tuner-meter::before {
  top: 8px;
  height: 260px;
}

.inline-tuner-meter .tuner-needle {
  bottom: 24px;
  height: 116px;
}

.inline-tuner-meter .tuner-scale {
  bottom: 18px;
}

.inline-tuner-meter .tuner-readout {
  bottom: 26px;
}

.inline-tuner-meter .tuner-readout strong {
  font-size: clamp(3rem, 5.7vw, 4.3rem);
}

.inline-tuner-meter .tuner-readout p {
  display: none;
}

.inline-tuner-panel .tuner-string-card {
  min-height: 58px;
}

/* Reference dashboard layout */
.app-frame.view-home {
  grid-template-columns: 257px minmax(0, 1fr);
}

.app-frame.view-home .ireal-brand {
  min-height: 146px;
  padding: 26px 28px 22px;
}

.app-frame.view-home .ireal-brand h1 {
  text-align: left;
  font-size: 1.45rem;
}

.app-frame.view-home .ireal-brand p {
  text-align: left;
  font-size: 0.82rem;
}

.app-frame.view-home .brand-icon:first-child {
  border: 1px solid rgba(0, 216, 255, 0.75);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0, 216, 255, 0.16), rgba(0, 216, 255, 0.04));
}

.app-frame.view-home .workspace {
  background:
    radial-gradient(circle at 73% 7%, rgba(0, 216, 255, 0.13), transparent 28%),
    radial-gradient(circle at 34% 46%, rgba(31, 182, 166, 0.08), transparent 31%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    #090d0f;
  background-size: auto, auto, 38px 38px, 38px 38px, auto;
}

.app-frame.view-home .library-category-row {
  grid-template-columns: 44px minmax(0, 1fr);
  min-height: 64px;
  padding: 0 18px 0 26px;
  border-bottom-color: rgba(255, 255, 255, 0.055);
  background: transparent;
}

.app-frame.view-home .library-category-row svg:last-child,
.app-frame.view-home .library-category-row b {
  display: none;
}

.app-frame.view-home .library-category-row span {
  font-size: 1rem;
  font-weight: 720;
}

.app-frame.view-home .home-nav-row.active {
  margin: 0 18px;
  min-height: 54px;
  border: 1px solid rgba(0, 216, 255, 0.78);
  border-radius: 12px;
  background: rgba(0, 216, 255, 0.13);
  box-shadow: 0 0 20px rgba(0, 216, 255, 0.24), inset 0 0 22px rgba(0, 216, 255, 0.08);
}

.app-frame.view-home .sidebar-cloud-status {
  margin: auto 18px 64px;
}

.home-workspace-main {
  padding: 24px 10px 20px 30px;
}

.home-dashboard {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: 54px minmax(270px, 1fr);
  grid-template-areas:
    "hero hero hero hero hero hero hero hero hero hero hero hero"
    "tools tools tools tools tools tools tools tools tools tools tools tools";
  gap: 12px 14px;
}

.home-hero {
  grid-area: hero;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 42%);
  gap: 12px;
}

.home-hero h2 {
  font-size: 1.48rem;
}

.home-hero p {
  font-size: 0.88rem;
}

.home-search {
  min-height: 44px;
}

.home-tool-grid {
  grid-area: tools;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.home-tool-card,
.home-card,
.home-inline-panel {
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 28%, rgba(0, 216, 255, 0.105), transparent 42%),
    linear-gradient(150deg, rgba(24, 33, 38, 0.95), rgba(9, 13, 15, 0.98));
  border-color: rgba(255, 255, 255, 0.105);
}

.home-tool-card {
  min-height: 0;
  grid-template-rows: auto minmax(120px, 1fr) 42px;
  padding: 22px;
}

.home-tool-copy h3 {
  margin-top: 10px;
  font-size: 1.22rem;
}

.home-tool-copy p {
  max-width: 18ch;
  font-size: 0.88rem;
}

.home-ref-asset {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 20px 22px rgba(0, 0, 0, 0.42));
}

.home-ref-metronome {
  width: min(94%, 184px);
  height: min(100%, 190px);
}

.home-ref-piano {
  width: min(116%, 236px);
  height: min(100%, 182px);
  transform: translateX(-4%) translateY(4px);
}

.home-ref-recordings {
  width: min(132%, 270px);
  height: min(100%, 188px);
  object-fit: cover;
  object-position: 22% 50%;
  border-radius: 10px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.45), 0 0 24px rgba(0, 216, 255, 0.16);
}

.home-ref-tuner {
  width: min(132%, 270px);
  height: min(100%, 188px);
  object-fit: cover;
  object-position: 42% 48%;
  border-radius: 10px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.45), 0 0 24px rgba(0, 216, 255, 0.18);
}

.home-tool-open {
  min-height: 40px;
  border-radius: 8px;
}

.last-setlist-card {
  grid-area: last;
}

.quick-actions-card {
  grid-area: quick;
}

.last-setlist-card,
.quick-actions-card {
  padding: 16px 20px;
}

.last-setlist-songs {
  gap: 0;
}

.last-setlist-songs li {
  min-height: 26px;
}

.quick-action-grid {
  gap: 10px;
}

.quick-action-grid > button,
.quick-action-split {
  min-height: 86px;
}

.inline-piano-panel {
  grid-area: piano;
  grid-template-rows: 36px 38px minmax(0, 1fr) 54px;
  gap: 8px;
  padding: 10px;
}

.inline-piano-panel > header,
.inline-tuner-panel > header {
  min-height: 34px;
}

.inline-piano-panel h3,
.inline-tuner-panel h3 {
  font-size: 1rem;
}

.inline-piano-toolbar > span {
  min-height: 32px;
  gap: 8px;
}

.inline-piano-toolbar > span svg {
  width: 14px;
  height: 14px;
}

.inline-piano-toolbar > div {
  gap: 7px;
}

.inline-piano-toolbar button {
  width: 34px;
  height: 34px;
}

.inline-piano-keys {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  min-height: 0;
}

.piano-strip-row {
  min-height: 0;
  display: flex;
  gap: 5px;
}

.inline-piano-keys > .piano-strip-row {
  display: flex;
  grid-template-columns: none;
  width: 100%;
  gap: 5px;
}

.piano-strip-octave {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  border: 2px solid #050607;
  border-radius: 6px;
  background: #050607;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.13);
}

.piano-strip-whites {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.piano-strip-key {
  position: relative;
  min-width: 0;
  border: 0;
  cursor: pointer;
}

.piano-strip-key.white {
  background: linear-gradient(180deg, #f8f8f3 0%, #dadbd8 82%, #b8b9b7 100%);
  box-shadow: inset 0 -7px 12px rgba(0, 0, 0, 0.18);
}

.piano-strip-blacks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.piano-strip-key.black {
  position: absolute;
  top: 0;
  width: 8.7%;
  height: 62%;
  transform: translateX(-50%);
  z-index: 2;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(180deg, #2a2c2e, #070808 82%);
  border: 1px solid #000;
  box-shadow: inset 0 -6px 10px rgba(255, 255, 255, 0.05), 0 3px 6px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.piano-strip-key.active.white,
.piano-strip-row:first-child .piano-strip-key.active {
  background: linear-gradient(180deg, #c6fbff, #00d8ff 54%, #0f6f7b);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.44), 0 0 18px rgba(0, 216, 255, 0.74);
}

.piano-strip-row:nth-child(2) .piano-strip-key.active {
  background: linear-gradient(180deg, #f4c6ff, #d759ff 55%, #6930a6);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.44), 0 0 18px rgba(214, 78, 255, 0.7);
}

.piano-strip-label {
  position: absolute;
  left: 6px;
  bottom: 5px;
  z-index: 3;
  color: rgba(0, 0, 0, 0.58);
  font-size: 0.72rem;
  font-weight: 800;
  pointer-events: none;
}

.inline-piano-readout {
  min-height: 52px;
  padding: 10px 14px;
}

.inline-tuner-panel {
  grid-area: tuner;
  grid-template-rows: 40px 42px minmax(0, 1fr) 84px;
  padding: 18px;
}

.inline-tuner-controls {
  grid-template-columns: minmax(130px, 1fr) minmax(120px, 1fr) minmax(142px, auto);
}

.inline-tuner-meter .tuner-meter {
  max-width: 560px;
  height: 210px;
}

.inline-tuner-meter .tuner-meter::before {
  left: 3%;
  right: 3%;
  top: 10px;
  height: 330px;
}

.inline-tuner-meter .tuner-needle {
  bottom: 28px;
  height: 148px;
}

.inline-tuner-meter .tuner-readout {
  bottom: 24px;
}

.inline-tuner-meter .tuner-readout strong {
  font-size: clamp(3.8rem, 6.1vw, 5.1rem);
}

.inline-tuner-panel .tuner-string-grid {
  align-self: end;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.inline-tuner-panel .tuner-string-card {
  min-height: 72px;
}

@media (max-width: 1180px) {
  .home-dashboard {
    grid-template-rows: 54px minmax(250px, 1fr) minmax(166px, 0.66fr) minmax(122px, 0.48fr);
  }

  .home-tool-card {
    padding: 18px;
  }

  .inline-tuner-panel {
    padding: 14px;
  }
}

/* Reference dashboard fit pass */
.app-frame.view-home .home-tool-copy > span {
  display: none;
}

.app-frame.view-home .home-tool-card {
  grid-template-rows: auto minmax(76px, 1fr) 38px;
  gap: 8px;
  padding: 18px 20px;
}

.app-frame.view-home .home-tool-copy h3 {
  margin: 0 0 7px;
  font-size: clamp(1.04rem, 1.42vw, 1.38rem);
  line-height: 1.08;
}

.app-frame.view-home .home-tool-copy p {
  max-width: 20ch;
  font-size: clamp(0.78rem, 0.92vw, 0.94rem);
  line-height: 1.36;
}

.app-frame.view-home .home-tool-visual {
  align-self: stretch;
  overflow: hidden;
}

.app-frame.view-home .home-tool-open {
  min-height: 38px;
  height: 38px;
  align-self: end;
}

.app-frame.view-home .home-ref-metronome {
  width: min(94%, 164px);
  height: min(100%, 136px);
}

.app-frame.view-home .home-ref-piano {
  width: min(118%, 190px);
  height: min(100%, 126px);
  transform: translateX(-5%) translateY(2px);
}

.app-frame.view-home .home-ref-recordings {
  width: min(132%, 220px);
  height: min(100%, 130px);
  object-position: 21% 52%;
  transform: translateY(2px);
}

.app-frame.view-home .home-ref-tuner {
  width: min(132%, 220px);
  height: min(100%, 130px);
  object-position: 43% 49%;
}

.app-frame.view-home .inline-piano-panel {
  grid-template-rows: 34px 34px minmax(0, 1fr) 48px;
  gap: 8px;
  padding: 10px;
}

.app-frame.view-home .inline-piano-panel > * {
  min-width: 0;
  max-width: 100%;
}

.app-frame.view-home .inline-piano-toolbar {
  width: 100%;
  min-width: 0;
  gap: 8px;
  overflow: hidden;
}

.app-frame.view-home .inline-piano-toolbar > span {
  flex: 0 1 auto;
  min-width: 80px;
  min-height: 31px;
  padding: 0 9px;
  white-space: nowrap;
}

.app-frame.view-home .inline-piano-toolbar > div {
  flex: 0 0 auto;
  gap: 5px;
}

.app-frame.view-home .inline-piano-toolbar button,
.app-frame.view-home .home-inline-panel > header button {
  width: 31px;
  height: 31px;
  border-radius: 8px;
}

.app-frame.view-home .inline-piano-keys {
  gap: 9px;
}

.app-frame.view-home .piano-strip-row {
  gap: 0;
  overflow: hidden;
  border: 2px solid #050607;
  border-radius: 7px;
  background: #050607;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.13);
}

.app-frame.view-home .piano-strip-octave {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.app-frame.view-home .piano-strip-whites {
  gap: 1px;
}

.app-frame.view-home .inline-piano-readout {
  min-height: 48px;
  padding: 8px 12px;
}

.app-frame.view-home .inline-piano-readout small {
  font-size: 0.68rem;
}

.app-frame.view-home .inline-piano-readout strong {
  font-size: 0.98rem;
}

@media (min-height: 880px) and (min-width: 1280px) {
  .app-frame.view-home .workspace {
    grid-template-rows: 1fr;
  }

  .app-frame.view-home .home-workspace-main {
    height: 100%;
    overflow: hidden;
  }

  .app-frame.view-home .home-dashboard {
    grid-template-rows: 54px minmax(400px, 1fr) minmax(260px, 0.62fr) minmax(192px, 0.46fr);
    grid-template-areas:
      "hero hero hero hero hero hero hero piano piano piano piano piano"
      "tools tools tools tools tools tools tools piano piano piano piano piano"
      "last last last last last tuner tuner tuner tuner tuner tuner tuner"
      "quick quick quick quick quick tuner tuner tuner tuner tuner tuner tuner";
  }

  .app-frame.view-home .home-hero {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 46%);
  }

  .app-frame.view-home .home-tool-card {
    grid-template-rows: auto minmax(155px, 1fr) 42px;
    gap: 12px;
    padding: 24px;
  }

  .app-frame.view-home .home-tool-copy h3 {
    font-size: 1.3rem;
    line-height: 1.12;
  }

  .app-frame.view-home .home-tool-copy p {
    font-size: 0.92rem;
    line-height: 1.42;
  }

  .app-frame.view-home .home-tool-open {
    min-height: 42px;
    height: 42px;
  }

  .app-frame.view-home .home-ref-metronome {
    width: min(94%, 190px);
    height: min(100%, 230px);
  }

  .app-frame.view-home .home-ref-piano {
    width: min(118%, 238px);
    height: min(100%, 214px);
  }

  .app-frame.view-home .home-ref-recordings {
    width: min(132%, 270px);
    height: min(100%, 212px);
  }

  .app-frame.view-home .home-ref-tuner {
    width: min(132%, 270px);
    height: min(100%, 212px);
  }

  .app-frame.view-home .inline-piano-panel {
    grid-template-rows: 40px 39px minmax(0, 1fr) 60px;
    gap: 10px;
    padding: 12px;
  }

  .app-frame.view-home .inline-piano-toolbar button,
  .app-frame.view-home .home-inline-panel > header button {
    width: 34px;
    height: 34px;
  }
}

.app-frame.view-home .quick-action-split > div {
  display: none;
}

.app-frame.view-home .quick-action-grid > button,
.app-frame.view-home .quick-action-split {
  min-height: 0;
  align-content: center;
}

.app-frame.view-home .inline-tuner-meter .tuner-meter::before {
  border: 0;
  background: conic-gradient(
    from 235deg at 50% 100%,
    #f1503f 0deg,
    #ff9f45 42deg,
    #39df70 78deg,
    #00d8ff 125deg,
    rgba(255, 255, 255, 0.16) 126deg,
    rgba(255, 255, 255, 0.16) 180deg,
    transparent 181deg
  );
  -webkit-mask: radial-gradient(ellipse at 50% 100%, transparent 0 64%, #000 65% 68%, transparent 69%);
  mask: radial-gradient(ellipse at 50% 100%, transparent 0 64%, #000 65% 68%, transparent 69%);
}

.app-frame.view-home .inline-tuner-meter .tuner-scale {
  bottom: 36px;
}

.app-frame.view-home .inline-tuner-meter .tuner-readout {
  bottom: 42px;
}

@media (max-height: 879px), (max-width: 1279px) {
  .app-frame.view-home .inline-tuner-meter .tuner-readout {
    bottom: 16px;
  }

  .app-frame.view-home .inline-tuner-meter .tuner-readout strong {
    font-size: clamp(2.35rem, 4.2vw, 3.35rem);
  }

  .app-frame.view-home .inline-tuner-meter .tuner-scale {
    bottom: 20px;
  }
}

/* Home and recordings cleanup pass */
.app-frame.view-home .home-dashboard {
  grid-template-rows: 54px minmax(250px, 1fr);
  grid-template-areas:
    "hero hero hero hero hero hero hero hero hero hero hero hero"
    "tools tools tools tools tools tools tools tools tools tools tools tools";
}

.app-frame.view-home .home-tool-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.app-frame.view-home .inline-piano-panel {
  display: none;
}

.app-frame.view-home .home-tool-card {
  padding: clamp(16px, 1.45vw, 20px);
}

.app-frame.view-home .home-tool-copy h3 {
  font-size: clamp(1rem, 1.18vw, 1.22rem);
}

.app-frame.view-home .home-tool-copy p {
  font-size: clamp(0.76rem, 0.84vw, 0.88rem);
}

.app-frame.view-home .home-ref-metronome,
.app-frame.view-home .home-ref-piano,
.app-frame.view-home .home-ref-recordings,
.app-frame.view-home .home-ref-tuner {
  max-height: 136px;
}

.app-frame.view-recordings .workspace-main {
  padding: 12px 16px 14px;
}

.recordings-shell {
  grid-template-columns: clamp(216px, 19vw, 252px) minmax(0, 1fr);
  gap: 14px;
}

.app-frame.view-recordings .piano-stage-rail {
  width: auto;
  max-width: 100%;
  overflow: hidden;
}

.app-frame.view-recordings .piano-rail-item {
  width: 100%;
}

.recordings-main {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
}

.recordings-hero {
  min-height: 50px;
  padding: 0;
}

.recordings-hero h2 {
  font-size: clamp(1.45rem, 2.1vw, 2.05rem);
}

.recordings-hero p {
  margin-top: 4px;
  font-size: 0.9rem;
}

.recording-status-strip {
  min-height: 74px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.recording-status-strip article {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-content: center;
  gap: 2px 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background:
    radial-gradient(circle at 15% 0%, rgba(0, 216, 255, 0.12), transparent 45%),
    rgba(7, 13, 15, 0.88);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.recording-status-strip article.active {
  border-color: rgba(255, 84, 61, 0.72);
  box-shadow: 0 0 22px rgba(255, 84, 61, 0.18), inset 0 0 0 1px rgba(255, 84, 61, 0.08);
}

.recording-status-strip svg {
  grid-row: 1 / 4;
  align-self: center;
  width: 24px;
  height: 24px;
  color: #00d8ff;
}

.recording-status-strip span,
.recording-status-strip em {
  min-width: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 760;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recording-status-strip strong {
  min-width: 0;
  color: #f4f8f9;
  font-size: 0.88rem;
  font-weight: 920;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recordings-grid {
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  grid-template-rows: minmax(0, 1fr) minmax(158px, 0.48fr);
  gap: 10px;
}

.record-console {
  grid-template-columns: minmax(150px, 0.72fr) minmax(0, 1.28fr);
  padding: 8px;
}

.record-console-screen {
  grid-template-rows: auto auto auto minmax(44px, 1fr) auto auto;
  gap: 6px;
  padding: 18px 14px 8px 16px;
}

.record-time {
  font-size: clamp(2.45rem, 5vw, 4.2rem);
}

.record-time-label {
  font-size: 0.86rem;
}

.record-waveform {
  min-height: 44px;
}

.record-levels {
  gap: 4px 8px;
}

.record-level-meter i {
  height: 10px;
}

.record-transport {
  min-height: 70px;
  gap: 14px;
  padding: 8px 18px;
}

.record-round {
  font-size: 0.78rem;
}

.record-round > svg {
  width: 42px;
  height: 42px;
  padding: 10px;
}

.record-round.primary > svg {
  width: 58px;
  height: 58px;
  padding: 17px;
}

.record-form-card {
  gap: 8px;
  padding: 12px;
}

.record-form-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: 8px 10px;
}

.record-tags-field,
.record-description-field {
  grid-column: 1 / -1;
}

.record-form-card input,
.record-form-card textarea {
  min-height: 36px;
}

.record-form-card textarea {
  min-height: 48px;
}

.record-save-row {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 184px);
  gap: 10px;
}

.record-save-btn {
  min-height: 42px;
}

.record-list-card {
  padding: 9px;
}

.record-list-card > header {
  min-height: 42px;
  grid-template-columns: minmax(94px, 0.8fr) minmax(130px, 1fr) 38px;
  gap: 8px;
}

.record-list-card > header strong {
  font-size: 0.98rem;
}

.record-search {
  min-height: 36px;
}

.recording-row {
  min-height: 58px;
  grid-template-columns: 38px minmax(0, 1fr) 56px 56px 30px;
  gap: 8px;
  padding: 6px 7px;
}

.recording-row-play {
  width: 34px;
  height: 34px;
}

.record-player-card {
  grid-template-rows: auto minmax(42px, 0.72fr) auto auto auto;
  gap: 8px;
  padding: 12px;
}

.record-player-controls {
  grid-template-columns: 34px 34px 50px 34px 58px minmax(82px, 1fr);
  gap: 7px;
}

.record-player-main {
  width: 50px;
  height: 50px;
  min-height: 50px !important;
}

.record-player-card footer {
  gap: 6px;
}

.record-player-card footer button {
  min-height: 34px;
  font-size: 0.78rem;
}

@media (max-width: 1160px), (max-height: 760px) {
  .recordings-shell {
    grid-template-columns: 214px minmax(0, 1fr);
    gap: 10px;
  }

  .app-frame.view-recordings .piano-stage-rail {
    padding: 12px;
    gap: 11px;
  }

  .app-frame.view-recordings .piano-rail-brand {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .app-frame.view-recordings .piano-rail-brand > span {
    width: 42px;
    height: 42px;
  }

  .app-frame.view-recordings .piano-rail-brand strong {
    font-size: 1.05rem;
  }

  .app-frame.view-recordings .piano-rail-item {
    min-height: 46px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
    padding: 0 10px;
  }

  .recording-status-strip {
    min-height: 60px;
  }

  .recording-status-strip article {
    padding: 8px 9px;
  }

  .recording-status-strip span,
  .recording-status-strip em {
    font-size: 0.66rem;
  }

  .recording-status-strip strong {
    font-size: 0.78rem;
  }

  .record-console {
    grid-template-columns: minmax(120px, 0.56fr) minmax(0, 1.44fr);
  }

  .record-mic-panel img {
    transform: scale(1.78);
  }
}

/* Professional animated tuner pass */
.app-frame.view-tuner .workspace-main {
  padding: 10px 14px 14px;
}

.app-frame.view-tuner .metronome-workspace {
  background:
    radial-gradient(circle at 56% 14%, rgba(0, 216, 255, 0.1), transparent 30%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.023) 1px, transparent 1px),
    #080b0c;
  background-size: auto, 38px 38px, 38px 38px, auto;
}

.app-frame.view-tuner .tuner-main {
  border-color: rgba(193, 137, 73, 0.22);
  background:
    radial-gradient(circle at 48% 10%, rgba(70, 255, 142, 0.08), transparent 28%),
    linear-gradient(145deg, rgba(20, 22, 21, 0.98), rgba(5, 7, 8, 0.98));
}

.app-frame.view-tuner .tuner-hero {
  min-height: 68px;
  padding: 12px 18px 10px;
}

.app-frame.view-tuner .tuner-hero h2 {
  font-size: clamp(1.45rem, 2.15vw, 2.05rem);
}

.app-frame.view-tuner .tuner-workbench {
  grid-template-columns: minmax(560px, 1.45fr) minmax(330px, 0.82fr);
  grid-template-rows: minmax(0, 1fr) 112px 48px;
}

.app-frame.view-tuner .award-tuner-console {
  isolation: isolate;
  grid-template-rows: minmax(300px, 1fr) 126px;
  padding: 14px;
  border: 2px solid rgba(10, 10, 9, 0.92);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 39%, rgba(59, 255, 114, 0.12), transparent 20%),
    radial-gradient(circle at 82% 38%, rgba(0, 216, 255, 0.17), transparent 24%),
    radial-gradient(circle at 16% 40%, rgba(255, 104, 45, 0.14), transparent 24%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
    linear-gradient(145deg, #24221d 0%, #0a0a09 54%, #1a1712 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 148, 0.13),
    inset 0 0 42px rgba(0, 0, 0, 0.72),
    0 22px 54px rgba(0, 0, 0, 0.44);
}

.app-frame.view-tuner .award-tuner-console::after {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 0;
  border: 1px solid rgba(216, 158, 84, 0.25);
  border-radius: 14px;
  pointer-events: none;
}

.app-frame.view-tuner .award-arc {
  z-index: 1;
  border: 1px solid rgba(232, 169, 95, 0.22);
  border-bottom-color: rgba(232, 169, 95, 0.34);
  border-radius: 18px 18px 8px 8px;
  background:
    radial-gradient(ellipse at 50% 68%, rgba(90, 255, 124, 0.18), transparent 19%),
    radial-gradient(ellipse at 49% 88%, rgba(0, 216, 255, 0.19), transparent 34%),
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.035), transparent 40%),
    linear-gradient(180deg, rgba(7, 8, 8, 0.86), rgba(4, 4, 4, 0.88));
  box-shadow:
    inset 0 0 54px rgba(0, 0, 0, 0.64),
    inset 0 -26px 30px rgba(205, 122, 44, 0.12);
}

.app-frame.view-tuner .award-arc::before {
  left: 6%;
  right: 6%;
  bottom: -2%;
  height: 122%;
  border-width: 2px;
  border-color: rgba(239, 178, 96, 0.36);
  background:
    conic-gradient(
      from 230deg at 50% 100%,
      rgba(244, 91, 48, 0.9) 0deg,
      rgba(255, 169, 76, 0.9) 48deg,
      rgba(111, 255, 98, 0.95) 86deg,
      rgba(56, 245, 255, 0.95) 132deg,
      transparent 133deg
    );
  -webkit-mask: radial-gradient(ellipse at 50% 100%, transparent 0 63%, #000 64% 67%, transparent 68%);
  mask: radial-gradient(ellipse at 50% 100%, transparent 0 63%, #000 64% 67%, transparent 68%);
  filter: drop-shadow(0 0 18px rgba(0, 216, 255, 0.24));
}

.app-frame.view-tuner .award-arc::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -1%;
  height: 119%;
  border-radius: 999px 999px 0 0;
  background:
    repeating-conic-gradient(
      from 230deg at 50% 100%,
      rgba(255, 224, 159, 0.82) 0deg 0.7deg,
      transparent 0.8deg 4.4deg
    );
  -webkit-mask: radial-gradient(ellipse at 50% 100%, transparent 0 58%, #000 59% 60%, transparent 61%);
  mask: radial-gradient(ellipse at 50% 100%, transparent 0 58%, #000 59% 60%, transparent 61%);
  opacity: 0.82;
  pointer-events: none;
}

.app-frame.view-tuner .award-arc-glow {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 12%;
  width: 116px;
  height: 190px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(82, 255, 118, 0.38), rgba(82, 255, 118, 0.08) 42%, transparent 70%);
  filter: blur(2px);
  opacity: 0.72;
  animation: tunerGlowBreath 2.8s ease-in-out infinite;
  pointer-events: none;
}

.app-frame.view-tuner .award-arc-scale {
  z-index: 3;
  left: 13%;
  right: 13%;
  top: 14%;
  color: #ff8d3a;
  text-shadow: 0 0 12px rgba(255, 125, 48, 0.32);
}

.app-frame.view-tuner .award-arc-scale span:nth-child(3) {
  color: #ffe36d;
  text-shadow: 0 0 15px rgba(117, 255, 104, 0.58);
}

.app-frame.view-tuner .award-arc-scale span:nth-child(4),
.app-frame.view-tuner .award-arc-scale span:nth-child(5) {
  color: #37f4ff;
  text-shadow: 0 0 13px rgba(55, 244, 255, 0.36);
}

.app-frame.view-tuner .award-needle {
  z-index: 8;
  bottom: 30%;
  height: min(35%, 170px);
  width: 4px;
  background: linear-gradient(180deg, #f9e3a2 0%, #ffd17a 68%, #7b4a1e 100%);
  box-shadow:
    0 0 15px rgba(255, 217, 127, 0.56),
    0 0 24px rgba(0, 216, 255, 0.2);
  transition: transform 120ms ease-out;
}

.app-frame.view-tuner .award-tuner-console.searching .award-needle {
  animation: tunerNeedleSearch 2.7s ease-in-out infinite;
}

.app-frame.view-tuner .award-note-readout {
  z-index: 6;
  margin-top: 78px;
}

.app-frame.view-tuner .award-note-readout strong {
  color: #7effed;
  text-shadow:
    0 0 12px rgba(126, 255, 237, 0.88),
    0 0 34px rgba(0, 216, 255, 0.42);
  animation: tunerNotePulse 2.4s ease-in-out infinite;
}

.app-frame.view-tuner .award-note-readout span {
  color: #48efff;
  text-shadow: 0 0 12px rgba(72, 239, 255, 0.4);
}

.app-frame.view-tuner .tuner-cent-readout {
  bottom: 24%;
  text-shadow: 0 0 13px currentColor;
}

.app-frame.view-tuner .tuner-accuracy-badge {
  bottom: 14px;
  min-width: 190px;
  min-height: 50px;
  border-color: rgba(226, 158, 86, 0.28);
  background:
    linear-gradient(180deg, rgba(17, 18, 17, 0.98), rgba(5, 6, 6, 0.98));
  color: #f2bb52;
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.55),
    0 0 22px rgba(242, 187, 82, 0.08);
}

.app-frame.view-tuner .tuner-accuracy-badge.tuned {
  color: #63f25e;
  border-color: rgba(99, 242, 94, 0.4);
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.55),
    0 0 26px rgba(99, 242, 94, 0.24);
}

.app-frame.view-tuner .tuner-console-status,
.app-frame.view-tuner .tuner-auto-btn {
  min-height: 48px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 13% 50%, rgba(87, 255, 104, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(24, 25, 21, 0.92), rgba(5, 6, 6, 0.92));
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.52);
}

.app-frame.view-tuner .tuner-console-status.active b,
.app-frame.view-tuner .tuner-auto-btn.active b {
  animation: tunerLedPulse 1.2s ease-in-out infinite;
}

.app-frame.view-tuner .tuner-console-controls {
  grid-template-columns: 150px minmax(220px, 1fr) 210px;
  gap: 12px;
}

.app-frame.view-tuner .tuner-gain-block,
.app-frame.view-tuner .tuner-vu-block,
.app-frame.view-tuner .tuner-calibration-block {
  border-color: rgba(227, 164, 89, 0.18);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 200, 116, 0.08), transparent 45%),
    rgba(8, 8, 7, 0.52);
}

.app-frame.view-tuner .tuner-gain-knob {
  width: 72px;
  height: 72px;
}

.app-frame.view-tuner .tuner-gain-knob b {
  width: 50px;
  height: 50px;
  background:
    radial-gradient(circle at 28% 22%, #fff0c4, #b37b3e 34%, #4e2c13 63%, #0c0907 100%);
}

.app-frame.view-tuner .tuner-vu-meter {
  height: 76px;
  border-color: #23180c;
  background:
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(0, 0, 0, 0.12) 19px 20px),
    radial-gradient(ellipse at 50% 100%, rgba(255, 235, 154, 0.72), transparent 62%),
    linear-gradient(180deg, #d6a963, #6e441c);
}

.app-frame.view-tuner .tuner-vu-meter::before {
  content: "-20   -10   -7   -5   -3   -1   0   +1   +2   +3";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 9px;
  display: flex;
  justify-content: space-between;
  color: #371907;
  font-size: 0.7rem;
  font-weight: 800;
}

.app-frame.view-tuner .tuner-vu-meter i {
  height: 62px;
  transition: transform 90ms ease-out;
}

.app-frame.view-tuner .award-tuner-console.live .tuner-vu-meter {
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.48),
    0 0 24px rgba(239, 178, 96, 0.12);
}

.app-frame.view-tuner .tuner-calibration-control {
  min-height: 44px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.3);
}

.app-frame.view-tuner .tuner-calibration-control input {
  font-size: 1.35rem;
}

@keyframes tunerGlowBreath {
  0%,
  100% {
    opacity: 0.44;
    transform: translateX(-50%) scaleY(0.92);
  }
  50% {
    opacity: 0.92;
    transform: translateX(-50%) scaleY(1.08);
  }
}

@keyframes tunerNotePulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.18);
  }
}

@keyframes tunerLedPulse {
  0%,
  100% {
    opacity: 0.82;
    box-shadow: 0 0 10px rgba(85, 233, 102, 0.55);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 20px rgba(85, 233, 102, 0.92);
  }
}

.app-frame.view-tuner .award-tuner-console {
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(211, 141, 70, 0.46);
  border-radius: 18px;
  background: #080706;
  overflow: hidden;
}

.app-frame.view-tuner .award-tuner-console::after {
  inset: 8px;
  z-index: 2;
  border-color: rgba(235, 169, 91, 0.24);
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.72),
    inset 0 0 42px rgba(0, 0, 0, 0.42);
}

.app-frame.view-tuner .tuner-device-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.08) contrast(1.04) brightness(0.94);
  pointer-events: none;
  user-select: none;
}

.app-frame.view-tuner .award-tuner-console::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 29%, rgba(83, 255, 140, 0.13), transparent 17%),
    radial-gradient(circle at 79% 30%, rgba(0, 226, 255, 0.08), transparent 19%),
    radial-gradient(circle at 23% 31%, rgba(255, 111, 44, 0.08), transparent 18%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.12));
  pointer-events: none;
}

.app-frame.view-tuner .tuner-console-top {
  position: absolute;
  left: 5.8%;
  right: 5.8%;
  top: 5.6%;
  z-index: 6;
  align-items: start;
}

.app-frame.view-tuner .tuner-console-status,
.app-frame.view-tuner .tuner-auto-btn {
  min-width: 124px;
  min-height: 44px;
  border-color: rgba(229, 174, 102, 0.22);
  border-radius: 13px;
  background:
    radial-gradient(circle at 16% 50%, rgba(95, 255, 112, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(20, 21, 17, 0.86), rgba(6, 6, 5, 0.9));
  color: #f1deb5;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(2px);
}

.app-frame.view-tuner .tuner-console-status:not(.active) {
  color: #ffe3a6;
}

.app-frame.view-tuner .award-arc {
  position: absolute;
  inset: 9% 3.4% 34.2%;
  z-index: 5;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-frame.view-tuner .award-arc::before,
.app-frame.view-tuner .award-arc::after,
.app-frame.view-tuner .award-arc-glow,
.app-frame.view-tuner .award-arc-scale {
  display: none;
}

.app-frame.view-tuner .award-needle {
  bottom: 34.8%;
  z-index: 8;
  height: min(44%, 210px);
  width: 4px;
  transform-origin: bottom center;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff0b6 0%, #ffe095 62%, #8a5728 100%);
  box-shadow:
    0 0 11px rgba(255, 226, 144, 0.76),
    0 0 26px rgba(79, 255, 176, 0.2);
}

.app-frame.view-tuner .award-needle::after {
  width: 16px;
  height: 16px;
  bottom: -7px;
  border-color: rgba(92, 47, 19, 0.94);
  background: radial-gradient(circle, #d49b48, #5a3215 70%);
}

.app-frame.view-tuner .award-note-readout {
  position: absolute;
  left: 50%;
  top: 49.5%;
  z-index: 7;
  width: min(36%, 280px);
  margin: 0;
  transform: translate(-50%, -50%);
  padding: 0;
}

.app-frame.view-tuner .award-note-readout strong {
  font-size: clamp(3.2rem, 6.4vw, 5.9rem);
  line-height: 0.86;
  color: #76ffe8;
  text-shadow:
    0 0 12px rgba(118, 255, 232, 0.9),
    0 0 34px rgba(0, 216, 255, 0.48),
    0 3px 12px rgba(0, 0, 0, 0.9);
}

.app-frame.view-tuner .award-note-readout span {
  margin-top: 8px;
  font-size: clamp(1.05rem, 1.8vw, 1.75rem);
  color: #3ff0ff;
}

.app-frame.view-tuner .tuner-cent-readout {
  z-index: 7;
  bottom: auto;
  top: 45%;
}

.app-frame.view-tuner .tuner-cent-readout.left {
  left: 13%;
}

.app-frame.view-tuner .tuner-cent-readout.right {
  right: 13%;
}

.app-frame.view-tuner .tuner-cent-readout strong {
  font-size: clamp(2.1rem, 4.2vw, 3.8rem);
}

.app-frame.view-tuner .tuner-accuracy-badge {
  left: 50%;
  bottom: 2.8%;
  z-index: 9;
  min-width: min(44%, 300px);
  min-height: 44px;
  transform: translateX(-50%);
  border: 1px solid rgba(230, 164, 84, 0.42);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 0%, rgba(74, 255, 112, 0.08), transparent 54%),
    linear-gradient(180deg, rgba(13, 14, 12, 0.96), rgba(4, 5, 4, 0.98));
  color: #ffd06b;
  font-size: clamp(0.92rem, 1.45vw, 1.3rem);
  box-shadow:
    inset 0 0 16px rgba(0, 0, 0, 0.68),
    0 0 18px rgba(255, 193, 96, 0.12);
}

.app-frame.view-tuner .tuner-accuracy-badge.tuned {
  color: #6dff64;
}

.app-frame.view-tuner .tuner-console-controls {
  position: absolute;
  left: 4.2%;
  right: 4.2%;
  bottom: 5.2%;
  z-index: 5;
  height: 24%;
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.app-frame.view-tuner .tuner-gain-block,
.app-frame.view-tuner .tuner-vu-block,
.app-frame.view-tuner .tuner-calibration-block {
  min-height: 0;
  border: 1px solid rgba(214, 145, 69, 0.18);
  border-radius: 12px;
  background: rgba(6, 6, 5, 0.24);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(1px);
}

.app-frame.view-tuner .tuner-gain-block > span,
.app-frame.view-tuner .tuner-vu-block > span,
.app-frame.view-tuner .tuner-calibration-block > span {
  color: rgba(255, 221, 171, 0.82);
  font-size: 0.68rem;
}

.app-frame.view-tuner .tuner-gain-knob {
  width: min(8vw, 66px);
  height: min(8vw, 66px);
}

.app-frame.view-tuner .tuner-vu-meter {
  height: min(9vw, 70px);
}

.app-frame.view-tuner .tuner-calibration-control {
  min-height: 38px;
}

.app-frame.view-tuner .tuner-calibration-control input {
  font-size: clamp(1rem, 1.7vw, 1.35rem);
}

@media (max-width: 1180px) {
  .app-frame.view-tuner .tuner-workbench {
    grid-template-columns: minmax(500px, 1.35fr) minmax(300px, 0.82fr);
  }

  .app-frame.view-tuner .tuner-console-controls {
    bottom: 4%;
    height: 23%;
    gap: 8px;
  }

  .app-frame.view-tuner .tuner-accuracy-badge {
    bottom: 2%;
    min-height: 38px;
  }
}

@keyframes tunerNeedleSearch {
  0%,
  100% {
    transform: translateX(-50%) rotate(-17deg);
  }
  50% {
    transform: translateX(-50%) rotate(17deg);
  }
}

/* Recordings reference cleanup */
.app-frame.view-recordings .workspace-main {
  padding: 10px 16px 14px;
}

.app-frame.view-recordings .recording-status-strip {
  display: none !important;
}

.app-frame.view-recordings .recordings-main {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.app-frame.view-recordings .recordings-hero {
  min-height: 54px;
  padding: 0 2px;
}

.app-frame.view-recordings .recordings-grid {
  grid-template-columns: minmax(0, 1.34fr) minmax(340px, 0.96fr);
  grid-template-rows: minmax(0, 1fr) minmax(196px, 0.52fr);
  gap: 10px;
}

.app-frame.view-recordings .record-console {
  grid-template-columns: minmax(190px, 0.42fr) minmax(0, 0.58fr);
  min-height: 0;
  padding: 8px;
  border-radius: 12px;
}

.app-frame.view-recordings .record-mic-panel {
  position: relative;
  min-height: 0;
  border-radius: 9px;
}

.app-frame.view-recordings .record-mic-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 54% 18%, rgba(255, 214, 128, 0.22), transparent 28%),
    radial-gradient(circle at 58% 50%, rgba(0, 216, 255, 0.12), transparent 34%);
  mix-blend-mode: screen;
  opacity: 0.42;
  pointer-events: none;
}

.app-frame.view-recordings .record-console.recording .record-mic-panel::after {
  animation: recordMicGlow 1.25s ease-in-out infinite;
}

.app-frame.view-recordings .record-mic-panel img {
  object-position: 34% 50%;
  transform: scale(1.18);
}

.app-frame.view-recordings .record-console-screen {
  grid-template-rows: auto auto auto minmax(42px, 1fr) auto auto;
  gap: 6px;
  padding: 18px 14px 6px 16px;
}

.app-frame.view-recordings .record-time {
  font-size: clamp(2.65rem, 5.35vw, 4.75rem);
}

.app-frame.view-recordings .record-waveform {
  min-height: 46px;
}

.app-frame.view-recordings .record-console.recording .record-waveform i {
  animation: recordWaveLive 720ms ease-in-out infinite alternate;
  animation-delay: calc(var(--d) * -80ms);
}

.app-frame.view-recordings .record-transport {
  min-height: 70px;
  gap: 14px;
  padding: 8px 20px;
}

.app-frame.view-recordings .record-round > svg {
  width: 42px;
  height: 42px;
  padding: 10px;
}

.app-frame.view-recordings .record-round.primary > svg {
  width: 58px;
  height: 58px;
  padding: 17px;
}

.app-frame.view-recordings .record-form-card {
  grid-template-rows: minmax(0, 1fr) 38px;
  padding: 10px 12px;
  gap: 6px;
  overflow: hidden;
}

.app-frame.view-recordings .record-form-grid {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.92fr) minmax(118px, 0.62fr);
  grid-template-rows: 40px 58px;
  grid-auto-rows: 0;
  align-content: start;
  gap: 6px 10px;
  overflow: hidden;
}

.app-frame.view-recordings .record-form-grid > label:nth-child(1) {
  grid-column: 1 / 2;
  grid-row: 1;
}

.app-frame.view-recordings .record-form-grid > label:nth-child(2) {
  grid-column: 2 / 3;
  grid-row: 1;
}

.app-frame.view-recordings .record-form-grid > label:nth-child(4) {
  grid-column: 3 / 4;
  grid-row: 1;
}

.app-frame.view-recordings .record-form-grid > label:nth-child(6) {
  grid-column: 3 / 4;
  grid-row: 2;
}

.app-frame.view-recordings .record-form-card .record-tags-field {
  grid-column: 1 / 2;
  grid-row: 2;
  overflow: visible;
}

.app-frame.view-recordings .record-form-card .record-description-field {
  grid-column: 2 / 3;
  grid-row: 2;
}

.app-frame.view-recordings .record-form-card input,
.app-frame.view-recordings .record-form-card textarea {
  min-height: 32px;
  border-radius: 7px;
  padding-inline: 10px;
}

.app-frame.view-recordings .record-form-card textarea {
  min-height: 40px;
  max-height: 44px;
  padding-block: 7px;
  line-height: 1.25;
}

.app-frame.view-recordings .record-form-card label {
  gap: 4px;
  min-height: 0;
  overflow: hidden;
}

.app-frame.view-recordings .record-form-card label span {
  font-size: 0.76rem;
}

.app-frame.view-recordings .record-tag-picker {
  min-height: 32px;
  height: 34px;
  max-width: 100%;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  align-content: start;
}

.app-frame.view-recordings .record-tag-picker button {
  min-height: 28px;
  padding: 0 8px;
  white-space: nowrap;
}

.app-frame.view-recordings .record-save-row {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 210px);
  align-self: end;
  gap: 10px;
}

.app-frame.view-recordings .record-backup-check {
  min-width: 0;
  overflow: hidden;
}

.app-frame.view-recordings .record-backup-check span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-frame.view-recordings .record-save-btn {
  min-height: 38px;
}

.app-frame.view-recordings .record-list-card,
.app-frame.view-recordings .record-player-card {
  border-radius: 12px;
}

@keyframes recordMicGlow {
  0%,
  100% {
    opacity: 0.34;
    filter: brightness(1);
  }
  50% {
    opacity: 0.82;
    filter: brightness(1.25);
  }
}

@keyframes recordWaveLive {
  from {
    transform: scaleY(calc(0.64 + (var(--d) * 0.018)));
    opacity: 0.68;
  }
  to {
    transform: scaleY(calc(0.92 + (var(--d) * 0.028)));
    opacity: 1;
  }
}

/* Standalone metronome tool opened from the home Metronom Stage card. */
.app-frame.view-metronomeTool .metronome-standalone-main {
  padding: 12px 16px 14px;
  overflow: hidden;
}

.practice-metronome-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  color: #f5f7f8;
}

.practice-metronome-rail {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 8px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 229, 255, 0.12), transparent 42%),
    rgba(4, 9, 12, 0.92);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.practice-metronome-rail nav,
.practice-rail-bottom {
  min-height: 0;
  display: grid;
  gap: 8px;
}

.practice-metronome-rail button {
  min-width: 0;
  min-height: 62px;
  display: grid;
  place-items: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 850;
  text-align: center;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.practice-metronome-rail button svg {
  width: 25px;
  height: 25px;
  color: #00e5ff;
}

.practice-metronome-rail button:hover,
.practice-metronome-rail button.active {
  transform: translateY(-1px);
  border-color: rgba(0, 229, 255, 0.62);
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.18), rgba(0, 229, 255, 0.055)),
    rgba(255, 255, 255, 0.025);
  color: #efffff;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.16), inset 3px 0 0 rgba(0, 229, 255, 0.9);
}

.practice-metronome-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.practice-metronome-hero {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 4px;
}

.practice-metronome-hero h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
}

.practice-metronome-hero p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(0.9rem, 1.08vw, 1.02rem);
}

.practice-history-btn,
.practice-ghost-action,
.practice-side-card button,
.practice-side-card select,
.practice-console-card button,
.practice-helper-card button {
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease, background 170ms ease, color 170ms ease;
}

.practice-history-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #f4f7f8;
  font-weight: 850;
}

.practice-history-btn:hover,
.practice-ghost-action:hover,
.practice-side-card button:hover,
.practice-console-card button:hover,
.practice-helper-card button:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 229, 255, 0.65);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.16);
}

.practice-metronome-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: minmax(380px, 1fr) minmax(128px, 0.33fr) 44px;
  grid-template-areas:
    "console console console console console console console side side side side side"
    "quick quick quick quick pulse pulse pulse pulse helper helper helper helper"
    "status status status status status status status status status status status status";
  gap: 12px;
}

.practice-console-card,
.practice-side-card,
.practice-bottom-card,
.practice-status-bar {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background:
    radial-gradient(circle at 22% 0%, rgba(0, 229, 255, 0.1), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(3, 8, 10, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 42px rgba(0, 0, 0, 0.28);
}

.practice-console-card {
  grid-area: console;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 0.8fr);
  grid-template-rows: minmax(0, 1fr) minmax(112px, auto);
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}

.analog-metronome-device {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(176, 104, 39, 0.34);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 55%, rgba(0, 229, 255, 0.13), transparent 38%),
    linear-gradient(145deg, rgba(77, 43, 20, 0.46), rgba(5, 7, 9, 0.92));
  overflow: hidden;
}

.analog-device-status {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  color: #f4ddb7;
  font-size: 0.75rem;
  font-weight: 900;
}

.analog-device-status span,
.practice-status-bar b {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  background: #5cff76;
  box-shadow: 0 0 12px rgba(92, 255, 118, 0.7);
}

.analog-metronome-frame {
  position: relative;
  width: min(86%, 330px);
  height: min(96%, 365px);
  display: grid;
  place-items: end center;
}

.analog-metronome-frame img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 24px 28px rgba(0, 0, 0, 0.52)) saturate(1.12);
}

.analog-pendulum {
  position: absolute;
  left: 50%;
  top: 18%;
  z-index: 2;
  width: 5px;
  height: 58%;
  transform-origin: 50% 10%;
  transform: translateX(-50%) rotate(var(--pendulum-rotation));
  border-radius: 999px;
  background: linear-gradient(180deg, #f1d5a4, #8b6332);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.18);
  transition: transform 120ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.analog-pendulum span {
  position: absolute;
  left: 50%;
  top: 20%;
  width: 38px;
  height: 34px;
  transform: translateX(-50%) rotate(45deg);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  background: linear-gradient(145deg, #d7c4a2, #705735);
}

.analog-pulse-waves {
  position: absolute;
  right: 18%;
  top: 40%;
  z-index: 0;
  display: grid;
  grid-auto-flow: column;
  gap: 10px;
  opacity: 0;
}

.practice-metronome-shell.is-playing .analog-pulse-waves {
  opacity: 1;
}

.analog-pulse-waves i {
  display: block;
  width: 16px;
  height: 72px;
  border-right: 3px solid rgba(0, 229, 255, 0.62);
  border-radius: 50%;
  animation: analogWave 520ms ease-in-out infinite;
}

.analog-pulse-waves i:nth-child(2) {
  animation-delay: 80ms;
  opacity: 0.72;
}

.analog-pulse-waves i:nth-child(3) {
  animation-delay: 160ms;
  opacity: 0.5;
}

.practice-bpm-console {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: center;
  gap: 12px;
  padding: 20px;
  border: 1px solid rgba(176, 104, 39, 0.3);
  border-radius: 12px;
  background: rgba(1, 6, 8, 0.72);
}

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

.practice-bpm-input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #00e5ff;
  font-size: clamp(4.6rem, 8.2vw, 7.2rem);
  font-weight: 950;
  line-height: 0.9;
  text-align: center;
  text-shadow: 0 0 28px rgba(0, 229, 255, 0.52);
  outline: none;
}

.practice-bpm-display span {
  grid-column: 1 / 2;
  color: #00e5ff;
  text-align: center;
  font-weight: 900;
}

.practice-bpm-display button {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
}

.practice-main-controls,
.practice-bpm-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.practice-round-btn {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border: 2px solid rgba(0, 229, 255, 0.72);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.22), rgba(0, 0, 0, 0.66));
  color: #f4ffff;
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.24);
}

.practice-round-btn svg {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.42));
}

.practice-round-btn.play {
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.18), transparent 26%),
    radial-gradient(circle, rgba(0, 229, 255, 0.3), rgba(0, 78, 90, 0.52) 48%, rgba(0, 0, 0, 0.68) 70%),
    conic-gradient(from 220deg, #007f94, #00e5ff, #72fff0, #00a8c6, #007f94);
  color: #fff;
}

.practice-round-btn.play.playing {
  border-color: #48ff8f;
  box-shadow: 0 0 38px rgba(72, 255, 143, 0.34);
}

.practice-round-btn.stop {
  border-color: rgba(255, 255, 255, 0.3);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.56));
}

.practice-bpm-actions button,
.practice-tap-btn,
.practice-sound-select,
.practice-wide-select,
.practice-session-row > button {
  min-height: 44px;
  border: 1px solid rgba(0, 229, 255, 0.34);
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.06);
  color: #dffcff;
  font-weight: 900;
}

.practice-bpm-actions button {
  width: 48px;
  font-size: 1.8rem;
}

.practice-bpm-dial {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(0, 229, 255, 0.16), rgba(0, 0, 0, 0.7) 58%),
    conic-gradient(from -90deg, #00e5ff var(--dial-deg), rgba(255, 255, 255, 0.12) 0);
  color: #f6ffff;
  font-size: 1.25rem;
  font-weight: 950;
  cursor: grab;
  touch-action: none;
}

.practice-tap-btn,
.practice-sound-select,
.practice-wide-select,
.practice-volume-row,
.practice-session-row {
  display: grid;
  align-items: center;
  gap: 9px;
}

.practice-tap-btn {
  grid-template-columns: auto auto;
  justify-content: center;
  color: #00e5ff;
}

.practice-sound-select,
.practice-wide-select {
  grid-template-columns: 24px minmax(0, 1fr);
  padding: 0 12px;
}

.practice-sound-select select,
.practice-wide-select select {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #eaffff;
  font: inherit;
  outline: none;
}

.practice-console-bottom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(240px, 0.92fr);
  gap: 12px;
}

.practice-console-bottom section {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(176, 104, 39, 0.22);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.practice-console-bottom strong,
.practice-side-card h3,
.practice-bottom-card h3 {
  margin: 0;
  color: rgba(232, 251, 255, 0.74);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  font-weight: 850;
}

.practice-console-bottom small {
  color: rgba(255, 255, 255, 0.56);
  font-weight: 850;
}

.practice-pill-row,
.practice-segment-row,
.practice-range-grid,
.quick-tempo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.practice-pill-row button,
.practice-segment-row button,
.practice-range-grid button,
.quick-tempo-row button {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.82);
  font-weight: 850;
}

.practice-pill-row button.active,
.practice-segment-row button.active,
.practice-range-grid button.active,
.quick-tempo-row button.active,
.practice-subdivision-grid button.active,
.practice-mode-grid button.active {
  border-color: rgba(0, 229, 255, 0.86);
  background: rgba(0, 229, 255, 0.15);
  color: #eaffff;
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.16);
}

.practice-accent-dots,
.practice-pulse-dots {
  display: flex;
  align-items: center;
  gap: 13px;
}

.practice-accent-dots button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.practice-accent-dots span,
.practice-pulse-dots span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.practice-accent-dots button.strong span,
.practice-pulse-dots span.strong {
  background: rgba(0, 229, 255, 0.72);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.42);
}

.practice-accent-dots button.current span,
.practice-pulse-dots span.active {
  transform: scale(1.38);
  background: #00e5ff;
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.68);
}

.practice-subdivision-grid,
.practice-mode-grid {
  display: grid;
  gap: 8px;
}

.practice-subdivision-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.practice-subdivision-grid button,
.practice-mode-grid button {
  min-width: 0;
  min-height: 74px;
  display: grid;
  place-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.84);
  font-weight: 850;
  text-align: center;
}

.practice-subdivision-grid svg,
.practice-mode-grid svg {
  width: 28px;
  height: 28px;
  color: #d7b997;
}

.practice-side-card {
  grid-area: side;
  display: grid;
  align-content: start;
  gap: 13px;
  padding: 16px;
  overflow: hidden;
}

.practice-side-card section {
  display: grid;
  gap: 9px;
}

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

.practice-range-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.practice-range-grid button {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 5px 4px;
}

.practice-range-grid small {
  color: rgba(255, 255, 255, 0.62);
}

.practice-segment-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.practice-volume-row {
  grid-template-columns: 24px minmax(0, 1fr) 46px;
  min-height: 36px;
  color: rgba(255, 255, 255, 0.78);
}

.practice-volume-row input,
.practice-helper-card input {
  accent-color: #00e5ff;
}

.practice-session-row {
  grid-template-columns: minmax(0, 1fr) 112px;
}

.practice-session-row > button {
  color: #00e5ff;
}

.quick-tempo-card {
  grid-area: quick;
}

.rhythm-pulse-card {
  grid-area: pulse;
}

.practice-helper-card {
  grid-area: helper;
}

.practice-bottom-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  overflow: hidden;
}

.quick-tempo-row {
  align-items: stretch;
}

.quick-tempo-row button {
  min-width: 58px;
  display: grid;
  align-content: center;
  gap: 2px;
}

.quick-tempo-row strong {
  color: #f8ffff;
  font-size: 1.05rem;
}

.quick-tempo-row span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.66rem;
}

.quick-tempo-add {
  width: 40px;
}

.practice-ghost-action {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.82);
  font-weight: 850;
}

.rhythm-wave {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.rhythm-wave span {
  width: 5px;
  height: calc(var(--h) * 5px);
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.55);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

.rhythm-wave span.active {
  background: #00e5ff;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.72);
  animation: pulseBarBeat 220ms ease;
}

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

.practice-helper-grid button,
.practice-helper-grid label {
  min-width: 0;
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.82);
}

.practice-helper-grid span {
  font-size: 0.72rem;
}

.practice-helper-grid strong {
  color: #00e5ff;
  font-size: 0.98rem;
}

.practice-helper-grid button.active {
  border-color: rgba(0, 229, 255, 0.72);
  background: rgba(0, 229, 255, 0.12);
}

.practice-status-bar {
  grid-area: status;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.practice-status-bar span,
.practice-status-bar button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.74);
  font-weight: 820;
  white-space: nowrap;
}

.practice-status-bar svg {
  width: 20px;
  height: 20px;
  color: #00e5ff;
}

.practice-status-bar button {
  min-height: 34px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.practice-status-bar b {
  background: rgba(255, 255, 255, 0.24);
  box-shadow: none;
}

.practice-status-bar b.on {
  background: #5cff76;
  box-shadow: 0 0 12px rgba(92, 255, 118, 0.7);
}

@keyframes analogWave {
  0% {
    transform: translateX(0) scaleY(0.72);
    opacity: 0.28;
  }
  50% {
    transform: translateX(8px) scaleY(1);
    opacity: 1;
  }
  100% {
    transform: translateX(18px) scaleY(0.72);
    opacity: 0.18;
  }
}

@keyframes pulseBarBeat {
  0% {
    transform: scaleY(0.82);
  }
  60% {
    transform: scaleY(1.28);
  }
  100% {
    transform: scaleY(1);
  }
}

@media (max-width: 1180px), (max-height: 760px) {
  .practice-metronome-shell {
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 12px;
  }

  .practice-metronome-rail button {
    min-height: 56px;
    font-size: 0.82rem;
  }

  .practice-metronome-main {
    grid-template-rows: 60px minmax(0, 1fr);
  }

  .practice-metronome-grid {
    grid-template-rows: minmax(338px, 1fr) minmax(116px, 0.3fr) 40px;
    gap: 10px;
  }

  .practice-console-card,
  .practice-side-card,
  .practice-bottom-card {
    padding: 10px;
  }

  .practice-bpm-console {
    padding: 14px;
    gap: 8px;
  }

  .practice-bpm-input {
    font-size: clamp(3.8rem, 7.4vw, 5.8rem);
  }

  .practice-round-btn {
    width: 68px;
    height: 68px;
  }

  .practice-mode-grid button {
    min-height: 62px;
  }
}

@media (max-width: 980px) {
  .app-frame.view-metronomeTool .metronome-standalone-main {
    overflow: auto;
  }

  .practice-metronome-shell,
  .practice-metronome-grid,
  .practice-console-card,
  .practice-console-bottom,
  .practice-helper-grid {
    grid-template-columns: 1fr;
  }

  .practice-metronome-shell,
  .practice-metronome-main {
    height: auto;
  }

  .practice-metronome-grid {
    grid-template-areas:
      "console"
      "side"
      "quick"
      "pulse"
      "helper"
      "status";
    grid-template-rows: none;
  }
}

/* Metronome tool fit pass: keep the home-card metronome usable on iPad landscape and shorter screens. */
.app-frame.view-metronomeTool .workspace {
  grid-template-rows: 64px minmax(0, 1fr);
}

.app-frame.view-metronomeTool .topbar {
  min-height: 64px;
  padding: 10px 20px;
}

.app-frame.view-metronomeTool .tab-button {
  min-height: 40px;
}

.app-frame.view-metronomeTool .metronome-standalone-main {
  padding: 10px 14px 12px;
}

.app-frame.view-metronomeTool .practice-metronome-shell {
  grid-template-columns: clamp(104px, 9.4vw, 122px) minmax(0, 1fr);
  gap: 12px;
}

.app-frame.view-metronomeTool .practice-metronome-rail {
  padding: 8px 7px;
}

.app-frame.view-metronomeTool .practice-metronome-rail nav,
.app-frame.view-metronomeTool .practice-rail-bottom {
  gap: 6px;
}

.app-frame.view-metronomeTool .practice-metronome-rail button {
  min-height: 54px;
  gap: 4px;
  font-size: clamp(0.74rem, 0.88vw, 0.9rem);
  line-height: 1.12;
}

.app-frame.view-metronomeTool .practice-metronome-rail button svg {
  width: 22px;
  height: 22px;
}

.app-frame.view-metronomeTool .practice-metronome-main {
  grid-template-rows: 62px minmax(0, 1fr);
  gap: 8px;
}

.app-frame.view-metronomeTool .practice-metronome-hero {
  align-items: end;
}

.app-frame.view-metronomeTool .practice-metronome-hero h2 {
  font-size: clamp(1.85rem, 2.65vw, 2.45rem);
}

.app-frame.view-metronomeTool .practice-metronome-hero p {
  margin-top: 5px;
  font-size: clamp(0.82rem, 1vw, 0.96rem);
  line-height: 1.22;
}

.app-frame.view-metronomeTool .practice-history-btn {
  min-height: 42px;
  padding: 0 14px;
}

.app-frame.view-metronomeTool .practice-metronome-grid {
  grid-template-columns: minmax(0, 7fr) minmax(340px, 5fr);
  grid-template-rows: minmax(0, 1fr) minmax(112px, 0.28fr) 40px;
  grid-template-areas:
    "console side"
    "quick pulse"
    "status status";
  gap: 10px;
}

.app-frame.view-metronomeTool .practice-helper-card {
  display: none;
}

.app-frame.view-metronomeTool .practice-console-card {
  grid-template-columns: minmax(210px, 0.94fr) minmax(250px, 1.06fr);
  grid-template-rows: minmax(0, 1fr) minmax(104px, auto);
  gap: 10px;
  padding: 10px;
}

.app-frame.view-metronomeTool .analog-metronome-frame {
  width: min(84%, 268px);
  height: min(94%, 280px);
}

.app-frame.view-metronomeTool .analog-device-status {
  top: 10px;
  left: 10px;
  padding: 7px 10px;
  font-size: 0.68rem;
}

.app-frame.view-metronomeTool .analog-pendulum span {
  width: 30px;
  height: 28px;
}

.app-frame.view-metronomeTool .practice-bpm-console {
  grid-template-columns: minmax(112px, 0.86fr) minmax(142px, 1fr);
  grid-template-rows: auto auto auto;
  align-content: center;
  gap: 8px 10px;
  padding: 12px;
}

.app-frame.view-metronomeTool .practice-bpm-display {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
}

.app-frame.view-metronomeTool .practice-bpm-input {
  font-size: clamp(3rem, 5.8vw, 4.25rem);
  -webkit-appearance: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.app-frame.view-metronomeTool .practice-bpm-input::-webkit-outer-spin-button,
.app-frame.view-metronomeTool .practice-bpm-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.app-frame.view-metronomeTool .practice-bpm-display span {
  font-size: 0.78rem;
}

.app-frame.view-metronomeTool .practice-bpm-display button {
  width: 32px;
  height: 32px;
}

.app-frame.view-metronomeTool .practice-main-controls {
  grid-column: 2;
  grid-row: 1;
  gap: 10px;
}

.app-frame.view-metronomeTool .practice-bpm-actions {
  grid-column: 2;
  grid-row: 2;
  gap: 8px;
}

.app-frame.view-metronomeTool .practice-tap-btn {
  grid-column: 1;
  grid-row: 3;
}

.app-frame.view-metronomeTool .practice-sound-select {
  grid-column: 2;
  grid-row: 3;
}

.app-frame.view-metronomeTool .practice-round-btn {
  width: clamp(54px, 5.5vw, 64px);
  height: clamp(54px, 5.5vw, 64px);
}

.app-frame.view-metronomeTool .practice-round-btn svg {
  width: 28px;
  height: 28px;
}

.app-frame.view-metronomeTool .practice-bpm-actions button,
.app-frame.view-metronomeTool .practice-tap-btn,
.app-frame.view-metronomeTool .practice-sound-select,
.app-frame.view-metronomeTool .practice-wide-select,
.app-frame.view-metronomeTool .practice-session-row > button {
  min-height: 38px;
  border-radius: 8px;
}

.app-frame.view-metronomeTool .practice-bpm-actions button {
  width: 38px;
  font-size: 1.35rem;
}

.app-frame.view-metronomeTool .practice-bpm-dial {
  width: 56px;
  height: 56px;
  font-size: 0.9rem;
}

.app-frame.view-metronomeTool .practice-sound-select,
.app-frame.view-metronomeTool .practice-wide-select {
  grid-template-columns: 20px minmax(0, 1fr);
  padding: 0 10px;
  font-size: 0.84rem;
}

.app-frame.view-metronomeTool .practice-console-bottom {
  gap: 10px;
}

.app-frame.view-metronomeTool .practice-console-bottom section {
  gap: 6px;
  padding: 8px 10px;
}

.app-frame.view-metronomeTool .practice-console-bottom strong,
.app-frame.view-metronomeTool .practice-side-card h3,
.app-frame.view-metronomeTool .practice-bottom-card h3 {
  font-size: 0.7rem;
  line-height: 1.1;
}

.app-frame.view-metronomeTool .practice-pill-row,
.app-frame.view-metronomeTool .practice-segment-row,
.app-frame.view-metronomeTool .practice-range-grid,
.app-frame.view-metronomeTool .quick-tempo-row {
  gap: 6px;
}

.app-frame.view-metronomeTool .practice-pill-row button,
.app-frame.view-metronomeTool .practice-segment-row button,
.app-frame.view-metronomeTool .practice-range-grid button,
.app-frame.view-metronomeTool .quick-tempo-row button {
  min-height: 32px;
  padding: 0 8px;
  font-size: clamp(0.72rem, 0.9vw, 0.86rem);
  line-height: 1.08;
}

.app-frame.view-metronomeTool .practice-subdivision-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.app-frame.view-metronomeTool .practice-subdivision-grid button {
  min-height: 54px;
  gap: 3px;
  padding: 4px 3px;
  font-size: clamp(0.68rem, 0.84vw, 0.8rem);
  line-height: 1.05;
}

.app-frame.view-metronomeTool .practice-subdivision-grid svg {
  width: 21px;
  height: 21px;
}

.app-frame.view-metronomeTool .practice-accent-dots {
  gap: 10px;
}

.app-frame.view-metronomeTool .practice-accent-dots span {
  width: 15px;
  height: 15px;
}

.app-frame.view-metronomeTool .practice-side-card {
  align-content: start;
  gap: 8px;
  padding: 10px;
  overflow: auto;
  scrollbar-width: thin;
}

.app-frame.view-metronomeTool .practice-side-card section {
  gap: 6px;
}

.app-frame.view-metronomeTool .practice-mode-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.app-frame.view-metronomeTool .practice-mode-grid button {
  min-height: 56px;
  gap: 3px;
  padding: 5px 4px;
  font-size: clamp(0.72rem, 0.92vw, 0.86rem);
  line-height: 1.08;
}

.app-frame.view-metronomeTool .practice-mode-grid svg {
  width: 22px;
  height: 22px;
}

.app-frame.view-metronomeTool .practice-range-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.app-frame.view-metronomeTool .practice-range-grid button {
  min-height: 44px;
  padding: 4px 3px;
}

.app-frame.view-metronomeTool .practice-range-grid span,
.app-frame.view-metronomeTool .practice-range-grid small {
  white-space: normal;
}

.app-frame.view-metronomeTool .practice-segment-row {
  gap: 6px;
}

.app-frame.view-metronomeTool .practice-volume-row {
  grid-template-columns: 20px minmax(0, 1fr) 42px;
  min-height: 30px;
}

.app-frame.view-metronomeTool .practice-session-row {
  grid-template-columns: minmax(0, 1fr) minmax(84px, 0.4fr);
  gap: 8px;
}

.app-frame.view-metronomeTool .practice-bottom-card {
  gap: 8px;
  padding: 10px;
  align-content: center;
}

.app-frame.view-metronomeTool .quick-tempo-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(48px, 1fr)) 38px;
  align-items: stretch;
}

.app-frame.view-metronomeTool .quick-tempo-row button {
  min-width: 0;
}

.app-frame.view-metronomeTool .quick-tempo-row strong {
  font-size: 0.96rem;
}

.app-frame.view-metronomeTool .quick-tempo-row span {
  font-size: 0.62rem;
}

.app-frame.view-metronomeTool .practice-ghost-action {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.app-frame.view-metronomeTool .rhythm-wave {
  min-height: 48px;
  gap: 6px;
}

.app-frame.view-metronomeTool .rhythm-wave span {
  width: 5px;
  height: calc(var(--h) * 4px);
}

.app-frame.view-metronomeTool .practice-status-bar {
  min-height: 40px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  padding: 0 12px;
}

.app-frame.view-metronomeTool .practice-status-bar span,
.app-frame.view-metronomeTool .practice-status-bar button {
  gap: 7px;
  font-size: clamp(0.76rem, 0.92vw, 0.9rem);
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-height: 700px) and (min-width: 981px) {
  .app-frame.view-metronomeTool .workspace {
    grid-template-rows: 56px minmax(0, 1fr);
  }

  .app-frame.view-metronomeTool .topbar {
    min-height: 56px;
    padding-block: 7px;
  }

  .app-frame.view-metronomeTool .metronome-standalone-main {
    padding: 8px 12px 10px;
  }

  .app-frame.view-metronomeTool .practice-metronome-main {
    grid-template-rows: 52px minmax(0, 1fr);
  }

  .app-frame.view-metronomeTool .practice-metronome-hero p {
    display: none;
  }

  .app-frame.view-metronomeTool .practice-metronome-grid {
    grid-template-rows: minmax(0, 1fr) minmax(96px, 0.26fr) 36px;
    gap: 8px;
  }

  .app-frame.view-metronomeTool .practice-console-card {
    grid-template-rows: minmax(0, 1fr) minmax(92px, auto);
  }

  .app-frame.view-metronomeTool .practice-bpm-console {
    gap: 6px 8px;
    padding: 10px;
  }

  .app-frame.view-metronomeTool .practice-bpm-input {
    font-size: clamp(2.75rem, 5.2vw, 3.7rem);
  }

  .app-frame.view-metronomeTool .practice-round-btn {
    width: 52px;
    height: 52px;
  }

  .app-frame.view-metronomeTool .practice-bpm-actions button,
  .app-frame.view-metronomeTool .practice-tap-btn,
  .app-frame.view-metronomeTool .practice-sound-select,
  .app-frame.view-metronomeTool .practice-wide-select,
  .app-frame.view-metronomeTool .practice-session-row > button {
    min-height: 34px;
  }

  .app-frame.view-metronomeTool .practice-bpm-dial {
    width: 48px;
    height: 48px;
  }

  .app-frame.view-metronomeTool .practice-subdivision-grid button,
  .app-frame.view-metronomeTool .practice-mode-grid button {
    min-height: 46px;
  }
}

@media (max-width: 1080px) and (min-width: 981px) {
  .app-frame.view-metronomeTool .practice-metronome-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, auto) minmax(0, auto) minmax(112px, auto) minmax(40px, auto);
    grid-template-areas:
      "console"
      "side"
      "quick"
      "status";
    overflow: auto;
  }

  .app-frame.view-metronomeTool .rhythm-pulse-card {
    display: none;
  }

  .app-frame.view-metronomeTool .practice-side-card {
    overflow: visible;
  }
}

/* BPM readability fix: keep 3-digit tempos clear beside Tap Tempo on compact screens. */
.app-frame.view-metronomeTool .practice-bpm-console {
  grid-template-columns: minmax(176px, 1fr) minmax(138px, 0.76fr);
  grid-template-rows: minmax(92px, 1fr) 42px 38px;
}

.app-frame.view-metronomeTool .practice-bpm-display {
  position: relative;
  grid-column: 1;
  grid-row: 1 / 3;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  padding: 8px 28px 10px 10px;
  border: 1px solid rgba(0, 229, 255, 0.14);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 52%, rgba(0, 229, 255, 0.17), transparent 58%),
    rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.app-frame.view-metronomeTool .practice-bpm-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  font-size: clamp(3.25rem, 5.2vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  text-align: center;
  overflow: visible;
}

.app-frame.view-metronomeTool .practice-bpm-display span {
  grid-column: 1;
  grid-row: 2;
  margin-top: 2px;
  font-size: 0.78rem;
  line-height: 1;
}

.app-frame.view-metronomeTool .practice-bpm-display button {
  position: absolute;
  right: 6px;
  top: 8px;
  grid-column: auto;
  grid-row: auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  opacity: 0.86;
}

.app-frame.view-metronomeTool .practice-main-controls {
  grid-column: 2;
  grid-row: 1;
}

.app-frame.view-metronomeTool .practice-bpm-actions {
  grid-column: 2;
  grid-row: 2;
}

.app-frame.view-metronomeTool .practice-tap-btn {
  grid-column: 1;
  grid-row: 3;
}

.app-frame.view-metronomeTool .practice-sound-select {
  grid-column: 2;
  grid-row: 3;
}

@media (max-height: 700px) and (min-width: 981px) {
  .app-frame.view-metronomeTool .practice-bpm-console {
    grid-template-columns: minmax(166px, 1fr) minmax(132px, 0.74fr);
    grid-template-rows: minmax(82px, 1fr) 38px 34px;
  }

  .app-frame.view-metronomeTool .practice-bpm-input {
    font-size: clamp(3rem, 4.8vw, 4.25rem);
  }
}

/* Home + metronome final fit pass for MacBook/iPad sized viewports. */
.app-frame.view-home {
  grid-template-columns: clamp(218px, 18vw, 257px) minmax(0, 1fr);
}

.app-frame.view-home .ireal-brand {
  min-height: 112px;
  align-items: center;
  padding: 20px 18px 16px;
}

.app-frame.view-home .ireal-brand p {
  display: none;
}

.app-frame.view-home .ireal-brand h1 {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  font-size: clamp(1.14rem, 1.5vw, 1.42rem);
  line-height: 1.05;
}

.app-frame.view-home .library-category-row {
  grid-template-columns: 42px minmax(0, 1fr);
  min-height: 58px;
  padding: 0 15px 0 20px;
}

.app-frame.view-home .library-category-row span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.14;
}

.app-frame.view-home .home-workspace-main {
  overflow: auto;
  padding: clamp(14px, 1.35vw, 22px) clamp(14px, 1.35vw, 24px);
}

.app-frame.view-home .home-dashboard {
  height: auto;
  min-height: 100%;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    "hero"
    "tools";
  align-content: start;
}

.app-frame.view-home .home-hero {
  grid-template-columns: minmax(0, 1fr) minmax(260px, min(42vw, 430px));
  align-items: start;
}

.app-frame.view-home .home-hero h2 {
  white-space: normal;
}

.app-frame.view-home .home-tool-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  align-items: stretch;
}

.app-frame.view-home .home-tool-card {
  min-height: clamp(244px, 32vh, 304px);
  grid-template-rows: auto minmax(102px, 1fr) 40px;
}

.app-frame.view-home .home-tool-copy h3 {
  overflow-wrap: anywhere;
}

.app-frame.view-home .home-tool-copy p {
  max-width: 24ch;
}

.app-frame.view-home .home-tool-visual {
  min-height: 106px;
  overflow: hidden;
}

.app-frame.view-home .home-ref-metronome {
  width: auto;
  height: min(100%, clamp(132px, 19vh, 194px));
  max-height: none;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 22px 24px rgba(0, 0, 0, 0.5)) saturate(1.08);
}

@media (max-width: 1120px) {
  .app-frame.view-home {
    grid-template-columns: clamp(206px, 24vw, 238px) minmax(0, 1fr);
  }

  .app-frame.view-home .home-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-frame.view-home .home-search-shell {
    max-width: 560px;
  }
}

.app-frame.view-metronomeTool .analog-metronome-device {
  background:
    radial-gradient(circle at 50% 42%, rgba(176, 104, 39, 0.15), transparent 30%),
    linear-gradient(145deg, rgba(27, 24, 21, 0.96), rgba(4, 6, 7, 0.96));
}

.app-frame.view-metronomeTool .analog-metronome-frame {
  width: min(88%, 330px);
  height: min(98%, 386px);
  place-items: center;
  overflow: hidden;
}

.app-frame.view-metronomeTool .analog-metronome-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 26px 32px rgba(0, 0, 0, 0.58)) saturate(1.08);
}

.app-frame.view-metronomeTool .analog-pendulum {
  left: 53%;
  top: 18%;
  width: 4px;
  height: 62%;
  transform-origin: 50% 88%;
  transform: translateX(-50%) rotate(0deg);
  opacity: 0;
  background: linear-gradient(180deg, #f4dca7, #a5793f 58%, #5b3b1d);
  box-shadow: 0 0 14px rgba(255, 210, 127, 0.24), 0 0 12px rgba(0, 229, 255, 0.14);
  transition: opacity 160ms ease;
}

.app-frame.view-metronomeTool .analog-pendulum span {
  top: 31%;
  width: 34px;
  height: 28px;
  border-color: rgba(255, 221, 154, 0.42);
  background: linear-gradient(145deg, #d9b36e, #6f4720);
}

.app-frame.view-metronomeTool .practice-metronome-shell.is-playing .analog-pendulum {
  opacity: 0.95;
  animation: practiceMetronomePendulum var(--pendulum-duration, 0.5s) cubic-bezier(0.42, 0, 0.58, 1) infinite alternate;
}

.app-frame.view-metronomeTool .practice-bpm-console {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(94px, auto) auto auto;
  align-content: center;
}

.app-frame.view-metronomeTool .practice-bpm-display {
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 92px;
  padding: 8px 36px 10px;
}

.app-frame.view-metronomeTool .practice-bpm-input {
  font-size: clamp(3.35rem, 6.2vw, 5.4rem);
}

.app-frame.view-metronomeTool .practice-main-controls {
  grid-column: 1;
  grid-row: 2;
}

.app-frame.view-metronomeTool .practice-bpm-actions {
  grid-column: 2;
  grid-row: 2;
}

.app-frame.view-metronomeTool .practice-tap-btn {
  grid-column: 1;
  grid-row: 3;
}

.app-frame.view-metronomeTool .practice-sound-select {
  grid-column: 2;
  grid-row: 3;
}

.app-frame.view-metronomeTool .rhythm-wave span.active {
  animation-duration: calc(var(--pendulum-duration, 0.5s) * 0.42);
}

@keyframes practiceMetronomePendulum {
  from {
    transform: translateX(-50%) rotate(-20deg);
  }
  to {
    transform: translateX(-50%) rotate(20deg);
  }
}

.playlist-context-menu.song-context-menu {
  position: fixed;
  right: auto;
  z-index: 220;
  min-width: 208px;
  max-width: min(232px, calc(100vw - 16px));
  border-color: rgba(0, 216, 255, 0.34);
  background: linear-gradient(180deg, rgba(19, 24, 28, 0.98), rgba(9, 12, 14, 0.98));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.55), 0 0 22px rgba(0, 216, 255, 0.12);
  backdrop-filter: blur(12px);
}

.sidebar-cloud-status {
  display: none !important;
}

.stage-song-browser-card .stage-song-browser-row {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) minmax(78px, 0.34fr) auto 42px;
}

@media (max-width: 1180px) {
  .stage-song-browser-card .stage-song-browser-row {
    grid-template-columns: minmax(0, 1fr) auto 40px;
    min-width: 0;
  }

  .stage-song-browser-card .stage-song-browser-artist {
    display: none;
  }
}

@media (max-width: 920px) {
  .stage-song-browser-card .stage-song-browser-grid {
    grid-template-columns: 1fr;
  }

  .stage-song-browser-card .stage-song-table {
    overflow-x: hidden;
  }

  .stage-song-browser-card .stage-song-browser-row {
    min-width: 0;
  }
}

/* Home cards and Metronom Stage drop targets final pass */
.app-frame.view-home .home-tool-card {
  min-height: clamp(300px, 38vh, 386px);
  grid-template-rows: auto minmax(158px, 1fr) 40px;
  gap: 12px;
}

.app-frame.view-home .home-tool-visual {
  position: relative;
  width: 100%;
  min-height: clamp(154px, 22vh, 226px);
  align-self: stretch;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 216, 255, 0.14), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.2));
}

.app-frame.view-home .home-ref-asset {
  display: block;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.55)) saturate(1.1);
}

.app-frame.view-home .home-ref-metronome {
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  transform: scale(1.18);
}

.app-frame.view-home .home-ref-recordings {
  object-position: center 50%;
}

.app-frame.view-home .home-ref-piano {
  object-fit: contain;
  object-position: center;
  width: 100%;
  height: 100%;
  padding: clamp(4px, 0.6vw, 10px);
  transform: none;
}

.app-frame.view-home .home-ref-tuner {
  object-position: center 48%;
}

@media (max-height: 760px) {
  .app-frame.view-home .home-tool-card {
    min-height: clamp(314px, 42vh, 360px);
    grid-template-rows: auto minmax(174px, 1fr) 38px;
  }

  .app-frame.view-home .home-tool-visual {
    min-height: clamp(170px, 24vh, 216px);
  }
}

.stage-song-browser-row[draggable="true"] {
  cursor: grab;
}

.stage-song-browser-row.dragging {
  opacity: 0.62;
  transform: scale(0.992);
}

.stage-click-drop-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 229, 255, 0.16);
  border-radius: 10px;
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 229, 255, 0.14), transparent 40%),
    linear-gradient(145deg, rgba(7, 17, 20, 0.9), rgba(4, 7, 9, 0.82));
  overflow: hidden;
}

.stage-click-drop-panel > header,
.stage-click-drop-panel > footer {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stage-click-drop-panel > header span,
.stage-drop-selected span,
.stage-click-set-copy span {
  display: block;
  color: #00e5ff;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stage-click-drop-panel > header strong {
  display: block;
  margin-top: 4px;
  color: #f6fbff;
  font-size: clamp(1.1rem, 1.45vw, 1.42rem);
  line-height: 1.08;
}

.stage-click-drop-panel > header small {
  display: block;
  max-width: 56ch;
  margin-top: 6px;
  color: #9faab0;
  font-weight: 720;
  line-height: 1.35;
}

.stage-drop-selected {
  min-height: 52px;
  display: grid;
  grid-template-columns: 34px minmax(0, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 9px;
  background: rgba(0, 229, 255, 0.06);
}

.stage-drop-selected svg {
  width: 21px;
  height: 21px;
  color: #00e5ff;
}

.stage-drop-selected strong {
  min-width: 0;
  color: #fff;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-drop-selected em {
  color: #d9f8ff;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.stage-drop-selected.muted {
  grid-template-columns: 34px minmax(0, 1fr);
  color: #a6b0b6;
}

.stage-click-set-targets {
  min-height: 0;
  display: grid;
  gap: 10px;
  align-content: start;
  overflow: auto;
  padding-right: 2px;
}

.stage-click-set-target {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px dashed rgba(0, 229, 255, 0.32);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.09), rgba(255, 255, 255, 0.026) 58%, rgba(0, 0, 0, 0.16));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.stage-click-set-target:hover,
.stage-click-set-target.contains-selected,
.stage-click-set-target.menu-open,
.stage-click-set-target.editing {
  transform: translateY(-1px);
  border-color: rgba(0, 229, 255, 0.82);
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.16), rgba(0, 229, 255, 0.045) 58%, rgba(0, 0, 0, 0.2));
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.14);
}

.stage-click-set-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.stage-click-set-copy strong {
  min-width: 0;
  color: #f8fdff;
  font-size: 1.04rem;
  font-weight: 920;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-click-set-name-btn {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: #f8fdff;
  font: inherit;
  font-size: 1.04rem;
  font-weight: 920;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
  padding: 0;
}

.stage-click-set-name-btn:hover {
  color: #00e5ff;
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.34);
}

.stage-click-set-name-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(0, 229, 255, 0.68);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.46);
  color: #f7fdff;
  font-size: 0.94rem;
  font-weight: 900;
  padding: 0 9px;
  outline: none;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.stage-click-set-copy small {
  min-width: 0;
  color: #a8b2b8;
  font-size: 0.82rem;
  font-weight: 720;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-click-set-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.stage-click-set-actions button {
  min-height: 36px;
  border: 1px solid rgba(0, 229, 255, 0.32);
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.08);
  color: #e9fbff;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.stage-click-set-actions button:first-child {
  min-width: 74px;
  padding: 0 12px;
}

.stage-click-set-actions button:last-child {
  width: 38px;
  display: grid;
  place-items: center;
}

.stage-click-set-actions button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(0, 229, 255, 0.78);
  background: rgba(0, 229, 255, 0.16);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.14);
}

.stage-click-set-actions button:disabled {
  opacity: 0.48;
  cursor: default;
}

.stage-click-set-inline-menu {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: -4px;
  padding: 8px;
  border: 1px solid rgba(255, 79, 79, 0.36);
  border-radius: 10px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 80, 80, 0.14), transparent 44%),
    linear-gradient(145deg, rgba(22, 16, 17, 0.96), rgba(6, 8, 10, 0.94));
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26), inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.stage-click-set-inline-menu button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 87, 87, 0.42);
  border-radius: 8px;
  background: rgba(255, 76, 76, 0.12);
  color: #ffdddd;
  font-weight: 920;
  cursor: pointer;
}

.stage-click-set-inline-menu button:hover {
  border-color: rgba(255, 97, 97, 0.86);
  background: rgba(255, 76, 76, 0.2);
  box-shadow: 0 0 18px rgba(255, 76, 76, 0.18);
}

.stage-click-empty-target {
  min-height: 180px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 20px;
  border: 1px dashed rgba(0, 229, 255, 0.26);
  border-radius: 10px;
  color: #aeb8be;
  text-align: center;
}

.stage-click-empty-target strong {
  color: #f7fbff;
  font-size: 1.18rem;
}

@media (max-width: 1180px) {
  .stage-click-drop-panel > header {
    align-items: stretch;
    flex-direction: column;
  }

  .stage-drop-selected {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }

  .stage-drop-selected span {
    display: none;
  }

  .stage-click-set-target {
    grid-template-columns: minmax(0, 1fr);
  }

  .stage-click-set-actions {
    justify-content: stretch;
  }

  .stage-click-set-actions button:first-child {
    flex: 1 1 auto;
  }
}

/* Tuner simplified fit pass */
.app-frame.view-tuner .tuner-hero {
  min-height: 76px;
  justify-content: flex-start;
  border-bottom-color: rgba(211, 141, 70, 0.18);
}

.app-frame.view-tuner .tuner-workbench {
  grid-template-columns: minmax(620px, 1.58fr) minmax(320px, 0.78fr);
  grid-template-rows: minmax(0, 1fr) 50px;
  gap: 10px;
  min-height: 0;
}

.app-frame.view-tuner .award-tuner-console {
  grid-column: 1;
  grid-row: 1;
  height: 100%;
  min-height: 0;
}

.app-frame.view-tuner .tuner-side-panel {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  height: 100%;
}

.app-frame.view-tuner .award-string-list {
  max-height: none;
  min-height: 0;
}

.app-frame.view-tuner .tuner-action-dock {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 50px;
}

.app-frame.view-tuner .tuner-bottom-panel,
.app-frame.view-tuner .tuner-hero-actions,
.app-frame.view-tuner .tuner-top-level {
  display: none !important;
}

.app-frame.view-tuner .award-arc {
  inset: 8% 3.2% 31.8%;
}

.app-frame.view-tuner .award-needle {
  bottom: 32.6%;
  height: min(48%, 238px);
}

.app-frame.view-tuner .award-note-readout {
  top: 47.5%;
}

.app-frame.view-tuner .tuner-cent-readout {
  top: 43.5%;
}

.app-frame.view-tuner .tuner-console-controls {
  bottom: 3.8%;
  height: 24%;
}

@media (max-width: 1180px) {
  .app-frame.view-tuner .tuner-workbench {
    grid-template-columns: minmax(500px, 1.34fr) minmax(290px, 0.8fr);
    grid-template-rows: minmax(0, 1fr) 48px;
  }

  .app-frame.view-tuner .award-tuner-console {
    height: 100%;
    min-height: 0;
  }
}

@media (max-width: 980px) {
  .app-frame.view-tuner .tuner-workbench {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }

  .app-frame.view-tuner .award-tuner-console,
  .app-frame.view-tuner .tuner-side-panel,
  .app-frame.view-tuner .tuner-action-dock {
    grid-column: 1;
    grid-row: auto;
  }

  .app-frame.view-tuner .award-tuner-console {
    min-height: 520px;
  }
}

/* v143 compact stage/tuner fit */
.app-frame.view-metronome .metronome-standalone-main,
.app-frame.view-metronome .metronome-prep-shell,
.app-frame.view-tuner .metronome-standalone-main,
.app-frame.view-tuner .tuner-page {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.app-frame.view-metronome .metronome-prep-shell {
  grid-template-columns: clamp(104px, 9vw, 122px) minmax(0, 1fr);
  gap: clamp(10px, 1.2vw, 16px);
}

.app-frame.view-metronome .metronome-prep-main {
  display: grid;
  grid-template-rows: clamp(54px, 8vh, 70px) minmax(248px, 0.92fr) minmax(0, 1fr);
  gap: clamp(8px, 1.2vh, 12px);
  overflow: hidden;
  padding-right: 0;
}

.app-frame.view-metronome .metronome-prep-hero {
  min-height: 0;
  height: auto;
  margin: 0;
}

.app-frame.view-metronome .metronome-prep-hero h2 {
  font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.app-frame.view-metronome .metronome-prep-hero p {
  font-size: clamp(0.82rem, 1.15vw, 1rem);
}

.app-frame.view-metronome .quick-song-card {
  min-height: 0;
  margin: 0;
  padding: clamp(12px, 1.5vw, 18px);
  overflow: hidden;
}

.app-frame.view-metronome .prep-card-title {
  margin-bottom: clamp(10px, 1.3vh, 16px);
}

.app-frame.view-metronome .quick-song-layout {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.72fr);
  gap: clamp(12px, 1.4vw, 18px);
}

.app-frame.view-metronome .quick-song-form {
  gap: clamp(10px, 1.2vw, 14px);
}

.app-frame.view-metronome .quick-field {
  gap: 6px;
}

.app-frame.view-metronome .quick-field > span:first-child,
.app-frame.view-metronome .stage-bpm-tap-row span {
  font-size: 0.82rem;
}

.app-frame.view-metronome .quick-field input,
.app-frame.view-metronome .quick-field select,
.app-frame.view-metronome .quick-choice-trigger,
.app-frame.view-metronome .quick-input-icon,
.app-frame.view-metronome .quick-bpm-control,
.app-frame.view-metronome .stage-manual-bpm input,
.app-frame.view-metronome .tap-tempo-btn {
  min-height: clamp(38px, 5.4vh, 44px);
}

.app-frame.view-metronome .stage-preview-card {
  min-height: 0;
  padding: clamp(12px, 1.4vw, 16px);
}

.app-frame.view-metronome .stage-preview-dial {
  width: clamp(94px, 10vw, 132px);
  height: clamp(94px, 10vw, 132px);
}

.app-frame.view-metronome .stage-preview-dial strong {
  font-size: clamp(1.75rem, 3.1vw, 2.35rem);
}

.app-frame.view-metronome .stage-preview-play {
  width: clamp(64px, 7.5vw, 84px);
  height: clamp(64px, 7.5vw, 84px);
}

.app-frame.view-metronome .stage-preview-play svg {
  width: clamp(24px, 3vw, 34px);
  height: clamp(24px, 3vw, 34px);
}

.app-frame.view-metronome .stage-song-browser-card {
  min-height: 0;
  height: 100%;
  margin: 0;
  grid-template-rows: auto minmax(0, 1fr) clamp(28px, 4.5vh, 38px);
}

.app-frame.view-metronome .stage-song-table-top {
  min-height: clamp(50px, 7vh, 62px);
  padding: clamp(8px, 1.2vw, 12px) clamp(12px, 1.6vw, 18px);
}

.app-frame.view-metronome .stage-song-browser-grid {
  min-height: 0;
  grid-template-columns: minmax(280px, 0.44fr) minmax(0, 1fr);
  gap: clamp(8px, 1vw, 12px);
  padding: clamp(8px, 1vw, 12px);
}

.app-frame.view-metronome .stage-song-browser-list-head {
  min-height: clamp(48px, 6.2vh, 62px);
  padding: 10px 14px;
}

.app-frame.view-metronome .stage-song-browser-list-head strong {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.app-frame.view-metronome .stage-song-browser-row {
  min-height: clamp(58px, 8vh, 72px);
  padding: 8px 9px;
}

.app-frame.view-metronome .stage-song-browser-artist {
  display: none;
}

.app-frame.view-metronome .stage-song-browser-row {
  grid-template-columns: minmax(0, 1fr) auto 38px;
}

.app-frame.view-metronome .stage-click-drop-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(8px, 1vh, 10px);
  padding: clamp(10px, 1.2vw, 14px);
}

.app-frame.view-metronome .stage-click-drop-panel > header {
  align-items: start;
}

.app-frame.view-metronome .stage-click-drop-panel > header strong {
  font-size: clamp(1.08rem, 1.55vw, 1.32rem);
}

.app-frame.view-metronome .stage-click-drop-panel > header small {
  max-width: 48ch;
  font-size: 0.84rem;
  line-height: 1.25;
}

.app-frame.view-metronome .stage-click-set-targets {
  gap: 8px;
}

.app-frame.view-metronome .stage-click-set-target {
  min-height: clamp(58px, 8vh, 72px);
  padding: 10px 12px;
  border-style: solid;
}

.app-frame.view-metronome .stage-click-set-actions button {
  min-height: 34px;
  padding: 0 12px;
}

.app-frame.view-metronome .stage-click-set-actions button:first-child {
  min-width: 86px;
}

.app-frame.view-metronome .quick-setlist-card,
.app-frame.view-metronome .stage-drop-selected {
  display: none !important;
}

.app-frame.view-metronome .stage-song-browser-card footer {
  min-height: 0;
  font-size: 0.88rem;
}

.app-frame.view-tuner .tuner-main {
  grid-template-rows: clamp(58px, 8vh, 70px) minmax(0, 1fr);
}

.app-frame.view-tuner .tuner-hero {
  min-height: 0;
  padding: clamp(9px, 1.1vh, 12px) clamp(12px, 1.4vw, 18px);
}

.app-frame.view-tuner .tuner-workbench {
  grid-template-columns: minmax(0, 1.72fr) minmax(260px, 0.62fr);
  grid-template-rows: minmax(0, 1fr) clamp(44px, 6vh, 50px);
  gap: 8px;
  padding: 8px;
}

.app-frame.view-tuner .award-tuner-console {
  border-radius: 14px;
}

.app-frame.view-tuner .tuner-device-art {
  object-fit: contain;
  object-position: center;
  background: #050504;
  filter: saturate(1.06) contrast(1.03) brightness(0.96);
}

.app-frame.view-tuner .award-tuner-console::after {
  inset: 6px;
  border-radius: 11px;
}

.app-frame.view-tuner .tuner-console-top {
  left: 6.2%;
  right: 6.2%;
  top: 6.5%;
}

.app-frame.view-tuner .tuner-console-status,
.app-frame.view-tuner .tuner-auto-btn {
  min-width: clamp(96px, 12vw, 124px);
  min-height: clamp(34px, 5.4vh, 42px);
  padding: 0 clamp(10px, 1.2vw, 14px);
  font-size: clamp(0.66rem, 0.95vw, 0.78rem);
}

.app-frame.view-tuner .award-note-readout {
  top: 48%;
}

.app-frame.view-tuner .award-note-readout strong {
  font-size: clamp(2.85rem, 5.9vw, 5.35rem);
}

.app-frame.view-tuner .award-note-readout span {
  margin-top: 5px;
  font-size: clamp(0.95rem, 1.55vw, 1.45rem);
}

.app-frame.view-tuner .tuner-accuracy-badge {
  bottom: 18%;
  min-height: clamp(34px, 5.2vh, 42px);
  min-width: min(38%, 260px);
}

.app-frame.view-tuner .tuner-cent-readout {
  top: 43%;
}

.app-frame.view-tuner .tuner-cent-readout strong {
  font-size: clamp(1.65rem, 3.3vw, 3.1rem);
}

.app-frame.view-tuner .tuner-console-controls {
  left: 7.3%;
  right: 7.3%;
  bottom: 7.2%;
  height: 17.5%;
  grid-template-columns: 0.92fr 1.15fr 0.92fr;
  gap: clamp(6px, 1vw, 10px);
}

.app-frame.view-tuner .tuner-gain-block,
.app-frame.view-tuner .tuner-vu-block,
.app-frame.view-tuner .tuner-calibration-block {
  border-color: rgba(231, 166, 87, 0.24);
  border-radius: 10px;
  background: rgba(8, 8, 7, 0.34);
  padding: clamp(5px, 0.7vw, 8px);
}

.app-frame.view-tuner .tuner-gain-block > span,
.app-frame.view-tuner .tuner-vu-block > span,
.app-frame.view-tuner .tuner-calibration-block > span {
  font-size: clamp(0.56rem, 0.75vw, 0.66rem);
}

.app-frame.view-tuner .tuner-gain-knob {
  width: clamp(42px, 5.2vw, 58px);
  height: clamp(42px, 5.2vw, 58px);
}

.app-frame.view-tuner .tuner-gain-knob b {
  width: 72%;
  height: 72%;
}

.app-frame.view-tuner .tuner-vu-meter {
  height: clamp(42px, 6.2vh, 58px);
}

.app-frame.view-tuner .tuner-vu-meter::before {
  font-size: clamp(0.48rem, 0.64vw, 0.62rem);
  top: 6px;
}

.app-frame.view-tuner .tuner-vu-meter i {
  height: 76%;
}

.app-frame.view-tuner .tuner-calibration-control {
  min-height: clamp(30px, 4.6vh, 36px);
}

.app-frame.view-tuner .tuner-calibration-control input {
  font-size: clamp(0.96rem, 1.35vw, 1.22rem);
}

.app-frame.view-tuner .tuner-reset-btn {
  min-height: clamp(24px, 3.6vh, 28px);
  padding: 0 12px;
  font-size: 0.76rem;
}

.app-frame.view-tuner .tuner-side-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 6px;
  padding: 8px;
}

.app-frame.view-tuner .tuner-instrument-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: 9px;
}

.app-frame.view-tuner .tuner-instrument-tabs button {
  min-height: clamp(30px, 4.8vh, 36px);
  font-size: clamp(0.68rem, 0.95vw, 0.78rem);
}

.app-frame.view-tuner .tuner-string-head {
  gap: 6px;
}

.app-frame.view-tuner .tuner-string-head strong {
  font-size: clamp(0.78rem, 1vw, 0.9rem);
}

.app-frame.view-tuner .tuner-string-head label {
  font-size: clamp(0.7rem, 0.92vw, 0.82rem);
}

.app-frame.view-tuner .award-string-list {
  gap: 5px;
  overflow: hidden auto;
}

.app-frame.view-tuner .award-string-row {
  min-height: clamp(36px, 5.7vh, 44px);
  grid-template-columns: 26px 34px 20px minmax(58px, 1fr);
  gap: 6px;
  padding: 0 8px;
}

.app-frame.view-tuner .award-string-row span {
  width: 24px;
  height: 24px;
  font-size: 0.74rem;
}

.app-frame.view-tuner .award-string-row strong {
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
}

.app-frame.view-tuner .award-string-row svg {
  display: none;
}

.app-frame.view-tuner .tuner-mode-block {
  gap: 5px;
}

.app-frame.view-tuner .tuner-mode-block button {
  min-height: clamp(30px, 4.8vh, 36px);
  font-size: clamp(0.72rem, 1vw, 0.86rem);
}

.app-frame.view-tuner .tuner-helper-grid {
  gap: 6px;
}

.app-frame.view-tuner .tuner-helper-grid button {
  min-height: clamp(48px, 7vh, 58px);
  padding: 8px;
  gap: 2px;
}

.app-frame.view-tuner .tuner-helper-grid button.active,
.app-frame.view-tuner .tuner-action-dock button.active {
  border-color: rgba(0, 229, 255, 0.75);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.22), rgba(0, 229, 255, 0.07));
  color: #eaffff;
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.16), 0 0 22px rgba(0, 229, 255, 0.16);
}

.app-frame.view-tuner .tuner-helper-grid button.active svg,
.app-frame.view-tuner .tuner-action-dock button.active svg {
  color: #00e5ff;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.44));
}

.app-frame.view-tuner .tuner-action-dock {
  min-height: 0;
  padding: 5px clamp(10px, 3vw, 40px);
  gap: 8px;
}

.app-frame.view-tuner .tuner-action-dock button {
  min-height: clamp(34px, 5vh, 40px);
}

@media (max-height: 760px) {
  .app-frame.view-metronome .metronome-prep-main {
    grid-template-rows: 54px minmax(236px, 0.9fr) minmax(0, 1fr);
  }

  .app-frame.view-metronome .quick-song-card {
    padding: 12px 14px;
  }

  .app-frame.view-metronome .prep-card-title {
    margin-bottom: 9px;
  }

  .app-frame.view-metronome .stage-preview-status em {
    display: none;
  }

  .app-frame.view-tuner .tuner-workbench {
    grid-template-columns: minmax(0, 1.76fr) minmax(250px, 0.58fr);
  }

  .app-frame.view-tuner .tuner-console-controls {
    bottom: 6.8%;
    height: 16.5%;
  }
}

@media (max-width: 1120px) {
  .app-frame.view-metronome .quick-song-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.66fr);
  }

  .app-frame.view-metronome .stage-song-browser-grid {
    grid-template-columns: minmax(250px, 0.42fr) minmax(0, 1fr);
  }

  .app-frame.view-tuner .tuner-workbench {
    grid-template-columns: minmax(0, 1.62fr) minmax(240px, 0.6fr);
  }
}

/* v143 final no-scroll polish */
.app-frame.view-metronome .metronome-prep-main {
  grid-template-rows: clamp(48px, 7vh, 58px) minmax(286px, 0.9fr) minmax(0, 1fr);
}

.app-frame.view-metronome .quick-song-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.app-frame.view-metronome .quick-song-layout {
  min-height: 0;
}

.app-frame.view-metronome .quick-song-form,
.app-frame.view-metronome .stage-preview-card {
  min-height: 0;
}

.app-frame.view-metronome .stage-preview-card {
  grid-template-columns: clamp(82px, 8.7vw, 112px) clamp(56px, 6vw, 76px) minmax(86px, 1fr);
  gap: clamp(8px, 1vw, 12px);
  align-content: center;
}

.app-frame.view-metronome .stage-preview-status {
  gap: 5px;
}

.app-frame.view-metronome .stage-preview-status em {
  display: none;
}

.app-frame.view-metronome .stage-preview-sound-dots {
  grid-template-columns: repeat(5, 15px);
  gap: 6px;
  min-height: 18px;
}

.app-frame.view-metronome .stage-preview-sound-dots button {
  width: 15px;
  height: 15px;
}

.app-frame.view-metronome .stage-beat-bars {
  min-height: 25px;
  gap: 5px;
}

.app-frame.view-metronome .stage-beat-bars span {
  width: 6px;
  height: 17px;
}

.app-frame.view-metronome .stage-beat-bars span.strong {
  height: 24px;
}

.app-frame.view-metronome .stage-beat-bars span.active {
  height: 26px;
}

.app-frame.view-metronome .stage-preview-volume {
  width: min(130px, 100%);
  grid-template-columns: 14px minmax(42px, 1fr) 24px;
  padding: 3px 6px;
}

.app-frame.view-metronome .stage-create-main {
  min-height: 38px;
}

.app-frame.view-metronome .stage-click-drop-panel > header small {
  max-width: 36ch;
}

.app-frame.view-metronome .stage-click-drop-panel > header .stage-prep-ghost-btn {
  white-space: nowrap;
}

.app-frame.view-metronome .stage-click-empty-target {
  min-height: 88px;
  padding: 14px;
}

.app-frame.view-metronome .stage-click-drop-panel > footer {
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 1120px) {
  .app-frame.view-metronome .metronome-prep-main {
    grid-template-rows: 52px minmax(286px, 0.88fr) minmax(0, 1fr);
  }

  .app-frame.view-metronome .quick-song-layout {
    grid-template-columns: minmax(0, 1fr) minmax(274px, 0.5fr);
  }

  .app-frame.view-metronome .quick-song-form {
    grid-template-columns: minmax(0, 1fr) minmax(138px, 0.62fr) minmax(156px, 0.7fr);
    gap: 9px;
  }

  .app-frame.view-metronome .quick-field.title-field {
    grid-column: span 2;
  }

  .app-frame.view-metronome .quick-field input,
  .app-frame.view-metronome .quick-field select,
  .app-frame.view-metronome .quick-choice-trigger,
  .app-frame.view-metronome .quick-input-icon,
  .app-frame.view-metronome .quick-bpm-control,
  .app-frame.view-metronome .stage-manual-bpm input,
  .app-frame.view-metronome .tap-tempo-btn {
    min-height: 38px;
    height: 38px;
  }

  .app-frame.view-metronome .quick-bpm-control input {
    height: 36px;
    font-size: 1.08rem;
  }

  .app-frame.view-metronome .quick-bpm-control {
    grid-template-columns: 34px minmax(62px, 1fr) 34px;
  }

  .app-frame.view-metronome .stage-bpm-tap-row {
    grid-column: span 2;
    grid-template-columns: minmax(102px, 0.38fr) minmax(132px, 0.62fr);
    gap: 9px;
  }

  .app-frame.view-metronome .stage-preview-card {
    grid-template-columns: 82px 58px minmax(72px, 1fr);
    padding: 10px;
  }

  .app-frame.view-metronome .stage-preview-dial {
    width: 78px;
    height: 78px;
  }

  .app-frame.view-metronome .stage-preview-dial strong {
    font-size: 1.55rem;
  }

  .app-frame.view-metronome .stage-preview-dial span {
    font-size: 0.66rem;
  }

  .app-frame.view-metronome .stage-preview-play {
    width: 56px;
    height: 56px;
  }

  .app-frame.view-metronome .stage-preview-play svg {
    width: 23px;
    height: 23px;
  }

  .app-frame.view-metronome .stage-preview-status b {
    font-size: 0.7rem;
    gap: 5px;
  }

  .app-frame.view-metronome .stage-preview-status small {
    font-size: 0.78rem;
  }

  .app-frame.view-metronome .stage-song-table-top {
    min-height: 50px;
    gap: 8px;
  }

  .app-frame.view-metronome .stage-song-search {
    min-width: 180px;
  }

  .app-frame.view-metronome .stage-song-browser-grid {
    grid-template-columns: minmax(240px, 0.4fr) minmax(0, 1fr);
  }

  .app-frame.view-metronome .stage-click-drop-panel {
    padding: 9px 10px;
    gap: 6px;
  }

  .app-frame.view-metronome .stage-click-drop-panel > header {
    gap: 7px;
  }

  .app-frame.view-metronome .stage-click-drop-panel > header strong {
    font-size: 1.02rem;
    margin-top: 2px;
  }

  .app-frame.view-metronome .stage-click-drop-panel > header small {
    max-width: 30ch;
    margin-top: 4px;
    font-size: 0.78rem;
  }

  .app-frame.view-metronome .stage-click-set-target {
    min-height: 52px;
    padding: 8px 10px;
  }

  .app-frame.view-metronome .stage-click-empty-target {
    min-height: 76px;
  }

  .app-frame.view-metronome .stage-click-drop-panel > footer .stage-prep-ghost-btn {
    min-height: 34px;
  }
}

@media (max-height: 780px) {
  .app-frame.view-metronome .metronome-prep-main {
    grid-template-rows: 50px minmax(286px, 0.88fr) minmax(0, 1fr);
  }

  .app-frame.view-metronome .quick-song-card {
    padding: 10px 12px;
  }

  .app-frame.view-metronome .prep-card-title {
    margin-bottom: 7px;
  }

  .app-frame.view-metronome .prep-card-title h3 {
    font-size: 1rem;
  }

  .app-frame.view-metronome .stage-song-browser-list-head {
    min-height: 42px;
    padding: 8px 12px;
  }

  .app-frame.view-metronome .stage-song-browser-row {
    min-height: 50px;
  }

  .app-frame.view-tuner .tuner-page {
    padding-bottom: 0;
  }
}

/* v144 Metronom Stage iPad fit and compact Click Setlist panel */
.app-frame.view-metronome .metronome-prep-main {
  grid-template-rows: clamp(42px, 6vh, 54px) minmax(224px, 0.72fr) minmax(0, 1fr);
  gap: clamp(7px, 0.9vh, 10px);
}

.app-frame.view-metronome .quick-song-card {
  padding: clamp(8px, 1vw, 12px);
}

.app-frame.view-metronome .prep-card-title {
  margin-bottom: 6px;
}

.app-frame.view-metronome .prep-card-title h3 {
  font-size: clamp(0.92rem, 1.35vw, 1rem);
}

.app-frame.view-metronome .quick-song-layout {
  grid-template-columns: minmax(0, 1fr) minmax(252px, 0.42fr);
  gap: clamp(8px, 1vw, 12px);
}

.app-frame.view-metronome .quick-song-form {
  grid-template-columns: minmax(144px, 1.1fr) minmax(136px, 0.94fr) minmax(112px, 0.74fr);
  gap: 7px 9px;
}

.app-frame.view-metronome .quick-field.title-field,
.app-frame.view-metronome .quick-field.stage-style-field,
.app-frame.view-metronome .quick-field.stage-note-field {
  grid-column: span 1;
}

.app-frame.view-metronome .quick-field,
.app-frame.view-metronome .stage-manual-bpm {
  gap: 4px;
}

.app-frame.view-metronome .quick-field > span:first-child,
.app-frame.view-metronome .stage-bpm-tap-row span {
  font-size: 0.74rem;
}

.app-frame.view-metronome .quick-field input,
.app-frame.view-metronome .quick-field select,
.app-frame.view-metronome .quick-choice-trigger,
.app-frame.view-metronome .quick-input-icon,
.app-frame.view-metronome .stage-manual-bpm input,
.app-frame.view-metronome .tap-tempo-btn {
  height: 34px;
  min-height: 34px;
  border-radius: 7px;
  font-size: 0.9rem;
}

.app-frame.view-metronome .quick-input-icon svg {
  left: 10px;
  width: 15px;
  height: 15px;
}

.app-frame.view-metronome .quick-input-icon input {
  padding-left: 32px;
}

.app-frame.view-metronome .quick-bpm-control {
  height: 34px;
  grid-template-columns: 32px minmax(52px, 1fr) 32px;
}

.app-frame.view-metronome .quick-bpm-control input {
  height: 32px;
  min-height: 32px;
  font-size: 1rem;
}

.app-frame.view-metronome .quick-bpm-control button {
  min-height: 32px;
  font-size: 1.05rem;
}

.app-frame.view-metronome .stage-bpm-tap-row {
  grid-column: span 1;
  grid-template-columns: minmax(54px, 0.44fr) minmax(78px, 0.56fr);
  gap: 6px;
}

.app-frame.view-metronome .stage-manual-bpm input {
  padding: 0 6px;
  font-size: 0.95rem;
}

.app-frame.view-metronome .tap-tempo-btn {
  padding: 0 8px;
  gap: 5px;
  line-height: 1.05;
}

.app-frame.view-metronome .tap-tempo-btn svg {
  width: 15px;
  height: 15px;
}

.app-frame.view-metronome .stage-preview-card {
  grid-template-columns: 72px 52px minmax(70px, 1fr);
  gap: 7px;
  padding: 9px;
}

.app-frame.view-metronome .stage-preview-dial {
  width: 70px;
  height: 70px;
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.34), 0 0 22px rgba(0, 229, 255, 0.16);
}

.app-frame.view-metronome .stage-preview-dial strong {
  font-size: 1.42rem;
}

.app-frame.view-metronome .stage-preview-dial span {
  font-size: 0.58rem;
}

.app-frame.view-metronome .stage-preview-play {
  width: 50px;
  height: 50px;
}

.app-frame.view-metronome .stage-preview-play svg {
  width: 20px;
  height: 20px;
}

.app-frame.view-metronome .stage-preview-status {
  gap: 3px;
}

.app-frame.view-metronome .stage-preview-status b {
  font-size: 0.64rem;
}

.app-frame.view-metronome .stage-preview-status small {
  font-size: 0.7rem;
}

.app-frame.view-metronome .stage-preview-sound-dots {
  grid-template-columns: repeat(5, 13px);
  gap: 5px;
  min-height: 15px;
}

.app-frame.view-metronome .stage-preview-sound-dots button {
  width: 13px;
  height: 13px;
}

.app-frame.view-metronome .stage-beat-bars {
  min-height: 20px;
  gap: 4px;
}

.app-frame.view-metronome .stage-beat-bars span {
  width: 5px;
  height: 14px;
}

.app-frame.view-metronome .stage-beat-bars span.strong {
  height: 19px;
}

.app-frame.view-metronome .stage-beat-bars span.active {
  height: 21px;
}

.app-frame.view-metronome .stage-preview-volume {
  width: min(112px, 100%);
  grid-template-columns: 12px minmax(34px, 1fr) 20px;
  gap: 5px;
  padding: 2px 5px;
}

.app-frame.view-metronome .stage-preview-volume strong {
  font-size: 0.64rem;
}

.app-frame.view-metronome .stage-create-main {
  min-height: 34px;
  font-size: 0.88rem;
}

.app-frame.view-metronome .stage-song-browser-card {
  grid-template-rows: auto minmax(0, 1fr);
}

.app-frame.view-metronome .stage-song-browser-card footer {
  display: none;
}

.app-frame.view-metronome .stage-song-table-top {
  min-height: 46px;
  padding: 7px 12px;
}

.app-frame.view-metronome .stage-song-table-top h3 {
  font-size: 0.98rem;
}

.app-frame.view-metronome .stage-song-search input,
.app-frame.view-metronome .stage-song-sort select {
  height: 36px;
  min-height: 36px;
}

.app-frame.view-metronome .stage-song-browser-grid {
  grid-template-columns: minmax(300px, 0.42fr) minmax(0, 0.58fr);
  gap: 9px;
  padding: 9px;
}

.app-frame.view-metronome .stage-song-browser-list-head {
  min-height: 44px;
  padding: 8px 12px;
}

.app-frame.view-metronome .stage-song-browser-row {
  min-height: 52px;
  padding: 7px 9px;
}

.app-frame.view-metronome .stage-song-menu {
  right: 6px;
  top: 38px;
  min-width: 126px;
  max-width: 148px;
  padding: 4px;
  gap: 2px;
  border-radius: 8px;
  z-index: 80;
}

.app-frame.view-metronome .stage-song-menu button {
  min-height: 30px;
  padding: 0 7px;
  gap: 6px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 820;
}

.app-frame.view-metronome .stage-song-menu button svg {
  width: 14px;
  height: 14px;
}

.app-frame.view-metronome .stage-click-drop-panel {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
}

.app-frame.view-metronome .stage-click-drop-panel > header {
  flex-direction: row;
  align-items: center;
  min-height: 34px;
  gap: 8px;
}

.app-frame.view-metronome .stage-click-drop-panel > header span {
  font-size: 0.7rem;
}

.app-frame.view-metronome .stage-click-drop-panel > header strong {
  margin-top: 1px;
  font-size: 1.02rem;
}

.app-frame.view-metronome .stage-click-drop-panel > header small,
.app-frame.view-metronome .stage-click-drop-panel > footer {
  display: none;
}

.stage-click-add-btn {
  width: auto;
  min-width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.08);
  color: #00e5ff;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.12);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.stage-click-add-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 229, 255, 0.82);
  background: rgba(0, 229, 255, 0.16);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.2);
}

.stage-click-add-btn svg {
  width: 18px;
  height: 18px;
}

.stage-click-add-btn span {
  color: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
}

.app-frame.view-metronome .stage-click-set-targets {
  gap: 7px;
  overflow: auto;
}

.app-frame.view-metronome .stage-click-set-target {
  min-height: 52px;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  padding: 8px 9px;
  border-style: solid;
  border-radius: 8px;
}

.app-frame.view-metronome .stage-click-set-copy {
  gap: 2px;
}

.app-frame.view-metronome .stage-click-set-copy strong {
  font-size: 0.94rem;
}

.app-frame.view-metronome .stage-click-set-name-btn {
  font-size: 0.94rem;
}

.app-frame.view-metronome .stage-click-set-name-input {
  min-height: 30px;
  font-size: 0.86rem;
  border-radius: 7px;
}

.app-frame.view-metronome .stage-click-set-copy small {
  font-size: 0.72rem;
}

.app-frame.view-metronome .stage-click-set-actions {
  justify-content: end;
}

.app-frame.view-metronome .stage-click-set-actions button:first-child,
.app-frame.view-metronome .stage-click-set-actions button:last-child,
.app-frame.view-metronome .stage-click-set-actions button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
}

.app-frame.view-metronome .stage-click-set-actions button svg {
  width: 18px;
  height: 18px;
}

.app-frame.view-metronome .stage-click-set-inline-menu {
  margin-top: -3px;
  padding: 6px;
  border-radius: 8px;
}

.app-frame.view-metronome .stage-click-set-inline-menu button {
  min-height: 32px;
  font-size: 0.82rem;
}

.app-frame.view-metronome .stage-click-empty-target.compact {
  min-height: 52px;
  place-items: center start;
  padding: 8px 10px;
  text-align: left;
}

.app-frame.view-metronome .stage-click-empty-target.compact strong {
  font-size: 0.92rem;
}

.app-frame.view-metronome .stage-click-empty-target.compact button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.1);
  color: #e9fbff;
  font-size: 0.8rem;
  font-weight: 900;
  cursor: pointer;
}

.app-frame.view-metronome .stage-click-empty-target.compact button:hover {
  border-color: rgba(0, 229, 255, 0.82);
  background: rgba(0, 229, 255, 0.18);
}

.app-frame.view-metronome .stage-click-set-target.general-click-set {
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(0, 229, 255, 0.035));
}

.stage-detail-note {
  grid-column: 1 / -1;
}

.stage-clickset-modal {
  max-width: min(420px, calc(100vw - 28px));
}

.stage-clickset-modal .stage-clickset-form {
  display: block;
}

@media (max-width: 1120px) {
  .app-frame.view-metronome .quick-song-layout {
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.38fr);
  }

  .app-frame.view-metronome .quick-song-form {
    grid-template-columns: minmax(126px, 1.05fr) minmax(118px, 0.86fr) minmax(98px, 0.68fr);
    gap: 6px 7px;
  }

  .app-frame.view-metronome .stage-song-browser-grid {
    grid-template-columns: minmax(250px, 0.4fr) minmax(0, 0.6fr);
  }
}

@media (max-height: 760px) {
  .app-frame.view-metronome .metronome-prep-main {
    grid-template-rows: 42px minmax(214px, 0.66fr) minmax(0, 1fr);
  }

  .app-frame.view-metronome .metronome-prep-hero p {
    display: none;
  }

  .app-frame.view-metronome .quick-field > span:first-child,
  .app-frame.view-metronome .stage-bpm-tap-row span {
    font-size: 0.68rem;
  }

  .app-frame.view-metronome .quick-field input,
  .app-frame.view-metronome .quick-field select,
  .app-frame.view-metronome .quick-choice-trigger,
  .app-frame.view-metronome .quick-input-icon,
  .app-frame.view-metronome .stage-manual-bpm input,
  .app-frame.view-metronome .tap-tempo-btn {
    height: 31px;
    min-height: 31px;
  }

  .app-frame.view-metronome .quick-bpm-control {
    height: 31px;
  }

  .app-frame.view-metronome .quick-bpm-control input,
  .app-frame.view-metronome .quick-bpm-control button {
    height: 29px;
    min-height: 29px;
  }
}

/* v146 polish: recording center, dark inline menus, iPad fit */
select option {
  background: #071013;
  color: #f5fbff;
}

.inline-choice {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 6px;
}

.inline-choice > span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  font-weight: 850;
}

.inline-choice-trigger {
  min-width: 0;
  min-height: 38px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.08), rgba(0, 0, 0, 0.38));
  color: #f4fbff;
  padding: 0 10px;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.inline-choice-trigger:hover,
.inline-choice.open .inline-choice-trigger {
  border-color: rgba(0, 229, 255, 0.72);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.16), rgba(0, 0, 0, 0.42));
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.12);
}

.inline-choice-trigger strong {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-choice-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 95;
  max-height: min(280px, 48vh);
  display: grid;
  gap: 4px;
  overflow: auto;
  padding: 7px;
  border: 1px solid rgba(0, 229, 255, 0.24);
  border-radius: 10px;
  background: rgba(6, 13, 15, 0.98);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.48), 0 0 24px rgba(0, 229, 255, 0.12);
}

.inline-choice-menu button {
  min-height: 36px;
  display: grid;
  gap: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #f1f8fb;
  padding: 7px 9px;
  text-align: left;
  cursor: pointer;
}

.inline-choice-menu button:hover,
.inline-choice-menu button.active {
  background: rgba(0, 229, 255, 0.14);
  color: #00e5ff;
}

.inline-choice-menu small {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.72rem;
}

.piano-control-card.inline-choice {
  align-content: center;
}

.piano-control-card.inline-choice .inline-choice-trigger {
  min-height: 44px;
  background: rgba(0, 0, 0, 0.36);
}

.app-frame.view-piano .piano-stage-hero h2 {
  color: #f7fbff;
  font-size: clamp(2.15rem, 4.1vw, 3.8rem);
  font-weight: 1000;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.22), 0 8px 28px rgba(0, 0, 0, 0.52);
}

.app-frame.view-piano .piano-stage-hero h2::after {
  width: min(210px, 42%);
  opacity: 0.9;
}

.app-frame.view-metronomeTool .practice-metronome-hero h2 {
  color: #d69a5b;
  text-shadow: 0 0 18px rgba(214, 154, 91, 0.34), 0 2px 0 rgba(0, 0, 0, 0.5);
}

.app-frame.view-metronomeTool .practice-history-btn {
  display: none !important;
}

.app-frame.view-metronomeTool .practice-side-card section:first-child {
  border: 1px solid rgba(214, 154, 91, 0.28);
  border-radius: 12px;
  padding: 8px;
  background: linear-gradient(135deg, rgba(214, 154, 91, 0.1), rgba(0, 229, 255, 0.045));
}

.app-frame.view-metronomeTool .practice-side-card h3 {
  color: #f0bf87;
  letter-spacing: 0.04em;
  text-shadow: 0 0 12px rgba(214, 154, 91, 0.22);
}

.app-frame.view-metronomeTool .practice-inline-choice {
  display: block;
}

.app-frame.view-metronomeTool .practice-sound-select.inline-choice,
.app-frame.view-metronomeTool .practice-wide-select.inline-choice {
  min-height: 38px;
  border: 0;
  background: transparent;
  padding: 0;
}

.app-frame.view-metronomeTool .practice-sound-select .inline-choice-trigger,
.app-frame.view-metronomeTool .practice-wide-select .inline-choice-trigger {
  width: 100%;
  min-height: 38px;
}

.app-frame.view-metronomeTool .quick-tempo-row {
  grid-template-columns: repeat(6, minmax(46px, 1fr));
}

.app-frame.view-metronomeTool .quick-tempo-add {
  display: none !important;
}

.app-frame.view-metronomeTool .rhythm-pulse-card {
  align-content: stretch;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.app-frame.view-metronomeTool .rhythm-wave {
  width: 100%;
  min-width: 0;
  justify-content: space-between;
  gap: clamp(3px, 0.5vw, 6px);
  overflow: hidden;
}

.app-frame.view-metronomeTool .rhythm-wave span {
  flex: 1 1 0;
  max-width: 7px;
  height: min(calc(var(--h) * 3.5px), 44px);
}

.app-frame.view-metronome .stage-song-table-top {
  grid-template-columns: auto minmax(220px, 420px);
  justify-content: start;
}

.app-frame.view-metronome .stage-song-table-top h3 {
  white-space: normal;
}

.app-frame.view-metronome .stage-style-field .quick-choice-menu {
  max-height: 240px;
}

.app-frame.view-recordings .recordings-top-icons,
.app-frame.view-recordings .record-player-card.empty {
  display: none !important;
}

.app-frame.view-recordings .workspace-main {
  padding: 8px 14px 12px;
}

.app-frame.view-recordings .recordings-shell {
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 14px;
}

.app-frame.view-recordings .recordings-main {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
}

.app-frame.view-recordings .recordings-hero {
  min-height: 46px;
}

.record-section-tabs {
  min-height: 34px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.record-section-tabs span {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.055);
  color: rgba(234, 252, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 850;
}

.app-frame.view-recordings .recordings-grid {
  grid-template-columns: minmax(0, 1.22fr) minmax(300px, 0.82fr);
  grid-template-rows: minmax(300px, 1fr) minmax(240px, 0.78fr);
  gap: 9px;
}

.app-frame.view-recordings .recordings-grid.no-player .record-list-card {
  grid-row: 1 / 3;
}

.app-frame.view-recordings .record-list-card {
  border: 0;
  box-shadow: none;
  background: radial-gradient(circle at 88% 18%, rgba(0, 229, 255, 0.09), transparent 38%), rgba(4, 8, 9, 0.72);
}

.app-frame.view-recordings .record-list-card > header {
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 42px;
}

.app-frame.view-recordings .record-list-card > header > button {
  display: none;
}

.app-frame.view-recordings .record-list-tools {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(82px, 0.28fr) minmax(92px, 0.32fr);
  gap: 7px;
  align-items: end;
}

.app-frame.view-recordings .record-list-choice {
  min-width: 0;
}

.app-frame.view-recordings .record-list-choice > span {
  display: none;
}

.app-frame.view-recordings .record-list-choice .inline-choice-trigger {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 8px;
  font-size: 0.78rem;
}

.app-frame.view-recordings .record-list-choice .inline-choice-trigger strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-frame.view-recordings .record-list-choice .inline-choice-menu {
  right: 0;
  left: auto;
  min-width: 152px;
  max-height: 210px;
  overflow: auto;
}

.app-frame.view-home .home-tool-card .home-ref-asset {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
}

.app-frame.view-home .home-tool-metronome .home-ref-asset {
  object-position: center 56% !important;
}

.app-frame.view-home .home-tool-piano .home-ref-asset {
  object-position: center 58% !important;
}

.app-frame.view-recordings .record-console-screen {
  grid-template-rows: auto auto auto auto minmax(36px, 1fr) auto auto;
  padding: 13px 12px 6px 14px;
}

.record-mic-permission,
.record-append-banner {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.06);
  padding: 5px 8px;
  color: #e9fbff;
  font-size: 0.78rem;
  font-weight: 850;
}

.record-mic-permission span,
.record-append-banner span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.record-mic-permission i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff6956;
  box-shadow: 0 0 10px rgba(255, 105, 86, 0.58);
}

.record-mic-permission.ready i {
  background: #42ff92;
  box-shadow: 0 0 12px rgba(66, 255, 146, 0.7);
}

.record-mic-permission small {
  color: rgba(255, 255, 255, 0.55);
}

.record-mic-permission button,
.record-append-banner button {
  min-height: 26px;
  border: 1px solid rgba(0, 229, 255, 0.48);
  border-radius: 7px;
  background: rgba(0, 229, 255, 0.12);
  color: #00e5ff;
  padding: 0 9px;
  font-weight: 900;
  cursor: pointer;
}

.app-frame.view-recordings .record-form-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.88fr) minmax(108px, 0.5fr);
  grid-template-rows: 42px 64px 42px;
}

.app-frame.view-recordings .record-form-grid > label:nth-child(5) {
  grid-column: 1 / 2;
  grid-row: 3;
}

.app-frame.view-recordings .record-form-grid > label:nth-child(7) {
  grid-column: 3 / 4;
  grid-row: 2;
}

.app-frame.view-recordings .record-form-card .record-custom-tag-field {
  grid-column: 2 / 4;
  grid-row: 3;
}

.app-frame.view-recordings .record-form-grid > .record-tags-field {
  grid-column: 1 / 2;
  grid-row: 2;
}

.app-frame.view-recordings .record-form-grid > .record-description-field {
  grid-column: 2 / 3 !important;
  grid-row: 2 !important;
}

.app-frame.view-recordings .record-form-grid > label:nth-child(7) {
  grid-column: 3 / 4 !important;
  grid-row: 2 !important;
}

.record-custom-tag-field > span:last-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
}

.record-custom-tag-field button {
  min-height: 32px;
  border: 1px solid rgba(0, 229, 255, 0.36);
  border-radius: 7px;
  background: rgba(0, 229, 255, 0.1);
  color: #00e5ff;
  cursor: pointer;
}

.app-frame.view-recordings .record-form-card input,
.app-frame.view-recordings .record-form-card textarea {
  min-height: 30px;
}

.app-frame.view-recordings .record-form-card textarea {
  min-height: 38px;
  max-height: 42px;
}

.app-frame.view-recordings .record-player-card {
  grid-template-rows: auto minmax(36px, 0.42fr) auto auto auto;
  gap: 7px;
  padding: 10px;
}

.app-frame.view-recordings .record-player-card > header {
  grid-template-columns: minmax(0, 1fr) 30px 30px;
}

.app-frame.view-recordings .record-player-card > header > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.app-frame.view-recordings .record-player-card > header small {
  min-width: 0;
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-frame.view-recordings .record-player-waveform {
  min-height: 40px;
}

.app-frame.view-recordings .record-player-controls {
  grid-template-columns: 32px 32px 48px 32px 58px minmax(88px, 1fr);
  gap: 7px;
}

.app-frame.view-recordings .record-player-main {
  width: 48px;
  height: 48px;
  min-height: 48px !important;
}

.record-trim-panel {
  min-height: 32px;
  border: 1px solid rgba(0, 229, 255, 0.12);
  border-radius: 9px;
  background: rgba(0, 229, 255, 0.045);
  overflow: hidden;
}

.record-trim-panel > header {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
}

.record-trim-panel > header button {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #00e5ff;
  font-weight: 900;
  cursor: pointer;
}

.record-trim-panel small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
}

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

.record-trim-controls label {
  display: grid;
  gap: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  font-weight: 800;
}

.record-trim-controls input {
  accent-color: #00d8ff;
}

.record-trim-controls button {
  min-height: 30px;
  border: 1px solid rgba(0, 229, 255, 0.26);
  border-radius: 7px;
  background: rgba(0, 229, 255, 0.08);
  color: #eafcff;
  font-weight: 850;
  cursor: pointer;
}

.app-frame.view-recordings .record-player-card footer {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.app-frame.view-recordings .record-player-card footer button {
  min-height: 32px;
  font-size: 0.74rem;
}

.app-frame.view-recordings .recording-action-menu {
  width: 164px;
  top: 48px;
  padding: 6px;
}

.app-frame.view-recordings .recording-action-menu button {
  min-height: 31px;
  font-size: 0.78rem;
}

/* v151 recordings: capture screen fits one viewport and list opens separately */
.app-frame.view-recordings {
  overflow: hidden;
}

.app-frame.view-recordings .workspace-main {
  height: calc(100vh - 70px);
  overflow: hidden;
  padding: 8px 14px 10px;
}

.app-frame.view-recordings .recordings-shell {
  height: 100%;
  min-height: 0;
  grid-template-columns: clamp(202px, 18vw, 250px) minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.app-frame.view-recordings .recordings-main {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
}

.app-frame.view-recordings .record-section-tabs,
.app-frame.view-recordings .record-quality,
.app-frame.view-recordings .record-mic-permission,
.app-frame.view-recordings .record-backup-check {
  display: none !important;
}

.app-frame.view-recordings .recordings-hero {
  min-height: 44px;
  align-items: start;
}

.app-frame.view-recordings .recordings-hero h2 {
  font-size: clamp(1.55rem, 2.25vw, 2rem);
  line-height: 1;
}

.app-frame.view-recordings .recordings-hero p {
  margin-top: 4px;
  font-size: 0.86rem;
}

.app-frame.view-recordings .recordings-grid.recording-capture-layout {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(304px, 0.74fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "record-console record-side";
  gap: 10px;
  overflow: hidden;
}

.app-frame.view-recordings .recording-capture-layout .record-console {
  grid-area: record-console;
  grid-column: auto !important;
  grid-row: auto !important;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1fr);
  padding: 9px;
}

.app-frame.view-recordings .recording-capture-layout .record-mic-panel {
  height: 100%;
  min-height: 0;
}

.app-frame.view-recordings .recording-capture-layout .record-mic-panel img {
  object-fit: cover;
  object-position: center;
  transform: scale(1.12);
}

.app-frame.view-recordings .recording-capture-layout .record-console-screen {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto auto auto minmax(34px, 0.7fr) auto auto;
  gap: 6px;
  padding: 22px 14px 8px 18px;
  overflow: hidden;
}

.app-frame.view-recordings .recording-capture-layout .record-console-head {
  min-height: 30px;
}

.app-frame.view-recordings .recording-capture-layout .record-time {
  font-size: clamp(2.55rem, 5.15vw, 4.45rem);
  white-space: nowrap;
}

.app-frame.view-recordings .recording-capture-layout .record-time-label {
  font-size: 0.86rem;
}

.app-frame.view-recordings .recording-capture-layout .record-waveform {
  min-height: 36px;
  max-height: 66px;
}

.app-frame.view-recordings .recording-capture-layout .record-level-meter i {
  height: 9px;
}

.app-frame.view-recordings .recording-capture-layout .record-transport {
  min-height: 60px;
  gap: 10px;
  padding: 7px 14px;
}

.app-frame.view-recordings .recording-capture-layout .record-round {
  font-size: 0.72rem;
}

.app-frame.view-recordings .recording-capture-layout .record-round > svg {
  width: 38px;
  height: 38px;
  padding: 9px;
}

.app-frame.view-recordings .recording-capture-layout .record-round.primary > svg {
  width: 54px;
  height: 54px;
  padding: 15px;
}

.record-side-panel {
  grid-area: record-side;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
}

.app-frame.view-recordings .record-side-panel .record-form-card {
  grid-column: auto !important;
  grid-row: auto !important;
  min-height: 0;
  height: 100%;
  padding: 12px;
  gap: 8px;
}

.app-frame.view-recordings .record-side-panel .record-form-grid {
  min-height: 0;
  height: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto minmax(48px, 0.7fr) auto;
  gap: 8px;
  overflow: hidden;
}

.app-frame.view-recordings .record-side-panel .record-form-grid > label,
.app-frame.view-recordings .record-side-panel .record-form-grid > .record-tags-field,
.app-frame.view-recordings .record-side-panel .record-form-grid > .record-description-field,
.app-frame.view-recordings .record-side-panel .record-form-grid > .record-custom-tag-field {
  grid-column: auto !important;
  grid-row: auto !important;
}

.app-frame.view-recordings .record-side-panel .record-tags-field,
.app-frame.view-recordings .record-side-panel .record-description-field,
.app-frame.view-recordings .record-side-panel .record-custom-tag-field {
  grid-column: 1 / -1 !important;
}

.app-frame.view-recordings .record-side-panel .record-form-card input,
.app-frame.view-recordings .record-side-panel .record-form-card textarea {
  min-height: 32px;
  font-size: 0.9rem;
}

.app-frame.view-recordings .record-side-panel .record-form-card textarea {
  min-height: 52px;
  max-height: 64px;
}

.app-frame.view-recordings .record-side-panel .record-tag-picker {
  max-height: 36px;
  overflow: auto hidden;
}

.app-frame.view-recordings .record-side-panel .record-save-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.app-frame.view-recordings .record-side-panel .record-save-btn {
  min-height: 42px;
}

.record-list-shortcut {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 12px;
  border: 1px solid rgba(0, 229, 255, 0.34);
  border-radius: 13px;
  background:
    radial-gradient(circle at 85% 20%, rgba(0, 229, 255, 0.16), transparent 42%),
    linear-gradient(135deg, rgba(0, 229, 255, 0.11), rgba(255, 255, 255, 0.035));
  color: #eaffff;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22), inset 0 0 18px rgba(0, 229, 255, 0.04);
}

.record-list-shortcut:hover {
  border-color: rgba(0, 229, 255, 0.72);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.14), inset 0 0 22px rgba(0, 229, 255, 0.08);
}

.record-list-shortcut span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #00e5ff;
  font-weight: 950;
}

.record-list-shortcut strong {
  justify-self: end;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(0, 229, 255, 0.32);
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.11);
  padding: 0 11px;
  color: #eaffff;
  font-size: 0.88rem;
}

.record-list-shortcut small {
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.82rem;
  font-weight: 700;
}

.recordings-list-main {
  grid-template-rows: auto minmax(0, 1fr) !important;
}

.recordings-list-page-grid {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 10px;
  overflow: hidden;
}

.record-back-btn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: #00e5ff;
  padding: 0;
  font-weight: 950;
  cursor: pointer;
}

.recordings-list-page-grid .record-list-card,
.recordings-list-page-grid .record-player-card {
  grid-column: auto !important;
  grid-row: auto !important;
  height: 100%;
  min-height: 0;
}

.recordings-list-page-grid .record-list-card {
  padding: 12px;
}

.recordings-list-page-grid .record-player-card.empty {
  display: grid;
  place-items: center;
  gap: 8px;
}

@media (max-width: 1180px) {
  .app-frame.view-recordings .recordings-shell {
    grid-template-columns: clamp(184px, 20vw, 222px) minmax(0, 1fr);
    gap: 10px;
  }

  .app-frame.view-recordings .recordings-grid.recording-capture-layout {
    grid-template-columns: minmax(0, 1fr) minmax(286px, 0.72fr);
  }

  .app-frame.view-recordings .recording-capture-layout .record-console {
    grid-template-columns: minmax(150px, 0.58fr) minmax(0, 1fr);
  }

  .app-frame.view-recordings .recording-capture-layout .record-console-screen {
    padding-left: 13px;
  }
}

@media (max-width: 980px) {
  .app-frame.view-recordings .recordings-grid.recording-capture-layout,
  .recordings-list-page-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-frame.view-recordings .recording-capture-layout .record-console {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-frame.view-recordings .recording-capture-layout .record-mic-panel {
    display: none;
  }
}

@media (max-height: 760px) {
  .app-frame.view-recordings .record-section-tabs {
    display: none;
  }

  .app-frame.view-recordings .recordings-main {
    grid-template-rows: 42px minmax(0, 1fr);
  }

  .app-frame.view-recordings .recordings-hero p {
    display: none;
  }

  .app-frame.view-recordings .recordings-grid {
    grid-template-rows: minmax(270px, 1fr) minmax(218px, 0.72fr);
  }

  .app-frame.view-recordings .record-time {
    font-size: clamp(2.2rem, 4.7vw, 3.7rem);
  }

  .app-frame.view-recordings .record-transport {
    min-height: 58px;
    padding: 6px 16px;
  }

  .app-frame.view-recordings .record-round > svg {
    width: 36px;
    height: 36px;
    padding: 9px;
  }

  .app-frame.view-recordings .record-round.primary > svg {
    width: 50px;
    height: 50px;
    padding: 14px;
  }
}

.app-frame.view-recordings .recordings-grid.recording-capture-layout {
  grid-template-rows: minmax(0, 1fr) !important;
}

.app-frame.view-recordings .recordings-grid.recording-capture-layout .record-side-panel {
  height: 100%;
  min-height: 0;
}

/* v152 iPad 7 / iPadOS 16.3 viewport fit */
:root {
  --app-width: 100vw;
  --app-height: 100vh;
  --topbar-height: 66px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

html,
body {
  height: var(--app-height);
  min-height: var(--app-height);
  max-height: var(--app-height);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  min-height: var(--app-height);
  padding: 0;
  touch-action: manipulation;
}

.app-frame,
.workspace,
.composer-frame,
.stage-app-frame {
  height: var(--app-height);
  min-height: 0;
  max-height: var(--app-height);
}

.library-panel {
  height: var(--app-height);
  max-height: var(--app-height);
}

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

.topbar {
  min-height: var(--topbar-height);
  padding: 10px max(14px, var(--safe-right)) 10px max(14px, var(--safe-left));
}

.app-frame.view-metronome .workspace-main,
.app-frame.view-clicksets .workspace-main,
.app-frame.view-piano .workspace-main,
.app-frame.view-recordings .workspace-main,
.app-frame.view-tuner .workspace-main {
  height: calc(var(--app-height) - var(--topbar-height));
  min-height: 0;
  overflow: hidden;
}

.home-workspace-main {
  height: var(--app-height);
  min-height: 0;
  padding:
    max(10px, var(--safe-top))
    max(12px, var(--safe-right))
    max(10px, var(--safe-bottom))
    max(12px, var(--safe-left));
}

@media (min-width: 1000px) and (max-width: 1120px) and (min-height: 700px) and (max-height: 860px) {
  :root {
    --topbar-height: 62px;
  }

  .app-frame,
  .app-frame.view-home {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .app-frame.library-mode-songs,
  .app-frame.library-mode-playlists,
  .app-frame.library-mode-playlist {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .library-panel {
    max-height: var(--app-height);
  }

  .ireal-brand {
    padding: 18px 16px 14px;
  }

  .ireal-brand h1 {
    font-size: 1.1rem;
  }

  .library-category-row {
    min-height: 52px;
    padding: 0 14px;
    grid-template-columns: 28px minmax(0, 1fr) 22px;
  }

  .library-category-row span {
    font-size: 0.94rem;
  }

  .topbar {
    gap: 8px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .tab-button {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.88rem;
  }

  .home-dashboard {
    height: 100%;
    grid-template-rows: 44px minmax(0, 1fr) !important;
    gap: 10px;
  }

  .home-hero {
    gap: 8px;
  }

  .home-hero h2 {
    font-size: 1.18rem;
  }

  .home-hero p {
    display: none;
  }

  .home-search {
    min-height: 40px;
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .home-filter-btn {
    min-height: 40px;
    width: 40px;
  }

  .app-frame.view-home .home-tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    min-height: 0;
  }

  .app-frame.view-home .home-tool-card {
    padding: 12px;
    grid-template-rows: auto minmax(116px, 1fr) 38px;
    gap: 8px;
  }

  .app-frame.view-home .home-tool-copy h3 {
    margin: 8px 0 4px;
    font-size: 0.98rem;
    line-height: 1.05;
  }

  .app-frame.view-home .home-tool-copy p {
    font-size: 0.72rem;
    line-height: 1.22;
    max-width: none;
  }

  .app-frame.view-home .home-tool-copy span {
    width: 30px;
    height: 30px;
  }

  .app-frame.view-home .home-tool-open {
    min-height: 36px;
  }

  .app-frame.view-home .home-ref-asset,
  .app-frame.view-home .home-ref-piano {
    object-fit: contain !important;
    object-position: center !important;
    transform: none !important;
  }

  .piano-stage-shell,
  .recordings-shell {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 10px;
  }

  .piano-stage-rail {
    padding: 8px;
    gap: 7px;
  }

  .piano-rail-brand {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 8px;
  }

  .piano-rail-brand > span {
    width: 44px;
    height: 44px;
  }

  .piano-rail-brand strong {
    font-size: 1rem;
  }

  .piano-rail-brand small,
  .piano-cloud-card {
    display: none;
  }

  .piano-stage-rail nav {
    gap: 5px;
  }

  .piano-rail-item {
    min-height: 42px;
    padding: 0 9px;
    font-size: 0.82rem;
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .piano-rail-item svg {
    width: 20px;
    height: 20px;
  }

  .piano-stage-main {
    grid-template-rows: 46px 72px minmax(0, 1fr) 92px;
    gap: 8px;
    padding-right: 0;
  }

  .piano-stage-hero {
    min-height: 46px;
    padding: 0;
    align-items: center;
  }

  .piano-stage-hero h2 {
    font-size: 1.8rem;
  }

  .piano-stage-hero p,
  .piano-hero-status {
    display: none;
  }

  .piano-stage-controls {
    grid-template-columns: 112px 106px 106px minmax(140px, 1fr) 154px;
    gap: 8px;
  }

  .piano-control-card,
  .piano-square-action {
    min-height: 72px;
    border-radius: 10px;
  }

  .piano-control-card {
    padding: 8px 10px;
    gap: 5px;
  }

  .piano-control-card > span {
    font-size: 0.72rem;
  }

  .piano-control-card select,
  .piano-control-card input[type="number"],
  .piano-stepper {
    min-height: 34px;
  }

  .piano-square-action {
    display: none;
  }

  .piano-stage-keyboard {
    padding: 5px;
    border-radius: 12px;
  }

  .piano-stage-keyboard .piano-keyboard-panel {
    gap: 8px;
  }

  .piano-stage-bottom {
    min-height: 92px;
    grid-template-columns: 0.82fr 1.22fr 1.42fr;
    gap: 8px;
  }

  .piano-info-card {
    min-height: 82px;
    padding: 10px 12px;
    gap: 6px;
  }

  .app-frame.view-recordings .workspace-main,
  .app-frame.view-piano .workspace-main,
  .app-frame.view-tuner .workspace-main {
    padding: 8px 10px 10px;
  }

  .app-frame.view-recordings .recordings-main {
    grid-template-rows: 40px minmax(0, 1fr);
  }

  .app-frame.view-recordings .recordings-hero p {
    display: none;
  }

  .app-frame.view-recordings .recordings-grid.recording-capture-layout {
    grid-template-columns: minmax(0, 1fr) 286px;
    gap: 8px;
  }

  .app-frame.view-recordings .recording-capture-layout .record-console {
    grid-template-columns: 162px minmax(0, 1fr);
    padding: 8px;
  }

  .app-frame.view-recordings .recording-capture-layout .record-console-screen {
    padding: 18px 12px 8px;
    gap: 5px;
  }

  .app-frame.view-recordings .recording-capture-layout .record-time {
    font-size: clamp(2.25rem, 4.9vw, 3.55rem);
  }

  .app-frame.view-recordings .record-side-panel .record-form-card {
    padding: 10px;
  }

  .app-frame.view-recordings .record-side-panel .record-form-grid {
    grid-template-rows: auto auto minmax(42px, 0.62fr) auto;
    gap: 6px;
  }

  .record-list-shortcut {
    min-height: 70px;
    padding: 10px 12px;
  }

  .tuner-page {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 8px;
  }

  .tuner-page .piano-stage-rail {
    padding: 9px 6px;
  }

  .tuner-page .piano-rail-item {
    min-height: 52px;
    font-size: 0.76rem;
  }

  .tuner-main {
    grid-template-rows: 58px minmax(0, 1fr);
  }

  .tuner-hero {
    min-height: 58px;
    padding: 10px 14px;
  }

  .tuner-hero h2 {
    font-size: 1.55rem;
  }

  .tuner-hero p {
    display: none;
  }

  .tuner-hero-actions > button,
  .tuner-mic-pill,
  .tuner-top-level {
    min-height: 36px;
  }

  .tuner-workbench {
    grid-template-columns: minmax(0, 1.18fr) minmax(268px, 0.72fr);
    grid-template-rows: minmax(0, 1fr) 76px 44px;
    gap: 8px;
    padding: 8px;
  }

  .award-tuner-console {
    grid-template-rows: minmax(0, 1fr) 92px;
    padding: 8px;
  }

  .tuner-console-controls {
    grid-template-columns: 104px minmax(0, 1fr) 138px;
    gap: 8px;
  }

  .tuner-side-panel {
    padding: 8px;
  }

  .award-string-list {
    max-height: 214px;
  }

  .tuner-bottom-panel {
    min-height: 76px;
  }

  .tuner-action-dock {
    min-height: 44px;
    padding: 6px;
  }
}

@media (max-width: 999px) and (min-height: 700px) {
  .app-frame,
  .app-frame.view-home,
  .app-frame.metronome-standalone {
    grid-template-columns: minmax(0, 1fr);
  }

  .library-panel {
    display: none;
  }

  .home-workspace-main,
  .workspace-main {
    padding-left: max(10px, var(--safe-left));
    padding-right: max(10px, var(--safe-right));
  }
}

/* v153 compact iPad Safari chrome fit */
@media (min-width: 880px) and (max-width: 999px) and (min-height: 620px) and (max-height: 720px) {
  :root {
    --topbar-height: 58px;
  }

  .app-frame,
  .app-frame.view-home,
  .app-frame.metronome-standalone {
    grid-template-columns: minmax(0, 1fr);
  }

  .library-panel {
    display: none;
  }

  .workspace-main,
  .home-workspace-main {
    width: 100%;
    min-width: 0;
    height: calc(var(--app-height) - var(--topbar-height));
    padding: 8px 10px;
  }

  .app-frame.view-home .home-workspace-main {
    height: var(--app-height);
    padding: 10px;
    overflow: hidden;
  }

  .home-dashboard {
    height: 100%;
    grid-template-rows: 42px minmax(0, 1fr) !important;
    gap: 8px;
    overflow: hidden;
  }

  .home-hero {
    grid-template-columns: minmax(210px, 0.68fr) minmax(300px, 1fr);
    gap: 8px;
  }

  .home-hero h2 {
    font-size: 1.08rem;
  }

  .home-hero p {
    display: none;
  }

  .home-search-shell {
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 7px;
  }

  .home-search {
    min-height: 38px;
    grid-template-columns: 32px minmax(0, 1fr);
    border-radius: 10px;
  }

  .home-filter-btn {
    width: 38px;
    min-height: 38px;
  }

  .app-frame.view-home .home-tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    min-height: 0;
    overflow: hidden;
  }

  .app-frame.view-home .home-tool-card {
    min-height: 0;
    padding: 10px;
    grid-template-rows: auto minmax(0, 1fr) 36px;
    gap: 7px;
    border-radius: 12px;
  }

  .app-frame.view-home .home-tool-copy span {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .app-frame.view-home .home-tool-copy h3 {
    margin: 6px 0 4px;
    font-size: 0.92rem;
    line-height: 1.05;
  }

  .app-frame.view-home .home-tool-copy p {
    font-size: 0.68rem;
    line-height: 1.18;
    max-width: none;
  }

  .app-frame.view-home .home-tool-visual {
    min-height: 0;
  }

  .app-frame.view-home .home-ref-asset,
  .app-frame.view-home .home-ref-piano {
    width: 100%;
    height: 100%;
    max-height: 250px;
    object-fit: contain !important;
    object-position: center !important;
    transform: none !important;
  }

  .app-frame.view-home .home-tool-open {
    min-height: 34px;
    border-radius: 8px;
  }
}

/* v156 tuner precision polish */
.app-frame.view-tuner .award-tuner-console {
  --tuner-state-color: #7effed;
  --tuner-state-soft: rgba(0, 229, 255, 0.18);
  --tuner-state-hard: rgba(0, 229, 255, 0.68);
}

.app-frame.view-tuner .award-tuner-console.flat,
.app-frame.view-tuner .award-tuner-console.sharp {
  --tuner-state-color: #ff3f43;
  --tuner-state-soft: rgba(255, 48, 58, 0.18);
  --tuner-state-hard: rgba(255, 48, 58, 0.8);
}

.app-frame.view-tuner .award-tuner-console.tuned {
  --tuner-state-color: #56ff69;
  --tuner-state-soft: rgba(86, 255, 105, 0.2);
  --tuner-state-hard: rgba(86, 255, 105, 0.86);
}

.app-frame.view-tuner .award-tuner-console::before {
  background:
    radial-gradient(circle at 50% 30%, var(--tuner-state-soft), transparent 20%),
    radial-gradient(circle at 79% 30%, rgba(0, 226, 255, 0.08), transparent 19%),
    radial-gradient(circle at 23% 31%, rgba(255, 111, 44, 0.08), transparent 18%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.16));
}

.app-frame.view-tuner .award-needle {
  background: linear-gradient(180deg, #fff8cf 0%, var(--tuner-state-color) 58%, #6f351a 100%);
  box-shadow:
    0 0 13px var(--tuner-state-hard),
    0 0 32px var(--tuner-state-soft),
    0 2px 10px rgba(0, 0, 0, 0.78);
}

.app-frame.view-tuner .award-tuner-console.flat .award-needle,
.app-frame.view-tuner .award-tuner-console.sharp .award-needle {
  animation: tunerWarningNeedle 0.78s ease-in-out infinite;
}

.app-frame.view-tuner .award-tuner-console.tuned .award-needle {
  animation: tunerLockedNeedle 1.25s ease-in-out infinite;
}

.app-frame.view-tuner .award-note-readout strong,
.app-frame.view-tuner .award-note-readout span {
  color: var(--tuner-state-color);
  text-shadow:
    0 0 10px var(--tuner-state-hard),
    0 0 34px var(--tuner-state-soft),
    0 3px 14px rgba(0, 0, 0, 0.92);
}

.app-frame.view-tuner .award-note-readout strong {
  font-weight: 1000;
  letter-spacing: 0.015em;
}

.app-frame.view-tuner .tuner-cent-readout {
  opacity: 0.5;
  color: rgba(255, 223, 170, 0.72);
  transition:
    color 160ms ease,
    opacity 160ms ease,
    filter 160ms ease,
    transform 160ms ease;
}

.app-frame.view-tuner .tuner-cent-readout.active {
  opacity: 1;
  color: #ff3f43;
  filter: drop-shadow(0 0 13px rgba(255, 48, 58, 0.72));
  transform: translateY(-2px) scale(1.04);
}

.app-frame.view-tuner .award-tuner-console.tuned .tuner-cent-readout {
  opacity: 0.82;
  color: #56ff69;
  filter: drop-shadow(0 0 10px rgba(86, 255, 105, 0.34));
}

.app-frame.view-tuner .tuner-cent-readout strong {
  font-weight: 1000;
}

.app-frame.view-tuner .tuner-accuracy-badge {
  color: #ffd06b;
  border-color: rgba(255, 208, 107, 0.42);
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.72),
    0 0 22px rgba(255, 208, 107, 0.14);
}

.app-frame.view-tuner .tuner-accuracy-badge.flat,
.app-frame.view-tuner .tuner-accuracy-badge.sharp {
  color: #ff484d;
  border-color: rgba(255, 72, 77, 0.74);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 72, 77, 0.16), transparent 54%),
    linear-gradient(180deg, rgba(18, 8, 8, 0.98), rgba(4, 5, 4, 0.98));
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.72),
    0 0 28px rgba(255, 48, 58, 0.32);
}

.app-frame.view-tuner .tuner-accuracy-badge.tuned {
  color: #56ff69;
  border-color: rgba(86, 255, 105, 0.82);
  background:
    radial-gradient(circle at 50% 0%, rgba(86, 255, 105, 0.18), transparent 56%),
    linear-gradient(180deg, rgba(6, 18, 9, 0.98), rgba(4, 5, 4, 0.98));
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.72),
    0 0 31px rgba(86, 255, 105, 0.36);
}

.app-frame.view-tuner .tuner-accuracy-badge span {
  font-weight: 1000;
  letter-spacing: 0.01em;
  text-shadow: 0 0 12px currentColor;
}

.app-frame.view-tuner .tuner-vu-meter {
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.48),
    0 0 18px var(--tuner-state-soft);
}

.app-frame.view-tuner .tuner-vu-meter i {
  filter:
    drop-shadow(0 0 8px rgba(0, 229, 255, 0.45))
    drop-shadow(0 0 14px var(--tuner-state-soft));
}

.app-frame.view-tuner .award-string-row.active {
  border-color: var(--tuner-state-hard);
  background:
    linear-gradient(90deg, var(--tuner-state-soft), rgba(255, 255, 255, 0.035));
  box-shadow:
    inset 0 0 0 1px var(--tuner-state-soft),
    0 0 18px var(--tuner-state-soft);
}

@keyframes tunerWarningNeedle {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.22);
  }
}

@keyframes tunerLockedNeedle {
  0%,
  100% {
    filter: brightness(1);
    box-shadow:
      0 0 13px rgba(86, 255, 105, 0.86),
      0 0 32px rgba(86, 255, 105, 0.2),
      0 2px 10px rgba(0, 0, 0, 0.78);
  }
  50% {
    filter: brightness(1.18);
    box-shadow:
      0 0 18px rgba(86, 255, 105, 0.96),
      0 0 42px rgba(86, 255, 105, 0.32),
      0 2px 10px rgba(0, 0, 0, 0.78);
  }
}

/* v156 iPad tool pages: opened tools show the tool itself, not a second side menu. */
.app-frame.view-piano .piano-stage-shell,
.app-frame.view-recordings .recordings-shell,
.app-frame.view-tuner .tuner-page,
.app-frame.view-metronome .metronome-prep-shell {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
}

.app-frame.view-piano .piano-stage-rail,
.app-frame.view-recordings .piano-stage-rail,
.app-frame.view-tuner .piano-stage-rail,
.app-frame.view-metronome .metronome-prep-rail {
  display: none !important;
}

.app-frame.view-piano .piano-stage-main,
.app-frame.view-recordings .recordings-main,
.app-frame.view-tuner .tuner-main,
.app-frame.view-metronome .metronome-prep-main {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  padding-left: clamp(12px, 1.6vw, 22px) !important;
  padding-right: clamp(12px, 1.6vw, 22px) !important;
}

/* v160: iPad recording waveform/list polish and centered full-size tuner */
.app-frame.view-recordings .recordings-grid.recording-capture-layout {
  grid-template-columns: minmax(0, 1.32fr) minmax(300px, 0.68fr) !important;
}

.app-frame.view-recordings .recording-capture-layout .record-console {
  grid-template-columns: minmax(176px, 0.46fr) minmax(0, 1fr) !important;
}

.app-frame.view-recordings .recording-capture-layout .record-mic-panel {
  display: block !important;
  min-width: 0;
  overflow: hidden;
}

.app-frame.view-recordings .recording-capture-layout .record-mic-panel img {
  object-fit: cover !important;
  object-position: center !important;
  transform: scale(1.06) !important;
}

.app-frame.view-recordings .recording-capture-layout .record-waveform {
  min-height: 72px !important;
  max-height: 118px !important;
  align-items: center;
  padding: 0 4px;
  background:
    linear-gradient(180deg, transparent 48%, rgba(0, 229, 255, 0.13) 49%, transparent 51%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 229, 255, 0.12), transparent 68%);
}

.app-frame.view-recordings .recording-capture-layout .record-waveform i,
.app-frame.view-recordings .record-player-card .record-waveform i {
  width: max(3px, min(7px, 0.52vw));
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(99, 255, 244, 0.95), rgba(0, 203, 229, 0.92));
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
}

.record-list-shortcut {
  grid-template-columns: 1fr auto !important;
  place-items: center stretch;
}

.record-list-shortcut span {
  justify-self: start;
}

.recordings-list-hero .record-back-btn.icon-only {
  width: 42px;
  min-height: 42px;
  justify-content: center;
  border: 1px solid rgba(0, 229, 255, 0.34);
  border-radius: 12px;
  background: rgba(0, 229, 255, 0.08);
}

.recordings-list-hero h2 {
  justify-content: center;
}

.recordings-list-page-grid {
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr) !important;
}

.recordings-list-page-grid .record-list-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.recordings-list-page-grid .record-list-card > header {
  align-items: center;
}

.recordings-list-page-grid .record-list-card > header > strong {
  text-align: center;
}

.app-frame.view-recordings .record-list-tools {
  grid-template-columns: minmax(0, 1fr) minmax(86px, auto) minmax(86px, auto);
}

.recording-list {
  overflow: auto;
  border: 1px solid rgba(0, 229, 255, 0.14);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.22);
  padding: 8px;
}

.recording-row {
  grid-template-columns: 48px minmax(126px, 0.95fr) minmax(112px, 1fr) 58px 74px 38px !important;
  gap: 9px !important;
  min-height: 76px !important;
}

.record-row-waveform {
  min-height: 40px !important;
  max-height: 44px !important;
  border: 0 !important;
  background: transparent !important;
  padding: 0;
}

.record-row-waveform i {
  width: 3px !important;
  opacity: 0.92;
}

.record-list-pagination {
  min-height: 42px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}

.record-list-pagination button {
  min-height: 36px;
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.08);
  color: #00e5ff;
  cursor: pointer;
}

.record-list-pagination button:disabled {
  opacity: 0.36;
  cursor: default;
}

.record-list-pagination span {
  color: rgba(234, 255, 255, 0.74);
  text-align: center;
  font-weight: 850;
}

.app-frame.view-recordings .record-player-card {
  display: grid;
  grid-template-rows: auto minmax(110px, 0.78fr) auto auto auto;
  gap: 12px;
  overflow: hidden;
}

.app-frame.view-recordings .record-player-card .record-player-waveform {
  min-height: 118px !important;
  max-height: 170px !important;
  border: 1px solid rgba(0, 229, 255, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(180deg, transparent 48%, rgba(255, 76, 86, 0.64) 49%, transparent 51%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 229, 255, 0.12), transparent 66%);
}

.app-frame.view-recordings .record-scrub-row input,
.app-frame.view-recordings .record-player-controls label input {
  min-width: 0;
  accent-color: #00e5ff;
}

.app-frame.view-recordings .record-player-controls {
  grid-template-columns: 44px 44px 66px 44px minmax(76px, 0.34fr) minmax(160px, 1fr) !important;
  align-items: center;
  gap: 10px !important;
}

.app-frame.view-recordings .record-player-controls button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
}

.app-frame.view-recordings .record-player-main {
  min-width: 66px !important;
  min-height: 66px !important;
}

.app-frame.view-recordings .record-player-main svg {
  width: 34px;
  height: 34px;
}

.app-frame.view-recordings .record-trim-panel {
  display: none !important;
}

@media (max-width: 920px) {
  .app-frame.view-recordings .recordings-grid.recording-capture-layout {
    grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.72fr) !important;
    overflow: hidden !important;
  }

  .app-frame.view-recordings .recording-capture-layout .record-mic-panel {
    display: block !important;
  }

  .app-frame.view-recordings .recording-capture-layout .record-console {
    grid-template-columns: minmax(146px, 0.44fr) minmax(0, 1fr) !important;
  }
}

.app-frame.view-tuner .tuner-main {
  grid-template-rows: auto minmax(0, 1fr) !important;
  justify-items: center;
}

.app-frame.view-tuner .tuner-hero {
  width: min(100%, 1040px);
  min-height: 64px !important;
}

.app-frame.view-tuner .tuner-workbench {
  width: min(100%, 1040px);
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  place-items: center;
  padding: 8px !important;
  overflow: hidden;
}

.app-frame.view-tuner .tuner-side-panel,
.app-frame.view-tuner .tuner-action-dock {
  display: none !important;
}

.app-frame.view-tuner .award-tuner-console {
  width: min(100%, 760px);
  height: min(100%, 900px);
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) 112px !important;
  padding: clamp(10px, 1.4vw, 16px) !important;
  transform: translateX(0);
}

.app-frame.view-tuner .tuner-device-art {
  position: absolute;
  inset: -2% -2% -1%;
  width: 104%;
  height: 104%;
  object-fit: cover;
  object-position: center;
  opacity: 0.72;
  pointer-events: none;
}

.app-frame.view-tuner .award-arc {
  z-index: 2;
  min-height: 0;
  margin: 0 auto;
  width: min(100%, 680px);
}

.app-frame.view-tuner .award-needle {
  height: min(30%, 132px) !important;
  width: 2px !important;
  bottom: 28% !important;
  transform: translateX(-50%) rotate(calc(var(--needle, 0) * 1.34deg)) !important;
}

.app-frame.view-tuner .tuner-cent-readout {
  bottom: 31% !important;
}

.app-frame.view-tuner .award-note-readout {
  margin-top: 36px !important;
}

.app-frame.view-tuner .award-note-readout strong {
  font-size: clamp(3.5rem, 8.6vw, 6.2rem) !important;
}

.app-frame.view-tuner .tuner-console-controls {
  grid-template-columns: 128px minmax(0, 1fr) 176px !important;
  gap: 8px;
}

.app-frame.view-tuner .tuner-vu-meter {
  width: min(100%, 178px) !important;
  height: 44px !important;
  border-width: 3px;
}

.app-frame.view-tuner .tuner-vu-meter i {
  height: 35px !important;
}

.tuner-reference-chip {
  position: absolute;
  z-index: 7;
  right: clamp(18px, 3vw, 38px);
  bottom: clamp(18px, 2.5vw, 34px);
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(0, 229, 255, 0.34);
  border-radius: 999px;
  background: rgba(0, 14, 16, 0.72);
  color: #eaffff;
  padding: 0 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.12);
}

.tuner-reference-chip svg {
  width: 18px;
  height: 18px;
  color: #00e5ff;
}

.tuner-reference-chip b {
  color: rgba(234, 255, 255, 0.62);
  font-size: 0.72rem;
}

.tuner-reference-chip.active {
  border-color: rgba(86, 255, 105, 0.72);
  color: #56ff69;
  box-shadow: 0 0 26px rgba(86, 255, 105, 0.18);
}

@media (max-height: 760px) {
  .app-frame.view-tuner .tuner-hero p {
    display: none;
  }

  .app-frame.view-tuner .award-tuner-console {
    width: min(100%, 700px);
    grid-template-rows: minmax(0, 1fr) 94px !important;
  }

  .app-frame.view-tuner .tuner-console-controls {
    grid-template-columns: 112px minmax(0, 1fr) 154px !important;
  }
}

/* v161: recording download choice sheet and tighter compact controls */
.record-download-sheet {
  width: min(460px, calc(100vw - 36px));
  display: grid;
  gap: 14px;
  border: 1px solid rgba(0, 229, 255, 0.34);
  border-radius: 16px;
  background:
    radial-gradient(circle at 18% 0%, rgba(0, 229, 255, 0.16), transparent 42%),
    linear-gradient(145deg, rgba(16, 22, 22, 0.98), rgba(4, 7, 8, 0.98));
  color: #eaffff;
  padding: 16px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.58), 0 0 32px rgba(0, 229, 255, 0.13);
}

.record-download-sheet header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: start;
  gap: 12px;
}

.record-download-sheet header div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.record-download-sheet strong {
  font-size: 1.25rem;
  font-weight: 950;
}

.record-download-sheet span,
.record-download-sheet p {
  color: rgba(234, 255, 255, 0.68);
}

.record-download-sheet header button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #eaffff;
}

.record-download-waveform {
  min-height: 72px !important;
  max-height: 90px !important;
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, transparent 48%, rgba(0, 229, 255, 0.16) 49%, transparent 51%),
    rgba(0, 0, 0, 0.24);
}

.record-download-sheet footer {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
  gap: 10px;
}

.record-download-sheet footer button {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 900;
}

.record-download-sheet footer button:first-child {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  color: #eaffff;
}

@media (max-height: 720px) {
  .app-frame.view-recordings .record-player-card {
    gap: 8px;
  }

  .app-frame.view-recordings .record-player-card .record-player-waveform {
    min-height: 84px !important;
    max-height: 120px !important;
  }

  .app-frame.view-recordings .record-player-controls {
    grid-template-columns: 38px 38px 56px 38px 70px minmax(120px, 1fr) !important;
    gap: 7px !important;
  }

  .app-frame.view-recordings .record-player-main {
    min-width: 56px !important;
    min-height: 56px !important;
  }
}

.app-frame.view-recordings .recording-capture-layout {
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.72fr);
  grid-template-rows: minmax(0, 1fr);
}

@media (max-width: 1100px), (max-height: 760px) {
  .app-frame.view-recordings .recording-capture-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, auto) minmax(0, 1fr);
  }

  .app-frame.view-recordings .record-side-panel {
    min-height: 0;
  }

  .app-frame.view-recordings .record-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-frame.view-recordings .record-description-field {
    grid-column: span 2;
  }
}

/* v157: focused iPad tool pages, stage Click Setlist routing, and stable tuner needle */
html,
body,
#app,
.app-frame,
.workspace,
.stage-app-frame {
  width: var(--app-width);
  max-width: var(--app-width);
}

.app-frame.view-recordings .recordings-shell,
.app-frame.view-piano .piano-stage-shell,
.app-frame.view-tuner .tuner-page {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
  width: 100%;
  max-width: 100%;
}

.app-frame.view-recordings .piano-stage-rail,
.app-frame.view-piano .piano-stage-rail,
.app-frame.view-tuner .piano-stage-rail {
  display: none !important;
}

.app-frame.view-recordings .recordings-main,
.app-frame.view-piano .piano-stage-main,
.app-frame.view-tuner .tuner-main {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.app-frame.view-recordings .workspace-main,
.app-frame.view-piano .workspace-main,
.app-frame.view-tuner .workspace-main {
  padding: clamp(8px, 1.1vw, 14px) clamp(10px, 1.4vw, 18px) clamp(8px, 1.1vw, 14px) !important;
}

.app-frame.view-recordings .recordings-main {
  grid-template-rows: auto minmax(0, 1fr) !important;
  gap: 8px !important;
}

.app-frame.view-recordings .recordings-hero {
  min-height: 42px !important;
  padding: 0 2px 4px !important;
}

.app-frame.view-recordings .recordings-hero h2 {
  font-size: clamp(1.65rem, 2.7vw, 2.25rem) !important;
}

.app-frame.view-recordings .recordings-grid.recording-capture-layout {
  grid-template-columns: minmax(470px, 1.25fr) minmax(286px, 0.74fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 10px !important;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.app-frame.view-recordings .recording-capture-layout .record-console {
  grid-template-columns: minmax(176px, 0.54fr) minmax(0, 1fr) !important;
  min-height: 0;
  height: 100%;
  padding: clamp(8px, 1vw, 12px) !important;
}

.app-frame.view-recordings .recording-capture-layout .record-mic-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.app-frame.view-recordings .recording-capture-layout .record-console-screen {
  padding: clamp(12px, 1.4vw, 20px) clamp(10px, 1.1vw, 14px) 8px !important;
  gap: clamp(5px, 0.7vw, 8px) !important;
}

.app-frame.view-recordings .recording-capture-layout .record-time {
  font-size: clamp(2.35rem, 4.6vw, 4.1rem) !important;
}

.app-frame.view-recordings .record-side-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  overflow: hidden;
}

.app-frame.view-recordings .record-side-panel .record-form-card {
  min-height: 0;
  overflow: hidden;
  padding: clamp(8px, 1vw, 11px) !important;
}

.app-frame.view-recordings .record-side-panel .record-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: auto auto minmax(56px, 0.72fr) auto !important;
  gap: 7px !important;
}

.app-frame.view-recordings .record-side-panel .record-form-grid > label,
.app-frame.view-recordings .record-side-panel .record-form-grid > .record-tags-field,
.app-frame.view-recordings .record-side-panel .record-form-grid > .record-description-field,
.app-frame.view-recordings .record-side-panel .record-form-grid > .record-custom-tag-field {
  min-width: 0;
  gap: 4px;
}

.app-frame.view-recordings .record-side-panel .record-form-card input,
.app-frame.view-recordings .record-side-panel .record-form-card textarea {
  min-height: 34px !important;
  font-size: 0.86rem !important;
}

.app-frame.view-recordings .record-side-panel .record-form-card textarea {
  min-height: 58px !important;
  max-height: 84px !important;
}

.app-frame.view-recordings .record-side-panel .record-tag-picker {
  max-height: 38px;
  overflow: auto;
  gap: 4px;
}

.app-frame.view-recordings .record-side-panel .record-tag-picker button {
  min-height: 27px;
  padding: 0 8px;
  font-size: 0.78rem;
}

.app-frame.view-recordings .record-list-shortcut {
  min-height: 58px;
  padding: 9px 12px;
}

.app-frame.view-recordings .record-list-shortcut small {
  display: none;
}

@media (max-width: 920px) {
  .app-frame.view-recordings .recordings-grid.recording-capture-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    overflow: auto;
  }

  .app-frame.view-recordings .recording-capture-layout .record-mic-panel {
    display: none !important;
  }
}

.app-frame.library-mode-songs,
.app-frame.library-mode-playlists,
.app-frame.library-mode-playlist {
  width: var(--app-width);
  max-width: var(--app-width);
  overflow: hidden;
}

.app-frame.library-mode-songs .workspace,
.app-frame.library-mode-playlists .workspace,
.app-frame.library-mode-playlist .workspace {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.browser-workspace-main,
.browser-preview-shell,
.browser-chart-area,
.browser-chart-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.browser-chart-area {
  overflow: auto;
  place-items: start center;
  padding: clamp(14px, 2vw, 30px) clamp(10px, 1.6vw, 18px);
}

.browser-chart-wrap .chart-paper.preview-paper {
  width: min(100%, 860px) !important;
  max-width: 100% !important;
  min-width: 0 !important;
  transform: none !important;
}

.browser-preview-toolbar {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.app-frame.view-tuner .award-needle {
  transform: translateX(-50%) rotate(calc(var(--needle, 0) * 1.28deg));
  transition: transform 78ms cubic-bezier(0.2, 0.9, 0.25, 1), filter 120ms ease, box-shadow 120ms ease;
}

.app-frame.view-tuner .award-tuner-console.searching .award-needle,
.app-frame.view-tuner .award-tuner-console.idle .award-needle {
  animation: none !important;
  transform: translateX(-50%) rotate(0deg) !important;
}

/* v158: real iPad recording fit and more readable preparation workspace */
.app-frame.view-recordings .recordings-shell,
.app-frame.view-recordings .recordings-main {
  overflow: hidden !important;
}

.app-frame.view-recordings .recordings-hero {
  min-height: 48px !important;
}

.app-frame.view-recordings .recordings-hero p {
  font-size: clamp(0.82rem, 1.4vw, 0.98rem) !important;
  line-height: 1.15;
}

.app-frame.view-recordings .recordings-grid.recording-capture-layout {
  grid-template-columns: minmax(0, 1.18fr) minmax(276px, 0.72fr) !important;
  grid-template-areas: "record-console record-side" !important;
  align-items: stretch;
  overflow: hidden !important;
}

.app-frame.view-recordings .recording-capture-layout .record-console {
  grid-area: record-console !important;
  min-width: 0;
  grid-template-columns: minmax(132px, 0.44fr) minmax(0, 1fr) !important;
  overflow: hidden;
}

.app-frame.view-recordings .recording-capture-layout .record-mic-panel {
  display: block !important;
  min-width: 0;
}

.app-frame.view-recordings .recording-capture-layout .record-mic-panel img {
  transform: none !important;
  object-fit: cover;
  object-position: center;
}

.app-frame.view-recordings .recording-capture-layout .record-console-screen {
  min-width: 0;
  grid-template-rows: auto auto auto minmax(28px, 0.6fr) auto auto !important;
  padding: clamp(10px, 1.1vw, 15px) clamp(9px, 1vw, 13px) 7px !important;
}

.app-frame.view-recordings .recording-capture-layout .record-time {
  font-size: clamp(2.1rem, 4.1vw, 3.6rem) !important;
}

.app-frame.view-recordings .recording-capture-layout .record-waveform {
  min-height: 28px !important;
  max-height: 54px !important;
}

.app-frame.view-recordings .recording-capture-layout .record-levels {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.app-frame.view-recordings .recording-capture-layout .record-transport {
  min-height: 52px !important;
  padding: 6px 10px !important;
}

.app-frame.view-recordings .recording-capture-layout .record-round > svg {
  width: 34px !important;
  height: 34px !important;
  padding: 8px !important;
}

.app-frame.view-recordings .recording-capture-layout .record-round.primary > svg {
  width: 48px !important;
  height: 48px !important;
  padding: 13px !important;
}

.app-frame.view-recordings .record-side-panel {
  grid-area: record-side !important;
  min-width: 0;
}

.app-frame.view-recordings .record-side-panel .record-form-card {
  padding: 9px !important;
}

.app-frame.view-recordings .record-side-panel .record-form-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  grid-template-rows: auto auto minmax(42px, 0.7fr) auto !important;
  gap: 6px !important;
}

.app-frame.view-recordings .record-side-panel .record-form-grid > label:nth-child(3),
.app-frame.view-recordings .record-side-panel .record-form-grid > label:nth-child(6) {
  display: none !important;
}

.app-frame.view-recordings .record-side-panel .record-tags-field,
.app-frame.view-recordings .record-side-panel .record-description-field,
.app-frame.view-recordings .record-side-panel .record-custom-tag-field {
  grid-column: 1 / -1 !important;
}

.app-frame.view-recordings .record-side-panel .record-form-card label span {
  font-size: 0.72rem !important;
  line-height: 1;
}

.app-frame.view-recordings .record-side-panel .record-form-card input,
.app-frame.view-recordings .record-side-panel .record-form-card textarea {
  min-height: 30px !important;
  font-size: 0.82rem !important;
}

.app-frame.view-recordings .record-side-panel .record-form-card textarea {
  min-height: 44px !important;
  max-height: 56px !important;
}

.app-frame.view-recordings .record-side-panel .record-tag-picker {
  max-height: 32px !important;
}

.app-frame.view-recordings .record-side-panel .record-tag-picker button {
  min-height: 25px !important;
  font-size: 0.72rem !important;
}

.app-frame.view-recordings .record-side-panel .record-save-btn {
  min-height: 38px !important;
}

.app-frame.view-recordings .record-list-shortcut {
  min-height: 48px !important;
}

@media (max-width: 820px) {
  .app-frame.view-recordings .recordings-grid.recording-capture-layout {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 0.7fr) !important;
  }

  .app-frame.view-recordings .recording-capture-layout .record-mic-panel {
    display: none !important;
  }

  .app-frame.view-recordings .recording-capture-layout .record-console {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

.app-frame.view-editor .prep-stage-editor.chart-mode .section-title h2 {
  min-width: 0;
}

.app-frame.view-editor .prep-stage-editor.chart-mode .chart-scroll {
  min-width: 0;
}

/* v161 iPad navigation and chart fit polish. */
.app-frame.tool-page-shell {
  grid-template-columns: clamp(148px, 17.5vw, 244px) minmax(0, 1fr) !important;
}

.app-frame.tool-page-shell .library-panel {
  min-width: 0;
  overflow: hidden;
}

.app-frame.tool-page-shell .ireal-brand {
  min-height: 88px;
  padding: 14px 12px;
}

.app-frame.tool-page-shell .ireal-library-categories {
  padding: 8px 10px;
  gap: 4px;
}

.app-frame.tool-page-shell .home-nav-row {
  min-height: 46px;
  padding: 8px 10px;
  gap: 10px;
}

.app-frame.tool-page-shell .home-nav-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-frame.view-piano .piano-stage-shell,
.app-frame.view-recordings .recordings-shell,
.app-frame.view-tuner .tuner-page,
.app-frame.view-metronome .metronome-prep-shell,
.app-frame.view-metronomeTool .practice-metronome-shell {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
}

.app-frame.view-piano .piano-stage-rail,
.app-frame.view-recordings .piano-stage-rail,
.app-frame.view-tuner .piano-stage-rail,
.app-frame.view-metronome .metronome-prep-rail,
.app-frame.view-metronomeTool .practice-metronome-rail {
  display: none !important;
}

.app-frame.view-piano .piano-stage-main,
.app-frame.view-recordings .recordings-main,
.app-frame.view-tuner .tuner-main,
.app-frame.view-metronome .metronome-prep-main,
.app-frame.view-metronomeTool .practice-metronome-main {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  padding-left: clamp(12px, 1.6vw, 22px) !important;
  padding-right: clamp(12px, 1.6vw, 22px) !important;
}

@media (max-width: 920px) {
  .app-frame.tool-page-shell {
    grid-template-columns: clamp(116px, 18vw, 150px) minmax(0, 1fr) !important;
  }

  .app-frame.tool-page-shell .ireal-brand {
    min-height: 76px;
    padding: 10px 8px;
  }

  .app-frame.tool-page-shell .ireal-brand .brand-icon {
    width: 34px;
    height: 34px;
  }

  .app-frame.tool-page-shell .ireal-brand h1 {
    font-size: clamp(0.9rem, 2vw, 1.05rem);
  }

  .app-frame.tool-page-shell .ireal-brand p {
    display: none;
  }

  .app-frame.tool-page-shell .home-nav-row {
    min-height: 42px;
    padding: 7px 8px;
    font-size: clamp(0.78rem, 1.8vw, 0.94rem);
  }

  .app-frame.tool-page-shell .home-nav-row svg {
    width: 22px;
    height: 22px;
  }

  .app-frame.library-mode-songs {
    grid-template-columns: clamp(220px, 31vw, 280px) minmax(0, 1fr) !important;
  }

  .app-frame.library-mode-songs > .library-panel {
    display: flex !important;
    min-width: 0;
    overflow: hidden;
  }

  .app-frame.library-mode-songs .browser-preview-shell {
    height: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .app-frame.library-mode-songs .browser-chart-area {
    width: 100%;
    min-width: 0;
    place-items: start center;
    overflow: auto;
    padding: clamp(12px, 2.4vw, 22px);
  }

  .app-frame.library-mode-songs .browser-chart-wrap {
    width: min(100%, 720px);
    min-width: 0;
  }

  .app-frame.library-mode-songs .browser-chart-wrap .chart-paper.preview-paper {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* v163 Metronom iPad fit: keep controls inside one clean screen without overlap. */
.app-frame.view-metronomeTool {
  --met-pad: clamp(7px, 0.9vw, 12px);
  --met-gap: clamp(7px, 0.9vw, 11px);
}

.app-frame.view-metronomeTool .workspace {
  grid-template-rows: clamp(50px, 6vh, 58px) minmax(0, 1fr) !important;
  min-height: 0;
  overflow: hidden;
}

.app-frame.view-metronomeTool .topbar {
  min-height: clamp(50px, 6vh, 58px) !important;
  padding: 7px 12px !important;
  overflow: hidden;
}

.app-frame.view-metronomeTool .tabs {
  gap: 8px;
  overflow: hidden;
}

.app-frame.view-metronomeTool .tab-button {
  min-height: 38px !important;
  padding: 0 13px !important;
  white-space: nowrap;
}

.app-frame.view-metronomeTool .metronome-standalone-main {
  height: 100%;
  min-height: 0;
  padding: var(--met-pad) clamp(8px, 1vw, 14px) !important;
  overflow: hidden !important;
}

.app-frame.view-metronomeTool .practice-metronome-shell,
.app-frame.view-metronomeTool .practice-metronome-main {
  height: 100%;
  min-height: 0;
  overflow: hidden !important;
}

.app-frame.view-metronomeTool .practice-metronome-main {
  display: grid;
  grid-template-rows: clamp(50px, 6.3vh, 62px) minmax(0, 1fr);
  gap: var(--met-gap) !important;
  padding-left: clamp(8px, 1vw, 14px) !important;
  padding-right: clamp(8px, 1vw, 14px) !important;
}

.app-frame.view-metronomeTool .practice-metronome-hero {
  min-height: 0;
  align-items: end;
  gap: 10px;
}

.app-frame.view-metronomeTool .practice-metronome-hero h2 {
  font-size: clamp(1.45rem, 3vw, 2.35rem) !important;
  line-height: 0.98;
}

.app-frame.view-metronomeTool .practice-metronome-hero p {
  margin-top: 3px !important;
  font-size: clamp(0.72rem, 1.15vw, 0.92rem) !important;
  line-height: 1.15 !important;
}

.app-frame.view-metronomeTool .practice-history-btn {
  min-height: 36px !important;
  padding: 0 12px !important;
  font-size: clamp(0.76rem, 1vw, 0.9rem);
}

.app-frame.view-metronomeTool .practice-metronome-grid {
  height: 100%;
  min-height: 0;
  display: grid !important;
  grid-template-columns: minmax(0, 1.12fr) minmax(260px, 0.88fr) !important;
  grid-template-rows: minmax(0, 1fr) clamp(82px, 11vh, 118px) clamp(34px, 4.5vh, 42px) !important;
  grid-template-areas:
    "console side"
    "quick pulse"
    "status status" !important;
  gap: var(--met-gap) !important;
  overflow: hidden !important;
}

.app-frame.view-metronomeTool .practice-console-card {
  grid-area: console;
  min-height: 0;
  display: grid !important;
  grid-template-columns: minmax(112px, 0.55fr) minmax(180px, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  grid-template-areas:
    "device bpm"
    "bottom bottom";
  gap: var(--met-gap) !important;
  padding: var(--met-pad) !important;
  overflow: hidden !important;
}

.app-frame.view-metronomeTool .analog-metronome-device {
  grid-area: device;
  min-height: 0 !important;
  height: 100%;
  overflow: hidden !important;
}

.app-frame.view-metronomeTool .analog-metronome-frame {
  width: min(92%, 245px) !important;
  height: min(96%, 258px) !important;
}

.app-frame.view-metronomeTool .analog-device-status {
  top: 8px !important;
  left: 8px !important;
  padding: 6px 8px !important;
  font-size: 0.62rem !important;
}

.app-frame.view-metronomeTool .practice-bpm-console {
  grid-area: bpm;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(98px, 0.62fr) !important;
  grid-template-rows: minmax(64px, 1fr) clamp(34px, 4.9vh, 42px) clamp(34px, 4.8vh, 40px) !important;
  align-content: stretch !important;
  gap: 7px !important;
  padding: 8px !important;
  overflow: hidden !important;
}

.app-frame.view-metronomeTool .practice-bpm-display {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  min-width: 0;
  min-height: 64px !important;
  height: 100%;
  padding: 5px 28px 6px !important;
}

.app-frame.view-metronomeTool .practice-bpm-input {
  font-size: clamp(2.55rem, 6vw, 4.6rem) !important;
  line-height: 0.92 !important;
}

.app-frame.view-metronomeTool .practice-main-controls {
  grid-column: 1 !important;
  grid-row: 2 !important;
  gap: 7px !important;
  min-width: 0;
}

.app-frame.view-metronomeTool .practice-round-btn {
  width: clamp(42px, 5.2vw, 54px) !important;
  height: clamp(42px, 5.2vw, 54px) !important;
}

.app-frame.view-metronomeTool .practice-round-btn svg {
  width: clamp(22px, 2.7vw, 29px) !important;
  height: clamp(22px, 2.7vw, 29px) !important;
}

.app-frame.view-metronomeTool .practice-bpm-actions {
  grid-column: 2 !important;
  grid-row: 2 !important;
  display: grid !important;
  grid-template-columns: clamp(28px, 3.7vw, 36px) minmax(40px, 1fr) clamp(28px, 3.7vw, 36px) !important;
  gap: 5px !important;
  min-width: 0;
}

.app-frame.view-metronomeTool .practice-bpm-actions button {
  width: auto !important;
  min-width: 0;
  min-height: 34px !important;
  padding: 0 !important;
  font-size: clamp(1rem, 2vw, 1.28rem) !important;
}

.app-frame.view-metronomeTool .practice-bpm-dial {
  width: auto !important;
  height: auto !important;
  min-width: 40px;
  min-height: 34px;
  font-size: 0.76rem !important;
}

.app-frame.view-metronomeTool .practice-tap-btn {
  grid-column: 1 !important;
  grid-row: 3 !important;
  min-width: 0;
  min-height: 34px !important;
  padding: 0 8px !important;
  font-size: clamp(0.78rem, 1.25vw, 0.92rem) !important;
  line-height: 1.05;
}

.app-frame.view-metronomeTool .practice-sound-select {
  grid-column: 2 !important;
  grid-row: 3 !important;
  min-width: 0;
  min-height: 34px !important;
  padding: 0 8px !important;
  font-size: clamp(0.72rem, 1.05vw, 0.84rem) !important;
}

.app-frame.view-metronomeTool .practice-sound-select .inline-choice-trigger,
.app-frame.view-metronomeTool .practice-wide-select .inline-choice-trigger {
  min-width: 0;
  overflow: hidden;
}

.app-frame.view-metronomeTool .practice-sound-select span,
.app-frame.view-metronomeTool .practice-wide-select span,
.app-frame.view-metronomeTool .practice-sound-select strong,
.app-frame.view-metronomeTool .practice-wide-select strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-frame.view-metronomeTool .practice-console-bottom {
  grid-area: bottom;
  min-width: 0;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: var(--met-gap) !important;
  overflow: hidden !important;
}

.app-frame.view-metronomeTool .practice-console-bottom section {
  min-width: 0;
  padding: 7px !important;
  gap: 5px !important;
}

.app-frame.view-metronomeTool .practice-pill-row,
.app-frame.view-metronomeTool .practice-segment-row,
.app-frame.view-metronomeTool .practice-range-grid {
  gap: 5px !important;
}

.app-frame.view-metronomeTool .practice-pill-row button,
.app-frame.view-metronomeTool .practice-segment-row button,
.app-frame.view-metronomeTool .practice-range-grid button {
  min-width: 0;
  min-height: 30px !important;
  padding: 0 6px !important;
  font-size: clamp(0.68rem, 1.1vw, 0.82rem) !important;
  overflow: hidden;
}

.app-frame.view-metronomeTool .practice-subdivision-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 5px !important;
}

.app-frame.view-metronomeTool .practice-subdivision-grid button {
  min-width: 0;
  min-height: 44px !important;
  padding: 3px !important;
  gap: 2px !important;
  font-size: clamp(0.62rem, 0.95vw, 0.76rem) !important;
}

.app-frame.view-metronomeTool .practice-subdivision-grid svg {
  width: 18px !important;
  height: 18px !important;
}

.app-frame.view-metronomeTool .practice-accent-dots {
  gap: clamp(8px, 1.2vw, 14px) !important;
  min-height: 28px;
}

.app-frame.view-metronomeTool .practice-accent-dots span {
  width: clamp(12px, 1.65vw, 17px) !important;
  height: clamp(12px, 1.65vw, 17px) !important;
}

.app-frame.view-metronomeTool .practice-side-card {
  grid-area: side;
  min-height: 0;
  display: grid;
  align-content: stretch !important;
  gap: 7px !important;
  padding: var(--met-pad) !important;
  overflow: hidden !important;
}

.app-frame.view-metronomeTool .practice-side-card section {
  min-width: 0;
  gap: 5px !important;
}

.app-frame.view-metronomeTool .practice-side-card h3,
.app-frame.view-metronomeTool .practice-bottom-card h3,
.app-frame.view-metronomeTool .practice-console-bottom strong {
  font-size: clamp(0.62rem, 0.95vw, 0.72rem) !important;
  line-height: 1 !important;
  letter-spacing: 0.06em;
}

.app-frame.view-metronomeTool .practice-mode-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 5px !important;
}

.app-frame.view-metronomeTool .practice-mode-grid button {
  min-width: 0;
  min-height: clamp(44px, 6.5vh, 56px) !important;
  padding: 4px 3px !important;
  gap: 2px !important;
  font-size: clamp(0.64rem, 1vw, 0.8rem) !important;
  line-height: 1.04 !important;
  overflow: hidden;
}

.app-frame.view-metronomeTool .practice-mode-grid svg {
  width: clamp(17px, 2.2vw, 22px) !important;
  height: clamp(17px, 2.2vw, 22px) !important;
}

.app-frame.view-metronomeTool .practice-range-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.app-frame.view-metronomeTool .practice-range-grid button {
  min-height: clamp(34px, 5.2vh, 44px) !important;
  line-height: 1.02 !important;
}

.app-frame.view-metronomeTool .practice-segment-row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.app-frame.view-metronomeTool .practice-wide-select,
.app-frame.view-metronomeTool .practice-session-row > button {
  min-height: 34px !important;
}

.app-frame.view-metronomeTool .practice-volume-row {
  grid-template-columns: 22px minmax(0, 1fr) 44px !important;
  min-width: 0;
  min-height: 30px !important;
  gap: 7px !important;
}

.app-frame.view-metronomeTool .practice-volume-row strong {
  white-space: nowrap;
  text-align: right;
}

.app-frame.view-metronomeTool .practice-session-row {
  grid-template-columns: minmax(0, 1fr) minmax(82px, 0.36fr) !important;
  gap: 7px !important;
}

.app-frame.view-metronomeTool .practice-bottom-card {
  min-width: 0;
  min-height: 0;
  padding: var(--met-pad) !important;
  gap: 6px !important;
  overflow: hidden !important;
}

.app-frame.view-metronomeTool .quick-tempo-card {
  grid-area: quick;
}

.app-frame.view-metronomeTool .quick-tempo-row {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto !important;
  gap: 5px !important;
  align-items: stretch;
}

.app-frame.view-metronomeTool .quick-tempo-row button {
  min-width: 0;
  min-height: 34px !important;
  padding: 0 4px !important;
  line-height: 1 !important;
}

.app-frame.view-metronomeTool .quick-tempo-row strong {
  font-size: clamp(0.82rem, 1.4vw, 1rem) !important;
}

.app-frame.view-metronomeTool .quick-tempo-row span {
  font-size: 0.58rem !important;
}

.app-frame.view-metronomeTool .rhythm-pulse-card {
  grid-area: pulse;
}

.app-frame.view-metronomeTool .rhythm-wave {
  min-height: 40px !important;
  gap: 5px !important;
}

.app-frame.view-metronomeTool .rhythm-wave span {
  width: 5px !important;
  max-height: 48px;
}

.app-frame.view-metronomeTool .practice-status-bar {
  grid-area: status;
  min-height: 34px !important;
  max-height: 42px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto !important;
  padding: 0 10px !important;
  gap: 7px !important;
  overflow: hidden;
}

.app-frame.view-metronomeTool .practice-status-bar span,
.app-frame.view-metronomeTool .practice-status-bar button {
  min-width: 0;
  font-size: clamp(0.68rem, 1vw, 0.82rem) !important;
  white-space: nowrap;
}

@media (max-width: 960px), (max-height: 820px) {
  .app-frame.view-metronomeTool.tool-page-shell {
    grid-template-columns: clamp(104px, 16vw, 138px) minmax(0, 1fr) !important;
  }

  .app-frame.view-metronomeTool .practice-metronome-main {
    grid-template-rows: clamp(42px, 5.2vh, 52px) minmax(0, 1fr);
  }

  .app-frame.view-metronomeTool .practice-metronome-hero p {
    display: none;
  }

  .app-frame.view-metronomeTool .practice-metronome-grid {
    grid-template-columns: minmax(0, 1.04fr) minmax(230px, 0.96fr) !important;
    grid-template-rows: minmax(0, 1fr) clamp(72px, 10vh, 98px) clamp(32px, 4.2vh, 38px) !important;
  }

  .app-frame.view-metronomeTool .practice-console-card {
    grid-template-columns: minmax(96px, 0.48fr) minmax(160px, 1fr) !important;
  }

  .app-frame.view-metronomeTool .analog-metronome-frame {
    width: min(94%, 210px) !important;
    height: min(94%, 228px) !important;
  }

  .app-frame.view-metronomeTool .practice-console-bottom {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .app-frame.view-metronomeTool .practice-console-bottom section:nth-child(3) {
    display: none;
  }

  .app-frame.view-metronomeTool .practice-mode-grid button,
  .app-frame.view-metronomeTool .practice-subdivision-grid button {
    min-height: 40px !important;
  }
}

@media (max-width: 760px), (max-height: 700px) {
  .app-frame.view-metronomeTool .practice-metronome-grid {
    grid-template-rows: minmax(0, 1fr) clamp(32px, 5vh, 38px) !important;
    grid-template-areas:
      "console side"
      "status status" !important;
  }

  .app-frame.view-metronomeTool .quick-tempo-card,
  .app-frame.view-metronomeTool .rhythm-pulse-card {
    display: none !important;
  }
}

/* v165 iPad portrait home: compact cards, readable left navigation, no horizontal spill. */
@media (min-width: 760px) and (max-width: 920px) {
  .app-frame.view-home {
    width: 100vw;
    height: var(--app-height);
    grid-template-columns: clamp(118px, 17vw, 142px) minmax(0, 1fr) !important;
    overflow: hidden !important;
  }

  .app-frame.view-home .library-panel {
    width: auto;
    min-width: 0;
    overflow: hidden !important;
  }

  .app-frame.view-home .ireal-brand {
    min-height: clamp(98px, 14vh, 124px) !important;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    align-content: center;
    gap: 7px;
    padding: 11px 8px !important;
  }

  .app-frame.view-home .ireal-brand .brand-icon {
    width: clamp(38px, 6vw, 48px);
    height: clamp(38px, 6vw, 48px);
  }

  .app-frame.view-home .ireal-brand .brand-copy {
    min-width: 0;
    text-align: center;
  }

  .app-frame.view-home .ireal-brand h1 {
    font-size: clamp(0.9rem, 2vw, 1.08rem) !important;
    line-height: 1.04 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .app-frame.view-home .ireal-brand .brand-copy small,
  .app-frame.view-home .ireal-brand > button,
  .app-frame.view-home .piano-cloud-card,
  .app-frame.view-home .library-category-row b,
  .app-frame.view-home .library-category-row svg:last-child {
    display: none !important;
  }

  .app-frame.view-home .ireal-library-categories {
    padding: 6px 5px !important;
    gap: 3px !important;
    overflow: hidden !important;
  }

  .app-frame.view-home .home-nav-row {
    min-height: clamp(46px, 6.5vh, 58px) !important;
    grid-template-columns: 26px minmax(0, 1fr) !important;
    gap: 7px !important;
    padding: 6px 8px !important;
    border-radius: 10px !important;
  }

  .app-frame.view-home .home-nav-row svg:first-child {
    width: clamp(20px, 3vw, 24px) !important;
    height: clamp(20px, 3vw, 24px) !important;
  }

  .app-frame.view-home .home-nav-row span {
    max-width: 100%;
    font-size: clamp(0.66rem, 1.55vw, 0.84rem) !important;
    line-height: 1.06 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere;
  }

  .app-frame.view-home .workspace {
    min-width: 0;
    overflow: hidden !important;
  }

  .app-frame.view-home .home-workspace-main {
    width: 100%;
    min-width: 0;
    height: var(--app-height) !important;
    padding: clamp(8px, 1.2vw, 12px) !important;
    overflow: hidden !important;
  }

  .app-frame.view-home .home-dashboard {
    height: 100%;
    min-width: 0;
    display: grid !important;
    grid-template-rows: clamp(42px, 6vh, 54px) minmax(0, 1fr) !important;
    grid-template-areas:
      "hero"
      "tools" !important;
    gap: clamp(7px, 1vw, 10px) !important;
    overflow: hidden !important;
  }

  .app-frame.view-home .home-hero {
    min-width: 0;
    min-height: 0;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(170px, 38%) !important;
    align-items: center;
    gap: 8px !important;
  }

  .app-frame.view-home .home-hero h2 {
    font-size: clamp(1rem, 2.4vw, 1.25rem) !important;
    line-height: 1.03 !important;
    white-space: normal !important;
  }

  .app-frame.view-home .home-hero p {
    display: none !important;
  }

  .app-frame.view-home .home-search-shell {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 6px;
  }

  .app-frame.view-home .home-search {
    min-width: 0;
    min-height: 36px !important;
    grid-template-columns: 30px minmax(0, 1fr);
    border-radius: 10px;
  }

  .app-frame.view-home .home-search input {
    min-width: 0;
    font-size: 0.76rem;
  }

  .app-frame.view-home .home-filter-btn {
    width: 36px;
    min-height: 36px;
    border-radius: 10px;
  }

  .app-frame.view-home .home-tool-grid {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(0, 1fr) !important;
    gap: clamp(8px, 1vw, 11px) !important;
    overflow: hidden !important;
  }

  .app-frame.view-home .home-tool-card {
    min-width: 0;
    min-height: 0 !important;
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr) clamp(32px, 4.8vh, 38px) !important;
    gap: 6px !important;
    padding: clamp(9px, 1.2vw, 12px) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  .app-frame.view-home .home-tool-copy {
    min-width: 0;
  }

  .app-frame.view-home .home-tool-copy h3 {
    margin: 0 0 2px !important;
    font-size: clamp(0.86rem, 1.8vw, 1.02rem) !important;
    line-height: 1.04 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-frame.view-home .home-tool-copy p {
    font-size: clamp(0.62rem, 1.2vw, 0.74rem) !important;
    line-height: 1.16 !important;
    max-width: none !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .app-frame.view-home .home-tool-visual {
    min-width: 0;
    min-height: 0 !important;
    height: 100%;
    border-radius: 9px !important;
    overflow: hidden !important;
  }

  .app-frame.view-home .home-ref-asset,
  .app-frame.view-home .home-ref-piano,
  .app-frame.view-home .home-ref-recordings,
  .app-frame.view-home .home-ref-tuner,
  .app-frame.view-home .home-ref-metronome {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    transform: none !important;
  }

  .app-frame.view-home .home-tool-open {
    min-height: clamp(32px, 4.8vh, 38px) !important;
    height: clamp(32px, 4.8vh, 38px) !important;
    border-radius: 8px !important;
    font-size: clamp(0.78rem, 1.5vw, 0.92rem) !important;
  }
}

/* v166 tuner needle: real cent movement wins over idle/searching visual states. */
.app-frame.view-tuner .award-tuner-console.has-detection .award-needle,
.app-frame.view-tuner .award-needle[data-tuner-needle] {
  transform: translateX(-50%) rotate(calc(var(--needle, 0) * 1.28deg)) !important;
  transition:
    transform 92ms cubic-bezier(0.18, 0.9, 0.22, 1),
    filter 120ms ease,
    box-shadow 120ms ease !important;
  will-change: transform;
}

.app-frame.view-tuner .award-tuner-console.has-detection.searching .award-needle,
.app-frame.view-tuner .award-tuner-console.has-detection.idle .award-needle {
  animation: none !important;
  transform: translateX(-50%) rotate(calc(var(--needle, 0) * 1.28deg)) !important;
}

.app-frame.view-tuner .award-tuner-console.flat.has-detection .award-needle,
.app-frame.view-tuner .award-tuner-console.sharp.has-detection .award-needle {
  animation: none !important;
}

/* v162 note/rest value palette, iPad home fit and compact recording console. */
.keyboard-grid button.sign-key {
  min-height: 58px;
  padding: 7px 8px;
  white-space: normal;
  line-height: 1.12;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(83, 86, 96, 0.98), rgba(47, 49, 57, 0.98)),
    #343741;
  border-color: rgba(255, 255, 255, 0.18);
  color: #effbff;
}

.keyboard-grid button.sign-key.rest-sign-key {
  background:
    radial-gradient(circle at 50% 12%, rgba(0, 229, 255, 0.22), transparent 52%),
    linear-gradient(180deg, rgba(45, 70, 74, 0.98), rgba(26, 31, 35, 0.98));
  border-color: rgba(0, 229, 255, 0.48);
  color: #dffbff;
  font-size: clamp(0.72rem, 0.88vw, 0.9rem);
}

.chart-sign-symbol {
  min-width: 0.88em;
  display: inline-grid;
  place-items: center;
  font-size: 0.82em;
  line-height: 1;
}

.rest-sign-key {
  min-width: 0;
  min-height: 92px;
  padding: 7px 8px !important;
}

.keyboard-row:has(.rest-sign-key) .keyboard-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
  gap: 6px;
}

.rest-key-content {
  display: grid;
  grid-template-rows: 50px auto;
  align-items: center;
  justify-items: center;
  gap: 5px;
  width: 100%;
  color: inherit;
  font-size: 0.7rem;
  font-weight: 900;
}

.rest-glyph-preview {
  position: relative;
  width: 72px;
  height: 50px;
  display: grid;
  place-items: center;
  color: #f4ffff;
}

.rest-symbol-glyph {
  width: 1em;
  height: 1em;
  display: inline-grid;
  place-items: center;
  color: currentColor;
  font-family: "Bravura", serif;
  font-style: normal;
  font-weight: 400;
  font-variant: normal;
  line-height: 1;
  text-rendering: geometricPrecision;
  speak: none;
}

.rest-symbol-glyph > span {
  display: block;
  font-family: inherit;
  font-size: inherit;
  line-height: 1;
}

.rest-key-icon {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  font-size: 48px;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.3));
}

.rest-key-icon[data-rest="whole"],
.rest-key-icon[data-rest="half"] {
  font-size: 52px;
}

.rest-key-icon[data-rest="quarter"] {
  width: 56px;
  height: 56px;
  font-size: 56px;
}

.rest-key-label {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
  line-height: 1.05;
}

.rest-key-label b {
  color: #f0feff;
  font-size: 0.72rem;
  white-space: nowrap;
}

.rest-key-label small {
  color: rgba(192, 247, 255, 0.66);
  font-size: 0.62rem;
  font-weight: 800;
  white-space: nowrap;
}

.chart-rest-sign {
  width: 1.35em;
  height: 1.28em;
  font-size: inherit;
  vertical-align: -0.13em;
}

.chart-rest-icon {
  width: 1.2em;
  height: 1.2em;
  color: #050605;
  font-size: 1.2em;
  line-height: 1;
}

@media (min-width: 760px) and (max-width: 1180px) {
  .app-frame.view-home {
    grid-template-columns: clamp(176px, 22vw, 224px) minmax(0, 1fr) !important;
    overflow: hidden;
  }

  .app-frame.view-home .library-panel {
    display: grid !important;
    min-width: 0;
    overflow: hidden;
  }

  .app-frame.view-home .ireal-brand {
    min-height: 78px;
    padding: 10px 12px;
  }

  .app-frame.view-home .ireal-brand .brand-copy small,
  .app-frame.view-home .piano-cloud-card {
    display: none;
  }

  .app-frame.view-home .ireal-library-categories {
    padding: 7px 8px;
    gap: 3px;
  }

  .app-frame.view-home .home-nav-row {
    min-height: 42px;
    padding: 7px 9px;
    gap: 8px;
    font-size: clamp(0.76rem, 1.35vw, 0.95rem);
  }

  .app-frame.view-home .home-nav-row svg {
    width: 20px;
    height: 20px;
  }

  .app-frame.view-home .home-workspace-main {
    min-width: 0;
    height: var(--app-height);
    padding: 10px 12px;
    overflow: hidden;
  }

  .app-frame.view-home .home-dashboard {
    height: 100%;
    min-width: 0;
    grid-template-rows: 44px minmax(0, 1fr) !important;
    grid-template-areas:
      "hero hero hero hero hero hero hero hero hero hero hero hero"
      "tools tools tools tools tools tools tools tools tools tools tools tools" !important;
    gap: 8px;
    overflow: hidden;
  }

  .app-frame.view-home .home-hero {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(210px, 42%);
    gap: 8px;
  }

  .app-frame.view-home .home-hero h2 {
    font-size: clamp(1rem, 2vw, 1.35rem);
    line-height: 1.05;
  }

  .app-frame.view-home .home-hero p {
    display: none;
  }

  .app-frame.view-home .home-search {
    min-height: 38px;
  }

  .app-frame.view-home .home-tool-grid {
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(0, 1fr);
    gap: 8px;
    overflow: hidden;
  }

  .app-frame.view-home .home-tool-card {
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) 34px;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .app-frame.view-home .home-tool-copy h3 {
    margin: 0 0 3px;
    font-size: clamp(0.88rem, 1.6vw, 1.05rem);
    line-height: 1.06;
  }

  .app-frame.view-home .home-tool-copy p {
    font-size: clamp(0.62rem, 1.15vw, 0.76rem);
    line-height: 1.22;
    max-width: none;
  }

  .app-frame.view-home .home-tool-visual {
    min-height: 0;
    border-radius: 9px;
    overflow: hidden;
  }

  .app-frame.view-home .home-ref-asset,
  .app-frame.view-home .home-ref-piano,
  .app-frame.view-home .home-ref-recordings,
  .app-frame.view-home .home-ref-tuner,
  .app-frame.view-home .home-ref-metronome {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center !important;
    transform: none !important;
  }

  .app-frame.view-home .home-tool-open {
    min-height: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .app-frame.view-recordings .recording-capture-layout .record-console {
    position: relative;
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: 0;
  }

  .app-frame.view-recordings .recording-capture-layout .record-mic-panel {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 1;
    width: clamp(112px, 19vw, 210px);
    height: clamp(118px, 31vh, 255px);
    display: block !important;
    border: 1px solid rgba(205, 136, 58, 0.36);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.36);
    opacity: 0.92;
  }

  .app-frame.view-recordings .recording-capture-layout .record-mic-panel img {
    transform: scale(1.08) !important;
    object-position: center 48% !important;
  }

  .app-frame.view-recordings .recording-capture-layout .record-console-screen {
    position: relative;
    z-index: 2;
    padding-right: clamp(130px, 23vw, 230px) !important;
  }

  .app-frame.view-recordings .recording-capture-layout .record-waveform {
    min-height: clamp(66px, 12vh, 118px) !important;
    max-height: none !important;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
  }

  .app-frame.view-recordings .recording-capture-layout .record-waveform i {
    min-height: 8px;
    box-shadow: 0 0 13px rgba(0, 229, 255, 0.52);
  }
}

@media (max-width: 820px) {
  .app-frame.view-recordings .recording-capture-layout .record-mic-panel {
    display: block !important;
    width: 118px;
    height: 150px;
  }

  .app-frame.view-recordings .recording-capture-layout .record-console-screen {
    padding-right: 136px !important;
  }
}

/* v164 phone-first layout pass: keep the app usable on iPhone/Android widths. */
@media (max-width: 759px) {
  :root {
    --topbar-height: 52px;
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .app-frame,
  .stage-app-frame,
  .app-frame.view-home,
  .app-frame.tool-page-shell,
  .app-frame.library-mode-songs,
  .app-frame.library-mode-playlists,
  .app-frame.library-mode-playlist {
    width: 100vw;
    height: var(--app-height);
    min-width: 0;
    grid-template-columns: clamp(72px, 22vw, 92px) minmax(0, 1fr) !important;
    overflow: hidden;
  }

  .library-panel,
  .app-frame.view-home .library-panel,
  .app-frame.tool-page-shell .library-panel {
    display: grid !important;
    width: auto;
    min-width: 0;
    max-width: 92px;
    overflow: hidden;
  }

  .ireal-brand,
  .app-frame.tool-page-shell .ireal-brand,
  .app-frame.view-home .ireal-brand {
    min-height: 64px;
    padding: 8px 5px;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 4px;
  }

  .ireal-brand .brand-icon,
  .app-frame.tool-page-shell .ireal-brand .brand-icon {
    width: 34px;
    height: 34px;
  }

  .ireal-brand .brand-copy h1,
  .ireal-brand .brand-copy small,
  .ireal-brand > button,
  .piano-cloud-card {
    display: none !important;
  }

  .ireal-library-categories,
  .app-frame.tool-page-shell .ireal-library-categories {
    padding: 6px 4px;
    gap: 3px;
    overflow: hidden;
  }

  .home-nav-row,
  .app-frame.view-home .home-nav-row,
  .app-frame.tool-page-shell .home-nav-row {
    min-height: 48px;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    padding: 6px 3px;
    gap: 2px;
    border-radius: 9px;
  }

  .home-nav-row svg,
  .app-frame.tool-page-shell .home-nav-row svg {
    width: 21px;
    height: 21px;
  }

  .home-nav-row span,
  .app-frame.tool-page-shell .home-nav-row span {
    max-width: 100%;
    font-size: clamp(0.55rem, 2.25vw, 0.68rem);
    line-height: 1.08;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .home-nav-row b,
  .home-nav-row svg:last-child {
    display: none !important;
  }

  .workspace,
  .app-frame.library-mode-songs .workspace,
  .app-frame.library-mode-playlists .workspace,
  .app-frame.library-mode-playlist .workspace {
    min-width: 0;
    overflow: hidden;
  }

  .topbar,
  .stage-topbar {
    min-width: 0;
    min-height: var(--topbar-height);
    padding: 7px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .topbar::-webkit-scrollbar,
  .stage-topbar::-webkit-scrollbar {
    display: none;
  }

  .tabs {
    min-width: max-content;
    gap: 6px;
  }

  .tab-button,
  .topbar button,
  .stage-topbar button {
    min-height: 36px;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .workspace-main,
  .home-workspace-main,
  .app-frame.view-piano .workspace-main,
  .app-frame.view-recordings .workspace-main,
  .app-frame.view-tuner .workspace-main {
    width: 100%;
    min-width: 0;
    height: calc(var(--app-height) - var(--topbar-height));
    padding: 8px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-frame.view-home .home-workspace-main {
    height: var(--app-height);
    overflow: auto;
  }

  .app-frame.view-home .home-dashboard {
    height: auto;
    min-height: 100%;
    display: grid;
    grid-template-rows: auto auto;
    grid-template-areas:
      "hero"
      "tools" !important;
    gap: 9px;
    overflow: visible;
  }

  .home-hero,
  .app-frame.view-home .home-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .home-hero h2,
  .app-frame.view-home .home-hero h2 {
    font-size: clamp(1.05rem, 5vw, 1.45rem);
    line-height: 1.05;
  }

  .home-hero p,
  .app-frame.view-home .home-hero p {
    display: none;
  }

  .home-search-shell {
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 6px;
  }

  .home-search,
  .app-frame.view-home .home-search {
    min-height: 38px;
    grid-template-columns: 32px minmax(0, 1fr);
    border-radius: 10px;
  }

  .home-search input {
    min-width: 0;
    font-size: 0.82rem;
  }

  .home-filter-btn {
    width: 38px;
    min-height: 38px;
    border-radius: 10px;
  }

  .home-tool-grid,
  .app-frame.view-home .home-tool-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: minmax(190px, auto);
    gap: 9px;
    overflow: visible;
  }

  .home-tool-card,
  .app-frame.view-home .home-tool-card {
    min-height: 190px;
    grid-template-rows: auto minmax(92px, 1fr) 36px;
    gap: 7px;
    padding: 11px;
    border-radius: 12px;
  }

  .home-tool-copy h3,
  .app-frame.view-home .home-tool-copy h3 {
    margin: 0 0 3px;
    font-size: 0.98rem;
    line-height: 1.05;
  }

  .home-tool-copy p,
  .app-frame.view-home .home-tool-copy p {
    font-size: 0.72rem;
    line-height: 1.22;
    max-width: none;
  }

  .home-tool-visual,
  .app-frame.view-home .home-tool-visual {
    min-height: 92px;
    border-radius: 9px;
    overflow: hidden;
  }

  .home-ref-asset,
  .home-ref-piano,
  .home-ref-recordings,
  .home-ref-tuner,
  .home-ref-metronome,
  .app-frame.view-home .home-ref-asset,
  .app-frame.view-home .home-ref-piano,
  .app-frame.view-home .home-ref-recordings,
  .app-frame.view-home .home-ref-tuner,
  .app-frame.view-home .home-ref-metronome {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center !important;
    transform: none !important;
  }

  .home-tool-open,
  .app-frame.view-home .home-tool-open {
    min-height: 36px;
    height: 36px;
  }

  .browser-shell,
  .browser-workspace-main,
  .browser-preview-shell,
  .browser-chart-area,
  .browser-chart-wrap,
  .prep-stage-editor,
  .chart-scroll {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: auto;
  }

  .chart-paper,
  .preview-paper {
    max-width: 100%;
    transform-origin: top left;
  }

  .chord-keyboard {
    max-width: 100%;
    overflow: auto;
  }

  .chord-entry-strip {
    grid-template-columns: minmax(70px, 92px) minmax(160px, 1fr);
    overflow-x: auto;
  }

  .keyboard-row {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .keyboard-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
  }

  .keyboard-grid button.sign-key {
    min-height: 48px;
    font-size: 0.66rem;
  }

  .recordings-grid.recording-capture-layout,
  .app-frame.view-recordings .recordings-grid.recording-capture-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "record-console"
      "record-side" !important;
    gap: 9px;
    overflow: visible !important;
  }

  .app-frame.view-recordings .recording-capture-layout .record-console {
    min-height: 520px;
  }

  .app-frame.view-recordings .recording-capture-layout .record-console-screen {
    padding-right: 8px !important;
  }

  .app-frame.view-recordings .recording-capture-layout .record-mic-panel {
    position: relative;
    inset: auto;
    width: 100%;
    height: 150px;
    order: -1;
  }

  .record-form-grid,
  .app-frame.view-recordings .record-side-panel .record-form-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .piano-stage-shell,
  .recordings-shell,
  .tuner-page,
  .metronome-prep-shell,
  .practice-metronome-shell,
  .app-frame.view-piano .piano-stage-shell,
  .app-frame.view-recordings .recordings-shell,
  .app-frame.view-tuner .tuner-page,
  .app-frame.view-metronome .metronome-prep-shell,
  .app-frame.view-metronomeTool .practice-metronome-shell {
    grid-template-columns: minmax(0, 1fr) !important;
    overflow: visible;
  }
}

/* v175 responsive viewport fit: every grid child stays inside the visible device width. */
html,
body,
#app,
.app-frame,
.stage-app-frame {
  width: 100%;
  max-width: 100%;
}

.app-frame > .workspace {
  width: auto;
  max-width: 100%;
  min-width: 0;
}

.app-frame .workspace-main,
.app-frame.view-metronome .metronome-prep-shell,
.app-frame.view-metronome .metronome-prep-main,
.app-frame.view-metronome .quick-song-card,
.app-frame.view-metronome .stage-song-browser-card,
.app-frame.view-metronome .stage-song-browser-grid,
.app-frame.view-metronome .stage-song-browser-list,
.app-frame.view-metronome .stage-click-drop-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

@media (min-width: 760px) and (max-width: 920px) {
  .app-frame.tool-page-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .app-frame.tool-page-shell > .library-panel {
    display: none !important;
  }
}

@media (min-width: 641px) and (max-width: 999px) {
  .app-frame.tool-page-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .app-frame.tool-page-shell > .library-panel {
    display: none !important;
  }
}

/* v192: visual click selector, song image attachment and swipeable stage viewer. */
.quick-click-sound-field,
.stage-song-image-field {
  grid-column: 1 / -1;
  min-width: 0;
}

.quick-field-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.quick-field-heading > span {
  color: #edf7fa;
  font-size: 0.84rem;
  font-weight: 900;
}

.quick-field-heading > small {
  color: #819097;
  font-size: 0.68rem;
  font-weight: 700;
}

.stage-click-sound-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.stage-click-sound-choice {
  position: relative;
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--sound-color) 8%, transparent), transparent 52%),
    rgba(255, 255, 255, 0.035);
  color: #f5fbfd;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, background 150ms ease;
}

.stage-click-sound-choice:hover,
.stage-click-sound-choice.active {
  border-color: color-mix(in srgb, var(--sound-color) 72%, white);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--sound-color) 22%, transparent), transparent 70%),
    rgba(255, 255, 255, 0.055);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--sound-color) 20%, transparent),
    0 0 20px color-mix(in srgb, var(--sound-color) 20%, transparent);
  transform: translateY(-1px);
}

.stage-click-sound-choice.active::after {
  content: "";
  position: absolute;
  inset: auto 8px 5px 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--sound-color);
  box-shadow: 0 0 9px var(--sound-color);
}

.stage-click-sound-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--sound-color) 42%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--sound-color) 12%, rgba(0, 0, 0, 0.38));
  color: var(--sound-color);
}

.stage-click-sound-icon svg {
  width: 15px;
  height: 15px;
}

.stage-click-sound-choice > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.stage-click-sound-choice b {
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-click-sound-choice small {
  overflow: hidden;
  color: #8d9ba2;
  font-size: 0.62rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-click-sound-choice > em,
.stage-preview-selected-sound > em {
  position: absolute;
  right: 7px;
  bottom: 11px;
  height: 14px;
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0.34;
}

.stage-click-sound-choice > em i,
.stage-preview-selected-sound > em i {
  width: 2px;
  border-radius: 999px;
  background: var(--sound-color);
}

.stage-click-sound-choice > em i:nth-child(1),
.stage-preview-selected-sound > em i:nth-child(1) {
  height: 5px;
}

.stage-click-sound-choice > em i:nth-child(2),
.stage-preview-selected-sound > em i:nth-child(2) {
  height: 11px;
}

.stage-click-sound-choice > em i:nth-child(3),
.stage-preview-selected-sound > em i:nth-child(3) {
  height: 8px;
}

.stage-click-sound-choice > em i:nth-child(4),
.stage-preview-selected-sound > em i:nth-child(4) {
  height: 14px;
}

.stage-preview-selected-sound {
  position: relative;
  width: min(174px, 100%);
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--sound-color) 38%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--sound-color) 8%, rgba(0, 0, 0, 0.28));
}

.stage-preview-selected-sound > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--sound-color) 15%, rgba(0, 0, 0, 0.32));
  color: var(--sound-color);
}

.stage-preview-selected-sound > span svg {
  width: 15px;
  height: 15px;
}

.stage-preview-selected-sound > div {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.stage-preview-selected-sound > div small {
  color: #75868d;
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.stage-preview-selected-sound > div strong {
  overflow: hidden;
  color: #f4fbfd;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-song-image-uploader {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 8px;
  border: 1px dashed rgba(0, 229, 255, 0.27);
  border-radius: 12px;
  background:
    radial-gradient(circle at 10% 50%, rgba(0, 229, 255, 0.08), transparent 35%),
    rgba(255, 255, 255, 0.025);
}

.stage-song-image-field.has-image .stage-song-image-uploader {
  border-style: solid;
  border-color: rgba(0, 229, 255, 0.38);
}

.stage-song-image-pick,
.stage-song-image-preview {
  min-width: 152px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 6px 11px;
  overflow: hidden;
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.16), rgba(0, 89, 104, 0.12));
  color: #effcff;
  cursor: pointer;
}

.stage-song-image-pick > svg {
  width: 22px;
  height: 22px;
  color: #00e5ff;
}

.stage-song-image-pick > span {
  display: grid;
  gap: 3px;
  text-align: left;
}

.stage-song-image-pick b {
  font-size: 0.78rem;
}

.stage-song-image-pick small {
  color: #8da0a8;
  font-size: 0.61rem;
}

.stage-song-image-preview {
  position: relative;
  min-width: 110px;
  width: 110px;
  padding: 0;
}

.stage-song-image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.stage-song-image-preview > span {
  position: absolute;
  inset: auto 5px 5px 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 5px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.74);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 850;
}

.stage-song-image-preview > span svg {
  width: 11px;
  height: 11px;
}

.stage-song-image-copy {
  min-width: 0;
}

.stage-song-image-copy strong {
  display: block;
  overflow: hidden;
  color: #e8f4f7;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-song-image-copy p {
  margin: 4px 0 0;
  color: #83939a;
  font-size: 0.66rem;
  line-height: 1.35;
}

.stage-song-image-remove {
  width: 64px;
  min-height: 48px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 1px solid rgba(255, 91, 91, 0.28);
  border-radius: 9px;
  background: rgba(255, 67, 67, 0.065);
  color: #ff8d8d;
  cursor: pointer;
}

.stage-song-image-remove svg {
  width: 16px;
  height: 16px;
}

.stage-song-image-remove span {
  font-size: 0.58rem;
  font-weight: 850;
}

.metronome-detail-grid > .metronome-panel {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.click-song-image-card {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(0, 229, 255, 0.24);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(0, 229, 255, 0.07), transparent 48%),
    rgba(255, 255, 255, 0.025);
}

.click-song-image-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.click-song-image-card > header > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.click-song-image-card > header span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #00e5ff;
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.09em;
}

.click-song-image-card > header span svg {
  width: 14px;
  height: 14px;
}

.click-song-image-card > header strong {
  overflow: hidden;
  color: #eaf4f7;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.click-song-image-card > header small {
  max-width: 40%;
  overflow: hidden;
  color: #73838a;
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.click-song-image-open {
  position: relative;
  width: 100%;
  min-height: 160px;
  max-height: 260px;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25% 75%, rgba(255, 255, 255, 0.025) 75%),
    #05090b;
  background-size: 18px 18px;
  cursor: zoom-in;
}

.click-song-image-open img {
  width: 100%;
  height: 100%;
  max-height: 260px;
  display: block;
  object-fit: contain;
}

.click-song-image-open-label {
  position: absolute;
  right: 9px;
  bottom: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(0, 229, 255, 0.36);
  border-radius: 999px;
  background: rgba(0, 8, 11, 0.84);
  color: #eafbff;
  font-size: 0.68rem;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.click-song-image-open-label svg {
  width: 14px;
  height: 14px;
  color: #00e5ff;
}

.click-song-image-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8b9ba2;
  font-size: 0.72rem;
  font-weight: 800;
}

.click-song-image-loading svg {
  width: 18px;
  height: 18px;
  animation: stage-image-spin 900ms linear infinite;
}

.click-song-image-card > p {
  margin: 7px 2px 0;
  color: #74838a;
  font-size: 0.64rem;
  line-height: 1.35;
}

.stage-image-viewer {
  position: fixed;
  z-index: 30000;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0, rgba(0, 229, 255, 0.095), transparent 38%),
    #030506;
  color: #eef9fc;
  isolation: isolate;
}

.stage-image-viewer-header {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(94px, auto) minmax(0, 1fr) 48px;
  align-items: center;
  gap: 14px;
  padding:
    max(9px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    9px
    max(14px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(4, 8, 10, 0.92);
  backdrop-filter: blur(18px);
}

.stage-image-viewer-header > button {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.07);
  color: #eafbff;
  font-weight: 850;
  cursor: pointer;
}

.stage-image-viewer-header > button:last-child {
  width: 42px;
  padding: 0;
}

.stage-image-viewer-header > button svg {
  width: 18px;
  height: 18px;
}

.stage-image-viewer-header > div {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.stage-image-viewer-header small {
  color: #00e5ff;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.stage-image-viewer-header strong {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-image-viewer-header span {
  color: #809097;
  font-size: 0.68rem;
}

.stage-image-viewer-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  align-items: stretch;
  overflow: hidden;
  touch-action: pan-y;
}

.stage-image-viewer-body figure {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  margin: 0;
  overflow: hidden;
}

.stage-image-viewer-body figure > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.stage-image-viewer-body figcaption {
  position: absolute;
  left: 50%;
  bottom: 14px;
  max-width: min(720px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #eef7fa;
  font-size: 0.72rem;
  font-weight: 750;
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.stage-image-viewer-body figcaption svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: #00e5ff;
}

.stage-image-viewer-nav {
  z-index: 2;
  width: 42px;
  height: 70px;
  align-self: center;
  justify-self: center;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 12px;
  background: rgba(0, 229, 255, 0.07);
  color: #eafbff;
  cursor: pointer;
}

.stage-image-viewer-nav svg {
  width: 26px;
  height: 26px;
}

.stage-image-viewer-nav:disabled {
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.2);
  cursor: default;
}

.stage-image-viewer-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  color: #7f8e95;
  text-align: center;
}

.stage-image-viewer-empty svg {
  width: 52px;
  height: 52px;
  color: rgba(0, 229, 255, 0.38);
}

.stage-image-viewer-empty strong {
  color: #d8e3e7;
  font-size: 1.05rem;
}

.stage-image-viewer-empty span {
  font-size: 0.78rem;
}

.stage-image-viewer-footer {
  min-height: 58px;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding:
    9px
    max(14px, env(safe-area-inset-right))
    max(9px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 8, 10, 0.94);
}

.stage-image-viewer-footer > span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #74848b;
  font-size: 0.65rem;
  font-weight: 750;
}

.stage-image-viewer-footer > span svg {
  width: 15px;
  height: 15px;
  color: #00e5ff;
}

.stage-image-viewer-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.stage-image-viewer-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: width 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.stage-image-viewer-dots span.has-image {
  background: rgba(255, 255, 255, 0.42);
}

.stage-image-viewer-dots span.active {
  width: 24px;
  background: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
}

@keyframes stage-image-spin {
  to {
    transform: rotate(1turn);
  }
}

@media (max-width: 1100px) {
  .stage-click-sound-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .quick-click-sound-field,
  .stage-song-image-field {
    grid-column: 1 !important;
  }

  .quick-field-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .stage-song-image-uploader {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .stage-song-image-pick,
  .stage-song-image-preview {
    min-width: 0;
    width: 100%;
  }

  .stage-song-image-copy {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .stage-song-image-remove {
    grid-column: 2;
    grid-row: 1;
  }

  .stage-image-viewer-header {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 8px;
  }

  .stage-image-viewer-header > button {
    width: 42px;
    padding: 0;
  }

  .stage-image-viewer-header > button span {
    display: none;
  }

  .stage-image-viewer-body {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
  }

  .stage-image-viewer-nav {
    width: 32px;
    height: 58px;
  }

  .stage-image-viewer-footer > span {
    text-align: center;
  }
}

/* v219 persistent, compact advanced chord controls. */
.stage-note-panel .stage-tool-switch .advanced-tools-trigger {
  min-width: 164px;
  margin-left: 0;
  border-color: rgba(0, 216, 255, 0.34);
  color: #dffcff;
}

.stage-note-panel .stage-tool-switch .advanced-tools-trigger .trigger-chevron {
  width: 15px;
  height: 15px;
  margin-left: 2px;
  opacity: 0.72;
}

.stage-note-panel .stage-tool-switch .advanced-tools-trigger.active {
  border-color: rgba(0, 216, 255, 0.82);
  background: linear-gradient(180deg, rgba(0, 216, 255, 0.26), rgba(0, 112, 136, 0.14));
  color: #fff;
}

.stage-advanced-tools > summary {
  min-height: 54px;
  border-radius: 10px;
  background: rgba(0, 216, 255, 0.045);
}

.stage-advanced-tools[open] > summary {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(6, 13, 16, 0.98);
}

.stage-advanced-tools .stage-detail-row {
  order: 2;
}

.stage-advanced-tools .keyboard-row:has(.rest-sign-key) .keyboard-grid.compact {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.stage-advanced-tools .keyboard-grid button.sign-key.rest-sign-key {
  min-width: 0;
  min-height: 52px;
  height: 52px;
  padding: 3px 5px !important;
}

.stage-advanced-tools .rest-key-content {
  grid-template-rows: 27px minmax(0, 1fr);
  gap: 1px;
}

.stage-advanced-tools .rest-glyph-preview {
  width: 34px;
  height: 27px;
}

.stage-advanced-tools .rest-key-icon,
.stage-advanced-tools .rest-key-icon[data-rest="whole"],
.stage-advanced-tools .rest-key-icon[data-rest="half"],
.stage-advanced-tools .rest-key-icon[data-rest="quarter"] {
  width: 27px;
  height: 27px;
  font-size: 27px;
  filter: none;
}

.stage-advanced-tools .rest-key-label b {
  font-size: 0.57rem;
}

.stage-advanced-tools .rest-key-label small {
  display: none;
}

@media (max-width: 760px) {
  .stage-note-panel .stage-tool-switch .advanced-tools-trigger {
    min-width: 0;
    margin-left: 0;
  }

  .stage-advanced-tools .keyboard-row:has(.rest-sign-key) .keyboard-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .stage-click-sound-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* v192: fast touch ordering and long-press song editing in Click Setlist. */
.click-song-list-title {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 3px;
  text-align: center;
}

.click-song-list-title strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.click-song-list-title small {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #72838a;
  font-size: 0.58rem;
  font-weight: 750;
  white-space: nowrap;
}

.click-song-list-title small svg {
  width: 12px;
  height: 12px;
  color: #00e5ff;
}

.click-song-drag-grip {
  position: relative;
  min-width: 38px;
  min-height: 54px;
  align-self: stretch;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.click-song-drag-grip::after {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: -1;
  border: 1px solid rgba(0, 229, 255, 0.14);
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.035);
}

.click-song-drag-grip svg {
  color: #00e5ff;
  filter: drop-shadow(0 0 5px rgba(0, 229, 255, 0.28));
}

.click-song-row-shell.touch-drag-origin {
  z-index: 12;
  opacity: 0.58;
  transform: scale(0.985);
}

.click-song-row-shell.touch-drop-before::before,
.click-song-row-shell.touch-drop-after::after {
  content: "";
  position: absolute;
  z-index: 15;
  left: 7px;
  right: 7px;
  height: 3px;
  border-radius: 999px;
  background: #00e5ff;
  box-shadow: 0 0 13px rgba(0, 229, 255, 0.78);
  pointer-events: none;
}

.click-song-row-shell.touch-drop-before::before {
  top: -2px;
}

.click-song-row-shell.touch-drop-after::after {
  bottom: -2px;
}

.click-song-edit-modal {
  width: min(720px, calc(100vw - 30px));
}

.click-song-edit-intro {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -5px 0 0;
  padding: 9px 11px;
  border: 1px solid rgba(0, 229, 255, 0.16);
  border-radius: 9px;
  background: rgba(0, 229, 255, 0.045);
  color: #8ea0a7;
  font-size: 0.7rem;
  line-height: 1.35;
}

.click-song-edit-intro svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #00e5ff;
}

.click-song-edit-modal .quick-field textarea {
  width: 100%;
  min-height: 78px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.36);
  color: #f3f8fa;
  font: inherit;
}

.click-song-edit-modal .create-stage-song-btn {
  min-width: 210px;
}

@media (max-width: 700px) {
  .click-song-list-title small {
    display: none;
  }

  .click-song-edit-modal .stage-modal-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .click-song-edit-modal .stage-modal-grid .title-field {
    grid-column: 1;
  }

  .click-song-edit-modal footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .click-song-edit-modal footer button,
  .click-song-edit-modal .create-stage-song-btn {
    width: 100%;
  }
}

/* v243 native Safari touch and in-place panel rendering.
   The preparation controls retain their existing geometry while JavaScript
   updates only the active editor panel instead of rebuilding the full sheet. */

/* v192: Metronom Stage multi-select library controls and visible short notes. */
.stage-song-browser-list-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.stage-song-browser-list-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.stage-song-browser-list-head > button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 229, 255, 0.26);
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.055);
  color: #00e5ff;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.stage-song-browser-list-head > button:hover,
.stage-song-browser-list-head > button.active {
  border-color: rgba(0, 229, 255, 0.68);
  background: rgba(0, 229, 255, 0.15);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.17);
}

.stage-song-browser-list-head > button svg {
  width: 19px;
  height: 19px;
}

.stage-song-bulk-toolbar {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.22);
  background:
    linear-gradient(145deg, rgba(0, 229, 255, 0.095), transparent 52%),
    rgba(0, 0, 0, 0.28);
}

.stage-song-bulk-summary,
.stage-song-bulk-actions,
.stage-song-bulk-target {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.stage-song-bulk-summary > strong {
  min-width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 229, 255, 0.46);
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.11);
  color: #00e5ff;
  font-size: 0.76rem;
}

.stage-song-bulk-summary > span {
  flex: 1 1 auto;
  color: #aab7bc;
  font-size: 0.67rem;
  font-weight: 800;
}

.stage-song-bulk-toolbar button,
.stage-song-bulk-target select {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #eaf3f6;
  font-size: 0.65rem;
  font-weight: 850;
}

.stage-song-bulk-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  cursor: pointer;
}

.stage-song-bulk-toolbar button svg {
  width: 14px;
  height: 14px;
}

.stage-song-bulk-toolbar button:disabled {
  opacity: 0.34;
  cursor: default;
}

.stage-song-bulk-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stage-song-bulk-actions .danger {
  border-color: rgba(255, 91, 91, 0.24);
  color: #ff9c9c;
}

.stage-song-bulk-target {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.stage-song-bulk-target label {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.stage-song-bulk-target label > span {
  color: #7f9097;
  font-size: 0.61rem;
  font-weight: 850;
}

.stage-song-bulk-target select {
  width: 100%;
  min-width: 0;
  padding: 0 27px 0 8px;
}

.stage-song-bulk-target > button,
.stage-song-bulk-save {
  border-color: rgba(0, 229, 255, 0.3) !important;
  background: rgba(0, 229, 255, 0.08) !important;
  color: #bff8ff !important;
}

.stage-song-bulk-save {
  width: 100%;
  min-height: 39px !important;
}

.stage-song-browser-row.bulk-mode {
  cursor: default;
}

.stage-song-browser-row.bulk-selected {
  border-color: rgba(0, 229, 255, 0.62);
  background:
    linear-gradient(90deg, rgba(0, 229, 255, 0.13), transparent 72%),
    rgba(0, 229, 255, 0.035);
  box-shadow: inset 3px 0 0 #00e5ff;
}

.stage-song-select-box {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(0, 229, 255, 0.38);
  border-radius: 6px;
  background: rgba(0, 229, 255, 0.045);
  color: #00e5ff;
  cursor: pointer;
}

.stage-song-select-box.selected {
  border-color: #00e5ff;
  background: #00b8cc;
  color: #001013;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.36);
}

.stage-song-select-box svg {
  width: 15px;
  height: 15px;
}

.stage-song-selected-mark {
  color: #00e5ff;
  font-size: 0.58rem;
  font-weight: 900;
}

.stage-song-row-note,
.click-song-note {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
  padding: 3px 6px;
  border: 1px solid rgba(255, 82, 82, 0.22);
  border-radius: 6px;
  background: rgba(255, 54, 54, 0.065);
  color: #ff7373;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-song-row-note svg,
.click-song-note svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  color: #ff5d5d;
}

.click-song-note {
  max-width: 100%;
  margin-top: 1px;
}

@media (max-width: 700px) {
  .stage-song-bulk-target {
    grid-template-columns: minmax(0, 1fr);
  }

  .stage-song-bulk-target > button {
    width: 100%;
  }
}

@media (max-width: 920px) {
  .app-frame.view-metronome .metronome-standalone-main {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-frame.view-metronome .metronome-prep-shell {
    height: auto;
    min-height: 100%;
    overflow: visible;
  }

  .app-frame.view-metronome .metronome-prep-main {
    height: auto;
    display: block;
    overflow: visible;
  }

  .app-frame.view-metronome .metronome-prep-hero,
  .app-frame.view-metronome .quick-song-card {
    margin-bottom: 10px;
  }

  .app-frame.view-metronome .quick-song-card {
    height: auto;
    overflow: visible;
  }

  .app-frame.view-metronome .quick-song-layout,
  .app-frame.view-metronome .stage-song-browser-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-frame.view-metronome .stage-song-browser-card {
    height: auto;
    min-height: 620px;
  }

  .app-frame.view-metronome .stage-song-browser-grid {
    grid-template-rows: minmax(220px, auto) minmax(260px, 1fr);
  }

  .app-frame.view-metronome .stage-song-browser-list,
  .app-frame.view-metronome .stage-click-drop-panel {
    min-height: 220px;
  }
}

@media (max-width: 640px) {
  :root {
    --topbar-height: 94px;
  }

  .app-frame,
  .app-frame.view-home,
  .app-frame.tool-page-shell,
  .app-frame.library-mode-songs,
  .app-frame.library-mode-playlists,
  .app-frame.library-mode-playlist {
    grid-template-columns: clamp(72px, 22vw, 92px) minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }

  .app-frame > .library-panel {
    grid-column: 1;
    grid-row: 1;
    order: 0;
    height: var(--app-height);
  }

  .app-frame > .workspace {
    grid-column: 2;
    grid-row: 1;
    order: 1;
    height: var(--app-height);
  }

  .app-frame .topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    gap: 5px;
    padding: 6px 8px;
    overflow: hidden;
  }

  .app-frame .topbar .page-nav,
  .app-frame .topbar .tabs {
    width: 100%;
    min-width: 0;
  }

  .app-frame .topbar .page-nav {
    gap: 5px;
  }

  .app-frame .topbar .page-nav button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 0.76rem;
  }

  .app-frame .topbar .tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .app-frame .topbar .tab-button {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 34px;
    padding: 0 4px;
    gap: 4px;
    font-size: clamp(0.58rem, 2.25vw, 0.72rem);
  }

  .app-frame .topbar .tab-button svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
  }

  .app-frame.view-metronome .metronome-standalone-main {
    padding: 8px !important;
  }

  .app-frame.view-metronome .metronome-prep-hero {
    gap: 8px;
  }

  .app-frame.view-metronome .metronome-prep-hero .stage-prep-ghost-btn {
    width: 100%;
  }

  .app-frame.view-metronome .quick-song-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-frame.view-metronome .quick-field,
  .app-frame.view-metronome .quick-field.title-field,
  .app-frame.view-metronome .quick-field.stage-style-field,
  .app-frame.view-metronome .quick-field.stage-note-field,
  .app-frame.view-metronome .stage-bpm-tap-row {
    grid-column: 1;
  }

  .app-frame.view-metronome .stage-preview-card {
    grid-template-columns: minmax(62px, 72px) minmax(46px, 52px) minmax(0, 1fr);
  }

  .app-frame.view-metronome .stage-song-table-top,
  .app-frame.view-metronome .stage-click-drop-panel > header {
    align-items: stretch;
    flex-direction: column;
  }

  .app-frame.view-metronome .stage-song-search,
  .app-frame.view-metronome .stage-click-add-btn {
    width: 100%;
  }

  .app-frame.view-metronome .stage-song-browser-card {
    min-height: 680px;
  }
}

/* v176 professional recording export: WAV/MP3 choice and save-location guidance. */
.record-download-sheet {
  width: min(620px, calc(100vw - 28px));
  max-height: min(820px, calc(100dvh - 28px));
  overflow: auto;
}

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

.record-download-format {
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: #eaffff;
  text-align: left;
  cursor: pointer;
}

.record-download-format:hover,
.record-download-format.active {
  border-color: rgba(0, 229, 255, 0.72);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.16), rgba(0, 229, 255, 0.045));
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.12), inset 3px 0 0 #00e5ff;
}

.record-download-format > svg {
  width: 30px;
  height: 30px;
  color: #00e5ff;
}

.record-download-format > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.record-download-format > span strong {
  color: #f6feff;
  font-size: 1.04rem;
}

.record-download-format > span small {
  color: rgba(234, 255, 255, 0.65);
  font-size: 0.76rem;
  line-height: 1.25;
}

.record-download-format > em {
  align-self: start;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.12);
  color: #87f6ff;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.record-download-name-field {
  display: grid;
  gap: 7px;
}

.record-download-name-field > span {
  color: #dffcff;
  font-size: 0.8rem;
  font-weight: 900;
}

.record-download-name-field > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
}

.record-download-name-field input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f4fdff;
  padding: 0 12px;
  font-weight: 820;
}

.record-download-name-field b {
  align-self: stretch;
  display: grid;
  place-items: center;
  min-width: 58px;
  padding: 0 10px;
  border-left: 1px solid rgba(0, 229, 255, 0.18);
  background: rgba(0, 229, 255, 0.08);
  color: #00e5ff;
  text-transform: uppercase;
}

.record-download-location {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
}

.record-download-location.picker-ready {
  border-color: rgba(77, 224, 160, 0.34);
  background: rgba(77, 224, 160, 0.065);
}

.record-download-location > svg {
  width: 28px;
  height: 28px;
  color: #4de0a0;
}

.record-download-location.browser-managed > svg {
  color: #00e5ff;
}

.record-download-location > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.record-download-location strong {
  color: #f2fffa;
  font-size: 0.9rem;
}

.record-download-location small {
  color: rgba(234, 255, 255, 0.64);
  font-size: 0.77rem;
  line-height: 1.3;
}

.record-download-summary {
  margin: 0;
  text-align: center;
}

.record-download-summary b {
  color: #dffcff;
}

.record-download-progress {
  display: grid;
  gap: 7px;
  text-align: center;
}

.record-download-progress > span {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.record-download-progress i {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00a8c6, #00e5ff, #4de0a0);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.42);
  transition: width 160ms ease;
}

.record-download-progress strong {
  color: #dffcff;
  font-size: 0.82rem;
}

@media (max-width: 640px) {
  .record-download-sheet {
    width: min(100% - 16px, 520px);
    max-height: calc(100dvh - 16px);
    gap: 10px;
    padding: 12px;
    border-radius: 13px;
  }

  .record-download-format-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .record-download-format {
    min-height: 72px;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    padding: 9px;
  }

  .record-download-format > svg {
    width: 24px;
    height: 24px;
  }

  .record-download-waveform {
    min-height: 54px !important;
    max-height: 64px !important;
  }

  .record-download-sheet footer {
    grid-template-columns: minmax(0, 0.66fr) minmax(0, 1.34fr);
  }
}

/* v178: Logic-style recording timeline. Empty frames stay visually empty. */
.app-frame.view-recordings .recording-signal-waveform {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: block;
  padding: 8px 10px !important;
  border: 1px solid rgba(0, 229, 255, 0.22) !important;
  border-radius: 14px;
  background: rgba(1, 10, 12, 0.34) !important;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.16);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.app-frame.view-recordings .recording-signal-waveform.has-signal {
  border-color: rgba(0, 229, 255, 0.42) !important;
  box-shadow: inset 0 0 34px rgba(0, 229, 255, 0.055), 0 0 18px rgba(0, 229, 255, 0.06);
}

.app-frame.view-recordings .recording-wave-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: visible;
}

.app-frame.view-recordings .recording-wave-area {
  opacity: 0.82;
}

.app-frame.view-recordings .recording-wave-edge {
  fill: none;
  stroke: rgba(137, 255, 248, 0.92);
  stroke-width: 1.35;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: 0.88;
}

.app-frame.view-recordings .recording-signal-waveform:not(.has-signal) {
  background: rgba(1, 10, 12, 0.24) !important;
  box-shadow: none;
}

.app-frame.view-recordings .recording-capture-layout .record-live-waveform,
.app-frame.view-recordings .record-player-card .record-player-waveform {
  background-image: none !important;
}

/* v179: unlimited continuation workflow and clearer recording details. */
.app-frame.view-recordings .record-append-banner {
  min-height: 54px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px 10px;
  border-color: rgba(0, 229, 255, 0.44);
  border-radius: 11px;
  background:
    linear-gradient(100deg, rgba(0, 229, 255, 0.16), rgba(0, 229, 255, 0.035)),
    rgba(2, 12, 15, 0.9);
  box-shadow: inset 3px 0 0 #00e5ff, 0 8px 22px rgba(0, 0, 0, 0.2);
}

.app-frame.view-recordings .record-append-banner > svg {
  width: 20px;
  height: 20px;
  color: #00e5ff;
}

.app-frame.view-recordings .record-append-banner span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.app-frame.view-recordings .record-append-banner b {
  color: #f2feff;
  font-size: 0.84rem;
  letter-spacing: 0.015em;
}

.app-frame.view-recordings .record-append-banner small {
  min-width: 0;
  color: rgba(223, 251, 255, 0.66);
  font-size: 0.69rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-frame.view-recordings .record-append-banner button {
  min-height: 32px;
  white-space: nowrap;
}

.app-frame.view-recordings .record-append-banner button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.app-frame.view-recordings .record-side-panel .record-form-card {
  position: relative;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: 7px !important;
  padding: 10px !important;
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 16px;
  background:
    radial-gradient(circle at 8% 0%, rgba(0, 229, 255, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    rgba(3, 9, 11, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 18px 40px rgba(0, 0, 0, 0.34);
}

.app-frame.view-recordings .record-side-panel .record-form-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.95), transparent);
  opacity: 0.78;
}

.app-frame.view-recordings .record-form-card.append-mode {
  border-color: rgba(0, 229, 255, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 28px rgba(0, 229, 255, 0.09), 0 18px 40px rgba(0, 0, 0, 0.34);
}

.record-form-card-head {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.record-form-card-head > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 229, 255, 0.34);
  border-radius: 11px;
  background: rgba(0, 229, 255, 0.1);
  color: #00e5ff;
}

.record-form-card-head > span svg {
  width: 22px;
  height: 22px;
}

.record-form-card-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.record-form-card-head strong {
  color: #f3feff;
  font-size: 1.02rem;
  line-height: 1.05;
}

.record-form-card-head small {
  color: rgba(255, 255, 255, 0.57);
  font-size: 0.73rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.record-form-card-head em {
  padding: 6px 8px;
  border: 1px solid rgba(0, 229, 255, 0.34);
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.09);
  color: #65f2ff;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0.055em;
  white-space: nowrap;
}

.app-frame.view-recordings .record-side-panel .record-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: auto auto auto auto !important;
  align-content: start;
  gap: 8px 10px !important;
  height: auto !important;
  padding: 1px 2px 5px;
  overflow: auto !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.34) transparent;
}

.app-frame.view-recordings .record-side-panel .record-form-grid > label {
  display: grid !important;
  min-width: 0;
  gap: 6px !important;
  overflow: visible !important;
}

.app-frame.view-recordings .record-side-panel .record-form-grid > label:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.app-frame.view-recordings .record-side-panel .record-form-grid > label:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

.app-frame.view-recordings .record-side-panel .record-form-grid > label:nth-child(3) {
  display: grid !important;
  grid-column: 1;
  grid-row: 2;
}

.app-frame.view-recordings .record-side-panel .record-form-grid > label:nth-child(6) {
  display: grid !important;
  grid-column: 2;
  grid-row: 2;
}

.app-frame.view-recordings .record-side-panel .record-form-grid > .record-tags-field {
  grid-column: 1 / -1 !important;
  grid-row: 3 !important;
  gap: 8px !important;
  padding: 10px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.085), rgba(0, 229, 255, 0.022));
}

.app-frame.view-recordings .record-side-panel .record-form-grid > .record-description-field {
  grid-column: 1 / -1 !important;
  grid-row: 4 !important;
}

.app-frame.view-recordings .record-side-panel .record-form-card label > span:first-child {
  color: rgba(235, 251, 253, 0.78);
  font-size: 0.8rem !important;
  font-weight: 900;
  line-height: 1.1 !important;
  letter-spacing: 0.012em;
}

.app-frame.view-recordings .record-side-panel .record-form-card input,
.app-frame.view-recordings .record-side-panel .record-form-card textarea {
  min-height: 38px !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.34);
  color: #f7ffff;
  font-size: 0.96rem !important;
  font-weight: 720;
}

.app-frame.view-recordings .record-side-panel .record-form-card input[readonly] {
  color: rgba(230, 249, 251, 0.72);
  background: rgba(255, 255, 255, 0.035);
}

.app-frame.view-recordings .record-side-panel .record-form-card textarea {
  min-height: 64px !important;
  max-height: 82px !important;
  padding: 11px 12px;
  line-height: 1.35;
}

.app-frame.view-recordings .record-tags-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #ecfdff !important;
  font-size: 0.88rem !important;
}

.app-frame.view-recordings .record-tags-title svg {
  width: 17px;
  height: 17px;
  color: #00e5ff;
}

.app-frame.view-recordings .record-tags-title small {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.12);
  color: #5decf9;
  font-size: 0.65rem;
  font-weight: 900;
}

.app-frame.view-recordings .record-side-panel .record-tag-picker {
  min-height: 0;
  height: auto;
  max-height: none !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
  gap: 5px;
  overflow: visible !important;
  padding: 0;
}

.app-frame.view-recordings .record-side-panel .record-tag-picker button {
  width: 100%;
  min-width: 0;
  min-height: 30px !important;
  padding: 0 4px;
  border-color: rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(244, 252, 252, 0.78);
  font-size: 0.72rem !important;
  white-space: nowrap;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.app-frame.view-recordings .record-side-panel .record-tag-picker button:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 229, 255, 0.42);
}

.app-frame.view-recordings .record-side-panel .record-tag-picker button.active {
  border-color: rgba(0, 229, 255, 0.72);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(0, 229, 255, 0.1));
  color: #8af6ff;
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.12), 0 0 14px rgba(0, 229, 255, 0.1);
}

.app-frame.view-recordings .record-side-panel .record-save-row {
  grid-template-columns: minmax(0, 1fr) !important;
}

.app-frame.view-recordings .record-side-panel .record-save-btn {
  min-height: 46px !important;
  border-radius: 11px;
  font-size: 0.94rem;
}

@media (max-width: 920px) {
  .app-frame.view-recordings .record-side-panel .record-form-card {
    overflow: visible !important;
  }

  .app-frame.view-recordings .record-side-panel .record-form-grid {
    overflow: visible !important;
  }
}

@media (max-width: 640px) {
  .app-frame.view-recordings .record-append-banner {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .app-frame.view-recordings .record-append-banner button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .app-frame.view-recordings .record-side-panel .record-form-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: none !important;
  }

  .app-frame.view-recordings .record-side-panel .record-form-grid > label,
  .app-frame.view-recordings .record-side-panel .record-form-grid > .record-tags-field,
  .app-frame.view-recordings .record-side-panel .record-form-grid > .record-description-field {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .record-form-card-head {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .record-form-card-head > span {
    width: 38px;
    height: 38px;
  }

  .record-form-card-head em {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* v179: recording list always fits its frame without horizontal scrolling. */
.app-frame.view-recordings .recordings-list-page-grid,
.app-frame.view-recordings .recordings-list-page-grid .record-list-card,
.app-frame.view-recordings .recordings-list-page-grid .recording-list {
  min-width: 0;
  max-width: 100%;
}

.app-frame.view-recordings .recordings-list-page-grid .record-list-card {
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.app-frame.view-recordings .recordings-list-page-grid .record-list-card > header {
  min-width: 0;
  min-height: 86px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 8px;
}

.app-frame.view-recordings .recordings-list-page-grid .record-list-card > header > strong {
  min-width: 0;
  text-align: left;
  font-size: 1rem;
}

.app-frame.view-recordings .record-list-tools {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(76px, 0.72fr) minmax(76px, 0.72fr) !important;
  gap: 7px;
}

.app-frame.view-recordings .record-search,
.app-frame.view-recordings .record-search input,
.app-frame.view-recordings .record-list-choice,
.app-frame.view-recordings .record-list-choice .inline-choice-trigger {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.app-frame.view-recordings .record-list-choice .inline-choice-trigger {
  padding-inline: 7px;
}

.app-frame.view-recordings .recording-list {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 7px;
}

.app-frame.view-recordings .recording-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 94px !important;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 32px !important;
  grid-template-rows: minmax(52px, auto) 26px;
  align-items: center;
  gap: 5px 7px !important;
  padding: 8px !important;
  overflow: visible;
}

.app-frame.view-recordings .recording-row > .recording-row-play {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 36px;
  height: 36px;
}

.app-frame.view-recordings .recording-row > .recording-row-main {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

.app-frame.view-recordings .recording-row-main strong {
  font-size: 0.94rem;
}

.app-frame.view-recordings .recording-row-main span {
  margin-top: 2px;
  font-size: 0.68rem;
}

.app-frame.view-recordings .recording-row-stats {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}

.app-frame.view-recordings .recording-row-stats b {
  min-width: 0;
  padding: 3px 6px;
  border: 1px solid rgba(0, 229, 255, 0.16);
  border-radius: 6px;
  background: rgba(0, 229, 255, 0.06);
  color: rgba(224, 251, 255, 0.72);
  font-size: 0.66rem;
  font-weight: 850;
  white-space: nowrap;
}

.app-frame.view-recordings .recording-row > .record-row-waveform {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  min-height: 26px !important;
  max-height: 28px !important;
  overflow: hidden;
}

.app-frame.view-recordings .recording-row > .recording-menu-btn {
  grid-column: 3;
  grid-row: 1 / 3;
  width: 32px;
  height: 38px;
  padding: 0;
}

@media (max-width: 520px) {
  .app-frame.view-recordings .record-list-tools {
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(68px, 0.7fr)) !important;
    gap: 5px;
  }

  .app-frame.view-recordings .record-search {
    grid-template-columns: 22px minmax(0, 1fr);
    padding-inline: 7px;
  }

  .app-frame.view-recordings .recording-row {
    grid-template-columns: 38px minmax(0, 1fr) 30px !important;
    gap: 4px !important;
    padding-inline: 6px !important;
  }
}

@media (max-width: 900px) {
  .app-frame.view-recordings .recordings-list-main {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .app-frame.view-recordings .recordings-list-page-grid {
    height: auto;
    min-height: 100%;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(480px, 1fr) minmax(420px, auto);
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  .app-frame.view-recordings .recordings-list-page-grid .record-list-card,
  .app-frame.view-recordings .recordings-list-page-grid .record-player-card {
    width: 100%;
    max-width: 100%;
  }
}

/* v186 balanced measure engraving: every chord, rest and sign gets an equal centered slot. */
.chart-measure {
  --measure-chord-size: 2.72rem;
  --measure-mark-size: 2.56rem;
  --measure-text-sign-size: 1.12rem;
}

.chart-measure.chord-density-tight {
  --measure-chord-size: 2.22rem;
  --measure-mark-size: 2.14rem;
  --measure-text-sign-size: 1rem;
}

.chart-measure.chord-density-dense {
  --measure-chord-size: 1.92rem;
  --measure-mark-size: 1.86rem;
  --measure-text-sign-size: 0.9rem;
}

.chart-measure.chord-density-packed {
  --measure-chord-size: 1.64rem;
  --measure-mark-size: 1.58rem;
  --measure-text-sign-size: 0.8rem;
}

.stage-paper .chart-measure {
  --measure-chord-size: 3.45rem;
  --measure-mark-size: 3.18rem;
  --measure-text-sign-size: 1.34rem;
}

.stage-paper .chart-measure.chord-density-tight {
  --measure-chord-size: 2.58rem;
  --measure-mark-size: 2.48rem;
  --measure-text-sign-size: 1.12rem;
}

.stage-paper .chart-measure.chord-density-dense {
  --measure-chord-size: 2.32rem;
  --measure-mark-size: 2.22rem;
  --measure-text-sign-size: 1rem;
}

.stage-paper .chart-measure.chord-density-packed {
  --measure-chord-size: 2.02rem;
  --measure-mark-size: 1.94rem;
  --measure-text-sign-size: 0.9rem;
}

.chart-measure.notation-with-chords {
  --measure-chord-size: 2rem;
  --measure-mark-size: 1.92rem;
  --measure-text-sign-size: 0.88rem;
}

.chart-measure.notation-with-chords.chord-density-tight {
  --measure-chord-size: 1.7rem;
  --measure-mark-size: 1.64rem;
  --measure-text-sign-size: 0.78rem;
}

.chart-measure.notation-with-chords.chord-density-dense {
  --measure-chord-size: 1.48rem;
  --measure-mark-size: 1.44rem;
  --measure-text-sign-size: 0.7rem;
}

.chart-measure.notation-with-chords.chord-density-packed {
  --measure-chord-size: 1.28rem;
  --measure-mark-size: 1.24rem;
  --measure-text-sign-size: 0.64rem;
}

.stage-paper .chart-measure.notation-with-chords {
  --measure-chord-size: 2.05rem;
  --measure-mark-size: 1.98rem;
  --measure-text-sign-size: 0.9rem;
}

.stage-paper .chart-measure.notation-with-chords.chord-density-tight {
  --measure-chord-size: 1.82rem;
  --measure-mark-size: 1.76rem;
  --measure-text-sign-size: 0.82rem;
}

.stage-paper .chart-measure.notation-with-chords.chord-density-dense {
  --measure-chord-size: 1.58rem;
  --measure-mark-size: 1.52rem;
  --measure-text-sign-size: 0.74rem;
}

.stage-paper .chart-measure.notation-with-chords.chord-density-packed {
  --measure-chord-size: 1.38rem;
  --measure-mark-size: 1.34rem;
  --measure-text-sign-size: 0.68rem;
}

.sheet-chords,
.chart-measure.notation-with-chords .sheet-chords {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: clamp(2px, 0.35vw, 6px) !important;
  width: 100%;
}

.sheet-chords > * {
  min-width: 0;
  max-width: 100%;
  align-self: center;
  justify-self: center;
}

.sheet-chords .chord-symbol {
  min-width: 0;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sheet-chords .chord-root {
  font-size: var(--measure-chord-size);
}

.sheet-chords .chart-sign-symbol {
  width: 1em;
  min-width: 1em;
  height: 1em;
  display: inline-grid;
  place-items: center;
  color: #050605;
  font-size: var(--measure-mark-size);
  line-height: 1;
  vertical-align: 0;
}

.sheet-chords .chart-text-sign {
  width: 100%;
  min-width: 0;
  font-size: var(--measure-text-sign-size);
  line-height: 1;
  text-align: center;
}

.sheet-chords .chart-rest-sign,
.sheet-chords .chart-rest-icon {
  width: 1em;
  height: 1em;
}

.sheet-chords .chart-rest-icon {
  font-size: 1.08em;
  line-height: 1;
  transform: translateY(0.01em);
}

.sheet-chords .chart-rest-icon[data-rest="whole"],
.sheet-chords .chart-rest-icon[data-rest="half"] {
  font-size: 1.12em;
  transform: translateY(-0.02em);
}

.sheet-chords .repeat-symbol,
.sheet-chords .double-bar {
  width: 1em;
  min-width: 1em;
  height: 1em;
  display: inline-grid;
  place-items: center;
  color: #050605;
  font-size: var(--measure-mark-size);
  line-height: 1;
  transform: none;
}

.sheet-chords .double-bar {
  letter-spacing: -0.14em;
  padding-right: 0.14em;
}

.chart-measure.chord-density-dense .sheet-chords {
  gap: 2px !important;
}

.chart-measure.chord-density-packed .sheet-chords {
  gap: 1px !important;
}

/* v187 compact rest palette: smaller controls, restrained glow and predictable columns. */
.keyboard-row:has(.rest-sign-key) {
  padding: 4px 6px;
}

.keyboard-row:has(.rest-sign-key) .keyboard-grid.compact {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.keyboard-grid button.sign-key.rest-sign-key {
  min-width: 0;
  min-height: 68px;
  height: 68px;
  padding: 4px 5px !important;
  overflow: hidden;
  border-color: rgba(0, 229, 255, 0.34);
  background:
    radial-gradient(circle at 50% 4%, rgba(0, 229, 255, 0.12), transparent 48%),
    linear-gradient(180deg, rgba(29, 48, 51, 0.96), rgba(19, 24, 27, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.rest-key-content {
  grid-template-rows: 30px minmax(0, 1fr);
  gap: 2px;
  min-width: 0;
  height: 100%;
}

.rest-glyph-preview {
  width: 40px;
  height: 30px;
}

.rest-key-icon,
.rest-key-icon[data-rest="whole"],
.rest-key-icon[data-rest="half"] {
  width: 30px;
  height: 30px;
  font-size: 30px;
  filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.22));
}

.rest-key-icon[data-rest="quarter"] {
  width: 34px;
  height: 34px;
  font-size: 34px;
}

.rest-key-label {
  width: 100%;
  min-width: 0;
  gap: 1px;
  align-content: center;
}

.rest-key-label b {
  max-width: 100%;
  color: #effdff;
  font-size: 0.62rem;
  line-height: 1;
  white-space: normal;
  text-wrap: balance;
}

.rest-key-label small {
  max-width: 100%;
  color: rgba(192, 247, 255, 0.58);
  font-size: 0.54rem;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .keyboard-row:has(.rest-sign-key) .keyboard-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .keyboard-row:has(.rest-sign-key) .keyboard-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .keyboard-row:has(.rest-sign-key) .keyboard-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* v188 slash-chord engraving: keep the root on the shared chord baseline. */
.sheet-chords .chord-symbol.has-bass {
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  line-height: 0.9;
}

.sheet-chords .chord-symbol.has-bass .chord-main,
.sheet-chords .chord-symbol.has-bass .chord-bass {
  flex: 0 0 auto;
}

.sheet-chords .chord-symbol.has-bass .chord-bass {
  align-self: baseline;
  margin: 0 0 0 0.06em;
  padding: 0;
  line-height: 0.9;
  transform: none;
}

/* Keep every item inside its equal rhythmic slot, including long chord extensions. */
.sheet-chords > .chord-symbol,
.sheet-chords > .repeat-symbol,
.sheet-chords > .double-bar {
  transform: scale(var(--measure-fit-scale, 1));
  transform-origin: center center;
}

/* v189 touch-first measure selection, copy and paste workflow. */
.chart-measure[data-action="select-measure"] {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.chart-measure.range-selected::after {
  content: "✓";
  position: absolute;
  left: 7px;
  top: 6px;
  z-index: 8;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #0a9e98;
  color: #f4ffff;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 7px rgba(0, 85, 88, 0.26);
}

.measure-selection-toolbar {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(0, 229, 255, 0.38);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(8, 37, 42, 0.98), rgba(10, 21, 25, 0.98));
  color: #dffcff;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.24);
}

.measure-selection-toolbar > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(219, 247, 250, 0.78);
  font-size: 0.76rem;
  line-height: 1.25;
}

.measure-selection-toolbar > span svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: #00e5ff;
}

.measure-selection-toolbar > span b {
  color: #f3feff;
  white-space: nowrap;
}

.measure-selection-toolbar > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.measure-selection-toolbar button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.08);
  color: #e9fdff;
  padding: 7px 10px;
  font-size: 0.72rem;
  font-weight: 800;
}

.measure-selection-toolbar button svg {
  width: 16px;
  height: 16px;
}

.measure-selection-toolbar button:disabled {
  opacity: 0.38;
}

.measure-selection-toolbar.paste-ready {
  border-color: rgba(78, 238, 170, 0.45);
  background: linear-gradient(135deg, rgba(7, 45, 37, 0.98), rgba(10, 25, 27, 0.98));
}

.measure-selection-toolbar.paste-ready > span svg {
  color: #58f3b5;
}

.measure-action-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px max(14px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: rgba(1, 5, 7, 0.72);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.measure-action-sheet {
  width: min(680px, 100%);
  overflow: hidden;
  border: 1px solid rgba(0, 229, 255, 0.42);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(19, 28, 32, 0.995), rgba(9, 15, 18, 0.995));
  color: #f4feff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62), 0 0 36px rgba(0, 229, 255, 0.1);
}

.measure-action-sheet > header {
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr 42px;
  align-items: center;
  gap: 10px;
  padding: 11px 13px 10px 16px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.16);
  background: rgba(0, 229, 255, 0.035);
}

.measure-action-sheet > header span {
  color: #00e5ff;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.measure-action-sheet > header strong {
  font-size: 1rem;
  text-align: center;
}

.measure-action-sheet > header button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: #ecfdff;
}

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

.measure-action-grid > button {
  min-width: 0;
  min-height: 88px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-content: center;
  text-align: left;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: #f4feff;
}

.measure-action-grid > button > svg {
  grid-row: 1 / 3;
  align-self: center;
  width: 28px;
  height: 28px;
  color: #00dff8;
}

.measure-action-grid > button b {
  min-width: 0;
  font-size: 0.88rem;
}

.measure-action-grid > button small {
  min-width: 0;
  margin-top: 3px;
  color: rgba(218, 242, 245, 0.58);
  font-size: 0.67rem;
  line-height: 1.25;
}

.measure-action-grid > button.primary {
  border-color: rgba(77, 242, 176, 0.52);
  background: linear-gradient(135deg, rgba(23, 127, 91, 0.3), rgba(0, 229, 255, 0.1));
}

.measure-action-grid > button.primary > svg {
  color: #58f3b5;
}

.measure-action-grid > button:disabled {
  opacity: 0.34;
}

.measure-action-clear {
  width: calc(100% - 24px);
  min-height: 42px;
  margin: 0 12px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 110, 110, 0.22);
  border-radius: 10px;
  background: rgba(255, 75, 75, 0.06);
  color: #ffbcbc;
  font-size: 0.74rem;
  font-weight: 800;
}

@media (max-width: 760px) {
  .measure-selection-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .measure-selection-toolbar > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .measure-selection-toolbar button {
    padding-inline: 6px;
  }

  .measure-action-grid {
    grid-template-columns: 1fr;
  }

  .measure-action-grid > button {
    min-height: 72px;
  }
}

/* iPad portrait: the hidden library must not leave the workspace in its old rail column. */
@media (min-width: 641px) and (max-width: 999px) {
  .app-frame.view-metronomeTool.tool-page-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .app-frame.view-metronomeTool.tool-page-shell > .library-panel {
    display: none !important;
  }

  .app-frame.view-metronomeTool.tool-page-shell > .workspace {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .app-frame.view-metronomeTool .metronome-standalone-main,
  .app-frame.view-metronomeTool .practice-metronome-shell,
  .app-frame.view-metronomeTool .practice-metronome-main {
    width: 100% !important;
    max-width: 100% !important;
  }

  .app-frame.view-editor .chord-keyboard.expanded {
    scroll-margin-top: 8px;
    border-color: rgba(0, 216, 255, 0.5);
    box-shadow: 0 -10px 34px rgba(0, 0, 0, 0.4), 0 0 24px rgba(0, 216, 255, 0.08);
  }

  .app-frame.view-editor .chord-keyboard.expanded .keyboard-mode-switch {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    width: 100%;
    padding: 2px 0 7px;
    background: rgba(28, 29, 32, 0.98);
  }

  .app-frame.view-editor .chord-keyboard.expanded .keyboard-mode-switch button {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 10px;
    font-size: 0.86rem;
  }
}

/* v194 final cascade: keep pagination and touch layout authoritative. */
.stage-song-browser-list {
  display: flex;
  flex-direction: column;
}

.stage-song-browser-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.stage-click-drop-panel,
.app-frame.view-metronome .stage-click-drop-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.stage-click-set-target,
.app-frame.view-metronome .stage-click-set-target {
  grid-template-columns: 28px minmax(0, 1fr) 34px;
}

.stage-click-drop-panel > header .stage-click-set-heading small,
.app-frame.view-metronome .stage-click-drop-panel > header .stage-click-set-heading small {
  display: block;
}

.click-set-list {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

/* v194 final piano cascade: later legacy tablet rules must not reintroduce two rows or outer overflow. */
.app-frame.view-piano .piano-stage-shell,
.app-frame.view-piano .piano-stage-main,
.app-frame.view-piano .piano-stage-keyboard {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.app-frame.view-piano .piano-stage-keyboard {
  --piano-white-width: clamp(44px, 4.7vw, 68px);
  position: relative;
  min-height: 292px;
  padding: 7px 0;
}

.app-frame.view-piano .piano-keyboard-viewport {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.app-frame.view-piano .piano-stage-keyboard .piano-keyboard-panel.piano-global-keyboard {
  width: max-content;
  height: 100%;
  min-height: 0;
  display: block;
  grid-template-rows: none;
}

.app-frame.view-piano .piano-stage-keyboard .piano-keyboard-row.piano-global-row {
  width: max-content;
  height: 100%;
  min-height: 0;
  display: flex;
  grid-template-columns: none;
  gap: 0;
  overflow: visible;
  border-radius: 0;
}

.app-frame.view-piano .piano-stage-keyboard .piano-global-row .piano-octave {
  flex: 0 0 calc(var(--piano-white-width) * var(--piano-white-count, 7));
  width: calc(var(--piano-white-width) * var(--piano-white-count, 7));
  height: 100%;
  min-height: 0;
}

.app-frame.view-piano .piano-stage-keyboard .piano-global-row .piano-key.white {
  min-width: var(--piano-white-width);
}

.app-frame.view-piano .piano-stage-keyboard .piano-global-row .piano-edge-group .piano-key.black {
  width: calc(var(--piano-white-width) * 0.62);
}

@media (orientation: portrait) and (max-width: 999px) {
  html body #app.app-frame.view-piano.tool-page-shell > main.workspace.metronome-workspace > section.workspace-main.metronome-standalone-main {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  html body #app.app-frame.view-piano.tool-page-shell .piano-stage-shell,
  html body #app.app-frame.view-piano.tool-page-shell .piano-stage-main,
  html body #app.app-frame.view-piano.tool-page-shell .piano-stage-keyboard {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  html body #app.app-frame.view-piano.tool-page-shell .piano-stage-main {
    grid-template-columns: minmax(0, 1fr) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  html body #app.app-frame.view-piano.tool-page-shell .piano-stage-main > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html body #app.app-frame.view-piano.tool-page-shell .piano-stage-controls {
    grid-template-columns: 0.82fr 0.92fr 0.92fr 1.32fr 1.3fr !important;
  }

  html body #app.app-frame.view-piano.tool-page-shell .piano-square-action {
    display: none !important;
  }

  html body #app.app-frame.view-piano.tool-page-shell .piano-control-card {
    min-width: 0 !important;
    padding-left: 10px;
    padding-right: 10px;
  }

  .app-frame.view-piano .piano-stage-keyboard {
    --piano-white-width: clamp(46px, 7vw, 58px);
    min-height: 330px;
  }
}

@media (orientation: landscape) and (max-width: 1366px) {
  html body #app.app-frame.view-piano.tool-page-shell > main.workspace.metronome-workspace > section.workspace-main.metronome-standalone-main,
  html body #app.app-frame.view-piano.tool-page-shell .piano-stage-shell,
  html body #app.app-frame.view-piano.tool-page-shell .piano-stage-shell > .piano-stage-main,
  html body #app.app-frame.view-piano.tool-page-shell .piano-stage-keyboard {
    width: 100vw !important;
    height: var(--app-height) !important;
    min-height: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    inset: auto !important;
    transform: none !important;
    overflow: hidden !important;
  }

  html body #app.app-frame.view-piano.tool-page-shell .piano-stage-keyboard {
    --piano-white-width: clamp(50px, 5.6vw, 74px);
  }
}

/* v195 iPad landscape piano ergonomics:
   fewer keys per view, acoustic-key proportions and large finger-safe targets. */
@media (orientation: landscape) and (max-width: 1366px) and (pointer: coarse) {
  html body #app.app-frame.view-piano.tool-page-shell .piano-stage-keyboard {
    --piano-white-width: clamp(76px, 8.15vw, 96px);
  }

  .app-frame.view-piano .piano-keyboard-viewport {
    scroll-snap-type: x proximity;
    scroll-padding-inline:
      max(52px, env(safe-area-inset-left))
      max(52px, env(safe-area-inset-right));
  }

  .app-frame.view-piano .piano-stage-keyboard .piano-global-row .piano-octave {
    scroll-snap-align: start;
  }

  .app-frame.view-piano .piano-stage-keyboard .piano-global-row .piano-key.white {
    width: var(--piano-white-width);
    min-width: var(--piano-white-width);
    box-sizing: border-box;
  }

  .app-frame.view-piano .piano-stage-keyboard .piano-global-row .piano-key.black {
    width: calc(var(--piano-white-width) * 0.6);
    height: 62%;
    box-sizing: border-box;
    border-radius: 0 0 9px 9px;
  }

  .app-frame.view-piano .piano-keyboard-pan {
    width: 52px;
    min-width: 52px;
    height: 108px;
    border-color: rgba(0, 229, 255, 0.62);
    background: rgba(2, 10, 13, 0.86);
  }

  .app-frame.view-piano .piano-keyboard-pan.previous {
    left: max(0px, env(safe-area-inset-left));
  }

  .app-frame.view-piano .piano-keyboard-pan.next {
    right: max(0px, env(safe-area-inset-right));
  }
}

/* v195 iPad preparation tools: chord and notation open as a visible,
   workspace-aligned bottom sheet instead of inheriting an off-screen drag position. */
@media (max-width: 1366px) {
  .app-frame.view-editor .stage-note-panel {
    left: calc(clamp(148px, 17.5vw, 244px) + 12px) !important;
    right: 12px !important;
    top: auto !important;
    bottom: max(0px, env(safe-area-inset-bottom)) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: min(68dvh, 640px) !important;
    min-height: 320px;
    max-height: calc(100dvh - 104px) !important;
    transform: none !important;
    z-index: 90;
    border-radius: 18px 18px 0 0;
    border-color: rgba(0, 229, 255, 0.58);
    background: rgba(5, 9, 11, 0.985);
    box-shadow: 0 -18px 54px rgba(0, 0, 0, 0.66), 0 0 30px rgba(0, 216, 255, 0.14);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .app-frame.view-editor .stage-note-panel > header {
    position: sticky;
    top: 0;
    z-index: 4;
    min-height: 56px;
    background: rgba(5, 9, 11, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .app-frame.view-editor .stage-note-panel .stage-tool-switch {
    position: sticky;
    top: 56px;
    z-index: 3;
    background: rgba(5, 9, 11, 0.98);
  }

  .app-frame.view-editor .stage-note-panel button,
  .app-frame.view-editor .stage-note-panel input {
    min-height: 44px;
  }
}

@media (max-width: 999px) {
  .app-frame.view-editor .stage-note-panel {
    left: 10px !important;
    right: 10px !important;
  }
}

/* v195 Songs preview: reliable in-app full-screen, editable metadata footer,
   and a touch-first playlist picker that also works on iPad Safari. */
html.browser-preview-open,
body.browser-preview-open {
  overflow: hidden !important;
}

.browser-preview-shell.preview-expanded {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000;
  width: var(--app-width, 100vw) !important;
  max-width: var(--app-width, 100vw) !important;
  height: var(--app-height, 100dvh) !important;
  min-height: var(--app-height, 100dvh) !important;
  max-height: var(--app-height, 100dvh) !important;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #090b0c;
}

.browser-preview-shell.preview-expanded .browser-preview-toolbar {
  min-height: 64px;
  padding:
    max(8px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    8px
    max(16px, env(safe-area-inset-left));
}

.browser-preview-shell.preview-expanded .browser-chart-area {
  min-height: 0;
  overflow: hidden;
  place-items: center;
  padding: clamp(6px, 1.2vw, 14px);
  background: #111315;
}

.browser-preview-shell.preview-expanded .browser-chart-wrap {
  width: 100%;
  height: 100%;
  overflow: hidden;
  place-items: center;
}

.browser-preview-shell.preview-expanded .browser-chart-wrap .chart-paper.preview-paper {
  width: min(100%, 1180px) !important;
  max-width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-height: 100% !important;
  margin: 0 auto;
  border-radius: 3px;
  padding: clamp(10px, 1.6vh, 18px) clamp(10px, 1.8vw, 22px);
  box-shadow: none;
}

.browser-preview-shell.preview-expanded .chart-paper-header {
  margin-bottom: clamp(6px, 1.2vh, 14px);
}

.browser-preview-shell.preview-expanded .chart-sheet-grid {
  row-gap: clamp(4px, 1vh, 11px);
}

.browser-add-playlist {
  width: auto !important;
  min-width: 52px;
  gap: 8px;
  padding: 0 12px !important;
  color: #00d8ff;
}

.browser-add-playlist span {
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.browser-song-footer {
  gap: 1px;
  padding:
    7px
    max(8px, env(safe-area-inset-right))
    max(7px, env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left));
}

.browser-footer-field {
  min-width: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: 3px;
  border-right: 1px solid rgba(0, 216, 255, 0.13);
  padding: 3px 8px;
}

.browser-footer-field:last-child {
  border-right: 0;
}

.browser-footer-field > span {
  padding: 0;
  color: rgba(180, 237, 246, 0.68);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
}

.browser-footer-field select,
.browser-footer-field input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid rgba(0, 216, 255, 0.27);
  border-radius: 9px;
  outline: 0;
  background: rgba(9, 18, 21, 0.95);
  color: #00d8ff;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  text-align: center;
  text-align-last: center;
}

.browser-footer-field select:focus,
.browser-footer-field input:focus {
  border-color: #00d8ff;
  box-shadow: 0 0 0 2px rgba(0, 216, 255, 0.16);
}

.browser-footer-number {
  grid-template-columns: minmax(58px, 96px) auto;
}

.browser-footer-number > span {
  grid-column: 1 / -1;
}

.browser-footer-number small {
  color: rgba(180, 237, 246, 0.7);
  font-weight: 850;
}

.browser-footer-number input {
  appearance: textfield;
}

.browser-footer-number input::-webkit-inner-spin-button,
.browser-footer-number input::-webkit-outer-spin-button {
  margin: 0;
  opacity: 1;
}

.browser-footer-tonality {
  grid-template-columns: minmax(62px, 0.72fr) minmax(88px, 1.28fr);
}

.browser-footer-tonality > span {
  grid-column: 1 / -1;
}

.browser-playlist-scrim {
  z-index: 1120;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.browser-playlist-picker {
  width: min(520px, 100%);
  max-height: min(680px, calc(var(--app-height, 100dvh) - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(0, 216, 255, 0.52);
  border-radius: 18px;
  background:
    radial-gradient(circle at 16% 0%, rgba(0, 216, 255, 0.17), transparent 36%),
    #080d0f;
  color: #f7fdff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72), 0 0 34px rgba(0, 216, 255, 0.13);
}

.browser-playlist-picker > header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(0, 216, 255, 0.16);
  padding: 12px 14px 12px 18px;
}

.browser-playlist-picker > header span,
.browser-playlist-picker > header strong {
  display: block;
}

.browser-playlist-picker > header span {
  color: #00d8ff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.browser-playlist-picker > header strong {
  margin-top: 4px;
  font-size: 1.16rem;
}

.browser-playlist-picker > header button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 216, 255, 0.32);
  border-radius: 12px;
  background: rgba(0, 216, 255, 0.08);
  color: #eaffff;
}

.browser-playlist-picker-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 9px;
  overflow: auto;
  padding: 14px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.browser-playlist-picker-list > button {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.045);
  color: #f5fbfc;
  text-align: left;
}

.browser-playlist-picker-list > button:not(:disabled):active {
  border-color: #00d8ff;
  background: rgba(0, 216, 255, 0.16);
}

.browser-playlist-picker-list > button.added {
  border-color: rgba(55, 224, 157, 0.28);
  color: #85efc4;
  opacity: 0.74;
}

.browser-playlist-picker-list > button span,
.browser-playlist-picker-list > button strong,
.browser-playlist-picker-list > button small {
  display: block;
  min-width: 0;
}

.browser-playlist-picker-list > button strong,
.browser-playlist-picker-list > button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-playlist-picker-list > button small {
  margin-top: 3px;
  color: rgba(220, 237, 240, 0.64);
}

.browser-playlist-empty {
  min-height: 240px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: rgba(230, 247, 250, 0.66);
  text-align: center;
}

.browser-playlist-empty > svg {
  width: 42px;
  height: 42px;
  color: #00d8ff;
}

.browser-playlist-empty > button {
  min-height: 44px;
  margin-top: 10px;
  border: 1px solid rgba(0, 216, 255, 0.42);
  border-radius: 11px;
  padding: 0 16px;
  background: rgba(0, 216, 255, 0.12);
  color: #eaffff;
  font-weight: 850;
}

@media (max-width: 720px) {
  .browser-add-playlist span {
    display: none;
  }

  .browser-song-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .browser-footer-field:nth-child(2) {
    border-right: 0;
  }
}

/* v195 shared navigation: the focused composer and library browsers use the
   same back/forward history as every tool page. */
.composer-topbar {
  grid-template-columns: minmax(178px, auto) 52px minmax(0, 1fr) 190px;
}

.composer-page-nav {
  min-width: 0;
}

.composer-page-nav button {
  min-width: 78px;
  min-height: 44px;
}

.library-history-nav {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.songs-browser-header .library-history-nav button {
  width: 34px;
  min-width: 34px;
  min-height: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 216, 255, 0.22);
  border-radius: 9px;
  padding: 0;
  background: rgba(0, 216, 255, 0.055);
}

.songs-browser-header .library-history-nav button:disabled {
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.025);
  cursor: default;
}

.songs-browser-header .library-history-nav svg {
  width: 19px;
  height: 19px;
}

@media (max-width: 780px) {
  .composer-topbar {
    grid-template-columns: minmax(144px, auto) 44px minmax(0, 1fr) 132px;
    gap: 5px;
    padding: 0 10px;
  }

  .composer-page-nav {
    gap: 4px;
  }

  .composer-page-nav button {
    min-width: 0;
    min-height: 44px;
    padding: 0 9px;
  }

  .composer-page-nav button span {
    font-size: 0.78rem;
  }

  .composer-right {
    gap: 8px;
  }
}

/* v196 Preparation visual page: live metadata overlay plus non-destructive
   crop, scale and position controls. */
.keyboard-mode-switch {
  flex-wrap: wrap;
}

.preparation-visual-page {
  width: min(1180px, 100%);
  display: grid;
  gap: 14px;
  margin: 0 auto;
}

.preparation-visual-heading {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.preparation-visual-heading span,
.preparation-image-controls header span {
  display: block;
  color: #00d8ff;
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.13em;
}

.preparation-visual-heading h2 {
  margin: 3px 0;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.preparation-visual-heading p {
  margin: 0;
  color: rgba(232, 243, 245, 0.62);
}

.preparation-content-switch {
  display: inline-flex;
  justify-self: start;
  gap: 8px;
  border: 1px solid rgba(0, 216, 255, 0.16);
  border-radius: 12px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.28);
}

.preparation-content-switch button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0 14px;
  background: transparent;
  color: rgba(239, 249, 250, 0.72);
  font-weight: 850;
}

.preparation-content-switch button.active {
  border-color: rgba(0, 216, 255, 0.55);
  background: rgba(0, 216, 255, 0.14);
  color: #fff;
}

.preparation-visual-meta {
  display: grid;
  grid-template-columns: minmax(190px, 1.55fr) minmax(170px, 1.25fr) minmax(90px, 0.55fr) minmax(90px, 0.55fr) minmax(130px, 0.8fr);
  gap: 9px;
  border: 1px solid rgba(0, 216, 255, 0.2);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(0, 216, 255, 0.065), rgba(0, 0, 0, 0.14));
}

.preparation-visual-meta label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.preparation-visual-meta label > span {
  color: rgba(200, 232, 237, 0.68);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preparation-visual-meta input,
.preparation-visual-meta select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  outline: 0;
  padding: 0 11px;
  background: rgba(2, 8, 10, 0.92);
  color: #f5fcfd;
  font: inherit;
  font-weight: 800;
}

.preparation-visual-meta input:focus,
.preparation-visual-meta select:focus {
  border-color: #00d8ff;
  box-shadow: 0 0 0 2px rgba(0, 216, 255, 0.13);
}

.preparation-media-canvas {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.preparation-media-canvas .media-editor-preview {
  width: 100%;
  height: min(68vh, 780px);
  min-height: 480px;
  border-color: rgba(0, 216, 255, 0.28);
  border-radius: 14px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
    #070a0b;
  background-size: 30px 30px;
  touch-action: none;
}

.preparation-media-canvas .media-editor-preview.media-empty {
  background:
    linear-gradient(90deg, rgba(11, 15, 16, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(11, 15, 16, 0.035) 1px, transparent 1px),
    #f8f6ef;
  background-size: 32px 32px;
}

.preparation-media-canvas .media-empty .upload-drop {
  width: min(520px, calc(100% - 36px));
  min-height: 220px;
  border-color: rgba(0, 102, 118, 0.34);
  background: rgba(255, 255, 255, 0.72);
  color: #46565a;
}

.preparation-media-canvas .media-empty .upload-drop strong {
  color: #101516;
}

.preparation-media-canvas .media-editor-preview img {
  transform-origin: center;
  will-change: transform, clip-path;
}

.preparation-media-actions {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.preparation-media-actions > button {
  min-height: 44px;
}

.preparation-media-actions > span {
  min-width: 0;
  overflow: hidden;
  color: rgba(225, 240, 243, 0.58);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preparation-media-canvas .media-title-overlay {
  left: clamp(10px, 2vw, 22px);
  right: clamp(10px, 2vw, 22px);
  min-height: 66px;
  border: 1px solid rgba(0, 216, 255, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(1, 7, 9, 0.82);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.media-overlay-copy,
.media-overlay-stats {
  min-width: 0;
  display: flex;
}

.media-overlay-copy {
  flex-direction: column;
  align-items: flex-start;
}

.media-overlay-copy b,
.media-overlay-copy small {
  max-width: min(58vw, 660px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-overlay-copy b {
  color: #fff;
  font-size: clamp(1rem, 2vw, 1.45rem);
}

.media-overlay-copy small {
  margin-top: 3px;
  color: rgba(229, 244, 247, 0.68);
}

.media-overlay-stats {
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.media-overlay-stats strong {
  border: 1px solid rgba(0, 216, 255, 0.24);
  border-radius: 9px;
  padding: 7px 9px;
  background: rgba(0, 216, 255, 0.08);
  color: #dffbff;
  font-size: 0.84rem;
  white-space: nowrap;
}

.preparation-image-controls {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  padding: 14px;
  background: rgba(5, 9, 11, 0.88);
}

.preparation-image-controls > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preparation-image-controls header strong {
  display: block;
  margin-top: 3px;
}

.preparation-image-controls header button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(0, 216, 255, 0.26);
  border-radius: 10px;
  padding: 0 12px;
  background: rgba(0, 216, 255, 0.06);
  color: #e9fcff;
  font-weight: 800;
}

.media-transform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.preparation-image-controls .crop-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0;
}

.preparation-image-hint {
  display: block;
  color: rgba(222, 238, 240, 0.58);
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .preparation-visual-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preparation-visual-meta label:first-child {
    grid-column: 1 / -1;
  }

  .preparation-media-canvas .media-editor-preview {
    height: min(60vh, 680px);
    min-height: 420px;
  }
}

@media (max-width: 720px) {
  .preparation-visual-heading {
    align-items: flex-start;
  }

  .preparation-visual-heading p {
    display: none;
  }

  .preparation-visual-meta,
  .media-transform-grid,
  .preparation-image-controls .crop-grid {
    grid-template-columns: 1fr;
  }

  .preparation-visual-meta label:first-child {
    grid-column: auto;
  }

  .preparation-media-canvas .media-editor-preview {
    min-height: 360px;
  }

  .preparation-media-canvas .media-title-overlay {
    align-items: flex-start;
  }

  .media-overlay-stats {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
}

/* v198 Metronom performance stage:
   the visual, tempo and transport now read as one large iPad-safe instrument. */
.app-frame.view-metronomeTool .practice-console-card {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(280px, 1fr) auto !important;
  gap: 10px;
}

.app-frame.view-metronomeTool .metronome-performance-stage {
  grid-column: 1 / -1 !important;
  position: relative;
  min-width: 0;
  min-height: 280px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 14px;
  background:
    radial-gradient(circle at 72% 43%, rgba(0, 229, 255, 0.13), transparent 32%),
    linear-gradient(145deg, #11100f, #040708 76%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    inset 0 -60px 80px rgba(0, 0, 0, 0.52),
    0 16px 34px rgba(0, 0, 0, 0.3);
}

.app-frame.view-metronomeTool .metronome-performance-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 38%, rgba(2, 6, 8, 0.22) 51%, rgba(2, 7, 9, 0.78) 78%, rgba(2, 7, 9, 0.94)),
    linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.7));
}

.app-frame.view-metronomeTool .metronome-performance-stage .analog-metronome-device {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #050708;
}

.app-frame.view-metronomeTool .metronome-performance-stage .analog-metronome-frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 62%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  place-items: center;
  overflow: hidden;
}

.app-frame.view-metronomeTool .metronome-performance-stage .analog-metronome-frame img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: 34% 52%;
  transform: scale(1.04);
  filter:
    brightness(0.94)
    contrast(1.08)
    saturate(1.18)
    drop-shadow(0 22px 30px rgba(0, 0, 0, 0.58));
}

.app-frame.view-metronomeTool .metronome-performance-stage .analog-device-status {
  top: 12px;
  left: 12px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 34px;
  padding: 0 11px;
  border-color: rgba(0, 229, 255, 0.24);
  background: rgba(3, 8, 10, 0.74);
  color: #d8faff;
  letter-spacing: 0.08em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-frame.view-metronomeTool .metronome-performance-stage .analog-device-status span {
  flex: 0 0 auto;
}

.app-frame.view-metronomeTool .metronome-performance-stage .analog-pendulum {
  left: 50%;
  top: 12%;
  height: 64%;
}

.app-frame.view-metronomeTool .metronome-performance-stage .analog-pulse-waves {
  right: 8%;
  top: 36%;
}

.app-frame.view-metronomeTool .practice-tempo-orbit {
  position: absolute;
  right: clamp(18px, 3.2vw, 46px);
  top: calc(50% - 30px);
  z-index: 4;
  width: min(clamp(176px, 18vw, 232px), calc(100% - 32px));
  aspect-ratio: 1;
  display: block;
  padding: 28px 26px 20px;
  transform: translateY(-50%);
  border: 2px solid rgba(0, 229, 255, 0.76);
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 36%, rgba(0, 229, 255, 0.24), rgba(0, 34, 41, 0.82) 48%, rgba(1, 5, 7, 0.97) 72%),
    conic-gradient(from 215deg, #006978, #00e5ff, #80fff3, #00a8c6, #006978);
  box-shadow:
    0 0 0 8px rgba(0, 229, 255, 0.055),
    0 0 42px rgba(0, 229, 255, 0.26),
    inset 0 0 28px rgba(0, 229, 255, 0.13);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.app-frame.view-metronomeTool .practice-tempo-orbit::before,
.app-frame.view-metronomeTool .practice-tempo-orbit::after {
  content: "";
  position: absolute;
  inset: 9px;
  z-index: -1;
  border: 1px solid rgba(186, 250, 255, 0.18);
  border-radius: inherit;
}

.app-frame.view-metronomeTool .practice-tempo-orbit::after {
  inset: -12px;
  border-color: rgba(0, 229, 255, 0.08);
}

.app-frame.view-metronomeTool .metronome-performance-stage.is-playing .practice-tempo-orbit {
  border-color: #54ff98;
  background:
    radial-gradient(circle at 45% 36%, rgba(84, 255, 152, 0.31), rgba(0, 73, 44, 0.86) 48%, rgba(1, 9, 6, 0.98) 72%),
    conic-gradient(from 215deg, #08743d, #54ff98, #b6ffd1, #20d977, #08743d);
  box-shadow:
    0 0 0 9px rgba(84, 255, 152, 0.07),
    0 0 52px rgba(84, 255, 152, 0.38),
    inset 0 0 32px rgba(84, 255, 152, 0.16);
}

.app-frame.view-metronomeTool .practice-tempo-orbit .practice-bpm-display {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 14px;
  width: auto !important;
  min-width: 0;
  min-height: 0;
  height: 82px !important;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 60px 18px;
  place-items: center;
  gap: 0 !important;
  padding: 0 !important;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.app-frame.view-metronomeTool .practice-tempo-orbit .practice-bpm-input {
  width: 100% !important;
  max-width: 100% !important;
  height: 60px !important;
  padding: 0 !important;
  color: #efffff;
  font-size: clamp(3rem, 5vw, 4.5rem) !important;
  line-height: 1 !important;
  text-align: center;
  text-shadow:
    0 0 8px rgba(0, 229, 255, 0.78),
    0 0 30px rgba(0, 229, 255, 0.5);
}

.app-frame.view-metronomeTool .metronome-performance-stage.is-playing .practice-bpm-input {
  color: #f3fff8;
  text-shadow:
    0 0 8px rgba(84, 255, 152, 0.86),
    0 0 34px rgba(84, 255, 152, 0.56);
}

.app-frame.view-metronomeTool .practice-tempo-orbit .practice-bpm-display span {
  grid-column: 1;
  grid-row: 2;
  margin: 0 !important;
  color: #9af8ff;
  font-size: 0.82rem;
  letter-spacing: 0.2em;
}

.app-frame.view-metronomeTool .practice-tempo-orbit .practice-bpm-display button {
  position: absolute;
  right: -2px;
  top: -4px;
  width: 32px;
  height: 32px;
  color: #c7f9ff;
}

.app-frame.view-metronomeTool .practice-tempo-orbit .practice-round-btn {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: clamp(56px, 5.3vw, 70px);
  height: clamp(56px, 5.3vw, 70px);
  margin: 0;
  transform: translateX(-50%);
  border-width: 2px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.22), transparent 25%),
    linear-gradient(145deg, rgba(0, 229, 255, 0.62), rgba(0, 94, 109, 0.8));
  box-shadow: 0 0 26px rgba(0, 229, 255, 0.34);
}

.app-frame.view-metronomeTool .practice-tempo-orbit .practice-round-btn.playing {
  border-color: #b8ffd1;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.25), transparent 25%),
    linear-gradient(145deg, rgba(84, 255, 152, 0.8), rgba(10, 109, 61, 0.88));
  box-shadow: 0 0 32px rgba(84, 255, 152, 0.52);
}

.app-frame.view-metronomeTool .practice-tempo-orbit .practice-round-btn:active {
  transform: translateX(-50%) scale(0.96);
}

.app-frame.view-metronomeTool .practice-tempo-orbit .practice-round-btn svg {
  width: 30px;
  height: 30px;
}

.app-frame.view-metronomeTool .practice-performance-toolbar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 5;
  min-width: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 12px;
  background: rgba(2, 8, 10, 0.84);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.app-frame.view-metronomeTool .practice-performance-toolbar .practice-tap-btn,
.app-frame.view-metronomeTool .practice-performance-toolbar .practice-sound-select {
  position: static;
  grid-column: auto;
  grid-row: auto;
  min-width: 0;
  margin: 0;
}

.app-frame.view-metronomeTool .practice-performance-toolbar .practice-tap-btn,
.app-frame.view-metronomeTool .practice-performance-toolbar .practice-sound-select {
  min-height: 42px;
}

.app-frame.view-metronomeTool .practice-console-bottom {
  grid-column: 1 / -1 !important;
  width: 100%;
}

@media (max-height: 700px) and (min-width: 981px) {
  .app-frame.view-metronomeTool .practice-console-card {
    grid-template-rows: minmax(232px, 1fr) auto !important;
  }

  .app-frame.view-metronomeTool .metronome-performance-stage {
    min-height: 232px;
  }

  .app-frame.view-metronomeTool .practice-tempo-orbit {
    right: 18px;
    top: calc(50% - 26px);
    width: min(clamp(164px, 17vw, 196px), calc(100% - 32px));
    padding: 22px 22px 15px;
  }

  .app-frame.view-metronomeTool .practice-tempo-orbit .practice-bpm-input {
    font-size: clamp(2.9rem, 4.8vw, 4.25rem) !important;
  }

  .app-frame.view-metronomeTool .practice-performance-toolbar {
    min-height: 48px;
    padding: 5px 7px;
  }

  .app-frame.view-metronomeTool .practice-performance-toolbar .practice-tap-btn,
  .app-frame.view-metronomeTool .practice-performance-toolbar .practice-sound-select {
    min-height: 38px;
  }
}

@media (max-width: 760px) {
  .app-frame.view-metronomeTool .metronome-performance-stage .analog-metronome-frame {
    width: 100%;
    opacity: 0.64;
  }

  .app-frame.view-metronomeTool .metronome-performance-stage::after {
    background:
      linear-gradient(180deg, rgba(2, 7, 9, 0.08), rgba(2, 7, 9, 0.76)),
      radial-gradient(circle at 50% 42%, transparent, rgba(2, 7, 9, 0.6));
  }

  .app-frame.view-metronomeTool .practice-tempo-orbit {
    right: 50%;
    top: calc(50% - 32px);
    width: min(58vw, 232px);
    transform: translate(50%, -50%);
  }

  .app-frame.view-metronomeTool .practice-performance-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* Landscape piano keeps the full keyboard while preserving universal Back/Forward. */
.app-frame.view-piano .piano-floating-history {
  display: none;
}

@media (orientation: landscape) and (max-width: 1366px) {
  .app-frame.view-piano .piano-floating-history {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    top: max(12px, env(safe-area-inset-top));
    z-index: 1500;
    display: inline-flex;
    width: auto;
    gap: 6px;
    padding: 5px;
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 13px;
    background: rgba(1, 7, 9, 0.74);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42), 0 0 22px rgba(0, 229, 255, 0.1);
    backdrop-filter: blur(13px);
    -webkit-backdrop-filter: blur(13px);
  }

  .app-frame.view-piano .piano-floating-history button {
    width: auto;
    min-width: 48px;
    min-height: 46px;
    padding: 0 12px;
    border-radius: 9px;
    background: rgba(0, 229, 255, 0.06);
  }

  .app-frame.view-piano .piano-floating-history button:disabled {
    opacity: 0.34;
  }
}

/* v198 Home: remove the redundant welcome/search strip and give tools the space. */
.app-frame.view-home .home-dashboard {
  height: 100%;
  min-height: 0;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) !important;
  grid-template-areas: "tools" !important;
  gap: 0 !important;
  overflow: hidden !important;
}

.app-frame.view-home .home-tool-grid {
  grid-area: tools;
  height: 100%;
  min-height: 0;
}

.app-frame.view-home .home-tool-copy h3 {
  font-size: clamp(1.02rem, 1.9vw, 1.24rem) !important;
}

.app-frame.view-home .home-tool-copy p {
  font-size: clamp(0.74rem, 1.12vw, 0.9rem) !important;
  line-height: 1.28;
}

.app-frame.view-home .home-tool-open {
  min-height: 40px;
  height: 40px;
  font-size: 0.92rem;
}

/* iPad preview recovery: never inherit a pinched visualViewport width or a
   narrow library column after the user chooses "Ekrana sığdır". */
html body #app .browser-preview-shell.preview-expanded {
  position: fixed !important;
  inset: 0 !important;
  left: 0 !important;
  top: 0 !important;
  right: auto !important;
  bottom: auto !important;
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  transform: none !important;
  overflow: hidden !important;
}

html body #app .browser-preview-shell.preview-expanded .browser-chart-area,
html body #app .browser-preview-shell.preview-expanded .browser-chart-wrap {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  transform: none !important;
}

html body #app .browser-preview-shell.preview-expanded .browser-chart-area {
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  padding: clamp(6px, 1.25vw, 16px) !important;
}

html body #app .browser-preview-shell.preview-expanded .browser-chart-wrap {
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
}

html body #app .browser-preview-shell.preview-expanded .browser-chart-wrap .chart-paper.preview-paper {
  width: min(calc(100vw - 24px), 1180px) !important;
  min-width: 0 !important;
  max-width: calc(100vw - 24px) !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  margin: 0 auto !important;
  transform: none !important;
  transform-origin: center !important;
}

@supports not (height: 100dvh) {
  html body #app .browser-preview-shell.preview-expanded {
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
  }
}

/* v206 Songs media preview:
   keep metadata controls closed until requested and let the image own the page. */
.browser-preview-shell {
  position: relative;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.browser-song-info {
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(260px, 1.5fr) minmax(150px, 0.9fr);
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(0, 216, 255, 0.16);
  padding: 8px clamp(18px, 2.4vw, 34px);
  background:
    linear-gradient(90deg, rgba(0, 216, 255, 0.055), transparent 24% 76%, rgba(0, 216, 255, 0.045)),
    #07090a;
  color: #f5fbfc;
}

.browser-song-info > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.browser-song-info strong,
.browser-song-info span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-song-info-left {
  justify-self: start;
  text-align: left;
}

.browser-song-info-center {
  justify-self: stretch;
  text-align: center;
}

.browser-song-info-right {
  justify-self: end;
  text-align: right;
}

.browser-song-info-left strong,
.browser-song-info-right strong {
  font-size: 0.94rem;
}

.browser-song-info-left span,
.browser-song-info-right span,
.browser-song-info-center span {
  color: rgba(215, 235, 239, 0.68);
  font-size: 0.78rem;
  font-weight: 750;
}

.browser-song-info-center strong {
  color: #f8fdff;
  font-size: clamp(1.1rem, 2.1vw, 1.55rem);
  letter-spacing: 0.025em;
}

.browser-song-info-left span {
  color: #00d8ff;
  font-weight: 900;
}

.browser-footer-toggle {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 42;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(0, 216, 255, 0.5);
  border-radius: 999px;
  padding: 0 17px;
  background: rgba(3, 12, 15, 0.82);
  color: #dffcff;
  font-weight: 850;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42), 0 0 22px rgba(0, 216, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: bottom 180ms ease, background 180ms ease, border-color 180ms ease;
}

.browser-footer-toggle svg {
  width: 20px;
  height: 20px;
  color: #00d8ff;
}

.browser-footer-toggle.open {
  bottom: calc(98px + env(safe-area-inset-bottom));
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(5, 10, 12, 0.92);
}

.browser-song-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  min-height: 88px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: rgba(0, 4, 6, 0.94);
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.browser-preview-shell.browser-media-preview .browser-chart-area,
html body #app .browser-preview-shell.preview-expanded.browser-media-preview .browser-chart-area {
  place-items: stretch !important;
  overflow: hidden !important;
  padding: 0 !important;
  background: #050607;
}

.browser-preview-shell.browser-media-preview .browser-chart-wrap,
html body #app .browser-preview-shell.preview-expanded.browser-media-preview .browser-chart-wrap {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  place-items: stretch !important;
}

.browser-preview-shell.browser-media-preview .browser-chart-wrap .media-stage,
html body #app .browser-preview-shell.preview-expanded.browser-media-preview .browser-chart-wrap .media-stage {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.browser-preview-shell.browser-media-preview .media-stage img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  background: transparent !important;
}

.preparation-create-playlist {
  border-style: dashed !important;
  border-color: rgba(0, 216, 255, 0.48) !important;
  background: rgba(0, 216, 255, 0.075) !important;
  color: #e8fdff !important;
}

.preparation-create-playlist > svg {
  width: 26px;
  height: 26px;
  color: #00d8ff;
}

.preparation-new-playlist-form {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(0, 216, 255, 0.54);
  border-radius: 13px;
  padding: 12px;
  background: rgba(0, 216, 255, 0.075);
}

.preparation-new-playlist-form label {
  display: grid;
  gap: 6px;
}

.preparation-new-playlist-form label span {
  color: rgba(220, 247, 250, 0.72);
  font-size: 0.76rem;
  font-weight: 850;
}

.preparation-new-playlist-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(0, 216, 255, 0.34);
  border-radius: 10px;
  padding: 0 12px;
  background: rgba(1, 8, 10, 0.9);
  color: #f4fdff;
  font: inherit;
  font-weight: 750;
  outline: 0;
}

.preparation-new-playlist-form input:focus {
  border-color: #00d8ff;
  box-shadow: 0 0 0 3px rgba(0, 216, 255, 0.14);
}

.preparation-new-playlist-form > div {
  display: grid;
  grid-template-columns: minmax(92px, 0.7fr) minmax(150px, 1.3fr);
  gap: 8px;
}

.preparation-new-playlist-form button {
  min-height: 42px !important;
  display: inline-flex !important;
  grid-template-columns: none !important;
  justify-content: center;
  gap: 7px !important;
  padding: 0 12px !important;
  text-align: center !important;
}

.preparation-new-playlist-form button.primary {
  border-color: rgba(0, 216, 255, 0.68);
  background: linear-gradient(180deg, rgba(0, 166, 187, 0.92), rgba(0, 105, 122, 0.94));
}

.new-song-content-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.new-song-content-switch button,
.new-song-media-picker button {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid #283039;
  border-radius: 12px;
  padding: 10px 14px;
  background: #0a0d10;
  color: #eff9fa;
  text-align: left;
}

.new-song-content-switch button.active {
  border-color: rgba(0, 216, 255, 0.76);
  background: linear-gradient(135deg, rgba(0, 216, 255, 0.2), rgba(0, 216, 255, 0.055));
  box-shadow: 0 0 24px rgba(0, 216, 255, 0.11);
}

.new-song-content-switch button > svg,
.new-song-media-picker button > svg {
  width: 28px;
  height: 28px;
  color: #00d8ff;
}

.new-song-content-switch span,
.new-song-media-picker span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 0 !important;
  text-align: left !important;
}

.new-song-content-switch strong,
.new-song-content-switch small,
.new-song-media-picker strong,
.new-song-media-picker small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-song-content-switch strong,
.new-song-media-picker strong {
  color: #f5fdff;
  font-size: 0.98rem;
}

.new-song-content-switch small,
.new-song-media-picker small {
  color: rgba(214, 235, 239, 0.62);
  font-size: 0.75rem;
}

.new-song-media-picker {
  display: grid;
}

.new-song-media-picker button {
  min-height: 92px;
  border-style: dashed;
  border-color: rgba(0, 216, 255, 0.46);
  background: rgba(0, 216, 255, 0.055);
}

@media (max-width: 720px) {
  .browser-song-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .browser-footer-tonality {
    grid-column: 1 / -1;
  }

  .browser-footer-toggle.open {
    bottom: calc(172px + env(safe-area-inset-bottom));
  }

  .browser-song-info {
    min-height: 64px;
    grid-template-columns: minmax(82px, 0.8fr) minmax(130px, 1.4fr) minmax(82px, 0.8fr);
    gap: 8px;
    padding-inline: 10px;
  }

  .new-song-content-switch {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* v206 iPad preview guard:
   selecting a song opens this viewport layer, so the chart can never remain
   trapped in the narrow library split column. */
html.browser-preview-open #app,
body.browser-preview-open #app,
html.browser-preview-open #app > .workspace,
body.browser-preview-open #app > .workspace,
html.browser-preview-open .browser-workspace-main,
body.browser-preview-open .browser-workspace-main {
  transform: none !important;
  filter: none !important;
  perspective: none !important;
  contain: none !important;
}

html.browser-preview-open #app,
body.browser-preview-open #app {
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: 100vw !important;
}

@media (max-width: 820px) {
  .browser-preview-shell:not(.preview-expanded) .browser-preview-toolbar {
    min-height: 64px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
    padding: 6px 8px;
  }

  .browser-preview-shell:not(.preview-expanded) .browser-preview-left,
  .browser-preview-shell:not(.preview-expanded) .browser-preview-right {
    min-width: 0;
    gap: 5px;
  }

  .browser-preview-shell:not(.preview-expanded) .browser-add-playlist {
    min-width: 44px;
    width: 44px !important;
    padding: 0 !important;
  }

  .browser-preview-shell:not(.preview-expanded) .browser-add-playlist span {
    display: none;
  }

  .browser-preview-shell:not(.preview-expanded) .browser-transpose-tools {
    display: grid;
    min-width: 0;
    grid-template-columns: 36px 34px minmax(66px, 92px) 34px 36px;
  }

  .browser-preview-shell:not(.preview-expanded) .transpose-key-label {
    min-width: 0;
    padding-inline: 5px;
  }

  .browser-preview-shell:not(.preview-expanded) .ireal-tool {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .browser-song-info {
    min-height: 62px;
    grid-template-columns: minmax(54px, 0.72fr) minmax(90px, 1.5fr) minmax(54px, 0.72fr);
    gap: 6px;
    padding: 7px 9px;
  }

  .browser-song-info-left strong,
  .browser-song-info-right strong {
    font-size: 0.78rem;
  }

  .browser-song-info-left span,
  .browser-song-info-right span,
  .browser-song-info-center span {
    font-size: 0.66rem;
  }

  .browser-song-info-center strong {
    font-size: clamp(0.88rem, 4vw, 1.12rem);
  }

  .browser-preview-shell.preview-expanded {
    grid-template-rows: auto auto minmax(0, 1fr) !important;
  }

  .browser-preview-shell.preview-expanded .browser-preview-toolbar {
    min-height: 58px;
    padding:
      max(6px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      6px
      max(8px, env(safe-area-inset-left));
  }
}

/* v210 final precedence layer.
   Keep this at EOF so historic device-specific rules cannot reintroduce
   fixed desktop widths after the responsive contract above. */
html,
body,
#app,
.app-frame,
.workspace,
.workspace-main {
  min-width: 0 !important;
  max-width: 100vw !important;
}

html,
body,
#app {
  width: 100% !important;
  overflow-x: hidden !important;
}

.app-frame,
.stage-app-frame,
.composer-frame {
  width: 100vw !important;
}

.app-frame > *,
.workspace > *,
.workspace-main > *,
.browser-workspace-main > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

body > .browser-preview-shell.preview-expanded.browser-preview-portal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  box-sizing: border-box !important;
  width: 100vw !important;
  width: 100dvw !important;
  min-width: 100vw !important;
  min-width: 100dvw !important;
  max-width: 100vw !important;
  max-width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  overflow: hidden !important;
  transform: none !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
}

body > .browser-preview-shell.preview-expanded.browser-preview-portal .browser-preview-toolbar,
body > .browser-preview-shell.preview-expanded.browser-preview-portal .browser-song-info,
body > .browser-preview-shell.preview-expanded.browser-preview-portal .browser-chart-area,
body > .browser-preview-shell.preview-expanded.browser-preview-portal .browser-chart-wrap {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

body > .browser-preview-shell.preview-expanded.browser-preview-portal .browser-chart-wrap .chart-paper.preview-paper {
  width: min(calc(100dvw - (2 * var(--responsive-page-gutter))), 1180px) !important;
  min-width: 0 !important;
  max-width: calc(100dvw - (2 * var(--responsive-page-gutter))) !important;
}

@media (min-width: 760px) and (max-width: 1180px) {
  .home-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 759px) {
  .home-tool-grid,
  .recordings-grid,
  .metronome-detail-grid,
  .stage-song-browser-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* v211 Playlistler: restore the professional master/detail workspace.
   The playlist index remains visible on the left, the selected song fills the
   right pane, and fullscreen is entered only from the expand control. */
@media (min-width: 760px) {
  .app-frame.library-mode-playlists,
  .app-frame.library-mode-playlist {
    grid-template-columns: clamp(270px, 31vw, 360px) minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }

  .app-frame.library-mode-playlists > .library-panel,
  .app-frame.library-mode-playlist > .library-panel {
    display: flex !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: var(--app-height) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .app-frame.library-mode-playlists > .workspace,
  .app-frame.library-mode-playlist > .workspace {
    display: grid !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: var(--app-height) !important;
    overflow: hidden !important;
  }

  .app-frame.library-mode-playlists .browser-workspace-main,
  .app-frame.library-mode-playlist .browser-workspace-main {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100% !important;
    padding: clamp(8px, 1.25vw, 16px) !important;
    overflow: hidden !important;
  }

  .app-frame.library-mode-playlists .browser-preview-shell:not(.preview-expanded),
  .app-frame.library-mode-playlist .browser-preview-shell:not(.preview-expanded) {
    box-sizing: border-box !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100% !important;
    overflow: hidden !important;
  }
}

@media (min-width: 760px) and (max-width: 980px) {
  .app-frame.library-mode-playlists,
  .app-frame.library-mode-playlist {
    grid-template-columns: clamp(248px, 33vw, 310px) minmax(0, 1fr) !important;
  }

  .app-frame.library-mode-playlists .browser-workspace-main,
  .app-frame.library-mode-playlist .browser-workspace-main {
    padding: 8px !important;
  }

  .app-frame.library-mode-playlists .songs-browser-header,
  .app-frame.library-mode-playlist .songs-browser-header {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    gap: 6px !important;
    padding-inline: 8px !important;
  }

  .app-frame.library-mode-playlists .songs-browser-header > strong,
  .app-frame.library-mode-playlist .songs-browser-header > strong {
    min-width: 0;
    overflow: hidden;
    font-size: 1.06rem;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-frame.library-mode-playlists .playlist-edit-trigger,
  .app-frame.library-mode-playlist .library-edit-action {
    width: 42px;
    min-width: 42px;
    overflow: hidden;
    font-size: 0 !important;
  }

  .app-frame.library-mode-playlists .playlist-edit-trigger svg,
  .app-frame.library-mode-playlist .library-edit-action svg {
    width: 23px;
    height: 23px;
  }

  .app-frame.library-mode-playlists .browser-preview-shell:not(.preview-expanded) .browser-preview-toolbar,
  .app-frame.library-mode-playlist .browser-preview-shell:not(.preview-expanded) .browser-preview-toolbar {
    box-sizing: border-box;
    min-width: 0 !important;
    grid-template-columns: auto minmax(34px, 1fr) auto !important;
    gap: 5px !important;
    padding-inline: 6px !important;
  }

  .app-frame.library-mode-playlists .browser-preview-shell:not(.preview-expanded) .browser-preview-left,
  .app-frame.library-mode-playlists .browser-preview-shell:not(.preview-expanded) .browser-preview-right,
  .app-frame.library-mode-playlist .browser-preview-shell:not(.preview-expanded) .browser-preview-left,
  .app-frame.library-mode-playlist .browser-preview-shell:not(.preview-expanded) .browser-preview-right {
    min-width: 0 !important;
    gap: 4px !important;
  }

  .app-frame.library-mode-playlists .browser-preview-shell:not(.preview-expanded) .browser-add-playlist,
  .app-frame.library-mode-playlist .browser-preview-shell:not(.preview-expanded) .browser-add-playlist {
    width: 44px !important;
    min-width: 44px !important;
    padding: 0 !important;
  }

  .app-frame.library-mode-playlists .browser-preview-shell:not(.preview-expanded) .browser-add-playlist span,
  .app-frame.library-mode-playlist .browser-preview-shell:not(.preview-expanded) .browser-add-playlist span {
    display: none !important;
  }

  .app-frame.library-mode-playlists .browser-preview-shell:not(.preview-expanded) .browser-transpose-tools,
  .app-frame.library-mode-playlist .browser-preview-shell:not(.preview-expanded) .browser-transpose-tools {
    min-width: 0 !important;
    grid-template-columns: 36px minmax(78px, 104px) 36px !important;
  }

  .app-frame.library-mode-playlists .browser-preview-shell:not(.preview-expanded) .browser-chart-area,
  .app-frame.library-mode-playlists .browser-preview-shell:not(.preview-expanded) .browser-chart-wrap,
  .app-frame.library-mode-playlist .browser-preview-shell:not(.preview-expanded) .browser-chart-area,
  .app-frame.library-mode-playlist .browser-preview-shell:not(.preview-expanded) .browser-chart-wrap {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .app-frame.library-mode-playlists .browser-preview-shell:not(.preview-expanded) .browser-chart-area,
  .app-frame.library-mode-playlist .browser-preview-shell:not(.preview-expanded) .browser-chart-area {
    padding: 10px 8px !important;
  }

  .app-frame.library-mode-playlists .browser-preview-shell:not(.preview-expanded) .browser-chart-wrap .chart-paper.preview-paper,
  .app-frame.library-mode-playlist .browser-preview-shell:not(.preview-expanded) .browser-chart-wrap .chart-paper.preview-paper {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
}

/* v213 professional preparation editor.
   One predictable chord/notation workspace is used on desktop and iPad.
   The score remains visible above the panel and advanced controls stay folded
   until the musician explicitly needs them. */
.stage-note-panel:not(.collapsed) {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  height: min(52dvh, 520px) !important;
  min-height: 360px !important;
  max-height: calc(100dvh - 112px) !important;
  overflow: hidden !important;
  border-radius: 16px 16px 0 0 !important;
  border-color: rgba(0, 216, 255, 0.5) !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(0, 216, 255, 0.085), transparent 34%),
    rgba(4, 8, 10, 0.985) !important;
  box-shadow:
    0 -24px 64px rgba(0, 0, 0, 0.68),
    0 0 0 1px rgba(0, 216, 255, 0.05),
    0 0 36px rgba(0, 216, 255, 0.1) !important;
}

.stage-note-panel:not(.collapsed) > header {
  position: relative !important;
  top: auto !important;
  z-index: 6;
  min-height: 52px !important;
  border-bottom-color: rgba(255, 255, 255, 0.09) !important;
  padding: 6px 10px 6px 14px !important;
  background: rgba(4, 8, 10, 0.98) !important;
}

.stage-note-panel:not(.collapsed) .stage-tool-switch {
  position: relative !important;
  top: auto !important;
  z-index: 5;
  min-height: 52px;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 7px 12px !important;
  background: rgba(4, 8, 10, 0.98) !important;
}

.stage-note-panel .stage-tool-switch button {
  min-width: 128px;
  min-height: 38px !important;
  justify-content: center;
  border-radius: 10px;
}

.stage-note-panel .stage-tool-switch button.active {
  border-color: rgba(0, 216, 255, 0.76);
  background: linear-gradient(180deg, rgba(0, 216, 255, 0.22), rgba(0, 120, 145, 0.12));
  box-shadow: inset 0 0 0 1px rgba(0, 216, 255, 0.12), 0 0 18px rgba(0, 216, 255, 0.08);
}

.stage-professional-tool {
  min-width: 0;
  min-height: 0;
}

.stage-note-panel .stage-chord-tool,
.stage-note-panel .stage-notation-workspace {
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.stage-note-panel .stage-chord-tool {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px 12px max(12px, env(safe-area-inset-bottom)) !important;
}

.stage-notation-heading small {
  color: #00d8ff;
  font-size: 0.65rem;
  font-weight: 950;
  letter-spacing: 0.11em;
}

.stage-note-panel .stage-chord-entry {
  grid-template-columns: 44px minmax(170px, 1fr) 44px 44px 44px minmax(96px, auto) !important;
  gap: 6px !important;
  margin: 0 !important;
}

.stage-note-panel .stage-chord-entry input {
  min-width: 0;
  min-height: 44px;
  border-color: rgba(0, 216, 255, 0.28);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.58);
  font-size: 1.06rem;
}

.stage-note-panel .stage-chord-entry input:focus {
  border-color: #00d8ff;
  box-shadow: 0 0 0 3px rgba(0, 216, 255, 0.14);
}

.stage-note-panel .stage-chord-entry button {
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 10px;
}

.stage-note-panel .stage-chord-entry button svg,
.stage-measure-nav svg {
  width: 19px;
  height: 19px;
}

.stage-note-panel .stage-chord-entry .stage-measure-nav.next {
  border-color: rgba(0, 216, 255, 0.58);
  background: linear-gradient(180deg, rgba(0, 184, 213, 0.9), rgba(0, 104, 124, 0.96));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.stage-note-panel .stage-measure-nav:disabled {
  opacity: 0.28;
  cursor: default;
}

.stage-core-chord-rows {
  gap: 5px !important;
}

.stage-note-panel .stage-core-chord-rows .keyboard-row {
  min-width: 0;
  grid-template-columns: 68px minmax(0, 1fr) !important;
  gap: 7px;
  border-color: rgba(255, 255, 255, 0.07);
  padding: 4px 6px !important;
  background: rgba(255, 255, 255, 0.018);
}

.stage-note-panel .stage-core-chord-rows .keyboard-row > span {
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 5px 4px;
  text-align: center;
}

.stage-note-panel .stage-core-chord-rows .keyboard-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)) !important;
  gap: 4px !important;
}

.stage-note-panel .stage-core-chord-rows .keyboard-row:has(.extension-key) .keyboard-grid.compact {
  grid-template-columns: repeat(14, minmax(0, 1fr)) !important;
}

.stage-note-panel .stage-core-chord-rows .keyboard-grid.compact button {
  min-height: 38px !important;
  border-radius: 8px;
  font-size: 0.82rem !important;
}

.stage-advanced-tools {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.stage-measure-details {
  border-color: rgba(0, 216, 255, 0.2);
  background: linear-gradient(180deg, rgba(0, 216, 255, 0.04), rgba(255, 255, 255, 0.014));
  animation: stage-measure-details-in 150ms ease-out;
}

@keyframes stage-measure-details-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stage-advanced-tools > summary {
  min-height: 48px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  color: #e9f9fb;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.stage-advanced-tools > summary::-webkit-details-marker {
  display: none;
}

.stage-advanced-tools > summary > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 900;
}

.stage-advanced-tools > summary > span svg {
  width: 17px;
  height: 17px;
  color: #00d8ff;
}

.stage-advanced-tools > summary > small {
  min-width: 0;
  overflow: hidden;
  color: rgba(220, 235, 238, 0.48);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-advanced-tools > summary > svg {
  width: 18px;
  height: 18px;
  transition: transform 160ms ease;
}

.stage-advanced-tools[open] > summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stage-advanced-tools[open] > summary > svg {
  transform: rotate(180deg);
}

.stage-advanced-tools > .keyboard-rows {
  padding: 8px;
}

.stage-measure-management {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 8px;
}

.stage-measure-management button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #3b4046;
  border-radius: 9px;
  padding: 0 12px;
  background: #151a1d;
  color: #eaf7f8;
  font-weight: 850;
}

.stage-measure-management .remove-measure-key {
  border-color: rgba(255, 90, 84, 0.42);
  color: #ffd9d6;
}

.stage-measure-management .add-measure-key {
  border-color: rgba(0, 216, 255, 0.42);
  color: #dffcff;
}

.stage-measure-management svg {
  width: 17px;
  height: 17px;
}

.stage-notation-workspace {
  display: grid;
  grid-template-rows: auto minmax(190px, 1fr) auto;
  align-content: stretch;
  gap: 8px;
  padding: 10px 12px max(14px, env(safe-area-inset-bottom));
}

.stage-notation-toolbar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0, 216, 255, 0.16);
  border-radius: 11px;
  padding: 7px 9px 7px 12px;
  background: rgba(0, 216, 255, 0.045);
}

.stage-notation-heading {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.stage-notation-heading strong {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: rgba(241, 251, 252, 0.86);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-notation-heading strong svg {
  width: 16px;
  height: 16px;
  color: #00d8ff;
}

.stage-notation-toolbar .notation-tool-row {
  flex-wrap: nowrap;
}

.stage-notation-toolbar .notation-tool-row > span {
  width: auto;
}

.stage-notation-toolbar button {
  min-height: 38px !important;
  border-radius: 9px !important;
}

.stage-notation-workspace .stage-staff-pad {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(170px, 1fr);
  padding: 0 !important;
}

.stage-notation-workspace .stage-staff-title {
  min-height: 38px;
  color: rgba(231, 245, 247, 0.66);
}

.stage-notation-workspace .stage-staff-title > span {
  justify-self: center;
}

.stage-notation-workspace .stage-staff-title b {
  color: #fff;
}

.stage-notation-workspace .stage-measure-nav {
  min-width: 44px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(0, 216, 255, 0.32);
  border-radius: 9px;
  padding: 0 10px;
  background: rgba(0, 216, 255, 0.07);
  color: #e9fdff;
  font-weight: 850;
}

.stage-notation-workspace .stage-staff-surface {
  min-height: 170px;
  height: 100% !important;
  max-height: 300px;
  border-radius: 11px;
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.staff-touch-hint {
  position: absolute;
  right: 16px;
  top: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(12, 31, 34, 0.34);
  font-size: 0.72rem;
  font-weight: 850;
  pointer-events: none;
}

.staff-touch-hint svg {
  width: 16px;
  height: 16px;
}

.notation-advanced .stage-note-chips {
  padding: 8px !important;
}

.notation-danger-row {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 8px;
}

@media (min-width: 1000px) {
  .stage-note-panel:not(.collapsed) {
    left: calc(clamp(268px, 23vw, 300px) + 16px) !important;
    right: auto !important;
    width: min(1180px, calc(100vw - clamp(268px, 23vw, 300px) - 32px)) !important;
    max-width: calc(100vw - clamp(268px, 23vw, 300px) - 32px) !important;
  }
}

@media (max-width: 1366px) {
  .app-frame.view-editor .stage-note-panel:not(.collapsed) {
    height: min(52dvh, 520px) !important;
    min-height: 350px !important;
  }
}

@media (max-width: 999px) {
  .app-frame.view-editor .stage-note-panel:not(.collapsed) {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    height: min(52dvh, 520px) !important;
    min-height: 350px !important;
  }

  .stage-note-panel .stage-core-chord-rows .keyboard-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  .app-frame.view-editor .stage-note-panel:not(.collapsed) {
    min-height: 330px !important;
  }

  .stage-note-panel .stage-tool-switch button {
    min-width: 0;
    flex: 1 1 0;
  }

  .stage-note-panel .stage-chord-entry {
    grid-template-columns: 42px minmax(118px, 1fr) 42px 42px 42px 48px !important;
  }

  .stage-note-panel .stage-chord-entry .stage-measure-nav.next span {
    display: none;
  }

  .stage-notation-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .stage-notation-heading {
    grid-column: 1 / -1;
  }

  .stage-advanced-tools > summary > small {
    display: none;
  }
}

@media (max-height: 800px) and (min-width: 640px) {
  .app-frame.view-editor .stage-note-panel:not(.collapsed) {
    height: min(65dvh, 500px) !important;
    min-height: 340px !important;
  }
}

/* v218 balanced chart engraving and piano idle state.
   Chord roots keep one optical size across measures; only qualities, bass notes
   and navigation signs stay small. A notation-only staff is vertically centered,
   while a staff sharing the measure with chords keeps its lower engraving lane. */
.chart-measure,
.chart-measure.chord-density-tight,
.chart-measure.chord-density-dense,
.chart-measure.chord-density-packed,
.chart-measure.notation-with-chords,
.chart-measure.notation-with-chords.chord-density-tight,
.chart-measure.notation-with-chords.chord-density-dense,
.chart-measure.notation-with-chords.chord-density-packed {
  --measure-chord-size: 2.2rem;
  --measure-chord-mark-size: 0.72rem;
  --measure-mark-size: 1.42rem;
  --measure-text-sign-size: 0.7rem;
}

.stage-paper .chart-measure,
.stage-paper .chart-measure.chord-density-tight,
.stage-paper .chart-measure.chord-density-dense,
.stage-paper .chart-measure.chord-density-packed,
.stage-paper .chart-measure.notation-with-chords,
.stage-paper .chart-measure.notation-with-chords.chord-density-tight,
.stage-paper .chart-measure.notation-with-chords.chord-density-dense,
.stage-paper .chart-measure.notation-with-chords.chord-density-packed {
  --measure-chord-size: 2.38rem;
  --measure-chord-mark-size: 0.78rem;
  --measure-mark-size: 1.5rem;
  --measure-text-sign-size: 0.74rem;
}

.sheet-chords .chord-root,
.stage-paper .chart-measure .sheet-chords .chord-root {
  font-size: var(--measure-chord-size) !important;
  font-weight: 650;
  line-height: 0.92;
}

.sheet-chords .chord-quality,
.sheet-chords .chord-bass,
.stage-paper .chart-measure .sheet-chords .chord-quality,
.stage-paper .chart-measure .sheet-chords .chord-bass {
  font-size: var(--measure-chord-mark-size) !important;
  font-weight: 850;
  line-height: 1;
}

.sheet-chords .chord-quality {
  align-self: flex-end;
  margin-left: 0.08em;
  padding-bottom: 0.12em;
}

.sheet-chords .chord-bass {
  margin-left: 0.08em !important;
}

.sheet-chords .accidental {
  font-size: 0.44em;
  margin-left: 0.02em;
  vertical-align: 0.72em;
}

.sheet-chords .chart-sign-symbol,
.sheet-chords .repeat-symbol,
.sheet-chords .double-bar {
  font-size: var(--measure-mark-size) !important;
  opacity: 0.86;
}

.sheet-chords .chart-text-sign {
  font-size: var(--measure-text-sign-size) !important;
  opacity: 0.82;
}

.chart-measure.notation-only .measure-notation-staff {
  top: 50% !important;
  bottom: auto !important;
  height: min(72%, 82px) !important;
  min-height: 72px !important;
  transform: translateY(-50%);
}

.stage-paper .chart-measure.notation-only .measure-notation-staff {
  top: 50% !important;
  bottom: auto !important;
  height: min(74%, 96px) !important;
  min-height: 82px !important;
  transform: translateY(-50%);
}

.chart-measure.notation-with-chords .measure-notation-staff,
.stage-paper .chart-measure.notation-with-chords .measure-notation-staff {
  top: auto !important;
  bottom: 8px !important;
  height: 50px !important;
  min-height: 50px !important;
  transform: none;
}

.piano-active-notes > em {
  color: rgba(226, 249, 252, 0.52);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* v219 fixed-size iReal-style chords and readable shared staff.
   Chord roots and qualities never shrink to fit. Dense measures gain another
   engraving row, while notation receives a full readable lane directly below
   the chord row. */
.chart-measure,
.chart-measure.chord-density-tight,
.chart-measure.chord-density-dense,
.chart-measure.chord-density-packed,
.chart-measure.notation-with-chords,
.chart-measure.notation-with-chords.chord-density-tight,
.chart-measure.notation-with-chords.chord-density-dense,
.chart-measure.notation-with-chords.chord-density-packed {
  --measure-chord-size: 2.46rem;
  --measure-chord-mark-size: 0.94rem;
  --measure-mark-size: 1.54rem;
  --measure-text-sign-size: 0.78rem;
}

.stage-paper .chart-measure,
.stage-paper .chart-measure.chord-density-tight,
.stage-paper .chart-measure.chord-density-dense,
.stage-paper .chart-measure.chord-density-packed,
.stage-paper .chart-measure.notation-with-chords,
.stage-paper .chart-measure.notation-with-chords.chord-density-tight,
.stage-paper .chart-measure.notation-with-chords.chord-density-dense,
.stage-paper .chart-measure.notation-with-chords.chord-density-packed {
  --measure-chord-size: 2.64rem;
  --measure-chord-mark-size: 1.02rem;
  --measure-mark-size: 1.64rem;
  --measure-text-sign-size: 0.82rem;
}

.sheet-chords > .chord-symbol,
.sheet-chords > .repeat-symbol,
.sheet-chords > .double-bar {
  transform: none !important;
}

.sheet-chords .chord-root,
.stage-paper .chart-measure .sheet-chords .chord-root {
  flex: 0 0 auto;
  font-size: var(--measure-chord-size) !important;
  font-weight: 680;
  line-height: 0.9;
}

.sheet-chords .chord-quality,
.sheet-chords .chord-bass,
.stage-paper .chart-measure .sheet-chords .chord-quality,
.stage-paper .chart-measure .sheet-chords .chord-bass {
  flex: 0 0 auto;
  font-size: var(--measure-chord-mark-size) !important;
  font-weight: 900;
  line-height: 0.95;
}

.sheet-chords .chord-quality {
  margin-left: 0.09em;
  padding-bottom: 0.13em;
}

.sheet-chords .chord-bass {
  margin-left: 0.1em !important;
}

.sheet-chords .accidental {
  font-size: 0.5em;
  margin-left: 0.02em;
  vertical-align: 0.68em;
}

.chart-measure.chord-density-dense .sheet-chords,
.chart-measure.chord-density-packed .sheet-chords {
  grid-auto-flow: row;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-columns: unset;
  align-content: center;
  row-gap: 5px !important;
}

.chart-measure.notation-only {
  min-height: 148px;
}

.stage-paper .chart-measure.notation-only {
  min-height: 166px;
}

.chart-measure.notation-only .measure-notation-staff {
  left: 9px;
  right: 7px;
  top: 50% !important;
  bottom: auto !important;
  height: min(80%, 102px) !important;
  min-height: 94px !important;
  transform: translateY(-50%);
}

.stage-paper .chart-measure.notation-only .measure-notation-staff {
  left: 9px;
  right: 7px;
  top: 50% !important;
  bottom: auto !important;
  height: min(82%, 116px) !important;
  min-height: 106px !important;
  transform: translateY(-50%);
}

.chart-measure.notation-with-chords,
.chart-measure.notation-with-chords.has-details {
  min-height: 174px;
  padding: 8px 8px 98px 12px;
}

.stage-paper .chart-measure.notation-with-chords,
.stage-paper .chart-measure.notation-with-chords.has-details {
  min-height: 190px;
  padding: 8px 8px 106px 12px;
}

.chart-measure.notation-with-chords .sheet-chords,
.stage-paper .chart-measure.notation-with-chords .sheet-chords,
.stage-paper .chart-measure.chord-density-tight.has-notation .sheet-chords,
.stage-paper .chart-measure.chord-density-dense.has-notation .sheet-chords,
.stage-paper .chart-measure.chord-density-packed.has-notation .sheet-chords {
  position: absolute;
  left: 10px;
  right: 8px;
  top: auto;
  bottom: 96px;
  width: auto;
  max-width: none;
  min-height: 50px;
  padding: 0;
  transform: none;
}

.stage-paper .chart-measure.notation-with-chords .sheet-chords,
.stage-paper .chart-measure.chord-density-tight.has-notation .sheet-chords,
.stage-paper .chart-measure.chord-density-dense.has-notation .sheet-chords,
.stage-paper .chart-measure.chord-density-packed.has-notation .sheet-chords {
  bottom: 104px;
}

.chart-measure.notation-with-chords .measure-notation-staff,
.chart-measure.notation-with-chords.has-details .measure-notation-staff {
  left: 9px;
  right: 7px;
  bottom: 8px !important;
  height: 84px !important;
  min-height: 84px !important;
  transform: none;
}

.stage-paper .chart-measure.notation-with-chords .measure-notation-staff,
.stage-paper .chart-measure.notation-with-chords.has-details .measure-notation-staff {
  left: 9px;
  right: 7px;
  bottom: 8px !important;
  height: 92px !important;
  min-height: 92px !important;
  transform: none;
}

.chart-measure.notation-with-chords.has-details .sheet-details {
  left: 14px;
  right: 12px;
  top: 5px;
  bottom: auto;
  max-height: 18px;
}

.chart-measure.notation-with-chords .measure-notation-staff.clean-active .mini-clef {
  left: 6px;
  font-size: 2.7rem;
}

.chart-measure.notation-with-chords .measure-notation-staff.clean-active .staff-line {
  left: 42px;
  height: 1.7px;
}

.chart-measure.notation-with-chords .measure-notation-staff.clean-active .engraved-notation {
  left: 46px;
}

.chart-measure.notation-with-chords .measure-notation-staff.clean-active .engraved-note {
  transform: translate(-50%, -50%) scale(1.22);
}

.chart-measure.notation-with-chords .measure-notation-staff.clean-active .engraved-stem {
  height: 38px;
}

.chart-measure.notation-with-chords .measure-notation-staff.ink-active .staff-line {
  height: 1.7px;
}

@media (max-width: 760px) {
  .chart-measure,
  .chart-measure.chord-density-tight,
  .chart-measure.chord-density-dense,
  .chart-measure.chord-density-packed,
  .chart-measure.notation-with-chords,
  .chart-measure.notation-with-chords.chord-density-tight,
  .chart-measure.notation-with-chords.chord-density-dense,
  .chart-measure.notation-with-chords.chord-density-packed,
  .stage-paper .chart-measure,
  .stage-paper .chart-measure.chord-density-tight,
  .stage-paper .chart-measure.chord-density-dense,
  .stage-paper .chart-measure.chord-density-packed,
  .stage-paper .chart-measure.notation-with-chords,
  .stage-paper .chart-measure.notation-with-chords.chord-density-tight,
  .stage-paper .chart-measure.notation-with-chords.chord-density-dense,
  .stage-paper .chart-measure.notation-with-chords.chord-density-packed {
    --measure-chord-size: 2.36rem;
    --measure-chord-mark-size: 0.92rem;
  }
}

/* Keep the v219 advanced controls above older component defaults in cascade. */
.stage-note-panel .stage-tool-switch .advanced-tools-trigger {
  min-width: 164px;
  margin-left: 0;
}

.stage-advanced-tools > summary {
  min-height: 54px;
  border-radius: 10px;
  background: rgba(0, 216, 255, 0.045);
}

.stage-advanced-tools[open] > summary {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(6, 13, 16, 0.98);
}

@media (max-width: 760px) {
  .stage-note-panel .stage-tool-switch .advanced-tools-trigger {
    min-width: 0;
    margin-left: 0;
  }
}

/* v220 preparation-sheet track sizing.
   The generic preview sheet compresses all four rows to the available height.
   That is useful in the read-only browser, but it made a large chord row and a
   readable staff escape above a 106px editor measure on iPad. The preparation
   editor owns its vertical scroll area, so give each row a professional minimum
   and let notation rows expand without shrinking or clipping their contents. */
.prep-stage-editor .chart-paper.preview-paper {
  height: auto;
  min-height: 100%;
  grid-template-rows: auto auto;
}

.prep-stage-editor .chart-paper.preview-paper .chart-sheet-grid {
  min-height: 0;
  grid-auto-rows: minmax(128px, auto);
}

.prep-stage-editor .chart-paper.preview-paper .chart-measure {
  min-height: 128px;
}

.prep-stage-editor .chart-paper.preview-paper .chart-measure.notation-only {
  min-height: 148px;
}

.prep-stage-editor .chart-paper.preview-paper .chart-measure.notation-with-chords {
  min-height: 174px;
}

.prep-stage-editor .chart-paper.preview-paper .chart-measure.notation-with-chords.has-details {
  min-height: 208px;
}

.prep-stage-editor .chart-measure.notation-with-chords.has-details .sheet-details {
  top: 6px;
  max-height: 34px;
  overflow: hidden;
}

/* v225 stable iPad chord panel.
   The chord workspace is a fixed bottom sheet: it cannot be accidentally
   dragged or resized, and touch input is delivered directly to its controls. */
.stage-note-panel,
.stage-note-panel:not(.collapsed) {
  border-radius: 16px 16px 0 0 !important;
  isolation: isolate;
}

.stage-note-panel > header {
  cursor: default !important;
  touch-action: manipulation !important;
}

.stage-note-panel button,
.stage-note-panel input,
.stage-note-panel summary {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 216, 255, 0.16);
}

.stage-note-panel .stage-chord-tool,
.stage-note-panel .stage-notation-workspace {
  pointer-events: auto;
}

.app-frame.view-editor .stage-note-panel.notation-expanded:not(.collapsed),
.stage-note-panel.notation-expanded:not(.collapsed) {
  left: max(8px, env(safe-area-inset-left)) !important;
  right: max(8px, env(safe-area-inset-right)) !important;
  top: max(8px, env(safe-area-inset-top)) !important;
  bottom: max(8px, env(safe-area-inset-bottom)) !important;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: 16px !important;
  z-index: 140 !important;
}

.stage-note-panel.notation-expanded .stage-notation-workspace {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  overflow: auto;
}

.stage-note-panel.notation-expanded .stage-staff-pad {
  min-height: clamp(330px, 60dvh, 610px);
  grid-template-rows: auto minmax(290px, 1fr);
}

.stage-note-panel.notation-expanded .stage-staff-surface {
  min-height: 290px;
  max-height: none;
}

.stage-note-panel.notation-expanded .notation-advanced {
  display: none;
}

/* v230 compact chord workspace.
   Akor Yaz follows its real content height instead of reserving an empty black
   half-panel. Measure details can still grow and scroll inside the viewport. */
.app-frame.view-editor .stage-note-panel.stage-tool-chord:not(.collapsed),
.stage-note-panel.stage-tool-chord:not(.collapsed) {
  height: auto !important;
  min-height: 0 !important;
  max-height: calc(100dvh - max(16px, env(safe-area-inset-top))) !important;
  grid-template-rows: auto auto minmax(0, auto) !important;
}

.stage-note-panel.stage-tool-chord .stage-chord-tool {
  max-height: calc(100dvh - 128px - max(12px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)));
  overflow-x: hidden;
  overflow-y: auto;
}

.app-frame.view-editor .stage-note-panel.stage-tool-chord:has(.stage-measure-details):not(.collapsed),
.stage-note-panel.stage-tool-chord:has(.stage-measure-details):not(.collapsed) {
  height: min(78dvh, 780px) !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
}

.stage-note-panel.stage-tool-chord:not(:has(.stage-measure-details)) .stage-chord-tool {
  scrollbar-gutter: auto;
}

/* v235 measure details below the chord keyboard.
   Opening Bölüm/Sus/İşaret no longer interrupts the root, quality, extension
   and slash-bass writing sequence; the optional details tray follows it. */
.stage-note-panel .stage-core-chord-rows + .stage-measure-details {
  margin-top: 4px;
}

@media (max-width: 600px) {
  .prep-stage-editor .chart-paper.preview-paper .chart-sheet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prep-stage-editor .chart-paper.preview-paper .chart-measure {
    border-right: 0;
    padding-left: 6px;
    padding-right: 4px;
  }

  .prep-stage-editor .chart-paper.preview-paper .chart-measure:nth-child(2n) {
    border-right: 3px solid #0d0e0d;
  }

  .prep-stage-editor .chart-measure.chord-density-dense .sheet-chords,
  .prep-stage-editor .chart-measure.chord-density-packed .sheet-chords {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prep-stage-editor .chart-paper.preview-paper .chart-measure.chord-density-dense,
  .prep-stage-editor .chart-paper.preview-paper .chart-measure.chord-density-packed {
    min-height: 154px;
  }

  .prep-stage-editor .chart-paper.preview-paper .chart-measure.notation-with-chords.chord-density-dense,
  .prep-stage-editor .chart-paper.preview-paper .chart-measure.notation-with-chords.chord-density-packed {
    min-height: 220px;
  }

  .prep-stage-editor .chart-paper.preview-paper .chart-measure.notation-with-chords.has-details.chord-density-dense,
  .prep-stage-editor .chart-paper.preview-paper .chart-measure.notation-with-chords.has-details.chord-density-packed {
    min-height: 254px;
  }

  .prep-stage-editor .chart-measure.notation-with-chords .sheet-chords {
    left: 4px;
    right: 3px;
  }

  .prep-stage-editor .chart-measure.notation-with-chords .measure-notation-staff {
    left: 4px;
    right: 3px;
  }
}

/* v234 dedicated preparation workspace.
   Hazırlık is a full-width work page instead of a sidebar screen. Its chord
   and notation editor belongs to the document flow, so it can never cover the
   score or extend beyond the workspace on iPad and desktop. */
.app-frame.preparation-workspace {
  grid-template-columns: minmax(0, 1fr) !important;
}

.app-frame.preparation-workspace > .preparation-workspace-shell {
  grid-column: 1;
  width: 100%;
  min-width: 0;
}

.preparation-workspace .topbar {
  padding-inline:
    max(var(--responsive-page-gutter), env(safe-area-inset-left))
    max(var(--responsive-page-gutter), env(safe-area-inset-right));
}

.preparation-workspace-main {
  overflow-x: hidden;
  overflow-y: auto;
  padding:
    clamp(12px, 1.5vw, 20px)
    max(var(--responsive-page-gutter), env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(var(--responsive-page-gutter), env(safe-area-inset-left));
}

.preparation-workspace .prep-stage-editor.chart-mode {
  width: min(1480px, 100%);
  min-height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
}

.app-frame.view-editor .prep-stage-editor.chart-mode .chart-scroll {
  height: clamp(260px, 44dvh, 540px);
  min-height: clamp(260px, 44dvh, 540px);
  max-height: clamp(260px, 44dvh, 540px);
  padding: clamp(10px, 1.4vw, 20px);
}

.preparation-workspace .prep-stage-editor.chart-mode .chart-paper {
  width: min(1180px, 100%);
}

.app-frame.preparation-workspace .preparation-note-panel:not(.notation-expanded) {
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  z-index: 20;
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0;
  scroll-margin-block: 8px;
  border-radius: 16px !important;
}

.app-frame.preparation-workspace .preparation-note-panel.editor-tool-visible:not(.notation-expanded) {
  visibility: visible;
  opacity: 1;
}

.app-frame.preparation-workspace .preparation-note-panel.stage-tool-chord:not(.collapsed):not(.notation-expanded) {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

.app-frame.preparation-workspace .preparation-note-panel.stage-tool-chord:has(.stage-measure-details):not(.collapsed):not(.notation-expanded) {
  height: clamp(430px, 56dvh, 680px) !important;
  max-height: none !important;
}

.app-frame.preparation-workspace .preparation-note-panel.stage-tool-notation:not(.collapsed):not(.notation-expanded) {
  height: min(430px, calc(100dvh - 120px)) !important;
  min-height: min(390px, calc(100dvh - 120px)) !important;
  max-height: none !important;
}

.app-frame.preparation-workspace .preparation-note-panel:not(.notation-expanded) > header {
  position: relative !important;
  top: auto !important;
  border-radius: 16px 16px 0 0;
}

.app-frame.preparation-workspace .preparation-note-panel:not(.notation-expanded) .stage-tool-switch {
  position: relative !important;
  top: auto !important;
}

@media (orientation: landscape) and (max-height: 820px) {
  .preparation-workspace .prep-stage-editor.chart-mode .chart-scroll {
    height: clamp(240px, 39dvh, 320px);
    min-height: clamp(240px, 39dvh, 320px);
    max-height: clamp(240px, 39dvh, 320px);
  }

  .app-frame.preparation-workspace .preparation-note-panel.stage-tool-notation:not(.collapsed):not(.notation-expanded) {
    height: min(410px, calc(100dvh - 112px)) !important;
    min-height: min(360px, calc(100dvh - 112px)) !important;
  }
}

@media (max-width: 760px) {
  .preparation-workspace .prep-stage-editor.chart-mode {
    gap: 9px;
  }

  .preparation-workspace .prep-stage-editor.chart-mode .chart-scroll {
    padding: 8px;
  }

  .app-frame.preparation-workspace .preparation-note-panel:not(.notation-expanded) {
    border-radius: 14px !important;
  }

  .app-frame.preparation-workspace .preparation-note-panel.stage-tool-notation:not(.collapsed):not(.notation-expanded) {
    height: min(430px, calc(100dvh - 112px)) !important;
    min-height: min(380px, calc(100dvh - 112px)) !important;
  }
}

/* v248 physical iPad WebKit touch surface.
   A nested momentum-scroller can keep an invisible compositing layer above
   later siblings on iPadOS. Give the preparation tools their own explicit
   layer and keep the chart scroller below it. */
.preparation-workspace-main {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.app-frame.view-editor .prep-stage-editor.chart-mode .chart-scroll {
  position: relative;
  z-index: 1;
  -webkit-overflow-scrolling: auto;
  transform: none !important;
}

.app-frame.view-editor .chord-keyboard {
  position: relative !important;
  z-index: 80 !important;
  isolation: isolate;
  overflow: visible !important;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  pointer-events: auto !important;
}

.app-frame.view-editor .keyboard-mode-switch,
.app-frame.view-editor .chord-entry-strip,
.app-frame.view-editor .stage-note-panel,
.app-frame.view-editor .stage-tool-switch {
  position: relative;
  z-index: 2;
  pointer-events: auto !important;
}

.app-frame.view-editor .chord-keyboard button,
.app-frame.view-editor .stage-note-panel button {
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: rgba(0, 216, 255, 0.2);
}

.preparation-workspace .stage-ink-canvas {
  pointer-events: auto !important;
  -webkit-user-select: none;
  user-select: none;
}

/* v236 continuous white preparation sheet.
   The preview paper used to keep only the first measure row inside its grid
   height. Additional rows overflowed onto the dark chart scroller even though
   the measures were valid. Let the preparation paper follow the full measure
   grid so every added measure remains on the white score page. */
.preparation-workspace .prep-stage-editor.chart-mode .chart-paper.preview-paper {
  display: block;
  height: max-content;
  min-height: 100%;
}

.preparation-workspace .prep-stage-editor.chart-mode .chart-paper.preview-paper .chart-sheet-grid {
  min-height: 0;
  height: auto;
  background: #fbfaf4;
}

/* v240 iPad 7 measure-details touch targets.
   The optional details tray is opened during chord entry, so its trigger and
   first-level controls keep a full 44px touch target on coarse pointers. */
@media (pointer: coarse), (max-width: 1180px) {
  .stage-note-panel .stage-tool-switch button,
  .stage-note-panel .stage-tool-switch .advanced-tools-trigger {
    min-height: 44px !important;
  }

  .stage-note-panel .stage-measure-details button {
    min-height: 44px;
  }
}

/* v241 direct iPad preparation controls.
   Safari can cancel the synthetic click after a finger or Pencil pointer
   sequence inside a nested scroll area. Keep every preparation editor control
   above decorative layers and give it a direct, full-size touch surface. */
@media (pointer: coarse), (max-width: 1180px) {
  .preparation-workspace .chord-keyboard,
  .preparation-workspace .keyboard-mode-switch,
  .preparation-workspace .stage-note-panel,
  .preparation-workspace .stage-tool-switch {
    position: relative;
    pointer-events: auto !important;
  }

  .preparation-workspace .keyboard-mode-switch button,
  .preparation-workspace .stage-note-panel button {
    position: relative;
    z-index: 2;
    min-height: 48px !important;
    pointer-events: auto !important;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
  }
}

/* v242 single-dispatch iPad preparation controls.
   Pointerdown now owns finger/Pencil activation, so WebKit cannot replay the
   same control after the preparation panel has rendered a replacement node. */

/* v242 compact style picker.
   Keep style categories readable without turning the song form into a
   full-screen wall of oversized controls. */
.new-song-modal {
  min-height: 0;
  max-height: min(88vh, 760px);
}

.new-song-form {
  gap: 9px;
  padding: 18px;
}

.new-song-form label {
  min-height: 54px;
  grid-template-columns: 104px minmax(0, 1fr);
  padding: 0 14px;
}

.new-song-form span {
  padding-right: 14px;
  font-size: 0.86rem;
}

.new-song-form input,
.new-song-form select {
  font-size: 1.02rem;
}

.new-song-form #new-song-style-bank > .style-bank {
  max-height: clamp(220px, 32vh, 300px);
  overflow-y: auto;
  overscroll-behavior: contain;
  gap: 9px;
  padding: 11px;
}

.new-song-form #new-song-style-bank > .style-bank .style-group {
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.new-song-form #new-song-style-bank > .style-bank .style-group > strong {
  padding: 8px 0 0 2px;
  font-size: 0.7rem;
  line-height: 1.2;
}

.new-song-form #new-song-style-bank > .style-bank .style-pill-grid {
  gap: 6px;
}

.new-song-form #new-song-style-bank > .style-bank .style-pill {
  min-height: 32px;
  border-radius: 7px;
  padding: 0 10px;
  font-size: 0.8rem;
  line-height: 1;
}

@media (max-width: 700px) {
  .new-song-form #new-song-style-bank > .style-bank .style-group {
    grid-template-columns: 1fr;
  }

  .new-song-form #new-song-style-bank > .style-bank .style-group > strong {
    padding-top: 0;
  }
}

/* v249 iPadOS 16 legacy WebKit editor path.
   The v224 editor worked before the dedicated preparation workspace added
   nested momentum scrollers. Safari 16.3 can retain one of those scrollers as
   the hit-test surface above later controls. On the affected iPad generation,
   use the document as the only vertical scroller and keep editor controls in a
   plain, non-composited layer. */
html.legacy-ipados-webkit,
html.legacy-ipados-webkit body,
html.legacy-ipados-webkit #app {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: auto !important;
}

html.legacy-ipados-webkit .app-frame.preparation-workspace {
  height: auto !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  overflow: visible !important;
}

html.legacy-ipados-webkit .preparation-workspace-shell {
  height: auto !important;
  max-height: none !important;
  grid-template-rows: auto auto !important;
  overflow: visible !important;
}

html.legacy-ipados-webkit .preparation-workspace-main {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  overscroll-behavior: auto !important;
  -webkit-overflow-scrolling: auto !important;
}

html.legacy-ipados-webkit .preparation-workspace .prep-stage-editor.chart-mode .chart-scroll {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  contain: none !important;
  isolation: auto !important;
  -webkit-overflow-scrolling: auto !important;
  -webkit-transform: none !important;
  transform: none !important;
}

html.legacy-ipados-webkit .app-frame.view-editor .chord-keyboard,
html.legacy-ipados-webkit .app-frame.view-editor .stage-note-panel,
html.legacy-ipados-webkit .composer-frame .chord-keyboard,
html.legacy-ipados-webkit .composer-frame .stage-note-panel {
  position: relative !important;
  inset: auto !important;
  z-index: 90 !important;
  isolation: auto !important;
  -webkit-transform: none !important;
  transform: none !important;
  pointer-events: auto !important;
}

html.legacy-ipados-webkit .composer-frame {
  height: auto !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  grid-template-rows: auto auto !important;
  overflow: visible !important;
}

html.legacy-ipados-webkit .composer-workspace,
html.legacy-ipados-webkit .focused-chart-composer,
html.legacy-ipados-webkit .focused-paper-wrap {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

html.legacy-ipados-webkit .focused-paper-wrap {
  min-height: 62vh !important;
}

html.legacy-ipados-webkit .chord-keyboard button,
html.legacy-ipados-webkit .stage-note-panel button {
  min-height: 48px;
  touch-action: manipulation !important;
  pointer-events: auto !important;
  -webkit-user-select: none;
  user-select: none;
}

/* v252 iPadOS 16 preparation safe mode.
   The dedicated v234 preparation shell uses nested scroll/compositing layers
   that Safari 16.3 can retain as the hit-test surface above later controls.
   Restore the proven flat v224 page structure only on the affected iPad while
   keeping the current editor, chord, notation and save features. */
html.legacy-ipados-webkit .app-frame.legacy-preparation-safe {
  width: 100% !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  overflow: visible !important;
}

html.legacy-ipados-webkit .app-frame.legacy-preparation-safe > .context-panel,
html.legacy-ipados-webkit .app-frame.legacy-preparation-safe > .library-panel {
  display: none !important;
}

html.legacy-ipados-webkit .app-frame.legacy-preparation-safe > .workspace {
  grid-column: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  overflow: visible !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe .workspace-main {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding:
    12px
    max(16px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left)) !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe .prep-stage-editor.chart-mode {
  width: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe .prep-stage-editor.chart-mode .chart-scroll {
  position: static !important;
  z-index: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  display: block !important;
  overflow: visible !important;
  contain: none !important;
  isolation: auto !important;
  -webkit-overflow-scrolling: auto !important;
  -webkit-transform: none !important;
  transform: none !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe .prep-stage-editor.chart-mode .chart-paper {
  width: 100% !important;
  max-width: none !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe .chord-keyboard,
html.legacy-ipados-webkit .legacy-preparation-safe .stage-note-panel:not(.notation-expanded) {
  position: relative !important;
  inset: auto !important;
  z-index: auto !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  isolation: auto !important;
  -webkit-transform: none !important;
  transform: none !important;
}

/* v253 iPadOS 16 notation and media safe surfaces.
   Safari 16.3 can enter a cyclic layout/compositing pass when a size container
   with cqh units sits in an auto-height grid. Use fixed, ordinary blocks for
   the Pencil staff and postpone the canvas backing store until first contact. */
html.legacy-ipados-webkit .legacy-preparation-safe .stage-note-panel.stage-tool-notation:not(.notation-expanded) {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe .stage-note-panel.stage-tool-notation > header,
html.legacy-ipados-webkit .legacy-preparation-safe .stage-note-panel.stage-tool-notation .stage-tool-switch {
  position: relative !important;
  top: auto !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe .stage-notation-workspace,
html.legacy-ipados-webkit .legacy-preparation-safe .stage-notation-workspace .stage-staff-pad {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  contain: none !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe .stage-notation-workspace .stage-staff-title {
  min-height: 46px !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe .stage-notation-workspace .stage-staff-surface {
  width: 100% !important;
  height: 260px !important;
  min-height: 260px !important;
  max-height: 260px !important;
  container-type: normal !important;
  contain: none !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe .stage-notation-workspace .stage-clef {
  font-size: 6.25rem !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe .stage-notation-workspace .stage-ink-canvas {
  width: 100% !important;
  height: 100% !important;
  contain: none !important;
  touch-action: none !important;
}

html.legacy-ipados-webkit .preparation-visual-page,
html.legacy-ipados-webkit .preparation-media-canvas,
html.legacy-ipados-webkit .preparation-media-canvas .media-editor-preview {
  contain: none !important;
  isolation: auto !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* v255: restore the proven compact notation workspace on iPadOS 16.3.
   The drawing surface remains the lightweight vector implementation, while
   the toolbar, staff proportions and fixed-size clef follow the stable panel. */
html.legacy-ipados-webkit .legacy-preparation-safe.legacy-notation-page-active > .workspace {
  min-height: 100vh !important;
  min-height: 100svh !important;
  background: #070b0c !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe.legacy-notation-page-active .topbar {
  display: none !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe.legacy-notation-page-active .workspace-main {
  min-height: 100vh !important;
  min-height: 100svh !important;
  padding: 0 !important;
  overflow: visible !important;
}

.legacy-ipad-notation-page {
  box-sizing: border-box;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #070b0c;
  color: #f4fbfc;
  overflow: visible;
  contain: none;
  isolation: auto;
}

.legacy-note-page-header,
.legacy-note-toolbar,
.legacy-note-measure-nav,
.legacy-note-clef-row,
.legacy-note-ink-actions,
.legacy-note-page-footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legacy-note-page-header {
  justify-content: space-between;
  min-height: 58px;
  padding: 0 4px;
  border-bottom: 1px solid rgba(0, 216, 255, 0.2);
}

.legacy-note-page-header small {
  display: block;
  margin-bottom: 4px;
  color: #00d8ff;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.legacy-note-page-heading strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #f4fbfc;
  font-size: clamp(0.94rem, 2vw, 1.08rem);
}

.legacy-note-page-heading svg {
  width: 18px;
  height: 18px;
  color: #00d8ff;
}

.legacy-ipad-notation-page button {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid #344047;
  border-radius: 12px;
  background: #171d20;
  color: #f4fbfc;
  font: inherit;
  font-weight: 800;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.legacy-ipad-notation-page button svg {
  width: 20px;
  height: 20px;
}

.legacy-note-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legacy-ipad-notation-page button:disabled {
  opacity: 0.36;
}

.legacy-ipad-notation-page button.active,
.legacy-ipad-notation-page button[aria-pressed="true"] {
  border-color: #00d8ff;
  background: #06343d;
}

.legacy-note-toolbar {
  justify-content: space-between;
  min-height: 62px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 216, 255, 0.24);
  border-radius: 13px;
  background: rgba(5, 17, 20, 0.92);
}

.legacy-note-measure-nav {
  flex: 0 0 auto;
}

.legacy-note-measure-nav strong {
  font-size: 1.05rem;
}

.legacy-note-measure-nav strong span {
  color: #8fa0a5;
  font-size: 0.86rem;
}

.legacy-note-measure-nav button {
  min-width: 48px;
  padding: 0 12px;
}

.legacy-note-measure-nav button.next {
  gap: 5px;
}

.legacy-note-clef-row {
  justify-content: center;
  flex-wrap: wrap;
}

.legacy-note-clef-row > span {
  color: #93a4a9;
  font-size: 0.82rem;
  font-weight: 800;
}

.legacy-note-clef-row .clef-button {
  min-width: 96px;
  padding: 0 14px;
}

.legacy-note-clef-row .clef-symbol {
  margin-right: 7px;
  font-size: 1.35rem;
}

.legacy-note-ink-actions {
  flex: 0 0 auto;
}

.legacy-note-ink-actions button {
  width: 48px;
  min-width: 48px;
  padding: 0;
  display: grid;
  place-items: center;
}

.legacy-note-paper {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  height: clamp(320px, 52svh, 470px);
  min-height: 320px;
  max-height: 470px;
  overflow: hidden;
  border: 2px solid #d9d7cf;
  border-radius: 12px;
  background: #fbfaf4;
  color: #111;
}

.legacy-note-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  contain: none;
}

.legacy-note-paper-bg {
  fill: #fbfaf4;
}

.legacy-note-staff-line {
  stroke: #171817;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.legacy-note-clef {
  position: absolute;
  left: clamp(44px, 5vw, 72px);
  top: 50%;
  z-index: 1;
  display: block;
  transform: translateY(-50%);
  fill: #101110;
  font-family: Bravura, "Apple Symbols", "Times New Roman", serif;
  font-size: clamp(5.5rem, 10vw, 7.25rem);
  line-height: 1;
  color: #101110;
  pointer-events: none;
}

.legacy-note-paper[data-clef="bass"] .legacy-note-clef {
  font-size: clamp(4.2rem, 8vw, 5.8rem);
}

.legacy-note-paper[data-clef="alto"] .legacy-note-clef {
  font-size: clamp(4.7rem, 8.8vw, 6.4rem);
}

.legacy-note-stroke,
.legacy-note-live-stroke {
  fill: none;
  stroke: #050605;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.legacy-note-hint {
  position: absolute;
  right: 16px;
  top: 14px;
  color: #667073;
  font-size: 0.86rem;
  font-weight: 800;
  pointer-events: none;
}

.legacy-note-page-footer {
  justify-content: center;
  flex-wrap: wrap;
  min-height: 34px;
}

.legacy-note-page-footer span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9eaaae;
  font-size: 0.84rem;
  font-weight: 700;
}

.legacy-note-page-footer svg {
  width: 16px;
  height: 16px;
  color: #00d8ff;
}

/* v255: preparation notation expansion grows only the staff.
   The panel stays in its normal place and all surrounding editor controls keep
   their layout; closing the expansion restores the original 260px staff. */
.app-frame.preparation-workspace .preparation-note-panel.notation-expanded,
html.legacy-ipados-webkit .legacy-preparation-safe .preparation-note-panel.notation-expanded {
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  z-index: 20 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: 16px !important;
  overflow: visible !important;
  transform: none !important;
}

.app-frame.preparation-workspace .preparation-note-panel.notation-expanded .stage-notation-workspace,
html.legacy-ipados-webkit .legacy-preparation-safe .preparation-note-panel.notation-expanded .stage-notation-workspace {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

.app-frame.preparation-workspace .preparation-note-panel.notation-expanded .stage-staff-pad,
html.legacy-ipados-webkit .legacy-preparation-safe .preparation-note-panel.notation-expanded .stage-staff-pad {
  display: block !important;
  min-height: 0 !important;
}

.app-frame.preparation-workspace .preparation-note-panel.notation-expanded .stage-staff-surface,
html.legacy-ipados-webkit .legacy-preparation-safe .preparation-note-panel.notation-expanded .stage-staff-surface {
  width: 100% !important;
  height: clamp(420px, 62svh, 640px) !important;
  min-height: 420px !important;
  max-height: 640px !important;
  container-type: normal !important;
  contain: none !important;
}

.app-frame.preparation-workspace .preparation-note-panel.notation-expanded .stage-staff-surface[data-clef="treble"],
html.legacy-ipados-webkit .legacy-preparation-safe .preparation-note-panel.notation-expanded .stage-staff-surface[data-clef="treble"] {
  --stage-clef-size: clamp(6rem, 14vw, 8.5rem);
}

.app-frame.preparation-workspace .preparation-note-panel.notation-expanded .stage-staff-surface[data-clef="treble"] .stage-clef,
html.legacy-ipados-webkit .legacy-preparation-safe .preparation-note-panel.notation-expanded .stage-staff-surface[data-clef="treble"] .stage-clef {
  font-size: clamp(8rem, 18vw, 10rem) !important;
}

.app-frame.preparation-workspace .preparation-note-panel.notation-expanded .stage-staff-surface[data-clef="bass"],
html.legacy-ipados-webkit .legacy-preparation-safe .preparation-note-panel.notation-expanded .stage-staff-surface[data-clef="bass"] {
  --stage-clef-size: clamp(4.8rem, 11vw, 6.8rem);
}

.app-frame.preparation-workspace .preparation-note-panel.notation-expanded .stage-staff-surface[data-clef="bass"] .stage-clef,
html.legacy-ipados-webkit .legacy-preparation-safe .preparation-note-panel.notation-expanded .stage-staff-surface[data-clef="bass"] .stage-clef {
  font-size: clamp(6rem, 14vw, 8rem) !important;
}

.app-frame.preparation-workspace .preparation-note-panel.notation-expanded .stage-staff-surface[data-clef="alto"],
html.legacy-ipados-webkit .legacy-preparation-safe .preparation-note-panel.notation-expanded .stage-staff-surface[data-clef="alto"] {
  --stage-clef-size: clamp(5.3rem, 12vw, 7.4rem);
}

.app-frame.preparation-workspace .preparation-note-panel.notation-expanded .stage-staff-surface[data-clef="alto"] .stage-clef,
html.legacy-ipados-webkit .legacy-preparation-safe .preparation-note-panel.notation-expanded .stage-staff-surface[data-clef="alto"] .stage-clef {
  font-size: clamp(6.8rem, 16vw, 9rem) !important;
}

@media (max-width: 820px) {
  .legacy-ipad-notation-page {
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
    gap: 9px;
  }

  .legacy-note-page-header {
    min-height: 52px;
  }

  .legacy-note-close span,
  .legacy-note-measure-nav button.next span,
  .legacy-note-clef-row > span,
  .legacy-note-hint {
    display: none;
  }

  .legacy-note-toolbar {
    min-height: 56px;
    gap: 7px;
    padding: 6px;
  }

  .legacy-note-toolbar button {
    min-height: 46px;
  }

  .legacy-note-clef-row {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .legacy-note-clef-row .clef-button {
    min-width: 72px;
    padding: 0 9px;
  }

  .legacy-note-ink-actions {
    gap: 5px;
  }

  .legacy-note-ink-actions button {
    width: 46px;
    min-width: 46px;
  }

  .legacy-note-paper {
    height: clamp(310px, 55svh, 430px);
    min-height: 310px;
  }
}

.sheet-vector-ink-preview {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.sheet-vector-ink-stroke {
  fill: none;
  stroke: #050605;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

@media (max-width: 820px) {
  .legacy-ipad-notation-page {
    gap: 10px;
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .legacy-note-paper {
    min-height: 480px;
  }

  .legacy-note-page-header button,
  .legacy-note-measure-nav button {
    padding-inline: 12px;
  }

  .legacy-note-page-footer span {
    flex-basis: 100%;
    text-align: center;
  }
}

/* v256: iPadOS 16.3 lightweight Pencil save flow.
   Pencil movement only updates the visible vector canvas. Expensive PNG
   serialization, automatic persistence and measure re-rendering are deferred
   until the user explicitly taps the single save button. */
html.legacy-ipados-webkit .legacy-preparation-safe .stage-notation-toolbar {
  grid-template-columns: minmax(180px, 1fr) auto auto !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe .ipad-ink-save-row {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 7px;
  border-top: 1px solid rgba(0, 216, 255, 0.14);
}

html.legacy-ipados-webkit .legacy-preparation-safe .ipad-ink-save {
  min-width: 156px;
  min-height: 48px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-color: rgba(0, 216, 255, 0.48) !important;
  background: rgba(0, 216, 255, 0.1) !important;
  color: #eafcff !important;
  touch-action: manipulation !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe .ipad-ink-save.pending {
  border-color: #00d8ff !important;
  background: linear-gradient(180deg, #08b9d9, #087b91) !important;
  color: #fff !important;
  box-shadow: 0 0 20px rgba(0, 216, 255, 0.2);
}

html.legacy-ipados-webkit .legacy-preparation-safe .ipad-ink-save svg {
  width: 19px;
  height: 19px;
}

html.legacy-ipados-webkit .legacy-preparation-safe [data-stage-ink-save-status] {
  color: #91a5aa;
  font-size: 0.75rem;
  font-weight: 750;
}

html.legacy-ipados-webkit .legacy-preparation-safe .ipad-ink-save.pending + [data-stage-ink-save-status] {
  color: #67ecff;
}

@media (max-width: 820px) {
  html.legacy-ipados-webkit .legacy-preparation-safe .ipad-ink-save-row {
    justify-content: stretch;
  }

  html.legacy-ipados-webkit .legacy-preparation-safe .ipad-ink-save {
    flex: 1 1 auto;
  }
}

/* v257: native-feeling inline notation accordion for iPadOS 16.3.
   Nota Yaz no longer creates the large measure dialog on the affected iPad.
   It expands inside the existing preparation frame, directly below the
   compact toolbar, so WebKit does not have to build another hit-test layer. */
html.legacy-ipados-webkit .legacy-preparation-safe .keyboard-mode-switch
  [data-action="open-editor-notation"] {
  min-width: 154px;
}

html.legacy-ipados-webkit .legacy-preparation-safe .keyboard-mode-switch
  [data-action="open-editor-notation"] .trigger-chevron {
  width: 16px;
  height: 16px;
  margin-left: 3px;
  opacity: 0.8;
}

html.legacy-ipados-webkit .legacy-preparation-safe .ipad-inline-notation-accordion {
  position: relative !important;
  inset: auto !important;
  z-index: auto !important;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 10px 0 2px;
  border: 1px solid rgba(0, 216, 255, 0.46);
  border-radius: 14px;
  background: #070d0f;
  overflow: visible;
  contain: none;
  isolation: auto;
  -webkit-transform: none;
  transform: none;
  animation: none;
}

html.legacy-ipados-webkit .legacy-preparation-safe .ipad-inline-notation-accordion
  .stage-notation-workspace {
  width: 100%;
  min-width: 0;
  padding: 10px;
  background: transparent;
}

html.legacy-ipados-webkit .legacy-preparation-safe .ipad-inline-notation-accordion
  button {
  min-height: 46px !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe .ipad-inline-notation-accordion
  .stage-staff-surface {
  height: 260px !important;
  min-height: 260px !important;
  max-height: 260px !important;
  contain: none !important;
  container-type: normal !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe .ipad-inline-notation-accordion
  .stage-ink-canvas {
  width: 100% !important;
  height: 100% !important;
  touch-action: none !important;
  contain: none !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe
  .stage-note-panel.stage-tool-chord,
html.legacy-ipados-webkit .legacy-preparation-safe
  .stage-note-panel.stage-tool-chord:has(.stage-measure-details) {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  grid-template-rows: auto auto auto !important;
  overflow: visible !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe
  .stage-note-panel.stage-tool-chord .stage-chord-tool {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  overscroll-behavior: auto !important;
  -webkit-overflow-scrolling: auto !important;
}

html.legacy-ipados-webkit .legacy-preparation-safe
  .stage-note-panel .stage-core-chord-rows + .stage-measure-details {
  position: static !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin-top: 10px !important;
  overflow: visible !important;
  contain: none !important;
  animation: none !important;
}

@media (max-width: 820px) {
  html.legacy-ipados-webkit .legacy-preparation-safe .keyboard-mode-switch
    [data-action="open-editor-notation"] {
    min-width: 0;
  }

  html.legacy-ipados-webkit .legacy-preparation-safe .ipad-inline-notation-accordion {
    margin-top: 8px;
    border-radius: 12px;
  }

  html.legacy-ipados-webkit .legacy-preparation-safe .ipad-inline-notation-accordion
    .stage-notation-toolbar {
    grid-template-columns: 1fr !important;
  }

html.legacy-ipados-webkit .legacy-preparation-safe .ipad-inline-notation-accordion
    .notation-tool-row {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* v263: prominent, touch-friendly iPad browser fullscreen control. */
.browser-preview-toolbar .fullscreen-toggle {
  width: 64px !important;
  min-width: 64px !important;
  height: 64px !important;
  min-height: 64px !important;
  border: 2px solid rgba(0, 216, 255, 0.8) !important;
  border-radius: 16px !important;
  background:
    linear-gradient(145deg, rgba(0, 216, 255, 0.2), rgba(0, 216, 255, 0.08)),
    #071316 !important;
  color: #18dcff !important;
  box-shadow:
    0 0 0 1px rgba(0, 216, 255, 0.12),
    0 8px 24px rgba(0, 216, 255, 0.16) !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.browser-preview-toolbar .fullscreen-toggle svg {
  width: 36px !important;
  height: 36px !important;
  stroke-width: 2.65;
}

.browser-preview-toolbar .fullscreen-toggle:active,
.browser-preview-toolbar .fullscreen-toggle[aria-pressed="true"] {
  background:
    linear-gradient(145deg, rgba(0, 216, 255, 0.32), rgba(0, 216, 255, 0.14)),
    #071316 !important;
  box-shadow:
    0 0 0 2px rgba(0, 216, 255, 0.18),
    0 5px 18px rgba(0, 216, 255, 0.2) !important;
}

@media (max-width: 820px) {
  .browser-preview-toolbar .fullscreen-toggle {
    width: 60px !important;
    min-width: 60px !important;
    height: 60px !important;
    min-height: 60px !important;
    border-radius: 15px !important;
  }

  .browser-preview-toolbar .fullscreen-toggle svg {
    width: 34px !important;
    height: 34px !important;
  }
}

/* v264: edit the selected chart or uploaded visual without leaving Songs. */
.browser-song-editor-footer {
  max-height: min(310px, 44vh);
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  align-content: start;
  gap: 10px !important;
  overflow: auto;
  padding:
    12px
    max(14px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left)) !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 216, 255, 0.14), transparent 34%),
    rgba(3, 9, 11, 0.98) !important;
  text-align: left !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.browser-song-editor-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.browser-song-editor-heading > div:first-child {
  min-width: 0;
}

.browser-song-editor-heading span,
.browser-song-editor-heading strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-song-editor-heading span {
  padding: 0 !important;
  color: #00d8ff;
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.13em;
}

.browser-song-editor-heading strong {
  margin-top: 3px;
  color: #f7fdff;
  font-size: 1.08rem;
}

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

.browser-song-editor-actions button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(0, 216, 255, 0.34);
  border-radius: 11px;
  padding: 0 13px;
  background: rgba(0, 216, 255, 0.08);
  color: #e9fcff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
}

.browser-song-editor-actions button.primary {
  border-color: rgba(0, 216, 255, 0.82);
  background: linear-gradient(180deg, #00a9c2, #00798d);
  color: #fff;
}

.browser-song-editor-actions svg {
  width: 19px;
  height: 19px;
}

.browser-song-editor-fields {
  min-width: 0;
  display: grid;
  grid-template-columns:
    minmax(150px, 1.35fr)
    minmax(140px, 1.15fr)
    minmax(112px, 0.85fr)
    minmax(94px, 0.65fr)
    minmax(88px, 0.6fr)
    minmax(154px, 1fr);
  gap: 8px;
}

.browser-song-editor-fields .browser-footer-field {
  min-height: 64px;
  border: 1px solid rgba(0, 216, 255, 0.16);
  border-radius: 11px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.035);
}

.browser-song-editor-fields .browser-footer-field:last-child {
  border-right: 1px solid rgba(0, 216, 255, 0.16);
}

.browser-song-editor-fields .browser-footer-number {
  grid-template-columns: minmax(52px, 1fr) auto;
}

.browser-song-editor-fields .browser-footer-tonality {
  grid-template-columns: minmax(50px, 0.65fr) minmax(78px, 1fr);
}

.browser-playlist-picker > header .browser-playlist-done {
  width: auto;
  min-width: 84px;
  display: inline-flex;
  gap: 7px;
  padding: 0 13px;
  color: #e9fcff;
  font-weight: 900;
}

.browser-playlist-picker > header .browser-playlist-done span {
  margin: 0;
  color: inherit;
  font-size: 0.82rem;
  letter-spacing: normal;
  text-transform: none;
}

@media (max-width: 1100px) {
  .browser-song-editor-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .browser-song-editor-footer {
    max-height: min(360px, 48vh);
  }
}

@media (max-width: 720px) {
  .browser-song-editor-heading {
    align-items: flex-start;
  }

  .browser-song-editor-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .browser-song-editor-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .browser-song-editor-footer {
    max-height: min(430px, 58vh);
  }

  .browser-editor-title,
  .browser-editor-artist {
    grid-column: 1 / -1;
  }
}

/* v268: Songs Edit uses the preparation-style chord, notation and measure
   workspace only. Metadata fields stay out of this flow; the working copy is
   kept as a recoverable draft until the explicit Save action. */
.browser-song-editor-footer.content-editor-open {
  height: min(76vh, 760px);
  max-height: min(76vh, 760px);
  grid-template-rows: auto minmax(0, 1fr) !important;
}

.browser-song-editor-footer.content-editor-open .browser-song-editor-heading {
  position: sticky;
  top: -12px;
  z-index: 8;
  margin: -12px -14px 0;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(0, 216, 255, 0.2);
  background: rgba(3, 9, 11, 0.98);
}

.browser-song-editor-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.browser-song-editor-actions .browser-song-draft-note {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px !important;
  border: 1px solid rgba(0, 216, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 216, 255, 0.07);
  color: rgba(226, 250, 253, 0.72);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: normal;
  text-transform: none;
}

.browser-song-draft-note svg {
  width: 17px;
  height: 17px;
  color: #00d8ff;
}

.browser-song-editor-actions button.active {
  border-color: rgba(0, 216, 255, 0.92);
  background: linear-gradient(180deg, rgba(0, 216, 255, 0.28), rgba(0, 121, 141, 0.18));
  box-shadow: inset 0 0 0 1px rgba(0, 216, 255, 0.14), 0 0 20px rgba(0, 216, 255, 0.12);
}

.browser-song-content-editor {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid rgba(0, 216, 255, 0.22);
  border-radius: 14px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(0, 216, 255, 0.055), transparent 120px),
    rgba(2, 8, 10, 0.72);
}

.browser-song-content-editor > header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.browser-song-content-editor > header div {
  min-width: 0;
}

.browser-song-content-editor > header span,
.browser-song-content-editor > header strong {
  display: block;
}

.browser-song-content-editor > header span {
  color: #00d8ff;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.13em;
}

.browser-song-content-editor > header strong {
  margin-top: 3px;
  color: #f7fdff;
  font-size: 0.98rem;
}

.browser-song-content-editor > header p {
  max-width: 520px;
  margin: 0;
  color: rgba(223, 238, 241, 0.64);
  font-size: 0.76rem;
  line-height: 1.35;
  text-align: right;
}

.browser-song-content-editor .chord-keyboard {
  width: 100%;
  min-width: 0;
  margin: 0;
  border-radius: 12px;
  box-shadow: none;
}

.browser-song-content-editor .browser-song-note-panel,
.browser-song-content-editor .browser-song-note-panel:not(.collapsed) {
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: min(58vh, 590px) !important;
  margin: 0 !important;
  transform: none !important;
  border-radius: 12px !important;
  z-index: 4 !important;
}

.browser-song-content-editor .browser-song-note-panel.stage-tool-chord:has(.stage-measure-details):not(.collapsed) {
  height: min(58vh, 590px) !important;
}

.browser-song-content-editor .browser-song-note-panel.notation-expanded:not(.collapsed) {
  height: min(64vh, 640px) !important;
  max-height: min(64vh, 640px) !important;
}

@media (max-width: 1100px) {
  .browser-song-editor-footer.content-editor-open {
    height: min(78vh, 720px);
    max-height: min(78vh, 720px);
  }

  .browser-song-content-editor > header {
    align-items: flex-start;
  }

  .browser-song-content-editor > header p {
    max-width: 46%;
  }
}

@media (max-width: 720px) {
  .browser-song-editor-footer.content-editor-open .browser-song-editor-heading {
    align-items: center;
  }

  .browser-song-editor-actions .browser-song-draft-note {
    min-height: 44px;
  }

  .browser-song-content-editor > header {
    display: block;
  }

  .browser-song-content-editor > header p {
    max-width: none;
    margin-top: 5px;
    text-align: left;
  }
}

/* v264: compact enharmonic transpose controls for iPad and small laptops. */
@media (max-width: 1180px) {
  .browser-preview-shell:not(.preview-expanded) .browser-preview-toolbar {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) !important;
    gap: 10px;
  }

  .browser-preview-shell:not(.preview-expanded) .browser-toolbar-title {
    display: none;
  }

  .browser-preview-shell:not(.preview-expanded) .browser-preview-left {
    grid-column: 1;
    gap: 8px;
  }

  .browser-preview-shell:not(.preview-expanded) .browser-preview-right {
    min-width: 0;
    grid-column: 2;
    gap: 8px;
  }
}

@media (max-width: 820px) {
  .browser-preview-shell:not(.preview-expanded) .browser-transpose-tools {
    grid-template-columns: 34px 32px minmax(62px, 86px) 32px 34px;
  }

  .browser-preview-shell:not(.preview-expanded) .transpose-step,
  .browser-preview-shell:not(.preview-expanded) .transpose-accidental {
    min-width: 32px;
  }

  .browser-preview-shell:not(.preview-expanded) .transpose-key-label {
    font-size: 0.78rem;
  }
}

/* v269: iReal-style single-line measure engraving.
   Every chord stays on the same rhythmic row. Dense measures use equal slots
   and the fitted scale calculated from the real measure width instead of
   creating a second chord row. */
.chart-measure .sheet-chords,
.chart-measure.chord-density-tight .sheet-chords,
.chart-measure.chord-density-dense .sheet-chords,
.chart-measure.chord-density-packed .sheet-chords,
.chart-measure.notation-with-chords .sheet-chords {
  display: grid !important;
  grid-auto-flow: column !important;
  grid-template-columns: none !important;
  grid-template-rows: minmax(0, 1fr) !important;
  grid-auto-columns: minmax(0, 1fr) !important;
  align-items: center !important;
  align-content: center !important;
  justify-items: center !important;
  row-gap: 0 !important;
  overflow: hidden;
  white-space: nowrap;
}

.chart-measure .sheet-chords > .chord-symbol,
.chart-measure .sheet-chords > .repeat-symbol,
.chart-measure .sheet-chords > .double-bar {
  transform: scale(var(--measure-fit-scale, 1)) !important;
  transform-origin: center center !important;
}

/* v270: Songs > Edit is the same document-flow workspace as Preparation.
   The score stays above the complete Akor / Ölçü Detayları / Nota tool row;
   no fixed footer or empty black spacer separates the selected measure from
   its controls. */
.browser-preview-shell.browser-preparation-edit {
  min-height: 100vh;
  max-height: none;
  grid-template-rows: auto auto auto auto !important;
  align-content: start;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: #0b0f10;
}

.browser-preparation-edit .browser-chart-area {
  height: clamp(300px, 48dvh, 560px);
  min-height: clamp(300px, 48dvh, 560px);
  max-height: clamp(300px, 48dvh, 560px);
  place-items: start center;
  overflow: auto;
  padding: clamp(10px, 1.4vw, 20px);
  background: #1d2023;
}

.browser-preparation-edit .browser-chart-wrap {
  width: min(1180px, 100%) !important;
  height: auto !important;
  min-height: 100%;
  display: block;
}

.browser-preparation-edit .browser-chart-wrap .chart-paper.preview-paper {
  width: 100% !important;
  height: max-content !important;
  min-height: 100% !important;
  max-height: none !important;
  margin: 0 auto !important;
}

.browser-preparation-edit .browser-chart-wrap .chart-measure {
  cursor: pointer;
}

.browser-preparation-edit .browser-chart-wrap .chart-measure.selected {
  background: rgba(0, 180, 164, 0.12) !important;
  outline: 2px solid rgba(0, 160, 148, 0.82) !important;
  outline-offset: -2px;
}

.browser-preparation-edit .browser-song-editor-footer.content-editor-open {
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  z-index: 20;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  grid-template-rows: auto auto !important;
  overflow: visible !important;
  border-top: 1px solid rgba(0, 216, 255, 0.28);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.browser-preparation-edit .browser-song-content-editor {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.browser-preparation-edit .browser-song-content-editor .chord-keyboard {
  position: relative !important;
  inset: auto !important;
  z-index: 30 !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  transform: none !important;
  isolation: isolate;
  pointer-events: auto !important;
}

.browser-preparation-edit .browser-song-content-editor .browser-song-note-panel,
.browser-preparation-edit .browser-song-content-editor .browser-song-note-panel:not(.collapsed) {
  position: relative !important;
  inset: auto !important;
  z-index: 24 !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  transform: none !important;
  pointer-events: auto !important;
}

@media (orientation: landscape) and (max-height: 820px) {
  .browser-preparation-edit .browser-chart-area {
    height: clamp(240px, 39dvh, 320px);
    min-height: clamp(240px, 39dvh, 320px);
    max-height: clamp(240px, 39dvh, 320px);
  }
}

@media (max-width: 820px) {
  .app-frame.library-mode-songs .browser-preview-shell.browser-preparation-edit {
    height: auto;
    min-height: 100vh;
    max-height: none;
    overflow-y: auto !important;
  }

  .browser-preparation-edit .browser-song-editor-heading {
    align-items: center;
  }
}
